@prisma/composer 0.36.0-dev.6 → 0.36.0-dev.7
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/{app-config-RX-7kHbF-BroG2yMY.d.mts → app-config-Bf_y5R7o-BEZAnKqM.d.mts} +31 -31
- package/dist/app-config-Bf_y5R7o-BEZAnKqM.d.mts.map +1 -0
- package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs +221 -0
- package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +1 -0
- package/dist/arktype.mjs +1 -2
- package/dist/arktype.mjs.map +1 -1
- package/dist/config-CDkq5Ayl.d.mts +1 -0
- package/dist/config-adapters-DG-uhGfv-Bt1M9f8b.mjs +47 -0
- package/dist/config-adapters-DG-uhGfv-Bt1M9f8b.mjs.map +1 -0
- package/dist/config.d.mts +7 -9
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/control.d.mts +6 -183
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +4 -4
- package/dist/control.mjs.map +1 -1
- package/dist/deploy-CmiYExQA.mjs +373 -0
- package/dist/deploy-CmiYExQA.mjs.map +1 -0
- package/dist/deploy-DQyaIoNe.d.mts +2 -0
- package/dist/deploy.d.mts +4 -3
- package/dist/deploy.mjs +3 -365
- package/dist/{deployment-summary-QkZexVIS-DqL4znd4.mjs → deployment-summary-BiBkPWlB-CyC2pudN.mjs} +9 -46
- package/dist/deployment-summary-BiBkPWlB-CyC2pudN.mjs.map +1 -0
- package/dist/{deployment-summary-Cm4lN6w9-CGdGdlFC.d.mts → deployment-summary-p88NV5m5-BJOosgmI.d.mts} +4 -5
- package/dist/deployment-summary-p88NV5m5-BJOosgmI.d.mts.map +1 -0
- package/dist/{secret-DoWGmN7m-CI5Yrldp.mjs → describe-kind-Cpm_euxo-CkhlGJUL.mjs} +13 -2
- package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +1 -0
- package/dist/{dev-current-BurA9uhA-DixUKm8W.mjs → dev-current-D0Kn6Mf4-DDWYu-3j.mjs} +5 -5
- package/dist/{dev-current-BurA9uhA-DixUKm8W.mjs.map → dev-current-D0Kn6Mf4-DDWYu-3j.mjs.map} +1 -1
- package/dist/{dev-environment-name-6eEr5PW8-BbNUVxlS.mjs → dev-environment-name-6eEr5PW8-BwusWVKi.mjs} +3 -3
- package/dist/{dev-environment-name-6eEr5PW8-BbNUVxlS.mjs.map → dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map} +1 -1
- package/dist/{dist-DiYPSVUE.mjs → dist-BtzrklYG.mjs} +2 -2
- package/dist/{dist-DiYPSVUE.mjs.map → dist-BtzrklYG.mjs.map} +1 -1
- package/dist/{dist-DLOn1x6Z.mjs → dist-C7SnNTD3.mjs} +2 -2
- package/dist/{dist-DLOn1x6Z.mjs.map → dist-C7SnNTD3.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-Cww6zOSC-D8eKSdMX.mjs → execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs} +59 -35
- package/dist/execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs.map +1 -0
- package/dist/{execute-dev-4KYkqSMh-Ny8ATEfU.mjs → execute-dev-Bl-5Q-Av-DILne6iY.mjs} +79 -48
- package/dist/execute-dev-Bl-5Q-Av-DILne6iY.mjs.map +1 -0
- package/dist/{execute-dev-current-Cd4YEUZk-DBj9y27X.mjs → execute-dev-current-D3USgHJ4-CNQe5ADb.mjs} +6 -6
- package/dist/{execute-dev-current-Cd4YEUZk-DBj9y27X.mjs.map → execute-dev-current-D3USgHJ4-CNQe5ADb.mjs.map} +1 -1
- package/dist/{execute-log-BC5o35wQ-photDb2l.mjs → execute-log-Dm3DkQQP-BSjoy6Wd.mjs} +6 -6
- package/dist/{execute-log-BC5o35wQ-photDb2l.mjs.map → execute-log-Dm3DkQQP-BSjoy6Wd.mjs.map} +1 -1
- package/dist/{graph-nazLWyK2-BBciBJje.mjs → graph-Bqr7PSGl-BM-M-TlO.mjs} +169 -40
- package/dist/graph-Bqr7PSGl-BM-M-TlO.mjs.map +1 -0
- package/dist/{graph-B_szUZs6--jpigkBW.d.mts → graph-DI1v3WKX-3g1lTRbh.d.mts} +8 -4
- package/dist/graph-DI1v3WKX-3g1lTRbh.d.mts.map +1 -0
- package/dist/{graph-types-CViux_yr-CVV2nQ0l.d.mts → graph-types-DRe9UUOp-C85Yr-sJ.d.mts} +60 -14
- package/dist/graph-types-DRe9UUOp-C85Yr-sJ.d.mts.map +1 -0
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-BNYl6MsF.d.mts → index-DWQ6BSgm.d.mts} +3 -3
- package/dist/{index-BNYl6MsF.d.mts.map → index-DWQ6BSgm.d.mts.map} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -3
- package/dist/internal-app-configuration-file.d.mts +19 -0
- package/dist/internal-app-configuration-file.d.mts.map +1 -0
- package/dist/internal-app-configuration-file.mjs +2 -0
- package/dist/{local-target-zSdLvLyy.mjs → local-target-Dd8FJEb5.mjs} +4 -3
- package/dist/{local-target-zSdLvLyy.mjs.map → local-target-Dd8FJEb5.mjs.map} +1 -1
- package/dist/local-target.d.mts +2 -2
- package/dist/local-target.d.mts.map +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-C9O2M7Z4.d.mts → nextjs-DLyeRR7M-RtoHcY1c.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-C9O2M7Z4.d.mts.map → nextjs-DLyeRR7M-RtoHcY1c.d.mts.map} +1 -1
- package/dist/nextjs-control.d.mts +4 -4
- package/dist/nextjs-control.mjs +2 -2
- package/dist/nextjs.d.mts +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node-control.mjs +2 -2
- package/dist/node.d.mts +2 -2
- package/dist/redaction-Bf8FvTFH-BTsKD9B5.d.mts +183 -0
- package/dist/redaction-Bf8FvTFH-BTsKD9B5.d.mts.map +1 -0
- package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs +295 -0
- package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs.map +1 -0
- package/dist/report.d.mts +3 -3
- package/dist/report.mjs +1 -1
- package/dist/report.mjs.map +1 -1
- package/dist/{run-alchemy-B-Z6i3cD-C30mHT0u.mjs → run-alchemy-OS_ix5g0-DCvUYZ7T.mjs} +30 -13
- package/dist/run-alchemy-OS_ix5g0-DCvUYZ7T.mjs.map +1 -0
- package/dist/{run-report-CmBz2-xc-S50d4g5V.mjs → run-report-CmBz2-xc-Cc8rV1CX.mjs} +2 -2
- package/dist/{run-report-CmBz2-xc-S50d4g5V.mjs.map → run-report-CmBz2-xc-Cc8rV1CX.mjs.map} +1 -1
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/{validate-environment-BNZC6W46-CNGrBiHh.mjs → validate-environment-D_dECxgO-B-gqpVEf.mjs} +76 -13
- package/dist/validate-environment-D_dECxgO-B-gqpVEf.mjs.map +1 -0
- package/dist/zod.mjs +1 -2
- package/dist/zod.mjs.map +1 -1
- package/package.json +13 -13
- package/skills/prisma-composer-core-concepts/SKILL.md +4 -4
- package/src/exports/internal-app-configuration-file.ts +1 -0
- package/dist/app-config-RX-7kHbF-BroG2yMY.d.mts.map +0 -1
- package/dist/config-Dp3ZVNnN.d.mts +0 -1
- package/dist/config-adapters-BA_IeiX0-BiE51GeB.mjs +0 -84
- package/dist/config-adapters-BA_IeiX0-BiE51GeB.mjs.map +0 -1
- package/dist/config-pools-DiYw7wMu-DzeWrJdm.mjs +0 -63
- package/dist/config-pools-DiYw7wMu-DzeWrJdm.mjs.map +0 -1
- package/dist/deploy-Dp3ZVNnN.d.mts +0 -1
- package/dist/deploy.mjs.map +0 -1
- package/dist/deployment-summary-Cm4lN6w9-CGdGdlFC.d.mts.map +0 -1
- package/dist/deployment-summary-QkZexVIS-DqL4znd4.mjs.map +0 -1
- package/dist/describe-kind-Cpm_euxo-JFh8ejof.mjs +0 -14
- package/dist/describe-kind-Cpm_euxo-JFh8ejof.mjs.map +0 -1
- package/dist/execute-deploy-destroy-Cww6zOSC-D8eKSdMX.mjs.map +0 -1
- package/dist/execute-dev-4KYkqSMh-Ny8ATEfU.mjs.map +0 -1
- package/dist/graph-B_szUZs6--jpigkBW.d.mts.map +0 -1
- package/dist/graph-nazLWyK2-BBciBJje.mjs.map +0 -1
- package/dist/graph-types-CViux_yr-CVV2nQ0l.d.mts.map +0 -1
- package/dist/internal-pools.d.mts +0 -18
- package/dist/internal-pools.d.mts.map +0 -1
- package/dist/internal-pools.mjs +0 -2
- package/dist/run-alchemy-B-Z6i3cD-C30mHT0u.mjs.map +0 -1
- package/dist/secret-DoWGmN7m-CI5Yrldp.mjs.map +0 -1
- package/dist/validate-environment-BNZC6W46-CNGrBiHh.mjs.map +0 -1
- package/src/exports/internal-pools.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-CmiYExQA.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/deploy.mjs"],"sourcesContent":["import { i as secretsKeys, l as isParamSource, r as nodeAddresses, t as Load, v as slotsOf } from \"./graph-Bqr7PSGl.mjs\";\nimport { r as deserializeContainers } from \"./container-transport-HcvNOGZL.mjs\";\nimport * as Alchemy from \"alchemy\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\n//#region src/control/deploy.ts\nvar LowerError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"LowerError\";\n\t}\n};\nfunction assertSameNodeAddresses(built, firstProcess) {\n\tconst onlyBuilt = built.filter((address) => !firstProcess.includes(address));\n\tconst onlyFirst = firstProcess.filter((address) => !built.includes(address));\n\tif (onlyBuilt.length === 0 && onlyFirst.length === 0) return;\n\tconst list = (addresses) => addresses.length === 0 ? \"none\" : addresses.map((address) => `\"${address}\"`).join(\", \");\n\tthrow new LowerError(`The deploy's second process built a different graph from the one Composer checked in its first process. Only in the second process: ${list(onlyBuilt)}. Only in the first process: ${list(onlyFirst)}. A module body must build the same graph every time; one that reads the process environment, a file or the clock can build a different one.`);\n}\n/**\n* Resolves one SERVICE-OWN param to its config value. The full resolution\n* order across both value channels:\n*\n* 1. A param claiming BOTH a provision-time binding and a `provision` need\n* (ADR-0031) is a loud error — two sources for one value.\n* 2. A provision-time binding (a schema-validated literal, or an opaque\n* `ParamSource` the target resolves at boot per ADR-0019) beats the\n* declared `default`.\n* 3. A framework-minted `provision` need is resolved per dependency EDGE\n* against the consumer extension's registry — that path fills CONNECTION\n* params in `buildConfig`'s inputs loop, never this function. A\n* service-own param has no edge to mint against, so an unbound need here\n* falls through like any unbound param.\n* 4. The `default`, else absent (only legal when `optional`), else a loud\n* error naming the param, the service, and the fix.\n*/\nfunction resolveParam(node, serviceId, name, param, bound) {\n\tif (bound !== void 0) {\n\t\tif (param.provision !== void 0) throw new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") has two sources claiming one value: a provision-time binding (${isParamSource(bound) ? \"a param source\" : \"a literal value\"}) AND a framework provision need (\"${String(param.provision.brand)}\") on its declaration — remove the binding or drop the \\`provision\\` facet.`);\n\t\tif (isParamSource(bound)) return bound;\n\t\tconst result = param.schema[\"~standard\"].validate(bound);\n\t\tif (result instanceof Promise) throw new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") uses an async Standard Schema — a provision-time literal value requires a synchronous validator.`);\n\t\tif (result.issues !== void 0) {\n\t\t\tconst messages = result.issues.map((issue) => issue.message).join(\"; \");\n\t\t\tthrow new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") received an invalid provision-time value: ${messages}`);\n\t\t}\n\t\treturn result.value;\n\t}\n\tif (param.default !== void 0) return param.default;\n\tif (param.optional === true) return void 0;\n\tthrow new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") has no default, is not optional, and was not bound at provision — bind it with a literal value or a param source (e.g. envParam('NAME')) on its provision() call, or give it a default.`);\n}\n/**\n* Assembles a service's typed Config. Connection params come from the\n* dependency edge's lowered outputs — or, for a param carrying a `provision`\n* need (ADR-0031), from `provisioned` (keyed by edge id): the framework mints\n* it, the producer hands nothing over. The service's own params resolve via\n* `resolveParam` (provision-time binding, then default, then loud\n* unbound-required failure).\n*\n* This is also where the connection contract is enforced: a producer that fails to\n* supply a required param its consumer's connection declares fails the deploy\n* here, naming the edge, rather than reaching the consumer as `undefined`.\n*/\nfunction buildConfig(node, id, graph, lowered, provisioned) {\n\tconst inputs = slotConnectionParams(node, id, graph, lowered, provisioned);\n\tconst boundParams = new Map(graph.params.filter((binding) => binding.serviceAddress === id).map((b) => [b.slot, b.binding]));\n\tconst service = {};\n\tfor (const [name, param] of Object.entries(node.params)) {\n\t\tconst value = resolveParam(node, id, name, param, boundParams.get(name));\n\t\tif (value !== void 0) service[name] = value;\n\t}\n\treturn {\n\t\tservice,\n\t\tinputs\n\t};\n}\n/**\n* The connection params of each of a service's or resource's dependency\n* slots, resolved against the producer's lowered outputs or the minted\n* `provisioned` value, with the connection contract enforced (see `buildConfig`).\n*/\nfunction connectionInputs(ctx) {\n\treturn slotConnectionParams(ctx.node, ctx.id, ctx.graph, ctx.lowered, ctx.provisioned);\n}\nfunction slotConnectionParams(node, id, graph, lowered, provisioned) {\n\tconst inputs = {};\n\tfor (const [inputName, inputNode] of Object.entries(node.inputs)) {\n\t\tconst edge = graph.edges.find((e) => e.to === id && e.input === inputName && e.kind === \"dependency\");\n\t\tconst producedOutputs = edge !== void 0 ? lowered.get(edge.from) ?? {} : {};\n\t\tconst values = {};\n\t\tfor (const [name, param] of Object.entries(inputNode.connection.params)) {\n\t\t\tif (param.provision !== void 0) {\n\t\t\t\tvalues[name] = provisioned.get(`${id}.${inputName}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = producedOutputs[name];\n\t\t\tif (value === void 0 && param.optional !== true && edge !== void 0) throw new LowerError(`Connection input \"${id}.${inputName}\" declares param \"${name}\", but its producer \"${edge.from}\" did not supply it — the producer's outputs carry [${Object.keys(producedOutputs).join(\", \") || \"nothing\"}]. Add \"${name}\" to the outputs the producer returns from its lowering, or declare the param optional on the connection.`);\n\t\t\tvalues[name] = value;\n\t\t}\n\t\tinputs[inputName] = values;\n\t}\n\treturn inputs;\n}\n/**\n* Joins resolved report entries back to their graph nodes — the last step of a\n* deploy report, run inside the Action with apply's resolved values.\n*\n* The entries cross Alchemy's action-input boundary, so they carry addresses\n* and plain entities only; the graph is held by closure on this side. That\n* split is why this join exists at all, and it is what keeps functions and\n* Standard Schemas (which a node carries, and which the plan's input hash\n* would have to serialize) out of the input.\n*\n* Skips an address the graph no longer holds: entries are data, the graph is\n* truth.\n*/\nfunction joinDeployment(graph, entries) {\n\tconst nodes = [];\n\tfor (const entry of entries) {\n\t\tconst node = graph.nodes.find((n) => n.id === entry.address)?.node;\n\t\tif (node === void 0 || node.kind !== \"service\" && node.kind !== \"resource\") continue;\n\t\tnodes.push({\n\t\t\taddress: entry.address,\n\t\t\tnode,\n\t\t\tentities: entry.entities\n\t\t});\n\t}\n\treturn nodes;\n}\nfunction missingBundleError(id) {\n\treturn new LowerError(`No bundle provided for service \"${id}\" (opts.bundles[\"${id}\"] is required).`);\n}\n/** The message `prisma dev` structures as `DEV.DEV_SERVER_UNSUPPORTED` (ADR-0056). */\nfunction noReserveError(id, extension, type) {\n\treturn new LowerError(`service \"${id}\" runs a dev server but its descriptor (${extension}/${type}) has no \\`reserve\\` step`);\n}\nfunction unassembledWithBundleError(address) {\n\treturn new LowerError(`\"${address}\" is listed in opts.unassembled and also has a bundle in opts.bundles — a service is either assembled or not.`);\n}\nfunction unassembledNotServiceError(address) {\n\treturn new LowerError(`\"${address}\" is listed in opts.unassembled but is not a service in the graph.`);\n}\nfunction duplicateExtensionError(id) {\n\treturn new LowerError(`Extension \"${id}\" is listed more than once in \\`extensions\\` — each extension id must be unique.`);\n}\n/** Registries as extension id → descriptor. Fails on a duplicate id — the CLI validates config, but lowering() is the programmatic escape hatch that doesn't. */\nfunction extensionsById(config) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (const extension of config.extensions) {\n\t\tif (map.has(extension.id)) return Effect.fail(duplicateExtensionError(extension.id));\n\t\tmap.set(extension.id, extension);\n\t}\n\treturn Effect.succeed(map);\n}\nfunction unknownExtensionError(extension, id) {\n\treturn new LowerError(`No extension \"${extension}\" is configured (needed by node \"${id}\") — add it to \\`extensions\\` in the \\`composer\\` section of prisma.config.ts (import its /control entry and list its descriptor).`);\n}\nfunction unknownNodeTypeError(extension, type) {\n\treturn new LowerError(`Extension \"${extension.id}\" has no descriptor for node type \"${type}\" (known: ${Object.keys(extension.nodes).join(\", \")}).`);\n}\n/** A provisioned param's need brand isn't registered by the consumer's extension (ADR-0031). */\nfunction unknownProvisionerError(extension, brand, edgeId) {\n\tconst known = extension.provisions !== void 0 && extension.provisions.size > 0 ? Array.from(extension.provisions.keys(), String).join(\", \") : \"(none registered)\";\n\treturn new LowerError(`Extension \"${extension.id}\" has no provisioner for need \"${String(brand)}\" (needed by edge \"${edgeId}\") (known: ${known}).`);\n}\n/** A provisioned edge whose consumer and provider nodes belong to different extensions (ADR-0031). */\nfunction crossExtensionProvisionError(edgeId) {\n\treturn new LowerError(`Provisioned edge \"${edgeId}\" spans two extensions — cross-extension provisioned edges aren't supported yet.`);\n}\n/**\n* More than one provisioned param on one connection (ADR-0031). One edge mints\n* ONE value, keyed by edge id, so a second need on the same connection would\n* silently receive the first's value under the first's brand.\n*/\nfunction multipleProvisionedParamsError(edgeId, names) {\n\treturn new LowerError(`Connection input \"${edgeId}\" declares more than one provisioned param (${names.join(\", \")}) — only one provisioned param per connection is supported.`);\n}\nfunction wrongKindError(extension, type, expected, got) {\n\treturn new LowerError(`Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${got}\" descriptor — this node needs a \"${expected}\" descriptor.`);\n}\n/** Looks up one node's descriptor: extension by `node.extension`, then descriptor by `node.type`, then the kind check. */\nfunction descriptorFor(extensions, node, id) {\n\tconst extension = extensions.get(node.extension);\n\tif (extension === void 0) return Effect.fail(unknownExtensionError(node.extension, id));\n\tconst descriptor = extension.nodes[node.type];\n\tif (descriptor === void 0) return Effect.fail(unknownNodeTypeError(extension, node.type));\n\tif (descriptor.kind !== node.kind) return Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));\n\treturn Effect.succeed(descriptor);\n}\n/**\n* The state-layer precedence a deploy resolves to: an explicit opts.state\n* always wins; failing that, the config's own (required) state descriptor,\n* created with its owning extension's resolved container (`undefined` when\n* that extension declared none). A pure function so the precedence is\n* testable without booting Alchemy.\n*/\nfunction resolveStateLayer(opts, config, containers) {\n\treturn opts.state ?? config.state.create(containers.get(config.state.extension));\n}\n/**\n* All configured extensions' providers merged, config array order — an\n* extension without `providers` is skipped; no used-extensions-only\n* filtering (ADR-0017's pinned providers rule).\n*/\nfunction mergedProviders(config) {\n\tconst [first, ...rest] = config.extensions.flatMap((extension) => extension.providers !== void 0 ? [extension.providers()] : []);\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n/**\n* Composable form for mixed stacks: hand-wired Alchemy resources alongside Prisma App nodes in one stack effect.\n* Fails with LowerError or whatever an extension's lowering raises — the error type is open.\n*/\nfunction lowering(root, config, opts) {\n\treturn Effect.gen(function* () {\n\t\tconst graph = Load(root, {\n\t\t\tid: opts.name,\n\t\t\t...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {},\n\t\t\t...opts.appConfigurationRead !== void 0 ? { appConfigurationRead: opts.appConfigurationRead } : {}\n\t\t});\n\t\tif (opts.firstProcessNodeAddresses !== void 0) assertSameNodeAddresses(nodeAddresses(graph), opts.firstProcessNodeAddresses);\n\t\tconst extensions = yield* extensionsById(config);\n\t\tconst containers = deserializeContainers(config.extensions, process.env);\n\t\tconst lowered = /* @__PURE__ */ new Map();\n\t\tconst entries = [];\n\t\tconst provisioned = /* @__PURE__ */ new Map();\n\t\tconst applications = /* @__PURE__ */ new Map();\n\t\tfor (const descriptor of config.extensions) {\n\t\t\tif (descriptor.application === void 0) continue;\n\t\t\tconst appCtx = {\n\t\t\t\tid: graph.root.id,\n\t\t\t\taddress: \"\",\n\t\t\t\tnode: graph.root.node,\n\t\t\t\tgraph,\n\t\t\t\topts,\n\t\t\t\tapplication: void 0,\n\t\t\t\tcontainer: containers.get(descriptor.id),\n\t\t\t\tlowered,\n\t\t\t\tprovisioned\n\t\t\t};\n\t\t\tapplications.set(descriptor.id, yield* descriptor.application.provision(appCtx));\n\t\t}\n\t\tfor (const edge of graph.edges) {\n\t\t\tif (edge.kind !== \"dependency\") continue;\n\t\t\tconst consumer = graph.nodes.find((n) => n.id === edge.to)?.node;\n\t\t\tif (consumer === void 0 || consumer.kind !== \"service\" && consumer.kind !== \"resource\") continue;\n\t\t\tconst slot = slotsOf(consumer)[edge.input];\n\t\t\tif (slot === void 0) continue;\n\t\t\tconst provisionedParams = Object.entries(slot.connection.params).filter(([, param]) => param.provision !== void 0);\n\t\t\tif (provisionedParams.length === 0) continue;\n\t\t\tconst edgeId = `${edge.to}.${edge.input}`;\n\t\t\tif (provisionedParams.length > 1) return yield* Effect.fail(multipleProvisionedParamsError(edgeId, provisionedParams.map(([name]) => name)));\n\t\t\tconst need = provisionedParams[0]?.[1].provision;\n\t\t\tif (need === void 0) continue;\n\t\t\tconst provider = graph.nodes.find((n) => n.id === edge.from)?.node;\n\t\t\tif (provider === void 0 || provider.kind !== \"service\" && provider.kind !== \"resource\") continue;\n\t\t\tif (consumer.extension !== provider.extension) return yield* Effect.fail(crossExtensionProvisionError(edgeId));\n\t\t\tconst extension = extensions.get(consumer.extension);\n\t\t\tif (extension === void 0) return yield* Effect.fail(unknownExtensionError(consumer.extension, edge.to));\n\t\t\tconst provisioner = extension.provisions?.get(need.brand);\n\t\t\tif (provisioner === void 0) return yield* Effect.fail(unknownProvisionerError(extension, need.brand, edgeId));\n\t\t\tconst ref = yield* provisioner.provision({\n\t\t\t\tapp: graph.root.id,\n\t\t\t\tedgeId,\n\t\t\t\tconsumerAddress: edge.to,\n\t\t\t\tproviderAddress: edge.from,\n\t\t\t\tinput: edge.input,\n\t\t\t\tneed\n\t\t\t});\n\t\t\tprovisioned.set(edgeId, ref);\n\t\t}\n\t\tconst unassembled = new Set(opts.unassembled ?? []);\n\t\tfor (const address of unassembled) {\n\t\t\tif (address in opts.bundles) return yield* Effect.fail(unassembledWithBundleError(address));\n\t\t\tconst found = graph.nodes.find((n) => n.id === address);\n\t\t\tif (found === void 0 || found.node.kind !== \"service\") return yield* Effect.fail(unassembledNotServiceError(address));\n\t\t}\n\t\tconst services = /* @__PURE__ */ new Map();\n\t\tconst ctxFor = (id, node) => ({\n\t\t\tid,\n\t\t\taddress: id,\n\t\t\tnode,\n\t\t\tgraph,\n\t\t\topts,\n\t\t\tapplication: applications.get(node.extension),\n\t\t\tcontainer: containers.get(node.extension),\n\t\t\tlowered,\n\t\t\tprovisioned,\n\t\t\tservices\n\t\t});\n\t\tfor (const { id, node } of graph.nodes) {\n\t\t\tif (node.kind !== \"service\") continue;\n\t\t\tconst descriptor = yield* descriptorFor(extensions, node, id);\n\t\t\tif (descriptor.kind !== \"service\") continue;\n\t\t\tservices.set(id, yield* descriptor.provision(ctxFor(id, node)));\n\t\t}\n\t\tfor (const { id, node } of graph.nodes) {\n\t\t\tif (node.kind === \"module\") continue;\n\t\t\tif (node.kind === \"dependency\") continue;\n\t\t\tconst ctx = ctxFor(id, node);\n\t\t\tconst descriptor = yield* descriptorFor(extensions, node, id);\n\t\t\tif (descriptor.kind === \"resource\") {\n\t\t\t\tconst result = yield* descriptor(ctx);\n\t\t\t\tlowered.set(id, result.outputs);\n\t\t\t\tentries.push({\n\t\t\t\t\taddress: id,\n\t\t\t\t\tentities: result.entities\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (descriptor.kind !== \"service\") return yield* Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));\n\t\t\tconst service = node;\n\t\t\tconst provisionedNode = services.get(id);\n\t\t\tconst typedConfig = buildConfig(service, id, graph, lowered, provisioned);\n\t\t\tconst serialized = yield* descriptor.serialize(ctx, provisionedNode, typedConfig);\n\t\t\tif (unassembled.has(id)) {\n\t\t\t\tif (descriptor.reserve === void 0) return yield* Effect.fail(noReserveError(id, node.extension, node.type));\n\t\t\t\tconst result = yield* descriptor.reserve(ctx, provisionedNode, serialized);\n\t\t\t\tlowered.set(id, result.outputs);\n\t\t\t\tentries.push({\n\t\t\t\t\taddress: id,\n\t\t\t\t\tentities: result.entities\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bundle = opts.bundles[id];\n\t\t\tif (bundle === void 0) return yield* Effect.fail(missingBundleError(id));\n\t\t\tconst artifact = yield* descriptor.package(ctx, {\n\t\t\t\tassembled: {\n\t\t\t\t\tdir: bundle.dir,\n\t\t\t\t\tentry: bundle.entry\n\t\t\t\t},\n\t\t\t\taddress: id\n\t\t\t});\n\t\t\tconst result = yield* descriptor.deploy(ctx, provisionedNode, artifact, serialized);\n\t\t\tlowered.set(id, result.outputs);\n\t\t\tentries.push({\n\t\t\t\taddress: id,\n\t\t\t\tentities: result.entities\n\t\t\t});\n\t\t}\n\t\tif (opts.report !== void 0) {\n\t\t\tconst report = opts.report;\n\t\t\tyield* Alchemy.Action(\"composer-deployment-report\", (input) => Effect.sync(() => {\n\t\t\t\treport({\n\t\t\t\t\tapp: opts.name,\n\t\t\t\t\tnodes: joinDeployment(graph, input.entries)\n\t\t\t\t});\n\t\t\t}))({\n\t\t\t\tnonce: Date.now(),\n\t\t\t\tentries\n\t\t\t});\n\t\t}\n\t});\n}\n/**\n* The whole-stack wrapper: Load → route each node through the config's\n* extension registries → an Alchemy Stack (the default export the alchemy\n* CLI consumes).\n*/\nfunction lower(root, config, opts) {\n\tconst stackEffect = Effect.orDie(lowering(root, config, opts));\n\tconst containers = deserializeContainers(config.extensions, process.env);\n\tconst providers = opts.providers ?? mergedProviders(config);\n\treturn Alchemy.Stack(opts.name, {\n\t\tproviders,\n\t\tstate: resolveStateLayer(opts, config, containers)\n\t}, stackEffect);\n}\n//#endregion\nexport { LowerError, buildConfig, connectionInputs, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };\n\n//# sourceMappingURL=deploy.mjs.map"],"mappings":";;;;;;AAMA,IAAI,aAAa,cAAc,MAAM;CACpC,YAAY,SAAS;EACpB,MAAM,OAAO;EACb,KAAK,OAAO;CACb;AACD;AACA,SAAS,wBAAwB,OAAO,cAAc;CACrD,MAAM,YAAY,MAAM,QAAQ,YAAY,CAAC,aAAa,SAAS,OAAO,CAAC;CAC3E,MAAM,YAAY,aAAa,QAAQ,YAAY,CAAC,MAAM,SAAS,OAAO,CAAC;CAC3E,IAAI,UAAU,WAAW,KAAK,UAAU,WAAW,GAAG;CACtD,MAAM,QAAQ,cAAc,UAAU,WAAW,IAAI,SAAS,UAAU,KAAK,YAAY,IAAI,QAAQ,EAAE,CAAC,CAAC,KAAK,IAAI;CAClH,MAAM,IAAI,WAAW,uIAAuI,KAAK,SAAS,EAAE,+BAA+B,KAAK,SAAS,EAAE,6IAA6I;AACzW;;;;;;;;;;;;;;;;;;AAkBA,SAAS,aAAa,MAAM,WAAW,MAAM,OAAO,OAAO;CAC1D,IAAI,UAAU,KAAK,GAAG;EACrB,IAAI,MAAM,cAAc,KAAK,GAAG,MAAM,IAAI,WAAW,UAAU,KAAK,QAAQ,UAAU,cAAc,KAAK,KAAK,mEAAmE,cAAc,KAAK,IAAI,mBAAmB,kBAAkB,qCAAqC,OAAO,MAAM,UAAU,KAAK,EAAE,4EAA4E;EAC5X,IAAI,cAAc,KAAK,GAAG,OAAO;EACjC,MAAM,SAAS,MAAM,OAAO,YAAY,CAAC,SAAS,KAAK;EACvD,IAAI,kBAAkB,SAAS,MAAM,IAAI,WAAW,UAAU,KAAK,QAAQ,UAAU,cAAc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,SAAS,KAAK,QAAQ;GAC5B,IAAI,WAAW,KAAK,GAAG,OAAO,OAAO,OAAO,KAAK,mBAAmB,EAAE,CAAC;GACvE,MAAM,WAAW,OAAO,WAAW,QAAQ,KAAK;IAC/C,WAAW;KACV,KAAK,OAAO;KACZ,OAAO,OAAO;IACf;IACA,SAAS;GACV,CAAC;GACD,MAAM,SAAS,OAAO,WAAW,OAAO,KAAK,iBAAiB,UAAU,UAAU;GAClF,QAAQ,IAAI,IAAI,OAAO,OAAO;GAC9B,QAAQ,KAAK;IACZ,SAAS;IACT,UAAU,OAAO;GAClB,CAAC;EACF;EACA,IAAI,KAAK,WAAW,KAAK,GAAG;GAC3B,MAAM,SAAS,KAAK;GACpB,OAAO,QAAQ,OAAO,+BAA+B,UAAU,OAAO,WAAW;IAChF,OAAO;KACN,KAAK,KAAK;KACV,OAAO,eAAe,OAAO,MAAM,OAAO;IAC3C,CAAC;GACF,CAAC,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,IAAI;IAChB;GACD,CAAC;EACF;CACD,CAAC;AACF;;;;;;AAMA,SAAS,MAAM,MAAM,QAAQ,MAAM;CAClC,MAAM,cAAc,OAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,CAAC;CAC7D,MAAM,aAAa,sBAAsB,OAAO,YAAY,QAAQ,GAAG;CACvE,MAAM,YAAY,KAAK,aAAa,gBAAgB,MAAM;CAC1D,OAAO,QAAQ,MAAM,KAAK,MAAM;EAC/B;EACA,OAAO,kBAAkB,MAAM,QAAQ,UAAU;CAClD,GAAG,WAAW;AACf"}
|
package/dist/deploy.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
|
|
1
|
+
import { i as secretsKeys, r as nodeAddresses } from "./graph-DI1v3WKX-3g1lTRbh.mjs";
|
|
2
|
+
import { B as PackageInput, F as LoweredResult, G as ProvisionerDescriptor, I as Lowering, M as LowerContext, N as LowerError, P as LowerOptions, Q as ServiceLowering, W as ProvisionEdge, Z as ServeInput, _ as DeployedNode, a as Artifact, dt as lowering, ft as mergedProviders, g as DeployedEntity, gt as resolveStateLayer, i as ApplicationDescriptor, lt as joinDeployment, nt as connectionInputs, o as AssembleInput, s as Bundle, t as AlchemyStateLayer, tt as buildConfig, ut as lower, v as DeploymentResult, y as DevServer, z as Outputs } from "./app-config-Bf_y5R7o-BEZAnKqM.mjs";
|
|
3
|
+
import "./deploy-DQyaIoNe.mjs";
|
|
4
|
+
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServeInput, ServiceLowering, buildConfig, connectionInputs, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };
|
package/dist/deploy.mjs
CHANGED
|
@@ -1,365 +1,3 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
import { r as
|
|
3
|
-
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import * as Layer from "effect/Layer";
|
|
6
|
-
//#region ../../0-framework/1-core/core/dist/deploy.mjs
|
|
7
|
-
var LowerError = class extends Error {
|
|
8
|
-
constructor(message) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = "LowerError";
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Resolves one SERVICE-OWN param to its config value. The full resolution
|
|
15
|
-
* order across both value channels:
|
|
16
|
-
*
|
|
17
|
-
* 1. A param claiming BOTH a provision-time binding and a `provision` need
|
|
18
|
-
* (ADR-0031) is a loud error — two sources for one value.
|
|
19
|
-
* 2. A provision-time binding (a schema-validated literal, or an opaque
|
|
20
|
-
* `ParamSource` the target resolves at boot per ADR-0019) beats the
|
|
21
|
-
* declared `default`.
|
|
22
|
-
* 3. A framework-minted `provision` need is resolved per dependency EDGE
|
|
23
|
-
* against the consumer extension's registry — that path fills CONNECTION
|
|
24
|
-
* params in `buildConfig`'s inputs loop, never this function. A
|
|
25
|
-
* service-own param has no edge to mint against, so an unbound need here
|
|
26
|
-
* falls through like any unbound param.
|
|
27
|
-
* 4. The `default`, else absent (only legal when `optional`), else a loud
|
|
28
|
-
* error naming the param, the service, and the fix.
|
|
29
|
-
*/
|
|
30
|
-
function resolveParam(node, serviceId, name, param, bound) {
|
|
31
|
-
if (bound !== void 0) {
|
|
32
|
-
if (param.provision !== void 0) throw new LowerError(`Param "${name}" of "${serviceId}" (service "${node.name}") has two sources claiming one value: a provision-time binding (${isParamSource(bound) ? "a param source" : "a literal value"}) AND a framework provision need ("${String(param.provision.brand)}") on its declaration — remove the binding or drop the \`provision\` facet.`);
|
|
33
|
-
if (isParamSource(bound)) return bound;
|
|
34
|
-
const result = param.schema["~standard"].validate(bound);
|
|
35
|
-
if (result instanceof Promise) throw new LowerError(`Param "${name}" of "${serviceId}" (service "${node.name}") uses an async Standard Schema — a provision-time literal value requires a synchronous validator.`);
|
|
36
|
-
if (result.issues !== void 0) {
|
|
37
|
-
const messages = result.issues.map((issue) => issue.message).join("; ");
|
|
38
|
-
throw new LowerError(`Param "${name}" of "${serviceId}" (service "${node.name}") received an invalid provision-time value: ${messages}`);
|
|
39
|
-
}
|
|
40
|
-
return result.value;
|
|
41
|
-
}
|
|
42
|
-
if (param.default !== void 0) return param.default;
|
|
43
|
-
if (param.optional === true) return void 0;
|
|
44
|
-
throw new LowerError(`Param "${name}" of "${serviceId}" (service "${node.name}") has no default, is not optional, and was not bound at provision — bind it with a literal value or a param source (e.g. envParam('NAME')) on its provision() call, or give it a default.`);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Assembles a service's typed Config. Connection params come from the
|
|
48
|
-
* dependency edge's lowered outputs — or, for a param carrying a `provision`
|
|
49
|
-
* need (ADR-0031), from `provisioned` (keyed by edge id): the framework mints
|
|
50
|
-
* it, the producer hands nothing over. The service's own params resolve via
|
|
51
|
-
* `resolveParam` (provision-time binding, then default, then loud
|
|
52
|
-
* unbound-required failure).
|
|
53
|
-
*
|
|
54
|
-
* This is also where the connection contract is enforced: a producer that fails to
|
|
55
|
-
* supply a required param its consumer's connection declares fails the deploy
|
|
56
|
-
* here, naming the edge, rather than reaching the consumer as `undefined`.
|
|
57
|
-
*/
|
|
58
|
-
function buildConfig(node, id, graph, lowered, provisioned) {
|
|
59
|
-
const inputs = slotConnectionParams(node, id, graph, lowered, provisioned);
|
|
60
|
-
const boundParams = new Map(graph.params.filter((binding) => binding.serviceAddress === id).map((b) => [b.slot, b.binding]));
|
|
61
|
-
const service = {};
|
|
62
|
-
for (const [name, param] of Object.entries(node.params)) {
|
|
63
|
-
const value = resolveParam(node, id, name, param, boundParams.get(name));
|
|
64
|
-
if (value !== void 0) service[name] = value;
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
service,
|
|
68
|
-
inputs
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* The connection params of each of a service's or resource's dependency
|
|
73
|
-
* slots, resolved against the producer's lowered outputs or the minted
|
|
74
|
-
* `provisioned` value, with the connection contract enforced (see `buildConfig`).
|
|
75
|
-
*/
|
|
76
|
-
function connectionInputs(ctx) {
|
|
77
|
-
return slotConnectionParams(ctx.node, ctx.id, ctx.graph, ctx.lowered, ctx.provisioned);
|
|
78
|
-
}
|
|
79
|
-
function slotConnectionParams(node, id, graph, lowered, provisioned) {
|
|
80
|
-
const inputs = {};
|
|
81
|
-
for (const [inputName, inputNode] of Object.entries(node.inputs)) {
|
|
82
|
-
const edge = graph.edges.find((e) => e.to === id && e.input === inputName && e.kind === "dependency");
|
|
83
|
-
const producedOutputs = edge !== void 0 ? lowered.get(edge.from) ?? {} : {};
|
|
84
|
-
const values = {};
|
|
85
|
-
for (const [name, param] of Object.entries(inputNode.connection.params)) {
|
|
86
|
-
if (param.provision !== void 0) {
|
|
87
|
-
values[name] = provisioned.get(`${id}.${inputName}`);
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
const value = producedOutputs[name];
|
|
91
|
-
if (value === void 0 && param.optional !== true && edge !== void 0) throw new LowerError(`Connection input "${id}.${inputName}" declares param "${name}", but its producer "${edge.from}" did not supply it — the producer's outputs carry [${Object.keys(producedOutputs).join(", ") || "nothing"}]. Add "${name}" to the outputs the producer returns from its lowering, or declare the param optional on the connection.`);
|
|
92
|
-
values[name] = value;
|
|
93
|
-
}
|
|
94
|
-
inputs[inputName] = values;
|
|
95
|
-
}
|
|
96
|
-
return inputs;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Joins resolved report entries back to their graph nodes — the last step of a
|
|
100
|
-
* deploy report, run inside the Action with apply's resolved values.
|
|
101
|
-
*
|
|
102
|
-
* The entries cross Alchemy's action-input boundary, so they carry addresses
|
|
103
|
-
* and plain entities only; the graph is held by closure on this side. That
|
|
104
|
-
* split is why this join exists at all, and it is what keeps functions and
|
|
105
|
-
* Standard Schemas (which a node carries, and which the plan's input hash
|
|
106
|
-
* would have to serialize) out of the input.
|
|
107
|
-
*
|
|
108
|
-
* Skips an address the graph no longer holds: entries are data, the graph is
|
|
109
|
-
* truth.
|
|
110
|
-
*/
|
|
111
|
-
function joinDeployment(graph, entries) {
|
|
112
|
-
const nodes = [];
|
|
113
|
-
for (const entry of entries) {
|
|
114
|
-
const node = graph.nodes.find((n) => n.id === entry.address)?.node;
|
|
115
|
-
if (node === void 0 || node.kind !== "service" && node.kind !== "resource") continue;
|
|
116
|
-
nodes.push({
|
|
117
|
-
address: entry.address,
|
|
118
|
-
node,
|
|
119
|
-
entities: entry.entities
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
return nodes;
|
|
123
|
-
}
|
|
124
|
-
function missingBundleError(id) {
|
|
125
|
-
return new LowerError(`No bundle provided for service "${id}" (opts.bundles["${id}"] is required).`);
|
|
126
|
-
}
|
|
127
|
-
/** The message `prisma dev` structures as `DEV.DEV_SERVER_UNSUPPORTED` (ADR-0056). */
|
|
128
|
-
function noReserveError(id, extension, type) {
|
|
129
|
-
return new LowerError(`service "${id}" runs a dev server but its descriptor (${extension}/${type}) has no \`reserve\` step`);
|
|
130
|
-
}
|
|
131
|
-
function unassembledWithBundleError(address) {
|
|
132
|
-
return new LowerError(`"${address}" is listed in opts.unassembled and also has a bundle in opts.bundles — a service is either assembled or not.`);
|
|
133
|
-
}
|
|
134
|
-
function unassembledNotServiceError(address) {
|
|
135
|
-
return new LowerError(`"${address}" is listed in opts.unassembled but is not a service in the graph.`);
|
|
136
|
-
}
|
|
137
|
-
function duplicateExtensionError(id) {
|
|
138
|
-
return new LowerError(`Extension "${id}" is listed more than once in \`extensions\` — each extension id must be unique.`);
|
|
139
|
-
}
|
|
140
|
-
/** Registries as extension id → descriptor. Fails on a duplicate id — the CLI validates config, but lowering() is the programmatic escape hatch that doesn't. */
|
|
141
|
-
function extensionsById(config) {
|
|
142
|
-
const map = /* @__PURE__ */ new Map();
|
|
143
|
-
for (const extension of config.extensions) {
|
|
144
|
-
if (map.has(extension.id)) return Effect.fail(duplicateExtensionError(extension.id));
|
|
145
|
-
map.set(extension.id, extension);
|
|
146
|
-
}
|
|
147
|
-
return Effect.succeed(map);
|
|
148
|
-
}
|
|
149
|
-
function unknownExtensionError(extension, id) {
|
|
150
|
-
return new LowerError(`No extension "${extension}" is configured (needed by node "${id}") — add it to \`extensions\` in the \`composer\` section of prisma.config.ts (import its /control entry and list its descriptor).`);
|
|
151
|
-
}
|
|
152
|
-
function unknownNodeTypeError(extension, type) {
|
|
153
|
-
return new LowerError(`Extension "${extension.id}" has no descriptor for node type "${type}" (known: ${Object.keys(extension.nodes).join(", ")}).`);
|
|
154
|
-
}
|
|
155
|
-
/** A provisioned param's need brand isn't registered by the consumer's extension (ADR-0031). */
|
|
156
|
-
function unknownProvisionerError(extension, brand, edgeId) {
|
|
157
|
-
const known = extension.provisions !== void 0 && extension.provisions.size > 0 ? Array.from(extension.provisions.keys(), String).join(", ") : "(none registered)";
|
|
158
|
-
return new LowerError(`Extension "${extension.id}" has no provisioner for need "${String(brand)}" (needed by edge "${edgeId}") (known: ${known}).`);
|
|
159
|
-
}
|
|
160
|
-
/** A provisioned edge whose consumer and provider nodes belong to different extensions (ADR-0031). */
|
|
161
|
-
function crossExtensionProvisionError(edgeId) {
|
|
162
|
-
return new LowerError(`Provisioned edge "${edgeId}" spans two extensions — cross-extension provisioned edges aren't supported yet.`);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* More than one provisioned param on one connection (ADR-0031). One edge mints
|
|
166
|
-
* ONE value, keyed by edge id, so a second need on the same connection would
|
|
167
|
-
* silently receive the first's value under the first's brand.
|
|
168
|
-
*/
|
|
169
|
-
function multipleProvisionedParamsError(edgeId, names) {
|
|
170
|
-
return new LowerError(`Connection input "${edgeId}" declares more than one provisioned param (${names.join(", ")}) — only one provisioned param per connection is supported.`);
|
|
171
|
-
}
|
|
172
|
-
function wrongKindError(extension, type, expected, got) {
|
|
173
|
-
return new LowerError(`Extension "${extension}"'s descriptor for node type "${type}" is a "${got}" descriptor — this node needs a "${expected}" descriptor.`);
|
|
174
|
-
}
|
|
175
|
-
/** Looks up one node's descriptor: extension by `node.extension`, then descriptor by `node.type`, then the kind check. */
|
|
176
|
-
function descriptorFor(extensions, node, id) {
|
|
177
|
-
const extension = extensions.get(node.extension);
|
|
178
|
-
if (extension === void 0) return Effect.fail(unknownExtensionError(node.extension, id));
|
|
179
|
-
const descriptor = extension.nodes[node.type];
|
|
180
|
-
if (descriptor === void 0) return Effect.fail(unknownNodeTypeError(extension, node.type));
|
|
181
|
-
if (descriptor.kind !== node.kind) return Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));
|
|
182
|
-
return Effect.succeed(descriptor);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* The state-layer precedence a deploy resolves to: an explicit opts.state
|
|
186
|
-
* always wins; failing that, the config's own (required) state descriptor,
|
|
187
|
-
* created with its owning extension's resolved container (`undefined` when
|
|
188
|
-
* that extension declared none). A pure function so the precedence is
|
|
189
|
-
* testable without booting Alchemy.
|
|
190
|
-
*/
|
|
191
|
-
function resolveStateLayer(opts, config, containers) {
|
|
192
|
-
return opts.state ?? config.state.create(containers.get(config.state.extension));
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* All configured extensions' providers merged, config array order — an
|
|
196
|
-
* extension without `providers` is skipped; no used-extensions-only
|
|
197
|
-
* filtering (ADR-0017's pinned providers rule).
|
|
198
|
-
*/
|
|
199
|
-
function mergedProviders(config) {
|
|
200
|
-
const [first, ...rest] = config.extensions.flatMap((extension) => extension.providers !== void 0 ? [extension.providers()] : []);
|
|
201
|
-
return first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Composable form for mixed stacks: hand-wired Alchemy resources alongside Prisma App nodes in one stack effect.
|
|
205
|
-
* Fails with LowerError or whatever an extension's lowering raises — the error type is open.
|
|
206
|
-
*/
|
|
207
|
-
function lowering(root, config, opts) {
|
|
208
|
-
return Effect.gen(function* () {
|
|
209
|
-
const graph = Load(root, {
|
|
210
|
-
id: opts.name,
|
|
211
|
-
...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {},
|
|
212
|
-
...opts.configPool !== void 0 ? { configPool: opts.configPool } : {}
|
|
213
|
-
});
|
|
214
|
-
const extensions = yield* extensionsById(config);
|
|
215
|
-
const containers = deserializeContainers(config.extensions, process.env);
|
|
216
|
-
const lowered = /* @__PURE__ */ new Map();
|
|
217
|
-
const entries = [];
|
|
218
|
-
const provisioned = /* @__PURE__ */ new Map();
|
|
219
|
-
const applications = /* @__PURE__ */ new Map();
|
|
220
|
-
for (const descriptor of config.extensions) {
|
|
221
|
-
if (descriptor.application === void 0) continue;
|
|
222
|
-
const appCtx = {
|
|
223
|
-
id: graph.root.id,
|
|
224
|
-
address: "",
|
|
225
|
-
node: graph.root.node,
|
|
226
|
-
graph,
|
|
227
|
-
opts,
|
|
228
|
-
application: void 0,
|
|
229
|
-
container: containers.get(descriptor.id),
|
|
230
|
-
lowered,
|
|
231
|
-
provisioned
|
|
232
|
-
};
|
|
233
|
-
applications.set(descriptor.id, yield* descriptor.application.provision(appCtx));
|
|
234
|
-
}
|
|
235
|
-
for (const edge of graph.edges) {
|
|
236
|
-
if (edge.kind !== "dependency") continue;
|
|
237
|
-
const consumer = graph.nodes.find((n) => n.id === edge.to)?.node;
|
|
238
|
-
if (consumer === void 0 || consumer.kind !== "service" && consumer.kind !== "resource") continue;
|
|
239
|
-
const slot = slotsOf(consumer)[edge.input];
|
|
240
|
-
if (slot === void 0) continue;
|
|
241
|
-
const provisionedParams = Object.entries(slot.connection.params).filter(([, param]) => param.provision !== void 0);
|
|
242
|
-
if (provisionedParams.length === 0) continue;
|
|
243
|
-
const edgeId = `${edge.to}.${edge.input}`;
|
|
244
|
-
if (provisionedParams.length > 1) return yield* Effect.fail(multipleProvisionedParamsError(edgeId, provisionedParams.map(([name]) => name)));
|
|
245
|
-
const need = provisionedParams[0]?.[1].provision;
|
|
246
|
-
if (need === void 0) continue;
|
|
247
|
-
const provider = graph.nodes.find((n) => n.id === edge.from)?.node;
|
|
248
|
-
if (provider === void 0 || provider.kind !== "service" && provider.kind !== "resource") continue;
|
|
249
|
-
if (consumer.extension !== provider.extension) return yield* Effect.fail(crossExtensionProvisionError(edgeId));
|
|
250
|
-
const extension = extensions.get(consumer.extension);
|
|
251
|
-
if (extension === void 0) return yield* Effect.fail(unknownExtensionError(consumer.extension, edge.to));
|
|
252
|
-
const provisioner = extension.provisions?.get(need.brand);
|
|
253
|
-
if (provisioner === void 0) return yield* Effect.fail(unknownProvisionerError(extension, need.brand, edgeId));
|
|
254
|
-
const ref = yield* provisioner.provision({
|
|
255
|
-
app: graph.root.id,
|
|
256
|
-
edgeId,
|
|
257
|
-
consumerAddress: edge.to,
|
|
258
|
-
providerAddress: edge.from,
|
|
259
|
-
input: edge.input,
|
|
260
|
-
need
|
|
261
|
-
});
|
|
262
|
-
provisioned.set(edgeId, ref);
|
|
263
|
-
}
|
|
264
|
-
const unassembled = new Set(opts.unassembled ?? []);
|
|
265
|
-
for (const address of unassembled) {
|
|
266
|
-
if (address in opts.bundles) return yield* Effect.fail(unassembledWithBundleError(address));
|
|
267
|
-
const found = graph.nodes.find((n) => n.id === address);
|
|
268
|
-
if (found === void 0 || found.node.kind !== "service") return yield* Effect.fail(unassembledNotServiceError(address));
|
|
269
|
-
}
|
|
270
|
-
const services = /* @__PURE__ */ new Map();
|
|
271
|
-
const ctxFor = (id, node) => ({
|
|
272
|
-
id,
|
|
273
|
-
address: id,
|
|
274
|
-
node,
|
|
275
|
-
graph,
|
|
276
|
-
opts,
|
|
277
|
-
application: applications.get(node.extension),
|
|
278
|
-
container: containers.get(node.extension),
|
|
279
|
-
lowered,
|
|
280
|
-
provisioned,
|
|
281
|
-
services
|
|
282
|
-
});
|
|
283
|
-
for (const { id, node } of graph.nodes) {
|
|
284
|
-
if (node.kind !== "service") continue;
|
|
285
|
-
const descriptor = yield* descriptorFor(extensions, node, id);
|
|
286
|
-
if (descriptor.kind !== "service") continue;
|
|
287
|
-
services.set(id, yield* descriptor.provision(ctxFor(id, node)));
|
|
288
|
-
}
|
|
289
|
-
for (const { id, node } of graph.nodes) {
|
|
290
|
-
if (node.kind === "module") continue;
|
|
291
|
-
if (node.kind === "dependency") continue;
|
|
292
|
-
const ctx = ctxFor(id, node);
|
|
293
|
-
const descriptor = yield* descriptorFor(extensions, node, id);
|
|
294
|
-
if (descriptor.kind === "resource") {
|
|
295
|
-
const result = yield* descriptor(ctx);
|
|
296
|
-
lowered.set(id, result.outputs);
|
|
297
|
-
entries.push({
|
|
298
|
-
address: id,
|
|
299
|
-
entities: result.entities
|
|
300
|
-
});
|
|
301
|
-
continue;
|
|
302
|
-
}
|
|
303
|
-
if (descriptor.kind !== "service") return yield* Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));
|
|
304
|
-
const service = node;
|
|
305
|
-
const provisionedNode = services.get(id);
|
|
306
|
-
const typedConfig = buildConfig(service, id, graph, lowered, provisioned);
|
|
307
|
-
const serialized = yield* descriptor.serialize(ctx, provisionedNode, typedConfig);
|
|
308
|
-
if (unassembled.has(id)) {
|
|
309
|
-
if (descriptor.reserve === void 0) return yield* Effect.fail(noReserveError(id, node.extension, node.type));
|
|
310
|
-
const result = yield* descriptor.reserve(ctx, provisionedNode, serialized);
|
|
311
|
-
lowered.set(id, result.outputs);
|
|
312
|
-
entries.push({
|
|
313
|
-
address: id,
|
|
314
|
-
entities: result.entities
|
|
315
|
-
});
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
const bundle = opts.bundles[id];
|
|
319
|
-
if (bundle === void 0) return yield* Effect.fail(missingBundleError(id));
|
|
320
|
-
const artifact = yield* descriptor.package(ctx, {
|
|
321
|
-
assembled: {
|
|
322
|
-
dir: bundle.dir,
|
|
323
|
-
entry: bundle.entry
|
|
324
|
-
},
|
|
325
|
-
address: id
|
|
326
|
-
});
|
|
327
|
-
const result = yield* descriptor.deploy(ctx, provisionedNode, artifact, serialized);
|
|
328
|
-
lowered.set(id, result.outputs);
|
|
329
|
-
entries.push({
|
|
330
|
-
address: id,
|
|
331
|
-
entities: result.entities
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
if (opts.report !== void 0) {
|
|
335
|
-
const report = opts.report;
|
|
336
|
-
yield* Alchemy.Action("composer-deployment-report", (input) => Effect.sync(() => {
|
|
337
|
-
report({
|
|
338
|
-
app: opts.name,
|
|
339
|
-
nodes: joinDeployment(graph, input.entries)
|
|
340
|
-
});
|
|
341
|
-
}))({
|
|
342
|
-
nonce: Date.now(),
|
|
343
|
-
entries
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* The whole-stack wrapper: Load → route each node through the config's
|
|
350
|
-
* extension registries → an Alchemy Stack (the default export the alchemy
|
|
351
|
-
* CLI consumes).
|
|
352
|
-
*/
|
|
353
|
-
function lower(root, config, opts) {
|
|
354
|
-
const stackEffect = Effect.orDie(lowering(root, config, opts));
|
|
355
|
-
const containers = deserializeContainers(config.extensions, process.env);
|
|
356
|
-
const providers = opts.providers ?? mergedProviders(config);
|
|
357
|
-
return Alchemy.Stack(opts.name, {
|
|
358
|
-
providers,
|
|
359
|
-
state: resolveStateLayer(opts, config, containers)
|
|
360
|
-
}, stackEffect);
|
|
361
|
-
}
|
|
362
|
-
//#endregion
|
|
363
|
-
export { LowerError, buildConfig, connectionInputs, joinDeployment, lower, lowering, mergedProviders, resolveStateLayer };
|
|
364
|
-
|
|
365
|
-
//# sourceMappingURL=deploy.mjs.map
|
|
1
|
+
import { b as secretsKeys, m as nodeAddresses } from "./graph-Bqr7PSGl-BM-M-TlO.mjs";
|
|
2
|
+
import { a as lower, c as resolveStateLayer, i as joinDeployment, n as buildConfig, o as lowering, r as connectionInputs, s as mergedProviders, t as LowerError } from "./deploy-CmiYExQA.mjs";
|
|
3
|
+
export { LowerError, buildConfig, connectionInputs, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };
|
package/dist/{deployment-summary-QkZexVIS-DqL4znd4.mjs → deployment-summary-BiBkPWlB-CyC2pudN.mjs}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
+
import { i as redactCredentialLooking } from "./redaction-HnbkSFrK-BXRZ3B33.mjs";
|
|
2
3
|
import * as fs$1 from "node:fs";
|
|
3
4
|
import { format, stripVTControlCharacters } from "node:util";
|
|
4
|
-
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-
|
|
5
|
+
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-BiBkPWlB.mjs
|
|
5
6
|
/**
|
|
6
7
|
* The deploy result's cross-process protocol, whole in one place: the
|
|
7
8
|
* serializable shape, the env var that names the carrier file, the writer the
|
|
@@ -112,7 +113,7 @@ function captureEngineFailure() {
|
|
|
112
113
|
console[method] = (...args) => {
|
|
113
114
|
const text = format(...args);
|
|
114
115
|
const shown = withComposerAdvice(text);
|
|
115
|
-
tail = `${tail}${
|
|
116
|
+
tail = `${tail}${redactCredentialLooking(shown, process.env)}\n`.slice(-65536);
|
|
116
117
|
if (shown === text) original.apply(console, args);
|
|
117
118
|
else original.call(console, shown);
|
|
118
119
|
};
|
|
@@ -126,35 +127,15 @@ function captureEngineFailure() {
|
|
|
126
127
|
} catch {}
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
|
-
/**
|
|
130
|
-
|
|
131
|
-
* removed, or undefined when it recorded none. The child redacts only what its
|
|
132
|
-
* own environment names as a secret; the parent knows the pools.
|
|
133
|
-
*/
|
|
134
|
-
function readEngineFailureCause(resultFilePath, secrets = []) {
|
|
130
|
+
/** Parent half: the cause the child recorded, passed through `redact`, or undefined when it recorded none. The child redacts only what its own environment names as a credential; the parent also knows the known secrets. */
|
|
131
|
+
function readEngineFailureCause(resultFilePath, redact) {
|
|
135
132
|
let cause;
|
|
136
133
|
try {
|
|
137
134
|
cause = fs$1.readFileSync(engineFailureFilePath(resultFilePath), "utf8");
|
|
138
135
|
} catch {
|
|
139
136
|
return;
|
|
140
137
|
}
|
|
141
|
-
return cause.length > 0 ?
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* The pool values a failure cause must not carry: every config pool value
|
|
145
|
-
* under a secret-named key, and, when the author lists the `secrets` adapters,
|
|
146
|
-
* every secrets pool value and every config pool value under a key the secrets
|
|
147
|
-
* pool also holds. The default `secrets` list is the whole process
|
|
148
|
-
* environment, which the secret-name rule already covers.
|
|
149
|
-
*/
|
|
150
|
-
function poolSecrets(pools, secretsListed) {
|
|
151
|
-
const values = [];
|
|
152
|
-
for (const [name, value] of Object.entries(pools.config)) {
|
|
153
|
-
if (typeof value !== "string") continue;
|
|
154
|
-
if (SECRET_ENV_NAME.test(name) || secretsListed && Object.hasOwn(pools.secrets, name)) values.push(value);
|
|
155
|
-
}
|
|
156
|
-
if (secretsListed) values.push(...Object.values(pools.secrets));
|
|
157
|
-
return values;
|
|
138
|
+
return cause.length > 0 ? redact(cause) : void 0;
|
|
158
139
|
}
|
|
159
140
|
/** Effect's pretty log prefix, e.g. `[10:29:16.556] INFO (#53): `. */
|
|
160
141
|
const LOG_PREFIX = /^\[[\d:.]+\] ([A-Z]+) \(#\d+\): ?/;
|
|
@@ -185,28 +166,10 @@ function engineFailureCause(output, env) {
|
|
|
185
166
|
const start = lines.findIndex((line) => line.failure);
|
|
186
167
|
const kept = start === -1 ? lines.slice(-5) : lines.slice(start).filter((line) => !line.info);
|
|
187
168
|
if (kept.length === 0) return void 0;
|
|
188
|
-
const cause =
|
|
169
|
+
const cause = redactCredentialLooking(kept.map((line) => line.text).join("\n"), env);
|
|
189
170
|
return cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;
|
|
190
171
|
}
|
|
191
|
-
/** Replaces each value of 8 characters or more, longest first, so a one-letter placeholder does not blank every matching letter. */
|
|
192
|
-
function redactValues(text, values) {
|
|
193
|
-
let redacted = text;
|
|
194
|
-
for (const value of [...values].sort((a, b) => b.length - a.length)) if (value.length >= 8) redacted = redacted.replaceAll(value, REDACTED);
|
|
195
|
-
return redacted;
|
|
196
|
-
}
|
|
197
|
-
/** Env var names whose values are credentials: the service token, preflight payloads, and the usual secret spellings. */
|
|
198
|
-
const SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$|^PRISMA_COMPOSER_PREFLIGHT_/i;
|
|
199
|
-
const REDACTED = "[redacted]";
|
|
200
|
-
/**
|
|
201
|
-
* Removes credentials from text that is about to leave the machine: the value
|
|
202
|
-
* of every secret-named env var, bearer/basic tokens, JWTs, the password in a
|
|
203
|
-
* URL, and `token=…`-style pairs. Values shorter than 8 characters are left,
|
|
204
|
-
* so a one-letter placeholder does not blank every matching letter.
|
|
205
|
-
*/
|
|
206
|
-
function redactSecrets(text, env) {
|
|
207
|
-
return redactValues(text, Object.entries(env).filter(([name]) => SECRET_ENV_NAME.test(name)).map(([, value]) => value ?? "")).replace(/\b(Bearer|Basic)\s+[\w.~+/=-]+/gi, `$1 ${REDACTED}`).replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]*/g, REDACTED).replace(/(\b[a-z][\w+.-]*:\/\/[^\s:/@]*:)[^\s/@]+@/gi, `$1${REDACTED}@`).replace(/\b((?:[\w-]*[_-])?(?:token|secret|password|passwd|api[_-]?key|access[_-]?key|private[_-]?key)["']?\s*[:=]\s*["']?)[^\s"',;&]+/gi, `$1${REDACTED}`);
|
|
208
|
-
}
|
|
209
172
|
//#endregion
|
|
210
|
-
export {
|
|
173
|
+
export { readEngineFailureCause as a, readDeploymentSummary as i, captureEngineFailure as n, writeDeploymentSummaryFile as o, engineFailureFilePath as r, DEPLOYMENT_RESULT_FILE_ENV as t };
|
|
211
174
|
|
|
212
|
-
//# sourceMappingURL=deployment-summary-
|
|
175
|
+
//# sourceMappingURL=deployment-summary-BiBkPWlB-CyC2pudN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-summary-BiBkPWlB-CyC2pudN.mjs","names":["fs"],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-BiBkPWlB.mjs"],"sourcesContent":["import { a as redactCredentialLooking } from \"./redaction-HnbkSFrK.mjs\";\nimport * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { format, stripVTControlCharacters } from \"node:util\";\n//#region src/deployment-summary.ts\n/**\n* The deploy result's cross-process protocol, whole in one place: the\n* serializable shape, the env var that names the carrier file, the writer the\n* report hook calls from inside the alchemy child, and the reader the deploy\n* operation runs after the child exits. `DeploymentResult` itself cannot\n* cross the boundary — its `DeployedNode` entries hold live graph-node\n* references (ADR-0033) — so the writer projects it down to what CAN.\n*\n* The summary is best-effort by contract: the writer never fails the child\n* over it, and the reader maps absent or malformed to `undefined`. So is the\n* failure cause the child leaves beside it when it exits non-zero.\n*/\n/** Env var the deploy operation sets on the alchemy child: when present,\n* the report hook also writes the JSON DeploymentSummary there. */\nconst DEPLOYMENT_RESULT_FILE_ENV = \"PRISMA_COMPOSER_DEPLOYMENT_RESULT_FILE\";\n/** Pure projection: keeps app + each node's address/entities, drops the in-process `node`. */\nfunction toDeploymentSummary(result) {\n\treturn {\n\t\tapp: result.app,\n\t\tnodes: result.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities\n\t\t}))\n\t};\n}\n/**\n* Writer half, called by the report hook inside the alchemy child: when the\n* env var names a file, write the summary there. Best-effort — a write\n* failure must not fail a deploy that already converged, so it is swallowed.\n*/\nfunction writeDeploymentSummaryFile(result) {\n\tconst file = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (file === void 0 || file.length === 0) return;\n\ttry {\n\t\tfs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));\n\t} catch {}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Reader half, run by the deploy operation after the child exits. Absent or\n* malformed → undefined — the summary is best-effort, never a deploy failure.\n*/\nfunction readDeploymentSummary(resultFilePath) {\n\tlet raw;\n\ttry {\n\t\traw = fs.readFileSync(resultFilePath, \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isRecord(parsed) || typeof parsed[\"app\"] !== \"string\" || !Array.isArray(parsed[\"nodes\"])) return;\n\tfor (const node of parsed[\"nodes\"]) {\n\t\tif (!isRecord(node) || typeof node[\"address\"] !== \"string\" || !Array.isArray(node[\"entities\"])) return;\n\t\tfor (const entity of node[\"entities\"]) if (!isRecord(entity) || typeof entity[\"kind\"] !== \"string\" || typeof entity[\"id\"] !== \"string\") return;\n\t}\n\treturn blindCast(parsed);\n}\n/** The child's failure cause rides beside the result file, so the one env var names both and the parent's cleanup removes both. */\nfunction engineFailureFilePath(resultFilePath) {\n\treturn `${resultFilePath}.failure.txt`;\n}\n/** Fits the platform's 5000-character build `errorMessage` with room for the exit-status prefix. */\nconst ENGINE_FAILURE_CAUSE_LIMIT = 1e3;\n/** Alchemy's advice to rerun its own CLI with `--adopt`, which a Composer user has no way to do. */\nconst ALCHEMY_ADOPT_ADVICE = [[/Re-run with `--adopt` \\(or wrap the effect in `adopt\\(true\\)`\\) to take it over\\./g, \"Something other than this app holds it. Remove that resource, then deploy again.\"], [/\\(re-deploy with --adopt to take ownership, then destroy\\)/g, \"(remove it by hand)\"]];\n/** Replaces Alchemy CLI advice in engine output with steps that work from Composer. */\nfunction withComposerAdvice(text) {\n\treturn ALCHEMY_ADOPT_ADVICE.reduce((current, [advice, replacement]) => current.replace(advice, replacement), text);\n}\nconst STDOUT_CONSOLE_METHODS = /* @__PURE__ */ new Set([\n\t\"log\",\n\t\"info\",\n\t\"debug\"\n]);\n/**\n* Child half of the failure protocol, called by the generated stack file.\n* Keeps a bounded tail of everything this process logs through `console`,\n* passing every call through except Alchemy's CLI advice (see\n* {@link withComposerAdvice}), and on a non-zero exit writes the\n* redacted cause beside the result file. `console`, not the output streams:\n* alchemy's logger and its error reporting both go through it, and under Bun\n* `console` does not reach `process.stdout.write`.\n*\n* When stdout is not a terminal it carries the parent's data lines, so\n* everything this process prints goes to stderr instead.\n*/\nfunction captureEngineFailure() {\n\tconst resultFile = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (resultFile === void 0 || resultFile.length === 0) return;\n\tconst stdoutToStderr = process.stdout.isTTY !== true;\n\tif (stdoutToStderr) process.stdout.write = process.stderr.write.bind(process.stderr);\n\tlet tail = \"\";\n\tfor (const method of [\n\t\t\"log\",\n\t\t\"info\",\n\t\t\"warn\",\n\t\t\"error\",\n\t\t\"debug\"\n\t]) {\n\t\tconst original = stdoutToStderr && STDOUT_CONSOLE_METHODS.has(method) ? console.error : console[method];\n\t\tconsole[method] = (...args) => {\n\t\t\tconst text = format(...args);\n\t\t\tconst shown = withComposerAdvice(text);\n\t\t\ttail = `${tail}${redactCredentialLooking(shown, process.env)}\\n`.slice(-65536);\n\t\t\tif (shown === text) original.apply(console, args);\n\t\t\telse original.call(console, shown);\n\t\t};\n\t}\n\tprocess.once(\"exit\", (code) => {\n\t\tif (code === 0) return;\n\t\tconst cause = engineFailureCause(tail, process.env);\n\t\tif (cause === void 0) return;\n\t\ttry {\n\t\t\tfs.writeFileSync(engineFailureFilePath(resultFile), cause);\n\t\t} catch {}\n\t});\n}\n/** Parent half: the cause the child recorded, passed through `redact`, or undefined when it recorded none. The child redacts only what its own environment names as a credential; the parent also knows the known secrets. */\nfunction readEngineFailureCause(resultFilePath, redact) {\n\tlet cause;\n\ttry {\n\t\tcause = fs.readFileSync(engineFailureFilePath(resultFilePath), \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\treturn cause.length > 0 ? redact(cause) : void 0;\n}\n/** Effect's pretty log prefix, e.g. `[10:29:16.556] INFO (#53): `. */\nconst LOG_PREFIX = /^\\[[\\d:.]+\\] ([A-Z]+) \\(#\\d+\\): ?/;\n/** Alchemy's per-resource failure row, e.g. `[web] fail — UnknownError: …`. */\nconst RESOURCE_FAIL_ROW = /^\\[[^\\]]+\\] fail\\b/;\nconst STACK_FRAME = /^\\s*at /;\n/**\n* The failure the output describes: every line from the first failure line\n* (a failed resource row, an ERROR log, or an `error:` line) to the end, minus\n* blank lines, stack frames and info logs; the last five lines when there is no\n* failure line. Redacted, then capped.\n*/\nfunction engineFailureCause(output, env) {\n\tconst lines = [];\n\tfor (const raw of stripVTControlCharacters(output).split(/\\r\\n|\\r|\\n/)) {\n\t\tconst clean = raw.replace(/(?![\\t])\\p{Cc}/gu, \"\").trimEnd();\n\t\tconst prefix = LOG_PREFIX.exec(clean);\n\t\tconst text = (prefix === null ? clean : clean.slice(prefix[0].length)).trim();\n\t\tif (text.length === 0 || text === \"{\" || text === \"}\" || STACK_FRAME.test(text)) continue;\n\t\tconst level = prefix?.[1];\n\t\tconst failure = level === \"ERROR\" || level === \"FATAL\" || RESOURCE_FAIL_ROW.test(text) || /^\\W*error:/i.test(text);\n\t\tlines.push({\n\t\t\ttext,\n\t\t\tfailure,\n\t\t\tinfo: !failure && level !== void 0\n\t\t});\n\t}\n\tconst start = lines.findIndex((line) => line.failure);\n\tconst kept = start === -1 ? lines.slice(-5) : lines.slice(start).filter((line) => !line.info);\n\tif (kept.length === 0) return void 0;\n\tconst cause = redactCredentialLooking(kept.map((line) => line.text).join(\"\\n\"), env);\n\treturn cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;\n}\n//#endregion\nexport { readEngineFailureCause as a, readDeploymentSummary as i, captureEngineFailure as n, writeDeploymentSummaryFile as o, engineFailureFilePath as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-BiBkPWlB.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,6BAA6B;;AAEnC,SAAS,oBAAoB,QAAQ;CACpC,OAAO;EACN,KAAK,OAAO;EACZ,OAAO,OAAO,MAAM,KAAK,UAAU;GAClC,SAAS,KAAK;GACd,UAAU,KAAK;EAChB,EAAE;CACH;AACD;;;;;;AAMA,SAAS,2BAA2B,QAAQ;CAC3C,MAAM,OAAO,QAAQ,IAAI;CACzB,IAAI,SAAS,KAAK,KAAK,KAAK,WAAW,GAAG;CAC1C,IAAI;EACH,KAAG,cAAc,MAAM,KAAK,UAAU,oBAAoB,MAAM,CAAC,CAAC;CACnE,QAAQ,CAAC;AACV;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU;AAC/C;;;;;A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,IAAI,GAAG;EACjF,MAAM,QAAQ,SAAS;EACvB,MAAM,UAAU,UAAU,WAAW,UAAU,WAAW,kBAAkB,KAAK,IAAI,KAAK,cAAc,KAAK,IAAI;EACjH,MAAM,KAAK;GACV;GACA;GACA,MAAM,CAAC,WAAW,UAAU,KAAK;EAClC,CAAC;CACF;CACA,MAAM,QAAQ,MAAM,WAAW,SAAS,KAAK,OAAO;CACpD,MAAM,OAAO,UAAU,KAAK,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,KAAK,CAAC,CAAC,QAAQ,SAAS,CAAC,KAAK,IAAI;CAC5F,IAAI,KAAK,WAAW,GAAG,OAAO,KAAK;CACnC,MAAM,QAAQ,wBAAwB,KAAK,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG;CACnF,OAAO,MAAM,UAAU,6BAA6B,QAAQ,GAAG,MAAM,MAAM,GAAG,6BAA6B,CAAC,EAAE;AAC/G"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { g as DeployedEntity } from "./app-config-
|
|
2
|
-
import "./
|
|
3
|
-
|
|
4
|
-
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-Cm4lN6w9.d.mts
|
|
1
|
+
import { g as DeployedEntity } from "./app-config-Bf_y5R7o-BEZAnKqM.mjs";
|
|
2
|
+
import "./deploy-DQyaIoNe.mjs";
|
|
3
|
+
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts
|
|
5
4
|
//#region src/deployment-summary.d.ts
|
|
6
5
|
/** The serializable projection of DeploymentResult — what CAN cross the process
|
|
7
6
|
* boundary. Writer (report hook) and reader (deploy operation) share this shape. */
|
|
@@ -28,4 +27,4 @@ interface DeploymentSummary {
|
|
|
28
27
|
declare function captureEngineFailure(): void;
|
|
29
28
|
//#endregion
|
|
30
29
|
export { DeploymentSummary as n, captureEngineFailure as r, DeployedNodeSummary as t };
|
|
31
|
-
//# sourceMappingURL=deployment-summary-
|
|
30
|
+
//# sourceMappingURL=deployment-summary-p88NV5m5-BJOosgmI.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-summary-p88NV5m5-BJOosgmI.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-p88NV5m5.d.mts"],"mappings":";;;;;;UAIU;WACC;WACA,mBAAmB;;UAEpB;WACC;WACA,gBAAgB;;;;;;;;;;;;;;iBAcV"}
|
|
@@ -66,6 +66,17 @@ function isSecretString(value) {
|
|
|
66
66
|
return typeof value === "object" && value !== null && blindCast(value)[SECRET_BOX] === true;
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
|
-
|
|
69
|
+
//#region ../../0-framework/0-foundation/foundation/dist/describe-kind-Cpm_euxo.mjs
|
|
70
|
+
/** How an error names the kind of a value it did not expect, without printing the value. */
|
|
71
|
+
function describeKind(value) {
|
|
72
|
+
if (value === void 0) return "nothing";
|
|
73
|
+
if (value === null) return "null";
|
|
74
|
+
if (Array.isArray(value)) return "an array";
|
|
75
|
+
if (typeof value === "function") return "a function";
|
|
76
|
+
if (typeof value === "object") return "an object";
|
|
77
|
+
return `a ${typeof value}`;
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { isPlainPointer as a, POINTER as i, SecretBox as n, isSecretPointer as o, isSecretString as r, describeKind as t };
|
|
70
81
|
|
|
71
|
-
//# sourceMappingURL=
|
|
82
|
+
//# sourceMappingURL=describe-kind-Cpm_euxo-CkhlGJUL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-kind-Cpm_euxo-CkhlGJUL.mjs","names":["#value"],"sources":["../../../0-framework/0-foundation/foundation/dist/pointer-Cw3E-nrh.mjs","../../../0-framework/0-foundation/foundation/dist/secret-DoWGmN7m.mjs","../../../0-framework/0-foundation/foundation/dist/describe-kind-Cpm_euxo.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\n//#region src/pointer.ts\n/** A pointer: what a value known only at boot holds at deploy. It names the platform variable the service reads at boot, and records whether that variable holds a secret. */\nconst POINTER = blindCast(Symbol.for(\"prisma:pointer\"));\nfunction kindOf(value) {\n\tif (typeof value !== \"object\" || value === null) return void 0;\n\treturn Reflect.get(value, POINTER);\n}\n/** True for a plain pointer: a value known only at boot whose variable holds plain text. */\nfunction isPlainPointer(value) {\n\treturn kindOf(value) === \"plain\";\n}\n/** True for a secret pointer: a value known only at boot whose variable holds a secret. */\nfunction isSecretPointer(value) {\n\treturn kindOf(value) === \"secret\";\n}\n//#endregion\nexport { isPlainPointer as n, isSecretPointer as r, POINTER as t };\n\n//# sourceMappingURL=pointer-Cw3E-nrh.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\n//#region src/secret.ts\n/**\n* A value wrapper that redacts everywhere except the one explicit reader,\n* `expose()`. Sensitivity is carried by the TYPE (`SecretBox<T>`), not a flag a\n* sink must remember to check: `String(box)`, template interpolation,\n* `JSON.stringify`, and `console.log`/`util.inspect` all print `[REDACTED]`, so\n* a secret can't leak through an accidental log or serialization.\n*\n* Every box carries a brand property keyed by the registered symbol\n* `Symbol.for('prisma:secret-box')`, which is what `isSecretString` checks. A\n* symbol key is invisible to `JSON.stringify` and `Object.keys`, so the box's\n* public shape still matches the platform's own `secrecy` type\n* (pdp-control-plane).\n*/\nconst REDACTED = \"[REDACTED]\";\nconst SECRET_BOX = blindCast(Symbol.for(\"prisma:secret-box\"));\nvar SecretBox = class {\n\t[SECRET_BOX] = true;\n\t#value;\n\tconstructor(value) {\n\t\tthis.#value = value;\n\t}\n\t/** The sole explicit door to the wrapped value. */\n\texpose() {\n\t\treturn this.#value;\n\t}\n\ttoString() {\n\t\treturn REDACTED;\n\t}\n\ttoJSON() {\n\t\treturn REDACTED;\n\t}\n\tvalueOf() {\n\t\treturn REDACTED;\n\t}\n\t[Symbol.toPrimitive]() {\n\t\treturn REDACTED;\n\t}\n\t[Symbol.for(\"nodejs.util.inspect.custom\")]() {\n\t\treturn REDACTED;\n\t}\n};\n/**\n* True for a redacting secret box — what a schema's secret leaf checks\n* (ADR-0042). Reads the brand rather than `instanceof`, so a box from a\n* duplicated module copy in a bundle counts and a look-alike does not.\n*/\nfunction isSecretString(value) {\n\treturn typeof value === \"object\" && value !== null && blindCast(value)[SECRET_BOX] === true;\n}\n//#endregion\nexport { isSecretString as n, SecretBox as t };\n\n//# sourceMappingURL=secret-DoWGmN7m.mjs.map","//#region src/describe-kind.ts\n/** How an error names the kind of a value it did not expect, without printing the value. */\nfunction describeKind(value) {\n\tif (value === void 0) return \"nothing\";\n\tif (value === null) return \"null\";\n\tif (Array.isArray(value)) return \"an array\";\n\tif (typeof value === \"function\") return \"a function\";\n\tif (typeof value === \"object\") return \"an object\";\n\treturn `a ${typeof value}`;\n}\n//#endregion\nexport { describeKind as t };\n\n//# sourceMappingURL=describe-kind-Cpm_euxo.mjs.map"],"mappings":";;;AAGA,MAAM,UAAU,UAAU,OAAO,IAAI,gBAAgB,CAAC;AACtD,SAAS,OAAO,OAAO;CACtB,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAK;CAC7D,OAAO,QAAQ,IAAI,OAAO,OAAO;AAClC;;AAEA,SAAS,eAAe,OAAO;CAC9B,OAAO,OAAO,KAAK,MAAM;AAC1B;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,OAAO,OAAO,KAAK,MAAM;AAC1B;;;;;;;;;;;;;;;;ACAA,MAAM,WAAW;AACjB,MAAM,aAAa,UAAU,OAAO,IAAI,mBAAmB,CAAC;AAC5D,IAAI,YAAY,MAAM;CACrB,CAAC,cAAc;CACf;CACA,YAAY,OAAO;EAClB,KAAKA,SAAS;CACf;;CAEA,SAAS;EACR,OAAO,KAAKA;CACb;CACA,WAAW;EACV,OAAO;CACR;CACA,SAAS;EACR,OAAO;CACR;CACA,UAAU;EACT,OAAO;CACR;CACA,CAAC,OAAO,eAAe;EACtB,OAAO;CACR;CACA,CAAC,OAAO,IAAI,4BAA4B,KAAK;EAC5C,OAAO;CACR;AACD;;;;;;AAMA,SAAS,eAAe,OAAO;CAC9B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU,KAAK,CAAC,CAAC,gBAAgB;AACxF;;;;AChDA,SAAS,aAAa,OAAO;CAC5B,IAAI,UAAU,KAAK,GAAG,OAAO;CAC7B,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO;CACjC,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,OAAO,KAAK,OAAO;AACpB"}
|