@prisma/composer 0.39.0-dev.12 → 0.39.0-dev.13

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.
Files changed (111) hide show
  1. package/dist/{app-config-DriAu5RU-C8hYpR38.d.mts → app-config-Dhypzb6a-C3Kb0XtS.d.mts} +35 -63
  2. package/dist/app-config-Dhypzb6a-C3Kb0XtS.d.mts.map +1 -0
  3. package/dist/{app-converge-DkTFs-ih-CAr2feEu.mjs → app-converge-CHMILMYi-JJnwJd2I.mjs} +5 -5
  4. package/dist/app-converge-CHMILMYi-JJnwJd2I.mjs.map +1 -0
  5. package/dist/config-D615fYD5.d.mts +1 -0
  6. package/dist/config.d.mts +3 -3
  7. package/dist/config.mjs +12 -2
  8. package/dist/config.mjs.map +1 -0
  9. package/dist/control.d.mts +236 -16
  10. package/dist/control.d.mts.map +1 -1
  11. package/dist/control.mjs +5 -5
  12. package/dist/control.mjs.map +1 -1
  13. package/dist/{converge-in-process-x89zb2MF-Dvj-J8xo.mjs → converge-in-process-CfeblFN9-B1KvX1Fa.mjs} +4 -4
  14. package/dist/{converge-in-process-x89zb2MF-Dvj-J8xo.mjs.map → converge-in-process-CfeblFN9-B1KvX1Fa.mjs.map} +1 -1
  15. package/dist/{converge-in-process-CTomEXaD-BnDylZP8.d.mts → converge-in-process-DZRf9uYm-Ohjvy0s_.d.mts} +6 -6
  16. package/dist/{converge-in-process-CTomEXaD-BnDylZP8.d.mts.map → converge-in-process-DZRf9uYm-Ohjvy0s_.d.mts.map} +1 -1
  17. package/dist/{deploy-DHgEJDpg.d.mts → deploy-CncPyRbo.d.mts} +4 -4
  18. package/dist/{deploy-DHgEJDpg.d.mts.map → deploy-CncPyRbo.d.mts.map} +1 -1
  19. package/dist/{deploy-CSU0kr4j.mjs → deploy-DPX4IXzF.mjs} +15 -43
  20. package/dist/deploy-DPX4IXzF.mjs.map +1 -0
  21. package/dist/deploy.d.mts +4 -4
  22. package/dist/deploy.mjs +3 -3
  23. package/dist/{dev-converge-messages-DML4rTz7-C_EAB5M_.mjs → dev-converge-messages-CElmPylA-BenEozC3.mjs} +7 -7
  24. package/dist/dev-converge-messages-CElmPylA-BenEozC3.mjs.map +1 -0
  25. package/dist/dev-converge-worker.mjs +3 -3
  26. package/dist/dev-converge-worker.mjs.map +1 -1
  27. package/dist/{dev-current-C7rT6Yxw-yJ1ORrSC.mjs → dev-current-C7R8uqyQ-CM3PrTGG.mjs} +8 -19
  28. package/dist/dev-current-C7R8uqyQ-CM3PrTGG.mjs.map +1 -0
  29. package/dist/{dist-Cf_mZHaH.mjs → dist-Bw5O9TDx.mjs} +2 -2
  30. package/dist/{dist-Cf_mZHaH.mjs.map → dist-Bw5O9TDx.mjs.map} +1 -1
  31. package/dist/execute-deploy-destroy-BIRdFfwR-BjLOxnQd.mjs +476 -0
  32. package/dist/execute-deploy-destroy-BIRdFfwR-BjLOxnQd.mjs.map +1 -0
  33. package/dist/{execute-dev-BtSLDMkv-DAXRcK9h.mjs → execute-dev-D9PxdbV3-CHISvcxU.mjs} +11 -15
  34. package/dist/execute-dev-D9PxdbV3-CHISvcxU.mjs.map +1 -0
  35. package/dist/{execute-dev-current-LEdiAZSw-CwM41ylY.mjs → execute-dev-current-BghQ0HLe-BC3mOHRQ.mjs} +4 -4
  36. package/dist/{execute-dev-current-LEdiAZSw-CwM41ylY.mjs.map → execute-dev-current-BghQ0HLe-BC3mOHRQ.mjs.map} +1 -1
  37. package/dist/{execute-log-CzzB35KD-BBHeeC1M.mjs → execute-log-Bg7v1TBv-DigUuQSN.mjs} +4 -4
  38. package/dist/{execute-log-CzzB35KD-BBHeeC1M.mjs.map → execute-log-Bg7v1TBv-DigUuQSN.mjs.map} +1 -1
  39. package/dist/{graph-D2WMLL43-CeiC5wdy.mjs → graph-BYo1OEqk-D5AtX8q4.mjs} +5 -5
  40. package/dist/graph-BYo1OEqk-D5AtX8q4.mjs.map +1 -0
  41. package/dist/{graph-CUYXjK8S-BzL-mhjq.d.mts → graph-CRFQxH8r-CI1p78T8.d.mts} +3 -3
  42. package/dist/graph-CRFQxH8r-CI1p78T8.d.mts.map +1 -0
  43. package/dist/{graph-types-D4PrtP-l-B0uuchTl.d.mts → graph-types-BeNeqIt4-LGyYX_Sm.d.mts} +9 -10
  44. package/dist/{graph-types-D4PrtP-l-B0uuchTl.d.mts.map → graph-types-BeNeqIt4-LGyYX_Sm.d.mts.map} +1 -1
  45. package/dist/http.d.mts +2 -2
  46. package/dist/http.mjs +2 -2
  47. package/dist/{index-D8chHe55.d.mts → index-DOJMK47O.d.mts} +3 -3
  48. package/dist/{index-D8chHe55.d.mts.map → index-DOJMK47O.d.mts.map} +1 -1
  49. package/dist/index.d.mts +3 -3
  50. package/dist/index.mjs +2 -2
  51. package/dist/internal-converge.d.mts +4 -4
  52. package/dist/internal-converge.mjs +2 -2
  53. package/dist/{load-entry-CEoVBdMj-CHOz7jKf.mjs → load-entry-CEoVBdMj-L1mXTtEO.mjs} +5 -5
  54. package/dist/load-entry-CEoVBdMj-L1mXTtEO.mjs.map +1 -0
  55. package/dist/{local-target-7KRsLMDO.d.mts → local-target-DZFvgvVK.d.mts} +2 -2
  56. package/dist/{local-target-7KRsLMDO.d.mts.map → local-target-DZFvgvVK.d.mts.map} +1 -1
  57. package/dist/local-target.d.mts +2 -2
  58. package/dist/{nextjs-DLyeRR7M-CzUbvPaJ.d.mts → nextjs-DLyeRR7M-C2z32CtL.d.mts} +3 -3
  59. package/dist/{nextjs-DLyeRR7M-CzUbvPaJ.d.mts.map → nextjs-DLyeRR7M-C2z32CtL.d.mts.map} +1 -1
  60. package/dist/nextjs-control.d.mts +4 -4
  61. package/dist/nextjs.d.mts +1 -1
  62. package/dist/node-control.d.mts +3 -3
  63. package/dist/node.d.mts +2 -2
  64. package/dist/{run-report-CmBz2-xc-Cc8rV1CX.mjs → run-report-HI2JqCSO-BWPG--nb.mjs} +5 -7
  65. package/dist/run-report-HI2JqCSO-BWPG--nb.mjs.map +1 -0
  66. package/dist/service-rpc.d.mts +2 -2
  67. package/dist/service-rpc.mjs +2 -2
  68. package/dist/steps-Det-FSAL-DRvo57Lf.mjs +174 -0
  69. package/dist/steps-Det-FSAL-DRvo57Lf.mjs.map +1 -0
  70. package/dist/testing.d.mts +1 -1
  71. package/dist/{validate-environment-DCZiNSlR-C7lv0cH1.mjs → validate-environment-BevPErw8-BDbXIt8U.mjs} +331 -9
  72. package/dist/validate-environment-BevPErw8-BDbXIt8U.mjs.map +1 -0
  73. package/package.json +11 -14
  74. package/skills/prisma-composer-core-concepts/SKILL.md +6 -23
  75. package/dist/app-config-DriAu5RU-C8hYpR38.d.mts.map +0 -1
  76. package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs +0 -186
  77. package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map +0 -1
  78. package/dist/app-converge-DkTFs-ih-CAr2feEu.mjs.map +0 -1
  79. package/dist/config-Bpi8QVLB.d.mts +0 -1
  80. package/dist/deploy-CSU0kr4j.mjs.map +0 -1
  81. package/dist/deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts +0 -33
  82. package/dist/deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts.map +0 -1
  83. package/dist/deployment-summary-CVJZn2v0-Dz-gX1rp.mjs +0 -153
  84. package/dist/deployment-summary-CVJZn2v0-Dz-gX1rp.mjs.map +0 -1
  85. package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs.map +0 -1
  86. package/dist/dev-current-C7rT6Yxw-yJ1ORrSC.mjs.map +0 -1
  87. package/dist/execute-deploy-destroy-C-aK5jh--D-AjLWc2.mjs +0 -855
  88. package/dist/execute-deploy-destroy-C-aK5jh--D-AjLWc2.mjs.map +0 -1
  89. package/dist/execute-dev-BtSLDMkv-DAXRcK9h.mjs.map +0 -1
  90. package/dist/graph-CUYXjK8S-BzL-mhjq.d.mts.map +0 -1
  91. package/dist/graph-D2WMLL43-CeiC5wdy.mjs.map +0 -1
  92. package/dist/internal-app-configuration-file.d.mts +0 -16
  93. package/dist/internal-app-configuration-file.d.mts.map +0 -1
  94. package/dist/internal-app-configuration-file.mjs +0 -2
  95. package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs.map +0 -1
  96. package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs +0 -90
  97. package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs.map +0 -1
  98. package/dist/redaction-DY6eDC12-W-FzW7_r.mjs +0 -339
  99. package/dist/redaction-DY6eDC12-W-FzW7_r.mjs.map +0 -1
  100. package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts +0 -232
  101. package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts.map +0 -1
  102. package/dist/report.d.mts +0 -19
  103. package/dist/report.d.mts.map +0 -1
  104. package/dist/report.mjs +0 -97
  105. package/dist/report.mjs.map +0 -1
  106. package/dist/run-report-CmBz2-xc-Cc8rV1CX.mjs.map +0 -1
  107. package/dist/steps-BZXNqW6U-C_ME2VLd.mjs +0 -112
  108. package/dist/steps-BZXNqW6U-C_ME2VLd.mjs.map +0 -1
  109. package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs.map +0 -1
  110. package/src/exports/internal-app-configuration-file.ts +0 -1
  111. package/src/exports/report.ts +0 -1
@@ -88,18 +88,7 @@ function okVoid() {
88
88
  return OK_VOID;
89
89
  }
90
90
  //#endregion
91
- //#region ../../0-framework/3-tooling/cli/dist/dev-current-C7rT6Yxw.mjs
92
- /**
93
- * Reads the execution diagnostics an engine-failure error carries in
94
- * `meta.diagnostics`; undefined for every other failure.
95
- */
96
- function executionDiagnostics(f) {
97
- const diagnostics = f.meta?.["diagnostics"];
98
- if (typeof diagnostics !== "object" || diagnostics === null) return void 0;
99
- const candidate = blindCast(diagnostics);
100
- if (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;
101
- return blindCast(diagnostics);
102
- }
91
+ //#region ../../0-framework/3-tooling/cli/dist/dev-current-C7R8uqyQ.mjs
103
92
  /**
104
93
  * Site-specific wrap for foreign extension/environment causes — passthrough
105
94
  * when already structured; never a boundary fallback (base-type rule 6(ii)).
@@ -134,8 +123,8 @@ const RUN_OF = {
134
123
  * An extension older than this Composer stores the input it is given but
135
124
  * resolves from a key without `environment`, so it may read every name as
136
125
  * production, or, locally, put every environment in one copy. Its
137
- * `deserialize` rebuilds only the fields it knows, so the container the
138
- * Alchemy child rebuilds shows which environment it really resolved.
126
+ * `deserialize` rebuilds only the fields it knows, so the container it
127
+ * rebuilds shows which environment it really resolved.
139
128
  * Refusing here keeps a mismatched install from deploying into, destroying
140
129
  * or running the wrong place.
141
130
  */
@@ -165,7 +154,7 @@ async function deployWithDeps(input, deps) {
165
154
  const cwd = input.cwd ?? process.cwd();
166
155
  let executor;
167
156
  try {
168
- executor = await import("./execute-deploy-destroy-C-aK5jh--D-AjLWc2.mjs");
157
+ executor = await import("./execute-deploy-destroy-BIRdFfwR-BjLOxnQd.mjs");
169
158
  } catch (error) {
170
159
  return notOk(executorLoadFailure("deploy", error));
171
160
  }
@@ -186,7 +175,7 @@ async function devWithDeps(input, deps) {
186
175
  const cwd = input.cwd ?? process.cwd();
187
176
  let executor;
188
177
  try {
189
- executor = await import("./execute-dev-BtSLDMkv-DAXRcK9h.mjs");
178
+ executor = await import("./execute-dev-D9PxdbV3-CHISvcxU.mjs");
190
179
  } catch (error) {
191
180
  return notOk(executorLoadFailure("dev", error));
192
181
  }
@@ -194,7 +183,7 @@ async function devWithDeps(input, deps) {
194
183
  }
195
184
  async function loadExecutor(operation) {
196
185
  try {
197
- return ok(await import("./execute-dev-current-LEdiAZSw-CwM41ylY.mjs"));
186
+ return ok(await import("./execute-dev-current-BghQ0HLe-BC3mOHRQ.mjs"));
198
187
  } catch (error) {
199
188
  return notOk(executorLoadFailure(operation, error));
200
189
  }
@@ -212,6 +201,6 @@ async function devStop(input) {
212
201
  return executor.value.executeDevStop(input, input.cwd ?? process.cwd());
213
202
  }
214
203
  //#endregion
215
- export { devUrl as a, requireContainerForEnvironment as c, ok as d, okVoid as f, devStop as i, toStructured as l, deploy as n, executionDiagnostics as o, dev as r, executorLoadFailure as s, convergeReasonsText as t, notOk as u };
204
+ export { devUrl as a, toStructured as c, okVoid as d, devStop as i, notOk as l, deploy as n, executorLoadFailure as o, dev as r, requireContainerForEnvironment as s, convergeReasonsText as t, ok as u };
216
205
 
217
- //# sourceMappingURL=dev-current-C7rT6Yxw-yJ1ORrSC.mjs.map
206
+ //# sourceMappingURL=dev-current-C7R8uqyQ-CM3PrTGG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-current-C7R8uqyQ-CM3PrTGG.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.mjs","../../../0-framework/3-tooling/cli/dist/dev-current-C7R8uqyQ.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 { notOk, ok } from \"@internal/foundation/result\";\n//#region src/operations/shared.ts\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 it\n* 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/** A failed converge's reasons as text, one per line, without a tag the message already starts with. */\nfunction convergeReasonsText(reasons) {\n\treturn reasons.map(({ tag, message }) => tag === \"Error\" || tag === \"Unknown\" || message.startsWith(tag) ? message : `${tag}: ${message}`).join(\"\\n\");\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-BIRdFfwR.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-D9PxdbV3.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-BghQ0HLe.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, convergeReasonsText 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-C7R8uqyQ.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;;;;CAIA,OAAO,MAAM,SAAS;EACrB,OAAO,UAAU,IAAI,WAAW,OAAO,OAAO,CAAC;CAChD;;;;;CAKA,WAAW;EACV,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACxE,OAAO,KAAK;CACb;;;;;CAKA,cAAc;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACvE,OAAO,KAAK;CACb;AACD;;;;AAIA,SAAS,GAAG,OAAO;CAClB,OAAO,WAAW,GAAG,KAAK;AAC3B;;;;AAIA,SAAS,MAAM,SAAS;CACvB,OAAO,WAAW,MAAM,OAAO;AAChC;;;;;AAKA,MAAM,UAAU,WAAW,GAAG,KAAK,CAAC;;;;;AAKpC,SAAS,SAAS;CACjB,OAAO;AACR;;;;;;;AChFA,SAAS,aAAa,MAAM,OAAO;CAClC,OAAO,mBAAmB,GAAG,KAAK,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descriptor of a param's schema for introspection — the
@@ -111,4 +111,4 @@ function hydrateSync(root, config) {
111
111
  //#endregion
112
112
  export { number as a, inputManifest as i, hydrate as n, param as o, hydrateSync as r, string as s, configOf as t };
113
113
 
114
- //# sourceMappingURL=dist-Cf_mZHaH.mjs.map
114
+ //# sourceMappingURL=dist-Bw5O9TDx.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dist-Cf_mZHaH.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/index.mjs"],"sourcesContent":["import { D as GraphCheckError, E as resolve, O as LoadError, S as valueResource, _ as provisionNeed, b as service, c as dependency, d as isParamSource, f as isProvisionNeed, g as paramSource, h as module, k as RESOURCE_OUT_PORT, l as freezeNode, m as isValueResource, n as assertAppName, o as ResourceNodeBase, p as isSecretSource, s as appRoot, t as Load, u as isNode, v as resource, w as isValue, x as slotsOf, y as secretSource } from \"./graph-D2WMLL43.mjs\";\nimport { isPlainPointer, isSecretPointer } from \"@internal/foundation/pointer\";\nimport { SecretBox, isSecretString } from \"@internal/foundation/secret\";\n//#region src/config.ts\n/**\n* A data-only descriptor of a param's schema for introspection — the\n* validator's vendor tag, never the schema's own `validate`. `configOf`\n* reports it where the old model reported `type: 'string' | 'number'`, so the\n* config surface stays enumerable without leaking a function. Nothing consumes\n* more than the vendor tag yet; a richer projection (e.g. a JSON-Schema export\n* when the vendor offers one) is an additive change if a consumer needs it.\n*/\nfunction projectSchema(schema) {\n\treturn { vendor: schema[\"~standard\"].vendor };\n}\n/**\n* Enumerates every config param the service declares: each input's connection\n* params, then the service's own params. Pure — reads `root.inputs`/`params`\n* directly, executes nothing but the (also pure) schema projection. Deliberately\n* does not go through `Load`: a service's connection-end inputs are legitimately\n* unwired from its own point of view (wiring is an enclosing module's concern),\n* and this introspects one service's declared shape regardless of how — or\n* whether — it composes into a larger graph.\n*/\nfunction configOf(root) {\n\tconst entries = [];\n\tfor (const [input, value] of Object.entries(root.inputs)) {\n\t\tif (typeof value !== \"object\" || value === null) continue;\n\t\tfor (const [name, param] of Object.entries(value.connection.params)) entries.push({\n\t\t\towner: { input },\n\t\t\tname,\n\t\t\tschema: projectSchema(param.schema),\n\t\t\toptional: param.optional === true,\n\t\t\tdefault: param.default\n\t\t});\n\t}\n\tfor (const [name, param] of Object.entries(root.params)) entries.push({\n\t\towner: \"service\",\n\t\tname,\n\t\tschema: projectSchema(param.schema),\n\t\toptional: param.optional === true,\n\t\tdefault: param.default\n\t});\n\treturn entries;\n}\n/**\n* The app's input manifest: every service input binding a `provision()` call\n* supplied (ADR-0042).\n*/\nfunction inputManifest(graph) {\n\treturn graph.inputBindings;\n}\nfunction scalarSchema(name, check) {\n\treturn { \"~standard\": {\n\t\tversion: 1,\n\t\tvendor: \"@prisma/composer\",\n\t\tvalidate: (value) => check(value) ? { value } : { issues: [{ message: `expected ${name}, got ${typeof value}` }] }\n\t} };\n}\nconst stringSchema = scalarSchema(\"string\", (v) => typeof v === \"string\");\nconst numberSchema = scalarSchema(\"number\", (v) => typeof v === \"number\" && Number.isFinite(v));\nfunction withFacets(schema, opts) {\n\treturn {\n\t\tschema,\n\t\t...opts.optional !== void 0 ? { optional: opts.optional } : {},\n\t\t...opts.default !== void 0 ? { default: opts.default } : {},\n\t\t...opts.provision !== void 0 ? { provision: opts.provision } : {}\n\t};\n}\n/** A string-valued param. */\nfunction string(opts = {}) {\n\treturn withFacets(stringSchema, opts);\n}\n/** A number-valued param. */\nfunction number(opts = {}) {\n\treturn withFacets(numberSchema, opts);\n}\n/** A param over any caller-supplied Standard Schema — a structured `jobs`, say. */\nfunction param(schema, opts = {}) {\n\treturn withFacets(schema, opts);\n}\n//#endregion\n//#region src/hydrate.ts\n/**\n* Given a service and a concrete typed Config, hydrate every input\n* (connection.hydrate with its typed value slice). A resource dep and a\n* connection dep hydrate through identical machinery — the loaded client is\n* indistinguishable. The service's own params ride alongside in\n* `config.service`; the node's `load()` merges the two.\n*/\nasync function hydrate(root, config) {\n\tconst deps = {};\n\tfor (const [name, inputNode] of Object.entries(root.inputs)) {\n\t\tconst values = config.inputs[name] ?? {};\n\t\tdeps[name] = await inputNode.connection.hydrate(values);\n\t}\n\treturn deps;\n}\n/**\n* Synchronous hydrate — what the node's `load()` uses so\n* `const { db } = service.load()` reads without `await`. Requires every\n* connection.hydrate to return synchronously; a Promise return is a loud error\n* naming the input (an async client factory must use the async `hydrate` path).\n*/\nfunction hydrateSync(root, config) {\n\tconst deps = {};\n\tfor (const [name, inputNode] of Object.entries(root.inputs)) {\n\t\tconst values = config.inputs[name] ?? {};\n\t\tconst client = inputNode.connection.hydrate(values);\n\t\tif (client instanceof Promise) throw new Error(`Connection hydrate for input \"${name}\" returned a Promise; load() requires a synchronous client factory.`);\n\t\tdeps[name] = client;\n\t}\n\treturn deps;\n}\n//#endregion\nexport { GraphCheckError, Load, LoadError, RESOURCE_OUT_PORT, ResourceNodeBase, SecretBox, appRoot, assertAppName, configOf, dependency, freezeNode, hydrate, hydrateSync, inputManifest, isNode, isParamSource, isPlainPointer, isProvisionNeed, isSecretPointer, isSecretSource, isSecretString, isValue, isValueResource, module, number, param, paramSource, provisionNeed, resolve, resource, secretSource, service, slotsOf, string, valueResource };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;AAYA,SAAS,cAAc,QAAQ;CAC9B,OAAO,EAAE,QAAQ,OAAO,YAAY,CAAC,OAAO;AAC7C;;;;;;;;;;AAUA,SAAS,SAAS,MAAM;CACvB,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,KAAK,MAAM,GAAG;EACzD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EACjD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,WAAW,MAAM,GAAG,QAAQ,KAAK;GACjF,OAAO,EAAE,MAAM;GACf;GACA,QAAQ,cAAc,MAAM,MAAM;GAClC,UAAU,MAAM,aAAa;GAC7B,SAAS,MAAM;EAChB,CAAC;CACF;CACA,KAA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,GAAG;EAC5D,MAAM,SAAS,OAAO,OAAO,SAAS,CAAC;EACvC,KAAK,QAAQ,MAAM,UAAU,WAAW,QAAQ,MAAM;CACvD;CACA,OAAO;AACR;;;;;;;AAOA,SAAS,YAAY,MAAM,QAAQ;CAClC,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,MAAM,cAAc,OAAO,QAAQ,KAAK,MAAM,GAAG;EAC5D,MAAM,SAAS,OAAO,OAAO,SAAS,CAAC;EACvC,MAAM,SAAS,UAAU,WAAW,QAAQ,MAAM;EAClD,IAAI,kBAAkB,SAAS,MAAM,IAAI,MAAM,iCAAiC,KAAK,oEAAoE;EACzJ,KAAK,QAAQ;CACd;CACA,OAAO;AACR"}
1
+ {"version":3,"file":"dist-Bw5O9TDx.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/index.mjs"],"sourcesContent":["import { D as GraphCheckError, E as resolve, O as LoadError, S as valueResource, _ as provisionNeed, b as service, c as dependency, d as isParamSource, f as isProvisionNeed, g as paramSource, h as module, k as RESOURCE_OUT_PORT, l as freezeNode, m as isValueResource, n as assertAppName, o as ResourceNodeBase, p as isSecretSource, s as appRoot, t as Load, u as isNode, v as resource, w as isValue, x as slotsOf, y as secretSource } from \"./graph-BYo1OEqk.mjs\";\nimport { isPlainPointer, isSecretPointer } from \"@internal/foundation/pointer\";\nimport { SecretBox, isSecretString } from \"@internal/foundation/secret\";\n//#region src/config.ts\n/**\n* A data-only descriptor of a param's schema for introspection — the\n* validator's vendor tag, never the schema's own `validate`. `configOf`\n* reports it where the old model reported `type: 'string' | 'number'`, so the\n* config surface stays enumerable without leaking a function. Nothing consumes\n* more than the vendor tag yet; a richer projection (e.g. a JSON-Schema export\n* when the vendor offers one) is an additive change if a consumer needs it.\n*/\nfunction projectSchema(schema) {\n\treturn { vendor: schema[\"~standard\"].vendor };\n}\n/**\n* Enumerates every config param the service declares: each input's connection\n* params, then the service's own params. Pure — reads `root.inputs`/`params`\n* directly, executes nothing but the (also pure) schema projection. Deliberately\n* does not go through `Load`: a service's connection-end inputs are legitimately\n* unwired from its own point of view (wiring is an enclosing module's concern),\n* and this introspects one service's declared shape regardless of how — or\n* whether — it composes into a larger graph.\n*/\nfunction configOf(root) {\n\tconst entries = [];\n\tfor (const [input, value] of Object.entries(root.inputs)) {\n\t\tif (typeof value !== \"object\" || value === null) continue;\n\t\tfor (const [name, param] of Object.entries(value.connection.params)) entries.push({\n\t\t\towner: { input },\n\t\t\tname,\n\t\t\tschema: projectSchema(param.schema),\n\t\t\toptional: param.optional === true,\n\t\t\tdefault: param.default\n\t\t});\n\t}\n\tfor (const [name, param] of Object.entries(root.params)) entries.push({\n\t\towner: \"service\",\n\t\tname,\n\t\tschema: projectSchema(param.schema),\n\t\toptional: param.optional === true,\n\t\tdefault: param.default\n\t});\n\treturn entries;\n}\n/**\n* The app's input manifest: every service input binding a `provision()` call\n* supplied (ADR-0042).\n*/\nfunction inputManifest(graph) {\n\treturn graph.inputBindings;\n}\nfunction scalarSchema(name, check) {\n\treturn { \"~standard\": {\n\t\tversion: 1,\n\t\tvendor: \"@prisma/composer\",\n\t\tvalidate: (value) => check(value) ? { value } : { issues: [{ message: `expected ${name}, got ${typeof value}` }] }\n\t} };\n}\nconst stringSchema = scalarSchema(\"string\", (v) => typeof v === \"string\");\nconst numberSchema = scalarSchema(\"number\", (v) => typeof v === \"number\" && Number.isFinite(v));\nfunction withFacets(schema, opts) {\n\treturn {\n\t\tschema,\n\t\t...opts.optional !== void 0 ? { optional: opts.optional } : {},\n\t\t...opts.default !== void 0 ? { default: opts.default } : {},\n\t\t...opts.provision !== void 0 ? { provision: opts.provision } : {}\n\t};\n}\n/** A string-valued param. */\nfunction string(opts = {}) {\n\treturn withFacets(stringSchema, opts);\n}\n/** A number-valued param. */\nfunction number(opts = {}) {\n\treturn withFacets(numberSchema, opts);\n}\n/** A param over any caller-supplied Standard Schema — a structured `jobs`, say. */\nfunction param(schema, opts = {}) {\n\treturn withFacets(schema, opts);\n}\n//#endregion\n//#region src/hydrate.ts\n/**\n* Given a service and a concrete typed Config, hydrate every input\n* (connection.hydrate with its typed value slice). A resource dep and a\n* connection dep hydrate through identical machinery — the loaded client is\n* indistinguishable. The service's own params ride alongside in\n* `config.service`; the node's `load()` merges the two.\n*/\nasync function hydrate(root, config) {\n\tconst deps = {};\n\tfor (const [name, inputNode] of Object.entries(root.inputs)) {\n\t\tconst values = config.inputs[name] ?? {};\n\t\tdeps[name] = await inputNode.connection.hydrate(values);\n\t}\n\treturn deps;\n}\n/**\n* Synchronous hydrate — what the node's `load()` uses so\n* `const { db } = service.load()` reads without `await`. Requires every\n* connection.hydrate to return synchronously; a Promise return is a loud error\n* naming the input (an async client factory must use the async `hydrate` path).\n*/\nfunction hydrateSync(root, config) {\n\tconst deps = {};\n\tfor (const [name, inputNode] of Object.entries(root.inputs)) {\n\t\tconst values = config.inputs[name] ?? {};\n\t\tconst client = inputNode.connection.hydrate(values);\n\t\tif (client instanceof Promise) throw new Error(`Connection hydrate for input \"${name}\" returned a Promise; load() requires a synchronous client factory.`);\n\t\tdeps[name] = client;\n\t}\n\treturn deps;\n}\n//#endregion\nexport { GraphCheckError, Load, LoadError, RESOURCE_OUT_PORT, ResourceNodeBase, SecretBox, appRoot, assertAppName, configOf, dependency, freezeNode, hydrate, hydrateSync, inputManifest, isNode, isParamSource, isPlainPointer, isProvisionNeed, isSecretPointer, isSecretSource, isSecretString, isValue, isValueResource, module, number, param, paramSource, provisionNeed, resolve, resource, secretSource, service, slotsOf, string, valueResource };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;AAYA,SAAS,cAAc,QAAQ;CAC9B,OAAO,EAAE,QAAQ,OAAO,YAAY,CAAC,OAAO;AAC7C;;;;;;;;;;AAUA,SAAS,SAAS,MAAM;CACvB,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,KAAK,MAAM,GAAG;EACzD,IAAI,OAAO,UAAU,YAAY,UAAU,M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IAAI;AACrC;;AAEA,SAAS,MAAM,QAAQ,OAAO,CAAC,GAAG;CACjC,OAAO,WAAW,QAAQ,IAAI;AAC/B;;;;;;;;AAUA,eAAe,QAAQ,MAAM,QAAQ;CACpC,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,MAAM,cAAc,OAAO,QAAQ,KAAK,MAAM,GAAG;EAC5D,MAAM,SAAS,OAAO,OAAO,SAAS,CAAC;EACvC,KAAK,QAAQ,MAAM,UAAU,WAAW,QAAQ,MAAM;CACvD;CACA,OAAO;AACR;;;;;;;AAOA,SAAS,YAAY,MAAM,QAAQ;CAClC,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,MAAM,cAAc,OAAO,QAAQ,KAAK,MAAM,GAAG;EAC5D,MAAM,SAAS,OAAO,OAAO,SAAS,CAAC;EACvC,MAAM,SAAS,UAAU,WAAW,QAAQ,MAAM;EAClD,IAAI,kBAAkB,SAAS,MAAM,IAAI,MAAM,iCAAiC,KAAK,oEAAoE;EACzJ,KAAK,QAAQ;CACd;CACA,OAAO;AACR"}
@@ -0,0 +1,476 @@
1
+ import { y as nodeAddresses } from "./graph-BYo1OEqk-D5AtX8q4.mjs";
2
+ import { t as InternalError } from "./internal-error-Dfur7Zqt-D96dWHZK.mjs";
3
+ import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
4
+ import "./deploy-DPX4IXzF.mjs";
5
+ import { c as toStructured, d as okVoid, l as notOk, s as requireContainerForEnvironment, t as convergeReasonsText, u as ok } from "./dev-current-C7R8uqyQ-CM3PrTGG.mjs";
6
+ import { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from "./run-report-HI2JqCSO-BWPG--nb.mjs";
7
+ import { t as loadAppConvergeEntry } from "./app-converge-CHMILMYi-JJnwJd2I.mjs";
8
+ import { a as SecretRedaction, d as redactThrown, f as redactUnsetPlatformVariable, i as validateEnvironmentName, l as redactError, r as runPipeline, s as credentialLookingValues, u as redactSummary } from "./validate-environment-BevPErw8-BDbXIt8U.mjs";
9
+ import { a as reportConvergeEvent, c as withComposerAdvice, i as refuseSecretsInRootInput, n as interactionMessages, o as stepTracker, s as toDeploymentSummary, t as capFailureCause } from "./steps-Det-FSAL-DRvo57Lf.mjs";
10
+ import * as path$1 from "node:path";
11
+ import * as fs$1 from "node:fs";
12
+ //#region ../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-BIRdFfwR.mjs
13
+ /**
14
+ * The deploy/destroy executor — main.ts's pipeline orchestration with argv,
15
+ * console, and exit codes removed: typed inputs in, structured results out.
16
+ * Reached only by lazy import from deploy.ts/destroy.ts — this module's
17
+ * static graph transitively loads alchemy's provider tree, so the control
18
+ * entry must never import it statically.
19
+ */
20
+ const ALCHEMY_STATE_DIR = ".alchemy";
21
+ /** Destroy guardrail (moved from main.ts): true when `<cwd>/.alchemy` is missing or empty — likely wrong directory or nothing deployed yet. */
22
+ function hasNoLocalDeployState(cwd) {
23
+ const stateDir = path$1.join(cwd, ALCHEMY_STATE_DIR);
24
+ return !(fs$1.existsSync(stateDir) && fs$1.readdirSync(stateDir).length > 0);
25
+ }
26
+ /** Times each step for the host's `onEvent`. A step still open when the run fails is closed as failed, innermost first. */
27
+ function stackSteps(onEvent) {
28
+ return stepTracker((step) => step.name === "assemble-service" ? `${step.name}:${step.address}` : step.name === "apply-resource" ? `${step.name}:${step.resourceId}` : step.name, onEvent);
29
+ }
30
+ async function executeDeploy(input, deps, cwd) {
31
+ const outcome = await runStackPipeline({
32
+ action: "deploy",
33
+ steps: stackSteps(input.onEvent)
34
+ }, {
35
+ entry: input.entry,
36
+ config: input.config,
37
+ name: input.name,
38
+ environment: input.environment ?? "production",
39
+ cwd,
40
+ deps,
41
+ reportId: input.reportId,
42
+ reportPath: resolveRunReportPath(input.reportPath, process.env[RUN_REPORT_FILE_ENV], cwd),
43
+ signal: input.signal,
44
+ redaction: deps.redaction ?? new SecretRedaction(process.env)
45
+ });
46
+ if (!outcome.ok) return outcome;
47
+ return ok({ summary: outcome.value });
48
+ }
49
+ async function executeDestroy(input, deps, cwd) {
50
+ const outcome = await runStackPipeline({
51
+ action: "destroy",
52
+ steps: stackSteps(input.onEvent)
53
+ }, {
54
+ entry: input.entry,
55
+ config: input.config,
56
+ name: input.name,
57
+ environment: input.environment,
58
+ cwd,
59
+ deps,
60
+ reportId: void 0,
61
+ reportPath: void 0,
62
+ signal: input.signal,
63
+ redaction: deps.redaction ?? new SecretRedaction(process.env)
64
+ });
65
+ if (!outcome.ok) return outcome;
66
+ return okVoid();
67
+ }
68
+ /**
69
+ * Opens a session per extension that declares a reporter. A `begin` that
70
+ * throws costs that extension its reporting and nothing else — the deploy
71
+ * has not started, and refusing to run it because an observer failed would
72
+ * invert the relationship.
73
+ */
74
+ async function beginReporters(extensions, context, redaction) {
75
+ return (await Promise.all(extensions.map(async (extension) => {
76
+ if (extension.reporter === void 0) return void 0;
77
+ try {
78
+ const reporter = await extension.reporter.begin(context);
79
+ return reporter === void 0 ? void 0 : {
80
+ extensionId: extension.id,
81
+ reporter
82
+ };
83
+ } catch (error) {
84
+ const detail = error instanceof Error ? error.message : String(error);
85
+ console.warn(`\nCould not start deploy reporting for ${extension.id}: ${redaction.redact(detail)}`);
86
+ return;
87
+ }
88
+ }))).filter((entry) => entry !== void 0);
89
+ }
90
+ /** Hands each session its own extension's resolved container, so it can attach the run to what that container names. */
91
+ async function attachReporters(reporters, containers, redaction) {
92
+ await Promise.all(reporters.map(async ({ extensionId, reporter }) => {
93
+ try {
94
+ await reporter.attach({ container: containers.get(extensionId) });
95
+ } catch (error) {
96
+ const detail = error instanceof Error ? error.message : String(error);
97
+ console.warn(`\nCould not attach this deploy to its project for ${extensionId}: ${redaction.redact(detail)}`);
98
+ }
99
+ }));
100
+ }
101
+ /** Every session's contribution to the apply's environment, so reporting that happens inside the apply can find the run. */
102
+ function reporterEnv(reporters, redaction) {
103
+ const env = {};
104
+ for (const { extensionId, reporter } of reporters) try {
105
+ Object.assign(env, reporter.childEnv());
106
+ } catch (error) {
107
+ const detail = error instanceof Error ? error.message : String(error);
108
+ console.warn(`\nCould not pass deploy reporting into the apply for ${extensionId}: ${redaction.redact(detail)}`);
109
+ }
110
+ return env;
111
+ }
112
+ /** `failingStep` is capped at 500 by the platform and `errorMessage` at 5000; truncating here keeps a long message from costing the whole report. */
113
+ function truncate(value, limit) {
114
+ return value.length <= limit ? value : `${value.slice(0, limit - 1)}…`;
115
+ }
116
+ /** An interrupted converge — reported as `cancelled`, never as `failed`. */
117
+ function wasInterrupted(failure) {
118
+ return failure.code === "DEPLOY.INTERRUPTED";
119
+ }
120
+ /**
121
+ * Ends every reporting session, whatever the run did. Sessions never reject
122
+ * by contract, but a buggy one must not turn a converged deploy into a
123
+ * failure — so this swallows anyway, and reports each session independently
124
+ * so one bad implementation cannot silence another.
125
+ */
126
+ async function finishReporters(reporters, outcome, redaction) {
127
+ const entities = outcome.summary?.nodes.flatMap((node) => node.entities) ?? [];
128
+ await Promise.all(reporters.map(async ({ reporter }) => {
129
+ try {
130
+ await reporter.finish({
131
+ ok: outcome.ok,
132
+ cancelled: outcome.cancelled,
133
+ failingStep: outcome.code === void 0 ? void 0 : truncate(outcome.code, 500),
134
+ errorMessage: outcome.message === void 0 ? void 0 : truncate(outcome.message, 5e3),
135
+ entities
136
+ });
137
+ } catch (error) {
138
+ const detail = error instanceof Error ? error.message : String(error);
139
+ console.warn(`\nCould not report this deploy's outcome: ${redaction.redact(detail)}`);
140
+ }
141
+ }));
142
+ }
143
+ /**
144
+ * Owns the reporting sessions around the pipeline: the inner run opens them
145
+ * once it knows which extensions are configured, and this closes them on
146
+ * every exit path — a returned failure, a success, or a thrown defect — as
147
+ * the `record` step, which also writes the run report.
148
+ * Nothing here can change what the pipeline returns.
149
+ */
150
+ async function runStackPipeline(run, opts) {
151
+ const steps = run.steps;
152
+ const reporters = [];
153
+ let outcome;
154
+ try {
155
+ outcome = await runStackPipelineInner(run, opts, reporters);
156
+ } catch (error) {
157
+ steps.closeOpen("failed");
158
+ steps.start({ name: "record" });
159
+ const thrown = redactThrown(error, opts.redaction);
160
+ await finishReporters(reporters, {
161
+ ok: false,
162
+ cancelled: false,
163
+ code: "DEPLOY.UNEXPECTED",
164
+ message: thrown.message
165
+ }, opts.redaction);
166
+ steps.finish({ name: "record" });
167
+ throw thrown;
168
+ }
169
+ if (!outcome.ok) outcome = notOk(redactError(outcome.failure, opts.redaction));
170
+ if (!outcome.ok) steps.closeOpen("failed");
171
+ steps.start({ name: "record" });
172
+ await finishReporters(reporters, outcome.ok ? {
173
+ ok: true,
174
+ cancelled: false,
175
+ summary: outcome.value
176
+ } : {
177
+ ok: false,
178
+ cancelled: wasInterrupted(outcome.failure),
179
+ code: outcome.failure.code,
180
+ message: outcome.failure.message
181
+ }, opts.redaction);
182
+ if (opts.reportPath === void 0 || writeRunReport(opts.reportPath, toRunReport({
183
+ summary: outcome.ok ? outcome.value : void 0,
184
+ environment: opts.environment,
185
+ failure: outcome.ok ? void 0 : {
186
+ code: outcome.failure.code,
187
+ message: outcome.failure.message
188
+ }
189
+ }))) steps.finish({ name: "record" });
190
+ else steps.fail({ name: "record" });
191
+ return outcome;
192
+ }
193
+ /** The pipeline both actions share: validate, load, assemble, resolve
194
+ * containers, then the in-process converge; deploy runs its preflight before
195
+ * the converge, and destroy its teardowns and container removals after it.
196
+ * The value is only ever a summary for deploy. */
197
+ async function runStackPipelineInner(run, opts, reporters) {
198
+ const { entry, config: composerConfig, name, environment, cwd, deps } = opts;
199
+ const { action } = run;
200
+ const steps = run.steps;
201
+ steps.start({ name: "prepare" });
202
+ try {
203
+ validateEnvironmentName(environment);
204
+ } catch (error) {
205
+ if (CliStructuredError.is(error)) return notOk(error);
206
+ throw error;
207
+ }
208
+ if (run.action === "destroy" && hasNoLocalDeployState(cwd)) run.steps.emit({
209
+ kind: "no-local-deploy-state",
210
+ cwd
211
+ });
212
+ const loaded = await prepareAppConvergeEntry(deps, path$1.dirname(path$1.resolve(cwd, composerConfig.file)));
213
+ if (!loaded.ok) return loaded;
214
+ const appConvergeEntry = loaded.value;
215
+ const platformCredentials = deps.credentials;
216
+ let pipeline;
217
+ let containers;
218
+ let alchemyStage;
219
+ const preflightPayloads = /* @__PURE__ */ new Map();
220
+ const unset = [];
221
+ try {
222
+ pipeline = await runPipeline(entry, name, environment, cwd, composerConfig, {
223
+ runAssembler: deps.runAssembler,
224
+ readSecrets: action === "deploy",
225
+ redaction: opts.redaction,
226
+ onEvent: (event) => {
227
+ switch (event.kind) {
228
+ case "loaded":
229
+ steps.finish({ name: "prepare" });
230
+ steps.start({ name: "assemble" });
231
+ return;
232
+ case "service-started":
233
+ steps.start({
234
+ name: "assemble-service",
235
+ address: event.address
236
+ });
237
+ return;
238
+ case "service-assembled":
239
+ steps.finish({
240
+ name: "assemble-service",
241
+ address: event.address
242
+ }, event.data);
243
+ return;
244
+ }
245
+ }
246
+ }, action === "destroy" ? (error) => new CliStructuredError("DEPLOY.BUILD_REQUIRED", error.message, {
247
+ why: "Destroy runs the same preparation as deploy before it locates the environment, and that preparation assembles the built app.",
248
+ fix: "Run the build, then retry the destroy.",
249
+ cause: error
250
+ }) : void 0);
251
+ steps.finish({ name: "assemble" });
252
+ const { graph, name: resolvedName } = pipeline;
253
+ const config = pipeline.configSource.value;
254
+ if (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.");
255
+ steps.start({ name: "connect" });
256
+ if (action === "deploy") reporters.push(...await beginReporters(config.extensions, {
257
+ appName: resolvedName,
258
+ graph,
259
+ environment,
260
+ cwd,
261
+ reportId: opts.reportId,
262
+ credentials: platformCredentials
263
+ }, opts.redaction));
264
+ containers = /* @__PURE__ */ new Map();
265
+ for (const extension of config.extensions) {
266
+ if (extension.container === void 0) continue;
267
+ try {
268
+ if (action === "deploy") {
269
+ const instance = await extension.container.ensure({
270
+ appName: resolvedName,
271
+ environment
272
+ }, platformCredentials);
273
+ requireContainerForEnvironment(action, extension.id, extension.container, instance, environment);
274
+ containers.set(extension.id, instance);
275
+ } else {
276
+ const instance = await extension.container.locate({
277
+ appName: resolvedName,
278
+ environment
279
+ }, platformCredentials);
280
+ if (instance === void 0) throw new CliStructuredError("DEPLOY.TARGET_NOT_FOUND", `Nothing deployed for ${resolvedName} in the environment ${environment}.`, { fix: "Deploy it first." });
281
+ requireContainerForEnvironment(action, extension.id, extension.container, instance, environment);
282
+ containers.set(extension.id, instance);
283
+ }
284
+ } catch (error) {
285
+ throw toStructured("DEPLOY.CONTAINER_FAILED", error);
286
+ }
287
+ }
288
+ await attachReporters(reporters, containers, opts.redaction);
289
+ alchemyStage = containers.get(config.state.extension)?.alchemyStage ?? environment;
290
+ steps.finish({ name: "connect" });
291
+ if (run.action === "deploy") {
292
+ run.steps.start({ name: "preflight" });
293
+ let checked = 0;
294
+ const report = (reported) => {
295
+ checked += reported.checked;
296
+ unset.push(...reported.unset.map((variable) => redactUnsetPlatformVariable(variable, opts.redaction)));
297
+ };
298
+ for (const extension of config.extensions) {
299
+ if (extension.preflight === void 0) continue;
300
+ try {
301
+ const payload = await extension.preflight({
302
+ graph,
303
+ container: containers.get(extension.id),
304
+ environment,
305
+ configuration: pipeline.configuration,
306
+ secrets: pipeline.secrets,
307
+ credentials: platformCredentials,
308
+ report
309
+ });
310
+ if (payload !== void 0) preflightPayloads.set(extension.id, payload);
311
+ } catch (error) {
312
+ throw toStructured("DEPLOY.PREFLIGHT_FAILED", error);
313
+ }
314
+ }
315
+ run.steps.finish({ name: "preflight" }, {
316
+ checked,
317
+ unset: unset.length
318
+ });
319
+ if (unset.length > 0) run.steps.emit({
320
+ kind: "preflight-findings",
321
+ findings: { unset }
322
+ });
323
+ }
324
+ } catch (error) {
325
+ if (CliStructuredError.is(error)) return notOk(error);
326
+ throw error;
327
+ }
328
+ const converged = await convergeStack(action, opts, steps, pipeline, appConvergeEntry, {
329
+ containers,
330
+ stage: alchemyStage,
331
+ preflightPayloads,
332
+ findings: { unset },
333
+ env: action === "deploy" ? reporterEnv(reporters, opts.redaction) : {}
334
+ });
335
+ if (action === "deploy" || !converged.ok) return converged;
336
+ try {
337
+ for (const extension of pipeline.configSource.value.extensions) {
338
+ if (extension.teardown === void 0) continue;
339
+ try {
340
+ await extension.teardown({
341
+ container: containers.get(extension.id),
342
+ environment
343
+ });
344
+ } catch (error) {
345
+ throw toStructured("DEPLOY.TEARDOWN_FAILED", error);
346
+ }
347
+ }
348
+ for (const extension of pipeline.configSource.value.extensions) {
349
+ if (extension.container === void 0) continue;
350
+ const instance = containers.get(extension.id);
351
+ if (instance === void 0) continue;
352
+ try {
353
+ await extension.container.remove(instance, platformCredentials);
354
+ } catch (error) {
355
+ throw toStructured("DEPLOY.CONTAINER_REMOVE_FAILED", error);
356
+ }
357
+ }
358
+ } catch (error) {
359
+ if (CliStructuredError.is(error)) return notOk(error);
360
+ throw error;
361
+ }
362
+ return ok(void 0);
363
+ }
364
+ /** Loaded before anything is created, so a missing or incompatible install fails first. */
365
+ async function prepareAppConvergeEntry(deps, appDir) {
366
+ try {
367
+ return ok(deps.appConvergeEntry ?? await loadAppConvergeEntry(appDir));
368
+ } catch (error) {
369
+ if (CliStructuredError.is(error)) return notOk(error);
370
+ throw error;
371
+ }
372
+ }
373
+ const WORDS = {
374
+ deploy: {
375
+ action: "deploy",
376
+ Action: "Deploy"
377
+ },
378
+ destroy: {
379
+ action: "destroy",
380
+ Action: "Destroy"
381
+ }
382
+ };
383
+ /** The structured failure a converge that did not apply settles as. */
384
+ function convergeFailure(action, outcome, redact) {
385
+ const words = WORDS[action];
386
+ switch (outcome.kind) {
387
+ case "interrupted": return new CliStructuredError("DEPLOY.INTERRUPTED", `The ${words.action} was interrupted.`, {
388
+ why: "It stopped while Alchemy planned or applied it. Resources it had already changed stay as they are.",
389
+ fix: `${words.Action} again to finish.`
390
+ });
391
+ case "refused": return outcome.reason === "already-running" ? new CliStructuredError("DEPLOY.CONVERGE_RUNNING", "Another deploy, destroy or `prisma dev` converge is already running in this process.", {
392
+ why: `A ${words.action} sets the process's environment and working directory while Alchemy runs, so two cannot overlap.`,
393
+ fix: `Wait for the other one to finish, or run this ${words.action} in its own process.`
394
+ }) : new CliStructuredError("DEPLOY.WORKER_THREAD", `${words.Action} cannot run in a worker thread when its cwd is not the process working directory.`, {
395
+ why: "Alchemy reads `.env` and keeps `.alchemy` in the working directory, and a worker thread cannot change it.",
396
+ fix: `Call ${words.action} from the main thread, or with the process's working directory as its cwd.`
397
+ });
398
+ case "failed": {
399
+ const cause = capFailureCause(redact(withComposerAdvice(convergeReasonsText(outcome.reasons))));
400
+ return new CliStructuredError("DEPLOY.ENGINE_FAILED", `Alchemy could not ${words.action} the app.\n${cause}`, { meta: {
401
+ engineCause: cause,
402
+ reasons: outcome.reasons.map(({ tag, message }) => ({
403
+ tag,
404
+ message: redact(message)
405
+ }))
406
+ } });
407
+ }
408
+ }
409
+ return new CliStructuredError("DEPLOY.ENGINE_FAILED", "The converge ended with an outcome this Composer does not know.");
410
+ }
411
+ /**
412
+ * Lowers the app with the containers and preflight payloads this run
413
+ * resolved, then plans and applies `action` in this process. A deploy's
414
+ * report hook runs inside the apply, here, so its summary comes back as a
415
+ * value.
416
+ */
417
+ async function convergeStack(action, opts, steps, pipeline, entry, resolved) {
418
+ const { cwd, environment } = opts;
419
+ const config = pipeline.configSource.value;
420
+ const env = resolved.env;
421
+ opts.redaction.addCredentialLookingValues(credentialLookingValues(env));
422
+ const redact = (text) => opts.redaction.redact(text);
423
+ let summary;
424
+ const report = (result) => {
425
+ summary = toDeploymentSummary(result);
426
+ };
427
+ const root = pipeline.graph.root.node;
428
+ if (root.kind !== "module") throw new InternalError("runPipeline admitted a root that is not a module");
429
+ steps.start({ name: "apply" });
430
+ let stack;
431
+ try {
432
+ stack = entry.lower(root, config, {
433
+ name: pipeline.name,
434
+ environment,
435
+ appConfigurationRead: pipeline.graph.appConfigurationRead,
436
+ preparedNodeAddresses: nodeAddresses(pipeline.graph),
437
+ bundles: pipeline.assembled.bundles,
438
+ containers: resolved.containers,
439
+ preflightPayloads: resolved.preflightPayloads,
440
+ findings: resolved.findings,
441
+ credentials: opts.deps.credentials,
442
+ ...action === "deploy" ? { report } : {}
443
+ });
444
+ } catch (error) {
445
+ if (CliStructuredError.is(error)) return notOk(error);
446
+ return notOk(new CliStructuredError("DEPLOY.ENGINE_FAILED", redact(error instanceof Error ? error.message : String(error))));
447
+ }
448
+ const output = interactionMessages(steps, opts.redaction);
449
+ let outcome;
450
+ try {
451
+ outcome = await entry.converge({
452
+ operation: action,
453
+ stack,
454
+ stage: resolved.stage,
455
+ cwd,
456
+ env,
457
+ signal: opts.signal,
458
+ onEvent: (event) => reportConvergeEvent(steps, event, redact, (resource) => ({
459
+ name: "apply-resource",
460
+ ...resource
461
+ })),
462
+ output: (text) => output.push(text)
463
+ });
464
+ } catch (error) {
465
+ return notOk(new CliStructuredError("DEPLOY.ENGINE_FAILED", redact(`Alchemy could not ${action} the app.\n${error instanceof Error ? error.message : String(error)}`)));
466
+ } finally {
467
+ output.end();
468
+ }
469
+ if (outcome.kind !== "applied") return notOk(convergeFailure(action, outcome, redact));
470
+ steps.finish({ name: "apply" });
471
+ return ok(redactSummary(summary, opts.redaction));
472
+ }
473
+ //#endregion
474
+ export { executeDeploy, executeDestroy };
475
+
476
+ //# sourceMappingURL=execute-deploy-destroy-BIRdFfwR-BjLOxnQd.mjs.map