@prisma/composer 0.6.0-dev.13 → 0.6.0-dev.15

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 (110) hide show
  1. package/dist/{app-config-CFsSXEVj-B242oUnm.d.mts → app-config-aIrriqVU-D6lJHzh2.d.mts} +42 -17
  2. package/dist/app-config-aIrriqVU-D6lJHzh2.d.mts.map +1 -0
  3. package/dist/bin.mjs +950 -12
  4. package/dist/bin.mjs.map +1 -1
  5. package/dist/config-CL7Jbve2.d.mts +1 -0
  6. package/dist/config.d.mts +3 -3
  7. package/dist/container-transport-DKmKg5JQ-CoY4XPma.mjs +30 -0
  8. package/dist/container-transport-DKmKg5JQ-CoY4XPma.mjs.map +1 -0
  9. package/dist/control.d.mts +3 -216
  10. package/dist/control.mjs +1 -69
  11. package/dist/deploy-CL7Jbve2.d.mts +1 -0
  12. package/dist/deploy.d.mts +2 -2
  13. package/dist/deploy.mjs +1 -1
  14. package/dist/{deployment-summary-r47O6kFr-CcMYVOn5.mjs → deployment-summary-DswOl_9E-C03NJ98H.mjs} +2 -2
  15. package/dist/{deployment-summary-r47O6kFr-CcMYVOn5.mjs.map → deployment-summary-DswOl_9E-C03NJ98H.mjs.map} +1 -1
  16. package/dist/{dist-C5rZnr4n.mjs → dist-C0dNEgS-.mjs} +2 -2
  17. package/dist/{dist-C5rZnr4n.mjs.map → dist-C0dNEgS-.mjs.map} +1 -1
  18. package/dist/{errors-0e8IVwzi.mjs → errors-DkXcnjPx.mjs} +3 -2
  19. package/dist/{errors-0e8IVwzi.mjs.map → errors-DkXcnjPx.mjs.map} +1 -1
  20. package/dist/{execute-deploy-destroy-IT4vGkMc-oO8yjHPH.mjs → execute-deploy-destroy-DfVJUICu-AMM8CwgV.mjs} +30 -19
  21. package/dist/execute-deploy-destroy-DfVJUICu-AMM8CwgV.mjs.map +1 -0
  22. package/dist/{execute-deploy-destroy-IT4vGkMc-YM1Cv6cu.mjs → execute-deploy-destroy-DfVJUICu-quUQ08T8.mjs} +29 -19
  23. package/dist/execute-deploy-destroy-DfVJUICu-quUQ08T8.mjs.map +1 -0
  24. package/dist/{execute-dev-DLYyduEM-88uyvrbj.mjs → execute-dev-BMTFWfFc-B1whS-Rr.mjs} +25 -23
  25. package/dist/{execute-dev-DLYyduEM-88uyvrbj.mjs.map → execute-dev-BMTFWfFc-B1whS-Rr.mjs.map} +1 -1
  26. package/dist/{execute-dev-DLYyduEM-BuUGTm0g.mjs → execute-dev-BMTFWfFc-BoKbcFVF.mjs} +29 -20
  27. package/dist/{execute-dev-DLYyduEM-BuUGTm0g.mjs.map → execute-dev-BMTFWfFc-BoKbcFVF.mjs.map} +1 -1
  28. package/dist/{execute-log-VIOL4DBz-DBPH8By4.mjs → execute-log-Cay9hlKW-B0tmRtrY.mjs} +11 -7
  29. package/dist/execute-log-Cay9hlKW-B0tmRtrY.mjs.map +1 -0
  30. package/dist/{execute-log-VIOL4DBz-DKodBrxS.mjs → execute-log-Cay9hlKW-DrMeVOXq.mjs} +9 -7
  31. package/dist/execute-log-Cay9hlKW-DrMeVOXq.mjs.map +1 -0
  32. package/dist/family-DkH0si4D-Uov_MuHV.d.mts +27 -0
  33. package/dist/family-DkH0si4D-Uov_MuHV.d.mts.map +1 -0
  34. package/dist/family.d.mts +53 -0
  35. package/dist/family.d.mts.map +1 -0
  36. package/dist/family.mjs +839 -0
  37. package/dist/family.mjs.map +1 -0
  38. package/dist/{graph-BJgUfGB0-kvgFzT4q.mjs → graph-BJgUfGB0-7fmubS_y.mjs} +2 -2
  39. package/dist/{graph-BJgUfGB0-kvgFzT4q.mjs.map → graph-BJgUfGB0-7fmubS_y.mjs.map} +1 -1
  40. package/dist/{graph-types-N6brq1zY-1VMNwtkJ.d.mts → graph-DqklX5Sf-CdNH3lA7.d.mts} +17 -2
  41. package/dist/graph-DqklX5Sf-CdNH3lA7.d.mts.map +1 -0
  42. package/dist/{index-DryPyF9U.d.mts → index-DuF5iI3i.d.mts} +2 -3
  43. package/dist/index-DuF5iI3i.d.mts.map +1 -0
  44. package/dist/index.d.mts +2 -3
  45. package/dist/index.mjs +2 -2
  46. package/dist/{local-target-DnA2E8IN.mjs → local-target-D3u_wuNF.mjs} +2 -2
  47. package/dist/{local-target-DnA2E8IN.mjs.map → local-target-D3u_wuNF.mjs.map} +1 -1
  48. package/dist/{local-target-DuSyWeYc.mjs → local-target-H0IWu_FM.mjs} +2 -2
  49. package/dist/{local-target-DuSyWeYc.mjs.map → local-target-H0IWu_FM.mjs.map} +1 -1
  50. package/dist/local-target.d.mts +1 -1
  51. package/dist/local-target.mjs +1 -1
  52. package/dist/log-DRnnWupy-9jbzL64M.d.mts +324 -0
  53. package/dist/log-DRnnWupy-9jbzL64M.d.mts.map +1 -0
  54. package/dist/{result-CzGChwbZ.mjs → log-DfT2hHqi-CDp9nfI5.mjs} +85 -90
  55. package/dist/log-DfT2hHqi-CDp9nfI5.mjs.map +1 -0
  56. package/dist/{nextjs-DLyeRR7M-DZODs9tk.d.mts → nextjs-DLyeRR7M-BfUbLXwr.d.mts} +3 -3
  57. package/dist/{nextjs-DLyeRR7M-DZODs9tk.d.mts.map → nextjs-DLyeRR7M-BfUbLXwr.d.mts.map} +1 -1
  58. package/dist/nextjs-control.d.mts +4 -4
  59. package/dist/nextjs.d.mts +1 -1
  60. package/dist/node-control.d.mts +3 -3
  61. package/dist/node.d.mts +2 -2
  62. package/dist/{pipeline-D3QoVzAB-D_ufjg3N.mjs → pipeline-AoW8zq4I-C6Qe0VaZ.mjs} +161 -42
  63. package/dist/{pipeline-D3QoVzAB-D_ufjg3N.mjs.map → pipeline-AoW8zq4I-C6Qe0VaZ.mjs.map} +1 -1
  64. package/dist/{pipeline-D3QoVzAB-Ci2aJ2mE.mjs → pipeline-AoW8zq4I-DM74ygtH.mjs} +164 -43
  65. package/dist/pipeline-AoW8zq4I-DM74ygtH.mjs.map +1 -0
  66. package/dist/report.d.mts +2 -2
  67. package/dist/report.mjs +1 -1
  68. package/dist/report.mjs.map +1 -1
  69. package/dist/{shared-CCaR42wo-BvegvmA_.mjs → result-B4XjxVK6.mjs} +127 -8
  70. package/dist/result-B4XjxVK6.mjs.map +1 -0
  71. package/dist/{result-CFqJKiqg.mjs → result-wonf1deB.mjs} +4 -18
  72. package/dist/result-wonf1deB.mjs.map +1 -0
  73. package/dist/run-alchemy-D44OZlyB-DA7s331N.mjs +93 -0
  74. package/dist/run-alchemy-D44OZlyB-DA7s331N.mjs.map +1 -0
  75. package/dist/run-alchemy-D44OZlyB-DeDTFsB6.mjs +93 -0
  76. package/dist/run-alchemy-D44OZlyB-DeDTFsB6.mjs.map +1 -0
  77. package/dist/service-rpc.d.mts +2 -2
  78. package/dist/service-rpc.mjs +2 -2
  79. package/dist/testing.d.mts +54 -2
  80. package/dist/testing.d.mts.map +1 -1
  81. package/dist/testing.mjs +150 -1
  82. package/dist/testing.mjs.map +1 -1
  83. package/package.json +12 -11
  84. package/src/exports/family.ts +14 -0
  85. package/src/exports/testing.ts +1 -0
  86. package/dist/app-config-CFsSXEVj-B242oUnm.d.mts.map +0 -1
  87. package/dist/cli-B3sWzFlb-CxEIzKsQ.mjs +0 -401
  88. package/dist/cli-B3sWzFlb-CxEIzKsQ.mjs.map +0 -1
  89. package/dist/config-ku5b_2YD.d.mts +0 -1
  90. package/dist/container-transport-DKmKg5JQ-BMRhx5w-.mjs +0 -75
  91. package/dist/container-transport-DKmKg5JQ-BMRhx5w-.mjs.map +0 -1
  92. package/dist/control.d.mts.map +0 -1
  93. package/dist/control.mjs.map +0 -1
  94. package/dist/deploy-ku5b_2YD.d.mts +0 -1
  95. package/dist/execute-deploy-destroy-IT4vGkMc-YM1Cv6cu.mjs.map +0 -1
  96. package/dist/execute-deploy-destroy-IT4vGkMc-oO8yjHPH.mjs.map +0 -1
  97. package/dist/execute-log-VIOL4DBz-DBPH8By4.mjs.map +0 -1
  98. package/dist/execute-log-VIOL4DBz-DKodBrxS.mjs.map +0 -1
  99. package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts +0 -18
  100. package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts.map +0 -1
  101. package/dist/graph-types-N6brq1zY-1VMNwtkJ.d.mts.map +0 -1
  102. package/dist/index-DryPyF9U.d.mts.map +0 -1
  103. package/dist/pipeline-D3QoVzAB-Ci2aJ2mE.mjs.map +0 -1
  104. package/dist/render-error-DsPN5qfr-CkVGj9uP.mjs +0 -30
  105. package/dist/render-error-DsPN5qfr-CkVGj9uP.mjs.map +0 -1
  106. package/dist/result-CFqJKiqg.mjs.map +0 -1
  107. package/dist/result-CzGChwbZ.mjs.map +0 -1
  108. package/dist/run-alchemy-hghRtddF-CQHOzlrW.mjs +0 -48
  109. package/dist/run-alchemy-hghRtddF-CQHOzlrW.mjs.map +0 -1
  110. package/dist/shared-CCaR42wo-BvegvmA_.mjs.map +0 -1
@@ -1,12 +1,13 @@
1
1
  import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
2
- import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
3
- import { o as isNode, t as Load } from "./graph-BJgUfGB0-kvgFzT4q.mjs";
4
- import "./dist-C5rZnr4n.mjs";
2
+ import { t as CliStructuredError } from "./errors-DkXcnjPx.mjs";
3
+ import { o as isNode, t as Load } from "./graph-BJgUfGB0-7fmubS_y.mjs";
4
+ import "./dist-C0dNEgS-.mjs";
5
+ import { l as effectResolutionDiagnostic } from "./log-DfT2hHqi-CDp9nfI5.mjs";
5
6
  import * as fs from "node:fs";
6
7
  import * as path from "node:path";
7
8
  import { pathToFileURL } from "node:url";
8
9
  import * as c12 from "c12";
9
- //#region ../../0-framework/3-tooling/cli/dist/load-entry-ZpkCjTxj.mjs
10
+ //#region ../../0-framework/3-tooling/cli/dist/load-entry-BYBSCuWg.mjs
10
11
  /**
11
12
  * `loadEntry` imports a user's topology with the host runtime's own module
12
13
  * loader — under node (the CLI's shebang runtime), that loader strips
@@ -127,7 +128,7 @@ async function assembleServices(graph, config, cwd, run) {
127
128
  return { bundles };
128
129
  }
129
130
  //#endregion
130
- //#region ../../0-framework/3-tooling/cli/dist/pipeline-D3QoVzAB.mjs
131
+ //#region ../../0-framework/3-tooling/cli/dist/pipeline-AoW8zq4I.mjs
131
132
  /**
132
133
  * Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE
133
134
  * file that imports control-plane code. Discovery is the standard walk-up
@@ -135,8 +136,19 @@ async function assembleServices(graph, config, cwd, run) {
135
136
  * loading is c12 with that explicit path (rc/global/package.json lookups
136
137
  * disabled), so the config file's own static imports resolve from the app
137
138
  * root by whatever package manager runs — no specifier construction, no
138
- * anchoring. The loaded shape is validated field-by-field with structured
139
- * errors naming the field.
139
+ * anchoring.
140
+ *
141
+ * Two shapes of the same machinery:
142
+ *
143
+ * loadAppConfigDiagnostics — returns the evaluated value together with
144
+ * EVERY problem found, and never throws. This is the shape the engine
145
+ * command family consumes: the engine renders diagnostics itself and
146
+ * decides per command whether a broken section is fatal, so a loader that
147
+ * threw on the first bad field would both hide the rest and bypass that
148
+ * rendering.
149
+ *
150
+ * loadAppConfig — the same load, throwing its first diagnostic. The
151
+ * clipanion CLI still runs on it; it goes when clipanion does.
140
152
  */
141
153
  const CONFIG_FILENAME = "prisma-composer.config.ts";
142
154
  /** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */
@@ -170,34 +182,52 @@ function isRecord(value) {
170
182
  /**
171
183
  * Field-by-field validation of the loaded default export — deliberately no
172
184
  * schema library: each check is a structured error naming the offending field.
173
- * Returns the same object, typed.
185
+ *
186
+ * Collects rather than throws, so one bad config reports every bad field
187
+ * instead of only the first. The `extensions` and `state` checks are
188
+ * independent, and within `extensions` each entry is judged on its own; a
189
+ * field whose own shape check already failed is not probed further, because
190
+ * anything derived from it would be noise rather than a second finding.
174
191
  */
175
- function validateConfigShape(loaded, configPath) {
176
- if (!isRecord(loaded) || Object.keys(loaded).length === 0) throw new CliStructuredError("CONFIG.EXPORT_INVALID", `"${configPath}" exported no config.`, {
192
+ function configShapeDiagnostics(loaded, configPath) {
193
+ if (!isRecord(loaded) || Object.keys(loaded).length === 0) return [new CliStructuredError("CONFIG.EXPORT_INVALID", `"${configPath}" exported no config.`, {
177
194
  fix: "It must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.",
178
195
  where: { path: configPath }
179
- });
196
+ })];
197
+ const diagnostics = [];
180
198
  const extensions = loaded["extensions"];
181
- if (!Array.isArray(extensions)) throw fieldError("extensions", "must be an array");
182
- const seen = /* @__PURE__ */ new Set();
183
- for (const [index, entry] of extensions.entries()) {
184
- if (!isRecord(entry)) throw fieldError(`extensions[${index}]`, "must be an extension descriptor object");
185
- const id = entry["id"];
186
- if (typeof id !== "string" || id.length === 0) throw fieldError(`extensions[${index}].id`, "must be a non-empty string (the extension package name)");
187
- if (!isRecord(entry["nodes"])) throw fieldError(`extensions[${index}].nodes`, "must be an object (the node-ID → control registry)");
188
- if (seen.has(id)) throw new CliStructuredError("CONFIG.EXTENSION_DUPLICATE", `${CONFIG_FILENAME}: extension "${id}" is listed more than once in \`extensions\`.`);
189
- seen.add(id);
199
+ if (!Array.isArray(extensions)) diagnostics.push(fieldError("extensions", "must be an array"));
200
+ else {
201
+ const seen = /* @__PURE__ */ new Set();
202
+ for (const [index, entry] of extensions.entries()) {
203
+ if (!isRecord(entry)) {
204
+ diagnostics.push(fieldError(`extensions[${index}]`, "must be an extension descriptor object"));
205
+ continue;
206
+ }
207
+ const id = entry["id"];
208
+ if (typeof id !== "string" || id.length === 0) diagnostics.push(fieldError(`extensions[${index}].id`, "must be a non-empty string (the extension package name)"));
209
+ else if (seen.has(id)) diagnostics.push(new CliStructuredError("CONFIG.EXTENSION_DUPLICATE", `${CONFIG_FILENAME}: extension "${id}" is listed more than once in \`extensions\`.`));
210
+ else seen.add(id);
211
+ if (!isRecord(entry["nodes"])) diagnostics.push(fieldError(`extensions[${index}].nodes`, "must be an object (the node-ID → control registry)"));
212
+ }
190
213
  }
191
214
  const state = loaded["state"];
192
- if (!isRecord(state) || typeof state["extension"] !== "string" || typeof state["create"] !== "function") throw fieldError("state", "must be a state descriptor (e.g. prismaState())");
215
+ if (!isRecord(state) || typeof state["extension"] !== "string" || typeof state["create"] !== "function") diagnostics.push(fieldError("state", "must be a state descriptor (e.g. prismaState())"));
216
+ return diagnostics;
217
+ }
218
+ /** The throwing form of configShapeDiagnostics: raises the first finding, returns the same object typed. Used by the clipanion pipeline. */
219
+ function validateConfigShape(loaded, configPath) {
220
+ const [first] = configShapeDiagnostics(loaded, configPath);
221
+ if (first !== void 0) throw first;
193
222
  return blindCast(loaded);
194
223
  }
195
224
  /**
196
- * Loads + validates the config at `configPath` via c12 (explicit file; rc /
197
- * global-rc / package.json lookups disabled discovery already happened in
198
- * findConfigPathForEntry).
225
+ * Evaluates `configPath` with c12 (explicit file; rc / global-rc /
226
+ * package.json lookups disabled). `verifySamePath` runs the same-file check
227
+ * against the discovered path — see loadAppConfigDiagnostics for when it does
228
+ * not apply.
199
229
  */
200
- async function loadAppConfig(configPath) {
230
+ async function evaluateConfig(configPath, verifySamePath) {
201
231
  let result;
202
232
  try {
203
233
  result = await c12.loadConfig({
@@ -209,19 +239,99 @@ async function loadAppConfig(configPath) {
209
239
  packageJson: false
210
240
  });
211
241
  } catch (error) {
212
- throw new CliStructuredError("CONFIG.EVALUATION_FAILED", `Evaluating "${configPath}" failed: ${error instanceof Error ? error.message : String(error)}`, {
213
- where: { path: configPath },
214
- cause: error
215
- });
242
+ return {
243
+ value: void 0,
244
+ diagnostics: [new CliStructuredError("CONFIG.EVALUATION_FAILED", `Evaluating "${configPath}" failed: ${error instanceof Error ? error.message : String(error)}`, {
245
+ where: { path: configPath },
246
+ cause: error
247
+ })]
248
+ };
216
249
  }
217
250
  const loadedFile = result.configFile;
218
- if (typeof loadedFile !== "string" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath)) throw new CliStructuredError("CONFIG.PATH_MISMATCH", `Config loading resolved "${String(loadedFile)}" instead of the discovered "${configPath}".`, {
219
- why: "Refusing to deploy against a different file.",
220
- where: { path: configPath }
221
- });
251
+ if (verifySamePath && (typeof loadedFile !== "string" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))) return {
252
+ value: result.config,
253
+ diagnostics: [new CliStructuredError("CONFIG.PATH_MISMATCH", `Config loading resolved "${String(loadedFile)}" instead of the discovered "${configPath}".`, {
254
+ why: "Refusing to deploy against a different file.",
255
+ where: { path: configPath }
256
+ })]
257
+ };
258
+ return {
259
+ value: result.config,
260
+ diagnostics: configShapeDiagnostics(result.config, configPath)
261
+ };
262
+ }
263
+ /**
264
+ * The front of every config load, shared by the throwing and the
265
+ * diagnostics-list shapes: verify the installed tree can evaluate a config at
266
+ * all, then settle which file to load — the section's path, or the
267
+ * entry-anchored walk.
268
+ *
269
+ * The effect-resolution check comes first because evaluating a config imports
270
+ * alchemy's provider tree: in a tree where alchemy resolves an `effect` we did
271
+ * not pin, nothing downstream can load, so the dependency conflict is the
272
+ * finding with the fix in it and every later failure is its symptom.
273
+ */
274
+ function configSource(request) {
275
+ const resolvedEntry = path.resolve(request.entryPath);
276
+ const cwd = request.cwd ?? path.dirname(resolvedEntry);
277
+ const effectConflict = effectResolutionDiagnostic(cwd);
278
+ if (effectConflict !== void 0) return {
279
+ ok: false,
280
+ path: void 0,
281
+ diagnostic: effectConflict
282
+ };
283
+ if (request.configPath === void 0) {
284
+ const discovered = findConfigPathForEntry(resolvedEntry);
285
+ return discovered === void 0 ? {
286
+ ok: false,
287
+ path: void 0,
288
+ diagnostic: missingConfigError(resolvedEntry)
289
+ } : {
290
+ ok: true,
291
+ path: discovered,
292
+ explicit: false
293
+ };
294
+ }
295
+ const configPath = path.resolve(cwd, request.configPath);
296
+ if (!fs.existsSync(configPath)) return {
297
+ ok: false,
298
+ path: configPath,
299
+ diagnostic: new CliStructuredError("CONFIG.FILE_MISSING", `The \`composer\` config section points at "${configPath}", which does not exist.`, {
300
+ why: "An explicit configPath is used as given — there is no walk to fall back on.",
301
+ fix: "Correct `configPath` in the `composer` section of prisma.config.ts, or remove it to search upward from the entry.",
302
+ where: { path: configPath }
303
+ })
304
+ };
222
305
  return {
306
+ ok: true,
223
307
  path: configPath,
224
- config: validateConfigShape(result.config, configPath)
308
+ explicit: true
309
+ };
310
+ }
311
+ /**
312
+ * The throwing form of that front, for the pipeline: the file the load will
313
+ * use, or the finding raised. `explicit` says the section named the file,
314
+ * which is what retires the same-file check for that case.
315
+ */
316
+ function resolveConfigFile(request) {
317
+ const source = configSource(request);
318
+ if (!source.ok) throw source.diagnostic;
319
+ return {
320
+ path: source.path,
321
+ explicit: source.explicit
322
+ };
323
+ }
324
+ /**
325
+ * Loads + validates the config at `configPath`, throwing its first diagnostic.
326
+ * The clipanion CLI's pipeline runs on this; it goes when clipanion does.
327
+ */
328
+ async function loadAppConfig(configPath, verifySamePath = true) {
329
+ const { value, diagnostics } = await evaluateConfig(configPath, verifySamePath);
330
+ const [first] = diagnostics;
331
+ if (first !== void 0) throw first;
332
+ return {
333
+ path: configPath,
334
+ config: validateConfigShape(value, configPath)
225
335
  };
226
336
  }
227
337
  function lookup(extensions, extension, type, expectedKind, what) {
@@ -271,6 +381,23 @@ function validateRegistryCoverage(graph, config) {
271
381
  * cannot drift.
272
382
  */
273
383
  /**
384
+ * The config step both pipelines share: the effect-resolution check and the
385
+ * choice of config file (load-config.ts's shared front), then evaluation —
386
+ * unless the caller substituted a config, which replaces the evaluation and
387
+ * nothing before it.
388
+ */
389
+ async function loadConfigStep(entryPath, cwd, deps) {
390
+ const { path: configPath, explicit } = resolveConfigFile({
391
+ entryPath,
392
+ configPath: deps.configPath,
393
+ cwd
394
+ });
395
+ return {
396
+ configPath,
397
+ config: deps.config ?? (await loadAppConfig(configPath, !explicit)).config
398
+ };
399
+ }
400
+ /**
274
401
  * The pipeline's front — config discovery/load, entry load, name resolution —
275
402
  * WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its
276
403
  * config and resolved name) to reach the already-running local instance; it
@@ -278,10 +405,7 @@ function validateRegistryCoverage(graph, config) {
278
405
  * output the way the full pipeline does.
279
406
  */
280
407
  async function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {
281
- const resolvedEntryPath = path.resolve(cwd, entry);
282
- const configPath = findConfigPathForEntry(resolvedEntryPath);
283
- if (configPath === void 0) throw missingConfigError(resolvedEntryPath);
284
- const config = deps.config ?? (await loadAppConfig(configPath)).config;
408
+ const { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);
285
409
  const entryModule = await loadEntry(entry, cwd);
286
410
  const name = overrideName ?? entryModule.root.name;
287
411
  if (name.length === 0) throw new CliStructuredError("COMPOSE.NAME_MISSING", "The root node has no name.", { fix: "Name it at authoring, or pass --name." });
@@ -299,10 +423,7 @@ async function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {
299
423
  * about any one command.
300
424
  */
301
425
  async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError) {
302
- const resolvedEntryPath = path.resolve(cwd, entry);
303
- const configPath = findConfigPathForEntry(resolvedEntryPath);
304
- if (configPath === void 0) throw missingConfigError(resolvedEntryPath);
305
- const config = deps.config ?? (await loadAppConfig(configPath)).config;
426
+ const { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);
306
427
  const entryModule = await loadEntry(entry, cwd);
307
428
  const graph = Load(entryModule.root);
308
429
  if (graph.root.node.kind !== "module") throw new CliStructuredError("COMPOSE.ROOT_NOT_MODULE", "The deploy root must be a module.", { fix: "Wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); })." });
@@ -328,4 +449,4 @@ async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError)
328
449
  //#endregion
329
450
  export { runPipeline as n, resolveAppIdentity as t };
330
451
 
331
- //# sourceMappingURL=pipeline-D3QoVzAB-Ci2aJ2mE.mjs.map
452
+ //# sourceMappingURL=pipeline-AoW8zq4I-DM74ygtH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-AoW8zq4I-DM74ygtH.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/load-entry-BYBSCuWg.mjs","../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/3-tooling/cli/dist/pipeline-AoW8zq4I.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { isNode } from \"@internal/core\";\n//#region src/jsx-load-error.ts\n/**\n* `loadEntry` imports a user's topology with the host runtime's own module\n* loader — under node (the CLI's shebang runtime), that loader strips\n* TypeScript types but has no JSX transform (ADR-0005: the framework\n* doesn't bundle or transform the app's code; deploy loading is no\n* exception). A `.tsx`/`.jsx` file anywhere in the topology's import graph\n* dies with node's raw `ERR_UNKNOWN_FILE_EXTENSION`, which names the file\n* but not the cause or the fix. This turns that one case into structured\n* error parts (summary/why/fix) that do — every other load failure (syntax\n* errors, missing files, non-JSX unknown extensions) is untouched.\n*/\nconst UNKNOWN_EXTENSION_CODE = \"ERR_UNKNOWN_FILE_EXTENSION\";\nconst JSX_EXTENSIONS = [\".tsx\", \".jsx\"];\nfunction errorCode(error) {\n\treturn \"code\" in error && typeof error.code === \"string\" ? error.code : void 0;\n}\nfunction unknownExtensionPath(error) {\n\tif (!(error instanceof Error)) return void 0;\n\tif (errorCode(error) !== UNKNOWN_EXTENSION_CODE) return void 0;\n\treturn /Unknown file extension \"\\.\\w+\" for (.+)$/.exec(error.message)?.[1];\n}\n/**\n* Returns structured error parts when `error` is node's\n* `ERR_UNKNOWN_FILE_EXTENSION` for a `.tsx`/`.jsx` file — `undefined` for\n* every other error (including unknown-extension failures for some other\n* extension), so the caller can fall through to its normal rethrow.\n*/\nfunction explainJsxLoadError(error, entryPath) {\n\tconst offendingPath = unknownExtensionPath(error);\n\tif (offendingPath === void 0) return void 0;\n\tif (!JSX_EXTENSIONS.some((ext) => offendingPath.endsWith(ext))) return void 0;\n\treturn {\n\t\tsummary: `\"${offendingPath}\" can't be loaded.`,\n\t\twhy: `deploy loads \"${entryPath}\"'s topology with node's own module loader, which strips TypeScript types but has no JSX transform — so a .tsx/.jsx file can't sit anywhere in that import graph.`,\n\t\tfix: \"Precompile that file in your own build (transform the JSX away, keep the real npm packages external) and import the compiled output instead of the raw .tsx/.jsx — see examples/email/scripts/build.ts in the prisma/composer repo for a worked example.\"\n\t};\n}\n//#endregion\n//#region src/load-entry.ts\n/**\n* Pipeline step 1 (deploy-cli.md § The pipeline): import the entry module\n* (resolved against cwd) and require its default export to be a node — a\n* service or module, branded by core's factories. Whatever this module exports\n* IS the application; nothing else marks a root (ADR-0003).\n*/\nasync function loadEntry(entryArg, cwd) {\n\tconst resolvedPath = path.resolve(cwd, entryArg);\n\tlet mod;\n\ttry {\n\t\tmod = await import(pathToFileURL(resolvedPath).href);\n\t} catch (error) {\n\t\tconst explained = explainJsxLoadError(error, resolvedPath);\n\t\tif (explained !== void 0) throw new CliStructuredError(\"COMPOSE.ENTRY_UNLOADABLE\", explained.summary, {\n\t\t\twhy: explained.why,\n\t\t\tfix: explained.fix,\n\t\t\twhere: { path: resolvedPath },\n\t\t\tcause: error\n\t\t});\n\t\tthrow new CliStructuredError(\"COMPOSE.ENTRY_UNLOADABLE\", `Failed to import entry module \"${resolvedPath}\": ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\twhere: { path: resolvedPath },\n\t\t\tcause: error\n\t\t});\n\t}\n\tconst root = blindCast(mod).default;\n\tif (!isNode(root) || root.kind === \"dependency\" || root.kind === \"resource\") throw new CliStructuredError(\"COMPOSE.ENTRY_EXPORT_INVALID\", `Entry module \"${resolvedPath}\" must default-export a node (a service or a module).`, {\n\t\tfix: \"Construct it with service() or module() from @prisma/composer.\",\n\t\twhere: { path: resolvedPath }\n\t});\n\treturn {\n\t\tpath: resolvedPath,\n\t\troot: blindCast(root)\n\t};\n}\n//#endregion\nexport { loadEntry as t };\n\n//# sourceMappingURL=load-entry-BYBSCuWg.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/assemble-error.ts\n/**\n* A user-facing assembly failure, structured at origin (base-type rule 6):\n* a `CliStructuredError` whose code names which way assembly went wrong.\n* This package's second consumer is the programmatic deploy API, not just\n* the CLI — hosts branch on `error.code`, the CLI renders the envelope.\n*/\nvar AssembleError = class extends CliStructuredError {\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t}\n};\n//#endregion\n//#region src/assemble-services.ts\n/**\n* The registry route for one service's build: extension by\n* `build.extension`, node descriptor by `build.type`, kind must be \"build\".\n* The CLI's coverage validation reports the same misses earlier with the\n* config fix; these errors are the backstop for programmatic callers.\n*/\nfunction buildDescriptorAssemble(config, node, address, cwd) {\n\tconst { extension, type } = node.build;\n\tconst extensionDescriptor = config.extensions.find((candidate) => candidate.id === extension);\n\tif (extensionDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by service \"${node.name}\"'s build).`, { fix: \"Add it to prisma-composer.config.ts's `extensions`.\" });\n\tconst nodeDescriptor = extensionDescriptor.nodes[type];\n\tif (nodeDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for build type \"${type}\".`, { why: `Known types: ${Object.keys(extensionDescriptor.nodes).join(\", \")}.` });\n\tif (nodeDescriptor.kind !== \"build\") throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for type \"${type}\" is a \"${nodeDescriptor.kind}\" descriptor.`, { why: \"Assembling a service build needs a \\\"build\\\" descriptor.\" });\n\treturn nodeDescriptor.assemble({\n\t\tbuild: node.build,\n\t\taddress,\n\t\tcwd\n\t});\n}\nasync function assembleServices(graph, config, cwd, run) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd) => buildDescriptorAssemble(config, node, address, nodeCwd));\n\tconst serviceNodes = graph.nodes.filter((n) => n.node.kind === \"service\");\n\tif (serviceNodes.length === 0) throw new AssembleError(\"ASSEMBLE.SERVICE_MISSING\", \"The loaded graph has no service to assemble.\");\n\tconst bundles = {};\n\tfor (const { id, node } of serviceNodes) try {\n\t\tbundles[id] = await runAssembler(node, id, cwd);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) throw error;\n\t\tthrow new AssembleError(\"ASSEMBLE.BUILD_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\tmeta: { address: id },\n\t\t\tcause: error\n\t\t});\n\t}\n\treturn { bundles };\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","import { i as effectResolutionDiagnostic } from \"./shared-BTnATsqm.mjs\";\nimport { t as loadEntry } from \"./load-entry-BYBSCuWg.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { Load } from \"@internal/core\";\nimport { assembleServices } from \"@internal/assemble\";\nimport * as c12 from \"c12\";\n//#region src/load-config.ts\n/**\n* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE\n* file that imports control-plane code. Discovery is the standard walk-up\n* from the deploy entry's directory (mirrors prisma-next's config-loader);\n* loading is c12 with that explicit path (rc/global/package.json lookups\n* disabled), so the config file's own static imports resolve from the app\n* root by whatever package manager runs — no specifier construction, no\n* anchoring.\n*\n* Two shapes of the same machinery:\n*\n* loadAppConfigDiagnostics — returns the evaluated value together with\n* EVERY problem found, and never throws. This is the shape the engine\n* command family consumes: the engine renders diagnostics itself and\n* decides per command whether a broken section is fatal, so a loader that\n* threw on the first bad field would both hide the rest and bypass that\n* rendering.\n*\n* loadAppConfig — the same load, throwing its first diagnostic. The\n* clipanion CLI still runs on it; it goes when clipanion does.\n*/\nconst CONFIG_FILENAME = \"prisma-composer.config.ts\";\n/** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */\nfunction findConfigPathForEntry(entryPath) {\n\tlet current = path.dirname(path.resolve(entryPath));\n\twhile (true) {\n\t\tconst candidate = path.join(current, CONFIG_FILENAME);\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(current);\n\t\tif (parent === current) return void 0;\n\t\tcurrent = parent;\n\t}\n}\nfunction missingConfigError(entryPath) {\n\tconst searchedFrom = path.dirname(path.resolve(entryPath));\n\treturn new CliStructuredError(\"CONFIG.FILE_MISSING\", `No ${CONFIG_FILENAME} found walking up from \"${searchedFrom}\".`, {\n\t\twhy: \"The deploy needs the app's config file.\",\n\t\tfix: \"Create one next to (or above) the entry, default-exporting defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.\",\n\t\twhere: { path: searchedFrom }\n\t});\n}\nfunction fieldError(field, requirement) {\n\treturn new CliStructuredError(\"CONFIG.FIELD_INVALID\", `${CONFIG_FILENAME}: \\`${field}\\` ${requirement}.`, {\n\t\tfix: \"See defineConfig() in '@prisma/composer/config'.\",\n\t\tmeta: { field }\n\t});\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/**\n* Field-by-field validation of the loaded default export — deliberately no\n* schema library: each check is a structured error naming the offending field.\n*\n* Collects rather than throws, so one bad config reports every bad field\n* instead of only the first. The `extensions` and `state` checks are\n* independent, and within `extensions` each entry is judged on its own; a\n* field whose own shape check already failed is not probed further, because\n* anything derived from it would be noise rather than a second finding.\n*/\nfunction configShapeDiagnostics(loaded, configPath) {\n\tif (!isRecord(loaded) || Object.keys(loaded).length === 0) return [new CliStructuredError(\"CONFIG.EXPORT_INVALID\", `\"${configPath}\" exported no config.`, {\n\t\tfix: \"It must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.\",\n\t\twhere: { path: configPath }\n\t})];\n\tconst diagnostics = [];\n\tconst extensions = loaded[\"extensions\"];\n\tif (!Array.isArray(extensions)) diagnostics.push(fieldError(\"extensions\", \"must be an array\"));\n\telse {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const [index, entry] of extensions.entries()) {\n\t\t\tif (!isRecord(entry)) {\n\t\t\t\tdiagnostics.push(fieldError(`extensions[${index}]`, \"must be an extension descriptor object\"));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst id = entry[\"id\"];\n\t\t\tif (typeof id !== \"string\" || id.length === 0) diagnostics.push(fieldError(`extensions[${index}].id`, \"must be a non-empty string (the extension package name)\"));\n\t\t\telse if (seen.has(id)) diagnostics.push(new CliStructuredError(\"CONFIG.EXTENSION_DUPLICATE\", `${CONFIG_FILENAME}: extension \"${id}\" is listed more than once in \\`extensions\\`.`));\n\t\t\telse seen.add(id);\n\t\t\tif (!isRecord(entry[\"nodes\"])) diagnostics.push(fieldError(`extensions[${index}].nodes`, \"must be an object (the node-ID → control registry)\"));\n\t\t}\n\t}\n\tconst state = loaded[\"state\"];\n\tif (!isRecord(state) || typeof state[\"extension\"] !== \"string\" || typeof state[\"create\"] !== \"function\") diagnostics.push(fieldError(\"state\", \"must be a state descriptor (e.g. prismaState())\"));\n\treturn diagnostics;\n}\n/** The throwing form of configShapeDiagnostics: raises the first finding, returns the same object typed. Used by the clipanion pipeline. */\nfunction validateConfigShape(loaded, configPath) {\n\tconst [first] = configShapeDiagnostics(loaded, configPath);\n\tif (first !== void 0) throw first;\n\treturn blindCast(loaded);\n}\n/**\n* Evaluates `configPath` with c12 (explicit file; rc / global-rc /\n* package.json lookups disabled). `verifySamePath` runs the same-file check\n* against the discovered path — see loadAppConfigDiagnostics for when it does\n* not apply.\n*/\nasync function evaluateConfig(configPath, verifySamePath) {\n\tlet result;\n\ttry {\n\t\tresult = await c12.loadConfig({\n\t\t\tname: \"prisma-composer\",\n\t\t\tconfigFile: configPath,\n\t\t\tcwd: path.dirname(configPath),\n\t\t\trcFile: false,\n\t\t\tglobalRc: false,\n\t\t\tpackageJson: false\n\t\t});\n\t} catch (error) {\n\t\treturn {\n\t\t\tvalue: void 0,\n\t\t\tdiagnostics: [new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", `Evaluating \"${configPath}\" failed: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\t\twhere: { path: configPath },\n\t\t\t\tcause: error\n\t\t\t})]\n\t\t};\n\t}\n\tconst loadedFile = result.configFile;\n\tif (verifySamePath && (typeof loadedFile !== \"string\" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))) return {\n\t\tvalue: result.config,\n\t\tdiagnostics: [new CliStructuredError(\"CONFIG.PATH_MISMATCH\", `Config loading resolved \"${String(loadedFile)}\" instead of the discovered \"${configPath}\".`, {\n\t\t\twhy: \"Refusing to deploy against a different file.\",\n\t\t\twhere: { path: configPath }\n\t\t})]\n\t};\n\treturn {\n\t\tvalue: result.config,\n\t\tdiagnostics: configShapeDiagnostics(result.config, configPath)\n\t};\n}\n/**\n* The front of every config load, shared by the throwing and the\n* diagnostics-list shapes: verify the installed tree can evaluate a config at\n* all, then settle which file to load — the section's path, or the\n* entry-anchored walk.\n*\n* The effect-resolution check comes first because evaluating a config imports\n* alchemy's provider tree: in a tree where alchemy resolves an `effect` we did\n* not pin, nothing downstream can load, so the dependency conflict is the\n* finding with the fix in it and every later failure is its symptom.\n*/\nfunction configSource(request) {\n\tconst resolvedEntry = path.resolve(request.entryPath);\n\tconst cwd = request.cwd ?? path.dirname(resolvedEntry);\n\tconst effectConflict = effectResolutionDiagnostic(cwd);\n\tif (effectConflict !== void 0) return {\n\t\tok: false,\n\t\tpath: void 0,\n\t\tdiagnostic: effectConflict\n\t};\n\tif (request.configPath === void 0) {\n\t\tconst discovered = findConfigPathForEntry(resolvedEntry);\n\t\treturn discovered === void 0 ? {\n\t\t\tok: false,\n\t\t\tpath: void 0,\n\t\t\tdiagnostic: missingConfigError(resolvedEntry)\n\t\t} : {\n\t\t\tok: true,\n\t\t\tpath: discovered,\n\t\t\texplicit: false\n\t\t};\n\t}\n\tconst configPath = path.resolve(cwd, request.configPath);\n\tif (!fs.existsSync(configPath)) return {\n\t\tok: false,\n\t\tpath: configPath,\n\t\tdiagnostic: new CliStructuredError(\"CONFIG.FILE_MISSING\", `The \\`composer\\` config section points at \"${configPath}\", which does not exist.`, {\n\t\t\twhy: \"An explicit configPath is used as given — there is no walk to fall back on.\",\n\t\t\tfix: \"Correct `configPath` in the `composer` section of prisma.config.ts, or remove it to search upward from the entry.\",\n\t\t\twhere: { path: configPath }\n\t\t})\n\t};\n\treturn {\n\t\tok: true,\n\t\tpath: configPath,\n\t\texplicit: true\n\t};\n}\n/**\n* The throwing form of that front, for the pipeline: the file the load will\n* use, or the finding raised. `explicit` says the section named the file,\n* which is what retires the same-file check for that case.\n*/\nfunction resolveConfigFile(request) {\n\tconst source = configSource(request);\n\tif (!source.ok) throw source.diagnostic;\n\treturn {\n\t\tpath: source.path,\n\t\texplicit: source.explicit\n\t};\n}\n/**\n* Loads + validates the config at `configPath`, throwing its first diagnostic.\n* The clipanion CLI's pipeline runs on this; it goes when clipanion does.\n*/\nasync function loadAppConfig(configPath, verifySamePath = true) {\n\tconst { value, diagnostics } = await evaluateConfig(configPath, verifySamePath);\n\tconst [first] = diagnostics;\n\tif (first !== void 0) throw first;\n\treturn {\n\t\tpath: configPath,\n\t\tconfig: validateConfigShape(value, configPath)\n\t};\n}\n//#endregion\n//#region src/validate-coverage.ts\nfunction lookup(extensions, extension, type, expectedKind, what) {\n\tconst ext = extensions.get(extension);\n\tif (ext === void 0) throw new CliStructuredError(\"CONFIG.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by ${what}).`, {\n\t\tfix: `Add it to ${CONFIG_FILENAME}'s \\`extensions\\` (import its /control entry and list its descriptor).`,\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tconst descriptor = ext.nodes[type];\n\tif (descriptor === void 0) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for node type \"${type}\" (needed by ${what}).`, {\n\t\twhy: `Known types: ${Object.keys(ext.nodes).join(\", \")}.`,\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tif (descriptor.kind !== expectedKind) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${descriptor.kind}\" descriptor — ${what} needs a \"${expectedKind}\" descriptor.`, { meta: {\n\t\textension,\n\t\ttype,\n\t\tkind: descriptor.kind\n\t} });\n}\n/** Throws a structured CONFIG.* error on the first uncovered `(extension, type)`; silent when the config covers the whole graph. */\nfunction validateRegistryCoverage(graph, config) {\n\tconst extensions = new Map(config.extensions.map((descriptor) => [descriptor.id, descriptor]));\n\tfor (const { id, node } of graph.nodes) {\n\t\tif (node.kind === \"resource\") {\n\t\t\tlookup(extensions, node.extension, node.type, \"resource\", `resource node \"${id}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (node.kind !== \"service\") continue;\n\t\tlookup(extensions, node.extension, node.type, \"service\", `service node \"${id}\"`);\n\t\tlookup(extensions, node.build.extension, node.build.type, \"build\", `service node \"${id}\"'s build descriptor`);\n\t}\n}\n//#endregion\n//#region src/pipeline.ts\n/**\n* The shared prefix of `deploy`/`destroy`/`dev` (deploy-cli.md § The\n* pipeline; local-dev spec § 6): config discovery/load, entry load, Load,\n* registry coverage validation, name resolution, assemble. Deploy and dev\n* diverge after this — deploy resolves containers/preflight/stack file\n* against the hosted providers, dev against the local ones — so everything\n* up to and including assemble lives here once, consumed verbatim by both\n* `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines\n* cannot drift.\n*/\n/**\n* The config step both pipelines share: the effect-resolution check and the\n* choice of config file (load-config.ts's shared front), then evaluation —\n* unless the caller substituted a config, which replaces the evaluation and\n* nothing before it.\n*/\nasync function loadConfigStep(entryPath, cwd, deps) {\n\tconst { path: configPath, explicit } = resolveConfigFile({\n\t\tentryPath,\n\t\tconfigPath: deps.configPath,\n\t\tcwd\n\t});\n\treturn {\n\t\tconfigPath,\n\t\tconfig: deps.config ?? (await loadAppConfig(configPath, !explicit)).config\n\t};\n}\n/**\n* The pipeline's front — config discovery/load, entry load, name resolution —\n* WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its\n* config and resolved name) to reach the already-running local instance; it\n* neither builds nor provisions, so it must not require the user's built\n* output the way the full pipeline does.\n*/\nasync function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {\n\tconst { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);\n\tconst entryModule = await loadEntry(entry, cwd);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\treturn {\n\t\tconfigPath,\n\t\tconfig,\n\t\tname\n\t};\n}\n/**\n* Runs config discovery/load, entry load, Load, registry coverage, name\n* resolution, and assemble — steps 1–6 of `run()`. `onAssembleError`, when\n* given, lets a caller decorate an assemble failure with command-specific\n* guidance (destroy's \"build first\" hint) without this shared step knowing\n* about any one command.\n*/\nasync function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError) {\n\tconst { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);\n\tconst entryModule = await loadEntry(entry, cwd);\n\tconst graph = Load(entryModule.root);\n\tif (graph.root.node.kind !== \"module\") throw new CliStructuredError(\"COMPOSE.ROOT_NOT_MODULE\", \"The deploy root must be a module.\", { fix: \"Wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); }).\" });\n\tvalidateRegistryCoverage(graph, config);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler);\n\t} catch (error) {\n\t\tif (onAssembleError !== void 0 && error instanceof Error) throw onAssembleError(error);\n\t\tthrow error;\n\t}\n\treturn {\n\t\tconfigPath,\n\t\tconfig,\n\t\tentryModule,\n\t\tgraph,\n\t\tname,\n\t\tassembled\n\t};\n}\n//#endregion\nexport { runPipeline as n, resolveAppIdentity as t };\n\n//# sourceMappingURL=pipeline-AoW8zq4I.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,yBAAyB;AAC/B,MAAM,iBAAiB,CAAC,QAAQ,MAAM;AACtC,SAAS,UAAU,OAAO;CACzB,OAAO,UAAU,SAAS,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,KAAK;AAC9E;AACA,SAAS,qBAAqB,OAAO;CACpC,IAAI,EAAE,iBAAiB,QAAQ,OAAO,KAAK;CAC3C,IAAI,UAAU,KAAK,MAAM,wBAAwB,OAAO,KAAK;CAC7D,OAAO,2CAA2C,KAAK,MAAM,OAAO,CAAC,GAAG;AACzE;;;;;;;AAOA,SAAS,oBAAoB,OAAO,WAAW;CAC9C,MAAM,gBAAgB,qBAAqB,KAAK;CAChD,IAAI,kBAAkB,KAAK,GAAG,OAAO,KAAK;CAC1C,IAAI,CAAC,eAAe,MAAM,QAAQ,cAAc,SAAS,GAAG,CAAC,GAAG,OAAO,KAAK;CAC5E,OAAO;EACN,SAAS,IAAI,cAAc;EAC3B,KAAK,iBAAiB,UAAU;EAChC,KAAK;CACN;AACD;;;;;;;AASA,eAAe,UAAU,UAAU,KAAK;CACvC,MAAM,eAAe,KAAK,QAAQ,KAAK,QAAQ;CAC/C,IAAI;CACJ,IAAI;EACH,MAAM,MAAM,OAAO,cAAc,YAAY,CAAC,CAAC;CAChD,SAAS,OAAO;EACf,MAAM,YAAY,oBAAoB,OAAO,YAAY;EACzD,IAAI,cAAc,KAAK,GAAG,MAAM,IAAI,mBAAmB,4BAA4B,UAAU,SAAS;GACrG,KAAK,UAAU;GACf,KAAK,UAAU;GACf,OAAO,EAAE,MAAM,aAAa;GAC5B,OAAO;EACR,CAAC;EACD,MAAM,IAAI,mBA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AAM,UAAU,OAAO,GAAG;CAC9C,MAAM,OAAO,gBAAgB,YAAY,KAAK;CAC9C,IAAI,KAAK,WAAW,GAAG,MAAM,IAAI,mBAAmB,wBAAwB,8BAA8B,EAAE,KAAK,wCAAwC,CAAC;CAC1J,OAAO;EACN;EACA;EACA;CACD;AACD;;;;;;;;AAQA,eAAe,YAAY,OAAO,cAAc,KAAK,OAAO,CAAC,GAAG,iBAAiB;CAChF,MAAM,EAAE,YAAY,WAAW,MAAM,eAAe,KAAK,QAAQ,KAAK,KAAK,GAAG,KAAK,IAAI;CACvF,MAAM,cAAc,MAAM,UAAU,OAAO,GAAG;CAC9C,MAAM,QAAQ,KAAK,YAAY,IAAI;CACnC,IAAI,MAAM,KAAK,KAAK,SAAS,UAAU,MAAM,IAAI,mBAAmB,2BAA2B,qCAAqC,EAAE,KAAK,qGAAqG,CAAC;CACjP,yBAAyB,OAAO,MAAM;CACtC,MAAM,OAAO,gBAAgB,YAAY,KAAK;CAC9C,IAAI,KAAK,WAAW,GAAG,MAAM,IAAI,mBAAmB,wBAAwB,8BAA8B,EAAE,KAAK,wCAAwC,CAAC;CAC1J,IAAI;CACJ,IAAI;EACH,YAAY,MAAM,iBAAiB,OAAO,QAAQ,KAAK,KAAK,YAAY;CACzE,SAAS,OAAO;EACf,IAAI,oBAAoB,KAAK,KAAK,iBAAiB,OAAO,MAAM,gBAAgB,KAAK;EACrF,MAAM;CACP;CACA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;CACD;AACD"}
package/dist/report.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { d as DeploymentResult } from "./app-config-CFsSXEVj-B242oUnm.mjs";
2
- import "./deploy-ku5b_2YD.mjs";
1
+ import { f as DeploymentResult } from "./app-config-aIrriqVU-D6lJHzh2.mjs";
2
+ import "./deploy-CL7Jbve2.mjs";
3
3
  //#region ../../0-framework/3-tooling/cli/dist/report.d.mts
4
4
  //#region src/render-deployment.d.ts
5
5
  /**
package/dist/report.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { r as writeDeploymentSummaryFile } from "./deployment-summary-r47O6kFr-CcMYVOn5.mjs";
1
+ import { r as writeDeploymentSummaryFile } from "./deployment-summary-DswOl_9E-C03NJ98H.mjs";
2
2
  //#region ../../0-framework/3-tooling/cli/dist/report.mjs
3
3
  /** Gap between the deepest tree label and the entity column. */
4
4
  const LABEL_GAP = 3;
@@ -1 +1 @@
1
- {"version":3,"file":"report.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/report.mjs"],"sourcesContent":["import { r as writeDeploymentSummaryFile } from \"./deployment-summary-r47O6kFr.mjs\";\n//#region src/render-deployment.ts\n/** Gap between the deepest tree label and the entity column. */\nconst LABEL_GAP = 3;\nconst emptyNode = (segment) => ({\n\tsegment,\n\tchildren: /* @__PURE__ */ new Map()\n});\n/** Builds the address tree, splitting each dot-address into its segments. */\nfunction buildTree(nodes) {\n\tconst root = emptyNode(\"\");\n\tfor (const deployed of nodes) {\n\t\tlet node = root;\n\t\tfor (const segment of deployed.address.split(\".\")) {\n\t\t\tlet child = node.children.get(segment);\n\t\t\tif (child === void 0) {\n\t\t\t\tchild = emptyNode(segment);\n\t\t\t\tnode.children.set(segment, child);\n\t\t\t}\n\t\t\tnode = child;\n\t\t}\n\t\tnode.deployed = deployed;\n\t}\n\treturn root;\n}\n/** Flattens the tree to rows in address order, drawing the box guides. */\nfunction toRows(node, guides, rows) {\n\tconst children = Array.from(node.children.values());\n\tchildren.forEach((child, index) => {\n\t\tconst isLast = index === children.length - 1;\n\t\trows.push({\n\t\t\tlabel: `${guides}${isLast ? \"└─ \" : \"├─ \"}${child.segment}`,\n\t\t\tcontinuation: `${guides}${isLast ? \" \" : \"│ \"}`,\n\t\t\tdeployed: child.deployed\n\t\t});\n\t\ttoRows(child, `${guides}${isLast ? \" \" : \"│ \"}`, rows);\n\t});\n}\n/** `kind id` — the one line an entity gets. */\nconst entityLine = (entity) => `${entity.kind} ${entity.id}`;\n/** Pads `prefix` out to `width`, so every entity starts in the same column. */\nconst pad = (prefix, width) => prefix.padEnd(width, \" \");\n/**\n* Renders a deploy's result as the app's own topology. Pure — returns the\n* string; the caller prints.\n*/\nfunction renderDeployment(result) {\n\tconst rows = [];\n\ttoRows(buildTree(result.nodes), \"\", rows);\n\tconst column = Math.max(0, ...rows.map((row) => row.label.length)) + LABEL_GAP;\n\tconst lines = [result.app];\n\tfor (const row of rows) {\n\t\tif (row.deployed === void 0) {\n\t\t\tlines.push(row.label);\n\t\t\tcontinue;\n\t\t}\n\t\tif (row.deployed.entities.length === 0) {\n\t\t\tlines.push(`${pad(row.label, column)}(no entities reported)`);\n\t\t\tcontinue;\n\t\t}\n\t\trow.deployed.entities.forEach((entity, index) => {\n\t\t\tconst prefix = index === 0 ? row.label : row.continuation;\n\t\t\tlines.push(`${pad(prefix, column)}${entityLine(entity)}`);\n\t\t\tif (entity.url !== void 0) lines.push(`${pad(row.continuation, column)}${entity.url}`);\n\t\t\tfor (const [key, value] of Object.entries(entity.details ?? {})) {\n\t\t\t\tif (value === \"\") continue;\n\t\t\t\tfor (const line of value.split(\"\\n\")) lines.push(`${pad(row.continuation, column)}${key} ${line}`);\n\t\t\t}\n\t\t});\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* The report hook the generated stack file wires into `LowerOptions`. Prints a\n* leading blank line so the summary separates from alchemy's own apply output,\n* then hands the result to the cross-process writer (deployment-summary.ts).\n*/\nfunction deploymentReport(result) {\n\tconsole.log(\"\");\n\tconsole.log(renderDeployment(result));\n\twriteDeploymentSummaryFile(result);\n}\n//#endregion\nexport { deploymentReport, renderDeployment };\n\n//# sourceMappingURL=report.mjs.map"],"mappings":";;;AAGA,MAAM,YAAY;AAClB,MAAM,aAAa,aAAa;CAC/B;CACA,0BAA0B,IAAI,IAAI;AACnC;;AAEA,SAAS,UAAU,OAAO;CACzB,MAAM,OAAO,UAAU,EAAE;CACzB,KAAK,MAAM,YAAY,OAAO;EAC7B,IAAI,OAAO;EACX,KAAK,MAA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AAU,IAAI,IAAI,QAAQ,IAAI;GAC7C,MAAM,KAAK,GAAG,IAAI,QAAQ,MAAM,IAAI,WAAW,MAAM,GAAG;GACxD,IAAI,OAAO,QAAQ,KAAK,GAAG,MAAM,KAAK,GAAG,IAAI,IAAI,cAAc,MAAM,IAAI,OAAO,KAAK;GACrF,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,WAAW,CAAC,CAAC,GAAG;IAChE,IAAI,UAAU,IAAI;IAClB,KAAK,MAAM,QAAQ,MAAM,MAAM,IAAI,GAAG,MAAM,KAAK,GAAG,IAAI,IAAI,cAAc,MAAM,IAAI,IAAI,GAAG,MAAM;GAClG;EACD,CAAC;CACF;CACA,OAAO,MAAM,KAAK,IAAI;AACvB;;;;;;AAMA,SAAS,iBAAiB,QAAQ;CACjC,QAAQ,IAAI,EAAE;CACd,QAAQ,IAAI,iBAAiB,MAAM,CAAC;CACpC,2BAA2B,MAAM;AAClC"}
1
+ {"version":3,"file":"report.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/report.mjs"],"sourcesContent":["import { r as writeDeploymentSummaryFile } from \"./deployment-summary-DswOl_9E.mjs\";\n//#region src/render-deployment.ts\n/** Gap between the deepest tree label and the entity column. */\nconst LABEL_GAP = 3;\nconst emptyNode = (segment) => ({\n\tsegment,\n\tchildren: /* @__PURE__ */ new Map()\n});\n/** Builds the address tree, splitting each dot-address into its segments. */\nfunction buildTree(nodes) {\n\tconst root = emptyNode(\"\");\n\tfor (const deployed of nodes) {\n\t\tlet node = root;\n\t\tfor (const segment of deployed.address.split(\".\")) {\n\t\t\tlet child = node.children.get(segment);\n\t\t\tif (child === void 0) {\n\t\t\t\tchild = emptyNode(segment);\n\t\t\t\tnode.children.set(segment, child);\n\t\t\t}\n\t\t\tnode = child;\n\t\t}\n\t\tnode.deployed = deployed;\n\t}\n\treturn root;\n}\n/** Flattens the tree to rows in address order, drawing the box guides. */\nfunction toRows(node, guides, rows) {\n\tconst children = Array.from(node.children.values());\n\tchildren.forEach((child, index) => {\n\t\tconst isLast = index === children.length - 1;\n\t\trows.push({\n\t\t\tlabel: `${guides}${isLast ? \"└─ \" : \"├─ \"}${child.segment}`,\n\t\t\tcontinuation: `${guides}${isLast ? \" \" : \"│ \"}`,\n\t\t\tdeployed: child.deployed\n\t\t});\n\t\ttoRows(child, `${guides}${isLast ? \" \" : \"│ \"}`, rows);\n\t});\n}\n/** `kind id` — the one line an entity gets. */\nconst entityLine = (entity) => `${entity.kind} ${entity.id}`;\n/** Pads `prefix` out to `width`, so every entity starts in the same column. */\nconst pad = (prefix, width) => prefix.padEnd(width, \" \");\n/**\n* Renders a deploy's result as the app's own topology. Pure — returns the\n* string; the caller prints.\n*/\nfunction renderDeployment(result) {\n\tconst rows = [];\n\ttoRows(buildTree(result.nodes), \"\", rows);\n\tconst column = Math.max(0, ...rows.map((row) => row.label.length)) + LABEL_GAP;\n\tconst lines = [result.app];\n\tfor (const row of rows) {\n\t\tif (row.deployed === void 0) {\n\t\t\tlines.push(row.label);\n\t\t\tcontinue;\n\t\t}\n\t\tif (row.deployed.entities.length === 0) {\n\t\t\tlines.push(`${pad(row.label, column)}(no entities reported)`);\n\t\t\tcontinue;\n\t\t}\n\t\trow.deployed.entities.forEach((entity, index) => {\n\t\t\tconst prefix = index === 0 ? row.label : row.continuation;\n\t\t\tlines.push(`${pad(prefix, column)}${entityLine(entity)}`);\n\t\t\tif (entity.url !== void 0) lines.push(`${pad(row.continuation, column)}${entity.url}`);\n\t\t\tfor (const [key, value] of Object.entries(entity.details ?? {})) {\n\t\t\t\tif (value === \"\") continue;\n\t\t\t\tfor (const line of value.split(\"\\n\")) lines.push(`${pad(row.continuation, column)}${key} ${line}`);\n\t\t\t}\n\t\t});\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* The report hook the generated stack file wires into `LowerOptions`. Prints a\n* leading blank line so the summary separates from alchemy's own apply output,\n* then hands the result to the cross-process writer (deployment-summary.ts).\n*/\nfunction deploymentReport(result) {\n\tconsole.log(\"\");\n\tconsole.log(renderDeployment(result));\n\twriteDeploymentSummaryFile(result);\n}\n//#endregion\nexport { deploymentReport, renderDeployment };\n\n//# sourceMappingURL=report.mjs.map"],"mappings":";;;AAGA,MAAM,YAAY;AAClB,MAAM,aAAa,aAAa;CAC/B;CACA,0BAA0B,IAAI,IAAI;AACnC;;AAEA,SAAS,UAAU,OAAO;CACzB,MAAM,OAAO,UAAU,EAAE;CACzB,KAAK,MAAM,YAAY,OAAO;EAC7B,IAAI,OAAO;EACX,KAAK,MAAM,WAAW,SAAS,QAAQ,MAAM,GAAG,GAAG;GAClD,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO;GACrC,IAAI,UAAU,KAAK,GAAG;IACrB,QAAQ,UAAU,OAAO;IACzB,KAAK,SAAS,IAAI,SAAS,KAAK;GACjC;GACA,OAAO;EACR;EACA,KAAK,WAAW;CACjB;CACA,OAAO;AACR;;AAEA,SAAS,OAAO,MAAM,QAAQ,MAAM;CACnC,MAAM,WAAW,MAAM,KAAK,KAAK,SAAS,OAAO,CAAC;CAClD,SAAS,SAAS,OAAO,UAAU;EAClC,MAAM,SAAS,UAAU,SAAS,SAAS;EAC3C,KAAK,KAAK;GACT,OAAO,GAAG,SAAS,SAAS,QAAQ,QAAQ,MAAM;GAClD,cAAc,GAAG,SAAS,SAAS,QAAQ;GAC3C,UAAU,MAAM;EACjB,CAAC;EACD,OAAO,OAAO,GAAG,SAAS,SAAS,QAAQ,SAAS,IAAI;CACzD,CAAC;AACF;;AAEA,MAAM,cAAc,WAAW,GAAG,OAAO,KAAK,GAAG,OAAO;;AAExD,MAAM,OAAO,QAAQ,UAAU,OAAO,OAAO,OAAO,GAAG;;;;;AAKvD,SAAS,iBAAiB,QAAQ;CACjC,MAAM,OAAO,CAAC;CACd,OAAO,UAAU,OAAO,KAAK,GAAG,IAAI,IAAI;CACxC,MAAM,SAAS,KAAK,IAAI,GAAG,GAAG,KAAK,KAAK,QAAQ,IAAI,MAAM,MAAM,CAAC,IAAI;CACrE,MAAM,QAAQ,CAAC,OAAO,GAAG;CACzB,KAAK,MAAM,OAAO,MAAM;EACvB,IAAI,IAAI,aAAa,KAAK,GAAG;GAC5B,MAAM,KAAK,IAAI,KAAK;GACpB;EACD;EACA,IAAI,IAAI,SAAS,SAAS,WAAW,GAAG;GACvC,MAAM,KAAK,GAAG,IAAI,IAAI,OAAO,MAAM,EAAE,uBAAuB;GAC5D;EACD;EACA,IAAI,SAAS,SAAS,SAAS,QAAQ,UAAU;GAChD,MAAM,SAAS,UAAU,IAAI,IAAI,QAAQ,IAAI;GAC7C,MAAM,KAAK,GAAG,IAAI,QAAQ,MAAM,IAAI,WAAW,MAAM,GAAG;GACxD,IAAI,OAAO,QAAQ,KAAK,GAAG,MAAM,KAAK,GAAG,IAAI,IAAI,cAAc,MAAM,IAAI,OAAO,KAAK;GACrF,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,WAAW,CAAC,CAAC,GAAG;IAChE,IAAI,UAAU,IAAI;IAClB,KAAK,MAAM,QAAQ,MAAM,MAAM,IAAI,GAAG,MAAM,KAAK,GAAG,IAAI,IAAI,cAAc,MAAM,IAAI,IAAI,GAAG,MAAM;GAClG;EACD,CAAC;CACF;CACA,OAAO,MAAM,KAAK,IAAI;AACvB;;;;;;AAMA,SAAS,iBAAiB,QAAQ;CACjC,QAAQ,IAAI,EAAE;CACd,QAAQ,IAAI,iBAAiB,MAAM,CAAC;CACpC,2BAA2B,MAAM;AAClC"}
@@ -41,6 +41,21 @@ function blindCast(input) {
41
41
  return input;
42
42
  }
43
43
  //#endregion
44
+ //#region ../../0-framework/0-foundation/foundation/dist/internal-error-BIc-ehme.mjs
45
+ /**
46
+ * A bug in Prisma Next, not a user error. Never catch this except at the
47
+ * outermost boundary for crash reporting — an InternalError means an invariant
48
+ * broke and the process cannot reliably continue. User-facing failures use
49
+ * `structuredError` with a dotted code instead.
50
+ */
51
+ var InternalError = class extends Error {
52
+ isPrismaInternalError = true;
53
+ constructor(message, options) {
54
+ super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);
55
+ this.name = "InternalError";
56
+ }
57
+ };
58
+ //#endregion
44
59
  //#region ../../0-framework/0-foundation/foundation/dist/errors.mjs
45
60
  /**
46
61
  * Returns an object with the key/value if value is defined, otherwise an empty object.
@@ -124,8 +139,9 @@ var CliStructuredError = class extends Error {
124
139
  return candidate.name === "CliStructuredError" && typeof candidate.code === "string" && typeof candidate.toEnvelope === "function";
125
140
  }
126
141
  };
142
+ const DOCS_BASE = `https://docs.prisma.io/docs/orm/next/reference/error-reference`;
127
143
  //#endregion
128
- //#region ../../0-framework/3-tooling/cli/dist/shared-CCaR42wo.mjs
144
+ //#region ../../0-framework/3-tooling/cli/dist/shared-BTnATsqm.mjs
129
145
  /**
130
146
  * Deploy preflight (TML-3158): verify that alchemy resolves the exact `effect`
131
147
  * version @prisma/composer pins. Package managers cannot be made to enforce
@@ -208,17 +224,33 @@ function effectMismatchError(found, required) {
208
224
  }
209
225
  };
210
226
  }
211
- /** Runs the preflight from the app's directory; throws DEPS.EFFECT_VERSION_CONFLICT on a mismatched tree, no-op otherwise. */
212
- function checkEffectResolution(cwd) {
227
+ /**
228
+ * Runs the preflight from the app's directory and RETURNS the
229
+ * DEPS.EFFECT_VERSION_CONFLICT error for a mismatched tree; undefined when the
230
+ * tree is healthy or alchemy is not installed.
231
+ *
232
+ * This is the form the config-load machinery uses. The check belongs on the
233
+ * config-load path rather than at import time because that is the first moment
234
+ * anything actually loads alchemy's provider tree — the break it explains —
235
+ * and because a check that runs at import time takes out commands that never
236
+ * touch alchemy at all, help among them.
237
+ */
238
+ function effectResolutionDiagnostic(cwd) {
213
239
  const alchemyDir = findAlchemyPackageDir(cwd);
214
- if (alchemyDir === void 0) return;
240
+ if (alchemyDir === void 0) return void 0;
215
241
  const parts = effectMismatchError(resolveEffectVersionFrom(alchemyDir), requiredEffectVersion(cwd));
216
- if (parts !== void 0) throw new CliStructuredError("DEPS.EFFECT_VERSION_CONFLICT", parts.summary, {
242
+ if (parts === void 0) return void 0;
243
+ return new CliStructuredError("DEPS.EFFECT_VERSION_CONFLICT", parts.summary, {
217
244
  why: parts.why,
218
245
  fix: parts.fix,
219
246
  meta: parts.meta
220
247
  });
221
248
  }
249
+ /** The throwing form, used by the executor-load diagnosis — the one caller left now that the bin runs no start-up preflight of its own. */
250
+ function checkEffectResolution(cwd) {
251
+ const diagnostic = effectResolutionDiagnostic(cwd);
252
+ if (diagnostic !== void 0) throw diagnostic;
253
+ }
222
254
  /**
223
255
  * Reads the execution diagnostics an engine-failure error carries in
224
256
  * `meta.diagnostics`; undefined for every other failure.
@@ -227,7 +259,7 @@ function executionDiagnostics(f) {
227
259
  const diagnostics = f.meta?.["diagnostics"];
228
260
  if (typeof diagnostics !== "object" || diagnostics === null) return void 0;
229
261
  const candidate = blindCast(diagnostics);
230
- if (candidate["exitCode"] !== void 0 && typeof candidate["exitCode"] !== "number" || typeof candidate["stackFilePath"] !== "string" || typeof candidate["reproduceCommand"] !== "string" || typeof candidate["cwd"] !== "string") return;
262
+ if (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;
231
263
  return blindCast(diagnostics);
232
264
  }
233
265
  /**
@@ -260,6 +292,93 @@ function executorLoadFailure(operation, error, cwd) {
260
292
  });
261
293
  }
262
294
  //#endregion
263
- export { CliStructuredError as a, toStructured as i, executionDiagnostics as n, blindCast as o, executorLoadFailure as r, checkEffectResolution as t };
295
+ //#region ../../0-framework/0-foundation/foundation/dist/result.mjs
296
+ /**
297
+ * Generic Result type for representing success or failure outcomes.
298
+ *
299
+ * This is the standard way to return "expected failures" as values rather than
300
+ * throwing exceptions. See docs/Error Handling.md for the full taxonomy.
301
+ *
302
+ * Naming rationale:
303
+ * - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator
304
+ * - `NotOk` avoids collision with domain types like "Failure" or "Error"
305
+ * - `failure` property distinguishes from JS Error semantics
306
+ */
307
+ /**
308
+ * Result class that implements both Ok and NotOk variants.
309
+ */
310
+ var ResultImpl = class ResultImpl {
311
+ ok;
312
+ _value;
313
+ _failure;
314
+ constructor(ok, valueOrFailure) {
315
+ this.ok = ok;
316
+ if (ok) this._value = blindCast(valueOrFailure);
317
+ else this._failure = blindCast(valueOrFailure);
318
+ Object.freeze(this);
319
+ }
320
+ get value() {
321
+ if (!this.ok) throw new InternalError("Cannot access value on NotOk result");
322
+ return this._value;
323
+ }
324
+ get failure() {
325
+ if (this.ok) throw new InternalError("Cannot access failure on Ok result");
326
+ return this._failure;
327
+ }
328
+ /**
329
+ * Creates a successful result.
330
+ */
331
+ static ok(value) {
332
+ return blindCast(new ResultImpl(true, value));
333
+ }
334
+ /**
335
+ * Creates an unsuccessful result.
336
+ */
337
+ static notOk(failure) {
338
+ return blindCast(new ResultImpl(false, failure));
339
+ }
340
+ /**
341
+ * Asserts that this result is Ok and returns the value.
342
+ * Throws if the result is NotOk.
343
+ */
344
+ assertOk() {
345
+ if (!this.ok) throw new InternalError("Expected Ok result but got NotOk");
346
+ return this.value;
347
+ }
348
+ /**
349
+ * Asserts that this result is NotOk and returns the failure.
350
+ * Throws if the result is Ok.
351
+ */
352
+ assertNotOk() {
353
+ if (this.ok) throw new InternalError("Expected NotOk result but got Ok");
354
+ return this.failure;
355
+ }
356
+ };
357
+ /**
358
+ * Creates a successful result.
359
+ */
360
+ function ok(value) {
361
+ return ResultImpl.ok(value);
362
+ }
363
+ /**
364
+ * Creates an unsuccessful result.
365
+ */
366
+ function notOk(failure) {
367
+ return ResultImpl.notOk(failure);
368
+ }
369
+ /**
370
+ * Singleton for void success results.
371
+ * Use this for validation checks that don't produce a value.
372
+ */
373
+ const OK_VOID = ResultImpl.ok(void 0);
374
+ /**
375
+ * Returns a successful void result.
376
+ * Use this for validation checks that don't produce a value.
377
+ */
378
+ function okVoid() {
379
+ return OK_VOID;
380
+ }
381
+ //#endregion
382
+ export { executionDiagnostics as a, CliStructuredError as c, blindCast as d, effectResolutionDiagnostic as i, DOCS_BASE as l, ok as n, executorLoadFailure as o, okVoid as r, toStructured as s, notOk as t, InternalError as u };
264
383
 
265
- //# sourceMappingURL=shared-CCaR42wo-BvegvmA_.mjs.map
384
+ //# sourceMappingURL=result-B4XjxVK6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-B4XjxVK6.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/casts-DpaahrlC.mjs","../../../0-framework/0-foundation/foundation/dist/internal-error-BIc-ehme.mjs","../../../0-framework/0-foundation/foundation/dist/errors.mjs","../../../0-framework/3-tooling/cli/dist/shared-BTnATsqm.mjs","../../../0-framework/0-foundation/foundation/dist/result.mjs"],"sourcesContent":["//#region src/casts.ts\n/**\n* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**\n*\n* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes\n* unnecessary**: tighten an input type, add a runtime check that narrows via a type\n* predicate, restructure a generic so the compiler can see the relationship you're\n* asserting, or use {@link castAs} when the value already satisfies the target type.\n* Only when no rewrite is feasible does `blindCast` become the right answer — and at\n* that point, the `Reason` literal you supply must articulate the compromise in\n* language a reviewer can evaluate.\n*\n* The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,\n* that is not a signal to soften the reason; it is a signal to go back and solve the\n* underlying type-system problem properly. An unconvincing justification is rework,\n* not a free pass.\n*\n* `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses\n* the compiler's checks (the input type is `unknown`, the output type is whatever the\n* caller asks for), but it forces the unsafety to be named at the call site instead of\n* smuggled in via a bare `as`. The `Reason` type parameter exists only at compile\n* time — it is not present in the emitted JavaScript — but it is grep-able and\n* visible to future readers.\n*\n* @example\n* ```typescript\n* const stringValue = blindCast<\n* string,\n* \"JSON.parse returns `unknown`; this field is documented to be a string in the API contract\"\n* >(parsed[key]);\n* ```\n*\n* @typeParam TargetType - The type the caller is asserting the input has.\n* @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.\n* Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.\n*/\nfunction blindCast(input) {\n\treturn input;\n}\n/**\n* Type-checked, runtime pass-through alternative to a bare `as Type` cast.\n*\n* Use `castAs` when the value already satisfies the target type but you want to make\n* the type assertion explicit at the call site — for example, when an inferred type is\n* wider than the type you want to publish, or when a literal object should be tagged\n* with its nominal interface. Unlike {@link blindCast}, the compiler still checks that\n* the value is assignable to the target type, so this helper cannot smuggle in an\n* unsafe assertion.\n*\n* `castAs` exists alongside `blindCast` so authors pick the right name at the call\n* site: a `castAs` is type-checked and benign; a `blindCast` is the unsafe escape\n* hatch. The split makes review faster — readers know which casts to scrutinize and\n* which are pure annotations.\n*\n* @example\n* ```typescript\n* interface FancyObject {\n* key: string;\n* keyTwo: {\n* subKey: string;\n* subKeyTwo: number;\n* };\n* }\n*\n* const typedObject = castAs<FancyObject>({\n* key: 'Chookede',\n* keyTwo: {\n* subKey: 'Choookeeeee',\n* subKeyTwo: 2,\n* },\n* });\n* ```\n*\n* @typeParam Type - The type to constrain and tag the value with. The value must be assignable to `Type`.\n*/\nfunction castAs(value) {\n\treturn value;\n}\n//#endregion\nexport { castAs as n, blindCast as t };\n\n//# sourceMappingURL=casts-DpaahrlC.mjs.map","//#region src/internal-error.ts\n/**\n* A bug in Prisma Next, not a user error. Never catch this except at the\n* outermost boundary for crash reporting — an InternalError means an invariant\n* broke and the process cannot reliably continue. User-facing failures use\n* `structuredError` with a dotted code instead.\n*/\nvar InternalError = class extends Error {\n\tisPrismaInternalError = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"InternalError\";\n\t}\n};\nfunction isInternalError(e) {\n\treturn typeof e === \"object\" && e !== null && \"isPrismaInternalError\" in e && e.isPrismaInternalError === true;\n}\nfunction assertNever(value, message) {\n\tthrow new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`);\n}\n//#endregion\nexport { assertNever as n, isInternalError as r, InternalError as t };\n\n//# sourceMappingURL=internal-error-BIc-ehme.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { n as assertNever, r as isInternalError, t as InternalError } from \"./internal-error-BIc-ehme.mjs\";\n//#region src/defined.ts\n/**\n* Returns an object with the key/value if value is defined, otherwise an empty object.\n*\n* Use with spread to conditionally include optional properties while satisfying\n* exactOptionalPropertyTypes. This is explicit about which properties are optional\n* and won't inadvertently strip other undefined values.\n*\n* @example\n* ```typescript\n* // Instead of:\n* const obj = {\n* required: 'value',\n* ...(optional ? { optional } : {}),\n* };\n*\n* // Use:\n* const obj = {\n* required: 'value',\n* ...ifDefined('optional', optional),\n* };\n* ```\n*/\nfunction ifDefined(key, value) {\n\treturn value !== void 0 ? blindCast({ [key]: value }) : {};\n}\n//#endregion\n//#region src/cli-structured-error.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `./structured-error.ts`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See ADR 239 in\n* prisma/prisma and composer's ADR-0044 for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = blindCast(error);\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n//#endregion\n//#region src/structured-error.ts\nconst STRUCTURED_CODE_RE = /^[A-Z][A-Z0-9]*\\.[A-Z][A-Z0-9_]*$/;\nfunction isStructuredError(e) {\n\treturn typeof e === \"object\" && e !== null && \"code\" in e && typeof e.code === \"string\" && STRUCTURED_CODE_RE.test(e.code) && \"message\" in e && typeof e.message === \"string\";\n}\nfunction structuredError(code, message, options) {\n\tconst error = options?.cause !== void 0 ? new Error(message, { cause: options.cause }) : new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"StructuredError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"where\", options?.where),\n\t\t...ifDefined(\"severity\", options?.severity),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t});\n}\nconst DOCS_BASE = `https://docs.prisma.io/docs/orm/next/reference/error-reference`;\nfunction docsUrlFor(code) {\n\treturn `${DOCS_BASE}#${code}`;\n}\n//#endregion\nexport { CliStructuredError, DOCS_BASE, InternalError, assertNever, docsUrlFor, isInternalError, isStructuredError, structuredError };\n\n//# sourceMappingURL=errors.mjs.map","import { createRequire } from \"node:module\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/check-effect-resolution.ts\n/**\n* Deploy preflight (TML-3158): verify that alchemy resolves the exact `effect`\n* version @prisma/composer pins. Package managers cannot be made to enforce\n* this — alchemy's own peer range accepts newer effect betas, and npm resolves\n* transitive peer conflicts with a warning, not a failure — so a floating\n* `@effect/*` range anywhere in the consumer's tree can hoist a newer effect\n* to the root, where alchemy picks it up and crashes mid-deploy\n* (`TypeError: Schedule.either is not a function`). This check turns that\n* silent break into a start-up error naming the fix.\n*/\n/** Walks up from `startDir` looking for `node_modules/alchemy` (mirrors resolveAlchemyBin). Undefined when absent — the check skips rather than second-guessing later, clearer failures. */\nfunction findAlchemyPackageDir(startDir) {\n\tlet dir = startDir;\n\twhile (true) {\n\t\tconst candidate = path.join(dir, \"node_modules\", \"alchemy\");\n\t\tif (fs.existsSync(path.join(candidate, \"package.json\"))) return candidate;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return void 0;\n\t\tdir = parent;\n\t}\n}\n/**\n* The `effect` version Node gives `packageDir`'s code, resolved exactly as\n* Node would: from the package's real path (so pnpm symlink layouts resolve\n* from the package's own store position, like at runtime). Undefined when\n* `effect` is not resolvable from there.\n*/\nfunction resolveEffectVersionFrom(packageDir) {\n\tlet entry;\n\ttry {\n\t\tentry = createRequire(path.join(fs.realpathSync(packageDir), \"noop.js\")).resolve(\"effect\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet dir = path.dirname(entry);\n\twhile (!fs.existsSync(path.join(dir, \"package.json\"))) {\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return void 0;\n\t\tdir = parent;\n\t}\n\tconst version = JSON.parse(fs.readFileSync(path.join(dir, \"package.json\"), \"utf-8\")).version;\n\treturn typeof version === \"string\" ? version : void 0;\n}\n/**\n* The `effect` version @prisma/composer pins, read from its own installed\n* package.json — the single source of truth; never hardcoded here. Undefined\n* when @prisma/composer is not resolvable from `startDir` (e.g. the CLI is\n* driven some other way), in which case the check skips.\n*\n* Assumes the pin is an exact version — effectMismatchError compares with\n* `===`, which scripts/check-npm-effect-resolution.mjs enforces in CI;\n* relaxing the pin to a range means revisiting that comparison.\n*/\nfunction requiredEffectVersion(startDir) {\n\tlet manifestPath;\n\ttry {\n\t\tmanifestPath = createRequire(path.join(startDir, \"noop.js\")).resolve(\"@prisma/composer/package.json\");\n\t} catch {\n\t\treturn;\n\t}\n\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf-8\"));\n\tif (typeof manifest !== \"object\" || manifest === null || !(\"dependencies\" in manifest)) return;\n\tconst dependencies = manifest.dependencies;\n\tif (typeof dependencies !== \"object\" || dependencies === null || !(\"effect\" in dependencies)) return;\n\tconst version = dependencies.effect;\n\treturn typeof version === \"string\" ? version : void 0;\n}\n/** Pure comparison + parts rendering, separated so tests cover the rule without a filesystem. Returns the structured error parts, or undefined when the tree is healthy or either side is unknown. */\nfunction effectMismatchError(found, required) {\n\tif (found === void 0 || required === void 0 || found === required) return void 0;\n\treturn {\n\t\tsummary: `Dependency conflict: alchemy resolves effect@${found}, but @prisma/composer requires effect@${required}.`,\n\t\twhy: \"Your package manager installed a second effect that alchemy picks up; deploying with it would crash inside alchemy.\",\n\t\tfix: `Add this to your app's package.json, then reinstall:\n\n \"overrides\": { \"effect\": \"${required}\" }\\n\\n(npm uses \"overrides\"; yarn calls it \"resolutions\", pnpm \"pnpm.overrides\".)`,\n\t\tmeta: {\n\t\t\tfound,\n\t\t\trequired\n\t\t}\n\t};\n}\n/**\n* Runs the preflight from the app's directory and RETURNS the\n* DEPS.EFFECT_VERSION_CONFLICT error for a mismatched tree; undefined when the\n* tree is healthy or alchemy is not installed.\n*\n* This is the form the config-load machinery uses. The check belongs on the\n* config-load path rather than at import time because that is the first moment\n* anything actually loads alchemy's provider tree — the break it explains —\n* and because a check that runs at import time takes out commands that never\n* touch alchemy at all, help among them.\n*/\nfunction effectResolutionDiagnostic(cwd) {\n\tconst alchemyDir = findAlchemyPackageDir(cwd);\n\tif (alchemyDir === void 0) return void 0;\n\tconst parts = effectMismatchError(resolveEffectVersionFrom(alchemyDir), requiredEffectVersion(cwd));\n\tif (parts === void 0) return void 0;\n\treturn new CliStructuredError(\"DEPS.EFFECT_VERSION_CONFLICT\", parts.summary, {\n\t\twhy: parts.why,\n\t\tfix: parts.fix,\n\t\tmeta: parts.meta\n\t});\n}\n/** The throwing form, used by the executor-load diagnosis — the one caller left now that the bin runs no start-up preflight of its own. */\nfunction checkEffectResolution(cwd) {\n\tconst diagnostic = effectResolutionDiagnostic(cwd);\n\tif (diagnostic !== void 0) throw diagnostic;\n}\n//#endregion\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/** Diagnoses a failed executor import: when the app's tree resolves a\n* mismatched `effect` (the known way that import breaks), the failure is the\n* fix-naming DEPS.EFFECT_VERSION_CONFLICT from checkEffectResolution with the\n* import error riding as cause; otherwise DEPS.EXECUTOR_UNLOADABLE — an\n* environmental failure of the consumer's installed tree, not a bug here. */\nfunction executorLoadFailure(operation, error, cwd) {\n\ttry {\n\t\tcheckEffectResolution(cwd);\n\t} catch (diagnostic) {\n\t\tif (CliStructuredError.is(diagnostic)) return new CliStructuredError(diagnostic.code, diagnostic.message, {\n\t\t\t...diagnostic.why !== void 0 ? { why: diagnostic.why } : {},\n\t\t\t...diagnostic.fix !== void 0 ? { fix: diagnostic.fix } : {},\n\t\t\t...diagnostic.meta !== void 0 ? { meta: diagnostic.meta } : {},\n\t\t\tcause: error\n\t\t});\n\t}\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\nexport { effectResolutionDiagnostic as i, executorLoadFailure as n, toStructured as r, executionDiagnostics as t };\n\n//# sourceMappingURL=shared-BTnATsqm.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-BIc-ehme.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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