@prisma/composer-cli 0.30.0-dev.4 → 0.30.0-dev.6

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 (34) hide show
  1. package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs +34 -0
  2. package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs.map +1 -0
  3. package/dist/{dev-DbmjkSa6-Cgo29RcD.mjs → dev-current-Bm7Yrsmt-CEeCNPfn.mjs} +24 -5
  4. package/dist/dev-current-Bm7Yrsmt-CEeCNPfn.mjs.map +1 -0
  5. package/dist/dist-j4X7U5yA.mjs +1788 -0
  6. package/dist/dist-j4X7U5yA.mjs.map +1 -0
  7. package/dist/{execute-deploy-destroy-UKk_5-qQ-CcXyFcz7.mjs → execute-deploy-destroy-BK4R2qCX-DT6AspVB.mjs} +5 -4
  8. package/dist/execute-deploy-destroy-BK4R2qCX-DT6AspVB.mjs.map +1 -0
  9. package/dist/execute-dev-current-nYH8EiKK-CDxBLKxl.mjs +126 -0
  10. package/dist/execute-dev-current-nYH8EiKK-CDxBLKxl.mjs.map +1 -0
  11. package/dist/{execute-dev-_A1IRF4b-BqFi9cwl.mjs → execute-dev-qKlYePGn-CeIibwG6.mjs} +14 -48
  12. package/dist/execute-dev-qKlYePGn-CeIibwG6.mjs.map +1 -0
  13. package/dist/{family-Dt7BgpVf-DA7vMU9c.d.mts → family-BIyR33Uq-BDM09XC2.d.mts} +104 -8
  14. package/dist/family-BIyR33Uq-BDM09XC2.d.mts.map +1 -0
  15. package/dist/family.d.mts +47 -3
  16. package/dist/family.d.mts.map +1 -1
  17. package/dist/family.mjs +203 -9
  18. package/dist/family.mjs.map +1 -1
  19. package/dist/local-target-DZ6bu7Aj.mjs +48 -0
  20. package/dist/local-target-DZ6bu7Aj.mjs.map +1 -0
  21. package/dist/{container-transport-HcvNOGZL-ClGmzBIO.mjs → pipeline-Dpesfd2j-C8q5FvQ4.mjs} +3 -34
  22. package/dist/pipeline-Dpesfd2j-C8q5FvQ4.mjs.map +1 -0
  23. package/dist/testing.d.mts +7 -1
  24. package/dist/testing.d.mts.map +1 -1
  25. package/dist/testing.mjs +23 -2
  26. package/dist/testing.mjs.map +1 -1
  27. package/package.json +9 -5
  28. package/src/exports/family.ts +29 -0
  29. package/src/family/emulator-list.ts +100 -0
  30. package/dist/container-transport-HcvNOGZL-ClGmzBIO.mjs.map +0 -1
  31. package/dist/dev-DbmjkSa6-Cgo29RcD.mjs.map +0 -1
  32. package/dist/execute-deploy-destroy-UKk_5-qQ-CcXyFcz7.mjs.map +0 -1
  33. package/dist/execute-dev-_A1IRF4b-BqFi9cwl.mjs.map +0 -1
  34. package/dist/family-Dt7BgpVf-DA7vMU9c.d.mts.map +0 -1
package/dist/family.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as ComposerConfigSource, h as CliStructuredError$1, i as realOperations, n as CreateComposerFamilyOptions, r as createComposerFamily, t as ComposerOperations } from "./family-Dt7BgpVf-DA7vMU9c.mjs";
2
- import { ConfigSection } from "@prisma/cli-engine";
1
+ import { _ as Result, i as ComposerConfigSource, n as CreateComposerFamilyOptions$1, r as realOperations, t as ComposerOperations, v as CliStructuredError$1 } from "./family-BIyR33Uq-BDM09XC2.mjs";
2
+ import { CommandFamily, ConfigSection } from "@prisma/cli-engine";
3
3
  import { CliStructuredError } from "@prisma/cli-engine/protocol";
4
4
  //#region ../../0-framework/3-tooling/cli/dist/family.d.mts
5
5
  //#region src/family/section.d.ts
@@ -15,5 +15,49 @@ type ComposerError = CliStructuredError$1;
15
15
  /** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */
16
16
  declare function toEngineError(error: ComposerError): CliStructuredError;
17
17
  //#endregion
18
- export { type ComposerOperations, type CreateComposerFamilyOptions, composerSection, createComposerFamily, realOperations, toEngineError };
18
+ //#region ../../1-prisma-cloud/0-lowering/dev-emulators/dist/index.d.mts
19
+ //#endregion
20
+ //#region src/emulator-list.d.ts
21
+ /** What an emulator's instances are. */
22
+ type EmulatorKind = 'service' | 'database' | 'bucket';
23
+ interface EmulatorInstance {
24
+ readonly id: string;
25
+ readonly kind: EmulatorKind;
26
+ /** A service's URL, a database's connection string, or a bucket's S3 endpoint plus `/<id>`. */
27
+ readonly url: string;
28
+ /** A service's status, a database's `running` or `stopped`, or `running` for a bucket. */
29
+ readonly state: string;
30
+ readonly labels: Readonly<Record<string, string>>;
31
+ }
32
+ /** Why a running emulator could not be listed: it did not answer, or it answered with an error. */
33
+ interface EmulatorListingError {
34
+ readonly code: string;
35
+ readonly message: string;
36
+ }
37
+ interface EmulatorListing {
38
+ readonly kind: EmulatorKind;
39
+ readonly running: boolean;
40
+ /** The emulator's admin URL; null when it is not running. */
41
+ readonly url: string | null;
42
+ /** Empty when the emulator is not running or could not be listed. */
43
+ readonly instances: readonly EmulatorInstance[];
44
+ /** Null unless the emulator runs but could not be listed. */
45
+ readonly error: EmulatorListingError | null;
46
+ }
47
+ interface EmulatorList {
48
+ readonly emulators: readonly EmulatorListing[];
49
+ }
50
+ //#endregion
51
+ //#region src/family/emulator-list.d.ts
52
+ type ListEmulators = () => Promise<Result<EmulatorList, CliStructuredError$1>>;
53
+ //#endregion
54
+ //#region src/exports/family.d.ts
55
+ interface CreateComposerFamilyOptions extends CreateComposerFamilyOptions$1 {
56
+ /** Defaults to the real listing of this machine's emulators. */
57
+ readonly listEmulators?: ListEmulators | undefined;
58
+ }
59
+ /** Composer's command family: `deploy`, `dev`, `dev url`, `dev stop` and `emulator list`, keyed by the path each is meant to mount at. */
60
+ declare function createComposerFamily(options?: CreateComposerFamilyOptions): CommandFamily;
61
+ //#endregion
62
+ export { type ComposerOperations, CreateComposerFamilyOptions, type ListEmulators, composerSection, createComposerFamily, realOperations, toEngineError };
19
63
  //# sourceMappingURL=family.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"family.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/family.d.mts"],"mappings":";;;;;cAKc,iBAAiB,cAAc;;;;;;;;KAQxC,gBAAA;;iBAEY,cAAc,OAAO,gBAAgB"}
1
+ {"version":3,"file":"family.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/family.d.mts","../../../1-prisma-cloud/0-lowering/dev-emulators/dist/index.d.mts","../src/family/emulator-list.ts","../src/exports/family.ts"],"mappings":";;;;;cAKc,iBAAiB,cAAc;;;;;;;;KAQxC,gBAAA;;iBAEY,cAAc,OAAO,gBAAgB;;;;;;KC4JjD;UAEK;WACC;WACA,MAAM;;WAEN;;WAEA;WACA,QAAQ,SAAS;;;UAGlB;WACC;WACA;;UAED;WACC,MAAM;WACN;;WAEA;;WAEA,oBAAoB;;WAEpB,OAAO;;UAER;WACC,oBAAoB;;;;KCxLnB,sBAAsB,QAAQ,OAAO,cAAc;;;UCc9C,oCAAoC;;WAE1C,gBAAgB;;;iBAIX,qBAAqB,UAAS,8BAAmC"}
package/dist/family.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as alchemyCommandLine, i as sectionMissing, t as checkComposerConfig } from "./composer-config-CY9fET8H-CgnpfWc2.mjs";
2
- import { n as devWithDeps, r as executionDiagnostics, t as deployWithDeps } from "./dev-DbmjkSa6-Cgo29RcD.mjs";
2
+ import { a as executionDiagnostics, i as devWithDeps, n as devStop, r as devUrl, t as deployWithDeps } from "./dev-current-Bm7Yrsmt-CEeCNPfn.mjs";
3
3
  import { defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, positional } from "@prisma/cli-engine";
4
4
  import { CliStructuredError, notOk, ok } from "@prisma/cli-engine/protocol";
5
5
  //#region ../../0-framework/3-tooling/cli/dist/family.mjs
@@ -446,11 +446,28 @@ Generated stack file: ${event.stackFilePath}\nRun \`${event.reproduceCommand}\`
446
446
  }
447
447
  };
448
448
  }
449
+ /** A detached session owns nothing to stop, so a Ctrl-C before it was ready stops the app the way `prisma dev stop` does. */
450
+ async function stopDetachedApp(operations, ctx) {
451
+ const stopped = await operations.devStop({
452
+ config: ctx.config,
453
+ cwd: ctx.cwd
454
+ });
455
+ if (stopped.ok) return;
456
+ ctx.report({
457
+ kind: "message",
458
+ severity: "warn",
459
+ text: `The app could not be stopped: ${stopped.failure.message} Run \`prisma dev stop\`.`
460
+ });
461
+ }
449
462
  const createDevCommand = (operations) => defineSessionCommand({
450
463
  help: {
451
464
  summary: "Bring up the application whose root node is <entry>'s default export, entirely on this machine.",
452
- description: "Runs credential-free and watches the app for changes, reconverging on every edit.",
453
- examples: ["{bin} dev module.ts", "{bin} dev module.ts --fresh"]
465
+ description: "Runs credential-free and watches the app for changes, reconverging on every edit. A node is one service, database or bucket in the app. Each node runs on a local emulator: a program on this machine that stands in for Prisma Cloud and runs services, databases or S3-compatible buckets. A node's address is its name in the app, with dots for a nested node (catalog.database). The app and where each node runs are recorded in this directory: `prisma dev url` works from here while `prisma dev` runs, and `prisma dev stop` also works after `prisma dev` was killed. Ending `prisma dev` stops its services and database servers; data and ports are kept. With --detach it returns once every service answers and leaves the app running without watching for changes, until `prisma dev stop`.",
466
+ examples: [
467
+ "{bin} dev module.ts",
468
+ "{bin} dev module.ts --fresh",
469
+ "{bin} dev module.ts --detach"
470
+ ]
454
471
  },
455
472
  args: {
456
473
  positionals: { entry: positional.string({
@@ -462,7 +479,8 @@ const createDevCommand = (operations) => defineSessionCommand({
462
479
  brief: "Override the root node's name — the dev instance's application name.",
463
480
  placeholder: "name"
464
481
  }),
465
- fresh: flag.boolean({ brief: "Destroy the dev stack and wipe the dev state directory before starting." })
482
+ fresh: flag.boolean({ brief: "Destroy the dev stack and wipe the dev state directory before starting." }),
483
+ detach: flag.boolean({ brief: "Return once every service answers and leave the app running without watching for changes. Use it in scripts, agents and CI. `prisma dev stop` stops the app." })
466
484
  }
467
485
  },
468
486
  needs: { config: composerSection },
@@ -474,16 +492,93 @@ const createDevCommand = (operations) => defineSessionCommand({
474
492
  config: ctx.config,
475
493
  name: args.flags.name,
476
494
  fresh: args.flags.fresh,
495
+ detach: args.flags.detach,
477
496
  cwd: ctx.cwd,
478
497
  onEvent: reportDevEvent(ctx.report, ctx.lastChild)
479
498
  }, { alchemy: coalescedConverge(alchemy) });
480
499
  if (!result.ok) return settleConvergeFailure(result.failure, ctx);
500
+ if (args.flags.detach) {
501
+ if (ctx.signal.aborted) await stopDetachedApp(operations, ctx);
502
+ return ok(void 0);
503
+ }
481
504
  await stopRequested(ctx.signal);
482
505
  await result.value.stop();
483
506
  return ok(void 0);
484
507
  }
485
508
  });
486
509
  /**
510
+ * `dev stop` — stops the app `prisma dev` last ran from this directory, as
511
+ * ending `prisma dev` would: its service processes and database servers.
512
+ * For an app whose `prisma dev` was killed without the chance to stop it.
513
+ */
514
+ const createDevStopCommand = (operations) => defineCommand({
515
+ help: {
516
+ summary: "Stop the app `prisma dev` last ran from this directory: its service processes and local database servers. Data and ports are kept for the next `prisma dev`.",
517
+ description: "Ending `prisma dev` with Ctrl-C does the same. Run this when `prisma dev` was killed without a chance to stop the app, or before deleting the directory. The emulators keep running; other directories may be using them.",
518
+ examples: ["{bin} dev stop"]
519
+ },
520
+ args: {},
521
+ needs: { config: composerSection },
522
+ handler: async (_args, ctx) => {
523
+ const result = await operations.devStop({
524
+ config: ctx.config,
525
+ cwd: ctx.cwd
526
+ });
527
+ if (!result.ok) return notOk(toEngineError(result.failure));
528
+ const { app, stopped } = result.value;
529
+ return ok(ctx.present({ data: result.value }, {
530
+ human: (ui) => [{
531
+ kind: "summary",
532
+ status: "ok",
533
+ text: `Stopped ${ui.emphasize(app)}. Its data and ports are kept for the next \`prisma dev\`.`
534
+ }, ...stopped.length === 0 ? [] : [{
535
+ kind: "table",
536
+ columns: ["Address", "Kind"],
537
+ rows: stopped.map(({ address, kind }) => [address, kind])
538
+ }]],
539
+ stdout: () => [],
540
+ json: () => result.value,
541
+ next: () => []
542
+ }));
543
+ }
544
+ });
545
+ /**
546
+ * `dev url <address>` — where a node of the app `prisma dev` runs from this
547
+ * directory answers locally. A data command: the URL is its stdout line, so
548
+ * `$(prisma dev url gateway --format human)` is the URL alone.
549
+ */
550
+ const createDevUrlCommand = (operations) => defineCommand({
551
+ help: {
552
+ summary: "Print the local URL of a node (a service, database or bucket in your app) that `prisma dev` runs from this directory: a service's HTTP URL, a database's connection string, or a bucket's S3 address.",
553
+ description: "Reads what the last `prisma dev` in this directory recorded and starts nothing, so run it while `prisma dev` is running; a node that is not running is an error. With --format human the URL alone goes to stdout. In a script, the JSON result holds it: prisma dev url gateway | jq -er 'select(.kind==\"result\").envelope.result.url'.",
554
+ examples: ["{bin} dev url gateway", "{bin} dev url catalog.database --json"]
555
+ },
556
+ args: { positionals: { address: positional.string({
557
+ brief: "The node's address: its name in the app, with dots for a nested node, such as catalog.database.",
558
+ placeholder: "address"
559
+ }) } },
560
+ needs: { config: composerSection },
561
+ handler: async (args, ctx) => {
562
+ const result = await operations.devUrl({
563
+ config: ctx.config,
564
+ address: args.positionals.address,
565
+ cwd: ctx.cwd
566
+ });
567
+ if (!result.ok) return notOk(toEngineError(result.failure));
568
+ const node = result.value;
569
+ return ok(ctx.present({ data: node }, {
570
+ human: (ui) => [{
571
+ kind: "summary",
572
+ status: "ok",
573
+ text: `The ${node.kind} ${ui.emphasize(node.address)} is ${node.state} at ${node.url}`
574
+ }],
575
+ stdout: () => [node.url],
576
+ json: () => node,
577
+ next: () => []
578
+ }));
579
+ }
580
+ });
581
+ /**
487
582
  * Composer's `CommandFamily`: the unit the `prisma` bin mounts.
488
583
  *
489
584
  * This module and everything it reaches statically must stay free of alchemy
@@ -500,27 +595,126 @@ const createDevCommand = (operations) => defineSessionCommand({
500
595
  * mount this family against the test double and exercise real grammar, real
501
596
  * arg validation and real handlers with no alchemy behind them.
502
597
  *
503
- * The family ships `deploy` and `dev` only. `destroy` and `log` are
504
- * programmatic operations in `@prisma/composer/control`, not commands.
598
+ * The family ships `deploy`, `dev`, `dev url` and `dev stop`, keyed by the
599
+ * path they are meant to mount at; the host decides where each one mounts.
600
+ * A host may add commands of its own through `commands` — the published
601
+ * family adds `emulator list`, which needs no project. `destroy` and `log`
602
+ * are programmatic operations in `@prisma/composer/control`, not commands.
505
603
  */
506
604
  const realOperations = {
507
605
  deploy: deployWithDeps,
508
- dev: devWithDeps
606
+ dev: devWithDeps,
607
+ devUrl,
608
+ devStop
509
609
  };
510
610
  /** The `prisma` CLI's error reference; the engine appends `/<CODE>` to it for every error envelope. */
511
611
  const CLI_DOCS_BASE = "https://www.prisma.io/docs/cli/error-reference/";
512
- function createComposerFamily(options = {}) {
612
+ function createComposerFamily$1(options = {}) {
513
613
  const operations = options.operations ?? realOperations;
514
614
  return defineCommandFamily({
515
615
  configSection: composerSection,
516
616
  commands: {
517
617
  deploy: createDeployCommand(operations),
518
- dev: createDevCommand(operations)
618
+ dev: createDevCommand(operations),
619
+ "dev url": createDevUrlCommand(operations),
620
+ "dev stop": createDevStopCommand(operations),
621
+ ...options.commands
519
622
  },
520
623
  docsBaseUrl: CLI_DOCS_BASE
521
624
  });
522
625
  }
523
626
  //#endregion
627
+ //#region src/family/emulator-list.ts
628
+ /**
629
+ * `emulator list` — every local emulator on this machine and every
630
+ * instance it holds. It needs no project and no config. The listing comes
631
+ * from the Prisma Cloud domain, so the command is assembled into the
632
+ * family here, where both domains may be imported.
633
+ */
634
+ /** Loaded on first use, so nothing of the emulators' clients loads with the family. */
635
+ const listEmulators = async () => (await import("./dist-j4X7U5yA.mjs")).listEmulators();
636
+ const EMULATOR_NAMES = {
637
+ service: "Service emulator",
638
+ database: "Database emulator",
639
+ bucket: "Bucket emulator"
640
+ };
641
+ /** The node and directory that started an instance, when Composer's labels say. */
642
+ function startedBy(labels) {
643
+ const address = labels["composer.address"];
644
+ const directory = labels["composer.directory"];
645
+ if (address === void 0) return void 0;
646
+ return directory === void 0 ? address : `${address} in ${directory}`;
647
+ }
648
+ function labelOf(emulator, dim) {
649
+ const name = EMULATOR_NAMES[emulator.kind];
650
+ if (!emulator.running || emulator.url === null) return `${name} ${dim("(not running)")}`;
651
+ if (emulator.error !== null) return `${name} at ${emulator.url}: could not list its instances (${emulator.error.code}: ${emulator.error.message})`;
652
+ return `${name} at ${emulator.url}`;
653
+ }
654
+ function statusOf(emulator) {
655
+ if (emulator.error !== null) return "error";
656
+ return emulator.running ? "ok" : "info";
657
+ }
658
+ const createEmulatorListCommand = (list) => defineCommand({
659
+ help: {
660
+ summary: "List the local emulators on this machine — the programs `prisma dev` starts to run services, databases and S3-compatible buckets without Prisma Cloud — with every instance each one holds.",
661
+ description: "Needs no project: it shows every directory’s instances. An emulator that is not running is listed with no instances, and one that runs but cannot be listed is shown with the error. Each instance’s labels say which directory, app and node started it. A stopped instance keeps its port and data until it is deleted.",
662
+ examples: ["{bin} emulator list", "{bin} emulator list --json"]
663
+ },
664
+ args: {},
665
+ handler: async (_args, ctx) => {
666
+ const result = await list();
667
+ if (!result.ok) return notOk(toEngineError(result.failure));
668
+ const { emulators } = result.value;
669
+ return ok(ctx.present({ data: result.value }, {
670
+ human: (ui) => [{
671
+ kind: "tree",
672
+ roots: emulators.map((emulator) => ({
673
+ label: labelOf(emulator, ui.dim),
674
+ status: statusOf(emulator),
675
+ children: emulator.instances.map((instance) => {
676
+ const by = startedBy(instance.labels);
677
+ return { label: [
678
+ instance.id,
679
+ instance.url,
680
+ instance.state,
681
+ ...by ? [ui.dim(by)] : []
682
+ ].join(" ") };
683
+ })
684
+ }))
685
+ }],
686
+ stdout: () => [],
687
+ json: () => result.value,
688
+ next: () => []
689
+ }));
690
+ }
691
+ });
692
+ //#endregion
693
+ //#region src/exports/family.ts
694
+ /**
695
+ * Public surface (the `./family` subpath): composer's engine `CommandFamily`,
696
+ * for hosts that mount composer's commands into their own CLI — the `prisma`
697
+ * bin does exactly this.
698
+ *
699
+ * Kept apart from `@prisma/composer`'s `./control` on purpose. `./control` is
700
+ * the programmatic deploy pipeline; this is the command surface: grammar, help
701
+ * and arg validation belong to the engine, and the handlers behind them are
702
+ * the same operations `./control` exposes.
703
+ *
704
+ * Its static graph is alchemy-free and effect-free, so importing it costs a
705
+ * host nothing until a composer command actually runs.
706
+ */
707
+ /** Composer's command family: `deploy`, `dev`, `dev url`, `dev stop` and `emulator list`, keyed by the path each is meant to mount at. */
708
+ function createComposerFamily(options = {}) {
709
+ return createComposerFamily$1({
710
+ ...options,
711
+ commands: {
712
+ "emulator list": createEmulatorListCommand(options.listEmulators ?? listEmulators),
713
+ ...options.commands
714
+ }
715
+ });
716
+ }
717
+ //#endregion
524
718
  export { composerSection, createComposerFamily, realOperations, toEngineError };
525
719
 
526
720
  //# sourceMappingURL=family.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"family.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/family.mjs"],"sourcesContent":["import { a as executionDiagnostics, i as deployWithDeps, n as devWithDeps } from \"./dev-DbmjkSa6.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy-BqHpStQn.mjs\";\nimport { i as sectionMissing, t as checkComposerConfig } from \"./composer-config-CY9fET8H.mjs\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError, notOk, ok } from \"@prisma/cli-engine/protocol\";\n//#region src/family/translate-error.ts\n/**\n* The family boundary's error translation.\n*\n* Composer and the engine each carry a class called `CliStructuredError`, both\n* descended from the same prisma/prisma foundation, and both recognize errors\n* by duck-typing on `name === 'CliStructuredError'`. That means a composer\n* error handed to the engine untranslated is ACCEPTED — it does not fail\n* loudly, it renders. What it loses is its `fix`: composer's foundation\n* carries remediation as one prose string on that field, the engine carries it\n* as a `nextActions` list and has no `fix` at all, so the fix text is dropped\n* silently and the user is told what broke with no word on what to do about\n* it. Nothing about that failure is visible without a test that looks for the\n* fix on the other side, which is why there is one.\n*\n* Everything else on the envelope survives as-is; only remediation changes\n* representation.\n*/\n/**\n* Composer's `fix` is free prose — \"add this overrides block and reinstall\",\n* \"run the build, then retry\" — with no machine-readable command inside it.\n* `user-choice` is the engine's own kind for exactly that (it is what the\n* engine uses for its own config and prompt failures), so the text carries\n* over verbatim as one action rather than being parsed into a command the\n* author never wrote.\n*/\nfunction fixAsNextActions(fix) {\n\treturn fix === void 0 ? [] : [{\n\t\tkind: \"user-choice\",\n\t\tlabel: fix\n\t}];\n}\n/** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */\nfunction toEngineError(error) {\n\treturn new CliStructuredError(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tnextActions: fixAsNextActions(error.fix),\n\t\t...error.why === void 0 ? {} : { why: error.why },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: error.meta },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl },\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/family/converge.ts\n/** The adapter the operations call, backed by the engine's `ctx.spawn` so the\n* terminal reaches alchemy natively and the engine owns signal policy. */\nfunction convergeSpawn(ctx) {\n\treturn async (invocation) => {\n\t\tconst commandLine = alchemyCommandLine(invocation);\n\t\treturn {\n\t\t\t...await ctx.spawn({\n\t\t\t\tcommand: commandLine.command,\n\t\t\t\targs: commandLine.args,\n\t\t\t\tcwd: commandLine.cwd,\n\t\t\t\tenv: commandLine.env\n\t\t\t}),\n\t\t\tcommandLine\n\t\t};\n\t};\n}\n/** The in-process leg's deps: composer's existing seam, carrying the engine's\n* own client and workspace id rather than anything read from the env. */\nfunction operationDeps(spec) {\n\treturn {\n\t\talchemy: spec.alchemy,\n\t\tcredentials: {\n\t\t\tworkspaceId: spec.workspaceId,\n\t\t\tclient: spec.client\n\t\t}\n\t};\n}\n/**\n* The reproduce hint a failed converge carries. Deliberately absent for an\n* aborted one: the user stopped it, so there is nothing to reproduce.\n*/\nfunction reproduceHint(failure) {\n\tconst diagnostics = executionDiagnostics(failure);\n\tif (diagnostics === void 0) return [];\n\treturn [{\n\t\tkind: \"run-command\",\n\t\tlabel: `Run the converge directly from ${diagnostics.cwd} to reproduce this`,\n\t\tcommand: diagnostics.reproduceCommand,\n\t\treason: `Generated stack file: ${diagnostics.stackFilePath}`\n\t}];\n}\n/**\n* How a FAILED converge settles. `deploy` and `dev` both end this\n* way and must not drift apart, so the decision lives here once rather than\n* inline in each handler.\n*\n* A failure that reached the child exits with the child's status verbatim and\n* carries the reproduce hint; a failure that never reached the child is an\n* ordinary structured error and gets the normal envelope. Nothing here reads\n* `signal` — see settleConverge.\n*/\nfunction settleConvergeFailure(failure, ctx) {\n\tconst child = ctx.lastChild();\n\tif (child !== void 0 && child.exitCode !== 0) return ok(exitWithChildStatus({ nextActions: reproduceHint(failure) }));\n\treturn notOk(toEngineError(failure));\n}\n/**\n* How a converge settles, now that the engine owns the child's status.\n*\n* Nothing here reads `signal`. `exitWithChildStatus` settles from the engine's\n* own record of the child, and a signal-killed one overrules whatever this\n* function asked for: 128 + the signal, no failure envelope, and the reproduce\n* hint dropped, because the user stopped the run and there is nothing to\n* reproduce.\n*\n* What is left is the operation's own verdict. A failure that reached the\n* child exits with the child's status verbatim and carries the reproduce hint;\n* a failure that never reached the child is an ordinary structured error and\n* gets the normal envelope.\n*\n* A SUCCESS presents its result even when the child was signal-killed. No\n* composer operation produces that pair today — each one reports a\n* signal-killed converge as a failure — and an operation that ever did would\n* have a real result worth showing. The run still exits 130, because the\n* engine settles a signal-terminated run from its own record of the signal\n* whatever the handler returns.\n*/\nfunction settleConverge(result, ctx, present) {\n\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\treturn ok(present(result.value));\n}\n//#endregion\n//#region src/family/section.ts\nfunction diagnostic(finding, file) {\n\tconst where = finding.where ?? file;\n\treturn {\n\t\tcode: finding.code,\n\t\tseverity: \"error\",\n\t\tsummary: finding.summary,\n\t\t...finding.why === void 0 ? {} : { why: finding.why },\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: finding.fix\n\t\t}],\n\t\t...where === void 0 ? {} : { where: { path: where } },\n\t\t...finding.field === void 0 ? {} : { meta: { field: finding.field } }\n\t};\n}\nfunction refuse(findings, file) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostics: findings.map((finding) => diagnostic(finding, file))\n\t};\n}\nfunction validate(raw, provenance) {\n\tconst file = provenance.files[0];\n\tif (raw === void 0 || file === void 0) return refuse([sectionMissing], void 0);\n\tconst checked = checkComposerConfig(raw, file);\n\tif (!checked.ok) return refuse(checked.findings, file);\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tvalue: checked.value,\n\t\t\tfile\n\t\t},\n\t\tdiagnostics: []\n\t};\n}\nconst composerSection = defineConfigSection({\n\tname: \"composer\",\n\tvalidate,\n\tmerge: (_parent, child) => child\n});\n//#endregion\n//#region src/family/workspace.ts\n/**\n* The workspace the in-process leg acts in, from the engine's credential\n* read. Handlers never decode a token and never read PRISMA_WORKSPACE_ID:\n* whether the credential came from a stored session or the environment, the\n* engine has already resolved it, and branching on where it came from is a\n* defect by the credential-manager design.\n*\n* Undefined when the active credential names no workspace — an environment\n* token whose claims carry none. The container descriptors raise their own\n* \"workspace required\" error in that case, which is the error the user needs.\n*/\nasync function workspaceIdOf(ctx) {\n\treturn (await ctx.activeCredential())?.workspaceId;\n}\n//#endregion\n//#region src/family/commands/deploy.ts\nconst STEP_LABELS = {\n\tprepare: \"load config and app\",\n\tassemble: \"assemble services\",\n\tconnect: \"connect to project and branch\",\n\tpreflight: \"check environment variables\",\n\tapply: \"plan and apply\",\n\trecord: \"record result\"\n};\nfunction stepLabel(step) {\n\treturn step.name === \"assemble-service\" ? `assemble ${step.address}` : STEP_LABELS[step.name];\n}\nfunction stepId(step) {\n\treturn step.name === \"assemble-service\" ? `deploy.assemble.${step.address}` : `deploy.${step.name}`;\n}\n/** `850ms`, `12.3s`, `9m 35s`. */\nfunction formatDuration(ms) {\n\tif (ms < 1e3) return `${String(Math.round(ms))}ms`;\n\tif (ms < 6e4) return `${(ms / 1e3).toFixed(1)}s`;\n\tconst seconds = Math.round(ms / 1e3);\n\treturn `${String(Math.floor(seconds / 60))}m ${String(seconds % 60)}s`;\n}\n/** The operation's step events as engine events. The engine prints only `step`, so a finished step carries its duration in the text too. */\nfunction toEngineEvent(event) {\n\tconst id = stepId(event.step);\n\tif (event.kind === \"step-started\") return {\n\t\tkind: \"step-started\",\n\t\tstep: stepLabel(event.step),\n\t\tid,\n\t\t...event.step.name === \"assemble-service\" ? { parentId: \"deploy.assemble\" } : {}\n\t};\n\treturn {\n\t\tkind: \"step-finished\",\n\t\tstep: `${stepLabel(event.step)} (${formatDuration(event.durationMs)})`,\n\t\tid,\n\t\toutcome: event.outcome,\n\t\tdata: {\n\t\t\t...event.data,\n\t\t\tdurationMs: event.durationMs\n\t\t}\n\t};\n}\nconst createDeployCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} deploy module.ts\", \"{bin} deploy module.ts --stage feat-auth\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...).\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the deploy's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Deploy scope to target; omit for production.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\treport: flag.string({\n\t\t\t\tbrief: \"Write the deploy's outcome as JSON to this path — resources, preview URLs, and the failure cause. Also settable as PRISMA_COMPOSER_REPORT_FILE.\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t}),\n\t\t\tbuildId: flag.string({\n\t\t\t\tbrief: \"Join the deploy record your CI already created rather than letting the target create one. Each target also reads its own environment variable for this; the flag wins.\",\n\t\t\t\tplaceholder: \"id\"\n\t\t\t})\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.deploy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tstage: args.flags.stage,\n\t\t\tcwd: ctx.cwd,\n\t\t\treportPath: args.flags.report,\n\t\t\treportId: args.flags.buildId,\n\t\t\tonEvent: (event) => ctx.report(toEngineEvent(event))\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, ({ summary, durationMs }) => {\n\t\t\tconst target = `to ${args.flags.stage ?? \"production\"} in ${formatDuration(durationMs)}`;\n\t\t\tfor (const node of summary?.nodes ?? []) for (const entity of node.entities) if (entity.url !== void 0) ctx.report({\n\t\t\t\tkind: \"endpoint\",\n\t\t\t\tname: node.address,\n\t\t\t\turl: entity.url\n\t\t\t});\n\t\t\treturn ctx.present({ data: {\n\t\t\t\tsummary: summary ?? null,\n\t\t\t\tdurationMs\n\t\t\t} }, {\n\t\t\t\thuman: (ui) => summary === void 0 ? [{\n\t\t\t\t\tkind: \"summary\",\n\t\t\t\t\tstatus: \"ok\",\n\t\t\t\t\ttext: `Deployed ${target}.`\n\t\t\t\t}] : [{\n\t\t\t\t\tkind: \"summary\",\n\t\t\t\t\tstatus: \"ok\",\n\t\t\t\t\ttext: `Deployed ${ui.emphasize(summary.app)} ${target}.`\n\t\t\t\t}, {\n\t\t\t\t\tkind: \"table\",\n\t\t\t\t\tcolumns: [\"Address\", \"Deployed\"],\n\t\t\t\t\trows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(\", \")])\n\t\t\t\t}],\n\t\t\t\tstdout: () => [],\n\t\t\t\tjson: () => ({\n\t\t\t\t\tsummary: summary ?? null,\n\t\t\t\t\tdurationMs\n\t\t\t\t}),\n\t\t\t\tnext: () => []\n\t\t\t});\n\t\t});\n\t}\n});\n//#endregion\n//#region src/family/commands/dev.ts\nconst STOP_STEP = \"Stopping the app's services — emulators and data stay up\";\n/** Resolves when the run is asked to stop. */\nfunction stopRequested(signal) {\n\tif (signal.aborted) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* One converge at a time. `ctx.spawn` refuses a second live child, and the\n* watch loop can well fire a rebuild while the previous converge is still\n* running — so a request that arrives during a live converge joins the single\n* queued follow-up instead of starting its own. That extends the coalescing\n* the watcher already does across a burst of edits to cover the converge\n* itself, and it is sound because every dev converge is the SAME invocation:\n* one stack file at one fixed path, rewritten in place before each request.\n*/\nfunction coalescedConverge(run) {\n\tlet live;\n\tlet queued;\n\tconst start = (invocation) => {\n\t\tconst outcome = run(invocation);\n\t\tconst settled = outcome.then(() => void 0, () => void 0);\n\t\tlive = settled;\n\t\tsettled.then(() => {\n\t\t\tif (live === settled) live = void 0;\n\t\t});\n\t\treturn outcome;\n\t};\n\treturn (invocation) => {\n\t\tconst running = live;\n\t\tif (running === void 0) return start(invocation);\n\t\tqueued ??= running.then(() => {\n\t\t\tqueued = void 0;\n\t\t\treturn start(invocation);\n\t\t});\n\t\treturn queued;\n\t};\n}\n/** The front door, ordered by address depth (fewest dots first) then lexicographically. */\nfunction frontDoorOrder(endpoints) {\n\treturn [...endpoints].sort((a, b) => {\n\t\tconst depth = a.address.split(\".\").length - b.address.split(\".\").length;\n\t\tif (depth !== 0) return depth;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t});\n}\n/**\n* The operation's events as engine events. The legacy `[dev]` console prefix\n* is gone: these are commentary the engine renders and frames.\n*/\nfunction reportDevEvent(report, lastChild) {\n\tlet stopFailed = false;\n\treturn (event) => {\n\t\tswitch (event.kind) {\n\t\t\tcase \"ready\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"status\",\n\t\t\t\t\tsubject: \"dev\",\n\t\t\t\t\tstatus: \"ready\"\n\t\t\t\t});\n\t\t\t\tfor (const endpoint of frontDoorOrder(event.endpoints)) report({\n\t\t\t\t\tkind: \"endpoint\",\n\t\t\t\t\tname: endpoint.address,\n\t\t\t\t\turl: endpoint.url\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"unwatchable\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.address} has no watchable inputs.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"rebuild-failed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Rebuild failed: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"config-changed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.file} changed. Restart dev to apply it; rebuilds are paused until then.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"watch-error\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Watch error: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"converge-failed\": {\n\t\t\t\tconst child = lastChild();\n\t\t\t\tif (child !== void 0 && child.signal !== null) return;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Converge failed — the running app is untouched; still watching.\nGenerated stack file: ${event.stackFilePath}\\nRun \\`${event.reproduceCommand}\\` from ${event.cwd} to reproduce this directly.`\n\t\t\t\t});\n\t\t\t\treport({\n\t\t\t\t\tkind: \"remediation\",\n\t\t\t\t\taction: {\n\t\t\t\t\t\tkind: \"run-command\",\n\t\t\t\t\t\tlabel: `Run the converge directly from ${event.cwd} to reproduce this`,\n\t\t\t\t\t\tcommand: event.reproduceCommand,\n\t\t\t\t\t\treason: `Generated stack file: ${event.stackFilePath}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"stopping\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-started\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stop-error\":\n\t\t\t\tstopFailed = true;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `A service refused to stop: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stopped\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\",\n\t\t\t\t\toutcome: stopFailed ? \"warning\" : \"ok\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t}\n\t};\n}\nconst createDevCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit.\",\n\t\texamples: [\"{bin} dev module.ts\", \"{bin} dev module.ts --fresh\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...).\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tfresh: flag.boolean({ brief: \"Destroy the dev stack and wipe the dev state directory before starting.\" })\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\tconst result = await operations.dev({\n\t\t\tentry: args.positionals.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tfresh: args.flags.fresh,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: reportDevEvent(ctx.report, ctx.lastChild)\n\t\t}, { alchemy: coalescedConverge(alchemy) });\n\t\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\t\tawait stopRequested(ctx.signal);\n\t\tawait result.value.stop();\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/family.ts\n/**\n* Composer's `CommandFamily`: the unit the `prisma` bin mounts.\n*\n* This module and everything it reaches statically must stay free of alchemy\n* and of effect VALUE imports: the `prisma` bin imports the family directly,\n* so anything in this static graph loads on `prisma --version`. The mechanism\n* that holds it is the existing lazy boundary inside the operation modules —\n* `operations/deploy.ts` and `dev.ts` each `await import()` their executor,\n* and it is the executors that reach the provider tree. Importing the operations here is therefore free; importing an\n* executor, or flattening one of those dynamic imports, is not.\n* scripts/check-family-static-graph.mjs enforces this against BUILT output,\n* where type-only imports have already been erased.\n*\n* The commands close over the operations they are given, so a host can\n* mount this family against the test double and exercise real grammar, real\n* arg validation and real handlers with no alchemy behind them.\n*\n* The family ships `deploy` and `dev` only. `destroy` and `log` are\n* programmatic operations in `@prisma/composer/control`, not commands.\n*/\nconst realOperations = {\n\tdeploy: deployWithDeps,\n\tdev: devWithDeps\n};\n/** The `prisma` CLI's error reference; the engine appends `/<CODE>` to it for every error envelope. */\nconst CLI_DOCS_BASE = \"https://www.prisma.io/docs/cli/error-reference/\";\nfunction createComposerFamily(options = {}) {\n\tconst operations = options.operations ?? realOperations;\n\treturn defineCommandFamily({\n\t\tconfigSection: composerSection,\n\t\tcommands: {\n\t\t\tdeploy: createDeployCommand(operations),\n\t\t\tdev: createDevCommand(operations)\n\t\t},\n\t\tdocsBaseUrl: CLI_DOCS_BASE\n\t});\n}\n//#endregion\nexport { composerSection, createComposerFamily, realOperations, toEngineError };\n\n//# sourceMappingURL=family.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,iBAAiB,KAAK;CAC9B,OAAO,QAAQ,KAAK,IAAI,CAAC,IAAI,CAAC;EAC7B,MAAM;EACN,OAAO;CACR,CAAC;AACF;;AAEA,SAAS,cAAc,OAAO;CAC7B,OAAO,IAAI,mBAAmB,MAAM,MAAM,MAAM,SAAS;EACxD,UAAU,MAAM;EAChB,aAAa,iBAAiB,MAAM,GAAG;EACvC,GAAG,MAAM,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,MAAM,IAAI;EAChD,GAAG,MAAM,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO,MAAM,MAAM;EACtD,GAAG,MAAM,SAAS,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,MAAM,KAAK;EACnD,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,QAAQ;EAC5D,OAAO;CACR,CAAC;AACF;;;AAKA,SAAS,cAAc,KAAK;CAC3B,OAAO,OAAO,eAAe;EAC5B,MAAM,cAAc,mBAAmB,UAAU;EACjD,OAAO;GACN,GAAG,MAAM,IAAI,MAAM;IAClB,SAAS,YAAY;IACrB,MAAM,YAAY;IAClB,KAAK,YAAY;IACjB,KAAK,YAAY;GAClB,CAAC;GACD;EACD;CACD;AACD;;;AAGA,SAAS,cAAc,MAAM;CAC5B,OAAO;EACN,SAAS,KAAK;EACd,aAAa;GACZ,aAAa,KAAK;GAClB,QAAQ,KAAK;EACd;CACD;AACD;;;;;AAKA,SAAS,cAAc,SAAS;CAC/B,MAAM,cAAc,qBAAqB,OAAO;CAChD,IAAI,gBAAgB,KAAK,GAAG,OAAO,CAAC;CACpC,OAAO,CAAC;EACP,MAAM;EACN,OAAO,kCAAkC,YAAY,IAAI;EACzD,SAAS,YAAY;EACrB,QAA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CACR,KAAK;AACN;;AAEA,MAAM,gBAAgB;AACtB,SAAS,qBAAqB,UAAU,CAAC,GAAG;CAC3C,MAAM,aAAa,QAAQ,cAAc;CACzC,OAAO,oBAAoB;EAC1B,eAAe;EACf,UAAU;GACT,QAAQ,oBAAoB,UAAU;GACtC,KAAK,iBAAiB,UAAU;EACjC;EACA,aAAa;CACd,CAAC;AACF"}
1
+ {"version":3,"file":"family.mjs","names":["createComposerFamily","createFrameworkFamily"],"sources":["../../../0-framework/3-tooling/cli/dist/family.mjs","../src/family/emulator-list.ts","../src/exports/family.ts"],"sourcesContent":["import { i as devWithDeps, n as devUrl, o as deployWithDeps, s as executionDiagnostics, t as devStop } from \"./dev-current-Bm7Yrsmt.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy-BqHpStQn.mjs\";\nimport { i as sectionMissing, t as checkComposerConfig } from \"./composer-config-CY9fET8H.mjs\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError, notOk, ok } from \"@prisma/cli-engine/protocol\";\n//#region src/family/translate-error.ts\n/**\n* The family boundary's error translation.\n*\n* Composer and the engine each carry a class called `CliStructuredError`, both\n* descended from the same prisma/prisma foundation, and both recognize errors\n* by duck-typing on `name === 'CliStructuredError'`. That means a composer\n* error handed to the engine untranslated is ACCEPTED — it does not fail\n* loudly, it renders. What it loses is its `fix`: composer's foundation\n* carries remediation as one prose string on that field, the engine carries it\n* as a `nextActions` list and has no `fix` at all, so the fix text is dropped\n* silently and the user is told what broke with no word on what to do about\n* it. Nothing about that failure is visible without a test that looks for the\n* fix on the other side, which is why there is one.\n*\n* Everything else on the envelope survives as-is; only remediation changes\n* representation.\n*/\n/**\n* Composer's `fix` is free prose — \"add this overrides block and reinstall\",\n* \"run the build, then retry\" — with no machine-readable command inside it.\n* `user-choice` is the engine's own kind for exactly that (it is what the\n* engine uses for its own config and prompt failures), so the text carries\n* over verbatim as one action rather than being parsed into a command the\n* author never wrote.\n*/\nfunction fixAsNextActions(fix) {\n\treturn fix === void 0 ? [] : [{\n\t\tkind: \"user-choice\",\n\t\tlabel: fix\n\t}];\n}\n/** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */\nfunction toEngineError(error) {\n\treturn new CliStructuredError(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tnextActions: fixAsNextActions(error.fix),\n\t\t...error.why === void 0 ? {} : { why: error.why },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: error.meta },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl },\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/family/converge.ts\n/** The adapter the operations call, backed by the engine's `ctx.spawn` so the\n* terminal reaches alchemy natively and the engine owns signal policy. */\nfunction convergeSpawn(ctx) {\n\treturn async (invocation) => {\n\t\tconst commandLine = alchemyCommandLine(invocation);\n\t\treturn {\n\t\t\t...await ctx.spawn({\n\t\t\t\tcommand: commandLine.command,\n\t\t\t\targs: commandLine.args,\n\t\t\t\tcwd: commandLine.cwd,\n\t\t\t\tenv: commandLine.env\n\t\t\t}),\n\t\t\tcommandLine\n\t\t};\n\t};\n}\n/** The in-process leg's deps: composer's existing seam, carrying the engine's\n* own client and workspace id rather than anything read from the env. */\nfunction operationDeps(spec) {\n\treturn {\n\t\talchemy: spec.alchemy,\n\t\tcredentials: {\n\t\t\tworkspaceId: spec.workspaceId,\n\t\t\tclient: spec.client\n\t\t}\n\t};\n}\n/**\n* The reproduce hint a failed converge carries. Deliberately absent for an\n* aborted one: the user stopped it, so there is nothing to reproduce.\n*/\nfunction reproduceHint(failure) {\n\tconst diagnostics = executionDiagnostics(failure);\n\tif (diagnostics === void 0) return [];\n\treturn [{\n\t\tkind: \"run-command\",\n\t\tlabel: `Run the converge directly from ${diagnostics.cwd} to reproduce this`,\n\t\tcommand: diagnostics.reproduceCommand,\n\t\treason: `Generated stack file: ${diagnostics.stackFilePath}`\n\t}];\n}\n/**\n* How a FAILED converge settles. `deploy` and `dev` both end this\n* way and must not drift apart, so the decision lives here once rather than\n* inline in each handler.\n*\n* A failure that reached the child exits with the child's status verbatim and\n* carries the reproduce hint; a failure that never reached the child is an\n* ordinary structured error and gets the normal envelope. Nothing here reads\n* `signal` — see settleConverge.\n*/\nfunction settleConvergeFailure(failure, ctx) {\n\tconst child = ctx.lastChild();\n\tif (child !== void 0 && child.exitCode !== 0) return ok(exitWithChildStatus({ nextActions: reproduceHint(failure) }));\n\treturn notOk(toEngineError(failure));\n}\n/**\n* How a converge settles, now that the engine owns the child's status.\n*\n* Nothing here reads `signal`. `exitWithChildStatus` settles from the engine's\n* own record of the child, and a signal-killed one overrules whatever this\n* function asked for: 128 + the signal, no failure envelope, and the reproduce\n* hint dropped, because the user stopped the run and there is nothing to\n* reproduce.\n*\n* What is left is the operation's own verdict. A failure that reached the\n* child exits with the child's status verbatim and carries the reproduce hint;\n* a failure that never reached the child is an ordinary structured error and\n* gets the normal envelope.\n*\n* A SUCCESS presents its result even when the child was signal-killed. No\n* composer operation produces that pair today — each one reports a\n* signal-killed converge as a failure — and an operation that ever did would\n* have a real result worth showing. The run still exits 130, because the\n* engine settles a signal-terminated run from its own record of the signal\n* whatever the handler returns.\n*/\nfunction settleConverge(result, ctx, present) {\n\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\treturn ok(present(result.value));\n}\n//#endregion\n//#region src/family/section.ts\nfunction diagnostic(finding, file) {\n\tconst where = finding.where ?? file;\n\treturn {\n\t\tcode: finding.code,\n\t\tseverity: \"error\",\n\t\tsummary: finding.summary,\n\t\t...finding.why === void 0 ? {} : { why: finding.why },\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: finding.fix\n\t\t}],\n\t\t...where === void 0 ? {} : { where: { path: where } },\n\t\t...finding.field === void 0 ? {} : { meta: { field: finding.field } }\n\t};\n}\nfunction refuse(findings, file) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostics: findings.map((finding) => diagnostic(finding, file))\n\t};\n}\nfunction validate(raw, provenance) {\n\tconst file = provenance.files[0];\n\tif (raw === void 0 || file === void 0) return refuse([sectionMissing], void 0);\n\tconst checked = checkComposerConfig(raw, file);\n\tif (!checked.ok) return refuse(checked.findings, file);\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tvalue: checked.value,\n\t\t\tfile\n\t\t},\n\t\tdiagnostics: []\n\t};\n}\nconst composerSection = defineConfigSection({\n\tname: \"composer\",\n\tvalidate,\n\tmerge: (_parent, child) => child\n});\n//#endregion\n//#region src/family/workspace.ts\n/**\n* The workspace the in-process leg acts in, from the engine's credential\n* read. Handlers never decode a token and never read PRISMA_WORKSPACE_ID:\n* whether the credential came from a stored session or the environment, the\n* engine has already resolved it, and branching on where it came from is a\n* defect by the credential-manager design.\n*\n* Undefined when the active credential names no workspace — an environment\n* token whose claims carry none. The container descriptors raise their own\n* \"workspace required\" error in that case, which is the error the user needs.\n*/\nasync function workspaceIdOf(ctx) {\n\treturn (await ctx.activeCredential())?.workspaceId;\n}\n//#endregion\n//#region src/family/commands/deploy.ts\nconst STEP_LABELS = {\n\tprepare: \"load config and app\",\n\tassemble: \"assemble services\",\n\tconnect: \"connect to project and branch\",\n\tpreflight: \"check environment variables\",\n\tapply: \"plan and apply\",\n\trecord: \"record result\"\n};\nfunction stepLabel(step) {\n\treturn step.name === \"assemble-service\" ? `assemble ${step.address}` : STEP_LABELS[step.name];\n}\nfunction stepId(step) {\n\treturn step.name === \"assemble-service\" ? `deploy.assemble.${step.address}` : `deploy.${step.name}`;\n}\n/** `850ms`, `12.3s`, `9m 35s`. */\nfunction formatDuration(ms) {\n\tif (ms < 1e3) return `${String(Math.round(ms))}ms`;\n\tif (ms < 6e4) return `${(ms / 1e3).toFixed(1)}s`;\n\tconst seconds = Math.round(ms / 1e3);\n\treturn `${String(Math.floor(seconds / 60))}m ${String(seconds % 60)}s`;\n}\n/** The operation's step events as engine events. The engine prints only `step`, so a finished step carries its duration in the text too. */\nfunction toEngineEvent(event) {\n\tconst id = stepId(event.step);\n\tif (event.kind === \"step-started\") return {\n\t\tkind: \"step-started\",\n\t\tstep: stepLabel(event.step),\n\t\tid,\n\t\t...event.step.name === \"assemble-service\" ? { parentId: \"deploy.assemble\" } : {}\n\t};\n\treturn {\n\t\tkind: \"step-finished\",\n\t\tstep: `${stepLabel(event.step)} (${formatDuration(event.durationMs)})`,\n\t\tid,\n\t\toutcome: event.outcome,\n\t\tdata: {\n\t\t\t...event.data,\n\t\t\tdurationMs: event.durationMs\n\t\t}\n\t};\n}\nconst createDeployCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} deploy module.ts\", \"{bin} deploy module.ts --stage feat-auth\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...).\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the deploy's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Deploy scope to target; omit for production.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\treport: flag.string({\n\t\t\t\tbrief: \"Write the deploy's outcome as JSON to this path — resources, preview URLs, and the failure cause. Also settable as PRISMA_COMPOSER_REPORT_FILE.\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t}),\n\t\t\tbuildId: flag.string({\n\t\t\t\tbrief: \"Join the deploy record your CI already created rather than letting the target create one. Each target also reads its own environment variable for this; the flag wins.\",\n\t\t\t\tplaceholder: \"id\"\n\t\t\t})\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.deploy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tstage: args.flags.stage,\n\t\t\tcwd: ctx.cwd,\n\t\t\treportPath: args.flags.report,\n\t\t\treportId: args.flags.buildId,\n\t\t\tonEvent: (event) => ctx.report(toEngineEvent(event))\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, ({ summary, durationMs }) => {\n\t\t\tconst target = `to ${args.flags.stage ?? \"production\"} in ${formatDuration(durationMs)}`;\n\t\t\tfor (const node of summary?.nodes ?? []) for (const entity of node.entities) if (entity.url !== void 0) ctx.report({\n\t\t\t\tkind: \"endpoint\",\n\t\t\t\tname: node.address,\n\t\t\t\turl: entity.url\n\t\t\t});\n\t\t\treturn ctx.present({ data: {\n\t\t\t\tsummary: summary ?? null,\n\t\t\t\tdurationMs\n\t\t\t} }, {\n\t\t\t\thuman: (ui) => summary === void 0 ? [{\n\t\t\t\t\tkind: \"summary\",\n\t\t\t\t\tstatus: \"ok\",\n\t\t\t\t\ttext: `Deployed ${target}.`\n\t\t\t\t}] : [{\n\t\t\t\t\tkind: \"summary\",\n\t\t\t\t\tstatus: \"ok\",\n\t\t\t\t\ttext: `Deployed ${ui.emphasize(summary.app)} ${target}.`\n\t\t\t\t}, {\n\t\t\t\t\tkind: \"table\",\n\t\t\t\t\tcolumns: [\"Address\", \"Deployed\"],\n\t\t\t\t\trows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(\", \")])\n\t\t\t\t}],\n\t\t\t\tstdout: () => [],\n\t\t\t\tjson: () => ({\n\t\t\t\t\tsummary: summary ?? null,\n\t\t\t\t\tdurationMs\n\t\t\t\t}),\n\t\t\t\tnext: () => []\n\t\t\t});\n\t\t});\n\t}\n});\n//#endregion\n//#region src/family/commands/dev.ts\nconst STOP_STEP = \"Stopping the app's services — emulators and data stay up\";\n/** Resolves when the run is asked to stop. */\nfunction stopRequested(signal) {\n\tif (signal.aborted) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* One converge at a time. `ctx.spawn` refuses a second live child, and the\n* watch loop can well fire a rebuild while the previous converge is still\n* running — so a request that arrives during a live converge joins the single\n* queued follow-up instead of starting its own. That extends the coalescing\n* the watcher already does across a burst of edits to cover the converge\n* itself, and it is sound because every dev converge is the SAME invocation:\n* one stack file at one fixed path, rewritten in place before each request.\n*/\nfunction coalescedConverge(run) {\n\tlet live;\n\tlet queued;\n\tconst start = (invocation) => {\n\t\tconst outcome = run(invocation);\n\t\tconst settled = outcome.then(() => void 0, () => void 0);\n\t\tlive = settled;\n\t\tsettled.then(() => {\n\t\t\tif (live === settled) live = void 0;\n\t\t});\n\t\treturn outcome;\n\t};\n\treturn (invocation) => {\n\t\tconst running = live;\n\t\tif (running === void 0) return start(invocation);\n\t\tqueued ??= running.then(() => {\n\t\t\tqueued = void 0;\n\t\t\treturn start(invocation);\n\t\t});\n\t\treturn queued;\n\t};\n}\n/** The front door, ordered by address depth (fewest dots first) then lexicographically. */\nfunction frontDoorOrder(endpoints) {\n\treturn [...endpoints].sort((a, b) => {\n\t\tconst depth = a.address.split(\".\").length - b.address.split(\".\").length;\n\t\tif (depth !== 0) return depth;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t});\n}\n/**\n* The operation's events as engine events. The legacy `[dev]` console prefix\n* is gone: these are commentary the engine renders and frames.\n*/\nfunction reportDevEvent(report, lastChild) {\n\tlet stopFailed = false;\n\treturn (event) => {\n\t\tswitch (event.kind) {\n\t\t\tcase \"ready\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"status\",\n\t\t\t\t\tsubject: \"dev\",\n\t\t\t\t\tstatus: \"ready\"\n\t\t\t\t});\n\t\t\t\tfor (const endpoint of frontDoorOrder(event.endpoints)) report({\n\t\t\t\t\tkind: \"endpoint\",\n\t\t\t\t\tname: endpoint.address,\n\t\t\t\t\turl: endpoint.url\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"unwatchable\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.address} has no watchable inputs.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"rebuild-failed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Rebuild failed: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"config-changed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.file} changed. Restart dev to apply it; rebuilds are paused until then.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"watch-error\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Watch error: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"converge-failed\": {\n\t\t\t\tconst child = lastChild();\n\t\t\t\tif (child !== void 0 && child.signal !== null) return;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Converge failed — the running app is untouched; still watching.\nGenerated stack file: ${event.stackFilePath}\\nRun \\`${event.reproduceCommand}\\` from ${event.cwd} to reproduce this directly.`\n\t\t\t\t});\n\t\t\t\treport({\n\t\t\t\t\tkind: \"remediation\",\n\t\t\t\t\taction: {\n\t\t\t\t\t\tkind: \"run-command\",\n\t\t\t\t\t\tlabel: `Run the converge directly from ${event.cwd} to reproduce this`,\n\t\t\t\t\t\tcommand: event.reproduceCommand,\n\t\t\t\t\t\treason: `Generated stack file: ${event.stackFilePath}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"stopping\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-started\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stop-error\":\n\t\t\t\tstopFailed = true;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `A service refused to stop: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stopped\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\",\n\t\t\t\t\toutcome: stopFailed ? \"warning\" : \"ok\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t}\n\t};\n}\n/** A detached session owns nothing to stop, so a Ctrl-C before it was ready stops the app the way `prisma dev stop` does. */\nasync function stopDetachedApp(operations, ctx) {\n\tconst stopped = await operations.devStop({\n\t\tconfig: ctx.config,\n\t\tcwd: ctx.cwd\n\t});\n\tif (stopped.ok) return;\n\tctx.report({\n\t\tkind: \"message\",\n\t\tseverity: \"warn\",\n\t\ttext: `The app could not be stopped: ${stopped.failure.message} Run \\`prisma dev stop\\`.`\n\t});\n}\nconst createDevCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit. A node is one service, database or bucket in the app. Each node runs on a local emulator: a program on this machine that stands in for Prisma Cloud and runs services, databases or S3-compatible buckets. A node's address is its name in the app, with dots for a nested node (catalog.database). The app and where each node runs are recorded in this directory: `prisma dev url` works from here while `prisma dev` runs, and `prisma dev stop` also works after `prisma dev` was killed. Ending `prisma dev` stops its services and database servers; data and ports are kept. With --detach it returns once every service answers and leaves the app running without watching for changes, until `prisma dev stop`.\",\n\t\texamples: [\n\t\t\t\"{bin} dev module.ts\",\n\t\t\t\"{bin} dev module.ts --fresh\",\n\t\t\t\"{bin} dev module.ts --detach\"\n\t\t]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...).\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tfresh: flag.boolean({ brief: \"Destroy the dev stack and wipe the dev state directory before starting.\" }),\n\t\t\tdetach: flag.boolean({ brief: \"Return once every service answers and leave the app running without watching for changes. Use it in scripts, agents and CI. `prisma dev stop` stops the app.\" })\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\tconst result = await operations.dev({\n\t\t\tentry: args.positionals.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tfresh: args.flags.fresh,\n\t\t\tdetach: args.flags.detach,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: reportDevEvent(ctx.report, ctx.lastChild)\n\t\t}, { alchemy: coalescedConverge(alchemy) });\n\t\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\t\tif (args.flags.detach) {\n\t\t\tif (ctx.signal.aborted) await stopDetachedApp(operations, ctx);\n\t\t\treturn ok(void 0);\n\t\t}\n\t\tawait stopRequested(ctx.signal);\n\t\tawait result.value.stop();\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/commands/dev-stop.ts\n/**\n* `dev stop` — stops the app `prisma dev` last ran from this directory, as\n* ending `prisma dev` would: its service processes and database servers.\n* For an app whose `prisma dev` was killed without the chance to stop it.\n*/\nconst createDevStopCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Stop the app `prisma dev` last ran from this directory: its service processes and local database servers. Data and ports are kept for the next `prisma dev`.\",\n\t\tdescription: \"Ending `prisma dev` with Ctrl-C does the same. Run this when `prisma dev` was killed without a chance to stop the app, or before deleting the directory. The emulators keep running; other directories may be using them.\",\n\t\texamples: [\"{bin} dev stop\"]\n\t},\n\targs: {},\n\tneeds: { config: composerSection },\n\thandler: async (_args, ctx) => {\n\t\tconst result = await operations.devStop({\n\t\t\tconfig: ctx.config,\n\t\t\tcwd: ctx.cwd\n\t\t});\n\t\tif (!result.ok) return notOk(toEngineError(result.failure));\n\t\tconst { app, stopped } = result.value;\n\t\treturn ok(ctx.present({ data: result.value }, {\n\t\t\thuman: (ui) => [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `Stopped ${ui.emphasize(app)}. Its data and ports are kept for the next \\`prisma dev\\`.`\n\t\t\t}, ...stopped.length === 0 ? [] : [{\n\t\t\t\tkind: \"table\",\n\t\t\t\tcolumns: [\"Address\", \"Kind\"],\n\t\t\t\trows: stopped.map(({ address, kind }) => [address, kind])\n\t\t\t}]],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => result.value,\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/commands/dev-url.ts\n/**\n* `dev url <address>` — where a node of the app `prisma dev` runs from this\n* directory answers locally. A data command: the URL is its stdout line, so\n* `$(prisma dev url gateway --format human)` is the URL alone.\n*/\nconst createDevUrlCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Print the local URL of a node (a service, database or bucket in your app) that `prisma dev` runs from this directory: a service's HTTP URL, a database's connection string, or a bucket's S3 address.\",\n\t\tdescription: \"Reads what the last `prisma dev` in this directory recorded and starts nothing, so run it while `prisma dev` is running; a node that is not running is an error. With --format human the URL alone goes to stdout. In a script, the JSON result holds it: prisma dev url gateway | jq -er 'select(.kind==\\\"result\\\").envelope.result.url'.\",\n\t\texamples: [\"{bin} dev url gateway\", \"{bin} dev url catalog.database --json\"]\n\t},\n\targs: { positionals: { address: positional.string({\n\t\tbrief: \"The node's address: its name in the app, with dots for a nested node, such as catalog.database.\",\n\t\tplaceholder: \"address\"\n\t}) } },\n\tneeds: { config: composerSection },\n\thandler: async (args, ctx) => {\n\t\tconst result = await operations.devUrl({\n\t\t\tconfig: ctx.config,\n\t\t\taddress: args.positionals.address,\n\t\t\tcwd: ctx.cwd\n\t\t});\n\t\tif (!result.ok) return notOk(toEngineError(result.failure));\n\t\tconst node = result.value;\n\t\treturn ok(ctx.present({ data: node }, {\n\t\t\thuman: (ui) => [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `The ${node.kind} ${ui.emphasize(node.address)} is ${node.state} at ${node.url}`\n\t\t\t}],\n\t\t\tstdout: () => [node.url],\n\t\t\tjson: () => node,\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/family.ts\n/**\n* Composer's `CommandFamily`: the unit the `prisma` bin mounts.\n*\n* This module and everything it reaches statically must stay free of alchemy\n* and of effect VALUE imports: the `prisma` bin imports the family directly,\n* so anything in this static graph loads on `prisma --version`. The mechanism\n* that holds it is the existing lazy boundary inside the operation modules —\n* `operations/deploy.ts` and `dev.ts` each `await import()` their executor,\n* and it is the executors that reach the provider tree. Importing the operations here is therefore free; importing an\n* executor, or flattening one of those dynamic imports, is not.\n* scripts/check-family-static-graph.mjs enforces this against BUILT output,\n* where type-only imports have already been erased.\n*\n* The commands close over the operations they are given, so a host can\n* mount this family against the test double and exercise real grammar, real\n* arg validation and real handlers with no alchemy behind them.\n*\n* The family ships `deploy`, `dev`, `dev url` and `dev stop`, keyed by the\n* path they are meant to mount at; the host decides where each one mounts.\n* A host may add commands of its own through `commands` — the published\n* family adds `emulator list`, which needs no project. `destroy` and `log`\n* are programmatic operations in `@prisma/composer/control`, not commands.\n*/\nconst realOperations = {\n\tdeploy: deployWithDeps,\n\tdev: devWithDeps,\n\tdevUrl,\n\tdevStop\n};\n/** The `prisma` CLI's error reference; the engine appends `/<CODE>` to it for every error envelope. */\nconst CLI_DOCS_BASE = \"https://www.prisma.io/docs/cli/error-reference/\";\nfunction createComposerFamily(options = {}) {\n\tconst operations = options.operations ?? realOperations;\n\treturn defineCommandFamily({\n\t\tconfigSection: composerSection,\n\t\tcommands: {\n\t\t\tdeploy: createDeployCommand(operations),\n\t\t\tdev: createDevCommand(operations),\n\t\t\t\"dev url\": createDevUrlCommand(operations),\n\t\t\t\"dev stop\": createDevStopCommand(operations),\n\t\t\t...options.commands\n\t\t},\n\t\tdocsBaseUrl: CLI_DOCS_BASE\n\t});\n}\n//#endregion\nexport { composerSection, createComposerFamily, realOperations, toEngineError };\n\n//# sourceMappingURL=family.mjs.map","/**\n * `emulator list` — every local emulator on this machine and every\n * instance it holds. It needs no project and no config. The listing comes\n * from the Prisma Cloud domain, so the command is assembled into the\n * family here, where both domains may be imported.\n */\n\nimport { toEngineError } from '@internal/cli/family';\nimport type { EmulatorList, EmulatorListing } from '@internal/dev-emulators';\nimport type { CliStructuredError as ComposerError } from '@internal/foundation/errors';\nimport type { Result } from '@internal/foundation/result';\nimport { defineCommand } from '@prisma/cli-engine';\nimport { notOk, ok } from '@prisma/cli-engine/protocol';\n\nexport type ListEmulators = () => Promise<Result<EmulatorList, ComposerError>>;\n\n/** Loaded on first use, so nothing of the emulators' clients loads with the family. */\nexport const listEmulators: ListEmulators = async () =>\n (await import('@internal/dev-emulators')).listEmulators();\n\nconst EMULATOR_NAMES = {\n service: 'Service emulator',\n database: 'Database emulator',\n bucket: 'Bucket emulator',\n} as const;\n\n/** The node and directory that started an instance, when Composer's labels say. */\nfunction startedBy(labels: Readonly<Record<string, string>>): string | undefined {\n const address = labels['composer.address'];\n const directory = labels['composer.directory'];\n if (address === undefined) return undefined;\n return directory === undefined ? address : `${address} in ${directory}`;\n}\n\nfunction labelOf(emulator: EmulatorListing, dim: (text: string) => string): string {\n const name = EMULATOR_NAMES[emulator.kind];\n if (!emulator.running || emulator.url === null) return `${name} ${dim('(not running)')}`;\n if (emulator.error !== null) {\n return `${name} at ${emulator.url}: could not list its instances (${emulator.error.code}: ${emulator.error.message})`;\n }\n return `${name} at ${emulator.url}`;\n}\n\nfunction statusOf(emulator: EmulatorListing): 'ok' | 'info' | 'error' {\n if (emulator.error !== null) return 'error';\n return emulator.running ? 'ok' : 'info';\n}\n\nexport const createEmulatorListCommand = (list: ListEmulators) =>\n defineCommand({\n help: {\n summary:\n 'List the local emulators on this machine — the programs `prisma dev` starts to run ' +\n 'services, databases and S3-compatible buckets without Prisma Cloud — with every ' +\n 'instance each one holds.',\n description:\n 'Needs no project: it shows every directory’s instances. An emulator that is not ' +\n 'running is listed with no instances, and one that runs but cannot be listed is ' +\n 'shown with the error. Each instance’s labels say which directory, ' +\n 'app and node started it. A stopped instance keeps its port and data until it is ' +\n 'deleted.',\n examples: ['{bin} emulator list', '{bin} emulator list --json'],\n },\n args: {},\n handler: async (_args, ctx) => {\n const result = await list();\n if (!result.ok) return notOk(toEngineError(result.failure));\n const { emulators } = result.value;\n return ok(\n ctx.present(\n { data: result.value },\n {\n human: (ui) => [\n {\n kind: 'tree',\n roots: emulators.map((emulator) => ({\n label: labelOf(emulator, ui.dim),\n status: statusOf(emulator),\n children: emulator.instances.map((instance) => {\n const by = startedBy(instance.labels);\n return {\n label: [\n instance.id,\n instance.url,\n instance.state,\n ...(by ? [ui.dim(by)] : []),\n ].join(' '),\n };\n }),\n })),\n },\n ],\n stdout: () => [],\n json: () => result.value,\n next: () => [],\n },\n ),\n );\n },\n });\n","/**\n * Public surface (the `./family` subpath): composer's engine `CommandFamily`,\n * for hosts that mount composer's commands into their own CLI — the `prisma`\n * bin does exactly this.\n *\n * Kept apart from `@prisma/composer`'s `./control` on purpose. `./control` is\n * the programmatic deploy pipeline; this is the command surface: grammar, help\n * and arg validation belong to the engine, and the handlers behind them are\n * the same operations `./control` exposes.\n *\n * Its static graph is alchemy-free and effect-free, so importing it costs a\n * host nothing until a composer command actually runs.\n */\n\nimport {\n createComposerFamily as createFrameworkFamily,\n type CreateComposerFamilyOptions as FrameworkFamilyOptions,\n} from '@internal/cli/family';\nimport type { CommandFamily } from '@prisma/cli-engine';\nimport {\n createEmulatorListCommand,\n type ListEmulators,\n listEmulators,\n} from '../family/emulator-list.ts';\n\nexport * from '@internal/cli/family';\nexport type { ListEmulators } from '../family/emulator-list.ts';\n\nexport interface CreateComposerFamilyOptions extends FrameworkFamilyOptions {\n /** Defaults to the real listing of this machine's emulators. */\n readonly listEmulators?: ListEmulators | undefined;\n}\n\n/** Composer's command family: `deploy`, `dev`, `dev url`, `dev stop` and `emulator list`, keyed by the path each is meant to mount at. */\nexport function createComposerFamily(options: CreateComposerFamilyOptions = {}): CommandFamily {\n return createFrameworkFamily({\n ...options,\n commands: {\n 'emulator list': createEmulatorListCommand(options.listEmulators ?? listEmulators),\n ...options.commands,\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,iBAAiB,KAAK;CAC9B,OAAO,QAAQ,KAAK,IAAI,CAAC,IAAI,CAAC;EAC7B,MAAM;EACN,OAAO;CACR,CAAC;AACF;;AAEA,SAAS,cAAc,OAAO;CAC7B,OAAO,IAAI,mBAAmB,MAAM,MAAM,MAAM,SAAS;EACxD,UAAU,MAAM;EAChB,aAAa,iBAAiB,MAAM,GAAG;EACvC,GAAG,MAAM,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,MAAM,IAAI;EAChD,GAAG,MAAM,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO,MAAM,MAAM;EACtD,GAAG,MAAM,SAAS,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,MAAM,KAAK;EACnD,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,EAAE,SAAS,MAA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ACE;EAKF,UAAU,CAAC,uBAAuB,4BAA4B;CAChE;CACA,MAAM,CAAC;CACP,SAAS,OAAO,OAAO,QAAQ;EAC7B,MAAM,SAAS,MAAM,KAAK;EAC1B,IAAI,CAAC,OAAO,IAAI,OAAO,MAAM,cAAc,OAAO,OAAO,CAAC;EAC1D,MAAM,EAAE,cAAc,OAAO;EAC7B,OAAO,GACL,IAAI,QACF,EAAE,MAAM,OAAO,MAAM,GACrB;GACE,QAAQ,OAAO,CACb;IACE,MAAM;IACN,OAAO,UAAU,KAAK,cAAc;KAClC,OAAO,QAAQ,UAAU,GAAG,GAAG;KAC/B,QAAQ,SAAS,QAAQ;KACzB,UAAU,SAAS,UAAU,KAAK,aAAa;MAC7C,MAAM,KAAK,UAAU,SAAS,MAAM;MACpC,OAAO,EACL,OAAO;OACL,SAAS;OACT,SAAS;OACT,SAAS;OACT,GAAI,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,CAAC;MAC3B,CAAC,CAAC,KAAK,IAAI,EACb;KACF,CAAC;IACH,EAAE;GACJ,CACF;GACA,cAAc,CAAC;GACf,YAAY,OAAO;GACnB,YAAY,CAAC;EACf,CACF,CACF;CACF;AACF,CAAC;;;;;;;;;;;;;;;;;ACjEH,SAAgB,qBAAqB,UAAuC,CAAC,GAAkB;CAC7F,OAAOC,uBAAsB;EAC3B,GAAG;EACH,UAAU;GACR,iBAAiB,0BAA0B,QAAQ,iBAAiB,aAAa;GACjF,GAAG,QAAQ;EACb;CACF,CAAC;AACH"}
@@ -0,0 +1,48 @@
1
+ import { l as CliStructuredError } from "./composer-config-CY9fET8H-CgnpfWc2.mjs";
2
+ import "effect/Layer";
3
+ import "alchemy/State/LocalState";
4
+ //#region ../../0-framework/1-core/core/dist/app-config-CGJHcFb-.mjs
5
+ /** `<cwd>/.prisma-composer/dev` — the dev instance's app-scoped state directory (ADR-0041, ADR-0004's tool-state rule). "dev" names the user-facing feature/dir (naming, operator 2026-07-23) — this constant's name and value are unchanged by the localTarget rename. */
6
+ const DEV_DIR = ".prisma-composer/dev";
7
+ /**
8
+ * True when an extension only participates in assembly (every `nodes` entry
9
+ * is `kind: 'build'`, and it declares none of `providers`/`application`/
10
+ * `provisions`/`container`) — it owns no resources or services, so it has
11
+ * nothing to emulate and is exempt from local-target-capability requirements
12
+ * (ADR-0041). Shared by `localTargetProviders` and every local-target hook
13
+ * iteration.
14
+ */
15
+ function isBuildOnlyExtension(extension) {
16
+ return Object.values(extension.nodes).every((node) => node.kind === "build") && extension.providers === void 0 && extension.application === void 0 && extension.provisions === void 0 && extension.container === void 0;
17
+ }
18
+ //#endregion
19
+ //#region ../../0-framework/1-core/core/dist/local-target.mjs
20
+ /** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, "dev" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */
21
+ function noLocalTargetSupportError(id) {
22
+ return new CliStructuredError("DEV.TARGET_UNSUPPORTED", `extension "${id}" has no dev support — it declares no \`localTarget\` descriptor (ADR-0041).`);
23
+ }
24
+ /**
25
+ * Resolves every non-build-only configured extension's lazy `localTarget`
26
+ * thunk, once (ADR-0041's lazy local-target reference — operator directive:
27
+ * the production control entry carries only the thunk, never the
28
+ * descriptor, so resolving it is this module's job, not something a deploy
29
+ * path ever does). A build-only extension (`isBuildOnlyExtension`) owns no
30
+ * resources or services and is skipped entirely — never even checked for a
31
+ * `localTarget` thunk. Every other configured extension must be
32
+ * local-target-capable, or the dev command cannot bring the app up at all,
33
+ * so a missing thunk throws naming the extension. The generated dev stack
34
+ * module calls this once and threads the resolved map through every
35
+ * subsequent hook, including `localTargetProviders`.
36
+ */
37
+ async function resolveLocalTargets(config) {
38
+ const entries = await Promise.all(config.extensions.flatMap((extension) => {
39
+ if (isBuildOnlyExtension(extension)) return [];
40
+ if (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);
41
+ return [extension.localTarget().then((descriptor) => [extension.id, descriptor])];
42
+ }));
43
+ return new Map(entries);
44
+ }
45
+ //#endregion
46
+ export { DEV_DIR as n, resolveLocalTargets as t };
47
+
48
+ //# sourceMappingURL=local-target-DZ6bu7Aj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-target-DZ6bu7Aj.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-CGJHcFb-.mjs","../../../0-framework/1-core/core/dist/local-target.mjs"],"sourcesContent":["//#region src/control/app-config.ts\n/** `<cwd>/.prisma-composer/dev` — the dev instance's app-scoped state directory (ADR-0041, ADR-0004's tool-state rule). \"dev\" names the user-facing feature/dir (naming, operator 2026-07-23) — this constant's name and value are unchanged by the localTarget rename. */\nconst DEV_DIR = \".prisma-composer/dev\";\n/**\n* True when an extension only participates in assembly (every `nodes` entry\n* is `kind: 'build'`, and it declares none of `providers`/`application`/\n* `provisions`/`container`) — it owns no resources or services, so it has\n* nothing to emulate and is exempt from local-target-capability requirements\n* (ADR-0041). Shared by `localTargetProviders` and every local-target hook\n* iteration.\n*/\nfunction isBuildOnlyExtension(extension) {\n\treturn Object.values(extension.nodes).every((node) => node.kind === \"build\") && extension.providers === void 0 && extension.application === void 0 && extension.provisions === void 0 && extension.container === void 0;\n}\n/** Typed identity — exists so the `composer` section of `prisma.config.ts` gets checked against PrismaAppConfig where it is written. */\nfunction defineConfig(config) {\n\treturn config;\n}\n//#endregion\nexport { defineConfig as n, isBuildOnlyExtension as r, DEV_DIR as t };\n\n//# sourceMappingURL=app-config-CGJHcFb-.mjs.map","import { r as isBuildOnlyExtension, t as DEV_DIR } from \"./app-config-CGJHcFb-.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as Layer from \"effect/Layer\";\nimport { localState } from \"alchemy/State/LocalState\";\n//#region src/control/local-target.ts\n/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, \"dev\" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */\nfunction noLocalTargetSupportError(id) {\n\treturn new CliStructuredError(\"DEV.TARGET_UNSUPPORTED\", `extension \"${id}\" has no dev support — it declares no \\`localTarget\\` descriptor (ADR-0041).`);\n}\n/**\n* Resolves every non-build-only configured extension's lazy `localTarget`\n* thunk, once (ADR-0041's lazy local-target reference — operator directive:\n* the production control entry carries only the thunk, never the\n* descriptor, so resolving it is this module's job, not something a deploy\n* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no\n* resources or services and is skipped entirely — never even checked for a\n* `localTarget` thunk. Every other configured extension must be\n* local-target-capable, or the dev command cannot bring the app up at all,\n* so a missing thunk throws naming the extension. The generated dev stack\n* module calls this once and threads the resolved map through every\n* subsequent hook, including `localTargetProviders`.\n*/\nasync function resolveLocalTargets(config) {\n\tconst entries = await Promise.all(config.extensions.flatMap((extension) => {\n\t\tif (isBuildOnlyExtension(extension)) return [];\n\t\tif (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);\n\t\treturn [extension.localTarget().then((descriptor) => [extension.id, descriptor])];\n\t}));\n\treturn new Map(entries);\n}\n/**\n* All configured extensions' local-target providers merged, config array\n* order (ADR-0041), from the ALREADY-RESOLVED descriptor map\n* (`resolveLocalTargets`'s product — this function itself never touches a\n* `localTarget` thunk). The generated dev stack module is this\n* aggregator's one caller, passing the result as `LowerOptions.providers`.\n*/\nfunction localTargetProviders(resolved, containers, devDir) {\n\tconst [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({\n\t\tcontainer: containers.get(id),\n\t\tdevDir\n\t}));\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n/** The state store `prisma dev` converges against: Alchemy's file store in the app's working directory. */\nfunction devState() {\n\treturn localState();\n}\n//#endregion\nexport { DEV_DIR, devState, localTargetProviders, resolveLocalTargets };\n\n//# sourceMappingURL=local-target.mjs.map"],"mappings":";;;;;AAEA,MAAM,UAAU;;;;;;;;;AAShB,SAAS,qBAAqB,WAAW;CACxC,OAAO,OAAO,OAAO,UAAU,KAAK,CAAC,CAAC,OAAO,SAAS,KAAK,SAAS,OAAO,KAAK,UAAU,cAAc,KAAK,KAAK,UAAU,gBAAgB,KAAK,KAAK,UAAU,eAAe,KAAK,KAAK,UAAU,cAAc,KAAK;AACvN;;;;ACPA,SAAS,0BAA0B,IAAI;CACtC,OAAO,IAAI,mBAAmB,0BAA0B,cAAc,GAAG,6EAA6E;AACvJ;;;;;;;;;;;;;;AAcA,eAAe,oBAAoB,QAAQ;CAC1C,MAAM,UAAU,MAAM,QAAQ,IAAI,OAAO,WAAW,SAAS,cAAc;EAC1E,IAAI,qBAAqB,SAAS,GAAG,OAAO,CAAC;EAC7C,IAAI,UAAU,gBAAgB,KAAK,GAAG,MAAM,0BAA0B,UAAU,EAAE;EAClF,OAAO,CAAC,UAAU,YAAY,CAAC,CAAC,MAAM,eAAe,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC;CACjF,CAAC,CAAC;CACF,OAAO,IAAI,IAAI,OAAO;AACvB"}
@@ -723,7 +723,7 @@ function Load(root, opts) {
723
723
  }
724
724
  blindCast(Symbol.for("prisma:secret-box"));
725
725
  //#endregion
726
- //#region ../../0-framework/3-tooling/cli/dist/pipeline-B-vJNch3.mjs
726
+ //#region ../../0-framework/3-tooling/cli/dist/pipeline-Dpesfd2j.mjs
727
727
  /**
728
728
  * Synchronous Node resolve hook so that entry modules may import relative
729
729
  * files using the specifier forms TypeScript accepts by default —
@@ -971,37 +971,6 @@ async function runPipeline(entry, overrideName, cwd, source, deps = {}, onAssemb
971
971
  };
972
972
  }
973
973
  //#endregion
974
- //#region ../../0-framework/1-core/core/dist/container-transport-HcvNOGZL.mjs
975
- /** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PRISMA_CLOUD': uppercased, every non-alphanumeric run replaced by one underscore. */
976
- function envVarSafeExtensionId(extensionId) {
977
- return extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, "_").replace(/^_+|_+$/g, "");
978
- }
979
- /** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_CONTAINER_PRISMA_COMPOSER_PRISMA_CLOUD' */
980
- function containerEnvVarName(extensionId) {
981
- return `PRISMA_COMPOSER_CONTAINER_${envVarSafeExtensionId(extensionId)}`;
982
- }
983
- function collisionError(a, b, varName) {
984
- return /* @__PURE__ */ new Error(`Extension ids "${a}" and "${b}" both map to the container transport variable "${varName}" — rename one of the extensions.`);
985
- }
986
- function emptySerializeError(extensionId) {
987
- return /* @__PURE__ */ new Error(`Extension "${extensionId}"'s container instance serialized to an empty string — ContainerInstance.serialize() must return a non-empty string.`);
988
- }
989
- /** The env entries the CLI sets on the alchemy process: `{ [containerEnvVarName(id)]: instance.serialize() }` for every resolved instance. */
990
- function containerEnv(instances) {
991
- const env = {};
992
- const ownerByVarName = /* @__PURE__ */ new Map();
993
- for (const [extensionId, instance] of instances) {
994
- const varName = containerEnvVarName(extensionId);
995
- const owner = ownerByVarName.get(varName);
996
- if (owner !== void 0) throw collisionError(owner, extensionId, varName);
997
- ownerByVarName.set(varName, extensionId);
998
- const serialized = instance.serialize();
999
- if (serialized.length === 0) throw emptySerializeError(extensionId);
1000
- env[varName] = serialized;
1001
- }
1002
- return env;
1003
- }
1004
- //#endregion
1005
- export { envVarSafeExtensionId as n, runPipeline as r, containerEnv as t };
974
+ export { runPipeline as n, checkConfigSource as t };
1006
975
 
1007
- //# sourceMappingURL=container-transport-HcvNOGZL-ClGmzBIO.mjs.map
976
+ //# sourceMappingURL=pipeline-Dpesfd2j-C8q5FvQ4.mjs.map