@prisma/composer-cli 0.25.0 → 0.26.0-dev.2

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 (56) hide show
  1. package/dist/composer-config-CY9fET8H-KpGjlYgO.mjs +432 -0
  2. package/dist/composer-config-CY9fET8H-KpGjlYgO.mjs.map +1 -0
  3. package/dist/{pipeline-C7gNjMzJ-CMqZQxqM.mjs → container-transport-HcvNOGZL-CHqecFc7.mjs} +109 -322
  4. package/dist/container-transport-HcvNOGZL-CHqecFc7.mjs.map +1 -0
  5. package/dist/{execute-deploy-destroy-CvKCwVkD-B3vcxYJF.mjs → execute-deploy-destroy-c0eko3AO-9npuGXd3.mjs} +108 -85
  6. package/dist/execute-deploy-destroy-c0eko3AO-9npuGXd3.mjs.map +1 -0
  7. package/dist/{execute-dev-BLCK5wF7-CuzMSK7T.mjs → execute-dev-BICPaq1g-CSoZJuhB.mjs} +162 -132
  8. package/dist/execute-dev-BICPaq1g-CSoZJuhB.mjs.map +1 -0
  9. package/dist/{family-B1RaH4f8-ChoTnv3A.d.mts → family-CgeZQdNg-gH8LuqqL.d.mts} +136 -172
  10. package/dist/family-CgeZQdNg-gH8LuqqL.d.mts.map +1 -0
  11. package/dist/family.d.mts +4 -39
  12. package/dist/family.d.mts.map +1 -1
  13. package/dist/family.mjs +49 -551
  14. package/dist/family.mjs.map +1 -1
  15. package/dist/generate-dev-stack-BUadNY_w-DF_lHVaP.mjs +87 -0
  16. package/dist/generate-dev-stack-BUadNY_w-DF_lHVaP.mjs.map +1 -0
  17. package/dist/run-alchemy-BEvB2sYQ-BgV2deuO.mjs +154 -0
  18. package/dist/run-alchemy-BEvB2sYQ-BgV2deuO.mjs.map +1 -0
  19. package/dist/testing.d.mts +24 -24
  20. package/dist/testing.d.mts.map +1 -1
  21. package/dist/testing.mjs +17 -45
  22. package/dist/testing.mjs.map +1 -1
  23. package/package.json +7 -11
  24. package/src/exports/testing.ts +5 -3
  25. package/dist/bin.mjs +0 -1040
  26. package/dist/bin.mjs.map +0 -1
  27. package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs +0 -34
  28. package/dist/container-transport-HcvNOGZL-CIoZc7Rs.mjs.map +0 -1
  29. package/dist/execute-deploy-destroy-CvKCwVkD-B3vcxYJF.mjs.map +0 -1
  30. package/dist/execute-deploy-destroy-CvKCwVkD-DCufHnkW.mjs +0 -528
  31. package/dist/execute-deploy-destroy-CvKCwVkD-DCufHnkW.mjs.map +0 -1
  32. package/dist/execute-dev-BLCK5wF7-B-fG_E31.mjs +0 -2011
  33. package/dist/execute-dev-BLCK5wF7-B-fG_E31.mjs.map +0 -1
  34. package/dist/execute-dev-BLCK5wF7-CuzMSK7T.mjs.map +0 -1
  35. package/dist/execute-log-B_zCJ17b-BrLUt7vo.mjs +0 -157
  36. package/dist/execute-log-B_zCJ17b-BrLUt7vo.mjs.map +0 -1
  37. package/dist/execute-log-B_zCJ17b-C4a0uxJj.mjs +0 -158
  38. package/dist/execute-log-B_zCJ17b-C4a0uxJj.mjs.map +0 -1
  39. package/dist/family-B1RaH4f8-ChoTnv3A.d.mts.map +0 -1
  40. package/dist/local-target-BOGjATc2.mjs +0 -68
  41. package/dist/local-target-BOGjATc2.mjs.map +0 -1
  42. package/dist/local-target-hoEGqgVA.mjs +0 -68
  43. package/dist/local-target-hoEGqgVA.mjs.map +0 -1
  44. package/dist/pipeline-C7gNjMzJ-CMqZQxqM.mjs.map +0 -1
  45. package/dist/pipeline-C7gNjMzJ-CixaMvnR.mjs +0 -1205
  46. package/dist/pipeline-C7gNjMzJ-CixaMvnR.mjs.map +0 -1
  47. package/dist/result-B874OKwb.mjs +0 -383
  48. package/dist/result-B874OKwb.mjs.map +0 -1
  49. package/dist/result-sR7PBi61.mjs +0 -229
  50. package/dist/result-sR7PBi61.mjs.map +0 -1
  51. package/dist/run-alchemy-pANK8XNX-BH1wC0r6.mjs +0 -99
  52. package/dist/run-alchemy-pANK8XNX-BH1wC0r6.mjs.map +0 -1
  53. package/dist/run-alchemy-pANK8XNX-XcCQncKN.mjs +0 -99
  54. package/dist/run-alchemy-pANK8XNX-XcCQncKN.mjs.map +0 -1
  55. package/dist/shared-BTnATsqm-BH4axbJg.mjs +0 -158
  56. package/dist/shared-BTnATsqm-BH4axbJg.mjs.map +0 -1
@@ -0,0 +1,432 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ //#region ../../0-framework/0-foundation/foundation/dist/casts-DpaahrlC.mjs
4
+ /**
5
+ * **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**
6
+ *
7
+ * Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes
8
+ * unnecessary**: tighten an input type, add a runtime check that narrows via a type
9
+ * predicate, restructure a generic so the compiler can see the relationship you're
10
+ * asserting, or use {@link castAs} when the value already satisfies the target type.
11
+ * Only when no rewrite is feasible does `blindCast` become the right answer — and at
12
+ * that point, the `Reason` literal you supply must articulate the compromise in
13
+ * language a reviewer can evaluate.
14
+ *
15
+ * The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,
16
+ * that is not a signal to soften the reason; it is a signal to go back and solve the
17
+ * underlying type-system problem properly. An unconvincing justification is rework,
18
+ * not a free pass.
19
+ *
20
+ * `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses
21
+ * the compiler's checks (the input type is `unknown`, the output type is whatever the
22
+ * caller asks for), but it forces the unsafety to be named at the call site instead of
23
+ * smuggled in via a bare `as`. The `Reason` type parameter exists only at compile
24
+ * time — it is not present in the emitted JavaScript — but it is grep-able and
25
+ * visible to future readers.
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const stringValue = blindCast<
30
+ * string,
31
+ * "JSON.parse returns `unknown`; this field is documented to be a string in the API contract"
32
+ * >(parsed[key]);
33
+ * ```
34
+ *
35
+ * @typeParam TargetType - The type the caller is asserting the input has.
36
+ * @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.
37
+ * Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.
38
+ */
39
+ function blindCast(input) {
40
+ return input;
41
+ }
42
+ //#endregion
43
+ //#region ../../0-framework/0-foundation/foundation/dist/internal-error-Dfur7Zqt.mjs
44
+ /**
45
+ * A bug in Prisma ORM, not a user error. Never catch this except at the
46
+ * outermost boundary for crash reporting — an InternalError means an invariant
47
+ * broke and the process cannot reliably continue. User-facing failures use
48
+ * `structuredError` with a dotted code instead.
49
+ */
50
+ var InternalError = class extends Error {
51
+ isPrismaInternalError = true;
52
+ constructor(message, options) {
53
+ super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);
54
+ this.name = "InternalError";
55
+ }
56
+ };
57
+ //#endregion
58
+ //#region ../../0-framework/0-foundation/foundation/dist/result.mjs
59
+ /**
60
+ * Generic Result type for representing success or failure outcomes.
61
+ *
62
+ * This is the standard way to return "expected failures" as values rather than
63
+ * throwing exceptions. See docs/Error Handling.md for the full taxonomy.
64
+ *
65
+ * Naming rationale:
66
+ * - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator
67
+ * - `NotOk` avoids collision with domain types like "Failure" or "Error"
68
+ * - `failure` property distinguishes from JS Error semantics
69
+ */
70
+ /**
71
+ * Result class that implements both Ok and NotOk variants.
72
+ */
73
+ var ResultImpl = class ResultImpl {
74
+ ok;
75
+ _value;
76
+ _failure;
77
+ constructor(ok, valueOrFailure) {
78
+ this.ok = ok;
79
+ if (ok) this._value = blindCast(valueOrFailure);
80
+ else this._failure = blindCast(valueOrFailure);
81
+ Object.freeze(this);
82
+ }
83
+ get value() {
84
+ if (!this.ok) throw new InternalError("Cannot access value on NotOk result");
85
+ return this._value;
86
+ }
87
+ get failure() {
88
+ if (this.ok) throw new InternalError("Cannot access failure on Ok result");
89
+ return this._failure;
90
+ }
91
+ /**
92
+ * Creates a successful result.
93
+ */
94
+ static ok(value) {
95
+ return blindCast(new ResultImpl(true, value));
96
+ }
97
+ /**
98
+ * Creates an unsuccessful result.
99
+ */
100
+ static notOk(failure) {
101
+ return blindCast(new ResultImpl(false, failure));
102
+ }
103
+ /**
104
+ * Asserts that this result is Ok and returns the value.
105
+ * Throws if the result is NotOk.
106
+ */
107
+ assertOk() {
108
+ if (!this.ok) throw new InternalError("Expected Ok result but got NotOk");
109
+ return this.value;
110
+ }
111
+ /**
112
+ * Asserts that this result is NotOk and returns the failure.
113
+ * Throws if the result is Ok.
114
+ */
115
+ assertNotOk() {
116
+ if (this.ok) throw new InternalError("Expected NotOk result but got Ok");
117
+ return this.failure;
118
+ }
119
+ };
120
+ /**
121
+ * Creates a successful result.
122
+ */
123
+ function ok(value) {
124
+ return ResultImpl.ok(value);
125
+ }
126
+ /**
127
+ * Creates an unsuccessful result.
128
+ */
129
+ function notOk(failure) {
130
+ return ResultImpl.notOk(failure);
131
+ }
132
+ /**
133
+ * Singleton for void success results.
134
+ * Use this for validation checks that don't produce a value.
135
+ */
136
+ const OK_VOID = ResultImpl.ok(void 0);
137
+ /**
138
+ * Returns a successful void result.
139
+ * Use this for validation checks that don't produce a value.
140
+ */
141
+ function okVoid() {
142
+ return OK_VOID;
143
+ }
144
+ //#endregion
145
+ //#region ../../0-framework/0-foundation/foundation/dist/errors.mjs
146
+ /**
147
+ * Returns an object with the key/value if value is defined, otherwise an empty object.
148
+ *
149
+ * Use with spread to conditionally include optional properties while satisfying
150
+ * exactOptionalPropertyTypes. This is explicit about which properties are optional
151
+ * and won't inadvertently strip other undefined values.
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * // Instead of:
156
+ * const obj = {
157
+ * required: 'value',
158
+ * ...(optional ? { optional } : {}),
159
+ * };
160
+ *
161
+ * // Use:
162
+ * const obj = {
163
+ * required: 'value',
164
+ * ...ifDefined('optional', optional),
165
+ * };
166
+ * ```
167
+ */
168
+ function ifDefined(key, value) {
169
+ return value !== void 0 ? blindCast({ [key]: value }) : {};
170
+ }
171
+ /**
172
+ * Structured CLI error that contains all information needed for error envelopes.
173
+ * Call sites throw these errors with full context.
174
+ *
175
+ * A `CliStructuredError` is a `StructuredError` (see
176
+ * `./structured-error.ts`): `code` is a dotted
177
+ * `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's
178
+ * category — there is no separate `domain` field. See ADR 239 in
179
+ * prisma/prisma and composer's ADR-0044 for the namespace taxonomy.
180
+ */
181
+ var CliStructuredError = class extends Error {
182
+ code;
183
+ severity;
184
+ constructor(code, summary, options) {
185
+ super(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);
186
+ this.name = "CliStructuredError";
187
+ this.code = code;
188
+ this.severity = options?.severity ?? "error";
189
+ const fix = options?.fix === options?.why ? void 0 : options?.fix;
190
+ const where = options?.where ? {
191
+ ...ifDefined("path", options.where.path),
192
+ ...ifDefined("line", options.where.line)
193
+ } : void 0;
194
+ Object.assign(this, {
195
+ ...ifDefined("why", options?.why),
196
+ ...ifDefined("fix", fix),
197
+ ...ifDefined("where", where),
198
+ ...ifDefined("meta", options?.meta),
199
+ ...ifDefined("docsUrl", options?.docsUrl)
200
+ });
201
+ }
202
+ /**
203
+ * Converts this error to a CLI error envelope for output formatting.
204
+ */
205
+ toEnvelope() {
206
+ return {
207
+ ok: false,
208
+ code: this.code,
209
+ severity: this.severity,
210
+ summary: this.message,
211
+ ...ifDefined("why", this.why),
212
+ ...ifDefined("fix", this.fix),
213
+ ...ifDefined("where", this.where),
214
+ ...ifDefined("meta", this.meta),
215
+ ...ifDefined("docsUrl", this.docsUrl)
216
+ };
217
+ }
218
+ /**
219
+ * Type guard to check if an error is a CliStructuredError.
220
+ * Uses duck-typing to work across module boundaries where instanceof may fail.
221
+ */
222
+ static is(error) {
223
+ if (!(error instanceof Error)) return false;
224
+ const candidate = blindCast(error);
225
+ return candidate.name === "CliStructuredError" && typeof candidate.code === "string" && typeof candidate.toEnvelope === "function";
226
+ }
227
+ };
228
+ //#endregion
229
+ //#region ../../0-framework/3-tooling/cli/dist/composer-config-CY9fET8H.mjs
230
+ /**
231
+ * What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.
232
+ * It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.
233
+ */
234
+ const SECTION_FIX = "Write `composer: composer({ extensions: [...], state: ... })` in prisma.config.ts, with `import { defineConfig as composer } from '@prisma/composer/config'`.";
235
+ const MOVE_TO_SECTION_FIX = `${SECTION_FIX} If the project has a prisma-composer.config.ts, move its extensions and state into that section and delete the file.`;
236
+ const SECTION_IS_THE_ONLY_SOURCE = "Composer reads its configuration only from the `composer` section of prisma.config.ts.";
237
+ const DESCRIPTOR_FIX = "Use the descriptor the extension factory returns, unchanged, instead of building one by hand.";
238
+ const RETIRED_FILE_NAMES = [
239
+ "ts",
240
+ "mts",
241
+ "mjs",
242
+ "js"
243
+ ].map((extension) => `prisma-composer.config.${extension}`);
244
+ const sectionMissing = {
245
+ code: "CONFIG.SECTION_MISSING",
246
+ summary: "No loaded prisma.config.ts declares a `composer` section.",
247
+ why: `${SECTION_IS_THE_ONLY_SOURCE} A prisma-composer.config.ts file is no longer read.`,
248
+ fix: MOVE_TO_SECTION_FIX
249
+ };
250
+ /** What the generated stack file throws when the file it imports has no `composer` export. */
251
+ function noComposerExportMessage(configFile) {
252
+ return `${configFile} declares no \`composer\` section. Pass the prisma.config.ts that declares it.`;
253
+ }
254
+ function configFileMissing(file) {
255
+ return {
256
+ code: "CONFIG.FILE_MISSING",
257
+ summary: `${file} does not exist.`,
258
+ fix: "Pass the path of the prisma.config.ts that declares the `composer` section.",
259
+ where: file
260
+ };
261
+ }
262
+ /** A prisma-composer.config.* beside the declaring file would otherwise be silently ignored. */
263
+ /** The path with symlinks resolved; the path itself when it cannot be resolved, so the check never throws. */
264
+ function realPath(file) {
265
+ try {
266
+ return fs.realpathSync(file);
267
+ } catch {
268
+ return file;
269
+ }
270
+ }
271
+ function retiredFileFinding(configFile) {
272
+ const directory = path.dirname(realPath(configFile));
273
+ const found = RETIRED_FILE_NAMES.map((name) => path.join(directory, name)).find((file) => fs.existsSync(file));
274
+ if (found === void 0) return void 0;
275
+ return {
276
+ code: "CONFIG.FILE_RETIRED",
277
+ summary: `${found} is no longer read.`,
278
+ why: SECTION_IS_THE_ONLY_SOURCE,
279
+ fix: MOVE_TO_SECTION_FIX,
280
+ where: found
281
+ };
282
+ }
283
+ function isObject(value) {
284
+ return typeof value === "object" && value !== null && !Array.isArray(value);
285
+ }
286
+ function isExtensionDescriptor(value) {
287
+ return isObject(value) && typeof value["id"] === "string" && value["id"].length > 0 && isObject(value["nodes"]);
288
+ }
289
+ function isStateDescriptor(value) {
290
+ return isObject(value) && typeof value["extension"] === "string" && typeof value["create"] === "function";
291
+ }
292
+ const stateInvalid = {
293
+ code: "CONFIG.FIELD_INVALID",
294
+ summary: "`composer.state` must be a state descriptor with a string `extension` and a `create` function.",
295
+ fix: "Set `state` to the state descriptor an extension provides, e.g. `state: prismaState()`.",
296
+ field: "state"
297
+ };
298
+ function unknownField(key) {
299
+ return {
300
+ code: "CONFIG.FIELD_UNKNOWN",
301
+ summary: `The \`composer\` section has no field \`${key}\`.`,
302
+ fix: key === "composer" ? "Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `extensions` and `state`." : `Remove \`${key}\`. The section takes only \`extensions\` and \`state\`.`,
303
+ field: key
304
+ };
305
+ }
306
+ function checkExtensions(value) {
307
+ if (!Array.isArray(value)) return {
308
+ extensions: [],
309
+ findings: [{
310
+ code: "CONFIG.FIELD_INVALID",
311
+ summary: "`composer.extensions` must be an array of extension descriptors.",
312
+ fix: "Set `extensions` to the descriptors your extensions provide, e.g. `extensions: [nodeBuild()]`.",
313
+ field: "extensions"
314
+ }]
315
+ };
316
+ const findings = [];
317
+ const extensions = [];
318
+ const seen = /* @__PURE__ */ new Set();
319
+ for (const [index, entry] of value.entries()) {
320
+ const field = `extensions[${index}]`;
321
+ if (!isObject(entry)) {
322
+ findings.push({
323
+ code: "CONFIG.FIELD_INVALID",
324
+ summary: `\`composer.${field}\` must be an extension descriptor object.`,
325
+ fix: "Put the descriptor an extension factory returns here, e.g. `nodeBuild()`, not the factory itself.",
326
+ field
327
+ });
328
+ continue;
329
+ }
330
+ const id = entry["id"];
331
+ if (typeof id !== "string" || id.length === 0) findings.push({
332
+ code: "CONFIG.FIELD_INVALID",
333
+ summary: `\`composer.${field}.id\` must be a non-empty string (the extension package name).`,
334
+ fix: DESCRIPTOR_FIX,
335
+ field: `${field}.id`
336
+ });
337
+ else if (seen.has(id)) findings.push({
338
+ code: "CONFIG.EXTENSION_DUPLICATE",
339
+ summary: `Extension "${id}" is listed more than once in \`composer.extensions\`.`,
340
+ fix: `Remove the repeated "${id}" entry from \`extensions\`.`,
341
+ field: `${field}.id`
342
+ });
343
+ else seen.add(id);
344
+ if (!isObject(entry["nodes"])) findings.push({
345
+ code: "CONFIG.FIELD_INVALID",
346
+ summary: `\`composer.${field}.nodes\` must be an object (the node-ID → control registry).`,
347
+ fix: DESCRIPTOR_FIX,
348
+ field: `${field}.nodes`
349
+ });
350
+ if (isExtensionDescriptor(entry)) extensions.push(entry);
351
+ }
352
+ return {
353
+ findings,
354
+ extensions
355
+ };
356
+ }
357
+ function checkFields(section) {
358
+ if (Object.hasOwn(section, "configPath")) return {
359
+ ok: false,
360
+ findings: [{
361
+ code: "CONFIG.FIELD_RETIRED",
362
+ summary: "`composer.configPath` is no longer supported: prisma-composer.config.ts is no longer read.",
363
+ why: SECTION_IS_THE_ONLY_SOURCE,
364
+ fix: `Replace \`configPath\` with the section itself. ${MOVE_TO_SECTION_FIX}`,
365
+ field: "configPath"
366
+ }]
367
+ };
368
+ if (Object.hasOwn(section, "composer")) return {
369
+ ok: false,
370
+ findings: [unknownField("composer")]
371
+ };
372
+ const findings = Object.keys(section).filter((key) => key !== "extensions" && key !== "state").map(unknownField);
373
+ const checked = checkExtensions(section["extensions"]);
374
+ findings.push(...checked.findings);
375
+ const state = section["state"];
376
+ if (!isStateDescriptor(state)) findings.push(stateInvalid);
377
+ const [first, ...rest] = findings;
378
+ if (first === void 0 && isStateDescriptor(state)) return {
379
+ ok: true,
380
+ value: {
381
+ extensions: checked.extensions,
382
+ state
383
+ }
384
+ };
385
+ return {
386
+ ok: false,
387
+ findings: [first ?? stateInvalid, ...rest]
388
+ };
389
+ }
390
+ /**
391
+ * Checks the fields that identify each descriptor and returns the descriptors as the config file's own objects.
392
+ * Never throws: a section's values are user code, and a throwing getter or Proxy trap becomes a finding.
393
+ */
394
+ function checkComposerSection(raw) {
395
+ if (!isObject(raw)) return {
396
+ ok: false,
397
+ findings: [{
398
+ code: "CONFIG.FIELD_INVALID",
399
+ summary: "The `composer` section of prisma.config.ts must be an object.",
400
+ fix: SECTION_FIX
401
+ }]
402
+ };
403
+ try {
404
+ return checkFields({ ...raw });
405
+ } catch (cause) {
406
+ return {
407
+ ok: false,
408
+ findings: [{
409
+ code: "CONFIG.FIELD_INVALID",
410
+ summary: "The `composer` section of prisma.config.ts could not be read.",
411
+ why: `Reading it threw: ${cause instanceof Error ? cause.message : String(cause)}`,
412
+ fix: SECTION_FIX
413
+ }]
414
+ };
415
+ }
416
+ }
417
+ /**
418
+ * The whole check, shared by the section validator and the programmatic operations so both report the same findings in the same order: the retired file beside the declaring `configFile` (resolved through symlinks), then every field finding.
419
+ */
420
+ function checkComposerConfig(raw, configFile) {
421
+ const retired = retiredFileFinding(configFile);
422
+ const checked = checkComposerSection(raw);
423
+ if (retired === void 0) return checked;
424
+ return {
425
+ ok: false,
426
+ findings: checked.ok ? [retired] : [retired, ...checked.findings]
427
+ };
428
+ }
429
+ //#endregion
430
+ export { CliStructuredError as a, okVoid as c, sectionMissing as i, InternalError as l, configFileMissing as n, notOk as o, noComposerExportMessage as r, ok as s, checkComposerConfig as t, blindCast as u };
431
+
432
+ //# sourceMappingURL=composer-config-CY9fET8H-KpGjlYgO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composer-config-CY9fET8H-KpGjlYgO.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/casts-DpaahrlC.mjs","../../../0-framework/0-foundation/foundation/dist/internal-error-Dfur7Zqt.mjs","../../../0-framework/0-foundation/foundation/dist/result.mjs","../../../0-framework/0-foundation/foundation/dist/errors.mjs","../../../0-framework/3-tooling/cli/dist/composer-config-CY9fET8H.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 ORM, 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-Dfur7Zqt.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-Dfur7Zqt.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","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { n as assertNever, r as isInternalError, t as InternalError } from \"./internal-error-Dfur7Zqt.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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/composer-config.ts\n/**\n* What makes a `composer` section valid, shared by the CLI's section validator and the programmatic operations.\n* It imports nothing from the CLI engine, because `@prisma/composer` must not depend on it.\n*/\nconst SECTION_FIX = \"Write `composer: composer({ extensions: [...], state: ... })` in prisma.config.ts, with `import { defineConfig as composer } from '@prisma/composer/config'`.\";\nconst MOVE_TO_SECTION_FIX = `${SECTION_FIX} If the project has a prisma-composer.config.ts, move its extensions and state into that section and delete the file.`;\nconst SECTION_IS_THE_ONLY_SOURCE = \"Composer reads its configuration only from the `composer` section of prisma.config.ts.\";\nconst DESCRIPTOR_FIX = \"Use the descriptor the extension factory returns, unchanged, instead of building one by hand.\";\nconst RETIRED_FILE_NAMES = [\n\t\"ts\",\n\t\"mts\",\n\t\"mjs\",\n\t\"js\"\n].map((extension) => `prisma-composer.config.${extension}`);\nconst sectionMissing = {\n\tcode: \"CONFIG.SECTION_MISSING\",\n\tsummary: \"No loaded prisma.config.ts declares a `composer` section.\",\n\twhy: `${SECTION_IS_THE_ONLY_SOURCE} A prisma-composer.config.ts file is no longer read.`,\n\tfix: MOVE_TO_SECTION_FIX\n};\n/** What the generated stack file throws when the file it imports has no `composer` export. */\nfunction noComposerExportMessage(configFile) {\n\treturn `${configFile} declares no \\`composer\\` section. Pass the prisma.config.ts that declares it.`;\n}\nfunction configFileMissing(file) {\n\treturn {\n\t\tcode: \"CONFIG.FILE_MISSING\",\n\t\tsummary: `${file} does not exist.`,\n\t\tfix: \"Pass the path of the prisma.config.ts that declares the `composer` section.\",\n\t\twhere: file\n\t};\n}\n/** A prisma-composer.config.* beside the declaring file would otherwise be silently ignored. */\n/** The path with symlinks resolved; the path itself when it cannot be resolved, so the check never throws. */\nfunction realPath(file) {\n\ttry {\n\t\treturn fs.realpathSync(file);\n\t} catch {\n\t\treturn file;\n\t}\n}\nfunction retiredFileFinding(configFile) {\n\tconst directory = path.dirname(realPath(configFile));\n\tconst found = RETIRED_FILE_NAMES.map((name) => path.join(directory, name)).find((file) => fs.existsSync(file));\n\tif (found === void 0) return void 0;\n\treturn {\n\t\tcode: \"CONFIG.FILE_RETIRED\",\n\t\tsummary: `${found} is no longer read.`,\n\t\twhy: SECTION_IS_THE_ONLY_SOURCE,\n\t\tfix: MOVE_TO_SECTION_FIX,\n\t\twhere: found\n\t};\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isExtensionDescriptor(value) {\n\treturn isObject(value) && typeof value[\"id\"] === \"string\" && value[\"id\"].length > 0 && isObject(value[\"nodes\"]);\n}\nfunction isStateDescriptor(value) {\n\treturn isObject(value) && typeof value[\"extension\"] === \"string\" && typeof value[\"create\"] === \"function\";\n}\nconst stateInvalid = {\n\tcode: \"CONFIG.FIELD_INVALID\",\n\tsummary: \"`composer.state` must be a state descriptor with a string `extension` and a `create` function.\",\n\tfix: \"Set `state` to the state descriptor an extension provides, e.g. `state: prismaState()`.\",\n\tfield: \"state\"\n};\nfunction unknownField(key) {\n\treturn {\n\t\tcode: \"CONFIG.FIELD_UNKNOWN\",\n\t\tsummary: `The \\`composer\\` section has no field \\`${key}\\`.`,\n\t\tfix: key === \"composer\" ? \"Pass the `composer` property of the prisma.config.ts export, not the whole export. The section takes only `extensions` and `state`.\" : `Remove \\`${key}\\`. The section takes only \\`extensions\\` and \\`state\\`.`,\n\t\tfield: key\n\t};\n}\nfunction checkExtensions(value) {\n\tif (!Array.isArray(value)) return {\n\t\textensions: [],\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: \"`composer.extensions` must be an array of extension descriptors.\",\n\t\t\tfix: \"Set `extensions` to the descriptors your extensions provide, e.g. `extensions: [nodeBuild()]`.\",\n\t\t\tfield: \"extensions\"\n\t\t}]\n\t};\n\tconst findings = [];\n\tconst extensions = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const [index, entry] of value.entries()) {\n\t\tconst field = `extensions[${index}]`;\n\t\tif (!isObject(entry)) {\n\t\t\tfindings.push({\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tsummary: `\\`composer.${field}\\` must be an extension descriptor object.`,\n\t\t\t\tfix: \"Put the descriptor an extension factory returns here, e.g. `nodeBuild()`, not the factory itself.\",\n\t\t\t\tfield\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst id = entry[\"id\"];\n\t\tif (typeof id !== \"string\" || id.length === 0) findings.push({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: `\\`composer.${field}.id\\` must be a non-empty string (the extension package name).`,\n\t\t\tfix: DESCRIPTOR_FIX,\n\t\t\tfield: `${field}.id`\n\t\t});\n\t\telse if (seen.has(id)) findings.push({\n\t\t\tcode: \"CONFIG.EXTENSION_DUPLICATE\",\n\t\t\tsummary: `Extension \"${id}\" is listed more than once in \\`composer.extensions\\`.`,\n\t\t\tfix: `Remove the repeated \"${id}\" entry from \\`extensions\\`.`,\n\t\t\tfield: `${field}.id`\n\t\t});\n\t\telse seen.add(id);\n\t\tif (!isObject(entry[\"nodes\"])) findings.push({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: `\\`composer.${field}.nodes\\` must be an object (the node-ID → control registry).`,\n\t\t\tfix: DESCRIPTOR_FIX,\n\t\t\tfield: `${field}.nodes`\n\t\t});\n\t\tif (isExtensionDescriptor(entry)) extensions.push(entry);\n\t}\n\treturn {\n\t\tfindings,\n\t\textensions\n\t};\n}\nfunction checkFields(section) {\n\tif (Object.hasOwn(section, \"configPath\")) return {\n\t\tok: false,\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_RETIRED\",\n\t\t\tsummary: \"`composer.configPath` is no longer supported: prisma-composer.config.ts is no longer read.\",\n\t\t\twhy: SECTION_IS_THE_ONLY_SOURCE,\n\t\t\tfix: `Replace \\`configPath\\` with the section itself. ${MOVE_TO_SECTION_FIX}`,\n\t\t\tfield: \"configPath\"\n\t\t}]\n\t};\n\tif (Object.hasOwn(section, \"composer\")) return {\n\t\tok: false,\n\t\tfindings: [unknownField(\"composer\")]\n\t};\n\tconst findings = Object.keys(section).filter((key) => key !== \"extensions\" && key !== \"state\").map(unknownField);\n\tconst checked = checkExtensions(section[\"extensions\"]);\n\tfindings.push(...checked.findings);\n\tconst state = section[\"state\"];\n\tif (!isStateDescriptor(state)) findings.push(stateInvalid);\n\tconst [first, ...rest] = findings;\n\tif (first === void 0 && isStateDescriptor(state)) return {\n\t\tok: true,\n\t\tvalue: {\n\t\t\textensions: checked.extensions,\n\t\t\tstate\n\t\t}\n\t};\n\treturn {\n\t\tok: false,\n\t\tfindings: [first ?? stateInvalid, ...rest]\n\t};\n}\n/**\n* Checks the fields that identify each descriptor and returns the descriptors as the config file's own objects.\n* Never throws: a section's values are user code, and a throwing getter or Proxy trap becomes a finding.\n*/\nfunction checkComposerSection(raw) {\n\tif (!isObject(raw)) return {\n\t\tok: false,\n\t\tfindings: [{\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tsummary: \"The `composer` section of prisma.config.ts must be an object.\",\n\t\t\tfix: SECTION_FIX\n\t\t}]\n\t};\n\ttry {\n\t\treturn checkFields({ ...raw });\n\t} catch (cause) {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tfindings: [{\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tsummary: \"The `composer` section of prisma.config.ts could not be read.\",\n\t\t\t\twhy: `Reading it threw: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\tfix: SECTION_FIX\n\t\t\t}]\n\t\t};\n\t}\n}\n/**\n* The whole check, shared by the section validator and the programmatic operations so both report the same findings in the same order: the retired file beside the declaring `configFile` (resolved through symlinks), then every field finding.\n*/\nfunction checkComposerConfig(raw, configFile) {\n\tconst retired = retiredFileFinding(configFile);\n\tconst checked = checkComposerSection(raw);\n\tif (retired === void 0) return checked;\n\treturn {\n\t\tok: false,\n\t\tfindings: checked.ok ? [retired] : [retired, ...checked.findings]\n\t};\n}\n//#endregion\nexport { sectionMissing as i, configFileMissing as n, noComposerExportMessage as r, checkComposerConfig as t };\n\n//# sourceMappingURL=composer-config-CY9fET8H.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAS,UAAU,OAAO;CACzB,OAAO;AACR;;;;;;;;;AC/BA,IAAI,gBAAgB,cAAc,MAAM;CACvC,wBAAwB;CACxB,YAAY,SAAS,SAAS;EAC7B,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;CACb;AACD;;;;;;;;;;;;;;;;;ACIA,IAAI,aAAa,MAAM,WAAW;CACjC;CACA;CACA;CACA,YAAY,IAAI,gBAAgB;EAC/B,KAAK,KAAK;EACV,IAAI,IAAI,KAAK,SAAS,UAAU,cAAc;OACzC,KAAK,WAAW,UAAU,cAAc;EAC7C,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,qCAAqC;EAC3E,OAAO,KAAK;CACb;CACA,IAAI,UAAU;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,oCAAoC;EACzE,OAAO,KAAK;CACb;;;;CAIA,OAAO,GAAG,OAAO;EAChB,OAAO,UAAU,IAAI,WAAW,MAAM,KAAK,CAAC;CAC7C;;;;CAIA,OAAO,MAAM,SAAS;EACrB,OAAO,UAAU,IAAI,WAAW,OAAO,OAAO,CAAC;CAChD;;;;;CAKA,WAAW;EACV,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACxE,OAAO,KAAK;CACb;;;;;CAKA,cAAc;EACb,IAAI,KAAK,IAAI,MAAM,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