@prisma/composer 0.6.0-dev.22 → 0.6.0-dev.23

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 (33) hide show
  1. package/dist/control.mjs +6 -6
  2. package/dist/{deployment-summary-DswOl_9E-C03NJ98H.mjs → deployment-summary-DswOl_9E-B9MhYYDt.mjs} +4 -4
  3. package/dist/deployment-summary-DswOl_9E-B9MhYYDt.mjs.map +1 -0
  4. package/dist/dist-CVk7Pk4B.mjs +42 -0
  5. package/dist/dist-CVk7Pk4B.mjs.map +1 -0
  6. package/dist/{execute-deploy-destroy-DRl6Tfg9-ktj5sQsO.mjs → execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs} +19 -19
  7. package/dist/execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs.map +1 -0
  8. package/dist/{execute-dev-BMTFWfFc-CGDFqR4w.mjs → execute-dev-BMTFWfFc-7MifQgpp.mjs} +34 -34
  9. package/dist/execute-dev-BMTFWfFc-7MifQgpp.mjs.map +1 -0
  10. package/dist/{execute-log-Cay9hlKW-ChlIv192.mjs → execute-log-Cay9hlKW-BcvKPOW1.mjs} +5 -5
  11. package/dist/execute-log-Cay9hlKW-BcvKPOW1.mjs.map +1 -0
  12. package/dist/nextjs-control.mjs +138 -34
  13. package/dist/nextjs-control.mjs.map +1 -1
  14. package/dist/node-control.mjs +21814 -55
  15. package/dist/node-control.mjs.map +1 -1
  16. package/dist/{pipeline-AoW8zq4I-CUon5KZH.mjs → pipeline-AoW8zq4I-Dg8xQ7nC.mjs} +18 -18
  17. package/dist/pipeline-AoW8zq4I-Dg8xQ7nC.mjs.map +1 -0
  18. package/dist/report.mjs +1 -1
  19. package/dist/{result-CY_TB7bn.mjs → result-D95kAAek.mjs} +13 -13
  20. package/dist/result-D95kAAek.mjs.map +1 -0
  21. package/dist/{run-alchemy-D44OZlyB-gVq_0gf4.mjs → run-alchemy-D44OZlyB-Cw5CVbUQ.mjs} +6 -6
  22. package/dist/run-alchemy-D44OZlyB-Cw5CVbUQ.mjs.map +1 -0
  23. package/dist/{run-report-C2o98uD--CAfePImA.mjs → run-report-C2o98uD--AX8kpz4Q.mjs} +6 -6
  24. package/dist/run-report-C2o98uD--AX8kpz4Q.mjs.map +1 -0
  25. package/package.json +10 -10
  26. package/dist/deployment-summary-DswOl_9E-C03NJ98H.mjs.map +0 -1
  27. package/dist/execute-deploy-destroy-DRl6Tfg9-ktj5sQsO.mjs.map +0 -1
  28. package/dist/execute-dev-BMTFWfFc-CGDFqR4w.mjs.map +0 -1
  29. package/dist/execute-log-Cay9hlKW-ChlIv192.mjs.map +0 -1
  30. package/dist/pipeline-AoW8zq4I-CUon5KZH.mjs.map +0 -1
  31. package/dist/result-CY_TB7bn.mjs.map +0 -1
  32. package/dist/run-alchemy-D44OZlyB-gVq_0gf4.mjs.map +0 -1
  33. package/dist/run-report-C2o98uD--CAfePImA.mjs.map +0 -1
@@ -2,9 +2,9 @@ import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
2
2
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
3
3
  import { o as isNode, t as Load } from "./graph-BJgUfGB0-kvgFzT4q.mjs";
4
4
  import "./dist-C5rZnr4n.mjs";
5
- import { i as effectResolutionDiagnostic } from "./result-CY_TB7bn.mjs";
6
- import * as fs from "node:fs";
7
- import * as path from "node:path";
5
+ import { i as effectResolutionDiagnostic } from "./result-D95kAAek.mjs";
6
+ import * as fs$1 from "node:fs";
7
+ import * as path$1 from "node:path";
8
8
  import { pathToFileURL } from "node:url";
9
9
  import * as c12 from "c12";
10
10
  //#region ../../0-framework/3-tooling/cli/dist/load-entry-BYBSCuWg.mjs
@@ -52,7 +52,7 @@ function explainJsxLoadError(error, entryPath) {
52
52
  * IS the application; nothing else marks a root (ADR-0003).
53
53
  */
54
54
  async function loadEntry(entryArg, cwd) {
55
- const resolvedPath = path.resolve(cwd, entryArg);
55
+ const resolvedPath = path$1.resolve(cwd, entryArg);
56
56
  let mod;
57
57
  try {
58
58
  mod = await import(pathToFileURL(resolvedPath).href);
@@ -153,17 +153,17 @@ async function assembleServices(graph, config, cwd, run) {
153
153
  const CONFIG_FILENAME = "prisma-composer.config.ts";
154
154
  /** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */
155
155
  function findConfigPathForEntry(entryPath) {
156
- let current = path.dirname(path.resolve(entryPath));
156
+ let current = path$1.dirname(path$1.resolve(entryPath));
157
157
  while (true) {
158
- const candidate = path.join(current, CONFIG_FILENAME);
159
- if (fs.existsSync(candidate)) return candidate;
160
- const parent = path.dirname(current);
158
+ const candidate = path$1.join(current, CONFIG_FILENAME);
159
+ if (fs$1.existsSync(candidate)) return candidate;
160
+ const parent = path$1.dirname(current);
161
161
  if (parent === current) return void 0;
162
162
  current = parent;
163
163
  }
164
164
  }
165
165
  function missingConfigError(entryPath) {
166
- const searchedFrom = path.dirname(path.resolve(entryPath));
166
+ const searchedFrom = path$1.dirname(path$1.resolve(entryPath));
167
167
  return new CliStructuredError("CONFIG.FILE_MISSING", `No ${CONFIG_FILENAME} found walking up from "${searchedFrom}".`, {
168
168
  why: "The deploy needs the app's config file.",
169
169
  fix: "Create one next to (or above) the entry, default-exporting defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.",
@@ -233,7 +233,7 @@ async function evaluateConfig(configPath, verifySamePath) {
233
233
  result = await c12.loadConfig({
234
234
  name: "prisma-composer",
235
235
  configFile: configPath,
236
- cwd: path.dirname(configPath),
236
+ cwd: path$1.dirname(configPath),
237
237
  rcFile: false,
238
238
  globalRc: false,
239
239
  packageJson: false
@@ -248,7 +248,7 @@ async function evaluateConfig(configPath, verifySamePath) {
248
248
  };
249
249
  }
250
250
  const loadedFile = result.configFile;
251
- if (verifySamePath && (typeof loadedFile !== "string" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))) return {
251
+ if (verifySamePath && (typeof loadedFile !== "string" || fs$1.realpathSync(loadedFile) !== fs$1.realpathSync(configPath))) return {
252
252
  value: result.config,
253
253
  diagnostics: [new CliStructuredError("CONFIG.PATH_MISMATCH", `Config loading resolved "${String(loadedFile)}" instead of the discovered "${configPath}".`, {
254
254
  why: "Refusing to deploy against a different file.",
@@ -272,8 +272,8 @@ async function evaluateConfig(configPath, verifySamePath) {
272
272
  * finding with the fix in it and every later failure is its symptom.
273
273
  */
274
274
  function configSource(request) {
275
- const resolvedEntry = path.resolve(request.entryPath);
276
- const cwd = request.cwd ?? path.dirname(resolvedEntry);
275
+ const resolvedEntry = path$1.resolve(request.entryPath);
276
+ const cwd = request.cwd ?? path$1.dirname(resolvedEntry);
277
277
  const effectConflict = effectResolutionDiagnostic(cwd);
278
278
  if (effectConflict !== void 0) return {
279
279
  ok: false,
@@ -292,8 +292,8 @@ function configSource(request) {
292
292
  explicit: false
293
293
  };
294
294
  }
295
- const configPath = path.resolve(cwd, request.configPath);
296
- if (!fs.existsSync(configPath)) return {
295
+ const configPath = path$1.resolve(cwd, request.configPath);
296
+ if (!fs$1.existsSync(configPath)) return {
297
297
  ok: false,
298
298
  path: configPath,
299
299
  diagnostic: new CliStructuredError("CONFIG.FILE_MISSING", `The \`composer\` config section points at "${configPath}", which does not exist.`, {
@@ -405,7 +405,7 @@ async function loadConfigStep(entryPath, cwd, deps) {
405
405
  * output the way the full pipeline does.
406
406
  */
407
407
  async function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {
408
- const { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);
408
+ const { configPath, config } = await loadConfigStep(path$1.resolve(cwd, entry), cwd, deps);
409
409
  const entryModule = await loadEntry(entry, cwd);
410
410
  const name = overrideName ?? entryModule.root.name;
411
411
  if (name.length === 0) throw new CliStructuredError("COMPOSE.NAME_MISSING", "The root node has no name.", { fix: "Name it at authoring, or pass --name." });
@@ -423,7 +423,7 @@ async function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {
423
423
  * about any one command.
424
424
  */
425
425
  async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError) {
426
- const { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);
426
+ const { configPath, config } = await loadConfigStep(path$1.resolve(cwd, entry), cwd, deps);
427
427
  const entryModule = await loadEntry(entry, cwd);
428
428
  const graph = Load(entryModule.root);
429
429
  if (graph.root.node.kind !== "module") throw new CliStructuredError("COMPOSE.ROOT_NOT_MODULE", "The deploy root must be a module.", { fix: "Wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); })." });
@@ -449,4 +449,4 @@ async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError)
449
449
  //#endregion
450
450
  export { runPipeline as n, resolveAppIdentity as t };
451
451
 
452
- //# sourceMappingURL=pipeline-AoW8zq4I-CUon5KZH.mjs.map
452
+ //# sourceMappingURL=pipeline-AoW8zq4I-Dg8xQ7nC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-AoW8zq4I-Dg8xQ7nC.mjs","names":["path","path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/load-entry-BYBSCuWg.mjs","../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/3-tooling/cli/dist/pipeline-AoW8zq4I.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { isNode } from \"@internal/core\";\n//#region src/jsx-load-error.ts\n/**\n* `loadEntry` imports a user's topology with the host runtime's own module\n* loader — under node (the CLI's shebang runtime), that loader strips\n* TypeScript types but has no JSX transform (ADR-0005: the framework\n* doesn't bundle or transform the app's code; deploy loading is no\n* exception). A `.tsx`/`.jsx` file anywhere in the topology's import graph\n* dies with node's raw `ERR_UNKNOWN_FILE_EXTENSION`, which names the file\n* but not the cause or the fix. This turns that one case into structured\n* error parts (summary/why/fix) that do — every other load failure (syntax\n* errors, missing files, non-JSX unknown extensions) is untouched.\n*/\nconst UNKNOWN_EXTENSION_CODE = \"ERR_UNKNOWN_FILE_EXTENSION\";\nconst JSX_EXTENSIONS = [\".tsx\", \".jsx\"];\nfunction errorCode(error) {\n\treturn \"code\" in error && typeof error.code === \"string\" ? error.code : void 0;\n}\nfunction unknownExtensionPath(error) {\n\tif (!(error instanceof Error)) return void 0;\n\tif (errorCode(error) !== UNKNOWN_EXTENSION_CODE) return void 0;\n\treturn /Unknown file extension \"\\.\\w+\" for (.+)$/.exec(error.message)?.[1];\n}\n/**\n* Returns structured error parts when `error` is node's\n* `ERR_UNKNOWN_FILE_EXTENSION` for a `.tsx`/`.jsx` file — `undefined` for\n* every other error (including unknown-extension failures for some other\n* extension), so the caller can fall through to its normal rethrow.\n*/\nfunction explainJsxLoadError(error, entryPath) {\n\tconst offendingPath = unknownExtensionPath(error);\n\tif (offendingPath === void 0) return void 0;\n\tif (!JSX_EXTENSIONS.some((ext) => offendingPath.endsWith(ext))) return void 0;\n\treturn {\n\t\tsummary: `\"${offendingPath}\" can't be loaded.`,\n\t\twhy: `deploy loads \"${entryPath}\"'s topology with node's own module loader, which strips TypeScript types but has no JSX transform — so a .tsx/.jsx file can't sit anywhere in that import graph.`,\n\t\tfix: \"Precompile that file in your own build (transform the JSX away, keep the real npm packages external) and import the compiled output instead of the raw .tsx/.jsx — see examples/email/scripts/build.ts in the prisma/composer repo for a worked example.\"\n\t};\n}\n//#endregion\n//#region src/load-entry.ts\n/**\n* Pipeline step 1 (deploy-cli.md § The pipeline): import the entry module\n* (resolved against cwd) and require its default export to be a node — a\n* service or module, branded by core's factories. Whatever this module exports\n* IS the application; nothing else marks a root (ADR-0003).\n*/\nasync function loadEntry(entryArg, cwd) {\n\tconst resolvedPath = path.resolve(cwd, entryArg);\n\tlet mod;\n\ttry {\n\t\tmod = await import(pathToFileURL(resolvedPath).href);\n\t} catch (error) {\n\t\tconst explained = explainJsxLoadError(error, resolvedPath);\n\t\tif (explained !== void 0) throw new CliStructuredError(\"COMPOSE.ENTRY_UNLOADABLE\", explained.summary, {\n\t\t\twhy: explained.why,\n\t\t\tfix: explained.fix,\n\t\t\twhere: { path: resolvedPath },\n\t\t\tcause: error\n\t\t});\n\t\tthrow new CliStructuredError(\"COMPOSE.ENTRY_UNLOADABLE\", `Failed to import entry module \"${resolvedPath}\": ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\twhere: { path: resolvedPath },\n\t\t\tcause: error\n\t\t});\n\t}\n\tconst root = blindCast(mod).default;\n\tif (!isNode(root) || root.kind === \"dependency\" || root.kind === \"resource\") throw new CliStructuredError(\"COMPOSE.ENTRY_EXPORT_INVALID\", `Entry module \"${resolvedPath}\" must default-export a node (a service or a module).`, {\n\t\tfix: \"Construct it with service() or module() from @prisma/composer.\",\n\t\twhere: { path: resolvedPath }\n\t});\n\treturn {\n\t\tpath: resolvedPath,\n\t\troot: blindCast(root)\n\t};\n}\n//#endregion\nexport { loadEntry as t };\n\n//# sourceMappingURL=load-entry-BYBSCuWg.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/assemble-error.ts\n/**\n* A user-facing assembly failure, structured at origin (base-type rule 6):\n* a `CliStructuredError` whose code names which way assembly went wrong.\n* This package's second consumer is the programmatic deploy API, not just\n* the CLI — hosts branch on `error.code`, the CLI renders the envelope.\n*/\nvar AssembleError = class extends CliStructuredError {\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t}\n};\n//#endregion\n//#region src/assemble-services.ts\n/**\n* The registry route for one service's build: extension by\n* `build.extension`, node descriptor by `build.type`, kind must be \"build\".\n* The CLI's coverage validation reports the same misses earlier with the\n* config fix; these errors are the backstop for programmatic callers.\n*/\nfunction buildDescriptorAssemble(config, node, address, cwd) {\n\tconst { extension, type } = node.build;\n\tconst extensionDescriptor = config.extensions.find((candidate) => candidate.id === extension);\n\tif (extensionDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by service \"${node.name}\"'s build).`, { fix: \"Add it to prisma-composer.config.ts's `extensions`.\" });\n\tconst nodeDescriptor = extensionDescriptor.nodes[type];\n\tif (nodeDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for build type \"${type}\".`, { why: `Known types: ${Object.keys(extensionDescriptor.nodes).join(\", \")}.` });\n\tif (nodeDescriptor.kind !== \"build\") throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for type \"${type}\" is a \"${nodeDescriptor.kind}\" descriptor.`, { why: \"Assembling a service build needs a \\\"build\\\" descriptor.\" });\n\treturn nodeDescriptor.assemble({\n\t\tbuild: node.build,\n\t\taddress,\n\t\tcwd\n\t});\n}\nasync function assembleServices(graph, config, cwd, run) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd) => buildDescriptorAssemble(config, node, address, nodeCwd));\n\tconst serviceNodes = graph.nodes.filter((n) => n.node.kind === \"service\");\n\tif (serviceNodes.length === 0) throw new AssembleError(\"ASSEMBLE.SERVICE_MISSING\", \"The loaded graph has no service to assemble.\");\n\tconst bundles = {};\n\tfor (const { id, node } of serviceNodes) try {\n\t\tbundles[id] = await runAssembler(node, id, cwd);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) throw error;\n\t\tthrow new AssembleError(\"ASSEMBLE.BUILD_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\tmeta: { address: id },\n\t\t\tcause: error\n\t\t});\n\t}\n\treturn { bundles };\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","import { i as effectResolutionDiagnostic } from \"./shared-BTnATsqm.mjs\";\nimport { t as loadEntry } from \"./load-entry-BYBSCuWg.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { Load } from \"@internal/core\";\nimport { assembleServices } from \"@internal/assemble\";\nimport * as c12 from \"c12\";\n//#region src/load-config.ts\n/**\n* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE\n* file that imports control-plane code. Discovery is the standard walk-up\n* from the deploy entry's directory (mirrors prisma-next's config-loader);\n* loading is c12 with that explicit path (rc/global/package.json lookups\n* disabled), so the config file's own static imports resolve from the app\n* root by whatever package manager runs — no specifier construction, no\n* anchoring.\n*\n* Two shapes of the same machinery:\n*\n* loadAppConfigDiagnostics — returns the evaluated value together with\n* EVERY problem found, and never throws. This is the shape the engine\n* command family consumes: the engine renders diagnostics itself and\n* decides per command whether a broken section is fatal, so a loader that\n* threw on the first bad field would both hide the rest and bypass that\n* rendering.\n*\n* loadAppConfig — the same load, throwing its first diagnostic. The\n* clipanion CLI still runs on it; it goes when clipanion does.\n*/\nconst CONFIG_FILENAME = \"prisma-composer.config.ts\";\n/** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */\nfunction findConfigPathForEntry(entryPath) {\n\tlet current = path.dirname(path.resolve(entryPath));\n\twhile (true) {\n\t\tconst candidate = path.join(current, CONFIG_FILENAME);\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(current);\n\t\tif (parent === current) return void 0;\n\t\tcurrent = parent;\n\t}\n}\nfunction missingConfigError(entryPath) {\n\tconst searchedFrom = path.dirname(path.resolve(entryPath));\n\treturn new CliStructuredError(\"CONFIG.FILE_MISSING\", `No ${CONFIG_FILENAME} found walking up from \"${searchedFrom}\".`, {\n\t\twhy: \"The deploy needs the app's config file.\",\n\t\tfix: \"Create one next to (or above) the entry, default-exporting defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.\",\n\t\twhere: { path: searchedFrom }\n\t});\n}\nfunction fieldError(field, requirement) {\n\treturn new CliStructuredError(\"CONFIG.FIELD_INVALID\", `${CONFIG_FILENAME}: \\`${field}\\` ${requirement}.`, {\n\t\tfix: \"See defineConfig() in '@prisma/composer/config'.\",\n\t\tmeta: { field }\n\t});\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Field-by-field validation of the loaded default export — deliberately no\n* schema library: each check is a structured error naming the offending field.\n*\n* Collects rather than throws, so one bad config reports every bad field\n* instead of only the first. The `extensions` and `state` checks are\n* independent, and within `extensions` each entry is judged on its own; a\n* field whose own shape check already failed is not probed further, because\n* anything derived from it would be noise rather than a second finding.\n*/\nfunction configShapeDiagnostics(loaded, configPath) {\n\tif (!isRecord(loaded) || Object.keys(loaded).length === 0) return [new CliStructuredError(\"CONFIG.EXPORT_INVALID\", `\"${configPath}\" exported no config.`, {\n\t\tfix: \"It must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.\",\n\t\twhere: { path: configPath }\n\t})];\n\tconst diagnostics = [];\n\tconst extensions = loaded[\"extensions\"];\n\tif (!Array.isArray(extensions)) diagnostics.push(fieldError(\"extensions\", \"must be an array\"));\n\telse {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const [index, entry] of extensions.entries()) {\n\t\t\tif (!isRecord(entry)) {\n\t\t\t\tdiagnostics.push(fieldError(`extensions[${index}]`, \"must be an extension descriptor object\"));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst id = entry[\"id\"];\n\t\t\tif (typeof id !== \"string\" || id.length === 0) diagnostics.push(fieldError(`extensions[${index}].id`, \"must be a non-empty string (the extension package name)\"));\n\t\t\telse if (seen.has(id)) diagnostics.push(new CliStructuredError(\"CONFIG.EXTENSION_DUPLICATE\", `${CONFIG_FILENAME}: extension \"${id}\" is listed more than once in \\`extensions\\`.`));\n\t\t\telse seen.add(id);\n\t\t\tif (!isRecord(entry[\"nodes\"])) diagnostics.push(fieldError(`extensions[${index}].nodes`, \"must be an object (the node-ID → control registry)\"));\n\t\t}\n\t}\n\tconst state = loaded[\"state\"];\n\tif (!isRecord(state) || typeof state[\"extension\"] !== \"string\" || typeof state[\"create\"] !== \"function\") diagnostics.push(fieldError(\"state\", \"must be a state descriptor (e.g. prismaState())\"));\n\treturn diagnostics;\n}\n/** The throwing form of configShapeDiagnostics: raises the first finding, returns the same object typed. Used by the clipanion pipeline. */\nfunction validateConfigShape(loaded, configPath) {\n\tconst [first] = configShapeDiagnostics(loaded, configPath);\n\tif (first !== void 0) throw first;\n\treturn blindCast(loaded);\n}\n/**\n* Evaluates `configPath` with c12 (explicit file; rc / global-rc /\n* package.json lookups disabled). `verifySamePath` runs the same-file check\n* against the discovered path — see loadAppConfigDiagnostics for when it does\n* not apply.\n*/\nasync function evaluateConfig(configPath, verifySamePath) {\n\tlet result;\n\ttry {\n\t\tresult = await c12.loadConfig({\n\t\t\tname: \"prisma-composer\",\n\t\t\tconfigFile: configPath,\n\t\t\tcwd: path.dirname(configPath),\n\t\t\trcFile: false,\n\t\t\tglobalRc: false,\n\t\t\tpackageJson: false\n\t\t});\n\t} catch (error) {\n\t\treturn {\n\t\t\tvalue: void 0,\n\t\t\tdiagnostics: [new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", `Evaluating \"${configPath}\" failed: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\t\twhere: { path: configPath },\n\t\t\t\tcause: error\n\t\t\t})]\n\t\t};\n\t}\n\tconst loadedFile = result.configFile;\n\tif (verifySamePath && (typeof loadedFile !== \"string\" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))) return {\n\t\tvalue: result.config,\n\t\tdiagnostics: [new CliStructuredError(\"CONFIG.PATH_MISMATCH\", `Config loading resolved \"${String(loadedFile)}\" instead of the discovered \"${configPath}\".`, {\n\t\t\twhy: \"Refusing to deploy against a different file.\",\n\t\t\twhere: { path: configPath }\n\t\t})]\n\t};\n\treturn {\n\t\tvalue: result.config,\n\t\tdiagnostics: configShapeDiagnostics(result.config, configPath)\n\t};\n}\n/**\n* The front of every config load, shared by the throwing and the\n* diagnostics-list shapes: verify the installed tree can evaluate a config at\n* all, then settle which file to load — the section's path, or the\n* entry-anchored walk.\n*\n* The effect-resolution check comes first because evaluating a config imports\n* alchemy's provider tree: in a tree where alchemy resolves an `effect` we did\n* not pin, nothing downstream can load, so the dependency conflict is the\n* finding with the fix in it and every later failure is its symptom.\n*/\nfunction configSource(request) {\n\tconst resolvedEntry = path.resolve(request.entryPath);\n\tconst cwd = request.cwd ?? path.dirname(resolvedEntry);\n\tconst effectConflict = effectResolutionDiagnostic(cwd);\n\tif (effectConflict !== void 0) return {\n\t\tok: false,\n\t\tpath: void 0,\n\t\tdiagnostic: effectConflict\n\t};\n\tif (request.configPath === void 0) {\n\t\tconst discovered = findConfigPathForEntry(resolvedEntry);\n\t\treturn discovered === void 0 ? {\n\t\t\tok: false,\n\t\t\tpath: void 0,\n\t\t\tdiagnostic: missingConfigError(resolvedEntry)\n\t\t} : {\n\t\t\tok: true,\n\t\t\tpath: discovered,\n\t\t\texplicit: false\n\t\t};\n\t}\n\tconst configPath = path.resolve(cwd, request.configPath);\n\tif (!fs.existsSync(configPath)) return {\n\t\tok: false,\n\t\tpath: configPath,\n\t\tdiagnostic: new CliStructuredError(\"CONFIG.FILE_MISSING\", `The \\`composer\\` config section points at \"${configPath}\", which does not exist.`, {\n\t\t\twhy: \"An explicit configPath is used as given — there is no walk to fall back on.\",\n\t\t\tfix: \"Correct `configPath` in the `composer` section of prisma.config.ts, or remove it to search upward from the entry.\",\n\t\t\twhere: { path: configPath }\n\t\t})\n\t};\n\treturn {\n\t\tok: true,\n\t\tpath: configPath,\n\t\texplicit: true\n\t};\n}\n/**\n* The throwing form of that front, for the pipeline: the file the load will\n* use, or the finding raised. `explicit` says the section named the file,\n* which is what retires the same-file check for that case.\n*/\nfunction resolveConfigFile(request) {\n\tconst source = configSource(request);\n\tif (!source.ok) throw source.diagnostic;\n\treturn {\n\t\tpath: source.path,\n\t\texplicit: source.explicit\n\t};\n}\n/**\n* Loads + validates the config at `configPath`, throwing its first diagnostic.\n* The clipanion CLI's pipeline runs on this; it goes when clipanion does.\n*/\nasync function loadAppConfig(configPath, verifySamePath = true) {\n\tconst { value, diagnostics } = await evaluateConfig(configPath, verifySamePath);\n\tconst [first] = diagnostics;\n\tif (first !== void 0) throw first;\n\treturn {\n\t\tpath: configPath,\n\t\tconfig: validateConfigShape(value, configPath)\n\t};\n}\n//#endregion\n//#region src/validate-coverage.ts\nfunction lookup(extensions, extension, type, expectedKind, what) {\n\tconst ext = extensions.get(extension);\n\tif (ext === void 0) throw new CliStructuredError(\"CONFIG.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by ${what}).`, {\n\t\tfix: `Add it to ${CONFIG_FILENAME}'s \\`extensions\\` (import its /control entry and list its descriptor).`,\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tconst descriptor = ext.nodes[type];\n\tif (descriptor === void 0) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for node type \"${type}\" (needed by ${what}).`, {\n\t\twhy: `Known types: ${Object.keys(ext.nodes).join(\", \")}.`,\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tif (descriptor.kind !== expectedKind) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${descriptor.kind}\" descriptor — ${what} needs a \"${expectedKind}\" descriptor.`, { meta: {\n\t\textension,\n\t\ttype,\n\t\tkind: descriptor.kind\n\t} });\n}\n/** Throws a structured CONFIG.* error on the first uncovered `(extension, type)`; silent when the config covers the whole graph. */\nfunction validateRegistryCoverage(graph, config) {\n\tconst extensions = new Map(config.extensions.map((descriptor) => [descriptor.id, descriptor]));\n\tfor (const { id, node } of graph.nodes) {\n\t\tif (node.kind === \"resource\") {\n\t\t\tlookup(extensions, node.extension, node.type, \"resource\", `resource node \"${id}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (node.kind !== \"service\") continue;\n\t\tlookup(extensions, node.extension, node.type, \"service\", `service node \"${id}\"`);\n\t\tlookup(extensions, node.build.extension, node.build.type, \"build\", `service node \"${id}\"'s build descriptor`);\n\t}\n}\n//#endregion\n//#region src/pipeline.ts\n/**\n* The shared prefix of `deploy`/`destroy`/`dev` (deploy-cli.md § The\n* pipeline; local-dev spec § 6): config discovery/load, entry load, Load,\n* registry coverage validation, name resolution, assemble. Deploy and dev\n* diverge after this — deploy resolves containers/preflight/stack file\n* against the hosted providers, dev against the local ones — so everything\n* up to and including assemble lives here once, consumed verbatim by both\n* `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines\n* cannot drift.\n*/\n/**\n* The config step both pipelines share: the effect-resolution check and the\n* choice of config file (load-config.ts's shared front), then evaluation —\n* unless the caller substituted a config, which replaces the evaluation and\n* nothing before it.\n*/\nasync function loadConfigStep(entryPath, cwd, deps) {\n\tconst { path: configPath, explicit } = resolveConfigFile({\n\t\tentryPath,\n\t\tconfigPath: deps.configPath,\n\t\tcwd\n\t});\n\treturn {\n\t\tconfigPath,\n\t\tconfig: deps.config ?? (await loadAppConfig(configPath, !explicit)).config\n\t};\n}\n/**\n* The pipeline's front — config discovery/load, entry load, name resolution —\n* WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its\n* config and resolved name) to reach the already-running local instance; it\n* neither builds nor provisions, so it must not require the user's built\n* output the way the full pipeline does.\n*/\nasync function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {\n\tconst { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);\n\tconst entryModule = await loadEntry(entry, cwd);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\treturn {\n\t\tconfigPath,\n\t\tconfig,\n\t\tname\n\t};\n}\n/**\n* Runs config discovery/load, entry load, Load, registry coverage, name\n* resolution, and assemble — steps 1–6 of `run()`. `onAssembleError`, when\n* given, lets a caller decorate an assemble failure with command-specific\n* guidance (destroy's \"build first\" hint) without this shared step knowing\n* about any one command.\n*/\nasync function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError) {\n\tconst { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);\n\tconst entryModule = await loadEntry(entry, cwd);\n\tconst graph = Load(entryModule.root);\n\tif (graph.root.node.kind !== \"module\") throw new CliStructuredError(\"COMPOSE.ROOT_NOT_MODULE\", \"The deploy root must be a module.\", { fix: \"Wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); }).\" });\n\tvalidateRegistryCoverage(graph, config);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler);\n\t} catch (error) {\n\t\tif (onAssembleError !== void 0 && error instanceof Error) throw onAssembleError(error);\n\t\tthrow error;\n\t}\n\treturn {\n\t\tconfigPath,\n\t\tconfig,\n\t\tentryModule,\n\t\tgraph,\n\t\tname,\n\t\tassembled\n\t};\n}\n//#endregion\nexport { runPipeline as n, resolveAppIdentity as t };\n\n//# sourceMappingURL=pipeline-AoW8zq4I.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,yBAAyB;AAC/B,MAAM,iBAAiB,CAAC,QAAQ,MAAM;AACtC,SAAS,UAAU,OAAO;CACzB,OAAO,UAAU,SAAS,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,KAAK;AAC9E;AACA,SAAS,qBAAqB,OAAO;CACpC,IAAI,EAAE,iBAAiB,QAAQ,OAAO,KAAK;CAC3C,IAAI,UAAU,KAAK,MAAM,wBAAwB,OAAO,KAAK;CAC7D,OAAO,2CAA2C,KAAK,MAAM,OAAO,CAAC,GAAG;AACzE;;;;;;;AAOA,SAAS,oBAAoB,OAAO,WAAW;CAC9C,MAAM,gBAAgB,qB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9C,IAAI,KAAK,WAAW,GAAG,MAAM,IAAI,mBAAmB,wBAAwB,8BAA8B,EAAE,KAAK,wCAAwC,CAAC;CAC1J,IAAI;CACJ,IAAI;EACH,YAAY,MAAM,iBAAiB,OAAO,QAAQ,KAAK,KAAK,YAAY;CACzE,SAAS,OAAO;EACf,IAAI,oBAAoB,KAAK,KAAK,iBAAiB,OAAO,MAAM,gBAAgB,KAAK;EACrF,MAAM;CACP;CACA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;CACD;AACD"}
package/dist/report.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { r as writeDeploymentSummaryFile } from "./deployment-summary-DswOl_9E-C03NJ98H.mjs";
1
+ import { r as writeDeploymentSummaryFile } from "./deployment-summary-DswOl_9E-B9MhYYDt.mjs";
2
2
  //#region ../../0-framework/3-tooling/cli/dist/report.mjs
3
3
  /** Gap between the deepest tree label and the entity column. */
4
4
  const LABEL_GAP = 3;
@@ -2,8 +2,8 @@ import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
2
2
  import { t as InternalError } from "./internal-error-BIc-ehme-Ck_lgxD_.mjs";
3
3
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
4
4
  import { createRequire } from "node:module";
5
- import * as fs from "node:fs";
6
- import * as path from "node:path";
5
+ import * as fs$1 from "node:fs";
6
+ import * as path$1 from "node:path";
7
7
  //#region ../../0-framework/3-tooling/cli/dist/shared-BTnATsqm.mjs
8
8
  /**
9
9
  * Deploy preflight (TML-3158): verify that alchemy resolves the exact `effect`
@@ -19,9 +19,9 @@ import * as path from "node:path";
19
19
  function findAlchemyPackageDir(startDir) {
20
20
  let dir = startDir;
21
21
  while (true) {
22
- const candidate = path.join(dir, "node_modules", "alchemy");
23
- if (fs.existsSync(path.join(candidate, "package.json"))) return candidate;
24
- const parent = path.dirname(dir);
22
+ const candidate = path$1.join(dir, "node_modules", "alchemy");
23
+ if (fs$1.existsSync(path$1.join(candidate, "package.json"))) return candidate;
24
+ const parent = path$1.dirname(dir);
25
25
  if (parent === dir) return void 0;
26
26
  dir = parent;
27
27
  }
@@ -35,17 +35,17 @@ function findAlchemyPackageDir(startDir) {
35
35
  function resolveEffectVersionFrom(packageDir) {
36
36
  let entry;
37
37
  try {
38
- entry = createRequire(path.join(fs.realpathSync(packageDir), "noop.js")).resolve("effect");
38
+ entry = createRequire(path$1.join(fs$1.realpathSync(packageDir), "noop.js")).resolve("effect");
39
39
  } catch {
40
40
  return;
41
41
  }
42
- let dir = path.dirname(entry);
43
- while (!fs.existsSync(path.join(dir, "package.json"))) {
44
- const parent = path.dirname(dir);
42
+ let dir = path$1.dirname(entry);
43
+ while (!fs$1.existsSync(path$1.join(dir, "package.json"))) {
44
+ const parent = path$1.dirname(dir);
45
45
  if (parent === dir) return void 0;
46
46
  dir = parent;
47
47
  }
48
- const version = JSON.parse(fs.readFileSync(path.join(dir, "package.json"), "utf-8")).version;
48
+ const version = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8")).version;
49
49
  return typeof version === "string" ? version : void 0;
50
50
  }
51
51
  /**
@@ -61,11 +61,11 @@ function resolveEffectVersionFrom(packageDir) {
61
61
  function requiredEffectVersion(startDir) {
62
62
  let manifestPath;
63
63
  try {
64
- manifestPath = createRequire(path.join(startDir, "noop.js")).resolve("@prisma/composer/package.json");
64
+ manifestPath = createRequire(path$1.join(startDir, "noop.js")).resolve("@prisma/composer/package.json");
65
65
  } catch {
66
66
  return;
67
67
  }
68
- const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
68
+ const manifest = JSON.parse(fs$1.readFileSync(manifestPath, "utf-8"));
69
69
  if (typeof manifest !== "object" || manifest === null || !("dependencies" in manifest)) return;
70
70
  const dependencies = manifest.dependencies;
71
71
  if (typeof dependencies !== "object" || dependencies === null || !("effect" in dependencies)) return;
@@ -244,4 +244,4 @@ function okVoid() {
244
244
  //#endregion
245
245
  export { executionDiagnostics as a, effectResolutionDiagnostic as i, ok as n, executorLoadFailure as o, okVoid as r, toStructured as s, notOk as t };
246
246
 
247
- //# sourceMappingURL=result-CY_TB7bn.mjs.map
247
+ //# sourceMappingURL=result-D95kAAek.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-D95kAAek.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/shared-BTnATsqm.mjs","../../../0-framework/0-foundation/foundation/dist/result.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/check-effect-resolution.ts\n/**\n* Deploy preflight (TML-3158): verify that alchemy resolves the exact `effect`\n* version @prisma/composer pins. Package managers cannot be made to enforce\n* this — alchemy's own peer range accepts newer effect betas, and npm resolves\n* transitive peer conflicts with a warning, not a failure — so a floating\n* `@effect/*` range anywhere in the consumer's tree can hoist a newer effect\n* to the root, where alchemy picks it up and crashes mid-deploy\n* (`TypeError: Schedule.either is not a function`). This check turns that\n* silent break into a start-up error naming the fix.\n*/\n/** Walks up from `startDir` looking for `node_modules/alchemy` (mirrors resolveAlchemyBin). Undefined when absent — the check skips rather than second-guessing later, clearer failures. */\nfunction findAlchemyPackageDir(startDir) {\n\tlet dir = startDir;\n\twhile (true) {\n\t\tconst candidate = path.join(dir, \"node_modules\", \"alchemy\");\n\t\tif (fs.existsSync(path.join(candidate, \"package.json\"))) return candidate;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return void 0;\n\t\tdir = parent;\n\t}\n}\n/**\n* The `effect` version Node gives `packageDir`'s code, resolved exactly as\n* Node would: from the package's real path (so pnpm symlink layouts resolve\n* from the package's own store position, like at runtime). Undefined when\n* `effect` is not resolvable from there.\n*/\nfunction resolveEffectVersionFrom(packageDir) {\n\tlet entry;\n\ttry {\n\t\tentry = createRequire(path.join(fs.realpathSync(packageDir), \"noop.js\")).resolve(\"effect\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet dir = path.dirname(entry);\n\twhile (!fs.existsSync(path.join(dir, \"package.json\"))) {\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return void 0;\n\t\tdir = parent;\n\t}\n\tconst version = JSON.parse(fs.readFileSync(path.join(dir, \"package.json\"), \"utf-8\")).version;\n\treturn typeof version === \"string\" ? version : void 0;\n}\n/**\n* The `effect` version @prisma/composer pins, read from its own installed\n* package.json — the single source of truth; never hardcoded here. Undefined\n* when @prisma/composer is not resolvable from `startDir` (e.g. the CLI is\n* driven some other way), in which case the check skips.\n*\n* Assumes the pin is an exact version — effectMismatchError compares with\n* `===`, which scripts/check-npm-effect-resolution.mjs enforces in CI;\n* relaxing the pin to a range means revisiting that comparison.\n*/\nfunction requiredEffectVersion(startDir) {\n\tlet manifestPath;\n\ttry {\n\t\tmanifestPath = createRequire(path.join(startDir, \"noop.js\")).resolve(\"@prisma/composer/package.json\");\n\t} catch {\n\t\treturn;\n\t}\n\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf-8\"));\n\tif (typeof manifest !== \"object\" || manifest === null || !(\"dependencies\" in manifest)) return;\n\tconst dependencies = manifest.dependencies;\n\tif (typeof dependencies !== \"object\" || dependencies === null || !(\"effect\" in dependencies)) return;\n\tconst version = dependencies.effect;\n\treturn typeof version === \"string\" ? version : void 0;\n}\n/** Pure comparison + parts rendering, separated so tests cover the rule without a filesystem. Returns the structured error parts, or undefined when the tree is healthy or either side is unknown. */\nfunction effectMismatchError(found, required) {\n\tif (found === void 0 || required === void 0 || found === required) return void 0;\n\treturn {\n\t\tsummary: `Dependency conflict: alchemy resolves effect@${found}, but @prisma/composer requires effect@${required}.`,\n\t\twhy: \"Your package manager installed a second effect that alchemy picks up; deploying with it would crash inside alchemy.\",\n\t\tfix: `Add this to your app's package.json, then reinstall:\n\n \"overrides\": { \"effect\": \"${required}\" }\\n\\n(npm uses \"overrides\"; yarn calls it \"resolutions\", pnpm \"pnpm.overrides\".)`,\n\t\tmeta: {\n\t\t\tfound,\n\t\t\trequired\n\t\t}\n\t};\n}\n/**\n* Runs the preflight from the app's directory and RETURNS the\n* DEPS.EFFECT_VERSION_CONFLICT error for a mismatched tree; undefined when the\n* tree is healthy or alchemy is not installed.\n*\n* This is the form the config-load machinery uses. The check belongs on the\n* config-load path rather than at import time because that is the first moment\n* anything actually loads alchemy's provider tree — the break it explains —\n* and because a check that runs at import time takes out commands that never\n* touch alchemy at all, help among them.\n*/\nfunction effectResolutionDiagnostic(cwd) {\n\tconst alchemyDir = findAlchemyPackageDir(cwd);\n\tif (alchemyDir === void 0) return void 0;\n\tconst parts = effectMismatchError(resolveEffectVersionFrom(alchemyDir), requiredEffectVersion(cwd));\n\tif (parts === void 0) return void 0;\n\treturn new CliStructuredError(\"DEPS.EFFECT_VERSION_CONFLICT\", parts.summary, {\n\t\twhy: parts.why,\n\t\tfix: parts.fix,\n\t\tmeta: parts.meta\n\t});\n}\n/** The throwing form, used by the executor-load diagnosis — the one caller left now that the bin runs no start-up preflight of its own. */\nfunction checkEffectResolution(cwd) {\n\tconst diagnostic = effectResolutionDiagnostic(cwd);\n\tif (diagnostic !== void 0) throw diagnostic;\n}\n//#endregion\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/** Diagnoses a failed executor import: when the app's tree resolves a\n* mismatched `effect` (the known way that import breaks), the failure is the\n* fix-naming DEPS.EFFECT_VERSION_CONFLICT from checkEffectResolution with the\n* import error riding as cause; otherwise DEPS.EXECUTOR_UNLOADABLE — an\n* environmental failure of the consumer's installed tree, not a bug here. */\nfunction executorLoadFailure(operation, error, cwd) {\n\ttry {\n\t\tcheckEffectResolution(cwd);\n\t} catch (diagnostic) {\n\t\tif (CliStructuredError.is(diagnostic)) return new CliStructuredError(diagnostic.code, diagnostic.message, {\n\t\t\t...diagnostic.why !== void 0 ? { why: diagnostic.why } : {},\n\t\t\t...diagnostic.fix !== void 0 ? { fix: diagnostic.fix } : {},\n\t\t\t...diagnostic.meta !== void 0 ? { meta: diagnostic.meta } : {},\n\t\t\tcause: error\n\t\t});\n\t}\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}\n//#endregion\nexport { effectResolutionDiagnostic as i, executorLoadFailure as n, toStructured as r, executionDiagnostics as t };\n\n//# sourceMappingURL=shared-BTnATsqm.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-BIc-ehme.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"],"mappings":";;;;;;;;;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AAM,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"}
@@ -1,6 +1,6 @@
1
1
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
- import * as fs from "node:fs";
3
- import * as path from "node:path";
2
+ import * as fs$1 from "node:fs";
3
+ import * as path$1 from "node:path";
4
4
  import { spawn } from "node:child_process";
5
5
  //#region ../../0-framework/3-tooling/cli/dist/run-alchemy-D44OZlyB.mjs
6
6
  /**
@@ -22,9 +22,9 @@ import { spawn } from "node:child_process";
22
22
  function resolveAlchemyBin(startDir) {
23
23
  let dir = startDir;
24
24
  while (true) {
25
- const candidate = path.join(dir, "node_modules", ".bin", "alchemy");
26
- if (fs.existsSync(candidate)) return candidate;
27
- const parent = path.dirname(dir);
25
+ const candidate = path$1.join(dir, "node_modules", ".bin", "alchemy");
26
+ if (fs$1.existsSync(candidate)) return candidate;
27
+ const parent = path$1.dirname(dir);
28
28
  if (parent === dir) throw new CliStructuredError("DEPLOY.ALCHEMY_BIN_MISSING", `Could not find an installed \`alchemy\` bin above "${startDir}".`, { fix: "Add \"alchemy\" as a dependency of your app." });
29
29
  dir = parent;
30
30
  }
@@ -90,4 +90,4 @@ const spawnAlchemy = async (invocation) => {
90
90
  //#endregion
91
91
  export { spawnAlchemy as n, alchemyInvocation as t };
92
92
 
93
- //# sourceMappingURL=run-alchemy-D44OZlyB-gVq_0gf4.mjs.map
93
+ //# sourceMappingURL=run-alchemy-D44OZlyB-Cw5CVbUQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-alchemy-D44OZlyB-Cw5CVbUQ.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/run-alchemy-D44OZlyB.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { spawn } from \"node:child_process\";\n//#region src/run-alchemy.ts\n/**\n* Pipeline step 7 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): hand the terminal to the generated stack file. Resolves the\n* workspace's own installed `alchemy` bin (walking up `node_modules/.bin`\n* from the generated file's package dir) rather than going through\n* `bunx`/`npx`, so this works the same under node and bun — the resolved\n* bin's own launcher (`alchemy/bin/cli.js`) does its own node/bun dispatch\n* from there, driven by the env it inherits.\n*\n* This module composes the invocation; it does not decide how the child is\n* started. Under the CLI the engine starts it (`ctx.spawn`), which is what\n* makes Ctrl-C reach the child natively and keeps signal policy in one place.\n* `spawnAlchemy` is the default for programmatic hosts driving\n* `@prisma/composer/control`, which have no engine to borrow.\n*/\n/** Walks up from `startDir` looking for `node_modules/.bin/alchemy`. */\nfunction resolveAlchemyBin(startDir) {\n\tlet dir = startDir;\n\twhile (true) {\n\t\tconst candidate = path.join(dir, \"node_modules\", \".bin\", \"alchemy\");\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) throw new CliStructuredError(\"DEPLOY.ALCHEMY_BIN_MISSING\", `Could not find an installed \\`alchemy\\` bin above \"${startDir}\".`, { fix: \"Add \\\"alchemy\\\" as a dependency of your app.\" });\n\t\tdir = parent;\n\t}\n}\n/**\n* Resolves the invocation against this machine — the step every adapter takes\n* and no caller should. Raises DEPLOY.ALCHEMY_BIN_MISSING when the app has no\n* alchemy installed.\n*/\nfunction alchemyCommandLine(invocation) {\n\treturn {\n\t\tcommand: resolveAlchemyBin(invocation.cwd),\n\t\targs: [\n\t\t\tinvocation.action,\n\t\t\tinvocation.stackFileRelativePath,\n\t\t\t\"--yes\",\n\t\t\t\"--stage\",\n\t\t\tinvocation.stage\n\t\t],\n\t\tcwd: invocation.cwd,\n\t\tenv: invocation.env\n\t};\n}\n/** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */\nfunction alchemyInvocation(input) {\n\treturn {\n\t\taction: input.command,\n\t\tstackFileRelativePath: input.stackFileRelativePath,\n\t\tcwd: input.cwd,\n\t\tstage: input.stage,\n\t\tenv: {\n\t\t\t...input.containerEnv,\n\t\t\t...input.env\n\t\t}\n\t};\n}\n/**\n* The default runner for hosts with no engine: inherited stdio, the caller's\n* own process group, and the child's status returned verbatim. It does not\n* collapse a signal into an exit code — that collapse is what made a\n* Ctrl-C'd deploy report itself as a failure.\n*/\nconst spawnAlchemy = async (invocation) => {\n\tconst line = alchemyCommandLine(invocation);\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(line.command, [...line.args], {\n\t\t\tcwd: line.cwd,\n\t\t\tstdio: \"inherit\",\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\t...line.env\n\t\t\t}\n\t\t});\n\t\tchild.on(\"error\", reject);\n\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\tresolve({\n\t\t\t\texitCode,\n\t\t\t\tsignal\n\t\t\t});\n\t\t});\n\t});\n};\n//#endregion\nexport { spawnAlchemy as i, alchemyInvocation as n, resolveAlchemyBin as r, alchemyCommandLine as t };\n\n//# sourceMappingURL=run-alchemy-D44OZlyB.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,kBAAkB,UAAU;CACpC,IAAI,MAAM;CACV,OAAO,MAAM;EACZ,MAAM,YAAYA,OAAK,KAAK,KAAK,gBAAgB,QAAQ,SAAS;EAClE,IAAIC,KAAG,WAAW,SAAS,GAAG,OAAO;EACrC,MAAM,SAASD,OAAK,QAAQ,GAAG;EAC/B,IAAI,WAAW,KAAK,MAAM,IAAI,mBAAmB,8BAA8B,sDAAsD,SAAS,KAAK,EAAE,KAAK,+CAA+C,CAAC;EAC1M,MAAM;CACP;AACD;;;;;;AAMA,SAAS,mBAAmB,YAAY;CACvC,OAAO;EACN,SAAS,kBAAkB,WAAW,GAAG;EACzC,MAAM;GACL,WAAW;GACX,WAAW;GACX;GACA;GACA,WAAW;EACZ;EACA,KAAK,WAAW;EAChB,KAAK,WAAW;CACjB;AACD;;AAEA,SAAS,kBAAkB,OAAO;CACjC,OAAO;EACN,QAAQ,MAAM;EACd,uBAAuB,MAAM;EAC7B,KAAK,MAAM;EACX,OAAO,MAAM;EACb,KAAK;GACJ,GAAG,MAAM;GACT,GAAG,MAAM;EACV;CACD;AACD;;;;;;;AAOA,MAAM,eAAe,OAAO,eAAe;CAC1C,MAAM,OAAO,mBAAmB,UAAU;CAC1C,OAAO,IAAI,SAAS,SAAS,WAAW;EACvC,MAAM,QAAQ,MAAM,KAAK,SAAS,CAAC,GAAG,KAAK,IAAI,GAAG;GACjD,KAAK,KAAK;GACV,OAAO;GACP,KAAK;IACJ,GAAG,QAAQ;IACX,GAAG,KAAK;GACT;EACD,CAAC;EACD,MAAM,GAAG,SAAS,MAAM;EACxB,MAAM,GAAG,UAAU,UAAU,WAAW;GACvC,QAAQ;IACP;IACA;GACD,CAAC;EACF,CAAC;CACF,CAAC;AACF"}
@@ -1,5 +1,5 @@
1
- import * as fs from "node:fs";
2
- import * as path from "node:path";
1
+ import * as fs$1 from "node:fs";
2
+ import * as path$1 from "node:path";
3
3
  //#region ../../0-framework/3-tooling/cli/dist/run-report-C2o98uD-.mjs
4
4
  /**
5
5
  * The run report: one deploy's outcome as JSON, for tools that consume a
@@ -35,7 +35,7 @@ function toRunReport(input) {
35
35
  function resolveRunReportPath(flag, env, cwd) {
36
36
  const requested = flag !== void 0 && flag.length > 0 ? flag : env;
37
37
  if (requested === void 0 || requested.length === 0) return void 0;
38
- return path.resolve(cwd, requested);
38
+ return path$1.resolve(cwd, requested);
39
39
  }
40
40
  /**
41
41
  * Writes the report, creating the parent directory if needed. A write failure
@@ -45,8 +45,8 @@ function resolveRunReportPath(flag, env, cwd) {
45
45
  */
46
46
  function writeRunReport(filePath, report) {
47
47
  try {
48
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
49
- fs.writeFileSync(filePath, `${JSON.stringify(report, null, 2)}\n`);
48
+ fs$1.mkdirSync(path$1.dirname(filePath), { recursive: true });
49
+ fs$1.writeFileSync(filePath, `${JSON.stringify(report, null, 2)}\n`);
50
50
  return true;
51
51
  } catch (error) {
52
52
  const detail = error instanceof Error ? error.message : String(error);
@@ -57,4 +57,4 @@ function writeRunReport(filePath, report) {
57
57
  //#endregion
58
58
  export { writeRunReport as a, toRunReport as i, RUN_REPORT_VERSION as n, resolveRunReportPath as r, RUN_REPORT_FILE_ENV as t };
59
59
 
60
- //# sourceMappingURL=run-report-C2o98uD--CAfePImA.mjs.map
60
+ //# sourceMappingURL=run-report-C2o98uD--AX8kpz4Q.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-report-C2o98uD--AX8kpz4Q.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/run-report-C2o98uD-.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/run-report.ts\n/**\n* The run report: one deploy's outcome as JSON, for tools that consume a\n* deploy rather than watch one — the Prisma GitHub Action reads it to build a\n* pull-request comment carrying preview links.\n*\n* Deliberately separate from `deployment-summary.ts`. That file is a private\n* carrier between the alchemy child and this process, written to a\n* per-run path the parent deletes in a `finally` so resource ids and URLs do\n* not accumulate on disk. This one is written where the operator asked for\n* it, survives the run, is written on the failure path too, and carries a\n* version so a consumer can depend on its shape.\n*/\n/** Bump when a change would break a consumer that reads the current shape. */\nconst RUN_REPORT_VERSION = 1;\n/** Names the file to write the run report to, when `--report` is not passed. */\nconst RUN_REPORT_FILE_ENV = \"PRISMA_COMPOSER_REPORT_FILE\";\nfunction toRunReport(input) {\n\treturn {\n\t\tversion: 1,\n\t\toutcome: input.failure === void 0 ? \"succeeded\" : \"failed\",\n\t\tapp: input.summary?.app ?? null,\n\t\tstage: input.stage ?? null,\n\t\tnodes: input.summary?.nodes ?? [],\n\t\tfailure: input.failure ?? null\n\t};\n}\n/**\n* The path to write to: the `--report` flag first, then the env var. Relative\n* paths resolve against the deploy's cwd. `undefined` means no report was\n* asked for, which is the common case and writes nothing.\n*/\nfunction resolveRunReportPath(flag, env, cwd) {\n\tconst requested = flag !== void 0 && flag.length > 0 ? flag : env;\n\tif (requested === void 0 || requested.length === 0) return void 0;\n\treturn path.resolve(cwd, requested);\n}\n/**\n* Writes the report, creating the parent directory if needed. A write failure\n* warns and returns false rather than failing a deploy that already\n* converged — but it is never silent, because the operator asked for this\n* file and a consumer is waiting on it.\n*/\nfunction writeRunReport(filePath, report) {\n\ttry {\n\t\tfs.mkdirSync(path.dirname(filePath), { recursive: true });\n\t\tfs.writeFileSync(filePath, `${JSON.stringify(report, null, 2)}\\n`);\n\t\treturn true;\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not write the run report to ${filePath}: ${detail}`);\n\t\treturn false;\n\t}\n}\n//#endregion\nexport { writeRunReport as a, toRunReport as i, RUN_REPORT_VERSION as n, resolveRunReportPath as r, RUN_REPORT_FILE_ENV as t };\n\n//# sourceMappingURL=run-report-C2o98uD-.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,qBAAqB;;AAE3B,MAAM,sBAAsB;AAC5B,SAAS,YAAY,OAAO;CAC3B,OAAO;EACN,SAAS;EACT,SAAS,MAAM,YAAY,KAAK,IAAI,cAAc;EAClD,KAAK,MAAM,SAAS,OAAO;EAC3B,OAAO,MAAM,SAAS;EACtB,OAAO,MAAM,SAAS,SAAS,CAAC;EAChC,SAAS,MAAM,WAAW;CAC3B;AACD;;;;;;AAMA,SAAS,qBAAqB,MAAM,KAAK,KAAK;CAC7C,MAAM,YAAY,SAAS,KAAK,KAAK,KAAK,SAAS,IAAI,OAAO;CAC9D,IAAI,cAAc,KAAK,KAAK,UAAU,WAAW,GAAG,OAAO,KAAK;CAChE,OAAOA,OAAK,QAAQ,KAAK,SAAS;AACnC;;;;;;;AAOA,SAAS,eAAe,UAAU,QAAQ;CACzC,IAAI;EACH,KAAG,UAAUA,OAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;EACxD,KAAG,cAAc,UAAU,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,GAAG;EACjE,OAAO;CACR,SAAS,OAAO;EACf,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACpE,QAAQ,KAAK,uCAAuC,SAAS,IAAI,QAAQ;EACzE,OAAO;CACR;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/composer",
3
- "version": "0.6.0-dev.22",
3
+ "version": "0.6.0-dev.23",
4
4
  "type": "module",
5
5
  "description": "Prisma Composer — build a Prisma App by composing Modules. Core authoring, deploy pipeline, and the service-rpc/node/nextjs authoring surfaces. The `prisma-composer` CLI lives in @prisma/composer-cli.",
6
6
  "exports": {
@@ -36,15 +36,15 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@effect/vitest": "4.0.0-beta.103",
39
- "@internal/assemble": "0.6.0-dev.22",
40
- "@internal/cli": "0.6.0-dev.22",
41
- "@internal/core": "0.6.0-dev.22",
42
- "@internal/foundation": "0.6.0-dev.22",
43
- "@internal/lowering": "0.6.0-dev.22",
44
- "@internal/nextjs": "0.6.0-dev.22",
45
- "@internal/node": "0.6.0-dev.22",
46
- "@internal/service-rpc": "0.6.0-dev.22",
47
- "@internal/tsdown-config": "0.6.0-dev.22",
39
+ "@internal/assemble": "0.6.0-dev.23",
40
+ "@internal/cli": "0.6.0-dev.23",
41
+ "@internal/core": "0.6.0-dev.23",
42
+ "@internal/foundation": "0.6.0-dev.23",
43
+ "@internal/lowering": "0.6.0-dev.23",
44
+ "@internal/nextjs": "0.6.0-dev.23",
45
+ "@internal/node": "0.6.0-dev.23",
46
+ "@internal/service-rpc": "0.6.0-dev.23",
47
+ "@internal/tsdown-config": "0.6.0-dev.23",
48
48
  "@types/node": "^26.0.1",
49
49
  "tsdown": "^0.22.7",
50
50
  "typescript": "^6.0.3"
@@ -1 +0,0 @@
1
- {"version":3,"file":"deployment-summary-DswOl_9E-C03NJ98H.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-DswOl_9E.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/deployment-summary.ts\n/**\n* The deploy result's cross-process protocol, whole in one place: the\n* serializable shape, the env var that names the carrier file, the writer the\n* report hook calls from inside the alchemy child, and the reader the deploy\n* operation runs after the child exits. `DeploymentResult` itself cannot\n* cross the boundary — its `DeployedNode` entries hold live graph-node\n* references (ADR-0033) — so the writer projects it down to what CAN.\n*\n* The summary is best-effort by contract: the writer never fails the child\n* over it, and the reader maps absent or malformed to `undefined`.\n*/\n/** Env var the deploy operation sets on the alchemy child: when present,\n* the report hook also writes the JSON DeploymentSummary there. */\nconst DEPLOYMENT_RESULT_FILE_ENV = \"PRISMA_COMPOSER_DEPLOYMENT_RESULT_FILE\";\n/** Pure projection: keeps app + each node's address/entities, drops the in-process `node`. */\nfunction toDeploymentSummary(result) {\n\treturn {\n\t\tapp: result.app,\n\t\tnodes: result.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities\n\t\t}))\n\t};\n}\n/**\n* Writer half, called by the report hook inside the alchemy child: when the\n* env var names a file, write the summary there. Best-effort — a write\n* failure must not fail a deploy that already converged, so it is swallowed.\n*/\nfunction writeDeploymentSummaryFile(result) {\n\tconst file = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (file === void 0 || file.length === 0) return;\n\ttry {\n\t\tfs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));\n\t} catch {}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Reader half, run by the deploy operation after the child exits. Absent or\n* malformed → undefined — the summary is best-effort, never a deploy failure.\n*/\nfunction readDeploymentSummary(resultFilePath) {\n\tlet raw;\n\ttry {\n\t\traw = fs.readFileSync(resultFilePath, \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isRecord(parsed) || typeof parsed[\"app\"] !== \"string\" || !Array.isArray(parsed[\"nodes\"])) return;\n\tfor (const node of parsed[\"nodes\"]) {\n\t\tif (!isRecord(node) || typeof node[\"address\"] !== \"string\" || !Array.isArray(node[\"entities\"])) return;\n\t\tfor (const entity of node[\"entities\"]) if (!isRecord(entity) || typeof entity[\"kind\"] !== \"string\" || typeof entity[\"id\"] !== \"string\") return;\n\t}\n\treturn blindCast(parsed);\n}\n//#endregion\nexport { readDeploymentSummary as n, writeDeploymentSummaryFile as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-DswOl_9E.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,6BAA6B;;AAEnC,SAAS,oBAAoB,QAAQ;CACpC,OAAO;EACN,KAAK,OAAO;EACZ,OAAO,OAAO,MAAM,KAAK,UAAU;GAClC,SAAS,KAAK;GACd,UAAU,KAAK;EAChB,EAAE;CACH;AACD;;;;;;AAMA,SAAS,2BAA2B,QAAQ;CAC3C,MAAM,OAAO,QAAQ,IAAI;CACzB,IAAI,SAAS,KAAK,KAAK,KAAK,WAAW,GAAG;CAC1C,IAAI;EACH,GAAG,cAAc,MAAM,KAAK,UAAU,oBAAoB,MAAM,CAAC,CAAC;CACnE,QAAQ,CAAC;AACV;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU;AAC/C;;;;;AAKA,SAAS,sBAAsB,gBAAgB;CAC9C,IAAI;CACJ,IAAI;EACH,MAAM,GAAG,aAAa,gBAAgB,MAAM;CAC7C,QAAQ;EACP;CACD;CACA,IAAI;CACJ,IAAI;EACH,SAAS,KAAK,MAAM,GAAG;CACxB,QAAQ;EACP;CACD;CACA,IAAI,CAAC,SAAS,MAAM,KAAK,OAAO,OAAO,WAAW,YAAY,CAAC,MAAM,QAAQ,OAAO,QAAQ,GAAG;CAC/F,KAAK,MAAM,QAAQ,OAAO,UAAU;EACnC,IAAI,CAAC,SAAS,IAAI,KAAK,OAAO,KAAK,eAAe,YAAY,CAAC,MAAM,QAAQ,KAAK,WAAW,GAAG;EAChG,KAAK,MAAM,UAAU,KAAK,aAAa,IAAI,CAAC,SAAS,MAAM,KAAK,OAAO,OAAO,YAAY,YAAY,OAAO,OAAO,UAAU,UAAU;CACzI;CACA,OAAO,UAAU,MAAM;AACxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"execute-deploy-destroy-DRl6Tfg9-ktj5sQsO.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/generate-stack-BL6htaQb.mjs","../../../0-framework/3-tooling/cli/dist/execute-deploy-destroy-DRl6Tfg9.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/generate-stack.ts\n/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */\nconst GENERATED_DIR = \".prisma-composer\";\nconst GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/alchemy.run.ts` to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tlines.push(\" report: deploymentReport,\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the stack module's source (tests assert on it without touching disk) — uses `//` headers, not a block comment, since a cwd path with a star-slash could close one early. */\nfunction renderStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst configImport = relativeImportSpecifier(generatedDir, input.configPath);\n\treturn `// Generated by \\`prisma-composer deploy\\`/\\`prisma-composer destroy\\` — overwritten on every\n// run; do not edit by hand. Independently runnable from ${quote(input.cwd)}:\n//\n// alchemy deploy ${GENERATED_DIR}/${GENERATED_FILE}\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\nimport { lower } from '@prisma/composer/deploy';\nimport { deploymentReport } from '@prisma/composer/report';\nimport config from ${quote(configImport)};\nimport app from ${quote(appImport)};\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the stack file, returning its absolute path. */\nfunction writeStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderStackFile(input));\n\treturn filePath;\n}\nconst GENERATED_STACK_RELATIVE_PATH = path.join(GENERATED_DIR, GENERATED_FILE);\n//#endregion\nexport { renderStackFile as n, writeStackFile as r, GENERATED_STACK_RELATIVE_PATH as t };\n\n//# sourceMappingURL=generate-stack-BL6htaQb.mjs.map","import { r as toStructured } from \"./shared-BTnATsqm.mjs\";\nimport { i as spawnAlchemy, n as alchemyInvocation } from \"./run-alchemy-D44OZlyB.mjs\";\nimport { r as writeStackFile, t as GENERATED_STACK_RELATIVE_PATH } from \"./generate-stack-BL6htaQb.mjs\";\nimport { n as readDeploymentSummary, t as DEPLOYMENT_RESULT_FILE_ENV } from \"./deployment-summary-DswOl_9E.mjs\";\nimport { a as writeRunReport, i as toRunReport, r as resolveRunReportPath, t as RUN_REPORT_FILE_ENV } from \"./run-report-C2o98uD-.mjs\";\nimport { n as runPipeline } from \"./pipeline-AoW8zq4I.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { notOk, ok, okVoid } from \"@internal/foundation/result\";\nimport { spawnSync } from \"node:child_process\";\nimport { randomUUID } from \"node:crypto\";\nimport { containerEnv } from \"@internal/core/config\";\n//#region src/validate-stage.ts\n/** A stage name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateStageName(stage) {\n\tconst result = spawnSync(\"git\", [\"check-ref-format\", `refs/heads/${stage}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliStructuredError(\"DEPLOY.STAGE_UNVALIDATABLE\", `git is required to validate --stage \"${stage}\" (git check-ref-format): ${result.error.message}.`, { cause: result.error });\n\tif (result.status !== 0) throw new CliStructuredError(\"DEPLOY.STAGE_INVALID\", `Invalid --stage \"${stage}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${stage}\").`);\n}\n//#endregion\n//#region src/operations/execute-deploy-destroy.ts\n/**\n* The deploy/destroy executor — main.ts's pipeline orchestration with argv,\n* console, and exit codes removed: typed inputs in, structured results out.\n* Reached only by lazy import from deploy.ts/destroy.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nconst ALCHEMY_STATE_DIR = \".alchemy\";\n/** Destroy guardrail (moved from main.ts): true when `<cwd>/.alchemy` is missing or empty — likely wrong directory or nothing deployed yet. */\nfunction hasNoLocalDeployState(cwd) {\n\tconst stateDir = path.join(cwd, ALCHEMY_STATE_DIR);\n\treturn !(fs.existsSync(stateDir) && fs.readdirSync(stateDir).length > 0);\n}\nasync function executeDeploy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"deploy\", {\n\t\tentry: input.entry,\n\t\tname: input.name,\n\t\tstage: input.stage,\n\t\tcwd,\n\t\tonEvent: void 0,\n\t\tdeps,\n\t\treportId: input.reportId\n\t});\n\tconst reportPath = resolveRunReportPath(input.reportPath, process.env[RUN_REPORT_FILE_ENV], cwd);\n\tif (reportPath !== void 0) writeRunReport(reportPath, toRunReport({\n\t\tsummary: outcome.ok ? outcome.value : void 0,\n\t\tstage: input.stage,\n\t\tfailure: outcome.ok ? void 0 : {\n\t\t\tcode: outcome.failure.code,\n\t\t\tmessage: outcome.failure.message\n\t\t}\n\t}));\n\tif (!outcome.ok) return outcome;\n\treturn ok({ summary: outcome.value });\n}\nasync function executeDestroy(input, deps, cwd) {\n\tconst outcome = await runStackPipeline(\"destroy\", {\n\t\tentry: input.entry,\n\t\tname: input.name,\n\t\tstage: input.target.kind === \"stage\" ? input.target.stage : void 0,\n\t\tcwd,\n\t\tonEvent: input.onEvent,\n\t\tdeps,\n\t\treportId: void 0\n\t});\n\tif (!outcome.ok) return outcome;\n\treturn okVoid();\n}\n/**\n* Opens a session per extension that declares a reporter. A `begin` that\n* throws costs that extension its reporting and nothing else — the deploy\n* has not started, and refusing to run it because an observer failed would\n* invert the relationship.\n*/\nasync function beginReporters(extensions, context) {\n\treturn (await Promise.all(extensions.map(async (extension) => {\n\t\tif (extension.reporter === void 0) return void 0;\n\t\ttry {\n\t\t\tconst reporter = await extension.reporter.begin(context);\n\t\t\treturn reporter === void 0 ? void 0 : {\n\t\t\t\textensionId: extension.id,\n\t\t\t\treporter\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not start deploy reporting for ${extension.id}: ${detail}`);\n\t\t\treturn;\n\t\t}\n\t}))).filter((entry) => entry !== void 0);\n}\n/** Hands each session its own extension's resolved container, so it can attach the run to what that container names. */\nasync function attachReporters(reporters, containers) {\n\tawait Promise.all(reporters.map(async ({ extensionId, reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.attach({ container: containers.get(extensionId) });\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not attach this deploy to its project for ${extensionId}: ${detail}`);\n\t\t}\n\t}));\n}\n/** Every session's contribution to the alchemy child's environment, so reporting that happens inside the apply can find the run. */\nfunction reporterChildEnv(reporters) {\n\tconst env = {};\n\tfor (const { extensionId, reporter } of reporters) try {\n\t\tObject.assign(env, reporter.childEnv());\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not pass deploy reporting into the apply for ${extensionId}: ${detail}`);\n\t}\n\treturn env;\n}\n/** `failingStep` is capped at 500 by the platform and `errorMessage` at 5000; truncating here keeps a long message from costing the whole report. */\nfunction truncate(value, limit) {\n\treturn value.length <= limit ? value : `${value.slice(0, limit - 1)}…`;\n}\n/** An interrupted converge (the engine settled a Ctrl-C) — reported as `cancelled`, never as `failed`. */\nfunction wasInterrupted(failure) {\n\treturn typeof failure.meta?.[\"signal\"] === \"string\";\n}\n/**\n* Ends every reporting session, whatever the run did. Sessions never reject\n* by contract, but a buggy one must not turn a converged deploy into a\n* failure — so this swallows anyway, and reports each session independently\n* so one bad implementation cannot silence another.\n*/\nasync function finishReporters(reporters, outcome) {\n\tconst entities = outcome.summary?.nodes.flatMap((node) => node.entities) ?? [];\n\tawait Promise.all(reporters.map(async ({ reporter }) => {\n\t\ttry {\n\t\t\tawait reporter.finish({\n\t\t\t\tok: outcome.ok,\n\t\t\t\tcancelled: outcome.cancelled,\n\t\t\t\tfailingStep: outcome.code === void 0 ? void 0 : truncate(outcome.code, 500),\n\t\t\t\terrorMessage: outcome.message === void 0 ? void 0 : truncate(outcome.message, 5e3),\n\t\t\t\tentities\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`\\nCould not report this deploy's outcome: ${detail}`);\n\t\t}\n\t}));\n}\n/**\n* Owns the reporting sessions around the pipeline: the inner run opens them\n* once it knows which extensions are configured, and this closes them on\n* every exit path — a returned failure, a success, or a thrown defect.\n* Nothing here can change what the pipeline returns.\n*/\nasync function runStackPipeline(action, opts) {\n\tconst reporters = [];\n\tlet outcome;\n\ttry {\n\t\toutcome = await runStackPipelineInner(action, opts, reporters);\n\t} catch (error) {\n\t\tawait finishReporters(reporters, {\n\t\t\tok: false,\n\t\t\tcancelled: false,\n\t\t\tcode: \"DEPLOY.UNEXPECTED\",\n\t\t\tmessage: error instanceof Error ? error.message : String(error)\n\t\t});\n\t\tthrow error;\n\t}\n\tawait finishReporters(reporters, outcome.ok ? {\n\t\tok: true,\n\t\tcancelled: false,\n\t\tsummary: outcome.value\n\t} : {\n\t\tok: false,\n\t\tcancelled: wasInterrupted(outcome.failure),\n\t\tcode: outcome.failure.code,\n\t\tmessage: outcome.failure.message\n\t});\n\treturn outcome;\n}\n/** The pipeline both actions share: validate, resolve containers, preflight,\n* write the stack file, run alchemy against it, then the destroy-only\n* teardown/removal suffix. The value is only ever a summary for deploy. */\nasync function runStackPipelineInner(action, opts, reporters) {\n\tconst { entry, name, stage, cwd, onEvent, deps } = opts;\n\tif (stage !== void 0) try {\n\t\tvalidateStageName(stage);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (action === \"destroy\" && hasNoLocalDeployState(cwd)) onEvent?.({\n\t\tkind: \"no-local-deploy-state\",\n\t\tcwd\n\t});\n\tlet pipeline;\n\tlet containers;\n\tlet alchemyStage;\n\ttry {\n\t\tpipeline = await runPipeline(entry, name, cwd, {\n\t\t\trunAssembler: deps.runAssembler,\n\t\t\tconfig: deps.config,\n\t\t\tconfigPath: deps.configPath\n\t\t}, action === \"destroy\" ? (error) => new CliStructuredError(\"DEPLOY.BUILD_REQUIRED\", error.message, {\n\t\t\twhy: \"destroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first.\",\n\t\t\tfix: \"Run the build, then retry the destroy.\",\n\t\t\tcause: error\n\t\t}) : void 0);\n\t\tconst { config, graph, name: resolvedName } = pipeline;\n\t\tif (action === \"deploy\") reporters.push(...await beginReporters(config.extensions, {\n\t\t\tappName: resolvedName,\n\t\t\tstage,\n\t\t\tcwd,\n\t\t\treportId: opts.reportId,\n\t\t\tcredentials: deps.credentials\n\t\t}));\n\t\tcontainers = /* @__PURE__ */ new Map();\n\t\tfor (const extension of config.extensions) {\n\t\t\tif (extension.container === void 0) continue;\n\t\t\ttry {\n\t\t\t\tif (action === \"deploy\") containers.set(extension.id, await extension.container.ensure({\n\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\tstage\n\t\t\t\t}, deps.credentials));\n\t\t\t\telse {\n\t\t\t\t\tconst instance = await extension.container.locate({\n\t\t\t\t\t\tappName: resolvedName,\n\t\t\t\t\t\tstage\n\t\t\t\t\t}, deps.credentials);\n\t\t\t\t\tif (instance === void 0) throw new CliStructuredError(\"DEPLOY.TARGET_NOT_FOUND\", `Nothing deployed for ${resolvedName}${stage !== void 0 ? `/${stage}` : \"\"}.`, { fix: \"Deploy it first.\" });\n\t\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_FAILED\", error);\n\t\t\t}\n\t\t}\n\t\tawait attachReporters(reporters, containers);\n\t\tconst pinnedStage = containers.get(config.state.extension)?.alchemyStage ?? stage;\n\t\tif (pinnedStage === void 0) throw new CliStructuredError(\"DEPLOY.SCOPE_MISSING\", \"The configured deploy target supplied no deploy scope (its container defines no alchemyStage), so Alchemy has no stage to run under.\", { fix: action === \"deploy\" ? \"Pass --stage <name> to choose the deploy scope explicitly.\" : \"destroy --production needs a target whose container supplies the production deploy scope.\" });\n\t\talchemyStage = pinnedStage;\n\t\tif (action === \"deploy\") for (const extension of config.extensions) {\n\t\t\tif (extension.preflight === void 0) continue;\n\t\t\ttry {\n\t\t\t\tawait extension.preflight({\n\t\t\t\t\tgraph,\n\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\tstage,\n\t\t\t\t\tcredentials: deps.credentials\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tthrow toStructured(\"DEPLOY.PREFLIGHT_FAILED\", error);\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tlet stackPath;\n\tconst resultFilePath = path.join(cwd, \".prisma-composer\", `deployment-result-${String(process.pid)}-${randomUUID()}.json`);\n\ttry {\n\t\ttry {\n\t\t\tstackPath = writeStackFile({\n\t\t\t\tentryPath: pipeline.entryModule.path,\n\t\t\t\tcwd,\n\t\t\t\tconfigPath: pipeline.configPath,\n\t\t\t\tname: pipeline.name,\n\t\t\t\tassembled: pipeline.assembled\n\t\t\t});\n\t\t} catch (error) {\n\t\t\treturn notOk(toStructured(\"DEPLOY.STACK_WRITE_FAILED\", error));\n\t\t}\n\t\tconst reproduceCommand = `alchemy ${action} ${GENERATED_STACK_RELATIVE_PATH} --yes --stage ${alchemyStage}`;\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await (deps.alchemy ?? spawnAlchemy)(alchemyInvocation({\n\t\t\t\tcommand: action,\n\t\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\t\tcwd,\n\t\t\t\tstage: alchemyStage,\n\t\t\t\tcontainerEnv: containerEnv(containers),\n\t\t\t\tenv: {\n\t\t\t\t\t...reporterChildEnv(reporters),\n\t\t\t\t\t[DEPLOYMENT_RESULT_FILE_ENV]: resultFilePath\n\t\t\t\t}\n\t\t\t}));\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tcause: error,\n\t\t\t\tmeta: { diagnostics: {\n\t\t\t\t\texitCode: void 0,\n\t\t\t\t\tstackFilePath: stackPath,\n\t\t\t\t\treproduceCommand,\n\t\t\t\t\tcwd\n\t\t\t\t} }\n\t\t\t}));\n\t\t}\n\t\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} was interrupted by ${outcome.signal}.`, { meta: {\n\t\t\tsignal: outcome.signal,\n\t\t\tdiagnostics: {\n\t\t\t\texitCode: void 0,\n\t\t\t\tsignal: outcome.signal,\n\t\t\t\tstackFilePath: stackPath,\n\t\t\t\treproduceCommand,\n\t\t\t\tcwd\n\t\t\t}\n\t\t} }));\n\t\tconst status = outcome.exitCode ?? 1;\n\t\tif (status !== 0) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy ${action} exited with status ${status}.`, { meta: {\n\t\t\texitCode: status,\n\t\t\tdiagnostics: {\n\t\t\t\texitCode: status,\n\t\t\t\tstackFilePath: stackPath,\n\t\t\t\treproduceCommand,\n\t\t\t\tcwd\n\t\t\t}\n\t\t} }));\n\t\ttry {\n\t\t\tif (action === \"destroy\") {\n\t\t\t\tfor (const extension of pipeline.config.extensions) {\n\t\t\t\t\tif (extension.teardown === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.teardown({\n\t\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\t\tstage\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.TEARDOWN_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const extension of pipeline.config.extensions) {\n\t\t\t\t\tif (extension.container === void 0) continue;\n\t\t\t\t\tconst instance = containers.get(extension.id);\n\t\t\t\t\tif (instance === void 0) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait extension.container.remove(instance, deps.credentials);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow toStructured(\"DEPLOY.CONTAINER_REMOVE_FAILED\", error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\tthrow error;\n\t\t}\n\t\tif (action === \"deploy\") return ok(readDeploymentSummary(resultFilePath));\n\t\treturn ok(void 0);\n\t} finally {\n\t\ttry {\n\t\t\tfs.rmSync(resultFilePath, { force: true });\n\t\t} catch {}\n\t}\n}\n//#endregion\nexport { executeDeploy, executeDestroy };\n\n//# sourceMappingURL=execute-deploy-destroy-DRl6Tfg9.mjs.map"],"mappings":";;;;;;;;;;;;;AAIA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;;AAEvB,SAAS,wBAAwB,cAAc,QAAQ;CACtD,MAAM,MAAM,KAAK,SAAS,cAAc,MAAM,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG;CACxE,OAAO,IAAI,WAAW,GAAG,IAAI,MAAM,KAAK;AACzC;AACA,SAAS,MAAM,OAAO;CACrB,OAAO,KAAK,UAAU,KAAK;AAC5B;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO,UAAU,MAAM,OAAO,GAAG,EAAE,WAAW,MAAM,OAAO,KAAK,EAAE;AACnE;AACA,SAAS,cAAc,OAAO;CAC7B,MAAM,QAAQ,CAAC;CACf,MAAM,KAAK,WAAW,MAAM,MAAM,IAAI,EAAE,EAAE;CAC1C,MAAM,KAAK,cAAc;CACzB,KAAK,MAAM,CAAC,IAAI,WAAW,OAAO,QAAQ,MAAM,UAAU,OAAO,GAAG,MAAM,KAAK,OAAO,MAAM,EAAE,EAAE,IAAI,aAAa,MAAM,EAAE,EAAE;CAC3H,MAAM,KAAK,MAAM;CACjB,MAAM,KAAK,6BAA6B;CACxC,OAAO,MAAM,KAAK,IAAI;AACvB;;AAEA,SAAS,gB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