@prisma/composer 0.39.0-dev.1 → 0.39.0-dev.11

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 (141) hide show
  1. package/dist/{app-config-UeKFBma7-CohaMmWp.d.mts → app-config-DriAu5RU-C8hYpR38.d.mts} +88 -83
  2. package/dist/app-config-DriAu5RU-C8hYpR38.d.mts.map +1 -0
  3. package/dist/{app-configuration-file-CeJvBAti-D3uDlheX.mjs → app-configuration-file-D0rB5g65-CdMrjkCc.mjs} +50 -85
  4. package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map +1 -0
  5. package/dist/app-converge-bS1l9jIf-DRGbjw2D.mjs +88 -0
  6. package/dist/app-converge-bS1l9jIf-DRGbjw2D.mjs.map +1 -0
  7. package/dist/arktype.d.mts +7 -5
  8. package/dist/arktype.d.mts.map +1 -1
  9. package/dist/arktype.mjs +7 -5
  10. package/dist/arktype.mjs.map +1 -1
  11. package/dist/config-Bpi8QVLB.d.mts +1 -0
  12. package/dist/config.d.mts +3 -3
  13. package/dist/config.mjs +2 -2
  14. package/dist/control.d.mts +19 -21
  15. package/dist/control.d.mts.map +1 -1
  16. package/dist/control.mjs +4 -4
  17. package/dist/control.mjs.map +1 -1
  18. package/dist/converge-in-process-CTomEXaD-BnDylZP8.d.mts +67 -0
  19. package/dist/converge-in-process-CTomEXaD-BnDylZP8.d.mts.map +1 -0
  20. package/dist/converge-in-process-x89zb2MF-Dvj-J8xo.mjs +258 -0
  21. package/dist/converge-in-process-x89zb2MF-Dvj-J8xo.mjs.map +1 -0
  22. package/dist/{deploy-3EXLVrtG.mjs → deploy-CSU0kr4j.mjs} +130 -38
  23. package/dist/deploy-CSU0kr4j.mjs.map +1 -0
  24. package/dist/deploy-DHgEJDpg.d.mts +32 -0
  25. package/dist/deploy-DHgEJDpg.d.mts.map +1 -0
  26. package/dist/deploy.d.mts +4 -4
  27. package/dist/deploy.mjs +3 -3
  28. package/dist/{deployment-summary-p88NV5m5-SgniM8TX.d.mts → deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts} +7 -4
  29. package/dist/deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts.map +1 -0
  30. package/dist/{deployment-summary-D74WrJX7-DQ3LDUuO.mjs → deployment-summary-CVJZn2v0-Dz-gX1rp.mjs} +16 -44
  31. package/dist/deployment-summary-CVJZn2v0-Dz-gX1rp.mjs.map +1 -0
  32. package/dist/{describe-kind-Cpm_euxo-CkhlGJUL.mjs → describe-kind-Cpm_euxo-DsSPENQa.mjs} +4 -4
  33. package/dist/describe-kind-Cpm_euxo-DsSPENQa.mjs.map +1 -0
  34. package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs +165 -0
  35. package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs.map +1 -0
  36. package/dist/dev-converge-worker.d.mts +1 -0
  37. package/dist/dev-converge-worker.mjs +142 -0
  38. package/dist/dev-converge-worker.mjs.map +1 -0
  39. package/dist/{dev-current-wD5YDLjA-CzyFYXni.mjs → dev-current-lAlj53eX-DrtBnAmA.mjs} +11 -7
  40. package/dist/dev-current-lAlj53eX-DrtBnAmA.mjs.map +1 -0
  41. package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs → dev-environment-name-6eEr5PW8-7ntm9Xhs.mjs} +3 -3
  42. package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map → dev-environment-name-6eEr5PW8-7ntm9Xhs.mjs.map} +1 -1
  43. package/dist/{dist-ynqBR6y8.mjs → dist-Cf_mZHaH.mjs} +4 -26
  44. package/dist/dist-Cf_mZHaH.mjs.map +1 -0
  45. package/dist/{emulator-retry-CV8rl69G-BgUzkxc-.mjs → emulator-retry-CV8rl69G-scQ105wk.mjs} +2 -2
  46. package/dist/{emulator-retry-CV8rl69G-BgUzkxc-.mjs.map → emulator-retry-CV8rl69G-scQ105wk.mjs.map} +1 -1
  47. package/dist/{errors-0e8IVwzi.mjs → errors-DI3TBXE-.mjs} +7 -2
  48. package/dist/{errors-0e8IVwzi.mjs.map → errors-DI3TBXE-.mjs.map} +1 -1
  49. package/dist/{execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs → execute-deploy-destroy-DN16ETAk-BaopEKsA.mjs} +376 -86
  50. package/dist/execute-deploy-destroy-DN16ETAk-BaopEKsA.mjs.map +1 -0
  51. package/dist/{execute-dev-BIyOI3Ys-BbDOLlV4.mjs → execute-dev-DnVmNpc1-kSyPML7l.mjs} +455 -221
  52. package/dist/execute-dev-DnVmNpc1-kSyPML7l.mjs.map +1 -0
  53. package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs → execute-dev-current-CZdmxVQ4-Bij2LeBY.mjs} +7 -7
  54. package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs.map → execute-dev-current-CZdmxVQ4-Bij2LeBY.mjs.map} +1 -1
  55. package/dist/{execute-log-BDdHor71-B2p8Zae2.mjs → execute-log-Bl-j6izb-BTAo6tRM.mjs} +8 -8
  56. package/dist/{execute-log-BDdHor71-B2p8Zae2.mjs.map → execute-log-Bl-j6izb-BTAo6tRM.mjs.map} +1 -1
  57. package/dist/{graph-C7mdtisq-RnKiwVsx.d.mts → graph-CUYXjK8S-BzL-mhjq.d.mts} +3 -3
  58. package/dist/graph-CUYXjK8S-BzL-mhjq.d.mts.map +1 -0
  59. package/dist/{graph-BzPLUUsB-D7EnB1F5.mjs → graph-D2WMLL43-CeiC5wdy.mjs} +150 -107
  60. package/dist/graph-D2WMLL43-CeiC5wdy.mjs.map +1 -0
  61. package/dist/{graph-types-s5V7pGj2-BxSqB1ZH.d.mts → graph-types-D4PrtP-l-B0uuchTl.d.mts} +101 -98
  62. package/dist/graph-types-D4PrtP-l-B0uuchTl.d.mts.map +1 -0
  63. package/dist/http.d.mts +2 -2
  64. package/dist/http.mjs +2 -2
  65. package/dist/{index-DyuwxTtd.d.mts → index-D8chHe55.d.mts} +3 -3
  66. package/dist/{index-DyuwxTtd.d.mts.map → index-D8chHe55.d.mts.map} +1 -1
  67. package/dist/index.d.mts +5 -5
  68. package/dist/index.mjs +4 -4
  69. package/dist/internal-app-configuration-file.d.mts +7 -10
  70. package/dist/internal-app-configuration-file.d.mts.map +1 -1
  71. package/dist/internal-app-configuration-file.mjs +2 -2
  72. package/dist/internal-converge-contract.d.mts +16 -0
  73. package/dist/internal-converge-contract.d.mts.map +1 -0
  74. package/dist/internal-converge-contract.mjs +16 -0
  75. package/dist/internal-converge-contract.mjs.map +1 -0
  76. package/dist/internal-converge.d.mts +5 -0
  77. package/dist/internal-converge.mjs +4 -0
  78. package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs +527 -0
  79. package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs.map +1 -0
  80. package/dist/local-target-7KRsLMDO.d.mts +31 -0
  81. package/dist/local-target-7KRsLMDO.d.mts.map +1 -0
  82. package/dist/{local-target-Dd8FJEb5.mjs → local-target-DhU1vaxd.mjs} +8 -8
  83. package/dist/{local-target-Dd8FJEb5.mjs.map → local-target-DhU1vaxd.mjs.map} +1 -1
  84. package/dist/local-target.d.mts +3 -31
  85. package/dist/local-target.mjs +1 -1
  86. package/dist/{nextjs-DLyeRR7M-0lw_cBIr.d.mts → nextjs-DLyeRR7M-CzUbvPaJ.d.mts} +3 -3
  87. package/dist/{nextjs-DLyeRR7M-0lw_cBIr.d.mts.map → nextjs-DLyeRR7M-CzUbvPaJ.d.mts.map} +1 -1
  88. package/dist/nextjs-control.d.mts +4 -4
  89. package/dist/nextjs.d.mts +1 -1
  90. package/dist/node-control.d.mts +3 -3
  91. package/dist/node.d.mts +2 -2
  92. package/dist/{pointer-CyQZZugO-D7k3vibs.d.mts → pointer-BX2KJ720-BxcfpaHP.d.mts} +8 -6
  93. package/dist/{pointer-CyQZZugO-D7k3vibs.d.mts.map → pointer-BX2KJ720-BxcfpaHP.d.mts.map} +1 -1
  94. package/dist/{preflight-transport-DmmtoFPH-CnDWufmu.mjs → preflight-transport-2d6iIchu-B-v7Di6I.mjs} +7 -44
  95. package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs.map +1 -0
  96. package/dist/{redaction-DXung4ip-bBoNomi3.mjs → redaction-DY6eDC12-W-FzW7_r.mjs} +32 -15
  97. package/dist/redaction-DY6eDC12-W-FzW7_r.mjs.map +1 -0
  98. package/dist/{redaction-Bf8FvTFH-D_HvoMrf.d.mts → redaction-Dn7BRdaP-BcLSPhLV.d.mts} +65 -16
  99. package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts.map +1 -0
  100. package/dist/report.d.mts +3 -3
  101. package/dist/report.mjs +2 -2
  102. package/dist/report.mjs.map +1 -1
  103. package/dist/service-rpc.d.mts +2 -2
  104. package/dist/service-rpc.mjs +2 -2
  105. package/dist/steps-BZXNqW6U-C_ME2VLd.mjs +112 -0
  106. package/dist/steps-BZXNqW6U-C_ME2VLd.mjs.map +1 -0
  107. package/dist/testing.d.mts +1 -1
  108. package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs +344 -0
  109. package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs.map +1 -0
  110. package/dist/zod.d.mts +6 -5
  111. package/dist/zod.d.mts.map +1 -1
  112. package/dist/zod.mjs +6 -5
  113. package/dist/zod.mjs.map +1 -1
  114. package/package.json +15 -13
  115. package/skills/prisma-composer-core-concepts/SKILL.md +47 -66
  116. package/src/exports/dev-converge-worker.ts +2 -0
  117. package/src/exports/internal-converge-contract.ts +1 -0
  118. package/src/exports/internal-converge.ts +1 -0
  119. package/dist/app-config-UeKFBma7-CohaMmWp.d.mts.map +0 -1
  120. package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +0 -1
  121. package/dist/config-BeZEgGCg.d.mts +0 -1
  122. package/dist/deploy-3EXLVrtG.mjs.map +0 -1
  123. package/dist/deploy-Xi4_JrtE.d.mts +0 -2
  124. package/dist/deployment-summary-D74WrJX7-DQ3LDUuO.mjs.map +0 -1
  125. package/dist/deployment-summary-p88NV5m5-SgniM8TX.d.mts.map +0 -1
  126. package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +0 -1
  127. package/dist/dev-current-wD5YDLjA-CzyFYXni.mjs.map +0 -1
  128. package/dist/dist-ynqBR6y8.mjs.map +0 -1
  129. package/dist/execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs.map +0 -1
  130. package/dist/execute-dev-BIyOI3Ys-BbDOLlV4.mjs.map +0 -1
  131. package/dist/graph-BzPLUUsB-D7EnB1F5.mjs.map +0 -1
  132. package/dist/graph-C7mdtisq-RnKiwVsx.d.mts.map +0 -1
  133. package/dist/graph-types-s5V7pGj2-BxSqB1ZH.d.mts.map +0 -1
  134. package/dist/local-target.d.mts.map +0 -1
  135. package/dist/preflight-transport-DmmtoFPH-CnDWufmu.mjs.map +0 -1
  136. package/dist/redaction-Bf8FvTFH-D_HvoMrf.d.mts.map +0 -1
  137. package/dist/redaction-DXung4ip-bBoNomi3.mjs.map +0 -1
  138. package/dist/run-alchemy-CRLAyOtt-CBUV28We.mjs +0 -236
  139. package/dist/run-alchemy-CRLAyOtt-CBUV28We.mjs.map +0 -1
  140. package/dist/validate-environment-D1BTCkTs-BQprjyNP.mjs +0 -739
  141. package/dist/validate-environment-D1BTCkTs-BQprjyNP.mjs.map +0 -1
@@ -1,22 +1,25 @@
1
- import { F as ModuleNode, K as ProvisionNeed, R as NodeId, Z as ResourceNode, o as BuildAdapter, r as AppRootNode, s as Config, st as ServiceNode, t as AppConfigurationRead, y as Graph } from "./graph-types-s5V7pGj2-BxSqB1ZH.mjs";
2
- import "./graph-C7mdtisq-RnKiwVsx.mjs";
1
+ import { F as ModuleNode, K as ProvisionNeed, R as NodeId, Z as ResourceNode, o as BuildAdapter, r as AppRootNode, s as Config, st as ServiceNode, t as AppConfigurationRead, y as Graph } from "./graph-types-D4PrtP-l-B0uuchTl.mjs";
2
+ import "./graph-CUYXjK8S-BzL-mhjq.mjs";
3
3
  import * as Alchemy from "alchemy";
4
4
  import { Input, StackServices } from "alchemy";
5
5
  import * as Effect from "effect/Effect";
6
6
  import * as Layer from "effect/Layer";
7
7
  import { State } from "alchemy/State/State";
8
- //#region ../../0-framework/1-core/core/dist/app-config-UeKFBma7.d.mts
9
- //#region src/container-transport.d.ts
8
+ //#region ../../0-framework/1-core/core/dist/app-config-DriAu5RU.d.mts
9
+ //#region src/caller-credentials.d.ts
10
10
  /**
11
- * Carries resolved containers from the CLI process into the alchemy process
12
- * (ADR-0037). A deploy runs as two processes: the CLI resolves each
13
- * extension's containers, then spawns `alchemy`, which re-imports the config
14
- * from scratch and needs those containers back — and env vars are the only
15
- * channel between the two. So the CLI writes each instance's `serialize()`
16
- * output into one env var per extension, and in the alchemy process
17
- * `deserializeContainers` reads each var back through the same extension's
18
- * descriptor. The framework owns the vars; it never reads their contents.
11
+ * What the caller has already authenticated, handed unchanged to every
12
+ * extension hook that talks to the platform. `C` is the extension's own client
13
+ * type: this module cannot import a platform SDK.
19
14
  */
15
+ interface CallerCredentials<C = unknown> {
16
+ /** The workspace the caller acts in. `undefined` when the caller has no workspace to name — the extension decides whether it can proceed. */
17
+ readonly workspaceId: string | undefined;
18
+ /** An already-authenticated platform API client. Present means the extension must not build its own from the environment. */
19
+ readonly client?: C | undefined;
20
+ }
21
+ //#endregion
22
+ //#region src/container-transport.d.ts
20
23
  /** The key an extension resolves a container from: which app, which environment. */
21
24
  interface LocateContainerInput {
22
25
  /** The application name (root node's name, or `--name`). */
@@ -36,25 +39,6 @@ interface ContainerInstance {
36
39
  /** Serialize to a non-empty string for the process transport above. The format is the extension's own; only its `deserialize` reads it. */
37
40
  serialize(): string;
38
41
  }
39
- /**
40
- * What the caller has already authenticated, handed to one container
41
- * lifecycle call. A caller that holds neither omits the argument, and the
42
- * extension falls back to whatever credential protocol it defines for
43
- * itself (for Prisma Cloud, its env vars — which is how the alchemy child
44
- * process still resolves containers).
45
- *
46
- * `C` is the extension's own platform-client type, left as a type parameter
47
- * because this shared-plane module must not import a platform SDK; the
48
- * framework only carries the value, never calls it. The framework stores the
49
- * erased `C = unknown` form and the extension recovers its concrete client
50
- * through the same method bivariance that erases `I` below.
51
- */
52
- interface ContainerCredentials<C = unknown> {
53
- /** The workspace the container lives in. `undefined` when the caller has no workspace to name — the extension decides whether it can proceed. */
54
- readonly workspaceId: string | undefined;
55
- /** An already-authenticated platform API client. Present means the extension must not build its own from the environment. */
56
- readonly client?: C | undefined;
57
- }
58
42
  /**
59
43
  * The platform containers an app deploys into, as one lifecycle. `I` is
60
44
  * the extension's own instance type — the same descriptor produces and
@@ -67,11 +51,11 @@ interface ContainerCredentials<C = unknown> {
67
51
  */
68
52
  interface ContainerDescriptor<I extends ContainerInstance = ContainerInstance, C = unknown> {
69
53
  /** Resolve the container for (appName, environment), creating anything absent. Called by `deploy`. */
70
- ensure(input: LocateContainerInput, credentials?: ContainerCredentials<C>): Promise<I>;
54
+ ensure(input: LocateContainerInput, credentials?: CallerCredentials<C>): Promise<I>;
71
55
  /** Find the container for (appName, environment); `undefined` when nothing exists. Called by `destroy` — never creates. */
72
- locate(input: LocateContainerInput, credentials?: ContainerCredentials<C>): Promise<I | undefined>;
56
+ locate(input: LocateContainerInput, credentials?: CallerCredentials<C>): Promise<I | undefined>;
73
57
  /** Remove the container after a successful destroy, after every extension's `teardown` has run. Failure policy is the extension's. */
74
- remove(instance: I, credentials?: ContainerCredentials<C>): Promise<void>;
58
+ remove(instance: I, credentials?: CallerCredentials<C>): Promise<void>;
75
59
  /** Reconstruct an instance from its own `serialize()` output — the far end of the framework's parent→child transport. */
76
60
  deserialize(serialized: string): I;
77
61
  }
@@ -99,19 +83,14 @@ declare function preflightEnvVarName(extensionId: string): string;
99
83
  declare function preflightEnv(payloads: ReadonlyMap<string, string>): Record<string, string>;
100
84
  /** The alchemy-process side: the payload this extension's own preflight wrote, or `undefined` when it wrote none (or when nothing ran a preflight at all). */
101
85
  declare function readPreflightPayload(extensionId: string, env: Readonly<Record<string, string | undefined>>): PreflightPayload;
102
- /** Where a platform variable is named: a service's input field, a service's per-key param, or the input of a module or resource that passes it to no service. */
86
+ /** Where a platform variable is named: a service's input field, or a resource no service reads. */
103
87
  type PlatformVariableReader = {
104
88
  readonly kind: 'field';
105
89
  readonly service: string;
106
90
  readonly path: string;
107
- } | {
108
- readonly kind: 'param';
109
- readonly service: string;
110
- readonly param: string;
111
91
  } | {
112
92
  readonly kind: 'unread';
113
93
  readonly node: string;
114
- readonly nodeKind: 'module' | 'resource';
115
94
  };
116
95
  /** A platform variable with no value that nothing requires, with its readers and the commands that set it. */
117
96
  interface UnsetPlatformVariable {
@@ -126,12 +105,6 @@ interface PreflightFindings {
126
105
  }
127
106
  /** One reader as the deploy prints it, for example `read by service "shop.email", field "apiKey"`. */
128
107
  declare function platformVariableReaderText(reader: PlatformVariableReader): string;
129
- /** The variable that carries every extension's deploy preflight findings from the first process to the second. No extension's preflight variable may take this name. */
130
- declare const PREFLIGHT_FINDINGS_ENV_VAR = "PRISMA_COMPOSER_PREFLIGHT_FINDINGS";
131
- /** The env entry the CLI sets on the second process. It is always set, and empty when nothing was found, so a stale value in the shell never reads as this run's. */
132
- declare function preflightFindingsEnv(findings: PreflightFindings): Record<string, string>;
133
- /** The second process's side: the findings the CLI carried, or none. Throws on a value that does not decode: that is a framework bug. */
134
- declare function readPreflightFindings(env: Readonly<Record<string, string | undefined>>): PreflightFindings;
135
108
  //#endregion
136
109
  //#region src/control/deploy.d.ts
137
110
  /** The Layer shape every Alchemy state store must satisfy — what `LowerOptions.state` and `PrismaAppConfig.state` both traffic in. */
@@ -168,7 +141,7 @@ interface ProvisionerDescriptor {
168
141
  /**
169
142
  * The phased service SPI. `P` and `S` are the descriptor's OWN intra-node
170
143
  * handoff types — provision's product consumed by serialize/deploy, and
171
- * serialize's product consumed by deploy. Core threads them through without
144
+ * serialize's product consumed by package/deploy. Core threads them through without
172
145
  * inspection; only the descriptor that writes them reads them.
173
146
  *
174
147
  * Method syntax (not property-arrow) is required: the heterogeneous
@@ -192,9 +165,10 @@ interface ServiceLowering<P = unknown, S = unknown> {
192
165
  /**
193
166
  * Prints the bootstrap and assembles the deployable artifact from the
194
167
  * app-built bundle. Must be byte-deterministic: an unchanged service noops
195
- * on redeploy.
168
+ * on redeploy. `serialized` is this service's `serialize` product. It must
169
+ * not write a secret, or a value the deploy has not resolved, into the artifact.
196
170
  */
197
- package(ctx: LowerContext, input: PackageInput): Effect.Effect<Artifact, unknown, unknown>;
171
+ package(ctx: LowerContext, input: PackageInput, serialized: S): Effect.Effect<Artifact, unknown, unknown>;
198
172
  /** Ships the packaged artifact into the provisioned thing and runs it. Returns the node's outputs for dependents, plus the entities it became on the deployment target. */
199
173
  deploy(ctx: LowerContext, provisioned: P, artifact: Artifact, serialized: S): Effect.Effect<LoweredResult, unknown, unknown>;
200
174
  /**
@@ -231,12 +205,13 @@ interface LowerContext {
231
205
  */
232
206
  readonly application: unknown;
233
207
  /**
234
- * The owning extension's resolved container, deserialized from the
235
- * framework transport; core never reads it — the extension narrows it
236
- * with its own type guard. `undefined` when the extension declares no
237
- * container descriptor.
208
+ * The owning extension's resolved container; core never reads it — the
209
+ * extension narrows it with its own type guard. `undefined` when the
210
+ * extension declares no container descriptor.
238
211
  */
239
212
  readonly container: ContainerInstance | undefined;
213
+ /** What the owning extension's preflight handed back this run; `undefined` when it returned nothing or ran no preflight. Core never reads it. */
214
+ readonly preflight: PreflightPayload;
240
215
  /** Already-lowered deps (topo order). */
241
216
  readonly lowered: ReadonlyMap<NodeId, Outputs>;
242
217
  /** Every provisioned param value minted this lowering, keyed by edge id (ADR-0031). */
@@ -302,16 +277,16 @@ interface DeploymentResult {
302
277
  interface LowerOptions {
303
278
  /** Stack + root node id. */
304
279
  readonly name: string;
305
- /** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`; the generated stack files always pass it. */
280
+ /** The environment being deployed, as `--environment` gave it. Required by any value over `environment.name`; every caller passes it. */
306
281
  readonly environment?: string;
307
- /** What the first process's Load read from the app configuration (ADR-0062), from the app configuration file. Load takes the root's input and every configuration key's text from it, and the Prisma Cloud serializer reads a service's `envParam()` leaves from its `configurationKeyText`. The generated stack files pass it. */
282
+ /** What the caller's Load read from the app configuration (ADR-0062). Load takes the root's input from it. */
308
283
  readonly appConfigurationRead?: AppConfigurationRead;
309
- /** The node addresses of the graph the first process built. When given, lowering refuses a graph whose addresses differ. The generated stack files pass them. */
284
+ /** The node addresses of the graph the caller built. When given, lowering refuses a graph whose addresses differ. */
310
285
  readonly firstProcessNodeAddresses?: readonly string[];
311
286
  readonly bundles: Record<string, Bundle>;
312
287
  /** Alchemy state store for the stack. Defaults to the config's own state layer. */
313
288
  readonly state?: AlchemyStateLayer;
314
- /** Explicit provider set for the stack. Defaults to the config's own merged `providers()` (`mergedProviders`) — the same override precedence as `state`. The dev stack module passes `localTargetProviders(...)` here (ADR-0041); `lower()` itself learns nothing about the local target. */
289
+ /** Explicit provider set for the stack. Defaults to the config's own merged `providers()` (`mergedProviders`) — the same override precedence as `state`. `prisma dev` passes `localTargetProviders(...)` here (ADR-0041); `lower()` itself learns nothing about the local target. */
315
290
  readonly providers?: Layer.Layer<never>;
316
291
  /**
317
292
  * Invoked once per deploy, during apply, with the Deploy operation's result
@@ -321,8 +296,16 @@ interface LowerOptions {
321
296
  * declared at all.
322
297
  */
323
298
  readonly report?: (result: DeploymentResult) => void;
324
- /** Addresses lowered without an artifact: `package` and `deploy` are skipped and `reserve` runs instead (ADR-0056). Only the dev stack file sets it. */
299
+ /** Addresses lowered without an artifact: `package` and `deploy` are skipped and `reserve` runs instead (ADR-0056). Only `prisma dev` sets it. */
325
300
  readonly unassembled?: readonly string[];
301
+ /** Each extension's resolved container, by extension id. Pass both `containers` and `preflightPayloads`, or neither. When both are absent, `lower()` reads both from the environment transports through `transportedLowerInputs(config)`. When exactly one is passed, `lower()` throws. */
302
+ readonly containers?: ReadonlyMap<string, ContainerInstance> | undefined;
303
+ /** What each extension's preflight returned, by extension id. Each lowering context gets its own extension's entry as `LowerContext.preflight`. */
304
+ readonly preflightPayloads?: ReadonlyMap<string, string> | undefined;
305
+ /** The platform variables with no value that the deploy preflight found. The deploy report carries them. Absent means none. */
306
+ readonly findings?: PreflightFindings;
307
+ /** What the caller already authenticated, handed to every extension's `providers()` and to the state descriptor's `create()`. Absent means each extension falls back to its own credential protocol. */
308
+ readonly credentials?: CallerCredentials | undefined;
326
309
  }
327
310
  /** A build descriptor's normalized output: the produced bundle dir plus the app's runnable entry within it. */
328
311
  interface Bundle {
@@ -377,6 +360,8 @@ interface Artifact {
377
360
  declare class LowerError extends Error {
378
361
  constructor(message: string);
379
362
  }
363
+ /** The `name` of the error `lower()` fails with when it builds a graph whose node addresses differ from `firstProcessNodeAddresses`. */
364
+ declare const GRAPH_CHANGED_ERROR = "GraphChangedError";
380
365
  /**
381
366
  * Assembles a service's typed Config. Connection params come from the
382
367
  * dependency edge's lowered outputs — or, for a param carrying a `provision`
@@ -413,7 +398,7 @@ declare function joinDeployment(graph: Graph, entries: readonly {
413
398
  address: string;
414
399
  entities: readonly DeployedEntity[];
415
400
  }[]): readonly DeployedNode[];
416
- /** The deploy report: every deployed node joined with its graph node, and the findings the CLI carried from the deploy preflight. */
401
+ /** The deploy report: every deployed node joined with its graph node, and the deploy preflight's findings. */
417
402
  declare function deploymentResult(app: string, graph: Graph, entries: readonly {
418
403
  address: string;
419
404
  entities: readonly DeployedEntity[];
@@ -431,16 +416,22 @@ declare function resolveStateLayer(opts: LowerOptions, config: PrismaAppConfig,
431
416
  * extension without `providers` is skipped; no used-extensions-only
432
417
  * filtering (ADR-0017's pinned providers rule).
433
418
  */
434
- declare function mergedProviders(config: PrismaAppConfig): Layer.Layer<never>;
419
+ declare function mergedProviders(config: PrismaAppConfig, credentials?: CallerCredentials): Layer.Layer<never>;
435
420
  /**
436
421
  * Composable form for mixed stacks: hand-wired Alchemy resources alongside Prisma App nodes in one stack effect.
437
422
  * Fails with LowerError or whatever an extension's lowering raises — the error type is open.
438
423
  */
439
424
  declare function lowering(root: ModuleNode | AppRootNode, config: PrismaAppConfig, opts: LowerOptions): Effect.Effect<undefined, LowerError, unknown>;
425
+ interface TransportedLowerInputs {
426
+ readonly containers: ReadonlyMap<string, ContainerInstance>;
427
+ readonly preflightPayloads: ReadonlyMap<string, string>;
428
+ }
429
+ /** The containers and preflight payloads a host wrote into the environment of a stack file it runs as a child. */
430
+ declare function transportedLowerInputs(config: PrismaAppConfig): TransportedLowerInputs;
440
431
  /**
441
432
  * The whole-stack wrapper: Load → route each node through the config's
442
- * extension registries → an Alchemy Stack (the default export the alchemy
443
- * CLI consumes).
433
+ * extension registries → an Alchemy Stack, which `deploy` hands to
434
+ * `Alchemist.plan` and a generated stack file exports for the alchemy CLI.
444
435
  */
445
436
  declare function lower(root: ModuleNode | AppRootNode, config: PrismaAppConfig, opts: LowerOptions): Alchemy.ConfiguredStack<undefined, never>;
446
437
  //#endregion
@@ -459,8 +450,11 @@ interface ExtensionDescriptor {
459
450
  readonly provisions?: ReadonlyMap<symbol, ProvisionerDescriptor>;
460
451
  /** Once-per-lowering hook — the application's shared infrastructure (e.g. prisma-cloud's Project). */
461
452
  readonly application?: ApplicationDescriptor;
462
- /** The extension's Alchemy providers — merged across all configured extensions (config order). */
463
- readonly providers?: () => Layer.Layer<never>;
453
+ /**
454
+ * The extension's Alchemy providers — merged across all configured extensions (config order).
455
+ * METHOD SYNTAX REQUIRED, like `preflight`: an extension types `input` against its own client, which assigns here only through method bivariance.
456
+ */
457
+ providers?(input: ProvidersInput): Layer.Layer<never>;
464
458
  /** Refuses a loaded graph this extension cannot deploy by throwing `GraphCheckError`. The CLI calls it right after Load in every command that runs Load. Any other throw is a bug. */
465
459
  readonly checkGraph?: (graph: Graph) => void;
466
460
  /**
@@ -470,10 +464,10 @@ interface ExtensionDescriptor {
470
464
  * platform variable a service needs has a value) and throws to abort the
471
465
  * deploy. Async: it talks to the platform (ADR-0064).
472
466
  *
473
- * What it returns is carried to the alchemy process for this same extension
474
- * to read back there (preflight-transport.ts) — preflight runs in the CLI
475
- * parent, and the alchemy child re-imports the config from scratch, so
476
- * anything the lowering needs from it must ride that transport. The payload
467
+ * What it returns reaches this same extension's lowering as
468
+ * `LowerContext.preflight`: as a value under `deploy` and `prisma dev`, and
469
+ * through the environment (preflight-transport.ts) for `destroy`'s alchemy
470
+ * child, which re-imports the config from scratch. The payload
477
471
  * is the extension's own opaque string; the framework never reads it, and a
478
472
  * secret value must never go in it. What it hands `input.report` reaches the
479
473
  * deploy report through the framework's own transport, not this payload.
@@ -528,10 +522,15 @@ interface ExtensionDescriptor {
528
522
  interface StateDescriptor {
529
523
  /** The owning extension's id — matched against `ExtensionDescriptor.id`. */
530
524
  readonly extension: string;
531
- /** Build the state layer. `container` is the owning extension's resolved instance; `undefined` when it declared no container descriptor. */
532
- create(container: ContainerInstance | undefined): AlchemyStateLayer;
525
+ /** Build the state layer. `container` is the owning extension's resolved instance; `undefined` when it declared no container descriptor. `credentials` is as `ExtensionDescriptor.providers` receives it. */
526
+ create(container: ContainerInstance | undefined, credentials?: CallerCredentials): AlchemyStateLayer;
527
+ }
528
+ /** What `ExtensionDescriptor.providers` receives. `C` erases to `unknown` at the framework boundary, exactly as on `PreflightInput`. */
529
+ interface ProvidersInput<C = unknown> {
530
+ /** What the caller already authenticated (`LowerOptions.credentials`). Absent means the extension falls back to its own credential protocol. */
531
+ readonly credentials?: CallerCredentials<C> | undefined;
533
532
  }
534
- /** The resolved deploy context handed to an extension's `preflight` hook. `C` erases to `unknown` at the framework boundary — see ContainerCredentials. */
533
+ /** The resolved deploy context handed to an extension's `preflight` hook. `C` erases to `unknown` at the framework boundary — see CallerCredentials. */
535
534
  interface PreflightInput<C = unknown> {
536
535
  /** The loaded application graph — the manifest of prerequisites is read from it (`provisionManifest`). */
537
536
  readonly graph: Graph;
@@ -544,7 +543,7 @@ interface PreflightInput<C = unknown> {
544
543
  /** The app secrets the command read for this environment. */
545
544
  readonly secrets: AppSecrets;
546
545
  /** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
547
- readonly credentials?: ContainerCredentials<C> | undefined;
546
+ readonly credentials?: CallerCredentials<C> | undefined;
548
547
  /** Hands the deploy how many platform variables the check read and which have no value. */
549
548
  readonly report?: ((check: PlatformVariableCheck) => void) | undefined;
550
549
  /** Shows the user a warning that does not stop the run. Only `prisma dev` passes it and shows the warnings; deploy passes none. */
@@ -589,7 +588,7 @@ interface ReportBeginInput<C = unknown> {
589
588
  */
590
589
  readonly reportId: string | undefined;
591
590
  /** What the caller has already authenticated, exactly as `preflight` and the container lifecycle receive it. Present means the reporter must not build a client from the environment. */
592
- readonly credentials?: ContainerCredentials<C> | undefined;
591
+ readonly credentials?: CallerCredentials<C> | undefined;
593
592
  }
594
593
  /** The deploy context handed to `RunReporter.attach`, once containers exist. */
595
594
  interface ReportAttachInput {
@@ -656,8 +655,8 @@ interface LocalTargetDescriptor {
656
655
  providers(input: LocalTargetProvidersInput): Layer.Layer<never>;
657
656
  /** A stable local identity — resolved without any platform call. */
658
657
  readonly container: ContainerDescriptor;
659
- /** Value sourcing (secrets/env-params) — runs where deploy's preflight runs. What it returns reaches the alchemy process the same way deploy's preflight payload does. */
660
- preflight?(input: PreflightInput): Promise<PreflightPayload>;
658
+ /** Works out the platform variables' values, where deploy's preflight runs. Its payload reaches the alchemy process the same way deploy's preflight payload does. */
659
+ preflight?(input: PreflightInput): Promise<DevPreflightResult>;
661
660
  /** Ensure the emulator daemons this topology's node kinds need are running, plus any per-node emulator state that must exist before converge (idempotent; daemons persist across sessions). */
662
661
  emulators?(input: LocalTargetEmulatorsInput): Promise<void>;
663
662
  /** The dev session's view of the running app. Core renders it and never learns an emulator's API. */
@@ -672,6 +671,12 @@ interface LocalTargetDescriptor {
672
671
  */
673
672
  current?(input: LocalTargetCurrentInput): Promise<LocalTargetCurrentApp | undefined>;
674
673
  }
674
+ /** What a local target's preflight found. */
675
+ interface DevPreflightResult {
676
+ readonly payload: PreflightPayload;
677
+ /** The text of each plain platform variable a service reads, by name. Never a secret. */
678
+ readonly plainVariableText: Readonly<Record<string, string>>;
679
+ }
675
680
  interface LocalTargetCurrentInput {
676
681
  /** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
677
682
  readonly devDir: string;
@@ -724,9 +729,9 @@ interface LocalTargetProvidersInput {
724
729
  readonly container: ContainerInstance | undefined;
725
730
  /** Absolute path of the environment's dev state directory (`devEnvironmentDir`, under the cwd). */
726
731
  readonly devDir: string;
727
- /** The text of each configuration key the graph reads, from the app configuration file. A local deployment takes the text its param rows point at from it. */
728
- readonly configurationKeyText: Readonly<Record<string, string>>;
729
- /** The app secrets the graph's `envSecret()`s name, which the first process handed the second. A local deployment takes the text its `$platform` markers name from it. */
732
+ /** The text of each plain platform variable a service reads, by name. Never a secret. */
733
+ readonly plainVariableText: Readonly<Record<string, string>>;
734
+ /** The app secrets the graph's platform secrets name, which `prisma dev` hands its converge worker thread in memory. A local deployment takes the text its secret `$platform` markers name from it. */
730
735
  readonly namedSecrets: NamedSecrets;
731
736
  }
732
737
  interface LocalTargetEmulatorsInput {
@@ -835,11 +840,11 @@ interface ConfigAdapterInput {
835
840
  type ConfigValues = Readonly<Record<string, unknown>>;
836
841
  /** A function in the `config` or `secrets` list of the `composer` section (ADR-0062): it receives the environment and returns that environment's values. Only the command's first process calls it; the second process reads what the first read from the app configuration file. */
837
842
  type ConfigAdapter = (input: ConfigAdapterInput) => ConfigValues | Promise<ConfigValues>;
838
- /** The app configuration (ADR-0062): what the `config` adapters return, merged by top-level key, a later adapter winning. It is the root's input, and what `envParam()` reads. */
843
+ /** The app configuration (ADR-0062): what the `config` adapters return, merged by top-level key, a later adapter winning. It is the root's input, and under `prisma dev` it also holds the text of each plain platform variable. */
839
844
  type AppConfiguration = Readonly<Record<string, unknown>>;
840
- /** The app secrets (ADR-0062): what the `secrets` adapters return, merged the same way. Every value is text. Nothing fills a platform variable from them. `prisma dev` hands its second process the values under the secrets keys of the graph's secret sources, and Composer redacts those values wherever it prints. */
845
+ /** The app secrets (ADR-0062): what the `secrets` adapters return, merged the same way. Every value is text. Nothing fills a platform variable from them. `prisma dev` hands the local target's providers the values under the secrets keys of the graph's secret sources, and Composer redacts those values wherever it prints. */
841
846
  type AppSecrets = Readonly<Record<string, string>>;
842
- /** The app secrets under the secrets keys of the graph's secret sources, each with text. `prisma dev`'s first process hands them to its second process in `PRISMA_COMPOSER_NAMED_SECRETS`. */
847
+ /** The app secrets under the secrets keys of the graph's secret sources, each with text. `prisma dev` hands them to the local target's providers, in memory. */
843
848
  type NamedSecrets = Readonly<Record<string, string>>;
844
849
  /**
845
850
  * The config file's default export. `extensions` lists every extension the
@@ -860,5 +865,5 @@ interface PrismaAppConfig {
860
865
  /** Typed identity — exists so the `composer` section of `prisma.config.ts` gets checked against PrismaAppConfig where it is written. */
861
866
  declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
862
867
  //#endregion
863
- export { RunOutcome as $, LocalTargetProvidersInput as A, PREFLIGHT_FINDINGS_ENV_VAR as B, LocalNodeStopped as C, readPreflightFindings as Ct, LocalTargetCurrentInput as D, LocalTargetCurrentApp as E, LoweredResult as F, PreflightInput as G, PlatformVariableCheck as H, Lowering as I, ProvisionEdge as J, PreflightPayload as K, NamedSecrets as L, LowerContext as M, LowerError as N, LocalTargetDescriptor as O, LowerOptions as P, ReporterDescriptor as Q, NodeDescriptor as R, LocalNodeLocation as S, preflightFindingsEnv as St, LocalTargetAttachment as T, resolveStateLayer as Tt, PlatformVariableReader as U, PackageInput as V, PreflightFindings as W, ReportAttachInput as X, ProvisionerDescriptor as Y, ReportBeginInput as Z, DeployedNode as _, lowering as _t, Artifact as a, UnsetPlatformVariable as at, ExtensionDescriptor as b, preflightEnv as bt, ConfigAdapter as c, containerEnv as ct, ContainerCredentials as d, deploymentResult as dt, RunReporter as et, ContainerDescriptor as f, deserializeContainers as ft, DeployedEntity as g, lower as gt, DEV_ENVIRONMENT_NAME_FILE as h, joinDeployment as ht, ApplicationDescriptor as i, TeardownInput as it, LocateContainerInput as j, LocalTargetEmulatorsInput as k, ConfigAdapterInput as l, containerEnvVarName as lt, DEV_DIR as m, isBuildOnlyExtension as mt, AppConfiguration as n, ServiceLowering as nt, AssembleInput as o, buildConfig as ot, ContainerInstance as p, devEnvironmentDir as pt, PrismaAppConfig as q, AppSecrets as r, StateDescriptor as rt, Bundle as s, connectionInputs as st, AlchemyStateLayer as t, ServeInput as tt, ConfigValues as u, defineConfig as ut, DeploymentResult as v, mergedProviders as vt, LocalTargetAttachInput as w, readPreflightPayload as wt, LocalNodeCondition as x, preflightEnvVarName as xt, DevServer as y, platformVariableReaderText as yt, Outputs as z };
864
- //# sourceMappingURL=app-config-UeKFBma7-CohaMmWp.d.mts.map
868
+ export { ReportBeginInput as $, LocalTargetDescriptor as A, NodeDescriptor as B, LocalNodeCondition as C, preflightEnvVarName as Ct, LocalTargetAttachment as D, LocalTargetAttachInput as E, transportedLowerInputs as Et, LowerError as F, PreflightFindings as G, PackageInput as H, LowerOptions as I, PrismaAppConfig as J, PreflightInput as K, LoweredResult as L, LocalTargetProvidersInput as M, LocateContainerInput as N, LocalTargetCurrentApp as O, LowerContext as P, ReportAttachInput as Q, Lowering as R, GRAPH_CHANGED_ERROR as S, preflightEnv as St, LocalNodeStopped as T, resolveStateLayer as Tt, PlatformVariableCheck as U, Outputs as V, PlatformVariableReader as W, ProvisionEdge as X, ProvidersInput as Y, ProvisionerDescriptor as Z, DeployedNode as _, joinDeployment as _t, Artifact as a, StateDescriptor as at, DevServer as b, mergedProviders as bt, CallerCredentials as c, buildConfig as ct, ConfigValues as d, containerEnvVarName as dt, ReporterDescriptor as et, ContainerDescriptor as f, defineConfig as ft, DeployedEntity as g, isBuildOnlyExtension as gt, DEV_ENVIRONMENT_NAME_FILE as h, devEnvironmentDir as ht, ApplicationDescriptor as i, ServiceLowering as it, LocalTargetEmulatorsInput as j, LocalTargetCurrentInput as k, ConfigAdapter as l, connectionInputs as lt, DEV_DIR as m, deserializeContainers as mt, AppConfiguration as n, RunReporter as nt, AssembleInput as o, TeardownInput as ot, ContainerInstance as p, deploymentResult as pt, PreflightPayload as q, AppSecrets as r, ServeInput as rt, Bundle as s, UnsetPlatformVariable as st, AlchemyStateLayer as t, RunOutcome as tt, ConfigAdapterInput as u, containerEnv as ut, DeploymentResult as v, lower as vt, LocalNodeLocation as w, readPreflightPayload as wt, ExtensionDescriptor as x, platformVariableReaderText as xt, DevPreflightResult as y, lowering as yt, NamedSecrets as z };
869
+ //# sourceMappingURL=app-config-DriAu5RU-C8hYpR38.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-config-DriAu5RU-C8hYpR38.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-DriAu5RU.d.mts"],"mappings":";;;;;;;;;;;;;;UAaU,kBAAkB;;WAEjB;;WAEA,SAAS;;;;;UAKV;;WAEC;;WAEA;;;;;;;UAOD;WACC,OAAO;;WAEP;;EAET;;;;;;;;;;;;UAYQ,oBAAoB,UAAU,oBAAoB,mBAAmB;;EAE7E,OAAO,OAAO,sBAAsB,cAAc,kBAAkB,KAAK,QAAQ;;EAEjF,OAAO,OAAO,sBAAsB,cAAc,kBAAkB,KAAK,QAAQ;;EAEjF,OAAO,UAAU,GAAG,cAAc,kBAAkB,KAAK;;EAEzD,YAAY,qBAAqB;;;iBAGlB,oBAAoB;;iBAEpB,aAAa,WAAW,oBAAoB,qBAAqB;;UAExE;WACC;WACA,YAAY;;;;;;iBAMN,sBAAsB,qBAAqB,+BAA+B,KAAK,SAAS,sCAAsC,oBAAoB;;;;KAI9J;;iBAEY,oBAAoB;;iBAEpB,aAAa,UAAU,8BAA8B;;iBAErD,qBAAqB,qBAAqB,KAAK,SAAS,sCAAsC;;KAE1G;WACM;WACA;WACA;;WAEA;WACA;;;UAGD;WACC;WACA,kBAAkB;;WAElB;;;UAGD;WACC,gBAAgB;;;iBAGV,2BAA2B,QAAQ;;;;KAI/C,oBAAoB,MAAM,MAAM,cAAc;;;;;;UAMzC;EACR,UAAU,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AER,eAAe;;aAEf,SAAS;MAChB;aACO;;;EAGX,WAAW;;;;;;EAMX;;;cAGY;;;;;;iBAMG,kBAAkB;;;;;;cAMrB;;;;;;;;;iBASG,qBAAqB,WAAW;;;;;;KAM5C;WACM;IACP;WACO;IACP;WACO;EACT,SAAS,OAAO,gBAAgB,QAAQ;;;;;EAKxC,OAAO,OAAO,aAAa,QAAQ;;;UAG3B;;WAEC;;WAEA;;;KAGN,eAAe,SAAS;;KAExB,iBAAiB,OAAO,uBAAuB,eAAe,QAAQ;;KAEtE,mBAAmB,SAAS;;KAE5B,aAAa,SAAS;;KAEtB,eAAe,SAAS;;;;;;;UAOnB;;WAEC;WACA,YAAY;WACZ,OAAO;;WAEP,kBAAkB;;WAElB,mBAAmB;;;iBAGb,aAAa,QAAQ,kBAAkB"}
@@ -1,21 +1,48 @@
1
- import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
1
+ import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
2
2
  import { t as DEV_DIR } from "./app-config-CErnR6NK-D9NgSBH4.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import * as fs$1 from "node:fs";
5
- //#region ../../0-framework/3-tooling/cli/dist/app-configuration-file-CeJvBAti.mjs
5
+ //#region ../../0-framework/3-tooling/cli/dist/app-configuration-file-D0rB5g65.mjs
6
+ function textIn(value, at) {
7
+ if (typeof value === "string") return [{
8
+ at,
9
+ text: value
10
+ }];
11
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return [{
12
+ at,
13
+ text: String(value)
14
+ }];
15
+ if (Array.isArray(value)) return value.flatMap((member, index) => textIn(member, [...at, String(index)]));
16
+ if (typeof value === "object" && value !== null) return Object.entries(value).flatMap(([key, member]) => textIn(member, [...at, key]));
17
+ return [];
18
+ }
19
+ /** Throws `CONFIG.SECRET_AS_PLAIN_VALUE` when a root input field Load read holds a known secret. */
20
+ function refuseSecretsInRootInput(read, knownSecrets, consequence) {
21
+ const readPlaces = read.rootInput.flatMap((field) => textIn(field.value, field.path).map(({ at, text }) => ({
22
+ where: `Root input field input.${at.join(".")}`,
23
+ text
24
+ })));
25
+ for (const { where, text } of readPlaces) {
26
+ const name = knownSecrets.nameIn(text);
27
+ if (name === void 0) continue;
28
+ throw new CliStructuredError("CONFIG.SECRET_AS_PLAIN_VALUE", `${where} holds the value of the platform secret "${name}". ${consequence}`, { fix: `Pass the value of the platform secret "${name}" to where this value is used, or give this plain value text that does not contain the value of "${name}".` });
29
+ }
30
+ }
31
+ /** Throws `CONFIG.SECRET_AS_PLAIN_VALUE` when a plain platform variable's text holds a known secret. */
32
+ function refuseSecretsInPlainVariables(plainVariableText, knownSecrets, consequence) {
33
+ for (const [variable, text] of Object.entries(plainVariableText)) {
34
+ const name = knownSecrets.nameIn(text);
35
+ if (name === void 0) continue;
36
+ throw new CliStructuredError("CONFIG.SECRET_AS_PLAIN_VALUE", `The platform variable "${variable}", which prisma dev read from the \`config\` adapters, holds the value of the platform secret "${name}". ${consequence}`, { fix: `Keep the value of "${name}" out of the platform variable "${variable}", or give "${variable}" a different value.` });
37
+ }
38
+ }
6
39
  /** Names the app configuration file the first process wrote for this run (ADR-0062). */
7
40
  const APP_CONFIGURATION_FILE_ENV = "PRISMA_COMPOSER_APP_CONFIGURATION_FILE";
8
- /** `prisma dev` only: the named secrets, as a JSON object. */
9
- const NAMED_SECRETS_ENV = "PRISMA_COMPOSER_NAMED_SECRETS";
10
41
  const FILE_NAME = /^app-configuration-(\d+)(-[^/]*)?\.json$/;
11
- /** The app configuration file a deploy or destroy run writes: unique per run, so concurrent runs from one checkout never share one. */
42
+ /** The app configuration file a destroy run writes: unique per run, so concurrent runs from one checkout never share one. */
12
43
  function deployAppConfigurationFile(cwd, runId) {
13
44
  return path$1.join(cwd, ".prisma-composer", `app-configuration-${String(process.pid)}-${runId}.json`);
14
45
  }
15
- /** The app configuration file `prisma dev` writes in an environment's folder. */
16
- function devAppConfigurationFile(devDir) {
17
- return path$1.join(devDir, `app-configuration-${String(process.pid)}.json`);
18
- }
19
46
  function isRunning(pid) {
20
47
  try {
21
48
  process.kill(pid, 0);
@@ -54,64 +81,20 @@ function removeLeftoverAppConfigurationFiles(cwd) {
54
81
  }
55
82
  }
56
83
  }
57
- function textIn(value, at) {
58
- if (typeof value === "string") return [{
59
- at,
60
- text: value
61
- }];
62
- if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return [{
63
- at,
64
- text: String(value)
65
- }];
66
- if (Array.isArray(value)) return value.flatMap((member, index) => textIn(member, [...at, String(index)]));
67
- if (typeof value === "object" && value !== null) return Object.entries(value).flatMap(([key, member]) => textIn(member, [...at, key]));
68
- return [];
69
- }
70
84
  /**
71
- * Refuses when the file would hold a known secret in a plain value, a number or a boolean
72
- * compared as its text (`KnownSecrets.nameIn`). The message names where and the secrets key,
73
- * never the value.
74
- */
75
- function refuseSecretsIn(read, knownSecrets) {
76
- const places = [...read.rootInput.flatMap((field) => textIn(field.value, field.path).map(({ at, text }) => ({
77
- where: `Root input field input.${at.join(".")}`,
78
- text
79
- }))), ...Object.entries(read.configurationKeyText).map(([key, text]) => ({
80
- where: `Configuration key "${key}"`,
81
- text
82
- }))];
83
- for (const { where, text } of places) {
84
- const name = knownSecrets.nameIn(text);
85
- if (name === void 0) continue;
86
- throw new CliStructuredError("CONFIG.SECRET_AS_PLAIN_VALUE", `${where} holds the value of the secret "${name}", which an envSecret() in the graph reads. Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.`, { fix: `Read the secret with envSecret('${name}') where it is used, or give this plain value text that does not contain the value of "${name}".` });
87
- }
88
- }
89
- /**
90
- * First process: the handover to the second process (ADR-0062). The app configuration file at
91
- * `file` holds what Load read and the graph's node addresses. With `appSecrets`, which only
92
- * `prisma dev` passes, the environment also carries the named secrets: the app secrets under
93
- * the graph's secrets keys, each with text. Refuses when the file would hold any of
94
- * `knownSecrets`. Every other input is plain data from the graph, such as
95
- * `graph.appConfigurationRead`, `nodeAddresses(graph)` and `secretsKeys(graph)`, so a caller with
96
- * its own copy of Composer's core can pass them. The exception is `knownSecrets`, a
97
- * `KnownSecrets`, which such a caller builds from the testing entry.
85
+ * First process: the app configuration file and the environment the second process starts with (ADR-0062).
86
+ * Refuses a file that would hold any of `knownSecrets`.
98
87
  */
99
88
  function prepareSecondProcess(input) {
100
- const { file, appSecrets } = input;
101
- refuseSecretsIn(input.appConfigurationRead, input.knownSecrets);
89
+ const { file } = input;
90
+ refuseSecretsInRootInput(input.appConfigurationRead, input.knownSecrets, "Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.");
91
+ refuseSecretsInPlainVariables(input.plainVariableText, input.knownSecrets, "Composer hands the second process every plain value in a file, and never writes a secret to a file.");
102
92
  const contents = {
103
93
  appConfigurationRead: input.appConfigurationRead,
94
+ plainVariableText: input.plainVariableText,
104
95
  nodeAddresses: input.nodeAddresses
105
96
  };
106
97
  const env = { [APP_CONFIGURATION_FILE_ENV]: file };
107
- if (appSecrets !== void 0) {
108
- const named = {};
109
- for (const key of input.secretsKeys) {
110
- const text = appSecrets[key];
111
- if (text !== void 0 && text !== "") named[key] = text;
112
- }
113
- env[NAMED_SECRETS_ENV] = JSON.stringify(named);
114
- }
115
98
  const remove = () => {
116
99
  try {
117
100
  fs$1.rmSync(file, { force: true });
@@ -135,7 +118,7 @@ function prepareSecondProcess(input) {
135
118
  };
136
119
  }
137
120
  function missingVariable(name, what) {
138
- return `${name} is not set. This stack file runs as the second process of a Composer deploy, destroy or prisma dev, which ${what}.`;
121
+ return `${name} is not set. This stack file runs as the second process of a Composer destroy, which ${what}.`;
139
122
  }
140
123
  function isRecord(value) {
141
124
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -175,7 +158,7 @@ function readAppConfigurationFile(env) {
175
158
  const message = cause instanceof Error ? cause.message : String(cause);
176
159
  throw new Error(`Could not read the app configuration file ${file}: ${message}. Composer deletes it when the run ends, so a stack file run by hand after that cannot read it; run the command again.`, { cause });
177
160
  }
178
- const notComposers = (what) => /* @__PURE__ */ new Error(`The app configuration file ${file} is not one Composer wrote: ${what}.`);
161
+ const notComposers = (what) => /* @__PURE__ */ new Error(`The app configuration file ${file} is not in the shape this version of Composer reads: ${what}. The usual cause is a \`prisma\` CLI and an app on different Composer versions. Put the \`prisma\` CLI and the app's \`@prisma/composer\` on the same version.`);
179
162
  let parsed;
180
163
  try {
181
164
  parsed = JSON.parse(text);
@@ -187,35 +170,17 @@ function readAppConfigurationFile(env) {
187
170
  if (!isRecord(read)) throw notComposers("appConfigurationRead is not an object");
188
171
  const rootInput = rootFieldsOf(read["rootInput"]);
189
172
  if (rootInput === void 0) throw notComposers("rootInput is not a list of fields");
190
- const configurationKeyText = textByKeyOf(read["configurationKeyText"]);
191
- if (configurationKeyText === void 0) throw notComposers("configurationKeyText is not an object of text");
173
+ const plainVariableText = textByKeyOf(parsed["plainVariableText"]);
174
+ if (plainVariableText === void 0) throw notComposers("plainVariableText is not an object of text");
192
175
  const addresses = parsed["nodeAddresses"];
193
176
  if (!isTextList(addresses)) throw notComposers("nodeAddresses is not a list of node addresses");
194
177
  return {
195
- appConfigurationRead: {
196
- rootInput,
197
- configurationKeyText
198
- },
178
+ appConfigurationRead: { rootInput },
179
+ plainVariableText,
199
180
  nodeAddresses: addresses
200
181
  };
201
182
  }
202
- /** Second process, under `prisma dev`: the named secrets the first process handed it. */
203
- function namedSecretsFromEnvironment(env) {
204
- const text = env[NAMED_SECRETS_ENV];
205
- if (text === void 0 || text === "") throw new Error(missingVariable(NAMED_SECRETS_ENV, "hands the secrets the local services need there"));
206
- let parsed;
207
- try {
208
- parsed = JSON.parse(text);
209
- } catch {
210
- parsed = void 0;
211
- }
212
- const byKey = textByKeyOf(parsed);
213
- if (byKey === void 0) throw new Error(`${NAMED_SECRETS_ENV} is not a JSON object of text.`);
214
- const secrets = Object.create(null);
215
- Object.assign(secrets, byKey);
216
- return Object.freeze(secrets);
217
- }
218
183
  //#endregion
219
- export { readAppConfigurationFile as a, prepareSecondProcess as i, devAppConfigurationFile as n, removeLeftoverAppConfigurationFiles as o, namedSecretsFromEnvironment as r, deployAppConfigurationFile as t };
184
+ export { refuseSecretsInRootInput as a, refuseSecretsInPlainVariables as i, prepareSecondProcess as n, removeLeftoverAppConfigurationFiles as o, readAppConfigurationFile as r, deployAppConfigurationFile as t };
220
185
 
221
- //# sourceMappingURL=app-configuration-file-CeJvBAti-D3uDlheX.mjs.map
186
+ //# sourceMappingURL=app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-configuration-file-D0rB5g65-CdMrjkCc.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/app-configuration-file-D0rB5g65.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { DEV_DIR } from \"@internal/core/config\";\n//#region src/secret-as-plain-value.ts\nfunction textIn(value, at) {\n\tif (typeof value === \"string\") return [{\n\t\tat,\n\t\ttext: value\n\t}];\n\tif (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\") return [{\n\t\tat,\n\t\ttext: String(value)\n\t}];\n\tif (Array.isArray(value)) return value.flatMap((member, index) => textIn(member, [...at, String(index)]));\n\tif (typeof value === \"object\" && value !== null) return Object.entries(value).flatMap(([key, member]) => textIn(member, [...at, key]));\n\treturn [];\n}\n/** Throws `CONFIG.SECRET_AS_PLAIN_VALUE` when a root input field Load read holds a known secret. */\nfunction refuseSecretsInRootInput(read, knownSecrets, consequence) {\n\tconst readPlaces = read.rootInput.flatMap((field) => textIn(field.value, field.path).map(({ at, text }) => ({\n\t\twhere: `Root input field input.${at.join(\".\")}`,\n\t\ttext\n\t})));\n\tfor (const { where, text } of readPlaces) {\n\t\tconst name = knownSecrets.nameIn(text);\n\t\tif (name === void 0) continue;\n\t\tthrow new CliStructuredError(\"CONFIG.SECRET_AS_PLAIN_VALUE\", `${where} holds the value of the platform secret \"${name}\". ${consequence}`, { fix: `Pass the value of the platform secret \"${name}\" to where this value is used, or give this plain value text that does not contain the value of \"${name}\".` });\n\t}\n}\n/** Throws `CONFIG.SECRET_AS_PLAIN_VALUE` when a plain platform variable's text holds a known secret. */\nfunction refuseSecretsInPlainVariables(plainVariableText, knownSecrets, consequence) {\n\tfor (const [variable, text] of Object.entries(plainVariableText)) {\n\t\tconst name = knownSecrets.nameIn(text);\n\t\tif (name === void 0) continue;\n\t\tthrow new CliStructuredError(\"CONFIG.SECRET_AS_PLAIN_VALUE\", `The platform variable \"${variable}\", which prisma dev read from the \\`config\\` adapters, holds the value of the platform secret \"${name}\". ${consequence}`, { fix: `Keep the value of \"${name}\" out of the platform variable \"${variable}\", or give \"${variable}\" a different value.` });\n\t}\n}\n//#endregion\n//#region src/app-configuration-file.ts\n/** Names the app configuration file the first process wrote for this run (ADR-0062). */\nconst APP_CONFIGURATION_FILE_ENV = \"PRISMA_COMPOSER_APP_CONFIGURATION_FILE\";\nconst FILE_NAME = /^app-configuration-(\\d+)(-[^/]*)?\\.json$/;\n/** The app configuration file a destroy run writes: unique per run, so concurrent runs from one checkout never share one. */\nfunction deployAppConfigurationFile(cwd, runId) {\n\treturn path.join(cwd, \".prisma-composer\", `app-configuration-${String(process.pid)}-${runId}.json`);\n}\nfunction isRunning(pid) {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (error) {\n\t\treturn error instanceof Error && \"code\" in error && error.code === \"EPERM\";\n\t}\n}\n/**\n* Deletes the app configuration files that earlier runs left in `.prisma-composer/` and in\n* each dev environment's folder: a run killed before its exit handler ran leaves its file. A\n* file is deleted only when its process is not running and it is older than\n* `LEFTOVER_APP_CONFIGURATION_FILE_AGE_MS`. Never throws.\n*/\nfunction removeLeftoverAppConfigurationFiles(cwd) {\n\tconst devRoot = path.join(cwd, DEV_DIR);\n\tconst dirs = [path.join(cwd, \".prisma-composer\")];\n\ttry {\n\t\tfor (const entry of fs.readdirSync(devRoot, { withFileTypes: true })) if (entry.isDirectory()) dirs.push(path.join(devRoot, entry.name));\n\t} catch {}\n\tfor (const dir of dirs) {\n\t\tlet names;\n\t\ttry {\n\t\t\tnames = fs.readdirSync(dir);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const name of names) {\n\t\t\tconst pid = Number(FILE_NAME.exec(name)?.[1]);\n\t\t\tif (Number.isNaN(pid) || pid === process.pid || isRunning(pid)) continue;\n\t\t\tconst file = path.join(dir, name);\n\t\t\ttry {\n\t\t\t\tif (Date.now() - fs.statSync(file).mtimeMs < 6e5) continue;\n\t\t\t\tfs.rmSync(file, { force: true });\n\t\t\t} catch {}\n\t\t}\n\t}\n}\n/**\n* First process: the app configuration file and the environment the second process starts with (ADR-0062).\n* Refuses a file that would hold any of `knownSecrets`.\n*/\nfunction prepareSecondProcess(input) {\n\tconst { file } = input;\n\trefuseSecretsInRootInput(input.appConfigurationRead, input.knownSecrets, \"Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.\");\n\trefuseSecretsInPlainVariables(input.plainVariableText, input.knownSecrets, \"Composer hands the second process every plain value in a file, and never writes a secret to a file.\");\n\tconst contents = {\n\t\tappConfigurationRead: input.appConfigurationRead,\n\t\tplainVariableText: input.plainVariableText,\n\t\tnodeAddresses: input.nodeAddresses\n\t};\n\tconst env = { [APP_CONFIGURATION_FILE_ENV]: file };\n\tconst remove = () => {\n\t\ttry {\n\t\t\tfs.rmSync(file, { force: true });\n\t\t} catch {}\n\t};\n\treturn {\n\t\tenv,\n\t\twriteFile() {\n\t\t\tfs.rmSync(file, { force: true });\n\t\t\tfs.writeFileSync(file, JSON.stringify(contents), {\n\t\t\t\tmode: 384,\n\t\t\t\tflag: \"wx\"\n\t\t\t});\n\t\t\tprocess.off(\"exit\", remove);\n\t\t\tprocess.on(\"exit\", remove);\n\t\t},\n\t\tremoveFile() {\n\t\t\tprocess.off(\"exit\", remove);\n\t\t\tremove();\n\t\t}\n\t};\n}\nfunction missingVariable(name, what) {\n\treturn `${name} is not set. This stack file runs as the second process of a Composer destroy, which ${what}.`;\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isTextList(value) {\n\treturn Array.isArray(value) && value.every((member) => typeof member === \"string\");\n}\nfunction rootFieldsOf(value) {\n\tif (!Array.isArray(value)) return void 0;\n\tconst fields = [];\n\tfor (const member of value) {\n\t\tif (!isRecord(member) || !isTextList(member[\"path\"])) return void 0;\n\t\tfields.push(\"value\" in member ? {\n\t\t\tpath: member[\"path\"],\n\t\t\tvalue: member[\"value\"]\n\t\t} : { path: member[\"path\"] });\n\t}\n\treturn fields;\n}\nfunction textByKeyOf(value) {\n\tif (!isRecord(value)) return void 0;\n\tconst byKey = {};\n\tfor (const [key, member] of Object.entries(value)) {\n\t\tif (typeof member !== \"string\") return void 0;\n\t\tbyKey[key] = member;\n\t}\n\treturn byKey;\n}\n/** Second process: the app configuration file the first process named in its environment. */\nfunction readAppConfigurationFile(env) {\n\tconst file = env[APP_CONFIGURATION_FILE_ENV];\n\tif (file === void 0 || file === \"\") throw new Error(missingVariable(APP_CONFIGURATION_FILE_ENV, \"names the app configuration file it wrote there\"));\n\tlet text;\n\ttry {\n\t\ttext = fs.readFileSync(file, \"utf8\");\n\t} catch (cause) {\n\t\tconst message = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow new Error(`Could not read the app configuration file ${file}: ${message}. Composer deletes it when the run ends, so a stack file run by hand after that cannot read it; run the command again.`, { cause });\n\t}\n\tconst notComposers = (what) => /* @__PURE__ */ new Error(`The app configuration file ${file} is not in the shape this version of Composer reads: ${what}. The usual cause is a \\`prisma\\` CLI and an app on different Composer versions. Put the \\`prisma\\` CLI and the app's \\`@prisma/composer\\` on the same version.`);\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch {\n\t\tthrow notComposers(\"it is not JSON\");\n\t}\n\tif (!isRecord(parsed)) throw notComposers(\"it is not JSON\");\n\tconst read = parsed[\"appConfigurationRead\"];\n\tif (!isRecord(read)) throw notComposers(\"appConfigurationRead is not an object\");\n\tconst rootInput = rootFieldsOf(read[\"rootInput\"]);\n\tif (rootInput === void 0) throw notComposers(\"rootInput is not a list of fields\");\n\tconst plainVariableText = textByKeyOf(parsed[\"plainVariableText\"]);\n\tif (plainVariableText === void 0) throw notComposers(\"plainVariableText is not an object of text\");\n\tconst addresses = parsed[\"nodeAddresses\"];\n\tif (!isTextList(addresses)) throw notComposers(\"nodeAddresses is not a list of node addresses\");\n\treturn {\n\t\tappConfigurationRead: { rootInput },\n\t\tplainVariableText,\n\t\tnodeAddresses: addresses\n\t};\n}\n//#endregion\nexport { refuseSecretsInPlainVariables as a, removeLeftoverAppConfigurationFiles as i, prepareSecondProcess as n, refuseSecretsInRootInput as o, readAppConfigurationFile as r, deployAppConfigurationFile as t };\n\n//# sourceMappingURL=app-configuration-file-D0rB5g65.mjs.map"],"mappings":";;;;;AAKA,SAAS,OAAO,OAAO,IAAI;CAC1B,IAAI,OAAO,UAAU,UAAU,OAAO,CAAC;EACtC;EACA,MAAM;CACP,CAAC;CACD,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,aAAa,OAAO,UAAU,UAAU,OAAO,CAAC;EACjG;EACA,MAAM,OAAO,KAAK;CACnB,CAAC;CACD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,SAAS,QAAQ,UAAU,OAAO,QAAQ,CAAC,GAAG,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC;CACxG,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,YAAY,OAAO,QAAQ,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;CACrI,OAAO,CAAC;AACT;;AAEA,SAAS,yBAAyB,MAAM,cAAc,aAAa;CAClE,MAAM,aAAa,KAAK,UAAU,SAAS,UAAU,OAAO,MAAM,OAAO,MAAM,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,YAAY;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