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

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 (102) hide show
  1. package/dist/{app-config-UeKFBma7-CohaMmWp.d.mts → app-config-CxdIiCvU-7vQWECm1.d.mts} +23 -21
  2. package/dist/app-config-CxdIiCvU-7vQWECm1.d.mts.map +1 -0
  3. package/dist/{app-configuration-file-CeJvBAti-D3uDlheX.mjs → app-configuration-file-Cw9autUL-DebaEvDz.mjs} +20 -25
  4. package/dist/app-configuration-file-Cw9autUL-DebaEvDz.mjs.map +1 -0
  5. package/dist/arktype.d.mts +1 -1
  6. package/dist/arktype.mjs +1 -1
  7. package/dist/arktype.mjs.map +1 -1
  8. package/dist/config-BcT6edff.d.mts +1 -0
  9. package/dist/config.d.mts +3 -3
  10. package/dist/config.mjs +1 -1
  11. package/dist/control.d.mts +7 -7
  12. package/dist/control.d.mts.map +1 -1
  13. package/dist/control.mjs +3 -3
  14. package/dist/control.mjs.map +1 -1
  15. package/dist/{deploy-3EXLVrtG.mjs → deploy-BzRRAmns.mjs} +8 -25
  16. package/dist/deploy-BzRRAmns.mjs.map +1 -0
  17. package/dist/deploy-D7NHGXag.d.mts +2 -0
  18. package/dist/deploy.d.mts +3 -3
  19. package/dist/deploy.mjs +2 -2
  20. package/dist/{deployment-summary-D74WrJX7-DQ3LDUuO.mjs → deployment-summary-B6rYxEZe-E4IIcngK.mjs} +3 -3
  21. package/dist/{deployment-summary-D74WrJX7-DQ3LDUuO.mjs.map → deployment-summary-B6rYxEZe-E4IIcngK.mjs.map} +1 -1
  22. package/dist/{deployment-summary-p88NV5m5-SgniM8TX.d.mts → deployment-summary-p88NV5m5-3Ga91LRH.d.mts} +3 -3
  23. package/dist/{deployment-summary-p88NV5m5-SgniM8TX.d.mts.map → deployment-summary-p88NV5m5-3Ga91LRH.d.mts.map} +1 -1
  24. package/dist/{describe-kind-Cpm_euxo-CkhlGJUL.mjs → describe-kind-Cpm_euxo-D9WDxl5C.mjs} +3 -3
  25. package/dist/describe-kind-Cpm_euxo-D9WDxl5C.mjs.map +1 -0
  26. package/dist/{dev-current-wD5YDLjA-CzyFYXni.mjs → dev-current-D8GwJQex-C8F3EUBY.mjs} +5 -5
  27. package/dist/{dev-current-wD5YDLjA-CzyFYXni.mjs.map → dev-current-D8GwJQex-C8F3EUBY.mjs.map} +1 -1
  28. package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs → dev-environment-name-6eEr5PW8-6sPgQZG3.mjs} +2 -2
  29. package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map → dev-environment-name-6eEr5PW8-6sPgQZG3.mjs.map} +1 -1
  30. package/dist/{dist-ynqBR6y8.mjs → dist-BN9EXWWX.mjs} +4 -26
  31. package/dist/dist-BN9EXWWX.mjs.map +1 -0
  32. package/dist/errors-0e8IVwzi.mjs.map +1 -1
  33. package/dist/{execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs → execute-deploy-destroy-1SIH5uAu-DVRY18xU.mjs} +12 -11
  34. package/dist/{execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs.map → execute-deploy-destroy-1SIH5uAu-DVRY18xU.mjs.map} +1 -1
  35. package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs → execute-dev-current-DsAsDBB1-DwfOidWf.mjs} +6 -6
  36. package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs.map → execute-dev-current-DsAsDBB1-DwfOidWf.mjs.map} +1 -1
  37. package/dist/{execute-dev-BIyOI3Ys-BbDOLlV4.mjs → execute-dev-xPaS5SAl-BUeHjmYV.mjs} +81 -19
  38. package/dist/execute-dev-xPaS5SAl-BUeHjmYV.mjs.map +1 -0
  39. package/dist/{execute-log-BDdHor71-B2p8Zae2.mjs → execute-log-Be9DYRI6-WnytA3d7.mjs} +6 -6
  40. package/dist/{execute-log-BDdHor71-B2p8Zae2.mjs.map → execute-log-Be9DYRI6-WnytA3d7.mjs.map} +1 -1
  41. package/dist/{graph-C7mdtisq-RnKiwVsx.d.mts → graph-DU0omY5O-BHO71z0F.d.mts} +3 -3
  42. package/dist/graph-DU0omY5O-BHO71z0F.d.mts.map +1 -0
  43. package/dist/{graph-BzPLUUsB-D7EnB1F5.mjs → graph-K7VOpCAj-D6UHSltu.mjs} +135 -101
  44. package/dist/graph-K7VOpCAj-D6UHSltu.mjs.map +1 -0
  45. package/dist/{graph-types-s5V7pGj2-BxSqB1ZH.d.mts → graph-types-Bzj1fahC-C8rOVj0c.d.mts} +90 -89
  46. package/dist/graph-types-Bzj1fahC-C8rOVj0c.d.mts.map +1 -0
  47. package/dist/http.d.mts +2 -2
  48. package/dist/http.mjs +2 -2
  49. package/dist/{index-DyuwxTtd.d.mts → index-B8s0bLZY.d.mts} +3 -3
  50. package/dist/{index-DyuwxTtd.d.mts.map → index-B8s0bLZY.d.mts.map} +1 -1
  51. package/dist/index.d.mts +5 -5
  52. package/dist/index.mjs +4 -4
  53. package/dist/internal-app-configuration-file.d.mts +8 -7
  54. package/dist/internal-app-configuration-file.d.mts.map +1 -1
  55. package/dist/internal-app-configuration-file.mjs +1 -1
  56. package/dist/{local-target-Dd8FJEb5.mjs → local-target-COdS1iNs.mjs} +3 -3
  57. package/dist/{local-target-Dd8FJEb5.mjs.map → local-target-COdS1iNs.mjs.map} +1 -1
  58. package/dist/local-target.d.mts +3 -3
  59. package/dist/local-target.d.mts.map +1 -1
  60. package/dist/local-target.mjs +1 -1
  61. package/dist/{nextjs-DLyeRR7M-0lw_cBIr.d.mts → nextjs-DLyeRR7M-Z_xX74Cp.d.mts} +3 -3
  62. package/dist/{nextjs-DLyeRR7M-0lw_cBIr.d.mts.map → nextjs-DLyeRR7M-Z_xX74Cp.d.mts.map} +1 -1
  63. package/dist/nextjs-control.d.mts +4 -4
  64. package/dist/nextjs.d.mts +1 -1
  65. package/dist/node-control.d.mts +3 -3
  66. package/dist/node.d.mts +2 -2
  67. package/dist/{pointer-CyQZZugO-D7k3vibs.d.mts → pointer-DclJZFQi-DJa4t8Wa.d.mts} +3 -3
  68. package/dist/{pointer-CyQZZugO-D7k3vibs.d.mts.map → pointer-DclJZFQi-DJa4t8Wa.d.mts.map} +1 -1
  69. package/dist/{preflight-transport-DmmtoFPH-CnDWufmu.mjs → preflight-transport-DJjTWvyH-CEJ9WlaN.mjs} +4 -6
  70. package/dist/preflight-transport-DJjTWvyH-CEJ9WlaN.mjs.map +1 -0
  71. package/dist/{redaction-DXung4ip-bBoNomi3.mjs → redaction-C-NnlVUh-B1nJc6rb.mjs} +3 -9
  72. package/dist/redaction-C-NnlVUh-B1nJc6rb.mjs.map +1 -0
  73. package/dist/{redaction-Bf8FvTFH-D_HvoMrf.d.mts → redaction-CqdeMBKw-BECjU4HR.d.mts} +15 -8
  74. package/dist/{redaction-Bf8FvTFH-D_HvoMrf.d.mts.map → redaction-CqdeMBKw-BECjU4HR.d.mts.map} +1 -1
  75. package/dist/report.d.mts +3 -3
  76. package/dist/report.mjs +2 -2
  77. package/dist/report.mjs.map +1 -1
  78. package/dist/{run-alchemy-CRLAyOtt-CBUV28We.mjs → run-alchemy-CyciV8i0-BxPAyrch.mjs} +3 -3
  79. package/dist/{run-alchemy-CRLAyOtt-CBUV28We.mjs.map → run-alchemy-CyciV8i0-BxPAyrch.mjs.map} +1 -1
  80. package/dist/service-rpc.d.mts +2 -2
  81. package/dist/service-rpc.mjs +2 -2
  82. package/dist/testing.d.mts +1 -1
  83. package/dist/{validate-environment-D1BTCkTs-BQprjyNP.mjs → validate-environment-DyW59rJ7-u8hQkzuY.mjs} +7 -7
  84. package/dist/{validate-environment-D1BTCkTs-BQprjyNP.mjs.map → validate-environment-DyW59rJ7-u8hQkzuY.mjs.map} +1 -1
  85. package/dist/zod.d.mts +1 -1
  86. package/dist/zod.mjs +1 -1
  87. package/dist/zod.mjs.map +1 -1
  88. package/package.json +11 -11
  89. package/skills/prisma-composer-core-concepts/SKILL.md +32 -40
  90. package/dist/app-config-UeKFBma7-CohaMmWp.d.mts.map +0 -1
  91. package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +0 -1
  92. package/dist/config-BeZEgGCg.d.mts +0 -1
  93. package/dist/deploy-3EXLVrtG.mjs.map +0 -1
  94. package/dist/deploy-Xi4_JrtE.d.mts +0 -2
  95. package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +0 -1
  96. package/dist/dist-ynqBR6y8.mjs.map +0 -1
  97. package/dist/execute-dev-BIyOI3Ys-BbDOLlV4.mjs.map +0 -1
  98. package/dist/graph-BzPLUUsB-D7EnB1F5.mjs.map +0 -1
  99. package/dist/graph-C7mdtisq-RnKiwVsx.d.mts.map +0 -1
  100. package/dist/graph-types-s5V7pGj2-BxSqB1ZH.d.mts.map +0 -1
  101. package/dist/preflight-transport-DmmtoFPH-CnDWufmu.mjs.map +0 -1
  102. package/dist/redaction-DXung4ip-bBoNomi3.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
2
- import { i as POINTER, o as isSecretPointer, r as isSecretString, t as describeKind } from "./describe-kind-Cpm_euxo-CkhlGJUL.mjs";
2
+ import { i as POINTER, o as isSecretPointer, r as isSecretString, t as describeKind } from "./describe-kind-Cpm_euxo-D9WDxl5C.mjs";
3
3
  import { t as InternalError } from "./internal-error-Dfur7Zqt-D96dWHZK.mjs";
4
4
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
5
- //#region ../../0-framework/1-core/core/dist/graph-BzPLUUsB.mjs
5
+ //#region ../../0-framework/1-core/core/dist/graph-K7VOpCAj.mjs
6
6
  /** The reserved name of a resource's single anonymous output port. Rejected as a user-declared port name (node.ts). */
7
7
  const RESOURCE_OUT_PORT = "$out";
8
8
  /**
@@ -29,6 +29,7 @@ function contractStyleOf(contract) {
29
29
  }
30
30
  const VALUE = blindCast(Symbol.for("prisma:value"));
31
31
  const VALUE_ORIGIN = blindCast(Symbol.for("prisma:value-origin"));
32
+ const VALUE_RESOURCE = blindCast(Symbol.for("prisma:value-resource"));
32
33
  /**
33
34
  * A value computed from other values. `fn` receives the dependencies' real
34
35
  * values as one tuple, in order, and returns plain data. Each dependency must
@@ -176,19 +177,20 @@ function buildModuleInput(moduleAddress) {
176
177
  */
177
178
  const NODE = Symbol.for("prisma:node");
178
179
  const SECRET_SOURCE = blindCast(Symbol.for("prisma:secret-source"));
179
- /** Builds a secret source from a target-defined payload: the SPI a deploy target's own constructor (e.g. `envSecret`) calls. The source is a value whose real value at deploy is itself, a pointer. Core forwards it and never inspects the payload. */
180
+ /** Builds a secret source from a target-defined payload: the SPI a deploy target's own constructor calls. The source is a value whose real value at deploy is itself, a pointer. Core forwards it and never inspects the payload. */
180
181
  function secretSource(payload, options) {
181
- const label = sourceLabel("secretSource", options?.label, "a secret source");
182
+ const label = sourceLabel("secretSource", options?.label);
182
183
  const secretsKey = options?.secretsKey;
183
184
  if (secretsKey !== void 0 && (typeof secretsKey !== "string" || secretsKey.length === 0)) throw new Error("secretSource() secretsKey must be a non-empty string.");
184
185
  return blindCast(buildSource(SECRET_SOURCE, payload, {
185
186
  kind: "source",
186
187
  sourceKind: "secret",
187
188
  label,
188
- secretsKey
189
+ secretsKey,
190
+ resource: void 0
189
191
  }, "secret"));
190
192
  }
191
- /** True if `value` is a secret source, such as an `envSecret()` result. */
193
+ /** True if `value` is a secret source. */
192
194
  function isSecretSource(value) {
193
195
  return typeof value === "object" && value !== null && blindCast(value)[SECRET_SOURCE] === true;
194
196
  }
@@ -206,35 +208,35 @@ function isProvisionNeed(value) {
206
208
  return typeof value === "object" && value !== null && blindCast(value)[PROVISION_NEED] === true;
207
209
  }
208
210
  const PARAM_SOURCE = blindCast(Symbol.for("prisma:param-source"));
209
- /** Builds a param source from a target-defined payload: the SPI a deploy target's own constructor (e.g. `envParam`) calls. Core forwards it and never inspects the payload. */
211
+ /** Builds a param source from a target-defined payload: the SPI a deploy target's own constructor calls. Core forwards it and never inspects the payload. */
210
212
  function paramSource(payload, options) {
211
- const label = sourceLabel("paramSource", options?.label, "a param source");
212
- const configurationKey = options?.configurationKey;
213
- if (configurationKey !== void 0 && (typeof configurationKey !== "string" || configurationKey.length === 0)) throw new Error("paramSource() configurationKey must be a non-empty string.");
213
+ const label = sourceLabel("paramSource", options?.label);
214
214
  const redacted = options?.redacted === true;
215
- if (configurationKey !== void 0 && redacted) throw new Error("paramSource() takes configurationKey, for a value known at deploy, or redacted, for a secret known only at boot, not both.");
216
215
  return blindCast(buildSource(PARAM_SOURCE, payload, {
217
216
  kind: "source",
218
217
  sourceKind: "param",
219
218
  label,
220
- configurationKey
221
- }, configurationKey !== void 0 ? void 0 : redacted ? "secret" : "plain"));
219
+ resource: void 0
220
+ }, redacted ? "secret" : "plain"));
222
221
  }
223
- function sourceLabel(factory, label, fallback) {
224
- if (label === void 0) return fallback;
222
+ function sourceLabel(factory, label) {
223
+ if (label === void 0) return "a source";
225
224
  if (typeof label !== "string" || label.length === 0) throw new Error(`${factory}() label must be a non-empty string.`);
226
225
  return label;
227
226
  }
228
- function buildSource(brand, payload, origin, kind) {
227
+ function buildSource(brand, payload, origin, kind, hidden = {}) {
229
228
  const source = {
230
229
  [VALUE]: true,
231
230
  [VALUE_ORIGIN]: origin,
232
231
  [brand]: true,
233
- ...kind === void 0 ? {} : { [POINTER]: kind },
232
+ [POINTER]: kind,
234
233
  payload
235
234
  };
236
235
  Object.defineProperty(origin, "source", { value: source });
237
- Object.defineProperties(source, coercions(origin));
236
+ Object.defineProperties(source, {
237
+ ...coercions(origin),
238
+ ...hidden
239
+ });
238
240
  Object.freeze(origin);
239
241
  return Object.freeze(source);
240
242
  }
@@ -253,7 +255,7 @@ function coercions(origin) {
253
255
  const sourceMisuses = /* @__PURE__ */ new WeakSet();
254
256
  function sourceMisuse(origin, what) {
255
257
  const { label } = origin;
256
- const error = new LoadError(origin.sourceKind === "secret" || origin.configurationKey === void 0 ? `${label} is known only at boot: the deploy holds a pointer to it, never its value, and ${what}. A module body can only pass it on, into a provision() binding; to compute with the value, do it in the service that reads it.` : `${label} is a value, not its real value, and ${what}. A module body can only pass it on: into a provision() binding or as a resolve() dependency. To compute with it, list it: resolve([${label}], ([v]) => …).`);
258
+ const error = new LoadError(`${label} is known only at boot: the deploy holds a pointer to it, never its value, and ${what}. A module body can only pass it on, into a provision() binding; to compute with the value, do it in the service that reads it.`);
257
259
  sourceMisuses.add(error);
258
260
  return error;
259
261
  }
@@ -267,7 +269,7 @@ function sourceOriginOf(source) {
267
269
  const origin = originOf(source);
268
270
  return origin.kind === "source" ? origin : void 0;
269
271
  }
270
- /** True if `value` is a param source, such as an `envParam()` result. */
272
+ /** True if `value` is a param source. */
271
273
  function isParamSource(value) {
272
274
  return typeof value === "object" && value !== null && blindCast(value)[PARAM_SOURCE] === true;
273
275
  }
@@ -395,6 +397,38 @@ var FrozenResourceNode = class extends ResourceNodeBase {
395
397
  function resource(def) {
396
398
  return new FrozenResourceNode(def);
397
399
  }
400
+ function isSourceValue(value) {
401
+ return (isSecretSource(value) || isParamSource(value)) && sourceOriginOf(value) !== void 0;
402
+ }
403
+ var FrozenValueResourceNode = class extends ResourceNodeBase {
404
+ [VALUE_RESOURCE];
405
+ constructor(def) {
406
+ super(def);
407
+ this[VALUE_RESOURCE] = def.value;
408
+ freezeNode(this);
409
+ }
410
+ };
411
+ /** Builds a frozen resource node that is a value: `value`, a source built with `secretSource()` or `paramSource()`. It provides no contract and has no dependencies. */
412
+ function valueResource(def) {
413
+ if (!isSourceValue(def.value)) throw new Error("valueResource() value must be a source, built with secretSource() or paramSource().");
414
+ return new FrozenValueResourceNode(def);
415
+ }
416
+ function valueResourceOrigin(node) {
417
+ if (!isNode(node) || node.kind !== "resource" || !(VALUE_RESOURCE in node)) return void 0;
418
+ const value = node[VALUE_RESOURCE];
419
+ return isSecretSource(value) || isParamSource(value) ? sourceOriginOf(value) : void 0;
420
+ }
421
+ /** True for a resource node that is a value: one that holds a source under the value resource key. */
422
+ function isValueResource(node) {
423
+ return valueResourceOrigin(node) !== void 0;
424
+ }
425
+ function provisionedValue(origin, address) {
426
+ const { source, ...kept } = origin;
427
+ return blindCast(buildSource(isSecretSource(source) ? SECRET_SOURCE : PARAM_SOURCE, source.payload, {
428
+ ...kept,
429
+ resource: address
430
+ }, isSecretPointer(source) ? "secret" : "plain", { id: { value: address } }));
431
+ }
398
432
  /**
399
433
  * Constructs a branded, frozen Service node — declarations only (inputs,
400
434
  * params, the input schema, build adapter, and the ports it exposes). Pure;
@@ -643,10 +677,8 @@ function loadService(root, rootId) {
643
677
  inputBindings: [],
644
678
  params: [],
645
679
  secretSources: [],
646
- appConfigurationRead: {
647
- rootInput: [],
648
- configurationKeyText: {}
649
- }
680
+ valueReads: [],
681
+ appConfigurationRead: { rootInput: [] }
650
682
  };
651
683
  }
652
684
  function joinPath(path, key) {
@@ -760,7 +792,7 @@ function checkResult(result, fnLabel) {
760
792
  const walk = (value, path) => {
761
793
  const atPath = path === "" ? "" : ` at "${path}"`;
762
794
  if (value === void 0) throw new LoadError(`${fnLabel} returned undefined${atPath}. Return a result for every environment; Composer never picks a default.`);
763
- if (isSecretSource(value) || isParamSource(value)) throw new LoadError(`${fnLabel} returned a source${atPath}, such as envSecret() or envParam() called inside the function. resolve() returns plain data; bind a source directly.`);
795
+ if (isSecretSource(value) || isParamSource(value)) throw new LoadError(`${fnLabel} returned a source${atPath}, a value known only at boot. resolve() returns plain data; bind the source directly.`);
764
796
  if (isValue(value)) throw new LoadError(`${fnLabel} returned a value${atPath}, not a real value. List that value as a dependency; fn receives its real value.`);
765
797
  const notPlain = describeNotPlain(value);
766
798
  if (notPlain !== void 0) throw new LoadError(`${fnLabel} returned ${notPlain}${atPath}. resolve() returns plain data: strings, finite numbers, booleans, null, arrays and plain objects.`);
@@ -790,7 +822,7 @@ function firstPointer(value, path = [], seen = /* @__PURE__ */ new WeakSet()) {
790
822
  function refusePointerDependency(fnLabel, dependency, real) {
791
823
  const found = firstPointer(real);
792
824
  if (found === void 0) return;
793
- const label = sourceOriginOf(found.pointer)?.label ?? "a value known only at boot";
825
+ const label = sourceOriginOf(found.pointer)?.label ?? "a source";
794
826
  const origin = originOf(dependency);
795
827
  if (origin.kind !== "input") throw new LoadError(`${fnLabel} lists ${label}, which is known only at boot. A resolve() dependency must be a deploy-time value. Bind ${label} directly into the input of the service that reads it.`);
796
828
  const listed = `${inputFieldLabel(origin)} of module "${origin.module}"`;
@@ -861,7 +893,7 @@ function refuseSecretBoxes(address, value, path) {
861
893
  address,
862
894
  kind: "moduleInput",
863
895
  path
864
- })} is bound to a SecretString. A secret's value never appears in the code; bind envSecret('NAME'), or pass on an input field typed secretString().`);
896
+ })} is bound to a SecretString. A secret's value never appears in the code; bind a secret source, or pass on an input field typed secretString().`);
865
897
  if (Array.isArray(value)) {
866
898
  for (const [index, member] of value.entries()) refuseSecretBoxes(address, member, joinPath(path, index));
867
899
  return;
@@ -869,10 +901,17 @@ function refuseSecretBoxes(address, value, path) {
869
901
  if (isPlainObject(value)) for (const [key, member] of Object.entries(value)) refuseSecretBoxes(address, member, joinPath(path, key));
870
902
  }
871
903
  /** The original source each runtime value in `value` names, by its path. */
872
- function sourcesByPath(value, path = "", found = /* @__PURE__ */ new Map()) {
873
- if (isSecretSource(value) || isParamSource(value)) found.set(path, sourceOriginOf(value)?.source ?? value);
874
- else if (Array.isArray(value)) for (const [index, member] of value.entries()) sourcesByPath(member, joinPath(path, index), found);
875
- else if (isPlainObject(value)) for (const [key, member] of Object.entries(value)) sourcesByPath(member, joinPath(path, key), found);
904
+ function sourcesByPath(value, path = "", found = /* @__PURE__ */ new Map(), ancestors = /* @__PURE__ */ new Set()) {
905
+ if (isSecretSource(value) || isParamSource(value)) {
906
+ found.set(path, sourceOriginOf(value)?.source ?? value);
907
+ return found;
908
+ }
909
+ if (!Array.isArray(value) && !isPlainObject(value)) return found;
910
+ if (ancestors.has(value)) return found;
911
+ ancestors.add(value);
912
+ const entries = Array.isArray(value) ? value.map((member, index) => [index, member]) : Object.entries(value);
913
+ for (const [key, member] of entries) sourcesByPath(member, joinPath(path, key), found, ancestors);
914
+ ancestors.delete(value);
876
915
  return found;
877
916
  }
878
917
  function validateModuleInput(entry, resolved, environment) {
@@ -905,11 +944,18 @@ function validateModuleInput(entry, resolved, environment) {
905
944
  };
906
945
  return restore(result.value, "");
907
946
  }
947
+ function refuseSourcesInParams(params) {
948
+ for (const { serviceAddress, slot, binding } of params) {
949
+ const [source] = pointersIn(binding);
950
+ if (source === void 0) continue;
951
+ throw new LoadError(`Service "${serviceAddress}" binds its param "${slot}" to ${sourceOriginOf(source)?.label ?? "a source"}, a value known only at boot. A param takes a literal or a value the deploy has. Bind the value to a field of the service's input instead.`);
952
+ }
953
+ }
908
954
  function refusePointersInProps(address, props) {
909
955
  const seen = /* @__PURE__ */ new WeakSet();
910
956
  const walk = (value, path) => {
911
957
  if (isSecretSource(value) || isParamSource(value)) {
912
- const label = sourceOriginOf(value)?.label ?? (isSecretSource(value) ? "a secret source" : "a param source");
958
+ const label = sourceOriginOf(value)?.label ?? "a source";
913
959
  throw new LoadError(`${describeSite({
914
960
  address,
915
961
  kind: "props",
@@ -931,22 +977,12 @@ function refusePointersInProps(address, props) {
931
977
  function resolveValues(input) {
932
978
  const { environment } = input;
933
979
  const rootFields = /* @__PURE__ */ new Map();
934
- const keysRead = /* @__PURE__ */ new Map();
935
- /** The text the app configuration holds for `key`, recorded; `undefined` when it holds none or `''`. */
936
- const configurationText = (key, label, site) => {
937
- let raw;
938
- if (input.appConfigurationRead !== void 0) raw = input.appConfigurationRead.configurationKeyText[key];
939
- else if (input.configuration !== void 0) raw = input.configuration[key];
940
- else throw new LoadError(`${describeSite(site)} depends on ${label}, but Load was given no app configuration to read "${key}" from. Pass { configuration } to Load; the deploy and dev commands pass the values the \`config\` adapters return.`);
941
- if (raw !== void 0 && raw !== "" && typeof raw !== "string") throw new LoadError(`${describeSite(site)} depends on ${label}, which reads "${key}" from the values the \`config\` adapters return, but they return ${describeKind(raw)} for it, not text. ${label} reads text; to pass other data, declare it in the root module's input.`);
942
- const text = raw === void 0 || raw === "" ? void 0 : raw;
943
- keysRead.set(key, {
944
- label,
945
- text
946
- });
947
- return text;
948
- };
949
980
  const secretUses = /* @__PURE__ */ new Map();
981
+ for (const [address, value] of input.valueResources) if (isSecretSource(value)) secretUses.set(value, {
982
+ source: value,
983
+ address,
984
+ nodeKind: "resource"
985
+ });
950
986
  const recordSecret = (source, site) => {
951
987
  const canonical = canonicalSecret(source);
952
988
  if (secretUses.has(canonical)) return;
@@ -956,8 +992,8 @@ function resolveValues(input) {
956
992
  nodeKind: nodeKindOf(site)
957
993
  });
958
994
  };
959
- const secretSourcesReceivedBy = (inputBindings, params) => {
960
- for (const { serviceAddress, binding } of [...inputBindings, ...params]) for (const pointer of pointersIn(binding)) {
995
+ const secretSourcesReceivedBy = (inputBindings) => {
996
+ for (const { serviceAddress, binding } of inputBindings) for (const pointer of pointersIn(binding)) {
961
997
  if (!isSecretSource(pointer)) continue;
962
998
  const canonical = canonicalSecret(pointer);
963
999
  if (secretUses.get(canonical)?.nodeKind === "service") continue;
@@ -1007,14 +1043,11 @@ function resolveValues(input) {
1007
1043
  break;
1008
1044
  case "source":
1009
1045
  if (isSecretSource(origin.source)) recordSecret(origin.source, site);
1010
- if (origin.sourceKind === "secret" || origin.configurationKey === void 0) result = origin.source;
1011
- else result = configurationText(origin.configurationKey, origin.label, site);
1046
+ result = origin.source;
1012
1047
  break;
1013
1048
  case "computed": {
1014
1049
  const args = origin.dependencies.map((dependency) => {
1015
1050
  const real = resolveOne(dependency, site);
1016
- const source = originOf(dependency);
1017
- if (real === void 0 && source.kind === "source" && source.sourceKind === "param") throw new LoadError(`${fnLabelFor(site)} lists ${source.label}, but "${source.configurationKey}" is unset or empty, so it has no real value. Set "${source.configurationKey}", or bind ${source.label} directly into an input binding, where an absent value leaves the key out and the schema decides.`);
1018
1051
  refusePointerDependency(fnLabelFor(site), dependency, real);
1019
1052
  return real;
1020
1053
  });
@@ -1072,35 +1105,11 @@ function resolveValues(input) {
1072
1105
  return validated;
1073
1106
  };
1074
1107
  const rootModuleAddress = () => input.moduleInputs.find((entry) => entry.isLoadRoot)?.moduleAddress ?? "";
1075
- const appConfigurationReadOf = (inputBindings, params, secretSources) => {
1076
- if (input.configuration !== void 0 || input.appConfigurationRead !== void 0) {
1077
- const kept = [...inputBindings.map(({ serviceAddress, binding }) => ({
1078
- binding,
1079
- site: {
1080
- address: serviceAddress,
1081
- kind: "serviceInput",
1082
- path: ""
1083
- }
1084
- })), ...params.map(({ serviceAddress, slot, binding }) => ({
1085
- binding,
1086
- site: {
1087
- address: serviceAddress,
1088
- kind: "param",
1089
- path: slot
1090
- }
1091
- }))];
1092
- for (const { binding, site } of kept) for (const pointer of pointersIn(binding)) {
1093
- if (!isParamSource(pointer)) continue;
1094
- const origin = sourceOriginOf(pointer);
1095
- if (origin?.sourceKind === "param" && origin.configurationKey !== void 0) configurationText(origin.configurationKey, origin.label, site);
1096
- }
1097
- }
1108
+ const appConfigurationReadOf = (secretSources) => {
1098
1109
  for (const use of secretSources) {
1099
1110
  const origin = sourceOriginOf(use.source);
1100
1111
  if (origin?.sourceKind !== "secret") continue;
1101
1112
  const key = origin.secretsKey;
1102
- const read = key === void 0 ? void 0 : keysRead.get(key);
1103
- if (key !== void 0 && read !== void 0) throw new LoadError(`${read.label} reads "${key}" from the app configuration, and ${origin.label} names "${key}" as a secret. A name is a plain value or a secret, not both: Composer hands the deploy's second process every plain value it reads, in a file, and never writes a secret to a file. Give the plain value and the secret different names.`);
1104
1113
  const field = [...rootFields.values()].find((candidate) => candidate.path[0] === key);
1105
1114
  if (key !== void 0 && field !== void 0) throw new LoadError(`${inputFieldLabel({
1106
1115
  kind: "input",
@@ -1116,25 +1125,21 @@ function resolveValues(input) {
1116
1125
  path: field.path
1117
1126
  })} of root module "${rootModuleAddress()}" holds ${kind}, which JSON cannot hold exactly. The deploy hands the root's input to its second process in a JSON file, so a field the root's body passes on must hold text, a finite number, a boolean, null, or arrays and plain objects of these.`);
1118
1127
  }
1119
- const configurationKeyText = {};
1120
- for (const [key, { text }] of keysRead) if (text !== void 0) configurationKeyText[key] = text;
1121
- return {
1122
- rootInput: [...rootFields.values()],
1123
- configurationKeyText
1124
- };
1128
+ return { rootInput: [...rootFields.values()] };
1125
1129
  };
1126
1130
  for (const entry of input.moduleInputs) validatedInputOf(entry);
1127
1131
  for (const { value, site } of found) resolveOne(value, site);
1128
1132
  const authoredProps = new Map([...input.resources].map(([address, resource]) => [address, resource.props]));
1129
1133
  if (found.length === 0) {
1130
1134
  for (const [address, props] of authoredProps) refusePointersInProps(address, props);
1131
- const secretSources = secretSourcesReceivedBy(input.inputBindings, input.params);
1135
+ refuseSourcesInParams(input.params);
1136
+ const secretSources = secretSourcesReceivedBy(input.inputBindings);
1132
1137
  return {
1133
1138
  inputBindings: input.inputBindings,
1134
1139
  params: input.params,
1135
1140
  resourceProps: authoredProps,
1136
1141
  secretSources,
1137
- appConfigurationRead: appConfigurationReadOf(input.inputBindings, input.params, secretSources)
1142
+ appConfigurationRead: appConfigurationReadOf(secretSources)
1138
1143
  };
1139
1144
  }
1140
1145
  const inProgress = /* @__PURE__ */ new WeakSet();
@@ -1160,15 +1165,28 @@ function resolveValues(input) {
1160
1165
  binding
1161
1166
  }];
1162
1167
  });
1163
- const secretSources = secretSourcesReceivedBy(inputBindings, params);
1168
+ refuseSourcesInParams(params);
1169
+ const secretSources = secretSourcesReceivedBy(inputBindings);
1164
1170
  return {
1165
1171
  resourceProps,
1166
1172
  inputBindings,
1167
1173
  params,
1168
1174
  secretSources,
1169
- appConfigurationRead: appConfigurationReadOf(inputBindings, params, secretSources)
1175
+ appConfigurationRead: appConfigurationReadOf(secretSources)
1170
1176
  };
1171
1177
  }
1178
+ function valueReadsOf(inputBindings) {
1179
+ const reads = [];
1180
+ for (const { serviceAddress, binding } of inputBindings) for (const [path, source] of sourcesByPath(binding)) {
1181
+ const resource = sourceOriginOf(source)?.resource;
1182
+ if (resource !== void 0) reads.push({
1183
+ reader: serviceAddress,
1184
+ resource,
1185
+ path
1186
+ });
1187
+ }
1188
+ return reads;
1189
+ }
1172
1190
  /**
1173
1191
  * Brands a ref-port with the AUTHORED endpoint it stands for — which port of
1174
1192
  * which node the author wired, before any forwarding chain resolves. Read
@@ -1240,6 +1258,9 @@ function producerIdOf(ref) {
1240
1258
  * identity the branding copy creates, never on reading this back.
1241
1259
  */
1242
1260
  const MODULE_INPUT_KEY = Symbol("prisma:module-input-key");
1261
+ function describeNode(node) {
1262
+ return valueResourceOrigin(node)?.label ?? `${node.kind} "${node.name}"`;
1263
+ }
1243
1264
  /** Whether `ref` carries a callable `satisfies` that accepts `required` truthily. */
1244
1265
  function satisfiesRequired(ref, required) {
1245
1266
  return typeof ref === "object" && ref !== null && "satisfies" in ref && typeof ref.satisfies === "function" && ref.satisfies(required);
@@ -1309,9 +1330,9 @@ function validateServiceParamBinding(child, id, paramWiring, enclosingModuleName
1309
1330
  * children carry it as their `parent`, and this module's own boundary ports
1310
1331
  * (and the authored edges touching them) are recorded against it.
1311
1332
  */
1312
- function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, ports, authoredEdges, loading) {
1333
+ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, valueResources, ports, authoredEdges, loading) {
1313
1334
  ports.push(...boundaryPortsOf(selfId, moduleNode));
1314
- const localIds = /* @__PURE__ */ new Set();
1335
+ const localNodes = /* @__PURE__ */ new Map();
1315
1336
  const used = /* @__PURE__ */ new Set();
1316
1337
  const ctxInputs = {};
1317
1338
  for (const key of Object.keys(moduleNode.deps)) {
@@ -1361,13 +1382,20 @@ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBinding
1361
1382
  if (isValue(id)) throw new LoadError(`provision() received a value as its id (module "${moduleNode.name}"). A value can configure a node, never decide its address: the graph is the same whatever inputs Composer is given (ADR-0062).`);
1362
1383
  if (typeof id !== "string" || id.length === 0) throw new LoadError(`provision() requires a non-empty id (module "${moduleNode.name}").`);
1363
1384
  if (!isConfigKeySegment(id)) throw new LoadError(`provision() id "${id}" (module "${moduleNode.name}") must contain only ASCII letters and digits ([A-Za-z0-9]) — the id becomes an address segment, and addresses derive deterministic config keys (segments uppercased and joined with "_"). "${id}" would put "${id.toUpperCase()}" inside the derived key. ("_" collides with the key separator and "." with the address separator.)`);
1364
- if (localIds.has(id)) throw new LoadError(`Duplicate provision id "${id}" in module "${moduleNode.name}".`);
1385
+ const fullAddress = `${selfId}.${id}`;
1365
1386
  const untrusted = child;
1366
1387
  if (!isNode(untrusted) || untrusted.kind !== "service" && untrusted.kind !== "resource" && untrusted.kind !== "module") throw new LoadError(`provision("${id}") expects a branded service, resource, or module node (construct it with the service()/resource()/module() factories or a pack's own).`);
1367
1388
  if (untrusted.kind === "module" && typeof untrusted.isRoot === "function" && untrusted.isRoot()) throw new LoadError(`Module "${selfId}" provisions the app root "${untrusted.name}". An app root is the deploy's entry and cannot be provisioned. Build the module with module() instead.`);
1368
- localIds.add(id);
1369
- const fullAddress = `${selfId}.${id}`;
1389
+ const holder = localNodes.get(id);
1390
+ if (holder !== void 0) throw new LoadError(`Duplicate provision id "${id}" in module "${selfId}": "${fullAddress}" already holds ${describeNode(holder)}, and ${describeNode(child)} takes the same id. Give one of them a different id with provision(node, { id: '…' }).`);
1391
+ localNodes.set(id, child);
1370
1392
  if (child.kind === "resource") {
1393
+ const valueOrigin = valueResourceOrigin(child);
1394
+ if (valueOrigin !== void 0) {
1395
+ if (typeof moduleNode.isRoot !== "function" || !moduleNode.isRoot()) throw new LoadError(`Module "${selfId}" provisions "${id}", a resource that is a value. Only the app root, built with appRoot(), can provision one. Provision it in the root and pass its value down through this module's input.`);
1396
+ const also = child.provides !== void 0 ? "provides a contract" : Object.keys(slotsOf(child)).length > 0 ? "declares dependency slots" : void 0;
1397
+ if (also !== void 0) throw new LoadError(`Resource "${fullAddress}" is a value and also ${also}. A resource that is a value provides no contract and has no dependencies.`);
1398
+ }
1371
1399
  if (provisionWiring !== void 0) throw new LoadError(`provision("${id}") received deps for a resource — a resource's slots are wired when it is constructed, not at provision().`);
1372
1400
  if (provisionSecrets !== void 0) throw new LoadError(`provision("${id}") received secrets for a resource — a resource has no secret slots to satisfy.`);
1373
1401
  if (provisionInput !== void 0) throw new LoadError(`provision("${id}") received an input binding for a resource — a resource declares no input schema.`);
@@ -1400,6 +1428,11 @@ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBinding
1400
1428
  targetKind: "resource",
1401
1429
  enclosingModuleName: moduleNode.name
1402
1430
  });
1431
+ if (valueOrigin !== void 0) {
1432
+ const value = provisionedValue(valueOrigin, fullAddress);
1433
+ valueResources.set(fullAddress, value);
1434
+ return value;
1435
+ }
1403
1436
  return refForResource(fullAddress, child);
1404
1437
  }
1405
1438
  for (const [input, ref] of Object.entries(provisionWiring ?? {})) if (isValue(ref)) throw new LoadError(`The deps for "${fullAddress}.${input}" are bound to a value. A value can configure a node, never decide its edges: the graph is the same whatever inputs Composer is given (ADR-0062).`);
@@ -1407,7 +1440,7 @@ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBinding
1407
1440
  markUsed(Object.values(localWiring));
1408
1441
  const localParams = { ...provisionParams ?? {} };
1409
1442
  if (child.kind === "service") {
1410
- if (provisionSecrets !== void 0) throw new LoadError(`provision("${id}") received secrets for a service — a service takes its secrets as envSecret(...) leaves of its \`input\` binding (ADR-0042), not a secrets map.`);
1443
+ if (provisionSecrets !== void 0) throw new LoadError(`provision("${id}") received secrets for a service — a service takes its secrets as values bound to secretString() fields of its \`input\` binding, not a secrets map.`);
1411
1444
  if (child.inputSchema !== void 0 && provisionInput === void 0) throw new LoadError(`Input of provisioned service "${id}" is not bound (module "${moduleNode.name}") — the service declares an input schema; bind it with \`input: { … }\` on its provision() call.`);
1412
1445
  if (child.inputSchema === void 0 && provisionInput !== void 0) throw new LoadError(`provision("${id}") received an input binding, but the service declares no input schema (module "${moduleNode.name}").`);
1413
1446
  if (provisionInput !== void 0) inputBindings.push({
@@ -1459,7 +1492,7 @@ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBinding
1459
1492
  targetKind: "module",
1460
1493
  enclosingModuleName: moduleNode.name
1461
1494
  });
1462
- const childOutputs = flatten(child, fullAddress, localWiring, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, ports, authoredEdges, loading);
1495
+ const childOutputs = flatten(child, fullAddress, localWiring, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, valueResources, ports, authoredEdges, loading);
1463
1496
  nodes.push({
1464
1497
  id: fullAddress,
1465
1498
  parent: selfId,
@@ -1534,11 +1567,12 @@ function loadModule(root, opts) {
1534
1567
  const inputBindings = [];
1535
1568
  const paramBindings = [];
1536
1569
  const byId = /* @__PURE__ */ new Map();
1570
+ const valueResources = /* @__PURE__ */ new Map();
1537
1571
  const ports = [];
1538
1572
  const authoredEdges = [];
1539
1573
  const loading = { sealed: false };
1540
1574
  try {
1541
- flatten(root, rootId, {}, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, ports, authoredEdges, loading);
1575
+ flatten(root, rootId, {}, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, valueResources, ports, authoredEdges, loading);
1542
1576
  for (const entry of pending) validateWiring(entry, byId);
1543
1577
  assertDependencyDag(edges);
1544
1578
  } finally {
@@ -1548,12 +1582,11 @@ function loadModule(root, opts) {
1548
1582
  for (const [address, node] of byId) if (node.kind === "resource") resources.set(address, node);
1549
1583
  const resolved = resolveValues({
1550
1584
  environment: opts?.environment,
1551
- configuration: opts?.configuration,
1552
- appConfigurationRead: opts?.appConfigurationRead,
1553
1585
  inputBindings,
1554
1586
  params: paramBindings,
1555
1587
  moduleInputs,
1556
- resources
1588
+ resources,
1589
+ valueResources
1557
1590
  });
1558
1591
  const resolvedNodes = nodes.map((entry) => {
1559
1592
  const props = resolved.resourceProps.get(entry.id);
@@ -1577,6 +1610,7 @@ function loadModule(root, opts) {
1577
1610
  inputBindings: resolved.inputBindings,
1578
1611
  params: resolved.params,
1579
1612
  secretSources: resolved.secretSources,
1613
+ valueReads: valueReadsOf(resolved.inputBindings),
1580
1614
  appConfigurationRead: resolved.appConfigurationRead
1581
1615
  };
1582
1616
  }
@@ -1664,6 +1698,6 @@ function nodeAddresses(graph) {
1664
1698
  return graph.nodes.map(({ id }) => id).sort();
1665
1699
  }
1666
1700
  //#endregion
1667
- export { service as C, secretsKeys as S, paramSource as _, ResourceNodeBase as a, resource as b, dependency as c, isParamSource as d, isProvisionNeed as f, nodeAddresses as g, module as h, RESOURCE_OUT_PORT as i, freezeNode as l, isValue as m, Load as n, appRoot as o, isSecretSource as p, LoadError as r, assertAppName as s, GraphCheckError as t, isNode as u, provisionNeed as v, slotsOf as w, secretSource as x, resolve as y };
1701
+ export { secretsKeys as C, valueResource as E, secretSource as S, slotsOf as T, nodeAddresses as _, ResourceNodeBase as a, resolve as b, dependency as c, isParamSource as d, isProvisionNeed as f, module as g, isValueResource as h, RESOURCE_OUT_PORT as i, freezeNode as l, isValue as m, Load as n, appRoot as o, isSecretSource as p, LoadError as r, assertAppName as s, GraphCheckError as t, isNode as u, paramSource as v, service as w, resource as x, provisionNeed as y };
1668
1702
 
1669
- //# sourceMappingURL=graph-BzPLUUsB-D7EnB1F5.mjs.map
1703
+ //# sourceMappingURL=graph-K7VOpCAj-D6UHSltu.mjs.map