@prisma/composer-cli 0.25.0-dev.3 → 0.25.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/bin.mjs +55 -108
  2. package/dist/bin.mjs.map +1 -1
  3. package/dist/{execute-deploy-destroy-Bdi-RiN5-T3tv5DHr.mjs → execute-deploy-destroy-CF6DR7sA-DGs5poBA.mjs} +23 -19
  4. package/dist/execute-deploy-destroy-CF6DR7sA-DGs5poBA.mjs.map +1 -0
  5. package/dist/{execute-deploy-destroy-Bdi-RiN5-BBrZ9a8c.mjs → execute-deploy-destroy-CF6DR7sA-jdelm-y5.mjs} +22 -18
  6. package/dist/execute-deploy-destroy-CF6DR7sA-jdelm-y5.mjs.map +1 -0
  7. package/dist/{execute-dev-BLCK5wF7-B-fG_E31.mjs → execute-dev-DAIUT0es-CVW9TfgX.mjs} +179 -130
  8. package/dist/execute-dev-DAIUT0es-CVW9TfgX.mjs.map +1 -0
  9. package/dist/{execute-dev-BLCK5wF7-CuzMSK7T.mjs → execute-dev-DAIUT0es-DTdnJdOi.mjs} +100 -131
  10. package/dist/{execute-dev-BLCK5wF7-B-fG_E31.mjs.map → execute-dev-DAIUT0es-DTdnJdOi.mjs.map} +1 -1
  11. package/dist/{execute-log-B_zCJ17b-C4a0uxJj.mjs → execute-log-PLs9-Qn3-BUBx5KmY.mjs} +7 -10
  12. package/dist/execute-log-PLs9-Qn3-BUBx5KmY.mjs.map +1 -0
  13. package/dist/{execute-log-B_zCJ17b-BrLUt7vo.mjs → execute-log-PLs9-Qn3-D8DRuvDr.mjs} +6 -9
  14. package/dist/execute-log-PLs9-Qn3-D8DRuvDr.mjs.map +1 -0
  15. package/dist/{family-DEJvITUc-DHsvEGPB.d.mts → family-DB2Uf88c-DWEm0USb.d.mts} +71 -14
  16. package/dist/{family-DEJvITUc-DHsvEGPB.d.mts.map → family-DB2Uf88c-DWEm0USb.d.mts.map} +1 -1
  17. package/dist/family.d.mts +3 -13
  18. package/dist/family.d.mts.map +1 -1
  19. package/dist/family.mjs +55 -108
  20. package/dist/family.mjs.map +1 -1
  21. package/dist/generate-dev-stack-CPpjJdTG-W0N0YgsI.mjs +87 -0
  22. package/dist/generate-dev-stack-CPpjJdTG-W0N0YgsI.mjs.map +1 -0
  23. package/dist/{local-target-hoEGqgVA.mjs → local-target-B9cBl_6r.mjs} +3 -3
  24. package/dist/local-target-B9cBl_6r.mjs.map +1 -0
  25. package/dist/{local-target-BOGjATc2.mjs → local-target-P4-n1Ovh.mjs} +3 -3
  26. package/dist/local-target-P4-n1Ovh.mjs.map +1 -0
  27. package/dist/{pipeline-C7gNjMzJ-CMqZQxqM.mjs → pipeline-DAYhea3J-BEnHHWp8.mjs} +36 -261
  28. package/dist/{pipeline-C7gNjMzJ-CMqZQxqM.mjs.map → pipeline-DAYhea3J-BEnHHWp8.mjs.map} +1 -1
  29. package/dist/{pipeline-C7gNjMzJ-CixaMvnR.mjs → pipeline-DAYhea3J-uuBciVDS.mjs} +36 -262
  30. package/dist/{pipeline-C7gNjMzJ-CixaMvnR.mjs.map → pipeline-DAYhea3J-uuBciVDS.mjs.map} +1 -1
  31. package/dist/result-D9vIrN7i.mjs +432 -0
  32. package/dist/result-D9vIrN7i.mjs.map +1 -0
  33. package/dist/{result-B874OKwb.mjs → result-SF9LFOuR.mjs} +207 -129
  34. package/dist/result-SF9LFOuR.mjs.map +1 -0
  35. package/dist/{run-alchemy-pANK8XNX-BH1wC0r6.mjs → run-alchemy-pANK8XNX-CqXC1tbs.mjs} +2 -2
  36. package/dist/{run-alchemy-pANK8XNX-BH1wC0r6.mjs.map → run-alchemy-pANK8XNX-CqXC1tbs.mjs.map} +1 -1
  37. package/dist/{run-alchemy-pANK8XNX-XcCQncKN.mjs → run-alchemy-pANK8XNX-T_pHNDBo.mjs} +2 -2
  38. package/dist/{run-alchemy-pANK8XNX-XcCQncKN.mjs.map → run-alchemy-pANK8XNX-T_pHNDBo.mjs.map} +1 -1
  39. package/dist/shared-BAIiDgXa-DYP7EOSk.mjs +33 -0
  40. package/dist/shared-BAIiDgXa-DYP7EOSk.mjs.map +1 -0
  41. package/dist/testing.d.mts +16 -2
  42. package/dist/testing.d.mts.map +1 -1
  43. package/dist/testing.mjs +3 -2
  44. package/dist/testing.mjs.map +1 -1
  45. package/package.json +4 -5
  46. package/src/exports/testing.ts +3 -1
  47. package/dist/execute-deploy-destroy-Bdi-RiN5-BBrZ9a8c.mjs.map +0 -1
  48. package/dist/execute-deploy-destroy-Bdi-RiN5-T3tv5DHr.mjs.map +0 -1
  49. package/dist/execute-dev-BLCK5wF7-CuzMSK7T.mjs.map +0 -1
  50. package/dist/execute-log-B_zCJ17b-BrLUt7vo.mjs.map +0 -1
  51. package/dist/execute-log-B_zCJ17b-C4a0uxJj.mjs.map +0 -1
  52. package/dist/local-target-BOGjATc2.mjs.map +0 -1
  53. package/dist/local-target-hoEGqgVA.mjs.map +0 -1
  54. package/dist/result-B874OKwb.mjs.map +0 -1
  55. package/dist/result-sR7PBi61.mjs +0 -229
  56. package/dist/result-sR7PBi61.mjs.map +0 -1
  57. package/dist/shared-BTnATsqm-BH4axbJg.mjs +0 -158
  58. package/dist/shared-BTnATsqm-BH4axbJg.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-dev-stack-CPpjJdTG-W0N0YgsI.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/generate-dev-stack-CPpjJdTG.mjs"],"sourcesContent":["import { r as noComposerExportMessage } from \"./composer-config-CY9fET8H.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/dev/generate-dev-stack.ts\n/**\n* Local-dev spec § 6 `generate-dev-stack.ts`: like generate-stack.ts but at\n* `.prisma-composer/dev/alchemy.run.ts`, always Alchemy stage `dev`, using\n* Alchemy's own `localState()` and no `report` — dev prints its own front\n* door (run-dev.ts), so core's presentation-free lower() gets nothing to\n* call back into. The generated module IS the one orchestration point where\n* dev provenance is resolved (spec § 3 REVISED): it deserializes the\n* containers, top-level-awaits `resolveLocalTargets(config)` (the lazy\n* `localTarget` thunks, ADR-0041), and passes\n* `providers: localTargetProviders(...)` + `state: localState()` explicitly\n* — `lower()` learns nothing about dev.\n*/\nconst DEV_GENERATED_DIR = \".prisma-composer/dev\";\nconst DEV_GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/dev/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(\" providers: localTargetProviders(resolved, containers, devDir),\");\n\tlines.push(\" state: localState(),\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the dev stack module's source (tests assert on it without touching disk). */\nfunction renderDevStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, DEV_GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst imports = [\n\t\t\"import * as path from 'node:path';\",\n\t\t\"import { deserializeContainers } from '@prisma/composer/config';\",\n\t\t\"import { lower } from '@prisma/composer/deploy';\",\n\t\t\"import { DEV_DIR, localTargetProviders, resolveLocalTargets } from '@prisma/composer/local-target';\",\n\t\t\"import { localState } from 'alchemy/State/LocalState';\",\n\t\t`import prismaConfig from ${quote(relativeImportSpecifier(generatedDir, input.configFile))};`,\n\t\t`import app from ${quote(appImport)};`\n\t].join(\"\\n\");\n\treturn `// Generated by \\`prisma-composer dev\\` — overwritten on every run; do not\n// edit by hand. Independently runnable from ${quote(input.cwd)}:\n//\n// alchemy deploy ${DEV_GENERATED_DIR}/${DEV_GENERATED_FILE} --stage dev\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\n${imports}\n\nconst config = prismaConfig.composer;\nif (config === undefined) {\n throw new Error(${quote(noComposerExportMessage(input.configFile))});\n}\n\nconst containers = deserializeContainers(config.extensions, process.env);\nconst resolved = await resolveLocalTargets(config);\nconst devDir = path.join(process.cwd(), DEV_DIR);\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the dev stack file, returning its absolute path. */\nfunction writeDevStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, DEV_GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, DEV_GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderDevStackFile(input));\n\treturn filePath;\n}\nconst DEV_STACK_RELATIVE_PATH = path.join(DEV_GENERATED_DIR, DEV_GENERATED_FILE);\n//#endregion\nexport { renderDevStackFile as n, writeDevStackFile as r, DEV_STACK_RELATIVE_PATH as t };\n\n//# sourceMappingURL=generate-dev-stack-CPpjJdTG.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;;AAE3B,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,kEAAkE;CAC7E,MAAM,KAAK,wBAAwB;CACnC,OAAO,MAAM,KAAK,IAAI;AACvB;;AAEA,SAAS,mBAAmB,OAAO;CAClC,MAAM,eAAe,KAAK,KAAK,MAAM,KAAK,iBAAiB;CAC3D,MAAM,YAAY,wBAAwB,cAAc,MAAM,SAAS;CACvE,MAAM,UAAU;EACf;EACA;EACA;EACA;EACA;EACA,4BAA4B,MAAM,wBAAwB,cAAc,MAAM,UAAU,CAAC,EAAE;EAC3F,mBAAmB,MAAM,SAAS,EAAE;CACrC,CAAC,CAAC,KAAK,IAAI;CACX,OAAO;+CACuC,MAAM,MAAM,GAAG,EAAE;;sBAE1C,kBAAkB,GAAG,mBAAmB;;;EAG5D,QAAQ;;;;oBAIU,MAAM,wBAAwB,MAAM,UAAU,CAAC,EAAE;;;;;;;;EAQnE,cAAc,KAAK,EAAE;;;AAGvB;;AAEA,SAAS,kBAAkB,OAAO;CACjC,MAAM,eAAe,KAAK,KAAK,MAAM,KAAK,iBAAiB;CAC3D,GAAG,UAAU,cAAc,EAAE,WAAW,KAAK,CAAC;CAC9C,MAAM,WAAW,KAAK,KAAK,cAAc,kBAAkB;CAC3D,GAAG,cAAc,UAAU,mBAAmB,KAAK,CAAC;CACpD,OAAO;AACR;AACA,MAAM,0BAA0B,KAAK,KAAK,mBAAmB,kBAAkB"}
@@ -1,6 +1,6 @@
1
- import { c as CliStructuredError } from "./result-B874OKwb.mjs";
1
+ import { c as CliStructuredError } from "./result-D9vIrN7i.mjs";
2
2
  import "effect/Layer";
3
- //#region ../../0-framework/1-core/core/dist/app-config-joXc-BKm.mjs
3
+ //#region ../../0-framework/1-core/core/dist/app-config-CGJHcFb-.mjs
4
4
  /** `<cwd>/.prisma-composer/dev` — the dev instance's app-scoped state directory (ADR-0041, ADR-0004's tool-state rule). "dev" names the user-facing feature/dir (naming, operator 2026-07-23) — this constant's name and value are unchanged by the localTarget rename. */
5
5
  const DEV_DIR = ".prisma-composer/dev";
6
6
  /**
@@ -65,4 +65,4 @@ async function resolveLocalTargets(config) {
65
65
  //#endregion
66
66
  export { withEmulatorRetry as n, DEV_DIR as r, resolveLocalTargets as t };
67
67
 
68
- //# sourceMappingURL=local-target-hoEGqgVA.mjs.map
68
+ //# sourceMappingURL=local-target-B9cBl_6r.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-target-B9cBl_6r.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-CGJHcFb-.mjs","../../../0-framework/3-tooling/cli/dist/emulator-retry-DGonap4g.mjs","../../../0-framework/1-core/core/dist/local-target.mjs"],"sourcesContent":["//#region src/control/app-config.ts\n/** `<cwd>/.prisma-composer/dev` — the dev instance's app-scoped state directory (ADR-0041, ADR-0004's tool-state rule). \"dev\" names the user-facing feature/dir (naming, operator 2026-07-23) — this constant's name and value are unchanged by the localTarget rename. */\nconst DEV_DIR = \".prisma-composer/dev\";\n/**\n* True when an extension only participates in assembly (every `nodes` entry\n* is `kind: 'build'`, and it declares none of `providers`/`application`/\n* `provisions`/`container`) — it owns no resources or services, so it has\n* nothing to emulate and is exempt from local-target-capability requirements\n* (ADR-0041). Shared by `localTargetProviders` and every local-target hook\n* iteration.\n*/\nfunction isBuildOnlyExtension(extension) {\n\treturn Object.values(extension.nodes).every((node) => node.kind === \"build\") && extension.providers === void 0 && extension.application === void 0 && extension.provisions === void 0 && extension.container === void 0;\n}\n/** Typed identity — exists so the `composer` section of `prisma.config.ts` gets checked against PrismaAppConfig where it is written. */\nfunction defineConfig(config) {\n\treturn config;\n}\n//#endregion\nexport { defineConfig as n, isBuildOnlyExtension as r, DEV_DIR as t };\n\n//# sourceMappingURL=app-config-CGJHcFb-.mjs.map","//#region src/operations/emulator-retry.ts\n/**\n* An emulator admin call right after a converge that just PUT dozens of\n* resources through the same daemon can hit a transient refused/reset\n* connection — a brief loopback hiccup under load, not a real failure.\n* Retried before giving up. Shared by the dev and log executors, which talk\n* to the same daemons (`startServices`, `endpoints`, `attach`).\n*/\nconst EMULATOR_RETRY_ATTEMPTS = 5;\nconst EMULATOR_RETRY_DELAY_MS = 500;\nasync function withEmulatorRetry(call) {\n\tlet lastError;\n\tfor (let attempt = 1; attempt <= EMULATOR_RETRY_ATTEMPTS; attempt += 1) try {\n\t\treturn await call();\n\t} catch (error) {\n\t\tlastError = error;\n\t\tif (attempt < EMULATOR_RETRY_ATTEMPTS) await new Promise((resolve) => setTimeout(resolve, EMULATOR_RETRY_DELAY_MS));\n\t}\n\tthrow lastError instanceof Error ? lastError : new Error(String(lastError));\n}\n//#endregion\nexport { withEmulatorRetry as t };\n\n//# sourceMappingURL=emulator-retry-DGonap4g.mjs.map","import { r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-CGJHcFb-.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as Layer from \"effect/Layer\";\n//#region src/control/local-target.ts\n/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, \"dev\" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */\nfunction noLocalTargetSupportError(id) {\n\treturn new CliStructuredError(\"DEV.TARGET_UNSUPPORTED\", `extension \"${id}\" has no dev support — it declares no \\`localTarget\\` descriptor (ADR-0041).`);\n}\n/**\n* Resolves every non-build-only configured extension's lazy `localTarget`\n* thunk, once (ADR-0041's lazy local-target reference — operator directive:\n* the production control entry carries only the thunk, never the\n* descriptor, so resolving it is this module's job, not something a deploy\n* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no\n* resources or services and is skipped entirely — never even checked for a\n* `localTarget` thunk. Every other configured extension must be\n* local-target-capable, or the dev command cannot bring the app up at all,\n* so a missing thunk throws naming the extension. The generated dev stack\n* module calls this once and threads the resolved map through every\n* subsequent hook, including `localTargetProviders`.\n*/\nasync function resolveLocalTargets(config) {\n\tconst entries = await Promise.all(config.extensions.flatMap((extension) => {\n\t\tif (isBuildOnlyExtension(extension)) return [];\n\t\tif (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);\n\t\treturn [extension.localTarget().then((descriptor) => [extension.id, descriptor])];\n\t}));\n\treturn new Map(entries);\n}\n/**\n* All configured extensions' local-target providers merged, config array\n* order (ADR-0041), from the ALREADY-RESOLVED descriptor map\n* (`resolveLocalTargets`'s product — this function itself never touches a\n* `localTarget` thunk). The generated dev stack module is this\n* aggregator's one caller, passing the result as `LowerOptions.providers`.\n*/\nfunction localTargetProviders(resolved, containers, devDir) {\n\tconst [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({\n\t\tcontainer: containers.get(id),\n\t\tdevDir\n\t}));\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n//#endregion\nexport { DEV_DIR, localTargetProviders, resolveLocalTargets };\n\n//# sourceMappingURL=local-target.mjs.map"],"mappings":";;;;AAEA,MAAM,UAAU;;;;;;;;;AAShB,SAAS,qBAAqB,WAAW;CACxC,OAAO,OAAO,OAAO,UAAU,KAAK,CAAC,CAAC,OAAO,SAAS,KAAK,SAAS,OAAO,KAAK,UAAU,cAAc,KAAK,KAAK,UAAU,gBAAgB,KAAK,KAAK,UAAU,eAAe,KAAK,KAAK,UAAU,cAAc,KAAK;AACvN;;;;;;;;;;ACLA,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,eAAe,kBAAkB,MAAM;CACtC,IAAI;CACJ,KAAK,IAAI,UAAU,GAAG,WAAW,yBAAyB,WAAW,GAAG,IAAI;EAC3E,OAAO,MAAM,KAAK;CACnB,SAAS,OAAO;EACf,YAAY;EACZ,IAAI,UAAU,yBAAyB,MAAM,IAAI,SAAS,YAAY,WAAW,SAAS,uBAAuB,CAAC;CACnH;CACA,MAAM,qBAAqB,QAAQ,YAAY,IAAI,MAAM,OAAO,SAAS,CAAC;AAC3E;;;;ACdA,SAAS,0BAA0B,IAAI;CACtC,OAAO,IAAI,mBAAmB,0BAA0B,cAAc,GAAG,6EAA6E;AACvJ;;;;;;;;;;;;;;AAcA,eAAe,oBAAoB,QAAQ;CAC1C,MAAM,UAAU,MAAM,QAAQ,IAAI,OAAO,WAAW,SAAS,cAAc;EAC1E,IAAI,qBAAqB,SAAS,GAAG,OAAO,CAAC;EAC7C,IAAI,UAAU,gBAAgB,KAAK,GAAG,MAAM,0BAA0B,UAAU,EAAE;EAClF,OAAO,CAAC,UAAU,YAAY,CAAC,CAAC,MAAM,eAAe,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC;CACjF,CAAC,CAAC;CACF,OAAO,IAAI,IAAI,OAAO;AACvB"}
@@ -1,6 +1,6 @@
1
- import { i as CliStructuredError } from "./result-sR7PBi61.mjs";
1
+ import { d as CliStructuredError } from "./result-SF9LFOuR.mjs";
2
2
  import "effect/Layer";
3
- //#region ../../0-framework/1-core/core/dist/app-config-joXc-BKm.mjs
3
+ //#region ../../0-framework/1-core/core/dist/app-config-CGJHcFb-.mjs
4
4
  /** `<cwd>/.prisma-composer/dev` — the dev instance's app-scoped state directory (ADR-0041, ADR-0004's tool-state rule). "dev" names the user-facing feature/dir (naming, operator 2026-07-23) — this constant's name and value are unchanged by the localTarget rename. */
5
5
  const DEV_DIR = ".prisma-composer/dev";
6
6
  /**
@@ -65,4 +65,4 @@ async function resolveLocalTargets(config) {
65
65
  //#endregion
66
66
  export { withEmulatorRetry as n, DEV_DIR as r, resolveLocalTargets as t };
67
67
 
68
- //# sourceMappingURL=local-target-BOGjATc2.mjs.map
68
+ //# sourceMappingURL=local-target-P4-n1Ovh.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-target-P4-n1Ovh.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-CGJHcFb-.mjs","../../../0-framework/3-tooling/cli/dist/emulator-retry-DGonap4g.mjs","../../../0-framework/1-core/core/dist/local-target.mjs"],"sourcesContent":["//#region src/control/app-config.ts\n/** `<cwd>/.prisma-composer/dev` — the dev instance's app-scoped state directory (ADR-0041, ADR-0004's tool-state rule). \"dev\" names the user-facing feature/dir (naming, operator 2026-07-23) — this constant's name and value are unchanged by the localTarget rename. */\nconst DEV_DIR = \".prisma-composer/dev\";\n/**\n* True when an extension only participates in assembly (every `nodes` entry\n* is `kind: 'build'`, and it declares none of `providers`/`application`/\n* `provisions`/`container`) — it owns no resources or services, so it has\n* nothing to emulate and is exempt from local-target-capability requirements\n* (ADR-0041). Shared by `localTargetProviders` and every local-target hook\n* iteration.\n*/\nfunction isBuildOnlyExtension(extension) {\n\treturn Object.values(extension.nodes).every((node) => node.kind === \"build\") && extension.providers === void 0 && extension.application === void 0 && extension.provisions === void 0 && extension.container === void 0;\n}\n/** Typed identity — exists so the `composer` section of `prisma.config.ts` gets checked against PrismaAppConfig where it is written. */\nfunction defineConfig(config) {\n\treturn config;\n}\n//#endregion\nexport { defineConfig as n, isBuildOnlyExtension as r, DEV_DIR as t };\n\n//# sourceMappingURL=app-config-CGJHcFb-.mjs.map","//#region src/operations/emulator-retry.ts\n/**\n* An emulator admin call right after a converge that just PUT dozens of\n* resources through the same daemon can hit a transient refused/reset\n* connection — a brief loopback hiccup under load, not a real failure.\n* Retried before giving up. Shared by the dev and log executors, which talk\n* to the same daemons (`startServices`, `endpoints`, `attach`).\n*/\nconst EMULATOR_RETRY_ATTEMPTS = 5;\nconst EMULATOR_RETRY_DELAY_MS = 500;\nasync function withEmulatorRetry(call) {\n\tlet lastError;\n\tfor (let attempt = 1; attempt <= EMULATOR_RETRY_ATTEMPTS; attempt += 1) try {\n\t\treturn await call();\n\t} catch (error) {\n\t\tlastError = error;\n\t\tif (attempt < EMULATOR_RETRY_ATTEMPTS) await new Promise((resolve) => setTimeout(resolve, EMULATOR_RETRY_DELAY_MS));\n\t}\n\tthrow lastError instanceof Error ? lastError : new Error(String(lastError));\n}\n//#endregion\nexport { withEmulatorRetry as t };\n\n//# sourceMappingURL=emulator-retry-DGonap4g.mjs.map","import { r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-CGJHcFb-.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as Layer from \"effect/Layer\";\n//#region src/control/local-target.ts\n/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, \"dev\" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */\nfunction noLocalTargetSupportError(id) {\n\treturn new CliStructuredError(\"DEV.TARGET_UNSUPPORTED\", `extension \"${id}\" has no dev support — it declares no \\`localTarget\\` descriptor (ADR-0041).`);\n}\n/**\n* Resolves every non-build-only configured extension's lazy `localTarget`\n* thunk, once (ADR-0041's lazy local-target reference — operator directive:\n* the production control entry carries only the thunk, never the\n* descriptor, so resolving it is this module's job, not something a deploy\n* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no\n* resources or services and is skipped entirely — never even checked for a\n* `localTarget` thunk. Every other configured extension must be\n* local-target-capable, or the dev command cannot bring the app up at all,\n* so a missing thunk throws naming the extension. The generated dev stack\n* module calls this once and threads the resolved map through every\n* subsequent hook, including `localTargetProviders`.\n*/\nasync function resolveLocalTargets(config) {\n\tconst entries = await Promise.all(config.extensions.flatMap((extension) => {\n\t\tif (isBuildOnlyExtension(extension)) return [];\n\t\tif (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);\n\t\treturn [extension.localTarget().then((descriptor) => [extension.id, descriptor])];\n\t}));\n\treturn new Map(entries);\n}\n/**\n* All configured extensions' local-target providers merged, config array\n* order (ADR-0041), from the ALREADY-RESOLVED descriptor map\n* (`resolveLocalTargets`'s product — this function itself never touches a\n* `localTarget` thunk). The generated dev stack module is this\n* aggregator's one caller, passing the result as `LowerOptions.providers`.\n*/\nfunction localTargetProviders(resolved, containers, devDir) {\n\tconst [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({\n\t\tcontainer: containers.get(id),\n\t\tdevDir\n\t}));\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n//#endregion\nexport { DEV_DIR, localTargetProviders, resolveLocalTargets };\n\n//# sourceMappingURL=local-target.mjs.map"],"mappings":";;;;AAEA,MAAM,UAAU;;;;;;;;;AAShB,SAAS,qBAAqB,WAAW;CACxC,OAAO,OAAO,OAAO,UAAU,KAAK,CAAC,CAAC,OAAO,SAAS,KAAK,SAAS,OAAO,KAAK,UAAU,cAAc,KAAK,KAAK,UAAU,gBAAgB,KAAK,KAAK,UAAU,eAAe,KAAK,KAAK,UAAU,cAAc,KAAK;AACvN;;;;;;;;;;ACLA,MAAM,0BAA0B;AAChC,MAAM,0BAA0B;AAChC,eAAe,kBAAkB,MAAM;CACtC,IAAI;CACJ,KAAK,IAAI,UAAU,GAAG,WAAW,yBAAyB,WAAW,GAAG,IAAI;EAC3E,OAAO,MAAM,KAAK;CACnB,SAAS,OAAO;EACf,YAAY;EACZ,IAAI,UAAU,yBAAyB,MAAM,IAAI,SAAS,YAAY,WAAW,SAAS,uBAAuB,CAAC;CACnH;CACA,MAAM,qBAAqB,QAAQ,YAAY,IAAI,MAAM,OAAO,SAAS,CAAC;AAC3E;;;;ACdA,SAAS,0BAA0B,IAAI;CACtC,OAAO,IAAI,mBAAmB,0BAA0B,cAAc,GAAG,6EAA6E;AACvJ;;;;;;;;;;;;;;AAcA,eAAe,oBAAoB,QAAQ;CAC1C,MAAM,UAAU,MAAM,QAAQ,IAAI,OAAO,WAAW,SAAS,cAAc;EAC1E,IAAI,qBAAqB,SAAS,GAAG,OAAO,CAAC;EAC7C,IAAI,UAAU,gBAAgB,KAAK,GAAG,MAAM,0BAA0B,UAAU,EAAE;EAClF,OAAO,CAAC,UAAU,YAAY,CAAC,CAAC,MAAM,eAAe,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC;CACjF,CAAC,CAAC;CACF,OAAO,IAAI,IAAI,OAAO;AACvB"}
@@ -1,10 +1,9 @@
1
- import { c as CliStructuredError, i as effectResolutionDiagnostic, l as InternalError, u as blindCast } from "./result-B874OKwb.mjs";
1
+ import { a as configFileMissing, c as CliStructuredError, i as checkComposerConfig, l as InternalError, u as blindCast } from "./result-D9vIrN7i.mjs";
2
2
  import * as mod from "node:module";
3
3
  import * as fs from "node:fs";
4
4
  import { existsSync } from "node:fs";
5
5
  import * as path from "node:path";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
7
- import * as c12 from "c12";
8
7
  //#region ../../0-framework/1-core/core/dist/graph-BfKAg2Ap.mjs
9
8
  /** The reserved name of a resource's single anonymous output port. Rejected as a user-declared port name (node.ts). */
10
9
  const RESOURCE_OUT_PORT = "$out";
@@ -827,7 +826,7 @@ var AssembleError = class extends CliStructuredError {
827
826
  function buildDescriptorAssemble(config, node, address, cwd) {
828
827
  const { extension, type } = node.build;
829
828
  const extensionDescriptor = config.extensions.find((candidate) => candidate.id === extension);
830
- if (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`." });
829
+ if (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 `extensions` in the `composer` section of prisma.config.ts." });
831
830
  const nodeDescriptor = extensionDescriptor.nodes[type];
832
831
  if (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(", ")}.` });
833
832
  if (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." });
@@ -854,242 +853,11 @@ async function assembleServices(graph, config, cwd, run) {
854
853
  return { bundles };
855
854
  }
856
855
  //#endregion
857
- //#region ../../0-framework/3-tooling/cli/dist/pipeline-C7gNjMzJ.mjs
858
- /**
859
- * Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE
860
- * file that imports control-plane code. Discovery is the standard walk-up
861
- * from the deploy entry's directory (mirrors prisma/orm's config-loader);
862
- * loading is c12 with that explicit path (rc/global/package.json lookups
863
- * disabled), so the config file's own static imports resolve from the app
864
- * root by whatever package manager runs — no specifier construction, no
865
- * anchoring.
866
- *
867
- * Two shapes of the same machinery:
868
- *
869
- * loadAppConfigDiagnostics — returns the evaluated value together with
870
- * EVERY problem found, and never throws. This is the shape the engine
871
- * command family consumes: the engine renders diagnostics itself and
872
- * decides per command whether a broken section is fatal, so a loader that
873
- * threw on the first bad field would both hide the rest and bypass that
874
- * rendering.
875
- *
876
- * loadAppConfig — the same load, throwing its first diagnostic. The
877
- * clipanion CLI still runs on it; it goes when clipanion does.
878
- */
879
- /**
880
- * Accepted config file names, in precedence order: when several sit in one
881
- * directory the first one found wins. The JavaScript spellings exist so a
882
- * project whose own TypeScript build would otherwise compile the config file
883
- * (no `include`, a `rootDir`, `module: commonjs`) can keep it out of that
884
- * build's sight.
885
- */
886
- const CONFIG_FILENAMES = [
887
- "prisma-composer.config.ts",
888
- "prisma-composer.config.mts",
889
- "prisma-composer.config.mjs",
890
- "prisma-composer.config.js"
891
- ];
892
- /** The canonical spelling, used in messages and docs. */
893
- const CONFIG_FILENAME = CONFIG_FILENAMES[0];
894
- /** The accepted spellings as one glob-like string for messages. */
895
- const CONFIG_FILENAME_PATTERN = "prisma-composer.config.{ts,mts,mjs,js}";
896
- /** Walks UP from the entry file's directory looking for one of CONFIG_FILENAMES; undefined when the walk hits the filesystem root. */
897
- function findConfigPathForEntry(entryPath) {
898
- let current = path.dirname(path.resolve(entryPath));
899
- while (true) {
900
- for (const filename of CONFIG_FILENAMES) {
901
- const candidate = path.join(current, filename);
902
- if (fs.existsSync(candidate)) return candidate;
903
- }
904
- const parent = path.dirname(current);
905
- if (parent === current) return void 0;
906
- current = parent;
907
- }
908
- }
909
- function missingConfigError(entryPath) {
910
- const searchedFrom = path.dirname(path.resolve(entryPath));
911
- return new CliStructuredError("CONFIG.FILE_MISSING", `No ${CONFIG_FILENAME_PATTERN} found walking up from "${searchedFrom}".`, {
912
- why: "The deploy needs the app's config file.",
913
- fix: "Create one next to (or above) the entry, default-exporting defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.",
914
- where: { path: searchedFrom }
915
- });
916
- }
917
- function fieldError(configPath, field, requirement) {
918
- return new CliStructuredError("CONFIG.FIELD_INVALID", `${path.basename(configPath)}: \`${field}\` ${requirement}.`, {
919
- fix: "See defineConfig() in '@prisma/composer/config'.",
920
- meta: { field }
921
- });
922
- }
923
- function isRecord(value) {
924
- return typeof value === "object" && value !== null;
925
- }
926
- /**
927
- * Field-by-field validation of the loaded default export — deliberately no
928
- * schema library: each check is a structured error naming the offending field.
929
- *
930
- * Collects rather than throws, so one bad config reports every bad field
931
- * instead of only the first. The `extensions` and `state` checks are
932
- * independent, and within `extensions` each entry is judged on its own; a
933
- * field whose own shape check already failed is not probed further, because
934
- * anything derived from it would be noise rather than a second finding.
935
- */
936
- function configShapeDiagnostics(loaded, configPath) {
937
- if (!isRecord(loaded) || Object.keys(loaded).length === 0) return [new CliStructuredError("CONFIG.EXPORT_INVALID", `"${configPath}" exported no config.`, {
938
- fix: "It must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.",
939
- where: { path: configPath }
940
- })];
941
- const diagnostics = [];
942
- const extensions = loaded["extensions"];
943
- if (!Array.isArray(extensions)) diagnostics.push(fieldError(configPath, "extensions", "must be an array"));
944
- else {
945
- const seen = /* @__PURE__ */ new Set();
946
- for (const [index, entry] of extensions.entries()) {
947
- if (!isRecord(entry)) {
948
- diagnostics.push(fieldError(configPath, `extensions[${index}]`, "must be an extension descriptor object"));
949
- continue;
950
- }
951
- const id = entry["id"];
952
- if (typeof id !== "string" || id.length === 0) diagnostics.push(fieldError(configPath, `extensions[${index}].id`, "must be a non-empty string (the extension package name)"));
953
- else if (seen.has(id)) diagnostics.push(new CliStructuredError("CONFIG.EXTENSION_DUPLICATE", `${path.basename(configPath)}: extension "${id}" is listed more than once in \`extensions\`.`));
954
- else seen.add(id);
955
- if (!isRecord(entry["nodes"])) diagnostics.push(fieldError(configPath, `extensions[${index}].nodes`, "must be an object (the node-ID → control registry)"));
956
- }
957
- }
958
- const state = loaded["state"];
959
- if (!isRecord(state) || typeof state["extension"] !== "string" || typeof state["create"] !== "function") diagnostics.push(fieldError(configPath, "state", "must be a state descriptor (e.g. prismaState())"));
960
- return diagnostics;
961
- }
962
- /** The throwing form of configShapeDiagnostics: raises the first finding, returns the same object typed. Used by the clipanion pipeline. */
963
- function validateConfigShape(loaded, configPath) {
964
- const [first] = configShapeDiagnostics(loaded, configPath);
965
- if (first !== void 0) throw first;
966
- return blindCast(loaded);
967
- }
968
- /**
969
- * Evaluates `configPath` with c12 (explicit file; rc / global-rc /
970
- * package.json lookups disabled). `verifySamePath` runs the same-file check
971
- * against the discovered path — see loadAppConfigDiagnostics for when it does
972
- * not apply.
973
- */
974
- async function evaluateConfig(configPath, verifySamePath) {
975
- let result;
976
- try {
977
- result = await c12.loadConfig({
978
- name: "prisma-composer",
979
- configFile: configPath,
980
- cwd: path.dirname(configPath),
981
- rcFile: false,
982
- globalRc: false,
983
- packageJson: false
984
- });
985
- } catch (error) {
986
- return {
987
- value: void 0,
988
- diagnostics: [new CliStructuredError("CONFIG.EVALUATION_FAILED", `Evaluating "${configPath}" failed: ${error instanceof Error ? error.message : String(error)}`, {
989
- where: { path: configPath },
990
- cause: error
991
- })]
992
- };
993
- }
994
- const loadedFile = result.configFile;
995
- if (verifySamePath && (typeof loadedFile !== "string" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))) return {
996
- value: result.config,
997
- diagnostics: [new CliStructuredError("CONFIG.PATH_MISMATCH", `Config loading resolved "${String(loadedFile)}" instead of the discovered "${configPath}".`, {
998
- why: "Refusing to deploy against a different file.",
999
- where: { path: configPath }
1000
- })]
1001
- };
1002
- return {
1003
- value: result.config,
1004
- diagnostics: configShapeDiagnostics(result.config, configPath)
1005
- };
1006
- }
1007
- /**
1008
- * The front of every config load, shared by the throwing and the
1009
- * diagnostics-list shapes: verify the installed tree can evaluate a config at
1010
- * all, then settle which file to load — the section's path, or the
1011
- * entry-anchored walk.
1012
- *
1013
- * The effect-resolution check comes first because evaluating a config imports
1014
- * alchemy's provider tree: in a tree where alchemy resolves an `effect` we did
1015
- * not pin, nothing downstream can load, so the dependency conflict is the
1016
- * finding with the fix in it and every later failure is its symptom.
1017
- */
1018
- function configSource(request) {
1019
- const resolvedEntry = path.resolve(request.entryPath);
1020
- const effectConflict = effectResolutionDiagnostic(request.cwd ?? path.dirname(resolvedEntry));
1021
- if (effectConflict !== void 0) return {
1022
- ok: false,
1023
- path: void 0,
1024
- diagnostic: effectConflict
1025
- };
1026
- if (request.configPath === void 0) {
1027
- const discovered = findConfigPathForEntry(resolvedEntry);
1028
- return discovered === void 0 ? {
1029
- ok: false,
1030
- path: void 0,
1031
- diagnostic: missingConfigError(resolvedEntry)
1032
- } : {
1033
- ok: true,
1034
- path: discovered,
1035
- explicit: false
1036
- };
1037
- }
1038
- const configPath = request.configPath;
1039
- if (!path.isAbsolute(configPath)) return {
1040
- ok: false,
1041
- path: configPath,
1042
- diagnostic: new CliStructuredError("CONFIG.PATH_NOT_ABSOLUTE", `The \`composer\` config section's configPath must arrive absolute, and "${configPath}" is relative.`, {
1043
- why: "The section validator resolves a relative configPath against the config file that declared it; a relative value here means that resolution was skipped.",
1044
- fix: "Run the configPath through the composer section validator, or resolve it against its declaring file before constructing the load request.",
1045
- where: { path: configPath }
1046
- })
1047
- };
1048
- if (!fs.existsSync(configPath)) return {
1049
- ok: false,
1050
- path: configPath,
1051
- diagnostic: new CliStructuredError("CONFIG.FILE_MISSING", `The \`composer\` config section points at "${configPath}", which does not exist.`, {
1052
- why: "An explicit configPath is used as given — there is no walk to fall back on.",
1053
- fix: "Correct `configPath` in the `composer` section of prisma.config.ts, or remove it to search upward from the entry.",
1054
- where: { path: configPath }
1055
- })
1056
- };
1057
- return {
1058
- ok: true,
1059
- path: configPath,
1060
- explicit: true
1061
- };
1062
- }
1063
- /**
1064
- * The throwing form of that front, for the pipeline: the file the load will
1065
- * use, or the finding raised. `explicit` says the section named the file,
1066
- * which is what retires the same-file check for that case.
1067
- */
1068
- function resolveConfigFile(request) {
1069
- const source = configSource(request);
1070
- if (!source.ok) throw source.diagnostic;
1071
- return {
1072
- path: source.path,
1073
- explicit: source.explicit
1074
- };
1075
- }
1076
- /**
1077
- * Loads + validates the config at `configPath`, throwing its first diagnostic.
1078
- * The clipanion CLI's pipeline runs on this; it goes when clipanion does.
1079
- */
1080
- async function loadAppConfig(configPath, verifySamePath = true) {
1081
- const { value, diagnostics } = await evaluateConfig(configPath, verifySamePath);
1082
- const [first] = diagnostics;
1083
- if (first !== void 0) throw first;
1084
- return {
1085
- path: configPath,
1086
- config: validateConfigShape(value, configPath)
1087
- };
1088
- }
856
+ //#region ../../0-framework/3-tooling/cli/dist/pipeline-DAYhea3J.mjs
1089
857
  function lookup(extensions, extension, type, expectedKind, what) {
1090
858
  const ext = extensions.get(extension);
1091
859
  if (ext === void 0) throw new CliStructuredError("CONFIG.EXTENSION_MISSING", `No extension "${extension}" is configured (needed by ${what}).`, {
1092
- fix: `Add it to ${CONFIG_FILENAME}'s \`extensions\` (import its /control entry and list its descriptor).`,
860
+ fix: "Add it to `extensions` in the `composer` section of prisma.config.ts (import its /control entry and list its descriptor).",
1093
861
  meta: {
1094
862
  extension,
1095
863
  type
@@ -1124,7 +892,7 @@ function validateRegistryCoverage(graph, config) {
1124
892
  }
1125
893
  /**
1126
894
  * The shared prefix of `deploy`/`destroy`/`dev` (deploy-cli.md § The
1127
- * pipeline; local-dev spec § 6): config discovery/load, entry load, Load,
895
+ * pipeline; local-dev spec § 6): entry load, Load,
1128
896
  * registry coverage validation, name resolution, assemble. Deploy and dev
1129
897
  * diverge after this — deploy resolves containers/preflight/stack file
1130
898
  * against the hosted providers, dev against the local ones — so everything
@@ -1132,50 +900,58 @@ function validateRegistryCoverage(graph, config) {
1132
900
  * `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines
1133
901
  * cannot drift.
1134
902
  */
903
+ function configError(findings, file) {
904
+ const [first] = findings;
905
+ return new CliStructuredError(first.code, first.summary, {
906
+ ...first.why === void 0 ? {} : { why: first.why },
907
+ fix: first.fix,
908
+ where: { path: first.where ?? file },
909
+ meta: {
910
+ ...first.field === void 0 ? {} : { field: first.field },
911
+ findings
912
+ }
913
+ });
914
+ }
1135
915
  /**
1136
- * The config step both pipelines share: the effect-resolution check and the
1137
- * choice of config file (load-config.ts's shared front), then evaluation —
1138
- * unless the caller substituted a config, which replaces the evaluation and
1139
- * nothing before it.
916
+ * Refuses a caller's config with the same findings, in the same order, as the CLI's section validator.
917
+ * The error is the first finding and carries all of them in `meta.findings`. Returns the config with `file` resolved against `cwd`.
1140
918
  */
1141
- async function loadConfigStep(entryPath, cwd, deps) {
1142
- const { path: configPath, explicit } = resolveConfigFile({
1143
- entryPath,
1144
- configPath: deps.configPath,
1145
- cwd
1146
- });
919
+ function checkConfigSource(source, cwd) {
920
+ const file = path.resolve(cwd, source.file);
921
+ if (!fs.existsSync(file)) throw configError([configFileMissing(file)], file);
922
+ const checked = checkComposerConfig(source.value, file);
923
+ if (!checked.ok) throw configError(checked.findings, file);
1147
924
  return {
1148
- configPath,
1149
- config: deps.config ?? (await loadAppConfig(configPath, !explicit)).config
925
+ value: checked.value,
926
+ file
1150
927
  };
1151
928
  }
1152
929
  /**
1153
- * The pipeline's front — config discovery/load, entry load, name resolution —
930
+ * The pipeline's front — entry load and name resolution —
1154
931
  * WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its
1155
932
  * config and resolved name) to reach the already-running local instance; it
1156
933
  * neither builds nor provisions, so it must not require the user's built
1157
934
  * output the way the full pipeline does.
1158
935
  */
1159
- async function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {
1160
- const { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);
936
+ async function resolveAppIdentity(entry, overrideName, cwd, config) {
937
+ const { value } = checkConfigSource(config, cwd);
1161
938
  const entryModule = await loadEntry(entry, cwd);
1162
939
  const name = overrideName ?? entryModule.root.name;
1163
940
  if (name.length === 0) throw new CliStructuredError("COMPOSE.NAME_MISSING", "The root node has no name.", { fix: "Name it at authoring, or pass --name." });
1164
941
  return {
1165
- configPath,
1166
- config,
942
+ config: value,
1167
943
  name
1168
944
  };
1169
945
  }
1170
946
  /**
1171
- * Runs config discovery/load, entry load, Load, registry coverage, name
1172
- * resolution, and assemble — steps 1–6 of `run()`. `onAssembleError`, when
947
+ * Runs entry load, Load, registry coverage, name resolution, and assemble — steps 1–5 of `run()`. `onAssembleError`, when
1173
948
  * given, lets a caller decorate an assemble failure with command-specific
1174
949
  * guidance (destroy's "build first" hint) without this shared step knowing
1175
950
  * about any one command.
1176
951
  */
1177
- async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError) {
1178
- const { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);
952
+ async function runPipeline(entry, overrideName, cwd, source, deps = {}, onAssembleError) {
953
+ const configSource = checkConfigSource(source, cwd);
954
+ const config = configSource.value;
1179
955
  const entryModule = await loadEntry(entry, cwd);
1180
956
  const graph = Load(entryModule.root);
1181
957
  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); })." });
@@ -1190,8 +966,7 @@ async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError)
1190
966
  throw error;
1191
967
  }
1192
968
  return {
1193
- configPath,
1194
- config,
969
+ configSource,
1195
970
  entryModule,
1196
971
  graph,
1197
972
  name,
@@ -1201,4 +976,4 @@ async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError)
1201
976
  //#endregion
1202
977
  export { runPipeline as n, resolveAppIdentity as t };
1203
978
 
1204
- //# sourceMappingURL=pipeline-C7gNjMzJ-CMqZQxqM.mjs.map
979
+ //# sourceMappingURL=pipeline-DAYhea3J-BEnHHWp8.mjs.map