@prisma/composer 0.6.0-dev.9 → 0.7.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 (73) hide show
  1. package/dist/{app-config-CFsSXEVj-B242oUnm.d.mts → app-config-BinBcpPf-1akTl5h4.d.mts} +128 -15
  2. package/dist/app-config-BinBcpPf-1akTl5h4.d.mts.map +1 -0
  3. package/dist/config-647Wkm51.d.mts +1 -0
  4. package/dist/config.d.mts +3 -3
  5. package/dist/control.d.mts +79 -35
  6. package/dist/control.d.mts.map +1 -1
  7. package/dist/control.mjs +34 -33
  8. package/dist/control.mjs.map +1 -1
  9. package/dist/deploy-647Wkm51.d.mts +1 -0
  10. package/dist/deploy.d.mts +2 -2
  11. package/dist/{deployment-summary-r47O6kFr-CcMYVOn5.mjs → deployment-summary-DswOl_9E-B9MhYYDt.mjs} +5 -5
  12. package/dist/deployment-summary-DswOl_9E-B9MhYYDt.mjs.map +1 -0
  13. package/dist/dist-CVk7Pk4B.mjs +42 -0
  14. package/dist/dist-CVk7Pk4B.mjs.map +1 -0
  15. package/dist/{execute-deploy-destroy-IT4vGkMc-oO8yjHPH.mjs → execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs} +171 -31
  16. package/dist/execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs.map +1 -0
  17. package/dist/{execute-dev-DLYyduEM-88uyvrbj.mjs → execute-dev-BMTFWfFc-7MifQgpp.mjs} +53 -48
  18. package/dist/execute-dev-BMTFWfFc-7MifQgpp.mjs.map +1 -0
  19. package/dist/{execute-log-VIOL4DBz-DBPH8By4.mjs → execute-log-Cay9hlKW-BcvKPOW1.mjs} +10 -7
  20. package/dist/execute-log-Cay9hlKW-BcvKPOW1.mjs.map +1 -0
  21. package/dist/local-target.d.mts +1 -1
  22. package/dist/nextjs-control.d.mts +3 -3
  23. package/dist/nextjs-control.mjs +138 -34
  24. package/dist/nextjs-control.mjs.map +1 -1
  25. package/dist/node-control.d.mts +3 -3
  26. package/dist/node-control.mjs +21814 -55
  27. package/dist/node-control.mjs.map +1 -1
  28. package/dist/{pipeline-D3QoVzAB-Ci2aJ2mE.mjs → pipeline-AoW8zq4I-Dg8xQ7nC.mjs} +170 -49
  29. package/dist/pipeline-AoW8zq4I-Dg8xQ7nC.mjs.map +1 -0
  30. package/dist/report.d.mts +2 -2
  31. package/dist/report.mjs +1 -1
  32. package/dist/report.mjs.map +1 -1
  33. package/dist/{result-CzGChwbZ.mjs → result-D95kAAek.mjs} +36 -20
  34. package/dist/result-D95kAAek.mjs.map +1 -0
  35. package/dist/run-alchemy-D44OZlyB-Cw5CVbUQ.mjs +93 -0
  36. package/dist/run-alchemy-D44OZlyB-Cw5CVbUQ.mjs.map +1 -0
  37. package/dist/run-report-C2o98uD--AX8kpz4Q.mjs +60 -0
  38. package/dist/run-report-C2o98uD--AX8kpz4Q.mjs.map +1 -0
  39. package/package.json +14 -19
  40. package/src/exports/testing.ts +5 -0
  41. package/dist/app-config-CFsSXEVj-B242oUnm.d.mts.map +0 -1
  42. package/dist/bin.mjs +0 -19
  43. package/dist/bin.mjs.map +0 -1
  44. package/dist/cli-B3sWzFlb-CxEIzKsQ.mjs +0 -401
  45. package/dist/cli-B3sWzFlb-CxEIzKsQ.mjs.map +0 -1
  46. package/dist/config-ku5b_2YD.d.mts +0 -1
  47. package/dist/container-transport-DKmKg5JQ-BMRhx5w-.mjs +0 -75
  48. package/dist/container-transport-DKmKg5JQ-BMRhx5w-.mjs.map +0 -1
  49. package/dist/deploy-ku5b_2YD.d.mts +0 -1
  50. package/dist/deployment-summary-r47O6kFr-CcMYVOn5.mjs.map +0 -1
  51. package/dist/execute-deploy-destroy-IT4vGkMc-YM1Cv6cu.mjs +0 -306
  52. package/dist/execute-deploy-destroy-IT4vGkMc-YM1Cv6cu.mjs.map +0 -1
  53. package/dist/execute-deploy-destroy-IT4vGkMc-oO8yjHPH.mjs.map +0 -1
  54. package/dist/execute-dev-DLYyduEM-88uyvrbj.mjs.map +0 -1
  55. package/dist/execute-dev-DLYyduEM-BuUGTm0g.mjs +0 -2006
  56. package/dist/execute-dev-DLYyduEM-BuUGTm0g.mjs.map +0 -1
  57. package/dist/execute-log-VIOL4DBz-DBPH8By4.mjs.map +0 -1
  58. package/dist/execute-log-VIOL4DBz-DKodBrxS.mjs +0 -155
  59. package/dist/execute-log-VIOL4DBz-DKodBrxS.mjs.map +0 -1
  60. package/dist/local-target-DuSyWeYc.mjs +0 -68
  61. package/dist/local-target-DuSyWeYc.mjs.map +0 -1
  62. package/dist/pipeline-D3QoVzAB-Ci2aJ2mE.mjs.map +0 -1
  63. package/dist/pipeline-D3QoVzAB-D_ufjg3N.mjs +0 -857
  64. package/dist/pipeline-D3QoVzAB-D_ufjg3N.mjs.map +0 -1
  65. package/dist/render-error-DsPN5qfr-CkVGj9uP.mjs +0 -30
  66. package/dist/render-error-DsPN5qfr-CkVGj9uP.mjs.map +0 -1
  67. package/dist/result-CFqJKiqg.mjs +0 -106
  68. package/dist/result-CFqJKiqg.mjs.map +0 -1
  69. package/dist/result-CzGChwbZ.mjs.map +0 -1
  70. package/dist/run-alchemy-hghRtddF-CQHOzlrW.mjs +0 -48
  71. package/dist/run-alchemy-hghRtddF-CQHOzlrW.mjs.map +0 -1
  72. package/dist/shared-CCaR42wo-BvegvmA_.mjs +0 -265
  73. package/dist/shared-CCaR42wo-BvegvmA_.mjs.map +0 -1
@@ -5,7 +5,7 @@ import { Input, StackServices } from "alchemy";
5
5
  import * as Effect from "effect/Effect";
6
6
  import * as Layer from "effect/Layer";
7
7
  import { State } from "alchemy/State/State";
8
- //#region ../../0-framework/1-core/core/dist/app-config-CFsSXEVj.d.mts
8
+ //#region ../../0-framework/1-core/core/dist/app-config-BinBcpPf.d.mts
9
9
  //#region src/container-transport.d.ts
10
10
  /**
11
11
  * Carries resolved containers from the CLI process into the alchemy process
@@ -36,23 +36,42 @@ interface ContainerInstance {
36
36
  /** Serialize to a non-empty string for the process transport above. The format is the extension's own; only its `deserialize` reads it. */
37
37
  serialize(): string;
38
38
  }
39
+ /**
40
+ * What the caller has already authenticated, handed to one container
41
+ * lifecycle call. A caller that holds neither omits the argument, and the
42
+ * extension falls back to whatever credential protocol it defines for
43
+ * itself (for Prisma Cloud, its env vars — which is how the alchemy child
44
+ * process still resolves containers).
45
+ *
46
+ * `C` is the extension's own platform-client type, left as a type parameter
47
+ * because this shared-plane module must not import a platform SDK; the
48
+ * framework only carries the value, never calls it. The framework stores the
49
+ * erased `C = unknown` form and the extension recovers its concrete client
50
+ * through the same method bivariance that erases `I` below.
51
+ */
52
+ interface ContainerCredentials<C = unknown> {
53
+ /** The workspace the container lives in. `undefined` when the caller has no workspace to name — the extension decides whether it can proceed. */
54
+ readonly workspaceId: string | undefined;
55
+ /** An already-authenticated platform API client. Present means the extension must not build its own from the environment. */
56
+ readonly client?: C | undefined;
57
+ }
39
58
  /**
40
59
  * The platform containers an app deploys into, as one lifecycle. `I` is
41
60
  * the extension's own instance type — the same descriptor produces and
42
61
  * consumes it, so the extension gets full typing internally while the
43
- * framework stores the erased form. METHOD SYNTAX REQUIRED on all four
44
- * members: the erased assignment into ExtensionDescriptor compiles only
45
- * through method bivariance; property-arrow members are checked
46
- * contravariantly and the assignment fails (same rule as
47
- * ServiceLowering<P, S> — ADR-0033).
62
+ * framework stores the erased form; `C` erases the same way. METHOD SYNTAX
63
+ * REQUIRED on all four members: the erased assignment into
64
+ * ExtensionDescriptor compiles only through method bivariance;
65
+ * property-arrow members are checked contravariantly and the assignment
66
+ * fails (same rule as ServiceLowering<P, S> — ADR-0033).
48
67
  */
49
- interface ContainerDescriptor<I extends ContainerInstance = ContainerInstance> {
68
+ interface ContainerDescriptor<I extends ContainerInstance = ContainerInstance, C = unknown> {
50
69
  /** Resolve the container for (appName, stage), creating anything absent. Called by `deploy`. */
51
- ensure(input: LocateContainerInput): Promise<I>;
70
+ ensure(input: LocateContainerInput, credentials?: ContainerCredentials<C>): Promise<I>;
52
71
  /** Find the container for (appName, stage); `undefined` when nothing exists. Called by `destroy` — never creates. */
53
- locate(input: LocateContainerInput): Promise<I | undefined>;
72
+ locate(input: LocateContainerInput, credentials?: ContainerCredentials<C>): Promise<I | undefined>;
54
73
  /** Remove the container after a successful destroy, after every extension's `teardown` has run. Failure policy is the extension's. */
55
- remove(instance: I): Promise<void>;
74
+ remove(instance: I, credentials?: ContainerCredentials<C>): Promise<void>;
56
75
  /** Reconstruct an instance from its own `serialize()` output — the far end of the framework's parent→child transport. */
57
76
  deserialize(serialized: string): I;
58
77
  }
@@ -348,8 +367,13 @@ interface ExtensionDescriptor {
348
367
  * runs. A target uses it to verify platform prerequisites (e.g. that every
349
368
  * secret env var in the provision manifest exists for the resolved stage) and
350
369
  * throws to abort the deploy. Async: it talks to the platform (ADR-0029).
370
+ *
371
+ * METHOD SYNTAX REQUIRED, for the same reason ContainerDescriptor's members
372
+ * need it: the framework hands over the erased `PreflightInput<unknown>`,
373
+ * and an extension that types the input against its own client type only
374
+ * assigns here through method bivariance.
351
375
  */
352
- readonly preflight?: (input: PreflightInput) => Promise<void>;
376
+ preflight?(input: PreflightInput): Promise<void>;
353
377
  /**
354
378
  * Destroy-time cleanup — the CLI runs it once, after `alchemy destroy`
355
379
  * succeeds and BEFORE the stage's Project/Branch are removed. A target uses
@@ -367,6 +391,12 @@ interface ExtensionDescriptor {
367
391
  * in container-transport.ts.
368
392
  */
369
393
  readonly container?: ContainerDescriptor;
394
+ /**
395
+ * Deploy-run reporting. The CLI begins a session after the graph is loaded
396
+ * and before containers are resolved, and finishes it on every exit path.
397
+ * An extension without one reports nothing, which is the default.
398
+ */
399
+ readonly reporter?: ReporterDescriptor;
370
400
  /**
371
401
  * The extension's LOCAL TARGET counterpart (ADR-0041; naming, operator
372
402
  * 2026-07-23 — "dev" names the user-facing feature only, the seam takes
@@ -391,14 +421,16 @@ interface StateDescriptor {
391
421
  /** Build the state layer. `container` is the owning extension's resolved instance; `undefined` when it declared no container descriptor. */
392
422
  create(container: ContainerInstance | undefined): AlchemyStateLayer;
393
423
  }
394
- /** The resolved deploy context handed to an extension's `preflight` hook. */
395
- interface PreflightInput {
424
+ /** The resolved deploy context handed to an extension's `preflight` hook. `C` erases to `unknown` at the framework boundary — see ContainerCredentials. */
425
+ interface PreflightInput<C = unknown> {
396
426
  /** The loaded application graph — the manifest of prerequisites is read from it (`provisionManifest`). */
397
427
  readonly graph: Graph;
398
428
  /** The calling extension's own resolved container; `undefined` when it declares no container descriptor. Narrow with the extension's guard. */
399
429
  readonly container: ContainerInstance | undefined;
400
430
  /** The stage name (`--stage`), or `undefined` for the default stage — for diagnostics/scope. */
401
431
  readonly stage: string | undefined;
432
+ /** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
433
+ readonly credentials?: ContainerCredentials<C> | undefined;
402
434
  }
403
435
  /** The resolved destroy context handed to an extension's `teardown` hook. */
404
436
  interface TeardownInput {
@@ -407,6 +439,87 @@ interface TeardownInput {
407
439
  /** The stage name (`--stage`), or `undefined` for the default stage — for diagnostics/scope. */
408
440
  readonly stage: string | undefined;
409
441
  }
442
+ /** The deploy context handed to `ReporterDescriptor.begin`. `C` erases to `unknown` at the framework boundary, exactly as on `PreflightInput`. */
443
+ interface ReportBeginInput<C = unknown> {
444
+ /** The resolved application name. */
445
+ readonly appName: string;
446
+ /** The stage name (`--stage`), or `undefined` for the default stage. */
447
+ readonly stage: string | undefined;
448
+ /** The directory the deploy command was run from — where a reporter reads repository metadata. */
449
+ readonly cwd: string;
450
+ /**
451
+ * An existing report record this deploy is one part of, when whatever
452
+ * invoked Composer created one first — a CI job that opens the record, runs
453
+ * several steps against it, and closes it afterwards. Opaque to core: only
454
+ * the reporter knows what record the id names, and a reporter that receives
455
+ * one joins it instead of creating its own.
456
+ *
457
+ * Takes precedence over any equivalent the reporter reads from the
458
+ * environment, because it was passed deliberately.
459
+ */
460
+ readonly reportId: string | undefined;
461
+ /** What the caller has already authenticated, exactly as `preflight` and the container lifecycle receive it. Present means the reporter must not build a client from the environment. */
462
+ readonly credentials?: ContainerCredentials<C> | undefined;
463
+ }
464
+ /** The deploy context handed to `RunReporter.attach`, once containers exist. */
465
+ interface ReportAttachInput {
466
+ /** The calling extension's own resolved container; `undefined` when it declares no container descriptor. Narrow with the extension's guard. */
467
+ readonly container: ContainerInstance | undefined;
468
+ }
469
+ /** How a run ended, as a reporter sees it. */
470
+ interface RunOutcome {
471
+ readonly ok: boolean;
472
+ /** The run was interrupted (the engine settled a Ctrl-C or a termination signal) — a kind of not-ok that is not a failure. Only meaningful when `ok` is false. */
473
+ readonly cancelled: boolean;
474
+ /** The failing step's name — the deploy's own error code. `undefined` when the run succeeded. */
475
+ readonly failingStep: string | undefined;
476
+ /** Human-readable detail. `undefined` when the run succeeded. */
477
+ readonly errorMessage: string | undefined;
478
+ /**
479
+ * Everything the run's nodes became on the deployment target, flattened.
480
+ * Core does not interpret a `kind` and neither should the CLI — a reporter
481
+ * reads the kinds its own extension emits and ignores the rest. Empty when
482
+ * the run failed before producing a report.
483
+ */
484
+ readonly entities: readonly DeployedEntity[];
485
+ }
486
+ /**
487
+ * One run's reporting session. Every method is best-effort by contract:
488
+ * reporting is observability, never a step of the deploy, so an
489
+ * implementation logs its own failures and resolves rather than rejecting.
490
+ * The CLI does not catch, and will not fail a deploy over a report.
491
+ */
492
+ interface RunReporter {
493
+ /**
494
+ * Extra environment for the alchemy child, so reporting that happens
495
+ * inside the apply can find the run this session belongs to. Read once,
496
+ * after `attach`, and merged into the child's environment.
497
+ */
498
+ childEnv(): Readonly<Record<string, string>>;
499
+ /** Called once the extension's own container is resolved, before any stack file is written — the moment the run's project and branch first exist to be referenced. */
500
+ attach(input: ReportAttachInput): Promise<void>;
501
+ /** Called exactly once, on every exit path including a thrown error. */
502
+ finish(outcome: RunOutcome): Promise<void>;
503
+ }
504
+ /**
505
+ * Deploy-run reporting — how an extension records that a deploy happened,
506
+ * how far it got, and how it ended. The CLI begins a session after the app's
507
+ * graph is loaded and before its containers are resolved, so a failure while
508
+ * creating them is still reported, and finishes it on every exit path.
509
+ *
510
+ * Deploy only: `destroy` has no reportable shape on the Prisma Cloud side
511
+ * (its build phases name a deploy), so the CLI does not run this hook there.
512
+ */
513
+ interface ReporterDescriptor {
514
+ /**
515
+ * Start a session, or return `undefined` when there is nothing to report
516
+ * against (no credentials, no repository). Never throws. METHOD SYNTAX
517
+ * REQUIRED, like `preflight`: the framework hands over the erased
518
+ * `ReportBeginInput<unknown>`, and a reporter that types the input against
519
+ * its own client type only assigns here through method bivariance.
520
+ */
521
+ begin(input: ReportBeginInput): Promise<RunReporter | undefined>;
522
+ }
410
523
  /** The extension's LOCAL TARGET counterpart (ADR-0041) — the local-target variant OF ExtensionDescriptor, hence the full qualifier. An extension without one is not local-target-capable (cannot back the "dev" feature). */
411
524
  interface LocalTargetDescriptor {
412
525
  /** Local providers for the SAME resource types this extension's lowering emits. Receives the app identity — unlike deploy's env-arg-free `providers()`, local providers are emulator clients and must know which app they provision for. */
@@ -493,5 +606,5 @@ interface PrismaAppConfig {
493
606
  /** Typed identity — exists so `prisma-composer.config.ts` gets checked against PrismaAppConfig where it is written. */
494
607
  declare function defineConfig(config: PrismaAppConfig): PrismaAppConfig;
495
608
  //#endregion
496
- export { ProvisionerDescriptor as A, joinDeployment as B, Lowering as C, PreflightInput as D, PackageInput as E, containerEnv as F, lowering as H, containerEnvVarName as I, defineConfig as L, StateDescriptor as M, TeardownInput as N, PrismaAppConfig as O, buildConfig as P, deserializeContainers as R, LoweredResult as S, Outputs as T, mergedProviders as U, lower as V, resolveStateLayer as W, LocalTargetProvidersInput as _, Bundle as a, LowerError as b, DEV_DIR as c, DeploymentResult as d, ExtensionDescriptor as f, LocalTargetEmulatorsInput as g, LocalTargetDescriptor as h, AssembleInput as i, ServiceLowering as j, ProvisionEdge as k, DeployedEntity as l, LocalTargetAttachment as m, ApplicationDescriptor as n, ContainerDescriptor as o, LocalTargetAttachInput as p, Artifact as r, ContainerInstance as s, AlchemyStateLayer as t, DeployedNode as u, LocateContainerInput as v, NodeDescriptor as w, LowerOptions as x, LowerContext as y, isBuildOnlyExtension as z };
497
- //# sourceMappingURL=app-config-CFsSXEVj-B242oUnm.d.mts.map
609
+ export { ProvisionEdge as A, buildConfig as B, LoweredResult as C, PackageInput as D, Outputs as E, RunOutcome as F, isBuildOnlyExtension as G, containerEnvVarName as H, RunReporter as I, lowering as J, joinDeployment as K, ServiceLowering as L, ReportAttachInput as M, ReportBeginInput as N, PreflightInput as O, ReporterDescriptor as P, StateDescriptor as R, LowerOptions as S, NodeDescriptor as T, defineConfig as U, containerEnv as V, deserializeContainers as W, resolveStateLayer as X, mergedProviders as Y, LocalTargetEmulatorsInput as _, Bundle as a, LowerContext as b, ContainerInstance as c, DeployedNode as d, DeploymentResult as f, LocalTargetDescriptor as g, LocalTargetAttachment as h, AssembleInput as i, ProvisionerDescriptor as j, PrismaAppConfig as k, DEV_DIR as l, LocalTargetAttachInput as m, ApplicationDescriptor as n, ContainerCredentials as o, ExtensionDescriptor as p, lower as q, Artifact as r, ContainerDescriptor as s, AlchemyStateLayer as t, DeployedEntity as u, LocalTargetProvidersInput as v, Lowering as w, LowerError as x, LocateContainerInput as y, TeardownInput as z };
610
+ //# sourceMappingURL=app-config-BinBcpPf-1akTl5h4.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-config-BinBcpPf-1akTl5h4.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-BinBcpPf.d.mts"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ import "./app-config-BinBcpPf-1akTl5h4.mjs";
package/dist/config.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { D as PreflightInput, F as containerEnv, I as containerEnvVarName, L as defineConfig, M as StateDescriptor, N as TeardownInput, O as PrismaAppConfig, R as deserializeContainers, _ as LocalTargetProvidersInput, c as DEV_DIR, f as ExtensionDescriptor, g as LocalTargetEmulatorsInput, h as LocalTargetDescriptor, m as LocalTargetAttachment, o as ContainerDescriptor, p as LocalTargetAttachInput, s as ContainerInstance, v as LocateContainerInput, w as NodeDescriptor, z as isBuildOnlyExtension } from "./app-config-CFsSXEVj-B242oUnm.mjs";
2
- import "./config-ku5b_2YD.mjs";
3
- export { type ContainerDescriptor, type ContainerInstance, DEV_DIR, ExtensionDescriptor, LocalTargetAttachInput, LocalTargetAttachment, LocalTargetDescriptor, LocalTargetEmulatorsInput, LocalTargetProvidersInput, type LocateContainerInput, NodeDescriptor, PreflightInput, PrismaAppConfig, StateDescriptor, TeardownInput, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, isBuildOnlyExtension };
1
+ import { F as RunOutcome, G as isBuildOnlyExtension, H as containerEnvVarName, I as RunReporter, M as ReportAttachInput, N as ReportBeginInput, O as PreflightInput, P as ReporterDescriptor, R as StateDescriptor, T as NodeDescriptor, U as defineConfig, V as containerEnv, W as deserializeContainers, _ as LocalTargetEmulatorsInput, c as ContainerInstance, g as LocalTargetDescriptor, h as LocalTargetAttachment, k as PrismaAppConfig, l as DEV_DIR, m as LocalTargetAttachInput, o as ContainerCredentials, p as ExtensionDescriptor, s as ContainerDescriptor, u as DeployedEntity, v as LocalTargetProvidersInput, y as LocateContainerInput, z as TeardownInput } from "./app-config-BinBcpPf-1akTl5h4.mjs";
2
+ import "./config-647Wkm51.mjs";
3
+ export { type ContainerCredentials, type ContainerDescriptor, type ContainerInstance, DEV_DIR, type DeployedEntity, ExtensionDescriptor, LocalTargetAttachInput, LocalTargetAttachment, LocalTargetDescriptor, LocalTargetEmulatorsInput, LocalTargetProvidersInput, type LocateContainerInput, NodeDescriptor, PreflightInput, PrismaAppConfig, ReportAttachInput, ReportBeginInput, ReporterDescriptor, RunOutcome, RunReporter, StateDescriptor, TeardownInput, containerEnv, containerEnvVarName, defineConfig, deserializeContainers, isBuildOnlyExtension };
@@ -1,38 +1,8 @@
1
1
  import { dt as CliStructuredError } from "./graph-types-N6brq1zY-1VMNwtkJ.mjs";
2
- import { l as DeployedEntity } from "./app-config-CFsSXEVj-B242oUnm.mjs";
3
- import "./config-ku5b_2YD.mjs";
2
+ import { u as DeployedEntity } from "./app-config-BinBcpPf-1akTl5h4.mjs";
3
+ import "./config-647Wkm51.mjs";
4
4
  import "./index-DryPyF9U.mjs";
5
- import "./deploy-ku5b_2YD.mjs";
6
- //#region ../../0-framework/3-tooling/cli/dist/load-entry-BS8rSRif.d.mts
7
- //#endregion
8
- //#region src/operations/shared.d.ts
9
- /** A running service's dotted address plus its local URL — what `dev` reports
10
- * as the front door and `log` reports as the tailable services. */
11
- interface ServiceEndpoint {
12
- readonly address: string;
13
- readonly url: string;
14
- }
15
- /**
16
- * Where a failed execution left its artifacts — details of the CURRENT
17
- * execution mechanism (a spawned deploy-engine child driving a generated
18
- * stack file), for hosts that want to print a reproduce hint. The mechanism
19
- * is not part of the surface's contract, so these fields may change or
20
- * disappear if the mechanism does; branch on `code`/`message`/`cause` for
21
- * anything durable.
22
- */
23
- interface ExecutionDiagnostics {
24
- /** The child's exit status; undefined means the spawn itself threw. */
25
- readonly exitCode: number | undefined;
26
- readonly stackFilePath: string;
27
- readonly reproduceCommand: string;
28
- readonly cwd: string;
29
- }
30
- /**
31
- * Reads the execution diagnostics an engine-failure error carries in
32
- * `meta.diagnostics`; undefined for every other failure.
33
- */
34
- declare function executionDiagnostics(f: CliStructuredError): ExecutionDiagnostics | undefined;
35
- //#endregion
5
+ import "./deploy-647Wkm51.mjs";
36
6
  //#region ../../0-framework/0-foundation/foundation/dist/result.d.mts
37
7
  //#region src/result.d.ts
38
8
  /**
@@ -61,7 +31,7 @@ interface NotOk<F> {
61
31
  */
62
32
  type Result<T, F> = Ok<T> | NotOk<F>;
63
33
  //#endregion
64
- //#region ../../0-framework/3-tooling/cli/dist/control.d.mts
34
+ //#region ../../0-framework/3-tooling/cli/dist/log-DDGcAU7S.d.mts
65
35
  //#region src/deployment-summary.d.ts
66
36
  /** The serializable projection of DeploymentResult — what CAN cross the process
67
37
  * boundary. Writer (report hook) and reader (deploy operation) share this shape. */
@@ -74,6 +44,39 @@ interface DeploymentSummary {
74
44
  readonly nodes: readonly DeployedNodeSummary[];
75
45
  }
76
46
  //#endregion
47
+ //#region src/operations/shared.d.ts
48
+ /** A running service's dotted address plus its local URL — what `dev` reports
49
+ * as the front door and `log` reports as the tailable services. */
50
+ interface ServiceEndpoint {
51
+ readonly address: string;
52
+ readonly url: string;
53
+ }
54
+ /**
55
+ * Where a failed execution left its artifacts — details of the CURRENT
56
+ * execution mechanism (a spawned deploy-engine child driving a generated
57
+ * stack file), for hosts that want to print a reproduce hint. The mechanism
58
+ * is not part of the surface's contract, so these fields may change or
59
+ * disappear if the mechanism does; branch on `code`/`message`/`cause` for
60
+ * anything durable.
61
+ */
62
+ interface ExecutionDiagnostics {
63
+ /** The child's exit status; undefined means the spawn itself threw, or the
64
+ * child was killed by a signal (`signal` then names it). */
65
+ readonly exitCode: number | undefined;
66
+ /** The signal that killed the child, when one did. A signal-killed converge
67
+ * is an abort the user asked for, not a failure of the deploy — a host
68
+ * should report it as an interruption and print no reproduce hint. */
69
+ readonly signal?: string | undefined;
70
+ readonly stackFilePath: string;
71
+ readonly reproduceCommand: string;
72
+ readonly cwd: string;
73
+ }
74
+ /**
75
+ * Reads the execution diagnostics an engine-failure error carries in
76
+ * `meta.diagnostics`; undefined for every other failure.
77
+ */
78
+ declare function executionDiagnostics(f: CliStructuredError): ExecutionDiagnostics | undefined;
79
+ //#endregion
77
80
  //#region src/operations/deploy.d.ts
78
81
  interface DeployInput {
79
82
  /** Path to the entry module, resolved against `cwd` — same contract as `prisma-composer deploy <entry>`. */
@@ -84,6 +87,20 @@ interface DeployInput {
84
87
  readonly stage?: string | undefined;
85
88
  /** Defaults to process.cwd(); the directory `.prisma-composer/` and `.alchemy` state live under. */
86
89
  readonly cwd?: string | undefined;
90
+ /**
91
+ * Where to write the run report — the deploy's outcome as JSON, for a tool
92
+ * that consumes a deploy rather than watches one. Relative paths resolve
93
+ * against `cwd`. Absent falls back to `PRISMA_COMPOSER_REPORT_FILE`, and
94
+ * absent from both writes no report.
95
+ */
96
+ readonly reportPath?: string | undefined;
97
+ /**
98
+ * An existing report record this deploy belongs to — the `--build-id` flag's
99
+ * slot. A CI job that opens the record before invoking Composer passes the
100
+ * id here, and the target's reporter joins that record instead of creating
101
+ * one. Absent falls back to whatever the target reads from the environment.
102
+ */
103
+ readonly reportId?: string | undefined;
87
104
  }
88
105
  interface DeploySuccess {
89
106
  /** Parsed from the alchemy child's result file. Undefined when the child
@@ -212,5 +229,32 @@ interface LogAttached {
212
229
  }
213
230
  declare function log(input: LogInput): Promise<Result<LogAttached, CliStructuredError>>;
214
231
  //#endregion
215
- export { type CliStructuredError, type DeployInput, type DeploySuccess, type DeployedNodeSummary, type DeploymentSummary, type DestroyEvent, type DestroyInput, type DestroyTarget, type DevEvent, type DevInput, type DevSession, type ExecutionDiagnostics, type LogAttached, type LogEvent, type LogInput, type LogLine, type NotOk, type Ok, type Result, type ServiceEndpoint, deploy, destroy, dev, executionDiagnostics, log };
232
+ //#region ../../0-framework/3-tooling/cli/dist/control.d.mts
233
+ //#region src/run-report.d.ts
234
+ /** Bump when a change would break a consumer that reads the current shape. */
235
+ declare const RUN_REPORT_VERSION = 1;
236
+ /** Names the file to write the run report to, when `--report` is not passed. */
237
+ declare const RUN_REPORT_FILE_ENV = "PRISMA_COMPOSER_REPORT_FILE";
238
+ interface RunReportFailure {
239
+ /** The deploy's own error code, e.g. `DEPLOY.PREFLIGHT_FAILED`. */
240
+ readonly code: string;
241
+ readonly message: string;
242
+ }
243
+ /**
244
+ * Every field is always present, and absent scalars are `null` rather than
245
+ * omitted — a consumer can read `report.failure` without first testing
246
+ * whether the key exists.
247
+ */
248
+ interface RunReport {
249
+ readonly version: number;
250
+ readonly outcome: 'succeeded' | 'failed';
251
+ /** Null when the run failed before it produced a deployment summary. */
252
+ readonly app: string | null;
253
+ /** Null for the default stage. */
254
+ readonly stage: string | null;
255
+ readonly nodes: readonly DeployedNodeSummary[];
256
+ readonly failure: RunReportFailure | null;
257
+ }
258
+ //#endregion
259
+ export { type CliStructuredError, type DeployInput, type DeploySuccess, type DeployedNodeSummary, type DeploymentSummary, type DestroyEvent, type DestroyInput, type DestroyTarget, type DevEvent, type DevInput, type DevSession, type ExecutionDiagnostics, type LogAttached, type LogEvent, type LogInput, type LogLine, type NotOk, type Ok, RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, type Result, type RunReport, type RunReportFailure, type ServiceEndpoint, deploy, destroy, dev, executionDiagnostics, log };
216
260
  //# sourceMappingURL=control.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/load-entry-BS8rSRif.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;;;UAyBU;WACC;WACA;;;;;;;;;;UAqBD;;WAEC;WACA;WACA;WACA;;;;;;iBAMM,qBAAqB,GAAG,qBAAqB;;;;;;;UCvDpD,GAAG;WACF;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAKQ,MAAM;WACL;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KAQZ,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;;;UCfxB;WACC;WACA,mBAAmB;;UAEpB;WACC;WACA,gBAAgB;;;;UAIjB;;WAEC;;WAEA;;WAEA;;WAEA;;UAED;;;WAGC,SAAS;;iBAEH,OAAO,OAAO,cAAc,QAAQ,OAAS,eAAe;;;;KAIxE;WACM;;WAEA;WACA;;KAEN;;;WAGM;WACA;;UAED;WACC;WACA;WACA,QAAQ;WACR;;WAEA,YAAY,OAAO;;iBAEb,QAAQ,OAAO,eAAe,QAAQ,aAAe;;;KAGjE;;;WAGM;WACA,oBAAoB;;WAEpB;WACA;;WAEA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;WACA;WACA;;WAEA;;;;WAIA;WACA;;WAEA;;UAED;WACC;WACA;WACA;WACA;WACA,YAAY,OAAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;iBAEF,IAAI,OAAO,WAAW,QAAQ,OAAS,YAAY;;;UAG1D;WACC;WACA;;KAEN;;;WAGM;WACA;;;;;WAKA;WACA;;UAED;WACC;WACA;;WAEA;;;WAGA;WACA;;WAEA,SAAS;WACT,YAAY,OAAO;;UAEpB;;WAEC;;;WAGA,mBAAmB;;WAEnB,OAAO,cAAc;;iBAEf,IAAI,OAAO,WAAW,QAAQ,OAAS,aAAa"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/log-DDGcAU7S.d.mts","../../../0-framework/3-tooling/cli/dist/control.d.mts"],"mappings":";;;;;;;;;;UAIU,GAAG;WACF;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAKQ,MAAM;WACL;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KAQZ,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;;;UCfxB;WACC;WACA,mBAAmB;;UAEpB;WACC;WACA,gBAAgB;;;;;;UAMjB;WACC;WACA;;;;;;;;;;UA2CD;;;WAGC;;;;WAIA;WACA;WACA;WACA;;;;;;iBAMM,qBAAqB,GAAG,qBAAqB;;;UAGpD;;WAEC;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;UAED;;;WAGC,SAAS;;iBAEH,OAAO,OAAO,cAAc,QAAQ,OAAO,eAAe;;;;KAQtE;WACM;;WAEA;WACA;;KAEN;;;WAGM;WACA;;UAED;WACC;WACA;WACA,QAAQ;WACR;;WAEA,YAAY,OAAO;;iBAEb,QAAQ,OAAO,eAAe,QAAQ,aAAa;;;KAO/D;;;WAGM;WACA,oBAAoB;;WAEpB;WACA;;WAEA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;WACA;WACA;;WAEA;;;;WAIA;WACA;;WAEA;;UAED;WACC;WACA;WACA;WACA;WACA,YAAY,OAAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;iBAEF,IAAI,OAAO,WAAW,QAAQ,OAAO,YAAY;;;UAcxD;WACC;WACA;;KAEN;;;WAGM;WACA;;;;;WAKA;WACA;;UAYD;WACC;WACA;;WAEA;;;WAGA;WACA;;WAEA,SAAS;WACT,YAAY,OAAO;;UAEpB;;WAEC;;;WAGA,mBAAmB;;WAEnB,OAAO,cAAc;;iBAEf,IAAI,OAAO,WAAW,QAAQ,OAAO,aAAa;;;;;cCnQrD;;cAEA;UACJ;;WAEC;WACA;;;;;;;UAOD;WACC;WACA;;WAEA;;WAEA;WACA,gBAAgB;WAChB,SAAS"}
package/dist/control.mjs CHANGED
@@ -1,70 +1,71 @@
1
- import { a as executorLoadFailure, i as executionDiagnostics, t as notOk } from "./result-CzGChwbZ.mjs";
2
- //#region ../../0-framework/3-tooling/cli/dist/destroy-DPAo6kVj.mjs
3
- async function dev(input) {
4
- return devWithDeps(input, {});
1
+ import { a as executionDiagnostics, o as executorLoadFailure, t as notOk } from "./result-D95kAAek.mjs";
2
+ import { n as RUN_REPORT_VERSION, t as RUN_REPORT_FILE_ENV } from "./run-report-C2o98uD--AX8kpz4Q.mjs";
3
+ //#region ../../0-framework/3-tooling/cli/dist/log-B1EJJGSl.mjs
4
+ async function deploy(input) {
5
+ return deployWithDeps(input, {});
5
6
  }
6
7
  /** In-package variant threading the injection seam (the CLI's RunDeps, unit
7
8
  * tests). Deliberately NOT re-exported through `./control` — the seam mirrors
8
9
  * internal types and is not part of the published surface. */
9
- async function devWithDeps(input, deps) {
10
+ async function deployWithDeps(input, deps) {
10
11
  const cwd = input.cwd ?? process.cwd();
11
12
  let executor;
12
13
  try {
13
- executor = await import("./execute-dev-DLYyduEM-88uyvrbj.mjs");
14
+ executor = await import("./execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs");
14
15
  } catch (error) {
15
- return notOk(executorLoadFailure("dev", error, cwd));
16
+ return notOk(executorLoadFailure("deploy", error, cwd));
16
17
  }
17
- return executor.executeDev(input, deps, cwd);
18
+ return executor.executeDeploy(input, deps, cwd);
18
19
  }
19
- async function log(input) {
20
- return logWithDeps(input, {});
20
+ async function destroy(input) {
21
+ return destroyWithDeps(input, {});
21
22
  }
22
- /** In-package variant threading the injection seam (the CLI's LogRunDeps,
23
- * unit tests). Deliberately NOT re-exported through `./control` — the seam
24
- * mirrors internal types and is not part of the published surface. */
25
- async function logWithDeps(input, deps) {
23
+ /** In-package variant threading the injection seam (the CLI's RunDeps, unit
24
+ * tests). Deliberately NOT re-exported through `./control` — the seam mirrors
25
+ * internal types and is not part of the published surface. */
26
+ async function destroyWithDeps(input, deps) {
26
27
  const cwd = input.cwd ?? process.cwd();
27
28
  let executor;
28
29
  try {
29
- executor = await import("./execute-log-VIOL4DBz-DBPH8By4.mjs");
30
+ executor = await import("./execute-deploy-destroy-DRl6Tfg9-B8LE2Lh5.mjs");
30
31
  } catch (error) {
31
- return notOk(executorLoadFailure("log", error, cwd));
32
+ return notOk(executorLoadFailure("destroy", error, cwd));
32
33
  }
33
- return executor.executeLog(input, deps, cwd);
34
+ return executor.executeDestroy(input, deps, cwd);
34
35
  }
35
- async function deploy(input) {
36
- return deployWithDeps(input, {});
36
+ async function dev(input) {
37
+ return devWithDeps(input, {});
37
38
  }
38
39
  /** In-package variant threading the injection seam (the CLI's RunDeps, unit
39
40
  * tests). Deliberately NOT re-exported through `./control` — the seam mirrors
40
41
  * internal types and is not part of the published surface. */
41
- async function deployWithDeps(input, deps) {
42
+ async function devWithDeps(input, deps) {
42
43
  const cwd = input.cwd ?? process.cwd();
43
44
  let executor;
44
45
  try {
45
- executor = await import("./execute-deploy-destroy-IT4vGkMc-oO8yjHPH.mjs");
46
+ executor = await import("./execute-dev-BMTFWfFc-7MifQgpp.mjs");
46
47
  } catch (error) {
47
- return notOk(executorLoadFailure("deploy", error, cwd));
48
+ return notOk(executorLoadFailure("dev", error, cwd));
48
49
  }
49
- return executor.executeDeploy(input, deps, cwd);
50
+ return executor.executeDev(input, deps, cwd);
50
51
  }
51
- async function destroy(input) {
52
- return destroyWithDeps(input, {});
52
+ async function log(input) {
53
+ return logWithDeps(input, {});
53
54
  }
54
- /** In-package variant threading the injection seam (the CLI's RunDeps, unit
55
- * tests). Deliberately NOT re-exported through `./control` — the seam mirrors
56
- * internal types and is not part of the published surface. */
57
- async function destroyWithDeps(input, deps) {
55
+ /** In-package variant threading the injection seam (the CLI's LogRunDeps,
56
+ * unit tests). Deliberately NOT re-exported through `./control` — the seam
57
+ * mirrors internal types and is not part of the published surface. */
58
+ async function logWithDeps(input, deps) {
58
59
  const cwd = input.cwd ?? process.cwd();
59
60
  let executor;
60
61
  try {
61
- executor = await import("./execute-deploy-destroy-IT4vGkMc-oO8yjHPH.mjs");
62
+ executor = await import("./execute-log-Cay9hlKW-BcvKPOW1.mjs");
62
63
  } catch (error) {
63
- return notOk(executorLoadFailure("destroy", error, cwd));
64
+ return notOk(executorLoadFailure("log", error, cwd));
64
65
  }
65
- return executor.executeDestroy(input, deps, cwd);
66
+ return executor.executeLog(input, deps, cwd);
66
67
  }
67
68
  //#endregion
68
- export { deploy, destroy, dev, executionDiagnostics, log };
69
+ export { RUN_REPORT_FILE_ENV, RUN_REPORT_VERSION, deploy, destroy, dev, executionDiagnostics, log };
69
70
 
70
71
  //# sourceMappingURL=control.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/destroy-DPAo6kVj.mjs"],"sourcesContent":["import { n as executorLoadFailure } from \"./shared-CCaR42wo.mjs\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-DLYyduEM.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error, cwd));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's LogRunDeps,\n* unit tests). Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-VIOL4DBz.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error, cwd));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-IT4vGkMc.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error, cwd));\n\t}\n\treturn executor.executeDeploy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/destroy.ts\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-IT4vGkMc.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error, cwd));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\n//#endregion\nexport { log as a, devWithDeps as c, deployWithDeps as i, destroyWithDeps as n, logWithDeps as o, deploy as r, dev as s, destroy as t };\n\n//# sourceMappingURL=destroy-DPAo6kVj.mjs.map"],"mappings":";;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,OAAO,GAAG,CAAC;CACpD;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,OAAO,GAAG,CAAC;CACpD;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;AAGA,eAAe,OAAO,OAAO;CAC5B,OAAO,eAAe,OAAO,CAAC,CAAC;AAChC;;;;AAIA,eAAe,eAAe,OAAO,MAAM;CAC1C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,UAAU,OAAO,GAAG,CAAC;CACvD;CACA,OAAO,SAAS,cAAc,OAAO,MAAM,GAAG;AAC/C;AAGA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,OAAO,GAAG,CAAC;CACxD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD"}
1
+ {"version":3,"file":"control.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/log-B1EJJGSl.mjs"],"sourcesContent":["import { n as executorLoadFailure } from \"./shared-BTnATsqm.mjs\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DRl6Tfg9.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error, cwd));\n\t}\n\treturn executor.executeDeploy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/destroy.ts\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DRl6Tfg9.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error, cwd));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-BMTFWfFc.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error, cwd));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's LogRunDeps,\n* unit tests). Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-Cay9hlKW.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error, cwd));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { destroy as a, deployWithDeps as c, devWithDeps as i, logWithDeps as n, destroyWithDeps as o, dev as r, deploy as s, log as t };\n\n//# sourceMappingURL=log-B1EJJGSl.mjs.map"],"mappings":";;;AAGA,eAAe,OAAO,OAAO;CAC5B,OAAO,eAAe,OAAO,CAAC,CAAC;AAChC;;;;AAIA,eAAe,eAAe,OAAO,MAAM;CAC1C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,UAAU,OAAO,GAAG,CAAC;CACvD;CACA,OAAO,SAAS,cAAc,OAAO,MAAM,GAAG;AAC/C;AAGA,eAAe,QAAQ,OAAO;CAC7B,OAAO,gBAAgB,OAAO,CAAC,CAAC;AACjC;;;;AAIA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,OAAO,GAAG,CAAC;CACxD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,OAAO,GAAG,CAAC;CACpD;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;AAGA,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,OAAO,GAAG,CAAC;CACpD;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C"}
@@ -0,0 +1 @@
1
+ import "./app-config-BinBcpPf-1akTl5h4.mjs";
package/dist/deploy.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as ProvisionerDescriptor, B as joinDeployment, C as Lowering, E as PackageInput, H as lowering, P as buildConfig, S as LoweredResult, T as Outputs, U as mergedProviders, V as lower, W as resolveStateLayer, a as Bundle, b as LowerError, d as DeploymentResult, i as AssembleInput, j as ServiceLowering, k as ProvisionEdge, l as DeployedEntity, n as ApplicationDescriptor, r as Artifact, t as AlchemyStateLayer, u as DeployedNode, x as LowerOptions, y as LowerContext } from "./app-config-CFsSXEVj-B242oUnm.mjs";
2
- import "./deploy-ku5b_2YD.mjs";
1
+ import { A as ProvisionEdge, B as buildConfig, C as LoweredResult, D as PackageInput, E as Outputs, J as lowering, K as joinDeployment, L as ServiceLowering, S as LowerOptions, X as resolveStateLayer, Y as mergedProviders, a as Bundle, b as LowerContext, d as DeployedNode, f as DeploymentResult, i as AssembleInput, j as ProvisionerDescriptor, n as ApplicationDescriptor, q as lower, r as Artifact, t as AlchemyStateLayer, u as DeployedEntity, w as Lowering, x as LowerError } from "./app-config-BinBcpPf-1akTl5h4.mjs";
2
+ import "./deploy-647Wkm51.mjs";
3
3
  export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServiceLowering, buildConfig, joinDeployment, lower, lowering, mergedProviders, resolveStateLayer };
@@ -1,6 +1,6 @@
1
1
  import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
2
- import * as fs from "node:fs";
3
- //#region ../../0-framework/3-tooling/cli/dist/deployment-summary-r47O6kFr.mjs
2
+ import * as fs$1 from "node:fs";
3
+ //#region ../../0-framework/3-tooling/cli/dist/deployment-summary-DswOl_9E.mjs
4
4
  /**
5
5
  * The deploy result's cross-process protocol, whole in one place: the
6
6
  * serializable shape, the env var that names the carrier file, the writer the
@@ -34,7 +34,7 @@ function writeDeploymentSummaryFile(result) {
34
34
  const file = process.env[DEPLOYMENT_RESULT_FILE_ENV];
35
35
  if (file === void 0 || file.length === 0) return;
36
36
  try {
37
- fs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));
37
+ fs$1.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));
38
38
  } catch {}
39
39
  }
40
40
  function isRecord(value) {
@@ -47,7 +47,7 @@ function isRecord(value) {
47
47
  function readDeploymentSummary(resultFilePath) {
48
48
  let raw;
49
49
  try {
50
- raw = fs.readFileSync(resultFilePath, "utf8");
50
+ raw = fs$1.readFileSync(resultFilePath, "utf8");
51
51
  } catch {
52
52
  return;
53
53
  }
@@ -67,4 +67,4 @@ function readDeploymentSummary(resultFilePath) {
67
67
  //#endregion
68
68
  export { readDeploymentSummary as n, writeDeploymentSummaryFile as r, DEPLOYMENT_RESULT_FILE_ENV as t };
69
69
 
70
- //# sourceMappingURL=deployment-summary-r47O6kFr-CcMYVOn5.mjs.map
70
+ //# sourceMappingURL=deployment-summary-DswOl_9E-B9MhYYDt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment-summary-DswOl_9E-B9MhYYDt.mjs","names":["fs"],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-DswOl_9E.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/deployment-summary.ts\n/**\n* The deploy result's cross-process protocol, whole in one place: the\n* serializable shape, the env var that names the carrier file, the writer the\n* report hook calls from inside the alchemy child, and the reader the deploy\n* operation runs after the child exits. `DeploymentResult` itself cannot\n* cross the boundary — its `DeployedNode` entries hold live graph-node\n* references (ADR-0033) — so the writer projects it down to what CAN.\n*\n* The summary is best-effort by contract: the writer never fails the child\n* over it, and the reader maps absent or malformed to `undefined`.\n*/\n/** Env var the deploy operation sets on the alchemy child: when present,\n* the report hook also writes the JSON DeploymentSummary there. */\nconst DEPLOYMENT_RESULT_FILE_ENV = \"PRISMA_COMPOSER_DEPLOYMENT_RESULT_FILE\";\n/** Pure projection: keeps app + each node's address/entities, drops the in-process `node`. */\nfunction toDeploymentSummary(result) {\n\treturn {\n\t\tapp: result.app,\n\t\tnodes: result.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities\n\t\t}))\n\t};\n}\n/**\n* Writer half, called by the report hook inside the alchemy child: when the\n* env var names a file, write the summary there. Best-effort — a write\n* failure must not fail a deploy that already converged, so it is swallowed.\n*/\nfunction writeDeploymentSummaryFile(result) {\n\tconst file = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (file === void 0 || file.length === 0) return;\n\ttry {\n\t\tfs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));\n\t} catch {}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Reader half, run by the deploy operation after the child exits. Absent or\n* malformed → undefined — the summary is best-effort, never a deploy failure.\n*/\nfunction readDeploymentSummary(resultFilePath) {\n\tlet raw;\n\ttry {\n\t\traw = fs.readFileSync(resultFilePath, \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isRecord(parsed) || typeof parsed[\"app\"] !== \"string\" || !Array.isArray(parsed[\"nodes\"])) return;\n\tfor (const node of parsed[\"nodes\"]) {\n\t\tif (!isRecord(node) || typeof node[\"address\"] !== \"string\" || !Array.isArray(node[\"entities\"])) return;\n\t\tfor (const entity of node[\"entities\"]) if (!isRecord(entity) || typeof entity[\"kind\"] !== \"string\" || typeof entity[\"id\"] !== \"string\") return;\n\t}\n\treturn blindCast(parsed);\n}\n//#endregion\nexport { readDeploymentSummary as n, writeDeploymentSummaryFile as r, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-DswOl_9E.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,6BAA6B;;AAEnC,SAAS,oBAAoB,QAAQ;CACpC,OAAO;EACN,KAAK,OAAO;EACZ,OAAO,OAAO,MAAM,KAAK,UAAU;GAClC,SAAS,KAAK;GACd,UAAU,KAAK;EAChB,EAAE;CACH;AACD;;;;;;AAMA,SAAS,2BAA2B,QAAQ;CAC3C,MAAM,OAAO,QAAQ,IAAI;CACzB,IAAI,SAAS,KAAK,KAAK,KAAK,WAAW,GAAG;CAC1C,IAAI;EACH,KAAG,cAAc,MAAM,KAAK,UAAU,oBAAoB,MAAM,CAAC,CAAC;CACnE,QAAQ,CAAC;AACV;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU;AAC/C;;;;;AAKA,SAAS,sBAAsB,gBAAgB;CAC9C,IAAI;CACJ,IAAI;EACH,MAAMA,KAAG,aAAa,gBAAgB,MAAM;CAC7C,QAAQ;EACP;CACD;CACA,IAAI;CACJ,IAAI;EACH,SAAS,KAAK,MAAM,GAAG;CACxB,QAAQ;EACP;CACD;CACA,IAAI,CAAC,SAAS,MAAM,KAAK,OAAO,OAAO,WAAW,YAAY,CAAC,MAAM,QAAQ,OAAO,QAAQ,GAAG;CAC/F,KAAK,MAAM,QAAQ,OAAO,UAAU;EACnC,IAAI,CAAC,SAAS,IAAI,KAAK,OAAO,KAAK,eAAe,YAAY,CAAC,MAAM,QAAQ,KAAK,WAAW,GAAG;EAChG,KAAK,MAAM,UAAU,KAAK,aAAa,IAAI,CAAC,SAAS,MAAM,KAAK,OAAO,OAAO,YAAY,YAAY,OAAO,OAAO,UAAU,UAAU;CACzI;CACA,OAAO,UAAU,MAAM;AACxB"}
@@ -0,0 +1,42 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ //#region ../../0-framework/2-authoring/bundle-paths/dist/index.mjs
4
+ /**
5
+ * The path-containment predicate and bundle-link validation shared by every
6
+ * assembly and packaging seam (node/nextjs adapters, the compute artifact
7
+ * writer, the local extractor). This predicate is the enforcement point of
8
+ * ADR-0047's boundary — a symlink may be preserved only while its target
9
+ * stays inside the assembled bundle — so it exists exactly once.
10
+ */
11
+ /** Lexical containment: `candidate` is `root` itself or below it. Both paths
12
+ * must already be absolute or share a resolution base; no filesystem access. */
13
+ function isWithin(root, candidate) {
14
+ const relative = path.relative(root, candidate);
15
+ return relative === "" || !relative.startsWith(`..${path.sep}`) && relative !== ".." && !path.isAbsolute(relative);
16
+ }
17
+ /** Walks the assembled bundle and rejects a dangling symlink or one whose
18
+ * resolved target escapes the bundle root. Symlinked directories are not
19
+ * descended: their targets are validated, and their contents belong to the
20
+ * target's own location. */
21
+ async function assertBundleSymlinksStayInside(bundleDir) {
22
+ const realRoot = await fs.promises.realpath(bundleDir);
23
+ const walk = async (directory) => {
24
+ for (const entry of await fs.promises.readdir(directory, { withFileTypes: true })) {
25
+ const full = path.join(directory, entry.name);
26
+ if (entry.isSymbolicLink()) {
27
+ let realTarget;
28
+ try {
29
+ realTarget = await fs.promises.realpath(full);
30
+ } catch {
31
+ throw new Error(`the assembled bundle contains a dangling symlink: ${full}`);
32
+ }
33
+ if (!isWithin(realRoot, realTarget)) throw new Error(`the assembled bundle contains a symlink whose target escapes the bundle: ${full} -> ${await fs.promises.readlink(full)}`);
34
+ } else if (entry.isDirectory()) await walk(full);
35
+ }
36
+ };
37
+ await walk(bundleDir);
38
+ }
39
+ //#endregion
40
+ export { isWithin as n, assertBundleSymlinksStayInside as t };
41
+
42
+ //# sourceMappingURL=dist-CVk7Pk4B.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist-CVk7Pk4B.mjs","names":[],"sources":["../../../0-framework/2-authoring/bundle-paths/dist/index.mjs"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\n//#region src/bundle-paths.ts\n/**\n* The path-containment predicate and bundle-link validation shared by every\n* assembly and packaging seam (node/nextjs adapters, the compute artifact\n* writer, the local extractor). This predicate is the enforcement point of\n* ADR-0047's boundary — a symlink may be preserved only while its target\n* stays inside the assembled bundle — so it exists exactly once.\n*/\n/** Lexical containment: `candidate` is `root` itself or below it. Both paths\n* must already be absolute or share a resolution base; no filesystem access. */\nfunction isWithin(root, candidate) {\n\tconst relative = path.relative(root, candidate);\n\treturn relative === \"\" || !relative.startsWith(`..${path.sep}`) && relative !== \"..\" && !path.isAbsolute(relative);\n}\n/** Walks the assembled bundle and rejects a dangling symlink or one whose\n* resolved target escapes the bundle root. Symlinked directories are not\n* descended: their targets are validated, and their contents belong to the\n* target's own location. */\nasync function assertBundleSymlinksStayInside(bundleDir) {\n\tconst realRoot = await fs.promises.realpath(bundleDir);\n\tconst walk = async (directory) => {\n\t\tfor (const entry of await fs.promises.readdir(directory, { withFileTypes: true })) {\n\t\t\tconst full = path.join(directory, entry.name);\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\tlet realTarget;\n\t\t\t\ttry {\n\t\t\t\t\trealTarget = await fs.promises.realpath(full);\n\t\t\t\t} catch {\n\t\t\t\t\tthrow new Error(`the assembled bundle contains a dangling symlink: ${full}`);\n\t\t\t\t}\n\t\t\t\tif (!isWithin(realRoot, realTarget)) throw new Error(`the assembled bundle contains a symlink whose target escapes the bundle: ${full} -> ${await fs.promises.readlink(full)}`);\n\t\t\t} else if (entry.isDirectory()) await walk(full);\n\t\t}\n\t};\n\tawait walk(bundleDir);\n}\n//#endregion\nexport { assertBundleSymlinksStayInside, isWithin };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,SAAS,MAAM,WAAW;CAClC,MAAM,WAAW,KAAK,SAAS,MAAM,SAAS;CAC9C,OAAO,aAAa,MAAM,CAAC,SAAS,WAAW,KAAK,KAAK,KAAK,KAAK,aAAa,QAAQ,CAAC,KAAK,WAAW,QAAQ;AAClH;;;;;AAKA,eAAe,+BAA+B,WAAW;CACxD,MAAM,WAAW,MAAM,GAAG,SAAS,SAAS,SAAS;CACrD,MAAM,OAAO,OAAO,cAAc;EACjC,KAAK,MAAM,SAAS,MAAM,GAAG,SAAS,QAAQ,WAAW,EAAE,eAAe,KAAK,CAAC,GAAG;GAClF,MAAM,OAAO,KAAK,KAAK,WAAW,MAAM,IAAI;GAC5C,IAAI,MAAM,eAAe,GAAG;IAC3B,IAAI;IACJ,IAAI;KACH,aAAa,MAAM,GAAG,SAAS,SAAS,IAAI;IAC7C,QAAQ;KACP,MAAM,IAAI,MAAM,qDAAqD,MAAM;IAC5E;IACA,IAAI,CAAC,SAAS,UAAU,UAAU,GAAG,MAAM,IAAI,MAAM,4EAA4E,KAAK,MAAM,MAAM,GAAG,SAAS,SAAS,IAAI,GAAG;GAC/K,OAAO,IAAI,MAAM,YAAY,GAAG,MAAM,KAAK,IAAI;EAChD;CACD;CACA,MAAM,KAAK,SAAS;AACrB"}