@prisma/composer 0.36.0-dev.6 → 0.36.0-dev.7

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 (116) hide show
  1. package/dist/{app-config-RX-7kHbF-BroG2yMY.d.mts → app-config-Bf_y5R7o-BEZAnKqM.d.mts} +31 -31
  2. package/dist/app-config-Bf_y5R7o-BEZAnKqM.d.mts.map +1 -0
  3. package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs +221 -0
  4. package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +1 -0
  5. package/dist/arktype.mjs +1 -2
  6. package/dist/arktype.mjs.map +1 -1
  7. package/dist/config-CDkq5Ayl.d.mts +1 -0
  8. package/dist/config-adapters-DG-uhGfv-Bt1M9f8b.mjs +47 -0
  9. package/dist/config-adapters-DG-uhGfv-Bt1M9f8b.mjs.map +1 -0
  10. package/dist/config.d.mts +7 -9
  11. package/dist/config.d.mts.map +1 -1
  12. package/dist/config.mjs +1 -1
  13. package/dist/control.d.mts +6 -183
  14. package/dist/control.d.mts.map +1 -1
  15. package/dist/control.mjs +4 -4
  16. package/dist/control.mjs.map +1 -1
  17. package/dist/deploy-CmiYExQA.mjs +373 -0
  18. package/dist/deploy-CmiYExQA.mjs.map +1 -0
  19. package/dist/deploy-DQyaIoNe.d.mts +2 -0
  20. package/dist/deploy.d.mts +4 -3
  21. package/dist/deploy.mjs +3 -365
  22. package/dist/{deployment-summary-QkZexVIS-DqL4znd4.mjs → deployment-summary-BiBkPWlB-CyC2pudN.mjs} +9 -46
  23. package/dist/deployment-summary-BiBkPWlB-CyC2pudN.mjs.map +1 -0
  24. package/dist/{deployment-summary-Cm4lN6w9-CGdGdlFC.d.mts → deployment-summary-p88NV5m5-BJOosgmI.d.mts} +4 -5
  25. package/dist/deployment-summary-p88NV5m5-BJOosgmI.d.mts.map +1 -0
  26. package/dist/{secret-DoWGmN7m-CI5Yrldp.mjs → describe-kind-Cpm_euxo-CkhlGJUL.mjs} +13 -2
  27. package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +1 -0
  28. package/dist/{dev-current-BurA9uhA-DixUKm8W.mjs → dev-current-D0Kn6Mf4-DDWYu-3j.mjs} +5 -5
  29. package/dist/{dev-current-BurA9uhA-DixUKm8W.mjs.map → dev-current-D0Kn6Mf4-DDWYu-3j.mjs.map} +1 -1
  30. package/dist/{dev-environment-name-6eEr5PW8-BbNUVxlS.mjs → dev-environment-name-6eEr5PW8-BwusWVKi.mjs} +3 -3
  31. package/dist/{dev-environment-name-6eEr5PW8-BbNUVxlS.mjs.map → dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map} +1 -1
  32. package/dist/{dist-DiYPSVUE.mjs → dist-BtzrklYG.mjs} +2 -2
  33. package/dist/{dist-DiYPSVUE.mjs.map → dist-BtzrklYG.mjs.map} +1 -1
  34. package/dist/{dist-DLOn1x6Z.mjs → dist-C7SnNTD3.mjs} +2 -2
  35. package/dist/{dist-DLOn1x6Z.mjs.map → dist-C7SnNTD3.mjs.map} +1 -1
  36. package/dist/{execute-deploy-destroy-Cww6zOSC-D8eKSdMX.mjs → execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs} +59 -35
  37. package/dist/execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs.map +1 -0
  38. package/dist/{execute-dev-4KYkqSMh-Ny8ATEfU.mjs → execute-dev-Bl-5Q-Av-DILne6iY.mjs} +79 -48
  39. package/dist/execute-dev-Bl-5Q-Av-DILne6iY.mjs.map +1 -0
  40. package/dist/{execute-dev-current-Cd4YEUZk-DBj9y27X.mjs → execute-dev-current-D3USgHJ4-CNQe5ADb.mjs} +6 -6
  41. package/dist/{execute-dev-current-Cd4YEUZk-DBj9y27X.mjs.map → execute-dev-current-D3USgHJ4-CNQe5ADb.mjs.map} +1 -1
  42. package/dist/{execute-log-BC5o35wQ-photDb2l.mjs → execute-log-Dm3DkQQP-BSjoy6Wd.mjs} +6 -6
  43. package/dist/{execute-log-BC5o35wQ-photDb2l.mjs.map → execute-log-Dm3DkQQP-BSjoy6Wd.mjs.map} +1 -1
  44. package/dist/{graph-nazLWyK2-BBciBJje.mjs → graph-Bqr7PSGl-BM-M-TlO.mjs} +169 -40
  45. package/dist/graph-Bqr7PSGl-BM-M-TlO.mjs.map +1 -0
  46. package/dist/{graph-B_szUZs6--jpigkBW.d.mts → graph-DI1v3WKX-3g1lTRbh.d.mts} +8 -4
  47. package/dist/graph-DI1v3WKX-3g1lTRbh.d.mts.map +1 -0
  48. package/dist/{graph-types-CViux_yr-CVV2nQ0l.d.mts → graph-types-DRe9UUOp-C85Yr-sJ.d.mts} +60 -14
  49. package/dist/graph-types-DRe9UUOp-C85Yr-sJ.d.mts.map +1 -0
  50. package/dist/http.d.mts +2 -2
  51. package/dist/http.mjs +2 -2
  52. package/dist/{index-BNYl6MsF.d.mts → index-DWQ6BSgm.d.mts} +3 -3
  53. package/dist/{index-BNYl6MsF.d.mts.map → index-DWQ6BSgm.d.mts.map} +1 -1
  54. package/dist/index.d.mts +4 -4
  55. package/dist/index.mjs +3 -3
  56. package/dist/internal-app-configuration-file.d.mts +19 -0
  57. package/dist/internal-app-configuration-file.d.mts.map +1 -0
  58. package/dist/internal-app-configuration-file.mjs +2 -0
  59. package/dist/{local-target-zSdLvLyy.mjs → local-target-Dd8FJEb5.mjs} +4 -3
  60. package/dist/{local-target-zSdLvLyy.mjs.map → local-target-Dd8FJEb5.mjs.map} +1 -1
  61. package/dist/local-target.d.mts +2 -2
  62. package/dist/local-target.d.mts.map +1 -1
  63. package/dist/local-target.mjs +1 -1
  64. package/dist/{nextjs-DLyeRR7M-C9O2M7Z4.d.mts → nextjs-DLyeRR7M-RtoHcY1c.d.mts} +3 -3
  65. package/dist/{nextjs-DLyeRR7M-C9O2M7Z4.d.mts.map → nextjs-DLyeRR7M-RtoHcY1c.d.mts.map} +1 -1
  66. package/dist/nextjs-control.d.mts +4 -4
  67. package/dist/nextjs-control.mjs +2 -2
  68. package/dist/nextjs.d.mts +1 -1
  69. package/dist/node-control.d.mts +3 -3
  70. package/dist/node-control.mjs +2 -2
  71. package/dist/node.d.mts +2 -2
  72. package/dist/redaction-Bf8FvTFH-BTsKD9B5.d.mts +183 -0
  73. package/dist/redaction-Bf8FvTFH-BTsKD9B5.d.mts.map +1 -0
  74. package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs +295 -0
  75. package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs.map +1 -0
  76. package/dist/report.d.mts +3 -3
  77. package/dist/report.mjs +1 -1
  78. package/dist/report.mjs.map +1 -1
  79. package/dist/{run-alchemy-B-Z6i3cD-C30mHT0u.mjs → run-alchemy-OS_ix5g0-DCvUYZ7T.mjs} +30 -13
  80. package/dist/run-alchemy-OS_ix5g0-DCvUYZ7T.mjs.map +1 -0
  81. package/dist/{run-report-CmBz2-xc-S50d4g5V.mjs → run-report-CmBz2-xc-Cc8rV1CX.mjs} +2 -2
  82. package/dist/{run-report-CmBz2-xc-S50d4g5V.mjs.map → run-report-CmBz2-xc-Cc8rV1CX.mjs.map} +1 -1
  83. package/dist/service-rpc.d.mts +2 -2
  84. package/dist/service-rpc.mjs +2 -2
  85. package/dist/testing.d.mts +1 -1
  86. package/dist/{validate-environment-BNZC6W46-CNGrBiHh.mjs → validate-environment-D_dECxgO-B-gqpVEf.mjs} +76 -13
  87. package/dist/validate-environment-D_dECxgO-B-gqpVEf.mjs.map +1 -0
  88. package/dist/zod.mjs +1 -2
  89. package/dist/zod.mjs.map +1 -1
  90. package/package.json +13 -13
  91. package/skills/prisma-composer-core-concepts/SKILL.md +4 -4
  92. package/src/exports/internal-app-configuration-file.ts +1 -0
  93. package/dist/app-config-RX-7kHbF-BroG2yMY.d.mts.map +0 -1
  94. package/dist/config-Dp3ZVNnN.d.mts +0 -1
  95. package/dist/config-adapters-BA_IeiX0-BiE51GeB.mjs +0 -84
  96. package/dist/config-adapters-BA_IeiX0-BiE51GeB.mjs.map +0 -1
  97. package/dist/config-pools-DiYw7wMu-DzeWrJdm.mjs +0 -63
  98. package/dist/config-pools-DiYw7wMu-DzeWrJdm.mjs.map +0 -1
  99. package/dist/deploy-Dp3ZVNnN.d.mts +0 -1
  100. package/dist/deploy.mjs.map +0 -1
  101. package/dist/deployment-summary-Cm4lN6w9-CGdGdlFC.d.mts.map +0 -1
  102. package/dist/deployment-summary-QkZexVIS-DqL4znd4.mjs.map +0 -1
  103. package/dist/describe-kind-Cpm_euxo-JFh8ejof.mjs +0 -14
  104. package/dist/describe-kind-Cpm_euxo-JFh8ejof.mjs.map +0 -1
  105. package/dist/execute-deploy-destroy-Cww6zOSC-D8eKSdMX.mjs.map +0 -1
  106. package/dist/execute-dev-4KYkqSMh-Ny8ATEfU.mjs.map +0 -1
  107. package/dist/graph-B_szUZs6--jpigkBW.d.mts.map +0 -1
  108. package/dist/graph-nazLWyK2-BBciBJje.mjs.map +0 -1
  109. package/dist/graph-types-CViux_yr-CVV2nQ0l.d.mts.map +0 -1
  110. package/dist/internal-pools.d.mts +0 -18
  111. package/dist/internal-pools.d.mts.map +0 -1
  112. package/dist/internal-pools.mjs +0 -2
  113. package/dist/run-alchemy-B-Z6i3cD-C30mHT0u.mjs.map +0 -1
  114. package/dist/secret-DoWGmN7m-CI5Yrldp.mjs.map +0 -1
  115. package/dist/validate-environment-BNZC6W46-CNGrBiHh.mjs.map +0 -1
  116. package/src/exports/internal-pools.ts +0 -1
@@ -1,84 +1,9 @@
1
- import { Dt as CliStructuredError } from "./graph-types-CViux_yr-CVV2nQ0l.mjs";
2
- import { H as PrismaAppConfig } from "./app-config-RX-7kHbF-BroG2yMY.mjs";
3
- import "./config-Dp3ZVNnN.mjs";
4
- import "./index-BNYl6MsF.mjs";
5
- import "./deploy-Dp3ZVNnN.mjs";
6
- import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-Cm4lN6w9-CGdGdlFC.mjs";
7
- //#region ../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts
8
- //#region src/composer-config.d.ts
9
- /** Composer's configuration and the `prisma.config.ts` that declares it. */
10
- interface ComposerConfigSource {
11
- /** The `composer` section: the `composer` property of that file's default export. */
12
- readonly value: PrismaAppConfig;
13
- /** The declaring `prisma.config.ts`. The deploy's generated stack file imports it. A relative path resolves against the operation's `cwd`. */
14
- readonly file: string;
15
- }
16
- //#endregion
17
- //#region ../../0-framework/0-foundation/foundation/dist/result.d.mts
18
- //#region src/result.d.ts
19
- /**
20
- * Represents a successful result containing a value.
21
- */
22
- interface Ok<T> {
23
- readonly ok: true;
24
- readonly value: T;
25
- assertOk(): T;
26
- assertNotOk(): never;
27
- }
28
- /**
29
- * Represents an unsuccessful result containing failure details.
30
- */
31
- interface NotOk<F> {
32
- readonly ok: false;
33
- readonly failure: F;
34
- assertOk(): never;
35
- assertNotOk(): F;
36
- }
37
- /**
38
- * A discriminated union representing either success (Ok) or failure (NotOk).
39
- *
40
- * @typeParam T - The success value type
41
- * @typeParam F - The failure details type
42
- */
43
- type Result<T, F> = Ok<T> | NotOk<F>;
44
- //#endregion
45
- //#region ../../0-framework/3-tooling/cli/dist/dev-current-3VmwctUt.d.mts
46
- //#endregion
47
- //#region src/operations/shared.d.ts
48
- /** A running service's dotted address plus its local URL — what `dev` reports
49
- * as the front door and `log` reports as the tailable services. */
50
- interface ServiceEndpoint {
51
- readonly address: string;
52
- readonly url: string;
53
- /** The dev server the service runs in place of its artifact, as its build adapter displays it (`next dev`) — absent for a service that runs its artifact (ADR-0056). */
54
- readonly devServer?: string;
55
- }
56
- /**
57
- * Where a failed execution left its artifacts — details of the CURRENT
58
- * execution mechanism (a spawned deploy-engine child driving a generated
59
- * stack file), for hosts that want to print a reproduce hint. The mechanism
60
- * is not part of the surface's contract, so these fields may change or
61
- * disappear if the mechanism does; branch on `code`/`message`/`cause` for
62
- * anything durable.
63
- */
64
- interface ExecutionDiagnostics {
65
- /** The child's exit status; undefined means the spawn itself threw, or the
66
- * child was killed by a signal (`signal` then names it). */
67
- readonly exitCode: number | undefined;
68
- /** The signal that killed the child, when one did. A signal-killed converge
69
- * is an abort the user asked for, not a failure of the deploy — a host
70
- * should report it as an interruption and print no reproduce hint. */
71
- readonly signal?: string | undefined;
72
- readonly stackFilePath: string;
73
- readonly reproduceCommand: string;
74
- readonly cwd: string;
75
- }
76
- /**
77
- * Reads the execution diagnostics an engine-failure error carries in
78
- * `meta.diagnostics`; undefined for every other failure.
79
- */
80
- declare function executionDiagnostics(f: CliStructuredError): ExecutionDiagnostics | undefined;
81
- //#endregion
1
+ import { At as CliStructuredError } from "./graph-types-DRe9UUOp-C85Yr-sJ.mjs";
2
+ import "./config-CDkq5Ayl.mjs";
3
+ import { n as DeploymentSummary, t as DeployedNodeSummary } from "./deployment-summary-p88NV5m5-BJOosgmI.mjs";
4
+ import "./index-DWQ6BSgm.mjs";
5
+ import { a as ExecutionDiagnostics, c as executionDiagnostics, d as Result, i as DevSession, l as NotOk, n as DevEvent, o as ServiceEndpoint, r as DevInput, s as dev, t as ComposerConfigSource, u as Ok } from "./redaction-Bf8FvTFH-BTsKD9B5.mjs";
6
+ //#region ../../0-framework/3-tooling/cli/dist/dev-current-BPnQtqnQ.d.mts
82
7
  //#region src/operations/deploy.d.ts
83
8
  /** A deploy step. `assemble-service` steps run inside `assemble`, one per service. */
84
9
  type DeployStep = {
@@ -137,108 +62,6 @@ interface DeploySuccess {
137
62
  }
138
63
  declare function deploy(input: DeployInput): Promise<Result<DeploySuccess, CliStructuredError>>;
139
64
  //#endregion
140
- //#region src/operations/dev.d.ts
141
- type DevEvent =
142
- /** Initial front door + after each successful re-converge. */
143
- {
144
- readonly kind: 'ready';
145
- readonly endpoints: readonly ServiceEndpoint[];
146
- } | {
147
- readonly kind: 'unwatchable';
148
- readonly address: string;
149
- } |
150
- /** A target's preflight warned about the graph; the session still starts. */
151
- {
152
- readonly kind: 'target-warning';
153
- readonly message: string;
154
- } | {
155
- readonly kind: 'rebuild-failed';
156
- readonly message: string;
157
- } |
158
- /** The file watcher itself errored (EMFILE, a vanished directory); the session keeps running. */
159
- {
160
- readonly kind: 'watch-error';
161
- readonly message: string;
162
- } |
163
- /** `prisma.config.ts` changed. The session keeps the config it started with and stops rebuilding until it is restarted. */
164
- {
165
- readonly kind: 'config-changed';
166
- readonly file: string;
167
- } |
168
- /** What the `config` or `secrets` adapters return changed since the session started. The session keeps the values it started with and stops rebuilding until it is restarted. */
169
- {
170
- readonly kind: 'values-changed';
171
- } |
172
- /** The app keeps running, still watching. */
173
- {
174
- readonly kind: 'converge-failed';
175
- readonly stackFilePath: string;
176
- readonly reproduceCommand: string;
177
- readonly cwd: string;
178
- } |
179
- /** Once per service that runs its build adapter's dev server, before the first converge (ADR-0056). `cwd` is absolute. */
180
- {
181
- readonly kind: 'dev-server';
182
- readonly address: string;
183
- readonly command: string;
184
- readonly cwd: string;
185
- } |
186
- /** A reconverge changed a dev server's environment, so the emulator restarted it. */
187
- {
188
- readonly kind: 'dev-server-restarted';
189
- readonly address: string;
190
- readonly command: string;
191
- } |
192
- /** One line a dev server wrote, while the session runs. */
193
- {
194
- readonly kind: 'dev-server-output';
195
- readonly address: string;
196
- readonly line: string;
197
- } | {
198
- readonly kind: 'stopping';
199
- } |
200
- /** One service refused to stop during stop(); teardown continues and `stopped` still follows. */
201
- {
202
- readonly kind: 'stop-error';
203
- readonly message: string;
204
- } | {
205
- readonly kind: 'stopped';
206
- };
207
- interface DevInput {
208
- /**
209
- * Composer's configuration: the `composer` section of `prisma.config.ts` and that file. The operation does not look for a config file; it refuses a section the CLI would refuse, before any work starts.
210
- */
211
- readonly config: ComposerConfigSource;
212
- /** The entry module, resolved against `cwd`. Overrides the `entry` in `config`; without either the operation fails with `CONFIG.ENTRY_MISSING`. */
213
- readonly entry?: string | undefined;
214
- readonly name?: string | undefined;
215
- /** The environment to run as: a complete local copy of the app with its own services, databases and buckets. Defaults to `dev`. */
216
- readonly environment?: string | undefined;
217
- /** Deletes the environment's local copy of the app, and its data, before starting. Other environments are untouched. */
218
- readonly fresh?: boolean | undefined;
219
- /**
220
- * Return once every service answers and leave the app running, with no
221
- * watch loop: the session is already closed and stopping it stops nothing.
222
- * `devStop` stops the app later.
223
- */
224
- readonly detach?: boolean | undefined;
225
- readonly cwd?: string | undefined;
226
- readonly onEvent?: ((event: DevEvent) => void) | undefined;
227
- }
228
- /** A running dev session. The operation NEVER touches process signal handlers —
229
- * the host owns signals (and must evict alchemy's import-time SIGINT/SIGTERM
230
- * listeners before installing its own; see run-dev.ts). */
231
- interface DevSession {
232
- /** The initial front door, already merged across attachments. */
233
- readonly endpoints: readonly ServiceEndpoint[];
234
- /** Stop the watch loop and the app's services (emulators and data stay up).
235
- * Idempotent; emits 'stopping'/'stopped'; resolves `closed`. A no-op for a detached session. */
236
- stop(): Promise<void>;
237
- /** Settles when the session has fully stopped (via stop()); already settled for a detached session. */
238
- readonly closed: Promise<void>;
239
- }
240
- declare function dev(input: DevInput): Promise<Result<DevSession, CliStructuredError>>;
241
- //#endregion
242
65
  //#region src/operations/dev-current.d.ts
243
66
  interface DevUrlInput {
244
67
  /** Composer's configuration: the `composer` section of `prisma.config.ts` and that file. It names the extensions whose local targets recorded the app. */
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/composer-config-BJrPWlDx.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/dev-current-3VmwctUt.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;;UAGU;;WAEC,OAAO;;WAEP;;;;;;;;UCHD,GAAG;WACF;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAKQ,MAAM;WACL;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KAQZ,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;;;;UCwDxB;WACC;WACA;;WAEA;;;;;;;;;;UA0CD;;;WAGC;;;;WAIA;WACA;WACA;WACA;;;;;;iBAMM,qBAAqB,GAAG,qBAAqB;;;;KAIzD;WACM;;WAEA;WACA;;KAEN;WACM;WACA,MAAM;;WAEN;WACA,MAAM;WACN;WACA;;WAEA,OAAO,SAAS;;UAIjB;;;;WAIC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;WAEA,YAAY,OAAO;;UAEpB;;;WAGC,SAAS;;WAET;;iBAEM,OAAO,OAAO,cAAc,QAAQ,OAAO,eAAe;;;KAOtE;;;WAGM;WACA,oBAAoB;;WAEpB;WACA;;;;WAIA;WACA;;WAEA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;;;;WAIA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;;;;WAIA;WACA;WACA;;WAEA;;;;WAIA;WACA;;WAEA;;UAED;;;;WAIC,QAAQ;;WAER;WACA;;WAEA;;WAEA;;;;;;WAMA;WACA;WACA,YAAY,OAAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;iBAEF,IAAI,OAAO,WAAW,QAAQ,OAAO,YAAY;;;UAOxD;;WAEC,QAAQ;;WAER;;WAEA;;WAEA;;UAED;WACC;;WAEA;;WAEA;;WAEA;;WAEA;;UAED;WACC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAED;;WAEC;;WAEA;;WAEA;aACE;aACA;;;;iBAII,OAAO,OAAO,cAAc,QAAQ,OAAO,QAAQ;;iBAEnD,QAAQ,OAAO,eAAe,QAAQ,OAAO,YAAY;;;;KCnWrE;;;WAGM;WACA;;UAED;;;;WAIC,QAAQ;;WAER;WACA;;WAEA;WACA;;WAEA,YAAY,OAAO;;iBAEb,QAAQ,OAAO,eAAe,QAAQ,aAAe;;;UAG5D;WACC;WACA;;KAEN;;;WAGM;WACA;;;;;WAKA;WACA;;UAED;;;;;WAKC,QAAQ;;WAER;WACA;;WAEA;;WAEA;;WAEA;WACA;;WAEA,SAAS;WACT,YAAY,OAAO;;UAEpB;;WAEC;;;WAGA,mBAAmB;;WAEnB,OAAO,cAAc;;iBAEf,IAAI,OAAO,WAAW,QAAQ,OAAS,aAAa;;;;cAIvD;;cAEA;UACJ;;WAEC;WACA;;;;;;;UAOD;WACC;WACA;;WAEA;WACA;WACA,gBAAgB;WAChB,SAAS"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-current-BPnQtqnQ.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;KAMK;WACM;;WAEA;WACA;;KAEN;WACM;WACA,MAAM;;WAEN;WACA,MAAM;WACN;WACA;;WAEA,OAAO,SAAS;;UAIjB;;;;WAIC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;WAEA,YAAY,OAAO;;UAEpB;;;WAGC,SAAS;;WAET;;iBAEM,OAAO,OAAO,cAAc,QAAQ,OAAO,eAAe;;;UAOjE;;WAEC,QAAQ;;WAER;;WAEA;;WAEA;;UAED;WACC;;WAEA;;WAEA;;WAEA;;WAEA;;UAED;WACC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAED;;WAEC;;WAEA;;WAEA;aACE;aACA;;;;iBAII,OAAO,OAAO,cAAc,QAAQ,OAAO,QAAQ;;iBAEnD,QAAQ,OAAO,eAAe,QAAQ,OAAO,YAAY;;;;KC5GrE;;;WAGM;WACA;;UAED;;;;WAIC,QAAQ;;WAER;WACA;;WAEA;WACA;;WAEA,YAAY,OAAO;;iBAEb,QAAQ,OAAO,eAAe,QAAQ,aAAe;;;UAG5D;WACC;WACA;;KAEN;;;WAGM;WACA;;;;;WAKA;WACA;;UAED;;;;;WAKC,QAAQ;;WAER;WACA;;WAEA;;WAEA;;WAEA;WACA;;WAEA,SAAS;WACT,YAAY,OAAO;;UAEpB;;WAEC;;;WAGA,mBAAmB;;WAEnB,OAAO,cAAc;;iBAEf,IAAI,OAAO,WAAW,QAAQ,OAAS,aAAa;;;;cAIvD;;cAEA;UACJ;;WAEC;WACA;;;;;;;UAOD;WACC;WACA;;WAEA;WACA;WACA,gBAAgB;WAChB,SAAS"}
package/dist/control.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
- import { a as executionDiagnostics, i as devUrl, l as notOk, n as dev, o as executorLoadFailure, r as devStop, t as deploy } from "./dev-current-BurA9uhA-DixUKm8W.mjs";
3
- import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-CmBz2-xc-S50d4g5V.mjs";
2
+ import { a as executionDiagnostics, i as devUrl, l as notOk, n as dev, o as executorLoadFailure, r as devStop, t as deploy } from "./dev-current-D0Kn6Mf4-DDWYu-3j.mjs";
3
+ import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-CmBz2-xc-Cc8rV1CX.mjs";
4
4
  //#region ../../0-framework/3-tooling/cli/dist/control.mjs
5
5
  /**
6
6
  * The programmatic `destroy` operation (`@prisma/composer/control`): typed
@@ -21,7 +21,7 @@ async function destroyWithDeps(input, deps) {
21
21
  const cwd = input.cwd ?? process.cwd();
22
22
  let executor;
23
23
  try {
24
- executor = await import("./execute-deploy-destroy-Cww6zOSC-D8eKSdMX.mjs");
24
+ executor = await import("./execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs");
25
25
  } catch (error) {
26
26
  return notOk(executorLoadFailure("destroy", error));
27
27
  }
@@ -43,7 +43,7 @@ async function logWithDeps(input, deps) {
43
43
  const cwd = input.cwd ?? process.cwd();
44
44
  let executor;
45
45
  try {
46
- executor = await import("./execute-log-BC5o35wQ-photDb2l.mjs");
46
+ executor = await import("./execute-log-Dm3DkQQP-BSjoy6Wd.mjs");
47
47
  } catch (error) {
48
48
  return notOk(executorLoadFailure("log", error));
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import { c as executionDiagnostics, l as executorLoadFailure, n as devUrl, o as deploy, r as dev, t as devStop } from \"./dev-current-BurA9uhA.mjs\";\nimport { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from \"./run-report-CmBz2-xc.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/destroy.ts\n/**\n* The programmatic `destroy` operation (`@prisma/composer/control`): typed\n* input, structured result, no argv, no console, no process.exit. No CLI\n* command wraps it. The executor\n* loads lazily, so importing this module executes nothing; an executor that\n* fails to load comes back as a structured failure, never a throw out of\n* the host.\n*/\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tif (typeof input.environment !== \"string\" || input.environment.length === 0) return notOk(environmentRequired());\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-Cww6zOSC.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\nfunction environmentRequired() {\n\treturn new CliStructuredError(\"DEPLOY.ENVIRONMENT_REQUIRED\", \"destroy needs the name of the environment to destroy.\", {\n\t\twhy: \"Destroy never defaults to production, so a call without a name has no target.\",\n\t\tfix: \"Pass `environment`, for example `destroy({ environment: 'staging', config })`.\"\n\t});\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-BC5o35wQ.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl, executionDiagnostics, log };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,WAAW,GAAG,OAAO,MAAM,oBAAoB,CAAC;CAC/G,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;AACA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,+BAA+B,yDAAyD;EACrH,KAAK;EACL,KAAK;CACN,CAAC;AACF;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C"}
1
+ {"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/control.mjs"],"sourcesContent":["import { c as executionDiagnostics, l as executorLoadFailure, n as devUrl, o as deploy, r as dev, t as devStop } from \"./dev-current-D0Kn6Mf4.mjs\";\nimport { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from \"./run-report-CmBz2-xc.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/destroy.ts\n/**\n* The programmatic `destroy` operation (`@prisma/composer/control`): typed\n* input, structured result, no argv, no console, no process.exit. No CLI\n* command wraps it. The executor\n* loads lazily, so importing this module executes nothing; an executor that\n* fails to load comes back as a structured failure, never a throw out of\n* the host.\n*/\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tif (typeof input.environment !== \"string\" || input.environment.length === 0) return notOk(environmentRequired());\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-Dh1CQ9X6.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\nfunction environmentRequired() {\n\treturn new CliStructuredError(\"DEPLOY.ENVIRONMENT_REQUIRED\", \"destroy needs the name of the environment to destroy.\", {\n\t\twhy: \"Destroy never defaults to production, so a call without a name has no target.\",\n\t\tfix: \"Pass `environment`, for example `destroy({ environment: 'staging', config })`.\"\n\t});\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, for the unit tests.\n* Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-Dm3DkQQP.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, devStop, devUrl, executionDiagnostics, log };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,WAAW,GAAG,OAAO,MAAM,oBAAoB,CAAC;CAC/G,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;AACA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,+BAA+B,yDAAyD;EACrH,KAAK;EACL,KAAK;CACN,CAAC;AACF;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C"}
@@ -0,0 +1,373 @@
1
+ import { S as slotsOf, l as isParamSource, m as nodeAddresses, t as Load } from "./graph-Bqr7PSGl-BM-M-TlO.mjs";
2
+ import { r as deserializeContainers } from "./container-transport-HcvNOGZL-twPi2TIv.mjs";
3
+ import * as Alchemy from "alchemy";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Layer from "effect/Layer";
6
+ //#region ../../0-framework/1-core/core/dist/deploy.mjs
7
+ var LowerError = class extends Error {
8
+ constructor(message) {
9
+ super(message);
10
+ this.name = "LowerError";
11
+ }
12
+ };
13
+ function assertSameNodeAddresses(built, firstProcess) {
14
+ const onlyBuilt = built.filter((address) => !firstProcess.includes(address));
15
+ const onlyFirst = firstProcess.filter((address) => !built.includes(address));
16
+ if (onlyBuilt.length === 0 && onlyFirst.length === 0) return;
17
+ const list = (addresses) => addresses.length === 0 ? "none" : addresses.map((address) => `"${address}"`).join(", ");
18
+ throw new LowerError(`The deploy's second process built a different graph from the one Composer checked in its first process. Only in the second process: ${list(onlyBuilt)}. Only in the first process: ${list(onlyFirst)}. A module body must build the same graph every time; one that reads the process environment, a file or the clock can build a different one.`);
19
+ }
20
+ /**
21
+ * Resolves one SERVICE-OWN param to its config value. The full resolution
22
+ * order across both value channels:
23
+ *
24
+ * 1. A param claiming BOTH a provision-time binding and a `provision` need
25
+ * (ADR-0031) is a loud error — two sources for one value.
26
+ * 2. A provision-time binding (a schema-validated literal, or an opaque
27
+ * `ParamSource` the target resolves at boot per ADR-0019) beats the
28
+ * declared `default`.
29
+ * 3. A framework-minted `provision` need is resolved per dependency EDGE
30
+ * against the consumer extension's registry — that path fills CONNECTION
31
+ * params in `buildConfig`'s inputs loop, never this function. A
32
+ * service-own param has no edge to mint against, so an unbound need here
33
+ * falls through like any unbound param.
34
+ * 4. The `default`, else absent (only legal when `optional`), else a loud
35
+ * error naming the param, the service, and the fix.
36
+ */
37
+ function resolveParam(node, serviceId, name, param, bound) {
38
+ if (bound !== void 0) {
39
+ if (param.provision !== void 0) throw new LowerError(`Param "${name}" of "${serviceId}" (service "${node.name}") has two sources claiming one value: a provision-time binding (${isParamSource(bound) ? "a param source" : "a literal value"}) AND a framework provision need ("${String(param.provision.brand)}") on its declaration — remove the binding or drop the \`provision\` facet.`);
40
+ if (isParamSource(bound)) return bound;
41
+ const result = param.schema["~standard"].validate(bound);
42
+ if (result instanceof Promise) throw new LowerError(`Param "${name}" of "${serviceId}" (service "${node.name}") uses an async Standard Schema — a provision-time literal value requires a synchronous validator.`);
43
+ if (result.issues !== void 0) {
44
+ const messages = result.issues.map((issue) => issue.message).join("; ");
45
+ throw new LowerError(`Param "${name}" of "${serviceId}" (service "${node.name}") received an invalid provision-time value: ${messages}`);
46
+ }
47
+ return result.value;
48
+ }
49
+ if (param.default !== void 0) return param.default;
50
+ if (param.optional === true) return void 0;
51
+ throw new LowerError(`Param "${name}" of "${serviceId}" (service "${node.name}") has no default, is not optional, and was not bound at provision — bind it with a literal value or a param source (e.g. envParam('NAME')) on its provision() call, or give it a default.`);
52
+ }
53
+ /**
54
+ * Assembles a service's typed Config. Connection params come from the
55
+ * dependency edge's lowered outputs — or, for a param carrying a `provision`
56
+ * need (ADR-0031), from `provisioned` (keyed by edge id): the framework mints
57
+ * it, the producer hands nothing over. The service's own params resolve via
58
+ * `resolveParam` (provision-time binding, then default, then loud
59
+ * unbound-required failure).
60
+ *
61
+ * This is also where the connection contract is enforced: a producer that fails to
62
+ * supply a required param its consumer's connection declares fails the deploy
63
+ * here, naming the edge, rather than reaching the consumer as `undefined`.
64
+ */
65
+ function buildConfig(node, id, graph, lowered, provisioned) {
66
+ const inputs = slotConnectionParams(node, id, graph, lowered, provisioned);
67
+ const boundParams = new Map(graph.params.filter((binding) => binding.serviceAddress === id).map((b) => [b.slot, b.binding]));
68
+ const service = {};
69
+ for (const [name, param] of Object.entries(node.params)) {
70
+ const value = resolveParam(node, id, name, param, boundParams.get(name));
71
+ if (value !== void 0) service[name] = value;
72
+ }
73
+ return {
74
+ service,
75
+ inputs
76
+ };
77
+ }
78
+ /**
79
+ * The connection params of each of a service's or resource's dependency
80
+ * slots, resolved against the producer's lowered outputs or the minted
81
+ * `provisioned` value, with the connection contract enforced (see `buildConfig`).
82
+ */
83
+ function connectionInputs(ctx) {
84
+ return slotConnectionParams(ctx.node, ctx.id, ctx.graph, ctx.lowered, ctx.provisioned);
85
+ }
86
+ function slotConnectionParams(node, id, graph, lowered, provisioned) {
87
+ const inputs = {};
88
+ for (const [inputName, inputNode] of Object.entries(node.inputs)) {
89
+ const edge = graph.edges.find((e) => e.to === id && e.input === inputName && e.kind === "dependency");
90
+ const producedOutputs = edge !== void 0 ? lowered.get(edge.from) ?? {} : {};
91
+ const values = {};
92
+ for (const [name, param] of Object.entries(inputNode.connection.params)) {
93
+ if (param.provision !== void 0) {
94
+ values[name] = provisioned.get(`${id}.${inputName}`);
95
+ continue;
96
+ }
97
+ const value = producedOutputs[name];
98
+ if (value === void 0 && param.optional !== true && edge !== void 0) throw new LowerError(`Connection input "${id}.${inputName}" declares param "${name}", but its producer "${edge.from}" did not supply it — the producer's outputs carry [${Object.keys(producedOutputs).join(", ") || "nothing"}]. Add "${name}" to the outputs the producer returns from its lowering, or declare the param optional on the connection.`);
99
+ values[name] = value;
100
+ }
101
+ inputs[inputName] = values;
102
+ }
103
+ return inputs;
104
+ }
105
+ /**
106
+ * Joins resolved report entries back to their graph nodes — the last step of a
107
+ * deploy report, run inside the Action with apply's resolved values.
108
+ *
109
+ * The entries cross Alchemy's action-input boundary, so they carry addresses
110
+ * and plain entities only; the graph is held by closure on this side. That
111
+ * split is why this join exists at all, and it is what keeps functions and
112
+ * Standard Schemas (which a node carries, and which the plan's input hash
113
+ * would have to serialize) out of the input.
114
+ *
115
+ * Skips an address the graph no longer holds: entries are data, the graph is
116
+ * truth.
117
+ */
118
+ function joinDeployment(graph, entries) {
119
+ const nodes = [];
120
+ for (const entry of entries) {
121
+ const node = graph.nodes.find((n) => n.id === entry.address)?.node;
122
+ if (node === void 0 || node.kind !== "service" && node.kind !== "resource") continue;
123
+ nodes.push({
124
+ address: entry.address,
125
+ node,
126
+ entities: entry.entities
127
+ });
128
+ }
129
+ return nodes;
130
+ }
131
+ function missingBundleError(id) {
132
+ return new LowerError(`No bundle provided for service "${id}" (opts.bundles["${id}"] is required).`);
133
+ }
134
+ /** The message `prisma dev` structures as `DEV.DEV_SERVER_UNSUPPORTED` (ADR-0056). */
135
+ function noReserveError(id, extension, type) {
136
+ return new LowerError(`service "${id}" runs a dev server but its descriptor (${extension}/${type}) has no \`reserve\` step`);
137
+ }
138
+ function unassembledWithBundleError(address) {
139
+ return new LowerError(`"${address}" is listed in opts.unassembled and also has a bundle in opts.bundles — a service is either assembled or not.`);
140
+ }
141
+ function unassembledNotServiceError(address) {
142
+ return new LowerError(`"${address}" is listed in opts.unassembled but is not a service in the graph.`);
143
+ }
144
+ function duplicateExtensionError(id) {
145
+ return new LowerError(`Extension "${id}" is listed more than once in \`extensions\` — each extension id must be unique.`);
146
+ }
147
+ /** Registries as extension id → descriptor. Fails on a duplicate id — the CLI validates config, but lowering() is the programmatic escape hatch that doesn't. */
148
+ function extensionsById(config) {
149
+ const map = /* @__PURE__ */ new Map();
150
+ for (const extension of config.extensions) {
151
+ if (map.has(extension.id)) return Effect.fail(duplicateExtensionError(extension.id));
152
+ map.set(extension.id, extension);
153
+ }
154
+ return Effect.succeed(map);
155
+ }
156
+ function unknownExtensionError(extension, id) {
157
+ return new LowerError(`No extension "${extension}" is configured (needed by node "${id}") — add it to \`extensions\` in the \`composer\` section of prisma.config.ts (import its /control entry and list its descriptor).`);
158
+ }
159
+ function unknownNodeTypeError(extension, type) {
160
+ return new LowerError(`Extension "${extension.id}" has no descriptor for node type "${type}" (known: ${Object.keys(extension.nodes).join(", ")}).`);
161
+ }
162
+ /** A provisioned param's need brand isn't registered by the consumer's extension (ADR-0031). */
163
+ function unknownProvisionerError(extension, brand, edgeId) {
164
+ const known = extension.provisions !== void 0 && extension.provisions.size > 0 ? Array.from(extension.provisions.keys(), String).join(", ") : "(none registered)";
165
+ return new LowerError(`Extension "${extension.id}" has no provisioner for need "${String(brand)}" (needed by edge "${edgeId}") (known: ${known}).`);
166
+ }
167
+ /** A provisioned edge whose consumer and provider nodes belong to different extensions (ADR-0031). */
168
+ function crossExtensionProvisionError(edgeId) {
169
+ return new LowerError(`Provisioned edge "${edgeId}" spans two extensions — cross-extension provisioned edges aren't supported yet.`);
170
+ }
171
+ /**
172
+ * More than one provisioned param on one connection (ADR-0031). One edge mints
173
+ * ONE value, keyed by edge id, so a second need on the same connection would
174
+ * silently receive the first's value under the first's brand.
175
+ */
176
+ function multipleProvisionedParamsError(edgeId, names) {
177
+ return new LowerError(`Connection input "${edgeId}" declares more than one provisioned param (${names.join(", ")}) — only one provisioned param per connection is supported.`);
178
+ }
179
+ function wrongKindError(extension, type, expected, got) {
180
+ return new LowerError(`Extension "${extension}"'s descriptor for node type "${type}" is a "${got}" descriptor — this node needs a "${expected}" descriptor.`);
181
+ }
182
+ /** Looks up one node's descriptor: extension by `node.extension`, then descriptor by `node.type`, then the kind check. */
183
+ function descriptorFor(extensions, node, id) {
184
+ const extension = extensions.get(node.extension);
185
+ if (extension === void 0) return Effect.fail(unknownExtensionError(node.extension, id));
186
+ const descriptor = extension.nodes[node.type];
187
+ if (descriptor === void 0) return Effect.fail(unknownNodeTypeError(extension, node.type));
188
+ if (descriptor.kind !== node.kind) return Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));
189
+ return Effect.succeed(descriptor);
190
+ }
191
+ /**
192
+ * The state-layer precedence a deploy resolves to: an explicit opts.state
193
+ * always wins; failing that, the config's own (required) state descriptor,
194
+ * created with its owning extension's resolved container (`undefined` when
195
+ * that extension declared none). A pure function so the precedence is
196
+ * testable without booting Alchemy.
197
+ */
198
+ function resolveStateLayer(opts, config, containers) {
199
+ return opts.state ?? config.state.create(containers.get(config.state.extension));
200
+ }
201
+ /**
202
+ * All configured extensions' providers merged, config array order — an
203
+ * extension without `providers` is skipped; no used-extensions-only
204
+ * filtering (ADR-0017's pinned providers rule).
205
+ */
206
+ function mergedProviders(config) {
207
+ const [first, ...rest] = config.extensions.flatMap((extension) => extension.providers !== void 0 ? [extension.providers()] : []);
208
+ return first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);
209
+ }
210
+ /**
211
+ * Composable form for mixed stacks: hand-wired Alchemy resources alongside Prisma App nodes in one stack effect.
212
+ * Fails with LowerError or whatever an extension's lowering raises — the error type is open.
213
+ */
214
+ function lowering(root, config, opts) {
215
+ return Effect.gen(function* () {
216
+ const graph = Load(root, {
217
+ id: opts.name,
218
+ ...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {},
219
+ ...opts.appConfigurationRead !== void 0 ? { appConfigurationRead: opts.appConfigurationRead } : {}
220
+ });
221
+ if (opts.firstProcessNodeAddresses !== void 0) assertSameNodeAddresses(nodeAddresses(graph), opts.firstProcessNodeAddresses);
222
+ const extensions = yield* extensionsById(config);
223
+ const containers = deserializeContainers(config.extensions, process.env);
224
+ const lowered = /* @__PURE__ */ new Map();
225
+ const entries = [];
226
+ const provisioned = /* @__PURE__ */ new Map();
227
+ const applications = /* @__PURE__ */ new Map();
228
+ for (const descriptor of config.extensions) {
229
+ if (descriptor.application === void 0) continue;
230
+ const appCtx = {
231
+ id: graph.root.id,
232
+ address: "",
233
+ node: graph.root.node,
234
+ graph,
235
+ opts,
236
+ application: void 0,
237
+ container: containers.get(descriptor.id),
238
+ lowered,
239
+ provisioned
240
+ };
241
+ applications.set(descriptor.id, yield* descriptor.application.provision(appCtx));
242
+ }
243
+ for (const edge of graph.edges) {
244
+ if (edge.kind !== "dependency") continue;
245
+ const consumer = graph.nodes.find((n) => n.id === edge.to)?.node;
246
+ if (consumer === void 0 || consumer.kind !== "service" && consumer.kind !== "resource") continue;
247
+ const slot = slotsOf(consumer)[edge.input];
248
+ if (slot === void 0) continue;
249
+ const provisionedParams = Object.entries(slot.connection.params).filter(([, param]) => param.provision !== void 0);
250
+ if (provisionedParams.length === 0) continue;
251
+ const edgeId = `${edge.to}.${edge.input}`;
252
+ if (provisionedParams.length > 1) return yield* Effect.fail(multipleProvisionedParamsError(edgeId, provisionedParams.map(([name]) => name)));
253
+ const need = provisionedParams[0]?.[1].provision;
254
+ if (need === void 0) continue;
255
+ const provider = graph.nodes.find((n) => n.id === edge.from)?.node;
256
+ if (provider === void 0 || provider.kind !== "service" && provider.kind !== "resource") continue;
257
+ if (consumer.extension !== provider.extension) return yield* Effect.fail(crossExtensionProvisionError(edgeId));
258
+ const extension = extensions.get(consumer.extension);
259
+ if (extension === void 0) return yield* Effect.fail(unknownExtensionError(consumer.extension, edge.to));
260
+ const provisioner = extension.provisions?.get(need.brand);
261
+ if (provisioner === void 0) return yield* Effect.fail(unknownProvisionerError(extension, need.brand, edgeId));
262
+ const ref = yield* provisioner.provision({
263
+ app: graph.root.id,
264
+ edgeId,
265
+ consumerAddress: edge.to,
266
+ providerAddress: edge.from,
267
+ input: edge.input,
268
+ need
269
+ });
270
+ provisioned.set(edgeId, ref);
271
+ }
272
+ const unassembled = new Set(opts.unassembled ?? []);
273
+ for (const address of unassembled) {
274
+ if (address in opts.bundles) return yield* Effect.fail(unassembledWithBundleError(address));
275
+ const found = graph.nodes.find((n) => n.id === address);
276
+ if (found === void 0 || found.node.kind !== "service") return yield* Effect.fail(unassembledNotServiceError(address));
277
+ }
278
+ const services = /* @__PURE__ */ new Map();
279
+ const ctxFor = (id, node) => ({
280
+ id,
281
+ address: id,
282
+ node,
283
+ graph,
284
+ opts,
285
+ application: applications.get(node.extension),
286
+ container: containers.get(node.extension),
287
+ lowered,
288
+ provisioned,
289
+ services
290
+ });
291
+ for (const { id, node } of graph.nodes) {
292
+ if (node.kind !== "service") continue;
293
+ const descriptor = yield* descriptorFor(extensions, node, id);
294
+ if (descriptor.kind !== "service") continue;
295
+ services.set(id, yield* descriptor.provision(ctxFor(id, node)));
296
+ }
297
+ for (const { id, node } of graph.nodes) {
298
+ if (node.kind === "module") continue;
299
+ if (node.kind === "dependency") continue;
300
+ const ctx = ctxFor(id, node);
301
+ const descriptor = yield* descriptorFor(extensions, node, id);
302
+ if (descriptor.kind === "resource") {
303
+ const result = yield* descriptor(ctx);
304
+ lowered.set(id, result.outputs);
305
+ entries.push({
306
+ address: id,
307
+ entities: result.entities
308
+ });
309
+ continue;
310
+ }
311
+ if (descriptor.kind !== "service") return yield* Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));
312
+ const service = node;
313
+ const provisionedNode = services.get(id);
314
+ const typedConfig = buildConfig(service, id, graph, lowered, provisioned);
315
+ const serialized = yield* descriptor.serialize(ctx, provisionedNode, typedConfig);
316
+ if (unassembled.has(id)) {
317
+ if (descriptor.reserve === void 0) return yield* Effect.fail(noReserveError(id, node.extension, node.type));
318
+ const result = yield* descriptor.reserve(ctx, provisionedNode, serialized);
319
+ lowered.set(id, result.outputs);
320
+ entries.push({
321
+ address: id,
322
+ entities: result.entities
323
+ });
324
+ continue;
325
+ }
326
+ const bundle = opts.bundles[id];
327
+ if (bundle === void 0) return yield* Effect.fail(missingBundleError(id));
328
+ const artifact = yield* descriptor.package(ctx, {
329
+ assembled: {
330
+ dir: bundle.dir,
331
+ entry: bundle.entry
332
+ },
333
+ address: id
334
+ });
335
+ const result = yield* descriptor.deploy(ctx, provisionedNode, artifact, serialized);
336
+ lowered.set(id, result.outputs);
337
+ entries.push({
338
+ address: id,
339
+ entities: result.entities
340
+ });
341
+ }
342
+ if (opts.report !== void 0) {
343
+ const report = opts.report;
344
+ yield* Alchemy.Action("composer-deployment-report", (input) => Effect.sync(() => {
345
+ report({
346
+ app: opts.name,
347
+ nodes: joinDeployment(graph, input.entries)
348
+ });
349
+ }))({
350
+ nonce: Date.now(),
351
+ entries
352
+ });
353
+ }
354
+ });
355
+ }
356
+ /**
357
+ * The whole-stack wrapper: Load → route each node through the config's
358
+ * extension registries → an Alchemy Stack (the default export the alchemy
359
+ * CLI consumes).
360
+ */
361
+ function lower(root, config, opts) {
362
+ const stackEffect = Effect.orDie(lowering(root, config, opts));
363
+ const containers = deserializeContainers(config.extensions, process.env);
364
+ const providers = opts.providers ?? mergedProviders(config);
365
+ return Alchemy.Stack(opts.name, {
366
+ providers,
367
+ state: resolveStateLayer(opts, config, containers)
368
+ }, stackEffect);
369
+ }
370
+ //#endregion
371
+ export { lower as a, resolveStateLayer as c, joinDeployment as i, buildConfig as n, lowering as o, connectionInputs as r, mergedProviders as s, LowerError as t };
372
+
373
+ //# sourceMappingURL=deploy-CmiYExQA.mjs.map