@prisma/composer-cli 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 (44) hide show
  1. package/dist/{app-configuration-file-CeJvBAti-DA4EKwFq.mjs → app-configuration-file-Cw9autUL-CPnePaG6.mjs} +17 -20
  2. package/dist/app-configuration-file-Cw9autUL-CPnePaG6.mjs.map +1 -0
  3. package/dist/{dev-current-wD5YDLjA-CFI8XTAK.mjs → dev-current-D8GwJQex-D4xWpddG.mjs} +6 -6
  4. package/dist/{dev-current-wD5YDLjA-CFI8XTAK.mjs.map → dev-current-D8GwJQex-D4xWpddG.mjs.map} +1 -1
  5. package/dist/{dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs → dev-environment-name-6eEr5PW8-DuiDkcM6.mjs} +2 -2
  6. package/dist/dev-environment-name-6eEr5PW8-DuiDkcM6.mjs.map +1 -0
  7. package/dist/{dist-D0rWRHos.mjs → dist-qqNor5kl.mjs} +3 -3
  8. package/dist/{dist-D0rWRHos.mjs.map → dist-qqNor5kl.mjs.map} +1 -1
  9. package/dist/{execute-deploy-destroy-DOzo2Psp-2iWcFbD9.mjs → execute-deploy-destroy-1SIH5uAu-SJMSVJ-C.mjs} +11 -10
  10. package/dist/{execute-deploy-destroy-DOzo2Psp-2iWcFbD9.mjs.map → execute-deploy-destroy-1SIH5uAu-SJMSVJ-C.mjs.map} +1 -1
  11. package/dist/{execute-dev-current-CKOzjWuO-DTOVqZzZ.mjs → execute-dev-current-DsAsDBB1-C_Pqg6lv.mjs} +6 -6
  12. package/dist/{execute-dev-current-CKOzjWuO-DTOVqZzZ.mjs.map → execute-dev-current-DsAsDBB1-C_Pqg6lv.mjs.map} +1 -1
  13. package/dist/{execute-dev-BIyOI3Ys-DGpTd9rP.mjs → execute-dev-xPaS5SAl-Pf5LvC3G.mjs} +77 -15
  14. package/dist/{execute-dev-BIyOI3Ys-DGpTd9rP.mjs.map → execute-dev-xPaS5SAl-Pf5LvC3G.mjs.map} +1 -1
  15. package/dist/family.d.mts +1 -1
  16. package/dist/family.mjs +22 -6
  17. package/dist/family.mjs.map +1 -1
  18. package/dist/{generate-dev-stack-BV_n-X9n-DM5faH3-.mjs → generate-dev-stack-BEpqJ3AH-BwP97FIX.mjs} +5 -5
  19. package/dist/generate-dev-stack-BEpqJ3AH-BwP97FIX.mjs.map +1 -0
  20. package/dist/{list-deployed-BFJJxt_W.mjs → list-deployed-BAKSI43Y.mjs} +4 -4
  21. package/dist/{list-deployed-BFJJxt_W.mjs.map → list-deployed-BAKSI43Y.mjs.map} +1 -1
  22. package/dist/{preflight-transport-DmmtoFPH-CZ0o7QPf.mjs → preflight-transport-DJjTWvyH-C98XN-K2.mjs} +3 -4
  23. package/dist/{preflight-transport-DmmtoFPH-CZ0o7QPf.mjs.map → preflight-transport-DJjTWvyH-C98XN-K2.mjs.map} +1 -1
  24. package/dist/{redaction-DXung4ip-Co_fv4Zl.mjs → redaction-C-NnlVUh-xg-a8RGt.mjs} +4 -10
  25. package/dist/redaction-C-NnlVUh-xg-a8RGt.mjs.map +1 -0
  26. package/dist/{redaction-Bf8FvTFH-XGchRgrK.d.mts → redaction-CqdeMBKw-B6ldtfDI.d.mts} +99 -73
  27. package/dist/redaction-CqdeMBKw-B6ldtfDI.d.mts.map +1 -0
  28. package/dist/{result-sR7PBi61.mjs → result-DlBttLS8.mjs} +7 -2
  29. package/dist/{result-sR7PBi61.mjs.map → result-DlBttLS8.mjs.map} +1 -1
  30. package/dist/{run-alchemy-CRLAyOtt-CwFLe4Zg.mjs → run-alchemy-CyciV8i0-Djfa6x3a.mjs} +4 -4
  31. package/dist/{run-alchemy-CRLAyOtt-CwFLe4Zg.mjs.map → run-alchemy-CyciV8i0-Djfa6x3a.mjs.map} +1 -1
  32. package/dist/testing.d.mts +5 -10
  33. package/dist/testing.d.mts.map +1 -1
  34. package/dist/testing.mjs +5 -5
  35. package/dist/testing.mjs.map +1 -1
  36. package/dist/{validate-environment-D1BTCkTs-C5m4rL6t.mjs → validate-environment-DyW59rJ7-B1PoUO20.mjs} +135 -88
  37. package/dist/validate-environment-DyW59rJ7-B1PoUO20.mjs.map +1 -0
  38. package/package.json +7 -7
  39. package/dist/app-configuration-file-CeJvBAti-DA4EKwFq.mjs.map +0 -1
  40. package/dist/dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs.map +0 -1
  41. package/dist/generate-dev-stack-BV_n-X9n-DM5faH3-.mjs.map +0 -1
  42. package/dist/redaction-Bf8FvTFH-XGchRgrK.d.mts.map +0 -1
  43. package/dist/redaction-DXung4ip-Co_fv4Zl.mjs.map +0 -1
  44. package/dist/validate-environment-D1BTCkTs-C5m4rL6t.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { d as checkComposerConfig, f as configFileMissing, i as credentialLookingValues, n as SecretRedaction, p as entryMissing, u as valuesUnderSecretsKeys } from "./redaction-DXung4ip-Co_fv4Zl.mjs";
2
- import { a as InternalError, i as CliStructuredError, o as blindCast } from "./result-sR7PBi61.mjs";
1
+ import { d as checkComposerConfig, f as configFileMissing, i as credentialLookingValues, n as SecretRedaction, p as entryMissing, u as valuesUnderSecretsKeys } from "./redaction-C-NnlVUh-xg-a8RGt.mjs";
2
+ import { i as CliStructuredError, o as InternalError, s as blindCast } from "./result-DlBttLS8.mjs";
3
3
  import * as mod from "node:module";
4
4
  import { createRequire } from "node:module";
5
5
  import * as fs from "node:fs";
@@ -783,8 +783,8 @@ async function assembleServices(graph, config, cwd, run, onEvent, options = {})
783
783
  };
784
784
  }
785
785
  //#endregion
786
- //#region ../../0-framework/0-foundation/foundation/dist/pointer-Cw3E-nrh.mjs
787
- /** A pointer: what a value known only at boot holds at deploy. It names the platform variable the service reads at boot, and records whether that variable holds a secret. */
786
+ //#region ../../0-framework/0-foundation/foundation/dist/pointer-BLedpQgL.mjs
787
+ /** A pointer: what a value known only at boot holds at deploy. It names the variable on the platform that the service reads at boot, and records whether that variable holds a secret. */
788
788
  const POINTER = blindCast(Symbol.for("prisma:pointer"));
789
789
  function kindOf(value) {
790
790
  if (typeof value !== "object" || value === null) return void 0;
@@ -806,7 +806,7 @@ function isSecretString(value) {
806
806
  return typeof value === "object" && value !== null && blindCast(value)[SECRET_BOX] === true;
807
807
  }
808
808
  //#endregion
809
- //#region ../../0-framework/1-core/core/dist/graph-BzPLUUsB.mjs
809
+ //#region ../../0-framework/1-core/core/dist/graph-K7VOpCAj.mjs
810
810
  /** The reserved name of a resource's single anonymous output port. Rejected as a user-declared port name (node.ts). */
811
811
  const RESOURCE_OUT_PORT = "$out";
812
812
  /**
@@ -833,6 +833,7 @@ function contractStyleOf(contract) {
833
833
  }
834
834
  const VALUE = blindCast(Symbol.for("prisma:value"));
835
835
  const VALUE_ORIGIN = blindCast(Symbol.for("prisma:value-origin"));
836
+ const VALUE_RESOURCE = blindCast(Symbol.for("prisma:value-resource"));
836
837
  /** True if `value` is a `Value`, a source included (checks the brand only, never a prototype). */
837
838
  function isValue(value) {
838
839
  return typeof value === "object" && value !== null && blindCast(value)[VALUE] === true;
@@ -953,13 +954,47 @@ function buildModuleInput(moduleAddress) {
953
954
  */
954
955
  const NODE = Symbol.for("prisma:node");
955
956
  const SECRET_SOURCE = blindCast(Symbol.for("prisma:secret-source"));
956
- /** True if `value` is a secret source, such as an `envSecret()` result. */
957
+ /** True if `value` is a secret source. */
957
958
  function isSecretSource(value) {
958
959
  return typeof value === "object" && value !== null && blindCast(value)[SECRET_SOURCE] === true;
959
960
  }
960
961
  blindCast(Symbol.for("prisma:provision-need"));
961
962
  const PARAM_SOURCE = blindCast(Symbol.for("prisma:param-source"));
963
+ function buildSource(brand, payload, origin, kind, hidden = {}) {
964
+ const source = {
965
+ [VALUE]: true,
966
+ [VALUE_ORIGIN]: origin,
967
+ [brand]: true,
968
+ [POINTER]: kind,
969
+ payload
970
+ };
971
+ Object.defineProperty(origin, "source", { value: source });
972
+ Object.defineProperties(source, {
973
+ ...coercions(origin),
974
+ ...hidden
975
+ });
976
+ Object.freeze(origin);
977
+ return Object.freeze(source);
978
+ }
979
+ function coercions(origin) {
980
+ const thrower = (what) => () => {
981
+ throw sourceMisuse(origin, what);
982
+ };
983
+ return {
984
+ toString: { value: thrower("its toString() was called") },
985
+ valueOf: { value: thrower("its valueOf() was called") },
986
+ [Symbol.toPrimitive]: { value: (hint) => {
987
+ throw sourceMisuse(origin, primitiveMisuse(hint));
988
+ } }
989
+ };
990
+ }
962
991
  const sourceMisuses = /* @__PURE__ */ new WeakSet();
992
+ function sourceMisuse(origin, what) {
993
+ const { label } = origin;
994
+ 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.`);
995
+ sourceMisuses.add(error);
996
+ return error;
997
+ }
963
998
  /** True for the error a source throws when code turns it into text or a number. Internal to core. */
964
999
  function isSourceMisuse(error) {
965
1000
  return error instanceof LoadError && sourceMisuses.has(error);
@@ -970,7 +1005,7 @@ function sourceOriginOf(source) {
970
1005
  const origin = originOf(source);
971
1006
  return origin.kind === "source" ? origin : void 0;
972
1007
  }
973
- /** True if `value` is a param source, such as an `envParam()` result. */
1008
+ /** True if `value` is a param source. */
974
1009
  function isParamSource(value) {
975
1010
  return typeof value === "object" && value !== null && blindCast(value)[PARAM_SOURCE] === true;
976
1011
  }
@@ -983,6 +1018,18 @@ function isParamSource(value) {
983
1018
  function isConfigKeySegment(name) {
984
1019
  return /^[A-Za-z0-9]+$/.test(name);
985
1020
  }
1021
+ function valueResourceOrigin(node) {
1022
+ if (!isNode(node) || node.kind !== "resource" || !(VALUE_RESOURCE in node)) return void 0;
1023
+ const value = node[VALUE_RESOURCE];
1024
+ return isSecretSource(value) || isParamSource(value) ? sourceOriginOf(value) : void 0;
1025
+ }
1026
+ function provisionedValue(origin, address) {
1027
+ const { source, ...kept } = origin;
1028
+ return blindCast(buildSource(isSecretSource(source) ? SECRET_SOURCE : PARAM_SOURCE, source.payload, {
1029
+ ...kept,
1030
+ resource: address
1031
+ }, isSecretPointer(source) ? "secret" : "plain", { id: { value: address } }));
1032
+ }
986
1033
  /**
987
1034
  * True if `value` was constructed by this module's factories. Checks the
988
1035
  * brand only, never a prototype — a graph may mix nodes from a different
@@ -1124,10 +1171,8 @@ function loadService(root, rootId) {
1124
1171
  inputBindings: [],
1125
1172
  params: [],
1126
1173
  secretSources: [],
1127
- appConfigurationRead: {
1128
- rootInput: [],
1129
- configurationKeyText: {}
1130
- }
1174
+ valueReads: [],
1175
+ appConfigurationRead: { rootInput: [] }
1131
1176
  };
1132
1177
  }
1133
1178
  function joinPath(path, key) {
@@ -1241,7 +1286,7 @@ function checkResult(result, fnLabel) {
1241
1286
  const walk = (value, path) => {
1242
1287
  const atPath = path === "" ? "" : ` at "${path}"`;
1243
1288
  if (value === void 0) throw new LoadError(`${fnLabel} returned undefined${atPath}. Return a result for every environment; Composer never picks a default.`);
1244
- 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.`);
1289
+ 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.`);
1245
1290
  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.`);
1246
1291
  const notPlain = describeNotPlain(value);
1247
1292
  if (notPlain !== void 0) throw new LoadError(`${fnLabel} returned ${notPlain}${atPath}. resolve() returns plain data: strings, finite numbers, booleans, null, arrays and plain objects.`);
@@ -1271,7 +1316,7 @@ function firstPointer(value, path = [], seen = /* @__PURE__ */ new WeakSet()) {
1271
1316
  function refusePointerDependency(fnLabel, dependency, real) {
1272
1317
  const found = firstPointer(real);
1273
1318
  if (found === void 0) return;
1274
- const label = sourceOriginOf(found.pointer)?.label ?? "a value known only at boot";
1319
+ const label = sourceOriginOf(found.pointer)?.label ?? "a source";
1275
1320
  const origin = originOf(dependency);
1276
1321
  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.`);
1277
1322
  const listed = `${inputFieldLabel(origin)} of module "${origin.module}"`;
@@ -1342,7 +1387,7 @@ function refuseSecretBoxes(address, value, path) {
1342
1387
  address,
1343
1388
  kind: "moduleInput",
1344
1389
  path
1345
- })} 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().`);
1390
+ })} 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().`);
1346
1391
  if (Array.isArray(value)) {
1347
1392
  for (const [index, member] of value.entries()) refuseSecretBoxes(address, member, joinPath(path, index));
1348
1393
  return;
@@ -1350,10 +1395,17 @@ function refuseSecretBoxes(address, value, path) {
1350
1395
  if (isPlainObject(value)) for (const [key, member] of Object.entries(value)) refuseSecretBoxes(address, member, joinPath(path, key));
1351
1396
  }
1352
1397
  /** The original source each runtime value in `value` names, by its path. */
1353
- function sourcesByPath(value, path = "", found = /* @__PURE__ */ new Map()) {
1354
- if (isSecretSource(value) || isParamSource(value)) found.set(path, sourceOriginOf(value)?.source ?? value);
1355
- else if (Array.isArray(value)) for (const [index, member] of value.entries()) sourcesByPath(member, joinPath(path, index), found);
1356
- else if (isPlainObject(value)) for (const [key, member] of Object.entries(value)) sourcesByPath(member, joinPath(path, key), found);
1398
+ function sourcesByPath(value, path = "", found = /* @__PURE__ */ new Map(), ancestors = /* @__PURE__ */ new Set()) {
1399
+ if (isSecretSource(value) || isParamSource(value)) {
1400
+ found.set(path, sourceOriginOf(value)?.source ?? value);
1401
+ return found;
1402
+ }
1403
+ if (!Array.isArray(value) && !isPlainObject(value)) return found;
1404
+ if (ancestors.has(value)) return found;
1405
+ ancestors.add(value);
1406
+ const entries = Array.isArray(value) ? value.map((member, index) => [index, member]) : Object.entries(value);
1407
+ for (const [key, member] of entries) sourcesByPath(member, joinPath(path, key), found, ancestors);
1408
+ ancestors.delete(value);
1357
1409
  return found;
1358
1410
  }
1359
1411
  function validateModuleInput(entry, resolved, environment) {
@@ -1386,11 +1438,18 @@ function validateModuleInput(entry, resolved, environment) {
1386
1438
  };
1387
1439
  return restore(result.value, "");
1388
1440
  }
1441
+ function refuseSourcesInParams(params) {
1442
+ for (const { serviceAddress, slot, binding } of params) {
1443
+ const [source] = pointersIn(binding);
1444
+ if (source === void 0) continue;
1445
+ 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.`);
1446
+ }
1447
+ }
1389
1448
  function refusePointersInProps(address, props) {
1390
1449
  const seen = /* @__PURE__ */ new WeakSet();
1391
1450
  const walk = (value, path) => {
1392
1451
  if (isSecretSource(value) || isParamSource(value)) {
1393
- const label = sourceOriginOf(value)?.label ?? (isSecretSource(value) ? "a secret source" : "a param source");
1452
+ const label = sourceOriginOf(value)?.label ?? "a source";
1394
1453
  throw new LoadError(`${describeSite({
1395
1454
  address,
1396
1455
  kind: "props",
@@ -1412,22 +1471,12 @@ function refusePointersInProps(address, props) {
1412
1471
  function resolveValues(input) {
1413
1472
  const { environment } = input;
1414
1473
  const rootFields = /* @__PURE__ */ new Map();
1415
- const keysRead = /* @__PURE__ */ new Map();
1416
- /** The text the app configuration holds for `key`, recorded; `undefined` when it holds none or `''`. */
1417
- const configurationText = (key, label, site) => {
1418
- let raw;
1419
- if (input.appConfigurationRead !== void 0) raw = input.appConfigurationRead.configurationKeyText[key];
1420
- else if (input.configuration !== void 0) raw = input.configuration[key];
1421
- 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.`);
1422
- 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.`);
1423
- const text = raw === void 0 || raw === "" ? void 0 : raw;
1424
- keysRead.set(key, {
1425
- label,
1426
- text
1427
- });
1428
- return text;
1429
- };
1430
1474
  const secretUses = /* @__PURE__ */ new Map();
1475
+ for (const [address, value] of input.valueResources) if (isSecretSource(value)) secretUses.set(value, {
1476
+ source: value,
1477
+ address,
1478
+ nodeKind: "resource"
1479
+ });
1431
1480
  const recordSecret = (source, site) => {
1432
1481
  const canonical = canonicalSecret(source);
1433
1482
  if (secretUses.has(canonical)) return;
@@ -1437,8 +1486,8 @@ function resolveValues(input) {
1437
1486
  nodeKind: nodeKindOf(site)
1438
1487
  });
1439
1488
  };
1440
- const secretSourcesReceivedBy = (inputBindings, params) => {
1441
- for (const { serviceAddress, binding } of [...inputBindings, ...params]) for (const pointer of pointersIn(binding)) {
1489
+ const secretSourcesReceivedBy = (inputBindings) => {
1490
+ for (const { serviceAddress, binding } of inputBindings) for (const pointer of pointersIn(binding)) {
1442
1491
  if (!isSecretSource(pointer)) continue;
1443
1492
  const canonical = canonicalSecret(pointer);
1444
1493
  if (secretUses.get(canonical)?.nodeKind === "service") continue;
@@ -1488,14 +1537,11 @@ function resolveValues(input) {
1488
1537
  break;
1489
1538
  case "source":
1490
1539
  if (isSecretSource(origin.source)) recordSecret(origin.source, site);
1491
- if (origin.sourceKind === "secret" || origin.configurationKey === void 0) result = origin.source;
1492
- else result = configurationText(origin.configurationKey, origin.label, site);
1540
+ result = origin.source;
1493
1541
  break;
1494
1542
  case "computed": {
1495
1543
  const args = origin.dependencies.map((dependency) => {
1496
1544
  const real = resolveOne(dependency, site);
1497
- const source = originOf(dependency);
1498
- 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.`);
1499
1545
  refusePointerDependency(fnLabelFor(site), dependency, real);
1500
1546
  return real;
1501
1547
  });
@@ -1553,35 +1599,11 @@ function resolveValues(input) {
1553
1599
  return validated;
1554
1600
  };
1555
1601
  const rootModuleAddress = () => input.moduleInputs.find((entry) => entry.isLoadRoot)?.moduleAddress ?? "";
1556
- const appConfigurationReadOf = (inputBindings, params, secretSources) => {
1557
- if (input.configuration !== void 0 || input.appConfigurationRead !== void 0) {
1558
- const kept = [...inputBindings.map(({ serviceAddress, binding }) => ({
1559
- binding,
1560
- site: {
1561
- address: serviceAddress,
1562
- kind: "serviceInput",
1563
- path: ""
1564
- }
1565
- })), ...params.map(({ serviceAddress, slot, binding }) => ({
1566
- binding,
1567
- site: {
1568
- address: serviceAddress,
1569
- kind: "param",
1570
- path: slot
1571
- }
1572
- }))];
1573
- for (const { binding, site } of kept) for (const pointer of pointersIn(binding)) {
1574
- if (!isParamSource(pointer)) continue;
1575
- const origin = sourceOriginOf(pointer);
1576
- if (origin?.sourceKind === "param" && origin.configurationKey !== void 0) configurationText(origin.configurationKey, origin.label, site);
1577
- }
1578
- }
1602
+ const appConfigurationReadOf = (secretSources) => {
1579
1603
  for (const use of secretSources) {
1580
1604
  const origin = sourceOriginOf(use.source);
1581
1605
  if (origin?.sourceKind !== "secret") continue;
1582
1606
  const key = origin.secretsKey;
1583
- const read = key === void 0 ? void 0 : keysRead.get(key);
1584
- 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.`);
1585
1607
  const field = [...rootFields.values()].find((candidate) => candidate.path[0] === key);
1586
1608
  if (key !== void 0 && field !== void 0) throw new LoadError(`${inputFieldLabel({
1587
1609
  kind: "input",
@@ -1597,25 +1619,21 @@ function resolveValues(input) {
1597
1619
  path: field.path
1598
1620
  })} 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.`);
1599
1621
  }
1600
- const configurationKeyText = {};
1601
- for (const [key, { text }] of keysRead) if (text !== void 0) configurationKeyText[key] = text;
1602
- return {
1603
- rootInput: [...rootFields.values()],
1604
- configurationKeyText
1605
- };
1622
+ return { rootInput: [...rootFields.values()] };
1606
1623
  };
1607
1624
  for (const entry of input.moduleInputs) validatedInputOf(entry);
1608
1625
  for (const { value, site } of found) resolveOne(value, site);
1609
1626
  const authoredProps = new Map([...input.resources].map(([address, resource]) => [address, resource.props]));
1610
1627
  if (found.length === 0) {
1611
1628
  for (const [address, props] of authoredProps) refusePointersInProps(address, props);
1612
- const secretSources = secretSourcesReceivedBy(input.inputBindings, input.params);
1629
+ refuseSourcesInParams(input.params);
1630
+ const secretSources = secretSourcesReceivedBy(input.inputBindings);
1613
1631
  return {
1614
1632
  inputBindings: input.inputBindings,
1615
1633
  params: input.params,
1616
1634
  resourceProps: authoredProps,
1617
1635
  secretSources,
1618
- appConfigurationRead: appConfigurationReadOf(input.inputBindings, input.params, secretSources)
1636
+ appConfigurationRead: appConfigurationReadOf(secretSources)
1619
1637
  };
1620
1638
  }
1621
1639
  const inProgress = /* @__PURE__ */ new WeakSet();
@@ -1641,15 +1659,28 @@ function resolveValues(input) {
1641
1659
  binding
1642
1660
  }];
1643
1661
  });
1644
- const secretSources = secretSourcesReceivedBy(inputBindings, params);
1662
+ refuseSourcesInParams(params);
1663
+ const secretSources = secretSourcesReceivedBy(inputBindings);
1645
1664
  return {
1646
1665
  resourceProps,
1647
1666
  inputBindings,
1648
1667
  params,
1649
1668
  secretSources,
1650
- appConfigurationRead: appConfigurationReadOf(inputBindings, params, secretSources)
1669
+ appConfigurationRead: appConfigurationReadOf(secretSources)
1651
1670
  };
1652
1671
  }
1672
+ function valueReadsOf(inputBindings) {
1673
+ const reads = [];
1674
+ for (const { serviceAddress, binding } of inputBindings) for (const [path, source] of sourcesByPath(binding)) {
1675
+ const resource = sourceOriginOf(source)?.resource;
1676
+ if (resource !== void 0) reads.push({
1677
+ reader: serviceAddress,
1678
+ resource,
1679
+ path
1680
+ });
1681
+ }
1682
+ return reads;
1683
+ }
1653
1684
  /**
1654
1685
  * Brands a ref-port with the AUTHORED endpoint it stands for — which port of
1655
1686
  * which node the author wired, before any forwarding chain resolves. Read
@@ -1721,6 +1752,9 @@ function producerIdOf(ref) {
1721
1752
  * identity the branding copy creates, never on reading this back.
1722
1753
  */
1723
1754
  const MODULE_INPUT_KEY = Symbol("prisma:module-input-key");
1755
+ function describeNode(node) {
1756
+ return valueResourceOrigin(node)?.label ?? `${node.kind} "${node.name}"`;
1757
+ }
1724
1758
  /** Whether `ref` carries a callable `satisfies` that accepts `required` truthily. */
1725
1759
  function satisfiesRequired(ref, required) {
1726
1760
  return typeof ref === "object" && ref !== null && "satisfies" in ref && typeof ref.satisfies === "function" && ref.satisfies(required);
@@ -1790,9 +1824,9 @@ function validateServiceParamBinding(child, id, paramWiring, enclosingModuleName
1790
1824
  * children carry it as their `parent`, and this module's own boundary ports
1791
1825
  * (and the authored edges touching them) are recorded against it.
1792
1826
  */
1793
- function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, ports, authoredEdges, loading) {
1827
+ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, valueResources, ports, authoredEdges, loading) {
1794
1828
  ports.push(...boundaryPortsOf(selfId, moduleNode));
1795
- const localIds = /* @__PURE__ */ new Set();
1829
+ const localNodes = /* @__PURE__ */ new Map();
1796
1830
  const used = /* @__PURE__ */ new Set();
1797
1831
  const ctxInputs = {};
1798
1832
  for (const key of Object.keys(moduleNode.deps)) {
@@ -1842,13 +1876,20 @@ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBinding
1842
1876
  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).`);
1843
1877
  if (typeof id !== "string" || id.length === 0) throw new LoadError(`provision() requires a non-empty id (module "${moduleNode.name}").`);
1844
1878
  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.)`);
1845
- if (localIds.has(id)) throw new LoadError(`Duplicate provision id "${id}" in module "${moduleNode.name}".`);
1879
+ const fullAddress = `${selfId}.${id}`;
1846
1880
  const untrusted = child;
1847
1881
  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).`);
1848
1882
  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.`);
1849
- localIds.add(id);
1850
- const fullAddress = `${selfId}.${id}`;
1883
+ const holder = localNodes.get(id);
1884
+ 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: '…' }).`);
1885
+ localNodes.set(id, child);
1851
1886
  if (child.kind === "resource") {
1887
+ const valueOrigin = valueResourceOrigin(child);
1888
+ if (valueOrigin !== void 0) {
1889
+ 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.`);
1890
+ const also = child.provides !== void 0 ? "provides a contract" : Object.keys(slotsOf(child)).length > 0 ? "declares dependency slots" : void 0;
1891
+ 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.`);
1892
+ }
1852
1893
  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().`);
1853
1894
  if (provisionSecrets !== void 0) throw new LoadError(`provision("${id}") received secrets for a resource — a resource has no secret slots to satisfy.`);
1854
1895
  if (provisionInput !== void 0) throw new LoadError(`provision("${id}") received an input binding for a resource — a resource declares no input schema.`);
@@ -1881,6 +1922,11 @@ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBinding
1881
1922
  targetKind: "resource",
1882
1923
  enclosingModuleName: moduleNode.name
1883
1924
  });
1925
+ if (valueOrigin !== void 0) {
1926
+ const value = provisionedValue(valueOrigin, fullAddress);
1927
+ valueResources.set(fullAddress, value);
1928
+ return value;
1929
+ }
1884
1930
  return refForResource(fullAddress, child);
1885
1931
  }
1886
1932
  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).`);
@@ -1888,7 +1934,7 @@ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBinding
1888
1934
  markUsed(Object.values(localWiring));
1889
1935
  const localParams = { ...provisionParams ?? {} };
1890
1936
  if (child.kind === "service") {
1891
- 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.`);
1937
+ 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.`);
1892
1938
  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.`);
1893
1939
  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}").`);
1894
1940
  if (provisionInput !== void 0) inputBindings.push({
@@ -1940,7 +1986,7 @@ function flatten(moduleNode, selfId, wiring, nodes, edges, pending, inputBinding
1940
1986
  targetKind: "module",
1941
1987
  enclosingModuleName: moduleNode.name
1942
1988
  });
1943
- const childOutputs = flatten(child, fullAddress, localWiring, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, ports, authoredEdges, loading);
1989
+ const childOutputs = flatten(child, fullAddress, localWiring, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, valueResources, ports, authoredEdges, loading);
1944
1990
  nodes.push({
1945
1991
  id: fullAddress,
1946
1992
  parent: selfId,
@@ -2015,11 +2061,12 @@ function loadModule(root, opts) {
2015
2061
  const inputBindings = [];
2016
2062
  const paramBindings = [];
2017
2063
  const byId = /* @__PURE__ */ new Map();
2064
+ const valueResources = /* @__PURE__ */ new Map();
2018
2065
  const ports = [];
2019
2066
  const authoredEdges = [];
2020
2067
  const loading = { sealed: false };
2021
2068
  try {
2022
- flatten(root, rootId, {}, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, ports, authoredEdges, loading);
2069
+ flatten(root, rootId, {}, nodes, edges, pending, inputBindings, paramBindings, moduleInputs, byId, valueResources, ports, authoredEdges, loading);
2023
2070
  for (const entry of pending) validateWiring(entry, byId);
2024
2071
  assertDependencyDag(edges);
2025
2072
  } finally {
@@ -2029,12 +2076,11 @@ function loadModule(root, opts) {
2029
2076
  for (const [address, node] of byId) if (node.kind === "resource") resources.set(address, node);
2030
2077
  const resolved = resolveValues({
2031
2078
  environment: opts?.environment,
2032
- configuration: opts?.configuration,
2033
- appConfigurationRead: opts?.appConfigurationRead,
2034
2079
  inputBindings,
2035
2080
  params: paramBindings,
2036
2081
  moduleInputs,
2037
- resources
2082
+ resources,
2083
+ valueResources
2038
2084
  });
2039
2085
  const resolvedNodes = nodes.map((entry) => {
2040
2086
  const props = resolved.resourceProps.get(entry.id);
@@ -2058,6 +2104,7 @@ function loadModule(root, opts) {
2058
2104
  inputBindings: resolved.inputBindings,
2059
2105
  params: resolved.params,
2060
2106
  secretSources: resolved.secretSources,
2107
+ valueReads: valueReadsOf(resolved.inputBindings),
2061
2108
  appConfigurationRead: resolved.appConfigurationRead
2062
2109
  };
2063
2110
  }
@@ -2145,7 +2192,7 @@ function nodeAddresses(graph) {
2145
2192
  return graph.nodes.map(({ id }) => id).sort();
2146
2193
  }
2147
2194
  //#endregion
2148
- //#region ../../0-framework/3-tooling/cli/dist/validate-environment-D1BTCkTs.mjs
2195
+ //#region ../../0-framework/3-tooling/cli/dist/validate-environment-DyW59rJ7.mjs
2149
2196
  function adapterInvalid(list, index, input, summary, fix) {
2150
2197
  return new CliStructuredError("CONFIG.ADAPTER_INVALID", summary, {
2151
2198
  fix,
@@ -2529,4 +2576,4 @@ function validateEnvironmentName(environment, spawn = spawnSync) {
2529
2576
  //#endregion
2530
2577
  export { nodeAddresses as a, __require as c, validateEnvironmentName as i, __toESM as l, resolveAppIdentity as n, secretsKeys as o, runPipeline as r, __commonJSMin as s, checkConfigSource as t };
2531
2578
 
2532
- //# sourceMappingURL=validate-environment-D1BTCkTs-C5m4rL6t.mjs.map
2579
+ //# sourceMappingURL=validate-environment-DyW59rJ7-B1PoUO20.mjs.map