@prisma/composer 0.39.0-dev.4 → 0.39.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/control.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
- import { a as executionDiagnostics, i as devUrl, l as notOk, n as dev, o as executorLoadFailure, r as devStop, t as deploy } from "./dev-current-Ce4Zhfiy-TY0NjkOZ.mjs";
2
+ import { a as executionDiagnostics, i as devUrl, l as notOk, n as dev, o as executorLoadFailure, r as devStop, t as deploy } from "./dev-current-Dp3jvXGN-C1Y2BAtC.mjs";
3
3
  import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-CmBz2-xc-Cc8rV1CX.mjs";
4
4
  //#region ../../0-framework/3-tooling/cli/dist/control.mjs
5
5
  /**
@@ -21,7 +21,7 @@ async function destroyWithDeps(input, deps) {
21
21
  const cwd = input.cwd ?? process.cwd();
22
22
  let executor;
23
23
  try {
24
- executor = await import("./execute-deploy-destroy-D2Ok1xun-DuY58xzA.mjs");
24
+ executor = await import("./execute-deploy-destroy-J0buFSWK-BhVTX4-E.mjs");
25
25
  } catch (error) {
26
26
  return notOk(executorLoadFailure("destroy", error));
27
27
  }
@@ -43,7 +43,7 @@ async function logWithDeps(input, deps) {
43
43
  const cwd = input.cwd ?? process.cwd();
44
44
  let executor;
45
45
  try {
46
- executor = await import("./execute-log-CEH820Un-i9u7t1Bw.mjs");
46
+ executor = await import("./execute-log-BcmA2gDv-CPrOZtEh.mjs");
47
47
  } catch (error) {
48
48
  return notOk(executorLoadFailure("log", error));
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import { c as executionDiagnostics, l as executorLoadFailure, n as devUrl, o as deploy, r as dev, t as devStop } from \"./dev-current-Ce4Zhfiy.mjs\";\nimport { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from \"./run-report-CmBz2-xc.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/destroy.ts\n/**\n* The programmatic `destroy` operation (`@prisma/composer/control`): typed\n* input, structured result, no argv, no console, no process.exit. No CLI\n* command wraps it. The executor\n* loads lazily, so importing this module executes nothing; an executor that\n* fails to load comes back as a structured failure, never a throw out of\n* the host.\n*/\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* 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\tif (typeof input.environment !== \"string\" || input.environment.length === 0) return notOk(environmentRequired());\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-D2Ok1xun.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\nfunction environmentRequired() {\n\treturn new CliStructuredError(\"DEPLOY.ENVIRONMENT_REQUIRED\", \"destroy needs the name of the environment to destroy.\", {\n\t\twhy: \"Destroy never defaults to production, so a call without a name has no target.\",\n\t\tfix: \"Pass `environment`, for example `destroy({ environment: 'staging', config })`.\"\n\t});\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, for the unit tests.\n* 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-CEH820Un.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl, executionDiagnostics, log };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,WAAW,GAAG,OAAO,MAAM,oBAAoB,CAAC;CAC/G,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;AACA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,+BAA+B,yDAAyD;EACrH,KAAK;EACL,KAAK;CACN,CAAC;AACF;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C"}
1
+ {"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import { c as executionDiagnostics, l as executorLoadFailure, n as devUrl, o as deploy, r as dev, t as devStop } from \"./dev-current-Dp3jvXGN.mjs\";\nimport { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from \"./run-report-CmBz2-xc.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/destroy.ts\n/**\n* The programmatic `destroy` operation (`@prisma/composer/control`): typed\n* input, structured result, no argv, no console, no process.exit. No CLI\n* command wraps it. The executor\n* loads lazily, so importing this module executes nothing; an executor that\n* fails to load comes back as a structured failure, never a throw out of\n* the host.\n*/\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* 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\tif (typeof input.environment !== \"string\" || input.environment.length === 0) return notOk(environmentRequired());\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-J0buFSWK.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\nfunction environmentRequired() {\n\treturn new CliStructuredError(\"DEPLOY.ENVIRONMENT_REQUIRED\", \"destroy needs the name of the environment to destroy.\", {\n\t\twhy: \"Destroy never defaults to production, so a call without a name has no target.\",\n\t\tfix: \"Pass `environment`, for example `destroy({ environment: 'staging', config })`.\"\n\t});\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, for the unit tests.\n* 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-BcmA2gDv.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl, executionDiagnostics, log };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,WAAW,GAAG,OAAO,MAAM,oBAAoB,CAAC;CAC/G,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;AACA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,+BAA+B,yDAAyD;EACrH,KAAK;EACL,KAAK;CACN,CAAC;AACF;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C"}
@@ -88,7 +88,7 @@ function okVoid() {
88
88
  return OK_VOID;
89
89
  }
90
90
  //#endregion
91
- //#region ../../0-framework/3-tooling/cli/dist/dev-current-Ce4Zhfiy.mjs
91
+ //#region ../../0-framework/3-tooling/cli/dist/dev-current-Dp3jvXGN.mjs
92
92
  /**
93
93
  * Reads the execution diagnostics an engine-failure error carries in
94
94
  * `meta.diagnostics`; undefined for every other failure.
@@ -161,7 +161,7 @@ async function deployWithDeps(input, deps) {
161
161
  const cwd = input.cwd ?? process.cwd();
162
162
  let executor;
163
163
  try {
164
- executor = await import("./execute-deploy-destroy-D2Ok1xun-DuY58xzA.mjs");
164
+ executor = await import("./execute-deploy-destroy-J0buFSWK-BhVTX4-E.mjs");
165
165
  } catch (error) {
166
166
  return notOk(executorLoadFailure("deploy", error));
167
167
  }
@@ -182,7 +182,7 @@ async function devWithDeps(input, deps) {
182
182
  const cwd = input.cwd ?? process.cwd();
183
183
  let executor;
184
184
  try {
185
- executor = await import("./execute-dev-BBPgDWzf-BCSle0Mw.mjs");
185
+ executor = await import("./execute-dev-B5YaMqpD-BAxU6Smm.mjs");
186
186
  } catch (error) {
187
187
  return notOk(executorLoadFailure("dev", error));
188
188
  }
@@ -190,7 +190,7 @@ async function devWithDeps(input, deps) {
190
190
  }
191
191
  async function loadExecutor(operation) {
192
192
  try {
193
- return ok(await import("./execute-dev-current-DNIwPfcW-uOHywz_h.mjs"));
193
+ return ok(await import("./execute-dev-current-C7le-kh2-BoUej3LZ.mjs"));
194
194
  } catch (error) {
195
195
  return notOk(executorLoadFailure(operation, error));
196
196
  }
@@ -210,4 +210,4 @@ async function devStop(input) {
210
210
  //#endregion
211
211
  export { executionDiagnostics as a, toStructured as c, okVoid as d, devUrl as i, notOk as l, dev as n, executorLoadFailure as o, devStop as r, requireContainerForEnvironment as s, deploy as t, ok as u };
212
212
 
213
- //# sourceMappingURL=dev-current-Ce4Zhfiy-TY0NjkOZ.mjs.map
213
+ //# sourceMappingURL=dev-current-Dp3jvXGN-C1Y2BAtC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev-current-Ce4Zhfiy-TY0NjkOZ.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.mjs","../../../0-framework/3-tooling/cli/dist/dev-current-Ce4Zhfiy.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\nconst RUN_OF = {\n\tdeploy: {\n\t\trunning: \"this deploy\",\n\t\truns: \"the deploy\"\n\t},\n\tdestroy: {\n\t\trunning: \"this destroy\",\n\t\truns: \"the destroy\"\n\t},\n\tdev: {\n\t\trunning: \"`prisma dev`\",\n\t\truns: \"`prisma dev`\"\n\t}\n};\n/**\n* An extension older than this Composer stores the input it is given but\n* resolves from a key without `environment`, so it may read every name as\n* production, or, locally, put every environment in one copy. Its\n* `deserialize` rebuilds only the fields it knows, so the container the\n* Alchemy child rebuilds shows which environment it really resolved.\n* Refusing here keeps a mismatched install from deploying into, destroying\n* or running the wrong place.\n*/\nfunction requireContainerForEnvironment(action, extensionId, descriptor, instance, environment) {\n\tlet rebuiltEnvironment;\n\ttry {\n\t\trebuiltEnvironment = descriptor.deserialize(instance.serialize()).input.environment;\n\t} catch {\n\t\trebuiltEnvironment = void 0;\n\t}\n\tif (rebuiltEnvironment === environment) return;\n\tconst { running, runs } = RUN_OF[action];\n\tthrow new CliStructuredError(\"DEPS.EXTENSION_INCOMPATIBLE\", `The extension ${extensionId} is older than the Composer running ${running}, so it would not resolve the environment ${environment}.`, { fix: `Install the same Composer version of ${extensionId} as the Composer that runs ${runs}.` });\n}\n//#endregion\n//#region src/operations/deploy.ts\n/** The environment `deploy` targets when none is named. */\nconst DEFAULT_DEPLOY_ENVIRONMENT = \"production\";\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. 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 startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-D2Ok1xun.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\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, which the family's\n* commands and the unit tests use. 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-BBPgDWzf.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev-current.ts\nasync function loadExecutor(operation) {\n\ttry {\n\t\treturn ok(await import(\"./execute-dev-current-DNIwPfcW.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` runs locally in the environment. */\nasync function devUrl(input) {\n\tconst executor = await loadExecutor(\"dev url\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevUrl(input, input.cwd ?? process.cwd());\n}\n/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */\nasync function devStop(input) {\n\tconst executor = await loadExecutor(\"dev stop\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevStop(input, input.cwd ?? process.cwd());\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT as a, executionDiagnostics as c, toStructured as d, devWithDeps as i, executorLoadFailure as l, devUrl as n, deploy as o, dev as r, deployWithDeps as s, devStop as t, requireContainerForEnvironment as u };\n\n//# sourceMappingURL=dev-current-Ce4Zhfiy.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAI,aAAa,MAAM,WAAW;CACjC;CACA;CACA;CACA,YAAY,IAAI,gBAAgB;EAC/B,KAAK,KAAK;EACV,IAAI,IAAI,KAAK,SAAS,UAAU,cAAc;OACzC,KAAK,WAAW,UAAU,cAAc;EAC7C,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,qCAAqC;EAC3E,OAAO,KAAK;CACb;CACA,IAAI,UAAU;EACb,IAAI,KAAK,IAA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eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;AAGA,eAAe,aAAa,WAAW;CACtC,IAAI;EACH,OAAO,GAAG,MAAM,OAAO,8CAAqC;CAC7D,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;AACD;;AAEA,eAAe,OAAO,OAAO;CAC5B,MAAM,WAAW,MAAM,aAAa,SAAS;CAC7C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,cAAc,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACtE;;AAEA,eAAe,QAAQ,OAAO;CAC7B,MAAM,WAAW,MAAM,aAAa,UAAU;CAC9C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,eAAe,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACvE"}
1
+ {"version":3,"file":"dev-current-Dp3jvXGN-C1Y2BAtC.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.mjs","../../../0-framework/3-tooling/cli/dist/dev-current-Dp3jvXGN.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\nconst RUN_OF = {\n\tdeploy: {\n\t\trunning: \"this deploy\",\n\t\truns: \"the deploy\"\n\t},\n\tdestroy: {\n\t\trunning: \"this destroy\",\n\t\truns: \"the destroy\"\n\t},\n\tdev: {\n\t\trunning: \"`prisma dev`\",\n\t\truns: \"`prisma dev`\"\n\t}\n};\n/**\n* An extension older than this Composer stores the input it is given but\n* resolves from a key without `environment`, so it may read every name as\n* production, or, locally, put every environment in one copy. Its\n* `deserialize` rebuilds only the fields it knows, so the container the\n* Alchemy child rebuilds shows which environment it really resolved.\n* Refusing here keeps a mismatched install from deploying into, destroying\n* or running the wrong place.\n*/\nfunction requireContainerForEnvironment(action, extensionId, descriptor, instance, environment) {\n\tlet rebuiltEnvironment;\n\ttry {\n\t\trebuiltEnvironment = descriptor.deserialize(instance.serialize()).input.environment;\n\t} catch {\n\t\trebuiltEnvironment = void 0;\n\t}\n\tif (rebuiltEnvironment === environment) return;\n\tconst { running, runs } = RUN_OF[action];\n\tthrow new CliStructuredError(\"DEPS.EXTENSION_INCOMPATIBLE\", `The extension ${extensionId} is older than the Composer running ${running}, so it would not resolve the environment ${environment}.`, { fix: `Install the same Composer version of ${extensionId} as the Composer that runs ${runs}.` });\n}\n//#endregion\n//#region src/operations/deploy.ts\n/** The environment `deploy` targets when none is named. */\nconst DEFAULT_DEPLOY_ENVIRONMENT = \"production\";\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. 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 startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-J0buFSWK.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\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, which the family's\n* commands and the unit tests use. 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-B5YaMqpD.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev-current.ts\nasync function loadExecutor(operation) {\n\ttry {\n\t\treturn ok(await import(\"./execute-dev-current-C7le-kh2.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` runs locally in the environment. */\nasync function devUrl(input) {\n\tconst executor = await loadExecutor(\"dev url\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevUrl(input, input.cwd ?? process.cwd());\n}\n/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */\nasync function devStop(input) {\n\tconst executor = await loadExecutor(\"dev stop\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevStop(input, input.cwd ?? process.cwd());\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT as a, executionDiagnostics as c, toStructured as d, devWithDeps as i, executorLoadFailure as l, devUrl as n, deploy as o, dev as r, deployWithDeps as s, devStop as t, requireContainerForEnvironment as u };\n\n//# sourceMappingURL=dev-current-Dp3jvXGN.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAI,aAAa,MAAM,WAAW;CACjC;CACA;CACA;CACA,YAAY,IAAI,gBAAgB;EAC/B,KAAK,KAAK;EACV,IAAI,IAAI,KAAK,SAAS,UAAU,cAAc;OACzC,KAAK,WAAW,UAAU,cAAc;EAC7C,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,qCAAqC;EAC3E,OAAO,KAAK;CACb;CACA,IAAI,UAAU;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,oCAAoC;EACzE,OAAO,KAAK;CACb;;;;CAIA,OAAO,GAAG,OAAO;EAChB,OAAO,UAAU,IAAI,WAAW,MAAM,KAAK,CAAC;CAC7C;;;;CA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O,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;AAGA,eAAe,aAAa,WAAW;CACtC,IAAI;EACH,OAAO,GAAG,MAAM,OAAO,8CAAqC;CAC7D,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;AACD;;AAEA,eAAe,OAAO,OAAO;CAC5B,MAAM,WAAW,MAAM,aAAa,SAAS;CAC7C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,cAAc,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACtE;;AAEA,eAAe,QAAQ,OAAO;CAC7B,MAAM,WAAW,MAAM,aAAa,UAAU;CAC9C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,eAAe,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACvE"}
@@ -5,7 +5,7 @@ import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
5
5
  import { o as preflightEnvVarName, t as containerEnv } from "./preflight-transport-C7_3abXW-Bza_hn9G.mjs";
6
6
  import { i as prepareSecondProcess, o as refuseSecretsInRootInput, s as removeLeftoverAppConfigurationFiles, t as deployAppConfigurationFile } from "./app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs";
7
7
  import "./deploy-NArSOken.mjs";
8
- import { c as toStructured, d as okVoid, l as notOk, s as requireContainerForEnvironment, u as ok } from "./dev-current-Ce4Zhfiy-TY0NjkOZ.mjs";
8
+ import { c as toStructured, d as okVoid, l as notOk, s as requireContainerForEnvironment, u as ok } from "./dev-current-Dp3jvXGN-C1Y2BAtC.mjs";
9
9
  import { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from "./run-report-CmBz2-xc-Cc8rV1CX.mjs";
10
10
  import { c as redactThrown, l as redactUnsetPlatformVariable, n as StreamRedactor, o as redactError, r as credentialLookingValues, s as redactSummary, t as SecretRedaction } from "./redaction-CjMYXtGp-CEQ5z1PK.mjs";
11
11
  import { a as readEngineFailureCause, i as engineFailureFilePath, n as capFailureCause, o as toDeploymentSummary, s as withComposerAdvice, t as DEPLOYMENT_RESULT_FILE_ENV } from "./deployment-summary-YP7eMPJI-CQsj7BHh.mjs";
@@ -16,8 +16,8 @@ import * as path$1 from "node:path";
16
16
  import * as fs$1 from "node:fs";
17
17
  import { pathToFileURL } from "node:url";
18
18
  import { randomUUID } from "node:crypto";
19
- //#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-D2Ok1xun.mjs
20
- var version = "0.39.0-dev.4";
19
+ //#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-J0buFSWK.mjs
20
+ var version = "0.39.0-dev.5";
21
21
  const ENTRY = "@prisma/composer/internal/converge";
22
22
  const CONTRACT_ENTRY = "@prisma/composer/internal/converge-contract";
23
23
  /** The Composer version this host runs; every Composer package carries the same one. */
@@ -799,4 +799,4 @@ async function convergeDeploy(opts, pipeline, entry, resolved) {
799
799
  //#endregion
800
800
  export { executeDeploy, executeDestroy };
801
801
 
802
- //# sourceMappingURL=execute-deploy-destroy-D2Ok1xun-DuY58xzA.mjs.map
802
+ //# sourceMappingURL=execute-deploy-destroy-J0buFSWK-BhVTX4-E.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute-deploy-destroy-D2Ok1xun-DuY58xzA.mjs","names":["fs","path"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-D2Ok1xun.mjs"],"sourcesContent":["import { i as runPipeline, t as validateEnvironmentName } from \"./validate-environment-XwVDifWN.mjs\";\nimport { i as noComposerExportMessage } from \"./composer-config-QKdY85G-.mjs\";\nimport { c as redactSummary, i as credentialLookingValues, l as redactThrown, n as SecretRedaction, r as StreamRedactor, s as redactError, u as redactUnsetPlatformVariable } from \"./redaction-CjMYXtGp.mjs\";\nimport { a as readEngineFailureCause, i as engineFailureFilePath, n as capFailureCause, o as toDeploymentSummary, s as withComposerAdvice, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-YP7eMPJI.mjs\";\nimport { i as prepareSecondProcess, o as removeLeftoverAppConfigurationFiles, s as refuseSecretsInRootInput, t as deployAppConfigurationFile } from \"./app-configuration-file-Bbfq5PR3.mjs\";\nimport { d as toStructured, u as requireContainerForEnvironment } from \"./dev-current-Ce4Zhfiy.mjs\";\nimport { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from \"./run-report-CmBz2-xc.mjs\";\nimport \"./converge-contract-BjDlHXVU.mjs\";\nimport { i as spawnAlchemy, n as alchemyInvocation, r as reproduceCommand } from \"./run-alchemy-BlYyc4Oh.mjs\";\nimport { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { nodeAddresses, secretsKeys } from \"@internal/core/deploy\";\nimport { CliStructuredError, InternalError } from \"@internal/foundation/errors\";\nimport { pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { containerEnv, preflightEnvVarName } from \"@internal/core/config\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { randomUUID } from \"node:crypto\";\n//#region package.json\nvar version = \"0.39.0-dev.4\";\n//#endregion\n//#region src/app-converge.ts\nconst ENTRY = \"@prisma/composer/internal/converge\";\nconst CONTRACT_ENTRY = \"@prisma/composer/internal/converge-contract\";\n/** The Composer version this host runs; every Composer package carries the same one. */\nconst HOST_COMPOSER_VERSION = version;\nfunction unresolvable(appDir, detail, cause) {\n\treturn new CliStructuredError(\"DEPS.CONVERGE_UNRESOLVABLE\", `Could not load the converge from the app's @prisma/composer in \"${appDir}\": ${detail}`, {\n\t\twhy: \"`prisma deploy` runs the lowering and Alchemy from the app's own install of @prisma/composer, so the app, its extensions and Alchemy share one copy of alchemy.\",\n\t\tfix: \"Install @prisma/composer in the app, at the same version as the Composer the `prisma` CLI runs.\",\n\t\t...cause === void 0 ? {} : { cause }\n\t});\n}\nfunction installedVersion(require) {\n\ttry {\n\t\tconst parsed = JSON.parse(fs.readFileSync(require.resolve(\"@prisma/composer/package.json\"), \"utf8\"));\n\t\treturn typeof parsed === \"object\" && parsed !== null && \"version\" in parsed && typeof parsed.version === \"string\" ? parsed.version : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\nasync function importFile(appDir, file) {\n\ttry {\n\t\treturn await import(pathToFileURL(file).href);\n\t} catch (error) {\n\t\tthrow unresolvable(appDir, `${file} failed to load: ${error instanceof Error ? error.message : String(error)}`, error);\n\t}\n}\nfunction contractMismatch(host, app) {\n\tconst appVersion = app.version ?? \"an unknown version\";\n\tconst update = app.contract < host.contract ? `Upgrade the app's @prisma/composer to a release that speaks converge contract ${host.contract}, such as ${host.version}.` : `Upgrade the \\`prisma\\` CLI to one that runs a Composer speaking converge contract ${app.contract}, such as ${appVersion}.`;\n\treturn new CliStructuredError(\"DEPS.CONVERGE_CONTRACT_MISMATCH\", `The app's @prisma/composer ${appVersion} speaks converge contract ${app.contract}, and the \\`prisma\\` CLI's Composer ${host.version} speaks contract ${host.contract}.`, {\n\t\twhy: \"Deploy calls the app's @prisma/composer from the CLI's Composer, and the two read each other's data only when they speak the same converge contract.\",\n\t\tfix: update\n\t});\n}\n/**\n* The app's `lower` and converge, from the install `appDir` resolves. Reads the app's\n* converge contract before loading anything else. Raises\n* DEPS.CONVERGE_UNRESOLVABLE when the install is missing or predates the\n* in-process converge, and DEPS.CONVERGE_CONTRACT_MISMATCH when it speaks\n* another contract than `host`.\n*/\nasync function loadAppConvergeEntry(appDir, host = {\n\tcontract: 2,\n\tversion: HOST_COMPOSER_VERSION\n}) {\n\tconst require = createRequire(path.join(appDir, \"package.json\"));\n\tlet contractFile;\n\tlet file;\n\ttry {\n\t\tcontractFile = require.resolve(CONTRACT_ENTRY);\n\t\tfile = require.resolve(ENTRY);\n\t} catch (error) {\n\t\tthrow unresolvable(appDir, `${CONTRACT_ENTRY} or ${ENTRY} does not resolve.`, error);\n\t}\n\tconst { CONVERGE_CONTRACT: appContract } = await importFile(appDir, contractFile);\n\tif (typeof appContract !== \"number\") throw unresolvable(appDir, `${contractFile} exports no CONVERGE_CONTRACT.`);\n\tif (appContract !== host.contract) throw contractMismatch(host, {\n\t\tcontract: appContract,\n\t\tversion: installedVersion(require)\n\t});\n\tconst { lower: appLower, convergeInProcess } = await importFile(appDir, file);\n\tif (typeof appLower !== \"function\" || typeof convergeInProcess !== \"function\") throw unresolvable(appDir, `${file} exports no lower and convergeInProcess.`);\n\treturn blindCast({\n\t\tlower: appLower,\n\t\tconverge: convergeInProcess\n\t});\n}\n//#endregion\n//#region src/generate-stack.ts\n/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */\nconst GENERATED_DIR = \".prisma-composer\";\nconst GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/alchemy.run.ts` to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(` environment: ${quote(input.environment)},`);\n\tlines.push(\" appConfigurationRead: file.appConfigurationRead,\");\n\tlines.push(\" firstProcessNodeAddresses: file.nodeAddresses,\");\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tlines.push(\" report: report.deploymentReport,\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the stack module's source (tests assert on it without touching disk) — uses `//` headers, not a block comment, since a cwd path with a star-slash could close one early. */\nfunction renderStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst configImport = relativeImportSpecifier(generatedDir, input.configFile);\n\treturn `// Generated by Composer's deploy and destroy operations — overwritten on every\n// run; do not edit by hand. Runnable from ${quote(input.cwd)} WITH the env the\n// CLI passes its child (the PRISMA_COMPOSER_CONTAINER_*/_PREFLIGHT_* vars and the app configuration file —\n// without them lower() refuses because no container is resolved), by the\n// command Composer starts, which a failed run prints:\n//\n// <node> <bin of the alchemy @prisma/composer depends on> deploy ${GENERATED_DIR}/${GENERATED_FILE} --yes --stage <stage>\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\n// It runs no config adapter: it reads what the first process's Load read from the app configuration file named in PRISMA_COMPOSER_APP_CONFIGURATION_FILE.\nimport { lower } from '@prisma/composer/deploy';\nimport * as report from '@prisma/composer/report';\nimport { readAppConfigurationFile } from '@prisma/composer/internal/app-configuration-file';\nimport prismaConfig from ${quote(configImport)};\nimport app from ${quote(appImport)};\n\nconst config = prismaConfig.composer;\nif (config === undefined) {\n throw new Error(${quote(noComposerExportMessage(input.configFile))});\n}\n\n// The app's own @prisma/composer may predate the failure recorder.\nreport.captureEngineFailure?.();\n\nconst file = readAppConfigurationFile(process.env);\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the stack file, returning its absolute path. */\nfunction writeStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderStackFile(input));\n\treturn filePath;\n}\nconst GENERATED_STACK_RELATIVE_PATH = path.join(GENERATED_DIR, GENERATED_FILE);\n//#endregion\n//#region src/operations/execute-deploy-destroy.ts\n/**\n* The deploy/destroy executor — main.ts's pipeline orchestration with argv,\n* console, and exit codes removed: typed inputs in, structured results out.\n* Reached only by lazy import from deploy.ts/destroy.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nconst ALCHEMY_STATE_DIR = \".alchemy\";\n/** Destroy guardrail (moved from main.ts): true when `<cwd>/.alchemy` is missing or empty — likely wrong directory or nothing deployed yet. */\nfunction hasNoLocalDeployState(cwd) {\n\tconst stateDir = path.join(cwd, ALCHEMY_STATE_DIR);\n\treturn !(fs.existsSync(stateDir) && fs.readdirSync(stateDir).length > 0);\n}\n/**\n* Times each deploy step for the host's `onEvent`. A step still open when the\n* run fails is closed as failed, innermost first. A host `onEvent` that throws\n* is the host's bug and cannot fail the deploy.\n*/\nfunction deploySteps(onEvent) {\n\tconst open = /* @__PURE__ */ new Map();\n\tconst keyOf = (step) => step.name === \"assemble-service\" ? `${step.name}:${step.address}` : step.name === \"apply-resource\" ? `${step.name}:${step.resourceId}` : step.name;\n\tconst emit = (event) => {\n\t\ttry {\n\t\t\tonEvent?.(event);\n\t\t} catch {}\n\t};\n\tconst finish = (step, outcome, data) => {\n\t\tconst entry = open.get(keyOf(step));\n\t\tif (entry === void 0) return;\n\t\topen.delete(keyOf(step));\n\t\tconst durationMs = Math.round(performance.now() - entry.startedAt);\n\t\temit({\n\t\t\tkind: \"step-finished\",\n\t\t\tstep,\n\t\t\toutcome,\n\t\t\tdurationMs,\n\t\t\tdata\n\t\t});\n\t};\n\treturn {\n\t\tstart(step) {\n\t\t\topen.set(keyOf(step), {\n\t\t\t\tstep,\n\t\t\t\tstartedAt: performance.now()\n\t\t\t});\n\t\t\temit({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep\n\t\t\t});\n\t\t},\n\t\tfinish(step, data) {\n\t\t\tfinish(step, \"ok\", data);\n\t\t},\n\t\tfail(step) {\n\t\t\tfinish(step, \"failed\");\n\t\t},\n\t\tfailOpen() {\n\t\t\tfor (const { step } of [...open.values()].reverse()) finish(step, \"failed\");\n\t\t},\n\t\tisOpen(step) {\n\t\t\treturn open.has(keyOf(step));\n\t\t},\n\t\tmessage(severity, text) {\n\t\t\temit({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity,\n\t\t\t\ttext\n\t\t\t});\n\t\t},\n\t\temit\n\t};\n}\nasync function executeDeploy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"deploy\", {\n\t\tentry: input.entry,\n\t\tconfig: input.config,\n\t\tname: input.name,\n\t\tenvironment: input.environment ?? \"production\",\n\t\tcwd,\n\t\tonEvent: void 0,\n\t\tdeps,\n\t\treportId: input.reportId,\n\t\treportPath: resolveRunReportPath(input.reportPath, process.env[RUN_REPORT_FILE_ENV], cwd),\n\t\tsteps: deploySteps(input.onEvent),\n\t\tsignal: input.signal,\n\t\tredaction: deps.redaction ?? new SecretRedaction(process.env)\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn ok({ summary: outcome.value });\n}\nasync function executeDestroy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"destroy\", {\n\t\tentry: input.entry,\n\t\tconfig: input.config,\n\t\tname: input.name,\n\t\tenvironment: input.environment,\n\t\tcwd,\n\t\tonEvent: input.onEvent,\n\t\tdeps,\n\t\treportId: void 0,\n\t\treportPath: void 0,\n\t\tsteps: deploySteps(void 0),\n\t\tsignal: void 0,\n\t\tredaction: new SecretRedaction(process.env)\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn okVoid();\n}\n/**\n* Opens a session per extension that declares a reporter. A `begin` that\n* throws costs that extension its reporting and nothing else — the deploy\n* has not started, and refusing to run it because an observer failed would\n* invert the relationship.\n*/\nasync function beginReporters(extensions, context, redaction) {\n\treturn (await Promise.all(extensions.map(async (extension) => {\n\t\tif (extension.reporter === void 0) return void 0;\n\t\ttry {\n\t\t\tconst reporter = await extension.reporter.begin(context);\n\t\t\treturn reporter === void 0 ? void 0 : {\n\t\t\t\textensionId: extension.id,\n\t\t\t\treporter\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not start deploy reporting for ${extension.id}: ${redaction.redact(detail)}`);\n\t\t\treturn;\n\t\t}\n\t}))).filter((entry) => entry !== void 0);\n}\n/** Hands each session its own extension's resolved container, so it can attach the run to what that container names. */\nasync function attachReporters(reporters, containers, redaction) {\n\tawait Promise.all(reporters.map(async ({ extensionId, reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.attach({ container: containers.get(extensionId) });\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not attach this deploy to its project for ${extensionId}: ${redaction.redact(detail)}`);\n\t\t}\n\t}));\n}\n/** Every session's contribution to the apply's environment, so reporting that happens inside the apply can find the run. */\nfunction reporterEnv(reporters, redaction) {\n\tconst env = {};\n\tfor (const { extensionId, reporter } of reporters) try {\n\t\tObject.assign(env, reporter.childEnv());\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not pass deploy reporting into the apply for ${extensionId}: ${redaction.redact(detail)}`);\n\t}\n\treturn env;\n}\n/** `failingStep` is capped at 500 by the platform and `errorMessage` at 5000; truncating here keeps a long message from costing the whole report. */\nfunction truncate(value, limit) {\n\treturn value.length <= limit ? value : `${value.slice(0, limit - 1)}…`;\n}\n/** An interrupted converge — reported as `cancelled`, never as `failed`. */\nfunction wasInterrupted(failure) {\n\treturn failure.code === \"DEPLOY.INTERRUPTED\" || typeof failure.meta?.[\"signal\"] === \"string\";\n}\n/**\n* Ends every reporting session, whatever the run did. Sessions never reject\n* by contract, but a buggy one must not turn a converged deploy into a\n* failure — so this swallows anyway, and reports each session independently\n* so one bad implementation cannot silence another.\n*/\nasync function finishReporters(reporters, outcome, redaction) {\n\tconst entities = outcome.summary?.nodes.flatMap((node) => node.entities) ?? [];\n\tawait Promise.all(reporters.map(async ({ reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.finish({\n\t\t\t\tok: outcome.ok,\n\t\t\t\tcancelled: outcome.cancelled,\n\t\t\t\tfailingStep: outcome.code === void 0 ? void 0 : truncate(outcome.code, 500),\n\t\t\t\terrorMessage: outcome.message === void 0 ? void 0 : truncate(outcome.message, 5e3),\n\t\t\t\tentities\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not report this deploy's outcome: ${redaction.redact(detail)}`);\n\t\t}\n\t}));\n}\n/**\n* Owns the reporting sessions around the pipeline: the inner run opens them\n* once it knows which extensions are configured, and this closes them on\n* every exit path — a returned failure, a success, or a thrown defect — as\n* the `record` step, which also writes the run report.\n* Nothing here can change what the pipeline returns.\n*/\nasync function runStackPipeline(action, opts) {\n\tconst reporters = [];\n\tlet outcome;\n\ttry {\n\t\toutcome = await runStackPipelineInner(action, opts, reporters);\n\t} catch (error) {\n\t\topts.steps.failOpen();\n\t\topts.steps.start({ name: \"record\" });\n\t\tconst thrown = redactThrown(error, opts.redaction);\n\t\tawait finishReporters(reporters, {\n\t\t\tok: false,\n\t\t\tcancelled: false,\n\t\t\tcode: \"DEPLOY.UNEXPECTED\",\n\t\t\tmessage: thrown.message\n\t\t}, opts.redaction);\n\t\topts.steps.finish({ name: \"record\" });\n\t\tthrow thrown;\n\t}\n\tif (!outcome.ok) outcome = notOk(redactError(outcome.failure, opts.redaction));\n\tif (!outcome.ok) opts.steps.failOpen();\n\topts.steps.start({ name: \"record\" });\n\tawait finishReporters(reporters, outcome.ok ? {\n\t\tok: true,\n\t\tcancelled: false,\n\t\tsummary: outcome.value\n\t} : {\n\t\tok: false,\n\t\tcancelled: wasInterrupted(outcome.failure),\n\t\tcode: outcome.failure.code,\n\t\tmessage: outcome.failure.message\n\t}, opts.redaction);\n\tif (opts.reportPath === void 0 || writeRunReport(opts.reportPath, toRunReport({\n\t\tsummary: outcome.ok ? outcome.value : void 0,\n\t\tenvironment: opts.environment,\n\t\tfailure: outcome.ok ? void 0 : {\n\t\t\tcode: outcome.failure.code,\n\t\t\tmessage: outcome.failure.message\n\t\t}\n\t}))) opts.steps.finish({ name: \"record\" });\n\telse opts.steps.fail({ name: \"record\" });\n\treturn outcome;\n}\n/** The pipeline both actions share: validate, resolve containers, then for\n* deploy preflight and the in-process converge, and for destroy the stack\n* file, the alchemy child and the teardown/removal suffix. The value is only\n* ever a summary for deploy. */\nasync function runStackPipelineInner(action, opts, reporters) {\n\tconst { entry, config: composerConfig, name, environment, cwd, onEvent, deps, steps } = opts;\n\tsteps.start({ name: \"prepare\" });\n\tremoveLeftoverAppConfigurationFiles(cwd);\n\ttry {\n\t\tvalidateEnvironmentName(environment);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tlet appConvergeEntry;\n\tif (action === \"deploy\") {\n\t\tconst loaded = await prepareAppConvergeEntry(deps, path.dirname(path.resolve(cwd, composerConfig.file)));\n\t\tif (!loaded.ok) return loaded;\n\t\tappConvergeEntry = loaded.value;\n\t}\n\tconst platformCredentials = deps.credentials;\n\tif (action === \"destroy\" && hasNoLocalDeployState(cwd)) onEvent?.({\n\t\tkind: \"no-local-deploy-state\",\n\t\tcwd\n\t});\n\tlet pipeline;\n\tlet containers;\n\tlet alchemyStage;\n\tconst preflightPayloads = /* @__PURE__ */ new Map();\n\tconst unset = [];\n\tconst preflightTransportEnv = {};\n\ttry {\n\t\tpipeline = await runPipeline(entry, name, environment, cwd, composerConfig, {\n\t\t\trunAssembler: deps.runAssembler,\n\t\t\treadSecrets: action === \"deploy\",\n\t\t\tredaction: opts.redaction,\n\t\t\tonEvent: (event) => {\n\t\t\t\tswitch (event.kind) {\n\t\t\t\t\tcase \"loaded\":\n\t\t\t\t\t\tsteps.finish({ name: \"prepare\" });\n\t\t\t\t\t\tsteps.start({ name: \"assemble\" });\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"service-started\":\n\t\t\t\t\t\tsteps.start({\n\t\t\t\t\t\t\tname: \"assemble-service\",\n\t\t\t\t\t\t\taddress: event.address\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"service-assembled\":\n\t\t\t\t\t\tsteps.finish({\n\t\t\t\t\t\t\tname: \"assemble-service\",\n\t\t\t\t\t\t\taddress: event.address\n\t\t\t\t\t\t}, event.data);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}, action === \"destroy\" ? (error) => new CliStructuredError(\"DEPLOY.BUILD_REQUIRED\", error.message, {\n\t\t\twhy: \"destroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first.\",\n\t\t\tfix: \"Run the build, then retry the destroy.\",\n\t\t\tcause: error\n\t\t}) : void 0);\n\t\tsteps.finish({ name: \"assemble\" });\n\t\tconst { graph, name: resolvedName } = pipeline;\n\t\tconst config = pipeline.configSource.value;\n\t\tif (action === \"deploy\") refuseSecretsInRootInput(graph.appConfigurationRead, opts.redaction.knownSecrets, \"A deploy sends every plain value Load read to the platform as plain configuration, and never sends a secret that way.\");\n\t\tsteps.start({ name: \"connect\" });\n\t\tif (action === \"deploy\") reporters.push(...await beginReporters(config.extensions, {\n\t\t\tappName: resolvedName,\n\t\t\tgraph,\n\t\t\tenvironment,\n\t\t\tcwd,\n\t\t\treportId: opts.reportId,\n\t\t\tcredentials: platformCredentials\n\t\t}, opts.redaction));\n\t\tcontainers = /* @__PURE__ */ new Map();\n\t\tfor (const extension of config.extensions) {\n\t\t\tif (extension.container === void 0) continue;\n\t\t\ttry {\n\t\t\t\tif (action === \"deploy\") {\n\t\t\t\t\tconst instance = await extension.container.ensure({\n\t\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\t\tenvironment\n\t\t\t\t\t}, platformCredentials);\n\t\t\t\t\trequireContainerForEnvironment(action, extension.id, extension.container, instance, environment);\n\t\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t\t} else {\n\t\t\t\t\tconst instance = await extension.container.locate({\n\t\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\t\tenvironment\n\t\t\t\t\t}, platformCredentials);\n\t\t\t\t\tif (instance === void 0) throw new CliStructuredError(\"DEPLOY.TARGET_NOT_FOUND\", `Nothing deployed for ${resolvedName} in the environment ${environment}.`, { fix: \"Deploy it first.\" });\n\t\t\t\t\trequireContainerForEnvironment(action, extension.id, extension.container, instance, environment);\n\t\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_FAILED\", error);\n\t\t\t}\n\t\t}\n\t\tawait attachReporters(reporters, containers, opts.redaction);\n\t\talchemyStage = containers.get(config.state.extension)?.alchemyStage ?? environment;\n\t\tsteps.finish({ name: \"connect\" });\n\t\tif (action === \"deploy\") {\n\t\t\tsteps.start({ name: \"preflight\" });\n\t\t\tlet checked = 0;\n\t\t\tconst report = (reported) => {\n\t\t\t\tchecked += reported.checked;\n\t\t\t\tunset.push(...reported.unset.map((variable) => redactUnsetPlatformVariable(variable, opts.redaction)));\n\t\t\t};\n\t\t\tfor (const extension of config.extensions) {\n\t\t\t\tif (extension.preflight === void 0) continue;\n\t\t\t\ttry {\n\t\t\t\t\tconst payload = await extension.preflight({\n\t\t\t\t\t\tgraph,\n\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tconfiguration: pipeline.configuration,\n\t\t\t\t\t\tsecrets: pipeline.secrets,\n\t\t\t\t\t\tcredentials: platformCredentials,\n\t\t\t\t\t\treport\n\t\t\t\t\t});\n\t\t\t\t\tif (payload !== void 0) preflightPayloads.set(extension.id, payload);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow toStructured(\"DEPLOY.PREFLIGHT_FAILED\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsteps.finish({ name: \"preflight\" }, {\n\t\t\t\tchecked,\n\t\t\t\tunset: unset.length\n\t\t\t});\n\t\t\tif (unset.length > 0) steps.emit({\n\t\t\t\tkind: \"preflight-findings\",\n\t\t\t\tfindings: { unset }\n\t\t\t});\n\t\t}\n\t\tif (action === \"destroy\") for (const extension of config.extensions) preflightTransportEnv[preflightEnvVarName(extension.id)] = \"\";\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (appConvergeEntry !== void 0) return convergeDeploy(opts, pipeline, appConvergeEntry, {\n\t\tcontainers,\n\t\tstage: alchemyStage,\n\t\tpreflightPayloads,\n\t\tfindings: { unset },\n\t\tenv: reporterEnv(reporters, opts.redaction)\n\t});\n\tlet stackPath;\n\tconst resultFilePath = path.join(cwd, \".prisma-composer\", `deployment-result-${String(process.pid)}-${randomUUID()}.json`);\n\tlet handover;\n\ttry {\n\t\ttry {\n\t\t\thandover = prepareSecondProcess({\n\t\t\t\tfile: deployAppConfigurationFile(cwd, randomUUID()),\n\t\t\t\tappConfigurationRead: pipeline.graph.appConfigurationRead,\n\t\t\t\tplainVariableText: {},\n\t\t\t\tnodeAddresses: nodeAddresses(pipeline.graph),\n\t\t\t\tsecretsKeys: secretsKeys(pipeline.graph),\n\t\t\t\tknownSecrets: opts.redaction.knownSecrets\n\t\t\t});\n\t\t\tstackPath = writeStackFile({\n\t\t\t\tentryPath: pipeline.entryModule.path,\n\t\t\t\tcwd,\n\t\t\t\tconfigFile: pipeline.configSource.file,\n\t\t\t\tname: pipeline.name,\n\t\t\t\tenvironment,\n\t\t\t\tassembled: pipeline.assembled\n\t\t\t});\n\t\t\thandover.writeFile();\n\t\t} catch (error) {\n\t\t\treturn notOk(toStructured(\"DEPLOY.STACK_WRITE_FAILED\", error));\n\t\t}\n\t\tconst invocation = alchemyInvocation({\n\t\t\tcommand: action,\n\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\tcwd,\n\t\t\tstage: alchemyStage,\n\t\t\tcontainerEnv: containerEnv(containers),\n\t\t\tpreflightEnv: preflightTransportEnv,\n\t\t\tenv: {\n\t\t\t\t...reporterEnv(reporters, opts.redaction),\n\t\t\t\t...handover.env,\n\t\t\t\t[DEPLOYMENT_RESULT_FILE_ENV]: resultFilePath\n\t\t\t},\n\t\t\tredactedValues: opts.redaction.allValues()\n\t\t});\n\t\tsteps.start({ name: \"apply\" });\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await (deps.alchemy ?? spawnAlchemy)(invocation);\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\tmeta: { diagnostics: {\n\t\t\t\t\texitCode: void 0,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand: reproduceCommand(invocation),\n\t\t\t\t\tcwd\n\t\t\t\t} }\n\t\t\t}));\n\t\t}\n\t\tconst reproduce = reproduceCommand(invocation, outcome);\n\t\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} was interrupted by ${outcome.signal}.`, { meta: {\n\t\t\tsignal: outcome.signal,\n\t\t\tdiagnostics: {\n\t\t\t\texitCode: void 0,\n\t\t\t\tsignal: outcome.signal,\n\t\t\t\tstackFilePath: stackPath,\n\t\t\t\treproduceCommand: reproduce,\n\t\t\t\tcwd\n\t\t\t}\n\t\t} }));\n\t\tconst status = outcome.exitCode ?? 1;\n\t\tif (status !== 0) {\n\t\t\tconst engineCause = readEngineFailureCause(resultFilePath, (text) => opts.redaction.redact(text));\n\t\t\tconst withCause = (sentence) => engineCause === void 0 ? sentence : `${sentence}\\n${engineCause}`;\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", withCause(`alchemy ${action} exited with status ${status}.`), { meta: {\n\t\t\t\texitCode: status,\n\t\t\t\t...engineCause !== void 0 ? { engineCause } : {},\n\t\t\t\tdiagnostics: {\n\t\t\t\t\texitCode: status,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand: reproduce,\n\t\t\t\t\tcwd\n\t\t\t\t}\n\t\t\t} }));\n\t\t}\n\t\tsteps.finish({ name: \"apply\" });\n\t\ttry {\n\t\t\tif (action === \"destroy\") {\n\t\t\t\tfor (const extension of pipeline.configSource.value.extensions) {\n\t\t\t\t\tif (extension.teardown === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.teardown({\n\t\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\t\tenvironment\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.TEARDOWN_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const extension of pipeline.configSource.value.extensions) {\n\t\t\t\t\tif (extension.container === void 0) continue;\n\t\t\t\t\tconst instance = containers.get(extension.id);\n\t\t\t\t\tif (instance === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.container.remove(instance, platformCredentials);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_REMOVE_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\tthrow error;\n\t\t}\n\t\treturn ok(void 0);\n\t} finally {\n\t\ttry {\n\t\t\tfs.rmSync(resultFilePath, { force: true });\n\t\t\tfs.rmSync(engineFailureFilePath(resultFilePath), { force: true });\n\t\t} catch {}\n\t\thandover?.removeFile();\n\t}\n}\n/** Loaded before anything is created, so a missing or incompatible install fails first. */\nasync function prepareAppConvergeEntry(deps, appDir) {\n\ttry {\n\t\treturn ok(deps.appConvergeEntry ?? await loadAppConvergeEntry(appDir));\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n/** One Alchemy progress event as the deploy's step events: each resource is a step inside `apply`. */\nfunction reportConvergeEvent(steps, event, redact) {\n\tif (event.kind === \"log\") {\n\t\tsteps.message(event.severity, redact(withComposerAdvice(event.text)));\n\t\treturn;\n\t}\n\tconst step = {\n\t\tname: \"apply-resource\",\n\t\tresourceId: event.fqn,\n\t\tresourceType: event.resourceType,\n\t\tstatus: event.status\n\t};\n\tswitch (event.phase) {\n\t\tcase \"running\":\n\t\t\tif (!steps.isOpen(step)) steps.start(step);\n\t\t\treturn;\n\t\tcase \"done\":\n\t\t\tif (!steps.isOpen(step)) steps.start(step);\n\t\t\tsteps.finish(step);\n\t\t\treturn;\n\t\tcase \"failed\":\n\t\t\tif (!steps.isOpen(step)) steps.start(step);\n\t\t\tsteps.fail(step);\n\t\t\tif (event.message !== void 0) steps.message(\"warn\", redact(`${event.fqn}: ${withComposerAdvice(event.message)}`));\n\t\t\treturn;\n\t\tcase \"pending\": return;\n\t}\n}\nfunction reasonsText(reasons) {\n\treturn reasons.map(({ tag, message }) => tag === \"Error\" || tag === \"Unknown\" || message.startsWith(tag) ? message : `${tag}: ${message}`).join(\"\\n\");\n}\n/** The structured failure a converge that did not apply settles as. */\nfunction convergeFailure(outcome, redact) {\n\tswitch (outcome.kind) {\n\t\tcase \"interrupted\": return new CliStructuredError(\"DEPLOY.INTERRUPTED\", \"The deploy was interrupted.\", {\n\t\t\twhy: \"It stopped while Alchemy planned or applied it. Resources it had already changed stay as they are.\",\n\t\t\tfix: \"Deploy again to finish.\"\n\t\t});\n\t\tcase \"refused\": return outcome.reason === \"already-running\" ? new CliStructuredError(\"DEPLOY.CONVERGE_RUNNING\", \"Another deploy is already running in this process.\", {\n\t\t\twhy: \"A deploy sets the process's environment and working directory while Alchemy runs, so two cannot overlap.\",\n\t\t\tfix: \"Wait for the other deploy to finish, or run this one in its own process.\"\n\t\t}) : new CliStructuredError(\"DEPLOY.WORKER_THREAD\", \"Deploy cannot run in a worker thread when its cwd is not the process working directory.\", {\n\t\t\twhy: \"Alchemy reads `.env` and keeps `.alchemy` in the working directory, and a worker thread cannot change it.\",\n\t\t\tfix: \"Call deploy from the main thread, or with the process's working directory as its cwd.\"\n\t\t});\n\t\tcase \"failed\": {\n\t\t\tconst cause = capFailureCause(redact(withComposerAdvice(reasonsText(outcome.reasons))));\n\t\t\treturn new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `Alchemy could not deploy the app.\\n${cause}`, { meta: {\n\t\t\t\tengineCause: cause,\n\t\t\t\treasons: outcome.reasons.map(({ tag, message }) => ({\n\t\t\t\t\ttag,\n\t\t\t\t\tmessage: redact(message)\n\t\t\t\t}))\n\t\t\t} });\n\t\t}\n\t}\n\treturn new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", \"The converge ended with an outcome this Composer does not know.\");\n}\n/**\n* Alchemy's terminal text as `info` messages, one per complete line, redacted. A secret split\n* across writes or lines is still found, because the text passes through a `StreamRedactor`\n* before it is cut into lines. `end` sends the last line that has no line break.\n*/\nfunction interactionMessages(steps, redaction) {\n\tconst stream = new StreamRedactor(redaction.allValues());\n\tlet partial = \"\";\n\tconst send = (text, last) => {\n\t\tconst lines = (partial + text).split(\"\\n\");\n\t\tpartial = last ? \"\" : lines.pop() ?? \"\";\n\t\tfor (const line of lines) if (line.trim() !== \"\") steps.message(\"info\", redaction.redact(line));\n\t};\n\treturn {\n\t\tpush: (text) => send(stream.push(text), false),\n\t\tend: () => send(stream.end(), true)\n\t};\n}\n/**\n* Deploy's converge: lowers the app with the containers and preflight\n* payloads this run resolved, then plans and applies it in this process.\n* The report hook runs inside the apply, here, so the summary comes back as\n* a value.\n*/\nasync function convergeDeploy(opts, pipeline, entry, resolved) {\n\tconst { cwd, environment, steps } = opts;\n\tconst config = pipeline.configSource.value;\n\tconst env = resolved.env;\n\topts.redaction.addCredentialLookingValues(credentialLookingValues(env));\n\tconst redact = (text) => opts.redaction.redact(text);\n\tlet summary;\n\tconst root = pipeline.graph.root.node;\n\tif (root.kind !== \"module\") throw new InternalError(\"runPipeline admitted a root that is not a module\");\n\tsteps.start({ name: \"apply\" });\n\tlet stack;\n\ttry {\n\t\tstack = entry.lower(root, config, {\n\t\t\tname: pipeline.name,\n\t\t\tenvironment,\n\t\t\tappConfigurationRead: pipeline.graph.appConfigurationRead,\n\t\t\tfirstProcessNodeAddresses: nodeAddresses(pipeline.graph),\n\t\t\tbundles: pipeline.assembled.bundles,\n\t\t\tcontainers: resolved.containers,\n\t\t\tpreflightPayloads: resolved.preflightPayloads,\n\t\t\tfindings: resolved.findings,\n\t\t\tcredentials: opts.deps.credentials,\n\t\t\treport: (result) => {\n\t\t\t\tsummary = toDeploymentSummary(result);\n\t\t\t}\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", redact(error instanceof Error ? error.message : String(error))));\n\t}\n\tconst output = interactionMessages(steps, opts.redaction);\n\tlet outcome;\n\ttry {\n\t\toutcome = await entry.converge({\n\t\t\toperation: \"deploy\",\n\t\t\tstack,\n\t\t\tstage: resolved.stage,\n\t\t\tcwd,\n\t\t\tenv,\n\t\t\tsignal: opts.signal,\n\t\t\tonEvent: (event) => reportConvergeEvent(steps, event, redact),\n\t\t\toutput: (text) => output.push(text)\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", redact(`Alchemy could not deploy the app.\\n${error instanceof Error ? error.message : String(error)}`)));\n\t} finally {\n\t\toutput.end();\n\t}\n\tif (outcome.kind !== \"applied\") return notOk(convergeFailure(outcome, redact));\n\tsteps.finish({ name: \"apply\" });\n\treturn ok(redactSummary(summary, opts.redaction));\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-D2Ok1xun.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAI,UAAU;AAGd,MAAM,QAAQ;AACd,MAAM,iBAAiB;;AAEvB,MAAM,wBAAwB;AAC9B,SAA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AE,MAAM,QAAQ,CAAC;CAC9B,OAAO,GAAG,cAAc,SAAS,KAAK,SAAS,CAAC;AACjD"}
1
+ {"version":3,"file":"execute-deploy-destroy-J0buFSWK-BhVTX4-E.mjs","names":["fs","path"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-J0buFSWK.mjs"],"sourcesContent":["import { i as runPipeline, t as validateEnvironmentName } from \"./validate-environment-XwVDifWN.mjs\";\nimport { i as noComposerExportMessage } from \"./composer-config-QKdY85G-.mjs\";\nimport { c as redactSummary, i as credentialLookingValues, l as redactThrown, n as SecretRedaction, r as StreamRedactor, s as redactError, u as redactUnsetPlatformVariable } from \"./redaction-CjMYXtGp.mjs\";\nimport { a as readEngineFailureCause, i as engineFailureFilePath, n as capFailureCause, o as toDeploymentSummary, s as withComposerAdvice, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-YP7eMPJI.mjs\";\nimport { i as prepareSecondProcess, o as removeLeftoverAppConfigurationFiles, s as refuseSecretsInRootInput, t as deployAppConfigurationFile } from \"./app-configuration-file-Bbfq5PR3.mjs\";\nimport { d as toStructured, u as requireContainerForEnvironment } from \"./dev-current-Dp3jvXGN.mjs\";\nimport { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from \"./run-report-CmBz2-xc.mjs\";\nimport \"./converge-contract-BjDlHXVU.mjs\";\nimport { i as spawnAlchemy, n as alchemyInvocation, r as reproduceCommand } from \"./run-alchemy-BlYyc4Oh.mjs\";\nimport { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { nodeAddresses, secretsKeys } from \"@internal/core/deploy\";\nimport { CliStructuredError, InternalError } from \"@internal/foundation/errors\";\nimport { pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { containerEnv, preflightEnvVarName } from \"@internal/core/config\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { randomUUID } from \"node:crypto\";\n//#region package.json\nvar version = \"0.39.0-dev.5\";\n//#endregion\n//#region src/app-converge.ts\nconst ENTRY = \"@prisma/composer/internal/converge\";\nconst CONTRACT_ENTRY = \"@prisma/composer/internal/converge-contract\";\n/** The Composer version this host runs; every Composer package carries the same one. */\nconst HOST_COMPOSER_VERSION = version;\nfunction unresolvable(appDir, detail, cause) {\n\treturn new CliStructuredError(\"DEPS.CONVERGE_UNRESOLVABLE\", `Could not load the converge from the app's @prisma/composer in \"${appDir}\": ${detail}`, {\n\t\twhy: \"`prisma deploy` runs the lowering and Alchemy from the app's own install of @prisma/composer, so the app, its extensions and Alchemy share one copy of alchemy.\",\n\t\tfix: \"Install @prisma/composer in the app, at the same version as the Composer the `prisma` CLI runs.\",\n\t\t...cause === void 0 ? {} : { cause }\n\t});\n}\nfunction installedVersion(require) {\n\ttry {\n\t\tconst parsed = JSON.parse(fs.readFileSync(require.resolve(\"@prisma/composer/package.json\"), \"utf8\"));\n\t\treturn typeof parsed === \"object\" && parsed !== null && \"version\" in parsed && typeof parsed.version === \"string\" ? parsed.version : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\nasync function importFile(appDir, file) {\n\ttry {\n\t\treturn await import(pathToFileURL(file).href);\n\t} catch (error) {\n\t\tthrow unresolvable(appDir, `${file} failed to load: ${error instanceof Error ? error.message : String(error)}`, error);\n\t}\n}\nfunction contractMismatch(host, app) {\n\tconst appVersion = app.version ?? \"an unknown version\";\n\tconst update = app.contract < host.contract ? `Upgrade the app's @prisma/composer to a release that speaks converge contract ${host.contract}, such as ${host.version}.` : `Upgrade the \\`prisma\\` CLI to one that runs a Composer speaking converge contract ${app.contract}, such as ${appVersion}.`;\n\treturn new CliStructuredError(\"DEPS.CONVERGE_CONTRACT_MISMATCH\", `The app's @prisma/composer ${appVersion} speaks converge contract ${app.contract}, and the \\`prisma\\` CLI's Composer ${host.version} speaks contract ${host.contract}.`, {\n\t\twhy: \"Deploy calls the app's @prisma/composer from the CLI's Composer, and the two read each other's data only when they speak the same converge contract.\",\n\t\tfix: update\n\t});\n}\n/**\n* The app's `lower` and converge, from the install `appDir` resolves. Reads the app's\n* converge contract before loading anything else. Raises\n* DEPS.CONVERGE_UNRESOLVABLE when the install is missing or predates the\n* in-process converge, and DEPS.CONVERGE_CONTRACT_MISMATCH when it speaks\n* another contract than `host`.\n*/\nasync function loadAppConvergeEntry(appDir, host = {\n\tcontract: 2,\n\tversion: HOST_COMPOSER_VERSION\n}) {\n\tconst require = createRequire(path.join(appDir, \"package.json\"));\n\tlet contractFile;\n\tlet file;\n\ttry {\n\t\tcontractFile = require.resolve(CONTRACT_ENTRY);\n\t\tfile = require.resolve(ENTRY);\n\t} catch (error) {\n\t\tthrow unresolvable(appDir, `${CONTRACT_ENTRY} or ${ENTRY} does not resolve.`, error);\n\t}\n\tconst { CONVERGE_CONTRACT: appContract } = await importFile(appDir, contractFile);\n\tif (typeof appContract !== \"number\") throw unresolvable(appDir, `${contractFile} exports no CONVERGE_CONTRACT.`);\n\tif (appContract !== host.contract) throw contractMismatch(host, {\n\t\tcontract: appContract,\n\t\tversion: installedVersion(require)\n\t});\n\tconst { lower: appLower, convergeInProcess } = await importFile(appDir, file);\n\tif (typeof appLower !== \"function\" || typeof convergeInProcess !== \"function\") throw unresolvable(appDir, `${file} exports no lower and convergeInProcess.`);\n\treturn blindCast({\n\t\tlower: appLower,\n\t\tconverge: convergeInProcess\n\t});\n}\n//#endregion\n//#region src/generate-stack.ts\n/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */\nconst GENERATED_DIR = \".prisma-composer\";\nconst GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/alchemy.run.ts` to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(` environment: ${quote(input.environment)},`);\n\tlines.push(\" appConfigurationRead: file.appConfigurationRead,\");\n\tlines.push(\" firstProcessNodeAddresses: file.nodeAddresses,\");\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tlines.push(\" report: report.deploymentReport,\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the stack module's source (tests assert on it without touching disk) — uses `//` headers, not a block comment, since a cwd path with a star-slash could close one early. */\nfunction renderStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst configImport = relativeImportSpecifier(generatedDir, input.configFile);\n\treturn `// Generated by Composer's deploy and destroy operations — overwritten on every\n// run; do not edit by hand. Runnable from ${quote(input.cwd)} WITH the env the\n// CLI passes its child (the PRISMA_COMPOSER_CONTAINER_*/_PREFLIGHT_* vars and the app configuration file —\n// without them lower() refuses because no container is resolved), by the\n// command Composer starts, which a failed run prints:\n//\n// <node> <bin of the alchemy @prisma/composer depends on> deploy ${GENERATED_DIR}/${GENERATED_FILE} --yes --stage <stage>\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\n// It runs no config adapter: it reads what the first process's Load read from the app configuration file named in PRISMA_COMPOSER_APP_CONFIGURATION_FILE.\nimport { lower } from '@prisma/composer/deploy';\nimport * as report from '@prisma/composer/report';\nimport { readAppConfigurationFile } from '@prisma/composer/internal/app-configuration-file';\nimport prismaConfig from ${quote(configImport)};\nimport app from ${quote(appImport)};\n\nconst config = prismaConfig.composer;\nif (config === undefined) {\n throw new Error(${quote(noComposerExportMessage(input.configFile))});\n}\n\n// The app's own @prisma/composer may predate the failure recorder.\nreport.captureEngineFailure?.();\n\nconst file = readAppConfigurationFile(process.env);\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the stack file, returning its absolute path. */\nfunction writeStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderStackFile(input));\n\treturn filePath;\n}\nconst GENERATED_STACK_RELATIVE_PATH = path.join(GENERATED_DIR, GENERATED_FILE);\n//#endregion\n//#region src/operations/execute-deploy-destroy.ts\n/**\n* The deploy/destroy executor — main.ts's pipeline orchestration with argv,\n* console, and exit codes removed: typed inputs in, structured results out.\n* Reached only by lazy import from deploy.ts/destroy.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nconst ALCHEMY_STATE_DIR = \".alchemy\";\n/** Destroy guardrail (moved from main.ts): true when `<cwd>/.alchemy` is missing or empty — likely wrong directory or nothing deployed yet. */\nfunction hasNoLocalDeployState(cwd) {\n\tconst stateDir = path.join(cwd, ALCHEMY_STATE_DIR);\n\treturn !(fs.existsSync(stateDir) && fs.readdirSync(stateDir).length > 0);\n}\n/**\n* Times each deploy step for the host's `onEvent`. A step still open when the\n* run fails is closed as failed, innermost first. A host `onEvent` that throws\n* is the host's bug and cannot fail the deploy.\n*/\nfunction deploySteps(onEvent) {\n\tconst open = /* @__PURE__ */ new Map();\n\tconst keyOf = (step) => step.name === \"assemble-service\" ? `${step.name}:${step.address}` : step.name === \"apply-resource\" ? `${step.name}:${step.resourceId}` : step.name;\n\tconst emit = (event) => {\n\t\ttry {\n\t\t\tonEvent?.(event);\n\t\t} catch {}\n\t};\n\tconst finish = (step, outcome, data) => {\n\t\tconst entry = open.get(keyOf(step));\n\t\tif (entry === void 0) return;\n\t\topen.delete(keyOf(step));\n\t\tconst durationMs = Math.round(performance.now() - entry.startedAt);\n\t\temit({\n\t\t\tkind: \"step-finished\",\n\t\t\tstep,\n\t\t\toutcome,\n\t\t\tdurationMs,\n\t\t\tdata\n\t\t});\n\t};\n\treturn {\n\t\tstart(step) {\n\t\t\topen.set(keyOf(step), {\n\t\t\t\tstep,\n\t\t\t\tstartedAt: performance.now()\n\t\t\t});\n\t\t\temit({\n\t\t\t\tkind: \"step-started\",\n\t\t\t\tstep\n\t\t\t});\n\t\t},\n\t\tfinish(step, data) {\n\t\t\tfinish(step, \"ok\", data);\n\t\t},\n\t\tfail(step) {\n\t\t\tfinish(step, \"failed\");\n\t\t},\n\t\tfailOpen() {\n\t\t\tfor (const { step } of [...open.values()].reverse()) finish(step, \"failed\");\n\t\t},\n\t\tisOpen(step) {\n\t\t\treturn open.has(keyOf(step));\n\t\t},\n\t\tmessage(severity, text) {\n\t\t\temit({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity,\n\t\t\t\ttext\n\t\t\t});\n\t\t},\n\t\temit\n\t};\n}\nasync function executeDeploy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"deploy\", {\n\t\tentry: input.entry,\n\t\tconfig: input.config,\n\t\tname: input.name,\n\t\tenvironment: input.environment ?? \"production\",\n\t\tcwd,\n\t\tonEvent: void 0,\n\t\tdeps,\n\t\treportId: input.reportId,\n\t\treportPath: resolveRunReportPath(input.reportPath, process.env[RUN_REPORT_FILE_ENV], cwd),\n\t\tsteps: deploySteps(input.onEvent),\n\t\tsignal: input.signal,\n\t\tredaction: deps.redaction ?? new SecretRedaction(process.env)\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn ok({ summary: outcome.value });\n}\nasync function executeDestroy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"destroy\", {\n\t\tentry: input.entry,\n\t\tconfig: input.config,\n\t\tname: input.name,\n\t\tenvironment: input.environment,\n\t\tcwd,\n\t\tonEvent: input.onEvent,\n\t\tdeps,\n\t\treportId: void 0,\n\t\treportPath: void 0,\n\t\tsteps: deploySteps(void 0),\n\t\tsignal: void 0,\n\t\tredaction: new SecretRedaction(process.env)\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn okVoid();\n}\n/**\n* Opens a session per extension that declares a reporter. A `begin` that\n* throws costs that extension its reporting and nothing else — the deploy\n* has not started, and refusing to run it because an observer failed would\n* invert the relationship.\n*/\nasync function beginReporters(extensions, context, redaction) {\n\treturn (await Promise.all(extensions.map(async (extension) => {\n\t\tif (extension.reporter === void 0) return void 0;\n\t\ttry {\n\t\t\tconst reporter = await extension.reporter.begin(context);\n\t\t\treturn reporter === void 0 ? void 0 : {\n\t\t\t\textensionId: extension.id,\n\t\t\t\treporter\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not start deploy reporting for ${extension.id}: ${redaction.redact(detail)}`);\n\t\t\treturn;\n\t\t}\n\t}))).filter((entry) => entry !== void 0);\n}\n/** Hands each session its own extension's resolved container, so it can attach the run to what that container names. */\nasync function attachReporters(reporters, containers, redaction) {\n\tawait Promise.all(reporters.map(async ({ extensionId, reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.attach({ container: containers.get(extensionId) });\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not attach this deploy to its project for ${extensionId}: ${redaction.redact(detail)}`);\n\t\t}\n\t}));\n}\n/** Every session's contribution to the apply's environment, so reporting that happens inside the apply can find the run. */\nfunction reporterEnv(reporters, redaction) {\n\tconst env = {};\n\tfor (const { extensionId, reporter } of reporters) try {\n\t\tObject.assign(env, reporter.childEnv());\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not pass deploy reporting into the apply for ${extensionId}: ${redaction.redact(detail)}`);\n\t}\n\treturn env;\n}\n/** `failingStep` is capped at 500 by the platform and `errorMessage` at 5000; truncating here keeps a long message from costing the whole report. */\nfunction truncate(value, limit) {\n\treturn value.length <= limit ? value : `${value.slice(0, limit - 1)}…`;\n}\n/** An interrupted converge — reported as `cancelled`, never as `failed`. */\nfunction wasInterrupted(failure) {\n\treturn failure.code === \"DEPLOY.INTERRUPTED\" || typeof failure.meta?.[\"signal\"] === \"string\";\n}\n/**\n* Ends every reporting session, whatever the run did. Sessions never reject\n* by contract, but a buggy one must not turn a converged deploy into a\n* failure — so this swallows anyway, and reports each session independently\n* so one bad implementation cannot silence another.\n*/\nasync function finishReporters(reporters, outcome, redaction) {\n\tconst entities = outcome.summary?.nodes.flatMap((node) => node.entities) ?? [];\n\tawait Promise.all(reporters.map(async ({ reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.finish({\n\t\t\t\tok: outcome.ok,\n\t\t\t\tcancelled: outcome.cancelled,\n\t\t\t\tfailingStep: outcome.code === void 0 ? void 0 : truncate(outcome.code, 500),\n\t\t\t\terrorMessage: outcome.message === void 0 ? void 0 : truncate(outcome.message, 5e3),\n\t\t\t\tentities\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not report this deploy's outcome: ${redaction.redact(detail)}`);\n\t\t}\n\t}));\n}\n/**\n* Owns the reporting sessions around the pipeline: the inner run opens them\n* once it knows which extensions are configured, and this closes them on\n* every exit path — a returned failure, a success, or a thrown defect — as\n* the `record` step, which also writes the run report.\n* Nothing here can change what the pipeline returns.\n*/\nasync function runStackPipeline(action, opts) {\n\tconst reporters = [];\n\tlet outcome;\n\ttry {\n\t\toutcome = await runStackPipelineInner(action, opts, reporters);\n\t} catch (error) {\n\t\topts.steps.failOpen();\n\t\topts.steps.start({ name: \"record\" });\n\t\tconst thrown = redactThrown(error, opts.redaction);\n\t\tawait finishReporters(reporters, {\n\t\t\tok: false,\n\t\t\tcancelled: false,\n\t\t\tcode: \"DEPLOY.UNEXPECTED\",\n\t\t\tmessage: thrown.message\n\t\t}, opts.redaction);\n\t\topts.steps.finish({ name: \"record\" });\n\t\tthrow thrown;\n\t}\n\tif (!outcome.ok) outcome = notOk(redactError(outcome.failure, opts.redaction));\n\tif (!outcome.ok) opts.steps.failOpen();\n\topts.steps.start({ name: \"record\" });\n\tawait finishReporters(reporters, outcome.ok ? {\n\t\tok: true,\n\t\tcancelled: false,\n\t\tsummary: outcome.value\n\t} : {\n\t\tok: false,\n\t\tcancelled: wasInterrupted(outcome.failure),\n\t\tcode: outcome.failure.code,\n\t\tmessage: outcome.failure.message\n\t}, opts.redaction);\n\tif (opts.reportPath === void 0 || writeRunReport(opts.reportPath, toRunReport({\n\t\tsummary: outcome.ok ? outcome.value : void 0,\n\t\tenvironment: opts.environment,\n\t\tfailure: outcome.ok ? void 0 : {\n\t\t\tcode: outcome.failure.code,\n\t\t\tmessage: outcome.failure.message\n\t\t}\n\t}))) opts.steps.finish({ name: \"record\" });\n\telse opts.steps.fail({ name: \"record\" });\n\treturn outcome;\n}\n/** The pipeline both actions share: validate, resolve containers, then for\n* deploy preflight and the in-process converge, and for destroy the stack\n* file, the alchemy child and the teardown/removal suffix. The value is only\n* ever a summary for deploy. */\nasync function runStackPipelineInner(action, opts, reporters) {\n\tconst { entry, config: composerConfig, name, environment, cwd, onEvent, deps, steps } = opts;\n\tsteps.start({ name: \"prepare\" });\n\tremoveLeftoverAppConfigurationFiles(cwd);\n\ttry {\n\t\tvalidateEnvironmentName(environment);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tlet appConvergeEntry;\n\tif (action === \"deploy\") {\n\t\tconst loaded = await prepareAppConvergeEntry(deps, path.dirname(path.resolve(cwd, composerConfig.file)));\n\t\tif (!loaded.ok) return loaded;\n\t\tappConvergeEntry = loaded.value;\n\t}\n\tconst platformCredentials = deps.credentials;\n\tif (action === \"destroy\" && hasNoLocalDeployState(cwd)) onEvent?.({\n\t\tkind: \"no-local-deploy-state\",\n\t\tcwd\n\t});\n\tlet pipeline;\n\tlet containers;\n\tlet alchemyStage;\n\tconst preflightPayloads = /* @__PURE__ */ new Map();\n\tconst unset = [];\n\tconst preflightTransportEnv = {};\n\ttry {\n\t\tpipeline = await runPipeline(entry, name, environment, cwd, composerConfig, {\n\t\t\trunAssembler: deps.runAssembler,\n\t\t\treadSecrets: action === \"deploy\",\n\t\t\tredaction: opts.redaction,\n\t\t\tonEvent: (event) => {\n\t\t\t\tswitch (event.kind) {\n\t\t\t\t\tcase \"loaded\":\n\t\t\t\t\t\tsteps.finish({ name: \"prepare\" });\n\t\t\t\t\t\tsteps.start({ name: \"assemble\" });\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"service-started\":\n\t\t\t\t\t\tsteps.start({\n\t\t\t\t\t\t\tname: \"assemble-service\",\n\t\t\t\t\t\t\taddress: event.address\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"service-assembled\":\n\t\t\t\t\t\tsteps.finish({\n\t\t\t\t\t\t\tname: \"assemble-service\",\n\t\t\t\t\t\t\taddress: event.address\n\t\t\t\t\t\t}, event.data);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}, action === \"destroy\" ? (error) => new CliStructuredError(\"DEPLOY.BUILD_REQUIRED\", error.message, {\n\t\t\twhy: \"destroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first.\",\n\t\t\tfix: \"Run the build, then retry the destroy.\",\n\t\t\tcause: error\n\t\t}) : void 0);\n\t\tsteps.finish({ name: \"assemble\" });\n\t\tconst { graph, name: resolvedName } = pipeline;\n\t\tconst config = pipeline.configSource.value;\n\t\tif (action === \"deploy\") refuseSecretsInRootInput(graph.appConfigurationRead, opts.redaction.knownSecrets, \"A deploy sends every plain value Load read to the platform as plain configuration, and never sends a secret that way.\");\n\t\tsteps.start({ name: \"connect\" });\n\t\tif (action === \"deploy\") reporters.push(...await beginReporters(config.extensions, {\n\t\t\tappName: resolvedName,\n\t\t\tgraph,\n\t\t\tenvironment,\n\t\t\tcwd,\n\t\t\treportId: opts.reportId,\n\t\t\tcredentials: platformCredentials\n\t\t}, opts.redaction));\n\t\tcontainers = /* @__PURE__ */ new Map();\n\t\tfor (const extension of config.extensions) {\n\t\t\tif (extension.container === void 0) continue;\n\t\t\ttry {\n\t\t\t\tif (action === \"deploy\") {\n\t\t\t\t\tconst instance = await extension.container.ensure({\n\t\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\t\tenvironment\n\t\t\t\t\t}, platformCredentials);\n\t\t\t\t\trequireContainerForEnvironment(action, extension.id, extension.container, instance, environment);\n\t\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t\t} else {\n\t\t\t\t\tconst instance = await extension.container.locate({\n\t\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\t\tenvironment\n\t\t\t\t\t}, platformCredentials);\n\t\t\t\t\tif (instance === void 0) throw new CliStructuredError(\"DEPLOY.TARGET_NOT_FOUND\", `Nothing deployed for ${resolvedName} in the environment ${environment}.`, { fix: \"Deploy it first.\" });\n\t\t\t\t\trequireContainerForEnvironment(action, extension.id, extension.container, instance, environment);\n\t\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_FAILED\", error);\n\t\t\t}\n\t\t}\n\t\tawait attachReporters(reporters, containers, opts.redaction);\n\t\talchemyStage = containers.get(config.state.extension)?.alchemyStage ?? environment;\n\t\tsteps.finish({ name: \"connect\" });\n\t\tif (action === \"deploy\") {\n\t\t\tsteps.start({ name: \"preflight\" });\n\t\t\tlet checked = 0;\n\t\t\tconst report = (reported) => {\n\t\t\t\tchecked += reported.checked;\n\t\t\t\tunset.push(...reported.unset.map((variable) => redactUnsetPlatformVariable(variable, opts.redaction)));\n\t\t\t};\n\t\t\tfor (const extension of config.extensions) {\n\t\t\t\tif (extension.preflight === void 0) continue;\n\t\t\t\ttry {\n\t\t\t\t\tconst payload = await extension.preflight({\n\t\t\t\t\t\tgraph,\n\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tconfiguration: pipeline.configuration,\n\t\t\t\t\t\tsecrets: pipeline.secrets,\n\t\t\t\t\t\tcredentials: platformCredentials,\n\t\t\t\t\t\treport\n\t\t\t\t\t});\n\t\t\t\t\tif (payload !== void 0) preflightPayloads.set(extension.id, payload);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow toStructured(\"DEPLOY.PREFLIGHT_FAILED\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsteps.finish({ name: \"preflight\" }, {\n\t\t\t\tchecked,\n\t\t\t\tunset: unset.length\n\t\t\t});\n\t\t\tif (unset.length > 0) steps.emit({\n\t\t\t\tkind: \"preflight-findings\",\n\t\t\t\tfindings: { unset }\n\t\t\t});\n\t\t}\n\t\tif (action === \"destroy\") for (const extension of config.extensions) preflightTransportEnv[preflightEnvVarName(extension.id)] = \"\";\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (appConvergeEntry !== void 0) return convergeDeploy(opts, pipeline, appConvergeEntry, {\n\t\tcontainers,\n\t\tstage: alchemyStage,\n\t\tpreflightPayloads,\n\t\tfindings: { unset },\n\t\tenv: reporterEnv(reporters, opts.redaction)\n\t});\n\tlet stackPath;\n\tconst resultFilePath = path.join(cwd, \".prisma-composer\", `deployment-result-${String(process.pid)}-${randomUUID()}.json`);\n\tlet handover;\n\ttry {\n\t\ttry {\n\t\t\thandover = prepareSecondProcess({\n\t\t\t\tfile: deployAppConfigurationFile(cwd, randomUUID()),\n\t\t\t\tappConfigurationRead: pipeline.graph.appConfigurationRead,\n\t\t\t\tplainVariableText: {},\n\t\t\t\tnodeAddresses: nodeAddresses(pipeline.graph),\n\t\t\t\tsecretsKeys: secretsKeys(pipeline.graph),\n\t\t\t\tknownSecrets: opts.redaction.knownSecrets\n\t\t\t});\n\t\t\tstackPath = writeStackFile({\n\t\t\t\tentryPath: pipeline.entryModule.path,\n\t\t\t\tcwd,\n\t\t\t\tconfigFile: pipeline.configSource.file,\n\t\t\t\tname: pipeline.name,\n\t\t\t\tenvironment,\n\t\t\t\tassembled: pipeline.assembled\n\t\t\t});\n\t\t\thandover.writeFile();\n\t\t} catch (error) {\n\t\t\treturn notOk(toStructured(\"DEPLOY.STACK_WRITE_FAILED\", error));\n\t\t}\n\t\tconst invocation = alchemyInvocation({\n\t\t\tcommand: action,\n\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\tcwd,\n\t\t\tstage: alchemyStage,\n\t\t\tcontainerEnv: containerEnv(containers),\n\t\t\tpreflightEnv: preflightTransportEnv,\n\t\t\tenv: {\n\t\t\t\t...reporterEnv(reporters, opts.redaction),\n\t\t\t\t...handover.env,\n\t\t\t\t[DEPLOYMENT_RESULT_FILE_ENV]: resultFilePath\n\t\t\t},\n\t\t\tredactedValues: opts.redaction.allValues()\n\t\t});\n\t\tsteps.start({ name: \"apply\" });\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await (deps.alchemy ?? spawnAlchemy)(invocation);\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\tmeta: { diagnostics: {\n\t\t\t\t\texitCode: void 0,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand: reproduceCommand(invocation),\n\t\t\t\t\tcwd\n\t\t\t\t} }\n\t\t\t}));\n\t\t}\n\t\tconst reproduce = reproduceCommand(invocation, outcome);\n\t\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} was interrupted by ${outcome.signal}.`, { meta: {\n\t\t\tsignal: outcome.signal,\n\t\t\tdiagnostics: {\n\t\t\t\texitCode: void 0,\n\t\t\t\tsignal: outcome.signal,\n\t\t\t\tstackFilePath: stackPath,\n\t\t\t\treproduceCommand: reproduce,\n\t\t\t\tcwd\n\t\t\t}\n\t\t} }));\n\t\tconst status = outcome.exitCode ?? 1;\n\t\tif (status !== 0) {\n\t\t\tconst engineCause = readEngineFailureCause(resultFilePath, (text) => opts.redaction.redact(text));\n\t\t\tconst withCause = (sentence) => engineCause === void 0 ? sentence : `${sentence}\\n${engineCause}`;\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", withCause(`alchemy ${action} exited with status ${status}.`), { meta: {\n\t\t\t\texitCode: status,\n\t\t\t\t...engineCause !== void 0 ? { engineCause } : {},\n\t\t\t\tdiagnostics: {\n\t\t\t\t\texitCode: status,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand: reproduce,\n\t\t\t\t\tcwd\n\t\t\t\t}\n\t\t\t} }));\n\t\t}\n\t\tsteps.finish({ name: \"apply\" });\n\t\ttry {\n\t\t\tif (action === \"destroy\") {\n\t\t\t\tfor (const extension of pipeline.configSource.value.extensions) {\n\t\t\t\t\tif (extension.teardown === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.teardown({\n\t\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\t\tenvironment\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.TEARDOWN_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const extension of pipeline.configSource.value.extensions) {\n\t\t\t\t\tif (extension.container === void 0) continue;\n\t\t\t\t\tconst instance = containers.get(extension.id);\n\t\t\t\t\tif (instance === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.container.remove(instance, platformCredentials);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_REMOVE_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\tthrow error;\n\t\t}\n\t\treturn ok(void 0);\n\t} finally {\n\t\ttry {\n\t\t\tfs.rmSync(resultFilePath, { force: true });\n\t\t\tfs.rmSync(engineFailureFilePath(resultFilePath), { force: true });\n\t\t} catch {}\n\t\thandover?.removeFile();\n\t}\n}\n/** Loaded before anything is created, so a missing or incompatible install fails first. */\nasync function prepareAppConvergeEntry(deps, appDir) {\n\ttry {\n\t\treturn ok(deps.appConvergeEntry ?? await loadAppConvergeEntry(appDir));\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n/** One Alchemy progress event as the deploy's step events: each resource is a step inside `apply`. */\nfunction reportConvergeEvent(steps, event, redact) {\n\tif (event.kind === \"log\") {\n\t\tsteps.message(event.severity, redact(withComposerAdvice(event.text)));\n\t\treturn;\n\t}\n\tconst step = {\n\t\tname: \"apply-resource\",\n\t\tresourceId: event.fqn,\n\t\tresourceType: event.resourceType,\n\t\tstatus: event.status\n\t};\n\tswitch (event.phase) {\n\t\tcase \"running\":\n\t\t\tif (!steps.isOpen(step)) steps.start(step);\n\t\t\treturn;\n\t\tcase \"done\":\n\t\t\tif (!steps.isOpen(step)) steps.start(step);\n\t\t\tsteps.finish(step);\n\t\t\treturn;\n\t\tcase \"failed\":\n\t\t\tif (!steps.isOpen(step)) steps.start(step);\n\t\t\tsteps.fail(step);\n\t\t\tif (event.message !== void 0) steps.message(\"warn\", redact(`${event.fqn}: ${withComposerAdvice(event.message)}`));\n\t\t\treturn;\n\t\tcase \"pending\": return;\n\t}\n}\nfunction reasonsText(reasons) {\n\treturn reasons.map(({ tag, message }) => tag === \"Error\" || tag === \"Unknown\" || message.startsWith(tag) ? message : `${tag}: ${message}`).join(\"\\n\");\n}\n/** The structured failure a converge that did not apply settles as. */\nfunction convergeFailure(outcome, redact) {\n\tswitch (outcome.kind) {\n\t\tcase \"interrupted\": return new CliStructuredError(\"DEPLOY.INTERRUPTED\", \"The deploy was interrupted.\", {\n\t\t\twhy: \"It stopped while Alchemy planned or applied it. Resources it had already changed stay as they are.\",\n\t\t\tfix: \"Deploy again to finish.\"\n\t\t});\n\t\tcase \"refused\": return outcome.reason === \"already-running\" ? new CliStructuredError(\"DEPLOY.CONVERGE_RUNNING\", \"Another deploy is already running in this process.\", {\n\t\t\twhy: \"A deploy sets the process's environment and working directory while Alchemy runs, so two cannot overlap.\",\n\t\t\tfix: \"Wait for the other deploy to finish, or run this one in its own process.\"\n\t\t}) : new CliStructuredError(\"DEPLOY.WORKER_THREAD\", \"Deploy cannot run in a worker thread when its cwd is not the process working directory.\", {\n\t\t\twhy: \"Alchemy reads `.env` and keeps `.alchemy` in the working directory, and a worker thread cannot change it.\",\n\t\t\tfix: \"Call deploy from the main thread, or with the process's working directory as its cwd.\"\n\t\t});\n\t\tcase \"failed\": {\n\t\t\tconst cause = capFailureCause(redact(withComposerAdvice(reasonsText(outcome.reasons))));\n\t\t\treturn new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `Alchemy could not deploy the app.\\n${cause}`, { meta: {\n\t\t\t\tengineCause: cause,\n\t\t\t\treasons: outcome.reasons.map(({ tag, message }) => ({\n\t\t\t\t\ttag,\n\t\t\t\t\tmessage: redact(message)\n\t\t\t\t}))\n\t\t\t} });\n\t\t}\n\t}\n\treturn new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", \"The converge ended with an outcome this Composer does not know.\");\n}\n/**\n* Alchemy's terminal text as `info` messages, one per complete line, redacted. A secret split\n* across writes or lines is still found, because the text passes through a `StreamRedactor`\n* before it is cut into lines. `end` sends the last line that has no line break.\n*/\nfunction interactionMessages(steps, redaction) {\n\tconst stream = new StreamRedactor(redaction.allValues());\n\tlet partial = \"\";\n\tconst send = (text, last) => {\n\t\tconst lines = (partial + text).split(\"\\n\");\n\t\tpartial = last ? \"\" : lines.pop() ?? \"\";\n\t\tfor (const line of lines) if (line.trim() !== \"\") steps.message(\"info\", redaction.redact(line));\n\t};\n\treturn {\n\t\tpush: (text) => send(stream.push(text), false),\n\t\tend: () => send(stream.end(), true)\n\t};\n}\n/**\n* Deploy's converge: lowers the app with the containers and preflight\n* payloads this run resolved, then plans and applies it in this process.\n* The report hook runs inside the apply, here, so the summary comes back as\n* a value.\n*/\nasync function convergeDeploy(opts, pipeline, entry, resolved) {\n\tconst { cwd, environment, steps } = opts;\n\tconst config = pipeline.configSource.value;\n\tconst env = resolved.env;\n\topts.redaction.addCredentialLookingValues(credentialLookingValues(env));\n\tconst redact = (text) => opts.redaction.redact(text);\n\tlet summary;\n\tconst root = pipeline.graph.root.node;\n\tif (root.kind !== \"module\") throw new InternalError(\"runPipeline admitted a root that is not a module\");\n\tsteps.start({ name: \"apply\" });\n\tlet stack;\n\ttry {\n\t\tstack = entry.lower(root, config, {\n\t\t\tname: pipeline.name,\n\t\t\tenvironment,\n\t\t\tappConfigurationRead: pipeline.graph.appConfigurationRead,\n\t\t\tfirstProcessNodeAddresses: nodeAddresses(pipeline.graph),\n\t\t\tbundles: pipeline.assembled.bundles,\n\t\t\tcontainers: resolved.containers,\n\t\t\tpreflightPayloads: resolved.preflightPayloads,\n\t\t\tfindings: resolved.findings,\n\t\t\tcredentials: opts.deps.credentials,\n\t\t\treport: (result) => {\n\t\t\t\tsummary = toDeploymentSummary(result);\n\t\t\t}\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", redact(error instanceof Error ? error.message : String(error))));\n\t}\n\tconst output = interactionMessages(steps, opts.redaction);\n\tlet outcome;\n\ttry {\n\t\toutcome = await entry.converge({\n\t\t\toperation: \"deploy\",\n\t\t\tstack,\n\t\t\tstage: resolved.stage,\n\t\t\tcwd,\n\t\t\tenv,\n\t\t\tsignal: opts.signal,\n\t\t\tonEvent: (event) => reportConvergeEvent(steps, event, redact),\n\t\t\toutput: (text) => output.push(text)\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", redact(`Alchemy could not deploy the app.\\n${error instanceof Error ? error.message : String(error)}`)));\n\t} finally {\n\t\toutput.end();\n\t}\n\tif (outcome.kind !== \"applied\") return notOk(convergeFailure(outcome, redact));\n\tsteps.finish({ name: \"apply\" });\n\treturn ok(redactSummary(summary, opts.redaction));\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-J0buFSWK.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAI,UAAU;AAGd,MAAM,QAAQ;AACd,MAAM,iBAAiB;;AAEvB,MAAM,wBAAwB;AAC9B,SAAS,aAAa,QAAQ,QAAQ,OAAO;CAC5C,OAAO,IAAI,mBAAmB,8BAA8B,mEAAmE,OAAO,KAAK,UAAU;EACpJ,KAAK;EACL,KAAK;EACL,GAAG,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM;CACpC,CAAC;AACF;AACA,SAAS,iBAAiB,SAAS;CAClC,IAAI;EACH,MAAM,SAAS,KAAK,MAAMA,KAAG,aAAa,QAAQ,QAAQ,+BAA+B,GAAG,MAAM,CAAC;EACnG,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,aAAa,UAAU,OAAO,OAAO,YAAY,WAAW,OAAO,UAAU,KAAK;CAC3I,QAAQ;EACP;CACD;AACD;AACA,eAAe,WAAW,QAAQ,MAAM;CACvC,IAAI;EACH,OAAO,MAAM,OAAO,cAAc,IAAI,CAAC,CAAC;CACzC,SAAS,OAAO;EACf,MAAM,aAAa,QAAQ,GAAG,KAAK,mBAAmB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,KAAK,KAAK;CACtH;AACD;AACA,SAAS,iBAAiB,MAAM,KAAK;CACpC,MAAM,aAAa,IAAI,WAAW;CAClC,MAAM,SAAS,IAAI,WAAW,KAAK,WAAW,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,OAAO,KAAK,SAAS;CACxD,IAAI;CACJ,IAAI;EACH,UAAU,MAAM,MAAM,SAAS;GAC9B,WAAW;GACX;GACA,OAAO,SAAS;GAChB;GACA;GACA,QAAQ,KAAK;GACb,UAAU,UAAU,oBAAoB,OAAO,OAAO,MAAM;GAC5D,SAAS,SAAS,OAAO,KAAK,IAAI;EACnC,CAAC;CACF,SAAS,OAAO;EACf,OAAO,MAAM,IAAI,mBAAmB,wBAAwB,OAAO,sCAAsC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,CAAC,CAAC;CACpK,UAAU;EACT,OAAO,IAAI;CACZ;CACA,IAAI,QAAQ,SAAS,WAAW,OAAO,MAAM,gBAAgB,SAAS,MAAM,CAAC;CAC7E,MAAM,OAAO,EAAE,MAAM,QAAQ,CAAC;CAC9B,OAAO,GAAG,cAAc,SAAS,KAAK,SAAS,CAAC;AACjD"}
@@ -4,7 +4,7 @@ import { a as preflightEnv, o as preflightEnvVarName, t as containerEnv } from "
4
4
  import { i as devEnvironmentDir } from "./app-config-CErnR6NK-D9NgSBH4.mjs";
5
5
  import { i as prepareSecondProcess, n as devAppConfigurationFile, s as removeLeftoverAppConfigurationFiles } from "./app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs";
6
6
  import "./deploy-NArSOken.mjs";
7
- import { c as toStructured, l as notOk, s as requireContainerForEnvironment, u as ok } from "./dev-current-Ce4Zhfiy-TY0NjkOZ.mjs";
7
+ import { c as toStructured, l as notOk, s as requireContainerForEnvironment, u as ok } from "./dev-current-Dp3jvXGN-C1Y2BAtC.mjs";
8
8
  import { r as resolveLocalTargets } from "./local-target-COdS1iNs.mjs";
9
9
  import { a as redactDevEvent, c as redactThrown, o as redactError, t as SecretRedaction } from "./redaction-CjMYXtGp-CEQ5z1PK.mjs";
10
10
  import { a as noComposerExportMessage, i as validateEnvironmentName, r as runPipeline } from "./validate-environment-XwVDifWN-BhPOzWN8.mjs";
@@ -1665,7 +1665,7 @@ var esm_default = {
1665
1665
  FSWatcher
1666
1666
  };
1667
1667
  //#endregion
1668
- //#region ../../0-framework/3-tooling/cli/dist/execute-dev-BBPgDWzf.mjs
1668
+ //#region ../../0-framework/3-tooling/cli/dist/execute-dev-B5YaMqpD.mjs
1669
1669
  const readKey = (read) => JSON.stringify([
1670
1670
  read.reader,
1671
1671
  read.resource,
@@ -2352,4 +2352,4 @@ async function executeDevInner(input, deps, cwd, redaction) {
2352
2352
  //#endregion
2353
2353
  export { executeDev };
2354
2354
 
2355
- //# sourceMappingURL=execute-dev-BBPgDWzf-BCSle0Mw.mjs.map
2355
+ //# sourceMappingURL=execute-dev-B5YaMqpD-BAxU6Smm.mjs.map