@prisma/composer-prisma-cloud 0.1.0 → 0.2.0-dev.2

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 (66) hide show
  1. package/dist/control.d.mts +79 -36
  2. package/dist/control.d.mts.map +1 -0
  3. package/dist/control.mjs +1074 -330
  4. package/dist/control.mjs.map +1 -1
  5. package/dist/cron/index.d.mts +63 -10
  6. package/dist/cron/index.d.mts.map +1 -0
  7. package/dist/cron/index.mjs +255 -42
  8. package/dist/cron/index.mjs.map +1 -1
  9. package/dist/cron/scheduler-entrypoint.mjs +563 -289
  10. package/dist/cron/scheduler-entrypoint.mjs.map +1 -1
  11. package/dist/cron/scheduler-service.mjs +255 -42
  12. package/dist/cron/scheduler-service.mjs.map +1 -1
  13. package/dist/index.d.mts +152 -26
  14. package/dist/index.d.mts.map +1 -0
  15. package/dist/index.mjs +108 -43
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/{prisma-next-COrwlg3N.mjs → prisma-next-DlU01kXJ-2sP5mQb6.mjs} +3 -3
  18. package/dist/prisma-next-DlU01kXJ-2sP5mQb6.mjs.map +1 -0
  19. package/dist/prisma-next.d.mts +1 -2
  20. package/dist/prisma-next.d.mts.map +1 -0
  21. package/dist/prisma-next.mjs +1 -1
  22. package/dist/provisioned-edges-B_XS1Mz--NFJgcXK7.mjs +211 -0
  23. package/dist/provisioned-edges-B_XS1Mz--NFJgcXK7.mjs.map +1 -0
  24. package/dist/serializer-Cx5slrV4-xJfH6EWS.d.mts +36 -0
  25. package/dist/serializer-Cx5slrV4-xJfH6EWS.d.mts.map +1 -0
  26. package/dist/{serializer-C2CsA7xm-29Eg2Tjl.mjs → serializer-D8_84XWO-DA2B6YbX.mjs} +91 -7
  27. package/dist/serializer-D8_84XWO-DA2B6YbX.mjs.map +1 -0
  28. package/dist/storage/index.d.mts +56 -20
  29. package/dist/storage/index.d.mts.map +1 -0
  30. package/dist/storage/index.mjs +267 -44
  31. package/dist/storage/index.mjs.map +1 -1
  32. package/dist/storage/storage-entrypoint.mjs +7395 -53
  33. package/dist/storage/storage-entrypoint.mjs.map +1 -1
  34. package/dist/storage/storage-service.mjs +267 -44
  35. package/dist/storage/storage-service.mjs.map +1 -1
  36. package/dist/storage/testing.d.mts +7 -4
  37. package/dist/storage/testing.d.mts.map +1 -0
  38. package/dist/storage/testing.mjs.map +1 -1
  39. package/dist/streams/index.d.mts +222 -0
  40. package/dist/streams/index.d.mts.map +1 -0
  41. package/dist/streams/index.mjs +4170 -0
  42. package/dist/streams/index.mjs.map +1 -0
  43. package/dist/streams/streams-entrypoint.mjs +48207 -0
  44. package/dist/streams/streams-entrypoint.mjs.map +1 -0
  45. package/dist/streams/streams-service.mjs +923 -0
  46. package/dist/streams/streams-service.mjs.map +1 -0
  47. package/dist/streams/testing.d.mts +33 -0
  48. package/dist/streams/testing.d.mts.map +1 -0
  49. package/dist/streams/testing.mjs +31335 -0
  50. package/dist/streams/testing.mjs.map +1 -0
  51. package/dist/testing.d.mts +1 -2
  52. package/dist/testing.d.mts.map +1 -0
  53. package/dist/testing.mjs +1 -1
  54. package/dist/testing.mjs.map +1 -1
  55. package/package.json +29 -23
  56. package/src/exports/control.ts +1 -0
  57. package/src/exports/cron.ts +1 -0
  58. package/src/exports/index.ts +1 -0
  59. package/src/exports/prisma-next.ts +1 -0
  60. package/src/exports/storage-testing.ts +1 -0
  61. package/src/exports/storage.ts +1 -0
  62. package/src/exports/streams-testing.ts +1 -0
  63. package/src/exports/streams.ts +1 -0
  64. package/src/exports/testing.ts +1 -0
  65. package/dist/prisma-next-COrwlg3N.mjs.map +0 -1
  66. package/dist/serializer-C2CsA7xm-29Eg2Tjl.mjs.map +0 -1
@@ -0,0 +1,211 @@
1
+ import { n as configKey, t as ORIGIN_KEY_NAME } from "./serializer-D8_84XWO-DA2B6YbX.mjs";
2
+ import { isParamSource, paramSource, provisionNeed } from "@prisma/composer";
3
+ import { blindCast } from "@prisma/composer/casts";
4
+ import { type } from "arktype";
5
+ import { RPC_PEER_KEY } from "@prisma/composer/service-rpc";
6
+ //#region ../../1-prisma-cloud/1-extensions/target/dist/provisioned-edges-B_XS1Mz-.mjs
7
+ /**
8
+ * The service's own origin as a reserved provider param (ADR-0031): the ONE
9
+ * brand and the ONE entry — shared by control.ts (which registers the
10
+ * deploy-side value function that resolves the provisioned service's
11
+ * `endpointDomain` — see its `selfOriginValue`) and compute.ts (which
12
+ * validates and stashes the row at boot through the generic
13
+ * `stashProviderParams` loop), so writer and reader cannot drift.
14
+ *
15
+ * Unlike the key-minting brands (`service-keys.ts`, `streams-keys.ts`) this
16
+ * brand has no provisioner and no consumer edges: the value derives from the
17
+ * service's OWN provisioned attributes, so control.ts registers it as a
18
+ * service-derived provider param (`descriptors/shared.ts`'s
19
+ * `ServiceProviderParam`) and the descriptor writes it for EVERY compute
20
+ * service, exposing or not.
21
+ *
22
+ * This module is reachable from the RUNTIME/authoring side — it must never
23
+ * import `@internal/lowering` or `effect`, or those tokens leak into a user
24
+ * service's bundle (the deploy-side value function lives in control.ts, the
25
+ * control-plane-only entry).
26
+ */
27
+ /** ADR-0031's brand for the service's own origin — control.ts registers the deploy-side value function under this. */
28
+ const SELF_ORIGIN = Symbol.for("prisma:self-origin");
29
+ /**
30
+ * The reserved provider param for the origin row: the var name is `ORIGIN`,
31
+ * derived through `configKey` at both ends (`configKey(address, …)` at
32
+ * deploy, `configKey('', …)` — `COMPOSER_ORIGIN` — at boot, where
33
+ * `readOrigin` reads it back). `brand` is `SELF_ORIGIN` — control.ts looks
34
+ * its deploy-side value function up by this field.
35
+ */
36
+ const ORIGIN_PARAM = {
37
+ name: ORIGIN_KEY_NAME,
38
+ schema: type("string"),
39
+ brand: SELF_ORIGIN
40
+ };
41
+ /**
42
+ * RPC's reserved provider param (ADR-0030/ADR-0031): the declaration —
43
+ * name + schema + brand — for the accepted-keys set a provider stores, shared
44
+ * by `control.ts` (which registers the deploy-side `value(refs)` that mints
45
+ * and aggregates it — see its `rpcAcceptedKeysValue`) and `compute.ts` (which
46
+ * validates and stashes it at boot), so writer and reader cannot drift.
47
+ * Finding the edges themselves is `provisioned-edges.ts`'s generic,
48
+ * brand-blind scan — RPC is not special-cased anywhere in this target.
49
+ *
50
+ * This module is reachable from the RUNTIME/authoring side — it must never
51
+ * import `@internal/lowering` or `effect`, or those tokens leak into a user
52
+ * service's bundle (the deploy-side `value(refs)` lives in control.ts, the
53
+ * control-plane-only entry).
54
+ */
55
+ /**
56
+ * The reserved provider param for RPC's accepted-keys set: the var name is
57
+ * `RPC_ACCEPTED_KEYS`, derived through `configKey` at both ends
58
+ * (`configKey(address, …)` at deploy, `configKey('', …)` at boot — the
59
+ * address-free form is `@internal/service-rpc`'s `RPC_ACCEPTED_KEYS_ENV`). `brand` is
60
+ * `RPC_PEER_KEY`, the same brand `perBindingToken()`'s need carries — control.ts
61
+ * looks its `value(refs)` up by this field.
62
+ */
63
+ const RPC_ACCEPTED_KEYS_PARAM = {
64
+ name: "RPC_ACCEPTED_KEYS",
65
+ schema: type("string[]"),
66
+ brand: RPC_PEER_KEY
67
+ };
68
+ /** ADR-0031's need brand for the streams module's bearer key — control.ts registers the provisioner under this. */
69
+ const STREAMS_API_KEY = Symbol.for("prisma:streams/api-key");
70
+ /**
71
+ * The provisioning need `durableStreams()`'s `apiKey` param declares: an
72
+ * unguessable value the target mints ONCE PER PROVIDER (not per edge) —
73
+ * `@prisma/streams-server` authenticates a single `API_KEY`, so every
74
+ * consumer of one streams module must present the same value. Per-provider
75
+ * cardinality is provisioner policy (ADR-0031), invisible to core.
76
+ */
77
+ const streamsApiKeyNeed = () => provisionNeed(STREAMS_API_KEY);
78
+ /**
79
+ * The reserved provider param for the streams bearer key: the var name is
80
+ * `STREAMS_API_KEY`. `brand` is `STREAMS_API_KEY` itself (the same symbol
81
+ * `streamsApiKeyNeed()`'s need carries) — control.ts looks its `value(refs)`
82
+ * up by this field.
83
+ */
84
+ const STREAMS_API_KEY_PARAM = {
85
+ name: "STREAMS_API_KEY",
86
+ schema: type("string"),
87
+ brand: STREAMS_API_KEY
88
+ };
89
+ /** The address-free name compute.ts re-stashes to and the streams entrypoint reads. */
90
+ const STREAMS_API_KEY_ENV = configKey("", {
91
+ owner: "service",
92
+ name: STREAMS_API_KEY_PARAM.name
93
+ });
94
+ /**
95
+ * The list of provider-side reserved params the boot path validates and
96
+ * stashes (ADR-0031): every brand's `{name, schema, brand}` declaration,
97
+ * collected from that brand's own module (`service-keys.ts`,
98
+ * `streams-keys.ts`, `origin-key.ts`) so `compute.ts` names no brand itself.
99
+ *
100
+ * This list exists separately from `control.ts`'s deploy-side registry
101
+ * (`PROVIDER_PARAMS`) because `control.ts` is deploy-only code — it imports
102
+ * `@internal/lowering` and `effect` to mint values — and a booted service
103
+ * must never import it. This module is reachable from a user service's
104
+ * bundle through `compute.ts`, so it must never import `@internal/lowering`,
105
+ * `effect`, `alchemy`, or `control.ts`.
106
+ *
107
+ * This is the single source of which reserved provider params exist:
108
+ * control.ts builds `PROVIDER_PARAMS` by mapping over this list and looking
109
+ * up each entry's deploy-side value function (edge-derived `value(refs)` or
110
+ * service-derived `valueForService(provisioned, address)`) by its `brand`,
111
+ * throwing at module load if one is missing. Adding a brand means adding its
112
+ * entry here, plus its deploy-side value function in control.ts — a brand
113
+ * registered for deploy but absent here is no longer expressible, because
114
+ * deploy no longer names its own param set independently.
115
+ */
116
+ const RESERVED_PROVIDER_PARAMS = [
117
+ RPC_ACCEPTED_KEYS_PARAM,
118
+ STREAMS_API_KEY_PARAM,
119
+ ORIGIN_PARAM
120
+ ];
121
+ /**
122
+ * Brands the payload `envParam` builds. Core's `paramSource()` is a public
123
+ * SPI, so a user could bypass `envParam` and bind a raw `paramSource('x')`;
124
+ * the brand lets `paramName` reject such a source (or another target's) with
125
+ * a clear error instead of reading an absent `.name`.
126
+ */
127
+ const PRISMA_CLOUD_PARAM_SOURCE = blindCast(Symbol.for("prisma:prisma-cloud-param-source"));
128
+ const RESERVED_PARAM_PREFIX = "COMPOSER_";
129
+ const POISONED_PARAM_NAMES = /* @__PURE__ */ new Set(["DATABASE_URL", "DATABASE_URL_POOLED"]);
130
+ /**
131
+ * Binds a param slot to a named Prisma Cloud platform env var — the non-secret
132
+ * sibling of `envSecret` (spec: env-sourced config params). The platform
133
+ * injects the value into the running instance per stage; the param's own
134
+ * schema validates it at boot, unredacted. The name may not use the
135
+ * framework's reserved `COMPOSER_` prefix or the poisoned
136
+ * `DATABASE_URL(_POOLED)` keys — same parity as `envSecret`.
137
+ */
138
+ function envParam(name) {
139
+ if (typeof name !== "string" || name.length === 0) throw new Error("envParam() requires a non-empty platform env-var name, e.g. envParam('APP_ORIGIN').");
140
+ if (name.startsWith(RESERVED_PARAM_PREFIX)) throw new Error(`envParam name "${name}" may not start with "${RESERVED_PARAM_PREFIX}" — that prefix is reserved for the framework's own generated config keys.`);
141
+ if (POISONED_PARAM_NAMES.has(name)) throw new Error(`envParam name "${name}" is reserved — ${[...POISONED_PARAM_NAMES].join(" and ")} are poisoned at project provision and cannot back a param.`);
142
+ return paramSource({
143
+ [PRISMA_CLOUD_PARAM_SOURCE]: true,
144
+ name
145
+ });
146
+ }
147
+ /** True only for a payload that `envParam` built — i.e. one carrying the brand. */
148
+ function isEnvParamPayload(payload) {
149
+ return typeof payload === "object" && payload !== null && blindCast(payload)[PRISMA_CLOUD_PARAM_SOURCE] === true;
150
+ }
151
+ /** True iff a resolved param value is an env-sourced pointer this target built (as opposed to a literal, or a foreign/raw `ParamSource`). */
152
+ function isEnvParamSource(value) {
153
+ return isParamSource(value) && isEnvParamPayload(value.payload);
154
+ }
155
+ /**
156
+ * Reads the Prisma Cloud env-var name back out of a param binding's opaque
157
+ * source. A source not built by `envParam` (a raw `paramSource(...)` or
158
+ * another target's source) carries no name — reject it here. `paramName` runs
159
+ * in preflight and at serialize before any value ever crosses the wire, so a
160
+ * foreign source fails early and clearly rather than producing a broken
161
+ * deploy with an undefined name.
162
+ */
163
+ function paramName(binding) {
164
+ const { binding: bound } = binding;
165
+ if (!isEnvParamSource(bound)) throw new Error(`param slot "${binding.slot}" of service "${binding.serviceAddress}" is bound to a source not created by envParam() — bind env-sourced params with envParam('NAME') from @prisma/composer-prisma-cloud.`);
166
+ return bound.payload.name;
167
+ }
168
+ /**
169
+ * Finds the manifest entry for one service param slot. `serialize` calls this
170
+ * only after confirming `buildConfig` resolved the slot to a `ParamSource`
171
+ * (`isParamSource(value)`), so a miss here means `graph.params` and the
172
+ * resolved `Config` have drifted — a Load invariant violation, surfaced
173
+ * loudly rather than producing a pointer row with an undefined name.
174
+ */
175
+ function paramBindingFor(bindings, serviceAddress, slot) {
176
+ const binding = bindings.find((b) => b.serviceAddress === serviceAddress && b.slot === slot);
177
+ if (binding === void 0) throw new Error(`param slot "${slot}" of "${serviceAddress}" resolved to a source but has no bound entry in the manifest — Load should have recorded it.`);
178
+ return binding;
179
+ }
180
+ /**
181
+ * Every provisioned edge in the graph. Core resolves and mints these (one
182
+ * value per edge, keyed by `edgeId`); this scan is how the target finds them
183
+ * again when it gathers a provider's inbound values.
184
+ */
185
+ function provisionedEdges(graph) {
186
+ const edges = [];
187
+ for (const edge of graph.edges) {
188
+ if (edge.kind !== "dependency") continue;
189
+ const consumer = graph.nodes.find((n) => n.id === edge.to)?.node;
190
+ if (consumer === void 0 || consumer.kind !== "service") continue;
191
+ const slot = consumer.inputs[edge.input];
192
+ if (slot === void 0) continue;
193
+ for (const param of Object.values(slot.connection.params)) {
194
+ const brand = param.provision?.brand;
195
+ if (brand === void 0) continue;
196
+ edges.push({
197
+ edgeId: `${edge.to}.${edge.input}`,
198
+ consumerAddress: edge.to,
199
+ input: edge.input,
200
+ providerAddress: edge.from,
201
+ brand
202
+ });
203
+ break;
204
+ }
205
+ }
206
+ return edges;
207
+ }
208
+ //#endregion
209
+ export { envParam as a, paramName as c, STREAMS_API_KEY_ENV as i, provisionedEdges as l, SELF_ORIGIN as n, isEnvParamSource as o, STREAMS_API_KEY as r, paramBindingFor as s, RESERVED_PROVIDER_PARAMS as t, streamsApiKeyNeed as u };
210
+
211
+ //# sourceMappingURL=provisioned-edges-B_XS1Mz--NFJgcXK7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provisioned-edges-B_XS1Mz--NFJgcXK7.mjs","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/provisioned-edges-B_XS1Mz-.mjs"],"sourcesContent":["import { n as configKey, t as ORIGIN_KEY_NAME } from \"./serializer-D8_84XWO.mjs\";\nimport { isParamSource, paramSource, provisionNeed } from \"@internal/core\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { type } from \"arktype\";\nimport { RPC_PEER_KEY } from \"@internal/service-rpc\";\n//#region src/origin-key.ts\n/**\n* The service's own origin as a reserved provider param (ADR-0031): the ONE\n* brand and the ONE entry — shared by control.ts (which registers the\n* deploy-side value function that resolves the provisioned service's\n* `endpointDomain` — see its `selfOriginValue`) and compute.ts (which\n* validates and stashes the row at boot through the generic\n* `stashProviderParams` loop), so writer and reader cannot drift.\n*\n* Unlike the key-minting brands (`service-keys.ts`, `streams-keys.ts`) this\n* brand has no provisioner and no consumer edges: the value derives from the\n* service's OWN provisioned attributes, so control.ts registers it as a\n* service-derived provider param (`descriptors/shared.ts`'s\n* `ServiceProviderParam`) and the descriptor writes it for EVERY compute\n* service, exposing or not.\n*\n* This module is reachable from the RUNTIME/authoring side — it must never\n* import `@internal/lowering` or `effect`, or those tokens leak into a user\n* service's bundle (the deploy-side value function lives in control.ts, the\n* control-plane-only entry).\n*/\n/** ADR-0031's brand for the service's own origin — control.ts registers the deploy-side value function under this. */\nconst SELF_ORIGIN = Symbol.for(\"prisma:self-origin\");\n/**\n* The reserved provider param for the origin row: the var name is `ORIGIN`,\n* derived through `configKey` at both ends (`configKey(address, …)` at\n* deploy, `configKey('', …)` — `COMPOSER_ORIGIN` — at boot, where\n* `readOrigin` reads it back). `brand` is `SELF_ORIGIN` — control.ts looks\n* its deploy-side value function up by this field.\n*/\nconst ORIGIN_PARAM = {\n\tname: ORIGIN_KEY_NAME,\n\tschema: type(\"string\"),\n\tbrand: SELF_ORIGIN\n};\n//#endregion\n//#region src/service-keys.ts\n/**\n* RPC's reserved provider param (ADR-0030/ADR-0031): the declaration —\n* name + schema + brand — for the accepted-keys set a provider stores, shared\n* by `control.ts` (which registers the deploy-side `value(refs)` that mints\n* and aggregates it — see its `rpcAcceptedKeysValue`) and `compute.ts` (which\n* validates and stashes it at boot), so writer and reader cannot drift.\n* Finding the edges themselves is `provisioned-edges.ts`'s generic,\n* brand-blind scan — RPC is not special-cased anywhere in this target.\n*\n* This module is reachable from the RUNTIME/authoring side — it must never\n* import `@internal/lowering` or `effect`, or those tokens leak into a user\n* service's bundle (the deploy-side `value(refs)` lives in control.ts, the\n* control-plane-only entry).\n*/\n/**\n* The reserved provider param for RPC's accepted-keys set: the var name is\n* `RPC_ACCEPTED_KEYS`, derived through `configKey` at both ends\n* (`configKey(address, …)` at deploy, `configKey('', …)` at boot — the\n* address-free form is `@internal/service-rpc`'s `RPC_ACCEPTED_KEYS_ENV`). `brand` is\n* `RPC_PEER_KEY`, the same brand `perBindingToken()`'s need carries — control.ts\n* looks its `value(refs)` up by this field.\n*/\nconst RPC_ACCEPTED_KEYS_PARAM = {\n\tname: \"RPC_ACCEPTED_KEYS\",\n\tschema: type(\"string[]\"),\n\tbrand: RPC_PEER_KEY\n};\n//#endregion\n//#region src/streams-keys.ts\n/** ADR-0031's need brand for the streams module's bearer key — control.ts registers the provisioner under this. */\nconst STREAMS_API_KEY = Symbol.for(\"prisma:streams/api-key\");\n/**\n* The provisioning need `durableStreams()`'s `apiKey` param declares: an\n* unguessable value the target mints ONCE PER PROVIDER (not per edge) —\n* `@prisma/streams-server` authenticates a single `API_KEY`, so every\n* consumer of one streams module must present the same value. Per-provider\n* cardinality is provisioner policy (ADR-0031), invisible to core.\n*/\nconst streamsApiKeyNeed = () => provisionNeed(STREAMS_API_KEY);\n/**\n* The reserved provider param for the streams bearer key: the var name is\n* `STREAMS_API_KEY`. `brand` is `STREAMS_API_KEY` itself (the same symbol\n* `streamsApiKeyNeed()`'s need carries) — control.ts looks its `value(refs)`\n* up by this field.\n*/\nconst STREAMS_API_KEY_PARAM = {\n\tname: \"STREAMS_API_KEY\",\n\tschema: type(\"string\"),\n\tbrand: STREAMS_API_KEY\n};\n/** The address-free name compute.ts re-stashes to and the streams entrypoint reads. */\nconst STREAMS_API_KEY_ENV = configKey(\"\", {\n\towner: \"service\",\n\tname: STREAMS_API_KEY_PARAM.name\n});\n//#endregion\n//#region src/provider-params.ts\n/**\n* The list of provider-side reserved params the boot path validates and\n* stashes (ADR-0031): every brand's `{name, schema, brand}` declaration,\n* collected from that brand's own module (`service-keys.ts`,\n* `streams-keys.ts`, `origin-key.ts`) so `compute.ts` names no brand itself.\n*\n* This list exists separately from `control.ts`'s deploy-side registry\n* (`PROVIDER_PARAMS`) because `control.ts` is deploy-only code — it imports\n* `@internal/lowering` and `effect` to mint values — and a booted service\n* must never import it. This module is reachable from a user service's\n* bundle through `compute.ts`, so it must never import `@internal/lowering`,\n* `effect`, `alchemy`, or `control.ts`.\n*\n* This is the single source of which reserved provider params exist:\n* control.ts builds `PROVIDER_PARAMS` by mapping over this list and looking\n* up each entry's deploy-side value function (edge-derived `value(refs)` or\n* service-derived `valueForService(provisioned, address)`) by its `brand`,\n* throwing at module load if one is missing. Adding a brand means adding its\n* entry here, plus its deploy-side value function in control.ts — a brand\n* registered for deploy but absent here is no longer expressible, because\n* deploy no longer names its own param set independently.\n*/\nconst RESERVED_PROVIDER_PARAMS = [\n\tRPC_ACCEPTED_KEYS_PARAM,\n\tSTREAMS_API_KEY_PARAM,\n\tORIGIN_PARAM\n];\n//#endregion\n//#region src/param.ts\n/**\n* Brands the payload `envParam` builds. Core's `paramSource()` is a public\n* SPI, so a user could bypass `envParam` and bind a raw `paramSource('x')`;\n* the brand lets `paramName` reject such a source (or another target's) with\n* a clear error instead of reading an absent `.name`.\n*/\nconst PRISMA_CLOUD_PARAM_SOURCE = blindCast(Symbol.for(\"prisma:prisma-cloud-param-source\"));\nconst RESERVED_PARAM_PREFIX = \"COMPOSER_\";\nconst POISONED_PARAM_NAMES = /* @__PURE__ */ new Set([\"DATABASE_URL\", \"DATABASE_URL_POOLED\"]);\n/**\n* Binds a param slot to a named Prisma Cloud platform env var — the non-secret\n* sibling of `envSecret` (spec: env-sourced config params). The platform\n* injects the value into the running instance per stage; the param's own\n* schema validates it at boot, unredacted. The name may not use the\n* framework's reserved `COMPOSER_` prefix or the poisoned\n* `DATABASE_URL(_POOLED)` keys — same parity as `envSecret`.\n*/\nfunction envParam(name) {\n\tif (typeof name !== \"string\" || name.length === 0) throw new Error(\"envParam() requires a non-empty platform env-var name, e.g. envParam('APP_ORIGIN').\");\n\tif (name.startsWith(RESERVED_PARAM_PREFIX)) throw new Error(`envParam name \"${name}\" may not start with \"${RESERVED_PARAM_PREFIX}\" — that prefix is reserved for the framework's own generated config keys.`);\n\tif (POISONED_PARAM_NAMES.has(name)) throw new Error(`envParam name \"${name}\" is reserved — ${[...POISONED_PARAM_NAMES].join(\" and \")} are poisoned at project provision and cannot back a param.`);\n\treturn paramSource({\n\t\t[PRISMA_CLOUD_PARAM_SOURCE]: true,\n\t\tname\n\t});\n}\n/** True only for a payload that `envParam` built — i.e. one carrying the brand. */\nfunction isEnvParamPayload(payload) {\n\treturn typeof payload === \"object\" && payload !== null && blindCast(payload)[PRISMA_CLOUD_PARAM_SOURCE] === true;\n}\n/** True iff a resolved param value is an env-sourced pointer this target built (as opposed to a literal, or a foreign/raw `ParamSource`). */\nfunction isEnvParamSource(value) {\n\treturn isParamSource(value) && isEnvParamPayload(value.payload);\n}\n/**\n* Reads the Prisma Cloud env-var name back out of a param binding's opaque\n* source. A source not built by `envParam` (a raw `paramSource(...)` or\n* another target's source) carries no name — reject it here. `paramName` runs\n* in preflight and at serialize before any value ever crosses the wire, so a\n* foreign source fails early and clearly rather than producing a broken\n* deploy with an undefined name.\n*/\nfunction paramName(binding) {\n\tconst { binding: bound } = binding;\n\tif (!isEnvParamSource(bound)) throw new Error(`param slot \"${binding.slot}\" of service \"${binding.serviceAddress}\" is bound to a source not created by envParam() — bind env-sourced params with envParam('NAME') from @prisma/composer-prisma-cloud.`);\n\treturn bound.payload.name;\n}\n/**\n* Finds the manifest entry for one service param slot. `serialize` calls this\n* only after confirming `buildConfig` resolved the slot to a `ParamSource`\n* (`isParamSource(value)`), so a miss here means `graph.params` and the\n* resolved `Config` have drifted — a Load invariant violation, surfaced\n* loudly rather than producing a pointer row with an undefined name.\n*/\nfunction paramBindingFor(bindings, serviceAddress, slot) {\n\tconst binding = bindings.find((b) => b.serviceAddress === serviceAddress && b.slot === slot);\n\tif (binding === void 0) throw new Error(`param slot \"${slot}\" of \"${serviceAddress}\" resolved to a source but has no bound entry in the manifest — Load should have recorded it.`);\n\treturn binding;\n}\n//#endregion\n//#region src/provisioned-edges.ts\n/**\n* Every provisioned edge in the graph. Core resolves and mints these (one\n* value per edge, keyed by `edgeId`); this scan is how the target finds them\n* again when it gathers a provider's inbound values.\n*/\nfunction provisionedEdges(graph) {\n\tconst edges = [];\n\tfor (const edge of graph.edges) {\n\t\tif (edge.kind !== \"dependency\") continue;\n\t\tconst consumer = graph.nodes.find((n) => n.id === edge.to)?.node;\n\t\tif (consumer === void 0 || consumer.kind !== \"service\") continue;\n\t\tconst slot = consumer.inputs[edge.input];\n\t\tif (slot === void 0) continue;\n\t\tfor (const param of Object.values(slot.connection.params)) {\n\t\t\tconst brand = param.provision?.brand;\n\t\t\tif (brand === void 0) continue;\n\t\t\tedges.push({\n\t\t\t\tedgeId: `${edge.to}.${edge.input}`,\n\t\t\t\tconsumerAddress: edge.to,\n\t\t\t\tinput: edge.input,\n\t\t\t\tproviderAddress: edge.from,\n\t\t\t\tbrand\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn edges;\n}\n//#endregion\nexport { paramName as a, STREAMS_API_KEY_ENV as c, paramBindingFor as i, streamsApiKeyNeed as l, envParam as n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;EACD;CACD;CACA,OAAO;AACR"}
@@ -0,0 +1,36 @@
1
+ import { ConfigParam } from "@prisma/composer";
2
+ import { StandardSchemaV1 } from "@standard-schema/spec";
3
+ //#region ../../1-prisma-cloud/1-extensions/target/dist/serializer-Cx5slrV4.d.mts
4
+ //#region src/serializer.d.ts
5
+ /** One declared param, paired with its owner and the raw ConfigParam (functions included). */
6
+ interface ParamEntry {
7
+ readonly owner: 'service' | {
8
+ readonly input: string;
9
+ };
10
+ readonly name: string;
11
+ readonly param: ConfigParam;
12
+ }
13
+ declare const configKey: (address: string, d: {
14
+ owner: ParamEntry["owner"];
15
+ name: string;
16
+ }) => string;
17
+ /**
18
+ * One reserved provider param's declaration: the boot-relevant half (name +
19
+ * schema) of a `ProviderParam` — the half the target's runtime side needs,
20
+ * without the deploy-only `value(refs)` function control.ts adds on top.
21
+ *
22
+ * `brand` is the ADR-0031 need brand this param answers for (e.g.
23
+ * `RPC_PEER_KEY`, `STREAMS_API_KEY`). control.ts's `PROVIDER_PARAMS` is built
24
+ * by mapping over the boot-side list of these entries (`provider-params.ts`'s
25
+ * `RESERVED_PROVIDER_PARAMS`) and looking up each brand's `value(refs)` by
26
+ * this field — so a param can exist on the deploy side only if it already
27
+ * exists here.
28
+ */
29
+ interface ProviderParamEntry {
30
+ readonly name: string;
31
+ readonly schema: StandardSchemaV1;
32
+ readonly brand: symbol;
33
+ }
34
+ //#endregion
35
+ export { configKey as n, ProviderParamEntry as t };
36
+ //# sourceMappingURL=serializer-Cx5slrV4-xJfH6EWS.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer-Cx5slrV4-xJfH6EWS.d.mts","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/serializer-Cx5slrV4.d.mts"],"mappings":";;;;;UAIU;WACC;aACE;;WAEF;WACA,OAAO;;cAEJ,YAAY,iBAAiB;EACzC,OAAO;EACP;;;;;;;;;;;;;;UAcQ;WACC;WACA,QAAQ;WACR"}
@@ -1,6 +1,7 @@
1
1
  import { secretSource } from "@prisma/composer";
2
2
  import { blindCast } from "@prisma/composer/casts";
3
- //#region ../../1-prisma-cloud/1-extensions/target/dist/serializer-C2CsA7xm.mjs
3
+ import { type } from "arktype";
4
+ //#region ../../1-prisma-cloud/1-extensions/target/dist/serializer-D8_84XWO.mjs
4
5
  /**
5
6
  * Brands the payload `envSecret` builds. Core's `secretSource()` is a public
6
7
  * SPI, so a user could bypass `envSecret` and bind a raw `secretSource('x')`;
@@ -8,12 +9,12 @@ import { blindCast } from "@prisma/composer/casts";
8
9
  * clear error instead of reading an absent `.name`.
9
10
  */
10
11
  const PRISMA_CLOUD_SECRET_SOURCE = blindCast(Symbol.for("prisma:prisma-cloud-secret-source"));
11
- const RESERVED_SECRET_PREFIX = "COMPOSE_";
12
+ const RESERVED_SECRET_PREFIX = "COMPOSER_";
12
13
  const POISONED_SECRET_NAMES = /* @__PURE__ */ new Set(["DATABASE_URL", "DATABASE_URL_POOLED"]);
13
14
  /**
14
15
  * Binds a secret slot to a named Prisma Cloud platform env var (ADR-0029). The
15
16
  * value is provisioned out-of-band; only the name is carried. The name may not
16
- * use the framework's reserved `COMPOSE_` prefix or the poisoned
17
+ * use the framework's reserved `COMPOSER_` prefix or the poisoned
17
18
  * `DATABASE_URL(_POOLED)` keys.
18
19
  */
19
20
  function envSecret(name) {
@@ -69,7 +70,7 @@ const configKey = (address, d) => {
69
70
  const segments = address.split(".").filter((s) => s.length > 0);
70
71
  const owner = d.owner === "service" ? [] : [d.owner.input];
71
72
  return [
72
- "COMPOSE",
73
+ "COMPOSER",
73
74
  ...segments,
74
75
  ...owner,
75
76
  d.name
@@ -88,12 +89,20 @@ function encode(owner, value) {
88
89
  function decode(owner, raw) {
89
90
  return owner === "service" ? JSON.parse(raw) : raw;
90
91
  }
92
+ const PARAM_POINTER_PREFIX = "@composer-param-pointer:";
93
+ /** True iff `raw` is a param pointer row (as opposed to a JSON-encoded literal). */
94
+ const isParamPointerRow = (raw) => raw.startsWith(PARAM_POINTER_PREFIX);
95
+ /** Builds a param pointer row's stored value from the platform var NAME it points to. */
96
+ const encodeParamPointer = (name) => `${PARAM_POINTER_PREFIX}${name}`;
97
+ /** Reverses `encodeParamPointer`: the platform var NAME a pointer row points to. */
98
+ const decodeParamPointer = (raw) => raw.slice(24);
91
99
  function coerce(raw, d, key) {
92
100
  if (!(raw !== void 0 && raw !== "")) {
93
101
  if (d.param.default !== void 0) return d.param.default;
94
102
  if (d.param.optional === true) return void 0;
95
103
  throw new Error(`missing required config param "${d.name}" (env ${key})`);
96
104
  }
105
+ if (d.owner === "service" && isParamPointerRow(raw)) return coerceEnvSourcedParam(raw, d, key);
97
106
  try {
98
107
  return standardValidateSync(d.param.schema, decode(d.owner, raw));
99
108
  } catch (cause) {
@@ -102,6 +111,26 @@ function coerce(raw, d, key) {
102
111
  }
103
112
  }
104
113
  /**
114
+ * Boot resolution for an env-sourced param: double-lookup (pointer → platform
115
+ * var), then the param's own schema on the raw string — no JSON decode, and
116
+ * no redaction (it's config, not a secret). An UNSET platform var is a loud
117
+ * boot failure naming both the param and the platform var; an EMPTY string is
118
+ * not special-cased here — it reaches the schema like any other value, so it
119
+ * passes iff the schema accepts it (deliberately unlike a literal param's own
120
+ * ""-means-absent rule, and unlike a secret's non-empty requirement).
121
+ */
122
+ function coerceEnvSourcedParam(raw, d, key) {
123
+ const platformVar = decodeParamPointer(raw);
124
+ const value = process.env[platformVar];
125
+ if (value === void 0) throw new Error(`env-sourced config param "${d.name}" (env ${key} → ${platformVar}) is unset: the platform variable "${platformVar}" was not injected — the deploy did not provision it.`);
126
+ try {
127
+ return standardValidateSync(d.param.schema, value);
128
+ } catch (cause) {
129
+ const message = cause instanceof Error ? cause.message : String(cause);
130
+ throw new Error(`invalid value for env-sourced config param "${d.name}" (env ${key} → ${platformVar}): ${message}`);
131
+ }
132
+ }
133
+ /**
105
134
  * Boot: read each declared param from env by its key, reverse the param's own
106
135
  * serialization (missing/invalid fails loudly), assemble the typed Config.
107
136
  * Secrets ride a separate channel (deserializeSecrets), not this one.
@@ -141,7 +170,7 @@ const stash = (node, config) => {
141
170
  process.env[configKey("", d)] = encode(d.owner, value);
142
171
  }
143
172
  };
144
- /** The pointer-row key for a secret slot: COMPOSE_<addr>_<slot> (secrets are service-level). */
173
+ /** The pointer-row key for a secret slot: COMPOSER_<addr>_<slot> (secrets are service-level). */
145
174
  const secretKey = (address, slot) => configKey(address, {
146
175
  owner: "service",
147
176
  name: slot
@@ -194,6 +223,61 @@ const stashSecrets = (node, address) => {
194
223
  process.env[secretKey("", slot)] = name;
195
224
  }
196
225
  };
226
+ /**
227
+ * Boot: for each reserved provider param, read its address-scoped row through
228
+ * the same `coerce` a declared param uses (JSON-decode, schema-validate), and
229
+ * re-emit it address-free — `stash`'s counterpart for this separate
230
+ * declaration space. A param is declared optional here unconditionally: an
231
+ * absent row means "never provisioned" (local dev, tests, a provider with no
232
+ * registered value for this deploy), never a boot failure, so nothing is
233
+ * stashed and the runtime reader that owns this slot falls back to its own
234
+ * pass-through behavior.
235
+ */
236
+ function stashProviderParams(entries, address) {
237
+ for (const entry of entries) {
238
+ const d = {
239
+ owner: "service",
240
+ name: entry.name,
241
+ param: {
242
+ schema: entry.schema,
243
+ optional: true
244
+ }
245
+ };
246
+ const key = configKey(address, d);
247
+ const value = coerce(process.env[key], d, key);
248
+ if (value === void 0) continue;
249
+ process.env[configKey("", d)] = encode("service", value);
250
+ }
251
+ }
252
+ /** The framework-resolved origin row: COMPOSER_<addr>_ORIGIN. Written per
253
+ * compute service at serialize — the service's own provisioned endpoint URL,
254
+ * riding the reserved-provider-param machinery (`origin-key.ts`'s
255
+ * `ORIGIN_PARAM`); never a declared param, never in config(). A harness with
256
+ * no deploy behind it supplies it by setting `COMPOSER_ORIGIN` to the
257
+ * JSON-encoded origin URL — exactly how the existing entrypoint tests supply
258
+ * their other `COMPOSER_*` rows. */
259
+ const ORIGIN_KEY_NAME = "ORIGIN";
260
+ /**
261
+ * Reads this service's origin back out of the address-free stash
262
+ * `stashProviderParams` wrote for the ORIGIN entry. `COMPOSER_ORIGIN` unset is
263
+ * a loud failure — a deployed environment always writes it, so an unset row
264
+ * means either a local harness that hasn't supplied it or a boot() called
265
+ * before run().
266
+ */
267
+ function readOrigin() {
268
+ const d = {
269
+ owner: "service",
270
+ name: ORIGIN_KEY_NAME,
271
+ param: {
272
+ schema: type("string"),
273
+ optional: true
274
+ }
275
+ };
276
+ const key = configKey("", d);
277
+ const value = coerce(process.env[key], d, key);
278
+ if (value === void 0) throw new Error("this service's origin is not available (env COMPOSER_ORIGIN is unset) — a deployed environment writes it automatically; a local harness must supply it like any other config value (set COMPOSER_ORIGIN to the JSON-encoded origin URL).");
279
+ return blindCast(value);
280
+ }
197
281
  /** Synchronous Standard Schema validation — see the matching note in core's `config.ts`. */
198
282
  function standardValidateSync(schema, value) {
199
283
  const result = schema["~standard"].validate(value);
@@ -202,6 +286,6 @@ function standardValidateSync(schema, value) {
202
286
  return result.value;
203
287
  }
204
288
  //#endregion
205
- export { envSecret as a, secretPointerRows as c, encode as i, stash as l, deserialize as n, paramEntries as o, deserializeSecrets as r, secretName as s, configKey as t, stashSecrets as u };
289
+ export { encode as a, paramEntries as c, secretPointerRows as d, stash as f, deserializeSecrets as i, readOrigin as l, stashSecrets as m, configKey as n, encodeParamPointer as o, stashProviderParams as p, deserialize as r, envSecret as s, ORIGIN_KEY_NAME as t, secretName as u };
206
290
 
207
- //# sourceMappingURL=serializer-C2CsA7xm-29Eg2Tjl.mjs.map
291
+ //# sourceMappingURL=serializer-D8_84XWO-DA2B6YbX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer-D8_84XWO-DA2B6YbX.mjs","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/serializer-D8_84XWO.mjs"],"sourcesContent":["import { secretSource } from \"@internal/core\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { type } from \"arktype\";\n//#region src/secret.ts\n/**\n* Brands the payload `envSecret` builds. Core's `secretSource()` is a public\n* SPI, so a user could bypass `envSecret` and bind a raw `secretSource('x')`;\n* the brand lets `secretName` reject such a source (or another target's) with a\n* clear error instead of reading an absent `.name`.\n*/\nconst PRISMA_CLOUD_SECRET_SOURCE = blindCast(Symbol.for(\"prisma:prisma-cloud-secret-source\"));\nconst RESERVED_SECRET_PREFIX = \"COMPOSER_\";\nconst POISONED_SECRET_NAMES = /* @__PURE__ */ new Set([\"DATABASE_URL\", \"DATABASE_URL_POOLED\"]);\n/**\n* Binds a secret slot to a named Prisma Cloud platform env var (ADR-0029). The\n* value is provisioned out-of-band; only the name is carried. The name may not\n* use the framework's reserved `COMPOSER_` prefix or the poisoned\n* `DATABASE_URL(_POOLED)` keys.\n*/\nfunction envSecret(name) {\n\tif (typeof name !== \"string\" || name.length === 0) throw new Error(\"envSecret() requires a non-empty platform env-var name, e.g. envSecret('STRIPE_SECRET_KEY').\");\n\tif (name.startsWith(RESERVED_SECRET_PREFIX)) throw new Error(`envSecret name \"${name}\" may not start with \"${RESERVED_SECRET_PREFIX}\" — that prefix is reserved for the framework's own generated config keys.`);\n\tif (POISONED_SECRET_NAMES.has(name)) throw new Error(`envSecret name \"${name}\" is reserved — ${[...POISONED_SECRET_NAMES].join(\" and \")} are poisoned at project provision and cannot back a secret.`);\n\treturn secretSource({\n\t\t[PRISMA_CLOUD_SECRET_SOURCE]: true,\n\t\tname\n\t});\n}\n/** True only for a payload that `envSecret` built — i.e. one carrying the brand. */\nfunction isEnvSecretPayload(payload) {\n\treturn typeof payload === \"object\" && payload !== null && blindCast(payload)[PRISMA_CLOUD_SECRET_SOURCE] === true;\n}\n/**\n* Reads the Prisma Cloud env-var name back out of a secret binding's opaque\n* source. A source not built by `envSecret` (a raw `secretSource(...)` or\n* another target's source) carries no name — reject it here. `secretName` runs\n* in preflight before any provisioning, so a foreign source fails early and\n* clearly rather than producing a broken deploy with an undefined name.\n*/\nfunction secretName(binding) {\n\tconst payload = binding.source.payload;\n\tif (!isEnvSecretPayload(payload)) throw new Error(`secret slot \"${binding.slot}\" of service \"${binding.serviceAddress}\" is bound to a source not created by envSecret() — bind secrets with envSecret('NAME') from @prisma/composer-prisma-cloud.`);\n\treturn payload.name;\n}\n//#endregion\n//#region src/serializer.ts\n/**\n* Walks a node's own params, then each dependency input's connection params —\n* the same enumeration order `configOf` uses, but carrying the raw\n* `ConfigParam` (with its `serialize`/`deserialize`) instead of a pure-data\n* projection.\n*/\nfunction paramEntries(node) {\n\tconst entries = [];\n\tfor (const [input, value] of Object.entries(node.inputs)) {\n\t\tif (typeof value !== \"object\" || value === null) continue;\n\t\tconst params = blindCast(value).connection.params;\n\t\tfor (const [name, param] of Object.entries(params)) entries.push({\n\t\t\towner: { input },\n\t\t\tname,\n\t\t\tparam\n\t\t});\n\t}\n\tfor (const [name, param] of Object.entries(node.params)) entries.push({\n\t\towner: \"service\",\n\t\tname,\n\t\tparam\n\t});\n\treturn entries;\n}\nconst configKey = (address, d) => {\n\tconst segments = address.split(\".\").filter((s) => s.length > 0);\n\tconst owner = d.owner === \"service\" ? [] : [d.owner.input];\n\treturn [\n\t\t\"COMPOSER\",\n\t\t...segments,\n\t\t...owner,\n\t\td.name\n\t].join(\"_\").toUpperCase();\n};\n/**\n* Typed value → its stored string. Service-own literals are JSON-encoded; a\n* dependency-input value is a provisioning ref at deploy (and a resolved\n* string at boot) and passes through untouched — LANDMINE: JSON-encoding it\n* would break the ordering edge Alchemy resolves through it.\n*/\nfunction encode(owner, value) {\n\treturn owner === \"service\" ? JSON.stringify(value) : blindCast(value);\n}\n/** Reverses `encode`: JSON-parse a service-own value, take a dependency-input value raw. */\nfunction decode(owner, raw) {\n\treturn owner === \"service\" ? JSON.parse(raw) : raw;\n}\nconst PARAM_POINTER_PREFIX = \"@composer-param-pointer:\";\n/** True iff `raw` is a param pointer row (as opposed to a JSON-encoded literal). */\nconst isParamPointerRow = (raw) => raw.startsWith(PARAM_POINTER_PREFIX);\n/** Builds a param pointer row's stored value from the platform var NAME it points to. */\nconst encodeParamPointer = (name) => `${PARAM_POINTER_PREFIX}${name}`;\n/** Reverses `encodeParamPointer`: the platform var NAME a pointer row points to. */\nconst decodeParamPointer = (raw) => raw.slice(24);\nfunction coerce(raw, d, key) {\n\tif (!(raw !== void 0 && raw !== \"\")) {\n\t\tif (d.param.default !== void 0) return d.param.default;\n\t\tif (d.param.optional === true) return void 0;\n\t\tthrow new Error(`missing required config param \"${d.name}\" (env ${key})`);\n\t}\n\tif (d.owner === \"service\" && isParamPointerRow(raw)) return coerceEnvSourcedParam(raw, d, key);\n\ttry {\n\t\treturn standardValidateSync(d.param.schema, decode(d.owner, raw));\n\t} catch (cause) {\n\t\tconst message = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow new Error(`invalid value for config param \"${d.name}\" (env ${key}): ${message}`);\n\t}\n}\n/**\n* Boot resolution for an env-sourced param: double-lookup (pointer → platform\n* var), then the param's own schema on the raw string — no JSON decode, and\n* no redaction (it's config, not a secret). An UNSET platform var is a loud\n* boot failure naming both the param and the platform var; an EMPTY string is\n* not special-cased here — it reaches the schema like any other value, so it\n* passes iff the schema accepts it (deliberately unlike a literal param's own\n* \"\"-means-absent rule, and unlike a secret's non-empty requirement).\n*/\nfunction coerceEnvSourcedParam(raw, d, key) {\n\tconst platformVar = decodeParamPointer(raw);\n\tconst value = process.env[platformVar];\n\tif (value === void 0) throw new Error(`env-sourced config param \"${d.name}\" (env ${key} → ${platformVar}) is unset: the platform variable \"${platformVar}\" was not injected — the deploy did not provision it.`);\n\ttry {\n\t\treturn standardValidateSync(d.param.schema, value);\n\t} catch (cause) {\n\t\tconst message = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow new Error(`invalid value for env-sourced config param \"${d.name}\" (env ${key} → ${platformVar}): ${message}`);\n\t}\n}\n/**\n* Boot: read each declared param from env by its key, reverse the param's own\n* serialization (missing/invalid fails loudly), assemble the typed Config.\n* Secrets ride a separate channel (deserializeSecrets), not this one.\n*/\nconst deserialize = (node, address) => {\n\tconst service = {};\n\tconst inputs = {};\n\tfor (const d of paramEntries(node)) {\n\t\tconst key = configKey(address, d);\n\t\tconst value = coerce(process.env[key], d, key);\n\t\tif (d.owner === \"service\") service[d.name] = value;\n\t\telse {\n\t\t\tlet bucket = inputs[d.owner.input];\n\t\t\tif (bucket === void 0) {\n\t\t\t\tbucket = {};\n\t\t\t\tinputs[d.owner.input] = bucket;\n\t\t\t}\n\t\t\tbucket[d.name] = value;\n\t\t}\n\t}\n\treturn {\n\t\tservice,\n\t\tinputs\n\t};\n};\n/**\n* run()'s setup step: write the resolved config to the environment under\n* address-free keys (configKey(\"\", d) + each serialize suffix), which load()\n* reads back with no address. Uses env, not a module variable, because a\n* framework may fork worker processes that inherit env but not memory.\n* Writes only these keys; nothing else is touched.\n*/\nconst stash = (node, config) => {\n\tfor (const d of paramEntries(node)) {\n\t\tconst value = d.owner === \"service\" ? config.service[d.name] : config.inputs[d.owner.input]?.[d.name];\n\t\tif (value === void 0) continue;\n\t\tprocess.env[configKey(\"\", d)] = encode(d.owner, value);\n\t}\n};\n/** The pointer-row key for a secret slot: COMPOSER_<addr>_<slot> (secrets are service-level). */\nconst secretKey = (address, slot) => configKey(address, {\n\towner: \"service\",\n\tname: slot\n});\n/**\n* Deploy: the pointer rows for a node's secret slots — each slot's key mapped to\n* the platform NAME the root bound it to (looked up in `graph.secrets`). Never a\n* value. A declared slot with no binding is a Load-invariant violation (Load\n* binds every slot), surfaced loudly here rather than written as a blank row.\n*/\nfunction secretPointerRows(node, address, bindings) {\n\tconst rows = [];\n\tfor (const slot of Object.keys(node.secretSlots)) {\n\t\tconst binding = bindings.find((b) => b.serviceAddress === address && b.slot === slot);\n\t\tif (binding === void 0) throw new Error(`secret slot \"${slot}\" of \"${address}\" has no bound platform name — Load should have bound it (ADR-0029).`);\n\t\trows.push({\n\t\t\tkey: secretKey(address, slot),\n\t\t\tname: secretName(binding)\n\t\t});\n\t}\n\treturn rows;\n}\n/**\n* Boot: resolve every secret slot to its value by double-lookup — read the\n* pointer key (the platform NAME), then read that platform var. A missing\n* pointer or a missing/empty platform value is a loud failure naming both keys.\n* Returns a plain Record for core's `hydrateSecrets` to box.\n*/\nconst deserializeSecrets = (node, address) => {\n\tconst values = {};\n\tfor (const slot of Object.keys(node.secretSlots)) {\n\t\tconst key = secretKey(address, slot);\n\t\tconst name = process.env[key];\n\t\tif (name === void 0 || name === \"\") throw new Error(`missing secret pointer for slot \"${slot}\" (env ${key}) — the deploy did not write it.`);\n\t\tconst value = process.env[name];\n\t\tif (value === void 0 || value === \"\") throw new Error(`secret \"${slot}\" is not provisioned (env ${key} → ${name}): the platform var \"${name}\" is unset or empty.`);\n\t\tvalues[slot] = value;\n\t}\n\treturn values;\n};\n/**\n* run()'s setup step for secrets: re-emit each slot's pointer NAME under its\n* address-free key, so the address-free `deserializeSecrets` double-looks-up\n* identically. Never the value — the value stays only in the platform var.\n*/\nconst stashSecrets = (node, address) => {\n\tfor (const slot of Object.keys(node.secretSlots)) {\n\t\tconst name = process.env[secretKey(address, slot)];\n\t\tif (name === void 0) continue;\n\t\tprocess.env[secretKey(\"\", slot)] = name;\n\t}\n};\n/**\n* Boot: for each reserved provider param, read its address-scoped row through\n* the same `coerce` a declared param uses (JSON-decode, schema-validate), and\n* re-emit it address-free — `stash`'s counterpart for this separate\n* declaration space. A param is declared optional here unconditionally: an\n* absent row means \"never provisioned\" (local dev, tests, a provider with no\n* registered value for this deploy), never a boot failure, so nothing is\n* stashed and the runtime reader that owns this slot falls back to its own\n* pass-through behavior.\n*/\nfunction stashProviderParams(entries, address) {\n\tfor (const entry of entries) {\n\t\tconst d = {\n\t\t\towner: \"service\",\n\t\t\tname: entry.name,\n\t\t\tparam: {\n\t\t\t\tschema: entry.schema,\n\t\t\t\toptional: true\n\t\t\t}\n\t\t};\n\t\tconst key = configKey(address, d);\n\t\tconst value = coerce(process.env[key], d, key);\n\t\tif (value === void 0) continue;\n\t\tprocess.env[configKey(\"\", d)] = encode(\"service\", value);\n\t}\n}\n/** The framework-resolved origin row: COMPOSER_<addr>_ORIGIN. Written per\n* compute service at serialize — the service's own provisioned endpoint URL,\n* riding the reserved-provider-param machinery (`origin-key.ts`'s\n* `ORIGIN_PARAM`); never a declared param, never in config(). A harness with\n* no deploy behind it supplies it by setting `COMPOSER_ORIGIN` to the\n* JSON-encoded origin URL — exactly how the existing entrypoint tests supply\n* their other `COMPOSER_*` rows. */\nconst ORIGIN_KEY_NAME = \"ORIGIN\";\n/**\n* Reads this service's origin back out of the address-free stash\n* `stashProviderParams` wrote for the ORIGIN entry. `COMPOSER_ORIGIN` unset is\n* a loud failure — a deployed environment always writes it, so an unset row\n* means either a local harness that hasn't supplied it or a boot() called\n* before run().\n*/\nfunction readOrigin() {\n\tconst d = {\n\t\towner: \"service\",\n\t\tname: ORIGIN_KEY_NAME,\n\t\tparam: {\n\t\t\tschema: type(\"string\"),\n\t\t\toptional: true\n\t\t}\n\t};\n\tconst key = configKey(\"\", d);\n\tconst value = coerce(process.env[key], d, key);\n\tif (value === void 0) throw new Error(\"this service's origin is not available (env COMPOSER_ORIGIN is unset) — a deployed environment writes it automatically; a local harness must supply it like any other config value (set COMPOSER_ORIGIN to the JSON-encoded origin URL).\");\n\treturn blindCast(value);\n}\n/** Synchronous Standard Schema validation — see the matching note in core's `config.ts`. */\nfunction standardValidateSync(schema, value) {\n\tconst result = schema[\"~standard\"].validate(value);\n\tif (result instanceof Promise) throw new Error(\"config param schema validation must be synchronous — async Standard Schema validators are not supported for config params\");\n\tif (result.issues !== void 0) throw new Error(`config param validation failed: ${result.issues.map((issue) => issue.message).join(\"; \")}`);\n\treturn result.value;\n}\n//#endregion\nexport { encode as a, readOrigin as c, stashProviderParams as d, stashSecrets as f, deserializeSecrets as i, secretPointerRows as l, secretName as m, configKey as n, encodeParamPointer as o, envSecret as p, deserialize as r, paramEntries as s, ORIGIN_KEY_NAME as t, stash as u };\n\n//# sourceMappingURL=serializer-D8_84XWO.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,6BAA6B,UAAU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oB,SAAS,SAAS;CAC9C,KAAK,MAAM,SAAS,SAAS;EAC5B,MAAM,IAAI;GACT,OAAO;GACP,MAAM,MAAM;GACZ,OAAO;IACN,QAAQ,MAAM;IACd,UAAU;GACX;EACD;EACA,MAAM,MAAM,UAAU,SAAS,CAAC;EAChC,MAAM,QAAQ,OAAO,QAAQ,IAAI,MAAM,GAAG,GAAG;EAC7C,IAAI,UAAU,KAAK,GAAG;EACtB,QAAQ,IAAI,UAAU,IAAI,CAAC,KAAK,OAAO,WAAW,KAAK;CACxD;AACD;;;;;;;;AAQA,MAAM,kBAAkB;;;;;;;;AAQxB,SAAS,aAAa;CACrB,MAAM,IAAI;EACT,OAAO;EACP,MAAM;EACN,OAAO;GACN,QAAQ,KAAK,QAAQ;GACrB,UAAU;EACX;CACD;CACA,MAAM,MAAM,UAAU,IAAI,CAAC;CAC3B,MAAM,QAAQ,OAAO,QAAQ,IAAI,MAAM,GAAG,GAAG;CAC7C,IAAI,UAAU,KAAK,GAAG,MAAM,IAAI,MAAM,0OAA0O;CAChR,OAAO,UAAU,KAAK;AACvB;;AAEA,SAAS,qBAAqB,QAAQ,OAAO;CAC5C,MAAM,SAAS,OAAO,YAAY,CAAC,SAAS,KAAK;CACjD,IAAI,kBAAkB,SAAS,MAAM,IAAI,MAAM,2HAA2H;CAC1K,IAAI,OAAO,WAAW,KAAK,GAAG,MAAM,IAAI,MAAM,mCAAmC,OAAO,OAAO,KAAK,UAAU,MAAM,OAAO,CAAC,CAAC,KAAK,IAAI,GAAG;CACzI,OAAO,OAAO;AACf"}
@@ -1,31 +1,68 @@
1
- import { Contract, DependencyEnd, ModuleNode } from "@prisma/composer";
2
-
1
+ import { BuildAdapter, Contract, DependencyEnd, Deps, Expose, HydratedDeps, ModuleNode, NODE, Params, RunnableServiceNode, SecretValues, Secrets, ServiceNode, Values } from "@prisma/composer";
2
+ import "@standard-schema/spec";
3
3
  //#region ../../1-prisma-cloud/1-extensions/target/dist/index.d.mts
4
4
  //#endregion
5
+ //#region src/compute.d.ts
6
+ declare const reservedParams: {
7
+ readonly port: import("@prisma/composer").ConfigParam<import("@standard-schema/spec").StandardSchemaV1<number, number>>;
8
+ };
9
+ type ReservedParams = typeof reservedParams;
10
+ /**
11
+ * A Prisma Compute service — declarations only (deps + params + build + the
12
+ * ports it exposes), no descriptor. `params` merges with the reserved
13
+ * `ReservedParams` (`port`); a user param whose name collides with a reserved
14
+ * one fails at authoring, the same way a colliding dependency name does.
15
+ *
16
+ * · run(address, boot) — the process controller: deserialize the platform
17
+ * environment (keyed off `address`, the extension's ONE env read) into a
18
+ * typed Config, re-emit it under address-free process-local stash keys,
19
+ * then call boot() to start the app's entry.
20
+ * · load() / config() — called from inside the app's entry: read the stash;
21
+ * load() hydrates + memoizes the deps, config() returns the typed params.
22
+ * Separate accessors so a dep and a param never share a namespace (ADR-0021).
23
+ * · origin() — this service's platform-assigned public origin, read from the
24
+ * stash `run()` populates; memoized per process.
25
+ *
26
+ * The underlying node carries `extension: '@prisma/composer-prisma-cloud'` —
27
+ * the control-plane registry key `prisma-composer deploy` resolves through the
28
+ * app's `prisma-composer.config.ts` (ADR-0017). This module loads nothing at
29
+ * deploy time; nodes are pure data until run() or load() is called.
30
+ */
31
+ declare class ComputeService<D extends Deps, P extends Params, E extends Expose, S extends Secrets> implements RunnableServiceNode<D, P & ReservedParams, E, S> {
32
+ #private;
33
+ readonly [NODE]: true;
34
+ readonly kind: 'service';
35
+ readonly name: string;
36
+ readonly extension: string;
37
+ readonly type: string;
38
+ readonly inputs: D;
39
+ readonly params: P & ReservedParams;
40
+ readonly secretSlots: S;
41
+ readonly build: BuildAdapter;
42
+ readonly expose: E | undefined;
43
+ constructor(node: ServiceNode<D, P & ReservedParams, E, S>);
44
+ run(address: string, boot: () => Promise<unknown>): Promise<unknown>;
45
+ load(): HydratedDeps<D>;
46
+ config(): Values<P & ReservedParams>;
47
+ secrets(): SecretValues<S>;
48
+ /** This service's platform-assigned public origin — read from the stash
49
+ * run() populates and memoized per process. Throws if called before run()
50
+ * has stashed it (readOrigin's pinned message). */
51
+ origin(): string;
52
+ }
53
+ //#endregion
5
54
  //#region src/postgres.d.ts
6
55
  interface PostgresConfig {
7
56
  readonly url: string;
8
57
  }
9
- /**
10
- * The contract a Postgres provides — and the contract its consumers require.
11
- * `satisfies` compares KIND, not identity: an extension module can be duplicated
12
- * across a workspace (same rationale as the Symbol.for node brand), and every
13
- * duplicate's contract must still satisfy. `__cmp` is the connection config a
14
- * postgres offers; core never inspects it.
15
- */
16
58
  //#endregion
17
59
  //#region src/s3-credentials.d.ts
18
60
  interface CredentialsConfig {
19
61
  readonly accessKeyId: string;
20
62
  readonly secretAccessKey: string;
21
63
  }
22
- /**
23
- * The contract the `s3-credentials` resource provides — a minted SigV4 key
24
- * pair. `satisfies` compares KIND only (mirrors `postgresContract`); `__cmp` is
25
- * the config the resource offers, which core never inspects.
26
- */
27
64
  //#endregion
28
- //#region ../../1-prisma-cloud/2-shared-modules/storage/dist/storage-service-Dl8holZ2.d.mts
65
+ //#region ../../1-prisma-cloud/2-shared-modules/storage/dist/storage-service-CVf6j3HC.d.mts
29
66
  //#region src/contract.d.ts
30
67
  interface S3Config {
31
68
  readonly url: string;
@@ -39,17 +76,16 @@ type S3Contract = typeof s3Contract;
39
76
  * A consumer's dependency on an S3-compatible store. No `region` in the
40
77
  * binding — the server accepts whatever region string the client signed.
41
78
  */
42
- declare function s3(): DependencyEnd<S3Config, typeof s3Contract>; //#endregion
79
+ declare function s3(): DependencyEnd<S3Config, typeof s3Contract>;
80
+ //#endregion
43
81
  //#region src/storage-service.d.ts
44
82
  declare function storageService(opts: {
45
83
  bucket: string;
46
- }): import("@prisma/composer").RunnableServiceNode<{
84
+ }): ComputeService<{
47
85
  db: import("@prisma/composer").DependencyEnd<PostgresConfig, import("@prisma/composer").Contract<"postgres", PostgresConfig>>;
48
86
  credentials: import("@prisma/composer").DependencyEnd<CredentialsConfig, import("@prisma/composer").Contract<"credentials", CredentialsConfig>>;
49
87
  }, {
50
88
  bucket: import("@prisma/composer").ConfigParam<import("@standard-schema/spec").StandardSchemaV1<string, string>>;
51
- } & {
52
- readonly port: import("@prisma/composer").ConfigParam<import("@standard-schema/spec").StandardSchemaV1<number, number>>;
53
89
  }, {
54
90
  store: import("@prisma/composer").Contract<"s3", S3Config>;
55
91
  }, Record<never, never>>;
@@ -61,7 +97,7 @@ declare function storage(opts?: {
61
97
  bucket?: string;
62
98
  }): ModuleNode<Record<never, never>, {
63
99
  store: typeof s3Contract;
64
- }, Record<never, never>>; //#endregion
100
+ }, Record<never, never>>;
65
101
  //#endregion
66
102
  export { type S3Config, type S3Contract, s3, s3Contract, storage, storageService };
67
103
  //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../1-prisma-cloud/1-extensions/target/dist/index.d.mts","../../../../1-prisma-cloud/2-shared-modules/storage/dist/storage-service-CVf6j3HC.d.mts","../../../../1-prisma-cloud/2-shared-modules/storage/dist/index.d.mts"],"mappings":";;;;;cA0Cc;WACH,+BAA+B,4CAA4C;;KAEjF,wBAAwB;;;;;;;;;;;;;;;;;;;;;;cAsBf,eAAe,UAAU,MAAM,UAAU,QAAQ,UAAU,QAAQ,UAAU,oBAAoB,oBAAoB,GAAG,IAAI,gBAAgB,GAAG;;YAEjJ;WACD;WACA;WACA;WACA;WACA,QAAQ;WACR,QAAQ,IAAI;WACZ,aAAa;WACb,OAAO;WACP,QAAQ;EACjB,YAAY,MAAM,YAAY,GAAG,IAAI,gBAAgB,GAAG;EACxD,IAAI,iBAAiB,YAAY,mBAAmB;EACpD,QAAQ,aAAa;EACrB,UAAU,OAAO,IAAI;EACrB,WAAW,aAAa;;;;EAIxB;;;;UA+DQ;WACC;;;;UAiDD;WACC;WACA;;;;;UCxMD;WACC;WACA;WACA;WACA;;cAEG,YAAY,eAAe;KACpC,oBAAoB;;;;;iBAKR,MAAM,cAAc,iBAAiB;;;iBAGrC,eAAe;EAC9B;IAQC;EAND,6BAA6B,cAHd,yCAGsG,qBAAzC;EAC5E,sCAAsC,cADqI,4CAC1C,wBAA5C;;EAErF,iCAAiC,4CAA4C;;EAE7E,gCAAgC,eAAe;GAC9C;;;;iBCvBc,QAAQ;EACvB;EACA;IACE,WAAW;EACb,cAAc;GACb"}