@prisma/composer-cli 0.27.0 → 0.28.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -589,7 +589,7 @@ interface Graph {
589
589
  readonly params: readonly ParamBinding[];
590
590
  }
591
591
  //#endregion
592
- //#region ../../0-framework/1-core/core/dist/app-config-DyCMnkDr.d.mts
592
+ //#region ../../0-framework/1-core/core/dist/app-config-3CswwwoZ.d.mts
593
593
  //#region src/container-transport.d.ts
594
594
  /**
595
595
  * Carries resolved containers from the CLI process into the alchemy process
@@ -858,6 +858,8 @@ interface AssembleInput {
858
858
  readonly address: string;
859
859
  /** The directory the deploy command was run from. The assembler puts its working directory under it (`<cwd>/.prisma-composer/`), the same place the CLI writes its other generated files. */
860
860
  readonly cwd: string;
861
+ /** Counts and labels this assemble measured, for the deploy's progress output. Core never reads them. */
862
+ readonly report?: ((data: Readonly<Record<string, string | number>>) => void) | undefined;
861
863
  }
862
864
  /** package()'s product. */
863
865
  interface Artifact {
@@ -959,6 +961,8 @@ interface PreflightInput<C = unknown> {
959
961
  readonly stage: string | undefined;
960
962
  /** What the caller has already authenticated, for the platform calls preflight makes. Absent means the extension falls back to its own credential protocol. */
961
963
  readonly credentials?: ContainerCredentials<C> | undefined;
964
+ /** Hands the deploy's progress output what the check covered, as counts (e.g. `{ checked: 53, filled: 0, missing: 0 }`). Counts only: never a name or a value. */
965
+ readonly report?: ((counts: Readonly<Record<string, number>>) => void) | undefined;
962
966
  }
963
967
  /** The resolved destroy context handed to an extension's `teardown` hook. */
964
968
  interface TeardownInput {
@@ -1177,10 +1181,12 @@ interface AssembledServices {
1177
1181
  /** One bundle per provisioned service, keyed by the service's full hierarchical address (its graph id). */
1178
1182
  readonly bundles: Record<string, Bundle>;
1179
1183
  }
1184
+ /** What a build adapter measured during one assemble, for progress output. Never read here. */
1185
+ type AssembleReport = (data: Readonly<Record<string, string | number>>) => void;
1180
1186
  /** Assembles one service node — the seam tests substitute to avoid a real build. */
1181
- type RunAssembler = (node: ServiceNode, address: string, cwd: string) => Promise<Bundle>;
1187
+ type RunAssembler = (node: ServiceNode, address: string, cwd: string, report?: AssembleReport) => Promise<Bundle>;
1182
1188
  //#endregion
1183
- //#region ../../0-framework/3-tooling/cli/dist/dev-CpevhBSn.d.mts
1189
+ //#region ../../0-framework/3-tooling/cli/dist/dev-D_zimxCK.d.mts
1184
1190
  //#region src/composer-config.d.ts
1185
1191
  /** Composer's configuration and the `prisma.config.ts` that declares it. */
1186
1192
  interface ComposerConfigSource {
@@ -1292,6 +1298,24 @@ interface OperationDeps {
1292
1298
  }
1293
1299
  //#endregion
1294
1300
  //#region src/operations/deploy.d.ts
1301
+ /** A deploy step. `assemble-service` steps run inside `assemble`, one per service. */
1302
+ type DeployStep = {
1303
+ readonly name: 'prepare' | 'assemble' | 'connect' | 'preflight' | 'apply' | 'record';
1304
+ } | {
1305
+ readonly name: 'assemble-service';
1306
+ readonly address: string;
1307
+ };
1308
+ type DeployEvent = {
1309
+ readonly kind: 'step-started';
1310
+ readonly step: DeployStep;
1311
+ } | {
1312
+ readonly kind: 'step-finished';
1313
+ readonly step: DeployStep;
1314
+ readonly outcome: 'ok' | 'failed';
1315
+ readonly durationMs: number;
1316
+ /** What the step measured, as its build adapter or deploy target reported it. The fields vary by adapter and target. */
1317
+ readonly data?: Readonly<Record<string, string | number>> | undefined;
1318
+ };
1295
1319
  interface DeployInput {
1296
1320
  /**
1297
1321
  * Composer's configuration: the `composer` section of `prisma.config.ts` and that file. The operation does not look for a config file; it refuses a section the CLI would refuse, before any work starts.
@@ -1319,11 +1343,15 @@ interface DeployInput {
1319
1343
  * one. Absent falls back to whatever the target reads from the environment.
1320
1344
  */
1321
1345
  readonly reportId?: string | undefined;
1346
+ /** Each step as it starts and finishes, in real time. Rendering is the host's. */
1347
+ readonly onEvent?: ((event: DeployEvent) => void) | undefined;
1322
1348
  }
1323
1349
  interface DeploySuccess {
1324
1350
  /** Parsed from the alchemy child's result file. Undefined when the child
1325
1351
  * did not write one (injected fake alchemy, or a report-less apply). */
1326
1352
  readonly summary: DeploymentSummary | undefined;
1353
+ /** How long the whole deploy took, from the call to its result. */
1354
+ readonly durationMs: number;
1327
1355
  }
1328
1356
  /** In-package variant threading the injection seam, which the family's
1329
1357
  * commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors
@@ -1397,7 +1425,7 @@ interface DevSession {
1397
1425
  * internal types and is not part of the published surface. */
1398
1426
  declare function devWithDeps(input: DevInput, deps: OperationDeps): Promise<Result$1<DevSession, CliStructuredError>>;
1399
1427
  //#endregion
1400
- //#region ../../0-framework/3-tooling/cli/dist/family-CgeZQdNg.d.mts
1428
+ //#region ../../0-framework/3-tooling/cli/dist/family-B7xU_-RU.d.mts
1401
1429
  //#region src/family/family.d.ts
1402
1430
  /**
1403
1431
  * The control-plane operations the family's handlers call. These are the
@@ -1418,5 +1446,5 @@ interface CreateComposerFamilyOptions {
1418
1446
  }
1419
1447
  declare function createComposerFamily(options?: CreateComposerFamilyOptions): CommandFamily;
1420
1448
  //#endregion
1421
- export { ComposerConfigSource as a, DevInput as c, ServiceEndpoint as d, AssembledServices as f, realOperations as i, DevSession as l, CliStructuredError as m, CreateComposerFamilyOptions as n, DeployInput as o, Result$1 as p, createComposerFamily as r, DeploySuccess as s, ComposerOperations as t, OperationDeps as u };
1422
- //# sourceMappingURL=family-CgeZQdNg-gH8LuqqL.d.mts.map
1449
+ export { ComposerConfigSource as a, DeploySuccess as c, OperationDeps as d, ServiceEndpoint as f, CliStructuredError as h, realOperations as i, DevInput as l, Result$1 as m, CreateComposerFamilyOptions as n, DeployEvent as o, AssembledServices as p, createComposerFamily as r, DeployInput as s, ComposerOperations as t, DevSession as u };
1450
+ //# sourceMappingURL=family-B7xU_-RU-0ngWShLP.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"family-CgeZQdNg-gH8LuqqL.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/errors.d.mts","../../../../node_modules/@standard-schema/spec/dist/index.d.ts","../../../0-framework/1-core/core/dist/graph-types-BTTaRnih.d.mts","../../../0-framework/1-core/core/dist/app-config-DyCMnkDr.d.mts","../../../0-framework/3-tooling/cli/dist/deployment-summary-CU-eVvJM.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/assemble/dist/index.d.mts","../../../0-framework/3-tooling/cli/dist/dev-CpevhBSn.d.mts","../../../0-framework/3-tooling/cli/dist/family-CgeZQdNg.d.mts"],"x_google_ignoreList":[1],"mappings":";;;;;;;UACU,wBAAwB;WACvB;WACA;WACA;WACA;aACE;aACA;;WAEF;WACA,OAAO;WACP;;;;;;;;UAwBD;WACC;WACA;WACA;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;;;;;;;;;;;;cAoBG,2BAA2B,iBAAiB;WAC/C;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA;aACA;eACE;eACA;;aAEF,OAAO;aACP;aACA;;;;;EAKX,cAAc;;;;;SAKP,GAAG,iBAAiB,SAAS;;;;;UCjG5B,gBAAgB,iBAAiB,SAAS;;WAEvC,aAAa,gBAAgB,MAAM,OAAO;;kBAErC;;YAEJ,MAAM,iBAAiB,SAAS;;aAE7B;;aAEA;;aAEA,QAAQ,MAAM,OAAO;;;YAGxB,MAAM,iBAAiB,SAAS;;aAE7B,OAAO;;aAEP,QAAQ;;;OAGhB,WAAW,eAAe,mBAAmB,YAAY;;OAEzD,YAAY,eAAe,mBAAmB,YAAY;;;UAGzD,iBAAiB,iBAAiB,SAAS;;WAExC,aAAa,iBAAiB,MAAM,OAAO;;kBAEtC;;YAEJ,MAAM,iBAAiB,SAAS,eAAe,gBAAgB,MAAM,OAAO;;aAEzE,WAAW,gBAAgB,UAAU,iBAAiB,wBAAwB,OAAO,UAAU,QAAQ,OAAO;;;OAGtH,OAAO,UAAU,cAAc,UA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IC,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;;;;;;WAOA;;;;;;;WAOA;;UAED;;;WAGC,SAAS;;;;;iBAMH,eAAe,OAAO,aAAa,MAAM,gBAAgB,QAAQ,SAAO,eAAe;;;KAGnG;;;WAGM;WACA,oBAAoB;;WAEpB;WACA;;WAEA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;WACA;WACA;;WAEA;;;;WAIA;WACA;;WAEA;;UAED;;;;WAIC,QAAQ;WACR;WACA;WACA;WACA;WACA,YAAY,OAAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;;;;iBAMF,YAAY,OAAO,UAAU,MAAM,gBAAgB,QAAQ,SAAO,YAAY;;;;;;;;;;;;UC5OrF;WACC,eAAe;WACf,YAAY;;cAET,gBAAgB;UACpB;;WAEC,aAAa;;iBAEP,qBAAqB,UAAU,8BAA8B"}
1
+ {"version":3,"file":"family-B7xU_-RU-0ngWShLP.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/errors.d.mts","../../../../node_modules/@standard-schema/spec/dist/index.d.ts","../../../0-framework/1-core/core/dist/graph-types-BTTaRnih.d.mts","../../../0-framework/1-core/core/dist/app-config-3CswwwoZ.d.mts","../../../0-framework/3-tooling/cli/dist/deployment-summary-CU-eVvJM.d.mts","../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/assemble/dist/index.d.mts","../../../0-framework/3-tooling/cli/dist/dev-D_zimxCK.d.mts","../../../0-framework/3-tooling/cli/dist/family-B7xU_-RU.d.mts"],"x_google_ignoreList":[1],"mappings":";;;;;;;UACU,wBAAwB;WACvB;WACA;WACA;WACA;aACE;aACA;;WAEF;WACA,OAAO;WACP;;;;;;;;UAwBD;WACC;WACA;WACA;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;;;;;;;;;;;;cAoBG,2BAA2B,iBAAiB;WAC/C;WACA;WACA;WACA;WACA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AAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;;;;iBAMF,YAAY,OAAO,UAAU,MAAM,gBAAgB,QAAQ,SAAO,YAAY;;;;;;;;;;;;UClQrF;WACC,eAAe;WACf,YAAY;;cAET,gBAAgB;UACpB;;WAEC,aAAa;;iBAEP,qBAAqB,UAAU,8BAA8B"}
package/dist/family.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as ComposerConfigSource, i as realOperations, m as CliStructuredError$1, n as CreateComposerFamilyOptions, r as createComposerFamily, t as ComposerOperations } from "./family-CgeZQdNg-gH8LuqqL.mjs";
1
+ import { a as ComposerConfigSource, h as CliStructuredError$1, i as realOperations, n as CreateComposerFamilyOptions, r as createComposerFamily, t as ComposerOperations } from "./family-B7xU_-RU-0ngWShLP.mjs";
2
2
  import { ConfigSection } from "@prisma/cli-engine";
3
3
  import { CliStructuredError } from "@prisma/cli-engine/protocol";
4
4
  //#region ../../0-framework/3-tooling/cli/dist/family.d.mts
package/dist/family.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { i as sectionMissing, t as checkComposerConfig } from "./composer-config-CY9fET8H-KpGjlYgO.mjs";
2
- import { a as devWithDeps, i as deployWithDeps, o as executionDiagnostics, t as alchemyCommandLine } from "./run-alchemy-BEvB2sYQ-BgV2deuO.mjs";
2
+ import { a as devWithDeps, i as deployWithDeps, o as executionDiagnostics, t as alchemyCommandLine } from "./run-alchemy-BEvB2sYQ-BePRE5k2.mjs";
3
3
  import { defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, positional } from "@prisma/cli-engine";
4
4
  import { CliStructuredError, notOk, ok } from "@prisma/cli-engine/protocol";
5
5
  //#region ../../0-framework/3-tooling/cli/dist/family.mjs
@@ -178,13 +178,47 @@ const composerSection = defineConfigSection({
178
178
  async function workspaceIdOf(ctx) {
179
179
  return (await ctx.activeCredential())?.workspaceId;
180
180
  }
181
- /**
182
- * `deploy <entry>` — a result command that hands the terminal to alchemy.
183
- *
184
- * `--production` is gone. It was accepted and then always errored ("only
185
- * valid with destroy"), so no invocation using it could ever have succeeded;
186
- * deploy targets production by default when no `--stage` is given.
187
- */
181
+ const STEP_LABELS = {
182
+ prepare: "load config and app",
183
+ assemble: "assemble services",
184
+ connect: "connect to project and branch",
185
+ preflight: "check environment variables",
186
+ apply: "plan and apply",
187
+ record: "record result"
188
+ };
189
+ function stepLabel(step) {
190
+ return step.name === "assemble-service" ? `assemble ${step.address}` : STEP_LABELS[step.name];
191
+ }
192
+ function stepId(step) {
193
+ return step.name === "assemble-service" ? `deploy.assemble.${step.address}` : `deploy.${step.name}`;
194
+ }
195
+ /** `850ms`, `12.3s`, `9m 35s`. */
196
+ function formatDuration(ms) {
197
+ if (ms < 1e3) return `${String(Math.round(ms))}ms`;
198
+ if (ms < 6e4) return `${(ms / 1e3).toFixed(1)}s`;
199
+ const seconds = Math.round(ms / 1e3);
200
+ return `${String(Math.floor(seconds / 60))}m ${String(seconds % 60)}s`;
201
+ }
202
+ /** The operation's step events as engine events. The engine prints only `step`, so a finished step carries its duration in the text too. */
203
+ function toEngineEvent(event) {
204
+ const id = stepId(event.step);
205
+ if (event.kind === "step-started") return {
206
+ kind: "step-started",
207
+ step: stepLabel(event.step),
208
+ id,
209
+ ...event.step.name === "assemble-service" ? { parentId: "deploy.assemble" } : {}
210
+ };
211
+ return {
212
+ kind: "step-finished",
213
+ step: `${stepLabel(event.step)} (${formatDuration(event.durationMs)})`,
214
+ id,
215
+ outcome: event.outcome,
216
+ data: {
217
+ ...event.data,
218
+ durationMs: event.durationMs
219
+ }
220
+ };
221
+ }
188
222
  const createDeployCommand = (operations) => defineCommand({
189
223
  help: {
190
224
  summary: "Deploy the application whose root node is <entry>'s default export.",
@@ -228,29 +262,44 @@ const createDeployCommand = (operations) => defineCommand({
228
262
  stage: args.flags.stage,
229
263
  cwd: ctx.cwd,
230
264
  reportPath: args.flags.report,
231
- reportId: args.flags.buildId
265
+ reportId: args.flags.buildId,
266
+ onEvent: (event) => ctx.report(toEngineEvent(event))
232
267
  }, operationDeps({
233
268
  alchemy,
234
269
  workspaceId: await workspaceIdOf(ctx),
235
270
  client: ctx.api
236
- })), ctx, ({ summary }) => ctx.present({ data: { summary: summary ?? null } }, {
237
- human: (ui) => summary === void 0 ? [{
238
- kind: "summary",
239
- status: "ok",
240
- text: "Deployed."
241
- }] : [{
242
- kind: "summary",
243
- status: "ok",
244
- text: `Deployed ${ui.emphasize(summary.app)}.`
245
- }, {
246
- kind: "table",
247
- columns: ["Address", "Deployed"],
248
- rows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(", ")])
249
- }],
250
- stdout: () => [],
251
- json: () => ({ summary: summary ?? null }),
252
- next: () => []
253
- }));
271
+ })), ctx, ({ summary, durationMs }) => {
272
+ const target = `to ${args.flags.stage ?? "production"} in ${formatDuration(durationMs)}`;
273
+ for (const node of summary?.nodes ?? []) for (const entity of node.entities) if (entity.url !== void 0) ctx.report({
274
+ kind: "endpoint",
275
+ name: node.address,
276
+ url: entity.url
277
+ });
278
+ return ctx.present({ data: {
279
+ summary: summary ?? null,
280
+ durationMs
281
+ } }, {
282
+ human: (ui) => summary === void 0 ? [{
283
+ kind: "summary",
284
+ status: "ok",
285
+ text: `Deployed ${target}.`
286
+ }] : [{
287
+ kind: "summary",
288
+ status: "ok",
289
+ text: `Deployed ${ui.emphasize(summary.app)} ${target}.`
290
+ }, {
291
+ kind: "table",
292
+ columns: ["Address", "Deployed"],
293
+ rows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(", ")])
294
+ }],
295
+ stdout: () => [],
296
+ json: () => ({
297
+ summary: summary ?? null,
298
+ durationMs
299
+ }),
300
+ next: () => []
301
+ });
302
+ });
254
303
  }
255
304
  });
256
305
  const STOP_STEP = "Stopping the app's services — emulators and data stay up";
@@ -1 +1 @@
1
- {"version":3,"file":"family.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/family.mjs"],"sourcesContent":["import { a as executionDiagnostics, i as deployWithDeps, n as devWithDeps } from \"./dev-Bmq-eLnv.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy-BEvB2sYQ.mjs\";\nimport { i as sectionMissing, t as checkComposerConfig } from \"./composer-config-CY9fET8H.mjs\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError, notOk, ok } from \"@prisma/cli-engine/protocol\";\n//#region src/family/translate-error.ts\n/**\n* The family boundary's error translation.\n*\n* Composer and the engine each carry a class called `CliStructuredError`, both\n* descended from the same prisma/prisma foundation, and both recognize errors\n* by duck-typing on `name === 'CliStructuredError'`. That means a composer\n* error handed to the engine untranslated is ACCEPTED — it does not fail\n* loudly, it renders. What it loses is its `fix`: composer's foundation\n* carries remediation as one prose string on that field, the engine carries it\n* as a `nextActions` list and has no `fix` at all, so the fix text is dropped\n* silently and the user is told what broke with no word on what to do about\n* it. Nothing about that failure is visible without a test that looks for the\n* fix on the other side, which is why there is one.\n*\n* Everything else on the envelope survives as-is; only remediation changes\n* representation.\n*/\n/**\n* Composer's `fix` is free prose — \"add this overrides block and reinstall\",\n* \"run the build, then retry\" — with no machine-readable command inside it.\n* `user-choice` is the engine's own kind for exactly that (it is what the\n* engine uses for its own config and prompt failures), so the text carries\n* over verbatim as one action rather than being parsed into a command the\n* author never wrote.\n*/\nfunction fixAsNextActions(fix) {\n\treturn fix === void 0 ? [] : [{\n\t\tkind: \"user-choice\",\n\t\tlabel: fix\n\t}];\n}\n/** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */\nfunction toEngineError(error) {\n\treturn new CliStructuredError(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tnextActions: fixAsNextActions(error.fix),\n\t\t...error.why === void 0 ? {} : { why: error.why },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: error.meta },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl },\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/family/converge.ts\n/** The adapter the operations call, backed by the engine's `ctx.spawn` so the\n* terminal reaches alchemy natively and the engine owns signal policy. */\nfunction convergeSpawn(ctx) {\n\treturn async (invocation) => {\n\t\tconst line = alchemyCommandLine(invocation);\n\t\treturn await ctx.spawn({\n\t\t\tcommand: line.command,\n\t\t\targs: line.args,\n\t\t\tcwd: line.cwd,\n\t\t\tenv: line.env\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\n/**\n* `deploy <entry>` — a result command that hands the terminal to alchemy.\n*\n* `--production` is gone. It was accepted and then always errored (\"only\n* valid with destroy\"), so no invocation using it could ever have succeeded;\n* deploy targets production by default when no `--stage` is given.\n*/\nconst createDeployCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} deploy module.ts\", \"{bin} deploy module.ts --stage feat-auth\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...).\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the deploy's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Deploy scope to target; omit for production.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\treport: flag.string({\n\t\t\t\tbrief: \"Write the deploy's outcome as JSON to this path — resources, preview URLs, and the failure cause. Also settable as PRISMA_COMPOSER_REPORT_FILE.\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t}),\n\t\t\tbuildId: flag.string({\n\t\t\t\tbrief: \"Join the deploy record your CI already created rather than letting the target create one. Each target also reads its own environment variable for this; the flag wins.\",\n\t\t\t\tplaceholder: \"id\"\n\t\t\t})\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.deploy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tstage: args.flags.stage,\n\t\t\tcwd: ctx.cwd,\n\t\t\treportPath: args.flags.report,\n\t\t\treportId: args.flags.buildId\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, ({ summary }) => ctx.present({ data: { summary: summary ?? null } }, {\n\t\t\thuman: (ui) => summary === void 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Deployed.\"\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `Deployed ${ui.emphasize(summary.app)}.`\n\t\t\t}, {\n\t\t\t\tkind: \"table\",\n\t\t\t\tcolumns: [\"Address\", \"Deployed\"],\n\t\t\t\trows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(\", \")])\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => ({ summary: summary ?? null }),\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/commands/dev.ts\nconst STOP_STEP = \"Stopping the app's services — emulators and data stay up\";\n/** Resolves when the run is asked to stop. */\nfunction stopRequested(signal) {\n\tif (signal.aborted) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* One converge at a time. `ctx.spawn` refuses a second live child, and the\n* watch loop can well fire a rebuild while the previous converge is still\n* running — so a request that arrives during a live converge joins the single\n* queued follow-up instead of starting its own. That extends the coalescing\n* the watcher already does across a burst of edits to cover the converge\n* itself, and it is sound because every dev converge is the SAME invocation:\n* one stack file at one fixed path, rewritten in place before each request.\n*/\nfunction coalescedConverge(run) {\n\tlet live;\n\tlet queued;\n\tconst start = (invocation) => {\n\t\tconst outcome = run(invocation);\n\t\tconst settled = outcome.then(() => void 0, () => void 0);\n\t\tlive = settled;\n\t\tsettled.then(() => {\n\t\t\tif (live === settled) live = void 0;\n\t\t});\n\t\treturn outcome;\n\t};\n\treturn (invocation) => {\n\t\tconst running = live;\n\t\tif (running === void 0) return start(invocation);\n\t\tqueued ??= running.then(() => {\n\t\t\tqueued = void 0;\n\t\t\treturn start(invocation);\n\t\t});\n\t\treturn queued;\n\t};\n}\n/** The front door, ordered by address depth (fewest dots first) then lexicographically. */\nfunction frontDoorOrder(endpoints) {\n\treturn [...endpoints].sort((a, b) => {\n\t\tconst depth = a.address.split(\".\").length - b.address.split(\".\").length;\n\t\tif (depth !== 0) return depth;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t});\n}\n/**\n* The operation's events as engine events. The legacy `[dev]` console prefix\n* is gone: these are commentary the engine renders and frames.\n*/\nfunction reportDevEvent(report, lastChild) {\n\tlet stopFailed = false;\n\treturn (event) => {\n\t\tswitch (event.kind) {\n\t\t\tcase \"ready\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"status\",\n\t\t\t\t\tsubject: \"dev\",\n\t\t\t\t\tstatus: \"ready\"\n\t\t\t\t});\n\t\t\t\tfor (const endpoint of frontDoorOrder(event.endpoints)) report({\n\t\t\t\t\tkind: \"endpoint\",\n\t\t\t\t\tname: endpoint.address,\n\t\t\t\t\turl: endpoint.url\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"unwatchable\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.address} has no watchable inputs.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"rebuild-failed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Rebuild failed: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"config-changed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.file} changed. Restart dev to apply it; rebuilds are paused until then.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"watch-error\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Watch error: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"converge-failed\": {\n\t\t\t\tconst child = lastChild();\n\t\t\t\tif (child !== void 0 && child.signal !== null) return;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Converge failed — the running app is untouched; still watching.\nGenerated stack file: ${event.stackFilePath}\\nRun \\`${event.reproduceCommand}\\` from ${event.cwd} to reproduce this directly.`\n\t\t\t\t});\n\t\t\t\treport({\n\t\t\t\t\tkind: \"remediation\",\n\t\t\t\t\taction: {\n\t\t\t\t\t\tkind: \"run-command\",\n\t\t\t\t\t\tlabel: `Run the converge directly from ${event.cwd} to reproduce this`,\n\t\t\t\t\t\tcommand: event.reproduceCommand,\n\t\t\t\t\t\treason: `Generated stack file: ${event.stackFilePath}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"stopping\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-started\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stop-error\":\n\t\t\t\tstopFailed = true;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `A service refused to stop: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stopped\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\",\n\t\t\t\t\toutcome: stopFailed ? \"warning\" : \"ok\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t}\n\t};\n}\nconst createDevCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit.\",\n\t\texamples: [\"{bin} dev module.ts\", \"{bin} dev module.ts --fresh\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...).\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tfresh: flag.boolean({ brief: \"Destroy the dev stack and wipe the dev state directory before starting.\" })\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\tconst result = await operations.dev({\n\t\t\tentry: args.positionals.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tfresh: args.flags.fresh,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: reportDevEvent(ctx.report, ctx.lastChild)\n\t\t}, { alchemy: coalescedConverge(alchemy) });\n\t\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\t\tawait stopRequested(ctx.signal);\n\t\tawait result.value.stop();\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/family.ts\n/**\n* Composer's `CommandFamily`: the unit the `prisma` bin mounts.\n*\n* This module and everything it reaches statically must stay free of alchemy\n* and of effect VALUE imports: the `prisma` bin imports the family directly,\n* so anything in this static graph loads on `prisma --version`. The mechanism\n* that holds it is the existing lazy boundary inside the operation modules —\n* `operations/deploy.ts` and `dev.ts` each `await import()` their executor,\n* and it is the executors that reach the provider tree. Importing the operations here is therefore free; importing an\n* executor, or flattening one of those dynamic imports, is not.\n* scripts/check-family-static-graph.mjs enforces this against BUILT output,\n* where type-only imports have already been erased.\n*\n* The commands close over the operations they are given, so a host can\n* mount this family against the test double and exercise real grammar, real\n* arg validation and real handlers with no alchemy behind them.\n*\n* The family ships `deploy` and `dev` only. `destroy` and `log` are\n* programmatic operations in `@prisma/composer/control`, not commands.\n*/\nconst realOperations = {\n\tdeploy: deployWithDeps,\n\tdev: devWithDeps\n};\n/** The `prisma` CLI's error reference; the engine appends `/<CODE>` to it for every error envelope. */\nconst CLI_DOCS_BASE = \"https://www.prisma.io/docs/cli/error-reference/\";\nfunction createComposerFamily(options = {}) {\n\tconst operations = options.operations ?? realOperations;\n\treturn defineCommandFamily({\n\t\tconfigSection: composerSection,\n\t\tcommands: {\n\t\t\tdeploy: createDeployCommand(operations),\n\t\t\tdev: createDevCommand(operations)\n\t\t},\n\t\tdocsBaseUrl: CLI_DOCS_BASE\n\t});\n}\n//#endregion\nexport { composerSection, createComposerFamily, realOperations, toEngineError };\n\n//# sourceMappingURL=family.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,iBAAiB,KAAK;CAC9B,OAAO,QAAQ,KAAK,IAAI,CAAC,IAAI,CAAC;EAC7B,MAAM;EACN,OAAO;CACR,CAAC;AACF;;AAEA,SAAS,cAAc,OAAO;CAC7B,OAAO,IAAI,mBAAmB,MAAM,MAAM,MAAM,SAAS;EACxD,UAAU,MAAM;EAChB,aAAa,iBAAiB,MAAM,GAAG;EACvC,GAAG,MAAM,QAAQ,KAAK,IAAI,CAAC,IAAI,EA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AAM,KAAK,OAAO;IACjB,OAAO;IACP,aAAa;GACd,CAAC;GACD,OAAO,KAAK,QAAQ,EAAE,OAAO,0EAA0E,CAAC;EACzG;CACD;CACA,OAAO,EAAE,QAAQ,gBAAgB;CACjC,UAAU;CACV,SAAS,OAAO,MAAM,QAAQ;EAC7B,MAAM,UAAU,cAAc,GAAG;EACjC,MAAM,SAAS,MAAM,WAAW,IAAI;GACnC,OAAO,KAAK,YAAY;GACxB,QAAQ,IAAI;GACZ,MAAM,KAAK,MAAM;GACjB,OAAO,KAAK,MAAM;GAClB,KAAK,IAAI;GACT,SAAS,eAAe,IAAI,QAAQ,IAAI,SAAS;EAClD,GAAG,EAAE,SAAS,kBAAkB,OAAO,EAAE,CAAC;EAC1C,IAAI,CAAC,OAAO,IAAI,OAAO,sBAAsB,OAAO,SAAS,GAAG;EAChE,MAAM,cAAc,IAAI,MAAM;EAC9B,MAAM,OAAO,MAAM,KAAK;EACxB,OAAO,GAAG,KAAK,CAAC;CACjB;AACD,CAAC;;;;;;;;;;;;;;;;;;;;;AAuBD,MAAM,iBAAiB;CACtB,QAAQ;CACR,KAAK;AACN;;AAEA,MAAM,gBAAgB;AACtB,SAAS,qBAAqB,UAAU,CAAC,GAAG;CAC3C,MAAM,aAAa,QAAQ,cAAc;CACzC,OAAO,oBAAoB;EAC1B,eAAe;EACf,UAAU;GACT,QAAQ,oBAAoB,UAAU;GACtC,KAAK,iBAAiB,UAAU;EACjC;EACA,aAAa;CACd,CAAC;AACF"}
1
+ {"version":3,"file":"family.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/family.mjs"],"sourcesContent":["import { a as executionDiagnostics, i as deployWithDeps, n as devWithDeps } from \"./dev-D5mgw4vL.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy-BEvB2sYQ.mjs\";\nimport { i as sectionMissing, t as checkComposerConfig } from \"./composer-config-CY9fET8H.mjs\";\nimport { defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError, notOk, ok } from \"@prisma/cli-engine/protocol\";\n//#region src/family/translate-error.ts\n/**\n* The family boundary's error translation.\n*\n* Composer and the engine each carry a class called `CliStructuredError`, both\n* descended from the same prisma/prisma foundation, and both recognize errors\n* by duck-typing on `name === 'CliStructuredError'`. That means a composer\n* error handed to the engine untranslated is ACCEPTED — it does not fail\n* loudly, it renders. What it loses is its `fix`: composer's foundation\n* carries remediation as one prose string on that field, the engine carries it\n* as a `nextActions` list and has no `fix` at all, so the fix text is dropped\n* silently and the user is told what broke with no word on what to do about\n* it. Nothing about that failure is visible without a test that looks for the\n* fix on the other side, which is why there is one.\n*\n* Everything else on the envelope survives as-is; only remediation changes\n* representation.\n*/\n/**\n* Composer's `fix` is free prose — \"add this overrides block and reinstall\",\n* \"run the build, then retry\" — with no machine-readable command inside it.\n* `user-choice` is the engine's own kind for exactly that (it is what the\n* engine uses for its own config and prompt failures), so the text carries\n* over verbatim as one action rather than being parsed into a command the\n* author never wrote.\n*/\nfunction fixAsNextActions(fix) {\n\treturn fix === void 0 ? [] : [{\n\t\tkind: \"user-choice\",\n\t\tlabel: fix\n\t}];\n}\n/** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */\nfunction toEngineError(error) {\n\treturn new CliStructuredError(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tnextActions: fixAsNextActions(error.fix),\n\t\t...error.why === void 0 ? {} : { why: error.why },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: error.meta },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl },\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/family/converge.ts\n/** The adapter the operations call, backed by the engine's `ctx.spawn` so the\n* terminal reaches alchemy natively and the engine owns signal policy. */\nfunction convergeSpawn(ctx) {\n\treturn async (invocation) => {\n\t\tconst line = alchemyCommandLine(invocation);\n\t\treturn await ctx.spawn({\n\t\t\tcommand: line.command,\n\t\t\targs: line.args,\n\t\t\tcwd: line.cwd,\n\t\t\tenv: line.env\n\t\t});\n\t};\n}\n/** The in-process leg's deps: composer's existing seam, carrying the engine's\n* own client and workspace id rather than anything read from the env. */\nfunction operationDeps(spec) {\n\treturn {\n\t\talchemy: spec.alchemy,\n\t\tcredentials: {\n\t\t\tworkspaceId: spec.workspaceId,\n\t\t\tclient: spec.client\n\t\t}\n\t};\n}\n/**\n* The reproduce hint a failed converge carries. Deliberately absent for an\n* aborted one: the user stopped it, so there is nothing to reproduce.\n*/\nfunction reproduceHint(failure) {\n\tconst diagnostics = executionDiagnostics(failure);\n\tif (diagnostics === void 0) return [];\n\treturn [{\n\t\tkind: \"run-command\",\n\t\tlabel: `Run the converge directly from ${diagnostics.cwd} to reproduce this`,\n\t\tcommand: diagnostics.reproduceCommand,\n\t\treason: `Generated stack file: ${diagnostics.stackFilePath}`\n\t}];\n}\n/**\n* How a FAILED converge settles. `deploy` and `dev` both end this\n* way and must not drift apart, so the decision lives here once rather than\n* inline in each handler.\n*\n* A failure that reached the child exits with the child's status verbatim and\n* carries the reproduce hint; a failure that never reached the child is an\n* ordinary structured error and gets the normal envelope. Nothing here reads\n* `signal` — see settleConverge.\n*/\nfunction settleConvergeFailure(failure, ctx) {\n\tconst child = ctx.lastChild();\n\tif (child !== void 0 && child.exitCode !== 0) return ok(exitWithChildStatus({ nextActions: reproduceHint(failure) }));\n\treturn notOk(toEngineError(failure));\n}\n/**\n* How a converge settles, now that the engine owns the child's status.\n*\n* Nothing here reads `signal`. `exitWithChildStatus` settles from the engine's\n* own record of the child, and a signal-killed one overrules whatever this\n* function asked for: 128 + the signal, no failure envelope, and the reproduce\n* hint dropped, because the user stopped the run and there is nothing to\n* reproduce.\n*\n* What is left is the operation's own verdict. A failure that reached the\n* child exits with the child's status verbatim and carries the reproduce hint;\n* a failure that never reached the child is an ordinary structured error and\n* gets the normal envelope.\n*\n* A SUCCESS presents its result even when the child was signal-killed. No\n* composer operation produces that pair today — each one reports a\n* signal-killed converge as a failure — and an operation that ever did would\n* have a real result worth showing. The run still exits 130, because the\n* engine settles a signal-terminated run from its own record of the signal\n* whatever the handler returns.\n*/\nfunction settleConverge(result, ctx, present) {\n\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\treturn ok(present(result.value));\n}\n//#endregion\n//#region src/family/section.ts\nfunction diagnostic(finding, file) {\n\tconst where = finding.where ?? file;\n\treturn {\n\t\tcode: finding.code,\n\t\tseverity: \"error\",\n\t\tsummary: finding.summary,\n\t\t...finding.why === void 0 ? {} : { why: finding.why },\n\t\tnextActions: [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: finding.fix\n\t\t}],\n\t\t...where === void 0 ? {} : { where: { path: where } },\n\t\t...finding.field === void 0 ? {} : { meta: { field: finding.field } }\n\t};\n}\nfunction refuse(findings, file) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostics: findings.map((finding) => diagnostic(finding, file))\n\t};\n}\nfunction validate(raw, provenance) {\n\tconst file = provenance.files[0];\n\tif (raw === void 0 || file === void 0) return refuse([sectionMissing], void 0);\n\tconst checked = checkComposerConfig(raw, file);\n\tif (!checked.ok) return refuse(checked.findings, file);\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tvalue: checked.value,\n\t\t\tfile\n\t\t},\n\t\tdiagnostics: []\n\t};\n}\nconst composerSection = defineConfigSection({\n\tname: \"composer\",\n\tvalidate,\n\tmerge: (_parent, child) => child\n});\n//#endregion\n//#region src/family/workspace.ts\n/**\n* The workspace the in-process leg acts in, from the engine's credential\n* read. Handlers never decode a token and never read PRISMA_WORKSPACE_ID:\n* whether the credential came from a stored session or the environment, the\n* engine has already resolved it, and branching on where it came from is a\n* defect by the credential-manager design.\n*\n* Undefined when the active credential names no workspace — an environment\n* token whose claims carry none. The container descriptors raise their own\n* \"workspace required\" error in that case, which is the error the user needs.\n*/\nasync function workspaceIdOf(ctx) {\n\treturn (await ctx.activeCredential())?.workspaceId;\n}\n//#endregion\n//#region src/family/commands/deploy.ts\nconst STEP_LABELS = {\n\tprepare: \"load config and app\",\n\tassemble: \"assemble services\",\n\tconnect: \"connect to project and branch\",\n\tpreflight: \"check environment variables\",\n\tapply: \"plan and apply\",\n\trecord: \"record result\"\n};\nfunction stepLabel(step) {\n\treturn step.name === \"assemble-service\" ? `assemble ${step.address}` : STEP_LABELS[step.name];\n}\nfunction stepId(step) {\n\treturn step.name === \"assemble-service\" ? `deploy.assemble.${step.address}` : `deploy.${step.name}`;\n}\n/** `850ms`, `12.3s`, `9m 35s`. */\nfunction formatDuration(ms) {\n\tif (ms < 1e3) return `${String(Math.round(ms))}ms`;\n\tif (ms < 6e4) return `${(ms / 1e3).toFixed(1)}s`;\n\tconst seconds = Math.round(ms / 1e3);\n\treturn `${String(Math.floor(seconds / 60))}m ${String(seconds % 60)}s`;\n}\n/** The operation's step events as engine events. The engine prints only `step`, so a finished step carries its duration in the text too. */\nfunction toEngineEvent(event) {\n\tconst id = stepId(event.step);\n\tif (event.kind === \"step-started\") return {\n\t\tkind: \"step-started\",\n\t\tstep: stepLabel(event.step),\n\t\tid,\n\t\t...event.step.name === \"assemble-service\" ? { parentId: \"deploy.assemble\" } : {}\n\t};\n\treturn {\n\t\tkind: \"step-finished\",\n\t\tstep: `${stepLabel(event.step)} (${formatDuration(event.durationMs)})`,\n\t\tid,\n\t\toutcome: event.outcome,\n\t\tdata: {\n\t\t\t...event.data,\n\t\t\tdurationMs: event.durationMs\n\t\t}\n\t};\n}\nconst createDeployCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} deploy module.ts\", \"{bin} deploy module.ts --stage feat-auth\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...).\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the deploy's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Deploy scope to target; omit for production.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\treport: flag.string({\n\t\t\t\tbrief: \"Write the deploy's outcome as JSON to this path — resources, preview URLs, and the failure cause. Also settable as PRISMA_COMPOSER_REPORT_FILE.\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t}),\n\t\t\tbuildId: flag.string({\n\t\t\t\tbrief: \"Join the deploy record your CI already created rather than letting the target create one. Each target also reads its own environment variable for this; the flag wins.\",\n\t\t\t\tplaceholder: \"id\"\n\t\t\t})\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.deploy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tstage: args.flags.stage,\n\t\t\tcwd: ctx.cwd,\n\t\t\treportPath: args.flags.report,\n\t\t\treportId: args.flags.buildId,\n\t\t\tonEvent: (event) => ctx.report(toEngineEvent(event))\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, ({ summary, durationMs }) => {\n\t\t\tconst target = `to ${args.flags.stage ?? \"production\"} in ${formatDuration(durationMs)}`;\n\t\t\tfor (const node of summary?.nodes ?? []) for (const entity of node.entities) if (entity.url !== void 0) ctx.report({\n\t\t\t\tkind: \"endpoint\",\n\t\t\t\tname: node.address,\n\t\t\t\turl: entity.url\n\t\t\t});\n\t\t\treturn ctx.present({ data: {\n\t\t\t\tsummary: summary ?? null,\n\t\t\t\tdurationMs\n\t\t\t} }, {\n\t\t\t\thuman: (ui) => summary === void 0 ? [{\n\t\t\t\t\tkind: \"summary\",\n\t\t\t\t\tstatus: \"ok\",\n\t\t\t\t\ttext: `Deployed ${target}.`\n\t\t\t\t}] : [{\n\t\t\t\t\tkind: \"summary\",\n\t\t\t\t\tstatus: \"ok\",\n\t\t\t\t\ttext: `Deployed ${ui.emphasize(summary.app)} ${target}.`\n\t\t\t\t}, {\n\t\t\t\t\tkind: \"table\",\n\t\t\t\t\tcolumns: [\"Address\", \"Deployed\"],\n\t\t\t\t\trows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(\", \")])\n\t\t\t\t}],\n\t\t\t\tstdout: () => [],\n\t\t\t\tjson: () => ({\n\t\t\t\t\tsummary: summary ?? null,\n\t\t\t\t\tdurationMs\n\t\t\t\t}),\n\t\t\t\tnext: () => []\n\t\t\t});\n\t\t});\n\t}\n});\n//#endregion\n//#region src/family/commands/dev.ts\nconst STOP_STEP = \"Stopping the app's services — emulators and data stay up\";\n/** Resolves when the run is asked to stop. */\nfunction stopRequested(signal) {\n\tif (signal.aborted) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* One converge at a time. `ctx.spawn` refuses a second live child, and the\n* watch loop can well fire a rebuild while the previous converge is still\n* running — so a request that arrives during a live converge joins the single\n* queued follow-up instead of starting its own. That extends the coalescing\n* the watcher already does across a burst of edits to cover the converge\n* itself, and it is sound because every dev converge is the SAME invocation:\n* one stack file at one fixed path, rewritten in place before each request.\n*/\nfunction coalescedConverge(run) {\n\tlet live;\n\tlet queued;\n\tconst start = (invocation) => {\n\t\tconst outcome = run(invocation);\n\t\tconst settled = outcome.then(() => void 0, () => void 0);\n\t\tlive = settled;\n\t\tsettled.then(() => {\n\t\t\tif (live === settled) live = void 0;\n\t\t});\n\t\treturn outcome;\n\t};\n\treturn (invocation) => {\n\t\tconst running = live;\n\t\tif (running === void 0) return start(invocation);\n\t\tqueued ??= running.then(() => {\n\t\t\tqueued = void 0;\n\t\t\treturn start(invocation);\n\t\t});\n\t\treturn queued;\n\t};\n}\n/** The front door, ordered by address depth (fewest dots first) then lexicographically. */\nfunction frontDoorOrder(endpoints) {\n\treturn [...endpoints].sort((a, b) => {\n\t\tconst depth = a.address.split(\".\").length - b.address.split(\".\").length;\n\t\tif (depth !== 0) return depth;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t});\n}\n/**\n* The operation's events as engine events. The legacy `[dev]` console prefix\n* is gone: these are commentary the engine renders and frames.\n*/\nfunction reportDevEvent(report, lastChild) {\n\tlet stopFailed = false;\n\treturn (event) => {\n\t\tswitch (event.kind) {\n\t\t\tcase \"ready\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"status\",\n\t\t\t\t\tsubject: \"dev\",\n\t\t\t\t\tstatus: \"ready\"\n\t\t\t\t});\n\t\t\t\tfor (const endpoint of frontDoorOrder(event.endpoints)) report({\n\t\t\t\t\tkind: \"endpoint\",\n\t\t\t\t\tname: endpoint.address,\n\t\t\t\t\turl: endpoint.url\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"unwatchable\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.address} has no watchable inputs.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"rebuild-failed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Rebuild failed: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"config-changed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.file} changed. Restart dev to apply it; rebuilds are paused until then.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"watch-error\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Watch error: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"converge-failed\": {\n\t\t\t\tconst child = lastChild();\n\t\t\t\tif (child !== void 0 && child.signal !== null) return;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Converge failed — the running app is untouched; still watching.\nGenerated stack file: ${event.stackFilePath}\\nRun \\`${event.reproduceCommand}\\` from ${event.cwd} to reproduce this directly.`\n\t\t\t\t});\n\t\t\t\treport({\n\t\t\t\t\tkind: \"remediation\",\n\t\t\t\t\taction: {\n\t\t\t\t\t\tkind: \"run-command\",\n\t\t\t\t\t\tlabel: `Run the converge directly from ${event.cwd} to reproduce this`,\n\t\t\t\t\t\tcommand: event.reproduceCommand,\n\t\t\t\t\t\treason: `Generated stack file: ${event.stackFilePath}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"stopping\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-started\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stop-error\":\n\t\t\t\tstopFailed = true;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `A service refused to stop: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stopped\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\",\n\t\t\t\t\toutcome: stopFailed ? \"warning\" : \"ok\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t}\n\t};\n}\nconst createDevCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit.\",\n\t\texamples: [\"{bin} dev module.ts\", \"{bin} dev module.ts --fresh\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The file whose default export is the application root module, built with module(...).\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tfresh: flag.boolean({ brief: \"Destroy the dev stack and wipe the dev state directory before starting.\" })\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\tconst result = await operations.dev({\n\t\t\tentry: args.positionals.entry,\n\t\t\tconfig: ctx.config,\n\t\t\tname: args.flags.name,\n\t\t\tfresh: args.flags.fresh,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: reportDevEvent(ctx.report, ctx.lastChild)\n\t\t}, { alchemy: coalescedConverge(alchemy) });\n\t\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\t\tawait stopRequested(ctx.signal);\n\t\tawait result.value.stop();\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/family.ts\n/**\n* Composer's `CommandFamily`: the unit the `prisma` bin mounts.\n*\n* This module and everything it reaches statically must stay free of alchemy\n* and of effect VALUE imports: the `prisma` bin imports the family directly,\n* so anything in this static graph loads on `prisma --version`. The mechanism\n* that holds it is the existing lazy boundary inside the operation modules —\n* `operations/deploy.ts` and `dev.ts` each `await import()` their executor,\n* and it is the executors that reach the provider tree. Importing the operations here is therefore free; importing an\n* executor, or flattening one of those dynamic imports, is not.\n* scripts/check-family-static-graph.mjs enforces this against BUILT output,\n* where type-only imports have already been erased.\n*\n* The commands close over the operations they are given, so a host can\n* mount this family against the test double and exercise real grammar, real\n* arg validation and real handlers with no alchemy behind them.\n*\n* The family ships `deploy` and `dev` only. `destroy` and `log` are\n* programmatic operations in `@prisma/composer/control`, not commands.\n*/\nconst realOperations = {\n\tdeploy: deployWithDeps,\n\tdev: devWithDeps\n};\n/** The `prisma` CLI's error reference; the engine appends `/<CODE>` to it for every error envelope. */\nconst CLI_DOCS_BASE = \"https://www.prisma.io/docs/cli/error-reference/\";\nfunction createComposerFamily(options = {}) {\n\tconst operations = options.operations ?? realOperations;\n\treturn defineCommandFamily({\n\t\tconfigSection: composerSection,\n\t\tcommands: {\n\t\t\tdeploy: createDeployCommand(operations),\n\t\t\tdev: createDevCommand(operations)\n\t\t},\n\t\tdocsBaseUrl: CLI_DOCS_BASE\n\t});\n}\n//#endregion\nexport { composerSection, createComposerFamily, realOperations, toEngineError };\n\n//# sourceMappingURL=family.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,iBAAiB,KAAK;CAC9B,OAAO,QAAQ,KAAK,IAAI,CAAC,IAAI,CAAC;EAC7B,MAAM;EACN,OAAO;CACR,CAAC;AACF;;AAEA,SAAS,cAAc,OAAO;CAC7B,OAAO,IAAI,mBAAmB,MAAM,MAAM,MAAM,SAAS;EACxD,UAAU,MAAM;EAChB,aAAa,iBAAiB,MAAM,GAAG;EACvC,GAAG,MAAM,QAAQ,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,MAAM,IAAI;EAChD,GAAG,MAAM,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO,MAAM,MAAM;EACtD,GAAG,MAAM,SAAS,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,MAAM,KAAK;EACnD,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,QAAQ;EAC5D,OAAO;CACR,CAAC;AACF;;;AAKA,SAAS,cAAc,KAAK;CAC3B,OAAO,OAAO,eAAe;EAC5B,MAA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SAAS,MAAM,WAAW,IAAI;GACnC,OAAO,KAAK,YAAY;GACxB,QAAQ,IAAI;GACZ,MAAM,KAAK,MAAM;GACjB,OAAO,KAAK,MAAM;GAClB,KAAK,IAAI;GACT,SAAS,eAAe,IAAI,QAAQ,IAAI,SAAS;EAClD,GAAG,EAAE,SAAS,kBAAkB,OAAO,EAAE,CAAC;EAC1C,IAAI,CAAC,OAAO,IAAI,OAAO,sBAAsB,OAAO,SAAS,GAAG;EAChE,MAAM,cAAc,IAAI,MAAM;EAC9B,MAAM,OAAO,MAAM,KAAK;EACxB,OAAO,GAAG,KAAK,CAAC;CACjB;AACD,CAAC;;;;;;;;;;;;;;;;;;;;;AAuBD,MAAM,iBAAiB;CACtB,QAAQ;CACR,KAAK;AACN;;AAEA,MAAM,gBAAgB;AACtB,SAAS,qBAAqB,UAAU,CAAC,GAAG;CAC3C,MAAM,aAAa,QAAQ,cAAc;CACzC,OAAO,oBAAoB;EAC1B,eAAe;EACf,UAAU;GACT,QAAQ,oBAAoB,UAAU;GACtC,KAAK,iBAAiB,UAAU;EACjC;EACA,aAAa;CACd,CAAC;AACF"}
@@ -1,8 +1,8 @@
1
- import { a as CliStructuredError, o as notOk, u as blindCast } from "./composer-config-CY9fET8H-KpGjlYgO.mjs";
1
+ import { a as CliStructuredError, o as notOk, s as ok, u as blindCast } from "./composer-config-CY9fET8H-KpGjlYgO.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import * as path from "node:path";
4
4
  import spawn from "cross-spawn";
5
- //#region ../../0-framework/3-tooling/cli/dist/dev-Bmq-eLnv.mjs
5
+ //#region ../../0-framework/3-tooling/cli/dist/dev-D5mgw4vL.mjs
6
6
  /**
7
7
  * Reads the execution diagnostics an engine-failure error carries in
8
8
  * `meta.diagnostics`; undefined for every other failure.
@@ -34,14 +34,20 @@ function executorLoadFailure(operation, error) {
34
34
  * commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors
35
35
  * internal types and is not part of the published surface. */
36
36
  async function deployWithDeps(input, deps) {
37
+ const startedAt = performance.now();
37
38
  const cwd = input.cwd ?? process.cwd();
38
39
  let executor;
39
40
  try {
40
- executor = await import("./execute-deploy-destroy-c0eko3AO-9npuGXd3.mjs");
41
+ executor = await import("./execute-deploy-destroy-1Nn5Pz26-BqJhnlfK.mjs");
41
42
  } catch (error) {
42
43
  return notOk(executorLoadFailure("deploy", error));
43
44
  }
44
- return executor.executeDeploy(input, deps, cwd);
45
+ const result = await executor.executeDeploy(input, deps, cwd);
46
+ if (!result.ok) return result;
47
+ return ok({
48
+ ...result.value,
49
+ durationMs: Math.round(performance.now() - startedAt)
50
+ });
45
51
  }
46
52
  /** In-package variant threading the injection seam, which the family's
47
53
  * commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors
@@ -50,7 +56,7 @@ async function devWithDeps(input, deps) {
50
56
  const cwd = input.cwd ?? process.cwd();
51
57
  let executor;
52
58
  try {
53
- executor = await import("./execute-dev-BICPaq1g-CSoZJuhB.mjs");
59
+ executor = await import("./execute-dev-BnKUgJhb-DdzpvOhU.mjs");
54
60
  } catch (error) {
55
61
  return notOk(executorLoadFailure("dev", error));
56
62
  }
@@ -151,4 +157,4 @@ const spawnAlchemy = async (invocation) => {
151
157
  //#endregion
152
158
  export { devWithDeps as a, deployWithDeps as i, alchemyInvocation as n, executionDiagnostics as o, spawnAlchemy as r, toStructured as s, alchemyCommandLine as t };
153
159
 
154
- //# sourceMappingURL=run-alchemy-BEvB2sYQ-BgV2deuO.mjs.map
160
+ //# sourceMappingURL=run-alchemy-BEvB2sYQ-BePRE5k2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-alchemy-BEvB2sYQ-BePRE5k2.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-D5mgw4vL.mjs","../../../0-framework/3-tooling/cli/dist/run-alchemy-BEvB2sYQ.mjs"],"sourcesContent":["import { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-1Nn5Pz26.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-BnKUgJhb.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\nexport { executionDiagnostics as a, deployWithDeps as i, devWithDeps as n, executorLoadFailure as o, deploy as r, toStructured as s, dev as t };\n\n//# sourceMappingURL=dev-D5mgw4vL.mjs.map","import * as fs from \"node:fs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\nimport spawn from \"cross-spawn\";\n//#region src/run-alchemy.ts\n/**\n* Pipeline step 7 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): hand the terminal to the generated stack file.\n*\n* Resolves the installed `alchemy` bin and launches package-manager shims with\n* cross-spawn.\n*\n* This module composes the invocation; it does not decide how the child is\n* started. Under the CLI the engine starts it (`ctx.spawn`), which is what\n* makes Ctrl-C reach the child natively and keeps signal policy in one place.\n* `spawnAlchemy` is the default for programmatic hosts driving\n* `@prisma/composer/control`, which have no engine to borrow.\n*/\n/** Walks up from `startDir` looking for the installed Alchemy executable. */\nfunction resolveAlchemyBin(startDir) {\n\tconst names = process.platform === \"win32\" ? [\n\t\t\"alchemy.exe\",\n\t\t\"alchemy.cmd\",\n\t\t\"alchemy\"\n\t] : [\"alchemy\"];\n\tlet dir = startDir;\n\twhile (true) {\n\t\tfor (const name of names) {\n\t\t\tconst candidate = path.join(dir, \"node_modules\", \".bin\", name);\n\t\t\tif (fs.existsSync(candidate)) return candidate;\n\t\t}\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) throw new CliStructuredError(\"DEPLOY.ALCHEMY_BIN_MISSING\", `Could not find an installed \\`alchemy\\` bin above \"${startDir}\".`, { fix: \"Add \\\"alchemy\\\" as a dependency of your app.\" });\n\t\tdir = parent;\n\t}\n}\n/**\n* Resolves the invocation against this machine — the step every adapter takes\n* and no caller should. Raises DEPLOY.ALCHEMY_BIN_MISSING when the app has no\n* alchemy installed.\n*/\nfunction alchemyCommandLine(invocation) {\n\treturn {\n\t\tcommand: resolveAlchemyBin(invocation.cwd),\n\t\targs: [\n\t\t\tinvocation.action,\n\t\t\tinvocation.stackFileRelativePath,\n\t\t\t\"--yes\",\n\t\t\t\"--stage\",\n\t\t\tinvocation.stage\n\t\t],\n\t\tcwd: invocation.cwd,\n\t\tenv: invocation.env\n\t};\n}\n/** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */\nfunction alchemyInvocation(input) {\n\treturn {\n\t\taction: input.command,\n\t\tstackFileRelativePath: input.stackFileRelativePath,\n\t\tcwd: input.cwd,\n\t\tstage: input.stage,\n\t\tenv: {\n\t\t\t...input.containerEnv,\n\t\t\t...input.preflightEnv,\n\t\t\t...input.env\n\t\t}\n\t};\n}\n/**\n* The default runner for hosts with no engine: inherited stdio, the caller's\n* own process group, and the child's status returned verbatim. It does not\n* collapse a signal into an exit code — that collapse is what made a\n* Ctrl-C'd deploy report itself as a failure.\n*/\nconst spawnAlchemy = async (invocation) => {\n\tconst line = alchemyCommandLine(invocation);\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(line.command, [...line.args], {\n\t\t\tcwd: line.cwd,\n\t\t\tstdio: \"inherit\",\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\t...line.env\n\t\t\t}\n\t\t});\n\t\tchild.on(\"error\", reject);\n\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\tresolve({\n\t\t\t\texitCode,\n\t\t\t\tsignal\n\t\t\t});\n\t\t});\n\t});\n};\n//#endregion\nexport { alchemyInvocation as n, spawnAlchemy as r, alchemyCommandLine as t };\n\n//# sourceMappingURL=run-alchemy-BEvB2sYQ.mjs.map"],"mappings":";;;;;;;;;AAQA,SAAS,qBAAqB,GAAG;CAChC,MAAM,cAAc,EAAE,OAAO;CAC7B,IAAI,OAAO,gBAAgB,YAAY,gBAAgB,MAAM,OAAO,KAAK;CACzE,MAAM,YAAY,UAAU,WAAW;CACvC,IAAI,UAAU,gBAAgB,KAAK,KAAK,OAAO,UAAU,gBAAgB,YAAY,UAAU,cAAc,KAAK,KAAK,OAAO,UAAU,cAAc,YAAY,OAAO,UAAU,qBAAqB,YAAY,OAAO,UAAU,wBAAwB,YAAY,OAAO,UAAU,WAAW,UAAU;CAC/S,OAAO,UAAU,WAAW;AAC7B;;;;;AAKA,SAAS,aAAa,MAAM,OAAO;CAClC,OAAO,mBAAmB,GAAG,KAAK,IAAI,QAAQ,IAAI,mBAAmB,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,EAAE,OAAO,MAAM,CAAC;AACpJ;;;AAGA,SAAS,oBAAoB,WAAW,OAAO;CAC9C,OAAO,IAAI,mBAAmB,4BAA4B,sBAAsB,UAAU,aAAa,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,KAAK;EAChK,KAAK,OAAO,UAAU;EACtB,KAAK;EACL,OAAO;CACR,CAAC;AACF;;;;AASA,eAAe,eAAe,OAAO,MAAM;CAC1C,MAAM,YAAY,YAAY,IAAI;CAClC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,UAAU,KAAK,CAAC;CA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T,GAAG,MAAM;EACV;CACD;AACD;;;;;;;AAOA,MAAM,eAAe,OAAO,eAAe;CAC1C,MAAM,OAAO,mBAAmB,UAAU;CAC1C,OAAO,IAAI,SAAS,SAAS,WAAW;EACvC,MAAM,QAAQ,MAAM,KAAK,SAAS,CAAC,GAAG,KAAK,IAAI,GAAG;GACjD,KAAK,KAAK;GACV,OAAO;GACP,KAAK;IACJ,GAAG,QAAQ;IACX,GAAG,KAAK;GACT;EACD,CAAC;EACD,MAAM,GAAG,SAAS,MAAM;EACxB,MAAM,GAAG,UAAU,UAAU,WAAW;GACvC,QAAQ;IACP;IACA;GACD,CAAC;EACF,CAAC;CACF,CAAC;AACF"}
@@ -1,4 +1,4 @@
1
- import { c as DevInput, d as ServiceEndpoint, f as AssembledServices, l as DevSession, m as CliStructuredError, o as DeployInput, p as Result, s as DeploySuccess, t as ComposerOperations, u as OperationDeps } from "./family-CgeZQdNg-gH8LuqqL.mjs";
1
+ import { c as DeploySuccess, d as OperationDeps, f as ServiceEndpoint, h as CliStructuredError, l as DevInput, m as Result, o as DeployEvent, p as AssembledServices, s as DeployInput, t as ComposerOperations, u as DevSession } from "./family-B7xU_-RU-0ngWShLP.mjs";
2
2
  //#region ../../0-framework/3-tooling/cli/dist/testing.d.mts
3
3
  //#region src/dev/generate-dev-stack.d.ts
4
4
  interface DevStackFileInput {
@@ -16,8 +16,10 @@ declare function renderDevStackFile(input: DevStackFileInput): string;
16
16
  //#endregion
17
17
  //#region src/testing/operations-double.d.ts
18
18
  interface OperationsDoubleFixtures {
19
- /** Returned as-is; pass notOk(error) for a failing deploy. Default: ok with no summary. */
19
+ /** Returned as-is; pass notOk(error) for a failing deploy. Default: ok with no summary and a zero duration. */
20
20
  readonly deploy?: Result<DeploySuccess, CliStructuredError> | undefined;
21
+ /** Sent to the deploy's `onEvent`, in order, before it returns. */
22
+ readonly deployEvents?: readonly DeployEvent[] | undefined;
21
23
  /**
22
24
  * A failing dev: returned as-is, no session starts. When absent, dev
23
25
  * succeeds with a working DevSession double over `devEndpoints`.
@@ -1 +1 @@
1
- {"version":3,"file":"testing.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/testing.d.mts"],"mappings":";;;UAMU;;WAEC;;WAEA;;WAEA;WACA;WACA,WAAW;;;iBAGL,mBAAmB,OAAO;;;UAGjC;;WAEC,SAAS,OAAO,eAAe;;;;;WAK/B,MAAM,OAAO,YAAY;;WAEzB,wBAAwB;;;;;;;;UAQzB;WACC,iBAAiB;WACjB,cAAc;;;UAGf;WACC,iBAAiB;WACjB,cAAc;WACd,MAAM;;UAEP;;WAEC,YAAY;WACZ,OAAO;;iBAED,uBAAuB,WAAW,2BAA2B"}
1
+ {"version":3,"file":"testing.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/testing.d.mts"],"mappings":";;;UAMU;;WAEC;;WAEA;;WAEA;WACA;WACA,WAAW;;;iBAGL,mBAAmB,OAAO;;;UAGjC;;WAEC,SAAS,OAAO,eAAe;;WAE/B,wBAAwB;;;;;WAKxB,MAAM,OAAO,YAAY;;WAEzB,wBAAwB;;;;;;;;UAQzB;WACC,iBAAiB;WACjB,cAAc;;;UAGf;WACC,iBAAiB;WACjB,cAAc;WACd,MAAM;;UAEP;;WAEC,YAAY;WACZ,OAAO;;iBAED,uBAAuB,WAAW,2BAA2B"}
package/dist/testing.mjs CHANGED
@@ -104,9 +104,15 @@ function createOperationsDouble(fixtures = {}) {
104
104
  deploy: async (input, operationDeps) => {
105
105
  calls.deploy.push(input);
106
106
  deps.deploy.push(operationDeps);
107
+ for (const event of fixtures.deployEvents ?? []) try {
108
+ input.onEvent?.(event);
109
+ } catch {}
107
110
  const converge = await runConverge(operationDeps, input.cwd);
108
111
  if (converge !== void 0) return converge;
109
- return fixtures.deploy ?? ok({ summary: void 0 });
112
+ return fixtures.deploy ?? ok({
113
+ summary: void 0,
114
+ durationMs: 0
115
+ });
110
116
  },
111
117
  dev: async (input, operationDeps) => {
112
118
  calls.dev.push(input);
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/testing.mjs"],"sourcesContent":["import { n as renderDevStackFile } from \"./generate-dev-stack-BUadNY_w.mjs\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/testing/operations-double.ts\n/**\n* The published operations double (`@prisma/composer-cli/testing`): the two\n* operations the command family calls, `deploy` and `dev`, with their real\n* signatures and Result shapes, backed by fixtures instead of alchemy,\n* containers, or a network. It does not cover `destroy` and `log`, which no\n* command calls.\n*\n* Hosts that mount composer's command family — prisma-cli above all — test\n* against this instead of the real operations, so their suites never spawn a\n* converge and their typecheck never needs the alchemy/effect constellation.\n* The conformance guarantee is carried by the types: `ComposerOperations` is\n* defined as `typeof deployWithDeps` (etc.) of the REAL operations, and the\n* double is declared against it, so a drift in any real signature fails\n* `tsc --noEmit` right here. Every import of implementation modules is\n* type-only and erases at build — the built `testing` chunk must contain no path to the real\n* control implementation, which scripts/check-family-static-graph.mjs proves\n* against the packed tarball.\n*/\nfunction devSessionDouble(input, endpoints) {\n\tlet resolveClosed;\n\tconst closed = new Promise((resolve) => {\n\t\tresolveClosed = resolve;\n\t});\n\tlet stopped = false;\n\tinput.onEvent?.({\n\t\tkind: \"ready\",\n\t\tendpoints\n\t});\n\treturn {\n\t\tendpoints,\n\t\tclosed,\n\t\tstop: async () => {\n\t\t\tif (stopped) return;\n\t\t\tstopped = true;\n\t\t\tinput.onEvent?.({ kind: \"stopping\" });\n\t\t\tinput.onEvent?.({ kind: \"stopped\" });\n\t\t\tresolveClosed();\n\t\t}\n\t};\n}\n/**\n* Runs the caller's converge adapter, when it supplied one, against a\n* synthetic invocation — no alchemy bin is resolved and no real child is\n* started; the adapter decides what the child does.\n*\n* This is what makes a host's tests cover the settlement rules rather than\n* just the grammar: a scripted fake child that exits non-zero, or is killed\n* by a signal, produces the same failure shape the real executor produces, so\n* the handler's settlement — and the engine's own child-status settlement\n* behind it — is genuinely exercised. Returns undefined when no adapter was\n* injected, leaving the fixture result untouched.\n*/\nasync function runConverge(deps, cwd) {\n\tif (deps.alchemy === void 0) return void 0;\n\tconst stackFilePath = \".prisma-composer/alchemy.run.ts\";\n\tconst reproduceCommand = `alchemy deploy ${stackFilePath} --yes --stage test`;\n\tconst workingDirectory = cwd ?? \".\";\n\tconst outcome = await deps.alchemy({\n\t\taction: \"deploy\",\n\t\tstackFileRelativePath: stackFilePath,\n\t\tcwd: workingDirectory,\n\t\tstage: \"test\",\n\t\tenv: {}\n\t});\n\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy deploy was interrupted by ${outcome.signal}.`, { meta: {\n\t\tsignal: outcome.signal,\n\t\tdiagnostics: {\n\t\t\texitCode: void 0,\n\t\t\tsignal: outcome.signal,\n\t\t\tstackFilePath,\n\t\t\treproduceCommand,\n\t\t\tcwd: workingDirectory\n\t\t}\n\t} }));\n\tconst status = outcome.exitCode ?? 1;\n\tif (status === 0) return void 0;\n\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy deploy exited with status ${status}.`, { meta: {\n\t\texitCode: status,\n\t\tdiagnostics: {\n\t\t\texitCode: status,\n\t\t\tstackFilePath,\n\t\t\treproduceCommand,\n\t\t\tcwd: workingDirectory\n\t\t}\n\t} }));\n}\nfunction createOperationsDouble(fixtures = {}) {\n\tconst deployCalls = [];\n\tconst devCalls = [];\n\tconst deps = {\n\t\tdeploy: [],\n\t\tdev: []\n\t};\n\tconst calls = {\n\t\tdeploy: deployCalls,\n\t\tdev: devCalls,\n\t\tdeps\n\t};\n\treturn {\n\t\toperations: {\n\t\t\tdeploy: async (input, operationDeps) => {\n\t\t\t\tcalls.deploy.push(input);\n\t\t\t\tdeps.deploy.push(operationDeps);\n\t\t\t\tconst converge = await runConverge(operationDeps, input.cwd);\n\t\t\t\tif (converge !== void 0) return converge;\n\t\t\t\treturn fixtures.deploy ?? ok({ summary: void 0 });\n\t\t\t},\n\t\t\tdev: async (input, operationDeps) => {\n\t\t\t\tcalls.dev.push(input);\n\t\t\t\tdeps.dev.push(operationDeps);\n\t\t\t\treturn fixtures.dev ?? ok(devSessionDouble(input, fixtures.devEndpoints ?? []));\n\t\t\t}\n\t\t},\n\t\tcalls\n\t};\n}\n//#endregion\nexport { createOperationsDouble, renderDevStackFile };\n\n//# sourceMappingURL=testing.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,iBAAiB,OAAO,WAAW;CAC3C,IAAI;CACJ,MAAM,SAAS,IAAI,SAAS,YAAY;EACvC,gBAAgB;CACjB,CAAC;CACD,IAAI,UAAU;CACd,MAAM,UAAU;EACf,MAAM;EACN;CACD,CAAC;CACD,OAAO;EACN;EACA;EACA,MAAM,YAAY;GACjB,IAAI,SAAS;GACb,UAAU;GACV,MAAM,UAAU,EAAE,MAAM,WAAW,CAAC;GACpC,MAAM,UAAU,EAAE,MAAM,UAAU,CAAC;GACnC,cAAc;EACf;CACD;AACD;;;;;;;;;;;;;AAaA,eAAe,YAAY,MAAM,KAAK;CACrC,IAAI,KAAK,YAAY,KAAK,GAAG,OAAO,KAAK;CACzC,MAAM,gBAAgB;CACtB,MAAM,mBAAmB,kBAAkB,cAAc;CACzD,MAAM,mBAAmB,OAAO;CAChC,MAAM,UAAU,MAAM,KAAK,QAAQ;EAClC,QAAQ;EACR,uBAAuB;EACvB,KAAK;EACL,OAAO;EACP,KAAK,CAAC;CACP,CAAC;CACD,IAAI,QAAQ,WAAW,MAAM,OAAO,MAAM,IAAI,mBAAmB,wBAAwB,qCAAqC,QAAQ,OAAO,IAAI,EAAE,MAAM;EACxJ,QAAQ,QAAQ;EAChB,aAAa;GACZ,UAAU,KAAK;GACf,QAAQ,QAAQ;GAChB;GACA;GACA,KAAK;EACN;CACD,EAAE,CAAC,CAAC;CACJ,MAAM,SAAS,QAAQ,YAAY;CACnC,IAAI,WAAW,GAAG,OAAO,KAAK;CAC9B,OAAO,MAAM,IAAI,mBAAmB,wBAAwB,qCAAqC,OAAO,IAAI,EAAE,MAAM;EACnH,UAAU;EACV,aAAa;GACZ,UAAU;GACV;GACA;GACA,KAAK;EACN;CACD,EAAE,CAAC,CAAC;AACL;AACA,SAAS,uBAAuB,WAAW,CAAC,GAAG;CAC9C,MAAM,cAAc,CAAC;CACrB,MAAM,WAAW,CAAC;CAClB,MAAM,OAAO;EACZ,QAAQ,CAAC;EACT,KAAK,CAAC;CACP;CACA,MAAM,QAAQ;EACb,QAAQ;EACR,KAAK;EACL;CACD;CACA,OAAO;EACN,YAAY;GACX,QAAQ,OAAO,OAAO,kBAAkB;IACvC,MAAM,OAAO,KAAK,KAAK;IACvB,KAAK,OAAO,KAAK,aAAa;IAC9B,MAAM,WAAW,MAAM,YAAY,eAAe,MAAM,GAAG;IAC3D,IAAI,aAAa,KAAK,GAAG,OAAO;IAChC,OAAO,SAAS,UAAU,GAAG,EAAE,SAAS,KAAK,EAAE,CAAC;GACjD;GACA,KAAK,OAAO,OAAO,kBAAkB;IACpC,MAAM,IAAI,KAAK,KAAK;IACpB,KAAK,IAAI,KAAK,aAAa;IAC3B,OAAO,SAAS,OAAO,GAAG,iBAAiB,OAAO,SAAS,gBAAgB,CAAC,CAAC,CAAC;GAC/E;EACD;EACA;CACD;AACD"}
1
+ {"version":3,"file":"testing.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/testing.mjs"],"sourcesContent":["import { n as renderDevStackFile } from \"./generate-dev-stack-BUadNY_w.mjs\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/testing/operations-double.ts\n/**\n* The published operations double (`@prisma/composer-cli/testing`): the two\n* operations the command family calls, `deploy` and `dev`, with their real\n* signatures and Result shapes, backed by fixtures instead of alchemy,\n* containers, or a network. It does not cover `destroy` and `log`, which no\n* command calls.\n*\n* Hosts that mount composer's command family — prisma-cli above all — test\n* against this instead of the real operations, so their suites never spawn a\n* converge and their typecheck never needs the alchemy/effect constellation.\n* The conformance guarantee is carried by the types: `ComposerOperations` is\n* defined as `typeof deployWithDeps` (etc.) of the REAL operations, and the\n* double is declared against it, so a drift in any real signature fails\n* `tsc --noEmit` right here. Every import of implementation modules is\n* type-only and erases at build — the built `testing` chunk must contain no path to the real\n* control implementation, which scripts/check-family-static-graph.mjs proves\n* against the packed tarball.\n*/\nfunction devSessionDouble(input, endpoints) {\n\tlet resolveClosed;\n\tconst closed = new Promise((resolve) => {\n\t\tresolveClosed = resolve;\n\t});\n\tlet stopped = false;\n\tinput.onEvent?.({\n\t\tkind: \"ready\",\n\t\tendpoints\n\t});\n\treturn {\n\t\tendpoints,\n\t\tclosed,\n\t\tstop: async () => {\n\t\t\tif (stopped) return;\n\t\t\tstopped = true;\n\t\t\tinput.onEvent?.({ kind: \"stopping\" });\n\t\t\tinput.onEvent?.({ kind: \"stopped\" });\n\t\t\tresolveClosed();\n\t\t}\n\t};\n}\n/**\n* Runs the caller's converge adapter, when it supplied one, against a\n* synthetic invocation — no alchemy bin is resolved and no real child is\n* started; the adapter decides what the child does.\n*\n* This is what makes a host's tests cover the settlement rules rather than\n* just the grammar: a scripted fake child that exits non-zero, or is killed\n* by a signal, produces the same failure shape the real executor produces, so\n* the handler's settlement — and the engine's own child-status settlement\n* behind it — is genuinely exercised. Returns undefined when no adapter was\n* injected, leaving the fixture result untouched.\n*/\nasync function runConverge(deps, cwd) {\n\tif (deps.alchemy === void 0) return void 0;\n\tconst stackFilePath = \".prisma-composer/alchemy.run.ts\";\n\tconst reproduceCommand = `alchemy deploy ${stackFilePath} --yes --stage test`;\n\tconst workingDirectory = cwd ?? \".\";\n\tconst outcome = await deps.alchemy({\n\t\taction: \"deploy\",\n\t\tstackFileRelativePath: stackFilePath,\n\t\tcwd: workingDirectory,\n\t\tstage: \"test\",\n\t\tenv: {}\n\t});\n\tif (outcome.signal !== null) return notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy deploy was interrupted by ${outcome.signal}.`, { meta: {\n\t\tsignal: outcome.signal,\n\t\tdiagnostics: {\n\t\t\texitCode: void 0,\n\t\t\tsignal: outcome.signal,\n\t\t\tstackFilePath,\n\t\t\treproduceCommand,\n\t\t\tcwd: workingDirectory\n\t\t}\n\t} }));\n\tconst status = outcome.exitCode ?? 1;\n\tif (status === 0) return void 0;\n\treturn notOk(new CliStructuredError(\"DEPLOY.ENGINE_FAILED\", `alchemy deploy exited with status ${status}.`, { meta: {\n\t\texitCode: status,\n\t\tdiagnostics: {\n\t\t\texitCode: status,\n\t\t\tstackFilePath,\n\t\t\treproduceCommand,\n\t\t\tcwd: workingDirectory\n\t\t}\n\t} }));\n}\nfunction createOperationsDouble(fixtures = {}) {\n\tconst deployCalls = [];\n\tconst devCalls = [];\n\tconst deps = {\n\t\tdeploy: [],\n\t\tdev: []\n\t};\n\tconst calls = {\n\t\tdeploy: deployCalls,\n\t\tdev: devCalls,\n\t\tdeps\n\t};\n\treturn {\n\t\toperations: {\n\t\t\tdeploy: async (input, operationDeps) => {\n\t\t\t\tcalls.deploy.push(input);\n\t\t\t\tdeps.deploy.push(operationDeps);\n\t\t\t\tfor (const event of fixtures.deployEvents ?? []) try {\n\t\t\t\t\tinput.onEvent?.(event);\n\t\t\t\t} catch {}\n\t\t\t\tconst converge = await runConverge(operationDeps, input.cwd);\n\t\t\t\tif (converge !== void 0) return converge;\n\t\t\t\treturn fixtures.deploy ?? ok({\n\t\t\t\t\tsummary: void 0,\n\t\t\t\t\tdurationMs: 0\n\t\t\t\t});\n\t\t\t},\n\t\t\tdev: async (input, operationDeps) => {\n\t\t\t\tcalls.dev.push(input);\n\t\t\t\tdeps.dev.push(operationDeps);\n\t\t\t\treturn fixtures.dev ?? ok(devSessionDouble(input, fixtures.devEndpoints ?? []));\n\t\t\t}\n\t\t},\n\t\tcalls\n\t};\n}\n//#endregion\nexport { createOperationsDouble, renderDevStackFile };\n\n//# sourceMappingURL=testing.mjs.map"],"mappings":";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AAC;EACT,KAAK,CAAC;CACP;CACA,MAAM,QAAQ;EACb,QAAQ;EACR,KAAK;EACL;CACD;CACA,OAAO;EACN,YAAY;GACX,QAAQ,OAAO,OAAO,kBAAkB;IACvC,MAAM,OAAO,KAAK,KAAK;IACvB,KAAK,OAAO,KAAK,aAAa;IAC9B,KAAK,MAAM,SAAS,SAAS,gBAAgB,CAAC,GAAG,IAAI;KACpD,MAAM,UAAU,KAAK;IACtB,QAAQ,CAAC;IACT,MAAM,WAAW,MAAM,YAAY,eAAe,MAAM,GAAG;IAC3D,IAAI,aAAa,KAAK,GAAG,OAAO;IAChC,OAAO,SAAS,UAAU,GAAG;KAC5B,SAAS,KAAK;KACd,YAAY;IACb,CAAC;GACF;GACA,KAAK,OAAO,OAAO,kBAAkB;IACpC,MAAM,IAAI,KAAK,KAAK;IACpB,KAAK,IAAI,KAAK,aAAa;IAC3B,OAAO,SAAS,OAAO,GAAG,iBAAiB,OAAO,SAAS,gBAAgB,CAAC,CAAC,CAAC;GAC/E;EACD;EACA;CACD;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/composer-cli",
3
- "version": "0.27.0",
3
+ "version": "0.28.0-dev.1",
4
4
  "type": "module",
5
5
  "description": "Prisma Composer's command family, which the `prisma` CLI mounts as `deploy` and `dev`.",
6
6
  "exports": {
@@ -13,7 +13,7 @@
13
13
  "src"
14
14
  ],
15
15
  "dependencies": {
16
- "@prisma/composer": "0.27.0",
16
+ "@prisma/composer": "0.28.0-dev.1",
17
17
  "alchemy": "2.0.0-beta.78",
18
18
  "cross-spawn": "^7.0.6",
19
19
  "effect": "4.0.0-rc.115",
@@ -23,8 +23,8 @@
23
23
  "@prisma/cli-engine": "0.6.3"
24
24
  },
25
25
  "devDependencies": {
26
- "@internal/cli": "0.27.0",
27
- "@internal/tsdown-config": "0.27.0",
26
+ "@internal/cli": "0.28.0-dev.1",
27
+ "@internal/tsdown-config": "0.28.0-dev.1",
28
28
  "@prisma/cli-engine": "0.6.3",
29
29
  "@types/node": "^26.0.1",
30
30
  "tsdown": "^0.22.7",