@prisma/composer-cli 0.37.0 → 0.38.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 (33) hide show
  1. package/dist/{dev-current-D0Kn6Mf4-DaV3DWR6.mjs → dev-current-D-Qb6Yem-CvaY4xsk.mjs} +5 -5
  2. package/dist/{dev-current-D0Kn6Mf4-DaV3DWR6.mjs.map → dev-current-D-Qb6Yem-CvaY4xsk.mjs.map} +1 -1
  3. package/dist/{dist-DizJD76s.mjs → dist-BH6HQ6zZ.mjs} +2 -2
  4. package/dist/{dist-DizJD76s.mjs.map → dist-BH6HQ6zZ.mjs.map} +1 -1
  5. package/dist/{execute-deploy-destroy-Dh1CQ9X6-XpXuMPxj.mjs → execute-deploy-destroy-C6EsdmLz-DqdToZ_i.mjs} +6 -6
  6. package/dist/{execute-deploy-destroy-Dh1CQ9X6-XpXuMPxj.mjs.map → execute-deploy-destroy-C6EsdmLz-DqdToZ_i.mjs.map} +1 -1
  7. package/dist/{execute-dev-current-D3USgHJ4-frlaz_BC.mjs → execute-dev-current-tBKmDAjV-DOOMGrl5.mjs} +4 -4
  8. package/dist/{execute-dev-current-D3USgHJ4-frlaz_BC.mjs.map → execute-dev-current-tBKmDAjV-DOOMGrl5.mjs.map} +1 -1
  9. package/dist/{execute-dev-Bl-5Q-Av-DK5AoRw1.mjs → execute-dev-gjIKYybU-hRndPEgC.mjs} +7 -7
  10. package/dist/{execute-dev-Bl-5Q-Av-DK5AoRw1.mjs.map → execute-dev-gjIKYybU-hRndPEgC.mjs.map} +1 -1
  11. package/dist/family.d.mts +1 -1
  12. package/dist/family.mjs +9 -9
  13. package/dist/family.mjs.map +1 -1
  14. package/dist/{generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs → generate-dev-stack-BV_n-X9n-BDBjgphH.mjs} +3 -3
  15. package/dist/{generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs.map → generate-dev-stack-BV_n-X9n-BDBjgphH.mjs.map} +1 -1
  16. package/dist/{list-deployed-Cj37uZ6w.mjs → list-deployed-IL0MgmTX.mjs} +3 -3
  17. package/dist/{list-deployed-Cj37uZ6w.mjs.map → list-deployed-IL0MgmTX.mjs.map} +1 -1
  18. package/dist/{redaction-Bf8FvTFH-M5hYsi--.d.mts → redaction-Bf8FvTFH-D0dXGsO8.d.mts} +29 -4
  19. package/dist/redaction-Bf8FvTFH-D0dXGsO8.d.mts.map +1 -0
  20. package/dist/{redaction-HnbkSFrK-BjFRb2aC.mjs → redaction-HnbkSFrK-CCKJNRwi.mjs} +3 -3
  21. package/dist/redaction-HnbkSFrK-CCKJNRwi.mjs.map +1 -0
  22. package/dist/{run-alchemy-OS_ix5g0-BzkuReFx.mjs → run-alchemy-OS_ix5g0-DSlHsv2p.mjs} +2 -2
  23. package/dist/{run-alchemy-OS_ix5g0-BzkuReFx.mjs.map → run-alchemy-OS_ix5g0-DSlHsv2p.mjs.map} +1 -1
  24. package/dist/testing.d.mts +1 -1
  25. package/dist/testing.mjs +3 -3
  26. package/dist/testing.mjs.map +1 -1
  27. package/dist/{validate-environment-D_dECxgO-fg8lfCME.mjs → validate-environment-CpQLC3CA-Ct-PXoKN.mjs} +25 -21
  28. package/dist/validate-environment-CpQLC3CA-Ct-PXoKN.mjs.map +1 -0
  29. package/package.json +7 -7
  30. package/src/family/deploy-list.ts +2 -2
  31. package/dist/redaction-Bf8FvTFH-M5hYsi--.d.mts.map +0 -1
  32. package/dist/redaction-HnbkSFrK-BjFRb2aC.mjs.map +0 -1
  33. package/dist/validate-environment-D_dECxgO-fg8lfCME.mjs.map +0 -1
package/dist/family.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CliStructuredError$1, a as DEFAULT_DEPLOY_ENVIRONMENT, i as realOperations, n as ComposerOperations, p as ComposerConfigSource, r as CreateComposerFamilyOptions$1, y as Result } from "./redaction-Bf8FvTFH-M5hYsi--.mjs";
1
+ import { C as CliStructuredError$1, a as DEFAULT_DEPLOY_ENVIRONMENT, i as realOperations, n as ComposerOperations, p as ComposerConfigSource, r as CreateComposerFamilyOptions$1, y as Result } from "./redaction-Bf8FvTFH-D0dXGsO8.mjs";
2
2
  import { CommandFamily, ConfigSection, ManagementApiClient } from "@prisma/cli-engine";
3
3
  import { CliStructuredError } from "@prisma/cli-engine/protocol";
4
4
  import "effect/Effect";
package/dist/family.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { m as sectionMissing, u as checkComposerConfig } from "./redaction-HnbkSFrK-BjFRb2aC.mjs";
2
- import { a as devWithDeps, i as devUrl, n as deployWithDeps, o as executionDiagnostics, r as devStop, t as DEFAULT_DEPLOY_ENVIRONMENT } from "./dev-current-D0Kn6Mf4-DaV3DWR6.mjs";
3
- import { t as alchemyCommandLine } from "./run-alchemy-OS_ix5g0-BzkuReFx.mjs";
1
+ import { m as sectionMissing, u as checkComposerConfig } from "./redaction-HnbkSFrK-CCKJNRwi.mjs";
2
+ import { a as devWithDeps, i as devUrl, n as deployWithDeps, o as executionDiagnostics, r as devStop, t as DEFAULT_DEPLOY_ENVIRONMENT } from "./dev-current-D-Qb6Yem-CvaY4xsk.mjs";
3
+ import { t as alchemyCommandLine } from "./run-alchemy-OS_ix5g0-DSlHsv2p.mjs";
4
4
  import * as path from "node:path";
5
5
  import { defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, positional } from "@prisma/cli-engine";
6
6
  import { CliStructuredError, notOk, ok } from "@prisma/cli-engine/protocol";
@@ -261,7 +261,7 @@ const createDeployCommand = (operations) => defineCommand({
261
261
  },
262
262
  args: { flags: {
263
263
  entry: flag.string({
264
- brief: "The file whose default export is the application root module, built with module(...). Overrides `entry` in the `composer` section of prisma.config.ts.",
264
+ brief: "The file whose default export is the app's root, built with appRoot(...). Overrides `entry` in the `composer` section of prisma.config.ts.",
265
265
  placeholder: "path"
266
266
  }),
267
267
  name: flag.string({
@@ -561,7 +561,7 @@ const createDevCommand = (operations) => defineSessionCommand({
561
561
  },
562
562
  args: { flags: {
563
563
  entry: flag.string({
564
- brief: "The file whose default export is the application root module, built with module(...). Overrides `entry` in the `composer` section of prisma.config.ts.",
564
+ brief: "The file whose default export is the app's root, built with appRoot(...). Overrides `entry` in the `composer` section of prisma.config.ts.",
565
565
  placeholder: "path"
566
566
  }),
567
567
  name: flag.string({
@@ -617,7 +617,7 @@ const createDevStopCommand = (operations) => defineCommand({
617
617
  },
618
618
  args: { flags: {
619
619
  entry: flag.string({
620
- brief: "The file whose default export is the application root module. Overrides `entry` in the `composer` section of prisma.config.ts.",
620
+ brief: "The file whose default export is the app's root, built with appRoot(...). Overrides `entry` in the `composer` section of prisma.config.ts.",
621
621
  placeholder: "path"
622
622
  }),
623
623
  name: flag.string({
@@ -774,7 +774,7 @@ function createComposerFamily$1(options = {}) {
774
774
  * assembled into the family here, where both domains may be imported.
775
775
  */
776
776
  /** Loaded on first use, so nothing of the Management API reads loads with the family. */
777
- const listDeployed = async (input) => (await import("./list-deployed-Cj37uZ6w.mjs")).listDeployed(input);
777
+ const listDeployed = async (input) => (await import("./list-deployed-IL0MgmTX.mjs")).listDeployed(input);
778
778
  const createDeployListCommand = (list) => defineCommand({
779
779
  help: {
780
780
  summary: "List every node the app has deployed in an environment, with its platform ID and URL.",
@@ -787,7 +787,7 @@ const createDeployListCommand = (list) => defineCommand({
787
787
  },
788
788
  args: { flags: {
789
789
  entry: flag.string({
790
- brief: "The file whose default export is the application root module, built with module(...). Overrides `entry` in the `composer` section of prisma.config.ts.",
790
+ brief: "The file whose default export is the app's root, built with appRoot(...). Overrides `entry` in the `composer` section of prisma.config.ts.",
791
791
  placeholder: "path"
792
792
  }),
793
793
  name: flag.string({
@@ -853,7 +853,7 @@ const createDeployListCommand = (list) => defineCommand({
853
853
  * family here, where both domains may be imported.
854
854
  */
855
855
  /** Loaded on first use, so nothing of the emulators' clients loads with the family. */
856
- const listEmulators = async () => (await import("./dist-DizJD76s.mjs")).listEmulators();
856
+ const listEmulators = async () => (await import("./dist-BH6HQ6zZ.mjs")).listEmulators();
857
857
  const EMULATOR_NAMES = {
858
858
  service: "Service emulator",
859
859
  database: "Database emulator",
@@ -1 +1 @@
1
- {"version":3,"file":"family.mjs","names":["createComposerFamily","createFrameworkFamily"],"sources":["../../../0-framework/3-tooling/cli/dist/family.mjs","../src/family/deploy-list.ts","../src/family/emulator-list.ts","../src/exports/family.ts"],"sourcesContent":["import { a as sectionMissing, t as checkComposerConfig } from \"./composer-config-DO_iG0iR.mjs\";\nimport { a as DEFAULT_DEPLOY_ENVIRONMENT, c as executionDiagnostics, i as devWithDeps, n as devUrl, s as deployWithDeps, t as devStop } from \"./dev-current-D0Kn6Mf4.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy-OS_ix5g0.mjs\";\nimport * as path from \"node:path\";\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/data-lines.ts\nconst ESCAPES = {\n\t\"\\\\\": \"\\\\\\\\\",\n\t\"\t\": \"\\\\t\",\n\t\"\\n\": \"\\\\n\",\n\t\"\\r\": \"\\\\r\"\n};\nfunction fieldText(field) {\n\tif (field === null || field === void 0) return \"\";\n\treturn String(field).replace(/[\\\\\\t\\n\\r]/g, (character) => ESCAPES[character] ?? character);\n}\n/**\n* One data line: the fields tab-separated, an absent field left empty so a\n* script reads the columns by position. A backslash, tab, newline or carriage\n* return inside a field is escaped as `\\\\`, `\\t`, `\\n` or `\\r`.\n*/\nfunction dataLine(fields) {\n\treturn fields.map(fieldText).join(\"\t\");\n}\n//#endregion\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/**\n* Node's `--import` of a module that sends the child's stdout to stderr when\n* stdout is not a terminal. In human format the engine hands a piped run's\n* stdout to the child, and that pipe carries only the parent's data lines.\n*/\nconst STDOUT_TO_STDERR = [\"--import\", `data:text/javascript,${encodeURIComponent(\"if (process.stdout.isTTY !== true) process.stdout.write = process.stderr.write.bind(process.stderr);\")}`];\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. It\n* ignores `invocation.redactedValues`: the child writes to the terminal, so\n* its output is not redacted (ADR-0062). */\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: [...STDOUT_TO_STDERR, ...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 the entry module's default export.\",\n\t\texamples: [\n\t\t\t\"{bin} deploy\",\n\t\t\t\"{bin} deploy --environment staging\",\n\t\t\t\"{bin} deploy --entry other-module.ts\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tentry: flag.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...). Overrides `entry` in the `composer` section of prisma.config.ts.\",\n\t\t\tplaceholder: \"path\"\n\t\t}),\n\t\tname: flag.string({\n\t\t\tbrief: \"Deploy the app under this name instead of the name its root module declares. A different name is a separate app on Prisma Cloud, with its own services, databases and buckets (default: the root module's name).\",\n\t\t\tplaceholder: \"name\"\n\t\t}),\n\t\tenvironment: flag.string({\n\t\t\tbrief: \"The environment to deploy to. Any name other than production is a complete, isolated copy of the app, such as staging or one per pull request.\",\n\t\t\tplaceholder: \"name\",\n\t\t\tdefault: DEFAULT_DEPLOY_ENVIRONMENT\n\t\t}),\n\t\treport: flag.string({\n\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\tplaceholder: \"path\"\n\t\t}),\n\t\tbuildId: flag.string({\n\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\tplaceholder: \"id\"\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.flags.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tenvironment: args.flags.environment,\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.environment ?? \"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: () => (summary?.nodes ?? []).flatMap((node) => node.entities.map((entity) => dataLine([\n\t\t\t\t\tnode.address,\n\t\t\t\t\tentity.kind,\n\t\t\t\t\tentity.id,\n\t\t\t\t\tentity.url\n\t\t\t\t]))),\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\n/**\n* `dev` — a session command that runs the local dev loop until the\n* user interrupts it.\n*\n* The watch loop, the emulators and the live attachments stay the operation's\n* state. What the handler owns is the boundary: the converge child goes out\n* through `ctx.spawn`, so the terminal reaches alchemy natively and the engine\n* owns signal policy; the operation's events become engine events; and the\n* session settles on how it actually ended.\n*\n* Windows is refused inside the operation itself (DEV.PLATFORM_UNSUPPORTED),\n* which is why nothing here reads the platform.\n*\n* `dev` is credential-free: everything it starts runs on this machine.\n*/\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, cwd) {\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\t...endpoint.devServer !== void 0 ? { data: { devServer: endpoint.devServer } } : {}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"dev-server\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"info\",\n\t\t\t\t\ttext: `${event.address}: runs \\`${event.command}\\` in ${path.relative(cwd, event.cwd) || \".\"}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"dev-server-restarted\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"info\",\n\t\t\t\t\ttext: `${event.address}: its environment changed; \\`${event.command}\\` restarted`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"dev-server-output\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"info\",\n\t\t\t\t\ttext: `[${event.address}] ${event.line}`\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 \"target-warning\":\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.message\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 \"values-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: \"The values the config or secrets adapters return changed since dev started. Restart dev to apply them; 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, app, ctx) {\n\tconst stopped = await operations.devStop({\n\t\t...app,\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 the entry module's default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit. A service whose build adapter declares a dev server (Next.js's `next dev`, or the `dev` command written on node()) runs that instead of its build, and its output is shown here, prefixed with its address. 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 path from the app name, with dots between names (shop.catalog.database). Each environment is a complete local copy of the app, with its own services, databases, buckets and ports; the default is dev, and copies of other environments run alongside it. Where each node runs is 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\",\n\t\t\t\"{bin} dev --fresh\",\n\t\t\t\"{bin} dev --environment test --fresh\",\n\t\t\t\"{bin} dev --detach\",\n\t\t\t\"{bin} dev --entry other-module.ts\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tentry: flag.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...). Overrides `entry` in the `composer` section of prisma.config.ts.\",\n\t\t\tplaceholder: \"path\"\n\t\t}),\n\t\tname: flag.string({\n\t\t\tbrief: \"Run the app under this name instead of the name its root module declares. A different name gets its own local services, databases and buckets (default: the root module's name).\",\n\t\t\tplaceholder: \"name\"\n\t\t}),\n\t\tenvironment: flag.string({\n\t\t\tbrief: \"The environment to run as. Each environment is a separate local copy of the app, so a second one, such as test, runs alongside dev and leaves its data alone.\",\n\t\t\tplaceholder: \"name\",\n\t\t\tdefault: \"dev\"\n\t\t}),\n\t\tfresh: flag.boolean({ brief: \"Delete this app's local services, databases and buckets in the environment, and their data, before starting. Other environments are untouched.\" }),\n\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} },\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.flags.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tenvironment: args.flags.environment,\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, ctx.cwd)\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, {\n\t\t\t\tentry: args.flags.entry,\n\t\t\t\tname: args.flags.name,\n\t\t\t\tenvironment: args.flags.environment\n\t\t\t}, 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's local copy in one environment, as ending\n* `prisma dev` would: its service processes and database servers. For an\n* 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's local copy in an environment: its service processes and local database servers. Data and ports are kept for the next `prisma dev`.\",\n\t\tdescription: \"The app is the root module of the entry, or --name, as for `prisma dev`, and the environment is dev unless --environment names another. Other apps and environments keep running. 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\", \"{bin} dev stop --environment test\"]\n\t},\n\targs: { flags: {\n\t\tentry: flag.string({\n\t\t\tbrief: \"The file whose default export is the application root module. Overrides `entry` in the `composer` section of prisma.config.ts.\",\n\t\t\tplaceholder: \"path\"\n\t\t}),\n\t\tname: flag.string({\n\t\t\tbrief: \"Stop the app run under this name instead of the root module's name.\",\n\t\t\tplaceholder: \"name\"\n\t\t}),\n\t\tenvironment: flag.string({\n\t\t\tbrief: \"The environment whose local copy to stop.\",\n\t\t\tplaceholder: \"name\",\n\t\t\tdefault: \"dev\"\n\t\t})\n\t} },\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\tentry: args.flags.entry,\n\t\t\tname: args.flags.name,\n\t\t\tenvironment: args.flags.environment,\n\t\t\tcwd: ctx.cwd\n\t\t});\n\t\tif (!result.ok) return notOk(toEngineError(result.failure));\n\t\tconst { app, environment, stopped } = result.value;\n\t\treturn ok(ctx.present({ data: result.value }, {\n\t\t\thuman: (ui) => stopped.length === 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"info\",\n\t\t\t\ttext: `Nothing of ${ui.emphasize(app)} was running in the environment ${environment}.`\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `Stopped ${ui.emphasize(app)} in the environment ${environment}. Its data and ports are kept for the next \\`prisma dev\\`.`\n\t\t\t}, {\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: () => stopped.map(({ address, kind }) => dataLine([address, kind])),\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 that `prisma dev` runs from this\n* directory answers locally, in the environment named. A data command: the\n* URL is its stdout line, so `$(prisma dev url shop.gateway)` 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: \"The app is the first name of the address, and the environment is dev unless --environment names another. Reads what `prisma dev` recorded for that app and environment in this directory and starts nothing, so run it while `prisma dev` is running; a node that is not running is an error. The URL alone goes to stdout, so a script can use it directly: curl \\\"$(prisma dev url shop.gateway)\\\". With --json, stdout carries the full result instead.\",\n\t\texamples: [\n\t\t\t\"{bin} dev url shop.gateway\",\n\t\t\t\"{bin} dev url shop.gateway --environment test\",\n\t\t\t\"{bin} dev url shop.catalog.database --json\"\n\t\t]\n\t},\n\targs: {\n\t\tpositionals: { address: positional.string({\n\t\t\tbrief: \"The node's address: the app name, then the names down to the node, with dots between them, such as shop.catalog.database.\",\n\t\t\tplaceholder: \"address\"\n\t\t}) },\n\t\tflags: { environment: flag.string({\n\t\t\tbrief: \"The environment whose local copy to read.\",\n\t\t\tplaceholder: \"name\",\n\t\t\tdefault: \"dev\"\n\t\t}) }\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\tenvironment: args.flags.environment,\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: () => [dataLine([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 `deploy list` and `emulator list`, which need Prisma Cloud\n* code. `destroy` and `log` are programmatic operations in\n* `@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/\";\n/** Retires `--stage` on `command` in favour of `--environment`, so typing it fails with `CLI.COMMAND_MOVED`. */\nfunction retiredStageFlagRedirect(command) {\n\treturn {\n\t\tfrom: command,\n\t\tflag: \"stage\",\n\t\treplacement: `${command} --environment <name>`,\n\t\treason: \"A place the app runs is now called an environment.\"\n\t};\n}\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\tredirects: [retiredStageFlagRedirect(\"deploy\"), ...options.redirects ?? []]\n\t});\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT, composerSection, createComposerFamily, dataLine, realOperations, toEngineError };\n\n//# sourceMappingURL=family.mjs.map","/**\n * `deploy list` — every node an app has deployed in an environment, with the\n * platform row each one deployed to. It reads the environment's application\n * topology and the Branch's rows on Prisma Cloud, so the command is\n * assembled into the family here, where both domains may be imported.\n */\n\nimport {\n composerSection,\n DEFAULT_DEPLOY_ENVIRONMENT,\n dataLine,\n toEngineError,\n} from '@internal/cli/family';\nimport type { CliStructuredError as ComposerError } from '@internal/foundation/errors';\nimport type { Result } from '@internal/foundation/result';\nimport { defineCommand, flag } from '@prisma/cli-engine';\nimport { notOk, ok } from '@prisma/cli-engine/protocol';\nimport type { DeployedNode } from './deployed-nodes.ts';\nimport type { ListDeployedInput } from './list-deployed.ts';\n\nexport type ListDeployed = (\n input: ListDeployedInput,\n) => Promise<Result<readonly DeployedNode[], ComposerError>>;\n\n/** Loaded on first use, so nothing of the Management API reads loads with the family. */\nexport const listDeployed: ListDeployed = async (input) =>\n (await import('./list-deployed.ts')).listDeployed(input);\n\nexport const createDeployListCommand = (list: ListDeployed) =>\n defineCommand({\n help: {\n summary:\n 'List every node the app has deployed in an environment, with its platform ID and URL.',\n description:\n 'Reads the application topology the last deploy recorded for the environment, and finds ' +\n 'each node’s service, database or bucket on Prisma Cloud. The root node is the ' +\n 'Project. A node with nothing on the platform, such as a module, has no platform ID.',\n examples: [\n '{bin} deploy list',\n '{bin} deploy list --environment staging',\n '{bin} deploy list --json',\n ],\n },\n args: {\n flags: {\n entry: flag.string({\n brief:\n 'The file whose default export is the application root module, built with ' +\n 'module(...). Overrides `entry` in the `composer` section of prisma.config.ts.',\n placeholder: 'path',\n }),\n name: flag.string({\n brief:\n 'List the app deployed under this name instead of the name its root module ' +\n \"declares (default: the root module's name).\",\n placeholder: 'name',\n }),\n environment: flag.string({\n brief: 'The environment to list.',\n placeholder: 'name',\n default: DEFAULT_DEPLOY_ENVIRONMENT,\n }),\n },\n },\n needs: { config: composerSection, credentials: true },\n handler: async (args, ctx) => {\n const credential = await ctx.activeCredential();\n const result = await list({\n config: ctx.config,\n entry: args.flags.entry,\n name: args.flags.name,\n environment: args.flags.environment ?? DEFAULT_DEPLOY_ENVIRONMENT,\n cwd: ctx.cwd,\n workspaceId: credential?.workspaceId,\n client: ctx.api,\n });\n if (!result.ok) return notOk(toEngineError(result.failure));\n const nodes = result.value;\n return ok(\n ctx.present(\n { data: nodes },\n {\n human: () => [\n {\n kind: 'table',\n columns: ['Address', 'Kind', 'Platform ID', 'URL'],\n rows: nodes.map((node) => [\n node.address,\n node.kind,\n node.platformId ?? '',\n node.url ?? '',\n ]),\n },\n ],\n stdout: () =>\n nodes.map((node) => dataLine([node.address, node.kind, node.platformId, node.url])),\n json: () => nodes,\n next: () => [],\n },\n ),\n );\n },\n });\n","/**\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 { dataLine, 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, directory and environment 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 const environment = labels['composer.environment'];\n if (address === undefined) return undefined;\n const where = directory === undefined ? address : `${address} in ${directory}`;\n return environment === undefined ? where : `${where} (${environment})`;\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, node and environment started it. A stopped instance keeps its port and data ' +\n 'until it is 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 emulators.flatMap((emulator) =>\n emulator.instances.map((instance) =>\n dataLine([\n emulator.kind,\n instance.id,\n instance.url,\n instance.state,\n instance.labels['composer.address'],\n instance.labels['composer.directory'],\n instance.labels['composer.environment'],\n ]),\n ),\n ),\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 { createDeployListCommand, type ListDeployed, listDeployed } from '../family/deploy-list.ts';\nimport {\n createEmulatorListCommand,\n type ListEmulators,\n listEmulators,\n} from '../family/emulator-list.ts';\n\nexport * from '@internal/cli/family';\nexport type { ListDeployed } from '../family/deploy-list.ts';\nexport type { DeployedNode } from '../family/deployed-nodes.ts';\nexport type { ListEmulators } from '../family/emulator-list.ts';\nexport type { ListDeployedInput } from '../family/list-deployed.ts';\n\nexport interface CreateComposerFamilyOptions extends FrameworkFamilyOptions {\n /** Defaults to the real listing of this machine's emulators. */\n readonly listEmulators?: ListEmulators | undefined;\n /** Defaults to the real read of what the app has deployed on Prisma Cloud. */\n readonly listDeployed?: ListDeployed | undefined;\n}\n\n/** Composer's command family: `deploy`, `deploy list`, `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 'deploy list': createDeployListCommand(options.listDeployed ?? listDeployed),\n 'emulator list': createEmulatorListCommand(options.listEmulators ?? listEmulators),\n ...options.commands,\n },\n });\n}\n"],"mappings":";;;;;;;AAOA,MAAM,UAAU;CACf,MAAM;CACN,KAAK;CACL,MAAM;CACN,MAAM;AACP;AACA,SAAS,UAAU,OAAO;CACzB,IAAI,UAAU,QAAQ,UAAU,KAAK,GAAG,OAAO;CAC/C,OAAO,OAAO,KAAK,CAAC,CAAC,QAAQ,gBAAgB,cAAc,QAAQ,cAAc,SAAS;AAC3F;;;;;;AAMA,SAAS,SAAS,QAAQ;CACzB,OAAO,OAAO,IAAI,SAAS,CAAC,CAAC,KAAK,GAAG;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,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,M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S;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,cACE,UAAU,SAAS,aACjB,SAAS,UAAU,KAAK,aACtB,SAAS;IACP,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS,OAAO;IAChB,SAAS,OAAO;IAChB,SAAS,OAAO;GAClB,CAAC,CACH,CACF;GACF,YAAY,OAAO;GACnB,YAAY,CAAC;EACf,CACF,CACF;CACF;AACF,CAAC;;;;;;;;;;;;;;;;;AC1EH,SAAgB,qBAAqB,UAAuC,CAAC,GAAkB;CAC7F,OAAOC,uBAAsB;EAC3B,GAAG;EACH,UAAU;GACR,eAAe,wBAAwB,QAAQ,gBAAgB,YAAY;GAC3E,iBAAiB,0BAA0B,QAAQ,iBAAiB,aAAa;GACjF,GAAG,QAAQ;EACb;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"family.mjs","names":["createComposerFamily","createFrameworkFamily"],"sources":["../../../0-framework/3-tooling/cli/dist/family.mjs","../src/family/deploy-list.ts","../src/family/emulator-list.ts","../src/exports/family.ts"],"sourcesContent":["import { a as sectionMissing, t as checkComposerConfig } from \"./composer-config-QKdY85G-.mjs\";\nimport { a as DEFAULT_DEPLOY_ENVIRONMENT, c as executionDiagnostics, i as devWithDeps, n as devUrl, s as deployWithDeps, t as devStop } from \"./dev-current-D-Qb6Yem.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy-OS_ix5g0.mjs\";\nimport * as path from \"node:path\";\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/data-lines.ts\nconst ESCAPES = {\n\t\"\\\\\": \"\\\\\\\\\",\n\t\"\t\": \"\\\\t\",\n\t\"\\n\": \"\\\\n\",\n\t\"\\r\": \"\\\\r\"\n};\nfunction fieldText(field) {\n\tif (field === null || field === void 0) return \"\";\n\treturn String(field).replace(/[\\\\\\t\\n\\r]/g, (character) => ESCAPES[character] ?? character);\n}\n/**\n* One data line: the fields tab-separated, an absent field left empty so a\n* script reads the columns by position. A backslash, tab, newline or carriage\n* return inside a field is escaped as `\\\\`, `\\t`, `\\n` or `\\r`.\n*/\nfunction dataLine(fields) {\n\treturn fields.map(fieldText).join(\"\t\");\n}\n//#endregion\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/**\n* Node's `--import` of a module that sends the child's stdout to stderr when\n* stdout is not a terminal. In human format the engine hands a piped run's\n* stdout to the child, and that pipe carries only the parent's data lines.\n*/\nconst STDOUT_TO_STDERR = [\"--import\", `data:text/javascript,${encodeURIComponent(\"if (process.stdout.isTTY !== true) process.stdout.write = process.stderr.write.bind(process.stderr);\")}`];\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. It\n* ignores `invocation.redactedValues`: the child writes to the terminal, so\n* its output is not redacted (ADR-0062). */\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: [...STDOUT_TO_STDERR, ...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 the entry module's default export.\",\n\t\texamples: [\n\t\t\t\"{bin} deploy\",\n\t\t\t\"{bin} deploy --environment staging\",\n\t\t\t\"{bin} deploy --entry other-module.ts\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tentry: flag.string({\n\t\t\tbrief: \"The file whose default export is the app's root, built with appRoot(...). Overrides `entry` in the `composer` section of prisma.config.ts.\",\n\t\t\tplaceholder: \"path\"\n\t\t}),\n\t\tname: flag.string({\n\t\t\tbrief: \"Deploy the app under this name instead of the name its root module declares. A different name is a separate app on Prisma Cloud, with its own services, databases and buckets (default: the root module's name).\",\n\t\t\tplaceholder: \"name\"\n\t\t}),\n\t\tenvironment: flag.string({\n\t\t\tbrief: \"The environment to deploy to. Any name other than production is a complete, isolated copy of the app, such as staging or one per pull request.\",\n\t\t\tplaceholder: \"name\",\n\t\t\tdefault: DEFAULT_DEPLOY_ENVIRONMENT\n\t\t}),\n\t\treport: flag.string({\n\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\tplaceholder: \"path\"\n\t\t}),\n\t\tbuildId: flag.string({\n\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\tplaceholder: \"id\"\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.flags.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tenvironment: args.flags.environment,\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.environment ?? \"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: () => (summary?.nodes ?? []).flatMap((node) => node.entities.map((entity) => dataLine([\n\t\t\t\t\tnode.address,\n\t\t\t\t\tentity.kind,\n\t\t\t\t\tentity.id,\n\t\t\t\t\tentity.url\n\t\t\t\t]))),\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\n/**\n* `dev` — a session command that runs the local dev loop until the\n* user interrupts it.\n*\n* The watch loop, the emulators and the live attachments stay the operation's\n* state. What the handler owns is the boundary: the converge child goes out\n* through `ctx.spawn`, so the terminal reaches alchemy natively and the engine\n* owns signal policy; the operation's events become engine events; and the\n* session settles on how it actually ended.\n*\n* Windows is refused inside the operation itself (DEV.PLATFORM_UNSUPPORTED),\n* which is why nothing here reads the platform.\n*\n* `dev` is credential-free: everything it starts runs on this machine.\n*/\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, cwd) {\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\t...endpoint.devServer !== void 0 ? { data: { devServer: endpoint.devServer } } : {}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"dev-server\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"info\",\n\t\t\t\t\ttext: `${event.address}: runs \\`${event.command}\\` in ${path.relative(cwd, event.cwd) || \".\"}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"dev-server-restarted\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"info\",\n\t\t\t\t\ttext: `${event.address}: its environment changed; \\`${event.command}\\` restarted`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"dev-server-output\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"info\",\n\t\t\t\t\ttext: `[${event.address}] ${event.line}`\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 \"target-warning\":\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.message\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 \"values-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: \"The values the config or secrets adapters return changed since dev started. Restart dev to apply them; 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, app, ctx) {\n\tconst stopped = await operations.devStop({\n\t\t...app,\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 the entry module's default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit. A service whose build adapter declares a dev server (Next.js's `next dev`, or the `dev` command written on node()) runs that instead of its build, and its output is shown here, prefixed with its address. 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 path from the app name, with dots between names (shop.catalog.database). Each environment is a complete local copy of the app, with its own services, databases, buckets and ports; the default is dev, and copies of other environments run alongside it. Where each node runs is 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\",\n\t\t\t\"{bin} dev --fresh\",\n\t\t\t\"{bin} dev --environment test --fresh\",\n\t\t\t\"{bin} dev --detach\",\n\t\t\t\"{bin} dev --entry other-module.ts\"\n\t\t]\n\t},\n\targs: { flags: {\n\t\tentry: flag.string({\n\t\t\tbrief: \"The file whose default export is the app's root, built with appRoot(...). Overrides `entry` in the `composer` section of prisma.config.ts.\",\n\t\t\tplaceholder: \"path\"\n\t\t}),\n\t\tname: flag.string({\n\t\t\tbrief: \"Run the app under this name instead of the name its root module declares. A different name gets its own local services, databases and buckets (default: the root module's name).\",\n\t\t\tplaceholder: \"name\"\n\t\t}),\n\t\tenvironment: flag.string({\n\t\t\tbrief: \"The environment to run as. Each environment is a separate local copy of the app, so a second one, such as test, runs alongside dev and leaves its data alone.\",\n\t\t\tplaceholder: \"name\",\n\t\t\tdefault: \"dev\"\n\t\t}),\n\t\tfresh: flag.boolean({ brief: \"Delete this app's local services, databases and buckets in the environment, and their data, before starting. Other environments are untouched.\" }),\n\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} },\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.flags.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tenvironment: args.flags.environment,\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, ctx.cwd)\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, {\n\t\t\t\tentry: args.flags.entry,\n\t\t\t\tname: args.flags.name,\n\t\t\t\tenvironment: args.flags.environment\n\t\t\t}, 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's local copy in one environment, as ending\n* `prisma dev` would: its service processes and database servers. For an\n* 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's local copy in an environment: its service processes and local database servers. Data and ports are kept for the next `prisma dev`.\",\n\t\tdescription: \"The app is the root module of the entry, or --name, as for `prisma dev`, and the environment is dev unless --environment names another. Other apps and environments keep running. 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\", \"{bin} dev stop --environment test\"]\n\t},\n\targs: { flags: {\n\t\tentry: flag.string({\n\t\t\tbrief: \"The file whose default export is the app's root, built with appRoot(...). Overrides `entry` in the `composer` section of prisma.config.ts.\",\n\t\t\tplaceholder: \"path\"\n\t\t}),\n\t\tname: flag.string({\n\t\t\tbrief: \"Stop the app run under this name instead of the root module's name.\",\n\t\t\tplaceholder: \"name\"\n\t\t}),\n\t\tenvironment: flag.string({\n\t\t\tbrief: \"The environment whose local copy to stop.\",\n\t\t\tplaceholder: \"name\",\n\t\t\tdefault: \"dev\"\n\t\t})\n\t} },\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\tentry: args.flags.entry,\n\t\t\tname: args.flags.name,\n\t\t\tenvironment: args.flags.environment,\n\t\t\tcwd: ctx.cwd\n\t\t});\n\t\tif (!result.ok) return notOk(toEngineError(result.failure));\n\t\tconst { app, environment, stopped } = result.value;\n\t\treturn ok(ctx.present({ data: result.value }, {\n\t\t\thuman: (ui) => stopped.length === 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"info\",\n\t\t\t\ttext: `Nothing of ${ui.emphasize(app)} was running in the environment ${environment}.`\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `Stopped ${ui.emphasize(app)} in the environment ${environment}. Its data and ports are kept for the next \\`prisma dev\\`.`\n\t\t\t}, {\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: () => stopped.map(({ address, kind }) => dataLine([address, kind])),\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 that `prisma dev` runs from this\n* directory answers locally, in the environment named. A data command: the\n* URL is its stdout line, so `$(prisma dev url shop.gateway)` 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: \"The app is the first name of the address, and the environment is dev unless --environment names another. Reads what `prisma dev` recorded for that app and environment in this directory and starts nothing, so run it while `prisma dev` is running; a node that is not running is an error. The URL alone goes to stdout, so a script can use it directly: curl \\\"$(prisma dev url shop.gateway)\\\". With --json, stdout carries the full result instead.\",\n\t\texamples: [\n\t\t\t\"{bin} dev url shop.gateway\",\n\t\t\t\"{bin} dev url shop.gateway --environment test\",\n\t\t\t\"{bin} dev url shop.catalog.database --json\"\n\t\t]\n\t},\n\targs: {\n\t\tpositionals: { address: positional.string({\n\t\t\tbrief: \"The node's address: the app name, then the names down to the node, with dots between them, such as shop.catalog.database.\",\n\t\t\tplaceholder: \"address\"\n\t\t}) },\n\t\tflags: { environment: flag.string({\n\t\t\tbrief: \"The environment whose local copy to read.\",\n\t\t\tplaceholder: \"name\",\n\t\t\tdefault: \"dev\"\n\t\t}) }\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\tenvironment: args.flags.environment,\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: () => [dataLine([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 `deploy list` and `emulator list`, which need Prisma Cloud\n* code. `destroy` and `log` are programmatic operations in\n* `@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/\";\n/** Retires `--stage` on `command` in favour of `--environment`, so typing it fails with `CLI.COMMAND_MOVED`. */\nfunction retiredStageFlagRedirect(command) {\n\treturn {\n\t\tfrom: command,\n\t\tflag: \"stage\",\n\t\treplacement: `${command} --environment <name>`,\n\t\treason: \"A place the app runs is now called an environment.\"\n\t};\n}\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\tredirects: [retiredStageFlagRedirect(\"deploy\"), ...options.redirects ?? []]\n\t});\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT, composerSection, createComposerFamily, dataLine, realOperations, toEngineError };\n\n//# sourceMappingURL=family.mjs.map","/**\n * `deploy list` — every node an app has deployed in an environment, with the\n * platform row each one deployed to. It reads the environment's application\n * topology and the Branch's rows on Prisma Cloud, so the command is\n * assembled into the family here, where both domains may be imported.\n */\n\nimport {\n composerSection,\n DEFAULT_DEPLOY_ENVIRONMENT,\n dataLine,\n toEngineError,\n} from '@internal/cli/family';\nimport type { CliStructuredError as ComposerError } from '@internal/foundation/errors';\nimport type { Result } from '@internal/foundation/result';\nimport { defineCommand, flag } from '@prisma/cli-engine';\nimport { notOk, ok } from '@prisma/cli-engine/protocol';\nimport type { DeployedNode } from './deployed-nodes.ts';\nimport type { ListDeployedInput } from './list-deployed.ts';\n\nexport type ListDeployed = (\n input: ListDeployedInput,\n) => Promise<Result<readonly DeployedNode[], ComposerError>>;\n\n/** Loaded on first use, so nothing of the Management API reads loads with the family. */\nexport const listDeployed: ListDeployed = async (input) =>\n (await import('./list-deployed.ts')).listDeployed(input);\n\nexport const createDeployListCommand = (list: ListDeployed) =>\n defineCommand({\n help: {\n summary:\n 'List every node the app has deployed in an environment, with its platform ID and URL.',\n description:\n 'Reads the application topology the last deploy recorded for the environment, and finds ' +\n 'each node’s service, database or bucket on Prisma Cloud. The root node is the ' +\n 'Project. A node with nothing on the platform, such as a module, has no platform ID.',\n examples: [\n '{bin} deploy list',\n '{bin} deploy list --environment staging',\n '{bin} deploy list --json',\n ],\n },\n args: {\n flags: {\n entry: flag.string({\n brief:\n \"The file whose default export is the app's root, built with appRoot(...). \" +\n 'Overrides `entry` in the `composer` section of prisma.config.ts.',\n placeholder: 'path',\n }),\n name: flag.string({\n brief:\n 'List the app deployed under this name instead of the name its root module ' +\n \"declares (default: the root module's name).\",\n placeholder: 'name',\n }),\n environment: flag.string({\n brief: 'The environment to list.',\n placeholder: 'name',\n default: DEFAULT_DEPLOY_ENVIRONMENT,\n }),\n },\n },\n needs: { config: composerSection, credentials: true },\n handler: async (args, ctx) => {\n const credential = await ctx.activeCredential();\n const result = await list({\n config: ctx.config,\n entry: args.flags.entry,\n name: args.flags.name,\n environment: args.flags.environment ?? DEFAULT_DEPLOY_ENVIRONMENT,\n cwd: ctx.cwd,\n workspaceId: credential?.workspaceId,\n client: ctx.api,\n });\n if (!result.ok) return notOk(toEngineError(result.failure));\n const nodes = result.value;\n return ok(\n ctx.present(\n { data: nodes },\n {\n human: () => [\n {\n kind: 'table',\n columns: ['Address', 'Kind', 'Platform ID', 'URL'],\n rows: nodes.map((node) => [\n node.address,\n node.kind,\n node.platformId ?? '',\n node.url ?? '',\n ]),\n },\n ],\n stdout: () =>\n nodes.map((node) => dataLine([node.address, node.kind, node.platformId, node.url])),\n json: () => nodes,\n next: () => [],\n },\n ),\n );\n },\n });\n","/**\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 { dataLine, 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, directory and environment 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 const environment = labels['composer.environment'];\n if (address === undefined) return undefined;\n const where = directory === undefined ? address : `${address} in ${directory}`;\n return environment === undefined ? where : `${where} (${environment})`;\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, node and environment started it. A stopped instance keeps its port and data ' +\n 'until it is 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 emulators.flatMap((emulator) =>\n emulator.instances.map((instance) =>\n dataLine([\n emulator.kind,\n instance.id,\n instance.url,\n instance.state,\n instance.labels['composer.address'],\n instance.labels['composer.directory'],\n instance.labels['composer.environment'],\n ]),\n ),\n ),\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 { createDeployListCommand, type ListDeployed, listDeployed } from '../family/deploy-list.ts';\nimport {\n createEmulatorListCommand,\n type ListEmulators,\n listEmulators,\n} from '../family/emulator-list.ts';\n\nexport * from '@internal/cli/family';\nexport type { ListDeployed } from '../family/deploy-list.ts';\nexport type { DeployedNode } from '../family/deployed-nodes.ts';\nexport type { ListEmulators } from '../family/emulator-list.ts';\nexport type { ListDeployedInput } from '../family/list-deployed.ts';\n\nexport interface CreateComposerFamilyOptions extends FrameworkFamilyOptions {\n /** Defaults to the real listing of this machine's emulators. */\n readonly listEmulators?: ListEmulators | undefined;\n /** Defaults to the real read of what the app has deployed on Prisma Cloud. */\n readonly listDeployed?: ListDeployed | undefined;\n}\n\n/** Composer's command family: `deploy`, `deploy list`, `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 'deploy list': createDeployListCommand(options.listDeployed ?? listDeployed),\n 'emulator list': createEmulatorListCommand(options.listEmulators ?? listEmulators),\n ...options.commands,\n },\n });\n}\n"],"mappings":";;;;;;;AAOA,MAAM,UAAU;CACf,MAAM;CACN,KAAK;CACL,MAAM;CACN,MAAM;AACP;AACA,SAAS,UAAU,OAAO;CACzB,IAAI,UAAU,QAAQ,UAAU,KAAK,GAAG,OAAO;CAC/C,OAAO,OAAO,KAAK,CAAC,CAAC,QAAQ,gBAAgB,cAAc,QAAQ,cAAc,SAAS;AAC3F;;;;;;AAMA,SAAS,SAAS,QAAQ;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1
+ import { p as noComposerExportMessage } from "./redaction-HnbkSFrK-CCKJNRwi.mjs";
2
2
  import { r as devEnvironmentDir } from "./app-config-CErnR6NK-DnKH4Kqc.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import * as path from "node:path";
5
- //#region ../../0-framework/3-tooling/cli/dist/generate-dev-stack-Cag2Bd4s.mjs
5
+ //#region ../../0-framework/3-tooling/cli/dist/generate-dev-stack-BV_n-X9n.mjs
6
6
  /**
7
7
  * Local-dev spec § 6 `generate-dev-stack.ts`: like generate-stack.ts but in
8
8
  * the environment's folder, `.prisma-composer/dev/<environment>/alchemy.run.ts`,
@@ -97,4 +97,4 @@ function writeDevStackFile(input) {
97
97
  //#endregion
98
98
  export { renderDevStackFile as n, writeDevStackFile as r, devStackRelativePath as t };
99
99
 
100
- //# sourceMappingURL=generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs.map
100
+ //# sourceMappingURL=generate-dev-stack-BV_n-X9n-BDBjgphH.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/generate-dev-stack-Cag2Bd4s.mjs"],"sourcesContent":["import { i as noComposerExportMessage } from \"./composer-config-DO_iG0iR.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { devEnvironmentDir } from \"@internal/core/config\";\n//#region src/dev/generate-dev-stack.ts\n/**\n* Local-dev spec § 6 `generate-dev-stack.ts`: like generate-stack.ts but in\n* the environment's folder, `.prisma-composer/dev/<environment>/alchemy.run.ts`,\n* at the Alchemy stage named by the environment, using\n* Composer's `devState()` (Alchemy's file store) and no `report` — dev prints its own front\n* door (run-dev.ts), so core's presentation-free lower() gets nothing to\n* call back into. The generated module IS the one orchestration point where\n* dev provenance is resolved (spec § 3 REVISED): it deserializes the\n* containers, top-level-awaits `resolveLocalTargets(config)` (the lazy\n* `localTarget` thunks, ADR-0041), and passes\n* `providers: localTargetProviders(...)` + `state: devState()` explicitly\n* — `lower()` learns nothing about dev.\n*/\nconst DEV_GENERATED_FILE = \"alchemy.run.ts\";\n/** The stack file's path relative to the cwd. */\nfunction devStackRelativePath(environment) {\n\treturn path.join(devEnvironmentDir(environment), DEV_GENERATED_FILE);\n}\n/** A relative import specifier from the stack file to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(` environment: ${quote(input.environment)},`);\n\tlines.push(\" appConfigurationRead: file.appConfigurationRead,\");\n\tlines.push(\" firstProcessNodeAddresses: file.nodeAddresses,\");\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tconst unassembled = Object.keys(input.assembled.devServers);\n\tif (unassembled.length > 0) lines.push(` unassembled: [${unassembled.map(quote).join(\", \")}],`);\n\tlines.push(\" providers: localTargetProviders(resolved, containers, devDir, file.appConfigurationRead.configurationKeyText, namedSecrets),\");\n\tlines.push(\" state: devState(),\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the dev stack module's source (tests assert on it without touching disk). */\nfunction renderDevStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, devEnvironmentDir(input.environment));\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst imports = [\n\t\t\"import * as path from 'node:path';\",\n\t\t\"import { deserializeContainers } from '@prisma/composer/config';\",\n\t\t\"import { namedSecretsFromEnvironment, readAppConfigurationFile } from '@prisma/composer/internal/app-configuration-file';\",\n\t\t\"import { lower } from '@prisma/composer/deploy';\",\n\t\t\"import { devEnvironmentDir, devState, localTargetProviders, resolveLocalTargets } from '@prisma/composer/local-target';\",\n\t\t`import prismaConfig from ${quote(relativeImportSpecifier(generatedDir, input.configFile))};`,\n\t\t`import app from ${quote(appImport)};`\n\t].join(\"\\n\");\n\treturn `// Generated by \\`prisma dev\\` — overwritten on every run; do not\n// edit by hand. Independently runnable from ${quote(input.cwd)} by the\n// command Composer starts, which a failed run prints:\n//\n// <node> <bin of the alchemy @prisma/composer depends on> deploy ${devStackRelativePath(input.environment)} --yes --stage ${input.environment}\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\n// It runs no config or secrets adapter: it reads what the first process's Load read from the app configuration file named in PRISMA_COMPOSER_APP_CONFIGURATION_FILE, and the named secrets from PRISMA_COMPOSER_NAMED_SECRETS.\n${imports}\n\nconst config = prismaConfig.composer;\nif (config === undefined) {\n throw new Error(${quote(noComposerExportMessage(input.configFile))});\n}\n\nconst containers = deserializeContainers(config.extensions, process.env);\nconst resolved = await resolveLocalTargets(config);\nconst devDir = path.join(process.cwd(), devEnvironmentDir(${quote(input.environment)}));\nconst file = readAppConfigurationFile(process.env);\nconst namedSecrets = namedSecretsFromEnvironment(process.env);\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the dev stack file, returning its absolute path. */\nfunction writeDevStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, devEnvironmentDir(input.environment));\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, DEV_GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderDevStackFile(input));\n\treturn filePath;\n}\n//#endregion\nexport { renderDevStackFile as n, writeDevStackFile as r, devStackRelativePath as t };\n\n//# sourceMappingURL=generate-dev-stack-Cag2Bd4s.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,qBAAqB;;AAE3B,SAAS,qBAAqB,aAAa;CAC1C,OA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;EACA,4BAA4B,MAAM,wBAAwB,cAAc,MAAM,UAAU,CAAC,EAAE;EAC3F,mBAAmB,MAAM,SAAS,EAAE;CACrC,CAAC,CAAC,KAAK,IAAI;CACX,OAAO;+CACuC,MAAM,MAAM,GAAG,EAAE;;;sEAGM,qBAAqB,MAAM,WAAW,EAAE,iBAAiB,MAAM,YAAY;;;;EAI/I,QAAQ;;;;oBAIU,MAAM,wBAAwB,MAAM,UAAU,CAAC,EAAE;;;;;4DAKT,MAAM,MAAM,WAAW,EAAE;;;;;EAKnF,cAAc,KAAK,EAAE;;;AAGvB;;AAEA,SAAS,kBAAkB,OAAO;CACjC,MAAM,eAAe,KAAK,KAAK,MAAM,KAAK,kBAAkB,MAAM,WAAW,CAAC;CAC9E,GAAG,UAAU,cAAc,EAAE,WAAW,KAAK,CAAC;CAC9C,MAAM,WAAW,KAAK,KAAK,cAAc,kBAAkB;CAC3D,GAAG,cAAc,UAAU,mBAAmB,KAAK,CAAC;CACpD,OAAO;AACR"}
1
+ {"version":3,"file":"generate-dev-stack-BV_n-X9n-BDBjgphH.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/generate-dev-stack-BV_n-X9n.mjs"],"sourcesContent":["import { i as noComposerExportMessage } from \"./composer-config-QKdY85G-.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { devEnvironmentDir } from \"@internal/core/config\";\n//#region src/dev/generate-dev-stack.ts\n/**\n* Local-dev spec § 6 `generate-dev-stack.ts`: like generate-stack.ts but in\n* the environment's folder, `.prisma-composer/dev/<environment>/alchemy.run.ts`,\n* at the Alchemy stage named by the environment, using\n* Composer's `devState()` (Alchemy's file store) and no `report` — dev prints its own front\n* door (run-dev.ts), so core's presentation-free lower() gets nothing to\n* call back into. The generated module IS the one orchestration point where\n* dev provenance is resolved (spec § 3 REVISED): it deserializes the\n* containers, top-level-awaits `resolveLocalTargets(config)` (the lazy\n* `localTarget` thunks, ADR-0041), and passes\n* `providers: localTargetProviders(...)` + `state: devState()` explicitly\n* — `lower()` learns nothing about dev.\n*/\nconst DEV_GENERATED_FILE = \"alchemy.run.ts\";\n/** The stack file's path relative to the cwd. */\nfunction devStackRelativePath(environment) {\n\treturn path.join(devEnvironmentDir(environment), DEV_GENERATED_FILE);\n}\n/** A relative import specifier from the stack file to `target` (posix separators). */\nfunction relativeImportSpecifier(generatedDir, target) {\n\tconst rel = path.relative(generatedDir, target).split(path.sep).join(\"/\");\n\treturn rel.startsWith(\".\") ? rel : `./${rel}`;\n}\nfunction quote(value) {\n\treturn JSON.stringify(value);\n}\nfunction renderBundle(bundle) {\n\treturn `{ dir: ${quote(bundle.dir)}, entry: ${quote(bundle.entry)} }`;\n}\nfunction renderOptions(input) {\n\tconst lines = [];\n\tlines.push(` name: ${quote(input.name)},`);\n\tlines.push(` environment: ${quote(input.environment)},`);\n\tlines.push(\" appConfigurationRead: file.appConfigurationRead,\");\n\tlines.push(\" firstProcessNodeAddresses: file.nodeAddresses,\");\n\tlines.push(\" bundles: {\");\n\tfor (const [id, bundle] of Object.entries(input.assembled.bundles)) lines.push(` ${quote(id)}: ${renderBundle(bundle)},`);\n\tlines.push(\" },\");\n\tconst unassembled = Object.keys(input.assembled.devServers);\n\tif (unassembled.length > 0) lines.push(` unassembled: [${unassembled.map(quote).join(\", \")}],`);\n\tlines.push(\" providers: localTargetProviders(resolved, containers, devDir, file.appConfigurationRead.configurationKeyText, namedSecrets),\");\n\tlines.push(\" state: devState(),\");\n\treturn lines.join(\"\\n\");\n}\n/** Renders the dev stack module's source (tests assert on it without touching disk). */\nfunction renderDevStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, devEnvironmentDir(input.environment));\n\tconst appImport = relativeImportSpecifier(generatedDir, input.entryPath);\n\tconst imports = [\n\t\t\"import * as path from 'node:path';\",\n\t\t\"import { deserializeContainers } from '@prisma/composer/config';\",\n\t\t\"import { namedSecretsFromEnvironment, readAppConfigurationFile } from '@prisma/composer/internal/app-configuration-file';\",\n\t\t\"import { lower } from '@prisma/composer/deploy';\",\n\t\t\"import { devEnvironmentDir, devState, localTargetProviders, resolveLocalTargets } from '@prisma/composer/local-target';\",\n\t\t`import prismaConfig from ${quote(relativeImportSpecifier(generatedDir, input.configFile))};`,\n\t\t`import app from ${quote(appImport)};`\n\t].join(\"\\n\");\n\treturn `// Generated by \\`prisma dev\\` — overwritten on every run; do not\n// edit by hand. Independently runnable from ${quote(input.cwd)} by the\n// command Composer starts, which a failed run prints:\n//\n// <node> <bin of the alchemy @prisma/composer depends on> deploy ${devStackRelativePath(input.environment)} --yes --stage ${input.environment}\n//\n// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).\n// It runs no config or secrets adapter: it reads what the first process's Load read from the app configuration file named in PRISMA_COMPOSER_APP_CONFIGURATION_FILE, and the named secrets from PRISMA_COMPOSER_NAMED_SECRETS.\n${imports}\n\nconst config = prismaConfig.composer;\nif (config === undefined) {\n throw new Error(${quote(noComposerExportMessage(input.configFile))});\n}\n\nconst containers = deserializeContainers(config.extensions, process.env);\nconst resolved = await resolveLocalTargets(config);\nconst devDir = path.join(process.cwd(), devEnvironmentDir(${quote(input.environment)}));\nconst file = readAppConfigurationFile(process.env);\nconst namedSecrets = namedSecretsFromEnvironment(process.env);\n\nexport default lower(app, config, {\n${renderOptions(input)}\n});\n`;\n}\n/** Writes the dev stack file, returning its absolute path. */\nfunction writeDevStackFile(input) {\n\tconst generatedDir = path.join(input.cwd, devEnvironmentDir(input.environment));\n\tfs.mkdirSync(generatedDir, { recursive: true });\n\tconst filePath = path.join(generatedDir, DEV_GENERATED_FILE);\n\tfs.writeFileSync(filePath, renderDevStackFile(input));\n\treturn filePath;\n}\n//#endregion\nexport { renderDevStackFile as n, writeDevStackFile as r, devStackRelativePath as t };\n\n//# sourceMappingURL=generate-dev-stack-BV_n-X9n.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,qBAAqB;;AAE3B,SAAS,qBAAqB,aAAa;CAC1C,OAAO,KA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4BAA4B,MAAM,wBAAwB,cAAc,MAAM,UAAU,CAAC,EAAE;EAC3F,mBAAmB,MAAM,SAAS,EAAE;CACrC,CAAC,CAAC,KAAK,IAAI;CACX,OAAO;+CACuC,MAAM,MAAM,GAAG,EAAE;;;sEAGM,qBAAqB,MAAM,WAAW,EAAE,iBAAiB,MAAM,YAAY;;;;EAI/I,QAAQ;;;;oBAIU,MAAM,wBAAwB,MAAM,UAAU,CAAC,EAAE;;;;;4DAKT,MAAM,MAAM,WAAW,EAAE;;;;;EAKnF,cAAc,KAAK,EAAE;;;AAGvB;;AAEA,SAAS,kBAAkB,OAAO;CACjC,MAAM,eAAe,KAAK,KAAK,MAAM,KAAK,kBAAkB,MAAM,WAAW,CAAC;CAC9E,GAAG,UAAU,cAAc,EAAE,WAAW,KAAK,CAAC;CAC9C,MAAM,WAAW,KAAK,KAAK,cAAc,kBAAkB;CAC3D,GAAG,cAAc,UAAU,mBAAmB,KAAK,CAAC;CACpD,OAAO;AACR"}
@@ -1,4 +1,4 @@
1
- import { i as validateEnvironmentName, n as resolveAppIdentity } from "./validate-environment-D_dECxgO-fg8lfCME.mjs";
1
+ import { i as validateEnvironmentName, n as resolveAppIdentity } from "./validate-environment-CpQLC3CA-Ct-PXoKN.mjs";
2
2
  import { i as CliStructuredError, n as ok, t as notOk } from "./result-sR7PBi61.mjs";
3
3
  import * as Effect from "effect/Effect";
4
4
  import "effect/Layer";
@@ -9,7 +9,7 @@ import "effect/Redacted";
9
9
  import * as Data from "effect/Data";
10
10
  Context.Service()("PrismaComposerCredentials");
11
11
  //#endregion
12
- //#region ../../1-prisma-cloud/0-lowering/lowering/dist/container-CuNTXJjn.mjs
12
+ //#region ../../1-prisma-cloud/0-lowering/lowering/dist/container-CrBfZsPj.mjs
13
13
  /**
14
14
  * The typed Prisma Management API client, built once from the resolved
15
15
  * credentials. Providers yield this in their outer Effect and call it inside
@@ -377,4 +377,4 @@ async function listDeployed(input) {
377
377
  //#endregion
378
378
  export { listDeployed };
379
379
 
380
- //# sourceMappingURL=list-deployed-Cj37uZ6w.mjs.map
380
+ //# sourceMappingURL=list-deployed-IL0MgmTX.mjs.map