@prisma/composer 0.1.0 → 0.2.0

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 (55) hide show
  1. package/dist/app-config-DJdU4ubR-BwioNK8j.d.mts +411 -0
  2. package/dist/assertions.d.mts +1 -1
  3. package/dist/bin.mjs +166 -256
  4. package/dist/bin.mjs.map +1 -1
  5. package/dist/casts.d.mts +1 -1
  6. package/dist/config-ByZICgry.d.mts +1 -0
  7. package/dist/config.d.mts +3 -2
  8. package/dist/config.mjs +2 -1
  9. package/dist/config.mjs.map +1 -1
  10. package/dist/container-transport-DKmKg5JQ-DKWs0ubK.mjs +45 -0
  11. package/dist/container-transport-DKmKg5JQ-DKWs0ubK.mjs.map +1 -0
  12. package/dist/deploy-ByZICgry.d.mts +1 -0
  13. package/dist/deploy.d.mts +3 -2
  14. package/dist/deploy.mjs +181 -23
  15. package/dist/deploy.mjs.map +1 -1
  16. package/dist/{dist-zBU8ASQW.mjs → dist-B0axxnBf.mjs} +16 -4
  17. package/dist/dist-B0axxnBf.mjs.map +1 -0
  18. package/dist/graph-B7NcPiOr-aSUOCGTH.d.mts +18 -0
  19. package/dist/{graph-BYdCQKya-BI0njTow.mjs → graph-BmrUEdo9-6Oq1hSmS.mjs} +102 -9
  20. package/dist/graph-BmrUEdo9-6Oq1hSmS.mjs.map +1 -0
  21. package/dist/{config-ob5OhCSP-sP3GW3uu.d.mts → graph-types-BgT9UEdm-Bz-_OcJH.d.mts} +205 -114
  22. package/dist/{index-CZSc9drz.d.mts → index-B2DJ5CN4.d.mts} +5 -20
  23. package/dist/index.d.mts +4 -3
  24. package/dist/index.mjs +3 -3
  25. package/dist/{index-Dh4Zro0y.d.mts → nextjs-DLyeRR7M-B9ukbB2L.d.mts} +6 -5
  26. package/dist/nextjs-control.d.mts +6 -5
  27. package/dist/nextjs-control.mjs +7 -10
  28. package/dist/nextjs-control.mjs.map +1 -1
  29. package/dist/nextjs.d.mts +2 -2
  30. package/dist/nextjs.mjs.map +1 -1
  31. package/dist/node-control.d.mts +5 -3
  32. package/dist/node-control.mjs +96 -24
  33. package/dist/node-control.mjs.map +1 -1
  34. package/dist/node.d.mts +18 -5
  35. package/dist/node.mjs +2 -1
  36. package/dist/node.mjs.map +1 -1
  37. package/dist/report.d.mts +17 -0
  38. package/dist/report.mjs +79 -0
  39. package/dist/report.mjs.map +1 -0
  40. package/dist/service-rpc.d.mts +61 -0
  41. package/dist/service-rpc.mjs +353 -0
  42. package/dist/service-rpc.mjs.map +1 -0
  43. package/dist/testing.d.mts +2 -3
  44. package/package.json +18 -17
  45. package/dist/app-config-BUqyK6N6-CVq3uvHF.d.mts +0 -188
  46. package/dist/config-BVVgDSdq.d.mts +0 -1
  47. package/dist/deploy-BVVgDSdq.d.mts +0 -1
  48. package/dist/dist-zBU8ASQW.mjs.map +0 -1
  49. package/dist/graph-BYdCQKya-BI0njTow.mjs.map +0 -1
  50. package/dist/rpc.d.mts +0 -43
  51. package/dist/rpc.mjs +0 -132
  52. package/dist/rpc.mjs.map +0 -1
  53. package/dist/tsdown.d.mts +0 -9
  54. package/dist/tsdown.mjs +0 -35
  55. package/dist/tsdown.mjs.map +0 -1
@@ -1,5 +1,4 @@
1
1
  import { StandardSchemaV1 } from "@standard-schema/spec";
2
-
3
2
  //#region ../../0-framework/0-foundation/foundation/dist/secret.d.mts
4
3
  //#region src/secret.d.ts
5
4
  /**
@@ -23,9 +22,111 @@ declare class SecretBox<T> {
23
22
  [Symbol.toPrimitive](): string;
24
23
  }
25
24
  /** The common case: a secret string. */
26
- type SecretString = SecretBox<string>; //#endregion
25
+ type SecretString = SecretBox<string>;
26
+ //#endregion
27
+ //#region ../../0-framework/1-core/core/dist/graph-types-BgT9UEdm.d.mts
28
+ //#region src/config.d.ts
29
+ /**
30
+ * A declared config param — pure data: a caller-owned Standard Schema
31
+ * (ADR-0018) plus a few framework facets. The framework carries the schema,
32
+ * infers the value type from it, and validates with it, without ever
33
+ * enumerating permitted shapes. Turning a value into stored config and back is
34
+ * the deploy target's job, not the param's (ADR-0019) — the same split RPC
35
+ * uses: schema on the declaration, wire owned by the mover.
36
+ */
37
+ interface ConfigParam<S extends StandardSchemaV1 = StandardSchemaV1> {
38
+ readonly schema: S;
39
+ readonly optional?: boolean;
40
+ readonly default?: StandardSchemaV1.InferOutput<S>;
41
+ /**
42
+ * A framework-minted value (ADR-0031): core resolves `provision.brand`
43
+ * against the consumer extension's `provisions` registry and mints this
44
+ * param's value per dependency edge. Opaque — core forwards the need and
45
+ * never reads its payload.
46
+ */
47
+ readonly provision?: ProvisionNeed;
48
+ }
49
+ type Params = Record<string, ConfigParam>;
50
+ /** What implementations receive — undefined only for optional params with no default. */
51
+ type Values<P extends Params> = { readonly [K in keyof P]: P[K]['optional'] extends true ? undefined extends P[K]['default'] ? StandardSchemaV1.InferOutput<P[K]['schema']> | undefined : StandardSchemaV1.InferOutput<P[K]['schema']> : StandardSchemaV1.InferOutput<P[K]['schema']>; };
52
+ /**
53
+ * The connection face of a dependency: declared params (data) and how
54
+ * validated values become a client (the hydrate behavior slot). Both P and C
55
+ * are INFERRED — the declaration types hydrate's input; the factory types the
56
+ * loaded dep.
57
+ */
58
+ interface Connection<P extends Params = Params, C = unknown> {
59
+ readonly params: P;
60
+ hydrate(values: Values<P>): C | Promise<C>;
61
+ }
62
+ /**
63
+ * The enumerable config surface of a service — derivable from the graph
64
+ * alone, nothing booted, no platform keys. The introspection artifact (values
65
+ * absent). `schema` is a data-only projection of the param's Standard Schema
66
+ * (JSON Schema when the vendor supports the optional conversion, a `{ vendor }`
67
+ * tag otherwise) — never the param's functions. Physical locations are the
68
+ * target pack's business. Secrets are not here — they live on their own slot.
69
+ */
70
+ interface ConfigDeclaration {
71
+ readonly owner: 'service' | {
72
+ readonly input: string;
73
+ };
74
+ readonly name: string;
75
+ readonly schema: Readonly<Record<string, unknown>>;
76
+ readonly optional: boolean;
77
+ readonly default: unknown;
78
+ }
79
+ /**
80
+ * The resolved, typed configuration of one service — what crosses the
81
+ * core→pack boundary. Core builds it at deploy (leaf values are provisioning
82
+ * refs, so the env writes depend on the resources/producer — the ordering
83
+ * edges); the pack serializes it, and at boot reconstructs the identical
84
+ * structure with concrete values. Both forms conform to the shape from
85
+ * configOf. Core never stringifies.
86
+ */
87
+ interface Config {
88
+ readonly service: Readonly<Record<string, unknown>>;
89
+ readonly inputs: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
90
+ }
91
+ /**
92
+ * Enumerates every config param the service declares: each input's connection
93
+ * params, then the service's own params. Pure — reads `root.inputs`/`params`
94
+ * directly, executes nothing but the (also pure) schema projection. Deliberately
95
+ * does not go through `Load`: a service's connection-end inputs are legitimately
96
+ * unwired from its own point of view (wiring is an enclosing module's concern),
97
+ * and this introspects one service's declared shape regardless of how — or
98
+ * whether — it composes into a larger graph.
99
+ */
100
+ declare function configOf(root: ServiceNode): readonly ConfigDeclaration[];
101
+ /**
102
+ * The app's provision manifest: every secret binding the root resolved across
103
+ * the graph (ADR-0029) — an opaque, target-defined source per service secret
104
+ * slot; a deploy target's preflight reads its own payload. Pure graph
105
+ * introspection, TARGET-AGNOSTIC — the target consumes it to verify each secret
106
+ * exists on the platform before deploy. The values are provisioned out-of-band.
107
+ */
108
+ declare function provisionManifest(graph: Graph): readonly SecretBinding[];
109
+ /**
110
+ * The app's param-binding manifest: every param a `provision()` call bound —
111
+ * literal or an opaque, target-defined `ParamSource` — at the address that
112
+ * declared it. The param sibling of `provisionManifest`, for a deploy
113
+ * target's own preflight to consume (D2). Pure graph introspection,
114
+ * TARGET-AGNOSTIC; a param this manifest omits simply falls back to its own
115
+ * `default` at `buildConfig`.
116
+ */
117
+ declare function paramManifest(graph: Graph): readonly ParamBinding[];
118
+ interface ParamOptions<T> {
119
+ readonly optional?: boolean;
120
+ readonly default?: T;
121
+ readonly provision?: ProvisionNeed;
122
+ }
123
+ /** A string-valued param. */
124
+ declare function string(opts?: ParamOptions<string>): ConfigParam<StandardSchemaV1<string, string>>;
125
+ /** A number-valued param. */
126
+ declare function number(opts?: ParamOptions<number>): ConfigParam<StandardSchemaV1<number, number>>;
127
+ /** A param over any caller-supplied Standard Schema — a structured `jobs`, say. */
128
+ declare function param<S extends StandardSchemaV1>(schema: S, opts?: ParamOptions<StandardSchemaV1.InferOutput<S>>): ConfigParam<S>;
27
129
  //#endregion
28
- //#region ../../0-framework/1-core/core/dist/config-ob5OhCSP.d.mts
29
130
  //#region src/contract.d.ts
30
131
  /**
31
132
  * A Contract is the declared interface of a service-to-service dependency: a
@@ -34,13 +135,14 @@ type SecretString = SecretBox<string>; //#endregion
34
135
  * `Cmp`, checked at `ModuleBuilder.provision`'s call site (node.ts); `satisfies`
35
136
  * is its runtime mirror, called at Load (graph.ts). Correctness comes from
36
137
  * the kind's builder shaping `Cmp` so assignability means the right thing —
37
- * see @prisma/composer/rpc's `contract()`/`rpc()`.
138
+ * see @prisma/composer/service-rpc's `contract()`/`rpc()`.
38
139
  */
39
140
  interface Contract<Kind extends string, Cmp> {
40
141
  readonly kind: Kind;
41
142
  readonly __cmp: Cmp;
42
143
  satisfies(required: Contract<Kind, unknown>): boolean;
43
- } //#endregion
144
+ }
145
+ //#endregion
44
146
  //#region src/node.d.ts
45
147
  declare const NODE: unique symbol;
46
148
  declare const SECRET_NEED: unique symbol;
@@ -59,15 +161,53 @@ interface SecretSource<T = unknown> {
59
161
  readonly payload: T;
60
162
  }
61
163
  /** What `provision(node, { secrets })` supplies: one source per declared secret slot. */
62
- type SecretBindings<S extends Secrets> = { [K in keyof S]: SecretSource };
164
+ type SecretBindings<S extends Secrets> = { [K in keyof S]: SecretSource; };
63
165
  /** What `secrets()` returns: one redacting SecretBox per declared slot. */
64
- type SecretValues<S extends Secrets> = { readonly [K in keyof S]: SecretString };
166
+ type SecretValues<S extends Secrets> = { readonly [K in keyof S]: SecretString; };
65
167
  /** Declares a secret NEED. Nameless — the platform name is bound at the root via `envSecret`. */
66
168
  declare function secret(): SecretNeed;
67
169
  /** 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. */
68
170
  declare function secretSource<T>(payload: T): SecretSource<T>;
69
171
  /** True if `value` is a secret source (an `envSecret` result or a forwarded ctx.secrets ref). */
70
172
  declare function isSecretSource(value: unknown): value is SecretSource;
173
+ declare const PROVISION_NEED: unique symbol;
174
+ /** A param value the framework mints. Opaque to core: it forwards the payload to the resolved provisioner and never reads it (ADR-0031). */
175
+ interface ProvisionNeed<T = unknown> {
176
+ readonly [PROVISION_NEED]: true;
177
+ /** Selects the provisioner in an extension's `provisions` registry. */
178
+ readonly brand: symbol;
179
+ /** Provisioner-defined; core never reads it. */
180
+ readonly payload: T;
181
+ }
182
+ /** Builds an opaque provisioning need — the declaring package's own brand plus whatever payload its provisioner reads back. */
183
+ declare function provisionNeed<T = undefined>(brand: symbol, payload?: T): ProvisionNeed<T>;
184
+ /** True if `value` is a provisioning need (a `provisionNeed()` result). */
185
+ declare function isProvisionNeed(value: unknown): value is ProvisionNeed;
186
+ declare const PARAM_SOURCE: unique symbol;
187
+ declare const PARAM_NEED: unique symbol;
188
+ /** The wiring value bound to a param at provision time: a target-defined payload core forwards but never inspects. A target (e.g. @prisma/composer-prisma-cloud's `envParam`) builds one via `paramSource()`. */
189
+ interface ParamSource<T = unknown> {
190
+ readonly [PARAM_SOURCE]: true;
191
+ /** Target-defined. Core never reads this; the target that authored the source reads it back. */
192
+ readonly payload: T;
193
+ }
194
+ /** 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. */
195
+ declare function paramSource<T>(payload: T): ParamSource<T>;
196
+ /** True if `value` is a param source (an `envParam` result or a forwarded ctx.params ref). */
197
+ declare function isParamSource(value: unknown): value is ParamSource;
198
+ /** A module's declared param-forwarding slot — nameless, schema-less; the root (or an ancestor module) binds a `ParamSource` and the topology forwards it into a child's real, schema-bearing param. */
199
+ interface ParamNeed {
200
+ readonly [PARAM_NEED]: true;
201
+ readonly kind: 'param';
202
+ }
203
+ /** A module's param-forwarding slots: name → the need it declares. */
204
+ type ParamNeeds = Record<string, ParamNeed>;
205
+ /** Declares a module param-forwarding NEED. Nameless — bound to a `ParamSource` by an enclosing scope and forwarded into a child's real param. */
206
+ declare function paramNeed(): ParamNeed;
207
+ /** What `provision(service, { params })` accepts per declared param: a literal (schema-validated when config is built) or an opaque `ParamSource`, taking precedence over `param.default`. Every entry is optional — an unbound param falls back to its `default`. */
208
+ type ParamBindings<P extends Params> = { readonly [K in keyof P]?: StandardSchemaV1.InferOutput<P[K]['schema']> | ParamSource; };
209
+ /** What `provision(moduleChild, { params })` accepts per declared `ParamNeed`: a `ParamSource` only — a need carries no schema to validate a literal against. */
210
+ type ParamNeedBindings<PN extends ParamNeeds> = { readonly [K in keyof PN]?: ParamSource; };
71
211
  /** Opaque `Contract<any, any>` bound shared by every node/port type that doesn't care which contract. */
72
212
  type AnyContract = Contract<any, any>;
73
213
  /** How a service's app becomes a runnable artifact — the build descriptor's routing key (`extension`/`type`) plus paths resolved relative to the authoring module. */
@@ -148,7 +288,7 @@ interface DependencyEnd<C = unknown, Req = unknown> {
148
288
  readonly required: Req | undefined;
149
289
  }
150
290
  /** A Module: the same Deps/Expose boundary a service has, around transparent wiring instead of a black-box body — its `body` runs at Load, not at authoring. */
151
- interface ModuleNode<D extends Deps = Deps, E extends Expose = Expose, S extends Secrets = Secrets> {
291
+ interface ModuleNode<D extends Deps = Deps, E extends Expose = Expose, S extends Secrets = Secrets, PN extends ParamNeeds = ParamNeeds> {
152
292
  readonly [NODE]: true;
153
293
  readonly kind: 'module';
154
294
  /** Human-readable, given at authoring — logs/diagnostics only. */
@@ -156,18 +296,22 @@ interface ModuleNode<D extends Deps = Deps, E extends Expose = Expose, S extends
156
296
  readonly deps: D;
157
297
  /** Declared secret input slots (authored as `secrets`) — forwarded to internals via `ctx.secrets` (ADR-0029). */
158
298
  readonly secretSlots: S;
299
+ /** Declared param-forwarding slots (authored as `params`) — forwarded to internals via `ctx.params`, the same rail secrets ride on. */
300
+ readonly paramSlots: PN;
159
301
  readonly expose: E;
160
- body(ctx: ModuleContext<D, S>): ModuleOutputs<E> | void;
302
+ body(ctx: ModuleContext<D, S, PN>): ModuleOutputs<E> | void;
161
303
  }
162
304
  /**
163
305
  * What a module's body receives: its declared inputs as forwardable wiring
164
306
  * values, plus `provision` to register the owned services/modules it wires them into.
165
307
  */
166
- interface ModuleContext<D extends Deps, S extends Secrets = Secrets> {
308
+ interface ModuleContext<D extends Deps, S extends Secrets = Secrets, PN extends ParamNeeds = ParamNeeds> {
167
309
  /** The module's declared inputs as wiring values — pass them into provision(). */
168
- readonly inputs: { [K in keyof D]: InputRef<D[K]> };
310
+ readonly inputs: { [K in keyof D]: InputRef<D[K]>; };
169
311
  /** The module's declared secret slots as forwardable sources — pass them into a child's `secrets` (ADR-0029). */
170
- readonly secrets: { readonly [K in keyof S]: SecretSource };
312
+ readonly secrets: { readonly [K in keyof S]: SecretSource; };
313
+ /** The module's declared param-forwarding slots as forwardable sources — pass them into a child's `params`. */
314
+ readonly params: { readonly [K in keyof PN]: ParamSource; };
171
315
  /** Registers an owned child (service or module) under a stable id. */
172
316
  readonly provision: ModuleBuilder['provision'];
173
317
  }
@@ -178,7 +322,7 @@ interface ModuleContext<D extends Deps, S extends Secrets = Secrets> {
178
322
  */
179
323
  type InputRef<DE> = DE extends DependencyEnd<any, infer Req extends AnyContract> ? RefPort<Req> : never;
180
324
  /** One ref-port per declared expose key, contract-checked against `E` (mirrors `Wiring`'s `NoInfer` use). */
181
- type ModuleOutputs<E extends Expose> = { [P in keyof E]: RefPort<NoInfer<E[P]>> };
325
+ type ModuleOutputs<E extends Expose> = { [P in keyof E]: RefPort<NoInfer<E[P]>>; };
182
326
  /**
183
327
  * A provisioned producer's port as a wiring-time value: its contract, tagged
184
328
  * with which provider produced it (`__providerId`, read by Load to resolve the edge).
@@ -193,7 +337,7 @@ type RefPort<C extends AnyContract> = C & {
193
337
  */
194
338
  type ProvisionedRef<E extends Expose = Record<never, never>> = {
195
339
  readonly id: string;
196
- } & { readonly [P in keyof E]: RefPort<E[P]> };
340
+ } & { readonly [P in keyof E]: RefPort<E[P]>; };
197
341
  /** A DependencyEnd's required contract (unknown for an untyped end). */
198
342
  type ReqOf<DE> = DE extends DependencyEnd<any, infer Req> ? Req : never;
199
343
  /**
@@ -203,27 +347,36 @@ type ReqOf<DE> = DE extends DependencyEnd<any, infer Req> ? Req : never;
203
347
  * into a nested `provision()` call — the same value shape a producer's own
204
348
  * exposed port carries.
205
349
  */
206
- type DepBindings<D extends Deps> = { [K in keyof D]: NoInfer<ReqOf<D[K]>> | InputRef<D[K]> };
350
+ type DepBindings<D extends Deps> = { [K in keyof D]: NoInfer<ReqOf<D[K]>> | InputRef<D[K]>; };
207
351
  /**
208
352
  * `provision`'s trailing options: an explicit `id` (default: the node's own
209
353
  * `name`) plus, for a node that declares dependency slots, the `deps` that
210
354
  * satisfy them. `deps` is required exactly when the node has slots —
211
355
  * `[keyof D] extends [never]` is the "no slots" test — so a dependency can
212
356
  * never be left unwired at compile time. The whole object is therefore
213
- * optional for a slot-less node and required for one with slots.
357
+ * optional for a slot-less node and required for one with slots. `params` is
358
+ * always optional — a bound value overrides `param.default`, but a param may
359
+ * fall back to its default (or be `optional`) instead, unlike `deps`/`secrets`.
360
+ * `PB` is the params-binding map appropriate to the target: `ParamBindings<P>`
361
+ * for a service's real, schema-bearing params; `ParamNeedBindings<PN>` for a
362
+ * child module's nameless forwarding slots.
214
363
  */
215
- type ProvisionArgs<D extends Deps, S extends Secrets> = [keyof D] extends [never] ? [keyof S] extends [never] ? [opts?: {
364
+ type ProvisionArgs<D extends Deps, S extends Secrets, PB> = [keyof D] extends [never] ? [keyof S] extends [never] ? [opts?: {
216
365
  id?: string;
366
+ params?: PB;
217
367
  }] : [opts: {
218
368
  id?: string;
219
369
  secrets: SecretBindings<S>;
370
+ params?: PB;
220
371
  }] : [keyof S] extends [never] ? [opts: {
221
372
  id?: string;
222
373
  deps: DepBindings<D>;
374
+ params?: PB;
223
375
  }] : [opts: {
224
376
  id?: string;
225
377
  deps: DepBindings<D>;
226
378
  secrets: SecretBindings<S>;
379
+ params?: PB;
227
380
  }];
228
381
  interface ModuleBuilder {
229
382
  /** Provisions an owned resource; its id defaults to the node's `name`. */
@@ -232,26 +385,28 @@ interface ModuleBuilder {
232
385
  }): {
233
386
  readonly id: string;
234
387
  } & RefPort<C>;
235
- /** Registers an owned service; its id defaults to the node's `name`; `deps`/`secrets` are required iff it declares them. */
236
- provision<D extends Deps, E extends Expose, S extends Secrets>(service: ServiceNode<D, any, E, S>, ...args: ProvisionArgs<D, S>): ProvisionedRef<E>;
388
+ /** Registers an owned service; its id defaults to the node's `name`; `deps`/`secrets` are required iff it declares them; a declared param may be bound (literal or `ParamSource`), overriding its default. */
389
+ provision<D extends Deps, P extends Params, E extends Expose, S extends Secrets>(service: ServiceNode<D, P, E, S>, ...args: ProvisionArgs<D, S, ParamBindings<P>>): ProvisionedRef<E>;
237
390
  /**
238
391
  * The service call with `deps`/`secrets` spelled out. `ProvisionArgs` above
239
392
  * cannot resolve while `D`/`S` are still unbound type parameters — a generic
240
393
  * wrapper like `cron()` provisioning a caller-supplied service — so that call
241
394
  * site resolves to this concrete overload instead.
242
395
  */
243
- provision<D extends Deps, E extends Expose, S extends Secrets>(service: ServiceNode<D, any, E, S>, opts: {
396
+ provision<D extends Deps, P extends Params, E extends Expose, S extends Secrets>(service: ServiceNode<D, P, E, S>, opts: {
244
397
  id?: string;
245
398
  deps: DepBindings<D>;
246
399
  secrets?: SecretBindings<S>;
400
+ params?: ParamBindings<P>;
247
401
  }): ProvisionedRef<E>;
248
- /** Registers an owned child module; its id defaults to the node's `name`; `deps`/`secrets` are required iff it declares them. */
249
- provision<D extends Deps, E extends Expose, S extends Secrets>(child: ModuleNode<D, E, S>, ...args: ProvisionArgs<D, S>): ProvisionedRef<E>;
402
+ /** Registers an owned child module; its id defaults to the node's `name`; `deps`/`secrets` are required iff it declares them; a declared param-forwarding slot may be bound to a `ParamSource`. */
403
+ provision<D extends Deps, E extends Expose, S extends Secrets, PN extends ParamNeeds>(child: ModuleNode<D, E, S, PN>, ...args: ProvisionArgs<D, S, ParamNeedBindings<PN>>): ProvisionedRef<E>;
250
404
  /** The child-module call with `deps`/`secrets` spelled out — the same generic-wrapper escape as the service overload above. */
251
- provision<D extends Deps, E extends Expose, S extends Secrets>(child: ModuleNode<D, E, S>, opts: {
405
+ provision<D extends Deps, E extends Expose, S extends Secrets, PN extends ParamNeeds>(child: ModuleNode<D, E, S, PN>, opts: {
252
406
  id?: string;
253
407
  deps: DepBindings<D>;
254
408
  secrets?: SecretBindings<S>;
409
+ params?: ParamNeedBindings<PN>;
255
410
  }): ProvisionedRef<E>;
256
411
  }
257
412
  /** Dependency map: name → the slot the service declares. Only declarations are admitted, never a concrete ResourceNode. */
@@ -259,7 +414,7 @@ type Deps = Record<string, DependencyEnd<any, any>>;
259
414
  /** Output-port map: name → the Contract a service exposes for others to depend on. */
260
415
  type Expose = Readonly<Record<string, AnyContract>>;
261
416
  type Hydrated<N> = N extends DependencyEnd<infer C, any> ? C : never;
262
- type HydratedDeps<D extends Deps> = { readonly [K in keyof D]: Hydrated<D[K]> };
417
+ type HydratedDeps<D extends Deps> = { readonly [K in keyof D]: Hydrated<D[K]>; };
263
418
  /**
264
419
  * Seals a node instance after its constructor has assigned all fields — the
265
420
  * last statement of a concrete node class's constructor. A free function, not
@@ -325,22 +480,24 @@ declare function dependency<P extends Params, C, Req = unknown>(def: {
325
480
  * closed-root shape — `module(name, body)` instead of `module(name, {}, () =>
326
481
  * ({}))`.
327
482
  */
328
- declare function module(name: string, body: (ctx: ModuleContext<Record<never, never>, Record<never, never>>) => void): ModuleNode<Record<never, never>, Record<never, never>, Record<never, never>>;
483
+ declare function module(name: string, body: (ctx: ModuleContext<Record<never, never>, Record<never, never>, Record<never, never>>) => void): ModuleNode<Record<never, never>, Record<never, never>, Record<never, never>, Record<never, never>>;
329
484
  /**
330
485
  * A module with a boundary: `deps` and/or `expose` declare what wires in and
331
486
  * out, the same way a service does. The body returns one port per `expose` key.
332
487
  */
333
- declare function module<D extends Deps = Record<never, never>, E extends Expose = Record<never, never>, S extends Secrets = Record<never, never>>(name: string, boundary: {
488
+ declare function module<D extends Deps = Record<never, never>, E extends Expose = Record<never, never>, S extends Secrets = Record<never, never>, PN extends ParamNeeds = Record<never, never>>(name: string, boundary: {
334
489
  deps?: D;
335
490
  secrets?: S;
491
+ params?: PN;
336
492
  expose?: E;
337
- }, body: (ctx: ModuleContext<D, S>) => ModuleOutputs<E> | void): ModuleNode<D, E, S>;
493
+ }, body: (ctx: ModuleContext<D, S, PN>) => ModuleOutputs<E> | void): ModuleNode<D, E, S, PN>;
338
494
  /**
339
495
  * True if `value` was constructed by this module's factories. Checks the
340
496
  * brand only, never a prototype — a graph may mix nodes from a different
341
497
  * installed copy of core (dual-package hazard).
342
498
  */
343
- declare function isNode(value: unknown): value is ServiceNode | ResourceNode | DependencyEnd | ModuleNode; //#endregion
499
+ declare function isNode(value: unknown): value is ServiceNode | ResourceNode | DependencyEnd | ModuleNode;
500
+ //#endregion
344
501
  //#region src/graph-types.d.ts
345
502
  /** Path-derived: root-scope children are bare ids ("auth", "db"); a nested module's own children dot-join under its address ("auth.db"). */
346
503
  type NodeId = string;
@@ -376,6 +533,22 @@ interface SecretBinding {
376
533
  /** The opaque source the root bound the slot to. Core never inspects it; the deploy target reads back its own payload. */
377
534
  readonly source: SecretSource;
378
535
  }
536
+ /**
537
+ * A resolved param binding: a `provision()` call bound a service's param
538
+ * slot to either a literal value or an opaque `ParamSource` — the non-secret
539
+ * sibling of `SecretBinding`. Unlike a secret, a param binding is not
540
+ * required for every declared param (a param may fall back to its own
541
+ * `default`), so this list only carries the ones a `provision()` call
542
+ * actually bound.
543
+ */
544
+ interface ParamBinding {
545
+ /** The graph address of the service that declares the param. */
546
+ readonly serviceAddress: NodeId;
547
+ /** The param name on that service. */
548
+ readonly slot: string;
549
+ /** A literal value (schema-validated by `buildConfig`) or an opaque `ParamSource` (the deploy target reads its own payload back) — check with `isParamSource`. Core never inspects a `ParamSource`'s payload. */
550
+ readonly binding: unknown;
551
+ }
379
552
  interface Graph {
380
553
  readonly root: GraphNode;
381
554
  /** Root + one per input, topo-ordered (deps first). */
@@ -383,95 +556,13 @@ interface Graph {
383
556
  readonly edges: readonly Edge[];
384
557
  /** Every service secret slot resolved to its root-bound opaque source. */
385
558
  readonly secrets: readonly SecretBinding[];
559
+ /** Every service param bound at provision — literal or source; unbound params are absent here and fall back to their `default` (see `buildConfig`). */
560
+ readonly params: readonly ParamBinding[];
386
561
  }
387
562
  /** Thrown by Load when the graph is malformed. */
388
563
  declare class LoadError extends Error {
389
564
  constructor(message: string);
390
- } //#endregion
391
- //#region src/config.d.ts
392
- /**
393
- * A declared config param — pure data: a caller-owned Standard Schema
394
- * (ADR-0018) plus a few framework facets. The framework carries the schema,
395
- * infers the value type from it, and validates with it, without ever
396
- * enumerating permitted shapes. Turning a value into stored config and back is
397
- * the deploy target's job, not the param's (ADR-0019) — the same split RPC
398
- * uses: schema on the declaration, wire owned by the mover.
399
- */
400
- interface ConfigParam<S extends StandardSchemaV1 = StandardSchemaV1> {
401
- readonly schema: S;
402
- readonly optional?: boolean;
403
- readonly default?: StandardSchemaV1.InferOutput<S>;
404
565
  }
405
- type Params = Record<string, ConfigParam>;
406
- /** What implementations receive — undefined only for optional params with no default. */
407
- type Values<P extends Params> = { readonly [K in keyof P]: P[K]['optional'] extends true ? undefined extends P[K]['default'] ? StandardSchemaV1.InferOutput<P[K]['schema']> | undefined : StandardSchemaV1.InferOutput<P[K]['schema']> : StandardSchemaV1.InferOutput<P[K]['schema']> };
408
- /**
409
- * The connection face of a dependency: declared params (data) and how
410
- * validated values become a client (the hydrate behavior slot). Both P and C
411
- * are INFERRED — the declaration types hydrate's input; the factory types the
412
- * loaded dep.
413
- */
414
- interface Connection<P extends Params = Params, C = unknown> {
415
- readonly params: P;
416
- hydrate(values: Values<P>): C | Promise<C>;
417
- }
418
- /**
419
- * The enumerable config surface of a service — derivable from the graph
420
- * alone, nothing booted, no platform keys. The introspection artifact (values
421
- * absent). `schema` is a data-only projection of the param's Standard Schema
422
- * (JSON Schema when the vendor supports the optional conversion, a `{ vendor }`
423
- * tag otherwise) — never the param's functions. Physical locations are the
424
- * target pack's business. Secrets are not here — they live on their own slot.
425
- */
426
- interface ConfigDeclaration {
427
- readonly owner: 'service' | {
428
- readonly input: string;
429
- };
430
- readonly name: string;
431
- readonly schema: Readonly<Record<string, unknown>>;
432
- readonly optional: boolean;
433
- readonly default: unknown;
434
- }
435
- /**
436
- * The resolved, typed configuration of one service — what crosses the
437
- * core→pack boundary. Core builds it at deploy (leaf values are provisioning
438
- * refs, so the env writes depend on the resources/producer — the ordering
439
- * edges); the pack serializes it, and at boot reconstructs the identical
440
- * structure with concrete values. Both forms conform to the shape from
441
- * configOf. Core never stringifies.
442
- */
443
- interface Config {
444
- readonly service: Readonly<Record<string, unknown>>;
445
- readonly inputs: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
446
- }
447
- /**
448
- * Enumerates every config param the service declares: each input's connection
449
- * params, then the service's own params. Pure — reads `root.inputs`/`params`
450
- * directly, executes nothing but the (also pure) schema projection. Deliberately
451
- * does not go through `Load`: a service's connection-end inputs are legitimately
452
- * unwired from its own point of view (wiring is an enclosing module's concern),
453
- * and this introspects one service's declared shape regardless of how — or
454
- * whether — it composes into a larger graph.
455
- */
456
- declare function configOf(root: ServiceNode): readonly ConfigDeclaration[];
457
- /**
458
- * The app's provision manifest: every secret binding the root resolved across
459
- * the graph (ADR-0029) — an opaque, target-defined source per service secret
460
- * slot; a deploy target's preflight reads its own payload. Pure graph
461
- * introspection, TARGET-AGNOSTIC — the target consumes it to verify each secret
462
- * exists on the platform before deploy. The values are provisioned out-of-band.
463
- */
464
- declare function provisionManifest(graph: Graph): readonly SecretBinding[];
465
- interface ParamOptions<T> {
466
- readonly optional?: boolean;
467
- readonly default?: T;
468
- }
469
- /** A string-valued param. */
470
- declare function string(opts?: ParamOptions<string>): ConfigParam<StandardSchemaV1<string, string>>;
471
- /** A number-valued param. */
472
- declare function number(opts?: ParamOptions<number>): ConfigParam<StandardSchemaV1<number, number>>;
473
- /** A param over any caller-supplied Standard Schema — a structured `jobs`, say. */
474
- declare function param<S extends StandardSchemaV1>(schema: S, opts?: ParamOptions<StandardSchemaV1.InferOutput<S>>): ConfigParam<S>; //#endregion
475
566
  //#endregion
476
- export { SecretNeed as A, isSecretSource as B, ProvisionedRef as C, RunnableServiceNode as D, ResourceNodeBase as E, Values as F, resource as G, number as H, configOf as I, service as J, secret as K, dependency as L, SecretValues as M, Secrets as N, SecretBinding as O, ServiceNode as P, freezeNode as R, Params as S, ResourceNode as T, param as U, module as V, provisionManifest as W, SecretBox as X, string as Y, SecretString as Z, ModuleBuilder as _, Connection as a, ModuleOutputs as b, Deps as c, Graph as d, GraphNode as f, LoadError as g, InputRef as h, ConfigParam as i, SecretSource as j, SecretBindings as k, Edge as l, HydratedDeps as m, Config as n, Contract as o, Hydrated as p, secretSource as q, ConfigDeclaration as r, DependencyEnd as s, BuildAdapter as t, Expose as u, ModuleContext as v, RefPort as w, NodeId as x, ModuleNode as y, isNode as z };
477
- //# sourceMappingURL=config-ob5OhCSP-sP3GW3uu.d.mts.map
567
+ export { paramManifest as $, ProvisionedRef as A, Secrets as B, ParamBindings as C, ParamSource as D, ParamNeeds as E, SecretBinding as F, freezeNode as G, Values as H, SecretBindings as I, isProvisionNeed as J, isNode as K, SecretNeed as L, ResourceNode as M, ResourceNodeBase as N, Params as O, RunnableServiceNode as P, param as Q, SecretSource as R, ParamBinding as S, ParamNeedBindings as T, configOf as U, ServiceNode as V, dependency as W, module as X, isSecretSource as Y, number as Z, ModuleBuilder as _, Connection as a, secret as at, ModuleOutputs as b, Deps as c, string as ct, Graph as d, paramNeed as et, GraphNode as f, LoadError as g, InputRef as h, ConfigParam as i, resource as it, RefPort as j, ProvisionNeed as k, Edge as l, SecretBox as lt, HydratedDeps as m, Config as n, provisionManifest as nt, Contract as o, secretSource as ot, Hydrated as p, isParamSource as q, ConfigDeclaration as r, provisionNeed as rt, DependencyEnd as s, service as st, BuildAdapter as t, paramSource as tt, Expose as u, SecretString as ut, ModuleContext as v, ParamNeed as w, NodeId as x, ModuleNode as y, SecretValues as z };
568
+ //# sourceMappingURL=graph-types-BgT9UEdm-Bz-_OcJH.d.mts.map
@@ -1,20 +1,5 @@
1
- import { M as SecretValues, N as Secrets, P as ServiceNode, c as Deps, d as Graph, m as HydratedDeps, n as Config, x as NodeId, y as ModuleNode } from "./config-ob5OhCSP-sP3GW3uu.mjs";
2
-
3
- //#region ../../0-framework/1-core/core/dist/graph-BCsfgIWh.d.mts
4
- //#region src/graph.d.ts
5
- /**
6
- * Builds the in-memory graph from a root node. A service root walks its own
7
- * `inputs`; a module root executes its body (wiring, not user code — the
8
- * designed exception to imports-run-nothing) and recursively flattens every
9
- * module it provisions into one graph of hierarchical addresses. A malformed
10
- * graph is a `LoadError` that names its fix; the individual validation rules
11
- * live with `loadService` / `loadModule` and are covered by name in the Load
12
- * tests. Executes nothing of the user's own code beyond module bodies.
13
- */
14
- declare function Load(root: ServiceNode | ModuleNode, opts?: {
15
- id?: NodeId;
16
- }): Graph; //#endregion
17
- //#endregion
1
+ import { B as Secrets, V as ServiceNode, c as Deps, m as HydratedDeps, n as Config, z as SecretValues } from "./graph-types-BgT9UEdm-Bz-_OcJH.mjs";
2
+ import "./graph-B7NcPiOr-aSUOCGTH.mjs";
18
3
  //#region ../../0-framework/1-core/core/dist/index.d.mts
19
4
  //#region src/hydrate.d.ts
20
5
  /**
@@ -41,7 +26,7 @@ declare function hydrateSync(root: ServiceNode, config: Config): HydratedDeps<De
41
26
  * so a secret is redacted by TYPE from here on. A declared slot missing from
42
27
  * `values` is a target contract violation, named loudly.
43
28
  */
44
- declare function hydrateSecrets(root: ServiceNode, values: Record<string, string>): SecretValues<Secrets>; //#endregion
29
+ declare function hydrateSecrets(root: ServiceNode, values: Record<string, string>): SecretValues<Secrets>;
45
30
  //#endregion
46
- export { Load as i, hydrateSecrets as n, hydrateSync as r, hydrate as t };
47
- //# sourceMappingURL=index-CZSc9drz.d.mts.map
31
+ export { hydrateSecrets as n, hydrateSync as r, hydrate as t };
32
+ //# sourceMappingURL=index-B2DJ5CN4.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
- import { A as SecretNeed, B as isSecretSource, C as ProvisionedRef, D as RunnableServiceNode, E as ResourceNodeBase, F as Values, G as resource, H as number, I as configOf, J as service, K as secret, L as dependency, M as SecretValues, N as Secrets, O as SecretBinding, P as ServiceNode, R as freezeNode, S as Params, T as ResourceNode, U as param, V as module, W as provisionManifest, X as SecretBox, Y as string, Z as SecretString, _ as ModuleBuilder, a as Connection, b as ModuleOutputs, c as Deps, d as Graph, f as GraphNode, g as LoadError, h as InputRef, i as ConfigParam, j as SecretSource, k as SecretBindings, l as Edge, m as HydratedDeps, n as Config, o as Contract, p as Hydrated, q as secretSource, r as ConfigDeclaration, s as DependencyEnd, t as BuildAdapter, u as Expose, v as ModuleContext, w as RefPort, x as NodeId, y as ModuleNode, z as isNode } from "./config-ob5OhCSP-sP3GW3uu.mjs";
2
- import { i as Load, n as hydrateSecrets, r as hydrateSync, t as hydrate } from "./index-CZSc9drz.mjs";
3
- export { type BuildAdapter, type Config, type ConfigDeclaration, type ConfigParam, type Connection, type Contract, type DependencyEnd, type Deps, type Edge, type Expose, type Graph, type GraphNode, type Hydrated, type HydratedDeps, type InputRef, Load, LoadError, type ModuleBuilder, type ModuleContext, type ModuleNode, type ModuleOutputs, type NodeId, type Params, type ProvisionedRef, type RefPort, type ResourceNode, ResourceNodeBase, type RunnableServiceNode, type SecretBinding, type SecretBindings, SecretBox, type SecretNeed, type SecretSource, type SecretString, type SecretValues, type Secrets, type ServiceNode, type Values, configOf, dependency, freezeNode, hydrate, hydrateSecrets, hydrateSync, isNode, isSecretSource, module, number, param, provisionManifest, resource, secret, secretSource, service, string };
1
+ import { $ as paramManifest, A as ProvisionedRef, B as Secrets, C as ParamBindings, D as ParamSource, E as ParamNeeds, F as SecretBinding, G as freezeNode, H as Values, I as SecretBindings, J as isProvisionNeed, K as isNode, L as SecretNeed, M as ResourceNode, N as ResourceNodeBase, O as Params, P as RunnableServiceNode, Q as param, R as SecretSource, S as ParamBinding, T as ParamNeedBindings, U as configOf, V as ServiceNode, W as dependency, X as module, Y as isSecretSource, Z as number, _ as ModuleBuilder, a as Connection, at as secret, b as ModuleOutputs, c as Deps, ct as string, d as Graph, et as paramNeed, f as GraphNode, g as LoadError, h as InputRef, i as ConfigParam, it as resource, j as RefPort, k as ProvisionNeed, l as Edge, lt as SecretBox, m as HydratedDeps, n as Config, nt as provisionManifest, o as Contract, ot as secretSource, p as Hydrated, q as isParamSource, r as ConfigDeclaration, rt as provisionNeed, s as DependencyEnd, st as service, t as BuildAdapter, tt as paramSource, u as Expose, ut as SecretString, v as ModuleContext, w as ParamNeed, x as NodeId, y as ModuleNode, z as SecretValues } from "./graph-types-BgT9UEdm-Bz-_OcJH.mjs";
2
+ import { t as Load } from "./graph-B7NcPiOr-aSUOCGTH.mjs";
3
+ import { n as hydrateSecrets, r as hydrateSync, t as hydrate } from "./index-B2DJ5CN4.mjs";
4
+ export { type BuildAdapter, type Config, type ConfigDeclaration, type ConfigParam, type Connection, type Contract, type DependencyEnd, type Deps, type Edge, type Expose, type Graph, type GraphNode, type Hydrated, type HydratedDeps, type InputRef, Load, LoadError, type ModuleBuilder, type ModuleContext, type ModuleNode, type ModuleOutputs, type NodeId, type ParamBinding, type ParamBindings, type ParamNeed, type ParamNeedBindings, type ParamNeeds, type ParamSource, type Params, type ProvisionNeed, type ProvisionedRef, type RefPort, type ResourceNode, ResourceNodeBase, type RunnableServiceNode, type SecretBinding, type SecretBindings, SecretBox, type SecretNeed, type SecretSource, type SecretString, type SecretValues, type Secrets, type ServiceNode, type Values, configOf, dependency, freezeNode, hydrate, hydrateSecrets, hydrateSync, isNode, isParamSource, isProvisionNeed, isSecretSource, module, number, param, paramManifest, paramNeed, paramSource, provisionManifest, provisionNeed, resource, secret, secretSource, service, string };
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as freezeNode, c as module, d as secretSource, f as service, i as dependency, l as resource, n as LoadError, o as isNode, r as ResourceNodeBase, s as isSecretSource, t as Load, u as secret } from "./graph-BYdCQKya-BI0njTow.mjs";
2
- import { a as number, c as string, i as hydrateSync, l as SecretBox, n as hydrate, o as param, r as hydrateSecrets, s as provisionManifest, t as configOf } from "./dist-zBU8ASQW.mjs";
3
- export { Load, LoadError, ResourceNodeBase, SecretBox, configOf, dependency, freezeNode, hydrate, hydrateSecrets, hydrateSync, isNode, isSecretSource, module, number, param, provisionManifest, resource, secret, secretSource, service, string };
1
+ import { _ as service, a as freezeNode, c as isProvisionNeed, d as paramNeed, f as paramSource, g as secretSource, h as secret, i as dependency, l as isSecretSource, m as resource, n as LoadError, o as isNode, p as provisionNeed, r as ResourceNodeBase, s as isParamSource, t as Load, u as module } from "./graph-BmrUEdo9-6Oq1hSmS.mjs";
2
+ import { a as number, c as provisionManifest, i as hydrateSync, l as string, n as hydrate, o as param, r as hydrateSecrets, s as paramManifest, t as configOf, u as SecretBox } from "./dist-B0axxnBf.mjs";
3
+ export { 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 };
@@ -1,6 +1,7 @@
1
- import { t as BuildAdapter } from "./config-ob5OhCSP-sP3GW3uu.mjs";
2
- //#region ../../0-framework/2-authoring/nextjs/dist/index.d.mts
3
- //#region src/index.d.ts
1
+ import { t as BuildAdapter } from "./graph-types-BgT9UEdm-Bz-_OcJH.mjs";
2
+ import "./index-B2DJ5CN4.mjs";
3
+ //#region ../../0-framework/2-authoring/nextjs/dist/nextjs-DLyeRR7M.d.mts
4
+ //#region src/nextjs.d.ts
4
5
  /** The nextjs build adapter's descriptor — `appDir` is this kind's own extra path input (the Next app root), beyond the shared `{ extension, type, module, entry }`. `entry` is a placeholder; the assembler locates `server.js` in the standalone tree. */
5
6
  interface NextjsBuildAdapter extends BuildAdapter {
6
7
  readonly type: 'nextjs';
@@ -9,7 +10,7 @@ interface NextjsBuildAdapter extends BuildAdapter {
9
10
  declare const nextjsBuild: (opts: {
10
11
  module: string;
11
12
  appDir: string;
12
- }) => NextjsBuildAdapter; //#endregion
13
+ }) => NextjsBuildAdapter;
13
14
  //#endregion
14
15
  export { nextjsBuild as n, NextjsBuildAdapter as t };
15
- //# sourceMappingURL=index-Dh4Zro0y.d.mts.map
16
+ //# sourceMappingURL=nextjs-DLyeRR7M-B9ukbB2L.d.mts.map
@@ -1,13 +1,14 @@
1
- import { a as Bundle, i as AssembleInput, o as ExtensionDescriptor } from "./app-config-BUqyK6N6-CVq3uvHF.mjs";
2
- import { t as NextjsBuildAdapter } from "./index-Dh4Zro0y.mjs";
3
-
1
+ import { a as Bundle, d as ExtensionDescriptor, i as AssembleInput } from "./app-config-DJdU4ubR-BwioNK8j.mjs";
2
+ import "./config-ByZICgry.mjs";
3
+ import "./deploy-ByZICgry.mjs";
4
+ import { t as NextjsBuildAdapter } from "./nextjs-DLyeRR7M-B9ukbB2L.mjs";
4
5
  //#region ../../0-framework/2-authoring/nextjs/dist/control.d.mts
5
- //#region src/control.d.ts
6
+ //#region src/control/build.d.ts
6
7
  /** The built standalone server.js for a nextjs build — `appDir`'s standalone root plus the app subpath Next recorded. Single-sourced so `assemble()` (deploy) and the integration-test seam can't drift. */
7
8
  declare function standaloneServerPath(build: NextjsBuildAdapter): string;
8
9
  declare function assemble(input: AssembleInput): Promise<Bundle>;
9
10
  /** The nextjs build extension descriptor — `prisma-composer.config.ts` lists it under `extensions`. */
10
- declare const nextjsBuild: () => ExtensionDescriptor; //#endregion
11
+ declare const nextjsBuild: () => ExtensionDescriptor;
11
12
  //#endregion
12
13
  export { type AssembleInput, type Bundle, assemble, nextjsBuild, standaloneServerPath };
13
14
  //# sourceMappingURL=nextjs-control.d.mts.map
@@ -1,7 +1,7 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
- import { build } from "tsdown";
4
+ import { build } from "esbuild";
5
5
  //#region ../../0-framework/2-authoring/nextjs/dist/control.mjs
6
6
  /**
7
7
  * The extension's control entry (ADR-0017): `nextjsBuild()` returns the build
@@ -77,18 +77,15 @@ async function assemble(input) {
77
77
  const publicSrc = path.join(appDir, "public");
78
78
  if (fs.existsSync(publicSrc)) await fs.promises.cp(publicSrc, path.join(appOut, "public"), { recursive: true });
79
79
  await build({
80
- entry: { main: fileURLToPath(buildDescriptor.module) },
81
- outDir: workDir,
80
+ entryPoints: { main: fileURLToPath(buildDescriptor.module) },
81
+ outdir: workDir,
82
+ bundle: true,
82
83
  format: "esm",
83
84
  platform: "node",
84
- external: ["bun"],
85
- noExternal: [/^@prisma\//, ...input.wrapperNoExternal ?? []],
86
- dts: false,
87
- sourcemap: false,
88
- clean: false,
89
- config: false
85
+ external: ["bun", "bun:*"],
86
+ outExtension: { ".js": ".mjs" }
90
87
  });
91
- if (!fs.existsSync(path.join(workDir, "main.mjs"))) throw new Error(`tsdown produced no main.mjs in ${workDir}`);
88
+ if (!fs.existsSync(path.join(workDir, "main.mjs"))) throw new Error(`esbuild produced no main.mjs in ${workDir}`);
92
89
  return {
93
90
  dir: workDir,
94
91
  entry: path.posix.join("bundle", appRel.split(path.sep).join("/"), "server.js")