@effect/tsgo 0.36.1 → 0.36.3

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 (2) hide show
  1. package/dist/effect-tsgo.cjs +778 -529
  2. package/package.json +11 -11
@@ -45,7 +45,7 @@ node_readline = __toESM(node_readline);
45
45
  let node_module = require("node:module");
46
46
  node_module = __toESM(node_module);
47
47
 
48
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Pipeable.js
48
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Pipeable.js
49
49
  /**
50
50
  * The `Pipeable` module defines the shared interface and implementation helpers
51
51
  * for values that support Effect-style method chaining with `.pipe(...)`.
@@ -148,7 +148,7 @@ const Class$1 = /* @__PURE__ */ function() {
148
148
  }();
149
149
 
150
150
  //#endregion
151
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Function.js
151
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Function.js
152
152
  /**
153
153
  * Creates a function that can be called in data-first style or data-last
154
154
  * (`pipe`-friendly) style.
@@ -426,9 +426,45 @@ function memoize(f) {
426
426
  return result;
427
427
  };
428
428
  }
429
+ /**
430
+ * Creates a memoized idempotent object transformation that caches both inputs
431
+ * and their outputs by object identity.
432
+ *
433
+ * **When to use**
434
+ *
435
+ * Use when an object transformation is idempotent and its output can be safely
436
+ * reused as a fixed point.
437
+ *
438
+ * **Details**
439
+ *
440
+ * After computing an input, the returned function caches both the input and
441
+ * the output. Calling it with either reference returns the output without
442
+ * invoking the supplied function again.
443
+ *
444
+ * **Gotchas**
445
+ *
446
+ * The returned function treats each computed output as a fixed point. If
447
+ * applying the supplied function to an output would produce an observably
448
+ * different value, this memoization changes that behavior.
449
+ *
450
+ * @see {@link memoize} for memoizing functions without an idempotence requirement
451
+ * @category caching
452
+ * @since 4.0.0
453
+ */
454
+ function memoizeIdempotent(f) {
455
+ const cache = /* @__PURE__ */ new WeakMap();
456
+ return (a) => {
457
+ const cached = cache.get(a);
458
+ if (cached !== void 0) return cached;
459
+ const result = f(a);
460
+ cache.set(a, result);
461
+ cache.set(result, result);
462
+ return result;
463
+ };
464
+ }
429
465
 
430
466
  //#endregion
431
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/equal.js
467
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/equal.js
432
468
  /** @internal */
433
469
  const getAllObjectKeys = (obj) => {
434
470
  const keys = new Set(Reflect.ownKeys(obj));
@@ -448,7 +484,7 @@ const getAllObjectKeys = (obj) => {
448
484
  const byReferenceInstances = /* @__PURE__ */ new WeakSet();
449
485
 
450
486
  //#endregion
451
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Predicate.js
487
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Predicate.js
452
488
  /**
453
489
  * Defines runtime checks for values.
454
490
  *
@@ -1047,7 +1083,7 @@ function isIterable(input) {
1047
1083
  }
1048
1084
 
1049
1085
  //#endregion
1050
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Hash.js
1086
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Hash.js
1051
1087
  /**
1052
1088
  * Computes Effect hash values and defines the interface for objects that want
1053
1089
  * to provide their own hash implementation. Hashes are small numeric
@@ -1461,7 +1497,7 @@ function withVisitedTracking$1(obj, fn) {
1461
1497
  }
1462
1498
 
1463
1499
  //#endregion
1464
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Equal.js
1500
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Equal.js
1465
1501
  /**
1466
1502
  * Defines the unique string identifier for the `Equal` interface.
1467
1503
  *
@@ -1733,7 +1769,7 @@ const byReferenceUnsafe = (obj) => {
1733
1769
  };
1734
1770
 
1735
1771
  //#endregion
1736
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Redactable.js
1772
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Redactable.js
1737
1773
  /**
1738
1774
  * Defines the symbol used to identify objects that implement the {@link Redactable}
1739
1775
  * protocol.
@@ -1853,7 +1889,7 @@ const emptyContext$1 = {
1853
1889
  };
1854
1890
 
1855
1891
  //#endregion
1856
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Formatter.js
1892
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Formatter.js
1857
1893
  /**
1858
1894
  * Formats JavaScript values into readable strings.
1859
1895
  *
@@ -2083,7 +2119,7 @@ function formatJson(input, options) {
2083
2119
  }
2084
2120
 
2085
2121
  //#endregion
2086
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Inspectable.js
2122
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Inspectable.js
2087
2123
  /**
2088
2124
  * Controls how values appear in logs and debugging output.
2089
2125
  *
@@ -2302,7 +2338,7 @@ var Class = class {
2302
2338
  };
2303
2339
 
2304
2340
  //#endregion
2305
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Utils.js
2341
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Utils.js
2306
2342
  /**
2307
2343
  * Yields its wrapped value exactly once through an `IterableIterator`.
2308
2344
  *
@@ -2390,7 +2426,7 @@ const pickInternalCall = () => {
2390
2426
  const internalCall = /* @__PURE__ */ pickInternalCall();
2391
2427
 
2392
2428
  //#endregion
2393
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/record.js
2429
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/record.js
2394
2430
  /** @internal */
2395
2431
  function assignProperty$1(self, key, value) {
2396
2432
  if (key === "__proto__") Object.defineProperty(self, key, {
@@ -2407,7 +2443,7 @@ function assignProperties(self, source) {
2407
2443
  }
2408
2444
 
2409
2445
  //#endregion
2410
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/core.js
2446
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/core.js
2411
2447
  /** @internal */
2412
2448
  const EffectTypeId = `~effect/Effect`;
2413
2449
  /** @internal */
@@ -2796,7 +2832,7 @@ const done$2 = (value) => {
2796
2832
  };
2797
2833
 
2798
2834
  //#endregion
2799
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Effectable.js
2835
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Effectable.js
2800
2836
  /**
2801
2837
  * Create a low-level `Effect` prototype.
2802
2838
  *
@@ -2821,40 +2857,7 @@ const Prototype = (options) => makePrimitiveProto({
2821
2857
  });
2822
2858
 
2823
2859
  //#endregion
2824
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/stackTraceLimit.js
2825
- /**
2826
- * Check if `Error.stackTraceLimit` is writable.
2827
- * Returns `false` if the property is frozen, non-writable, or `Error` is non-extensible.
2828
- *
2829
- * @internal
2830
- */
2831
- const isStackTraceLimitWritable = () => {
2832
- const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
2833
- if (desc === void 0) return Object.isExtensible(Error);
2834
- return Object.hasOwn(desc, "writable") ? desc.writable === true : desc.set !== void 0;
2835
- };
2836
- const canWriteStackTraceLimit = /* @__PURE__ */ isStackTraceLimitWritable();
2837
- /**
2838
- * Get the current `Error.stackTraceLimit` value.
2839
- * Returns `undefined` if the property doesn't exist.
2840
- *
2841
- * @internal
2842
- */
2843
- const getStackTraceLimit = () => Error.stackTraceLimit;
2844
- /**
2845
- * Safely set `Error.stackTraceLimit` if possible, otherwise no-op.
2846
- *
2847
- * Accepts `undefined` so a value read via {@link getStackTraceLimit} can be
2848
- * restored faithfully.
2849
- *
2850
- * @internal
2851
- */
2852
- const setStackTraceLimit = (value) => {
2853
- if (canWriteStackTraceLimit) Error.stackTraceLimit = value;
2854
- };
2855
-
2856
- //#endregion
2857
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Equivalence.js
2860
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Equivalence.js
2858
2861
  /**
2859
2862
  * Creates a custom equivalence relation with an optimized reference equality check.
2860
2863
  *
@@ -3012,7 +3015,7 @@ function Struct$2(fields) {
3012
3015
  }
3013
3016
 
3014
3017
  //#endregion
3015
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/doNotation.js
3018
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/doNotation.js
3016
3019
  /** @internal */
3017
3020
  const let_$2 = (map) => dual(3, (self, name, f) => map(self, (a) => ({
3018
3021
  ...a,
@@ -3027,7 +3030,7 @@ const bind$2 = (map, flatMap) => dual(3, (self, name, f) => flatMap(self, (a) =>
3027
3030
  }))));
3028
3031
 
3029
3032
  //#endregion
3030
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/option.js
3033
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/option.js
3031
3034
  /**
3032
3035
  * @since 2.0.0
3033
3036
  */
@@ -3098,7 +3101,7 @@ const some$1 = (value) => {
3098
3101
  };
3099
3102
 
3100
3103
  //#endregion
3101
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/result.js
3104
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/result.js
3102
3105
  const TypeId$37 = "~effect/data/Result";
3103
3106
  const CommonProto = {
3104
3107
  [TypeId$37]: {
@@ -3176,7 +3179,7 @@ const getSuccess$3 = (self) => isFailure$4(self) ? none$4 : some$1(self.success)
3176
3179
  const fromOption$4 = /* @__PURE__ */ dual(2, (self, onNone) => isNone$1(self) ? fail$6(onNone()) : succeed$7(self.value));
3177
3180
 
3178
3181
  //#endregion
3179
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Order.js
3182
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Order.js
3180
3183
  /**
3181
3184
  * Defines comparison functions for ordered values.
3182
3185
  *
@@ -3673,7 +3676,7 @@ const clamp$2 = (O) => dual(2, (self, options) => min$2(O)(options.maximum, max$
3673
3676
  const isBetween$1 = (O) => dual(2, (self, options) => !isLessThan$4(O)(self, options.minimum) && !isGreaterThan$5(O)(self, options.maximum));
3674
3677
 
3675
3678
  //#endregion
3676
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Option.js
3679
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Option.js
3677
3680
  /**
3678
3681
  * Creates an `Option` representing the absence of a value.
3679
3682
  *
@@ -4331,7 +4334,7 @@ const filter$4 = /* @__PURE__ */ dual(2, (self, predicate) => isNone(self) ? non
4331
4334
  const exists$1 = /* @__PURE__ */ dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));
4332
4335
 
4333
4336
  //#endregion
4334
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Context.js
4337
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Context.js
4335
4338
  /**
4336
4339
  * Runtime type identifier attached to `Context` service keys and used by
4337
4340
  * `isKey` to recognize them.
@@ -4391,16 +4394,9 @@ const ServiceTypeId = "~effect/Context/Service";
4391
4394
  * @since 4.0.0
4392
4395
  */
4393
4396
  const Service = function() {
4394
- const prevLimit = getStackTraceLimit();
4395
- setStackTraceLimit(2);
4396
- const err = /* @__PURE__ */ new Error();
4397
- setStackTraceLimit(prevLimit);
4398
4397
  function KeyClass() {}
4399
4398
  const self = KeyClass;
4400
4399
  Object.setPrototypeOf(self, ServiceProto);
4401
- Object.defineProperty(self, "stack", { get() {
4402
- return err.stack;
4403
- } });
4404
4400
  const init = (key, options) => {
4405
4401
  self.key = key;
4406
4402
  if (options?.defaultValue) {
@@ -4424,8 +4420,7 @@ const ServiceProto = {
4424
4420
  toJSON() {
4425
4421
  return {
4426
4422
  _id: "Service",
4427
- key: this.key,
4428
- stack: this.stack
4423
+ key: this.key
4429
4424
  };
4430
4425
  },
4431
4426
  of(self) {
@@ -4789,13 +4784,6 @@ const getDefaultValue = (ref) => {
4789
4784
  };
4790
4785
  const serviceNotFoundError = (service) => {
4791
4786
  const error = /* @__PURE__ */ new Error(`Service not found${service.key ? `: ${String(service.key)}` : ""}`);
4792
- if (service.stack) {
4793
- const lines = service.stack.split("\n");
4794
- if (lines.length > 2) {
4795
- const afterAt = lines[2].match(/at (.*)/);
4796
- if (afterAt) error.message = error.message + ` (defined at ${afterAt[1]})`;
4797
- }
4798
- }
4799
4787
  if (error.stack) {
4800
4788
  const lines = error.stack.split("\n");
4801
4789
  lines.splice(1, 3);
@@ -4975,7 +4963,7 @@ const mergeAll$1 = (...ctxs) => {
4975
4963
  const Reference = Service;
4976
4964
 
4977
4965
  //#endregion
4978
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/array.js
4966
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/array.js
4979
4967
  /**
4980
4968
  * @since 2.0.0
4981
4969
  */
@@ -4983,7 +4971,7 @@ const Reference = Service;
4983
4971
  const isArrayNonEmpty$1 = (self) => self.length > 0;
4984
4972
 
4985
4973
  //#endregion
4986
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Result.js
4974
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Result.js
4987
4975
  /**
4988
4976
  * Creates a `Result` holding a `Success` value.
4989
4977
  *
@@ -5315,7 +5303,7 @@ const match$7 = /* @__PURE__ */ dual(2, (self, { onFailure, onSuccess }) => isFa
5315
5303
  const succeedNone$2 = /* @__PURE__ */ succeed$6(none$4);
5316
5304
 
5317
5305
  //#endregion
5318
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Iterable.js
5306
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Iterable.js
5319
5307
  /**
5320
5308
  * Returns the first element that satisfies the specified
5321
5309
  * predicate, or `None` if no such element exists.
@@ -5430,7 +5418,7 @@ const filter$3 = /* @__PURE__ */ dual(2, (self, predicate) => ({ [Symbol.iterato
5430
5418
  } }));
5431
5419
 
5432
5420
  //#endregion
5433
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Record.js
5421
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Record.js
5434
5422
  /**
5435
5423
  * Transforms the values of a record into an `Array` with a custom mapping function.
5436
5424
  *
@@ -5520,7 +5508,7 @@ const keys = (self) => Object.keys(self);
5520
5508
  const assignProperty = assignProperty$1;
5521
5509
 
5522
5510
  //#endregion
5523
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Array.js
5511
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Array.js
5524
5512
  /**
5525
5513
  * Works with JavaScript arrays, readonly arrays, and non-empty arrays.
5526
5514
  *
@@ -6214,7 +6202,7 @@ const dedupe = (self) => {
6214
6202
  };
6215
6203
 
6216
6204
  //#endregion
6217
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Duration.js
6205
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Duration.js
6218
6206
  const TypeId$35 = "~effect/time/Duration";
6219
6207
  const bigint0$2 = /* @__PURE__ */ BigInt(0);
6220
6208
  const bigint1$1 = /* @__PURE__ */ BigInt(1);
@@ -6342,7 +6330,14 @@ const negativeInfinityDurationValue = { _tag: "NegativeInfinity" };
6342
6330
  const DurationProto = {
6343
6331
  [TypeId$35]: TypeId$35,
6344
6332
  [symbol$3]() {
6345
- return structure(this.value);
6333
+ switch (this.value._tag) {
6334
+ case "Millis": {
6335
+ const nanos = this.value.millis * 1e6;
6336
+ return Number.isFinite(nanos) ? hash(roundTiesAwayFromZero(nanos)) : number$2(this.value.millis);
6337
+ }
6338
+ case "Nanos": return hash(this.value.nanos);
6339
+ default: return structure(this.value);
6340
+ }
6346
6341
  },
6347
6342
  [symbol$2](that) {
6348
6343
  return isDuration(that) && equals$1(this, that);
@@ -6757,7 +6752,7 @@ const Equivalence$4 = (self, that) => matchPair(self, that, {
6757
6752
  const equals$1 = /* @__PURE__ */ dual(2, (self, that) => Equivalence$4(self, that));
6758
6753
 
6759
6754
  //#endregion
6760
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Filter.js
6755
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Filter.js
6761
6756
  /**
6762
6757
  * Creates a Filter from a predicate or refinement function.
6763
6758
  *
@@ -6939,7 +6934,7 @@ const toOption$1 = (self) => (input) => {
6939
6934
  };
6940
6935
 
6941
6936
  //#endregion
6942
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Scheduler.js
6937
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Scheduler.js
6943
6938
  /**
6944
6939
  * Controls how runnable Effect fiber tasks are dispatched.
6945
6940
  *
@@ -7156,7 +7151,7 @@ const PreventSchedulerYield = /* @__PURE__ */ Reference("effect/Scheduler/Preven
7156
7151
  });
7157
7152
 
7158
7153
  //#endregion
7159
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Tracer.js
7154
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Tracer.js
7160
7155
  /**
7161
7156
  * Defines the low-level tracing model used by Effect.
7162
7157
  *
@@ -7424,12 +7419,12 @@ const randomHexString = /* @__PURE__ */ function() {
7424
7419
  }();
7425
7420
 
7426
7421
  //#endregion
7427
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/metric.js
7422
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/metric.js
7428
7423
  /** @internal */
7429
7424
  const FiberRuntimeMetricsKey = "effect/observability/Metric/FiberRuntimeMetricsKey";
7430
7425
 
7431
7426
  //#endregion
7432
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/references.js
7427
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/references.js
7433
7428
  /** @internal */
7434
7429
  const CurrentErrorReporters = /* @__PURE__ */ Reference("effect/ErrorReporter/CurrentErrorReporters", { defaultValue: () => /* @__PURE__ */ new Set() });
7435
7430
  /** @internal */
@@ -7463,7 +7458,40 @@ const UnhandledLogLevel$1 = /* @__PURE__ */ Reference("effect/References/Unhandl
7463
7458
  const CurrentLogSpans$1 = /* @__PURE__ */ Reference("effect/References/CurrentLogSpans", { defaultValue: () => [] });
7464
7459
 
7465
7460
  //#endregion
7466
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/tracer.js
7461
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/stackTraceLimit.js
7462
+ /**
7463
+ * Check if `Error.stackTraceLimit` is writable.
7464
+ * Returns `false` if the property is frozen, non-writable, or `Error` is non-extensible.
7465
+ *
7466
+ * @internal
7467
+ */
7468
+ const isStackTraceLimitWritable = () => {
7469
+ const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
7470
+ if (desc === void 0) return Object.isExtensible(Error);
7471
+ return Object.hasOwn(desc, "writable") ? desc.writable === true : desc.set !== void 0;
7472
+ };
7473
+ const canWriteStackTraceLimit = /* @__PURE__ */ isStackTraceLimitWritable();
7474
+ /**
7475
+ * Get the current `Error.stackTraceLimit` value.
7476
+ * Returns `undefined` if the property doesn't exist.
7477
+ *
7478
+ * @internal
7479
+ */
7480
+ const getStackTraceLimit = () => Error.stackTraceLimit;
7481
+ /**
7482
+ * Safely set `Error.stackTraceLimit` if possible, otherwise no-op.
7483
+ *
7484
+ * Accepts `undefined` so a value read via {@link getStackTraceLimit} can be
7485
+ * restored faithfully.
7486
+ *
7487
+ * @internal
7488
+ */
7489
+ const setStackTraceLimit = (value) => {
7490
+ if (canWriteStackTraceLimit) Error.stackTraceLimit = value;
7491
+ };
7492
+
7493
+ //#endregion
7494
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/tracer.js
7467
7495
  /** @internal */
7468
7496
  const addSpanStackTrace = (options) => {
7469
7497
  if (options?.captureStackTrace === false) return options;
@@ -7494,7 +7522,7 @@ const makeStackCleaner = (line) => (stack) => {
7494
7522
  const spanCleaner = /* @__PURE__ */ makeStackCleaner(3);
7495
7523
 
7496
7524
  //#endregion
7497
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/effect.js
7525
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/effect.js
7498
7526
  /** @internal */
7499
7527
  var Interrupt = class extends ReasonBase {
7500
7528
  fiberId;
@@ -9678,10 +9706,8 @@ const useSpan$1 = (name, ...args) => {
9678
9706
  return withFiber$1((fiber) => {
9679
9707
  const span = makeSpanUnsafe(fiber, name, options);
9680
9708
  const clock = fiber.getRef(ClockRef);
9681
- return onExit$1(internalCall(() => evaluate(span)), (exit) => sync$1(() => {
9682
- if (span.status._tag === "Ended") return;
9683
- span.end(clock.currentTimeNanosUnsafe(), exit);
9684
- }));
9709
+ const timingEnabled = fiber.getRef(TracerTimingEnabled$1);
9710
+ return onExit$1(internalCall(() => evaluate(span)), (exit) => endSpan(span, exit, clock, timingEnabled));
9685
9711
  });
9686
9712
  };
9687
9713
  const provideParentSpan = /* @__PURE__ */ provideService$1(ParentSpan);
@@ -10046,7 +10072,7 @@ const reportCauseUnsafe = (fiber, cause, defectsOnly) => {
10046
10072
  };
10047
10073
 
10048
10074
  //#endregion
10049
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Cause.js
10075
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Cause.js
10050
10076
  /**
10051
10077
  * Unique brand for `Cause` values, used for runtime type checks via {@link isCause}.
10052
10078
  *
@@ -11226,7 +11252,7 @@ const reasonAnnotations = reasonAnnotations$1;
11226
11252
  const annotations = causeAnnotations;
11227
11253
 
11228
11254
  //#endregion
11229
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Exit.js
11255
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Exit.js
11230
11256
  ExitTypeId;
11231
11257
  /**
11232
11258
  * Checks whether an unknown value is an Exit.
@@ -12021,7 +12047,7 @@ const getCause = exitGetCause;
12021
12047
  const findErrorOption = exitFindErrorOption;
12022
12048
 
12023
12049
  //#endregion
12024
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Deferred.js
12050
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Deferred.js
12025
12051
  const TypeId$33 = "~effect/Deferred";
12026
12052
  const DeferredProto = {
12027
12053
  [TypeId$33]: {
@@ -12224,7 +12250,7 @@ const doneUnsafe = (self, effect) => {
12224
12250
  };
12225
12251
 
12226
12252
  //#endregion
12227
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/References.js
12253
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/References.js
12228
12254
  /**
12229
12255
  * Context reference for managing log annotations that are automatically added to all log entries.
12230
12256
  * These annotations provide contextual metadata that appears in every log message.
@@ -12698,7 +12724,7 @@ const CurrentLoggers = CurrentLoggers$1;
12698
12724
  const LogToStderr = LogToStderr$1;
12699
12725
 
12700
12726
  //#endregion
12701
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Scope.js
12727
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Scope.js
12702
12728
  /**
12703
12729
  * Controls how long resources stay open.
12704
12730
  *
@@ -13049,7 +13075,7 @@ const closeUnsafe = scopeCloseUnsafe;
13049
13075
  const use = scopeUse;
13050
13076
 
13051
13077
  //#endregion
13052
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Layer.js
13078
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Layer.js
13053
13079
  const TypeId$32 = "~effect/Layer";
13054
13080
  const MemoMapTypeId = "~effect/Layer/MemoMap";
13055
13081
  const memoMapReuse = (entry, scope) => {
@@ -13784,7 +13810,7 @@ const provide$2 = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that
13784
13810
  const provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self, that) => merge$2(that, self)));
13785
13811
 
13786
13812
  //#endregion
13787
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/ExecutionPlan.js
13813
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/ExecutionPlan.js
13788
13814
  /**
13789
13815
  * Runtime type identifier attached to `ExecutionPlan` values and used by
13790
13816
  * `isExecutionPlan`.
@@ -13829,7 +13855,7 @@ const CurrentMetadata$1 = /* @__PURE__ */ Reference("effect/ExecutionPlan/Curren
13829
13855
  }) });
13830
13856
 
13831
13857
  //#endregion
13832
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Data.js
13858
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Data.js
13833
13859
  /**
13834
13860
  * Creates constructors and matchers for a `TaggedEnum` type.
13835
13861
  *
@@ -14005,7 +14031,7 @@ const Error$2 = Error$3;
14005
14031
  const TaggedError$1 = TaggedError$2;
14006
14032
 
14007
14033
  //#endregion
14008
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Clock.js
14034
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Clock.js
14009
14035
  /**
14010
14036
  * Context reference for the active time service in the environment.
14011
14037
  *
@@ -14180,7 +14206,7 @@ const currentTimeNanos = currentTimeNanos$1;
14180
14206
  const monotonicTimeNanos = monotonicTimeNanos$1;
14181
14207
 
14182
14208
  //#endregion
14183
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/dateTime.js
14209
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/dateTime.js
14184
14210
  /** @internal */
14185
14211
  const TypeId$30 = "~effect/time/DateTime";
14186
14212
  /** @internal */
@@ -14798,7 +14824,7 @@ const formatIsoOffset$1 = (self) => {
14798
14824
  const formatIsoZoned$1 = (self) => self.zone._tag === "Offset" ? formatIsoOffset$1(self) : `${formatIsoOffset$1(self)}[${self.zone.id}]`;
14799
14825
 
14800
14826
  //#endregion
14801
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Number.js
14827
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Number.js
14802
14828
  /**
14803
14829
  * Works with TypeScript `number` values.
14804
14830
  *
@@ -14925,7 +14951,7 @@ const round = /* @__PURE__ */ dual(2, (self, precision) => {
14925
14951
  });
14926
14952
 
14927
14953
  //#endregion
14928
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Pull.js
14954
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Pull.js
14929
14955
  /**
14930
14956
  * Models one low-level pull step for stream-like consumers.
14931
14957
  *
@@ -15102,7 +15128,7 @@ const matchEffect$1 = /* @__PURE__ */ dual(2, (self, options) => matchCauseEffec
15102
15128
  }));
15103
15129
 
15104
15130
  //#endregion
15105
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Schedule.js
15131
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Schedule.js
15106
15132
  const TypeId$29 = "~effect/Schedule";
15107
15133
  /**
15108
15134
  * Context reference containing metadata for the currently running schedule step.
@@ -15443,13 +15469,13 @@ const while_ = /* @__PURE__ */ dual(2, (self, predicate) => fromStep(map$8(toSte
15443
15469
  const forever$1 = /* @__PURE__ */ spaced(zero$1);
15444
15470
 
15445
15471
  //#endregion
15446
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/layer.js
15472
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/layer.js
15447
15473
  const provideLayer = (self, layer, options) => scopedWith$1((scope) => flatMap$2(options?.local ? buildWithMemoMap(layer, makeMemoMapUnsafe(), scope) : buildWithScope(layer, scope), (context) => provideContext$1(self, context)));
15448
15474
  /** @internal */
15449
15475
  const provide$1 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, source, options) => isContext(source) ? provideContext$1(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll(...source) : source, options));
15450
15476
 
15451
15477
  //#endregion
15452
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/schedule.js
15478
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/schedule.js
15453
15479
  /** @internal */
15454
15480
  const repeatOrElse$1 = /* @__PURE__ */ dual(3, (self, schedule, orElse) => flatMap$2(toStepWithMetadata(schedule), (step) => {
15455
15481
  let meta = CurrentMetadata.defaultValue();
@@ -15511,11 +15537,12 @@ const buildFromOptions = (options) => {
15511
15537
  };
15512
15538
 
15513
15539
  //#endregion
15514
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/executionPlan.js
15540
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/executionPlan.js
15515
15541
  /** @internal */
15516
15542
  const makeEventEmitter = (onEvent, currentMetadata) => {
15517
15543
  let lastStepIndex = -1;
15518
15544
  let stepAttempt = 0;
15545
+ const emit = (event) => ignoreCause$1(onEvent(event));
15519
15546
  return {
15520
15547
  begin: clockWith$2((clock) => suspend$3(() => {
15521
15548
  const meta = currentMetadata();
@@ -15530,7 +15557,7 @@ const makeEventEmitter = (onEvent, currentMetadata) => {
15530
15557
  stepIndex: meta.stepIndex,
15531
15558
  startNanos: clock.monotonicTimeNanosUnsafe()
15532
15559
  };
15533
- return as$1(onEvent({
15560
+ return as$1(emit({
15534
15561
  _tag: "AttemptStart",
15535
15562
  attempt: state.attempt,
15536
15563
  stepAttempt: state.stepAttempt,
@@ -15539,7 +15566,7 @@ const makeEventEmitter = (onEvent, currentMetadata) => {
15539
15566
  })),
15540
15567
  end: (state, exit) => clockWith$2((clock) => {
15541
15568
  const duration = nanos(clock.monotonicTimeNanosUnsafe() - state.startNanos);
15542
- return onEvent(exit._tag === "Success" ? {
15569
+ return emit(exit._tag === "Success" ? {
15543
15570
  _tag: "AttemptSuccess",
15544
15571
  attempt: state.attempt,
15545
15572
  stepAttempt: state.stepAttempt,
@@ -15616,7 +15643,7 @@ const scheduleFromStep = (step, first) => {
15616
15643
  const scheduleOnce = /* @__PURE__ */ recurs(1);
15617
15644
 
15618
15645
  //#endregion
15619
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Request.js
15646
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Request.js
15620
15647
  const TypeId$28 = "~effect/Request";
15621
15648
  const requestVariance = /* @__PURE__ */ byReferenceUnsafe({
15622
15649
  _E: (_) => _,
@@ -15655,7 +15682,7 @@ const RequestPrototype = {
15655
15682
  const makeEntry = (options) => options;
15656
15683
 
15657
15684
  //#endregion
15658
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/request.js
15685
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/request.js
15659
15686
  /** @internal */
15660
15687
  const request$1 = /* @__PURE__ */ dual(2, (self, resolver) => {
15661
15688
  const withResolver = (resolver) => callback$2((resume) => {
@@ -15757,7 +15784,7 @@ function runBatch(batch) {
15757
15784
  }
15758
15785
 
15759
15786
  //#endregion
15760
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Effect.js
15787
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Effect.js
15761
15788
  /**
15762
15789
  * Runtime identifier used to recognize `Effect` values.
15763
15790
  *
@@ -23106,7 +23133,7 @@ const catchEager = catchEager$1;
23106
23133
  const fnUntracedEager = fnUntracedEager$1;
23107
23134
 
23108
23135
  //#endregion
23109
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Runtime.js
23136
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Runtime.js
23110
23137
  /**
23111
23138
  * Helpers for turning an `Effect` program into a host application's main entry
23112
23139
  * point. This module is the low-level layer used by platform adapters to run a
@@ -23391,7 +23418,7 @@ const getErrorReported = (u) => {
23391
23418
  };
23392
23419
 
23393
23420
  //#endregion
23394
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodeRuntime.js
23421
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodeRuntime.js
23395
23422
  /**
23396
23423
  * Runs an Effect as the Node process main program, interrupting the fiber on
23397
23424
  * `SIGINT` or `SIGTERM` and invoking the configured teardown to determine the
@@ -23418,7 +23445,7 @@ const runMain$1 = /* @__PURE__ */ makeRunMain(({ fiber, teardown }) => {
23418
23445
  });
23419
23446
 
23420
23447
  //#endregion
23421
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.104_effect@4.0.0-beta.104_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeRuntime.js
23448
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.107_effect@4.0.0-beta.107_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeRuntime.js
23422
23449
  /**
23423
23450
  * Node.js process runner for Effect programs.
23424
23451
  *
@@ -23456,7 +23483,7 @@ const runMain$1 = /* @__PURE__ */ makeRunMain(({ fiber, teardown }) => {
23456
23483
  const runMain = runMain$1;
23457
23484
 
23458
23485
  //#endregion
23459
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/PlatformError.js
23486
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/PlatformError.js
23460
23487
  /**
23461
23488
  * Normalized errors for platform APIs.
23462
23489
  *
@@ -23609,7 +23636,7 @@ const systemError = (options) => new PlatformError(new SystemError(options));
23609
23636
  const badArgument = (options) => new PlatformError(new BadArgument(options));
23610
23637
 
23611
23638
  //#endregion
23612
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Fiber.js
23639
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Fiber.js
23613
23640
  const await_ = fiberAwait;
23614
23641
  /**
23615
23642
  * Waits for all fibers in the provided iterable to complete and returns
@@ -23929,7 +23956,7 @@ const getCurrent = getCurrentFiber;
23929
23956
  const runIn = fiberRunIn;
23930
23957
 
23931
23958
  //#endregion
23932
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Latch.js
23959
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Latch.js
23933
23960
  /**
23934
23961
  * Creates a `Latch` synchronously, outside of `Effect`.
23935
23962
  *
@@ -24001,7 +24028,7 @@ const makeUnsafe$2 = makeLatchUnsafe;
24001
24028
  const make$24 = makeLatch;
24002
24029
 
24003
24030
  //#endregion
24004
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/MutableRef.js
24031
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/MutableRef.js
24005
24032
  const TypeId$25 = "~effect/MutableRef";
24006
24033
  const MutableRefProto = {
24007
24034
  [TypeId$25]: TypeId$25,
@@ -24052,7 +24079,7 @@ const make$23 = (value) => {
24052
24079
  };
24053
24080
 
24054
24081
  //#endregion
24055
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/MutableList.js
24082
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/MutableList.js
24056
24083
  /**
24057
24084
  * Defines the unique symbol used to represent an empty result when taking elements from a MutableList.
24058
24085
  * This symbol is returned by `take` when the list is empty, allowing for safe type checking.
@@ -24244,7 +24271,7 @@ const take$1 = (self) => {
24244
24271
  };
24245
24272
 
24246
24273
  //#endregion
24247
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Queue.js
24274
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Queue.js
24248
24275
  const TypeId$24 = "~effect/Queue";
24249
24276
  const EnqueueTypeId = "~effect/Queue/Enqueue";
24250
24277
  const DequeueTypeId = "~effect/Queue/Dequeue";
@@ -24997,7 +25024,7 @@ const finalize = (self, exit) => {
24997
25024
  };
24998
25025
 
24999
25026
  //#endregion
25000
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Semaphore.js
25027
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Semaphore.js
25001
25028
  /**
25002
25029
  * Creates a `Semaphore` synchronously with the specified total
25003
25030
  * number of permits.
@@ -25127,7 +25154,7 @@ var SemaphoreImpl = class {
25127
25154
  };
25128
25155
 
25129
25156
  //#endregion
25130
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Channel.js
25157
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Channel.js
25131
25158
  /**
25132
25159
  * Provides low-level building blocks for streaming data through Effect.
25133
25160
  *
@@ -25726,7 +25753,7 @@ const runFold = /* @__PURE__ */ dual(3, (self, initial, f) => suspend$2(() => {
25726
25753
  const toPullScoped = (self, scope) => toTransform(self)(done$1(), scope);
25727
25754
 
25728
25755
  //#endregion
25729
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/stream.js
25756
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/stream.js
25730
25757
  const TypeId$22 = "~effect/Stream";
25731
25758
  const streamVariance = {
25732
25759
  _R: identity,
@@ -25747,7 +25774,7 @@ const fromChannel$2 = (channel) => {
25747
25774
  };
25748
25775
 
25749
25776
  //#endregion
25750
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Sink.js
25777
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Sink.js
25751
25778
  const TypeId$21 = "~effect/Sink";
25752
25779
  const endVoid = /* @__PURE__ */ succeed$2([void 0]);
25753
25780
  const sinkVariance = {
@@ -25989,7 +26016,7 @@ const forEachArray = (f) => fromTransform((upstream) => upstream.pipe(flatMap$1(
25989
26016
  const unwrap$1 = (effect) => fromChannel$1(unwrap$2(map$5(effect, toChannel$1)));
25990
26017
 
25991
26018
  //#endregion
25992
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/rcRef.js
26019
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/rcRef.js
25993
26020
  const TypeId$20 = "~effect/RcRef";
25994
26021
  const stateEmpty = { _tag: "Empty" };
25995
26022
  const stateClosed = { _tag: "Closed" };
@@ -26026,7 +26053,7 @@ const make$20 = (options) => withFiber((fiber) => {
26026
26053
  return close$2;
26027
26054
  }), ref);
26028
26055
  });
26029
- const getState = (self) => uninterruptibleMask((restore) => {
26056
+ const getState = (self) => uninterruptibleMask(function loop(restore) {
26030
26057
  switch (self.state._tag) {
26031
26058
  case "Closed": return interrupt$1;
26032
26059
  case "Acquired":
@@ -26034,18 +26061,21 @@ const getState = (self) => uninterruptibleMask((restore) => {
26034
26061
  return self.state.fiber ? as(interrupt(self.state.fiber), self.state) : succeed$2(self.state);
26035
26062
  case "Empty": {
26036
26063
  const scope = makeUnsafe$4();
26037
- return self.semaphore.withPermits(1)(restore(provideContext(self.acquire, add$2(self.context, Scope, scope))).pipe(map$5((value) => {
26038
- const state = {
26039
- _tag: "Acquired",
26040
- value,
26041
- scope,
26042
- fiber: void 0,
26043
- refCount: 1,
26044
- invalidated: false
26045
- };
26046
- self.state = state;
26047
- return state;
26048
- })));
26064
+ return self.semaphore.withPermit(suspend$2(() => {
26065
+ if (self.state._tag !== "Empty") return loop(restore);
26066
+ return restore(provideContext(self.acquire, add$2(self.context, Scope, scope))).pipe(map$5((value) => {
26067
+ const state = {
26068
+ _tag: "Acquired",
26069
+ value,
26070
+ scope,
26071
+ fiber: void 0,
26072
+ refCount: 1,
26073
+ invalidated: false
26074
+ };
26075
+ self.state = state;
26076
+ return state;
26077
+ }), onExit((exit) => isFailure$1(exit) ? close(scope, exit) : void_$1));
26078
+ }));
26049
26079
  }
26050
26080
  }
26051
26081
  });
@@ -26091,7 +26121,7 @@ const invalidate$1 = (self_) => {
26091
26121
  };
26092
26122
 
26093
26123
  //#endregion
26094
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/RcRef.js
26124
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/RcRef.js
26095
26125
  /**
26096
26126
  * Creates an `RcRef` from an acquire effect.
26097
26127
  *
@@ -26209,7 +26239,7 @@ const get = get$1;
26209
26239
  const invalidate = invalidate$1;
26210
26240
 
26211
26241
  //#endregion
26212
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Stream.js
26242
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Stream.js
26213
26243
  /**
26214
26244
  * Describes effectful sources that emit values over time.
26215
26245
  *
@@ -26668,7 +26698,7 @@ const runCollect = (self) => runFold(self.channel, () => [], (acc, chunk) => {
26668
26698
  const mkString = (self) => runFold(self.channel, () => "", (acc, chunk) => acc + chunk.join(""));
26669
26699
 
26670
26700
  //#endregion
26671
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/FileSystem.js
26701
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/FileSystem.js
26672
26702
  /**
26673
26703
  * Defines the portable file system service for Effect programs.
26674
26704
  *
@@ -26881,7 +26911,7 @@ const FileTypeId = "~effect/platform/FileSystem/File";
26881
26911
  var WatchBackend = class extends Service()("effect/platform/FileSystem/WatchBackend") {};
26882
26912
 
26883
26913
  //#endregion
26884
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Path.js
26914
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Path.js
26885
26915
  /**
26886
26916
  * Provides path operations through the Effect environment.
26887
26917
  *
@@ -27332,7 +27362,7 @@ const posixImpl = /* @__PURE__ */ Path.of({
27332
27362
  });
27333
27363
 
27334
27364
  //#endregion
27335
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/schema/annotations.js
27365
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/schema/annotations.js
27336
27366
  /** @internal */
27337
27367
  function resolve$1(ast) {
27338
27368
  return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
@@ -27361,7 +27391,16 @@ const getExpected = /* @__PURE__ */ memoize((ast) => {
27361
27391
  });
27362
27392
 
27363
27393
  //#endregion
27364
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/SchemaIssue.js
27394
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/schema/parser.js
27395
+ const missing = /* @__PURE__ */ Symbol();
27396
+ const succeed$1 = succeed$4;
27397
+ const missingExit = /* @__PURE__ */ succeed$1(missing);
27398
+ const sameExit = /* @__PURE__ */ succeed$1(missing);
27399
+ const toOption = (value) => value === missing ? none$3() : some(value);
27400
+ const fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed$1(option.value);
27401
+
27402
+ //#endregion
27403
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/SchemaIssue.js
27365
27404
  const TypeId$16 = "~effect/SchemaIssue/Issue";
27366
27405
  /**
27367
27406
  * Returns `true` if the given value is an {@link Issue}.
@@ -27394,10 +27433,42 @@ const TypeId$16 = "~effect/SchemaIssue/Issue";
27394
27433
  function isIssue(u) {
27395
27434
  return hasProperty(u, TypeId$16) && u[TypeId$16] === TypeId$16;
27396
27435
  }
27436
+ /**
27437
+ * Returns `true` when an issue contains an input reported by the schema parser.
27438
+ *
27439
+ * **When to use**
27440
+ *
27441
+ * Use when reading `Issue.input`, especially when `undefined` is a valid input
27442
+ * value.
27443
+ *
27444
+ * **Details**
27445
+ *
27446
+ * Reported input is stored as an own property. This guard checks for that
27447
+ * property and narrows `input` from optional to required.
27448
+ *
27449
+ * **Example** (Reading a reported input)
27450
+ *
27451
+ * ```ts import.meta.vitest
27452
+ * import { Result, Schema, SchemaIssue } from "effect"
27453
+ *
27454
+ * const result = Schema.decodeUnknownResult(Schema.String)(1, { reportInput: true })
27455
+ * if (Result.isFailure(result) && SchemaIssue.hasInput(result.failure.issue)) {
27456
+ * result.failure.issue.input // => 1
27457
+ * }
27458
+ * ```
27459
+ *
27460
+ * @see {@link Issue} for the complete issue model
27461
+ *
27462
+ * @category guards
27463
+ * @since 4.0.0
27464
+ */
27465
+ function hasInput(issue) {
27466
+ return Object.hasOwn(issue, "input");
27467
+ }
27397
27468
  var Base$1 = class {
27398
27469
  [TypeId$16] = TypeId$16;
27399
- toString() {
27400
- return defaultFormatter$1(this);
27470
+ constructor(input, options) {
27471
+ if (options?.reportInput === true && input !== missing) this.input = input;
27401
27472
  }
27402
27473
  };
27403
27474
  /**
@@ -27418,11 +27489,13 @@ var Base$1 = class {
27418
27489
  * ```ts import.meta.vitest
27419
27490
  * import { SchemaAST, SchemaIssue } from "effect"
27420
27491
  *
27492
+ * const formatIssue = SchemaIssue.makeFormatterDefault()
27493
+ *
27421
27494
  * function describe(issue: SchemaIssue.Issue): string {
27422
27495
  * if (issue._tag === "Filter") {
27423
- * return `Filter failed: ${String(issue.issue)}`
27496
+ * return `Filter failed: ${formatIssue(issue.issue)}`
27424
27497
  * }
27425
- * return String(issue)
27498
+ * return formatIssue(issue)
27426
27499
  * }
27427
27500
  *
27428
27501
  * const issue = new SchemaIssue.Filter(
@@ -27448,8 +27521,8 @@ var Filter$1 = class extends Base$1 {
27448
27521
  * The issue that occurred.
27449
27522
  */
27450
27523
  issue;
27451
- constructor(filter, issue) {
27452
- super();
27524
+ constructor(filter, issue, input, options) {
27525
+ super(input, options);
27453
27526
  this.filter = filter;
27454
27527
  this.issue = issue;
27455
27528
  }
@@ -27483,8 +27556,8 @@ var Encoding = class extends Base$1 {
27483
27556
  * The issue that occurred.
27484
27557
  */
27485
27558
  issue;
27486
- constructor(ast, issue) {
27487
- super();
27559
+ constructor(ast, issue, input, options) {
27560
+ super(input, options);
27488
27561
  this.ast = ast;
27489
27562
  this.issue = issue;
27490
27563
  }
@@ -27566,7 +27639,8 @@ var MissingKey = class extends Base$1 {
27566
27639
  *
27567
27640
  * - `ast` is the schema that was being validated against.
27568
27641
  * - `annotations` on `ast` may contain a custom `messageUnexpectedKey`.
27569
- * - The default formatter renders this as `"Expected no excess property"`.
27642
+ * - The default formatter renders this as `"Expected no excess property"`, or
27643
+ * `"Unexpected key with value <input>"` when the issue reports an input.
27570
27644
  *
27571
27645
  * @see {@link MissingKey} — the opposite case (required key absent)
27572
27646
  * @see {@link Pointer} — wraps this issue with the unexpected key's path
@@ -27580,8 +27654,8 @@ var UnexpectedKey = class extends Base$1 {
27580
27654
  * The schema that caused the issue.
27581
27655
  */
27582
27656
  ast;
27583
- constructor(ast) {
27584
- super();
27657
+ constructor(ast, input, options) {
27658
+ super(input, options);
27585
27659
  this.ast = ast;
27586
27660
  }
27587
27661
  };
@@ -27614,8 +27688,8 @@ var Composite = class extends Base$1 {
27614
27688
  * The issues that occurred.
27615
27689
  */
27616
27690
  issues;
27617
- constructor(ast, issues) {
27618
- super();
27691
+ constructor(ast, issues, input, options) {
27692
+ super(input, options);
27619
27693
  this.ast = ast;
27620
27694
  this.issues = issues;
27621
27695
  }
@@ -27632,15 +27706,17 @@ var Composite = class extends Base$1 {
27632
27706
  * **Details**
27633
27707
  *
27634
27708
  * - `ast` is the schema node that expected a different type.
27635
- * - The default formatter renders this as `"Expected <type>"`.
27709
+ * - The default formatter renders this as `"Expected <type>"`, adding
27710
+ * `", got <input>"` when the issue reports an input.
27636
27711
  *
27637
27712
  * **Example** (Formatting a type mismatch)
27638
27713
  *
27639
27714
  * ```ts import.meta.vitest
27640
27715
  * import { Schema, SchemaIssue } from "effect"
27641
27716
  *
27717
+ * const formatIssue = SchemaIssue.makeFormatterDefault()
27642
27718
  * const issue = new SchemaIssue.InvalidType(Schema.String.ast)
27643
- * String(issue) // => "Expected string"
27719
+ * formatIssue(issue) // => "Expected string"
27644
27720
  * ```
27645
27721
  *
27646
27722
  * @see {@link InvalidValue} — the input has the right type but fails a value constraint
@@ -27654,8 +27730,8 @@ var InvalidType = class extends Base$1 {
27654
27730
  * The schema that caused the issue.
27655
27731
  */
27656
27732
  ast;
27657
- constructor(ast) {
27658
- super();
27733
+ constructor(ast, input, options) {
27734
+ super(input, options);
27659
27735
  this.ast = ast;
27660
27736
  }
27661
27737
  };
@@ -27670,17 +27746,22 @@ var InvalidType = class extends Base$1 {
27670
27746
  *
27671
27747
  * **Details**
27672
27748
  *
27673
- * - `annotations` optionally carries a `message` string for formatting.
27674
- * - The default formatter renders this as `"Expected a valid value"` unless a
27675
- * custom `message` annotation is provided.
27749
+ * - A `message` annotation is returned unchanged and takes precedence over all
27750
+ * other default formatting.
27751
+ * - Without `message`, an `expected` annotation is formatted as
27752
+ * `"Expected <expected>"`, adding `", got <input>"` when input is reported.
27753
+ * - Without either annotation, the default formatter renders
27754
+ * `"Expected a valid value"`, or `"Invalid data <input>"` when input is
27755
+ * reported.
27676
27756
  *
27677
27757
  * **Example** (Returning InvalidValue from a custom filter)
27678
27758
  *
27679
27759
  * ```ts import.meta.vitest
27680
27760
  * import { SchemaIssue } from "effect"
27681
27761
  *
27762
+ * const formatIssue = SchemaIssue.makeFormatterDefault()
27682
27763
  * const issue = new SchemaIssue.InvalidValue({ message: "must not be empty" })
27683
- * String(issue) // => "must not be empty"
27764
+ * formatIssue(issue) // => "must not be empty"
27684
27765
  * ```
27685
27766
  *
27686
27767
  * @see {@link InvalidType} — the input has the wrong type entirely
@@ -27695,8 +27776,8 @@ var InvalidValue$1 = class extends Base$1 {
27695
27776
  * The metadata for the issue.
27696
27777
  */
27697
27778
  annotations;
27698
- constructor(annotations) {
27699
- super();
27779
+ constructor(annotations, input, options) {
27780
+ super(input, options);
27700
27781
  this.annotations = annotations;
27701
27782
  }
27702
27783
  };
@@ -27719,10 +27800,11 @@ var InvalidValue$1 = class extends Base$1 {
27719
27800
  * ```ts import.meta.vitest
27720
27801
  * import { SchemaIssue } from "effect"
27721
27802
  *
27803
+ * const formatIssue = SchemaIssue.makeFormatterDefault()
27722
27804
  * const issue = new SchemaIssue.Forbidden(
27723
27805
  * { message: "async operation not allowed in sync context" }
27724
27806
  * )
27725
- * String(issue) // => "async operation not allowed in sync context"
27807
+ * formatIssue(issue) // => "async operation not allowed in sync context"
27726
27808
  * ```
27727
27809
  *
27728
27810
  * @see {@link InvalidValue} — for value-constraint failures (not operation failures)
@@ -27736,8 +27818,8 @@ var Forbidden = class extends Base$1 {
27736
27818
  * The metadata for the issue.
27737
27819
  */
27738
27820
  annotations;
27739
- constructor(annotations) {
27740
- super();
27821
+ constructor(annotations, input, options) {
27822
+ super(input, options);
27741
27823
  this.annotations = annotations;
27742
27824
  }
27743
27825
  };
@@ -27757,7 +27839,8 @@ var Forbidden = class extends Base$1 {
27757
27839
  * **Gotchas**
27758
27840
  *
27759
27841
  * `issues` is empty when no union member was applicable. In that case, the
27760
- * default formatter reports the expected type for the union.
27842
+ * default formatter reports the expected type for the union and appends
27843
+ * `", got <input>"` when input is reported.
27761
27844
  *
27762
27845
  * @see {@link OneOf} — the opposite: *too many* members matched
27763
27846
  * @see {@link Composite} — groups multiple issues under a non-union schema
@@ -27775,8 +27858,8 @@ var AnyOf = class extends Base$1 {
27775
27858
  * The issues that occurred.
27776
27859
  */
27777
27860
  issues;
27778
- constructor(ast, issues) {
27779
- super();
27861
+ constructor(ast, issues, input, options) {
27862
+ super(input, options);
27780
27863
  this.ast = ast;
27781
27864
  this.issues = issues;
27782
27865
  }
@@ -27795,7 +27878,9 @@ var AnyOf = class extends Base$1 {
27795
27878
  * - `ast` is the `Union` AST node.
27796
27879
  * - `successes` lists the AST nodes of each member that accepted the input.
27797
27880
  * - The default formatter renders this as
27798
- * `"Expected exactly one member to match"`.
27881
+ * `"Expected exactly one member to match"`, or
27882
+ * `"Expected exactly one member to match the input <input>"` when input is
27883
+ * reported.
27799
27884
  *
27800
27885
  * @see {@link AnyOf} — the opposite: *no* members matched
27801
27886
  *
@@ -27812,31 +27897,31 @@ var OneOf = class extends Base$1 {
27812
27897
  * The schemas that were successful.
27813
27898
  */
27814
27899
  successes;
27815
- constructor(ast, successes) {
27816
- super();
27900
+ constructor(ast, successes, input, options) {
27901
+ super(input, options);
27817
27902
  this.ast = ast;
27818
27903
  this.successes = successes;
27819
27904
  }
27820
27905
  };
27821
- function makeFilterIssue(entry) {
27906
+ function makeFilterIssue(entry, input, options) {
27822
27907
  if (isIssue(entry)) return entry;
27823
- if (typeof entry === "string") return new InvalidValue$1({ message: entry });
27824
- const inner = typeof entry.issue === "string" ? new InvalidValue$1({ message: entry.issue }) : entry.issue;
27908
+ if (typeof entry === "string") return new InvalidValue$1({ message: entry }, input, options);
27909
+ const inner = typeof entry.issue === "string" ? new InvalidValue$1({ message: entry.issue }, input, options) : entry.issue;
27825
27910
  return new Pointer(entry.path, inner);
27826
27911
  }
27827
27912
  /** @internal */
27828
- function makeSingle$1(out) {
27913
+ function makeSingle$1(out, input, options) {
27829
27914
  if (out === void 0) return;
27830
- if (typeof out === "boolean") return out ? void 0 : new InvalidValue$1();
27831
- return makeFilterIssue(out);
27915
+ if (typeof out === "boolean") return out ? void 0 : new InvalidValue$1(void 0, input, options);
27916
+ return makeFilterIssue(out, input, options);
27832
27917
  }
27833
27918
  /** @internal */
27834
- function normalizeFilterOutput(ast, out) {
27919
+ function normalizeFilterOutput(ast, out, input, options) {
27835
27920
  if (Array.isArray(out)) {
27836
27921
  if (!isReadonlyArrayNonEmpty(out)) return;
27837
- return out.length === 1 ? makeFilterIssue(out[0]) : new Composite(ast, map$9(out, makeFilterIssue));
27922
+ return out.length === 1 ? makeFilterIssue(out[0], input, options) : new Composite(ast, map$9(out, (entry) => makeFilterIssue(entry, input, options)), input, options);
27838
27923
  }
27839
- return makeSingle$1(out);
27924
+ return makeSingle$1(out, input, options);
27840
27925
  }
27841
27926
  /**
27842
27927
  * Returns the built-in {@link LeafHook} used by default formatters.
@@ -27848,13 +27933,18 @@ function normalizeFilterOutput(ast, out) {
27848
27933
  * **Details**
27849
27934
  *
27850
27935
  * - Checks for a `message` annotation first; returns it if present.
27851
- * - Otherwise generates a default message per `_tag`:
27852
- * - `InvalidType` `"Expected <type>"`
27853
- * - `InvalidValue` `"Expected a valid value"`
27936
+ * - For `InvalidValue`, an `expected` annotation uses the standard expected
27937
+ * value message and includes reported input when available.
27938
+ * - Otherwise generates a default message per `_tag`. When the issue reports
27939
+ * input, the message includes its formatted value where applicable:
27940
+ * - `InvalidType` → `"Expected <type>"` or `"Expected <type>, got <input>"`
27941
+ * - `InvalidValue` → `"Expected a valid value"` or `"Invalid data <input>"`
27854
27942
  * - `MissingKey` → `"Missing key"`
27855
- * - `UnexpectedKey` → `"Expected no excess property"`
27943
+ * - `UnexpectedKey` → `"Expected no excess property"` or
27944
+ * `"Unexpected key with value <input>"`
27856
27945
  * - `Forbidden` → `"Forbidden operation"`
27857
- * - `OneOf` → `"Expected exactly one member to match"`
27946
+ * - `OneOf` → `"Expected exactly one member to match"` or
27947
+ * `"Expected exactly one member to match the input <input>"`
27858
27948
  *
27859
27949
  * **Example** (Formatting Standard Schema issues with defaultLeafHook)
27860
27950
  *
@@ -27877,12 +27967,23 @@ const defaultLeafHook = (issue) => {
27877
27967
  const message = findMessage(issue);
27878
27968
  if (message !== void 0) return message;
27879
27969
  switch (issue._tag) {
27880
- case "InvalidType": return getExpectedMessage(getExpected(issue.ast));
27881
- case "InvalidValue": return "Expected a valid value";
27970
+ case "InvalidType": return getExpectedMessage(getExpected(issue.ast), issue);
27971
+ case "InvalidValue": {
27972
+ const expected = findExpected(issue);
27973
+ if (expected !== void 0) return getExpectedMessage(expected, issue);
27974
+ const input = formatInput(issue);
27975
+ return input === void 0 ? "Expected a valid value" : `Invalid data ${input}`;
27976
+ }
27882
27977
  case "MissingKey": return "Missing key";
27883
- case "UnexpectedKey": return "Expected no excess property";
27978
+ case "UnexpectedKey": {
27979
+ const input = formatInput(issue);
27980
+ return input === void 0 ? "Expected no excess property" : `Unexpected key with value ${input}`;
27981
+ }
27884
27982
  case "Forbidden": return "Forbidden operation";
27885
- case "OneOf": return "Expected exactly one member to match";
27983
+ case "OneOf": {
27984
+ const input = formatInput(issue);
27985
+ return input === void 0 ? "Expected exactly one member to match" : `Expected exactly one member to match the input ${input}`;
27986
+ }
27886
27987
  }
27887
27988
  };
27888
27989
  /**
@@ -27897,7 +27998,8 @@ const defaultLeafHook = (issue) => {
27897
27998
  * - Looks for a `message` annotation on the inner issue first, then on the
27898
27999
  * filter itself.
27899
28000
  * - Returns `undefined` when no annotation is found, causing the formatter to
27900
- * fall back to `"Expected <filter>"`.
28001
+ * fall back to `"Expected <filter>"` or, when the filter reports input,
28002
+ * `"Expected <filter>, got <input>"`.
27901
28003
  *
27902
28004
  * @see {@link CheckHook}
27903
28005
  * @see {@link makeFormatterStandardSchemaV1}
@@ -27905,11 +28007,17 @@ const defaultLeafHook = (issue) => {
27905
28007
  * @category formatting
27906
28008
  * @since 4.0.0
27907
28009
  */
27908
- const defaultCheckHook = (issue) => {
27909
- return findMessage(issue.issue) ?? findMessage(issue);
27910
- };
27911
- function getExpectedMessage(expected) {
27912
- return `Expected ${expected}`;
28010
+ const defaultCheckHook = (issue) => findMessage(issue.issue) ?? findMessage(issue);
28011
+ function formatInput(issue) {
28012
+ return hasInput(issue) ? format$3(issue.input) : void 0;
28013
+ }
28014
+ function findExpected(issue) {
28015
+ const expected = issue.annotations?.expected;
28016
+ return typeof expected === "string" ? expected : void 0;
28017
+ }
28018
+ function getExpectedMessage(expected, issue) {
28019
+ const input = formatInput(issue);
28020
+ return input === void 0 ? `Expected ${expected}` : `Expected ${expected}, got ${input}`;
27913
28021
  }
27914
28022
  function toDefaultIssues(issue, path, leafHook, checkHook) {
27915
28023
  switch (issue._tag) {
@@ -27919,13 +28027,12 @@ function toDefaultIssues(issue, path, leafHook, checkHook) {
27919
28027
  path,
27920
28028
  message
27921
28029
  }];
27922
- switch (issue.issue._tag) {
27923
- case "InvalidValue": return [{
27924
- path,
27925
- message: getExpectedMessage(formatCheck(issue.filter))
27926
- }];
27927
- default: return toDefaultIssues(issue.issue, path, leafHook, checkHook);
27928
- }
28030
+ if (issue.issue._tag !== "InvalidValue") return toDefaultIssues(issue.issue, path, leafHook, checkHook);
28031
+ const expected = findExpected(issue.issue);
28032
+ return [{
28033
+ path,
28034
+ message: expected === void 0 ? getExpectedMessage(formatCheck(issue.filter), issue) : getExpectedMessage(expected, issue.issue)
28035
+ }];
27929
28036
  }
27930
28037
  case "Encoding": return toDefaultIssues(issue.issue, path, leafHook, checkHook);
27931
28038
  case "Pointer": return toDefaultIssues(issue.issue, [...path, ...issue.path], leafHook, checkHook);
@@ -27933,7 +28040,7 @@ function toDefaultIssues(issue, path, leafHook, checkHook) {
27933
28040
  case "AnyOf":
27934
28041
  if (issue.issues.length === 0) return [{
27935
28042
  path,
27936
- message: findMessage(issue) ?? getExpectedMessage(getExpected(issue.ast))
28043
+ message: findMessage(issue) ?? getExpectedMessage(getExpected(issue.ast), issue)
27937
28044
  }];
27938
28045
  return issue.issues.flatMap((issue) => toDefaultIssues(issue, path, leafHook, checkHook));
27939
28046
  default: return [{
@@ -27961,13 +28068,19 @@ function formatCheck(check) {
27961
28068
  *
27962
28069
  * **Details**
27963
28070
  *
27964
- * This is the default formatter used by `SchemaIssue.toString()`.
27965
- *
27966
28071
  * - Flattens the issue tree into `{ message, path }` entries using
27967
28072
  * {@link defaultLeafHook} and {@link defaultCheckHook}.
28073
+ * - Includes reported input in default messages when the node producing the
28074
+ * message has an `input` field.
27968
28075
  * - Each entry is rendered as `"<message>"` or `"<message>\n at <path>"`.
27969
28076
  * - Multiple entries are joined with newlines.
27970
28077
  *
28078
+ * **Gotchas**
28079
+ *
28080
+ * Formatting an issue can disclose input retained with `reportInput: true`.
28081
+ * Wrapper inputs are not inherited by child messages, and custom messages are
28082
+ * returned unchanged.
28083
+ *
27971
28084
  * **Example** (Formatting an issue as a string)
27972
28085
  *
27973
28086
  * ```ts import.meta.vitest
@@ -28016,7 +28129,7 @@ function getMessageAnnotation(annotations, type = "message") {
28016
28129
  }
28017
28130
 
28018
28131
  //#endregion
28019
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/schema/cause.js
28132
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/schema/cause.js
28020
28133
  /** @internal */
28021
28134
  function getSchemaIssue(cause) {
28022
28135
  let issue;
@@ -28034,16 +28147,7 @@ function getSchemaIssueOrThrow(cause, message) {
28034
28147
  }
28035
28148
 
28036
28149
  //#endregion
28037
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/schema/parser.js
28038
- const missing = /* @__PURE__ */ Symbol();
28039
- const succeed$1 = succeed$4;
28040
- const missingExit = /* @__PURE__ */ succeed$1(missing);
28041
- const sameExit = /* @__PURE__ */ succeed$1(missing);
28042
- const toOption = (value) => value === missing ? none$3() : some(value);
28043
- const fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed$1(option.value);
28044
-
28045
- //#endregion
28046
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/DateTime.js
28150
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/DateTime.js
28047
28151
  TypeId$30;
28048
28152
  TimeZoneTypeId;
28049
28153
  /**
@@ -29930,7 +30034,7 @@ const formatIsoZoned = formatIsoZoned$1;
29930
30034
  const layerCurrentZoneNamed = /* @__PURE__ */ flow(zoneMakeNamedEffect$1, /* @__PURE__ */ effect(CurrentTimeZone));
29931
30035
 
29932
30036
  //#endregion
29933
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Encoding.js
30037
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Encoding.js
29934
30038
  /**
29935
30039
  * Encoding and decoding helpers for Base64, Base64Url, and hexadecimal text.
29936
30040
  * The functions convert between strings, UTF-8 text, and `Uint8Array` bytes.
@@ -30809,7 +30913,7 @@ const bytesToHex = [
30809
30913
  ];
30810
30914
 
30811
30915
  //#endregion
30812
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/SchemaGetter.js
30916
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/SchemaGetter.js
30813
30917
  /**
30814
30918
  * Builds one-way conversions used by schemas.
30815
30919
  *
@@ -30978,10 +31082,10 @@ function transform$2(f) {
30978
31082
  * import { Effect, Option, SchemaGetter, SchemaIssue } from "effect"
30979
31083
  *
30980
31084
  * const safeParseInt = SchemaGetter.transformOrFail<number, string>(
30981
- * (s) => {
31085
+ * (s, options) => {
30982
31086
  * const n = parseInt(s, 10)
30983
31087
  * return isNaN(n)
30984
- * ? Effect.fail(new SchemaIssue.InvalidValue({ message: "not an integer" }))
31088
+ * ? Effect.fail(new SchemaIssue.InvalidValue({ message: "not an integer" }, s, options))
30985
31089
  * : Effect.succeed(n)
30986
31090
  * }
30987
31091
  * )
@@ -31284,7 +31388,7 @@ function encodeHex() {
31284
31388
  * @since 4.0.0
31285
31389
  */
31286
31390
  function decodeBase64() {
31287
- return transformOrFail$1((input) => mapErrorEager(fromResult(decodeBase64$1(input)), () => new InvalidValue$1({ message: "Expected a valid Base64 string" })));
31391
+ return transformOrFail$1((input, options) => mapErrorEager(fromResult(decodeBase64$1(input)), () => new InvalidValue$1({ expected: "a valid Base64 string" }, input, options)));
31288
31392
  }
31289
31393
  /**
31290
31394
  * Decodes a Base64 string to a UTF-8 `string`.
@@ -31309,8 +31413,8 @@ function decodeBase64() {
31309
31413
  * @since 4.0.0
31310
31414
  */
31311
31415
  function decodeBase64String() {
31312
- return transformOrFail$1((input) => match$7(decodeBase64String$1(input), {
31313
- onFailure: () => fail$1(new InvalidValue$1({ message: "Expected a valid Base64 string" })),
31416
+ return transformOrFail$1((input, options) => match$7(decodeBase64String$1(input), {
31417
+ onFailure: () => fail$1(new InvalidValue$1({ expected: "a valid Base64 string" }, input, options)),
31314
31418
  onSuccess: succeed$2
31315
31419
  }));
31316
31420
  }
@@ -31337,8 +31441,8 @@ function decodeBase64String() {
31337
31441
  * @since 4.0.0
31338
31442
  */
31339
31443
  function decodeBase64UrlString() {
31340
- return transformOrFail$1((input) => match$7(decodeBase64UrlString$1(input), {
31341
- onFailure: () => fail$1(new InvalidValue$1({ message: "Expected a valid Base64Url string" })),
31444
+ return transformOrFail$1((input, options) => match$7(decodeBase64UrlString$1(input), {
31445
+ onFailure: () => fail$1(new InvalidValue$1({ expected: "a valid Base64Url string" }, input, options)),
31342
31446
  onSuccess: succeed$2
31343
31447
  }));
31344
31448
  }
@@ -31365,8 +31469,8 @@ function decodeBase64UrlString() {
31365
31469
  * @since 4.0.0
31366
31470
  */
31367
31471
  function decodeHexString() {
31368
- return transformOrFail$1((input) => match$7(decodeHexString$1(input), {
31369
- onFailure: () => fail$1(new InvalidValue$1({ message: "Expected a valid hexadecimal string" })),
31472
+ return transformOrFail$1((input, options) => match$7(decodeHexString$1(input), {
31473
+ onFailure: () => fail$1(new InvalidValue$1({ expected: "a valid hexadecimal string" }, input, options)),
31370
31474
  onSuccess: succeed$2
31371
31475
  }));
31372
31476
  }
@@ -31418,11 +31522,11 @@ function encodeUriComponent() {
31418
31522
  * @since 4.0.0
31419
31523
  */
31420
31524
  function decodeUriComponent() {
31421
- return transformOrFail$1((input) => {
31525
+ return transformOrFail$1((input, options) => {
31422
31526
  try {
31423
31527
  return succeed$2(globalThis.decodeURIComponent(input));
31424
31528
  } catch {
31425
- return fail$1(new InvalidValue$1({ message: "Expected a valid URI component" }));
31529
+ return fail$1(new InvalidValue$1({ expected: "a valid URI component" }, input, options));
31426
31530
  }
31427
31531
  });
31428
31532
  }
@@ -31459,9 +31563,9 @@ function decodeUriComponent() {
31459
31563
  * @since 4.0.0
31460
31564
  */
31461
31565
  function dateTimeUtcFromInput() {
31462
- return transformOrFail$1((input) => {
31566
+ return transformOrFail$1((input, options) => {
31463
31567
  return match$8(make$17(input), {
31464
- onNone: () => fail$1(new InvalidValue$1({ message: "Invalid DateTime input" })),
31568
+ onNone: () => fail$1(new InvalidValue$1({ message: "Invalid DateTime input" }, input, options)),
31465
31569
  onSome: (dt) => succeed$2(toUtc(dt))
31466
31570
  });
31467
31571
  });
@@ -31525,7 +31629,7 @@ function collectBracketPathEntries(isLeaf) {
31525
31629
  }
31526
31630
 
31527
31631
  //#endregion
31528
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/BigDecimal.js
31632
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/BigDecimal.js
31529
31633
  /**
31530
31634
  * Decimal numbers and arithmetic for cases where JavaScript `number` rounding
31531
31635
  * is not precise enough. A `BigDecimal` stores digits as a `bigint` plus a
@@ -32219,7 +32323,7 @@ const floor = /* @__PURE__ */ dual(isBigDecimalArgs, (self, scale = 0) => {
32219
32323
  });
32220
32324
 
32221
32325
  //#endregion
32222
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/SchemaTransformation.js
32326
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/SchemaTransformation.js
32223
32327
  /**
32224
32328
  * Builds two-way conversions used by schemas.
32225
32329
  *
@@ -32383,10 +32487,10 @@ const make$15 = (options) => {
32383
32487
  * Schema.decodeTo(
32384
32488
  * Schema.Date,
32385
32489
  * SchemaTransformation.transformOrFail({
32386
- * decode: (s) => {
32490
+ * decode: (s, options) => {
32387
32491
  * const d = new Date(s)
32388
32492
  * return isNaN(d.getTime())
32389
- * ? Effect.fail(new SchemaIssue.InvalidValue({ message: "Invalid date" }))
32493
+ * ? Effect.fail(new SchemaIssue.InvalidValue({ message: "Invalid date" }, s, options))
32390
32494
  * : Effect.succeed(d)
32391
32495
  * },
32392
32496
  * encode: (d) => Effect.succeed(d.toISOString())
@@ -32622,8 +32726,8 @@ const dateFromMillis = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Date$2
32622
32726
  * @since 4.0.0
32623
32727
  */
32624
32728
  const durationFromString = /* @__PURE__ */ transformOrFail({
32625
- decode: (s) => match$8(fromInput(s), {
32626
- onNone: () => fail$1(new InvalidValue$1({ message: "Expected a valid Duration string" })),
32729
+ decode: (s, options) => match$8(fromInput(s), {
32730
+ onNone: () => fail$1(new InvalidValue$1({ expected: "a valid Duration string" }, s, options)),
32627
32731
  onSome: succeed$2
32628
32732
  }),
32629
32733
  encode: (duration) => succeed$2(globalThis.String(duration))
@@ -32661,8 +32765,8 @@ const durationFromString = /* @__PURE__ */ transformOrFail({
32661
32765
  */
32662
32766
  const durationFromNanos = /* @__PURE__ */ transformOrFail({
32663
32767
  decode: (i) => succeed$2(nanos(i)),
32664
- encode: (a) => match$8(toNanos(a), {
32665
- onNone: () => fail$1(new InvalidValue$1({ message: "Expected a Duration representable as a bigint" })),
32768
+ encode: (a, options) => match$8(toNanos(a), {
32769
+ onNone: () => fail$1(new InvalidValue$1({ expected: "a Duration representable as a bigint" }, a, options)),
32666
32770
  onSome: (nanos) => succeed$2(nanos)
32667
32771
  })
32668
32772
  });
@@ -32776,7 +32880,7 @@ const defectFromJson = (options) => transform$1({
32776
32880
  * @since 4.0.0
32777
32881
  */
32778
32882
  const urlFromString = /* @__PURE__ */ transformOrFail({
32779
- decode: (s) => URL.canParse(s) ? succeed$2(new URL(s)) : fail$1(new InvalidValue$1({ message: "Expected a valid URL string" })),
32883
+ decode: (s, options) => URL.canParse(s) ? succeed$2(new URL(s)) : fail$1(new InvalidValue$1({ expected: "a valid URL string" }, s, options)),
32780
32884
  encode: (url) => succeed$2(url.href)
32781
32885
  });
32782
32886
  /**
@@ -32798,9 +32902,9 @@ const urlFromString = /* @__PURE__ */ transformOrFail({
32798
32902
  * @since 4.0.0
32799
32903
  */
32800
32904
  const bigDecimalFromString = /* @__PURE__ */ transformOrFail({
32801
- decode: (s) => {
32905
+ decode: (s, options) => {
32802
32906
  const result = fromString(s);
32803
- return isNone(result) ? fail$1(new InvalidValue$1({ message: "Expected a valid BigDecimal string" })) : succeed$2(result.value);
32907
+ return isNone(result) ? fail$1(new InvalidValue$1({ expected: "a valid BigDecimal string" }, s, options)) : succeed$2(result.value);
32804
32908
  },
32805
32909
  encode: (bd) => succeed$2(format(bd))
32806
32910
  });
@@ -33007,9 +33111,9 @@ const timeZoneOffsetFromNumber = /* @__PURE__ */ transform$1({
33007
33111
  * @since 4.0.0
33008
33112
  */
33009
33113
  const timeZoneNamedFromString = /* @__PURE__ */ transformOrFail({
33010
- decode: (s) => {
33114
+ decode: (s, options) => {
33011
33115
  return match$8(zoneMakeNamed(s), {
33012
- onNone: () => fail$1(new InvalidValue$1({ message: "Expected a valid IANA time zone" })),
33116
+ onNone: () => fail$1(new InvalidValue$1({ expected: "a valid IANA time zone" }, s, options)),
33013
33117
  onSome: succeed$2
33014
33118
  });
33015
33119
  },
@@ -33037,9 +33141,9 @@ const timeZoneNamedFromString = /* @__PURE__ */ transformOrFail({
33037
33141
  * @since 4.0.0
33038
33142
  */
33039
33143
  const timeZoneFromString = /* @__PURE__ */ transformOrFail({
33040
- decode: (s) => {
33144
+ decode: (s, options) => {
33041
33145
  return match$8(zoneFromString(s), {
33042
- onNone: () => fail$1(new InvalidValue$1({ message: "Expected a valid time zone" })),
33146
+ onNone: () => fail$1(new InvalidValue$1({ expected: "a valid time zone" }, s, options)),
33043
33147
  onSome: succeed$2
33044
33148
  });
33045
33149
  },
@@ -33067,9 +33171,9 @@ const timeZoneFromString = /* @__PURE__ */ transformOrFail({
33067
33171
  * @since 4.0.0
33068
33172
  */
33069
33173
  const dateTimeUtcFromString = /* @__PURE__ */ transformOrFail({
33070
- decode: (s) => {
33174
+ decode: (s, options) => {
33071
33175
  return match$8(make$17(s), {
33072
- onNone: () => fail$1(new InvalidValue$1({ message: "Expected a valid UTC DateTime string" })),
33176
+ onNone: () => fail$1(new InvalidValue$1({ expected: "a valid UTC DateTime string" }, s, options)),
33073
33177
  onSome: (result) => succeed$2(toUtc(result))
33074
33178
  });
33075
33179
  },
@@ -33096,9 +33200,9 @@ const dateTimeUtcFromString = /* @__PURE__ */ transformOrFail({
33096
33200
  * @since 4.0.0
33097
33201
  */
33098
33202
  const dateTimeZonedFromString = /* @__PURE__ */ transformOrFail({
33099
- decode: (s) => {
33203
+ decode: (s, options) => {
33100
33204
  return match$8(makeZonedFromString(s), {
33101
- onNone: () => fail$1(new InvalidValue$1({ message: "Expected a valid Zoned DateTime string" })),
33205
+ onNone: () => fail$1(new InvalidValue$1({ expected: "a valid Zoned DateTime string" }, s, options)),
33102
33206
  onSome: succeed$2
33103
33207
  });
33104
33208
  },
@@ -33106,7 +33210,7 @@ const dateTimeZonedFromString = /* @__PURE__ */ transformOrFail({
33106
33210
  });
33107
33211
 
33108
33212
  //#endregion
33109
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/SchemaAST.js
33213
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/SchemaAST.js
33110
33214
  /**
33111
33215
  * Represents Effect schemas as runtime trees.
33112
33216
  *
@@ -33194,13 +33298,6 @@ const isArrays = /* @__PURE__ */ makeGuard("Arrays");
33194
33298
  */
33195
33299
  const isObjects = /* @__PURE__ */ makeGuard("Objects");
33196
33300
  /**
33197
- * Narrows an {@link AST} to {@link Union}.
33198
- *
33199
- * @category guards
33200
- * @since 3.10.0
33201
- */
33202
- const isUnion = /* @__PURE__ */ makeGuard("Union");
33203
- /**
33204
33301
  * Narrows an {@link AST} to {@link Suspend}.
33205
33302
  *
33206
33303
  * @category guards
@@ -33988,7 +34085,7 @@ var Arrays = class Arrays extends Base {
33988
34085
  }
33989
34086
  return fnUntracedEager(function* (input, options) {
33990
34087
  if (input === missing) return missing;
33991
- if (!Array.isArray(input)) return yield* fail$1(new InvalidType(ast));
34088
+ if (!Array.isArray(input)) return yield* fail$1(new InvalidType(ast, input, options));
33992
34089
  if (!elements) {
33993
34090
  elements = ast.elements.map((ast) => ({
33994
34091
  ast,
@@ -34016,12 +34113,13 @@ var Arrays = class Arrays extends Base {
34016
34113
  });
34017
34114
  if (eff) yield* eff;
34018
34115
  if (ast.rest.length === 0 && len > elementLen) for (let i = elementLen; i <= len - 1; i++) {
34019
- const issue = new Pointer([i], new UnexpectedKey(ast));
34116
+ const unexpected = new UnexpectedKey(ast, input[i], options);
34117
+ const issue = new Pointer([i], unexpected);
34020
34118
  if (options.errors === "all") if (state.issues) state.issues.push(issue);
34021
34119
  else state.issues = [issue];
34022
- else return yield* fail$1(new Composite(ast, [issue]));
34120
+ else return yield* fail$1(new Composite(ast, [issue], input, options));
34023
34121
  }
34024
- if (state.issues) return yield* fail$1(new Composite(ast, state.issues));
34122
+ if (state.issues) return yield* fail$1(new Composite(ast, state.issues, input, options));
34025
34123
  return state.output;
34026
34124
  });
34027
34125
  }
@@ -34058,7 +34156,7 @@ const parseArray = /* @__PURE__ */ iterateEager()({
34058
34156
  const issue = new Pointer([i], new MissingKey(p.ast.context?.annotations));
34059
34157
  if (s.options.errors === "all") if (s.issues) s.issues.push(issue);
34060
34158
  else s.issues = [issue];
34061
- else return fail$2(new Composite(s.ast, [issue]));
34159
+ else return fail$2(new Composite(s.ast, [issue], s.input, s.options));
34062
34160
  }
34063
34161
  }
34064
34162
  });
@@ -34069,11 +34167,11 @@ const resolveConcurrency = (value) => {
34069
34167
  const wrapPropertyKeyIssue = (s, ast, key, exit) => {
34070
34168
  if (exit.cause.reasons.length === 0) return exit;
34071
34169
  const issue = getSchemaIssue(exit.cause);
34072
- if (issue === void 0) return failCause$2(map$7(exit.cause, (issue) => new Composite(ast, [new Pointer([key], issue)])));
34170
+ if (issue === void 0) return failCause$2(map$7(exit.cause, (issue) => new Composite(ast, [new Pointer([key], issue)], s.input, s.options)));
34073
34171
  const pointer = new Pointer([key], issue);
34074
34172
  if (s.options.errors === "all") if (s.issues) s.issues.push(pointer);
34075
34173
  else s.issues = [pointer];
34076
- else return fail$2(new Composite(ast, [pointer]));
34174
+ else return fail$2(new Composite(ast, [pointer], s.input, s.options));
34077
34175
  };
34078
34176
  /**
34079
34177
  * floating point or integer, with optional exponent
@@ -34265,7 +34363,7 @@ var Objects = class Objects extends Base {
34265
34363
  }) : void 0;
34266
34364
  return fnUntracedEager(function* (input, options) {
34267
34365
  if (input === missing) return missing;
34268
- if (!(typeof input === "object" && input !== null && !Array.isArray(input))) return yield* fail$1(new InvalidType(ast));
34366
+ if (!(typeof input === "object" && input !== null && !Array.isArray(input))) return yield* fail$1(new InvalidType(ast, input, options));
34269
34367
  if (!properties) {
34270
34368
  properties = ast.propertySignatures.map((ps) => ({
34271
34369
  parser: compileConstructorDefault(ps.type),
@@ -34297,12 +34395,13 @@ var Objects = class Objects extends Base {
34297
34395
  for (let i = 0; i < inputKeys.length; i++) {
34298
34396
  const key = inputKeys[i];
34299
34397
  if (!expectedKeysSet.has(key)) if (onExcessPropertyError) {
34300
- const issue = new Pointer([key], new UnexpectedKey(ast));
34398
+ const unexpected = new UnexpectedKey(ast, record[key], options);
34399
+ const issue = new Pointer([key], unexpected);
34301
34400
  if (errorsAllOption) {
34302
34401
  if (state.issues) state.issues.push(issue);
34303
34402
  else state.issues = [issue];
34304
34403
  continue;
34305
- } else return yield* fail$1(new Composite(ast, [issue]));
34404
+ } else return yield* fail$1(new Composite(ast, [issue], input, options));
34306
34405
  } else assignProperty$1(out, key, record[key]);
34307
34406
  }
34308
34407
  }
@@ -34331,7 +34430,7 @@ var Objects = class Objects extends Base {
34331
34430
  const eff = parseIndexes(state, keyPairs, concurrency);
34332
34431
  if (eff) yield* eff;
34333
34432
  }
34334
- if (state.issues) return yield* fail$1(new Composite(ast, state.issues));
34433
+ if (state.issues) return yield* fail$1(new Composite(ast, state.issues, input, options));
34335
34434
  if (options.propertyOrder === "original") {
34336
34435
  const keys = (inputKeys ?? Reflect.ownKeys(record)).concat(expectedKeys);
34337
34436
  const preserved = {};
@@ -34389,7 +34488,7 @@ const parseProperties = /* @__PURE__ */ iterateEager()({
34389
34488
  if (s.issues) s.issues.push(issue);
34390
34489
  else s.issues = [issue];
34391
34490
  return;
34392
- } else return fail$2(new Composite(s.ast, [issue]));
34491
+ } else return fail$2(new Composite(s.ast, [issue], s.input, s.options));
34393
34492
  }
34394
34493
  }
34395
34494
  });
@@ -34416,7 +34515,7 @@ function tuple(elements, checks = void 0) {
34416
34515
  function union(members, mode, checks) {
34417
34516
  return new Union$1(members.map(getAST), mode, void 0, checks);
34418
34517
  }
34419
- const toCandidate = /* @__PURE__ */ memoize((ast) => {
34518
+ const toCandidate = /* @__PURE__ */ memoizeIdempotent((ast) => {
34420
34519
  while (true) {
34421
34520
  if (isSuspend(ast)) return unknown;
34422
34521
  const encoding = ast.encoding;
@@ -34642,7 +34741,7 @@ var Union$1 = class Union$1 extends Base {
34642
34741
  if (candidates.length === 1) {
34643
34742
  const result = compile(candidates[0])(input, options);
34644
34743
  if (result._tag === "Success") return result;
34645
- return effectIsExit(result) ? failSingleUnionCandidate(ast, result.cause) : catchCause(result, (cause) => failSingleUnionCandidate(ast, cause));
34744
+ return effectIsExit(result) ? failSingleUnionCandidate(ast, result.cause, input, options) : catchCause(result, (cause) => failSingleUnionCandidate(ast, cause, input, options));
34646
34745
  }
34647
34746
  const state = {
34648
34747
  ast,
@@ -34658,9 +34757,14 @@ var Union$1 = class Union$1 extends Base {
34658
34757
  ...concurrency,
34659
34758
  orderedStep: true
34660
34759
  } : void 0);
34661
- if (!eff) return state.out ?? fail$1(new AnyOf(ast, state.issues ?? []));
34760
+ if (!eff) {
34761
+ if (state.out) return state.out;
34762
+ return fail$1(new AnyOf(ast, state.issues ?? [], input, options));
34763
+ }
34662
34764
  return flatMapEager(eff, (_) => {
34663
- return state.out === sameExit ? succeed$2(input) : state.out ?? fail$1(new AnyOf(ast, state.issues ?? []));
34765
+ if (state.out === sameExit) return succeed$2(input);
34766
+ if (state.out) return state.out;
34767
+ return fail$1(new AnyOf(ast, state.issues ?? [], input, options));
34664
34768
  });
34665
34769
  };
34666
34770
  }
@@ -34707,9 +34811,10 @@ var Union$1 = class Union$1 extends Base {
34707
34811
  return Array.from(new Set(types)).join(" | ");
34708
34812
  }
34709
34813
  };
34710
- function failSingleUnionCandidate(ast, cause) {
34814
+ function failSingleUnionCandidate(ast, cause, input, options) {
34711
34815
  const issue = getSchemaIssue(cause);
34712
- return issue ? fail$2(new AnyOf(ast, [issue])) : failCause$2(cause);
34816
+ if (!issue) return failCause$2(cause);
34817
+ return fail$2(new AnyOf(ast, [issue], input, options));
34713
34818
  }
34714
34819
  const parseUnion = /* @__PURE__ */ iterateEager()({
34715
34820
  onItem(s, ast) {
@@ -34724,7 +34829,7 @@ const parseUnion = /* @__PURE__ */ iterateEager()({
34724
34829
  } else {
34725
34830
  if (s.out && s.successes) {
34726
34831
  s.successes.push(candidate);
34727
- return fail$2(new OneOf(s.ast, s.successes));
34832
+ return fail$2(new OneOf(s.ast, s.successes, s.input, s.options));
34728
34833
  }
34729
34834
  s.out = exit;
34730
34835
  if (s.successes) s.successes.push(candidate);
@@ -34826,7 +34931,7 @@ var FilterGroup = class FilterGroup extends Class$1 {
34826
34931
  };
34827
34932
  /** @internal */
34828
34933
  function makeFilter$1(filter, annotations, aborted = false) {
34829
- return new Filter((input, ast, options) => normalizeFilterOutput(ast, filter(input, ast, options)), annotations, aborted);
34934
+ return new Filter((input, ast, options) => normalizeFilterOutput(ast, filter(input, ast, options), input, options), annotations, aborted);
34830
34935
  }
34831
34936
  /** @internal */
34832
34937
  function isFinite$2(annotations) {
@@ -34908,6 +35013,11 @@ function modifyOwnPropertyDescriptors(ast, f) {
34908
35013
  f(d);
34909
35014
  return Object.create(Object.getPrototypeOf(ast), d);
34910
35015
  }
35016
+ const contextOwners = /* @__PURE__ */ new WeakMap();
35017
+ /** @internal */
35018
+ function getContextOwner(ast) {
35019
+ return contextOwners.get(ast) ?? ast;
35020
+ }
34911
35021
  /** @internal */
34912
35022
  function replaceEncoding(ast, encoding) {
34913
35023
  if (ast.encoding === encoding) return ast;
@@ -34918,9 +35028,13 @@ function replaceEncoding(ast, encoding) {
34918
35028
  /** @internal */
34919
35029
  function replaceContext(ast, context) {
34920
35030
  if (ast.context === context) return ast;
34921
- return modifyOwnPropertyDescriptors(ast, (d) => {
35031
+ const owner = getContextOwner(ast);
35032
+ if (owner.context === context) return owner;
35033
+ const out = modifyOwnPropertyDescriptors(ast, (d) => {
34922
35034
  d.context.value = context;
34923
35035
  });
35036
+ contextOwners.set(out, owner);
35037
+ return out;
34924
35038
  }
34925
35039
  /** @internal */
34926
35040
  function annotate$1(ast, annotations) {
@@ -34967,11 +35081,15 @@ function replaceContextLastLink(ast, context) {
34967
35081
  return applyToLastLink((ast) => replaceContext(ast, context))(ast);
34968
35082
  }
34969
35083
  /** @internal */
34970
- function applyToSelfOrLastLinkEncoding(f) {
35084
+ function applyToSelfOrLastLinkEncodingIdempotent(f, options) {
34971
35085
  function out(ast) {
34972
- return ast.encoding ? replaceEncoding(ast, updateLastLink(ast.encoding, out)) : f(ast);
35086
+ if (ast.encoding) {
35087
+ const last = ast.encoding[ast.encoding.length - 1];
35088
+ return options?.stopAt?.(last) ? ast : replaceEncoding(ast, updateLastLink(ast.encoding, out));
35089
+ }
35090
+ return f(ast);
34973
35091
  }
34974
- return memoize(out);
35092
+ return memoizeIdempotent(out);
34975
35093
  }
34976
35094
  function appendTransformation(from, transformation, to) {
34977
35095
  const link = new Link(from, transformation);
@@ -34995,24 +35113,13 @@ function annotateKey(ast, annotations) {
34995
35113
  ...annotations
34996
35114
  }) : new Context(false, false, void 0, annotations));
34997
35115
  }
34998
- const optionalKeyLastLink = /* @__PURE__ */ applyToLastLink(optionalKey$1);
34999
- /**
35000
- * Marks an AST node's property key as optional by setting
35001
- * {@link Context.isOptional} to `true`.
35002
- *
35003
- * **Details**
35004
- *
35005
- * Also propagates the optional flag through the last link of the encoding
35006
- * chain if present.
35007
- *
35008
- * @see {@link isOptional}
35009
- * @see {@link Context}
35010
- * @category transforming
35011
- * @since 4.0.0
35012
- */
35013
- function optionalKey$1(ast) {
35116
+ /** @internal */
35117
+ const optionalKey$1 = /* @__PURE__ */ memoizeIdempotent((ast) => {
35014
35118
  return optionalKeyLastLink(replaceContext(ast, ast.context ? ast.context.isOptional === false ? new Context(true, ast.context.isMutable, ast.context.constructorDefault, ast.context.annotations) : ast.context : new Context(true, false)));
35015
- }
35119
+ });
35120
+ const optionalKeyLastLink = /* @__PURE__ */ applyToLastLink(optionalKey$1);
35121
+ /** @internal */
35122
+ const optional$3 = /* @__PURE__ */ memoize((ast) => optionalKey$1(new Union$1([ast, undefined_], "anyOf")));
35016
35123
  /** @internal */
35017
35124
  function withConstructorDefault$1(ast, defaultValue) {
35018
35125
  const constructorDefault = new Link(unknown, new Transformation(withDefault$2(defaultValue), passthrough$1()));
@@ -35091,7 +35198,7 @@ function extractStructuralChecks(checks) {
35091
35198
  * @category transforming
35092
35199
  * @since 4.0.0
35093
35200
  */
35094
- const toType = /* @__PURE__ */ memoize((ast) => {
35201
+ const toType = /* @__PURE__ */ memoizeIdempotent((ast) => {
35095
35202
  if (ast.encoding) return toType(replaceEncoding(ast, void 0));
35096
35203
  const out = ast;
35097
35204
  const type = out.recur?.(toType) ?? out;
@@ -35131,7 +35238,7 @@ const toType = /* @__PURE__ */ memoize((ast) => {
35131
35238
  * @category transforming
35132
35239
  * @since 4.0.0
35133
35240
  */
35134
- const toEncoded = /* @__PURE__ */ memoize((ast) => {
35241
+ const toEncoded = /* @__PURE__ */ memoizeIdempotent((ast) => {
35135
35242
  return toType(flip(ast));
35136
35243
  });
35137
35244
  function flipEncoding(ast, encoding) {
@@ -35176,18 +35283,20 @@ function containsUndefined(ast) {
35176
35283
  }
35177
35284
  function fromConst(ast, value) {
35178
35285
  const succeed = succeed$1(value);
35179
- return (input) => {
35286
+ return (input, options) => {
35180
35287
  if (input === missing) return missingExit;
35181
- return input === value ? succeed : fail$1(new InvalidType(ast));
35288
+ if (input === value) return succeed;
35289
+ return fail$1(new InvalidType(ast, input, options));
35182
35290
  };
35183
35291
  }
35184
35292
  function fromRefinement(ast, refinement) {
35185
- return (input) => {
35293
+ return (input, options) => {
35186
35294
  if (input === missing) return missingExit;
35187
- return refinement(input) ? sameExit : fail$1(new InvalidType(ast));
35295
+ if (refinement(input)) return sameExit;
35296
+ return fail$1(new InvalidType(ast, input, options));
35188
35297
  };
35189
35298
  }
35190
- const parameterFromPropertyKey = /* @__PURE__ */ applyToSelfOrLastLinkEncoding((ast) => {
35299
+ const parameterFromPropertyKey = /* @__PURE__ */ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
35191
35300
  switch (ast._tag) {
35192
35301
  default: return ast;
35193
35302
  case "Number": return ast.toCodecStringTree();
@@ -35195,7 +35304,7 @@ const parameterFromPropertyKey = /* @__PURE__ */ applyToSelfOrLastLinkEncoding((
35195
35304
  }
35196
35305
  });
35197
35306
  /** @internal */
35198
- const parameterFromString = /* @__PURE__ */ applyToSelfOrLastLinkEncoding((ast) => {
35307
+ const parameterFromString = /* @__PURE__ */ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
35199
35308
  switch (ast._tag) {
35200
35309
  default: return ast;
35201
35310
  case "Symbol":
@@ -35242,9 +35351,9 @@ const symbolString = /* @__PURE__ */ appendChecks(string$3, [/* @__PURE__ */ isS
35242
35351
  /**
35243
35352
  * to distinguish between Symbol and String, we need to add a check to the string keyword
35244
35353
  */
35245
- const symbolToString = /* @__PURE__ */ new Link(symbolString, /* @__PURE__ */ new Transformation(/* @__PURE__ */ transform$2((description) => globalThis.Symbol.for(isStringSymbolRegExp.exec(description)[1])), /* @__PURE__ */ transformOrFail$1((sym) => {
35354
+ const symbolToString = /* @__PURE__ */ new Link(symbolString, /* @__PURE__ */ new Transformation(/* @__PURE__ */ transform$2((description) => globalThis.Symbol.for(isStringSymbolRegExp.exec(description)[1])), /* @__PURE__ */ transformOrFail$1((sym, options) => {
35246
35355
  if (globalThis.Symbol.keyFor(sym) !== void 0) return succeed$2(globalThis.String(sym));
35247
- return fail$1(new Forbidden({ message: "cannot serialize to string, Symbol is not registered" }));
35356
+ return fail$1(new Forbidden({ message: "cannot serialize to string, Symbol is not registered" }, sym, options));
35248
35357
  })));
35249
35358
  /** @internal */
35250
35359
  function isStringSymbol(annotations) {
@@ -35268,7 +35377,7 @@ function collectIssues(checks, value, issues, ast, options) {
35268
35377
  } else {
35269
35378
  const issue = check.run(value, ast, options);
35270
35379
  if (issue) {
35271
- const filter = new Filter$1(check, issue);
35380
+ const filter = new Filter$1(check, issue, value, options);
35272
35381
  if (issues) issues.push(filter);
35273
35382
  else issues = [filter];
35274
35383
  if (options.errors !== "all" || check.aborted) return issues;
@@ -35418,7 +35527,7 @@ function isJson(u) {
35418
35527
  return isTree(u, isJsonLeaf);
35419
35528
  }
35420
35529
  /** @internal */
35421
- const Json$1 = /* @__PURE__ */ new Declaration([], () => (input, ast) => isJson(input) ? sameExit : fail$1(new InvalidType(ast)), {
35530
+ const Json$1 = /* @__PURE__ */ new Declaration([], () => (input, ast, options) => isJson(input) ? sameExit : fail$1(new InvalidType(ast, input, options)), {
35422
35531
  representation: {
35423
35532
  id: "effect/schema/Json",
35424
35533
  payload: null
@@ -35443,7 +35552,7 @@ const MutableJson$1 = /* @__PURE__ */ annotate$1(Json$1, { representation: {
35443
35552
  function isStringTree(u) {
35444
35553
  return isTree(u, isStringTreeLeaf);
35445
35554
  }
35446
- const StringTree = /* @__PURE__ */ new Declaration([], () => (input, ast) => isStringTree(input) ? sameExit : fail$1(new InvalidType(ast)), {
35555
+ const StringTree = /* @__PURE__ */ new Declaration([], () => (input, ast, options) => isStringTree(input) ? sameExit : fail$1(new InvalidType(ast, input, options)), {
35447
35556
  expected: "StringTree",
35448
35557
  toCodecStringTree: () => void 0
35449
35558
  });
@@ -35451,7 +35560,7 @@ const StringTree = /* @__PURE__ */ new Declaration([], () => (input, ast) => isS
35451
35560
  const unknownToStringTree = /* @__PURE__ */ new Link(StringTree, /* @__PURE__ */ passthrough());
35452
35561
 
35453
35562
  //#endregion
35454
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Brand.js
35563
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Brand.js
35455
35564
  /**
35456
35565
  * Returns a `Constructor` that **does not apply any runtime checks** and just
35457
35566
  * returns the provided value.
@@ -35476,7 +35585,7 @@ function nominal() {
35476
35585
  }
35477
35586
 
35478
35587
  //#endregion
35479
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/process/ChildProcessSpawner.js
35588
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/process/ChildProcessSpawner.js
35480
35589
  /**
35481
35590
  * Service boundary for starting and controlling child processes.
35482
35591
  *
@@ -35549,7 +35658,7 @@ const make$14 = (spawn) => {
35549
35658
  var ChildProcessSpawner = class extends Service()("effect/process/ChildProcessSpawner") {};
35550
35659
 
35551
35660
  //#endregion
35552
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/process/ChildProcess.js
35661
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/process/ChildProcess.js
35553
35662
  /**
35554
35663
  * Describes child processes before they are started.
35555
35664
  *
@@ -35758,7 +35867,19 @@ const concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || pre
35758
35867
  ];
35759
35868
 
35760
35869
  //#endregion
35761
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/internal/utils.js
35870
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
35871
+ const buildSpawnOptions = (options, base, platform) => {
35872
+ const detached = options.detached ?? platform !== "win32";
35873
+ return {
35874
+ ...base,
35875
+ detached,
35876
+ shell: options.shell,
35877
+ windowsHide: options.windowsHide ?? !detached
35878
+ };
35879
+ };
35880
+
35881
+ //#endregion
35882
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/internal/utils.js
35762
35883
  /** @internal */
35763
35884
  const handleErrnoException = (module, method) => (err, [path]) => {
35764
35885
  let reason = "Unknown";
@@ -35796,7 +35917,7 @@ const handleErrnoException = (module, method) => (err, [path]) => {
35796
35917
  };
35797
35918
 
35798
35919
  //#endregion
35799
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodeSink.js
35920
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodeSink.js
35800
35921
  /**
35801
35922
  * Creates a `Sink` that writes chunks to a Node writable stream, respecting
35802
35923
  * backpressure, mapping writable errors with `onError`, and ending the stream
@@ -35862,7 +35983,7 @@ const pullIntoWritable = (options) => options.pull.pipe(flatMap$1((chunk) => {
35862
35983
  }) : identity);
35863
35984
 
35864
35985
  //#endregion
35865
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodeStream.js
35986
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodeStream.js
35866
35987
  /**
35867
35988
  * Adapters between Node streams and Effect streams, channels, and readables.
35868
35989
  *
@@ -35943,7 +36064,7 @@ const readableToPullUnsafe = (options) => {
35943
36064
  const defaultOnError = (error) => new UnknownError(error);
35944
36065
 
35945
36066
  //#endregion
35946
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
36067
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
35947
36068
  const toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
35948
36069
  const toPlatformError = (method, error, command) => {
35949
36070
  const { commands } = flattenCommand(command);
@@ -35953,6 +36074,12 @@ const toPlatformError = (method, error, command) => {
35953
36074
  }, "");
35954
36075
  return handleErrnoException("ChildProcess", method)(error, [commandStr]);
35955
36076
  };
36077
+ const taskkill = (childProcess, onExit = () => {}) => node_child_process.execFile("taskkill", [
36078
+ "/pid",
36079
+ String(childProcess.pid),
36080
+ "/T",
36081
+ "/F"
36082
+ ], { windowsHide: true }, onExit);
35956
36083
  const make$12 = /* @__PURE__ */ gen(function* () {
35957
36084
  const fs = yield* FileSystem;
35958
36085
  const path = yield* Path;
@@ -36120,7 +36247,7 @@ const make$12 = /* @__PURE__ */ gen(function* () {
36120
36247
  });
36121
36248
  const killProcessGroup = (command, childProcess, signal) => {
36122
36249
  if (globalThis.process.platform === "win32") return callback$1((resume) => {
36123
- node_child_process.exec(`taskkill /pid ${childProcess.pid} /T /F`, (error) => {
36250
+ taskkill(childProcess, (error) => {
36124
36251
  if (error) resume(fail$1(toPlatformError("kill", toError(error), command)));
36125
36252
  else resume(void_$1);
36126
36253
  });
@@ -36134,7 +36261,7 @@ const make$12 = /* @__PURE__ */ gen(function* () {
36134
36261
  };
36135
36262
  const killProcessGroupOnExit = (childProcess, signal) => {
36136
36263
  if (globalThis.process.platform === "win32") {
36137
- node_child_process.exec(`taskkill /pid ${childProcess.pid} /T /F`, () => {});
36264
+ taskkill(childProcess);
36138
36265
  return;
36139
36266
  }
36140
36267
  try {
@@ -36183,13 +36310,11 @@ const make$12 = /* @__PURE__ */ gen(function* () {
36183
36310
  const cwd = yield* resolveWorkingDirectory(cmd.options);
36184
36311
  const env = resolveEnvironment(cmd.options);
36185
36312
  const stdio = buildStdioArray(stdinConfig, stdoutConfig, stderrConfig, resolvedAdditionalFds);
36186
- const [childProcess, exitSignal] = yield* acquireRelease(spawn(cmd, {
36313
+ const [childProcess, exitSignal] = yield* acquireRelease(spawn(cmd, buildSpawnOptions(cmd.options, {
36187
36314
  cwd,
36188
36315
  env,
36189
- stdio,
36190
- detached: cmd.options.detached ?? process.platform !== "win32",
36191
- shell: cmd.options.shell
36192
- }), fnUntraced(function* ([childProcess, exitSignal]) {
36316
+ stdio
36317
+ }, process.platform)), fnUntraced(function* ([childProcess, exitSignal]) {
36193
36318
  const exited = yield* isDone(exitSignal);
36194
36319
  const killWithTimeout = withTimeout(childProcess, cmd, cmd.options);
36195
36320
  if (exited) {
@@ -36348,7 +36473,7 @@ const flattenCommand = (command) => {
36348
36473
  };
36349
36474
 
36350
36475
  //#endregion
36351
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Crypto.js
36476
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Crypto.js
36352
36477
  /**
36353
36478
  * Defines a platform-independent service for cryptographic operations.
36354
36479
  *
@@ -36497,7 +36622,7 @@ const formatUUIDv7 = (timestampMillis, bytes) => {
36497
36622
  };
36498
36623
 
36499
36624
  //#endregion
36500
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
36625
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
36501
36626
  /**
36502
36627
  * Node-compatible implementation of Effect's `Crypto` service.
36503
36628
  *
@@ -36545,7 +36670,7 @@ const make$10 = /* @__PURE__ */ make$11({
36545
36670
  const layer$10 = /* @__PURE__ */ succeed$3(Crypto, make$10);
36546
36671
 
36547
36672
  //#endregion
36548
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.104_effect@4.0.0-beta.104_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeCrypto.js
36673
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.107_effect@4.0.0-beta.107_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeCrypto.js
36549
36674
  /**
36550
36675
  * The `NodeCrypto` module provides the Node.js `Crypto` service layer for
36551
36676
  * Effect programs. Provide {@link layer} at the edge of a Node application,
@@ -36568,7 +36693,7 @@ const layer$10 = /* @__PURE__ */ succeed$3(Crypto, make$10);
36568
36693
  const layer$9 = layer$10;
36569
36694
 
36570
36695
  //#endregion
36571
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
36696
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
36572
36697
  /**
36573
36698
  * Shared Node-compatible implementation of Effect's `FileSystem` service.
36574
36699
  *
@@ -36931,7 +37056,7 @@ const makeFileSystem = /* @__PURE__ */ map$5(/* @__PURE__ */ serviceOption(Watch
36931
37056
  const layer$8 = /* @__PURE__ */ effect(FileSystem)(makeFileSystem);
36932
37057
 
36933
37058
  //#endregion
36934
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.104_effect@4.0.0-beta.104_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeFileSystem.js
37059
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.107_effect@4.0.0-beta.107_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeFileSystem.js
36935
37060
  /**
36936
37061
  * Node.js `FileSystem` layer for programs that perform real filesystem I/O.
36937
37062
  *
@@ -36951,7 +37076,7 @@ const layer$8 = /* @__PURE__ */ effect(FileSystem)(makeFileSystem);
36951
37076
  const layer$7 = layer$8;
36952
37077
 
36953
37078
  //#endregion
36954
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodePath.js
37079
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodePath.js
36955
37080
  /**
36956
37081
  * Node-backed provider for Effect's `Path` service.
36957
37082
  *
@@ -37018,7 +37143,7 @@ const layer$6 = /* @__PURE__ */ succeed$3(Path)({
37018
37143
  });
37019
37144
 
37020
37145
  //#endregion
37021
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.104_effect@4.0.0-beta.104_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodePath.js
37146
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.107_effect@4.0.0-beta.107_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodePath.js
37022
37147
  /**
37023
37148
  * Node.js layers for Effect's `Path` service.
37024
37149
  *
@@ -37055,7 +37180,7 @@ const layerPosix = layerPosix$1;
37055
37180
  const layerWin32 = layerWin32$1;
37056
37181
 
37057
37182
  //#endregion
37058
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Stdio.js
37183
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Stdio.js
37059
37184
  /**
37060
37185
  * Service contract for command-line arguments and standard input, output, and
37061
37186
  * error output. It lets programs depend on standard I/O through the Effect
@@ -37107,8 +37232,9 @@ const Stdio = /* @__PURE__ */ Service(TypeId$10);
37107
37232
  *
37108
37233
  * **Details**
37109
37234
  *
37110
- * The returned service reuses the supplied fields unchanged and only adds the
37111
- * `Stdio` type identifier; it does not create a `Layer` or provide defaults.
37235
+ * The returned service reuses the supplied fields unchanged and adds the
37236
+ * `Stdio` type identifier. Omitted terminal-detection fields default to
37237
+ * effects that succeed with `false`.
37112
37238
  *
37113
37239
  * @see {@link layerTest} for a test layer with default fields that can be overridden
37114
37240
  *
@@ -37117,11 +37243,13 @@ const Stdio = /* @__PURE__ */ Service(TypeId$10);
37117
37243
  */
37118
37244
  const make$9 = (options) => ({
37119
37245
  [TypeId$10]: TypeId$10,
37246
+ stdinIsTerminal: succeed$2(false),
37247
+ stdoutIsTerminal: succeed$2(false),
37120
37248
  ...options
37121
37249
  });
37122
37250
 
37123
37251
  //#endregion
37124
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
37252
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
37125
37253
  /**
37126
37254
  * Shared Node.js implementation of the Effect `Stdio` service.
37127
37255
  *
@@ -37143,6 +37271,8 @@ const make$9 = (options) => ({
37143
37271
  */
37144
37272
  const layer$4 = /* @__PURE__ */ succeed$3(Stdio, /* @__PURE__ */ make$9({
37145
37273
  args: /* @__PURE__ */ sync(() => process.argv.slice(2)),
37274
+ stdinIsTerminal: /* @__PURE__ */ sync(() => process.stdin.isTTY === true),
37275
+ stdoutIsTerminal: /* @__PURE__ */ sync(() => process.stdout.isTTY === true),
37146
37276
  stdout: (options) => fromWritable({
37147
37277
  evaluate: () => process.stdout,
37148
37278
  onError: (cause) => systemError({
@@ -37176,7 +37306,7 @@ const layer$4 = /* @__PURE__ */ succeed$3(Stdio, /* @__PURE__ */ make$9({
37176
37306
  }));
37177
37307
 
37178
37308
  //#endregion
37179
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.104_effect@4.0.0-beta.104_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeStdio.js
37309
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.107_effect@4.0.0-beta.107_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeStdio.js
37180
37310
  /**
37181
37311
  * Node.js `Stdio` layer for the current process.
37182
37312
  *
@@ -37197,58 +37327,7 @@ const layer$4 = /* @__PURE__ */ succeed$3(Stdio, /* @__PURE__ */ make$9({
37197
37327
  const layer$3 = layer$4;
37198
37328
 
37199
37329
  //#endregion
37200
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/SchemaError.js
37201
- /**
37202
- * @since 4.0.0
37203
- */
37204
- const TypeId$9 = "~effect/SchemaError/SchemaError";
37205
- /**
37206
- * Error thrown (or returned as the error channel value) when schema decoding
37207
- * or encoding fails.
37208
- *
37209
- * **Details**
37210
- *
37211
- * The `issue` field contains a structured {@link Issue} tree describing
37212
- * every validation failure, including the path to the problematic value and
37213
- * the expected type or constraint. Built-in issues have no `actual` field,
37214
- * and built-in messages do not include the rejected value. Other Issue fields
37215
- * and custom annotations or messages are not sanitized. `message` renders the
37216
- * issue tree as a human-readable string.
37217
- *
37218
- * Use {@link isSchemaError} to narrow an unknown value to `SchemaError`.
37219
- *
37220
- * **Example** (Catching a SchemaError)
37221
- *
37222
- * ```ts import.meta.vitest
37223
- * import { Schema } from "effect"
37224
- *
37225
- * try {
37226
- * Schema.decodeUnknownSync(Schema.Number)("not a number")
37227
- * } catch (err) {
37228
- * if (Schema.isSchemaError(err)) {
37229
- * err.message // => "Expected number"
37230
- * }
37231
- * }
37232
- * ```
37233
- *
37234
- * @category errors
37235
- * @since 4.0.0
37236
- */
37237
- var SchemaError = class extends TaggedError$1("SchemaError") {
37238
- [TypeId$9] = TypeId$9;
37239
- constructor(issue) {
37240
- super({ issue });
37241
- }
37242
- get message() {
37243
- return this.issue.toString();
37244
- }
37245
- toString() {
37246
- return `SchemaError(${this.message})`;
37247
- }
37248
- };
37249
-
37250
- //#endregion
37251
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/SchemaParser.js
37330
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/SchemaParser.js
37252
37331
  /**
37253
37332
  * Runs schemas against real values.
37254
37333
  *
@@ -37326,6 +37405,9 @@ function makeOption(schema) {
37326
37405
  *
37327
37406
  * The returned function constructs a value from constructor input and throws an
37328
37407
  * `Error` with the `SchemaIssue.Issue` in its `cause` when construction fails.
37408
+ * Schema validation failures use the generic message `"Schema validation failed"`.
37409
+ * Format the `cause` explicitly with `SchemaIssue.makeFormatterDefault()` when
37410
+ * human-readable details are needed.
37329
37411
  *
37330
37412
  * **Gotchas**
37331
37413
  *
@@ -37342,7 +37424,7 @@ function make$8(schema) {
37342
37424
  const exit = runSyncExit(parser(input, options));
37343
37425
  if (isSuccess$1(exit)) return exit.value;
37344
37426
  const issue = getSchemaIssueOrThrow(exit.cause, "Constructor adapter can only throw schema issues");
37345
- throw new Error(issue.toString(), { cause: issue });
37427
+ throw new Error("Schema validation failed", { cause: issue });
37346
37428
  };
37347
37429
  }
37348
37430
  /**
@@ -37394,6 +37476,9 @@ function _is(ast) {
37394
37476
  * The assertion returns normally when validation succeeds. When the input does
37395
37477
  * not satisfy the schema with a schema-only failure, it throws an `Error` with
37396
37478
  * the `SchemaIssue.Issue` in its `cause`.
37479
+ * Schema validation failures use the generic message `"Schema validation failed"`.
37480
+ * Format the `cause` explicitly with `SchemaIssue.makeFormatterDefault()` when
37481
+ * human-readable details are needed.
37397
37482
  *
37398
37483
  * **Gotchas**
37399
37484
  *
@@ -37408,7 +37493,7 @@ function asserts$1(schema, input) {
37408
37493
  const exit = asExit(run$3(toType(schema.ast)))(input, defaultParseOptions);
37409
37494
  if (isFailure$1(exit)) {
37410
37495
  const issue = getSchemaIssueOrThrow(exit.cause, "Assertion adapter can only throw schema issues");
37411
- throw new Error(issue.toString(), { cause: issue });
37496
+ throw new Error("Schema validation failed", { cause: issue });
37412
37497
  }
37413
37498
  }
37414
37499
  /**
@@ -37549,13 +37634,13 @@ function makeParser$1(ast, compile, compileConstructorDefault, constructorDefaul
37549
37634
  const output = result === sameExit ? input : result[args];
37550
37635
  if (input !== missing && output !== missing) {
37551
37636
  const issues = collectIssues(encodingChecks, input, void 0, ast, options);
37552
- if (issues) result = fail$1(new Composite(ast, issues));
37637
+ if (issues) result = fail$1(new Composite(ast, issues, input, options));
37553
37638
  }
37554
37639
  }
37555
37640
  } else result = flatMap$1(result, (value) => {
37556
37641
  if (input !== missing && value !== missing) {
37557
37642
  const issues = collectIssues(encodingChecks, input, void 0, ast, options);
37558
- if (issues) return fail$1(new Composite(ast, issues));
37643
+ if (issues) return fail$1(new Composite(ast, issues, input, options));
37559
37644
  }
37560
37645
  return succeed$2(value);
37561
37646
  });
@@ -37564,12 +37649,12 @@ function makeParser$1(ast, compile, compileConstructorDefault, constructorDefaul
37564
37649
  const value = result === sameExit ? input : result[args];
37565
37650
  if (value === missing) return result;
37566
37651
  const issues = collectIssues(checks, value, void 0, ast, options);
37567
- if (issues) result = fail$1(new Composite(ast, issues));
37652
+ if (issues) result = fail$1(new Composite(ast, issues, value, options));
37568
37653
  }
37569
37654
  } else result = flatMap$1(result, (value) => {
37570
37655
  if (value !== missing) {
37571
37656
  const issues = collectIssues(checks, value, void 0, ast, options);
37572
- if (issues) return fail$1(new Composite(ast, issues));
37657
+ if (issues) return fail$1(new Composite(ast, issues, value, options));
37573
37658
  }
37574
37659
  return succeed$2(value);
37575
37660
  });
@@ -37599,7 +37684,7 @@ function makeParser$1(ast, compile, compileConstructorDefault, constructorDefaul
37599
37684
  const local = parseLocal(value, options);
37600
37685
  return local === sameExit ? result : local;
37601
37686
  }
37602
- result = catchCause(result, (cause) => failCauseSync(() => map$7(cause, (issue) => new Encoding(ast, issue))));
37687
+ result = catchCause(result, (cause) => failCauseSync(() => map$7(cause, (issue) => new Encoding(ast, issue, input, options))));
37603
37688
  return flatMapEager(result, (value) => {
37604
37689
  const local = parseLocal(value, options);
37605
37690
  return local === sameExit ? succeed$1(value) : local;
@@ -37608,11 +37693,11 @@ function makeParser$1(ast, compile, compileConstructorDefault, constructorDefaul
37608
37693
  }
37609
37694
 
37610
37695
  //#endregion
37611
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/schema/schema.js
37696
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/schema/schema.js
37612
37697
  /** @internal */
37613
- const TypeId$8 = "~effect/Schema/Schema";
37698
+ const TypeId$9 = "~effect/Schema/Schema";
37614
37699
  const SchemaProto = {
37615
- [TypeId$8]: TypeId$8,
37700
+ [TypeId$9]: TypeId$9,
37616
37701
  pipe() {
37617
37702
  return pipeArguments(this, arguments);
37618
37703
  },
@@ -37632,19 +37717,14 @@ function make$7(ast, options) {
37632
37717
  const self = Object.defineProperties(Object.setPrototypeOf(Schema, SchemaProto), Object.getOwnPropertyDescriptors({ ...options }));
37633
37718
  self.ast = ast;
37634
37719
  self.rebuild = (ast) => make$7(ast, options);
37635
- const makeEffect$1 = makeEffect(self);
37636
- self.makeEffect = (input, options) => fromIssueEffect(makeEffect$1(input, options));
37720
+ self.makeEffect = makeEffect(self);
37637
37721
  self.make = make$8(self);
37638
37722
  self.makeOption = makeOption(self);
37639
37723
  return self;
37640
37724
  }
37641
- /** @internal */
37642
- function fromIssueEffect(self) {
37643
- return catchCause(self, (cause) => failCauseSync(() => map$7(cause, (issue) => new SchemaError(issue))));
37644
- }
37645
37725
 
37646
37726
  //#endregion
37647
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Struct.js
37727
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Struct.js
37648
37728
  /**
37649
37729
  * Creates an `Equivalence` for a struct by providing an `Equivalence` for each
37650
37730
  * property. Two structs are equivalent when all their corresponding properties
@@ -37752,7 +37832,7 @@ const makeOrder = Struct$1;
37752
37832
  const lambda = (f) => f;
37753
37833
 
37754
37834
  //#endregion
37755
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/internal/redacted.js
37835
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/internal/redacted.js
37756
37836
  /** @internal */
37757
37837
  const redactedRegistry = /* @__PURE__ */ new WeakMap();
37758
37838
  /** @internal */
@@ -37762,7 +37842,7 @@ const value$1 = (self) => {
37762
37842
  };
37763
37843
 
37764
37844
  //#endregion
37765
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Redacted.js
37845
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Redacted.js
37766
37846
  /**
37767
37847
  * Wraps sensitive values so normal output does not reveal them.
37768
37848
  *
@@ -37775,7 +37855,7 @@ const value$1 = (self) => {
37775
37855
  *
37776
37856
  * @since 3.3.0
37777
37857
  */
37778
- const TypeId$7 = "~effect/data/Redacted";
37858
+ const TypeId$8 = "~effect/data/Redacted";
37779
37859
  /**
37780
37860
  * Returns `true` if a value is a `Redacted` wrapper.
37781
37861
  *
@@ -37803,7 +37883,7 @@ const TypeId$7 = "~effect/data/Redacted";
37803
37883
  * @category guards
37804
37884
  * @since 3.3.0
37805
37885
  */
37806
- const isRedacted = (u) => hasProperty(u, TypeId$7);
37886
+ const isRedacted = (u) => hasProperty(u, TypeId$8);
37807
37887
  /**
37808
37888
  * Creates a `Redacted` wrapper for a sensitive value.
37809
37889
  *
@@ -37837,7 +37917,7 @@ const make$6 = (value, options) => {
37837
37917
  return self;
37838
37918
  };
37839
37919
  const Proto$5 = {
37840
- [TypeId$7]: { _A: (_) => _ },
37920
+ [TypeId$8]: { _A: (_) => _ },
37841
37921
  label: void 0,
37842
37922
  ...PipeInspectableProto,
37843
37923
  toJSON() {
@@ -37877,8 +37957,59 @@ const Proto$5 = {
37877
37957
  const value = value$1;
37878
37958
 
37879
37959
  //#endregion
37880
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Schema.js
37881
- const TypeId$6 = TypeId$8;
37960
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/SchemaError.js
37961
+ /**
37962
+ * @since 4.0.0
37963
+ */
37964
+ const TypeId$7 = "~effect/SchemaError/SchemaError";
37965
+ /**
37966
+ * Error thrown (or returned as the error channel value) when schema decoding
37967
+ * or encoding fails.
37968
+ *
37969
+ * **Details**
37970
+ *
37971
+ * The `issue` field contains a structured {@link SchemaIssue.Issue} tree describing
37972
+ * every validation failure, including the path to the problematic value and
37973
+ * the expected type or constraint. The `message` field renders the issue tree
37974
+ * with the default formatter. When input reporting is enabled, the message may
37975
+ * include reported input. Other Issue fields and custom annotations or messages
37976
+ * are not sanitized.
37977
+ *
37978
+ * Use {@link isSchemaError} to narrow an unknown value to `SchemaError`.
37979
+ *
37980
+ * **Example** (Catching a SchemaError)
37981
+ *
37982
+ * ```ts import.meta.vitest
37983
+ * import { Schema } from "effect"
37984
+ *
37985
+ * try {
37986
+ * Schema.decodeUnknownSync(Schema.Number)("not a number")
37987
+ * } catch (err) {
37988
+ * if (Schema.isSchemaError(err)) {
37989
+ * err.message // => "Expected number"
37990
+ * }
37991
+ * }
37992
+ * ```
37993
+ *
37994
+ * @category errors
37995
+ * @since 4.0.0
37996
+ */
37997
+ var SchemaError = class extends TaggedError$1("SchemaError") {
37998
+ [TypeId$7] = TypeId$7;
37999
+ constructor(issue) {
38000
+ super({ issue });
38001
+ }
38002
+ get message() {
38003
+ return defaultFormatter$1(this.issue);
38004
+ }
38005
+ toString() {
38006
+ return `SchemaError(${this.message})`;
38007
+ }
38008
+ };
38009
+
38010
+ //#endregion
38011
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Schema.js
38012
+ const TypeId$6 = TypeId$9;
37882
38013
  /**
37883
38014
  * Creates a schema for a **parametric** type (a generic container such as
37884
38015
  * `Array<A>`, `Option<A>`, etc.) by accepting a list of type-parameter schemas
@@ -37903,7 +38034,7 @@ const TypeId$6 = TypeId$8;
37903
38034
  * **Example** (Schema for a parametric `Box<A>` type)
37904
38035
  *
37905
38036
  * ```ts import.meta.vitest
37906
- * import { Effect, Schema, SchemaIssue as Issue, SchemaParser } from "effect"
38037
+ * import { Effect, Schema, SchemaIssue, SchemaParser } from "effect"
37907
38038
  *
37908
38039
  * interface Box<A> {
37909
38040
  * readonly value: A
@@ -37918,7 +38049,7 @@ const TypeId$6 = TypeId$8;
37918
38049
  * ([itemCodec]) =>
37919
38050
  * (u, ast, options) => {
37920
38051
  * if (!isBox(u)) {
37921
- * return Effect.fail(new SchemaIssue.InvalidType(ast))
38052
+ * return Effect.fail(new SchemaIssue.InvalidType(ast, u, options))
37922
38053
  * }
37923
38054
  * return Effect.map(
37924
38055
  * SchemaParser.decodeUnknownEffect(itemCodec)(u.value, options),
@@ -37972,7 +38103,7 @@ function declareConstructor() {
37972
38103
  * @since 3.10.0
37973
38104
  */
37974
38105
  function declare(is, annotations) {
37975
- return declareConstructor()([], () => (input, ast) => is(input) ? succeed$2(input) : fail$1(new InvalidType(ast)), annotations);
38106
+ return declareConstructor()([], () => (input, ast, options) => is(input) ? succeed$2(input) : fail$1(new InvalidType(ast, input, options)), annotations);
37976
38107
  }
37977
38108
  /**
37978
38109
  * Creates a type guard function that checks if a value conforms to a given
@@ -38025,6 +38156,9 @@ const is = is$1;
38025
38156
  *
38026
38157
  * The input is narrowed if the assertion succeeds. If schema validation fails,
38027
38158
  * the assertion throws an `Error` whose cause is `SchemaIssue.Issue`.
38159
+ * Schema validation failures use the generic message `"Schema validation failed"`.
38160
+ * Format the `cause` explicitly with `SchemaIssue.makeFormatterDefault()` when
38161
+ * human-readable details are needed.
38028
38162
  *
38029
38163
  * **Gotchas**
38030
38164
  *
@@ -38085,6 +38219,9 @@ function decodeUnknownEffect(schema, options) {
38085
38219
  return fromIssueEffect(parser(input, options));
38086
38220
  };
38087
38221
  }
38222
+ function fromIssueEffect(self) {
38223
+ return catchCause(self, (cause) => failCauseSync(() => map$7(cause, (issue) => new SchemaError(issue))));
38224
+ }
38088
38225
  /**
38089
38226
  * Decodes an `unknown` input against a schema, returning an `Option` that is
38090
38227
  * `Some` with the decoded value on success or `None` for schema mismatches.
@@ -38270,7 +38407,10 @@ const optionalKey = /* @__PURE__ */ lambda((schema) => make$5(optionalKey$1(sche
38270
38407
  * @category combinators
38271
38408
  * @since 3.10.0
38272
38409
  */
38273
- const optional$2 = /* @__PURE__ */ lambda((self) => optionalKey(UndefinedOr(self)));
38410
+ const optional$2 = /* @__PURE__ */ lambda((self) => {
38411
+ const schema = UndefinedOr(self);
38412
+ return make$5(optional$3(self.ast), { schema });
38413
+ });
38274
38414
  /**
38275
38415
  * Creates a schema for a single literal value (string, number, bigint, boolean, or null).
38276
38416
  *
@@ -38596,7 +38736,7 @@ function decodeTo(to, transformation) {
38596
38736
  * **Details**
38597
38737
  *
38598
38738
  * Constructor defaults are applied only during `make*`, not during decoding or
38599
- * encoding.
38739
+ * encoding. Failures are represented directly as `SchemaIssue.Issue` values.
38600
38740
  *
38601
38741
  * **Example** (Defining an optional field with a static default)
38602
38742
  *
@@ -38617,10 +38757,7 @@ function decodeTo(to, transformation) {
38617
38757
  * @since 3.10.0
38618
38758
  */
38619
38759
  function withConstructorDefault(defaultValue) {
38620
- return (schema) => make$5(withConstructorDefault$1(schema.ast, toIssueEffect(defaultValue)), { schema });
38621
- }
38622
- function toIssueEffect(self) {
38623
- return catchCause(self, (cause) => failCauseSync(() => map$7(cause, (error) => error.issue)));
38760
+ return (schema) => make$5(withConstructorDefault$1(schema.ast, defaultValue), { schema });
38624
38761
  }
38625
38762
  /**
38626
38763
  * Combines a {@link Literal} schema with {@link withConstructorDefault}, making it ideal
@@ -39652,9 +39789,9 @@ const RegExp$1 = /* @__PURE__ */ instanceOf(globalThis.RegExp, {
39652
39789
  source: String$1,
39653
39790
  flags: String$1
39654
39791
  }), transformOrFail({
39655
- decode: (e) => try_({
39792
+ decode: (e, options) => try_({
39656
39793
  try: () => new globalThis.RegExp(e.source, e.flags),
39657
- catch: () => new InvalidValue$1({ message: "Expected valid RegExp source and flags" })
39794
+ catch: () => new InvalidValue$1({ expected: "valid RegExp source and flags" }, e, options)
39658
39795
  }),
39659
39796
  encode: (regExp) => succeed$2({
39660
39797
  source: regExp.source,
@@ -40083,8 +40220,8 @@ const File = /* @__PURE__ */ instanceOf(globalThis.File, {
40083
40220
  name: String$1,
40084
40221
  lastModified: Int
40085
40222
  }), transformOrFail({
40086
- decode: (e) => match$7(decodeBase64$1(e.data), {
40087
- onFailure: () => fail$1(new InvalidValue$1({ message: "Expected a valid Base64 string" })),
40223
+ decode: (e, options) => match$7(decodeBase64$1(e.data), {
40224
+ onFailure: () => fail$1(new InvalidValue$1({ expected: "a valid Base64 string" }, e.data, options)),
40088
40225
  onSuccess: (bytes) => {
40089
40226
  const buffer = new globalThis.Uint8Array(bytes);
40090
40227
  return succeed$2(new globalThis.File([buffer], e.name, {
@@ -40093,7 +40230,7 @@ const File = /* @__PURE__ */ instanceOf(globalThis.File, {
40093
40230
  }));
40094
40231
  }
40095
40232
  }),
40096
- encode: (file) => tryPromise({
40233
+ encode: (file, options) => tryPromise({
40097
40234
  try: async () => {
40098
40235
  const bytes = new globalThis.Uint8Array(await file.arrayBuffer());
40099
40236
  return {
@@ -40103,7 +40240,7 @@ const File = /* @__PURE__ */ instanceOf(globalThis.File, {
40103
40240
  lastModified: file.lastModified
40104
40241
  };
40105
40242
  },
40106
- catch: () => new InvalidValue$1({ message: "Expected File to be readable" })
40243
+ catch: () => new InvalidValue$1({ expected: "a readable File" }, file, options)
40107
40244
  })
40108
40245
  }))
40109
40246
  });
@@ -40747,8 +40884,8 @@ function getClassSchemaFactory(from, identifier, annotations) {
40747
40884
  const ClassTypeId = getClassTypeId(identifier);
40748
40885
  const isClassValue = (input) => input instanceof self || hasProperty(input, ClassTypeId);
40749
40886
  const transformation = getClassTransformation(self);
40750
- return memo = decodeTo(make$5(new Declaration([from.ast], () => (input, ast) => {
40751
- return isClassValue(input) ? succeed$2(input) : fail$1(new InvalidType(ast));
40887
+ return memo = decodeTo(make$5(new Declaration([from.ast], () => (input, ast, options) => {
40888
+ return isClassValue(input) ? succeed$2(input) : fail$1(new InvalidType(ast, input, options));
40752
40889
  }, {
40753
40890
  identifier,
40754
40891
  [CONSTRUCTOR_ANNOTATION_KEY]: ([from]) => ({
@@ -40872,7 +41009,7 @@ function makeReorder(getPriority) {
40872
41009
  * @since 4.0.0
40873
41010
  */
40874
41011
  function toCodecStringTree(schema) {
40875
- return make$5(serializerStringTree(schema.ast), { schema });
41012
+ return make$5(toCodecStringTreeAST(schema.ast), { schema });
40876
41013
  }
40877
41014
  const toStringTreeReorder = /* @__PURE__ */ makeReorder((ast) => {
40878
41015
  switch (ast._tag) {
@@ -40885,7 +41022,7 @@ const toStringTreeReorder = /* @__PURE__ */ makeReorder((ast) => {
40885
41022
  default: return 1;
40886
41023
  }
40887
41024
  });
40888
- function serializerTree(ast, recur, onMissingAnnotation) {
41025
+ function toCodecStringTreeASTStep(ast, recur, onMissingAnnotation) {
40889
41026
  switch (ast._tag) {
40890
41027
  case "Declaration": {
40891
41028
  const typeParameters = ast.typeParameters.map((tp) => make$5(recur(toEncoded(tp))));
@@ -40926,16 +41063,15 @@ function serializerTree(ast, recur, onMissingAnnotation) {
40926
41063
  }
40927
41064
  const nullToString = /* @__PURE__ */ new Link(/* @__PURE__ */ new Literal$1("null"), /* @__PURE__ */ new Transformation(/* @__PURE__ */ transform$2(() => null), /* @__PURE__ */ transform$2(() => "null")));
40928
41065
  const booleanToString = /* @__PURE__ */ new Link(/* @__PURE__ */ new Union$1([/* @__PURE__ */ new Literal$1("true"), /* @__PURE__ */ new Literal$1("false")], "anyOf"), /* @__PURE__ */ new Transformation(/* @__PURE__ */ transform$2((s) => s === "true"), /* @__PURE__ */ String$3()));
40929
- const SERIALIZER_ENSURE_ARRAY = "~effect/Schema/SERIALIZER_ENSURE_ARRAY";
40930
- const isSerializerArrayFromSingle = (ast) => isUnion(ast) && ast.annotations?.[SERIALIZER_ENSURE_ARRAY] === true;
40931
- const serializerStringTree = /* @__PURE__ */ applyToSelfOrLastLinkEncoding((ast) => {
40932
- if (isSerializerArrayFromSingle(ast)) return ast;
40933
- const out = serializerTree(ast, serializerStringTree, (ast) => {
41066
+ const arrayFromSingleTransformation = /* @__PURE__ */ new Transformation(/* @__PURE__ */ transform$2((input) => typeof input === "string" ? [input] : input), /* @__PURE__ */ passthrough$1());
41067
+ const isCodecArrayFromSingleLink = (link) => link.transformation === arrayFromSingleTransformation;
41068
+ const toCodecStringTreeAST = /* @__PURE__ */ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
41069
+ const out = toCodecStringTreeASTStep(ast, toCodecStringTreeAST, (ast) => {
40934
41070
  throw new globalThis.Error("Missing structural codec for StringTree", { cause: ast });
40935
41071
  });
40936
41072
  if (out !== ast && ast.context !== void 0) return replaceContextLastLink(out, withoutConstructorDefault(ast.context));
40937
41073
  return out;
40938
- });
41074
+ }, { stopAt: isCodecArrayFromSingleLink });
40939
41075
  /**
40940
41076
  * Schema that accepts and validates any immutable JSON-compatible value.
40941
41077
  *
@@ -40967,7 +41103,7 @@ const MutableJson = /* @__PURE__ */ make$5(/* @__PURE__ */ annotate$1(MutableJso
40967
41103
  }) }));
40968
41104
 
40969
41105
  //#endregion
40970
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Terminal.js
41106
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Terminal.js
40971
41107
  const TypeId$5 = "~effect/platform/Terminal";
40972
41108
  const QuitErrorTypeId = "effect/platform/Terminal/QuitError";
40973
41109
  /**
@@ -41047,7 +41183,7 @@ const make$4 = (impl) => Terminal.of({
41047
41183
  });
41048
41184
 
41049
41185
  //#endregion
41050
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.104_effect@4.0.0-beta.104/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
41186
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.107_effect@4.0.0-beta.107/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
41051
41187
  /**
41052
41188
  * Creates a scoped process-backed `Terminal` using Node `readline`, enabling
41053
41189
  * TTY raw mode while in scope and using the supplied predicate to decide when
@@ -41068,34 +41204,37 @@ const make$3 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQ
41068
41204
  };
41069
41205
  stdin.once("end", onStdinEnd);
41070
41206
  yield* addFinalizer(() => sync(() => stdin.off("end", onStdinEnd)));
41071
- const rlRef = yield* make$19({ acquire: acquireRelease(sync(() => {
41072
- const rl = node_readline.createInterface({
41073
- input: stdin,
41074
- escapeCodeTimeout: 50
41075
- });
41076
- const onLine = (line) => offerUnsafe(lines, line);
41077
- const onClose = () => {
41207
+ const rlRef = yield* make$19({
41208
+ acquire: acquireRelease(sync(() => {
41209
+ const rl = node_readline.createInterface({
41210
+ input: stdin,
41211
+ escapeCodeTimeout: 50
41212
+ });
41213
+ const onLine = (line) => offerUnsafe(lines, line);
41214
+ const onClose = () => {
41215
+ readlineActive = false;
41216
+ endUnsafe(lines);
41217
+ };
41218
+ readlineActive = true;
41219
+ node_readline.emitKeypressEvents(stdin, rl);
41220
+ rl.on("line", onLine);
41221
+ rl.once("close", onClose);
41222
+ if (stdin.isTTY) stdin.setRawMode(true);
41223
+ return {
41224
+ rl,
41225
+ onClose,
41226
+ onLine
41227
+ };
41228
+ }), ({ rl, onClose, onLine }) => sync(() => {
41078
41229
  readlineActive = false;
41079
- endUnsafe(lines);
41080
- };
41081
- readlineActive = true;
41082
- node_readline.emitKeypressEvents(stdin, rl);
41083
- rl.on("line", onLine);
41084
- rl.once("close", onClose);
41085
- if (stdin.isTTY) stdin.setRawMode(true);
41086
- return {
41087
- rl,
41088
- onClose,
41089
- onLine
41090
- };
41091
- }), ({ rl, onClose, onLine }) => sync(() => {
41092
- readlineActive = false;
41093
- rl.off("line", onLine);
41094
- rl.off("close", onClose);
41095
- if (stdin.isTTY) stdin.setRawMode(false);
41096
- rl.close();
41097
- if (inputEnded) endUnsafe(lines);
41098
- })) });
41230
+ rl.off("line", onLine);
41231
+ rl.off("close", onClose);
41232
+ if (stdin.isTTY) stdin.setRawMode(false);
41233
+ rl.close();
41234
+ if (inputEnded) endUnsafe(lines);
41235
+ })),
41236
+ idleTimeToLive: "10 millis"
41237
+ });
41099
41238
  const columns = sync(() => stdout.columns ?? 0);
41100
41239
  const rows = sync(() => stdout.rows ?? 0);
41101
41240
  const readInput = gen(function* () {
@@ -41164,7 +41303,7 @@ function defaultShouldQuit(input) {
41164
41303
  }
41165
41304
 
41166
41305
  //#endregion
41167
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.104_effect@4.0.0-beta.104_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeTerminal.js
41306
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.107_effect@4.0.0-beta.107_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeTerminal.js
41168
41307
  /**
41169
41308
  * Node.js implementation of the Effect `Terminal` service.
41170
41309
  *
@@ -41192,7 +41331,7 @@ const make$2 = make$3;
41192
41331
  const layer$1 = layer$2;
41193
41332
 
41194
41333
  //#endregion
41195
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.104_effect@4.0.0-beta.104_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeServices.js
41334
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.107_effect@4.0.0-beta.107_ioredis@5.9.2/node_modules/@effect/platform-node/dist/NodeServices.js
41196
41335
  /**
41197
41336
  * Provides the default Node implementations for child process spawning,
41198
41337
  * filesystem, path, stdio, and terminal services.
@@ -41203,7 +41342,7 @@ const layer$1 = layer$2;
41203
41342
  const layer = /* @__PURE__ */ provideMerge(layer$11, /* @__PURE__ */ mergeAll(layer$7, layer$9, layer$5, layer$3, layer$1));
41204
41343
 
41205
41344
  //#endregion
41206
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Console.js
41345
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Console.js
41207
41346
  /**
41208
41347
  * Context reference for the current console service in the Effect system, allowing access to the active console implementation from within the Effect context.
41209
41348
  *
@@ -41339,7 +41478,7 @@ const log = (...args) => consoleWith((console) => sync$1(() => {
41339
41478
  }));
41340
41479
 
41341
41480
  //#endregion
41342
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/CliOutput.js
41481
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/CliOutput.js
41343
41482
  /**
41344
41483
  * Formats CLI help and errors as text.
41345
41484
  *
@@ -41588,7 +41727,7 @@ const formatHelpDocImpl = (doc, colors) => {
41588
41727
  };
41589
41728
 
41590
41729
  //#endregion
41591
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/completions/bash.js
41730
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/completions/bash.js
41592
41731
  const escapeForBash = (s) => s.replace(/'/g, "'\\''");
41593
41732
  const sanitizeFunctionName = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
41594
41733
  const flagNamesForWordlist = (flag) => {
@@ -41793,7 +41932,7 @@ const generate$3 = (executableName, descriptor) => {
41793
41932
  };
41794
41933
 
41795
41934
  //#endregion
41796
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/completions/fish.js
41935
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/completions/fish.js
41797
41936
  const escapeFishString = (s) => s.replace(/'/g, "\\'");
41798
41937
  /**
41799
41938
  * Build a Fish condition that checks the current subcommand context.
@@ -41932,7 +42071,7 @@ const generate$2 = (executableName, descriptor) => {
41932
42071
  };
41933
42072
 
41934
42073
  //#endregion
41935
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/completions/zsh.js
42074
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/completions/zsh.js
41936
42075
  const escapeZsh = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:");
41937
42076
  const sanitize = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
41938
42077
  /**
@@ -42070,7 +42209,7 @@ const generate$1 = (executableName, descriptor) => {
42070
42209
  };
42071
42210
 
42072
42211
  //#endregion
42073
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/Completions.js
42212
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/Completions.js
42074
42213
  /**
42075
42214
  * The `Completions` module turns a plain description of an Effect CLI command
42076
42215
  * tree into shell completion scripts for Bash, Zsh, and Fish. It is the
@@ -42107,7 +42246,7 @@ const generate = (executableName, shell, descriptor) => {
42107
42246
  };
42108
42247
 
42109
42248
  //#endregion
42110
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/ConfigProvider.js
42249
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/ConfigProvider.js
42111
42250
  /**
42112
42251
  * Data sources used by `Config` to load raw configuration values. A
42113
42252
  * `ConfigProvider` reads paths from places such as environment variables,
@@ -42330,13 +42469,45 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
42330
42469
  return value === "" && !preserveEmptyStrings ? void 0 : value;
42331
42470
  }
42332
42471
  /**
42472
+ * Creates a `ConfigProvider` backed by an explicit environment record.
42473
+ *
42474
+ * **When to use**
42475
+ *
42476
+ * Use when a restricted runtime cannot evaluate the automatic environment
42477
+ * detection performed by {@link fromEnv}, or whenever the environment record
42478
+ * must be supplied explicitly.
42479
+ *
42480
+ * **Details**
42481
+ *
42482
+ * `undefined` values are ignored. Path lookup and child discovery otherwise
42483
+ * use the same environment-variable semantics as {@link fromEnv}.
42484
+ *
42485
+ * Environment variable names are captured at construction time to establish
42486
+ * record keys and array lengths. The supplied record remains live for value
42487
+ * lookups, so updates to known paths are observed by later loads. Keys added
42488
+ * after construction can be loaded directly, but do not appear in captured
42489
+ * parent record keys or array lengths.
42490
+ *
42491
+ * Literal empty strings are treated as missing values by default. Pass
42492
+ * `{ preserveEmptyStrings: true }` to keep empty strings as explicit values.
42493
+ *
42494
+ * @see {@link fromEnv} – automatically reads the runtime environment
42495
+ *
42496
+ * @category constructors
42497
+ * @since 4.0.0
42498
+ */
42499
+ function fromEnvRecord(env, options) {
42500
+ const preserveEmptyStrings = options?.preserveEmptyStrings === true;
42501
+ const trie = buildEnvTrie(env);
42502
+ return make$1((path) => succeed$2(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
42503
+ }
42504
+ /**
42333
42505
  * Creates a `ConfigProvider` backed by environment variables.
42334
42506
  *
42335
42507
  * **When to use**
42336
42508
  *
42337
42509
  * Use to read configuration from `process.env`, which is the default when no
42338
- * provider is explicitly set, or pass a custom env record for testing or
42339
- * non-Node runtimes.
42510
+ * provider is explicitly set, or pass a custom env record for testing.
42340
42511
  *
42341
42512
  * **Details**
42342
42513
  *
@@ -42377,19 +42548,17 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
42377
42548
  * ```
42378
42549
  *
42379
42550
  * @see {@link fromUnknown} – for JSON objects
42551
+ * @see {@link fromEnvRecord} – for explicit records in restricted runtimes
42380
42552
  * @see {@link constantCase} – bridge camelCase keys to SCREAMING_SNAKE_CASE
42381
42553
  *
42382
42554
  * @category constructors
42383
42555
  * @since 2.0.0
42384
42556
  */
42385
42557
  function fromEnv(options) {
42386
- const env = options?.env ?? {
42558
+ return fromEnvRecord(options?.env ?? {
42387
42559
  ...globalThis.process?.env,
42388
42560
  ...{}?.env
42389
- };
42390
- const preserveEmptyStrings = options?.preserveEmptyStrings === true;
42391
- const trie = buildEnvTrie(env);
42392
- return make$1((path) => succeed$2(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
42561
+ }, { preserveEmptyStrings: options?.preserveEmptyStrings });
42393
42562
  }
42394
42563
  function buildEnvTrie(env) {
42395
42564
  const trie = {};
@@ -42425,7 +42594,7 @@ function trieNodeAt(root, path) {
42425
42594
  }
42426
42595
 
42427
42596
  //#endregion
42428
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/LogLevel.js
42597
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/LogLevel.js
42429
42598
  /**
42430
42599
  * Returns all `LogLevel` values in order from `All` through the concrete severities to
42431
42600
  * `None`.
@@ -42526,7 +42695,7 @@ const Order = LogLevelOrder;
42526
42695
  const isGreaterThan = isLogLevelGreaterThan;
42527
42696
 
42528
42697
  //#endregion
42529
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/Config.js
42698
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/Config.js
42530
42699
  const TypeId$4 = "~effect/Config";
42531
42700
  const Proto$3 = {
42532
42701
  .../* @__PURE__ */ Prototype({
@@ -42599,7 +42768,7 @@ const Boolean = /* @__PURE__ */ Literals([...TrueValues.literals, ...FalseValues
42599
42768
  const LogLevel$1 = /* @__PURE__ */ Literals(values);
42600
42769
 
42601
42770
  //#endregion
42602
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/CliError.js
42771
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/CliError.js
42603
42772
  /**
42604
42773
  * Defines structured errors for the unstable CLI parser and runner.
42605
42774
  *
@@ -42983,6 +43152,10 @@ var UnknownSubcommand = class extends TaggedError(`${TypeId$3}/UnknownSubcommand
42983
43152
  /**
42984
43153
  * Error wrapper for user handler failures in the CLI error channel.
42985
43154
  *
43155
+ * `userMessage` can provide safe, user-facing text independently of the
43156
+ * underlying cause. When omitted or empty, `message` uses a non-empty string
43157
+ * cause or `Error.message`, then falls back to `"An error occurred"`.
43158
+ *
42986
43159
  * **Example** (Wrapping user errors)
42987
43160
  *
42988
43161
  * ```ts import.meta.vitest
@@ -42991,7 +43164,8 @@ var UnknownSubcommand = class extends TaggedError(`${TypeId$3}/UnknownSubcommand
42991
43164
  *
42992
43165
  * // Wrapping user errors
42993
43166
  * const userError = new CliError.UserError({
42994
- * cause: new Error("Database connection failed")
43167
+ * cause: new Error("Database connection failed for postgres://localhost"),
43168
+ * userMessage: "Could not connect to the database"
42995
43169
  * })
42996
43170
  *
42997
43171
  * // In command handler
@@ -43018,13 +43192,34 @@ var UnknownSubcommand = class extends TaggedError(`${TypeId$3}/UnknownSubcommand
43018
43192
  * @category errors
43019
43193
  * @since 4.0.0
43020
43194
  */
43021
- var UserError = class extends TaggedError(`${TypeId$3}/UserError`)("UserError", { cause: /* @__PURE__ */ Defect() }) {
43195
+ var UserError = class extends TaggedError(`${TypeId$3}/UserError`)("UserError", {
43196
+ cause: /* @__PURE__ */ Defect(),
43197
+ userMessage: /* @__PURE__ */ optionalKey(String$1)
43198
+ }) {
43022
43199
  /**
43023
43200
  * Marks this value as a user handler error for runtime guards.
43024
43201
  *
43025
43202
  * @since 4.0.0
43026
43203
  */
43027
43204
  [TypeId$3] = TypeId$3;
43205
+ /**
43206
+ * Controls whether the runtime logger should report this error. The CLI
43207
+ * runner sets this to `false` after rendering the error itself.
43208
+ *
43209
+ * @since 4.0.0
43210
+ */
43211
+ [errorReported] = true;
43212
+ /**
43213
+ * Returns the explicit user-facing message or a safe fallback from `cause`.
43214
+ *
43215
+ * @since 4.0.0
43216
+ */
43217
+ get message() {
43218
+ if (this.userMessage) return this.userMessage;
43219
+ if (typeof this.cause === "string" && this.cause) return this.cause;
43220
+ if (this.cause instanceof Error && this.cause.message) return this.cause.message;
43221
+ return "An error occurred";
43222
+ }
43028
43223
  };
43029
43224
  /**
43030
43225
  * Schema for concrete CLI errors that can be reported together with help output.
@@ -43072,7 +43267,7 @@ var ShowHelp = class extends TaggedError(`${TypeId$3}/ShowHelp`)("ShowHelp", {
43072
43267
  };
43073
43268
 
43074
43269
  //#endregion
43075
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/Primitive.js
43270
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/Primitive.js
43076
43271
  /**
43077
43272
  * Parses raw command-line strings into typed values.
43078
43273
  *
@@ -43517,7 +43712,7 @@ const getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.cho
43517
43712
  const getPathType = (primitive) => primitive._tag === "Path" ? primitive.pathType : void 0;
43518
43713
 
43519
43714
  //#endregion
43520
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/ansi.js
43715
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/ansi.js
43521
43716
  /**
43522
43717
  * Internal ANSI escape sequence helpers used by the unstable CLI rendering
43523
43718
  * implementation. This module centralizes the control codes for text styling,
@@ -43601,7 +43796,7 @@ const eraseLines = (rows) => {
43601
43796
  };
43602
43797
 
43603
43798
  //#endregion
43604
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/Prompt.js
43799
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/Prompt.js
43605
43800
  /**
43606
43801
  * Builds interactive terminal prompts for CLI applications.
43607
43802
  *
@@ -45469,7 +45664,7 @@ const entriesToDisplay = (cursor, total, maxVisible) => {
45469
45664
  };
45470
45665
 
45471
45666
  //#endregion
45472
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/Param.js
45667
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/Param.js
45473
45668
  const TypeId$1 = "~effect/cli/Param";
45474
45669
  /**
45475
45670
  * Defines the kind discriminator for positional argument parameters.
@@ -46265,7 +46460,7 @@ const getParamMetadata = (param) => {
46265
46460
  };
46266
46461
 
46267
46462
  //#endregion
46268
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/Flag.js
46463
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/Flag.js
46269
46464
  /**
46270
46465
  * Creates a string flag that accepts text input.
46271
46466
  *
@@ -46580,7 +46775,7 @@ const map = /* @__PURE__ */ dual(2, (self, f) => map$1(self, f));
46580
46775
  const atLeast = /* @__PURE__ */ dual(2, (self, min) => atLeast$1(self, min));
46581
46776
 
46582
46777
  //#endregion
46583
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/config.js
46778
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/config.js
46584
46779
  /**
46585
46780
  * Config Internal
46586
46781
  * ================
@@ -46700,7 +46895,7 @@ const reconstructTree = (tree, results) => {
46700
46895
  };
46701
46896
 
46702
46897
  //#endregion
46703
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/command.js
46898
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/command.js
46704
46899
  /**
46705
46900
  * Command Implementation
46706
46901
  * ======================
@@ -46892,7 +47087,7 @@ const checkForDuplicateFlags = (parent, subcommands, options) => {
46892
47087
  };
46893
47088
 
46894
47089
  //#endregion
46895
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/completions/descriptor.js
47090
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/completions/descriptor.js
46896
47091
  /**
46897
47092
  * CommandDescriptor — pure-data representation of a command tree for
46898
47093
  * shell completion generation.
@@ -46991,7 +47186,7 @@ const fromCommand = (cmd) => {
46991
47186
  };
46992
47187
 
46993
47188
  //#endregion
46994
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/help.js
47189
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/help.js
46995
47190
  /**
46996
47191
  * Help Documentation
46997
47192
  * ================
@@ -47101,7 +47296,7 @@ const getHelpForCommandPath = (command, commandPath, builtIns) => gen(function*
47101
47296
  });
47102
47297
 
47103
47298
  //#endregion
47104
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/GlobalFlag.js
47299
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/GlobalFlag.js
47105
47300
  /**
47106
47301
  * Global flags for Effect CLI command trees. Global flags are parsed outside a
47107
47302
  * single command's local flags and can apply to a command and its descendants.
@@ -47274,7 +47469,7 @@ const BuiltIns = [
47274
47469
  ];
47275
47470
 
47276
47471
  //#endregion
47277
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/CliConfig.js
47472
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/CliConfig.js
47278
47473
  /**
47279
47474
  * Configuration for Effect CLI command execution.
47280
47475
  *
@@ -47302,7 +47497,7 @@ var CliConfig = class extends Reference("effect/unstable/cli/CliConfig", { defau
47302
47497
  const defaults = { builtIns: BuiltIns };
47303
47498
 
47304
47499
  //#endregion
47305
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/lexer.js
47500
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/lexer.js
47306
47501
  /** @internal */
47307
47502
  function lex(argv) {
47308
47503
  const endIndex = argv.indexOf("--");
@@ -47362,7 +47557,7 @@ const lexTokens = (args) => {
47362
47557
  };
47363
47558
 
47364
47559
  //#endregion
47365
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/auto-suggest.js
47560
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/auto-suggest.js
47366
47561
  /**
47367
47562
  * Simple Levenshtein distance implementation (small N, no perf worries)
47368
47563
  */
@@ -47391,7 +47586,7 @@ const suggest = (input, candidates) => {
47391
47586
  };
47392
47587
 
47393
47588
  //#endregion
47394
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/parser.js
47589
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/parser.js
47395
47590
  /**
47396
47591
  * Parsing Pipeline for CLI Commands
47397
47592
  * ==================================
@@ -47919,7 +48114,7 @@ const scanCommandLevel = (tokens, context) => {
47919
48114
  };
47920
48115
 
47921
48116
  //#endregion
47922
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/internal/wizard.js
48117
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/internal/wizard.js
47923
48118
  const run$1 = /* @__PURE__ */ fnUntraced(function* (command, options) {
47924
48119
  const commandPath = options?.commandPath ?? [command.name];
47925
48120
  const selected = getCommandAtPath(command, commandPath);
@@ -48083,7 +48278,7 @@ const wrapCommand = (commandLine) => {
48083
48278
  const formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
48084
48279
 
48085
48280
  //#endregion
48086
- //#region ../../node_modules/.pnpm/effect@4.0.0-beta.104/node_modules/effect/dist/unstable/cli/Command.js
48281
+ //#region ../../node_modules/.pnpm/effect@4.0.0-beta.107/node_modules/effect/dist/unstable/cli/Command.js
48087
48282
  /**
48088
48283
  * Returns `true` if the provided value is a `Command`.
48089
48284
  *
@@ -48473,12 +48668,17 @@ const getOutOfScopeGlobalFlagErrors = (allFlags, activeFlags, flagMap, commandPa
48473
48668
  }
48474
48669
  return errors;
48475
48670
  };
48476
- const showHelp = (command, error$1) => gen(function* () {
48671
+ const showHelp = (command, error$2, renderErrors) => gen(function* () {
48477
48672
  const { builtIns } = yield* CliConfig;
48478
48673
  const formatter = yield* Formatter;
48479
- const helpDoc = yield* getHelpForCommandPath(command, error$1.commandPath, builtIns);
48674
+ const helpDoc = yield* getHelpForCommandPath(command, error$2.commandPath, builtIns);
48480
48675
  yield* log(formatter.formatHelpDoc(helpDoc));
48481
- if (error$1.errors.length > 0) yield* error(formatter.formatErrors(error$1.errors));
48676
+ if (renderErrors && error$2.errors.length > 0) yield* error(formatter.formatErrors(error$2.errors));
48677
+ });
48678
+ const showUserError = (error$1) => gen(function* () {
48679
+ const formatter = yield* Formatter;
48680
+ yield* error(formatter.formatError(error$1));
48681
+ error$1[errorReported] = false;
48482
48682
  });
48483
48683
  /**
48484
48684
  * Runs a command using the arguments supplied by the `Stdio` service.
@@ -48488,6 +48688,11 @@ const showHelp = (command, error$1) => gen(function* () {
48488
48688
  * Use when command-line arguments should come from `Stdio` at the application
48489
48689
  * entry point.
48490
48690
  *
48691
+ * Help documents are always rendered. By default, parse error details and
48692
+ * `CliError.UserError` failures are also rendered with the installed
48693
+ * `CliOutput.Formatter` before the error is rethrown. Set `renderErrors` to
48694
+ * `false` when the host application owns error rendering.
48695
+ *
48491
48696
  * **Example** (Running commands with standard input)
48492
48697
  *
48493
48698
  * ```ts import.meta.vitest
@@ -48545,6 +48750,11 @@ const run = /* @__PURE__ */ dual(2, (command, config) => Stdio.use(({ args }) =>
48545
48750
  * Use when you need to test CLI applications or programmatically execute
48546
48751
  * commands with specific arguments.
48547
48752
  *
48753
+ * Help documents are always rendered. By default, parse error details and
48754
+ * `CliError.UserError` failures are also rendered with the installed
48755
+ * `CliOutput.Formatter` before the error is rethrown. Set `renderErrors` to
48756
+ * `false` when the host application owns error rendering.
48757
+ *
48548
48758
  * **Example** (Running commands with explicit arguments)
48549
48759
  *
48550
48760
  * ```ts import.meta.vitest
@@ -48653,7 +48863,10 @@ const runWith = (command, config) => {
48653
48863
  inactive: "no"
48654
48864
  }))) {
48655
48865
  yield* log();
48656
- yield* runWith(command, config)(wizardArgs.slice(1));
48866
+ yield* runWith(command, {
48867
+ ...config,
48868
+ renderErrors: false
48869
+ })(wizardArgs.slice(1));
48657
48870
  }
48658
48871
  }).pipe(catchTag("QuitError", () => log(renderQuit())));
48659
48872
  yield* flag.run(value, handlerCtx);
@@ -48681,7 +48894,7 @@ const runWith = (command, config) => {
48681
48894
  onSome: (level) => make$29(MinimumLogLevel, level)
48682
48895
  });
48683
48896
  yield* provideContext(program, services);
48684
- }, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$6(error) : fail$5(error), (error) => andThen(showHelp(command, error), fail$1(error))), catchFilter((e) => isQuitError(e) ? succeed$6(e) : fail$5(e), (_) => interrupt$1));
48897
+ }, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$6(error) : fail$5(error), (error) => andThen(showHelp(command, error, config.renderErrors !== false), fail$1(error))), catchFilter((error) => config.renderErrors !== false && isCliError(error) && error._tag === "UserError" ? succeed$6(error) : fail$5(error), (error) => andThen(showUserError(error), fail$1(error))), catchFilter((e) => isQuitError(e) ? succeed$6(e) : fail$5(e), (_) => interrupt$1));
48685
48898
  };
48686
48899
 
48687
48900
  //#endregion
@@ -50391,6 +50604,17 @@ var metadata_default = {
50391
50604
  rules
50392
50605
  };
50393
50606
 
50607
+ //#endregion
50608
+ //#region src/patcher/fileHash.ts
50609
+ const textEncoder = new TextEncoder();
50610
+ const hashBytes = (contents) => gen(function* () {
50611
+ const digest = yield* (yield* Crypto).digest("SHA-256", typeof contents === "string" ? textEncoder.encode(contents) : contents);
50612
+ return encodeHex$1(digest);
50613
+ });
50614
+ const hashFile = (filePath) => gen(function* () {
50615
+ return yield* hashBytes(yield* (yield* FileSystem).readFile(filePath));
50616
+ });
50617
+
50394
50618
  //#endregion
50395
50619
  //#region src/patcher/discovery.ts
50396
50620
  const defaultTypescriptPackageNames$1 = ["typescript", "@typescript/native"];
@@ -50505,11 +50729,15 @@ const discoverBinaries = (cwd, preferredTypescriptPackage) => gen(function* () {
50505
50729
  const typescript = yield* discoverTypeScript(cwdRequire, preferredTypescriptPackage);
50506
50730
  const oxlint = yield* discoverOxlint(cwdRequire);
50507
50731
  const vitePlusOxlint = yield* discoverVitePlusOxlint(cwdRequire);
50508
- return [...new Map([
50732
+ const discovered = [...new Map([
50509
50733
  ...typescript,
50510
50734
  ...oxlint,
50511
50735
  ...vitePlusOxlint
50512
50736
  ].map((binary) => [binary.binaryPath, binary])).values()];
50737
+ return yield* forEach$1(discovered, (binary) => hashFile(binary.binaryPath).pipe(map$5((fileHash) => ({
50738
+ ...binary,
50739
+ fileHash
50740
+ })), mapError(() => new DiscoveryError({ reason: `Unable to read discovered binary ${binary.binaryPath}.` }))));
50513
50741
  });
50514
50742
  const selectComponents = (binaries, components) => binaries.filter((binary) => components.has(binary.component));
50515
50743
  const requireComponents = (binaries, components) => gen(function* () {
@@ -50557,7 +50785,9 @@ const renderOxlintDeclarations = (source) => {
50557
50785
  const resolveOxlintDeclarations = (target) => gen(function* () {
50558
50786
  const fs = yield* FileSystem;
50559
50787
  yield* Path;
50560
- const source = yield* fs.readFileString(target.binaryPath).pipe(mapError((error) => new PatcherError({ reason: `Unable to read Oxlint declarations at ${target.binaryPath}: ${error.message}` })));
50788
+ const backupPath = `${target.binaryPath}.original`;
50789
+ const sourcePath = (yield* exists(fs, backupPath)) ? backupPath : target.binaryPath;
50790
+ const source = yield* fs.readFileString(sourcePath).pipe(mapError((error) => new PatcherError({ reason: `Unable to read Oxlint declarations at ${sourcePath}: ${error.message}` })));
50561
50791
  const replacement = yield* try_({
50562
50792
  try: () => renderOxlintDeclarations(source),
50563
50793
  catch: (error) => error instanceof PatcherError ? error : new PatcherError({ reason: `Unable to generate Oxlint declarations: ${String(error)}` })
@@ -50567,7 +50797,10 @@ const resolveOxlintDeclarations = (target) => gen(function* () {
50567
50797
  suffix: ".d.ts"
50568
50798
  }).pipe(mapError((error) => new PatcherError({ reason: `Unable to create a temporary Oxlint declaration file: ${error.message}` })));
50569
50799
  yield* fs.writeFileString(replacementPath, replacement).pipe(mapError((error) => new PatcherError({ reason: `Unable to write generated Oxlint declarations at ${replacementPath}: ${error.message}` })));
50570
- return { path: replacementPath };
50800
+ return {
50801
+ path: replacementPath,
50802
+ fileHash: yield* hashBytes(replacement).pipe(mapError((error) => new PatcherError({ reason: `Unable to hash generated Oxlint declarations: ${error.message}` })))
50803
+ };
50571
50804
  });
50572
50805
  const resolvePlatformPackage = (target) => gen(function* () {
50573
50806
  const path = yield* Path;
@@ -50592,12 +50825,16 @@ const resolveReplacement = (target) => gen(function* () {
50592
50825
  target,
50593
50826
  reason: `Missing packaged artifact ${replacementPath}.`
50594
50827
  });
50595
- return { path: replacementPath };
50828
+ return {
50829
+ path: replacementPath,
50830
+ fileHash: yield* hashFile(replacementPath).pipe(mapError((error) => new PatcherError({ reason: `Unable to hash packaged artifact ${replacementPath}: ${error.message}` })))
50831
+ };
50596
50832
  });
50597
50833
  const preparePatch = (targets, options) => gen(function* () {
50598
50834
  const fs = yield* FileSystem;
50599
50835
  const resolver = options.resolveReplacement ?? resolveReplacement;
50600
50836
  const operations = [];
50837
+ const cleanup = [];
50601
50838
  const skipped = [];
50602
50839
  const available = [];
50603
50840
  for (const target of targets) {
@@ -50605,14 +50842,6 @@ const preparePatch = (targets, options) => gen(function* () {
50605
50842
  const targetExists = yield* exists(fs, target.binaryPath);
50606
50843
  const backupExists = yield* exists(fs, backupPath);
50607
50844
  if (!targetExists) return yield* new PatcherError({ reason: `Installed binary does not exist: ${target.binaryPath}` });
50608
- if (backupExists) {
50609
- skipped.push({
50610
- target,
50611
- reason: "already-patched",
50612
- message: `${target.component} skipped because backup already exists at ${backupPath}.`
50613
- });
50614
- continue;
50615
- }
50616
50845
  const replacement = yield* resolver(target).pipe(catchTag("ReplacementUnavailableError", (error) => {
50617
50846
  if (!options.skipMissing) return fail$1(error);
50618
50847
  skipped.push({
@@ -50623,14 +50852,34 @@ const preparePatch = (targets, options) => gen(function* () {
50623
50852
  return succeed$2(void 0);
50624
50853
  }));
50625
50854
  if (replacement === void 0) continue;
50855
+ if (backupExists && target.fileHash === replacement.fileHash) {
50856
+ skipped.push({
50857
+ target,
50858
+ reason: "already-patched",
50859
+ message: `${target.component} skipped because its hash matches the replacement.`
50860
+ });
50861
+ continue;
50862
+ }
50626
50863
  available.push({
50627
50864
  target,
50628
- replacementPath: replacement.path
50865
+ replacementPath: replacement.path,
50866
+ backupExists
50629
50867
  });
50630
50868
  }
50631
- for (const { replacementPath, target } of available) {
50869
+ for (const { backupExists, replacementPath, target } of available) {
50632
50870
  const backupPath = `${target.binaryPath}.original`;
50633
- operations.push({
50871
+ if (backupExists) {
50872
+ const quarantinePath = `${target.binaryPath}.${(0, node_crypto.randomUUID)()}.patched`;
50873
+ operations.push({
50874
+ _tag: "Rename",
50875
+ sourcePath: target.binaryPath,
50876
+ destinationPath: quarantinePath
50877
+ });
50878
+ cleanup.push({
50879
+ _tag: "Remove",
50880
+ path: quarantinePath
50881
+ });
50882
+ } else operations.push({
50634
50883
  _tag: "Rename",
50635
50884
  sourcePath: target.binaryPath,
50636
50885
  destinationPath: backupPath
@@ -50648,7 +50897,7 @@ const preparePatch = (targets, options) => gen(function* () {
50648
50897
  }
50649
50898
  return {
50650
50899
  operations,
50651
- cleanup: [],
50900
+ cleanup,
50652
50901
  skipped
50653
50902
  };
50654
50903
  });
@@ -197939,7 +198188,7 @@ var FileReadError = class extends TaggedError$1("FileReadError") {
197939
198188
  //#endregion
197940
198189
  //#region package.json
197941
198190
  var name = "@effect/tsgo";
197942
- var version = "0.36.1";
198191
+ var version = "0.36.3";
197943
198192
 
197944
198193
  //#endregion
197945
198194
  //#region src/cli/setup/consts.ts