@prisma/composer 0.2.0 → 0.3.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/{app-config-DJdU4ubR-BwioNK8j.d.mts → app-config-Dw3r7sUa-D3dr8rg2.d.mts} +89 -5
  2. package/dist/app-config-Dw3r7sUa-D3dr8rg2.d.mts.map +1 -0
  3. package/dist/app-config-joXc-BKm-CdcXqNMD.mjs +22 -0
  4. package/dist/app-config-joXc-BKm-CdcXqNMD.mjs.map +1 -0
  5. package/dist/assertions.d.mts.map +1 -0
  6. package/dist/bin.mjs +2396 -182
  7. package/dist/bin.mjs.map +1 -1
  8. package/dist/casts.d.mts.map +1 -0
  9. package/dist/config-121C4hAb.d.mts +1 -0
  10. package/dist/config.d.mts +3 -3
  11. package/dist/config.mjs +2 -9
  12. package/dist/deploy-121C4hAb.d.mts +1 -0
  13. package/dist/deploy-H3PKi0ZR-Chgm12Bn.mjs +313 -0
  14. package/dist/deploy-H3PKi0ZR-Chgm12Bn.mjs.map +1 -0
  15. package/dist/deploy.d.mts +2 -2
  16. package/dist/deploy.mjs +1 -311
  17. package/dist/{dist-B0axxnBf.mjs → dist-BkSJOwTm.mjs} +2 -2
  18. package/dist/{dist-B0axxnBf.mjs.map → dist-BkSJOwTm.mjs.map} +1 -1
  19. package/dist/{graph-BmrUEdo9-6Oq1hSmS.mjs → graph-CP16cJyH-D5IW87Y-.mjs} +18 -14
  20. package/dist/graph-CP16cJyH-D5IW87Y-.mjs.map +1 -0
  21. package/dist/{graph-B7NcPiOr-aSUOCGTH.d.mts → graph-DUSgjmzA-DhtkTqoz.d.mts} +3 -3
  22. package/dist/graph-DUSgjmzA-DhtkTqoz.d.mts.map +1 -0
  23. package/dist/{graph-types-BgT9UEdm-Bz-_OcJH.d.mts → graph-types-BcbVhojU-C3fhxjPK.d.mts} +3 -3
  24. package/dist/graph-types-BcbVhojU-C3fhxjPK.d.mts.map +1 -0
  25. package/dist/{index-B2DJ5CN4.d.mts → index-BFBNz7Aw.d.mts} +3 -3
  26. package/dist/index-BFBNz7Aw.d.mts.map +1 -0
  27. package/dist/index.d.mts +4 -4
  28. package/dist/index.mjs +2 -2
  29. package/dist/local-target.d.mts +29 -0
  30. package/dist/local-target.d.mts.map +1 -0
  31. package/dist/local-target.mjs +47 -0
  32. package/dist/local-target.mjs.map +1 -0
  33. package/dist/{nextjs-DLyeRR7M-B9ukbB2L.d.mts → nextjs-DLyeRR7M-DwnBjryZ.d.mts} +3 -3
  34. package/dist/nextjs-DLyeRR7M-DwnBjryZ.d.mts.map +1 -0
  35. package/dist/nextjs-control.d.mts +4 -4
  36. package/dist/nextjs-control.d.mts.map +1 -0
  37. package/dist/nextjs-control.mjs +2 -1
  38. package/dist/nextjs-control.mjs.map +1 -1
  39. package/dist/nextjs.d.mts +1 -1
  40. package/dist/node-control.d.mts +3 -3
  41. package/dist/node-control.d.mts.map +1 -0
  42. package/dist/node-control.mjs +44 -25
  43. package/dist/node-control.mjs.map +1 -1
  44. package/dist/node.d.mts +2 -2
  45. package/dist/node.d.mts.map +1 -0
  46. package/dist/report.d.mts +2 -2
  47. package/dist/report.d.mts.map +1 -0
  48. package/dist/service-rpc.d.mts +2 -2
  49. package/dist/service-rpc.d.mts.map +1 -0
  50. package/dist/service-rpc.mjs +2 -2
  51. package/dist/testing.d.mts +1 -1
  52. package/dist/testing.d.mts.map +1 -0
  53. package/package.json +13 -11
  54. package/src/exports/assertions.ts +1 -0
  55. package/src/exports/casts.ts +1 -0
  56. package/src/exports/config.ts +1 -0
  57. package/src/exports/deploy.ts +1 -0
  58. package/src/exports/index.ts +1 -0
  59. package/src/exports/local-target.ts +1 -0
  60. package/src/exports/nextjs-control.ts +1 -0
  61. package/src/exports/nextjs.ts +2 -0
  62. package/src/exports/node-control.ts +1 -0
  63. package/src/exports/node.ts +2 -0
  64. package/src/exports/report.ts +1 -0
  65. package/src/exports/service-rpc.ts +1 -0
  66. package/src/exports/testing.ts +1 -0
  67. package/dist/config-ByZICgry.d.mts +0 -1
  68. package/dist/config.mjs.map +0 -1
  69. package/dist/deploy-ByZICgry.d.mts +0 -1
  70. package/dist/deploy.mjs.map +0 -1
  71. package/dist/graph-BmrUEdo9-6Oq1hSmS.mjs.map +0 -1
package/dist/bin.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.mjs","names":[],"sources":["../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/0-foundation/foundation/dist/casts.mjs","../../../0-framework/1-core/core/dist/graph-BmrUEdo9.mjs","../../../0-framework/1-core/core/dist/index.mjs","../../../0-framework/1-core/core/dist/container-transport-DKmKg5JQ.mjs","../../../0-framework/3-tooling/cli/dist/cli-Bc6_i0ls.mjs","../../../0-framework/3-tooling/cli/dist/bin.mjs"],"sourcesContent":["//#region src/assemble-error.ts\n/**\n* A user-facing assembly failure with a message that already names the fix\n* (mirrors @internal/cli's CliError contract). This package must not import\n* CliError — its second consumer is the future programmatic deploy API, not\n* just the CLI — so it throws its own typed error; the CLI maps it (or lets\n* it propagate, since bin.ts already treats every Error uniformly: print the\n* message, exit nonzero).\n*/\nvar AssembleError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"AssembleError\";\n\t}\n};\n//#endregion\n//#region src/assemble-services.ts\n/**\n* The registry route for one service's build: extension by\n* `build.extension`, node descriptor by `build.type`, kind must be \"build\".\n* The CLI's coverage validation reports the same misses earlier with the\n* config fix; these errors are the backstop for programmatic callers.\n*/\nfunction buildDescriptorAssemble(config, node, address, cwd) {\n\tconst { extension, type } = node.build;\n\tconst extensionDescriptor = config.extensions.find((candidate) => candidate.id === extension);\n\tif (extensionDescriptor === void 0) throw new AssembleError(`No extension \"${extension}\" is configured (needed by service \"${node.name}\"'s build) — add it to prisma-composer.config.ts's \\`extensions\\`.`);\n\tconst nodeDescriptor = extensionDescriptor.nodes[type];\n\tif (nodeDescriptor === void 0) throw new AssembleError(`Extension \"${extension}\" has no descriptor for build type \"${type}\" (known: ${Object.keys(extensionDescriptor.nodes).join(\", \")}).`);\n\tif (nodeDescriptor.kind !== \"build\") throw new AssembleError(`Extension \"${extension}\"'s descriptor for type \"${type}\" is a \"${nodeDescriptor.kind}\" descriptor — assembling a service build needs a \"build\" descriptor.`);\n\treturn nodeDescriptor.assemble({\n\t\tbuild: node.build,\n\t\taddress,\n\t\tcwd\n\t});\n}\nasync function assembleServices(graph, config, cwd, run) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd) => buildDescriptorAssemble(config, node, address, nodeCwd));\n\tconst serviceNodes = graph.nodes.filter((n) => n.node.kind === \"service\");\n\tif (serviceNodes.length === 0) throw new AssembleError(\"The loaded graph has no service to assemble.\");\n\tconst bundles = {};\n\tfor (const { id, node } of serviceNodes) bundles[id] = await runAssembler(node, id, cwd);\n\treturn { bundles };\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","//#region src/casts.ts\n/**\n* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**\n*\n* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes\n* unnecessary**: tighten an input type, add a runtime check that narrows via a type\n* predicate, restructure a generic so the compiler can see the relationship you're\n* asserting, or use {@link castAs} when the value already satisfies the target type.\n* Only when no rewrite is feasible does `blindCast` become the right answer — and at\n* that point, the `Reason` literal you supply must articulate the compromise in\n* language a reviewer can evaluate.\n*\n* The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,\n* that is not a signal to soften the reason; it is a signal to go back and solve the\n* underlying type-system problem properly. An unconvincing justification is rework,\n* not a free pass.\n*\n* `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses\n* the compiler's checks (the input type is `unknown`, the output type is whatever the\n* caller asks for), but it forces the unsafety to be named at the call site instead of\n* smuggled in via a bare `as`. The `Reason` type parameter exists only at compile\n* time — it is not present in the emitted JavaScript — but it is grep-able and\n* visible to future readers.\n*\n* @example\n* ```typescript\n* const stringValue = blindCast<\n* string,\n* \"JSON.parse returns `unknown`; this field is documented to be a string in the API contract\"\n* >(parsed[key]);\n* ```\n*\n* @typeParam TargetType - The type the caller is asserting the input has.\n* @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.\n* Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.\n*/\nfunction blindCast(input) {\n\treturn input;\n}\n/**\n* Type-checked, runtime pass-through alternative to a bare `as Type` cast.\n*\n* Use `castAs` when the value already satisfies the target type but you want to make\n* the type assertion explicit at the call site — for example, when an inferred type is\n* wider than the type you want to publish, or when a literal object should be tagged\n* with its nominal interface. Unlike {@link blindCast}, the compiler still checks that\n* the value is assignable to the target type, so this helper cannot smuggle in an\n* unsafe assertion.\n*\n* `castAs` exists alongside `blindCast` so authors pick the right name at the call\n* site: a `castAs` is type-checked and benign; a `blindCast` is the unsafe escape\n* hatch. The split makes review faster — readers know which casts to scrutinize and\n* which are pure annotations.\n*\n* @example\n* ```typescript\n* interface FancyObject {\n* key: string;\n* keyTwo: {\n* subKey: string;\n* subKeyTwo: number;\n* };\n* }\n*\n* const typedObject = castAs<FancyObject>({\n* key: 'Chookede',\n* keyTwo: {\n* subKey: 'Choookeeeee',\n* subKeyTwo: 2,\n* },\n* });\n* ```\n*\n* @typeParam Type - The type to constrain and tag the value with. The value must be assignable to `Type`.\n*/\nfunction castAs(value) {\n\treturn value;\n}\n//#endregion\nexport { blindCast, castAs };\n\n//# sourceMappingURL=casts.mjs.map","import { blindCast } from \"@internal/foundation/casts\";\n//#region src/graph-types.ts\n/** Thrown by Load when the graph is malformed. */\nvar LoadError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"LoadError\";\n\t}\n};\n//#endregion\n//#region src/node.ts\n/**\n* Core model: node types and the factories that construct them, plain frozen\n* data objects. A node's `extension` + `type` form its deploy-time registry key (ADR-0017).\n*/\nconst NODE = Symbol.for(\"prisma:node\");\nconst SECRET_NEED = blindCast(Symbol.for(\"prisma:secret-need\"));\nconst SECRET_SOURCE = blindCast(Symbol.for(\"prisma:secret-source\"));\n/** Declares a secret NEED. Nameless — the platform name is bound at the root via `envSecret`. */\nfunction secret() {\n\treturn Object.freeze({\n\t\t[SECRET_NEED]: true,\n\t\tkind: \"secret\"\n\t});\n}\n/** Builds an opaque secret source from a target-defined payload — the SPI a deploy target's own source constructor (e.g. `envSecret`) calls. Core forwards the source and never inspects the payload. */\nfunction secretSource(payload) {\n\treturn Object.freeze({\n\t\t[SECRET_SOURCE]: true,\n\t\tpayload\n\t});\n}\n/** True if `value` is a secret source (an `envSecret` result or a forwarded ctx.secrets ref). */\nfunction isSecretSource(value) {\n\treturn typeof value === \"object\" && value !== null && blindCast(value)[SECRET_SOURCE] === true;\n}\nconst PROVISION_NEED = blindCast(Symbol.for(\"prisma:provision-need\"));\n/** Builds an opaque provisioning need — the declaring package's own brand plus whatever payload its provisioner reads back. */\nfunction provisionNeed(brand, payload) {\n\treturn blindCast(Object.freeze({\n\t\t[PROVISION_NEED]: true,\n\t\tbrand,\n\t\tpayload\n\t}));\n}\n/** True if `value` is a provisioning need (a `provisionNeed()` result). */\nfunction isProvisionNeed(value) {\n\treturn typeof value === \"object\" && value !== null && blindCast(value)[PROVISION_NEED] === true;\n}\nconst PARAM_SOURCE = blindCast(Symbol.for(\"prisma:param-source\"));\nconst PARAM_NEED = blindCast(Symbol.for(\"prisma:param-need\"));\n/** Builds an opaque param source from a target-defined payload — the SPI a deploy target's own source constructor (e.g. `envParam`) calls. Core forwards the source and never inspects the payload. */\nfunction paramSource(payload) {\n\treturn Object.freeze({\n\t\t[PARAM_SOURCE]: true,\n\t\tpayload\n\t});\n}\n/** True if `value` is a param source (an `envParam` result or a forwarded ctx.params ref). */\nfunction isParamSource(value) {\n\treturn typeof value === \"object\" && value !== null && blindCast(value)[PARAM_SOURCE] === true;\n}\n/** Declares a module param-forwarding NEED. Nameless — bound to a `ParamSource` by an enclosing scope and forwarded into a child's real param. */\nfunction paramNeed() {\n\treturn Object.freeze({\n\t\t[PARAM_NEED]: true,\n\t\tkind: \"param\"\n\t});\n}\nfunction requireType(type, factory) {\n\tif (typeof type !== \"string\" || type.length === 0) throw new Error(`${factory}() requires a non-empty node type.`);\n}\nfunction requireName(name, factory) {\n\tif (typeof name !== \"string\" || name.length === 0) throw new Error(`${factory}() requires a non-empty name.`);\n}\nfunction requireExtension(extension, factory) {\n\tif (typeof extension !== \"string\" || extension.length === 0) throw new Error(`${factory}() requires a non-empty extension (the authoring extension's package name).`);\n}\n/**\n* Config keys join address/input/param names with \"_\" and uppercase — an\n* underscore inside a name would collide with that separator (e.g. param\n* \"db_url\" vs input \"db\"'s param \"url\" both hitting env key \"DB_URL\").\n*/\nfunction requireNoUnderscoreName(name, kind, factory) {\n\tif (name.includes(\"_\")) throw new Error(`${factory}() ${kind} name \"${name}\" may not contain \"_\" — config keys join names with \"_\" as the separator (e.g. an input \"db\"'s param \"url\" becomes env key \"DB_URL\"), so an underscore inside a name would collide with that separator.`);\n}\nfunction requireNoUnderscoreNames(names, kind, factory) {\n\tfor (const name of names) requireNoUnderscoreName(name, kind, factory);\n}\nfunction freezeParams(params) {\n\tconst frozen = {};\n\tfor (const [name, param] of Object.entries(params)) frozen[name] = Object.freeze({ ...param });\n\treturn Object.freeze(frozen);\n}\nfunction freezeSecrets(secrets) {\n\tconst frozen = {};\n\tfor (const [name, need] of Object.entries(secrets)) frozen[name] = Object.freeze({ ...need });\n\treturn blindCast(Object.freeze(frozen));\n}\n/** A frozen shallow copy that keeps the caller's declared type. */\nfunction frozenShallowCopy(obj) {\n\treturn blindCast(Object.freeze({ ...obj }));\n}\n/**\n* Seals a node instance after its constructor has assigned all fields — the\n* last statement of a concrete node class's constructor. A free function, not\n* a base-class method, so an instance stays structurally a plain frozen node.\n*/\nfunction freezeNode(node) {\n\tObject.freeze(node);\n\treturn node;\n}\n/**\n* Everything `resource()` establishes, minus the freeze — an extension\n* whose resource node carries extra fields extends this, assigns them, and\n* calls `freezeNode(this)` as its constructor's last statement.\n*/\nvar ResourceNodeBase = class {\n\t[NODE] = true;\n\tkind = \"resource\";\n\tname;\n\textension;\n\ttype;\n\tprovides;\n\tconstructor(def) {\n\t\trequireName(def.name, \"resource\");\n\t\trequireExtension(def.extension, \"resource\");\n\t\tconst provides = def.provides;\n\t\tif (typeof provides !== \"object\" || provides === null || typeof provides.kind !== \"string\" || provides.kind.length === 0 || typeof provides.satisfies !== \"function\") throw new Error(\"resource() requires `provides` — the Contract this resource offers (a non-empty `kind` plus its `satisfies()`).\");\n\t\tthis.name = def.name;\n\t\tthis.extension = def.extension;\n\t\tthis.type = provides.kind;\n\t\tthis.provides = provides;\n\t}\n};\n/** The core leaf: exactly the base, frozen. */\nvar FrozenResourceNode = class extends ResourceNodeBase {\n\tconstructor(def) {\n\t\tsuper(def);\n\t\tfreezeNode(this);\n\t}\n};\n/**\n* Constructs a branded, frozen Resource node — an identity plus the Contract\n* it provides; the routing `type` is the contract's `kind`. Pure — nothing\n* is provisioned until a module provisions it.\n*/\nfunction resource(def) {\n\treturn new FrozenResourceNode(def);\n}\n/**\n* Constructs a branded, frozen Service node — declarations only (inputs,\n* params, build adapter, and the ports it exposes). Pure; carries no runtime behavior.\n*/\nfunction service(def) {\n\trequireName(def.name, \"service\");\n\trequireExtension(def.extension, \"service\");\n\trequireType(def.type, \"service\");\n\trequireNoUnderscoreNames(Object.keys(def.inputs), \"input\", \"service\");\n\trequireNoUnderscoreNames(Object.keys(def.params), \"param\", \"service\");\n\trequireNoUnderscoreNames(Object.keys(def.secrets ?? {}), \"secret\", \"service\");\n\tfor (const slot of Object.keys(def.secrets ?? {})) if (Object.hasOwn(def.params, slot)) throw new Error(`service() secret slot \"${slot}\" collides with a param of the same name — a secret slot and a service param derive the same config key (COMPOSER_<addr>_${slot.toUpperCase()}); rename one.`);\n\treturn Object.freeze({\n\t\t[NODE]: true,\n\t\tkind: \"service\",\n\t\tname: def.name,\n\t\textension: def.extension,\n\t\ttype: def.type,\n\t\tinputs: frozenShallowCopy(def.inputs),\n\t\tparams: freezeParams(def.params),\n\t\tsecretSlots: freezeSecrets(def.secrets ?? blindCast({})),\n\t\tbuild: Object.freeze({ ...def.build }),\n\t\texpose: def.expose !== void 0 ? frozenShallowCopy(def.expose) : void 0\n\t});\n}\n/**\n* Constructs a branded, frozen DependencyEnd. `required` (if given) is the\n* contract Load compares a wired ref against via `satisfies()`; an unnamed\n* end's diagnostic `name` falls back to its `type`.\n*/\nfunction dependency(def) {\n\trequireType(def.type, \"dependency\");\n\trequireNoUnderscoreNames(Object.keys(def.connection.params), \"param\", \"dependency\");\n\tconst connection = Object.freeze({\n\t\tparams: freezeParams(def.connection.params),\n\t\thydrate: def.connection.hydrate\n\t});\n\treturn Object.freeze({\n\t\t[NODE]: true,\n\t\tkind: \"dependency\",\n\t\tname: def.name !== void 0 && def.name.length > 0 ? def.name : def.type,\n\t\ttype: def.type,\n\t\tconnection,\n\t\trequired: def.required\n\t});\n}\n/**\n* Constructs a branded, frozen Module node. Construction is INERT — the body is\n* wiring, not user code, and runs only when the module is Loaded.\n*/\nfunction module(name, boundaryOrBody, maybeBody) {\n\trequireName(name, \"module\");\n\tconst closedRoot = typeof boundaryOrBody === \"function\";\n\tconst boundary = closedRoot ? {} : boundaryOrBody;\n\tconst deps = frozenShallowCopy(boundary.deps ?? {});\n\tconst secretSlots = frozenShallowCopy(boundary.secrets ?? {});\n\tconst paramSlots = frozenShallowCopy(boundary.params ?? {});\n\tconst expose = frozenShallowCopy(boundary.expose ?? {});\n\tconst body = closedRoot ? (ctx) => {\n\t\tboundaryOrBody(ctx);\n\t\treturn {};\n\t} : maybeBody;\n\treturn Object.freeze({\n\t\t[NODE]: true,\n\t\tkind: \"module\",\n\t\tname,\n\t\tdeps,\n\t\tsecretSlots,\n\t\tparamSlots,\n\t\texpose,\n\t\tbody\n\t});\n}\n/**\n* True if `value` was constructed by this module's factories. Checks the\n* brand only, never a prototype — a graph may mix nodes from a different\n* installed copy of core (dual-package hazard).\n*/\nfunction isNode(value) {\n\treturn typeof value === \"object\" && value !== null && value[NODE] === true;\n}\n//#endregion\n//#region src/toposort.ts\n/**\n* Stable topological sort: every edge's `from` precedes its `to` in the\n* result. Ties (nodes with no ordering constraint between them) keep their\n* relative order from `nodes` — so a graph already authored producer-first\n* comes out byte-identical to its pre-sort layout; only a graph that\n* genuinely needs reordering (e.g. a module wired via a forged ref pointing at a\n* not-yet-provisioned producer) actually moves. A Kahn's-algorithm variant\n* that always picks the ready node with the smallest original index. Edges\n* whose endpoint falls outside `nodes` (e.g. a service-root's input edges\n* targeting the root, which is appended separately) are ignored. Cycles\n* cannot reach here: `assertDependencyDag` already rejects them for\n* dependency edges, and input edges never cycle.\n*/\nfunction topoSort(nodes, edges) {\n\tconst byId = new Map(nodes.map((n) => [n.id, n]));\n\tconst indexOf = new Map(nodes.map((n, i) => [n.id, i]));\n\tconst indegree = new Map(nodes.map((n) => [n.id, 0]));\n\tconst successors = /* @__PURE__ */ new Map();\n\tfor (const edge of edges) {\n\t\tif (!byId.has(edge.from) || !byId.has(edge.to)) continue;\n\t\tconst targets = successors.get(edge.from) ?? [];\n\t\ttargets.push(edge.to);\n\t\tsuccessors.set(edge.from, targets);\n\t\tindegree.set(edge.to, (indegree.get(edge.to) ?? 0) + 1);\n\t}\n\tconst ready = new Set(nodes.filter((n) => indegree.get(n.id) === 0).map((n) => n.id));\n\tconst order = [];\n\twhile (ready.size > 0) {\n\t\tlet next;\n\t\tlet bestIndex = Number.POSITIVE_INFINITY;\n\t\tfor (const id of ready) {\n\t\t\tconst index = indexOf.get(id) ?? Number.POSITIVE_INFINITY;\n\t\t\tif (index < bestIndex) {\n\t\t\t\tbestIndex = index;\n\t\t\t\tnext = id;\n\t\t\t}\n\t\t}\n\t\tif (next === void 0) break;\n\t\tready.delete(next);\n\t\torder.push(next);\n\t\tfor (const target of successors.get(next) ?? []) {\n\t\t\tconst remaining = (indegree.get(target) ?? 0) - 1;\n\t\t\tindegree.set(target, remaining);\n\t\t\tif (remaining === 0) ready.add(target);\n\t\t}\n\t}\n\tif (order.length !== nodes.length) throw new LoadError(`topological sort processed ${order.length} of ${nodes.length} nodes — the graph contains a cycle that slipped past the DAG validation.`);\n\treturn order.map((id) => byId.get(id)).filter((n) => n !== void 0);\n}\n//#endregion\n//#region src/load-service.ts\nfunction serviceInputs(service, serviceId) {\n\tif (typeof service.inputs !== \"object\" || service.inputs === null) throw new LoadError(`Service \"${serviceId}\" has no inputs map.`);\n\tconst nodes = [];\n\tconst edges = [];\n\tfor (const [input, value] of Object.entries(service.inputs)) {\n\t\tconst kind = isNode(value) ? value.kind : void 0;\n\t\tif (kind === \"resource\") throw new LoadError(`Input \"${input}\" of \"${serviceId}\" is a resource node — a resource is provisioned by the composing module, never created for a service that mentions it. Declare the input as a dependency (the pack's dependency factory) and wire the module-provisioned resource's ref into it.`);\n\t\tif (kind !== \"dependency\") throw new LoadError(`Input \"${input}\" of \"${serviceId}\" is not a branded dependency end (construct it with the dependency() factory).`);\n\t\tif (value.type.length === 0) throw new LoadError(`Input \"${input}\" of \"${serviceId}\" has an empty node type.`);\n\t\tconst id = `${serviceId}.${input}`;\n\t\tnodes.push({\n\t\t\tid,\n\t\t\tnode: value\n\t\t});\n\t\tedges.push({\n\t\t\tfrom: id,\n\t\t\tto: serviceId,\n\t\t\tinput,\n\t\t\tkind: \"input\"\n\t\t});\n\t}\n\treturn {\n\t\tnodes,\n\t\tedges\n\t};\n}\nfunction loadService(root, rootId) {\n\tfor (const [input, value] of Object.entries(root.inputs)) if (isNode(value) && value.kind === \"dependency\") throw new LoadError(`Service \"${rootId}\" has an unwired dependency input \"${input}\" — this service is composed by a module; deploy the module instead of loading \"${rootId}\" directly.`);\n\tconst secretSlots = Object.keys(root.secretSlots);\n\tif (secretSlots.length > 0) {\n\t\tconst names = secretSlots.map((k) => `\"${k}\"`).join(\", \");\n\t\tthrow new LoadError(`Service \"${rootId}\" declares secret slot${secretSlots.length > 1 ? \"s\" : \"\"} ${names} but is being loaded directly — a lone service has no enclosing scope to bind them. Compose it inside a module that binds each with envSecret('NAME').`);\n\t}\n\tconst rootGraphNode = {\n\t\tid: rootId,\n\t\tnode: root\n\t};\n\tconst { nodes, edges } = serviceInputs(root, rootId);\n\treturn {\n\t\troot: rootGraphNode,\n\t\tnodes: [...topoSort(nodes, edges), rootGraphNode],\n\t\tedges,\n\t\tsecrets: [],\n\t\tparams: []\n\t};\n}\n//#endregion\n//#region src/load-module.ts\n/**\n* Builds the ref a provision() call hands back: the id (so a producer with no\n* exposed ports — or an untyped slot — can still be wired wholesale) plus one\n* ref-port per exposed contract, each the contract's own runtime value (so\n* its `satisfies()` still works) tagged with the provider's id.\n*/\nfunction refFor(id, service) {\n\tconst ports = {};\n\tfor (const [port, contract] of Object.entries(service.expose ?? {})) ports[port] = {\n\t\t...contract,\n\t\t__providerId: id\n\t};\n\treturn blindCast({\n\t\tid,\n\t\t...ports\n\t});\n}\n/**\n* The resource variant of refFor: a resource has exactly one port — the\n* contract it provides — flattened onto the ref itself, tagged with the\n* provider id. `id` is written last so a hostile contract value cannot\n* clobber it.\n*/\nfunction refForResource(id, resource) {\n\treturn blindCast({\n\t\t...resource.provides,\n\t\t__providerId: id,\n\t\tid\n\t});\n}\n/** A wired value's producer id: a ref-port's `__providerId`, or a bare ref's `id`. */\nfunction producerIdOf(ref) {\n\tif (typeof ref !== \"object\" || ref === null) return void 0;\n\tif (\"__providerId\" in ref && typeof ref.__providerId === \"string\") return ref.__providerId;\n\tif (\"id\" in ref && typeof ref.id === \"string\") return ref.id;\n}\n/**\n* Brands each `ctx.inputs` entry with the input key it stands for (see\n* flatten): diagnostic only — usage attribution relies on the per-key object\n* identity the branding copy creates, never on reading this back.\n*/\nconst MODULE_INPUT_KEY = Symbol(\"prisma:module-input-key\");\n/** Same per-key identity trick as MODULE_INPUT_KEY, for the parallel `ctx.secrets` forwarding channel. */\nconst MODULE_SECRET_KEY = Symbol(\"prisma:module-secret-key\");\n/** Same per-key identity trick as MODULE_INPUT_KEY, for the parallel `ctx.params` forwarding channel. */\nconst MODULE_PARAM_KEY = Symbol(\"prisma:module-param-key\");\n/** Whether `ref` carries a callable `satisfies` that accepts `required` truthily. */\nfunction satisfiesRequired(ref, required) {\n\treturn typeof ref === \"object\" && ref !== null && \"satisfies\" in ref && typeof ref.satisfies === \"function\" && ref.satisfies(required);\n}\n/**\n* Checks one recorded `wiring` object against the Deps it was wired against:\n* every named input exists and is a dependency slot, every referenced\n* producer is a real (by-now-provisioned) address, and a wired ref whose\n* slot declares a required contract must satisfy() it — no producer-kind\n* branching, the contract alone determines validity, whether the producer is\n* a service port or a resource. Shared by both provisioned kinds so a\n* module-as-child gets exactly the checks a service gets, and run once per\n* entry against the one `byId` shared by the whole recursive flatten, so a\n* forwarded ref resolves through to its real producer address regardless of\n* which ancestor scope provisioned it.\n*/\nfunction validateWiring(pending, byId) {\n\tconst { deps, wiring, targetId, targetKind, enclosingModuleName } = pending;\n\tfor (const [input, ref] of Object.entries(wiring)) {\n\t\tconst declared = blindCast(deps[input]);\n\t\tif (declared === void 0 || !isNode(declared) || declared.kind !== \"dependency\") throw new LoadError(`The deps for \"${targetId}\" name \"${input}\", which is not a dependency slot of that ${targetKind}.`);\n\t\tconst producerId = producerIdOf(ref);\n\t\tconst producer = producerId !== void 0 ? byId.get(producerId) : void 0;\n\t\tif (producerId === void 0 || producer === void 0) throw new LoadError(`The deps for \"${targetId}.${input}\" reference \"${String(producerId)}\", which is not provisioned in module \"${enclosingModuleName}\".`);\n\t\tconst required = declared.required;\n\t\tif (required !== void 0 && !satisfiesRequired(ref, required)) throw new LoadError(`The deps for \"${targetId}.${input}\" do not satisfy the slot's required contract.`);\n\t}\n\tfor (const [input, rawValue] of Object.entries(deps)) {\n\t\tconst value = blindCast(rawValue);\n\t\tif (!isNode(value) || wiring[input] !== void 0) continue;\n\t\tif (value.kind === \"dependency\") throw new LoadError(`Dependency input \"${input}\" of provisioned ${targetKind} \"${targetId}\" is not wired to a producer (module \"${enclosingModuleName}\").`);\n\t}\n}\n/** The (unvalidated) edges a `wiring` object implies — one dependency edge per entry; `validateWiring` does the real checking. */\nfunction wiringEdges(wiring, targetId) {\n\treturn Object.entries(wiring).map(([input, ref]) => ({\n\t\tfrom: producerIdOf(ref) ?? \"\",\n\t\tto: targetId,\n\t\tinput,\n\t\tkind: \"dependency\"\n\t}));\n}\n/**\n* Checks the secrets wired into one provisioned child: every declared slot is\n* bound to a real secret source (an `envSecret` or a forwarded ctx.secrets\n* ref), and no wired key names a slot the child doesn't declare — the secret\n* analog of `validateWiring`'s per-input checks, but resolved inline (a source\n* carries its own name, so no whole-graph pass is needed).\n*/\nfunction validateSecretBinding(child, id, secretWiring, enclosingModuleName) {\n\tconst { kind } = child;\n\tfor (const slot of Object.keys(child.secretSlots)) {\n\t\tconst bound = secretWiring[slot];\n\t\tif (bound === void 0) throw new LoadError(`Secret slot \"${slot}\" of provisioned ${kind} \"${id}\" is not bound (module \"${enclosingModuleName}\") — bind it with envSecret('NAME') or forward ctx.secrets.`);\n\t\tif (!isSecretSource(bound)) throw new LoadError(`Secret slot \"${slot}\" of \"${id}\" (module \"${enclosingModuleName}\") was wired with a non-secret value — use envSecret('NAME') or a forwarded ctx.secrets ref.`);\n\t}\n\tfor (const slot of Object.keys(secretWiring)) if (!Object.hasOwn(child.secretSlots, slot)) throw new LoadError(`The secrets for \"${id}\" name \"${slot}\", which is not a secret slot of that ${kind} (module \"${enclosingModuleName}\").`);\n}\n/**\n* Checks the params wired into a provisioned SERVICE: unlike a secret slot, a\n* declared param is never required to be bound here — it may fall back to its\n* own `default` (checked later, at `buildConfig`) — so this only rejects a\n* wired key that names something other than a real declared param.\n*/\nfunction validateServiceParamBinding(child, id, paramWiring, enclosingModuleName) {\n\tfor (const slot of Object.keys(paramWiring)) if (!Object.hasOwn(child.params, slot)) throw new LoadError(`The params for \"${id}\" name \"${slot}\", which is not a param of that service (module \"${enclosingModuleName}\").`);\n}\n/**\n* Checks the params wired into a provisioned MODULE: every declared\n* param-forwarding slot must be bound to a real `ParamSource` — a slot has no\n* schema of its own, so (unlike a service param) it cannot fall back to a\n* literal or a default; the param analog of `validateSecretBinding`.\n*/\nfunction validateParamNeedBinding(child, id, paramWiring, enclosingModuleName) {\n\tfor (const slot of Object.keys(child.paramSlots)) {\n\t\tconst bound = paramWiring[slot];\n\t\tif (bound === void 0) throw new LoadError(`Param slot \"${slot}\" of provisioned module \"${id}\" is not bound (module \"${enclosingModuleName}\") — bind it with a param source (e.g. envParam('NAME')) or forward ctx.params.`);\n\t\tif (!isParamSource(bound)) throw new LoadError(`Param slot \"${slot}\" of \"${id}\" (module \"${enclosingModuleName}\") was wired with a non-source value — a module param-forwarding slot carries no schema to validate a literal against; use envParam('NAME') or a forwarded ctx.params ref.`);\n\t}\n\tfor (const slot of Object.keys(paramWiring)) if (!Object.hasOwn(child.paramSlots, slot)) throw new LoadError(`The params for \"${id}\" name \"${slot}\", which is not a param slot of that module (module \"${enclosingModuleName}\").`);\n}\n/**\n* Recursively flattens one module's body into the shared graph state and\n* returns its resolved ModuleOutputs (one ref-port per expose key) for the\n* caller (the enclosing provision() call, or Load itself for the root) to\n* use. `address` is this module's OWN full address, or `undefined` for the root\n* scope — its direct children then get bare (unprefixed) addresses, keeping\n* a single-level module identical to before nesting existed. `wiring` supplies a\n* resolved producer ref-port for each of this module's OWN declared deps (empty\n* for the root, which may not declare any — see the root non-empty-deps\n* check in loadModule). `nodes`, `edges`, `pending`, and `byId` are shared\n* across the ENTIRE recursive flatten, not per scope — a nested module may\n* forward in a producer provisioned by an ancestor scope, and it is the\n* shared `byId` (keyed by full address) that lets that resolve.\n*/\nfunction flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes, edges, pending, secretBindings, paramBindings, byId) {\n\tconst localIds = /* @__PURE__ */ new Set();\n\tconst used = /* @__PURE__ */ new Set();\n\tconst usedSecrets = /* @__PURE__ */ new Set();\n\tconst usedParams = /* @__PURE__ */ new Set();\n\tconst ctxInputs = {};\n\tfor (const key of Object.keys(moduleNode.deps)) {\n\t\tconst wired = wiring[key];\n\t\tctxInputs[key] = typeof wired === \"object\" && wired !== null ? {\n\t\t\t...wired,\n\t\t\t[MODULE_INPUT_KEY]: key\n\t\t} : wired;\n\t}\n\tconst markUsed = (values) => {\n\t\tfor (const value of Object.values(values)) for (const key of Object.keys(ctxInputs)) if (value === ctxInputs[key]) used.add(key);\n\t};\n\tconst ctxSecrets = {};\n\tfor (const key of Object.keys(moduleNode.secretSlots)) {\n\t\tconst bound = secretWiring[key];\n\t\tctxSecrets[key] = typeof bound === \"object\" && bound !== null ? {\n\t\t\t...bound,\n\t\t\t[MODULE_SECRET_KEY]: key\n\t\t} : bound;\n\t}\n\tconst markSecretsUsed = (values) => {\n\t\tfor (const value of Object.values(values)) for (const key of Object.keys(ctxSecrets)) if (value === ctxSecrets[key]) usedSecrets.add(key);\n\t};\n\tconst ctxParams = {};\n\tfor (const key of Object.keys(moduleNode.paramSlots)) {\n\t\tconst bound = paramWiring[key];\n\t\tctxParams[key] = typeof bound === \"object\" && bound !== null ? {\n\t\t\t...bound,\n\t\t\t[MODULE_PARAM_KEY]: key\n\t\t} : bound;\n\t}\n\tconst markParamsUsed = (values) => {\n\t\tfor (const value of Object.values(values)) for (const key of Object.keys(ctxParams)) if (value === ctxParams[key]) usedParams.add(key);\n\t};\n\tconst provision = (child, opts) => {\n\t\tconst id = opts?.id ?? child.name;\n\t\tconst provisionWiring = opts?.deps;\n\t\tconst provisionSecrets = opts?.secrets;\n\t\tconst provisionParams = opts?.params;\n\t\tif (typeof id !== \"string\" || id.length === 0) throw new LoadError(`provision() requires a non-empty id (module \"${moduleNode.name}\").`);\n\t\tif (id.includes(\"_\") || id.includes(\".\")) throw new LoadError(`provision() id \"${id}\" (module \"${moduleNode.name}\") may not contain \"_\" or \".\" — \"_\" is the config-key separator and \".\" the node-id path separator; either inside an id collides with the joined form of other names.`);\n\t\tif (localIds.has(id)) throw new LoadError(`Duplicate provision id \"${id}\" in module \"${moduleNode.name}\".`);\n\t\tconst untrusted = child;\n\t\tif (!isNode(untrusted) || untrusted.kind !== \"service\" && untrusted.kind !== \"resource\" && untrusted.kind !== \"module\") throw new LoadError(`provision(\"${id}\") expects a branded service, resource, or module node (construct it with the service()/resource()/module() factories or a pack's own).`);\n\t\tlocalIds.add(id);\n\t\tconst fullAddress = address === void 0 ? id : `${address}.${id}`;\n\t\tif (child.kind === \"resource\") {\n\t\t\tif (provisionWiring !== void 0) throw new LoadError(`provision(\"${id}\") received deps for a resource — a resource has no dependency slots to satisfy.`);\n\t\t\tif (provisionSecrets !== void 0) throw new LoadError(`provision(\"${id}\") received secrets for a resource — a resource has no secret slots to satisfy.`);\n\t\t\tif (provisionParams !== void 0) throw new LoadError(`provision(\"${id}\") received params for a resource — a resource has no params to satisfy.`);\n\t\t\tif (child.type.length === 0) throw new LoadError(`provision(\"${id}\") received a resource with an empty node type.`);\n\t\t\tbyId.set(fullAddress, child);\n\t\t\tnodes.push({\n\t\t\t\tid: fullAddress,\n\t\t\t\tnode: child\n\t\t\t});\n\t\t\treturn refForResource(fullAddress, child);\n\t\t}\n\t\tconst localWiring = { ...provisionWiring ?? {} };\n\t\tmarkUsed(localWiring);\n\t\tconst localSecrets = { ...provisionSecrets ?? {} };\n\t\tmarkSecretsUsed(localSecrets);\n\t\tvalidateSecretBinding(child, id, localSecrets, moduleNode.name);\n\t\tconst localParams = { ...provisionParams ?? {} };\n\t\tmarkParamsUsed(localParams);\n\t\tif (child.kind === \"service\") {\n\t\t\tfor (const slot of Object.keys(child.secretSlots)) {\n\t\t\t\tconst bound = localSecrets[slot];\n\t\t\t\tif (isSecretSource(bound)) secretBindings.push({\n\t\t\t\t\tserviceAddress: fullAddress,\n\t\t\t\t\tslot,\n\t\t\t\t\tsource: bound\n\t\t\t\t});\n\t\t\t}\n\t\t\tvalidateServiceParamBinding(child, id, localParams, moduleNode.name);\n\t\t\tfor (const [slot, binding] of Object.entries(localParams)) paramBindings.push({\n\t\t\t\tserviceAddress: fullAddress,\n\t\t\t\tslot,\n\t\t\t\tbinding\n\t\t\t});\n\t\t\tconst inputs = serviceInputs(child, fullAddress);\n\t\t\tnodes.push(...inputs.nodes, {\n\t\t\t\tid: fullAddress,\n\t\t\t\tnode: child\n\t\t\t});\n\t\t\tedges.push(...inputs.edges, ...wiringEdges(localWiring, fullAddress));\n\t\t\tpending.push({\n\t\t\t\tdeps: child.inputs,\n\t\t\t\twiring: localWiring,\n\t\t\t\ttargetId: fullAddress,\n\t\t\t\ttargetKind: \"service\",\n\t\t\t\tenclosingModuleName: moduleNode.name\n\t\t\t});\n\t\t\tbyId.set(fullAddress, child);\n\t\t\treturn refFor(fullAddress, child);\n\t\t}\n\t\tvalidateParamNeedBinding(child, id, localParams, moduleNode.name);\n\t\tedges.push(...wiringEdges(localWiring, fullAddress));\n\t\tpending.push({\n\t\t\tdeps: child.deps,\n\t\t\twiring: localWiring,\n\t\t\ttargetId: fullAddress,\n\t\t\ttargetKind: \"module\",\n\t\t\tenclosingModuleName: moduleNode.name\n\t\t});\n\t\tconst childOutputs = flatten(child, fullAddress, localWiring, localSecrets, localParams, nodes, edges, pending, secretBindings, paramBindings, byId);\n\t\tnodes.push({\n\t\t\tid: fullAddress,\n\t\t\tnode: child\n\t\t});\n\t\tbyId.set(fullAddress, child);\n\t\treturn blindCast({\n\t\t\tid: fullAddress,\n\t\t\t...childOutputs\n\t\t});\n\t};\n\tconst ctx = blindCast({\n\t\tinputs: ctxInputs,\n\t\tsecrets: ctxSecrets,\n\t\tparams: ctxParams,\n\t\tprovision: blindCast(provision)\n\t});\n\tconst outputs = blindCast(moduleNode.body(ctx) ?? {});\n\tmarkUsed(outputs);\n\tfor (const key of Object.keys(moduleNode.deps)) if (!used.has(key)) throw new LoadError(`Module \"${moduleNode.name}\" declares input \"${key}\" but never forwards it into a provision nor returns it as an output.`);\n\tfor (const key of Object.keys(moduleNode.secretSlots)) if (!usedSecrets.has(key)) throw new LoadError(`Module \"${moduleNode.name}\" declares secret \"${key}\" but never forwards it into a provision.`);\n\tfor (const key of Object.keys(moduleNode.paramSlots)) if (!usedParams.has(key)) throw new LoadError(`Module \"${moduleNode.name}\" declares param \"${key}\" but never forwards it into a provision.`);\n\tfor (const [key, contract] of Object.entries(moduleNode.expose)) {\n\t\tconst port = outputs[key];\n\t\tif (port === void 0) throw new LoadError(`Module \"${moduleNode.name}\" declares expose \"${key}\" but its body did not return a port for it.`);\n\t\tif (!satisfiesRequired(port, contract)) throw new LoadError(`Module \"${moduleNode.name}\"'s returned port for expose \"${key}\" does not satisfy its declared contract.`);\n\t}\n\treturn outputs;\n}\nfunction loadModule(root, opts) {\n\tconst rootId = opts?.id ?? root.name;\n\tconst rootDepKeys = Object.keys(root.deps);\n\tif (rootDepKeys.length > 0) {\n\t\tconst names = rootDepKeys.map((k) => `\"${k}\"`).join(\", \");\n\t\tthrow new LoadError(`Module \"${root.name}\" declares input${rootDepKeys.length > 1 ? \"s\" : \"\"} ${names} but is being deployed as the root — a root has no enclosing scope to wire them; compose \"${root.name}\" from another module that provisions and wires it instead.`);\n\t}\n\tconst rootSecretKeys = Object.keys(root.secretSlots);\n\tif (rootSecretKeys.length > 0) {\n\t\tconst names = rootSecretKeys.map((k) => `\"${k}\"`).join(\", \");\n\t\tthrow new LoadError(`Module \"${root.name}\" declares secret${rootSecretKeys.length > 1 ? \"s\" : \"\"} ${names} but is being deployed as the root — a root has no enclosing scope to bind them; the root binds secrets with envSecret('NAME'), it does not declare secret slots of its own.`);\n\t}\n\tconst rootParamKeys = Object.keys(root.paramSlots);\n\tif (rootParamKeys.length > 0) {\n\t\tconst names = rootParamKeys.map((k) => `\"${k}\"`).join(\", \");\n\t\tthrow new LoadError(`Module \"${root.name}\" declares param${rootParamKeys.length > 1 ? \"s\" : \"\"} ${names} but is being deployed as the root — a root has no enclosing scope to bind them; the root binds params directly on each provision() call, it does not declare param-forwarding slots of its own.`);\n\t}\n\tconst nodes = [];\n\tconst edges = [];\n\tconst pending = [];\n\tconst secretBindings = [];\n\tconst paramBindings = [];\n\tconst byId = /* @__PURE__ */ new Map();\n\tflatten(root, void 0, {}, {}, {}, nodes, edges, pending, secretBindings, paramBindings, byId);\n\tfor (const entry of pending) validateWiring(entry, byId);\n\tassertDependencyDag(edges);\n\tconst rootGraphNode = {\n\t\tid: rootId,\n\t\tnode: root\n\t};\n\treturn {\n\t\troot: rootGraphNode,\n\t\tnodes: [...topoSort(nodes, edges), rootGraphNode],\n\t\tedges,\n\t\tsecrets: secretBindings,\n\t\tparams: paramBindings\n\t};\n}\n/**\n* The dependency edges must form a DAG — a cycle means neither producer can\n* deploy first. Resources take no wiring, so only service/module-to-service/module\n* edges can ever participate in a cycle; no special-casing needed.\n*/\nfunction assertDependencyDag(edges) {\n\tconst adjacency = /* @__PURE__ */ new Map();\n\tfor (const edge of edges) {\n\t\tif (edge.kind !== \"dependency\") continue;\n\t\tconst targets = adjacency.get(edge.from) ?? [];\n\t\ttargets.push(edge.to);\n\t\tadjacency.set(edge.from, targets);\n\t}\n\tconst visiting = /* @__PURE__ */ new Set();\n\tconst done = /* @__PURE__ */ new Set();\n\tconst stack = [];\n\tconst visit = (id) => {\n\t\tif (done.has(id)) return;\n\t\tif (visiting.has(id)) throw new LoadError(`Dependency cycle: ${[...stack.slice(stack.indexOf(id)), id].join(\" → \")} — no deploy order exists.`);\n\t\tvisiting.add(id);\n\t\tstack.push(id);\n\t\tfor (const next of adjacency.get(id) ?? []) visit(next);\n\t\tstack.pop();\n\t\tvisiting.delete(id);\n\t\tdone.add(id);\n\t};\n\tfor (const id of adjacency.keys()) visit(id);\n}\n//#endregion\n//#region src/graph.ts\n/**\n* Builds the in-memory graph from a root node. A service root walks its own\n* `inputs`; a module root executes its body (wiring, not user code — the\n* designed exception to imports-run-nothing) and recursively flattens every\n* module it provisions into one graph of hierarchical addresses. A malformed\n* graph is a `LoadError` that names its fix; the individual validation rules\n* live with `loadService` / `loadModule` and are covered by name in the Load\n* tests. Executes nothing of the user's own code beyond module bodies.\n*/\nfunction Load(root, opts) {\n\tif (!isNode(root)) throw new LoadError(\"Load expects a branded service or module node (construct it with the service()/module() factories).\");\n\tif (root.kind === \"module\") return loadModule(root, opts);\n\tif (root.kind === \"service\") return loadService(root, opts?.id ?? \"root\");\n\tthrow new LoadError(\"Load expects a service or module root (received another node kind).\");\n}\n//#endregion\nexport { LoadError as _, isNode as a, isSecretSource as c, paramSource as d, provisionNeed as f, service as g, secretSource as h, freezeNode as i, module as l, secret as m, ResourceNodeBase as n, isParamSource as o, resource as p, dependency as r, isProvisionNeed as s, Load as t, paramNeed as u };\n\n//# sourceMappingURL=graph-BmrUEdo9.mjs.map","import { _ as LoadError, a as isNode, c as isSecretSource, d as paramSource, f as provisionNeed, g as service, h as secretSource, i as freezeNode, l as module, m as secret, n as ResourceNodeBase, o as isParamSource, p as resource, r as dependency, s as isProvisionNeed, t as Load, u as paramNeed } from \"./graph-BmrUEdo9.mjs\";\nimport { SecretBox, SecretBox as SecretBox$1 } from \"@internal/foundation/secret\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/config.ts\n/**\n* A data-only descriptor of a param's schema for introspection — the\n* validator's vendor tag, never the schema's own `validate`. `configOf`\n* reports it where the old model reported `type: 'string' | 'number'`, so the\n* config surface stays enumerable without leaking a function. Nothing consumes\n* more than the vendor tag yet; a richer projection (e.g. a JSON-Schema export\n* when the vendor offers one) is an additive change if a consumer needs it.\n*/\nfunction projectSchema(schema) {\n\treturn { vendor: schema[\"~standard\"].vendor };\n}\n/**\n* Enumerates every config param the service declares: each input's connection\n* params, then the service's own params. Pure — reads `root.inputs`/`params`\n* directly, executes nothing but the (also pure) schema projection. Deliberately\n* does not go through `Load`: a service's connection-end inputs are legitimately\n* unwired from its own point of view (wiring is an enclosing module's concern),\n* and this introspects one service's declared shape regardless of how — or\n* whether — it composes into a larger graph.\n*/\nfunction configOf(root) {\n\tconst entries = [];\n\tfor (const [input, value] of Object.entries(root.inputs)) {\n\t\tif (typeof value !== \"object\" || value === null) continue;\n\t\tfor (const [name, param] of Object.entries(value.connection.params)) entries.push({\n\t\t\towner: { input },\n\t\t\tname,\n\t\t\tschema: projectSchema(param.schema),\n\t\t\toptional: param.optional === true,\n\t\t\tdefault: param.default\n\t\t});\n\t}\n\tfor (const [name, param] of Object.entries(root.params)) entries.push({\n\t\towner: \"service\",\n\t\tname,\n\t\tschema: projectSchema(param.schema),\n\t\toptional: param.optional === true,\n\t\tdefault: param.default\n\t});\n\treturn entries;\n}\n/**\n* The app's provision manifest: every secret binding the root resolved across\n* the graph (ADR-0029) — an opaque, target-defined source per service secret\n* slot; a deploy target's preflight reads its own payload. Pure graph\n* introspection, TARGET-AGNOSTIC — the target consumes it to verify each secret\n* exists on the platform before deploy. The values are provisioned out-of-band.\n*/\nfunction provisionManifest(graph) {\n\treturn graph.secrets;\n}\n/**\n* The app's param-binding manifest: every param a `provision()` call bound —\n* literal or an opaque, target-defined `ParamSource` — at the address that\n* declared it. The param sibling of `provisionManifest`, for a deploy\n* target's own preflight to consume (D2). Pure graph introspection,\n* TARGET-AGNOSTIC; a param this manifest omits simply falls back to its own\n* `default` at `buildConfig`.\n*/\nfunction paramManifest(graph) {\n\treturn graph.params;\n}\nfunction scalarSchema(name, check) {\n\treturn { \"~standard\": {\n\t\tversion: 1,\n\t\tvendor: \"@prisma/composer\",\n\t\tvalidate: (value) => check(value) ? { value } : { issues: [{ message: `expected ${name}, got ${typeof value}` }] }\n\t} };\n}\nconst stringSchema = scalarSchema(\"string\", (v) => typeof v === \"string\");\nconst numberSchema = scalarSchema(\"number\", (v) => typeof v === \"number\" && Number.isFinite(v));\nfunction withFacets(schema, opts) {\n\treturn {\n\t\tschema,\n\t\t...opts.optional !== void 0 ? { optional: opts.optional } : {},\n\t\t...opts.default !== void 0 ? { default: opts.default } : {},\n\t\t...opts.provision !== void 0 ? { provision: opts.provision } : {}\n\t};\n}\n/** A string-valued param. */\nfunction string(opts = {}) {\n\treturn withFacets(stringSchema, opts);\n}\n/** A number-valued param. */\nfunction number(opts = {}) {\n\treturn withFacets(numberSchema, opts);\n}\n/** A param over any caller-supplied Standard Schema — a structured `jobs`, say. */\nfunction param(schema, opts = {}) {\n\treturn withFacets(schema, opts);\n}\n//#endregion\n//#region src/hydrate.ts\n/**\n* The boot-side half of the runtime split (see core-model.md § Runtime:\n* booting a service). Core's job at boot is structural only: turn a\n* concrete, typed Config into hydrated deps by calling each input's\n* connection.hydrate with its value slice. No environment read, no\n* validation, no strings — the pack's `load()` already read the process-local\n* stash into a typed Config before calling this.\n*/\n/**\n* Given a service and a concrete typed Config, hydrate every input\n* (connection.hydrate with its typed value slice). A resource dep and a\n* connection dep hydrate through identical machinery — the loaded client is\n* indistinguishable. The service's own params ride alongside in\n* `config.service`; the node's `load()` merges the two.\n*/\nasync function hydrate(root, config) {\n\tconst deps = {};\n\tfor (const [name, inputNode] of Object.entries(root.inputs)) {\n\t\tconst values = config.inputs[name] ?? {};\n\t\tdeps[name] = await inputNode.connection.hydrate(values);\n\t}\n\treturn deps;\n}\n/**\n* Synchronous hydrate — what the node's `load()` uses so\n* `const { db } = service.load()` reads without `await`. Requires every\n* connection.hydrate to return synchronously; a Promise return is a loud error\n* naming the input (an async client factory must use the async `hydrate` path).\n*/\nfunction hydrateSync(root, config) {\n\tconst deps = {};\n\tfor (const [name, inputNode] of Object.entries(root.inputs)) {\n\t\tconst values = config.inputs[name] ?? {};\n\t\tconst client = inputNode.connection.hydrate(values);\n\t\tif (client instanceof Promise) throw new Error(`Connection hydrate for input \"${name}\" returned a Promise; load() requires a synchronous client factory.`);\n\t\tdeps[name] = client;\n\t}\n\treturn deps;\n}\n/**\n* Wraps each of a service's resolved secret values in a redacting `SecretBox`\n* — what the node's `secrets()` accessor returns (ADR-0021, sibling to\n* `load()`/`config()`). The RESOLUTION of a secret's value (the boot\n* double-lookup that reads the platform var the pointer names) is the target\n* pack's job; core is handed the already-resolved strings and only boxes them,\n* so a secret is redacted by TYPE from here on. A declared slot missing from\n* `values` is a target contract violation, named loudly.\n*/\nfunction hydrateSecrets(root, values) {\n\tconst boxed = {};\n\tfor (const slot of Object.keys(root.secretSlots)) {\n\t\tconst value = values[slot];\n\t\tif (value === void 0) throw new Error(`secret slot \"${slot}\" has no resolved value — the target must resolve every declared secret before hydrateSecrets().`);\n\t\tboxed[slot] = new SecretBox$1(value);\n\t}\n\treturn blindCast(boxed);\n}\n//#endregion\nexport { Load, LoadError, ResourceNodeBase, SecretBox, configOf, dependency, freezeNode, hydrate, hydrateSecrets, hydrateSync, isNode, isParamSource, isProvisionNeed, isSecretSource, module, number, param, paramManifest, paramNeed, paramSource, provisionManifest, provisionNeed, resource, secret, secretSource, service, string };\n\n//# sourceMappingURL=index.mjs.map","//#region src/container-transport.ts\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_CONTAINER_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction containerEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_CONTAINER_${extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, \"_\").replace(/^_+|_+$/g, \"\")}`;\n}\nfunction collisionError(a, b, varName) {\n\treturn /* @__PURE__ */ new Error(`Extension ids \"${a}\" and \"${b}\" both mangle to the container transport variable \"${varName}\" — rename one of the extensions.`);\n}\nfunction emptySerializeError(extensionId) {\n\treturn /* @__PURE__ */ new Error(`Extension \"${extensionId}\"'s container instance serialized to an empty string — ContainerInstance.serialize() must return a non-empty string.`);\n}\n/** The env entries the CLI sets on the alchemy process: `{ [containerEnvVarName(id)]: instance.serialize() }` for every resolved instance. */\nfunction containerEnv(instances) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, instance] of instances) {\n\t\tconst varName = containerEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw collisionError(owner, extensionId, varName);\n\t\townerByVarName.set(varName, extensionId);\n\t\tconst serialized = instance.serialize();\n\t\tif (serialized.length === 0) throw emptySerializeError(extensionId);\n\t\tenv[varName] = serialized;\n\t}\n\treturn env;\n}\n/**\n* The alchemy-process side: for each extension with a container descriptor\n* whose var is present in `env`, call its deserialize. Absent var → no entry.\n*/\nfunction deserializeContainers(extensions, env) {\n\tconst instances = /* @__PURE__ */ new Map();\n\tfor (const extension of extensions) {\n\t\tconst descriptor = extension.container;\n\t\tif (descriptor === void 0) continue;\n\t\tconst serialized = env[containerEnvVarName(extension.id)];\n\t\tif (serialized === void 0) continue;\n\t\tinstances.set(extension.id, descriptor.deserialize(serialized));\n\t}\n\treturn instances;\n}\n//#endregion\nexport { containerEnvVarName as n, deserializeContainers as r, containerEnv as t };\n\n//# sourceMappingURL=container-transport-DKmKg5JQ.mjs.map","import { Cli, Command, Option, UsageError } from \"clipanion\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { assembleServices } from \"@internal/assemble\";\nimport { Load, isNode } from \"@internal/core\";\nimport { containerEnv } from \"@internal/core/config\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport * as c12 from \"c12\";\nimport { pathToFileURL } from \"node:url\";\nimport { spawnSync } from \"node:child_process\";\n//#region src/cli-error.ts\n/**\n* A user-facing failure with a message that already names the fix (deploy-cli.md\n* § Error surface). `bin.ts` catches this — and any other Error, including\n* core's LoadError/LowerError — uniformly: print the message, exit nonzero.\n*/\nvar CliError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"CliError\";\n\t}\n};\n//#endregion\n//#region src/generate-stack.ts\n/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */\nconst GENERATED_DIR = \".prisma-composer\";\nconst GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/alchemy.run.ts` to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tlines.push(\" report: deploymentReport,\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the stack module's source (tests assert on it without touching disk) — uses `//` headers, not a block comment, since a cwd path with a star-slash could close one early. */\nfunction renderStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst configImport = relativeImportSpecifier(generatedDir, input.configPath);\n\treturn `// Generated by \\`prisma-composer deploy\\`/\\`prisma-composer destroy\\` — overwritten on every\n// run; do not edit by hand. Independently runnable from ${quote(input.cwd)}:\n//\n// alchemy deploy ${GENERATED_DIR}/${GENERATED_FILE}\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\nimport { lower } from '@prisma/composer/deploy';\nimport { deploymentReport } from '@prisma/composer/report';\nimport config from ${quote(configImport)};\nimport app from ${quote(appImport)};\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the stack file, returning its absolute path. */\nfunction writeStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderStackFile(input));\n\treturn filePath;\n}\nconst GENERATED_STACK_RELATIVE_PATH = path.join(GENERATED_DIR, GENERATED_FILE);\n//#endregion\n//#region src/load-config.ts\n/**\n* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE\n* file that imports control-plane code. Discovery is the standard walk-up\n* from the deploy entry's directory (mirrors prisma-next's config-loader);\n* loading is c12 with that explicit path (rc/global/package.json lookups\n* disabled), so the config file's own static imports resolve from the app\n* root by whatever package manager runs — no specifier construction, no\n* anchoring. The loaded shape is validated field-by-field with CliErrors\n* naming the field.\n*/\nconst CONFIG_FILENAME = \"prisma-composer.config.ts\";\n/** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */\nfunction findConfigPathForEntry(entryPath) {\n\tlet current = path.dirname(path.resolve(entryPath));\n\twhile (true) {\n\t\tconst candidate = path.join(current, CONFIG_FILENAME);\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(current);\n\t\tif (parent === current) return void 0;\n\t\tcurrent = parent;\n\t}\n}\nfunction missingConfigError(entryPath) {\n\treturn new CliError(`No ${CONFIG_FILENAME} found walking up from \"${path.dirname(path.resolve(entryPath))}\" — the deploy needs the app's config file. Create one next to (or above) the entry, default-exporting defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.`);\n}\nfunction fieldError(field, requirement) {\n\treturn new CliError(`${CONFIG_FILENAME}: \\`${field}\\` ${requirement} — see defineConfig() in '@prisma/composer/config'.`);\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Field-by-field validation of the loaded default export — deliberately no\n* schema library: each check is a CliError naming the offending field.\n* Returns the same object, typed.\n*/\nfunction validateConfigShape(loaded, configPath) {\n\tif (!isRecord(loaded) || Object.keys(loaded).length === 0) throw new CliError(`\"${configPath}\" exported no config — it must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.`);\n\tconst extensions = loaded[\"extensions\"];\n\tif (!Array.isArray(extensions)) throw fieldError(\"extensions\", \"must be an array\");\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const [index, entry] of extensions.entries()) {\n\t\tif (!isRecord(entry)) throw fieldError(`extensions[${index}]`, \"must be an extension descriptor object\");\n\t\tconst id = entry[\"id\"];\n\t\tif (typeof id !== \"string\" || id.length === 0) throw fieldError(`extensions[${index}].id`, \"must be a non-empty string (the extension package name)\");\n\t\tif (!isRecord(entry[\"nodes\"])) throw fieldError(`extensions[${index}].nodes`, \"must be an object (the node-ID → control registry)\");\n\t\tif (seen.has(id)) throw new CliError(`${CONFIG_FILENAME}: extension \"${id}\" is listed more than once in \\`extensions\\`.`);\n\t\tseen.add(id);\n\t}\n\tconst state = loaded[\"state\"];\n\tif (!isRecord(state) || typeof state[\"extension\"] !== \"string\" || typeof state[\"create\"] !== \"function\") throw fieldError(\"state\", \"must be a state descriptor (e.g. prismaState())\");\n\treturn blindCast(loaded);\n}\n/**\n* Loads + validates the config at `configPath` via c12 (explicit file; rc /\n* global-rc / package.json lookups disabled — discovery already happened in\n* findConfigPathForEntry).\n*/\nasync function loadAppConfig(configPath) {\n\tconst result = await c12.loadConfig({\n\t\tname: \"prisma-composer\",\n\t\tconfigFile: configPath,\n\t\tcwd: path.dirname(configPath),\n\t\trcFile: false,\n\t\tglobalRc: false,\n\t\tpackageJson: false\n\t});\n\tconst loadedFile = result.configFile;\n\tif (typeof loadedFile !== \"string\" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath)) throw new CliError(`Config loading resolved \"${String(loadedFile)}\" instead of the discovered \"${configPath}\" — refusing to deploy against a different file.`);\n\treturn {\n\t\tpath: configPath,\n\t\tconfig: validateConfigShape(result.config, configPath)\n\t};\n}\n//#endregion\n//#region src/load-entry.ts\n/**\n* Pipeline step 1 (deploy-cli.md § The pipeline): import the entry module\n* (resolved against cwd) and require its default export to be a node — a\n* service or module, branded by core's factories. Whatever this module exports\n* IS the application; nothing else marks a root (ADR-0003).\n*/\nasync function loadEntry(entryArg, cwd) {\n\tconst resolvedPath = path.resolve(cwd, entryArg);\n\tconst root = (await import(pathToFileURL(resolvedPath).href)).default;\n\tif (!isNode(root) || root.kind === \"dependency\" || root.kind === \"resource\") throw new CliError(`Entry module \"${resolvedPath}\" must default-export a node (a service or a module) — construct it with service() or module() from @prisma/composer.`);\n\treturn {\n\t\tpath: resolvedPath,\n\t\troot: blindCast(root)\n\t};\n}\n//#endregion\n//#region src/run-alchemy.ts\n/**\n* Pipeline step 7 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): shell out to the generated stack file. Resolves the\n* workspace's own installed `alchemy` bin (walking up `node_modules/.bin`\n* from the generated file's package dir) rather than going through\n* `bunx`/`npx`, so this works the same under node and bun — the resolved\n* bin's own launcher (`alchemy/bin/cli.js`) does its own node/bun dispatch\n* from there, driven by the env it inherits.\n*/\n/** Walks up from `startDir` looking for `node_modules/.bin/alchemy`. */\nfunction resolveAlchemyBin(startDir) {\n\tlet dir = startDir;\n\twhile (true) {\n\t\tconst candidate = path.join(dir, \"node_modules\", \".bin\", \"alchemy\");\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) throw new CliError(`Could not find an installed \\`alchemy\\` bin above \"${startDir}\" — add \"alchemy\" as a dependency of your app.`);\n\t\tdir = parent;\n\t}\n}\n/** Runs `alchemy deploy|destroy <stack file> --yes [--stage <stage>]`, inheriting stdio + env, plus every extension's resolved container. */\nfunction runAlchemy(input) {\n\tconst bin = resolveAlchemyBin(input.cwd);\n\tconst args = [\n\t\tinput.command,\n\t\tinput.stackFileRelativePath,\n\t\t\"--yes\"\n\t];\n\tif (input.stage !== void 0) args.push(\"--stage\", input.stage);\n\tconst result = spawnSync(bin, args, {\n\t\tcwd: input.cwd,\n\t\tstdio: \"inherit\",\n\t\tenv: {\n\t\t\t...input.env ?? process.env,\n\t\t\t...input.containerEnv\n\t\t}\n\t});\n\tif (result.error !== void 0) throw result.error;\n\treturn result.status ?? 1;\n}\n//#endregion\n//#region src/validate-coverage.ts\nfunction lookup(extensions, extension, type, expectedKind, what) {\n\tconst ext = extensions.get(extension);\n\tif (ext === void 0) throw new CliError(`No extension \"${extension}\" is configured (needed by ${what}) — add it to ${CONFIG_FILENAME}'s \\`extensions\\` (import its /control entry and list its descriptor).`);\n\tconst descriptor = ext.nodes[type];\n\tif (descriptor === void 0) throw new CliError(`Extension \"${extension}\" has no descriptor for node type \"${type}\" (needed by ${what}; known: ${Object.keys(ext.nodes).join(\", \")}).`);\n\tif (descriptor.kind !== expectedKind) throw new CliError(`Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${descriptor.kind}\" descriptor — ${what} needs a \"${expectedKind}\" descriptor.`);\n}\n/** Throws a CliError on the first uncovered `(extension, type)`; silent when the config covers the whole graph. */\nfunction validateRegistryCoverage(graph, config) {\n\tconst extensions = new Map(config.extensions.map((descriptor) => [descriptor.id, descriptor]));\n\tfor (const { id, node } of graph.nodes) {\n\t\tif (node.kind === \"resource\") {\n\t\t\tlookup(extensions, node.extension, node.type, \"resource\", `resource node \"${id}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (node.kind !== \"service\") continue;\n\t\tlookup(extensions, node.extension, node.type, \"service\", `service node \"${id}\"`);\n\t\tlookup(extensions, node.build.extension, node.build.type, \"build\", `service node \"${id}\"'s build descriptor`);\n\t}\n}\n//#endregion\n//#region src/validate-stage.ts\n/** A stage name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateStageName(stage) {\n\tconst result = spawnSync(\"git\", [\"check-ref-format\", `refs/heads/${stage}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliError(`git is required to validate --stage \"${stage}\" (git check-ref-format): ${result.error.message}.`);\n\tif (result.status !== 0) throw new CliError(`Invalid --stage \"${stage}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${stage}\").`);\n}\n//#endregion\n//#region src/main.ts\n/**\n* Argument parsing (clipanion — prisma-next's CLI idiom, see\n* prisma-next/packages/1-framework/3-tooling/cli/src/migration-cli.ts) +\n* orchestration of deploy-cli.md § The pipeline.\n*/\nconst BINARY_NAME = \"prisma-composer\";\n/** The <entry>/--name/--stage surface shared by deploy and destroy; execute() is unused — run() drives the pipeline directly so error handling stays under this module's control. */\nvar DeployCliCommand = class extends Command {\n\tentry = Option.String({ name: \"entry\" });\n\tname = Option.String(\"--name\", { description: \"Override the root node's name — the deploy's application name.\" });\n\tstage = Option.String(\"--stage\", { description: \"Alchemy stage to target.\" });\n\tproduction = Option.Boolean(\"--production\", false, { description: \"destroy: tear down the project-level production environment (required to destroy production).\" });\n\tasync execute() {\n\t\treturn 0;\n\t}\n};\nvar DeployCommand = class extends DeployCliCommand {\n\tstatic paths = [[\"deploy\"]];\n\tstatic usage = Command.Usage({\n\t\tdescription: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [[\"Deploy an app\", \"$0 deploy src/service.ts\"]]\n\t});\n\taction = \"deploy\";\n};\nvar DestroyCommand = class extends DeployCliCommand {\n\tstatic paths = [[\"destroy\"]];\n\tstatic usage = Command.Usage({\n\t\tdescription: \"Tear down the application whose root node is <entry>'s default export — same derivation as deploy, Alchemy destroy.\",\n\t\texamples: [[\"Destroy an app\", \"$0 destroy src/service.ts\"]]\n\t});\n\taction = \"destroy\";\n};\nfunction buildCli() {\n\treturn Cli.from([DeployCommand, DestroyCommand], {\n\t\tbinaryName: BINARY_NAME,\n\t\tbinaryLabel: \"The prisma-composer deploy CLI\"\n\t});\n}\n/** Thrown internally when the user explicitly asked for `--help`/`-h` — run() prints it to stdout and exits 0; not a usage error. */\nvar HelpRequested = class extends Error {};\n/** Duck-typed: clipanion's UnknownSyntaxError isn't re-exported, so match its name + clipanion.type discriminator (mirrors prisma-next's migration-cli.ts). */\nfunction isUnknownSyntaxError(error) {\n\tif (!(error instanceof Error) || error.name !== \"UnknownSyntaxError\") return false;\n\tconst meta = error.clipanion;\n\treturn typeof meta === \"object\" && meta !== null && meta.type === \"none\";\n}\n/** Exported for direct testing (main.test.ts) — not part of the package's public barrel (see index.ts). */\nfunction parseArgs(argv) {\n\tconst cli = buildCli();\n\tlet command;\n\ttry {\n\t\tcommand = cli.process([...argv]);\n\t} catch (error) {\n\t\tif (isUnknownSyntaxError(error) || error instanceof UsageError) throw new UsageError(cli.usage(null, { detailed: true }));\n\t\tthrow error;\n\t}\n\tif (command instanceof DeployCommand || command instanceof DestroyCommand) return {\n\t\tcommand: command.action,\n\t\tentry: command.entry,\n\t\tname: command.name,\n\t\tstage: command.stage,\n\t\tproduction: command.production\n\t};\n\tif (argv.includes(\"--help\") || argv.includes(\"-h\")) throw new HelpRequested(cli.usage(null, { detailed: true }));\n\tthrow new UsageError(cli.usage(null, { detailed: true }));\n}\n/** Destroy must name its target explicitly — no silent default to production (spec §10). */\nfunction effectiveStage(args) {\n\tif (args.command === \"deploy\") {\n\t\tif (args.production) throw new CliError(\"--production is only valid with `destroy`; `deploy` targets production by default (omit --stage).\");\n\t\treturn args.stage;\n\t}\n\tif (args.stage !== void 0 && args.production) throw new CliError(\"Pass either --stage <name> or --production to `destroy`, not both.\");\n\tif (args.stage === void 0 && !args.production) throw new CliError(\"`destroy` requires an explicit target: --stage <name> to tear down a branch environment, or --production to tear down the production environment.\");\n\treturn args.production ? void 0 : args.stage;\n}\nconst ALCHEMY_STATE_DIR = \".alchemy\";\n/** Warns (doesn't fail) when destroy finds no local deploy state under cwd — likely wrong directory or nothing deployed yet. */\nfunction warnIfNoLocalDeployState(cwd) {\n\tconst stateDir = path.join(cwd, ALCHEMY_STATE_DIR);\n\tif (!(fs.existsSync(stateDir) && fs.readdirSync(stateDir).length > 0)) console.warn(`\\nNo prior deploy state under ${cwd} — if you deployed from a different directory, run destroy from there; otherwise this is a no-op.`);\n}\n/** Runs the full pipeline; returns the process exit code. */\nasync function run(argv, deps = {}) {\n\tlet args;\n\ttry {\n\t\targs = parseArgs(argv);\n\t} catch (error) {\n\t\tif (error instanceof HelpRequested) {\n\t\t\tconsole.log(error.message);\n\t\t\treturn 0;\n\t\t}\n\t\tthrow error;\n\t}\n\tconst stage = effectiveStage(args);\n\tif (stage !== void 0) validateStageName(stage);\n\tconst cwd = process.cwd();\n\tif (args.command === \"destroy\") warnIfNoLocalDeployState(cwd);\n\tconst resolvedEntryPath = path.resolve(cwd, args.entry);\n\tconst configPath = findConfigPathForEntry(resolvedEntryPath);\n\tif (configPath === void 0) throw missingConfigError(resolvedEntryPath);\n\tconst config = deps.config ?? (await loadAppConfig(configPath)).config;\n\tconst entryModule = await loadEntry(args.entry, cwd);\n\tconst graph = Load(entryModule.root);\n\tif (graph.root.node.kind !== \"module\") throw new CliError(\"The deploy root must be a module — wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); }).\");\n\tvalidateRegistryCoverage(graph, config);\n\tconst name = args.name ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliError(\"The root node has no name — name it at authoring, or pass --name.\");\n\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler);\n\t} catch (error) {\n\t\tif (args.command === \"destroy\" && error instanceof Error) throw new CliError(`${error.message}\\n\\ndestroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first. Run the build, then retry the destroy.`);\n\t\tthrow error;\n\t}\n\tconst containers = /* @__PURE__ */ new Map();\n\tfor (const extension of config.extensions) {\n\t\tif (extension.container === void 0) continue;\n\t\ttry {\n\t\t\tif (args.command === \"deploy\") containers.set(extension.id, await extension.container.ensure({\n\t\t\t\tappName: name,\n\t\t\t\tstage\n\t\t\t}));\n\t\t\telse {\n\t\t\t\tconst instance = await extension.container.locate({\n\t\t\t\t\tappName: name,\n\t\t\t\t\tstage\n\t\t\t\t});\n\t\t\t\tif (instance === void 0) throw new CliError(`Nothing deployed for ${name}${stage !== void 0 ? `/${stage}` : \"\"} — deploy it first.`);\n\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n\t\t}\n\t}\n\tif (args.command === \"deploy\") for (const extension of config.extensions) {\n\t\tif (extension.preflight === void 0) continue;\n\t\ttry {\n\t\t\tawait extension.preflight({\n\t\t\t\tgraph,\n\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\tstage\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthrow error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n\t\t}\n\t}\n\tconst stackPath = writeStackFile({\n\t\tentryPath: entryModule.path,\n\t\tcwd,\n\t\tconfigPath,\n\t\tname,\n\t\tassembled\n\t});\n\ttry {\n\t\tconst status = (deps.alchemy ?? runAlchemy)({\n\t\t\tcommand: args.command,\n\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\tcwd,\n\t\t\tstage,\n\t\t\tcontainerEnv: containerEnv(containers)\n\t\t});\n\t\tif (status !== 0) {\n\t\t\tconsole.error(`\\nGenerated stack file: ${stackPath}`);\n\t\t\tconsole.error(`Run \\`alchemy ${args.command} ${GENERATED_STACK_RELATIVE_PATH} --yes\\` from ${cwd} to reproduce this directly.`);\n\t\t\treturn status;\n\t\t}\n\t\tif (args.command === \"destroy\") {\n\t\t\tfor (const extension of config.extensions) {\n\t\t\t\tif (extension.teardown === void 0) continue;\n\t\t\t\ttry {\n\t\t\t\t\tawait extension.teardown({\n\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\tstage\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const extension of config.extensions) {\n\t\t\t\tif (extension.container === void 0) continue;\n\t\t\t\tconst instance = containers.get(extension.id);\n\t\t\t\tif (instance === void 0) continue;\n\t\t\t\ttry {\n\t\t\t\t\tawait extension.container.remove(instance);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn status;\n\t} catch (error) {\n\t\tconsole.error(`\\nGenerated stack file: ${stackPath}`);\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/cli.ts\n/**\n* Run the `prisma-composer` CLI end to end: dispatch `argv`, map errors to exit\n* codes. Shared by this package's `bin` and the unscoped `prisma-composer` launcher.\n*/\nasync function cli(argv = process.argv.slice(2)) {\n\ttry {\n\t\tprocess.exitCode = await run(argv);\n\t} catch (error) {\n\t\tif (error instanceof UsageError) {\n\t\t\tconsole.error(error.message);\n\t\t\tprocess.exitCode = 1;\n\t\t\treturn;\n\t\t}\n\t\tconsole.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n\t\tprocess.exitCode = 1;\n\t}\n}\n//#endregion\nexport { loadEntry as a, CliError as c, runAlchemy as i, run as n, renderStackFile as o, resolveAlchemyBin as r, writeStackFile as s, cli as t };\n\n//# sourceMappingURL=cli-Bc6_i0ls.mjs.map","#!/usr/bin/env node\nimport { t as cli } from \"./cli-Bc6_i0ls.mjs\";\n//#region src/bin.ts\ncli();\n//#endregion\nexport {};\n\n//# sourceMappingURL=bin.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AASA,IAAI,gBAAgB,cAAc,MAAM;CACvC,YAAY,SAAS;EACpB,MAAM,OAAO;EACb,KAAK,OAAO;CACb;AACD;;;;;;;AASA,SAAS,wBAAwB,QAAQ,MAAM,SAAS,KAAK;CAC5D,MAAM,EAAE,WAAW,SAAS,KAAK;CACjC,MAAM,sBAAsB,OAAO,WAAW,MAAM,cAAc,UAAU,OAAO,SAAS;CAC5F,IAAI,wBAAwB,KAAK,GAAG,MAAM,IAAI,cAAc,iBAAiB,UAAU,sCAAsC,KAAK,KAAK,mEAAmE;CAC1M,MAAM,iBAAiB,oBAAoB,MAAM;CACjD,IAAI,mBAAmB,KAAK,GAAG,MAAM,IAAI,cAAc,cAAc,UAAU,sCAAsC,KAAK,YAAY,OAAO,KAAK,oBAAoB,KAAK,CAAC,CAAC,KAAK,IAAI,EAAE,GAAG;CAC3L,IAAI,eAAe,SAAS,SAAS,MAAM,IAAI,cAAc,cAAc,UAAU,2BAA2B,KAAK,UA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IAC5C,IAAI,aAAa,KAAK,GAAG;IACzB,IAAI;KACH,MAAM,UAAU,UAAU,OAAO,QAAQ;IAC1C,SAAS,OAAO;KACf,MAAM,iBAAiB,WAAW,QAAQ,IAAI,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;IAC9G;GACD;EACD;EACA,OAAO;CACR,SAAS,OAAO;EACf,QAAQ,MAAM,2BAA2B,WAAW;EACpD,MAAM;CACP;AACD;;;;;AAOA,eAAe,IAAI,OAAO,QAAQ,KAAK,MAAM,CAAC,GAAG;CAChD,IAAI;EACH,QAAQ,WAAW,MAAM,IAAI,IAAI;CAClC,SAAS,OAAO;EACf,IAAI,iBAAiB,YAAY;GAChC,QAAQ,MAAM,MAAM,OAAO;GAC3B,QAAQ,WAAW;GACnB;EACD;EACA,QAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;EAChF,QAAQ,WAAW;CACpB;AACD;;;ACvcA,IAAI"}
1
+ {"version":3,"file":"bin.mjs","names":["lstat","stat","presolve","readdir","pjoin","prelative","realpath","psep","osType","fs_watch","stat","fsrealpath","EV","stat","watch","chokidar"],"sources":["../../../0-framework/1-core/core/dist/container-transport-DKmKg5JQ.mjs","../../../0-framework/1-core/core/dist/app-config-joXc-BKm.mjs","../../../0-framework/0-foundation/foundation/dist/casts.mjs","../../../0-framework/1-core/core/dist/graph-CP16cJyH.mjs","../../../0-framework/1-core/core/dist/deploy-H3PKi0ZR.mjs","../../../0-framework/1-core/core/dist/local-target.mjs","../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/1-core/core/dist/index.mjs","../../../0-framework/3-tooling/cli/node_modules/readdirp/esm/index.js","../../../0-framework/3-tooling/cli/node_modules/chokidar/esm/handler.js","../../../0-framework/3-tooling/cli/node_modules/chokidar/esm/index.js","../../../0-framework/3-tooling/cli/dist/cli-CH8Ewf_a.mjs","../../../0-framework/3-tooling/cli/dist/bin.mjs"],"sourcesContent":["//#region src/container-transport.ts\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_CONTAINER_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction containerEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_CONTAINER_${extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, \"_\").replace(/^_+|_+$/g, \"\")}`;\n}\nfunction collisionError(a, b, varName) {\n\treturn /* @__PURE__ */ new Error(`Extension ids \"${a}\" and \"${b}\" both mangle to the container transport variable \"${varName}\" — rename one of the extensions.`);\n}\nfunction emptySerializeError(extensionId) {\n\treturn /* @__PURE__ */ new Error(`Extension \"${extensionId}\"'s container instance serialized to an empty string — ContainerInstance.serialize() must return a non-empty string.`);\n}\n/** The env entries the CLI sets on the alchemy process: `{ [containerEnvVarName(id)]: instance.serialize() }` for every resolved instance. */\nfunction containerEnv(instances) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, instance] of instances) {\n\t\tconst varName = containerEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw collisionError(owner, extensionId, varName);\n\t\townerByVarName.set(varName, extensionId);\n\t\tconst serialized = instance.serialize();\n\t\tif (serialized.length === 0) throw emptySerializeError(extensionId);\n\t\tenv[varName] = serialized;\n\t}\n\treturn env;\n}\n/**\n* The alchemy-process side: for each extension with a container descriptor\n* whose var is present in `env`, call its deserialize. Absent var → no entry.\n*/\nfunction deserializeContainers(extensions, env) {\n\tconst instances = /* @__PURE__ */ new Map();\n\tfor (const extension of extensions) {\n\t\tconst descriptor = extension.container;\n\t\tif (descriptor === void 0) continue;\n\t\tconst serialized = env[containerEnvVarName(extension.id)];\n\t\tif (serialized === void 0) continue;\n\t\tinstances.set(extension.id, descriptor.deserialize(serialized));\n\t}\n\treturn instances;\n}\n//#endregion\nexport { containerEnvVarName as n, deserializeContainers as r, containerEnv as t };\n\n//# sourceMappingURL=container-transport-DKmKg5JQ.mjs.map","//#region src/control/app-config.ts\n/** `<cwd>/.prisma-composer/dev` — the dev instance's app-scoped state directory (ADR-0041, ADR-0004's tool-state rule). \"dev\" names the user-facing feature/dir (naming, operator 2026-07-23) — this constant's name and value are unchanged by the localTarget rename. */\nconst DEV_DIR = \".prisma-composer/dev\";\n/**\n* True when an extension only participates in assembly (every `nodes` entry\n* is `kind: 'build'`, and it declares none of `providers`/`application`/\n* `provisions`/`container`) — it owns no resources or services, so it has\n* nothing to emulate and is exempt from local-target-capability requirements\n* (ADR-0041). Shared by `localTargetProviders` and every local-target hook\n* iteration.\n*/\nfunction isBuildOnlyExtension(extension) {\n\treturn Object.values(extension.nodes).every((node) => node.kind === \"build\") && extension.providers === void 0 && extension.application === void 0 && extension.provisions === void 0 && extension.container === void 0;\n}\n/** Typed identity — exists so `prisma-composer.config.ts` gets checked against PrismaAppConfig where it is written. */\nfunction defineConfig(config) {\n\treturn config;\n}\n//#endregion\nexport { defineConfig as n, isBuildOnlyExtension as r, DEV_DIR as t };\n\n//# sourceMappingURL=app-config-joXc-BKm.mjs.map","//#region src/casts.ts\n/**\n* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**\n*\n* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes\n* unnecessary**: tighten an input type, add a runtime check that narrows via a type\n* predicate, restructure a generic so the compiler can see the relationship you're\n* asserting, or use {@link castAs} when the value already satisfies the target type.\n* Only when no rewrite is feasible does `blindCast` become the right answer — and at\n* that point, the `Reason` literal you supply must articulate the compromise in\n* language a reviewer can evaluate.\n*\n* The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,\n* that is not a signal to soften the reason; it is a signal to go back and solve the\n* underlying type-system problem properly. An unconvincing justification is rework,\n* not a free pass.\n*\n* `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses\n* the compiler's checks (the input type is `unknown`, the output type is whatever the\n* caller asks for), but it forces the unsafety to be named at the call site instead of\n* smuggled in via a bare `as`. The `Reason` type parameter exists only at compile\n* time — it is not present in the emitted JavaScript — but it is grep-able and\n* visible to future readers.\n*\n* @example\n* ```typescript\n* const stringValue = blindCast<\n* string,\n* \"JSON.parse returns `unknown`; this field is documented to be a string in the API contract\"\n* >(parsed[key]);\n* ```\n*\n* @typeParam TargetType - The type the caller is asserting the input has.\n* @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.\n* Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.\n*/\nfunction blindCast(input) {\n\treturn input;\n}\n/**\n* Type-checked, runtime pass-through alternative to a bare `as Type` cast.\n*\n* Use `castAs` when the value already satisfies the target type but you want to make\n* the type assertion explicit at the call site — for example, when an inferred type is\n* wider than the type you want to publish, or when a literal object should be tagged\n* with its nominal interface. Unlike {@link blindCast}, the compiler still checks that\n* the value is assignable to the target type, so this helper cannot smuggle in an\n* unsafe assertion.\n*\n* `castAs` exists alongside `blindCast` so authors pick the right name at the call\n* site: a `castAs` is type-checked and benign; a `blindCast` is the unsafe escape\n* hatch. The split makes review faster — readers know which casts to scrutinize and\n* which are pure annotations.\n*\n* @example\n* ```typescript\n* interface FancyObject {\n* key: string;\n* keyTwo: {\n* subKey: string;\n* subKeyTwo: number;\n* };\n* }\n*\n* const typedObject = castAs<FancyObject>({\n* key: 'Chookede',\n* keyTwo: {\n* subKey: 'Choookeeeee',\n* subKeyTwo: 2,\n* },\n* });\n* ```\n*\n* @typeParam Type - The type to constrain and tag the value with. The value must be assignable to `Type`.\n*/\nfunction castAs(value) {\n\treturn value;\n}\n//#endregion\nexport { blindCast, castAs };\n\n//# sourceMappingURL=casts.mjs.map","import { blindCast } from \"@internal/foundation/casts\";\n//#region src/graph-types.ts\n/** Thrown by Load when the graph is malformed. */\nvar LoadError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"LoadError\";\n\t}\n};\n//#endregion\n//#region src/node.ts\n/**\n* Core model: node types and the factories that construct them, plain frozen\n* data objects. A node's `extension` + `type` form its deploy-time registry key (ADR-0017).\n*/\nconst NODE = Symbol.for(\"prisma:node\");\nconst SECRET_NEED = blindCast(Symbol.for(\"prisma:secret-need\"));\nconst SECRET_SOURCE = blindCast(Symbol.for(\"prisma:secret-source\"));\n/** Declares a secret NEED. Nameless — the platform name is bound at the root via `envSecret`. */\nfunction secret() {\n\treturn Object.freeze({\n\t\t[SECRET_NEED]: true,\n\t\tkind: \"secret\"\n\t});\n}\n/** Builds an opaque secret source from a target-defined payload — the SPI a deploy target's own source constructor (e.g. `envSecret`) calls. Core forwards the source and never inspects the payload. */\nfunction secretSource(payload) {\n\treturn Object.freeze({\n\t\t[SECRET_SOURCE]: true,\n\t\tpayload\n\t});\n}\n/** True if `value` is a secret source (an `envSecret` result or a forwarded ctx.secrets ref). */\nfunction isSecretSource(value) {\n\treturn typeof value === \"object\" && value !== null && blindCast(value)[SECRET_SOURCE] === true;\n}\nconst PROVISION_NEED = blindCast(Symbol.for(\"prisma:provision-need\"));\n/** Builds an opaque provisioning need — the declaring package's own brand plus whatever payload its provisioner reads back. */\nfunction provisionNeed(brand, payload) {\n\treturn blindCast(Object.freeze({\n\t\t[PROVISION_NEED]: true,\n\t\tbrand,\n\t\tpayload\n\t}));\n}\n/** True if `value` is a provisioning need (a `provisionNeed()` result). */\nfunction isProvisionNeed(value) {\n\treturn typeof value === \"object\" && value !== null && blindCast(value)[PROVISION_NEED] === true;\n}\nconst PARAM_SOURCE = blindCast(Symbol.for(\"prisma:param-source\"));\nconst PARAM_NEED = blindCast(Symbol.for(\"prisma:param-need\"));\n/** Builds an opaque param source from a target-defined payload — the SPI a deploy target's own source constructor (e.g. `envParam`) calls. Core forwards the source and never inspects the payload. */\nfunction paramSource(payload) {\n\treturn Object.freeze({\n\t\t[PARAM_SOURCE]: true,\n\t\tpayload\n\t});\n}\n/** True if `value` is a param source (an `envParam` result or a forwarded ctx.params ref). */\nfunction isParamSource(value) {\n\treturn typeof value === \"object\" && value !== null && blindCast(value)[PARAM_SOURCE] === true;\n}\n/** Declares a module param-forwarding NEED. Nameless — bound to a `ParamSource` by an enclosing scope and forwarded into a child's real param. */\nfunction paramNeed() {\n\treturn Object.freeze({\n\t\t[PARAM_NEED]: true,\n\t\tkind: \"param\"\n\t});\n}\nfunction requireType(type, factory) {\n\tif (typeof type !== \"string\" || type.length === 0) throw new Error(`${factory}() requires a non-empty node type.`);\n}\nfunction requireName(name, factory) {\n\tif (typeof name !== \"string\" || name.length === 0) throw new Error(`${factory}() requires a non-empty name.`);\n}\nfunction requireExtension(extension, factory) {\n\tif (typeof extension !== \"string\" || extension.length === 0) throw new Error(`${factory}() requires a non-empty extension (the authoring extension's package name).`);\n}\n/**\n* Core's grammar for every name that becomes a config-key segment —\n* addresses, input/param/secret names: ASCII letters and digits only.\n* Conservative by design so any target medium — POSIX env-var keys\n* included — can uppercase and \"_\"-join segments without escaping.\n*/\nfunction isConfigKeySegment(name) {\n\treturn /^[A-Za-z0-9]+$/.test(name);\n}\nfunction requireConfigKeySegmentName(name, kind, factory) {\n\tif (!isConfigKeySegment(name)) throw new Error(`${factory}() ${kind} name \"${name}\" must contain only ASCII letters and digits ([A-Za-z0-9]) — declared names derive deterministic config keys, uppercased and joined with \"_\" (an input \"db\"'s param \"url\" becomes config key \"DB_URL\"), so an underscore inside a name collides with that separator and any other character has no place in a config key. \"${name}\" would put \"${name.toUpperCase()}\" inside the derived key.`);\n}\nfunction requireConfigKeySegmentNames(names, kind, factory) {\n\tfor (const name of names) requireConfigKeySegmentName(name, kind, factory);\n}\nfunction freezeParams(params) {\n\tconst frozen = {};\n\tfor (const [name, param] of Object.entries(params)) frozen[name] = Object.freeze({ ...param });\n\treturn Object.freeze(frozen);\n}\nfunction freezeSecrets(secrets) {\n\tconst frozen = {};\n\tfor (const [name, need] of Object.entries(secrets)) frozen[name] = Object.freeze({ ...need });\n\treturn blindCast(Object.freeze(frozen));\n}\n/** A frozen shallow copy that keeps the caller's declared type. */\nfunction frozenShallowCopy(obj) {\n\treturn blindCast(Object.freeze({ ...obj }));\n}\n/**\n* Seals a node instance after its constructor has assigned all fields — the\n* last statement of a concrete node class's constructor. A free function, not\n* a base-class method, so an instance stays structurally a plain frozen node.\n*/\nfunction freezeNode(node) {\n\tObject.freeze(node);\n\treturn node;\n}\n/**\n* Everything `resource()` establishes, minus the freeze — an extension\n* whose resource node carries extra fields extends this, assigns them, and\n* calls `freezeNode(this)` as its constructor's last statement.\n*/\nvar ResourceNodeBase = class {\n\t[NODE] = true;\n\tkind = \"resource\";\n\tname;\n\textension;\n\ttype;\n\tprovides;\n\tconstructor(def) {\n\t\trequireName(def.name, \"resource\");\n\t\trequireExtension(def.extension, \"resource\");\n\t\tconst provides = def.provides;\n\t\tif (typeof provides !== \"object\" || provides === null || typeof provides.kind !== \"string\" || provides.kind.length === 0 || typeof provides.satisfies !== \"function\") throw new Error(\"resource() requires `provides` — the Contract this resource offers (a non-empty `kind` plus its `satisfies()`).\");\n\t\tthis.name = def.name;\n\t\tthis.extension = def.extension;\n\t\tthis.type = provides.kind;\n\t\tthis.provides = provides;\n\t}\n};\n/** The core leaf: exactly the base, frozen. */\nvar FrozenResourceNode = class extends ResourceNodeBase {\n\tconstructor(def) {\n\t\tsuper(def);\n\t\tfreezeNode(this);\n\t}\n};\n/**\n* Constructs a branded, frozen Resource node — an identity plus the Contract\n* it provides; the routing `type` is the contract's `kind`. Pure — nothing\n* is provisioned until a module provisions it.\n*/\nfunction resource(def) {\n\treturn new FrozenResourceNode(def);\n}\n/**\n* Constructs a branded, frozen Service node — declarations only (inputs,\n* params, build adapter, and the ports it exposes). Pure; carries no runtime behavior.\n*/\nfunction service(def) {\n\trequireName(def.name, \"service\");\n\trequireExtension(def.extension, \"service\");\n\trequireType(def.type, \"service\");\n\trequireConfigKeySegmentNames(Object.keys(def.inputs), \"input\", \"service\");\n\trequireConfigKeySegmentNames(Object.keys(def.params), \"param\", \"service\");\n\trequireConfigKeySegmentNames(Object.keys(def.secrets ?? {}), \"secret\", \"service\");\n\tfor (const slot of Object.keys(def.secrets ?? {})) if (Object.hasOwn(def.params, slot)) throw new Error(`service() secret slot \"${slot}\" collides with a param of the same name — a secret slot and a service param derive the same config key (COMPOSER_<addr>_${slot.toUpperCase()}); rename one.`);\n\treturn Object.freeze({\n\t\t[NODE]: true,\n\t\tkind: \"service\",\n\t\tname: def.name,\n\t\textension: def.extension,\n\t\ttype: def.type,\n\t\tinputs: frozenShallowCopy(def.inputs),\n\t\tparams: freezeParams(def.params),\n\t\tsecretSlots: freezeSecrets(def.secrets ?? blindCast({})),\n\t\tbuild: Object.freeze({ ...def.build }),\n\t\texpose: def.expose !== void 0 ? frozenShallowCopy(def.expose) : void 0\n\t});\n}\n/**\n* Constructs a branded, frozen DependencyEnd. `required` (if given) is the\n* contract Load compares a wired ref against via `satisfies()`; an unnamed\n* end's diagnostic `name` falls back to its `type`.\n*/\nfunction dependency(def) {\n\trequireType(def.type, \"dependency\");\n\trequireConfigKeySegmentNames(Object.keys(def.connection.params), \"param\", \"dependency\");\n\tconst connection = Object.freeze({\n\t\tparams: freezeParams(def.connection.params),\n\t\thydrate: def.connection.hydrate\n\t});\n\treturn Object.freeze({\n\t\t[NODE]: true,\n\t\tkind: \"dependency\",\n\t\tname: def.name !== void 0 && def.name.length > 0 ? def.name : def.type,\n\t\ttype: def.type,\n\t\tconnection,\n\t\trequired: def.required\n\t});\n}\n/**\n* Constructs a branded, frozen Module node. Construction is INERT — the body is\n* wiring, not user code, and runs only when the module is Loaded.\n*/\nfunction module(name, boundaryOrBody, maybeBody) {\n\trequireName(name, \"module\");\n\tconst closedRoot = typeof boundaryOrBody === \"function\";\n\tconst boundary = closedRoot ? {} : boundaryOrBody;\n\tconst deps = frozenShallowCopy(boundary.deps ?? {});\n\tconst secretSlots = frozenShallowCopy(boundary.secrets ?? {});\n\tconst paramSlots = frozenShallowCopy(boundary.params ?? {});\n\tconst expose = frozenShallowCopy(boundary.expose ?? {});\n\tconst body = closedRoot ? (ctx) => {\n\t\tboundaryOrBody(ctx);\n\t\treturn {};\n\t} : maybeBody;\n\treturn Object.freeze({\n\t\t[NODE]: true,\n\t\tkind: \"module\",\n\t\tname,\n\t\tdeps,\n\t\tsecretSlots,\n\t\tparamSlots,\n\t\texpose,\n\t\tbody\n\t});\n}\n/**\n* True if `value` was constructed by this module's factories. Checks the\n* brand only, never a prototype — a graph may mix nodes from a different\n* installed copy of core (dual-package hazard).\n*/\nfunction isNode(value) {\n\treturn typeof value === \"object\" && value !== null && value[NODE] === true;\n}\n//#endregion\n//#region src/toposort.ts\n/**\n* Stable topological sort: every edge's `from` precedes its `to` in the\n* result. Ties (nodes with no ordering constraint between them) keep their\n* relative order from `nodes` — so a graph already authored producer-first\n* comes out byte-identical to its pre-sort layout; only a graph that\n* genuinely needs reordering (e.g. a module wired via a forged ref pointing at a\n* not-yet-provisioned producer) actually moves. A Kahn's-algorithm variant\n* that always picks the ready node with the smallest original index. Edges\n* whose endpoint falls outside `nodes` (e.g. a service-root's input edges\n* targeting the root, which is appended separately) are ignored. Cycles\n* cannot reach here: `assertDependencyDag` already rejects them for\n* dependency edges, and input edges never cycle.\n*/\nfunction topoSort(nodes, edges) {\n\tconst byId = new Map(nodes.map((n) => [n.id, n]));\n\tconst indexOf = new Map(nodes.map((n, i) => [n.id, i]));\n\tconst indegree = new Map(nodes.map((n) => [n.id, 0]));\n\tconst successors = /* @__PURE__ */ new Map();\n\tfor (const edge of edges) {\n\t\tif (!byId.has(edge.from) || !byId.has(edge.to)) continue;\n\t\tconst targets = successors.get(edge.from) ?? [];\n\t\ttargets.push(edge.to);\n\t\tsuccessors.set(edge.from, targets);\n\t\tindegree.set(edge.to, (indegree.get(edge.to) ?? 0) + 1);\n\t}\n\tconst ready = new Set(nodes.filter((n) => indegree.get(n.id) === 0).map((n) => n.id));\n\tconst order = [];\n\twhile (ready.size > 0) {\n\t\tlet next;\n\t\tlet bestIndex = Number.POSITIVE_INFINITY;\n\t\tfor (const id of ready) {\n\t\t\tconst index = indexOf.get(id) ?? Number.POSITIVE_INFINITY;\n\t\t\tif (index < bestIndex) {\n\t\t\t\tbestIndex = index;\n\t\t\t\tnext = id;\n\t\t\t}\n\t\t}\n\t\tif (next === void 0) break;\n\t\tready.delete(next);\n\t\torder.push(next);\n\t\tfor (const target of successors.get(next) ?? []) {\n\t\t\tconst remaining = (indegree.get(target) ?? 0) - 1;\n\t\t\tindegree.set(target, remaining);\n\t\t\tif (remaining === 0) ready.add(target);\n\t\t}\n\t}\n\tif (order.length !== nodes.length) throw new LoadError(`topological sort processed ${order.length} of ${nodes.length} nodes — the graph contains a cycle that slipped past the DAG validation.`);\n\treturn order.map((id) => byId.get(id)).filter((n) => n !== void 0);\n}\n//#endregion\n//#region src/load-service.ts\nfunction serviceInputs(service, serviceId) {\n\tif (typeof service.inputs !== \"object\" || service.inputs === null) throw new LoadError(`Service \"${serviceId}\" has no inputs map.`);\n\tconst nodes = [];\n\tconst edges = [];\n\tfor (const [input, value] of Object.entries(service.inputs)) {\n\t\tconst kind = isNode(value) ? value.kind : void 0;\n\t\tif (kind === \"resource\") throw new LoadError(`Input \"${input}\" of \"${serviceId}\" is a resource node — a resource is provisioned by the composing module, never created for a service that mentions it. Declare the input as a dependency (the pack's dependency factory) and wire the module-provisioned resource's ref into it.`);\n\t\tif (kind !== \"dependency\") throw new LoadError(`Input \"${input}\" of \"${serviceId}\" is not a branded dependency end (construct it with the dependency() factory).`);\n\t\tif (value.type.length === 0) throw new LoadError(`Input \"${input}\" of \"${serviceId}\" has an empty node type.`);\n\t\tconst id = `${serviceId}.${input}`;\n\t\tnodes.push({\n\t\t\tid,\n\t\t\tnode: value\n\t\t});\n\t\tedges.push({\n\t\t\tfrom: id,\n\t\t\tto: serviceId,\n\t\t\tinput,\n\t\t\tkind: \"input\"\n\t\t});\n\t}\n\treturn {\n\t\tnodes,\n\t\tedges\n\t};\n}\nfunction loadService(root, rootId) {\n\tfor (const [input, value] of Object.entries(root.inputs)) if (isNode(value) && value.kind === \"dependency\") throw new LoadError(`Service \"${rootId}\" has an unwired dependency input \"${input}\" — this service is composed by a module; deploy the module instead of loading \"${rootId}\" directly.`);\n\tconst secretSlots = Object.keys(root.secretSlots);\n\tif (secretSlots.length > 0) {\n\t\tconst names = secretSlots.map((k) => `\"${k}\"`).join(\", \");\n\t\tthrow new LoadError(`Service \"${rootId}\" declares secret slot${secretSlots.length > 1 ? \"s\" : \"\"} ${names} but is being loaded directly — a lone service has no enclosing scope to bind them. Compose it inside a module that binds each with envSecret('NAME').`);\n\t}\n\tconst rootGraphNode = {\n\t\tid: rootId,\n\t\tnode: root\n\t};\n\tconst { nodes, edges } = serviceInputs(root, rootId);\n\treturn {\n\t\troot: rootGraphNode,\n\t\tnodes: [...topoSort(nodes, edges), rootGraphNode],\n\t\tedges,\n\t\tsecrets: [],\n\t\tparams: []\n\t};\n}\n//#endregion\n//#region src/load-module.ts\n/**\n* Builds the ref a provision() call hands back: the id (so a producer with no\n* exposed ports — or an untyped slot — can still be wired wholesale) plus one\n* ref-port per exposed contract, each the contract's own runtime value (so\n* its `satisfies()` still works) tagged with the provider's id.\n*/\nfunction refFor(id, service) {\n\tconst ports = {};\n\tfor (const [port, contract] of Object.entries(service.expose ?? {})) ports[port] = {\n\t\t...contract,\n\t\t__providerId: id\n\t};\n\treturn blindCast({\n\t\tid,\n\t\t...ports\n\t});\n}\n/**\n* The resource variant of refFor: a resource has exactly one port — the\n* contract it provides — flattened onto the ref itself, tagged with the\n* provider id. `id` is written last so a hostile contract value cannot\n* clobber it.\n*/\nfunction refForResource(id, resource) {\n\treturn blindCast({\n\t\t...resource.provides,\n\t\t__providerId: id,\n\t\tid\n\t});\n}\n/** A wired value's producer id: a ref-port's `__providerId`, or a bare ref's `id`. */\nfunction producerIdOf(ref) {\n\tif (typeof ref !== \"object\" || ref === null) return void 0;\n\tif (\"__providerId\" in ref && typeof ref.__providerId === \"string\") return ref.__providerId;\n\tif (\"id\" in ref && typeof ref.id === \"string\") return ref.id;\n}\n/**\n* Brands each `ctx.inputs` entry with the input key it stands for (see\n* flatten): diagnostic only — usage attribution relies on the per-key object\n* identity the branding copy creates, never on reading this back.\n*/\nconst MODULE_INPUT_KEY = Symbol(\"prisma:module-input-key\");\n/** Same per-key identity trick as MODULE_INPUT_KEY, for the parallel `ctx.secrets` forwarding channel. */\nconst MODULE_SECRET_KEY = Symbol(\"prisma:module-secret-key\");\n/** Same per-key identity trick as MODULE_INPUT_KEY, for the parallel `ctx.params` forwarding channel. */\nconst MODULE_PARAM_KEY = Symbol(\"prisma:module-param-key\");\n/** Whether `ref` carries a callable `satisfies` that accepts `required` truthily. */\nfunction satisfiesRequired(ref, required) {\n\treturn typeof ref === \"object\" && ref !== null && \"satisfies\" in ref && typeof ref.satisfies === \"function\" && ref.satisfies(required);\n}\n/**\n* Checks one recorded `wiring` object against the Deps it was wired against:\n* every named input exists and is a dependency slot, every referenced\n* producer is a real (by-now-provisioned) address, and a wired ref whose\n* slot declares a required contract must satisfy() it — no producer-kind\n* branching, the contract alone determines validity, whether the producer is\n* a service port or a resource. Shared by both provisioned kinds so a\n* module-as-child gets exactly the checks a service gets, and run once per\n* entry against the one `byId` shared by the whole recursive flatten, so a\n* forwarded ref resolves through to its real producer address regardless of\n* which ancestor scope provisioned it.\n*/\nfunction validateWiring(pending, byId) {\n\tconst { deps, wiring, targetId, targetKind, enclosingModuleName } = pending;\n\tfor (const [input, ref] of Object.entries(wiring)) {\n\t\tconst declared = blindCast(deps[input]);\n\t\tif (declared === void 0 || !isNode(declared) || declared.kind !== \"dependency\") throw new LoadError(`The deps for \"${targetId}\" name \"${input}\", which is not a dependency slot of that ${targetKind}.`);\n\t\tconst producerId = producerIdOf(ref);\n\t\tconst producer = producerId !== void 0 ? byId.get(producerId) : void 0;\n\t\tif (producerId === void 0 || producer === void 0) throw new LoadError(`The deps for \"${targetId}.${input}\" reference \"${String(producerId)}\", which is not provisioned in module \"${enclosingModuleName}\".`);\n\t\tconst required = declared.required;\n\t\tif (required !== void 0 && !satisfiesRequired(ref, required)) throw new LoadError(`The deps for \"${targetId}.${input}\" do not satisfy the slot's required contract.`);\n\t}\n\tfor (const [input, rawValue] of Object.entries(deps)) {\n\t\tconst value = blindCast(rawValue);\n\t\tif (!isNode(value) || wiring[input] !== void 0) continue;\n\t\tif (value.kind === \"dependency\") throw new LoadError(`Dependency input \"${input}\" of provisioned ${targetKind} \"${targetId}\" is not wired to a producer (module \"${enclosingModuleName}\").`);\n\t}\n}\n/** The (unvalidated) edges a `wiring` object implies — one dependency edge per entry; `validateWiring` does the real checking. */\nfunction wiringEdges(wiring, targetId) {\n\treturn Object.entries(wiring).map(([input, ref]) => ({\n\t\tfrom: producerIdOf(ref) ?? \"\",\n\t\tto: targetId,\n\t\tinput,\n\t\tkind: \"dependency\"\n\t}));\n}\n/**\n* Checks the secrets wired into one provisioned child: every declared slot is\n* bound to a real secret source (an `envSecret` or a forwarded ctx.secrets\n* ref), and no wired key names a slot the child doesn't declare — the secret\n* analog of `validateWiring`'s per-input checks, but resolved inline (a source\n* carries its own name, so no whole-graph pass is needed).\n*/\nfunction validateSecretBinding(child, id, secretWiring, enclosingModuleName) {\n\tconst { kind } = child;\n\tfor (const slot of Object.keys(child.secretSlots)) {\n\t\tconst bound = secretWiring[slot];\n\t\tif (bound === void 0) throw new LoadError(`Secret slot \"${slot}\" of provisioned ${kind} \"${id}\" is not bound (module \"${enclosingModuleName}\") — bind it with envSecret('NAME') or forward ctx.secrets.`);\n\t\tif (!isSecretSource(bound)) throw new LoadError(`Secret slot \"${slot}\" of \"${id}\" (module \"${enclosingModuleName}\") was wired with a non-secret value — use envSecret('NAME') or a forwarded ctx.secrets ref.`);\n\t}\n\tfor (const slot of Object.keys(secretWiring)) if (!Object.hasOwn(child.secretSlots, slot)) throw new LoadError(`The secrets for \"${id}\" name \"${slot}\", which is not a secret slot of that ${kind} (module \"${enclosingModuleName}\").`);\n}\n/**\n* Checks the params wired into a provisioned SERVICE: unlike a secret slot, a\n* declared param is never required to be bound here — it may fall back to its\n* own `default` (checked later, at `buildConfig`) — so this only rejects a\n* wired key that names something other than a real declared param.\n*/\nfunction validateServiceParamBinding(child, id, paramWiring, enclosingModuleName) {\n\tfor (const slot of Object.keys(paramWiring)) if (!Object.hasOwn(child.params, slot)) throw new LoadError(`The params for \"${id}\" name \"${slot}\", which is not a param of that service (module \"${enclosingModuleName}\").`);\n}\n/**\n* Checks the params wired into a provisioned MODULE: every declared\n* param-forwarding slot must be bound to a real `ParamSource` — a slot has no\n* schema of its own, so (unlike a service param) it cannot fall back to a\n* literal or a default; the param analog of `validateSecretBinding`.\n*/\nfunction validateParamNeedBinding(child, id, paramWiring, enclosingModuleName) {\n\tfor (const slot of Object.keys(child.paramSlots)) {\n\t\tconst bound = paramWiring[slot];\n\t\tif (bound === void 0) throw new LoadError(`Param slot \"${slot}\" of provisioned module \"${id}\" is not bound (module \"${enclosingModuleName}\") — bind it with a param source (e.g. envParam('NAME')) or forward ctx.params.`);\n\t\tif (!isParamSource(bound)) throw new LoadError(`Param slot \"${slot}\" of \"${id}\" (module \"${enclosingModuleName}\") was wired with a non-source value — a module param-forwarding slot carries no schema to validate a literal against; use envParam('NAME') or a forwarded ctx.params ref.`);\n\t}\n\tfor (const slot of Object.keys(paramWiring)) if (!Object.hasOwn(child.paramSlots, slot)) throw new LoadError(`The params for \"${id}\" name \"${slot}\", which is not a param slot of that module (module \"${enclosingModuleName}\").`);\n}\n/**\n* Recursively flattens one module's body into the shared graph state and\n* returns its resolved ModuleOutputs (one ref-port per expose key) for the\n* caller (the enclosing provision() call, or Load itself for the root) to\n* use. `address` is this module's OWN full address, or `undefined` for the root\n* scope — its direct children then get bare (unprefixed) addresses, keeping\n* a single-level module identical to before nesting existed. `wiring` supplies a\n* resolved producer ref-port for each of this module's OWN declared deps (empty\n* for the root, which may not declare any — see the root non-empty-deps\n* check in loadModule). `nodes`, `edges`, `pending`, and `byId` are shared\n* across the ENTIRE recursive flatten, not per scope — a nested module may\n* forward in a producer provisioned by an ancestor scope, and it is the\n* shared `byId` (keyed by full address) that lets that resolve.\n*/\nfunction flatten(moduleNode, address, wiring, secretWiring, paramWiring, nodes, edges, pending, secretBindings, paramBindings, byId) {\n\tconst localIds = /* @__PURE__ */ new Set();\n\tconst used = /* @__PURE__ */ new Set();\n\tconst usedSecrets = /* @__PURE__ */ new Set();\n\tconst usedParams = /* @__PURE__ */ new Set();\n\tconst ctxInputs = {};\n\tfor (const key of Object.keys(moduleNode.deps)) {\n\t\tconst wired = wiring[key];\n\t\tctxInputs[key] = typeof wired === \"object\" && wired !== null ? {\n\t\t\t...wired,\n\t\t\t[MODULE_INPUT_KEY]: key\n\t\t} : wired;\n\t}\n\tconst markUsed = (values) => {\n\t\tfor (const value of Object.values(values)) for (const key of Object.keys(ctxInputs)) if (value === ctxInputs[key]) used.add(key);\n\t};\n\tconst ctxSecrets = {};\n\tfor (const key of Object.keys(moduleNode.secretSlots)) {\n\t\tconst bound = secretWiring[key];\n\t\tctxSecrets[key] = typeof bound === \"object\" && bound !== null ? {\n\t\t\t...bound,\n\t\t\t[MODULE_SECRET_KEY]: key\n\t\t} : bound;\n\t}\n\tconst markSecretsUsed = (values) => {\n\t\tfor (const value of Object.values(values)) for (const key of Object.keys(ctxSecrets)) if (value === ctxSecrets[key]) usedSecrets.add(key);\n\t};\n\tconst ctxParams = {};\n\tfor (const key of Object.keys(moduleNode.paramSlots)) {\n\t\tconst bound = paramWiring[key];\n\t\tctxParams[key] = typeof bound === \"object\" && bound !== null ? {\n\t\t\t...bound,\n\t\t\t[MODULE_PARAM_KEY]: key\n\t\t} : bound;\n\t}\n\tconst markParamsUsed = (values) => {\n\t\tfor (const value of Object.values(values)) for (const key of Object.keys(ctxParams)) if (value === ctxParams[key]) usedParams.add(key);\n\t};\n\tconst provision = (child, opts) => {\n\t\tconst id = opts?.id ?? child.name;\n\t\tconst provisionWiring = opts?.deps;\n\t\tconst provisionSecrets = opts?.secrets;\n\t\tconst provisionParams = opts?.params;\n\t\tif (typeof id !== \"string\" || id.length === 0) throw new LoadError(`provision() requires a non-empty id (module \"${moduleNode.name}\").`);\n\t\tif (!isConfigKeySegment(id)) throw new LoadError(`provision() id \"${id}\" (module \"${moduleNode.name}\") must contain only ASCII letters and digits ([A-Za-z0-9]) — the id becomes an address segment, and addresses derive deterministic config keys (segments uppercased and joined with \"_\"). \"${id}\" would put \"${id.toUpperCase()}\" inside the derived key. (\"_\" collides with the key separator and \".\" with the address separator.)`);\n\t\tif (localIds.has(id)) throw new LoadError(`Duplicate provision id \"${id}\" in module \"${moduleNode.name}\".`);\n\t\tconst untrusted = child;\n\t\tif (!isNode(untrusted) || untrusted.kind !== \"service\" && untrusted.kind !== \"resource\" && untrusted.kind !== \"module\") throw new LoadError(`provision(\"${id}\") expects a branded service, resource, or module node (construct it with the service()/resource()/module() factories or a pack's own).`);\n\t\tlocalIds.add(id);\n\t\tconst fullAddress = address === void 0 ? id : `${address}.${id}`;\n\t\tif (child.kind === \"resource\") {\n\t\t\tif (provisionWiring !== void 0) throw new LoadError(`provision(\"${id}\") received deps for a resource — a resource has no dependency slots to satisfy.`);\n\t\t\tif (provisionSecrets !== void 0) throw new LoadError(`provision(\"${id}\") received secrets for a resource — a resource has no secret slots to satisfy.`);\n\t\t\tif (provisionParams !== void 0) throw new LoadError(`provision(\"${id}\") received params for a resource — a resource has no params to satisfy.`);\n\t\t\tif (child.type.length === 0) throw new LoadError(`provision(\"${id}\") received a resource with an empty node type.`);\n\t\t\tbyId.set(fullAddress, child);\n\t\t\tnodes.push({\n\t\t\t\tid: fullAddress,\n\t\t\t\tnode: child\n\t\t\t});\n\t\t\treturn refForResource(fullAddress, child);\n\t\t}\n\t\tconst localWiring = { ...provisionWiring ?? {} };\n\t\tmarkUsed(localWiring);\n\t\tconst localSecrets = { ...provisionSecrets ?? {} };\n\t\tmarkSecretsUsed(localSecrets);\n\t\tvalidateSecretBinding(child, id, localSecrets, moduleNode.name);\n\t\tconst localParams = { ...provisionParams ?? {} };\n\t\tmarkParamsUsed(localParams);\n\t\tif (child.kind === \"service\") {\n\t\t\tfor (const slot of Object.keys(child.secretSlots)) {\n\t\t\t\tconst bound = localSecrets[slot];\n\t\t\t\tif (isSecretSource(bound)) secretBindings.push({\n\t\t\t\t\tserviceAddress: fullAddress,\n\t\t\t\t\tslot,\n\t\t\t\t\tsource: bound\n\t\t\t\t});\n\t\t\t}\n\t\t\tvalidateServiceParamBinding(child, id, localParams, moduleNode.name);\n\t\t\tfor (const [slot, binding] of Object.entries(localParams)) paramBindings.push({\n\t\t\t\tserviceAddress: fullAddress,\n\t\t\t\tslot,\n\t\t\t\tbinding\n\t\t\t});\n\t\t\tconst inputs = serviceInputs(child, fullAddress);\n\t\t\tnodes.push(...inputs.nodes, {\n\t\t\t\tid: fullAddress,\n\t\t\t\tnode: child\n\t\t\t});\n\t\t\tedges.push(...inputs.edges, ...wiringEdges(localWiring, fullAddress));\n\t\t\tpending.push({\n\t\t\t\tdeps: child.inputs,\n\t\t\t\twiring: localWiring,\n\t\t\t\ttargetId: fullAddress,\n\t\t\t\ttargetKind: \"service\",\n\t\t\t\tenclosingModuleName: moduleNode.name\n\t\t\t});\n\t\t\tbyId.set(fullAddress, child);\n\t\t\treturn refFor(fullAddress, child);\n\t\t}\n\t\tvalidateParamNeedBinding(child, id, localParams, moduleNode.name);\n\t\tedges.push(...wiringEdges(localWiring, fullAddress));\n\t\tpending.push({\n\t\t\tdeps: child.deps,\n\t\t\twiring: localWiring,\n\t\t\ttargetId: fullAddress,\n\t\t\ttargetKind: \"module\",\n\t\t\tenclosingModuleName: moduleNode.name\n\t\t});\n\t\tconst childOutputs = flatten(child, fullAddress, localWiring, localSecrets, localParams, nodes, edges, pending, secretBindings, paramBindings, byId);\n\t\tnodes.push({\n\t\t\tid: fullAddress,\n\t\t\tnode: child\n\t\t});\n\t\tbyId.set(fullAddress, child);\n\t\treturn blindCast({\n\t\t\tid: fullAddress,\n\t\t\t...childOutputs\n\t\t});\n\t};\n\tconst ctx = blindCast({\n\t\tinputs: ctxInputs,\n\t\tsecrets: ctxSecrets,\n\t\tparams: ctxParams,\n\t\tprovision: blindCast(provision)\n\t});\n\tconst outputs = blindCast(moduleNode.body(ctx) ?? {});\n\tmarkUsed(outputs);\n\tfor (const key of Object.keys(moduleNode.deps)) if (!used.has(key)) throw new LoadError(`Module \"${moduleNode.name}\" declares input \"${key}\" but never forwards it into a provision nor returns it as an output.`);\n\tfor (const key of Object.keys(moduleNode.secretSlots)) if (!usedSecrets.has(key)) throw new LoadError(`Module \"${moduleNode.name}\" declares secret \"${key}\" but never forwards it into a provision.`);\n\tfor (const key of Object.keys(moduleNode.paramSlots)) if (!usedParams.has(key)) throw new LoadError(`Module \"${moduleNode.name}\" declares param \"${key}\" but never forwards it into a provision.`);\n\tfor (const [key, contract] of Object.entries(moduleNode.expose)) {\n\t\tconst port = outputs[key];\n\t\tif (port === void 0) throw new LoadError(`Module \"${moduleNode.name}\" declares expose \"${key}\" but its body did not return a port for it.`);\n\t\tif (!satisfiesRequired(port, contract)) throw new LoadError(`Module \"${moduleNode.name}\"'s returned port for expose \"${key}\" does not satisfy its declared contract.`);\n\t}\n\treturn outputs;\n}\nfunction loadModule(root, opts) {\n\tconst rootId = opts?.id ?? root.name;\n\tconst rootDepKeys = Object.keys(root.deps);\n\tif (rootDepKeys.length > 0) {\n\t\tconst names = rootDepKeys.map((k) => `\"${k}\"`).join(\", \");\n\t\tthrow new LoadError(`Module \"${root.name}\" declares input${rootDepKeys.length > 1 ? \"s\" : \"\"} ${names} but is being deployed as the root — a root has no enclosing scope to wire them; compose \"${root.name}\" from another module that provisions and wires it instead.`);\n\t}\n\tconst rootSecretKeys = Object.keys(root.secretSlots);\n\tif (rootSecretKeys.length > 0) {\n\t\tconst names = rootSecretKeys.map((k) => `\"${k}\"`).join(\", \");\n\t\tthrow new LoadError(`Module \"${root.name}\" declares secret${rootSecretKeys.length > 1 ? \"s\" : \"\"} ${names} but is being deployed as the root — a root has no enclosing scope to bind them; the root binds secrets with envSecret('NAME'), it does not declare secret slots of its own.`);\n\t}\n\tconst rootParamKeys = Object.keys(root.paramSlots);\n\tif (rootParamKeys.length > 0) {\n\t\tconst names = rootParamKeys.map((k) => `\"${k}\"`).join(\", \");\n\t\tthrow new LoadError(`Module \"${root.name}\" declares param${rootParamKeys.length > 1 ? \"s\" : \"\"} ${names} but is being deployed as the root — a root has no enclosing scope to bind them; the root binds params directly on each provision() call, it does not declare param-forwarding slots of its own.`);\n\t}\n\tconst nodes = [];\n\tconst edges = [];\n\tconst pending = [];\n\tconst secretBindings = [];\n\tconst paramBindings = [];\n\tconst byId = /* @__PURE__ */ new Map();\n\tflatten(root, void 0, {}, {}, {}, nodes, edges, pending, secretBindings, paramBindings, byId);\n\tfor (const entry of pending) validateWiring(entry, byId);\n\tassertDependencyDag(edges);\n\tconst rootGraphNode = {\n\t\tid: rootId,\n\t\tnode: root\n\t};\n\treturn {\n\t\troot: rootGraphNode,\n\t\tnodes: [...topoSort(nodes, edges), rootGraphNode],\n\t\tedges,\n\t\tsecrets: secretBindings,\n\t\tparams: paramBindings\n\t};\n}\n/**\n* The dependency edges must form a DAG — a cycle means neither producer can\n* deploy first. Resources take no wiring, so only service/module-to-service/module\n* edges can ever participate in a cycle; no special-casing needed.\n*/\nfunction assertDependencyDag(edges) {\n\tconst adjacency = /* @__PURE__ */ new Map();\n\tfor (const edge of edges) {\n\t\tif (edge.kind !== \"dependency\") continue;\n\t\tconst targets = adjacency.get(edge.from) ?? [];\n\t\ttargets.push(edge.to);\n\t\tadjacency.set(edge.from, targets);\n\t}\n\tconst visiting = /* @__PURE__ */ new Set();\n\tconst done = /* @__PURE__ */ new Set();\n\tconst stack = [];\n\tconst visit = (id) => {\n\t\tif (done.has(id)) return;\n\t\tif (visiting.has(id)) throw new LoadError(`Dependency cycle: ${[...stack.slice(stack.indexOf(id)), id].join(\" → \")} — no deploy order exists.`);\n\t\tvisiting.add(id);\n\t\tstack.push(id);\n\t\tfor (const next of adjacency.get(id) ?? []) visit(next);\n\t\tstack.pop();\n\t\tvisiting.delete(id);\n\t\tdone.add(id);\n\t};\n\tfor (const id of adjacency.keys()) visit(id);\n}\n//#endregion\n//#region src/graph.ts\n/**\n* Builds the in-memory graph from a root node. A service root walks its own\n* `inputs`; a module root executes its body (wiring, not user code — the\n* designed exception to imports-run-nothing) and recursively flattens every\n* module it provisions into one graph of hierarchical addresses. A malformed\n* graph is a `LoadError` that names its fix; the individual validation rules\n* live with `loadService` / `loadModule` and are covered by name in the Load\n* tests. Executes nothing of the user's own code beyond module bodies.\n*/\nfunction Load(root, opts) {\n\tif (!isNode(root)) throw new LoadError(\"Load expects a branded service or module node (construct it with the service()/module() factories).\");\n\tif (root.kind === \"module\") return loadModule(root, opts);\n\tif (root.kind === \"service\") return loadService(root, opts?.id ?? \"root\");\n\tthrow new LoadError(\"Load expects a service or module root (received another node kind).\");\n}\n//#endregion\nexport { LoadError as _, isNode as a, isSecretSource as c, paramSource as d, provisionNeed as f, service as g, secretSource as h, freezeNode as i, module as l, secret as m, ResourceNodeBase as n, isParamSource as o, resource as p, dependency as r, isProvisionNeed as s, Load as t, paramNeed as u };\n\n//# sourceMappingURL=graph-CP16cJyH.mjs.map","import { o as isParamSource, t as Load } from \"./graph-CP16cJyH.mjs\";\nimport { r as deserializeContainers } from \"./container-transport-DKmKg5JQ.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};\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 = {};\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\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* 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}\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 prisma-composer.config.ts's \\`extensions\\` (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, { id: opts.name });\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\") continue;\n\t\t\tconst slot = consumer.inputs[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\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\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 = {\n\t\t\t\tid,\n\t\t\t\taddress: id,\n\t\t\t\tnode,\n\t\t\t\tgraph,\n\t\t\t\topts,\n\t\t\t\tapplication: applications.get(node.extension),\n\t\t\t\tcontainer: containers.get(node.extension),\n\t\t\t\tlowered,\n\t\t\t\tprovisioned\n\t\t\t};\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 = yield* descriptor.provision(ctx);\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\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 { lowering as a, lower as i, buildConfig as n, mergedProviders as o, joinDeployment as r, resolveStateLayer as s, LowerError as t };\n\n//# sourceMappingURL=deploy-H3PKi0ZR.mjs.map","import { t as LowerError } from \"./deploy-H3PKi0ZR.mjs\";\nimport { r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-joXc-BKm.mjs\";\nimport * as Layer from \"effect/Layer\";\n//#region src/control/local-target.ts\n/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, \"dev\" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */\nfunction noLocalTargetSupportError(id) {\n\treturn new LowerError(`extension \"${id}\" has no dev support — it declares no \\`localTarget\\` descriptor (ADR-0041).`);\n}\n/**\n* Resolves every non-build-only configured extension's lazy `localTarget`\n* thunk, once (ADR-0041's lazy local-target reference — operator directive:\n* the production control entry carries only the thunk, never the\n* descriptor, so resolving it is this module's job, not something a deploy\n* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no\n* resources or services and is skipped entirely — never even checked for a\n* `localTarget` thunk. Every other configured extension must be\n* local-target-capable, or the dev command cannot bring the app up at all,\n* so a missing thunk throws naming the extension. The generated dev stack\n* module calls this once and threads the resolved map through every\n* subsequent hook, including `localTargetProviders`.\n*/\nasync function resolveLocalTargets(config) {\n\tconst entries = await Promise.all(config.extensions.flatMap((extension) => {\n\t\tif (isBuildOnlyExtension(extension)) return [];\n\t\tif (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);\n\t\treturn [extension.localTarget().then((descriptor) => [extension.id, descriptor])];\n\t}));\n\treturn new Map(entries);\n}\n/**\n* All configured extensions' local-target providers merged, config array\n* order (ADR-0041), from the ALREADY-RESOLVED descriptor map\n* (`resolveLocalTargets`'s product — this function itself never touches a\n* `localTarget` thunk). The generated dev stack module is this\n* aggregator's one caller, passing the result as `LowerOptions.providers`.\n*/\nfunction localTargetProviders(resolved, containers, devDir) {\n\tconst [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({\n\t\tcontainer: containers.get(id),\n\t\tdevDir\n\t}));\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n//#endregion\nexport { DEV_DIR, localTargetProviders, resolveLocalTargets };\n\n//# sourceMappingURL=local-target.mjs.map","//#region src/assemble-error.ts\n/**\n* A user-facing assembly failure with a message that already names the fix\n* (mirrors @internal/cli's CliError contract). This package must not import\n* CliError — its second consumer is the future programmatic deploy API, not\n* just the CLI — so it throws its own typed error; the CLI maps it (or lets\n* it propagate, since bin.ts already treats every Error uniformly: print the\n* message, exit nonzero).\n*/\nvar AssembleError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"AssembleError\";\n\t}\n};\n//#endregion\n//#region src/assemble-services.ts\n/**\n* The registry route for one service's build: extension by\n* `build.extension`, node descriptor by `build.type`, kind must be \"build\".\n* The CLI's coverage validation reports the same misses earlier with the\n* config fix; these errors are the backstop for programmatic callers.\n*/\nfunction buildDescriptorAssemble(config, node, address, cwd) {\n\tconst { extension, type } = node.build;\n\tconst extensionDescriptor = config.extensions.find((candidate) => candidate.id === extension);\n\tif (extensionDescriptor === void 0) throw new AssembleError(`No extension \"${extension}\" is configured (needed by service \"${node.name}\"'s build) — add it to prisma-composer.config.ts's \\`extensions\\`.`);\n\tconst nodeDescriptor = extensionDescriptor.nodes[type];\n\tif (nodeDescriptor === void 0) throw new AssembleError(`Extension \"${extension}\" has no descriptor for build type \"${type}\" (known: ${Object.keys(extensionDescriptor.nodes).join(\", \")}).`);\n\tif (nodeDescriptor.kind !== \"build\") throw new AssembleError(`Extension \"${extension}\"'s descriptor for type \"${type}\" is a \"${nodeDescriptor.kind}\" descriptor — assembling a service build needs a \"build\" descriptor.`);\n\treturn nodeDescriptor.assemble({\n\t\tbuild: node.build,\n\t\taddress,\n\t\tcwd\n\t});\n}\nasync function assembleServices(graph, config, cwd, run) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd) => buildDescriptorAssemble(config, node, address, nodeCwd));\n\tconst serviceNodes = graph.nodes.filter((n) => n.node.kind === \"service\");\n\tif (serviceNodes.length === 0) throw new AssembleError(\"The loaded graph has no service to assemble.\");\n\tconst bundles = {};\n\tfor (const { id, node } of serviceNodes) bundles[id] = await runAssembler(node, id, cwd);\n\treturn { bundles };\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","import { _ as LoadError, a as isNode, c as isSecretSource, d as paramSource, f as provisionNeed, g as service, h as secretSource, i as freezeNode, l as module, m as secret, n as ResourceNodeBase, o as isParamSource, p as resource, r as dependency, s as isProvisionNeed, t as Load, u as paramNeed } from \"./graph-CP16cJyH.mjs\";\nimport { SecretBox, SecretBox as SecretBox$1 } from \"@internal/foundation/secret\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/config.ts\n/**\n* A data-only descriptor of a param's schema for introspection — the\n* validator's vendor tag, never the schema's own `validate`. `configOf`\n* reports it where the old model reported `type: 'string' | 'number'`, so the\n* config surface stays enumerable without leaking a function. Nothing consumes\n* more than the vendor tag yet; a richer projection (e.g. a JSON-Schema export\n* when the vendor offers one) is an additive change if a consumer needs it.\n*/\nfunction projectSchema(schema) {\n\treturn { vendor: schema[\"~standard\"].vendor };\n}\n/**\n* Enumerates every config param the service declares: each input's connection\n* params, then the service's own params. Pure — reads `root.inputs`/`params`\n* directly, executes nothing but the (also pure) schema projection. Deliberately\n* does not go through `Load`: a service's connection-end inputs are legitimately\n* unwired from its own point of view (wiring is an enclosing module's concern),\n* and this introspects one service's declared shape regardless of how — or\n* whether — it composes into a larger graph.\n*/\nfunction configOf(root) {\n\tconst entries = [];\n\tfor (const [input, value] of Object.entries(root.inputs)) {\n\t\tif (typeof value !== \"object\" || value === null) continue;\n\t\tfor (const [name, param] of Object.entries(value.connection.params)) entries.push({\n\t\t\towner: { input },\n\t\t\tname,\n\t\t\tschema: projectSchema(param.schema),\n\t\t\toptional: param.optional === true,\n\t\t\tdefault: param.default\n\t\t});\n\t}\n\tfor (const [name, param] of Object.entries(root.params)) entries.push({\n\t\towner: \"service\",\n\t\tname,\n\t\tschema: projectSchema(param.schema),\n\t\toptional: param.optional === true,\n\t\tdefault: param.default\n\t});\n\treturn entries;\n}\n/**\n* The app's provision manifest: every secret binding the root resolved across\n* the graph (ADR-0029) — an opaque, target-defined source per service secret\n* slot; a deploy target's preflight reads its own payload. Pure graph\n* introspection, TARGET-AGNOSTIC — the target consumes it to verify each secret\n* exists on the platform before deploy. The values are provisioned out-of-band.\n*/\nfunction provisionManifest(graph) {\n\treturn graph.secrets;\n}\n/**\n* The app's param-binding manifest: every param a `provision()` call bound —\n* literal or an opaque, target-defined `ParamSource` — at the address that\n* declared it. The param sibling of `provisionManifest`, for a deploy\n* target's own preflight to consume (D2). Pure graph introspection,\n* TARGET-AGNOSTIC; a param this manifest omits simply falls back to its own\n* `default` at `buildConfig`.\n*/\nfunction paramManifest(graph) {\n\treturn graph.params;\n}\nfunction scalarSchema(name, check) {\n\treturn { \"~standard\": {\n\t\tversion: 1,\n\t\tvendor: \"@prisma/composer\",\n\t\tvalidate: (value) => check(value) ? { value } : { issues: [{ message: `expected ${name}, got ${typeof value}` }] }\n\t} };\n}\nconst stringSchema = scalarSchema(\"string\", (v) => typeof v === \"string\");\nconst numberSchema = scalarSchema(\"number\", (v) => typeof v === \"number\" && Number.isFinite(v));\nfunction withFacets(schema, opts) {\n\treturn {\n\t\tschema,\n\t\t...opts.optional !== void 0 ? { optional: opts.optional } : {},\n\t\t...opts.default !== void 0 ? { default: opts.default } : {},\n\t\t...opts.provision !== void 0 ? { provision: opts.provision } : {}\n\t};\n}\n/** A string-valued param. */\nfunction string(opts = {}) {\n\treturn withFacets(stringSchema, opts);\n}\n/** A number-valued param. */\nfunction number(opts = {}) {\n\treturn withFacets(numberSchema, opts);\n}\n/** A param over any caller-supplied Standard Schema — a structured `jobs`, say. */\nfunction param(schema, opts = {}) {\n\treturn withFacets(schema, opts);\n}\n//#endregion\n//#region src/hydrate.ts\n/**\n* The boot-side half of the runtime split (see core-model.md § Runtime:\n* booting a service). Core's job at boot is structural only: turn a\n* concrete, typed Config into hydrated deps by calling each input's\n* connection.hydrate with its value slice. No environment read, no\n* validation, no strings — the pack's `load()` already read the process-local\n* stash into a typed Config before calling this.\n*/\n/**\n* Given a service and a concrete typed Config, hydrate every input\n* (connection.hydrate with its typed value slice). A resource dep and a\n* connection dep hydrate through identical machinery — the loaded client is\n* indistinguishable. The service's own params ride alongside in\n* `config.service`; the node's `load()` merges the two.\n*/\nasync function hydrate(root, config) {\n\tconst deps = {};\n\tfor (const [name, inputNode] of Object.entries(root.inputs)) {\n\t\tconst values = config.inputs[name] ?? {};\n\t\tdeps[name] = await inputNode.connection.hydrate(values);\n\t}\n\treturn deps;\n}\n/**\n* Synchronous hydrate — what the node's `load()` uses so\n* `const { db } = service.load()` reads without `await`. Requires every\n* connection.hydrate to return synchronously; a Promise return is a loud error\n* naming the input (an async client factory must use the async `hydrate` path).\n*/\nfunction hydrateSync(root, config) {\n\tconst deps = {};\n\tfor (const [name, inputNode] of Object.entries(root.inputs)) {\n\t\tconst values = config.inputs[name] ?? {};\n\t\tconst client = inputNode.connection.hydrate(values);\n\t\tif (client instanceof Promise) throw new Error(`Connection hydrate for input \"${name}\" returned a Promise; load() requires a synchronous client factory.`);\n\t\tdeps[name] = client;\n\t}\n\treturn deps;\n}\n/**\n* Wraps each of a service's resolved secret values in a redacting `SecretBox`\n* — what the node's `secrets()` accessor returns (ADR-0021, sibling to\n* `load()`/`config()`). The RESOLUTION of a secret's value (the boot\n* double-lookup that reads the platform var the pointer names) is the target\n* pack's job; core is handed the already-resolved strings and only boxes them,\n* so a secret is redacted by TYPE from here on. A declared slot missing from\n* `values` is a target contract violation, named loudly.\n*/\nfunction hydrateSecrets(root, values) {\n\tconst boxed = {};\n\tfor (const slot of Object.keys(root.secretSlots)) {\n\t\tconst value = values[slot];\n\t\tif (value === void 0) throw new Error(`secret slot \"${slot}\" has no resolved value — the target must resolve every declared secret before hydrateSecrets().`);\n\t\tboxed[slot] = new SecretBox$1(value);\n\t}\n\treturn blindCast(boxed);\n}\n//#endregion\nexport { Load, LoadError, ResourceNodeBase, SecretBox, configOf, dependency, freezeNode, hydrate, hydrateSecrets, hydrateSync, isNode, isParamSource, isProvisionNeed, isSecretSource, module, number, param, paramManifest, paramNeed, paramSource, provisionManifest, provisionNeed, resource, secret, secretSource, service, string };\n\n//# sourceMappingURL=index.mjs.map","import { stat, lstat, readdir, realpath } from 'node:fs/promises';\nimport { Readable } from 'node:stream';\nimport { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from 'node:path';\nexport const EntryTypes = {\n FILE_TYPE: 'files',\n DIR_TYPE: 'directories',\n FILE_DIR_TYPE: 'files_directories',\n EVERYTHING_TYPE: 'all',\n};\nconst defaultOptions = {\n root: '.',\n fileFilter: (_entryInfo) => true,\n directoryFilter: (_entryInfo) => true,\n type: EntryTypes.FILE_TYPE,\n lstat: false,\n depth: 2147483648,\n alwaysStat: false,\n highWaterMark: 4096,\n};\nObject.freeze(defaultOptions);\nconst RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';\nconst NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]);\nconst ALL_TYPES = [\n EntryTypes.DIR_TYPE,\n EntryTypes.EVERYTHING_TYPE,\n EntryTypes.FILE_DIR_TYPE,\n EntryTypes.FILE_TYPE,\n];\nconst DIR_TYPES = new Set([\n EntryTypes.DIR_TYPE,\n EntryTypes.EVERYTHING_TYPE,\n EntryTypes.FILE_DIR_TYPE,\n]);\nconst FILE_TYPES = new Set([\n EntryTypes.EVERYTHING_TYPE,\n EntryTypes.FILE_DIR_TYPE,\n EntryTypes.FILE_TYPE,\n]);\nconst isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);\nconst wantBigintFsStats = process.platform === 'win32';\nconst emptyFn = (_entryInfo) => true;\nconst normalizeFilter = (filter) => {\n if (filter === undefined)\n return emptyFn;\n if (typeof filter === 'function')\n return filter;\n if (typeof filter === 'string') {\n const fl = filter.trim();\n return (entry) => entry.basename === fl;\n }\n if (Array.isArray(filter)) {\n const trItems = filter.map((item) => item.trim());\n return (entry) => trItems.some((f) => entry.basename === f);\n }\n return emptyFn;\n};\n/** Readable readdir stream, emitting new files as they're being listed. */\nexport class ReaddirpStream extends Readable {\n constructor(options = {}) {\n super({\n objectMode: true,\n autoDestroy: true,\n highWaterMark: options.highWaterMark,\n });\n const opts = { ...defaultOptions, ...options };\n const { root, type } = opts;\n this._fileFilter = normalizeFilter(opts.fileFilter);\n this._directoryFilter = normalizeFilter(opts.directoryFilter);\n const statMethod = opts.lstat ? lstat : stat;\n // Use bigint stats if it's windows and stat() supports options (node 10+).\n if (wantBigintFsStats) {\n this._stat = (path) => statMethod(path, { bigint: true });\n }\n else {\n this._stat = statMethod;\n }\n this._maxDepth = opts.depth ?? defaultOptions.depth;\n this._wantsDir = type ? DIR_TYPES.has(type) : false;\n this._wantsFile = type ? FILE_TYPES.has(type) : false;\n this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;\n this._root = presolve(root);\n this._isDirent = !opts.alwaysStat;\n this._statsProp = this._isDirent ? 'dirent' : 'stats';\n this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };\n // Launch stream with one parent, the root dir.\n this.parents = [this._exploreDir(root, 1)];\n this.reading = false;\n this.parent = undefined;\n }\n async _read(batch) {\n if (this.reading)\n return;\n this.reading = true;\n try {\n while (!this.destroyed && batch > 0) {\n const par = this.parent;\n const fil = par && par.files;\n if (fil && fil.length > 0) {\n const { path, depth } = par;\n const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));\n const awaited = await Promise.all(slice);\n for (const entry of awaited) {\n if (!entry)\n continue;\n if (this.destroyed)\n return;\n const entryType = await this._getEntryType(entry);\n if (entryType === 'directory' && this._directoryFilter(entry)) {\n if (depth <= this._maxDepth) {\n this.parents.push(this._exploreDir(entry.fullPath, depth + 1));\n }\n if (this._wantsDir) {\n this.push(entry);\n batch--;\n }\n }\n else if ((entryType === 'file' || this._includeAsFile(entry)) &&\n this._fileFilter(entry)) {\n if (this._wantsFile) {\n this.push(entry);\n batch--;\n }\n }\n }\n }\n else {\n const parent = this.parents.pop();\n if (!parent) {\n this.push(null);\n break;\n }\n this.parent = await parent;\n if (this.destroyed)\n return;\n }\n }\n }\n catch (error) {\n this.destroy(error);\n }\n finally {\n this.reading = false;\n }\n }\n async _exploreDir(path, depth) {\n let files;\n try {\n files = await readdir(path, this._rdOptions);\n }\n catch (error) {\n this._onError(error);\n }\n return { files, depth, path };\n }\n async _formatEntry(dirent, path) {\n let entry;\n const basename = this._isDirent ? dirent.name : dirent;\n try {\n const fullPath = presolve(pjoin(path, basename));\n entry = { path: prelative(this._root, fullPath), fullPath, basename };\n entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);\n }\n catch (err) {\n this._onError(err);\n return;\n }\n return entry;\n }\n _onError(err) {\n if (isNormalFlowError(err) && !this.destroyed) {\n this.emit('warn', err);\n }\n else {\n this.destroy(err);\n }\n }\n async _getEntryType(entry) {\n // entry may be undefined, because a warning or an error were emitted\n // and the statsProp is undefined\n if (!entry && this._statsProp in entry) {\n return '';\n }\n const stats = entry[this._statsProp];\n if (stats.isFile())\n return 'file';\n if (stats.isDirectory())\n return 'directory';\n if (stats && stats.isSymbolicLink()) {\n const full = entry.fullPath;\n try {\n const entryRealPath = await realpath(full);\n const entryRealPathStats = await lstat(entryRealPath);\n if (entryRealPathStats.isFile()) {\n return 'file';\n }\n if (entryRealPathStats.isDirectory()) {\n const len = entryRealPath.length;\n if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {\n const recursiveError = new Error(`Circular symlink detected: \"${full}\" points to \"${entryRealPath}\"`);\n // @ts-ignore\n recursiveError.code = RECURSIVE_ERROR_CODE;\n return this._onError(recursiveError);\n }\n return 'directory';\n }\n }\n catch (error) {\n this._onError(error);\n return '';\n }\n }\n }\n _includeAsFile(entry) {\n const stats = entry && entry[this._statsProp];\n return stats && this._wantsEverything && !stats.isDirectory();\n }\n}\n/**\n * Streaming version: Reads all files and directories in given root recursively.\n * Consumes ~constant small amount of RAM.\n * @param root Root directory\n * @param options Options to specify root (start directory), filters and recursion depth\n */\nexport function readdirp(root, options = {}) {\n // @ts-ignore\n let type = options.entryType || options.type;\n if (type === 'both')\n type = EntryTypes.FILE_DIR_TYPE; // backwards-compatibility\n if (type)\n options.type = type;\n if (!root) {\n throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');\n }\n else if (typeof root !== 'string') {\n throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');\n }\n else if (type && !ALL_TYPES.includes(type)) {\n throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);\n }\n options.root = root;\n return new ReaddirpStream(options);\n}\n/**\n * Promise version: Reads all files and directories in given root recursively.\n * Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed.\n * @returns array of paths and their entry infos\n */\nexport function readdirpPromise(root, options = {}) {\n return new Promise((resolve, reject) => {\n const files = [];\n readdirp(root, options)\n .on('data', (entry) => files.push(entry))\n .on('end', () => resolve(files))\n .on('error', (error) => reject(error));\n });\n}\nexport default readdirp;\n","import { watchFile, unwatchFile, watch as fs_watch } from 'fs';\nimport { open, stat, lstat, realpath as fsrealpath } from 'fs/promises';\nimport * as sysPath from 'path';\nimport { type as osType } from 'os';\nexport const STR_DATA = 'data';\nexport const STR_END = 'end';\nexport const STR_CLOSE = 'close';\nexport const EMPTY_FN = () => { };\nexport const IDENTITY_FN = (val) => val;\nconst pl = process.platform;\nexport const isWindows = pl === 'win32';\nexport const isMacos = pl === 'darwin';\nexport const isLinux = pl === 'linux';\nexport const isFreeBSD = pl === 'freebsd';\nexport const isIBMi = osType() === 'OS400';\nexport const EVENTS = {\n ALL: 'all',\n READY: 'ready',\n ADD: 'add',\n CHANGE: 'change',\n ADD_DIR: 'addDir',\n UNLINK: 'unlink',\n UNLINK_DIR: 'unlinkDir',\n RAW: 'raw',\n ERROR: 'error',\n};\nconst EV = EVENTS;\nconst THROTTLE_MODE_WATCH = 'watch';\nconst statMethods = { lstat, stat };\nconst KEY_LISTENERS = 'listeners';\nconst KEY_ERR = 'errHandlers';\nconst KEY_RAW = 'rawEmitters';\nconst HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW];\n// prettier-ignore\nconst binaryExtensions = new Set([\n '3dm', '3ds', '3g2', '3gp', '7z', 'a', 'aac', 'adp', 'afdesign', 'afphoto', 'afpub', 'ai',\n 'aif', 'aiff', 'alz', 'ape', 'apk', 'appimage', 'ar', 'arj', 'asf', 'au', 'avi',\n 'bak', 'baml', 'bh', 'bin', 'bk', 'bmp', 'btif', 'bz2', 'bzip2',\n 'cab', 'caf', 'cgm', 'class', 'cmx', 'cpio', 'cr2', 'cur', 'dat', 'dcm', 'deb', 'dex', 'djvu',\n 'dll', 'dmg', 'dng', 'doc', 'docm', 'docx', 'dot', 'dotm', 'dra', 'DS_Store', 'dsk', 'dts',\n 'dtshd', 'dvb', 'dwg', 'dxf',\n 'ecelp4800', 'ecelp7470', 'ecelp9600', 'egg', 'eol', 'eot', 'epub', 'exe',\n 'f4v', 'fbs', 'fh', 'fla', 'flac', 'flatpak', 'fli', 'flv', 'fpx', 'fst', 'fvt',\n 'g3', 'gh', 'gif', 'graffle', 'gz', 'gzip',\n 'h261', 'h263', 'h264', 'icns', 'ico', 'ief', 'img', 'ipa', 'iso',\n 'jar', 'jpeg', 'jpg', 'jpgv', 'jpm', 'jxr', 'key', 'ktx',\n 'lha', 'lib', 'lvp', 'lz', 'lzh', 'lzma', 'lzo',\n 'm3u', 'm4a', 'm4v', 'mar', 'mdi', 'mht', 'mid', 'midi', 'mj2', 'mka', 'mkv', 'mmr', 'mng',\n 'mobi', 'mov', 'movie', 'mp3',\n 'mp4', 'mp4a', 'mpeg', 'mpg', 'mpga', 'mxu',\n 'nef', 'npx', 'numbers', 'nupkg',\n 'o', 'odp', 'ods', 'odt', 'oga', 'ogg', 'ogv', 'otf', 'ott',\n 'pages', 'pbm', 'pcx', 'pdb', 'pdf', 'pea', 'pgm', 'pic', 'png', 'pnm', 'pot', 'potm',\n 'potx', 'ppa', 'ppam',\n 'ppm', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx', 'psd', 'pya', 'pyc', 'pyo', 'pyv',\n 'qt',\n 'rar', 'ras', 'raw', 'resources', 'rgb', 'rip', 'rlc', 'rmf', 'rmvb', 'rpm', 'rtf', 'rz',\n 's3m', 's7z', 'scpt', 'sgi', 'shar', 'snap', 'sil', 'sketch', 'slk', 'smv', 'snk', 'so',\n 'stl', 'suo', 'sub', 'swf',\n 'tar', 'tbz', 'tbz2', 'tga', 'tgz', 'thmx', 'tif', 'tiff', 'tlz', 'ttc', 'ttf', 'txz',\n 'udf', 'uvh', 'uvi', 'uvm', 'uvp', 'uvs', 'uvu',\n 'viv', 'vob',\n 'war', 'wav', 'wax', 'wbmp', 'wdp', 'weba', 'webm', 'webp', 'whl', 'wim', 'wm', 'wma',\n 'wmv', 'wmx', 'woff', 'woff2', 'wrm', 'wvx',\n 'xbm', 'xif', 'xla', 'xlam', 'xls', 'xlsb', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx', 'xm',\n 'xmind', 'xpi', 'xpm', 'xwd', 'xz',\n 'z', 'zip', 'zipx',\n]);\nconst isBinaryPath = (filePath) => binaryExtensions.has(sysPath.extname(filePath).slice(1).toLowerCase());\n// TODO: emit errors properly. Example: EMFILE on Macos.\nconst foreach = (val, fn) => {\n if (val instanceof Set) {\n val.forEach(fn);\n }\n else {\n fn(val);\n }\n};\nconst addAndConvert = (main, prop, item) => {\n let container = main[prop];\n if (!(container instanceof Set)) {\n main[prop] = container = new Set([container]);\n }\n container.add(item);\n};\nconst clearItem = (cont) => (key) => {\n const set = cont[key];\n if (set instanceof Set) {\n set.clear();\n }\n else {\n delete cont[key];\n }\n};\nconst delFromSet = (main, prop, item) => {\n const container = main[prop];\n if (container instanceof Set) {\n container.delete(item);\n }\n else if (container === item) {\n delete main[prop];\n }\n};\nconst isEmptySet = (val) => (val instanceof Set ? val.size === 0 : !val);\nconst FsWatchInstances = new Map();\n/**\n * Instantiates the fs_watch interface\n * @param path to be watched\n * @param options to be passed to fs_watch\n * @param listener main event handler\n * @param errHandler emits info about errors\n * @param emitRaw emits raw event data\n * @returns {NativeFsWatcher}\n */\nfunction createFsWatchInstance(path, options, listener, errHandler, emitRaw) {\n const handleEvent = (rawEvent, evPath) => {\n listener(path);\n emitRaw(rawEvent, evPath, { watchedPath: path });\n // emit based on events occurring for files from a directory's watcher in\n // case the file's watcher misses it (and rely on throttling to de-dupe)\n if (evPath && path !== evPath) {\n fsWatchBroadcast(sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath));\n }\n };\n try {\n return fs_watch(path, {\n persistent: options.persistent,\n }, handleEvent);\n }\n catch (error) {\n errHandler(error);\n return undefined;\n }\n}\n/**\n * Helper for passing fs_watch event data to a collection of listeners\n * @param fullPath absolute path bound to fs_watch instance\n */\nconst fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {\n const cont = FsWatchInstances.get(fullPath);\n if (!cont)\n return;\n foreach(cont[listenerType], (listener) => {\n listener(val1, val2, val3);\n });\n};\n/**\n * Instantiates the fs_watch interface or binds listeners\n * to an existing one covering the same file system entry\n * @param path\n * @param fullPath absolute path\n * @param options to be passed to fs_watch\n * @param handlers container for event listener functions\n */\nconst setFsWatchListener = (path, fullPath, options, handlers) => {\n const { listener, errHandler, rawEmitter } = handlers;\n let cont = FsWatchInstances.get(fullPath);\n let watcher;\n if (!options.persistent) {\n watcher = createFsWatchInstance(path, options, listener, errHandler, rawEmitter);\n if (!watcher)\n return;\n return watcher.close.bind(watcher);\n }\n if (cont) {\n addAndConvert(cont, KEY_LISTENERS, listener);\n addAndConvert(cont, KEY_ERR, errHandler);\n addAndConvert(cont, KEY_RAW, rawEmitter);\n }\n else {\n watcher = createFsWatchInstance(path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, // no need to use broadcast here\n fsWatchBroadcast.bind(null, fullPath, KEY_RAW));\n if (!watcher)\n return;\n watcher.on(EV.ERROR, async (error) => {\n const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);\n if (cont)\n cont.watcherUnusable = true; // documented since Node 10.4.1\n // Workaround for https://github.com/joyent/node/issues/4337\n if (isWindows && error.code === 'EPERM') {\n try {\n const fd = await open(path, 'r');\n await fd.close();\n broadcastErr(error);\n }\n catch (err) {\n // do nothing\n }\n }\n else {\n broadcastErr(error);\n }\n });\n cont = {\n listeners: listener,\n errHandlers: errHandler,\n rawEmitters: rawEmitter,\n watcher,\n };\n FsWatchInstances.set(fullPath, cont);\n }\n // const index = cont.listeners.indexOf(listener);\n // removes this instance's listeners and closes the underlying fs_watch\n // instance if there are no more listeners left\n return () => {\n delFromSet(cont, KEY_LISTENERS, listener);\n delFromSet(cont, KEY_ERR, errHandler);\n delFromSet(cont, KEY_RAW, rawEmitter);\n if (isEmptySet(cont.listeners)) {\n // Check to protect against issue gh-730.\n // if (cont.watcherUnusable) {\n cont.watcher.close();\n // }\n FsWatchInstances.delete(fullPath);\n HANDLER_KEYS.forEach(clearItem(cont));\n // @ts-ignore\n cont.watcher = undefined;\n Object.freeze(cont);\n }\n };\n};\n// fs_watchFile helpers\n// object to hold per-process fs_watchFile instances\n// (may be shared across chokidar FSWatcher instances)\nconst FsWatchFileInstances = new Map();\n/**\n * Instantiates the fs_watchFile interface or binds listeners\n * to an existing one covering the same file system entry\n * @param path to be watched\n * @param fullPath absolute path\n * @param options options to be passed to fs_watchFile\n * @param handlers container for event listener functions\n * @returns closer\n */\nconst setFsWatchFileListener = (path, fullPath, options, handlers) => {\n const { listener, rawEmitter } = handlers;\n let cont = FsWatchFileInstances.get(fullPath);\n // let listeners = new Set();\n // let rawEmitters = new Set();\n const copts = cont && cont.options;\n if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {\n // \"Upgrade\" the watcher to persistence or a quicker interval.\n // This creates some unlikely edge case issues if the user mixes\n // settings in a very weird way, but solving for those cases\n // doesn't seem worthwhile for the added complexity.\n // listeners = cont.listeners;\n // rawEmitters = cont.rawEmitters;\n unwatchFile(fullPath);\n cont = undefined;\n }\n if (cont) {\n addAndConvert(cont, KEY_LISTENERS, listener);\n addAndConvert(cont, KEY_RAW, rawEmitter);\n }\n else {\n // TODO\n // listeners.add(listener);\n // rawEmitters.add(rawEmitter);\n cont = {\n listeners: listener,\n rawEmitters: rawEmitter,\n options,\n watcher: watchFile(fullPath, options, (curr, prev) => {\n foreach(cont.rawEmitters, (rawEmitter) => {\n rawEmitter(EV.CHANGE, fullPath, { curr, prev });\n });\n const currmtime = curr.mtimeMs;\n if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {\n foreach(cont.listeners, (listener) => listener(path, curr));\n }\n }),\n };\n FsWatchFileInstances.set(fullPath, cont);\n }\n // const index = cont.listeners.indexOf(listener);\n // Removes this instance's listeners and closes the underlying fs_watchFile\n // instance if there are no more listeners left.\n return () => {\n delFromSet(cont, KEY_LISTENERS, listener);\n delFromSet(cont, KEY_RAW, rawEmitter);\n if (isEmptySet(cont.listeners)) {\n FsWatchFileInstances.delete(fullPath);\n unwatchFile(fullPath);\n cont.options = cont.watcher = undefined;\n Object.freeze(cont);\n }\n };\n};\n/**\n * @mixin\n */\nexport class NodeFsHandler {\n constructor(fsW) {\n this.fsw = fsW;\n this._boundHandleError = (error) => fsW._handleError(error);\n }\n /**\n * Watch file for changes with fs_watchFile or fs_watch.\n * @param path to file or dir\n * @param listener on fs change\n * @returns closer for the watcher instance\n */\n _watchWithNodeFs(path, listener) {\n const opts = this.fsw.options;\n const directory = sysPath.dirname(path);\n const basename = sysPath.basename(path);\n const parent = this.fsw._getWatchedDir(directory);\n parent.add(basename);\n const absolutePath = sysPath.resolve(path);\n const options = {\n persistent: opts.persistent,\n };\n if (!listener)\n listener = EMPTY_FN;\n let closer;\n if (opts.usePolling) {\n const enableBin = opts.interval !== opts.binaryInterval;\n options.interval = enableBin && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;\n closer = setFsWatchFileListener(path, absolutePath, options, {\n listener,\n rawEmitter: this.fsw._emitRaw,\n });\n }\n else {\n closer = setFsWatchListener(path, absolutePath, options, {\n listener,\n errHandler: this._boundHandleError,\n rawEmitter: this.fsw._emitRaw,\n });\n }\n return closer;\n }\n /**\n * Watch a file and emit add event if warranted.\n * @returns closer for the watcher instance\n */\n _handleFile(file, stats, initialAdd) {\n if (this.fsw.closed) {\n return;\n }\n const dirname = sysPath.dirname(file);\n const basename = sysPath.basename(file);\n const parent = this.fsw._getWatchedDir(dirname);\n // stats is always present\n let prevStats = stats;\n // if the file is already being watched, do nothing\n if (parent.has(basename))\n return;\n const listener = async (path, newStats) => {\n if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))\n return;\n if (!newStats || newStats.mtimeMs === 0) {\n try {\n const newStats = await stat(file);\n if (this.fsw.closed)\n return;\n // Check that change event was not fired because of changed only accessTime.\n const at = newStats.atimeMs;\n const mt = newStats.mtimeMs;\n if (!at || at <= mt || mt !== prevStats.mtimeMs) {\n this.fsw._emit(EV.CHANGE, file, newStats);\n }\n if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats.ino) {\n this.fsw._closeFile(path);\n prevStats = newStats;\n const closer = this._watchWithNodeFs(file, listener);\n if (closer)\n this.fsw._addPathCloser(path, closer);\n }\n else {\n prevStats = newStats;\n }\n }\n catch (error) {\n // Fix issues where mtime is null but file is still present\n this.fsw._remove(dirname, basename);\n }\n // add is about to be emitted if file not already tracked in parent\n }\n else if (parent.has(basename)) {\n // Check that change event was not fired because of changed only accessTime.\n const at = newStats.atimeMs;\n const mt = newStats.mtimeMs;\n if (!at || at <= mt || mt !== prevStats.mtimeMs) {\n this.fsw._emit(EV.CHANGE, file, newStats);\n }\n prevStats = newStats;\n }\n };\n // kick off the watcher\n const closer = this._watchWithNodeFs(file, listener);\n // emit an add event if we're supposed to\n if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {\n if (!this.fsw._throttle(EV.ADD, file, 0))\n return;\n this.fsw._emit(EV.ADD, file, stats);\n }\n return closer;\n }\n /**\n * Handle symlinks encountered while reading a dir.\n * @param entry returned by readdirp\n * @param directory path of dir being read\n * @param path of this item\n * @param item basename of this item\n * @returns true if no more processing is needed for this entry.\n */\n async _handleSymlink(entry, directory, path, item) {\n if (this.fsw.closed) {\n return;\n }\n const full = entry.fullPath;\n const dir = this.fsw._getWatchedDir(directory);\n if (!this.fsw.options.followSymlinks) {\n // watch symlink directly (don't follow) and detect changes\n this.fsw._incrReadyCount();\n let linkPath;\n try {\n linkPath = await fsrealpath(path);\n }\n catch (e) {\n this.fsw._emitReady();\n return true;\n }\n if (this.fsw.closed)\n return;\n if (dir.has(item)) {\n if (this.fsw._symlinkPaths.get(full) !== linkPath) {\n this.fsw._symlinkPaths.set(full, linkPath);\n this.fsw._emit(EV.CHANGE, path, entry.stats);\n }\n }\n else {\n dir.add(item);\n this.fsw._symlinkPaths.set(full, linkPath);\n this.fsw._emit(EV.ADD, path, entry.stats);\n }\n this.fsw._emitReady();\n return true;\n }\n // don't follow the same symlink more than once\n if (this.fsw._symlinkPaths.has(full)) {\n return true;\n }\n this.fsw._symlinkPaths.set(full, true);\n }\n _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {\n // Normalize the directory name on Windows\n directory = sysPath.join(directory, '');\n throttler = this.fsw._throttle('readdir', directory, 1000);\n if (!throttler)\n return;\n const previous = this.fsw._getWatchedDir(wh.path);\n const current = new Set();\n let stream = this.fsw._readdirp(directory, {\n fileFilter: (entry) => wh.filterPath(entry),\n directoryFilter: (entry) => wh.filterDir(entry),\n });\n if (!stream)\n return;\n stream\n .on(STR_DATA, async (entry) => {\n if (this.fsw.closed) {\n stream = undefined;\n return;\n }\n const item = entry.path;\n let path = sysPath.join(directory, item);\n current.add(item);\n if (entry.stats.isSymbolicLink() &&\n (await this._handleSymlink(entry, directory, path, item))) {\n return;\n }\n if (this.fsw.closed) {\n stream = undefined;\n return;\n }\n // Files that present in current directory snapshot\n // but absent in previous are added to watch list and\n // emit `add` event.\n if (item === target || (!target && !previous.has(item))) {\n this.fsw._incrReadyCount();\n // ensure relativeness of path is preserved in case of watcher reuse\n path = sysPath.join(dir, sysPath.relative(dir, path));\n this._addToNodeFs(path, initialAdd, wh, depth + 1);\n }\n })\n .on(EV.ERROR, this._boundHandleError);\n return new Promise((resolve, reject) => {\n if (!stream)\n return reject();\n stream.once(STR_END, () => {\n if (this.fsw.closed) {\n stream = undefined;\n return;\n }\n const wasThrottled = throttler ? throttler.clear() : false;\n resolve(undefined);\n // Files that absent in current directory snapshot\n // but present in previous emit `remove` event\n // and are removed from @watched[directory].\n previous\n .getChildren()\n .filter((item) => {\n return item !== directory && !current.has(item);\n })\n .forEach((item) => {\n this.fsw._remove(directory, item);\n });\n stream = undefined;\n // one more time for any missed in case changes came in extremely quickly\n if (wasThrottled)\n this._handleRead(directory, false, wh, target, dir, depth, throttler);\n });\n });\n }\n /**\n * Read directory to add / remove files from `@watched` list and re-read it on change.\n * @param dir fs path\n * @param stats\n * @param initialAdd\n * @param depth relative to user-supplied path\n * @param target child path targeted for watch\n * @param wh Common watch helpers for this path\n * @param realpath\n * @returns closer for the watcher instance.\n */\n async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {\n const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));\n const tracked = parentDir.has(sysPath.basename(dir));\n if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {\n this.fsw._emit(EV.ADD_DIR, dir, stats);\n }\n // ensure dir is tracked (harmless if redundant)\n parentDir.add(sysPath.basename(dir));\n this.fsw._getWatchedDir(dir);\n let throttler;\n let closer;\n const oDepth = this.fsw.options.depth;\n if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {\n if (!target) {\n await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);\n if (this.fsw.closed)\n return;\n }\n closer = this._watchWithNodeFs(dir, (dirPath, stats) => {\n // if current directory is removed, do nothing\n if (stats && stats.mtimeMs === 0)\n return;\n this._handleRead(dirPath, false, wh, target, dir, depth, throttler);\n });\n }\n return closer;\n }\n /**\n * Handle added file, directory, or glob pattern.\n * Delegates call to _handleFile / _handleDir after checks.\n * @param path to file or ir\n * @param initialAdd was the file added at watch instantiation?\n * @param priorWh depth relative to user-supplied path\n * @param depth Child path actually targeted for watch\n * @param target Child path actually targeted for watch\n */\n async _addToNodeFs(path, initialAdd, priorWh, depth, target) {\n const ready = this.fsw._emitReady;\n if (this.fsw._isIgnored(path) || this.fsw.closed) {\n ready();\n return false;\n }\n const wh = this.fsw._getWatchHelpers(path);\n if (priorWh) {\n wh.filterPath = (entry) => priorWh.filterPath(entry);\n wh.filterDir = (entry) => priorWh.filterDir(entry);\n }\n // evaluate what is at the path we're being asked to watch\n try {\n const stats = await statMethods[wh.statMethod](wh.watchPath);\n if (this.fsw.closed)\n return;\n if (this.fsw._isIgnored(wh.watchPath, stats)) {\n ready();\n return false;\n }\n const follow = this.fsw.options.followSymlinks;\n let closer;\n if (stats.isDirectory()) {\n const absPath = sysPath.resolve(path);\n const targetPath = follow ? await fsrealpath(path) : path;\n if (this.fsw.closed)\n return;\n closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);\n if (this.fsw.closed)\n return;\n // preserve this symlink's target path\n if (absPath !== targetPath && targetPath !== undefined) {\n this.fsw._symlinkPaths.set(absPath, targetPath);\n }\n }\n else if (stats.isSymbolicLink()) {\n const targetPath = follow ? await fsrealpath(path) : path;\n if (this.fsw.closed)\n return;\n const parent = sysPath.dirname(wh.watchPath);\n this.fsw._getWatchedDir(parent).add(wh.watchPath);\n this.fsw._emit(EV.ADD, wh.watchPath, stats);\n closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);\n if (this.fsw.closed)\n return;\n // preserve this symlink's target path\n if (targetPath !== undefined) {\n this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath);\n }\n }\n else {\n closer = this._handleFile(wh.watchPath, stats, initialAdd);\n }\n ready();\n if (closer)\n this.fsw._addPathCloser(path, closer);\n return false;\n }\n catch (error) {\n if (this.fsw._handleError(error)) {\n ready();\n return path;\n }\n }\n }\n}\n","/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */\nimport { stat as statcb } from 'fs';\nimport { stat, readdir } from 'fs/promises';\nimport { EventEmitter } from 'events';\nimport * as sysPath from 'path';\nimport { readdirp } from 'readdirp';\nimport { NodeFsHandler, EVENTS as EV, isWindows, isIBMi, EMPTY_FN, STR_CLOSE, STR_END, } from './handler.js';\nconst SLASH = '/';\nconst SLASH_SLASH = '//';\nconst ONE_DOT = '.';\nconst TWO_DOTS = '..';\nconst STRING_TYPE = 'string';\nconst BACK_SLASH_RE = /\\\\/g;\nconst DOUBLE_SLASH_RE = /\\/\\//;\nconst DOT_RE = /\\..*\\.(sw[px])$|~$|\\.subl.*\\.tmp/;\nconst REPLACER_RE = /^\\.[/\\\\]/;\nfunction arrify(item) {\n return Array.isArray(item) ? item : [item];\n}\nconst isMatcherObject = (matcher) => typeof matcher === 'object' && matcher !== null && !(matcher instanceof RegExp);\nfunction createPattern(matcher) {\n if (typeof matcher === 'function')\n return matcher;\n if (typeof matcher === 'string')\n return (string) => matcher === string;\n if (matcher instanceof RegExp)\n return (string) => matcher.test(string);\n if (typeof matcher === 'object' && matcher !== null) {\n return (string) => {\n if (matcher.path === string)\n return true;\n if (matcher.recursive) {\n const relative = sysPath.relative(matcher.path, string);\n if (!relative) {\n return false;\n }\n return !relative.startsWith('..') && !sysPath.isAbsolute(relative);\n }\n return false;\n };\n }\n return () => false;\n}\nfunction normalizePath(path) {\n if (typeof path !== 'string')\n throw new Error('string expected');\n path = sysPath.normalize(path);\n path = path.replace(/\\\\/g, '/');\n let prepend = false;\n if (path.startsWith('//'))\n prepend = true;\n const DOUBLE_SLASH_RE = /\\/\\//;\n while (path.match(DOUBLE_SLASH_RE))\n path = path.replace(DOUBLE_SLASH_RE, '/');\n if (prepend)\n path = '/' + path;\n return path;\n}\nfunction matchPatterns(patterns, testString, stats) {\n const path = normalizePath(testString);\n for (let index = 0; index < patterns.length; index++) {\n const pattern = patterns[index];\n if (pattern(path, stats)) {\n return true;\n }\n }\n return false;\n}\nfunction anymatch(matchers, testString) {\n if (matchers == null) {\n throw new TypeError('anymatch: specify first argument');\n }\n // Early cache for matchers.\n const matchersArray = arrify(matchers);\n const patterns = matchersArray.map((matcher) => createPattern(matcher));\n if (testString == null) {\n return (testString, stats) => {\n return matchPatterns(patterns, testString, stats);\n };\n }\n return matchPatterns(patterns, testString);\n}\nconst unifyPaths = (paths_) => {\n const paths = arrify(paths_).flat();\n if (!paths.every((p) => typeof p === STRING_TYPE)) {\n throw new TypeError(`Non-string provided as watch path: ${paths}`);\n }\n return paths.map(normalizePathToUnix);\n};\n// If SLASH_SLASH occurs at the beginning of path, it is not replaced\n// because \"//StoragePC/DrivePool/Movies\" is a valid network path\nconst toUnix = (string) => {\n let str = string.replace(BACK_SLASH_RE, SLASH);\n let prepend = false;\n if (str.startsWith(SLASH_SLASH)) {\n prepend = true;\n }\n while (str.match(DOUBLE_SLASH_RE)) {\n str = str.replace(DOUBLE_SLASH_RE, SLASH);\n }\n if (prepend) {\n str = SLASH + str;\n }\n return str;\n};\n// Our version of upath.normalize\n// TODO: this is not equal to path-normalize module - investigate why\nconst normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));\n// TODO: refactor\nconst normalizeIgnored = (cwd = '') => (path) => {\n if (typeof path === 'string') {\n return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path));\n }\n else {\n return path;\n }\n};\nconst getAbsolutePath = (path, cwd) => {\n if (sysPath.isAbsolute(path)) {\n return path;\n }\n return sysPath.join(cwd, path);\n};\nconst EMPTY_SET = Object.freeze(new Set());\n/**\n * Directory entry.\n */\nclass DirEntry {\n constructor(dir, removeWatcher) {\n this.path = dir;\n this._removeWatcher = removeWatcher;\n this.items = new Set();\n }\n add(item) {\n const { items } = this;\n if (!items)\n return;\n if (item !== ONE_DOT && item !== TWO_DOTS)\n items.add(item);\n }\n async remove(item) {\n const { items } = this;\n if (!items)\n return;\n items.delete(item);\n if (items.size > 0)\n return;\n const dir = this.path;\n try {\n await readdir(dir);\n }\n catch (err) {\n if (this._removeWatcher) {\n this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));\n }\n }\n }\n has(item) {\n const { items } = this;\n if (!items)\n return;\n return items.has(item);\n }\n getChildren() {\n const { items } = this;\n if (!items)\n return [];\n return [...items.values()];\n }\n dispose() {\n this.items.clear();\n this.path = '';\n this._removeWatcher = EMPTY_FN;\n this.items = EMPTY_SET;\n Object.freeze(this);\n }\n}\nconst STAT_METHOD_F = 'stat';\nconst STAT_METHOD_L = 'lstat';\nexport class WatchHelper {\n constructor(path, follow, fsw) {\n this.fsw = fsw;\n const watchPath = path;\n this.path = path = path.replace(REPLACER_RE, '');\n this.watchPath = watchPath;\n this.fullWatchPath = sysPath.resolve(watchPath);\n this.dirParts = [];\n this.dirParts.forEach((parts) => {\n if (parts.length > 1)\n parts.pop();\n });\n this.followSymlinks = follow;\n this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;\n }\n entryPath(entry) {\n return sysPath.join(this.watchPath, sysPath.relative(this.watchPath, entry.fullPath));\n }\n filterPath(entry) {\n const { stats } = entry;\n if (stats && stats.isSymbolicLink())\n return this.filterDir(entry);\n const resolvedPath = this.entryPath(entry);\n // TODO: what if stats is undefined? remove !\n return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);\n }\n filterDir(entry) {\n return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);\n }\n}\n/**\n * Watches files & directories for changes. Emitted events:\n * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`\n *\n * new FSWatcher()\n * .add(directories)\n * .on('add', path => log('File', path, 'was added'))\n */\nexport class FSWatcher extends EventEmitter {\n // Not indenting methods for history sake; for now.\n constructor(_opts = {}) {\n super();\n this.closed = false;\n this._closers = new Map();\n this._ignoredPaths = new Set();\n this._throttled = new Map();\n this._streams = new Set();\n this._symlinkPaths = new Map();\n this._watched = new Map();\n this._pendingWrites = new Map();\n this._pendingUnlinks = new Map();\n this._readyCount = 0;\n this._readyEmitted = false;\n const awf = _opts.awaitWriteFinish;\n const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };\n const opts = {\n // Defaults\n persistent: true,\n ignoreInitial: false,\n ignorePermissionErrors: false,\n interval: 100,\n binaryInterval: 300,\n followSymlinks: true,\n usePolling: false,\n // useAsync: false,\n atomic: true, // NOTE: overwritten later (depends on usePolling)\n ..._opts,\n // Change format\n ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),\n awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === 'object' ? { ...DEF_AWF, ...awf } : false,\n };\n // Always default to polling on IBM i because fs.watch() is not available on IBM i.\n if (isIBMi)\n opts.usePolling = true;\n // Editor atomic write normalization enabled by default with fs.watch\n if (opts.atomic === undefined)\n opts.atomic = !opts.usePolling;\n // opts.atomic = typeof _opts.atomic === 'number' ? _opts.atomic : 100;\n // Global override. Useful for developers, who need to force polling for all\n // instances of chokidar, regardless of usage / dependency depth\n const envPoll = process.env.CHOKIDAR_USEPOLLING;\n if (envPoll !== undefined) {\n const envLower = envPoll.toLowerCase();\n if (envLower === 'false' || envLower === '0')\n opts.usePolling = false;\n else if (envLower === 'true' || envLower === '1')\n opts.usePolling = true;\n else\n opts.usePolling = !!envLower;\n }\n const envInterval = process.env.CHOKIDAR_INTERVAL;\n if (envInterval)\n opts.interval = Number.parseInt(envInterval, 10);\n // This is done to emit ready only once, but each 'add' will increase that?\n let readyCalls = 0;\n this._emitReady = () => {\n readyCalls++;\n if (readyCalls >= this._readyCount) {\n this._emitReady = EMPTY_FN;\n this._readyEmitted = true;\n // use process.nextTick to allow time for listener to be bound\n process.nextTick(() => this.emit(EV.READY));\n }\n };\n this._emitRaw = (...args) => this.emit(EV.RAW, ...args);\n this._boundRemove = this._remove.bind(this);\n this.options = opts;\n this._nodeFsHandler = new NodeFsHandler(this);\n // You’re frozen when your heart’s not open.\n Object.freeze(opts);\n }\n _addIgnoredPath(matcher) {\n if (isMatcherObject(matcher)) {\n // return early if we already have a deeply equal matcher object\n for (const ignored of this._ignoredPaths) {\n if (isMatcherObject(ignored) &&\n ignored.path === matcher.path &&\n ignored.recursive === matcher.recursive) {\n return;\n }\n }\n }\n this._ignoredPaths.add(matcher);\n }\n _removeIgnoredPath(matcher) {\n this._ignoredPaths.delete(matcher);\n // now find any matcher objects with the matcher as path\n if (typeof matcher === 'string') {\n for (const ignored of this._ignoredPaths) {\n // TODO (43081j): make this more efficient.\n // probably just make a `this._ignoredDirectories` or some\n // such thing.\n if (isMatcherObject(ignored) && ignored.path === matcher) {\n this._ignoredPaths.delete(ignored);\n }\n }\n }\n }\n // Public methods\n /**\n * Adds paths to be watched on an existing FSWatcher instance.\n * @param paths_ file or file list. Other arguments are unused\n */\n add(paths_, _origAdd, _internal) {\n const { cwd } = this.options;\n this.closed = false;\n this._closePromise = undefined;\n let paths = unifyPaths(paths_);\n if (cwd) {\n paths = paths.map((path) => {\n const absPath = getAbsolutePath(path, cwd);\n // Check `path` instead of `absPath` because the cwd portion can't be a glob\n return absPath;\n });\n }\n paths.forEach((path) => {\n this._removeIgnoredPath(path);\n });\n this._userIgnored = undefined;\n if (!this._readyCount)\n this._readyCount = 0;\n this._readyCount += paths.length;\n Promise.all(paths.map(async (path) => {\n const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, undefined, 0, _origAdd);\n if (res)\n this._emitReady();\n return res;\n })).then((results) => {\n if (this.closed)\n return;\n results.forEach((item) => {\n if (item)\n this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));\n });\n });\n return this;\n }\n /**\n * Close watchers or start ignoring events from specified paths.\n */\n unwatch(paths_) {\n if (this.closed)\n return this;\n const paths = unifyPaths(paths_);\n const { cwd } = this.options;\n paths.forEach((path) => {\n // convert to absolute path unless relative path already matches\n if (!sysPath.isAbsolute(path) && !this._closers.has(path)) {\n if (cwd)\n path = sysPath.join(cwd, path);\n path = sysPath.resolve(path);\n }\n this._closePath(path);\n this._addIgnoredPath(path);\n if (this._watched.has(path)) {\n this._addIgnoredPath({\n path,\n recursive: true,\n });\n }\n // reset the cached userIgnored anymatch fn\n // to make ignoredPaths changes effective\n this._userIgnored = undefined;\n });\n return this;\n }\n /**\n * Close watchers and remove all listeners from watched paths.\n */\n close() {\n if (this._closePromise) {\n return this._closePromise;\n }\n this.closed = true;\n // Memory management.\n this.removeAllListeners();\n const closers = [];\n this._closers.forEach((closerList) => closerList.forEach((closer) => {\n const promise = closer();\n if (promise instanceof Promise)\n closers.push(promise);\n }));\n this._streams.forEach((stream) => stream.destroy());\n this._userIgnored = undefined;\n this._readyCount = 0;\n this._readyEmitted = false;\n this._watched.forEach((dirent) => dirent.dispose());\n this._closers.clear();\n this._watched.clear();\n this._streams.clear();\n this._symlinkPaths.clear();\n this._throttled.clear();\n this._closePromise = closers.length\n ? Promise.all(closers).then(() => undefined)\n : Promise.resolve();\n return this._closePromise;\n }\n /**\n * Expose list of watched paths\n * @returns for chaining\n */\n getWatched() {\n const watchList = {};\n this._watched.forEach((entry, dir) => {\n const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;\n const index = key || ONE_DOT;\n watchList[index] = entry.getChildren().sort();\n });\n return watchList;\n }\n emitWithAll(event, args) {\n this.emit(event, ...args);\n if (event !== EV.ERROR)\n this.emit(EV.ALL, event, ...args);\n }\n // Common helpers\n // --------------\n /**\n * Normalize and emit events.\n * Calling _emit DOES NOT MEAN emit() would be called!\n * @param event Type of event\n * @param path File or directory path\n * @param stats arguments to be passed with event\n * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag\n */\n async _emit(event, path, stats) {\n if (this.closed)\n return;\n const opts = this.options;\n if (isWindows)\n path = sysPath.normalize(path);\n if (opts.cwd)\n path = sysPath.relative(opts.cwd, path);\n const args = [path];\n if (stats != null)\n args.push(stats);\n const awf = opts.awaitWriteFinish;\n let pw;\n if (awf && (pw = this._pendingWrites.get(path))) {\n pw.lastChange = new Date();\n return this;\n }\n if (opts.atomic) {\n if (event === EV.UNLINK) {\n this._pendingUnlinks.set(path, [event, ...args]);\n setTimeout(() => {\n this._pendingUnlinks.forEach((entry, path) => {\n this.emit(...entry);\n this.emit(EV.ALL, ...entry);\n this._pendingUnlinks.delete(path);\n });\n }, typeof opts.atomic === 'number' ? opts.atomic : 100);\n return this;\n }\n if (event === EV.ADD && this._pendingUnlinks.has(path)) {\n event = EV.CHANGE;\n this._pendingUnlinks.delete(path);\n }\n }\n if (awf && (event === EV.ADD || event === EV.CHANGE) && this._readyEmitted) {\n const awfEmit = (err, stats) => {\n if (err) {\n event = EV.ERROR;\n args[0] = err;\n this.emitWithAll(event, args);\n }\n else if (stats) {\n // if stats doesn't exist the file must have been deleted\n if (args.length > 1) {\n args[1] = stats;\n }\n else {\n args.push(stats);\n }\n this.emitWithAll(event, args);\n }\n };\n this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit);\n return this;\n }\n if (event === EV.CHANGE) {\n const isThrottled = !this._throttle(EV.CHANGE, path, 50);\n if (isThrottled)\n return this;\n }\n if (opts.alwaysStat &&\n stats === undefined &&\n (event === EV.ADD || event === EV.ADD_DIR || event === EV.CHANGE)) {\n const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;\n let stats;\n try {\n stats = await stat(fullPath);\n }\n catch (err) {\n // do nothing\n }\n // Suppress event when fs_stat fails, to avoid sending undefined 'stat'\n if (!stats || this.closed)\n return;\n args.push(stats);\n }\n this.emitWithAll(event, args);\n return this;\n }\n /**\n * Common handler for errors\n * @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag\n */\n _handleError(error) {\n const code = error && error.code;\n if (error &&\n code !== 'ENOENT' &&\n code !== 'ENOTDIR' &&\n (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES'))) {\n this.emit(EV.ERROR, error);\n }\n return error || this.closed;\n }\n /**\n * Helper utility for throttling\n * @param actionType type being throttled\n * @param path being acted upon\n * @param timeout duration of time to suppress duplicate actions\n * @returns tracking object or false if action should be suppressed\n */\n _throttle(actionType, path, timeout) {\n if (!this._throttled.has(actionType)) {\n this._throttled.set(actionType, new Map());\n }\n const action = this._throttled.get(actionType);\n if (!action)\n throw new Error('invalid throttle');\n const actionPath = action.get(path);\n if (actionPath) {\n actionPath.count++;\n return false;\n }\n // eslint-disable-next-line prefer-const\n let timeoutObject;\n const clear = () => {\n const item = action.get(path);\n const count = item ? item.count : 0;\n action.delete(path);\n clearTimeout(timeoutObject);\n if (item)\n clearTimeout(item.timeoutObject);\n return count;\n };\n timeoutObject = setTimeout(clear, timeout);\n const thr = { timeoutObject, clear, count: 0 };\n action.set(path, thr);\n return thr;\n }\n _incrReadyCount() {\n return this._readyCount++;\n }\n /**\n * Awaits write operation to finish.\n * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.\n * @param path being acted upon\n * @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished\n * @param event\n * @param awfEmit Callback to be called when ready for event to be emitted.\n */\n _awaitWriteFinish(path, threshold, event, awfEmit) {\n const awf = this.options.awaitWriteFinish;\n if (typeof awf !== 'object')\n return;\n const pollInterval = awf.pollInterval;\n let timeoutHandler;\n let fullPath = path;\n if (this.options.cwd && !sysPath.isAbsolute(path)) {\n fullPath = sysPath.join(this.options.cwd, path);\n }\n const now = new Date();\n const writes = this._pendingWrites;\n function awaitWriteFinishFn(prevStat) {\n statcb(fullPath, (err, curStat) => {\n if (err || !writes.has(path)) {\n if (err && err.code !== 'ENOENT')\n awfEmit(err);\n return;\n }\n const now = Number(new Date());\n if (prevStat && curStat.size !== prevStat.size) {\n writes.get(path).lastChange = now;\n }\n const pw = writes.get(path);\n const df = now - pw.lastChange;\n if (df >= threshold) {\n writes.delete(path);\n awfEmit(undefined, curStat);\n }\n else {\n timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);\n }\n });\n }\n if (!writes.has(path)) {\n writes.set(path, {\n lastChange: now,\n cancelWait: () => {\n writes.delete(path);\n clearTimeout(timeoutHandler);\n return event;\n },\n });\n timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);\n }\n }\n /**\n * Determines whether user has asked to ignore this path.\n */\n _isIgnored(path, stats) {\n if (this.options.atomic && DOT_RE.test(path))\n return true;\n if (!this._userIgnored) {\n const { cwd } = this.options;\n const ign = this.options.ignored;\n const ignored = (ign || []).map(normalizeIgnored(cwd));\n const ignoredPaths = [...this._ignoredPaths];\n const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];\n this._userIgnored = anymatch(list, undefined);\n }\n return this._userIgnored(path, stats);\n }\n _isntIgnored(path, stat) {\n return !this._isIgnored(path, stat);\n }\n /**\n * Provides a set of common helpers and properties relating to symlink handling.\n * @param path file or directory pattern being watched\n */\n _getWatchHelpers(path) {\n return new WatchHelper(path, this.options.followSymlinks, this);\n }\n // Directory helpers\n // -----------------\n /**\n * Provides directory tracking objects\n * @param directory path of the directory\n */\n _getWatchedDir(directory) {\n const dir = sysPath.resolve(directory);\n if (!this._watched.has(dir))\n this._watched.set(dir, new DirEntry(dir, this._boundRemove));\n return this._watched.get(dir);\n }\n // File helpers\n // ------------\n /**\n * Check for read permissions: https://stackoverflow.com/a/11781404/1358405\n */\n _hasReadPermissions(stats) {\n if (this.options.ignorePermissionErrors)\n return true;\n return Boolean(Number(stats.mode) & 0o400);\n }\n /**\n * Handles emitting unlink events for\n * files and directories, and via recursion, for\n * files and directories within directories that are unlinked\n * @param directory within which the following item is located\n * @param item base path of item/directory\n */\n _remove(directory, item, isDirectory) {\n // if what is being deleted is a directory, get that directory's paths\n // for recursive deleting and cleaning of watched object\n // if it is not a directory, nestedDirectoryChildren will be empty array\n const path = sysPath.join(directory, item);\n const fullPath = sysPath.resolve(path);\n isDirectory =\n isDirectory != null ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);\n // prevent duplicate handling in case of arriving here nearly simultaneously\n // via multiple paths (such as _handleFile and _handleDir)\n if (!this._throttle('remove', path, 100))\n return;\n // if the only watched file is removed, watch for its return\n if (!isDirectory && this._watched.size === 1) {\n this.add(directory, item, true);\n }\n // This will create a new entry in the watched object in either case\n // so we got to do the directory check beforehand\n const wp = this._getWatchedDir(path);\n const nestedDirectoryChildren = wp.getChildren();\n // Recursively remove children directories / files.\n nestedDirectoryChildren.forEach((nested) => this._remove(path, nested));\n // Check if item was on the watched list and remove it\n const parent = this._getWatchedDir(directory);\n const wasTracked = parent.has(item);\n parent.remove(item);\n // Fixes issue #1042 -> Relative paths were detected and added as symlinks\n // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612),\n // but never removed from the map in case the path was deleted.\n // This leads to an incorrect state if the path was recreated:\n // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553\n if (this._symlinkPaths.has(fullPath)) {\n this._symlinkPaths.delete(fullPath);\n }\n // If we wait for this file to be fully written, cancel the wait.\n let relPath = path;\n if (this.options.cwd)\n relPath = sysPath.relative(this.options.cwd, path);\n if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {\n const event = this._pendingWrites.get(relPath).cancelWait();\n if (event === EV.ADD)\n return;\n }\n // The Entry will either be a directory that just got removed\n // or a bogus entry to a file, in either case we have to remove it\n this._watched.delete(path);\n this._watched.delete(fullPath);\n const eventName = isDirectory ? EV.UNLINK_DIR : EV.UNLINK;\n if (wasTracked && !this._isIgnored(path))\n this._emit(eventName, path);\n // Avoid conflicts if we later create another file with the same name\n this._closePath(path);\n }\n /**\n * Closes all watchers for a path\n */\n _closePath(path) {\n this._closeFile(path);\n const dir = sysPath.dirname(path);\n this._getWatchedDir(dir).remove(sysPath.basename(path));\n }\n /**\n * Closes only file-specific watchers\n */\n _closeFile(path) {\n const closers = this._closers.get(path);\n if (!closers)\n return;\n closers.forEach((closer) => closer());\n this._closers.delete(path);\n }\n _addPathCloser(path, closer) {\n if (!closer)\n return;\n let list = this._closers.get(path);\n if (!list) {\n list = [];\n this._closers.set(path, list);\n }\n list.push(closer);\n }\n _readdirp(root, opts) {\n if (this.closed)\n return;\n const options = { type: EV.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };\n let stream = readdirp(root, options);\n this._streams.add(stream);\n stream.once(STR_CLOSE, () => {\n stream = undefined;\n });\n stream.once(STR_END, () => {\n if (stream) {\n this._streams.delete(stream);\n stream = undefined;\n }\n });\n return stream;\n }\n}\n/**\n * Instantiates watcher with paths to be tracked.\n * @param paths file / directory paths\n * @param options opts, such as `atomic`, `awaitWriteFinish`, `ignored`, and others\n * @returns an instance of FSWatcher for chaining.\n * @example\n * const watcher = watch('.').on('all', (event, path) => { console.log(event, path); });\n * watch('.', { atomic: true, awaitWriteFinish: true, ignored: (f, stats) => stats?.isFile() && !f.endsWith('.js') })\n */\nexport function watch(paths, options = {}) {\n const watcher = new FSWatcher(options);\n watcher.add(paths);\n return watcher;\n}\nexport default { watch, FSWatcher };\n","import { Cli, Command, Option, UsageError } from \"clipanion\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { containerEnv } from \"@internal/core/config\";\nimport { DEV_DIR, resolveLocalTargets } from \"@internal/core/local-target\";\nimport { assembleServices } from \"@internal/assemble\";\nimport { Load, isNode } from \"@internal/core\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport * as c12 from \"c12\";\nimport { pathToFileURL } from \"node:url\";\nimport { spawnSync } from \"node:child_process\";\nimport chokidar from \"chokidar\";\n//#region src/cli-error.ts\n/**\n* A user-facing failure with a message that already names the fix (deploy-cli.md\n* § Error surface). `bin.ts` catches this — and any other Error, including\n* core's LoadError/LowerError — uniformly: print the message, exit nonzero.\n*/\nvar CliError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"CliError\";\n\t}\n};\n//#endregion\n//#region src/load-config.ts\n/**\n* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE\n* file that imports control-plane code. Discovery is the standard walk-up\n* from the deploy entry's directory (mirrors prisma-next's config-loader);\n* loading is c12 with that explicit path (rc/global/package.json lookups\n* disabled), so the config file's own static imports resolve from the app\n* root by whatever package manager runs — no specifier construction, no\n* anchoring. The loaded shape is validated field-by-field with CliErrors\n* naming the field.\n*/\nconst CONFIG_FILENAME = \"prisma-composer.config.ts\";\n/** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */\nfunction findConfigPathForEntry(entryPath) {\n\tlet current = path.dirname(path.resolve(entryPath));\n\twhile (true) {\n\t\tconst candidate = path.join(current, CONFIG_FILENAME);\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(current);\n\t\tif (parent === current) return void 0;\n\t\tcurrent = parent;\n\t}\n}\nfunction missingConfigError(entryPath) {\n\treturn new CliError(`No ${CONFIG_FILENAME} found walking up from \"${path.dirname(path.resolve(entryPath))}\" — the deploy needs the app's config file. Create one next to (or above) the entry, default-exporting defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.`);\n}\nfunction fieldError(field, requirement) {\n\treturn new CliError(`${CONFIG_FILENAME}: \\`${field}\\` ${requirement} — see defineConfig() in '@prisma/composer/config'.`);\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Field-by-field validation of the loaded default export — deliberately no\n* schema library: each check is a CliError naming the offending field.\n* Returns the same object, typed.\n*/\nfunction validateConfigShape(loaded, configPath) {\n\tif (!isRecord(loaded) || Object.keys(loaded).length === 0) throw new CliError(`\"${configPath}\" exported no config — it must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.`);\n\tconst extensions = loaded[\"extensions\"];\n\tif (!Array.isArray(extensions)) throw fieldError(\"extensions\", \"must be an array\");\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const [index, entry] of extensions.entries()) {\n\t\tif (!isRecord(entry)) throw fieldError(`extensions[${index}]`, \"must be an extension descriptor object\");\n\t\tconst id = entry[\"id\"];\n\t\tif (typeof id !== \"string\" || id.length === 0) throw fieldError(`extensions[${index}].id`, \"must be a non-empty string (the extension package name)\");\n\t\tif (!isRecord(entry[\"nodes\"])) throw fieldError(`extensions[${index}].nodes`, \"must be an object (the node-ID → control registry)\");\n\t\tif (seen.has(id)) throw new CliError(`${CONFIG_FILENAME}: extension \"${id}\" is listed more than once in \\`extensions\\`.`);\n\t\tseen.add(id);\n\t}\n\tconst state = loaded[\"state\"];\n\tif (!isRecord(state) || typeof state[\"extension\"] !== \"string\" || typeof state[\"create\"] !== \"function\") throw fieldError(\"state\", \"must be a state descriptor (e.g. prismaState())\");\n\treturn blindCast(loaded);\n}\n/**\n* Loads + validates the config at `configPath` via c12 (explicit file; rc /\n* global-rc / package.json lookups disabled — discovery already happened in\n* findConfigPathForEntry).\n*/\nasync function loadAppConfig(configPath) {\n\tconst result = await c12.loadConfig({\n\t\tname: \"prisma-composer\",\n\t\tconfigFile: configPath,\n\t\tcwd: path.dirname(configPath),\n\t\trcFile: false,\n\t\tglobalRc: false,\n\t\tpackageJson: false\n\t});\n\tconst loadedFile = result.configFile;\n\tif (typeof loadedFile !== \"string\" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath)) throw new CliError(`Config loading resolved \"${String(loadedFile)}\" instead of the discovered \"${configPath}\" — refusing to deploy against a different file.`);\n\treturn {\n\t\tpath: configPath,\n\t\tconfig: validateConfigShape(result.config, configPath)\n\t};\n}\n//#endregion\n//#region src/jsx-load-error.ts\n/**\n* `loadEntry` imports a user's topology with the host runtime's own module\n* loader — under node (the CLI's shebang runtime), that loader strips\n* TypeScript types but has no JSX transform (ADR-0005: the framework\n* doesn't bundle or transform the app's code; deploy loading is no\n* exception). A `.tsx`/`.jsx` file anywhere in the topology's import graph\n* dies with node's raw `ERR_UNKNOWN_FILE_EXTENSION`, which names the file\n* but not the cause or the fix. This turns that one case into a CliError\n* message that does — every other load failure (syntax errors, missing\n* files, non-JSX unknown extensions) is untouched, re-thrown as-is.\n*/\nconst UNKNOWN_EXTENSION_CODE = \"ERR_UNKNOWN_FILE_EXTENSION\";\nconst JSX_EXTENSIONS = [\".tsx\", \".jsx\"];\nfunction errorCode(error) {\n\treturn \"code\" in error && typeof error.code === \"string\" ? error.code : void 0;\n}\nfunction unknownExtensionPath(error) {\n\tif (!(error instanceof Error)) return void 0;\n\tif (errorCode(error) !== UNKNOWN_EXTENSION_CODE) return void 0;\n\treturn /Unknown file extension \"\\.\\w+\" for (.+)$/.exec(error.message)?.[1];\n}\n/**\n* Returns a CliError-ready message when `error` is node's\n* `ERR_UNKNOWN_FILE_EXTENSION` for a `.tsx`/`.jsx` file — `undefined` for\n* every other error (including unknown-extension failures for some other\n* extension), so the caller can fall through to its normal rethrow.\n*/\nfunction explainJsxLoadError(error, entryPath) {\n\tconst offendingPath = unknownExtensionPath(error);\n\tif (offendingPath === void 0) return void 0;\n\tif (!JSX_EXTENSIONS.some((ext) => offendingPath.endsWith(ext))) return void 0;\n\treturn `\"${offendingPath}\" can't be loaded: deploy loads \"${entryPath}\"'s topology with node's own module loader, which strips TypeScript types but has no JSX transform — so a .tsx/.jsx file can't sit anywhere in that import graph.\n\nPrecompile that file in your own build (transform the JSX away, keep the real npm packages external) and import the compiled output instead of the raw .tsx/.jsx — see examples/email/scripts/build.ts in the prisma/composer repo for a worked example.`;\n}\n//#endregion\n//#region src/load-entry.ts\n/**\n* Pipeline step 1 (deploy-cli.md § The pipeline): import the entry module\n* (resolved against cwd) and require its default export to be a node — a\n* service or module, branded by core's factories. Whatever this module exports\n* IS the application; nothing else marks a root (ADR-0003).\n*/\nasync function loadEntry(entryArg, cwd) {\n\tconst resolvedPath = path.resolve(cwd, entryArg);\n\tlet mod;\n\ttry {\n\t\tmod = await import(pathToFileURL(resolvedPath).href);\n\t} catch (error) {\n\t\tconst explained = explainJsxLoadError(error, resolvedPath);\n\t\tif (explained !== void 0) throw new CliError(explained);\n\t\tthrow error;\n\t}\n\tconst root = blindCast(mod).default;\n\tif (!isNode(root) || root.kind === \"dependency\" || root.kind === \"resource\") throw new CliError(`Entry module \"${resolvedPath}\" must default-export a node (a service or a module) — construct it with service() or module() from @prisma/composer.`);\n\treturn {\n\t\tpath: resolvedPath,\n\t\troot: blindCast(root)\n\t};\n}\n//#endregion\n//#region src/validate-coverage.ts\nfunction lookup(extensions, extension, type, expectedKind, what) {\n\tconst ext = extensions.get(extension);\n\tif (ext === void 0) throw new CliError(`No extension \"${extension}\" is configured (needed by ${what}) — add it to ${CONFIG_FILENAME}'s \\`extensions\\` (import its /control entry and list its descriptor).`);\n\tconst descriptor = ext.nodes[type];\n\tif (descriptor === void 0) throw new CliError(`Extension \"${extension}\" has no descriptor for node type \"${type}\" (needed by ${what}; known: ${Object.keys(ext.nodes).join(\", \")}).`);\n\tif (descriptor.kind !== expectedKind) throw new CliError(`Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${descriptor.kind}\" descriptor — ${what} needs a \"${expectedKind}\" descriptor.`);\n}\n/** Throws a CliError on the first uncovered `(extension, type)`; silent when the config covers the whole graph. */\nfunction validateRegistryCoverage(graph, config) {\n\tconst extensions = new Map(config.extensions.map((descriptor) => [descriptor.id, descriptor]));\n\tfor (const { id, node } of graph.nodes) {\n\t\tif (node.kind === \"resource\") {\n\t\t\tlookup(extensions, node.extension, node.type, \"resource\", `resource node \"${id}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (node.kind !== \"service\") continue;\n\t\tlookup(extensions, node.extension, node.type, \"service\", `service node \"${id}\"`);\n\t\tlookup(extensions, node.build.extension, node.build.type, \"build\", `service node \"${id}\"'s build descriptor`);\n\t}\n}\n//#endregion\n//#region src/pipeline.ts\n/**\n* The shared prefix of `deploy`/`destroy`/`dev` (deploy-cli.md § The\n* pipeline; local-dev spec § 6): config discovery/load, entry load, Load,\n* registry coverage validation, name resolution, assemble. Deploy and dev\n* diverge after this — deploy resolves containers/preflight/stack file\n* against the hosted providers, dev against the local ones — so everything\n* up to and including assemble lives here once, consumed verbatim by both\n* `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines\n* cannot drift.\n*/\n/**\n* The pipeline's front — config discovery/load, entry load, name resolution —\n* WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its\n* config and resolved name) to reach the already-running local instance; it\n* neither builds nor provisions, so it must not require the user's built\n* output the way the full pipeline does.\n*/\nasync function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {\n\tconst resolvedEntryPath = path.resolve(cwd, entry);\n\tconst configPath = findConfigPathForEntry(resolvedEntryPath);\n\tif (configPath === void 0) throw missingConfigError(resolvedEntryPath);\n\tconst config = deps.config ?? (await loadAppConfig(configPath)).config;\n\tconst entryModule = await loadEntry(entry, cwd);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliError(\"The root node has no name — name it at authoring, or pass --name.\");\n\treturn {\n\t\tconfigPath,\n\t\tconfig,\n\t\tname\n\t};\n}\n/**\n* Runs config discovery/load, entry load, Load, registry coverage, name\n* resolution, and assemble — steps 1–6 of `run()`. `onAssembleError`, when\n* given, lets a caller decorate an assemble failure with command-specific\n* guidance (destroy's \"build first\" hint) without this shared step knowing\n* about any one command.\n*/\nasync function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError) {\n\tconst resolvedEntryPath = path.resolve(cwd, entry);\n\tconst configPath = findConfigPathForEntry(resolvedEntryPath);\n\tif (configPath === void 0) throw missingConfigError(resolvedEntryPath);\n\tconst config = deps.config ?? (await loadAppConfig(configPath)).config;\n\tconst entryModule = await loadEntry(entry, cwd);\n\tconst graph = Load(entryModule.root);\n\tif (graph.root.node.kind !== \"module\") throw new CliError(\"The deploy root must be a module — wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); }).\");\n\tvalidateRegistryCoverage(graph, config);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliError(\"The root node has no name — name it at authoring, or pass --name.\");\n\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler);\n\t} catch (error) {\n\t\tif (onAssembleError !== void 0 && error instanceof Error) throw onAssembleError(error);\n\t\tthrow error;\n\t}\n\treturn {\n\t\tconfigPath,\n\t\tconfig,\n\t\tentryModule,\n\t\tgraph,\n\t\tname,\n\t\tassembled\n\t};\n}\n//#endregion\n//#region src/run-alchemy.ts\n/**\n* Pipeline step 7 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): shell out to the generated stack file. Resolves the\n* workspace's own installed `alchemy` bin (walking up `node_modules/.bin`\n* from the generated file's package dir) rather than going through\n* `bunx`/`npx`, so this works the same under node and bun — the resolved\n* bin's own launcher (`alchemy/bin/cli.js`) does its own node/bun dispatch\n* from there, driven by the env it inherits.\n*/\n/** Walks up from `startDir` looking for `node_modules/.bin/alchemy`. */\nfunction resolveAlchemyBin(startDir) {\n\tlet dir = startDir;\n\twhile (true) {\n\t\tconst candidate = path.join(dir, \"node_modules\", \".bin\", \"alchemy\");\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) throw new CliError(`Could not find an installed \\`alchemy\\` bin above \"${startDir}\" — add \"alchemy\" as a dependency of your app.`);\n\t\tdir = parent;\n\t}\n}\n/** Runs `alchemy deploy|destroy <stack file> --yes [--stage <stage>]`, inheriting stdio + env, plus every extension's resolved container. */\nfunction runAlchemy(input) {\n\tconst bin = resolveAlchemyBin(input.cwd);\n\tconst args = [\n\t\tinput.command,\n\t\tinput.stackFileRelativePath,\n\t\t\"--yes\"\n\t];\n\tif (input.stage !== void 0) args.push(\"--stage\", input.stage);\n\tconst result = spawnSync(bin, args, {\n\t\tcwd: input.cwd,\n\t\tstdio: \"inherit\",\n\t\tenv: {\n\t\t\t...input.env ?? process.env,\n\t\t\t...input.containerEnv\n\t\t}\n\t});\n\tif (result.error !== void 0) throw result.error;\n\treturn result.status ?? 1;\n}\n//#endregion\n//#region src/dev/generate-dev-stack.ts\n/**\n* Local-dev spec § 6 `generate-dev-stack.ts`: like generate-stack.ts but at\n* `.prisma-composer/dev/alchemy.run.ts`, always Alchemy stage `dev`, using\n* Alchemy's own `localState()` and no `report` — dev prints its own front\n* door (run-dev.ts), so core's presentation-free lower() gets nothing to\n* call back into. The generated module IS the one orchestration point where\n* dev provenance is resolved (spec § 3 REVISED): it deserializes the\n* containers, top-level-awaits `resolveLocalTargets(config)` (the lazy\n* `localTarget` thunks, ADR-0041), and passes\n* `providers: localTargetProviders(...)` + `state: localState()` explicitly\n* — `lower()` learns nothing about dev.\n*/\nconst DEV_GENERATED_DIR = \".prisma-composer/dev\";\nconst DEV_GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/dev/alchemy.run.ts` to `target` (posix separators). */\nfunction relativeImportSpecifier$1(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote$1(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle$1(bundle) {\n\treturn `{ dir: ${quote$1(bundle.dir)}, entry: ${quote$1(bundle.entry)} }`;\n}\nfunction renderOptions$1(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote$1(input.name)},`);\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote$1(id)}: ${renderBundle$1(bundle)},`);\n\tlines.push(\" },\");\n\tlines.push(\" providers: localTargetProviders(resolved, containers, devDir),\");\n\tlines.push(\" state: localState(),\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the dev stack module's source (tests assert on it without touching disk). */\nfunction renderDevStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, DEV_GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier$1(generatedDir, input.entryPath);\n\tconst configImport = relativeImportSpecifier$1(generatedDir, input.configPath);\n\treturn `// Generated by \\`prisma-composer dev\\` — overwritten on every run; do not\n// edit by hand. Independently runnable from ${quote$1(input.cwd)}:\n//\n// alchemy deploy ${DEV_GENERATED_DIR}/${DEV_GENERATED_FILE} --stage dev\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\nimport * as path from 'node:path';\nimport { deserializeContainers } from '@prisma/composer/config';\nimport { lower } from '@prisma/composer/deploy';\nimport { DEV_DIR, localTargetProviders, resolveLocalTargets } from '@prisma/composer/local-target';\nimport { localState } from 'alchemy/State/LocalState';\nimport config from ${quote$1(configImport)};\nimport app from ${quote$1(appImport)};\n\nconst containers = deserializeContainers(config.extensions, process.env);\nconst resolved = await resolveLocalTargets(config);\nconst devDir = path.join(process.cwd(), DEV_DIR);\n\nexport default lower(app, config, {\n${renderOptions$1(input)}\n});\n`;\n}\n/** Writes the dev stack file, returning its absolute path. */\nfunction writeDevStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, DEV_GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, DEV_GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderDevStackFile(input));\n\treturn filePath;\n}\nconst DEV_STACK_RELATIVE_PATH = path.join(DEV_GENERATED_DIR, DEV_GENERATED_FILE);\n//#endregion\n//#region src/dev/watch.ts\n/**\n* Local-dev spec § 6 `watch.ts`: watches each assembled bundle's declared\n* `watch` paths (a directory watched recursively, a file watched through\n* its parent — see `startWatch`), debounced 300 ms and coalesced across\n* every service — one edit across several files/services still fires\n* exactly one rebuild.\n*\n* The watch ENGINE is `chokidar` v4 (operator decision, design tip 74272d8:\n* don't-reinvent-the-wheel beats the no-new-deps contract here — it absorbs\n* the atomic-rename class and the cross-platform recursive-watch\n* differences; v4 is pure JS, no native code, no glob surface — irrelevant\n* here anyway, since every target is a literal file or directory path,\n* never a pattern). The parent-directory indirection for FILE targets stays\n* OURS (`startWatch` explains why), as does the debounce: chokidar's own\n* `awaitWriteFinish` is a per-file \"has this file's size stopped changing\"\n* poll, a different semantic from \"coalesce a burst across many files into\n* one callback,\" which is what the dev loop actually needs.\n*/\nconst DEBOUNCE_MS = 300;\n/** Bundles → watch targets, plus the addresses with nothing watchable (the pinned one-line startup note). */\nfunction watchTargetsFrom(bundles) {\n\tconst targets = [];\n\tconst unwatchable = [];\n\tfor (const [address, bundle] of Object.entries(bundles)) {\n\t\tconst paths = bundle.watch;\n\t\tif (paths === void 0 || paths.length === 0) {\n\t\t\tunwatchable.push(address);\n\t\t\tcontinue;\n\t\t}\n\t\ttargets.push({\n\t\t\taddress,\n\t\t\tpaths\n\t\t});\n\t}\n\treturn {\n\t\ttargets,\n\t\tunwatchable\n\t};\n}\n/**\n* Watches every target's paths via chokidar, debounced 300 ms and coalesced\n* across every service, invoking `onChange` once per burst.\n*\n* File targets are watched THROUGH their parent directory, filtered to the\n* exact path: a watch bound directly to a file dies with the file's inode\n* on Linux, so `rm -rf dist && bun build --outfile dist/x.mjs` — every\n* rebuild's shape — would go silently unobserved after the first delete\n* (chokidar absorbs atomic renames, not unlink+recreate of a directly\n* watched file; proven by the delete-recreate test failing on Linux CI\n* only). Directory targets are watched recursively as themselves; a\n* nonexistent path is treated as a file target, so it starts reporting the\n* moment something creates it.\n*/\nfunction startWatch(targets, onChange) {\n\tlet timer;\n\tconst trigger = () => {\n\t\tif (timer !== void 0) clearTimeout(timer);\n\t\ttimer = setTimeout(() => {\n\t\t\ttimer = void 0;\n\t\t\tonChange();\n\t\t}, DEBOUNCE_MS);\n\t};\n\tconst fileTargets = /* @__PURE__ */ new Set();\n\tconst directoryRoots = /* @__PURE__ */ new Set();\n\tconst parentRoots = /* @__PURE__ */ new Set();\n\tfor (const target of targets) for (const p of target.paths) {\n\t\tconst abs = path.resolve(p);\n\t\tlet isDirectory = false;\n\t\ttry {\n\t\t\tisDirectory = fs.statSync(abs).isDirectory();\n\t\t} catch {}\n\t\tif (isDirectory) directoryRoots.add(abs);\n\t\telse {\n\t\t\tfileTargets.add(abs);\n\t\t\tparentRoots.add(path.dirname(abs));\n\t\t}\n\t}\n\tconst reportError = (error) => {\n\t\tconsole.error(`[dev] watch error: ${error instanceof Error ? error.message : String(error)}`);\n\t};\n\tconst watchers = [];\n\tif (directoryRoots.size > 0) {\n\t\tconst directoryWatcher = chokidar.watch([...directoryRoots], { ignoreInitial: true });\n\t\tdirectoryWatcher.on(\"all\", () => trigger());\n\t\tdirectoryWatcher.on(\"error\", reportError);\n\t\twatchers.push(directoryWatcher);\n\t}\n\tif (parentRoots.size > 0) {\n\t\tconst parentWatcher = chokidar.watch([...parentRoots], {\n\t\t\tignoreInitial: true,\n\t\t\tdepth: 0\n\t\t});\n\t\tparentWatcher.on(\"all\", (_event, eventPath) => {\n\t\t\tif (fileTargets.has(path.resolve(eventPath))) trigger();\n\t\t});\n\t\tparentWatcher.on(\"error\", reportError);\n\t\twatchers.push(parentWatcher);\n\t}\n\tlet markReady = () => {};\n\tconst allReady = Promise.all(watchers.map((watcher) => new Promise((resolve) => watcher.on(\"ready\", () => resolve())))).then(() => {});\n\treturn {\n\t\tready: Promise.race([allReady, new Promise((resolve) => markReady = resolve)]),\n\t\tstop: () => {\n\t\t\tif (timer !== void 0) clearTimeout(timer);\n\t\t\tmarkReady();\n\t\t\tfor (const watcher of watchers) watcher.close();\n\t\t}\n\t};\n}\n//#endregion\n//#region src/dev/run-dev.ts\n/**\n* Local-dev spec § 6 `run-dev.ts`: `prisma-composer dev <entry>` — steps 1–6\n* of `run()` reused via pipeline.ts, then the dev-only pipeline: capability\n* check, containers, `--fresh` teardown, preflight, emulators, converge\n* against a generated dev stack file, attach (front door + merged logs),\n* watch loop until interrupted.\n*/\nfunction toCliError$1(error) {\n\treturn error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n}\n/** `[dev] ready:` then one line per endpoint, ordered by address depth (fewest dots first) then lexicographic. Exported for tests. */\nfunction renderFrontDoor(endpoints) {\n\treturn [\"[dev] ready:\", ...[...endpoints].sort((a, b) => {\n\t\tconst depthA = a.address.split(\".\").length;\n\t\tconst depthB = b.address.split(\".\").length;\n\t\tif (depthA !== depthB) return depthA - depthB;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t}).map((e) => `[dev] ${e.address} ${e.url}`)];\n}\nfunction printFrontDoor(endpoints) {\n\tfor (const line of renderFrontDoor(endpoints)) console.log(line);\n}\nconst EMULATOR_RETRY_ATTEMPTS = 5;\nconst EMULATOR_RETRY_DELAY_MS = 500;\n/** An emulator admin call right after a converge that just PUT dozens of resources through the same daemon can hit a transient refused/reset connection — a brief loopback hiccup under load, not a real failure. Retried before giving up. Applies to every attach admin call the dev session makes (`startServices`, `endpoints`). */\nasync function withEmulatorRetry(call) {\n\tlet lastError;\n\tfor (let attempt = 1; attempt <= EMULATOR_RETRY_ATTEMPTS; attempt += 1) try {\n\t\treturn await call();\n\t} catch (error) {\n\t\tlastError = error;\n\t\tif (attempt < EMULATOR_RETRY_ATTEMPTS) await new Promise((resolve) => setTimeout(resolve, EMULATOR_RETRY_DELAY_MS));\n\t}\n\tthrow lastError instanceof Error ? lastError : new Error(String(lastError));\n}\nasync function mergedEndpoints(attachments) {\n\treturn (await Promise.all(attachments.map((a) => withEmulatorRetry(() => a.endpoints())))).flat();\n}\n/** Runs the full dev pipeline; returns the process exit code. */\nasync function runDev(args, deps = {}) {\n\tif (process.platform === \"win32\") throw new CliError(\"local dev is not supported on Windows yet.\");\n\tconst cwd = process.cwd();\n\tconst devDir = path.join(cwd, DEV_DIR);\n\tconst pipelineDeps = {\n\t\trunAssembler: deps.runAssembler,\n\t\tconfig: deps.config\n\t};\n\tconst { configPath, config, entryModule, graph, name, assembled } = await runPipeline(args.entry, args.name, cwd, pipelineDeps);\n\tlet resolved;\n\ttry {\n\t\tresolved = await resolveLocalTargets(config);\n\t} catch (error) {\n\t\tthrow toCliError$1(error);\n\t}\n\tconst containers = /* @__PURE__ */ new Map();\n\tfor (const [id, dev] of resolved) try {\n\t\tcontainers.set(id, await dev.container.ensure({\n\t\t\tappName: name,\n\t\t\tstage: void 0\n\t\t}));\n\t} catch (error) {\n\t\tthrow toCliError$1(error);\n\t}\n\tif (args.fresh) for (const [id, dev] of resolved) {\n\t\tif (dev.teardown === void 0) continue;\n\t\ttry {\n\t\t\tawait dev.teardown({\n\t\t\t\tcontainer: containers.get(id),\n\t\t\t\tstage: void 0\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthrow toCliError$1(error);\n\t\t}\n\t}\n\tfor (const [id, dev] of resolved) {\n\t\tif (dev.preflight === void 0) continue;\n\t\ttry {\n\t\t\tawait dev.preflight({\n\t\t\t\tgraph,\n\t\t\t\tcontainer: containers.get(id),\n\t\t\t\tstage: void 0\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthrow toCliError$1(error);\n\t\t}\n\t}\n\tfor (const [id, dev] of resolved) {\n\t\tif (dev.emulators === void 0) continue;\n\t\ttry {\n\t\t\tawait dev.emulators({\n\t\t\t\tgraph,\n\t\t\t\tcontainer: containers.get(id),\n\t\t\t\tdevDir\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthrow toCliError$1(error);\n\t\t}\n\t}\n\tconst converge = () => {\n\t\tconst stackPath = writeDevStackFile({\n\t\t\tentryPath: entryModule.path,\n\t\t\tcwd,\n\t\t\tconfigPath,\n\t\t\tname,\n\t\t\tassembled\n\t\t});\n\t\tconst status = (deps.alchemy ?? runAlchemy)({\n\t\t\tcommand: \"deploy\",\n\t\t\tstackFileRelativePath: DEV_STACK_RELATIVE_PATH,\n\t\t\tcwd,\n\t\t\tstage: \"dev\",\n\t\t\tcontainerEnv: containerEnv(containers)\n\t\t});\n\t\tif (status !== 0) {\n\t\t\tconsole.error(`\\nGenerated stack file: ${stackPath}`);\n\t\t\tconsole.error(`Run \\`alchemy deploy ${DEV_STACK_RELATIVE_PATH} --yes --stage dev\\` from ${cwd} to reproduce this directly.`);\n\t\t}\n\t\treturn status;\n\t};\n\tconst firstStatus = converge();\n\tif (firstStatus !== 0) return firstStatus;\n\tconst attachments = [];\n\tfor (const [id, dev] of resolved) attachments.push(await dev.attach({\n\t\tcontainer: containers.get(id),\n\t\tdevDir\n\t}));\n\tconst started = [];\n\tfor (const attachment of attachments) try {\n\t\tawait withEmulatorRetry(() => attachment.startServices());\n\t\tstarted.push(attachment);\n\t} catch (error) {\n\t\tawait Promise.all(started.map((a) => a.stopServices().catch(() => void 0)));\n\t\tthrow toCliError$1(error);\n\t}\n\tprintFrontDoor(await mergedEndpoints(attachments));\n\tconsole.log(`[dev] logs: prisma-composer log ${args.entry}`);\n\tconst { targets, unwatchable } = watchTargetsFrom(assembled.bundles);\n\tfor (const address of unwatchable) console.log(`[dev] ${address} has no watchable inputs`);\n\tconst watch = startWatch(targets, () => {\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tconst rePipeline = await runPipeline(args.entry, args.name, cwd, pipelineDeps);\n\t\t\t\twriteDevStackFile({\n\t\t\t\t\tentryPath: rePipeline.entryModule.path,\n\t\t\t\t\tcwd,\n\t\t\t\t\tconfigPath: rePipeline.configPath,\n\t\t\t\t\tname: rePipeline.name,\n\t\t\t\t\tassembled: rePipeline.assembled\n\t\t\t\t});\n\t\t\t\tif ((deps.alchemy ?? runAlchemy)({\n\t\t\t\t\tcommand: \"deploy\",\n\t\t\t\t\tstackFileRelativePath: DEV_STACK_RELATIVE_PATH,\n\t\t\t\t\tcwd,\n\t\t\t\t\tstage: \"dev\",\n\t\t\t\t\tcontainerEnv: containerEnv(containers)\n\t\t\t\t}) !== 0) {\n\t\t\t\t\tconsole.error(\"[dev] converge failed — the running app is untouched; still watching.\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tprintFrontDoor(await mergedEndpoints(attachments));\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(`[dev] rebuild failed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t}\n\t\t})();\n\t});\n\tawait watch.ready;\n\tawait new Promise((resolve) => {\n\t\tlet stopping = false;\n\t\tconst finish = () => {\n\t\t\tif (stopping) return;\n\t\t\tstopping = true;\n\t\t\tconsole.log(\"[dev] stopping — the app's services are stopping; emulators and data stay up.\");\n\t\t\twatch.stop();\n\t\t\t(async () => {\n\t\t\t\tfor (const attachment of attachments) await attachment.stopServices().catch(() => void 0);\n\t\t\t\tconsole.log(\"[dev] stopped.\");\n\t\t\t\tresolve();\n\t\t\t})();\n\t\t};\n\t\tprocess.removeAllListeners(\"SIGINT\");\n\t\tprocess.removeAllListeners(\"SIGTERM\");\n\t\tprocess.on(\"SIGINT\", finish);\n\t\tprocess.on(\"SIGTERM\", finish);\n\t});\n\treturn 0;\n}\n//#endregion\n//#region src/generate-stack.ts\n/** Pipeline step 6: writes a regenerated-every-run, independently runnable stack module at `.prisma-composer/alchemy.run.ts`. */\nconst GENERATED_DIR = \".prisma-composer\";\nconst GENERATED_FILE = \"alchemy.run.ts\";\n/** A relative import specifier from `.prisma-composer/alchemy.run.ts` to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tlines.push(\" report: deploymentReport,\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the stack module's source (tests assert on it without touching disk) — uses `//` headers, not a block comment, since a cwd path with a star-slash could close one early. */\nfunction renderStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst configImport = relativeImportSpecifier(generatedDir, input.configPath);\n\treturn `// Generated by \\`prisma-composer deploy\\`/\\`prisma-composer destroy\\` — overwritten on every\n// run; do not edit by hand. Independently runnable from ${quote(input.cwd)}:\n//\n// alchemy deploy ${GENERATED_DIR}/${GENERATED_FILE}\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\nimport { lower } from '@prisma/composer/deploy';\nimport { deploymentReport } from '@prisma/composer/report';\nimport config from ${quote(configImport)};\nimport app from ${quote(appImport)};\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the stack file, returning its absolute path. */\nfunction writeStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, GENERATED_DIR);\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderStackFile(input));\n\treturn filePath;\n}\nconst GENERATED_STACK_RELATIVE_PATH = path.join(GENERATED_DIR, GENERATED_FILE);\n//#endregion\n//#region src/log/run-log.ts\n/**\n* `prisma-composer log <entry> [address]` — tail the merged logs of an\n* already-running local app. It resolves the app the way `dev` does (config →\n* localTarget → container → attach) but calls only the attachment's `logs()`\n* view: it neither builds, provisions, starts, nor stops anything. `dev` no\n* longer streams logs inline (that drowned the front door once it supervises\n* more than one service); this is where logs live.\n*/\nfunction toCliError(error) {\n\treturn error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n}\n/** Runs the log tail until interrupted; returns the process exit code. */\nasync function runLog(args, deps = {}) {\n\tif (process.platform === \"win32\") throw new CliError(\"local dev is not supported on Windows yet.\");\n\tconst cwd = process.cwd();\n\tconst devDir = path.join(cwd, DEV_DIR);\n\tconst { config, name } = deps.identity ?? await resolveAppIdentity(args.entry, args.name, cwd, { config: deps.config });\n\tlet resolved;\n\ttry {\n\t\tresolved = await resolveLocalTargets(config);\n\t} catch (error) {\n\t\tthrow toCliError(error);\n\t}\n\tconst attachments = [];\n\tfor (const target of resolved.values()) try {\n\t\tconst container = await target.container.ensure({\n\t\t\tappName: name,\n\t\t\tstage: void 0\n\t\t});\n\t\tattachments.push(await target.attach({\n\t\t\tcontainer,\n\t\t\tdevDir\n\t\t}));\n\t} catch (error) {\n\t\tthrow toCliError(error);\n\t}\n\tconst services = (await Promise.all(attachments.map((a) => a.endpoints()))).flat();\n\tif (services.length === 0) {\n\t\tconsole.error(`[log] no running services for \"${name}\" — start it first with \\`prisma-composer dev ${args.entry}\\`.`);\n\t\treturn 0;\n\t}\n\tif (args.address !== void 0 && !services.some((s) => s.address === args.address)) throw new CliError(`no service \"${args.address}\" in \"${name}\" — running services: ${services.map((s) => s.address).join(\", \")}.`);\n\tconst controller = new AbortController();\n\tconst finish = () => controller.abort();\n\tprocess.on(\"SIGINT\", finish);\n\tprocess.on(\"SIGTERM\", finish);\n\ttry {\n\t\tawait Promise.all(attachments.map(async (attachment) => {\n\t\t\ttry {\n\t\t\t\tfor await (const { service, line } of attachment.logs(controller.signal, { tail: args.tail })) {\n\t\t\t\t\tif (controller.signal.aborted) return;\n\t\t\t\t\tif (args.address !== void 0 && service !== args.address) continue;\n\t\t\t\t\tconsole.log(`[${service}] ${line}`);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (!controller.signal.aborted) console.error(`[log] stream failed: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t}\n\t\t}));\n\t} finally {\n\t\tprocess.off(\"SIGINT\", finish);\n\t\tprocess.off(\"SIGTERM\", finish);\n\t}\n\treturn 0;\n}\n//#endregion\n//#region src/validate-stage.ts\n/** A stage name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateStageName(stage) {\n\tconst result = spawnSync(\"git\", [\"check-ref-format\", `refs/heads/${stage}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliError(`git is required to validate --stage \"${stage}\" (git check-ref-format): ${result.error.message}.`);\n\tif (result.status !== 0) throw new CliError(`Invalid --stage \"${stage}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${stage}\").`);\n}\n//#endregion\n//#region src/main.ts\n/**\n* Argument parsing (clipanion — prisma-next's CLI idiom, see\n* prisma-next/packages/1-framework/3-tooling/cli/src/migration-cli.ts) +\n* orchestration of deploy-cli.md § The pipeline.\n*/\nconst BINARY_NAME = \"prisma-composer\";\n/** The <entry>/--name/--stage surface shared by deploy and destroy; execute() is unused — run() drives the pipeline directly so error handling stays under this module's control. */\nvar DeployCliCommand = class extends Command {\n\tentry = Option.String({ name: \"entry\" });\n\tname = Option.String(\"--name\", { description: \"Override the root node's name — the deploy's application name.\" });\n\tstage = Option.String(\"--stage\", { description: \"Alchemy stage to target.\" });\n\tproduction = Option.Boolean(\"--production\", false, { description: \"destroy: tear down the project-level production environment (required to destroy production).\" });\n\tasync execute() {\n\t\treturn 0;\n\t}\n};\nvar DeployCommand = class extends DeployCliCommand {\n\tstatic paths = [[\"deploy\"]];\n\tstatic usage = Command.Usage({\n\t\tdescription: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [[\"Deploy an app\", \"$0 deploy src/service.ts\"]]\n\t});\n\taction = \"deploy\";\n};\nvar DestroyCommand = class extends DeployCliCommand {\n\tstatic paths = [[\"destroy\"]];\n\tstatic usage = Command.Usage({\n\t\tdescription: \"Tear down the application whose root node is <entry>'s default export — same derivation as deploy, Alchemy destroy.\",\n\t\texamples: [[\"Destroy an app\", \"$0 destroy src/service.ts\"]]\n\t});\n\taction = \"destroy\";\n};\n/** `<entry>`/`--name`/`--fresh` only — no `--stage`/`--production` (local-dev spec § 6: a working directory has exactly one dev instance, no stages). */\nvar DevCommand = class extends Command {\n\tstatic paths = [[\"dev\"]];\n\tstatic usage = Command.Usage({\n\t\tdescription: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine, credential-free.\",\n\t\texamples: [[\"Run an app locally\", \"$0 dev src/service.ts\"]]\n\t});\n\tentry = Option.String({ name: \"entry\" });\n\tname = Option.String(\"--name\", { description: \"Override the root node's name — the dev instance's application name.\" });\n\tfresh = Option.Boolean(\"--fresh\", false, { description: \"Destroy the dev stack and wipe the dev state directory before starting.\" });\n\tasync execute() {\n\t\treturn 0;\n\t}\n};\nvar LogCommand = class extends Command {\n\tstatic paths = [[\"log\"]];\n\tstatic usage = Command.Usage({\n\t\tdescription: \"Tail the merged logs of the locally-running application whose root node is <entry>'s default export.\",\n\t\texamples: [[\"Tail every service\", \"$0 log src/service.ts\"], [\"Tail one service\", \"$0 log src/service.ts catalog.service\"]]\n\t});\n\tentry = Option.String({ name: \"entry\" });\n\taddress = Option.String({\n\t\tname: \"address\",\n\t\trequired: false\n\t});\n\tname = Option.String(\"--name\", { description: \"Override the root node's name — the dev instance's application name.\" });\n\ttail = Option.String(\"--tail\", { description: `How many trailing history lines to show before live output (default ${String(DEFAULT_LOG_TAIL)}).` });\n\tasync execute() {\n\t\treturn 0;\n\t}\n};\nfunction buildCli() {\n\treturn Cli.from([\n\t\tDeployCommand,\n\t\tDestroyCommand,\n\t\tDevCommand,\n\t\tLogCommand\n\t], {\n\t\tbinaryName: BINARY_NAME,\n\t\tbinaryLabel: \"The prisma-composer deploy CLI\"\n\t});\n}\n/** Thrown internally when the user explicitly asked for `--help`/`-h` — run() prints it to stdout and exits 0; not a usage error. */\nvar HelpRequested = class extends Error {};\n/** Duck-typed: clipanion's UnknownSyntaxError isn't re-exported, so match its name + clipanion.type discriminator (mirrors prisma-next's migration-cli.ts). */\nfunction isUnknownSyntaxError(error) {\n\tif (!(error instanceof Error) || error.name !== \"UnknownSyntaxError\") return false;\n\tconst meta = error.clipanion;\n\treturn typeof meta === \"object\" && meta !== null && meta.type === \"none\";\n}\n/** `log`'s default backlog: an empty screen reads as broken, so show a little recent history before going live. */\nconst DEFAULT_LOG_TAIL = 20;\n/** Exported for direct testing (main.test.ts) — not part of the package's public barrel (see index.ts). */\nfunction parseArgs(argv) {\n\tconst cli = buildCli();\n\tlet command;\n\ttry {\n\t\tcommand = cli.process([...argv]);\n\t} catch (error) {\n\t\tif (isUnknownSyntaxError(error) || error instanceof UsageError) throw new UsageError(cli.usage(null, { detailed: true }));\n\t\tthrow error;\n\t}\n\tif (command instanceof DeployCommand || command instanceof DestroyCommand) return {\n\t\tcommand: command.action,\n\t\tentry: command.entry,\n\t\tname: command.name,\n\t\tstage: command.stage,\n\t\tproduction: command.production,\n\t\tfresh: false\n\t};\n\tif (command instanceof DevCommand) return {\n\t\tcommand: \"dev\",\n\t\tentry: command.entry,\n\t\tname: command.name,\n\t\tstage: void 0,\n\t\tproduction: false,\n\t\tfresh: command.fresh\n\t};\n\tif (command instanceof LogCommand) {\n\t\tconst tail = command.tail === void 0 ? DEFAULT_LOG_TAIL : Number.parseInt(command.tail, 10);\n\t\tif (Number.isNaN(tail) || tail < 0) throw new UsageError(\"`--tail` must be a non-negative integer.\");\n\t\treturn {\n\t\t\tcommand: \"log\",\n\t\t\tentry: command.entry,\n\t\t\tname: command.name,\n\t\t\tstage: void 0,\n\t\t\tproduction: false,\n\t\t\tfresh: false,\n\t\t\taddress: command.address,\n\t\t\ttail\n\t\t};\n\t}\n\tif (argv.includes(\"--help\") || argv.includes(\"-h\")) throw new HelpRequested(cli.usage(null, { detailed: true }));\n\tthrow new UsageError(cli.usage(null, { detailed: true }));\n}\n/** Destroy must name its target explicitly — no silent default to production (spec §10). */\nfunction effectiveStage(args) {\n\tif (args.command === \"deploy\") {\n\t\tif (args.production) throw new CliError(\"--production is only valid with `destroy`; `deploy` targets production by default (omit --stage).\");\n\t\treturn args.stage;\n\t}\n\tif (args.stage !== void 0 && args.production) throw new CliError(\"Pass either --stage <name> or --production to `destroy`, not both.\");\n\tif (args.stage === void 0 && !args.production) throw new CliError(\"`destroy` requires an explicit target: --stage <name> to tear down a branch environment, or --production to tear down the production environment.\");\n\treturn args.production ? void 0 : args.stage;\n}\nconst ALCHEMY_STATE_DIR = \".alchemy\";\n/** Warns (doesn't fail) when destroy finds no local deploy state under cwd — likely wrong directory or nothing deployed yet. */\nfunction warnIfNoLocalDeployState(cwd) {\n\tconst stateDir = path.join(cwd, ALCHEMY_STATE_DIR);\n\tif (!(fs.existsSync(stateDir) && fs.readdirSync(stateDir).length > 0)) console.warn(`\\nNo prior deploy state under ${cwd} — if you deployed from a different directory, run destroy from there; otherwise this is a no-op.`);\n}\n/** Runs the full pipeline; returns the process exit code. */\nasync function run(argv, deps = {}) {\n\tlet args;\n\ttry {\n\t\targs = parseArgs(argv);\n\t} catch (error) {\n\t\tif (error instanceof HelpRequested) {\n\t\t\tconsole.log(error.message);\n\t\t\treturn 0;\n\t\t}\n\t\tthrow error;\n\t}\n\tif (args.command === \"dev\") return runDev(args, deps);\n\tif (args.command === \"log\") return runLog({\n\t\tentry: args.entry,\n\t\tname: args.name,\n\t\taddress: args.address,\n\t\ttail: args.tail ?? DEFAULT_LOG_TAIL\n\t}, { config: deps.config });\n\tconst stage = effectiveStage(args);\n\tif (stage !== void 0) validateStageName(stage);\n\tconst cwd = process.cwd();\n\tif (args.command === \"destroy\") warnIfNoLocalDeployState(cwd);\n\tconst pipelineDeps = {\n\t\trunAssembler: deps.runAssembler,\n\t\tconfig: deps.config\n\t};\n\tconst onAssembleError = args.command === \"destroy\" ? (error) => new CliError(`${error.message}\\n\\ndestroy evaluates the same stack program as deploy, which packages the built artifacts — so the app must be built first. Run the build, then retry the destroy.`) : void 0;\n\tconst { configPath, config, entryModule, graph, name, assembled } = await runPipeline(args.entry, args.name, cwd, pipelineDeps, onAssembleError);\n\tconst containers = /* @__PURE__ */ new Map();\n\tfor (const extension of config.extensions) {\n\t\tif (extension.container === void 0) continue;\n\t\ttry {\n\t\t\tif (args.command === \"deploy\") containers.set(extension.id, await extension.container.ensure({\n\t\t\t\tappName: name,\n\t\t\t\tstage\n\t\t\t}));\n\t\t\telse {\n\t\t\t\tconst instance = await extension.container.locate({\n\t\t\t\t\tappName: name,\n\t\t\t\t\tstage\n\t\t\t\t});\n\t\t\t\tif (instance === void 0) throw new CliError(`Nothing deployed for ${name}${stage !== void 0 ? `/${stage}` : \"\"} — deploy it first.`);\n\t\t\t\tcontainers.set(extension.id, instance);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n\t\t}\n\t}\n\tif (args.command === \"deploy\") for (const extension of config.extensions) {\n\t\tif (extension.preflight === void 0) continue;\n\t\ttry {\n\t\t\tawait extension.preflight({\n\t\t\t\tgraph,\n\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\tstage\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthrow error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n\t\t}\n\t}\n\tconst stackPath = writeStackFile({\n\t\tentryPath: entryModule.path,\n\t\tcwd,\n\t\tconfigPath,\n\t\tname,\n\t\tassembled\n\t});\n\ttry {\n\t\tconst status = (deps.alchemy ?? runAlchemy)({\n\t\t\tcommand: args.command,\n\t\t\tstackFileRelativePath: GENERATED_STACK_RELATIVE_PATH,\n\t\t\tcwd,\n\t\t\tstage,\n\t\t\tcontainerEnv: containerEnv(containers)\n\t\t});\n\t\tif (status !== 0) {\n\t\t\tconsole.error(`\\nGenerated stack file: ${stackPath}`);\n\t\t\tconsole.error(`Run \\`alchemy ${args.command} ${GENERATED_STACK_RELATIVE_PATH} --yes\\` from ${cwd} to reproduce this directly.`);\n\t\t\treturn status;\n\t\t}\n\t\tif (args.command === \"destroy\") {\n\t\t\tfor (const extension of config.extensions) {\n\t\t\t\tif (extension.teardown === void 0) continue;\n\t\t\t\ttry {\n\t\t\t\t\tawait extension.teardown({\n\t\t\t\t\t\tcontainer: containers.get(extension.id),\n\t\t\t\t\t\tstage\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const extension of config.extensions) {\n\t\t\t\tif (extension.container === void 0) continue;\n\t\t\t\tconst instance = containers.get(extension.id);\n\t\t\t\tif (instance === void 0) continue;\n\t\t\t\ttry {\n\t\t\t\t\tawait extension.container.remove(instance);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow error instanceof CliError ? error : new CliError(error instanceof Error ? error.message : String(error));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn status;\n\t} catch (error) {\n\t\tconsole.error(`\\nGenerated stack file: ${stackPath}`);\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/cli.ts\n/**\n* Run the `prisma-composer` CLI end to end: dispatch `argv`, map errors to exit\n* codes. Shared by this package's `bin` and the unscoped `prisma-composer` launcher.\n*/\nasync function cli(argv = process.argv.slice(2)) {\n\ttry {\n\t\tprocess.exitCode = await run(argv);\n\t} catch (error) {\n\t\tif (error instanceof UsageError) {\n\t\t\tconsole.error(error.message);\n\t\t\tprocess.exitCode = 1;\n\t\t\treturn;\n\t\t}\n\t\tconsole.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n\t\tprocess.exitCode = 1;\n\t}\n}\n//#endregion\nexport { resolveAlchemyBin as a, CliError as c, writeStackFile as i, run as n, runAlchemy as o, renderStackFile as r, loadEntry as s, cli as t };\n\n//# sourceMappingURL=cli-CH8Ewf_a.mjs.map","#!/usr/bin/env node\nimport { t as cli } from \"./cli-CH8Ewf_a.mjs\";\n//#region src/bin.ts\ncli();\n//#endregion\nexport {};\n\n//# sourceMappingURL=bin.mjs.map"],"x_google_ignoreList":[8,9,10],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,SAAS,oBAAoB,aAAa;CACzC,OAAO,6BAA6B,YAAY,YAAY,CAAC,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC,QAAQ,YAAY,EAAE;AACjH;AACA,SAAS,eAAe,GAAG,GAAG,SAAS;CACtC,uBAAuB,IAAI,MAAM,kBAAkB,EAAE,SAAS,EAAE,qDAAqD,QAAQ,kCAAkC;AAChK;AACA,SAAS,oBAAoB,aAAa;CACzC,uBAAuB,IAAI,MAAM,cAAc,YAAY,qHAAqH;AACjL;;AAEA,SAAS,aAAa,WAAW;CAChC,MAAM,MAAM,CAAC;CACb,MAAM,iCAAiC,IAAI,IAAI;CAC/C,KAAK,MAAM,CAAC,aAAa,aAAa,WAAW;EAChD,MAAM,UAAU,oBAAoB,WAAW;EAC/C,MAAM,QAAQ,eAAe,IAAI,OAAO;EACxC,IAAI,UAAU,KAAK,GAAG,MAAM,eAAe,OAAO,aAAa,OAAO;EACtE,eAAe,IAAI,SAAS,WAAW;EACvC,MAAM,aAAa,SAAS,UAAU;EACtC,IAAI,WAAW,WAAW,GAAG,M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