@prisma/composer-prisma-cloud 0.6.0-dev.10 → 0.6.0-dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/control.mjs CHANGED
@@ -2,7 +2,7 @@ import { o as paramBindingFor, s as paramName } from "./secret-Doubjztg-CWHCDiuX
2
2
  import { a as encodeParamPointer, i as encode, l as serializeInput, n as configKey, o as paramEntries } from "./serializer-Ch1Tmx-2-D7cNhkEp.mjs";
3
3
  import { a as provisionedEdges, n as SELF_ORIGIN, r as STREAMS_API_KEY, t as RESERVED_PROVIDER_PARAMS } from "./provisioned-edges-COr17uxy-DymAGn_V.mjs";
4
4
  import { n as requiredPackHeadOf } from "./required-pack-head-BrrJarzc-DeP50pBu.mjs";
5
- import { A as packageComputeArtifact, B as call, D as EnvironmentVariable, E as Deployment, F as resolveDefaultBranchId, H as layer, I as MANAGEMENT_API_ORIGIN, L as ManagementClient, M as BucketKey, N as collectPages, O as ServiceKey, P as drivePagesAsync, R as PrismaApiError, S as Database, T as ComputeService, V as fromEnv, _ as resolveTargetRef, a as PgWarmProvider, b as providers, d as collectPreflightNames, f as containerDescriptor, g as resolvePrismaNextConfig, h as prismaCloudContainerOf, i as PgWarm, j as Bucket, k as ServiceKeyProvider, l as S3Credentials, m as packHeadRefHashes, n as GeneratedParamProvider, o as PnMigration, r as PRISMA_CLOUD_EXTENSION_ID, s as PnMigrationProvider, t as GeneratedParam, u as S3CredentialsProvider, w as COMPUTE_REGIONS, x as Connection, z as PrismaCredentials } from "./s3-credentials-resource-BMsm9nho-Cpc28adr.mjs";
5
+ import { A as packageComputeArtifact, B as call, D as EnvironmentVariable, E as Deployment, F as resolveDefaultBranchId, H as layer, I as MANAGEMENT_API_ORIGIN, L as ManagementClient, M as BucketKey, N as collectPages, O as ServiceKey, P as drivePagesAsync, R as PrismaApiError, S as Database, T as ComputeService, V as fromEnv, _ as resolveTargetRef, a as PgWarmProvider, b as providers, d as collectPreflightNames, f as containerDescriptor, g as resolvePrismaNextConfig, h as prismaCloudContainerOf, i as PgWarm, j as Bucket, k as ServiceKeyProvider, l as S3Credentials, m as packHeadRefHashes, n as GeneratedParamProvider, o as PnMigration, r as PRISMA_CLOUD_EXTENSION_ID, s as PnMigrationProvider, t as GeneratedParam, u as S3CredentialsProvider, w as COMPUTE_REGIONS, x as Connection, z as PrismaCredentials } from "./s3-credentials-resource-DOjmcHZh-D4jQK_9K.mjs";
6
6
  import { n as isPnPostgresResourceNode } from "./prisma-next-DmPGOIm2-3V7kdn8T.mjs";
7
7
  import { isParamSource } from "@prisma/composer";
8
8
  import { blindCast } from "@prisma/composer/casts";
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":["os","Prisma.Bucket","Prisma.BucketKey","Prisma.ComputeService","Prisma.EnvironmentVariable","Prisma.packageComputeArtifact","Prisma.Deployment","Prisma.Database","Prisma.Connection","managementClientLayer","Prisma.ServiceKey","Prisma.COMPUTE_REGIONS","Prisma.providers","Prisma.ServiceKeyProvider"],"sources":["../../../1-prisma-cloud/0-lowering/lowering/dist/state.mjs","../../../1-prisma-cloud/1-extensions/target/dist/control.mjs"],"sourcesContent":["import { a as MANAGEMENT_API_ORIGIN, c as PrismaCredentials, l as fromEnv, n as call, o as ManagementClient, s as layer, t as PrismaApiError } from \"./http-SWyaVRHS.mjs\";\nimport { a as resolveDefaultBranchId, o as collectPages } from \"./container-BNuTukFR.mjs\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Data from \"effect/Data\";\nimport { Stack } from \"alchemy\";\nimport * as os from \"node:os\";\nimport { State, makeHttpStateStore } from \"alchemy/State\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport * as HttpClientRequest from \"effect/unstable/http/HttpClientRequest\";\nimport * as Headers from \"effect/unstable/http/Headers\";\n//#region src/state/empty-scope.ts\n/**\n* Whether the platform state API holds any resources for (stack, stage).\n* Requires the live deploy lease — the listing runs under it, like every\n* state operation.\n*/\nconst scopeOccupied = (client, scope, lease) => call(() => client.GET(\"/v1/projects/{projectId}/branches/{branchId}/alchemy-state/state/stacks/{stack}/stages/{stage}/resources\", { params: {\n\tpath: {\n\t\tprojectId: scope.projectId,\n\t\tbranchId: scope.branchId,\n\t\tstack: scope.stack,\n\t\tstage: scope.stage\n\t},\n\theader: { \"alchemy-state-lease-id\": Redacted.value(lease.leaseId) }\n} })).pipe(Effect.map((fqns) => fqns.length > 0));\nconst listBranchResources = (client, projectId, branchId) => Effect.gen(function* () {\n\tconst query = (cursor) => cursor === void 0 ? {\n\t\tprojectId,\n\t\tbranchId\n\t} : {\n\t\tprojectId,\n\t\tbranchId,\n\t\tcursor\n\t};\n\tconst apps = yield* collectPages(`apps on branch ${branchId}`, (cursor) => call(() => client.GET(\"/v1/apps\", { params: { query: query(cursor) } })));\n\tconst databases = yield* collectPages(`databases on branch ${branchId}`, (cursor) => call(() => client.GET(\"/v1/databases\", { params: { query: query(cursor) } })));\n\tconst buckets = yield* collectPages(`buckets on branch ${branchId}`, (cursor) => call(() => client.GET(\"/v1/buckets\", { params: { query: query(cursor) } })));\n\treturn [\n\t\t...apps.map((r) => ({\n\t\t\tkind: \"app\",\n\t\t\tname: r.name\n\t\t})),\n\t\t...databases.map((r) => ({\n\t\t\tkind: \"database\",\n\t\t\tname: r.name\n\t\t})),\n\t\t...buckets.map((r) => ({\n\t\t\tkind: \"bucket\",\n\t\t\tname: r.name\n\t\t}))\n\t];\n});\n/**\n* The empty-scope-with-live-resources case: the platform state API holds no\n* resources for (stack, stage) while the platform already has Compute apps,\n* databases, or buckets on the target Branch — this stage predates the\n* platform state API (its state lives in a legacy `prisma-composer-state`\n* database, which is never read; there is no automatic migration), or the\n* deploy targets a project that already runs something. Deploying would\n* recreate every resource and die in per-resource `already_exists` failures —\n* so fail once, up front. A genuinely fresh deploy sees an empty Branch and\n* passes. Connections are not counted: they are children of databases, which\n* are. Local dev never reaches this — the dev stack pins\n* `state: localState()` (generate-dev-stack.ts).\n*/\nconst failOnEmptyScopeWithLiveResources = (projectId, branchId, stack, stage) => Effect.gen(function* () {\n\tconst client = yield* ManagementClient;\n\tconst resources = yield* listBranchResources(client, projectId, branchId);\n\tif (resources.length === 0) return;\n\tconst names = resources.map((r) => `${r.kind} \"${r.name}\"`).join(\", \");\n\treturn yield* Effect.fail(new PrismaApiError({\n\t\tstatus: 0,\n\t\tmessage: `the platform state API holds no deploy state for stage \"${stage}\" (stack \"${stack}\"), but the platform already has ${String(resources.length)} resource(s) on the target branch ${branchId}: ${names}. This stage predates the platform state API. With no state, a deploy would recreate every resource and fail with already_exists, and a destroy would remove nothing. Destroy the stage with the previous version of composer, or delete the stage (its branch — or the project, for production) in the Prisma Console or via the Management API — then redeploy fresh. If those resources are another deployment's, remove them or deploy into a different project. Then retry.`\n\t}));\n});\n//#endregion\n//#region src/state/errors.ts\n/**\n* An operator-facing failure from the hosted-state bootstrap pipeline\n* (branch resolution, lease acquisition, or the migration guard) — what a\n* deployer actually sees, instead of a raw Effect defect.\n*/\nvar HostedStateBootstrapError = class extends Data.TaggedError(\"HostedStateBootstrapError\") {\n\tget message() {\n\t\treturn `hosted-state bootstrap failed in ${this.container}: ${this.step} — ${this.reason}`;\n\t}\n};\n/**\n* Builds a {@link HostedStateBootstrapError} from whatever the failed step\n* threw. Never retains the raw API error object as `cause`: only the\n* extracted message text survives into the operator-facing error, so a\n* credential or lease id carried on the raw error can never leak.\n*/\nconst hostedStateBootstrapError = (container, step, cause) => new HostedStateBootstrapError({\n\tcontainer,\n\tstep,\n\treason: cause instanceof Error ? cause.message : String(cause)\n});\n//#endregion\n//#region src/state/lease.ts\n/** The header every state operation and lease call carries. Its value is a capability token — never log it. */\nconst LEASE_HEADER = \"Alchemy-State-Lease-Id\";\n/**\n* Adds the lease header to effect's redacted header names (alongside the\n* defaults such as `authorization`), so a logged failed request renders the\n* lease id as `<redacted>`. Merged into the state layer's outputs.\n*/\nconst redactLeaseHeader = Layer.effect(Headers.CurrentRedactedNames, Effect.gen(function* () {\n\treturn [...yield* Headers.CurrentRedactedNames, LEASE_HEADER];\n}));\nconst LEASE_PATH = \"/v1/projects/{projectId}/branches/{branchId}/alchemy-state/lease\";\n/** The server names the current holder in its 409 message; pass it through verbatim, hint appended. */\nconst serverErrorText = (error) => error.error.hint === void 0 ? error.error.message : `${error.error.message} ${error.error.hint}`;\nconst transportError = (cause) => new PrismaApiError({\n\tstatus: 0,\n\tmessage: String(cause)\n});\n/** Best-effort `user@host`, echoed in the contention error a blocked deploy sees. */\nconst holderDescription = () => {\n\ttry {\n\t\treturn `${os.userInfo().username}@${os.hostname()}`;\n\t} catch {\n\t\treturn \"unknown\";\n\t}\n};\n/**\n* Acquires the (stack, stage) deploy lease. Contention (409) fails fast with\n* the server's message naming the current holder — no queueing, no retry.\n* The server's default TTL (60s) applies; no `ttlSeconds` is sent.\n*/\nconst acquireDeployLease = (client, scope) => Effect.tryPromise({\n\ttry: () => client.POST(LEASE_PATH, {\n\t\tparams: { path: {\n\t\t\tprojectId: scope.projectId,\n\t\t\tbranchId: scope.branchId\n\t\t} },\n\t\tbody: {\n\t\t\tstack: scope.stack,\n\t\t\tstage: scope.stage,\n\t\t\tholderDescription: holderDescription()\n\t\t}\n\t}),\n\tcatch: transportError\n}).pipe(Effect.flatMap((r) => {\n\tconst status = r.response.status;\n\tif (r.error !== void 0) return Effect.fail(new PrismaApiError({\n\t\tstatus,\n\t\tmessage: serverErrorText(r.error)\n\t}));\n\tif (r.data !== void 0) return Effect.succeed({\n\t\tleaseId: Redacted.make(r.data.data.leaseId),\n\t\texpiresAt: r.data.data.expiresAt\n\t});\n\treturn Effect.fail(new PrismaApiError({\n\t\tstatus,\n\t\tmessage: `lease acquisition returned HTTP ${String(status)} with no error body`\n\t}));\n}));\n/**\n* Extends the lease on a fixed cadence (TTL/3) until interrupted. A 404 means\n* the lease was lost — log one loud warning and stop; enforcement is\n* server-side, so the run's next state operation fails with 409. Any other\n* heartbeat failure is ignored and the next tick retries; the heartbeat never\n* fails the run.\n*/\nconst heartbeatDeployLease = (client, scope, lease, every = \"20 seconds\") => Effect.gen(function* () {\n\twhile (true) {\n\t\tyield* Effect.sleep(every);\n\t\tif ((yield* Effect.tryPromise(() => client.PATCH(LEASE_PATH, { params: {\n\t\t\tpath: {\n\t\t\t\tprojectId: scope.projectId,\n\t\t\t\tbranchId: scope.branchId\n\t\t\t},\n\t\t\theader: { \"alchemy-state-lease-id\": Redacted.value(lease.leaseId) }\n\t\t} })).pipe(Effect.map((r) => r.response.status), Effect.catch(() => Effect.succeed(0)))) === 404) {\n\t\t\tyield* Effect.logWarning(`the deploy lease for stage \"${scope.stage}\" was lost (heartbeat returned 404) — another deploy may have taken over; the next state operation of this run will fail.`);\n\t\t\treturn;\n\t\t}\n\t}\n});\n/**\n* Releases the lease on clean exit. Never fails: a 404 (lease already\n* expired or replaced) or any other failure is logged, not thrown — the run\n* already completed.\n*/\nconst releaseDeployLease = (client, scope, lease) => Effect.tryPromise(() => client.DELETE(LEASE_PATH, { params: {\n\tpath: {\n\t\tprojectId: scope.projectId,\n\t\tbranchId: scope.branchId\n\t},\n\theader: { \"alchemy-state-lease-id\": Redacted.value(lease.leaseId) }\n} })).pipe(Effect.flatMap((r) => {\n\tconst status = r.response.status;\n\tif (status === 404) return Effect.logWarning(`releasing the deploy lease for stage \"${scope.stage}\" returned 404 — it had already expired or been replaced.`);\n\tif (status >= 200 && status < 300) return Effect.void;\n\treturn Effect.logWarning(`releasing the deploy lease for stage \"${scope.stage}\" returned HTTP ${String(status)} — the lease stays live until its TTL expires.`);\n}), Effect.catch((cause) => Effect.logWarning(`releasing the deploy lease for stage \"${scope.stage}\" failed: ${String(cause)}`)));\n//#endregion\n//#region src/state/layer.ts\n/**\n* The hosted Alchemy state store: alchemy's stock HTTP state client pointed\n* at the platform state API\n* (`/v1/projects/{projectId}/branches/{branchId}/alchemy-state`). On layer\n* init (scoped, once per stack run): resolve the stage's Branch, acquire the\n* (stack, stage) deploy lease, fork its heartbeat, run the migration guard,\n* and build the stock store. Finalizers (reverse order): interrupt the\n* heartbeat, release the lease. The Management API plumbing\n* (`ManagementClient`, `PrismaCredentials`) and the store's `HttpClient` are\n* provided internally, so the returned layer's only requirements are the\n* ones alchemy itself already provides to every state store\n* (`StackServices`).\n*\n* Any bootstrap failure is wrapped into an operator-facing\n* `HostedStateBootstrapError` (naming the Project/Branch and the step that\n* failed — see `errors.ts`) before dying the layer (loud, immediate,\n* unrecoverable) rather than surfacing as a typed error — matching core's\n* `LowerOptions.state: Layer.Layer<State, never, StackServices>` contract\n* and alchemy's own convention (e.g. a missing state store is `Effect.die`\n* in `Stack.make`).\n*/\nconst prismaStateLayer = (ids) => stateLayerAgainst(MANAGEMENT_API_ORIGIN, ids);\n/** `prismaStateLayer` with the API origin injectable — split out so tests can point it at a fake state API. */\nconst stateLayerAgainst = (apiOrigin, ids) => {\n\tconst { projectId, branchId, defaultBranchId } = ids;\n\tconst dependencies = layer({ apiOrigin }).pipe(Layer.provideMerge(fromEnv()));\n\treturn Layer.effect(State, Effect.gen(function* () {\n\t\tconst stack = yield* Stack;\n\t\tconst container = branchId === void 0 ? projectId : `${projectId}/${branchId}`;\n\t\tconst bootstrapError = (step) => (cause) => hostedStateBootstrapError(container, step, cause);\n\t\tconst mgmt = yield* ManagementClient;\n\t\tconst { token } = yield* PrismaCredentials;\n\t\tconst stateBranchId = branchId ?? defaultBranchId ?? (yield* resolveDefaultBranchId(mgmt, projectId).pipe(Effect.mapError(bootstrapError(\"resolving the stage branch\"))));\n\t\tconst scope = {\n\t\t\tprojectId,\n\t\t\tbranchId: stateBranchId,\n\t\t\tstack: stack.name,\n\t\t\tstage: stack.stage\n\t\t};\n\t\tconst lease = yield* acquireDeployLease(mgmt, scope).pipe(Effect.mapError(bootstrapError(\"acquiring the deploy lease\")));\n\t\tyield* Effect.addFinalizer(() => releaseDeployLease(mgmt, scope, lease));\n\t\tyield* Effect.forkScoped(heartbeatDeployLease(mgmt, scope, lease));\n\t\tif (!(yield* scopeOccupied(mgmt, scope, lease).pipe(Effect.mapError(bootstrapError(\"probing the deploy state scope\"))))) yield* failOnEmptyScopeWithLiveResources(projectId, stateBranchId, stack.name, stack.stage).pipe(Effect.provideService(ManagementClient, mgmt), Effect.mapError(bootstrapError(\"checking the empty deploy state scope\")));\n\t\tconst service = yield* makeHttpStateStore({\n\t\t\turl: `${apiOrigin}/v1/projects/${projectId}/branches/${stateBranchId}/alchemy-state`,\n\t\t\tauthToken: Redacted.value(token),\n\t\t\ttransformClient: (req) => HttpClientRequest.setHeader(req, LEASE_HEADER, Redacted.value(lease.leaseId)),\n\t\t\tid: \"prisma-postgres\"\n\t\t}).pipe(Effect.provide(FetchHttpClient.layer));\n\t\treturn Effect.succeed(service);\n\t}).pipe(Effect.provide(dependencies))).pipe(Layer.orDie, Layer.merge(redactLeaseHeader));\n};\n//#endregion\nexport { prismaStateLayer };\n\n//# sourceMappingURL=state.mjs.map","import { c as paramName, s as paramBindingFor } from \"./secret-Doubjztg.mjs\";\nimport { a as encodeParamPointer, i as encode, l as serializeInput, n as configKey, o as paramEntries } from \"./serializer-Ch1Tmx-2.mjs\";\nimport { n as RESERVED_PROVIDER_PARAMS, o as SELF_ORIGIN, r as STREAMS_API_KEY, t as provisionedEdges } from \"./provisioned-edges-COr17uxy.mjs\";\nimport { n as requiredPackHeadOf } from \"./required-pack-head-BrrJarzc.mjs\";\nimport { _ as prismaCloudContainerOf, a as PnMigrationProvider, c as resolvePrismaNextConfig, d as GeneratedParam, f as GeneratedParamProvider, h as containerDescriptor, i as PnMigration, l as PgWarm, n as S3CredentialsProvider, o as resolveTargetRef, p as PRISMA_CLOUD_EXTENSION_ID, r as collectPreflightNames, s as packHeadRefHashes, t as S3Credentials, u as PgWarmProvider } from \"./s3-credentials-resource-BMsm9nho.mjs\";\nimport { n as isPnPostgresResourceNode } from \"./prisma-next-DmPGOIm2.mjs\";\nimport { isParamSource } from \"@internal/core\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { RPC_PEER_KEY } from \"@internal/service-rpc\";\nimport * as Prisma from \"@internal/lowering\";\nimport { ManagementClient, drivePagesAsync, fromEnv, managementClientLayer } from \"@internal/lowering\";\nimport { prismaStateLayer } from \"@internal/lowering/state\";\nimport * as Output from \"alchemy/Output\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Redacted from \"effect/Redacted\";\nconst PRISMA_NAME_MIN = 3;\nconst PRISMA_NAME_MAX = 65;\nfunction validateName(value, source) {\n\tif (value.length < PRISMA_NAME_MIN || value.length > PRISMA_NAME_MAX) throw new Error(`prisma-cloud: ${source} \"${value}\" (${value.length} characters) is not a valid Prisma resource name — Prisma requires ${PRISMA_NAME_MIN}–${PRISMA_NAME_MAX} characters. Rename the provision id (or the deploy --name) to fit.`);\n}\nfunction isCloudApplication(value) {\n\treturn typeof value === \"object\" && value !== null && \"projectId\" in value && typeof value.projectId === \"string\" && \"branchId\" in value && (value.branchId === void 0 || typeof value.branchId === \"string\");\n}\n/** Narrows `ctx.application`, which core hands over as `unknown`, to this extension's own product; throws naming the hook when it hasn't run. */\nfunction cloudApplicationOf(application) {\n\tif (!isCloudApplication(application)) throw new Error(\"prisma-cloud: ctx.application is not this extension's application product — the prismaCloud() application hook must run before any node lowers.\");\n\treturn application;\n}\nfunction projectIdOf(application) {\n\treturn cloudApplicationOf(application).projectId;\n}\n//#endregion\n//#region src/descriptors/bucket.ts\n/**\n* One Bucket per module-provisioned bucket resource — `id` is the module\n* provision id, so a resource shared by several consumers is created exactly\n* once. A BucketKey is minted for the bucket: it is the reveal-once credential\n* carrier, and its attributes (endpoint, bucketName, accessKeyId,\n* secretAccessKey) become the four S3Config outputs consumers resolve by name.\n*/\nfunction bucketDescriptor(_o) {\n\tconst lowering = ({ id, application }) => Effect.gen(function* () {\n\t\tvalidateName(id, \"resource name (from provision id)\");\n\t\tconst branchId = cloudApplicationOf(application).branchId;\n\t\tconst bkt = yield* Prisma.Bucket(`${id}-bucket`, {\n\t\t\tprojectId: projectIdOf(application),\n\t\t\tname: id,\n\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t});\n\t\tconst key = yield* Prisma.BucketKey(`${id}-key`, {\n\t\t\tbucketId: bkt.id,\n\t\t\tname: id,\n\t\t\trole: \"read_write\"\n\t\t});\n\t\tconst secretAccessKey = Output.map(key.secretAccessKey, (v) => Redacted.value(v));\n\t\treturn {\n\t\t\toutputs: {\n\t\t\t\turl: key.endpoint,\n\t\t\t\tbucket: key.bucketName,\n\t\t\t\taccessKeyId: key.accessKeyId,\n\t\t\t\tsecretAccessKey\n\t\t\t},\n\t\t\tentities: [{\n\t\t\t\tkind: \"bucket\",\n\t\t\t\tid: bkt.id\n\t\t\t}]\n\t\t};\n\t});\n\treturn Object.assign(lowering, { kind: \"resource\" });\n}\n//#endregion\n//#region src/descriptors/compute.ts\n/** The `compute` node kind's descriptor: the four service hooks — provision, serialize, package, deploy. */\n/**\n* Returns the PRECISE descriptor type, not the erased `NodeDescriptor`: the\n* registry in control.ts erases it on assignment anyway (method bivariance),\n* but s3-store composes over these hooks and needs their P/S to stay visible.\n* Annotating this `NodeDescriptor` would force s3-store to cast them back.\n*/\nfunction computeDescriptor(o) {\n\treturn {\n\t\tkind: \"service\",\n\t\tprovision: ({ id, application }) => Effect.gen(function* () {\n\t\t\tvalidateName(id, \"service name (from provision id)\");\n\t\t\tconst projectId = projectIdOf(application);\n\t\t\tconst branchId = cloudApplicationOf(application).branchId;\n\t\t\tconst svc = yield* Prisma.ComputeService(`${id}-svc`, {\n\t\t\t\tprojectId,\n\t\t\t\tname: id,\n\t\t\t\tregion: o().region ?? \"us-east-1\",\n\t\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tserviceId: svc.id,\n\t\t\t\tprojectId,\n\t\t\t\tendpointDomain: svc.endpointDomain\n\t\t\t};\n\t\t}),\n\t\tserialize: (ctx, provisioned, config) => Effect.gen(function* () {\n\t\t\tconst { address, node, graph } = ctx;\n\t\t\tconst branchId = cloudApplicationOf(ctx.application).branchId;\n\t\t\tconst cls = branchId ? \"preview\" : \"production\";\n\t\t\tconst branch = branchId !== void 0 ? { branchId } : {};\n\t\t\tconst projectId = provisioned.projectId;\n\t\t\tconst svc = node;\n\t\t\tconst records = [];\n\t\t\tfor (const d of paramEntries(svc)) {\n\t\t\t\tconst value = d.owner === \"service\" ? config.service[d.name] : config.inputs[d.owner.input]?.[d.name];\n\t\t\t\tif (value === void 0) continue;\n\t\t\t\tconst key = configKey(address, d);\n\t\t\t\tconst rowValue = d.owner === \"service\" && isParamSource(value) ? encodeParamPointer(paramName(paramBindingFor(graph.params, address, d.name))) : encode(d.owner, value);\n\t\t\t\trecords.push(yield* Prisma.EnvironmentVariable(`${key}-var`, {\n\t\t\t\t\tprojectId,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: rowValue,\n\t\t\t\t\tclass: cls,\n\t\t\t\t\t...branch\n\t\t\t\t}));\n\t\t\t}\n\t\t\tconst inputRow = serializeInput(svc, address, graph.inputBindings.find((b) => b.serviceAddress === address)?.binding);\n\t\t\tif (inputRow !== void 0) {\n\t\t\t\trecords.push(yield* Prisma.EnvironmentVariable(`${inputRow.key}-var`, {\n\t\t\t\t\tprojectId,\n\t\t\t\t\tkey: inputRow.key,\n\t\t\t\t\tvalue: inputRow.value,\n\t\t\t\t\tclass: cls,\n\t\t\t\t\t...branch\n\t\t\t\t}));\n\t\t\t\tfor (const leaf of inputRow.generated) {\n\t\t\t\t\tconst resource = yield* GeneratedParam(`${inputRow.key}:${leaf.path}-generated`, { bytes: leaf.bytes });\n\t\t\t\t\trecords.push(yield* Prisma.EnvironmentVariable(`${leaf.varName}-var`, {\n\t\t\t\t\t\tprojectId,\n\t\t\t\t\t\tkey: leaf.varName,\n\t\t\t\t\t\tvalue: resource.value,\n\t\t\t\t\t\tclass: cls,\n\t\t\t\t\t\t...branch\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst exposes = svc.expose !== void 0 && Object.keys(svc.expose).length > 0;\n\t\t\tconst refsByBrand = /* @__PURE__ */ new Map();\n\t\t\tif (exposes) for (const edge of provisionedEdges(graph)) {\n\t\t\t\tif (edge.providerAddress !== address) continue;\n\t\t\t\tconst ref = ctx.provisioned.get(edge.edgeId);\n\t\t\t\tif (ref === void 0) continue;\n\t\t\t\tconst refs = refsByBrand.get(edge.brand) ?? [];\n\t\t\t\trefs.push(ref);\n\t\t\t\trefsByBrand.set(edge.brand, refs);\n\t\t\t}\n\t\t\tfor (const [brand, entry] of o().providerParams) {\n\t\t\t\tconst raw = \"valueForService\" in entry ? entry.valueForService(provisioned, address) : exposes ? entry.value(refsByBrand.get(brand) ?? []) : void 0;\n\t\t\t\tif (raw === void 0) continue;\n\t\t\t\tconst key = configKey(address, {\n\t\t\t\t\towner: \"service\",\n\t\t\t\t\tname: entry.name\n\t\t\t\t});\n\t\t\t\tconst value = Output.isOutput(raw) ? Output.map(raw, (v) => encode(\"service\", v)) : encode(\"service\", raw);\n\t\t\t\trecords.push(yield* Prisma.EnvironmentVariable(`${key}-var`, {\n\t\t\t\t\tprojectId,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue,\n\t\t\t\t\tclass: cls,\n\t\t\t\t\t...branch\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tenvironment: records,\n\t\t\t\tport: typeof config.service[\"port\"] === \"number\" ? config.service[\"port\"] : 3e3,\n\t\t\t\t...inputRow !== void 0 ? { input: inputRow } : {}\n\t\t\t};\n\t\t}),\n\t\tpackage: ({ id }, { assembled, address }) => Effect.try(() => Prisma.packageComputeArtifact({\n\t\t\tid,\n\t\t\tbundleDir: assembled.dir,\n\t\t\tappEntry: assembled.entry,\n\t\t\taddress\n\t\t})),\n\t\tdeploy: ({ id }, provisioned, artifact, serialized) => Effect.gen(function* () {\n\t\t\tconst deployment = yield* Prisma.Deployment(`${id}-deploy`, {\n\t\t\t\tcomputeServiceId: provisioned.serviceId,\n\t\t\t\tartifactPath: artifact.path,\n\t\t\t\tartifactHash: artifact.sha256,\n\t\t\t\tenvironment: serialized.environment,\n\t\t\t\tport: serialized.port\n\t\t\t});\n\t\t\tconst inputDetails = serialized.input !== void 0 ? { details: {\n\t\t\t\tinput: serialized.input.value,\n\t\t\t\t...serialized.input.absent.length > 0 ? { absent: serialized.input.absent.join(\"\\n\") } : {}\n\t\t\t} } : {};\n\t\t\treturn {\n\t\t\t\toutputs: {\n\t\t\t\t\turl: deployment.deployedUrl,\n\t\t\t\t\tprojectId: provisioned.projectId\n\t\t\t\t},\n\t\t\t\tentities: [{\n\t\t\t\t\tkind: \"compute-service\",\n\t\t\t\t\tid: provisioned.serviceId,\n\t\t\t\t\turl: deployment.deployedUrl,\n\t\t\t\t\t...inputDetails\n\t\t\t\t}]\n\t\t\t};\n\t\t})\n\t};\n}\n//#endregion\n//#region src/descriptors/postgres.ts\n/**\n* One Database per module-provisioned postgres resource — `id` is the\n* module provision id, so a resource shared by several consumers is created\n* exactly once.\n*/\nfunction postgresDescriptor(o) {\n\tconst lowering = ({ id, application }) => Effect.gen(function* () {\n\t\tvalidateName(id, \"resource name (from provision id)\");\n\t\tconst branchId = cloudApplicationOf(application).branchId;\n\t\tconst db = yield* Prisma.Database(`${id}-db`, {\n\t\t\tprojectId: projectIdOf(application),\n\t\t\tname: id,\n\t\t\tregion: o().region ?? \"us-east-1\",\n\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t});\n\t\tconst conn = yield* Prisma.Connection(`${id}-conn`, {\n\t\t\tdatabaseId: db.id,\n\t\t\tname: id\n\t\t});\n\t\tconst url = Output.map(conn.connectionString, (value) => Redacted.value(value));\n\t\treturn {\n\t\t\toutputs: { url: (yield* PgWarm(`${id}-warm`, { url })).url },\n\t\t\tentities: [{\n\t\t\t\tkind: \"postgres-database\",\n\t\t\t\tid: db.id\n\t\t\t}]\n\t\t};\n\t});\n\treturn Object.assign(lowering, { kind: \"resource\" });\n}\n//#endregion\n//#region src/preflight.ts\n/** production for the default stage; preview for a named stage — matching how the pack writes config rows. */\nconst classFor = (branchId) => branchId === void 0 ? \"production\" : \"preview\";\n/**\n* One page of the env-var list. The query is `blindCast` to `never` because\n* openapi-fetch types this path's query as `never` (an SDK path/operation\n* mismatch); that same workaround defeats the client's response-type inference,\n* so the result is projected to the small shape we actually read.\n*/\nasync function listEnvVars(client, query) {\n\treturn blindCast(await client.GET(\"/v1/environment-variables\", { params: { query: blindCast(query) } }));\n}\nasync function existsOnPlatform(client, projectId, branchId, key) {\n\tconst cls = classFor(branchId);\n\tconst visible = (row) => branchId === void 0 || row.branchId === null || row.branchId === branchId;\n\tlet found = false;\n\tawait drivePagesAsync(`environment variables named \"${key}\"`, async (cursor) => {\n\t\tconst res = await listEnvVars(client, cursor === void 0 ? {\n\t\t\tprojectId,\n\t\t\tclass: cls,\n\t\t\tkey\n\t\t} : {\n\t\t\tprojectId,\n\t\t\tclass: cls,\n\t\t\tkey,\n\t\t\tcursor\n\t\t});\n\t\tif (res.error !== void 0) throw listFailedError(key, res.error);\n\t\treturn res.data ?? {\n\t\t\tdata: [],\n\t\t\tpagination: {\n\t\t\t\tnextCursor: null,\n\t\t\t\thasMore: false\n\t\t\t}\n\t\t};\n\t}, (data) => {\n\t\tfound = data.some(visible);\n\t\treturn found;\n\t});\n\treturn found;\n}\n/**\n* Provision `key`=`value` directly via the Management API for the target\n* stage's scope (a production template for the default stage; a preview branch\n* override for a named stage — the same scope the pack writes config rows to,\n* EnvironmentVariable.ts). A 409 means a concurrent deploy already provisioned\n* it — tolerated. The value is never logged.\n*/\nasync function fillMissing(client, projectId, branchId, key, value) {\n\tconst res = await client.POST(\"/v1/environment-variables\", { body: {\n\t\tprojectId,\n\t\tclass: classFor(branchId),\n\t\tkey,\n\t\tvalue,\n\t\t...branchId !== void 0 ? { branchId } : {}\n\t} });\n\tif (res.error !== void 0 && res.response.status !== 409) throw fillFailedError(key, res.error);\n}\nconst tokenRequiredError = () => /* @__PURE__ */ new Error(\"environment variable PRISMA_SERVICE_TOKEN is required for deploy preflight.\");\nconst listFailedError = (key, error) => /* @__PURE__ */ new Error(`deploy preflight: Prisma Management API error listing \"${key}\": ${JSON.stringify(error)}.`);\nconst fillFailedError = (key, error) => /* @__PURE__ */ new Error(`deploy preflight: failed to provision \"${key}\" from the deploy shell: ${JSON.stringify(error)}.`);\nfunction missingError(missing, branchId, stage) {\n\tconst scope = branchId === void 0 ? \"the production class (project-level template)\" : `the preview class of stage \"${stage ?? branchId}\" (branch override or template)`;\n\tconst lines = missing.map((m) => ` - ${m.name} (required by service \"${m.serviceAddress}\")`);\n\treturn /* @__PURE__ */ new Error(`Deploy preflight failed — ${missing.length} env var(s) (secret or env-sourced param) are not provisioned on Prisma Cloud for ${scope}, and are absent from the deploy shell:\\n${lines.join(\"\\n\")}\\n\\nSet each in the deploy shell environment (the CLI will provision it on deploy), or create it on the platform (Prisma Console or the Management API) in ${scope}.`);\n}\nasync function managementClient() {\n\tif ((process.env[\"PRISMA_SERVICE_TOKEN\"] ?? \"\").length === 0) throw tokenRequiredError();\n\treturn Effect.runPromise(Effect.gen(function* () {\n\t\treturn yield* ManagementClient;\n\t}).pipe(Effect.provide(managementClientLayer().pipe(Layer.provide(fromEnv())))));\n}\n/**\n* The Prisma Cloud extension's `preflight`. Uses the shared name collector\n* (`collectPreflightNames`, ADR-0042) — every service's input-binding\n* `envSecret` leaf, plus `paramManifest` filtered to env-sourced reserved\n* params — checks each platform name against the platform, fills from the\n* shell where possible, and fails loudly on anything absent from both.\n* `envParam` leaves of an input binding are NOT checked here — they resolve\n* from the deploy shell at serialize, and an unset one is an omitted key the\n* schema arbitrates. Accepts an injected client for tests; otherwise builds\n* one from env.\n*/\nasync function runPreflight(input, deps) {\n\tconst { projectId, branchId } = prismaCloudContainerOf(input.container);\n\tconst collected = collectPreflightNames(input.graph);\n\tconst names = /* @__PURE__ */ new Map();\n\tfor (const meta of [...collected.secrets, ...collected.envParams]) if (!names.has(meta.name)) names.set(meta.name, meta);\n\tif (names.size === 0) return;\n\tconst client = deps?.client ?? await managementClient();\n\tconst missing = [];\n\tfor (const meta of names.values()) {\n\t\tif (await existsOnPlatform(client, projectId, branchId, meta.name)) continue;\n\t\tconst shellValue = process.env[meta.name];\n\t\tif (shellValue !== void 0 && shellValue.length > 0) {\n\t\t\tawait fillMissing(client, projectId, branchId, meta.name, shellValue);\n\t\t\tcontinue;\n\t\t}\n\t\tmissing.push(meta);\n\t}\n\tif (missing.length > 0) throw missingError(missing, branchId, input.stage);\n}\n/**\n* The extension-pack half of the deploy preflight: every dependency edge\n* whose required contract carries a `requiredPackHead` must be wired to a\n* `pnPostgres` resource whose `prisma-next.config.ts` lists that pack at the\n* required head hash. Enforced HERE — at deploy time, before the migration\n* step constructs — because wireability (`pnContract().satisfies`)\n* deliberately says yes to every required pack head (the authoring-side\n* contract value cannot see the resource's config), and boot time would be\n* too late: the service would be down after a green deploy. Invoked from the\n* `prisma-next` descriptor's lowering, beside the migration-step\n* construction.\n*/\nasync function runPackPreflight(graph) {\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\tconst requirement = requiredPackHeadOf(slot.required);\n\t\tif (requirement === void 0) continue;\n\t\tconst node = graph.nodes.find((n) => n.id === edge.from)?.node;\n\t\tconst provider = node !== void 0 && (node.kind === \"resource\" || node.kind === \"service\") && isPnPostgresResourceNode(node) ? node : void 0;\n\t\tif (provider === void 0) throw new Error(`service \"${edge.to}\" requires extension pack \"${requirement.packId}\", which only a pnPostgres resource can carry.`);\n\t\tconst { extensionPacks } = await resolvePrismaNextConfig(provider.config);\n\t\tif (extensionPacks.find((p) => p.id === requirement.packId) === void 0) throw new Error(`prisma-next database \"${provider.name}\" does not list extension pack \"${requirement.packId}\" in its prisma-next.config.ts extensionPacks — service \"${edge.to}\" requires it. Add the pack and run migration plan.`);\n\t}\n}\n//#endregion\n//#region src/descriptors/prisma-next.ts\n/**\n* The migration is a tracked `PnMigration` Alchemy resource keyed on the\n* target REF identity (hash + sorted invariants): unchanged redeploy is a\n* no-op, a contract or ref-invariant change re-migrates.\n*/\nfunction prismaNextDescriptor(o) {\n\tconst lowering = ({ id, node, application, graph }) => Effect.gen(function* () {\n\t\tvalidateName(id, \"resource name (from provision id)\");\n\t\tconst branchId = cloudApplicationOf(application).branchId;\n\t\tconst db = yield* Prisma.Database(`${id}-db`, {\n\t\t\tprojectId: projectIdOf(application),\n\t\t\tname: id,\n\t\t\tregion: o().region ?? \"us-east-1\",\n\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t});\n\t\tconst conn = yield* Prisma.Connection(`${id}-conn`, {\n\t\t\tdatabaseId: db.id,\n\t\t\tname: id\n\t\t});\n\t\tconst url = Output.map(conn.connectionString, (value) => Redacted.value(value));\n\t\tif (!isPnPostgresResourceNode(node)) throw new Error(`prisma-next lowering received a non-prisma-next node (${id}).`);\n\t\tconst contractJson = node.provides.__cmp.contractJson;\n\t\tconst { migrationsDir, extensionPacks } = yield* Effect.promise(() => resolvePrismaNextConfig(node.config));\n\t\tconst ref = yield* Effect.promise(() => resolveTargetRef(migrationsDir, contractJson, node.targetRef));\n\t\tyield* Effect.promise(() => runPackPreflight(graph));\n\t\tconst warm = yield* PgWarm(`${id}-warm`, { url });\n\t\tyield* PnMigration(`${id}-migrate`, {\n\t\t\turl: warm.url,\n\t\t\tcontractJson,\n\t\t\tmigrationsDir,\n\t\t\ttargetHash: ref.hash,\n\t\t\tinvariants: [...ref.invariants].sort(),\n\t\t\tpackHeadRefHashes: packHeadRefHashes(extensionPacks),\n\t\t\tconfigPath: node.config,\n\t\t\t...node.targetRef !== void 0 ? { refName: node.targetRef } : {}\n\t\t});\n\t\treturn {\n\t\t\toutputs: { url: warm.url },\n\t\t\tentities: [{\n\t\t\t\tkind: \"postgres-database\",\n\t\t\t\tid: db.id\n\t\t\t}]\n\t\t};\n\t});\n\treturn Object.assign(lowering, { kind: \"resource\" });\n}\n//#endregion\n//#region src/descriptors/s3-credentials.ts\n/**\n* One `S3Credentials` resource per provisioned credentials node — `id` is the\n* module provision id, so a pair shared by the storage service is minted once\n* and kept stable across deploys (the resource's provider preserves it).\n* `_o` is unused today (the mint needs no region/project) but kept for symmetry\n* with the other descriptors' signature.\n*/\nfunction s3CredentialsDescriptor(_o) {\n\tconst lowering = ({ id }) => Effect.gen(function* () {\n\t\tconst creds = yield* S3Credentials(`${id}-creds`, {});\n\t\treturn {\n\t\t\toutputs: {\n\t\t\t\taccessKeyId: creds.accessKeyId,\n\t\t\t\tsecretAccessKey: creds.secretAccessKey\n\t\t\t},\n\t\t\tentities: []\n\t\t};\n\t});\n\treturn Object.assign(lowering, { kind: \"resource\" });\n}\n//#endregion\n//#region src/descriptors/s3-store.ts\nfunction s3StoreDescriptor(o) {\n\tconst base = computeDescriptor(o);\n\treturn {\n\t\tkind: \"service\",\n\t\tprovision: base.provision,\n\t\tpackage: base.package,\n\t\tserialize: (ctx, provisioned, config) => Effect.gen(function* () {\n\t\t\tconst serialized = yield* base.serialize(ctx, provisioned, config);\n\t\t\tconst credentials = config.inputs[\"credentials\"] ?? {};\n\t\t\tconst document = serialized.input !== void 0 ? JSON.parse(serialized.input.value) : void 0;\n\t\t\tconst bucket = typeof document === \"object\" && document !== null && \"bucket\" in document ? document.bucket : void 0;\n\t\t\tif (credentials[\"accessKeyId\"] === void 0 || credentials[\"secretAccessKey\"] === void 0 || bucket === void 0) throw new Error(\"s3-store service must wire a 'credentials' dependency and declare a 'bucket' input key\");\n\t\t\treturn {\n\t\t\t\t...serialized,\n\t\t\t\tbucket,\n\t\t\t\taccessKeyId: credentials[\"accessKeyId\"],\n\t\t\t\tsecretAccessKey: credentials[\"secretAccessKey\"]\n\t\t\t};\n\t\t}),\n\t\tdeploy: (ctx, provisioned, artifact, serialized) => Effect.gen(function* () {\n\t\t\tconst deployed = yield* base.deploy(ctx, provisioned, artifact, serialized);\n\t\t\treturn {\n\t\t\t\t...deployed,\n\t\t\t\toutputs: {\n\t\t\t\t\t...deployed.outputs,\n\t\t\t\t\tbucket: serialized.bucket,\n\t\t\t\t\taccessKeyId: serialized.accessKeyId,\n\t\t\t\t\tsecretAccessKey: serialized.secretAccessKey\n\t\t\t\t}\n\t\t\t};\n\t\t})\n\t};\n}\n//#endregion\n//#region src/control/extension.ts\n/** The Prisma Cloud–hosted deploy state store; its implementation lives in @internal/lowering. */\n/**\n* ADR-0031's registered provisioner for RPC_PEER_KEY: mints one `ServiceKey`\n* resource per edge (ADR-0030) and forwards its value as the opaque ref core\n* writes into the consumer's `serviceKey` param. The resource id keeps the\n* `servicekey-${edgeId}` scheme byte-identical to slice 2's, so an existing\n* deploy's keys are found, not re-minted. Defined here, not in service-keys.ts:\n* that module is also reachable from the runtime/authoring side, which must\n* never import `@internal/lowering` or `effect`.\n*/\nconst serviceKeyProvisioner = { provision: (edge) => Effect.gen(function* () {\n\treturn (yield* Prisma.ServiceKey(`servicekey-${edge.edgeId}`, {})).value;\n}) };\n/**\n* `ctx.provisioned`'s refs are typed `unknown` — core forwards a provisioner's\n* ref without inspecting it. Each provider param below is the sole reader of\n* its own provisioner's output, so the shape is asserted here, once, rather\n* than checked.\n*/\nconst asKeyOutputs = (refs) => refs.map((ref) => blindCast(ref));\n/**\n* RPC's deploy-side `value(refs)` (ADR-0030): the provider stores a SET — one\n* key per inbound edge — into the accepted-keys var `serve()` reads. Paired\n* with the provisioner above: mint per edge, aggregate every edge.\n*\n* Zero consumers still emits, and that is the whole point of #100: an ABSENT\n* var means \"never provisioned\" and passes every caller through, so a deployed\n* provider nobody wired must say \"[]\" — deny everything — rather than say\n* nothing. Written as a literal because `Output.all()` with no arguments has\n* nothing to resolve.\n*/\nconst rpcAcceptedKeysValue = (refs) => refs.length > 0 ? Output.all(...asKeyOutputs(refs)) : [];\n/**\n* ADR-0031's registered provisioner for STREAMS_API_KEY — the same `ServiceKey`\n* mint, keyed PER PROVIDER instead of per edge: the resource id is the\n* provider's address, so every consumer edge of one streams module resolves to\n* the same resource and therefore the same stable value. That is what\n* `@prisma/streams-server` requires (it authenticates a single `API_KEY`), and\n* cardinality is exactly what ADR-0031 leaves to the provisioner. Making it\n* per-edge later is this id's shape plus an accepted-set provider param — no\n* new resource, no core change.\n*/\nconst streamsApiKeyProvisioner = { provision: (edge) => Effect.gen(function* () {\n\treturn (yield* Prisma.ServiceKey(`streamskey-${edge.providerAddress}`, {})).value;\n}) };\n/**\n* Streams' deploy-side `value(refs)`: ONE value, not a set —\n* `@prisma/streams-server` authenticates a single `API_KEY`, which is why the\n* provisioner above mints per provider. That pairing is the invariant this\n* param depends on, so it asserts rather than trusts it: a future per-edge\n* flip without a paired accepted-set param here would otherwise ship\n* whichever key came first and leave every other consumer 401ing, silently.\n* The refs are lazy Outputs (not comparable at serialize time); inside\n* `Output.map` they are resolved strings, the same seam RPC's set aggregates\n* on.\n*\n* Zero consumers emits NOTHING — the streams counterpart to RPC's \"[]\".\n* `@prisma/streams-server` has no deny-all mode: it either authenticates a key\n* or runs --no-auth, so there is no value here that means \"refuse everyone\".\n* Writing no key is what fails closed — the entrypoint refuses to boot with\n* a named error rather than serve unauthenticated.\n*/\nconst streamsApiKeyValue = (refs) => {\n\tif (refs.length === 0) return void 0;\n\treturn Output.map(Output.all(...asKeyOutputs(refs)), (vals) => {\n\t\tconst distinct = [...new Set(vals)];\n\t\tif (distinct.length > 1) throw new Error(`a streams provider was provisioned ${distinct.length} distinct keys across its ${refs.length} inbound bindings, but it can only be given one (@prisma/streams-server authenticates a single API_KEY). Its provisioner must mint per provider, not per edge — or this param must store an accepted-key set, once the server accepts one.`);\n\t\treturn distinct[0] ?? \"\";\n\t});\n};\n/**\n* Origin's deploy-side value function (service-derived): the provisioned\n* service's own `endpointDomain`, verbatim — `https://…`, no trailing slash,\n* no normalization. Every compute service gets this row, exposing or not.\n* The undefined guard is a deploy-time invariant check, not a policy: the\n* Management API always reports an endpoint domain post-PRO-200, so a missing\n* one means the platform predates the fix — fail the deploy loudly rather\n* than write a row origin() would trust. The raw string is JSON-encoded by\n* the descriptor's generic loop, like every other reserved provider param.\n*/\nconst selfOriginValue = (provisioned, address) => Output.map(provisioned.endpointDomain, (v) => {\n\tif (v === void 0) throw new Error(`ComputeService for \"${address}\" reported no endpointDomain at provision — cannot resolve the service's own origin (Management API predates the PRO-200 fix?)`);\n\treturn v;\n});\n/** The user-facing state descriptor: `state: prismaState()` in `prisma-composer.config.ts` (ADR-0017). */\nconst prismaState = () => ({\n\textension: PRISMA_CLOUD_EXTENSION_ID,\n\tcreate: (container) => {\n\t\tconst { projectId, branchId, defaultBranchId } = prismaCloudContainerOf(container);\n\t\treturn prismaStateLayer({\n\t\t\tprojectId,\n\t\t\t...branchId !== void 0 ? { branchId } : {},\n\t\t\t...defaultBranchId !== void 0 ? { defaultBranchId } : {}\n\t\t});\n\t}\n});\nconst KNOWN_REGION_SET = new Set(Prisma.COMPUTE_REGIONS);\nfunction isComputeRegion(value) {\n\treturn KNOWN_REGION_SET.has(value);\n}\n/** Prisma.providers()'s ProviderCollection doesn't structurally unify with Alchemy's inferred providers Layer (a @internal/lowering typings gap); it satisfies it at runtime. */\nfunction asProvidersLayer(layer) {\n\treturn layer;\n}\n/**\n* This extension's brands, each with the two halves ADR-0031 splits: the\n* PROVISIONER core resolves a mint through, and the reserved PROVIDER PARAM\n* that stores the minted values on the provider. So this file stays the only\n* place a brand is named — `descriptors/compute.ts` just looks a provider\n* param up by brand.\n*\n* `__tests__/provider-params.test.ts` asserts this map's brands are exactly\n* `PROVIDER_PARAMS`'s edge-derived brands (a service-derived param like the\n* origin mints nothing, so it has no provisioner): a brand minted here with no provider param\n* below would leave the value it mints written to consumers while no\n* provider ever stores an accepted-keys row for it — `serve()` (or the\n* equivalent runtime reader) then sees an absent var and passes every caller\n* through.\n*/\nconst PROVISIONERS = /* @__PURE__ */ new Map([[RPC_PEER_KEY, serviceKeyProvisioner], [STREAMS_API_KEY, streamsApiKeyProvisioner]]);\n/**\n* Every brand's deploy-side value function — the only per-brand thing this\n* file still holds directly. `PROVIDER_PARAMS` below is built by mapping\n* `RESERVED_PROVIDER_PARAMS` (`provider-params.ts`, the boot-side list) onto\n* this map, so a param can exist on the deploy side only if it already\n* exists on the boot side: `RESERVED_PROVIDER_PARAMS` is the single source of\n* which reserved provider params exist at all, closing the drift the old\n* name-comparison test only detected after the fact.\n*/\nconst PROVIDER_PARAM_VALUES = /* @__PURE__ */ new Map([\n\t[RPC_PEER_KEY, { value: rpcAcceptedKeysValue }],\n\t[STREAMS_API_KEY, { value: streamsApiKeyValue }],\n\t[SELF_ORIGIN, { valueForService: selfOriginValue }]\n]);\n/**\n* Builds the deploy-side registry from the boot-side list, keyed by brand —\n* throws if a boot-side entry has no registered deploy-side value function,\n* so `RESERVED_PROVIDER_PARAMS` stays the single source of which reserved\n* provider params exist: deploy can no longer write a row boot never\n* stashes. Exported (rather than inlined into `PROVIDER_PARAMS` below) so\n* `__tests__/provider-params.test.ts` can drive it directly with a\n* deliberately incomplete value map and watch it throw.\n*/\nfunction buildProviderParams(entries, values) {\n\treturn new Map(entries.map((entry) => {\n\t\tconst value = values.get(entry.brand);\n\t\tif (value === void 0) throw new Error(`prisma-cloud: reserved provider param \"${entry.name}\" (provider-params.ts) has no registered deploy-side value() in control.ts's PROVIDER_PARAM_VALUES — every param in RESERVED_PROVIDER_PARAMS must have one.`);\n\t\treturn [entry.brand, {\n\t\t\t...entry,\n\t\t\t...value\n\t\t}];\n\t}));\n}\nconst PROVIDER_PARAMS = buildProviderParams(RESERVED_PROVIDER_PARAMS, PROVIDER_PARAM_VALUES);\n/**\n* Resolves the factory's env-or-option inputs. Deliberately does NOT require\n* `PRISMA_WORKSPACE_ID`: nothing in this file reads `ResolvedCloudOptions.workspaceId`\n* downstream — it exists only so a caller MAY pin an explicit workspace, and\n* the real workspace check for a real deploy lives where the value actually\n* matters, `container.ts`'s `ensureContainer`/`locateContainer`. Region\n* validation stays eager-on-call (a garbage `PRISMA_REGION` still fails\n* loudly), but an ABSENT one resolves to `undefined` without touching\n* anything else — required for `prisma-composer dev`, which never sets\n* `PRISMA_REGION` and must not fail on its absence (local-dev spec § 5).\n*/\nfunction resolveOptions(opts) {\n\tconst workspaceId = opts.workspaceId ?? process.env[\"PRISMA_WORKSPACE_ID\"] ?? \"\";\n\tif (opts.region !== void 0) return {\n\t\tworkspaceId,\n\t\tregion: opts.region,\n\t\tproviderParams: PROVIDER_PARAMS\n\t};\n\tconst region = process.env[\"PRISMA_REGION\"];\n\tif (region === void 0 || region.length === 0) return {\n\t\tworkspaceId,\n\t\tproviderParams: PROVIDER_PARAMS\n\t};\n\tif (!isComputeRegion(region)) throw new Error(`prismaCloud(): environment variable PRISMA_REGION=\"${region}\" is not a known region (expected one of: ${Prisma.COMPUTE_REGIONS.join(\", \")}).`);\n\treturn {\n\t\tworkspaceId,\n\t\tregion,\n\t\tproviderParams: PROVIDER_PARAMS\n\t};\n}\n/**\n* A memoized thunk over `resolveOptions` — evaluated at FIRST LOWERING USE\n* (inside a node descriptor's `provision`/`serialize`), never at `prismaCloud()`\n* construction. The node descriptors take this thunk, not a resolved value\n* (local-dev spec § 5): `prismaCloud()` itself must construct with no\n* environment present, since it also builds the `localTarget` descriptor, which must\n* never require `PRISMA_WORKSPACE_ID`/`PRISMA_REGION`/`PRISMA_SERVICE_TOKEN`.\n*/\nfunction lazyOptions(opts) {\n\tlet cached;\n\treturn () => {\n\t\tcached ??= resolveOptions(opts);\n\t\treturn cached;\n\t};\n}\n/** The Prisma Cloud extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */\nconst prismaCloud = (opts = {}) => {\n\tconst o = lazyOptions(opts);\n\treturn {\n\t\tid: PRISMA_CLOUD_EXTENSION_ID,\n\t\tcontainer: containerDescriptor(),\n\t\tproviders: () => asProvidersLayer(Layer.mergeAll(Prisma.providers(), PgWarmProvider(), PnMigrationProvider(), S3CredentialsProvider(), GeneratedParamProvider(), Prisma.ServiceKeyProvider())),\n\t\tpreflight: (input) => runPreflight(input),\n\t\tapplication: { provision: (ctx) => Effect.gen(function* () {\n\t\t\tconst { projectId, branchId } = prismaCloudContainerOf(ctx.container);\n\t\t\tfor (const key of [\"DATABASE_URL\", \"DATABASE_URL_POOLED\"]) yield* Prisma.EnvironmentVariable(`${key}-poison`, {\n\t\t\t\tprojectId,\n\t\t\t\tkey,\n\t\t\t\tvalue: \"-\",\n\t\t\t\tclass: branchId ? \"preview\" : \"production\",\n\t\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tprojectId,\n\t\t\t\tbranchId\n\t\t\t};\n\t\t}) },\n\t\tprovisions: PROVISIONERS,\n\t\tnodes: {\n\t\t\tpostgres: postgresDescriptor(o),\n\t\t\t\"prisma-next\": prismaNextDescriptor(o),\n\t\t\tcompute: computeDescriptor(o),\n\t\t\tcredentials: s3CredentialsDescriptor(o),\n\t\t\t\"s3-store\": s3StoreDescriptor(o),\n\t\t\ts3: bucketDescriptor(o)\n\t\t},\n\t\tlocalTarget: () => import(\"@prisma/composer-prisma-cloud/local-target\").then((m) => m.localTargetDescriptor())\n\t};\n};\n//#endregion\nexport { PROVIDER_PARAMS, buildProviderParams, prismaCloud, prismaState };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,iBAAiB,QAAQ,OAAO,UAAU,WAAW,OAAO,IAAI,4GAA4G,EAAE,QAAQ;CAC3L,MAAM;EACL,WAAW,MAAM;EACjB,UAAU,MAAM;EAChB,OAAO,MAAM;EACb,OAAO,MAAM;CACd;CACA,QAAQ,EAAE,0BAA0B,SAAS,MAAM,MAAM,OAAO,EAAE;AACnE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,SAAS,K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GAAG,MAAM,IAAI,MAAM,sDAAsD,OAAO,4CAAA,gBAAmE,KAAK,IAAI,EAAE,GAAG;CAC5L,OAAO;EACN;EACA;EACA,gBAAgB;CACjB;AACD;;;;;;;;;AASA,SAAS,YAAY,MAAM;CAC1B,IAAI;CACJ,aAAa;EACZ,WAAW,eAAe,IAAI;EAC9B,OAAO;CACR;AACD;;AAEA,MAAM,eAAe,OAAO,CAAC,MAAM;CAClC,MAAM,IAAI,YAAY,IAAI;CAC1B,OAAO;EACN,IAAI;EACJ,WAAW,oBAAoB;EAC/B,iBAAiB,iBAAiB,MAAM,SAASC,UAAiB,GAAG,eAAe,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,uBAAuB,GAAGC,mBAA0B,CAAC,CAAC;EAC7L,YAAY,UAAU,aAAa,KAAK;EACxC,aAAa,EAAE,YAAY,QAAQ,OAAO,IAAI,aAAa;GAC1D,MAAM,EAAE,WAAW,aAAa,uBAAuB,IAAI,SAAS;GACpE,KAAK,MAAM,OAAO,CAAC,gBAAgB,qBAAqB,GAAG,OAAOT,oBAA2B,GAAG,IAAI,UAAU;IAC7G;IACA;IACA,OAAO;IACP,OAAO,WAAW,YAAY;IAC9B,GAAG,aAAa,KAAK,IAAI,EAAE,SAAS,IAAI,CAAC;GAC1C,CAAC;GACD,OAAO;IACN;IACA;GACD;EACD,CAAC,EAAE;EACH,YAAY;EACZ,OAAO;GACN,UAAU,mBAAmB,CAAC;GAC9B,eAAe,qBAAqB,CAAC;GACrC,SAAS,kBAAkB,CAAC;GAC5B,aAAa,wBAAwB,CAAC;GACtC,YAAY,kBAAkB,CAAC;GAC/B,IAAI,iBAAiB,CAAC;EACvB;EACA,mBAAmB,OAAO,6CAA6C,CAAC,MAAM,MAAM,EAAE,sBAAsB,CAAC;CAC9G;AACD"}
1
+ {"version":3,"file":"control.mjs","names":["os","Prisma.Bucket","Prisma.BucketKey","Prisma.ComputeService","Prisma.EnvironmentVariable","Prisma.packageComputeArtifact","Prisma.Deployment","Prisma.Database","Prisma.Connection","managementClientLayer","Prisma.ServiceKey","Prisma.COMPUTE_REGIONS","Prisma.providers","Prisma.ServiceKeyProvider"],"sources":["../../../1-prisma-cloud/0-lowering/lowering/dist/state.mjs","../../../1-prisma-cloud/1-extensions/target/dist/control.mjs"],"sourcesContent":["import { a as MANAGEMENT_API_ORIGIN, c as PrismaCredentials, l as fromEnv, n as call, o as ManagementClient, s as layer, t as PrismaApiError } from \"./http-SWyaVRHS.mjs\";\nimport { a as resolveDefaultBranchId, o as collectPages } from \"./container-BNuTukFR.mjs\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Data from \"effect/Data\";\nimport { Stack } from \"alchemy\";\nimport * as os from \"node:os\";\nimport { State, makeHttpStateStore } from \"alchemy/State\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport * as HttpClientRequest from \"effect/unstable/http/HttpClientRequest\";\nimport * as Headers from \"effect/unstable/http/Headers\";\n//#region src/state/empty-scope.ts\n/**\n* Whether the platform state API holds any resources for (stack, stage).\n* Requires the live deploy lease — the listing runs under it, like every\n* state operation.\n*/\nconst scopeOccupied = (client, scope, lease) => call(() => client.GET(\"/v1/projects/{projectId}/branches/{branchId}/alchemy-state/state/stacks/{stack}/stages/{stage}/resources\", { params: {\n\tpath: {\n\t\tprojectId: scope.projectId,\n\t\tbranchId: scope.branchId,\n\t\tstack: scope.stack,\n\t\tstage: scope.stage\n\t},\n\theader: { \"alchemy-state-lease-id\": Redacted.value(lease.leaseId) }\n} })).pipe(Effect.map((fqns) => fqns.length > 0));\nconst listBranchResources = (client, projectId, branchId) => Effect.gen(function* () {\n\tconst query = (cursor) => cursor === void 0 ? {\n\t\tprojectId,\n\t\tbranchId\n\t} : {\n\t\tprojectId,\n\t\tbranchId,\n\t\tcursor\n\t};\n\tconst apps = yield* collectPages(`apps on branch ${branchId}`, (cursor) => call(() => client.GET(\"/v1/apps\", { params: { query: query(cursor) } })));\n\tconst databases = yield* collectPages(`databases on branch ${branchId}`, (cursor) => call(() => client.GET(\"/v1/databases\", { params: { query: query(cursor) } })));\n\tconst buckets = yield* collectPages(`buckets on branch ${branchId}`, (cursor) => call(() => client.GET(\"/v1/buckets\", { params: { query: query(cursor) } })));\n\treturn [\n\t\t...apps.map((r) => ({\n\t\t\tkind: \"app\",\n\t\t\tname: r.name\n\t\t})),\n\t\t...databases.map((r) => ({\n\t\t\tkind: \"database\",\n\t\t\tname: r.name\n\t\t})),\n\t\t...buckets.map((r) => ({\n\t\t\tkind: \"bucket\",\n\t\t\tname: r.name\n\t\t}))\n\t];\n});\n/**\n* The empty-scope-with-live-resources case: the platform state API holds no\n* resources for (stack, stage) while the platform already has Compute apps,\n* databases, or buckets on the target Branch — this stage predates the\n* platform state API (its state lives in a legacy `prisma-composer-state`\n* database, which is never read; there is no automatic migration), or the\n* deploy targets a project that already runs something. Deploying would\n* recreate every resource and die in per-resource `already_exists` failures —\n* so fail once, up front. A genuinely fresh deploy sees an empty Branch and\n* passes. Connections are not counted: they are children of databases, which\n* are. Local dev never reaches this — the dev stack pins\n* `state: localState()` (generate-dev-stack.ts).\n*/\nconst failOnEmptyScopeWithLiveResources = (projectId, branchId, stack, stage) => Effect.gen(function* () {\n\tconst client = yield* ManagementClient;\n\tconst resources = yield* listBranchResources(client, projectId, branchId);\n\tif (resources.length === 0) return;\n\tconst names = resources.map((r) => `${r.kind} \"${r.name}\"`).join(\", \");\n\treturn yield* Effect.fail(new PrismaApiError({\n\t\tstatus: 0,\n\t\tmessage: `the platform state API holds no deploy state for stage \"${stage}\" (stack \"${stack}\"), but the platform already has ${String(resources.length)} resource(s) on the target branch ${branchId}: ${names}. This stage predates the platform state API. With no state, a deploy would recreate every resource and fail with already_exists, and a destroy would remove nothing. Destroy the stage with the previous version of composer, or delete the stage (its branch — or the project, for production) in the Prisma Console or via the Management API — then redeploy fresh. If those resources are another deployment's, remove them or deploy into a different project. Then retry.`\n\t}));\n});\n//#endregion\n//#region src/state/errors.ts\n/**\n* An operator-facing failure from the hosted-state bootstrap pipeline\n* (branch resolution, lease acquisition, or the migration guard) — what a\n* deployer actually sees, instead of a raw Effect defect.\n*/\nvar HostedStateBootstrapError = class extends Data.TaggedError(\"HostedStateBootstrapError\") {\n\tget message() {\n\t\treturn `hosted-state bootstrap failed in ${this.container}: ${this.step} — ${this.reason}`;\n\t}\n};\n/**\n* Builds a {@link HostedStateBootstrapError} from whatever the failed step\n* threw. Never retains the raw API error object as `cause`: only the\n* extracted message text survives into the operator-facing error, so a\n* credential or lease id carried on the raw error can never leak.\n*/\nconst hostedStateBootstrapError = (container, step, cause) => new HostedStateBootstrapError({\n\tcontainer,\n\tstep,\n\treason: cause instanceof Error ? cause.message : String(cause)\n});\n//#endregion\n//#region src/state/lease.ts\n/** The header every state operation and lease call carries. Its value is a capability token — never log it. */\nconst LEASE_HEADER = \"Alchemy-State-Lease-Id\";\n/**\n* Adds the lease header to effect's redacted header names (alongside the\n* defaults such as `authorization`), so a logged failed request renders the\n* lease id as `<redacted>`. Merged into the state layer's outputs.\n*/\nconst redactLeaseHeader = Layer.effect(Headers.CurrentRedactedNames, Effect.gen(function* () {\n\treturn [...yield* Headers.CurrentRedactedNames, LEASE_HEADER];\n}));\nconst LEASE_PATH = \"/v1/projects/{projectId}/branches/{branchId}/alchemy-state/lease\";\n/** The server names the current holder in its 409 message; pass it through verbatim, hint appended. */\nconst serverErrorText = (error) => error.error.hint === void 0 ? error.error.message : `${error.error.message} ${error.error.hint}`;\nconst transportError = (cause) => new PrismaApiError({\n\tstatus: 0,\n\tmessage: String(cause)\n});\n/** Best-effort `user@host`, echoed in the contention error a blocked deploy sees. */\nconst holderDescription = () => {\n\ttry {\n\t\treturn `${os.userInfo().username}@${os.hostname()}`;\n\t} catch {\n\t\treturn \"unknown\";\n\t}\n};\n/**\n* Acquires the (stack, stage) deploy lease. Contention (409) fails fast with\n* the server's message naming the current holder — no queueing, no retry.\n* The server's default TTL (60s) applies; no `ttlSeconds` is sent.\n*/\nconst acquireDeployLease = (client, scope) => Effect.tryPromise({\n\ttry: () => client.POST(LEASE_PATH, {\n\t\tparams: { path: {\n\t\t\tprojectId: scope.projectId,\n\t\t\tbranchId: scope.branchId\n\t\t} },\n\t\tbody: {\n\t\t\tstack: scope.stack,\n\t\t\tstage: scope.stage,\n\t\t\tholderDescription: holderDescription()\n\t\t}\n\t}),\n\tcatch: transportError\n}).pipe(Effect.flatMap((r) => {\n\tconst status = r.response.status;\n\tif (r.error !== void 0) return Effect.fail(new PrismaApiError({\n\t\tstatus,\n\t\tmessage: serverErrorText(r.error)\n\t}));\n\tif (r.data !== void 0) return Effect.succeed({\n\t\tleaseId: Redacted.make(r.data.data.leaseId),\n\t\texpiresAt: r.data.data.expiresAt\n\t});\n\treturn Effect.fail(new PrismaApiError({\n\t\tstatus,\n\t\tmessage: `lease acquisition returned HTTP ${String(status)} with no error body`\n\t}));\n}));\n/**\n* Extends the lease on a fixed cadence (TTL/3) until interrupted. A 404 means\n* the lease was lost — log one loud warning and stop; enforcement is\n* server-side, so the run's next state operation fails with 409. Any other\n* heartbeat failure is ignored and the next tick retries; the heartbeat never\n* fails the run.\n*/\nconst heartbeatDeployLease = (client, scope, lease, every = \"20 seconds\") => Effect.gen(function* () {\n\twhile (true) {\n\t\tyield* Effect.sleep(every);\n\t\tif ((yield* Effect.tryPromise(() => client.PATCH(LEASE_PATH, { params: {\n\t\t\tpath: {\n\t\t\t\tprojectId: scope.projectId,\n\t\t\t\tbranchId: scope.branchId\n\t\t\t},\n\t\t\theader: { \"alchemy-state-lease-id\": Redacted.value(lease.leaseId) }\n\t\t} })).pipe(Effect.map((r) => r.response.status), Effect.catch(() => Effect.succeed(0)))) === 404) {\n\t\t\tyield* Effect.logWarning(`the deploy lease for stage \"${scope.stage}\" was lost (heartbeat returned 404) — another deploy may have taken over; the next state operation of this run will fail.`);\n\t\t\treturn;\n\t\t}\n\t}\n});\n/**\n* Releases the lease on clean exit. Never fails: a 404 (lease already\n* expired or replaced) or any other failure is logged, not thrown — the run\n* already completed.\n*/\nconst releaseDeployLease = (client, scope, lease) => Effect.tryPromise(() => client.DELETE(LEASE_PATH, { params: {\n\tpath: {\n\t\tprojectId: scope.projectId,\n\t\tbranchId: scope.branchId\n\t},\n\theader: { \"alchemy-state-lease-id\": Redacted.value(lease.leaseId) }\n} })).pipe(Effect.flatMap((r) => {\n\tconst status = r.response.status;\n\tif (status === 404) return Effect.logWarning(`releasing the deploy lease for stage \"${scope.stage}\" returned 404 — it had already expired or been replaced.`);\n\tif (status >= 200 && status < 300) return Effect.void;\n\treturn Effect.logWarning(`releasing the deploy lease for stage \"${scope.stage}\" returned HTTP ${String(status)} — the lease stays live until its TTL expires.`);\n}), Effect.catch((cause) => Effect.logWarning(`releasing the deploy lease for stage \"${scope.stage}\" failed: ${String(cause)}`)));\n//#endregion\n//#region src/state/layer.ts\n/**\n* The hosted Alchemy state store: alchemy's stock HTTP state client pointed\n* at the platform state API\n* (`/v1/projects/{projectId}/branches/{branchId}/alchemy-state`). On layer\n* init (scoped, once per stack run): resolve the stage's Branch, acquire the\n* (stack, stage) deploy lease, fork its heartbeat, run the migration guard,\n* and build the stock store. Finalizers (reverse order): interrupt the\n* heartbeat, release the lease. The Management API plumbing\n* (`ManagementClient`, `PrismaCredentials`) and the store's `HttpClient` are\n* provided internally, so the returned layer's only requirements are the\n* ones alchemy itself already provides to every state store\n* (`StackServices`).\n*\n* Any bootstrap failure is wrapped into an operator-facing\n* `HostedStateBootstrapError` (naming the Project/Branch and the step that\n* failed — see `errors.ts`) before dying the layer (loud, immediate,\n* unrecoverable) rather than surfacing as a typed error — matching core's\n* `LowerOptions.state: Layer.Layer<State, never, StackServices>` contract\n* and alchemy's own convention (e.g. a missing state store is `Effect.die`\n* in `Stack.make`).\n*/\nconst prismaStateLayer = (ids) => stateLayerAgainst(MANAGEMENT_API_ORIGIN, ids);\n/** `prismaStateLayer` with the API origin injectable — split out so tests can point it at a fake state API. */\nconst stateLayerAgainst = (apiOrigin, ids) => {\n\tconst { projectId, branchId, defaultBranchId } = ids;\n\tconst dependencies = layer({ apiOrigin }).pipe(Layer.provideMerge(fromEnv()));\n\treturn Layer.effect(State, Effect.gen(function* () {\n\t\tconst stack = yield* Stack;\n\t\tconst container = branchId === void 0 ? projectId : `${projectId}/${branchId}`;\n\t\tconst bootstrapError = (step) => (cause) => hostedStateBootstrapError(container, step, cause);\n\t\tconst mgmt = yield* ManagementClient;\n\t\tconst { token } = yield* PrismaCredentials;\n\t\tconst stateBranchId = branchId ?? defaultBranchId ?? (yield* resolveDefaultBranchId(mgmt, projectId).pipe(Effect.mapError(bootstrapError(\"resolving the stage branch\"))));\n\t\tconst scope = {\n\t\t\tprojectId,\n\t\t\tbranchId: stateBranchId,\n\t\t\tstack: stack.name,\n\t\t\tstage: stack.stage\n\t\t};\n\t\tconst lease = yield* acquireDeployLease(mgmt, scope).pipe(Effect.mapError(bootstrapError(\"acquiring the deploy lease\")));\n\t\tyield* Effect.addFinalizer(() => releaseDeployLease(mgmt, scope, lease));\n\t\tyield* Effect.forkScoped(heartbeatDeployLease(mgmt, scope, lease));\n\t\tif (!(yield* scopeOccupied(mgmt, scope, lease).pipe(Effect.mapError(bootstrapError(\"probing the deploy state scope\"))))) yield* failOnEmptyScopeWithLiveResources(projectId, stateBranchId, stack.name, stack.stage).pipe(Effect.provideService(ManagementClient, mgmt), Effect.mapError(bootstrapError(\"checking the empty deploy state scope\")));\n\t\tconst service = yield* makeHttpStateStore({\n\t\t\turl: `${apiOrigin}/v1/projects/${projectId}/branches/${stateBranchId}/alchemy-state`,\n\t\t\tauthToken: Redacted.value(token),\n\t\t\ttransformClient: (req) => HttpClientRequest.setHeader(req, LEASE_HEADER, Redacted.value(lease.leaseId)),\n\t\t\tid: \"prisma-postgres\"\n\t\t}).pipe(Effect.provide(FetchHttpClient.layer));\n\t\treturn Effect.succeed(service);\n\t}).pipe(Effect.provide(dependencies))).pipe(Layer.orDie, Layer.merge(redactLeaseHeader));\n};\n//#endregion\nexport { prismaStateLayer };\n\n//# sourceMappingURL=state.mjs.map","import { c as paramName, s as paramBindingFor } from \"./secret-Doubjztg.mjs\";\nimport { a as encodeParamPointer, i as encode, l as serializeInput, n as configKey, o as paramEntries } from \"./serializer-Ch1Tmx-2.mjs\";\nimport { n as RESERVED_PROVIDER_PARAMS, o as SELF_ORIGIN, r as STREAMS_API_KEY, t as provisionedEdges } from \"./provisioned-edges-COr17uxy.mjs\";\nimport { n as requiredPackHeadOf } from \"./required-pack-head-BrrJarzc.mjs\";\nimport { _ as prismaCloudContainerOf, a as PnMigrationProvider, c as resolvePrismaNextConfig, d as GeneratedParam, f as GeneratedParamProvider, h as containerDescriptor, i as PnMigration, l as PgWarm, n as S3CredentialsProvider, o as resolveTargetRef, p as PRISMA_CLOUD_EXTENSION_ID, r as collectPreflightNames, s as packHeadRefHashes, t as S3Credentials, u as PgWarmProvider } from \"./s3-credentials-resource-DOjmcHZh.mjs\";\nimport { n as isPnPostgresResourceNode } from \"./prisma-next-DmPGOIm2.mjs\";\nimport { isParamSource } from \"@internal/core\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { RPC_PEER_KEY } from \"@internal/service-rpc\";\nimport * as Prisma from \"@internal/lowering\";\nimport { ManagementClient, drivePagesAsync, fromEnv, managementClientLayer } from \"@internal/lowering\";\nimport { prismaStateLayer } from \"@internal/lowering/state\";\nimport * as Output from \"alchemy/Output\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Redacted from \"effect/Redacted\";\nconst PRISMA_NAME_MIN = 3;\nconst PRISMA_NAME_MAX = 65;\nfunction validateName(value, source) {\n\tif (value.length < PRISMA_NAME_MIN || value.length > PRISMA_NAME_MAX) throw new Error(`prisma-cloud: ${source} \"${value}\" (${value.length} characters) is not a valid Prisma resource name — Prisma requires ${PRISMA_NAME_MIN}–${PRISMA_NAME_MAX} characters. Rename the provision id (or the deploy --name) to fit.`);\n}\nfunction isCloudApplication(value) {\n\treturn typeof value === \"object\" && value !== null && \"projectId\" in value && typeof value.projectId === \"string\" && \"branchId\" in value && (value.branchId === void 0 || typeof value.branchId === \"string\");\n}\n/** Narrows `ctx.application`, which core hands over as `unknown`, to this extension's own product; throws naming the hook when it hasn't run. */\nfunction cloudApplicationOf(application) {\n\tif (!isCloudApplication(application)) throw new Error(\"prisma-cloud: ctx.application is not this extension's application product — the prismaCloud() application hook must run before any node lowers.\");\n\treturn application;\n}\nfunction projectIdOf(application) {\n\treturn cloudApplicationOf(application).projectId;\n}\n//#endregion\n//#region src/descriptors/bucket.ts\n/**\n* One Bucket per module-provisioned bucket resource — `id` is the module\n* provision id, so a resource shared by several consumers is created exactly\n* once. A BucketKey is minted for the bucket: it is the reveal-once credential\n* carrier, and its attributes (endpoint, bucketName, accessKeyId,\n* secretAccessKey) become the four S3Config outputs consumers resolve by name.\n*/\nfunction bucketDescriptor(_o) {\n\tconst lowering = ({ id, application }) => Effect.gen(function* () {\n\t\tvalidateName(id, \"resource name (from provision id)\");\n\t\tconst branchId = cloudApplicationOf(application).branchId;\n\t\tconst bkt = yield* Prisma.Bucket(`${id}-bucket`, {\n\t\t\tprojectId: projectIdOf(application),\n\t\t\tname: id,\n\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t});\n\t\tconst key = yield* Prisma.BucketKey(`${id}-key`, {\n\t\t\tbucketId: bkt.id,\n\t\t\tname: id,\n\t\t\trole: \"read_write\"\n\t\t});\n\t\tconst secretAccessKey = Output.map(key.secretAccessKey, (v) => Redacted.value(v));\n\t\treturn {\n\t\t\toutputs: {\n\t\t\t\turl: key.endpoint,\n\t\t\t\tbucket: key.bucketName,\n\t\t\t\taccessKeyId: key.accessKeyId,\n\t\t\t\tsecretAccessKey\n\t\t\t},\n\t\t\tentities: [{\n\t\t\t\tkind: \"bucket\",\n\t\t\t\tid: bkt.id\n\t\t\t}]\n\t\t};\n\t});\n\treturn Object.assign(lowering, { kind: \"resource\" });\n}\n//#endregion\n//#region src/descriptors/compute.ts\n/** The `compute` node kind's descriptor: the four service hooks — provision, serialize, package, deploy. */\n/**\n* Returns the PRECISE descriptor type, not the erased `NodeDescriptor`: the\n* registry in control.ts erases it on assignment anyway (method bivariance),\n* but s3-store composes over these hooks and needs their P/S to stay visible.\n* Annotating this `NodeDescriptor` would force s3-store to cast them back.\n*/\nfunction computeDescriptor(o) {\n\treturn {\n\t\tkind: \"service\",\n\t\tprovision: ({ id, application }) => Effect.gen(function* () {\n\t\t\tvalidateName(id, \"service name (from provision id)\");\n\t\t\tconst projectId = projectIdOf(application);\n\t\t\tconst branchId = cloudApplicationOf(application).branchId;\n\t\t\tconst svc = yield* Prisma.ComputeService(`${id}-svc`, {\n\t\t\t\tprojectId,\n\t\t\t\tname: id,\n\t\t\t\tregion: o().region ?? \"us-east-1\",\n\t\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tserviceId: svc.id,\n\t\t\t\tprojectId,\n\t\t\t\tendpointDomain: svc.endpointDomain\n\t\t\t};\n\t\t}),\n\t\tserialize: (ctx, provisioned, config) => Effect.gen(function* () {\n\t\t\tconst { address, node, graph } = ctx;\n\t\t\tconst branchId = cloudApplicationOf(ctx.application).branchId;\n\t\t\tconst cls = branchId ? \"preview\" : \"production\";\n\t\t\tconst branch = branchId !== void 0 ? { branchId } : {};\n\t\t\tconst projectId = provisioned.projectId;\n\t\t\tconst svc = node;\n\t\t\tconst records = [];\n\t\t\tfor (const d of paramEntries(svc)) {\n\t\t\t\tconst value = d.owner === \"service\" ? config.service[d.name] : config.inputs[d.owner.input]?.[d.name];\n\t\t\t\tif (value === void 0) continue;\n\t\t\t\tconst key = configKey(address, d);\n\t\t\t\tconst rowValue = d.owner === \"service\" && isParamSource(value) ? encodeParamPointer(paramName(paramBindingFor(graph.params, address, d.name))) : encode(d.owner, value);\n\t\t\t\trecords.push(yield* Prisma.EnvironmentVariable(`${key}-var`, {\n\t\t\t\t\tprojectId,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: rowValue,\n\t\t\t\t\tclass: cls,\n\t\t\t\t\t...branch\n\t\t\t\t}));\n\t\t\t}\n\t\t\tconst inputRow = serializeInput(svc, address, graph.inputBindings.find((b) => b.serviceAddress === address)?.binding);\n\t\t\tif (inputRow !== void 0) {\n\t\t\t\trecords.push(yield* Prisma.EnvironmentVariable(`${inputRow.key}-var`, {\n\t\t\t\t\tprojectId,\n\t\t\t\t\tkey: inputRow.key,\n\t\t\t\t\tvalue: inputRow.value,\n\t\t\t\t\tclass: cls,\n\t\t\t\t\t...branch\n\t\t\t\t}));\n\t\t\t\tfor (const leaf of inputRow.generated) {\n\t\t\t\t\tconst resource = yield* GeneratedParam(`${inputRow.key}:${leaf.path}-generated`, { bytes: leaf.bytes });\n\t\t\t\t\trecords.push(yield* Prisma.EnvironmentVariable(`${leaf.varName}-var`, {\n\t\t\t\t\t\tprojectId,\n\t\t\t\t\t\tkey: leaf.varName,\n\t\t\t\t\t\tvalue: resource.value,\n\t\t\t\t\t\tclass: cls,\n\t\t\t\t\t\t...branch\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst exposes = svc.expose !== void 0 && Object.keys(svc.expose).length > 0;\n\t\t\tconst refsByBrand = /* @__PURE__ */ new Map();\n\t\t\tif (exposes) for (const edge of provisionedEdges(graph)) {\n\t\t\t\tif (edge.providerAddress !== address) continue;\n\t\t\t\tconst ref = ctx.provisioned.get(edge.edgeId);\n\t\t\t\tif (ref === void 0) continue;\n\t\t\t\tconst refs = refsByBrand.get(edge.brand) ?? [];\n\t\t\t\trefs.push(ref);\n\t\t\t\trefsByBrand.set(edge.brand, refs);\n\t\t\t}\n\t\t\tfor (const [brand, entry] of o().providerParams) {\n\t\t\t\tconst raw = \"valueForService\" in entry ? entry.valueForService(provisioned, address) : exposes ? entry.value(refsByBrand.get(brand) ?? []) : void 0;\n\t\t\t\tif (raw === void 0) continue;\n\t\t\t\tconst key = configKey(address, {\n\t\t\t\t\towner: \"service\",\n\t\t\t\t\tname: entry.name\n\t\t\t\t});\n\t\t\t\tconst value = Output.isOutput(raw) ? Output.map(raw, (v) => encode(\"service\", v)) : encode(\"service\", raw);\n\t\t\t\trecords.push(yield* Prisma.EnvironmentVariable(`${key}-var`, {\n\t\t\t\t\tprojectId,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue,\n\t\t\t\t\tclass: cls,\n\t\t\t\t\t...branch\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tenvironment: records,\n\t\t\t\tport: typeof config.service[\"port\"] === \"number\" ? config.service[\"port\"] : 3e3,\n\t\t\t\t...inputRow !== void 0 ? { input: inputRow } : {}\n\t\t\t};\n\t\t}),\n\t\tpackage: ({ id }, { assembled, address }) => Effect.try(() => Prisma.packageComputeArtifact({\n\t\t\tid,\n\t\t\tbundleDir: assembled.dir,\n\t\t\tappEntry: assembled.entry,\n\t\t\taddress\n\t\t})),\n\t\tdeploy: ({ id }, provisioned, artifact, serialized) => Effect.gen(function* () {\n\t\t\tconst deployment = yield* Prisma.Deployment(`${id}-deploy`, {\n\t\t\t\tcomputeServiceId: provisioned.serviceId,\n\t\t\t\tartifactPath: artifact.path,\n\t\t\t\tartifactHash: artifact.sha256,\n\t\t\t\tenvironment: serialized.environment,\n\t\t\t\tport: serialized.port\n\t\t\t});\n\t\t\tconst inputDetails = serialized.input !== void 0 ? { details: {\n\t\t\t\tinput: serialized.input.value,\n\t\t\t\t...serialized.input.absent.length > 0 ? { absent: serialized.input.absent.join(\"\\n\") } : {}\n\t\t\t} } : {};\n\t\t\treturn {\n\t\t\t\toutputs: {\n\t\t\t\t\turl: deployment.deployedUrl,\n\t\t\t\t\tprojectId: provisioned.projectId\n\t\t\t\t},\n\t\t\t\tentities: [{\n\t\t\t\t\tkind: \"compute-service\",\n\t\t\t\t\tid: provisioned.serviceId,\n\t\t\t\t\turl: deployment.deployedUrl,\n\t\t\t\t\t...inputDetails\n\t\t\t\t}]\n\t\t\t};\n\t\t})\n\t};\n}\n//#endregion\n//#region src/descriptors/postgres.ts\n/**\n* One Database per module-provisioned postgres resource — `id` is the\n* module provision id, so a resource shared by several consumers is created\n* exactly once.\n*/\nfunction postgresDescriptor(o) {\n\tconst lowering = ({ id, application }) => Effect.gen(function* () {\n\t\tvalidateName(id, \"resource name (from provision id)\");\n\t\tconst branchId = cloudApplicationOf(application).branchId;\n\t\tconst db = yield* Prisma.Database(`${id}-db`, {\n\t\t\tprojectId: projectIdOf(application),\n\t\t\tname: id,\n\t\t\tregion: o().region ?? \"us-east-1\",\n\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t});\n\t\tconst conn = yield* Prisma.Connection(`${id}-conn`, {\n\t\t\tdatabaseId: db.id,\n\t\t\tname: id\n\t\t});\n\t\tconst url = Output.map(conn.connectionString, (value) => Redacted.value(value));\n\t\treturn {\n\t\t\toutputs: { url: (yield* PgWarm(`${id}-warm`, { url })).url },\n\t\t\tentities: [{\n\t\t\t\tkind: \"postgres-database\",\n\t\t\t\tid: db.id\n\t\t\t}]\n\t\t};\n\t});\n\treturn Object.assign(lowering, { kind: \"resource\" });\n}\n//#endregion\n//#region src/preflight.ts\n/** production for the default stage; preview for a named stage — matching how the pack writes config rows. */\nconst classFor = (branchId) => branchId === void 0 ? \"production\" : \"preview\";\n/**\n* One page of the env-var list. The query is `blindCast` to `never` because\n* openapi-fetch types this path's query as `never` (an SDK path/operation\n* mismatch); that same workaround defeats the client's response-type inference,\n* so the result is projected to the small shape we actually read.\n*/\nasync function listEnvVars(client, query) {\n\treturn blindCast(await client.GET(\"/v1/environment-variables\", { params: { query: blindCast(query) } }));\n}\nasync function existsOnPlatform(client, projectId, branchId, key) {\n\tconst cls = classFor(branchId);\n\tconst visible = (row) => branchId === void 0 || row.branchId === null || row.branchId === branchId;\n\tlet found = false;\n\tawait drivePagesAsync(`environment variables named \"${key}\"`, async (cursor) => {\n\t\tconst res = await listEnvVars(client, cursor === void 0 ? {\n\t\t\tprojectId,\n\t\t\tclass: cls,\n\t\t\tkey\n\t\t} : {\n\t\t\tprojectId,\n\t\t\tclass: cls,\n\t\t\tkey,\n\t\t\tcursor\n\t\t});\n\t\tif (res.error !== void 0) throw listFailedError(key, res.error);\n\t\treturn res.data ?? {\n\t\t\tdata: [],\n\t\t\tpagination: {\n\t\t\t\tnextCursor: null,\n\t\t\t\thasMore: false\n\t\t\t}\n\t\t};\n\t}, (data) => {\n\t\tfound = data.some(visible);\n\t\treturn found;\n\t});\n\treturn found;\n}\n/**\n* Provision `key`=`value` directly via the Management API for the target\n* stage's scope (a production template for the default stage; a preview branch\n* override for a named stage — the same scope the pack writes config rows to,\n* EnvironmentVariable.ts). A 409 means a concurrent deploy already provisioned\n* it — tolerated. The value is never logged.\n*/\nasync function fillMissing(client, projectId, branchId, key, value) {\n\tconst res = await client.POST(\"/v1/environment-variables\", { body: {\n\t\tprojectId,\n\t\tclass: classFor(branchId),\n\t\tkey,\n\t\tvalue,\n\t\t...branchId !== void 0 ? { branchId } : {}\n\t} });\n\tif (res.error !== void 0 && res.response.status !== 409) throw fillFailedError(key, res.error);\n}\nconst tokenRequiredError = () => /* @__PURE__ */ new Error(\"environment variable PRISMA_SERVICE_TOKEN is required for deploy preflight.\");\nconst listFailedError = (key, error) => /* @__PURE__ */ new Error(`deploy preflight: Prisma Management API error listing \"${key}\": ${JSON.stringify(error)}.`);\nconst fillFailedError = (key, error) => /* @__PURE__ */ new Error(`deploy preflight: failed to provision \"${key}\" from the deploy shell: ${JSON.stringify(error)}.`);\nfunction missingError(missing, branchId, stage) {\n\tconst scope = branchId === void 0 ? \"the production class (project-level template)\" : `the preview class of stage \"${stage ?? branchId}\" (branch override or template)`;\n\tconst lines = missing.map((m) => ` - ${m.name} (required by service \"${m.serviceAddress}\")`);\n\treturn /* @__PURE__ */ new Error(`Deploy preflight failed — ${missing.length} env var(s) (secret or env-sourced param) are not provisioned on Prisma Cloud for ${scope}, and are absent from the deploy shell:\\n${lines.join(\"\\n\")}\\n\\nSet each in the deploy shell environment (the CLI will provision it on deploy), or create it on the platform (Prisma Console or the Management API) in ${scope}.`);\n}\nasync function managementClient() {\n\tif ((process.env[\"PRISMA_SERVICE_TOKEN\"] ?? \"\").length === 0) throw tokenRequiredError();\n\treturn Effect.runPromise(Effect.gen(function* () {\n\t\treturn yield* ManagementClient;\n\t}).pipe(Effect.provide(managementClientLayer().pipe(Layer.provide(fromEnv())))));\n}\n/**\n* The Prisma Cloud extension's `preflight`. Uses the shared name collector\n* (`collectPreflightNames`, ADR-0042) — every service's input-binding\n* `envSecret` leaf, plus `paramManifest` filtered to env-sourced reserved\n* params — checks each platform name against the platform, fills from the\n* shell where possible, and fails loudly on anything absent from both.\n* `envParam` leaves of an input binding are NOT checked here — they resolve\n* from the deploy shell at serialize, and an unset one is an omitted key the\n* schema arbitrates. Accepts an injected client for tests; otherwise builds\n* one from env.\n*/\nasync function runPreflight(input, deps) {\n\tconst { projectId, branchId } = prismaCloudContainerOf(input.container);\n\tconst collected = collectPreflightNames(input.graph);\n\tconst names = /* @__PURE__ */ new Map();\n\tfor (const meta of [...collected.secrets, ...collected.envParams]) if (!names.has(meta.name)) names.set(meta.name, meta);\n\tif (names.size === 0) return;\n\tconst client = deps?.client ?? await managementClient();\n\tconst missing = [];\n\tfor (const meta of names.values()) {\n\t\tif (await existsOnPlatform(client, projectId, branchId, meta.name)) continue;\n\t\tconst shellValue = process.env[meta.name];\n\t\tif (shellValue !== void 0 && shellValue.length > 0) {\n\t\t\tawait fillMissing(client, projectId, branchId, meta.name, shellValue);\n\t\t\tcontinue;\n\t\t}\n\t\tmissing.push(meta);\n\t}\n\tif (missing.length > 0) throw missingError(missing, branchId, input.stage);\n}\n/**\n* The extension-pack half of the deploy preflight: every dependency edge\n* whose required contract carries a `requiredPackHead` must be wired to a\n* `pnPostgres` resource whose `prisma-next.config.ts` lists that pack at the\n* required head hash. Enforced HERE — at deploy time, before the migration\n* step constructs — because wireability (`pnContract().satisfies`)\n* deliberately says yes to every required pack head (the authoring-side\n* contract value cannot see the resource's config), and boot time would be\n* too late: the service would be down after a green deploy. Invoked from the\n* `prisma-next` descriptor's lowering, beside the migration-step\n* construction.\n*/\nasync function runPackPreflight(graph) {\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\tconst requirement = requiredPackHeadOf(slot.required);\n\t\tif (requirement === void 0) continue;\n\t\tconst node = graph.nodes.find((n) => n.id === edge.from)?.node;\n\t\tconst provider = node !== void 0 && (node.kind === \"resource\" || node.kind === \"service\") && isPnPostgresResourceNode(node) ? node : void 0;\n\t\tif (provider === void 0) throw new Error(`service \"${edge.to}\" requires extension pack \"${requirement.packId}\", which only a pnPostgres resource can carry.`);\n\t\tconst { extensionPacks } = await resolvePrismaNextConfig(provider.config);\n\t\tif (extensionPacks.find((p) => p.id === requirement.packId) === void 0) throw new Error(`prisma-next database \"${provider.name}\" does not list extension pack \"${requirement.packId}\" in its prisma-next.config.ts extensionPacks — service \"${edge.to}\" requires it. Add the pack and run migration plan.`);\n\t}\n}\n//#endregion\n//#region src/descriptors/prisma-next.ts\n/**\n* The migration is a tracked `PnMigration` Alchemy resource keyed on the\n* target REF identity (hash + sorted invariants): unchanged redeploy is a\n* no-op, a contract or ref-invariant change re-migrates.\n*/\nfunction prismaNextDescriptor(o) {\n\tconst lowering = ({ id, node, application, graph }) => Effect.gen(function* () {\n\t\tvalidateName(id, \"resource name (from provision id)\");\n\t\tconst branchId = cloudApplicationOf(application).branchId;\n\t\tconst db = yield* Prisma.Database(`${id}-db`, {\n\t\t\tprojectId: projectIdOf(application),\n\t\t\tname: id,\n\t\t\tregion: o().region ?? \"us-east-1\",\n\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t});\n\t\tconst conn = yield* Prisma.Connection(`${id}-conn`, {\n\t\t\tdatabaseId: db.id,\n\t\t\tname: id\n\t\t});\n\t\tconst url = Output.map(conn.connectionString, (value) => Redacted.value(value));\n\t\tif (!isPnPostgresResourceNode(node)) throw new Error(`prisma-next lowering received a non-prisma-next node (${id}).`);\n\t\tconst contractJson = node.provides.__cmp.contractJson;\n\t\tconst { migrationsDir, extensionPacks } = yield* Effect.promise(() => resolvePrismaNextConfig(node.config));\n\t\tconst ref = yield* Effect.promise(() => resolveTargetRef(migrationsDir, contractJson, node.targetRef));\n\t\tyield* Effect.promise(() => runPackPreflight(graph));\n\t\tconst warm = yield* PgWarm(`${id}-warm`, { url });\n\t\tyield* PnMigration(`${id}-migrate`, {\n\t\t\turl: warm.url,\n\t\t\tcontractJson,\n\t\t\tmigrationsDir,\n\t\t\ttargetHash: ref.hash,\n\t\t\tinvariants: [...ref.invariants].sort(),\n\t\t\tpackHeadRefHashes: packHeadRefHashes(extensionPacks),\n\t\t\tconfigPath: node.config,\n\t\t\t...node.targetRef !== void 0 ? { refName: node.targetRef } : {}\n\t\t});\n\t\treturn {\n\t\t\toutputs: { url: warm.url },\n\t\t\tentities: [{\n\t\t\t\tkind: \"postgres-database\",\n\t\t\t\tid: db.id\n\t\t\t}]\n\t\t};\n\t});\n\treturn Object.assign(lowering, { kind: \"resource\" });\n}\n//#endregion\n//#region src/descriptors/s3-credentials.ts\n/**\n* One `S3Credentials` resource per provisioned credentials node — `id` is the\n* module provision id, so a pair shared by the storage service is minted once\n* and kept stable across deploys (the resource's provider preserves it).\n* `_o` is unused today (the mint needs no region/project) but kept for symmetry\n* with the other descriptors' signature.\n*/\nfunction s3CredentialsDescriptor(_o) {\n\tconst lowering = ({ id }) => Effect.gen(function* () {\n\t\tconst creds = yield* S3Credentials(`${id}-creds`, {});\n\t\treturn {\n\t\t\toutputs: {\n\t\t\t\taccessKeyId: creds.accessKeyId,\n\t\t\t\tsecretAccessKey: creds.secretAccessKey\n\t\t\t},\n\t\t\tentities: []\n\t\t};\n\t});\n\treturn Object.assign(lowering, { kind: \"resource\" });\n}\n//#endregion\n//#region src/descriptors/s3-store.ts\nfunction s3StoreDescriptor(o) {\n\tconst base = computeDescriptor(o);\n\treturn {\n\t\tkind: \"service\",\n\t\tprovision: base.provision,\n\t\tpackage: base.package,\n\t\tserialize: (ctx, provisioned, config) => Effect.gen(function* () {\n\t\t\tconst serialized = yield* base.serialize(ctx, provisioned, config);\n\t\t\tconst credentials = config.inputs[\"credentials\"] ?? {};\n\t\t\tconst document = serialized.input !== void 0 ? JSON.parse(serialized.input.value) : void 0;\n\t\t\tconst bucket = typeof document === \"object\" && document !== null && \"bucket\" in document ? document.bucket : void 0;\n\t\t\tif (credentials[\"accessKeyId\"] === void 0 || credentials[\"secretAccessKey\"] === void 0 || bucket === void 0) throw new Error(\"s3-store service must wire a 'credentials' dependency and declare a 'bucket' input key\");\n\t\t\treturn {\n\t\t\t\t...serialized,\n\t\t\t\tbucket,\n\t\t\t\taccessKeyId: credentials[\"accessKeyId\"],\n\t\t\t\tsecretAccessKey: credentials[\"secretAccessKey\"]\n\t\t\t};\n\t\t}),\n\t\tdeploy: (ctx, provisioned, artifact, serialized) => Effect.gen(function* () {\n\t\t\tconst deployed = yield* base.deploy(ctx, provisioned, artifact, serialized);\n\t\t\treturn {\n\t\t\t\t...deployed,\n\t\t\t\toutputs: {\n\t\t\t\t\t...deployed.outputs,\n\t\t\t\t\tbucket: serialized.bucket,\n\t\t\t\t\taccessKeyId: serialized.accessKeyId,\n\t\t\t\t\tsecretAccessKey: serialized.secretAccessKey\n\t\t\t\t}\n\t\t\t};\n\t\t})\n\t};\n}\n//#endregion\n//#region src/control/extension.ts\n/** The Prisma Cloud–hosted deploy state store; its implementation lives in @internal/lowering. */\n/**\n* ADR-0031's registered provisioner for RPC_PEER_KEY: mints one `ServiceKey`\n* resource per edge (ADR-0030) and forwards its value as the opaque ref core\n* writes into the consumer's `serviceKey` param. The resource id keeps the\n* `servicekey-${edgeId}` scheme byte-identical to slice 2's, so an existing\n* deploy's keys are found, not re-minted. Defined here, not in service-keys.ts:\n* that module is also reachable from the runtime/authoring side, which must\n* never import `@internal/lowering` or `effect`.\n*/\nconst serviceKeyProvisioner = { provision: (edge) => Effect.gen(function* () {\n\treturn (yield* Prisma.ServiceKey(`servicekey-${edge.edgeId}`, {})).value;\n}) };\n/**\n* `ctx.provisioned`'s refs are typed `unknown` — core forwards a provisioner's\n* ref without inspecting it. Each provider param below is the sole reader of\n* its own provisioner's output, so the shape is asserted here, once, rather\n* than checked.\n*/\nconst asKeyOutputs = (refs) => refs.map((ref) => blindCast(ref));\n/**\n* RPC's deploy-side `value(refs)` (ADR-0030): the provider stores a SET — one\n* key per inbound edge — into the accepted-keys var `serve()` reads. Paired\n* with the provisioner above: mint per edge, aggregate every edge.\n*\n* Zero consumers still emits, and that is the whole point of #100: an ABSENT\n* var means \"never provisioned\" and passes every caller through, so a deployed\n* provider nobody wired must say \"[]\" — deny everything — rather than say\n* nothing. Written as a literal because `Output.all()` with no arguments has\n* nothing to resolve.\n*/\nconst rpcAcceptedKeysValue = (refs) => refs.length > 0 ? Output.all(...asKeyOutputs(refs)) : [];\n/**\n* ADR-0031's registered provisioner for STREAMS_API_KEY — the same `ServiceKey`\n* mint, keyed PER PROVIDER instead of per edge: the resource id is the\n* provider's address, so every consumer edge of one streams module resolves to\n* the same resource and therefore the same stable value. That is what\n* `@prisma/streams-server` requires (it authenticates a single `API_KEY`), and\n* cardinality is exactly what ADR-0031 leaves to the provisioner. Making it\n* per-edge later is this id's shape plus an accepted-set provider param — no\n* new resource, no core change.\n*/\nconst streamsApiKeyProvisioner = { provision: (edge) => Effect.gen(function* () {\n\treturn (yield* Prisma.ServiceKey(`streamskey-${edge.providerAddress}`, {})).value;\n}) };\n/**\n* Streams' deploy-side `value(refs)`: ONE value, not a set —\n* `@prisma/streams-server` authenticates a single `API_KEY`, which is why the\n* provisioner above mints per provider. That pairing is the invariant this\n* param depends on, so it asserts rather than trusts it: a future per-edge\n* flip without a paired accepted-set param here would otherwise ship\n* whichever key came first and leave every other consumer 401ing, silently.\n* The refs are lazy Outputs (not comparable at serialize time); inside\n* `Output.map` they are resolved strings, the same seam RPC's set aggregates\n* on.\n*\n* Zero consumers emits NOTHING — the streams counterpart to RPC's \"[]\".\n* `@prisma/streams-server` has no deny-all mode: it either authenticates a key\n* or runs --no-auth, so there is no value here that means \"refuse everyone\".\n* Writing no key is what fails closed — the entrypoint refuses to boot with\n* a named error rather than serve unauthenticated.\n*/\nconst streamsApiKeyValue = (refs) => {\n\tif (refs.length === 0) return void 0;\n\treturn Output.map(Output.all(...asKeyOutputs(refs)), (vals) => {\n\t\tconst distinct = [...new Set(vals)];\n\t\tif (distinct.length > 1) throw new Error(`a streams provider was provisioned ${distinct.length} distinct keys across its ${refs.length} inbound bindings, but it can only be given one (@prisma/streams-server authenticates a single API_KEY). Its provisioner must mint per provider, not per edge — or this param must store an accepted-key set, once the server accepts one.`);\n\t\treturn distinct[0] ?? \"\";\n\t});\n};\n/**\n* Origin's deploy-side value function (service-derived): the provisioned\n* service's own `endpointDomain`, verbatim — `https://…`, no trailing slash,\n* no normalization. Every compute service gets this row, exposing or not.\n* The undefined guard is a deploy-time invariant check, not a policy: the\n* Management API always reports an endpoint domain post-PRO-200, so a missing\n* one means the platform predates the fix — fail the deploy loudly rather\n* than write a row origin() would trust. The raw string is JSON-encoded by\n* the descriptor's generic loop, like every other reserved provider param.\n*/\nconst selfOriginValue = (provisioned, address) => Output.map(provisioned.endpointDomain, (v) => {\n\tif (v === void 0) throw new Error(`ComputeService for \"${address}\" reported no endpointDomain at provision — cannot resolve the service's own origin (Management API predates the PRO-200 fix?)`);\n\treturn v;\n});\n/** The user-facing state descriptor: `state: prismaState()` in `prisma-composer.config.ts` (ADR-0017). */\nconst prismaState = () => ({\n\textension: PRISMA_CLOUD_EXTENSION_ID,\n\tcreate: (container) => {\n\t\tconst { projectId, branchId, defaultBranchId } = prismaCloudContainerOf(container);\n\t\treturn prismaStateLayer({\n\t\t\tprojectId,\n\t\t\t...branchId !== void 0 ? { branchId } : {},\n\t\t\t...defaultBranchId !== void 0 ? { defaultBranchId } : {}\n\t\t});\n\t}\n});\nconst KNOWN_REGION_SET = new Set(Prisma.COMPUTE_REGIONS);\nfunction isComputeRegion(value) {\n\treturn KNOWN_REGION_SET.has(value);\n}\n/** Prisma.providers()'s ProviderCollection doesn't structurally unify with Alchemy's inferred providers Layer (a @internal/lowering typings gap); it satisfies it at runtime. */\nfunction asProvidersLayer(layer) {\n\treturn layer;\n}\n/**\n* This extension's brands, each with the two halves ADR-0031 splits: the\n* PROVISIONER core resolves a mint through, and the reserved PROVIDER PARAM\n* that stores the minted values on the provider. So this file stays the only\n* place a brand is named — `descriptors/compute.ts` just looks a provider\n* param up by brand.\n*\n* `__tests__/provider-params.test.ts` asserts this map's brands are exactly\n* `PROVIDER_PARAMS`'s edge-derived brands (a service-derived param like the\n* origin mints nothing, so it has no provisioner): a brand minted here with no provider param\n* below would leave the value it mints written to consumers while no\n* provider ever stores an accepted-keys row for it — `serve()` (or the\n* equivalent runtime reader) then sees an absent var and passes every caller\n* through.\n*/\nconst PROVISIONERS = /* @__PURE__ */ new Map([[RPC_PEER_KEY, serviceKeyProvisioner], [STREAMS_API_KEY, streamsApiKeyProvisioner]]);\n/**\n* Every brand's deploy-side value function — the only per-brand thing this\n* file still holds directly. `PROVIDER_PARAMS` below is built by mapping\n* `RESERVED_PROVIDER_PARAMS` (`provider-params.ts`, the boot-side list) onto\n* this map, so a param can exist on the deploy side only if it already\n* exists on the boot side: `RESERVED_PROVIDER_PARAMS` is the single source of\n* which reserved provider params exist at all, closing the drift the old\n* name-comparison test only detected after the fact.\n*/\nconst PROVIDER_PARAM_VALUES = /* @__PURE__ */ new Map([\n\t[RPC_PEER_KEY, { value: rpcAcceptedKeysValue }],\n\t[STREAMS_API_KEY, { value: streamsApiKeyValue }],\n\t[SELF_ORIGIN, { valueForService: selfOriginValue }]\n]);\n/**\n* Builds the deploy-side registry from the boot-side list, keyed by brand —\n* throws if a boot-side entry has no registered deploy-side value function,\n* so `RESERVED_PROVIDER_PARAMS` stays the single source of which reserved\n* provider params exist: deploy can no longer write a row boot never\n* stashes. Exported (rather than inlined into `PROVIDER_PARAMS` below) so\n* `__tests__/provider-params.test.ts` can drive it directly with a\n* deliberately incomplete value map and watch it throw.\n*/\nfunction buildProviderParams(entries, values) {\n\treturn new Map(entries.map((entry) => {\n\t\tconst value = values.get(entry.brand);\n\t\tif (value === void 0) throw new Error(`prisma-cloud: reserved provider param \"${entry.name}\" (provider-params.ts) has no registered deploy-side value() in control.ts's PROVIDER_PARAM_VALUES — every param in RESERVED_PROVIDER_PARAMS must have one.`);\n\t\treturn [entry.brand, {\n\t\t\t...entry,\n\t\t\t...value\n\t\t}];\n\t}));\n}\nconst PROVIDER_PARAMS = buildProviderParams(RESERVED_PROVIDER_PARAMS, PROVIDER_PARAM_VALUES);\n/**\n* Resolves the factory's env-or-option inputs. Deliberately does NOT require\n* `PRISMA_WORKSPACE_ID`: nothing in this file reads `ResolvedCloudOptions.workspaceId`\n* downstream — it exists only so a caller MAY pin an explicit workspace, and\n* the real workspace check for a real deploy lives where the value actually\n* matters, `container.ts`'s `ensureContainer`/`locateContainer`. Region\n* validation stays eager-on-call (a garbage `PRISMA_REGION` still fails\n* loudly), but an ABSENT one resolves to `undefined` without touching\n* anything else — required for `prisma-composer dev`, which never sets\n* `PRISMA_REGION` and must not fail on its absence (local-dev spec § 5).\n*/\nfunction resolveOptions(opts) {\n\tconst workspaceId = opts.workspaceId ?? process.env[\"PRISMA_WORKSPACE_ID\"] ?? \"\";\n\tif (opts.region !== void 0) return {\n\t\tworkspaceId,\n\t\tregion: opts.region,\n\t\tproviderParams: PROVIDER_PARAMS\n\t};\n\tconst region = process.env[\"PRISMA_REGION\"];\n\tif (region === void 0 || region.length === 0) return {\n\t\tworkspaceId,\n\t\tproviderParams: PROVIDER_PARAMS\n\t};\n\tif (!isComputeRegion(region)) throw new Error(`prismaCloud(): environment variable PRISMA_REGION=\"${region}\" is not a known region (expected one of: ${Prisma.COMPUTE_REGIONS.join(\", \")}).`);\n\treturn {\n\t\tworkspaceId,\n\t\tregion,\n\t\tproviderParams: PROVIDER_PARAMS\n\t};\n}\n/**\n* A memoized thunk over `resolveOptions` — evaluated at FIRST LOWERING USE\n* (inside a node descriptor's `provision`/`serialize`), never at `prismaCloud()`\n* construction. The node descriptors take this thunk, not a resolved value\n* (local-dev spec § 5): `prismaCloud()` itself must construct with no\n* environment present, since it also builds the `localTarget` descriptor, which must\n* never require `PRISMA_WORKSPACE_ID`/`PRISMA_REGION`/`PRISMA_SERVICE_TOKEN`.\n*/\nfunction lazyOptions(opts) {\n\tlet cached;\n\treturn () => {\n\t\tcached ??= resolveOptions(opts);\n\t\treturn cached;\n\t};\n}\n/** The Prisma Cloud extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */\nconst prismaCloud = (opts = {}) => {\n\tconst o = lazyOptions(opts);\n\treturn {\n\t\tid: PRISMA_CLOUD_EXTENSION_ID,\n\t\tcontainer: containerDescriptor(),\n\t\tproviders: () => asProvidersLayer(Layer.mergeAll(Prisma.providers(), PgWarmProvider(), PnMigrationProvider(), S3CredentialsProvider(), GeneratedParamProvider(), Prisma.ServiceKeyProvider())),\n\t\tpreflight: (input) => runPreflight(input),\n\t\tapplication: { provision: (ctx) => Effect.gen(function* () {\n\t\t\tconst { projectId, branchId } = prismaCloudContainerOf(ctx.container);\n\t\t\tfor (const key of [\"DATABASE_URL\", \"DATABASE_URL_POOLED\"]) yield* Prisma.EnvironmentVariable(`${key}-poison`, {\n\t\t\t\tprojectId,\n\t\t\t\tkey,\n\t\t\t\tvalue: \"-\",\n\t\t\t\tclass: branchId ? \"preview\" : \"production\",\n\t\t\t\t...branchId !== void 0 ? { branchId } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tprojectId,\n\t\t\t\tbranchId\n\t\t\t};\n\t\t}) },\n\t\tprovisions: PROVISIONERS,\n\t\tnodes: {\n\t\t\tpostgres: postgresDescriptor(o),\n\t\t\t\"prisma-next\": prismaNextDescriptor(o),\n\t\t\tcompute: computeDescriptor(o),\n\t\t\tcredentials: s3CredentialsDescriptor(o),\n\t\t\t\"s3-store\": s3StoreDescriptor(o),\n\t\t\ts3: bucketDescriptor(o)\n\t\t},\n\t\tlocalTarget: () => import(\"@prisma/composer-prisma-cloud/local-target\").then((m) => m.localTargetDescriptor())\n\t};\n};\n//#endregion\nexport { PROVIDER_PARAMS, buildProviderParams, prismaCloud, prismaState };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,iBAAiB,QAAQ,OAAO,UAAU,WAAW,OAAO,IAAI,4GAA4G,EAAE,QAAQ;CAC3L,MAAM;EACL,WAAW,MAAM;EACjB,UAAU,MAAM;EAChB,OAAO,MAAM;EACb,OAAO,MAAM;CACd;CACA,QAAQ,EAAE,0BAA0B,SAAS,MAAM,MAAM,OAAO,EAAE;AACnE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK,SAAS,KAAK,SAAS,CAAC,CAAC;AAChD,MAAM,uBAAuB,QAAQ,WAAW,aAAa,OAAO,IAAI,aAAa;CACpF,MAAM,SAAS,WAAW,WAAW,KAAK,IAAI;EAC7C;EACA;CACD,IAAI;EACH;EACA;EACA;CACD;CACA,MAAM,OAAO,OAAO,aAAa,kBAAkB,aAAa,WAAW,WAAW,OAAO,IAAI,YAAY,EAAE,QAAQ,EAAE,OAAO,MAAM,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;CACnJ,MAAM,YAAY,OAAO,aAAa,uBAAuB,aAAa,WAAW,WAAW,OAAO,IAAI,iBAAiB,EAAE,QAAQ,EAAE,OAAO,MAAM,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;CAClK,MAAM,UAAU,OAAO,aAAa,qBAAqB,aAAa,WAAW,WAAW,OAAO,IAAI,eAAe,EAAE,QAAQ,EA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,aAAa;GAC1D,MAAM,EAAE,WAAW,aAAa,uBAAuB,IAAI,SAAS;GACpE,KAAK,MAAM,OAAO,CAAC,gBAAgB,qBAAqB,GAAG,OAAOT,oBAA2B,GAAG,IAAI,UAAU;IAC7G;IACA;IACA,OAAO;IACP,OAAO,WAAW,YAAY;IAC9B,GAAG,aAAa,KAAK,IAAI,EAAE,SAAS,IAAI,CAAC;GAC1C,CAAC;GACD,OAAO;IACN;IACA;GACD;EACD,CAAC,EAAE;EACH,YAAY;EACZ,OAAO;GACN,UAAU,mBAAmB,CAAC;GAC9B,eAAe,qBAAqB,CAAC;GACrC,SAAS,kBAAkB,CAAC;GAC5B,aAAa,wBAAwB,CAAC;GACtC,YAAY,kBAAkB,CAAC;GAC/B,IAAI,iBAAiB,CAAC;EACvB;EACA,mBAAmB,OAAO,6CAA6C,CAAC,MAAM,MAAM,EAAE,sBAAsB,CAAC;CAC9G;AACD"}
@@ -1,4 +1,4 @@
1
- import { C as Project, D as EnvironmentVariable, E as Deployment, M as BucketKey, S as Database, T as ComputeService, a as PgWarmProvider, c as PrismaCloudContainer, d as collectPreflightNames, h as prismaCloudContainerOf, j as Bucket, k as ServiceKeyProvider, n as GeneratedParamProvider, p as deserialize, s as PnMigrationProvider, u as S3CredentialsProvider, v as mintKeyPair, x as Connection, y as Providers } from "./s3-credentials-resource-BMsm9nho-Cpc28adr.mjs";
1
+ import { C as Project, D as EnvironmentVariable, E as Deployment, M as BucketKey, S as Database, T as ComputeService, a as PgWarmProvider, c as PrismaCloudContainer, d as collectPreflightNames, h as prismaCloudContainerOf, j as Bucket, k as ServiceKeyProvider, n as GeneratedParamProvider, p as deserialize, s as PnMigrationProvider, u as S3CredentialsProvider, v as mintKeyPair, x as Connection, y as Providers } from "./s3-credentials-resource-DOjmcHZh-D4jQK_9K.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { blindCast } from "@prisma/composer/casts";
4
4
  import * as Effect from "effect/Effect";