repo-dive 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -15,7 +15,7 @@ import * as NodeUrl from "node:url";
15
15
  import { fileURLToPath, pathToFileURL } from "node:url";
16
16
  import { access, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from "node:fs/promises";
17
17
  import * as readline from "node:readline";
18
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Pipeable.js
18
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Pipeable.js
19
19
  /**
20
20
  * The `Pipeable` module defines the shared interface and implementation helpers
21
21
  * for values that support Effect-style method chaining with `.pipe(...)`.
@@ -117,7 +117,7 @@ var Class$3 = /*#__PURE__*/ function() {
117
117
  return PipeableBase;
118
118
  }();
119
119
  //#endregion
120
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Function.js
120
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Function.js
121
121
  /**
122
122
  * Creates a function that can be called in data-first style or data-last
123
123
  * (`pipe`-friendly) style.
@@ -395,8 +395,44 @@ function memoize(f) {
395
395
  return result;
396
396
  };
397
397
  }
398
+ /**
399
+ * Creates a memoized idempotent object transformation that caches both inputs
400
+ * and their outputs by object identity.
401
+ *
402
+ * **When to use**
403
+ *
404
+ * Use when an object transformation is idempotent and its output can be safely
405
+ * reused as a fixed point.
406
+ *
407
+ * **Details**
408
+ *
409
+ * After computing an input, the returned function caches both the input and
410
+ * the output. Calling it with either reference returns the output without
411
+ * invoking the supplied function again.
412
+ *
413
+ * **Gotchas**
414
+ *
415
+ * The returned function treats each computed output as a fixed point. If
416
+ * applying the supplied function to an output would produce an observably
417
+ * different value, this memoization changes that behavior.
418
+ *
419
+ * @see {@link memoize} for memoizing functions without an idempotence requirement
420
+ * @category caching
421
+ * @since 4.0.0
422
+ */
423
+ function memoizeIdempotent(f) {
424
+ const cache = /* @__PURE__ */ new WeakMap();
425
+ return (a) => {
426
+ const cached = cache.get(a);
427
+ if (cached !== void 0) return cached;
428
+ const result = f(a);
429
+ cache.set(a, result);
430
+ cache.set(result, result);
431
+ return result;
432
+ };
433
+ }
398
434
  //#endregion
399
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/equal.js
435
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/equal.js
400
436
  /** @internal */
401
437
  var getAllObjectKeys = (obj) => {
402
438
  const keys = new Set(Reflect.ownKeys(obj));
@@ -415,7 +451,7 @@ var getAllObjectKeys = (obj) => {
415
451
  /** @internal */
416
452
  var byReferenceInstances = /*#__PURE__*/ new WeakSet();
417
453
  //#endregion
418
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Predicate.js
454
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Predicate.js
419
455
  /**
420
456
  * Defines runtime checks for values.
421
457
  *
@@ -1019,7 +1055,7 @@ function isIterable(input) {
1019
1055
  return hasProperty(input, Symbol.iterator) || isString(input);
1020
1056
  }
1021
1057
  //#endregion
1022
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Hash.js
1058
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Hash.js
1023
1059
  /**
1024
1060
  * Computes Effect hash values and defines the interface for objects that want
1025
1061
  * to provide their own hash implementation. Hashes are small numeric
@@ -1432,7 +1468,7 @@ function withVisitedTracking$1(obj, fn) {
1432
1468
  return result;
1433
1469
  }
1434
1470
  //#endregion
1435
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Equal.js
1471
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Equal.js
1436
1472
  /**
1437
1473
  * Defines the unique string identifier for the `Equal` interface.
1438
1474
  *
@@ -1658,7 +1694,7 @@ var compareSets = /*#__PURE__*/ makeCompareSet(compareBoth);
1658
1694
  */
1659
1695
  var isEqual = (u) => hasProperty(u, symbol$2);
1660
1696
  //#endregion
1661
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Redactable.js
1697
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Redactable.js
1662
1698
  /**
1663
1699
  * Defines the symbol used to identify objects that implement the {@link Redactable}
1664
1700
  * protocol.
@@ -1777,7 +1813,7 @@ var emptyContext$1 = {
1777
1813
  }
1778
1814
  };
1779
1815
  //#endregion
1780
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Formatter.js
1816
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Formatter.js
1781
1817
  /**
1782
1818
  * Formats JavaScript values into readable strings.
1783
1819
  *
@@ -2011,7 +2047,7 @@ function formatJson(input, options) {
2011
2047
  }, options?.space) ?? "null";
2012
2048
  }
2013
2049
  //#endregion
2014
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Inspectable.js
2050
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Inspectable.js
2015
2051
  /**
2016
2052
  * Controls how values appear in logs and debugging output.
2017
2053
  *
@@ -2158,7 +2194,7 @@ var BaseProto = {
2158
2194
  }
2159
2195
  };
2160
2196
  //#endregion
2161
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Utils.js
2197
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Utils.js
2162
2198
  /**
2163
2199
  * Yields its wrapped value exactly once through an `IterableIterator`.
2164
2200
  *
@@ -2245,7 +2281,7 @@ var pickInternalCall = () => {
2245
2281
  /** @internal */
2246
2282
  var internalCall = /*#__PURE__*/ pickInternalCall();
2247
2283
  //#endregion
2248
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/record.js
2284
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/record.js
2249
2285
  /** @internal */
2250
2286
  function assignProperty(self, key, value) {
2251
2287
  if (key === "__proto__") Object.defineProperty(self, key, {
@@ -2261,7 +2297,7 @@ function assignProperties(self, source) {
2261
2297
  for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProperty(self, key, source[key]);
2262
2298
  }
2263
2299
  //#endregion
2264
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/core.js
2300
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/core.js
2265
2301
  /** @internal */
2266
2302
  var EffectTypeId = `~effect/Effect`;
2267
2303
  /** @internal */
@@ -2634,7 +2670,7 @@ var done$2 = (value) => {
2634
2670
  return exitFail(Done$1(value));
2635
2671
  };
2636
2672
  //#endregion
2637
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Equivalence.js
2673
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Equivalence.js
2638
2674
  /**
2639
2675
  * Creates a custom equivalence relation with an optimized reference equality check.
2640
2676
  *
@@ -2744,14 +2780,14 @@ function Array_(item) {
2744
2780
  });
2745
2781
  }
2746
2782
  //#endregion
2747
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/array.js
2783
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/array.js
2748
2784
  /**
2749
2785
  * @since 2.0.0
2750
2786
  */
2751
2787
  /** @internal */
2752
2788
  var isArrayNonEmpty$1 = (self) => self.length > 0;
2753
2789
  //#endregion
2754
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/option.js
2790
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/option.js
2755
2791
  /**
2756
2792
  * @since 2.0.0
2757
2793
  */
@@ -2821,7 +2857,7 @@ var some$1 = (value) => {
2821
2857
  return a;
2822
2858
  };
2823
2859
  //#endregion
2824
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/result.js
2860
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/result.js
2825
2861
  var TypeId$51 = "~effect/data/Result";
2826
2862
  var CommonProto = {
2827
2863
  [TypeId$51]: {
@@ -2893,7 +2929,7 @@ var succeed$9 = (success) => {
2893
2929
  return a;
2894
2930
  };
2895
2931
  //#endregion
2896
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Order.js
2932
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Order.js
2897
2933
  /**
2898
2934
  * Defines comparison functions for ordered values.
2899
2935
  *
@@ -3136,7 +3172,7 @@ var isLessThanOrEqualTo$1 = (O) => dual(2, (self, that) => O(self, that) !== 1);
3136
3172
  */
3137
3173
  var isGreaterThanOrEqualTo$2 = (O) => dual(2, (self, that) => O(self, that) !== -1);
3138
3174
  //#endregion
3139
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Option.js
3175
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Option.js
3140
3176
  /**
3141
3177
  * Creates an `Option` representing the absence of a value.
3142
3178
  *
@@ -3608,7 +3644,7 @@ var filter = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none() :
3608
3644
  */
3609
3645
  var exists$1 = /*#__PURE__*/ dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));
3610
3646
  //#endregion
3611
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Result.js
3647
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Result.js
3612
3648
  /**
3613
3649
  * Creates a `Result` holding a `Success` value.
3614
3650
  *
@@ -3726,7 +3762,7 @@ var isFailure$1 = isFailure$2;
3726
3762
  */
3727
3763
  var match$4 = /*#__PURE__*/ dual(2, (self, { onFailure, onSuccess }) => isFailure$1(self) ? onFailure(self.failure) : onSuccess(self.success));
3728
3764
  //#endregion
3729
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Iterable.js
3765
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Iterable.js
3730
3766
  /**
3731
3767
  * Returns the first element that satisfies the specified
3732
3768
  * predicate, or `None` if no such element exists.
@@ -3779,7 +3815,7 @@ var findFirst$1 = /*#__PURE__*/ dual(2, (self, f) => {
3779
3815
  return none();
3780
3816
  });
3781
3817
  //#endregion
3782
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Record.js
3818
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Record.js
3783
3819
  /**
3784
3820
  * Checks whether a given `key` exists in a record.
3785
3821
  *
@@ -3890,7 +3926,7 @@ var makeEquivalence$2 = (equivalence) => {
3890
3926
  return (self, that) => is(self, that) && is(that, self);
3891
3927
  };
3892
3928
  //#endregion
3893
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Array.js
3929
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Array.js
3894
3930
  /**
3895
3931
  * Works with JavaScript arrays, readonly arrays, and non-empty arrays.
3896
3932
  *
@@ -4422,7 +4458,7 @@ var dedupe = (self) => {
4422
4458
  return out;
4423
4459
  };
4424
4460
  //#endregion
4425
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Effectable.js
4461
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Effectable.js
4426
4462
  /**
4427
4463
  * Create a low-level `Effect` prototype.
4428
4464
  *
@@ -4446,7 +4482,7 @@ var Prototype = (options) => makePrimitiveProto({
4446
4482
  [evaluate]: options.evaluate
4447
4483
  });
4448
4484
  //#endregion
4449
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Context.js
4485
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Context.js
4450
4486
  /**
4451
4487
  * Runtime type identifier attached to `Context` service keys and used by
4452
4488
  * `isKey` to recognize them.
@@ -5074,7 +5110,7 @@ var mergeAll$1 = (...ctxs) => {
5074
5110
  */
5075
5111
  var Reference = Service$1;
5076
5112
  //#endregion
5077
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Duration.js
5113
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Duration.js
5078
5114
  var TypeId$49 = "~effect/time/Duration";
5079
5115
  var bigint0$2 = /*#__PURE__*/ BigInt(0);
5080
5116
  var bigint1 = /*#__PURE__*/ BigInt(1);
@@ -5748,7 +5784,7 @@ var format$2 = (self) => {
5748
5784
  return pieces.join(" ");
5749
5785
  };
5750
5786
  //#endregion
5751
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Filter.js
5787
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Filter.js
5752
5788
  /**
5753
5789
  * Composes two filters sequentially, passing the successful output of the first
5754
5790
  * filter to the second.
@@ -5769,7 +5805,7 @@ var composePassthrough = /*#__PURE__*/ dual(2, (left, right) => (input) => {
5769
5805
  return rightOut;
5770
5806
  });
5771
5807
  //#endregion
5772
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Scheduler.js
5808
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Scheduler.js
5773
5809
  /**
5774
5810
  * Controls how runnable Effect fiber tasks are dispatched.
5775
5811
  *
@@ -5985,7 +6021,7 @@ var PreventSchedulerYield = /*#__PURE__*/ Reference("effect/Scheduler/PreventSch
5985
6021
  defaultValue: () => false
5986
6022
  });
5987
6023
  //#endregion
5988
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Tracer.js
6024
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Tracer.js
5989
6025
  /**
5990
6026
  * Defines the low-level tracing model used by Effect.
5991
6027
  *
@@ -6298,11 +6334,11 @@ var randomHexString = /*#__PURE__*/ function() {
6298
6334
  };
6299
6335
  }();
6300
6336
  //#endregion
6301
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/metric.js
6337
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/metric.js
6302
6338
  /** @internal */
6303
6339
  var FiberRuntimeMetricsKey = "effect/observability/Metric/FiberRuntimeMetricsKey";
6304
6340
  //#endregion
6305
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/references.js
6341
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/references.js
6306
6342
  /** @internal */
6307
6343
  var CurrentErrorReporters = /*#__PURE__*/ Reference("effect/ErrorReporter/CurrentErrorReporters", { defaultValue: () => /* @__PURE__ */ new Set() });
6308
6344
  /** @internal */
@@ -6333,7 +6369,7 @@ var MinimumLogLevel$1 = /*#__PURE__*/ Reference("effect/References/MinimumLogLev
6333
6369
  /** @internal */
6334
6370
  var CurrentLogSpans = /*#__PURE__*/ Reference("effect/References/CurrentLogSpans", { defaultValue: () => [] });
6335
6371
  //#endregion
6336
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/stackTraceLimit.js
6372
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/stackTraceLimit.js
6337
6373
  /**
6338
6374
  * Check if `Error.stackTraceLimit` is writable.
6339
6375
  * Returns `false` if the property is frozen, non-writable, or `Error` is non-extensible.
@@ -6365,7 +6401,7 @@ var setStackTraceLimit = (value) => {
6365
6401
  if (canWriteStackTraceLimit) Error.stackTraceLimit = value;
6366
6402
  };
6367
6403
  //#endregion
6368
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/tracer.js
6404
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/tracer.js
6369
6405
  /** @internal */
6370
6406
  var addSpanStackTrace = (options) => {
6371
6407
  if (options?.captureStackTrace === false) return options;
@@ -6395,7 +6431,7 @@ var makeStackCleaner = (line) => (stack) => {
6395
6431
  };
6396
6432
  var spanCleaner = /*#__PURE__*/ makeStackCleaner(3);
6397
6433
  //#endregion
6398
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/effect.js
6434
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/effect.js
6399
6435
  /** @internal */
6400
6436
  var Interrupt = class extends ReasonBase {
6401
6437
  fiberId;
@@ -8022,10 +8058,8 @@ var useSpan$1 = (name, ...args) => {
8022
8058
  return withFiber$1((fiber) => {
8023
8059
  const span = makeSpanUnsafe(fiber, name, options);
8024
8060
  const clock = fiber.getRef(ClockRef);
8025
- return onExit$1(internalCall(() => evaluate(span)), (exit) => sync$1(() => {
8026
- if (span.status._tag === "Ended") return;
8027
- span.end(clock.currentTimeNanosUnsafe(), exit);
8028
- }));
8061
+ const timingEnabled = fiber.getRef(TracerTimingEnabled);
8062
+ return onExit$1(internalCall(() => evaluate(span)), (exit) => endSpan(span, exit, clock, timingEnabled));
8029
8063
  });
8030
8064
  };
8031
8065
  var provideParentSpan = /*#__PURE__*/ provideService$1(ParentSpan);
@@ -8315,7 +8349,7 @@ var reportCauseUnsafe = (fiber, cause, defectsOnly) => {
8315
8349
  reporters.forEach((reporter) => reporter.report(opts));
8316
8350
  };
8317
8351
  //#endregion
8318
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Deferred.js
8352
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Deferred.js
8319
8353
  var TypeId$48 = "~effect/Deferred";
8320
8354
  /**
8321
8355
  * Checks whether a value is a `Deferred`.
@@ -8489,7 +8523,7 @@ var doneUnsafe = (self, effect) => {
8489
8523
  return true;
8490
8524
  };
8491
8525
  //#endregion
8492
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Exit.js
8526
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Exit.js
8493
8527
  /**
8494
8528
  * Checks whether an unknown value is an Exit.
8495
8529
  *
@@ -8717,7 +8751,7 @@ var isSuccess = exitIsSuccess;
8717
8751
  */
8718
8752
  var isFailure = exitIsFailure;
8719
8753
  //#endregion
8720
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/References.js
8754
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/References.js
8721
8755
  /**
8722
8756
  * Context reference for managing log annotations that are automatically added to all log entries.
8723
8757
  * These annotations provide contextual metadata that appears in every log message.
@@ -8851,7 +8885,7 @@ var CurrentLogLevel = CurrentLogLevel$1;
8851
8885
  */
8852
8886
  var MinimumLogLevel = MinimumLogLevel$1;
8853
8887
  //#endregion
8854
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Scope.js
8888
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Scope.js
8855
8889
  /**
8856
8890
  * Controls how long resources stay open.
8857
8891
  *
@@ -9145,7 +9179,7 @@ var close = scopeClose;
9145
9179
  */
9146
9180
  var closeUnsafe = scopeCloseUnsafe;
9147
9181
  //#endregion
9148
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Layer.js
9182
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Layer.js
9149
9183
  var TypeId$47 = "~effect/Layer";
9150
9184
  var MemoMapTypeId = "~effect/Layer/MemoMap";
9151
9185
  var memoMapReuse = (entry, scope) => {
@@ -9963,7 +9997,7 @@ var provideMerge = /*#__PURE__*/ dual(2, (self, that) => provideWith(self, that,
9963
9997
  */
9964
9998
  var launch = (self) => scoped$1(andThen$1(build(self), never$2));
9965
9999
  //#endregion
9966
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Cause.js
10000
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Cause.js
9967
10001
  /**
9968
10002
  * Records the full reason an `Effect` failed.
9969
10003
  *
@@ -10516,7 +10550,7 @@ var UnknownError$1 = UnknownError$2;
10516
10550
  var StackTrace = class extends Service$1()("effect/Cause/StackTrace") {};
10517
10551
  Service$1()("effect/Cause/InterruptorStackTrace");
10518
10552
  //#endregion
10519
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Data.js
10553
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Data.js
10520
10554
  /**
10521
10555
  * Provides a base class for immutable data types.
10522
10556
  *
@@ -10726,7 +10760,7 @@ var Error$2 = Error$3;
10726
10760
  */
10727
10761
  var TaggedError$1 = TaggedError$2;
10728
10762
  //#endregion
10729
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Clock.js
10763
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Clock.js
10730
10764
  /**
10731
10765
  * Context reference for the active time service in the environment.
10732
10766
  *
@@ -10806,7 +10840,7 @@ var Clock = ClockRef;
10806
10840
  */
10807
10841
  var currentTimeMillis = currentTimeMillis$1;
10808
10842
  //#endregion
10809
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/dateTime.js
10843
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/dateTime.js
10810
10844
  /** @internal */
10811
10845
  var TypeId$46 = "~effect/time/DateTime";
10812
10846
  /** @internal */
@@ -10959,7 +10993,7 @@ var round = /*#__PURE__*/ dual(2, (self, precision) => {
10959
10993
  return Math.round(self * factor) / factor;
10960
10994
  });
10961
10995
  //#endregion
10962
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Pull.js
10996
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Pull.js
10963
10997
  /**
10964
10998
  * Models one low-level pull step for stream-like consumers.
10965
10999
  *
@@ -11114,7 +11148,7 @@ var matchEffect$1 = /*#__PURE__*/ dual(2, (self, options) => matchCauseEffect$1(
11114
11148
  }
11115
11149
  }));
11116
11150
  //#endregion
11117
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Schedule.js
11151
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Schedule.js
11118
11152
  var TypeId$45 = "~effect/Schedule";
11119
11153
  /**
11120
11154
  * Context reference containing metadata for the currently running schedule step.
@@ -11419,12 +11453,12 @@ var while_ = /*#__PURE__*/ dual(2, (self, predicate) => fromStep(map$9(toStep(se
11419
11453
  */
11420
11454
  var forever$1 = /*#__PURE__*/ spaced(zero$1);
11421
11455
  //#endregion
11422
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/layer.js
11456
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/layer.js
11423
11457
  var provideLayer = (self, layer, options) => scopedWith$1((scope) => flatMap$2(options?.local ? buildWithMemoMap(layer, makeMemoMapUnsafe(), scope) : buildWithScope(layer, scope), (context) => provideContext$3(self, context)));
11424
11458
  /** @internal */
11425
11459
  var provide$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, source, options) => isContext(source) ? provideContext$3(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll(...source) : source, options));
11426
11460
  //#endregion
11427
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/schedule.js
11461
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/schedule.js
11428
11462
  /** @internal */
11429
11463
  var retryOrElse = /*#__PURE__*/ dual(3, (self, policy, orElse) => flatMap$2(toStepWithMetadata(policy), (step) => {
11430
11464
  let meta = CurrentMetadata.defaultValue();
@@ -11458,7 +11492,7 @@ var buildFromOptions = (options) => {
11458
11492
  return schedule;
11459
11493
  };
11460
11494
  //#endregion
11461
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Effect.js
11495
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Effect.js
11462
11496
  /**
11463
11497
  * Checks whether a value is an `Effect`.
11464
11498
  *
@@ -15330,7 +15364,7 @@ var flatMapEager = flatMapEager$1;
15330
15364
  */
15331
15365
  var fnUntracedEager = fnUntracedEager$1;
15332
15366
  //#endregion
15333
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/PlatformError.js
15367
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/PlatformError.js
15334
15368
  /**
15335
15369
  * Normalized errors for platform APIs.
15336
15370
  *
@@ -15482,7 +15516,7 @@ var systemError = (options) => new PlatformError(new SystemError(options));
15482
15516
  */
15483
15517
  var badArgument = (options) => new PlatformError(new BadArgument(options));
15484
15518
  //#endregion
15485
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Fiber.js
15519
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Fiber.js
15486
15520
  /**
15487
15521
  * Joins a fiber, blocking until it completes. If the fiber succeeds,
15488
15522
  * returns its value. If it fails, the error is propagated.
@@ -15613,7 +15647,7 @@ var getCurrent = getCurrentFiber;
15613
15647
  */
15614
15648
  var runIn = fiberRunIn;
15615
15649
  //#endregion
15616
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Latch.js
15650
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Latch.js
15617
15651
  /**
15618
15652
  * Creates a `Latch` synchronously, outside of `Effect`.
15619
15653
  *
@@ -15650,7 +15684,7 @@ var runIn = fiberRunIn;
15650
15684
  */
15651
15685
  var makeUnsafe$3 = makeLatchUnsafe;
15652
15686
  //#endregion
15653
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/MutableRef.js
15687
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/MutableRef.js
15654
15688
  var TypeId$43 = "~effect/MutableRef";
15655
15689
  var MutableRefProto = {
15656
15690
  [TypeId$43]: TypeId$43,
@@ -15700,7 +15734,7 @@ var make$43 = (value) => {
15700
15734
  return ref;
15701
15735
  };
15702
15736
  //#endregion
15703
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/MutableList.js
15737
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/MutableList.js
15704
15738
  /**
15705
15739
  * Mutable lists for collecting ordered values and draining them from the front.
15706
15740
  * A `MutableList<A>` can append values to the end, prepend values to the
@@ -15967,7 +16001,7 @@ var take$1 = (self) => {
15967
16001
  return message;
15968
16002
  };
15969
16003
  //#endregion
15970
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Queue.js
16004
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Queue.js
15971
16005
  /**
15972
16006
  * Passes values asynchronously between fibers.
15973
16007
  *
@@ -16882,7 +16916,7 @@ var finalize = (self, exit) => {
16882
16916
  openState.awaiters.clear();
16883
16917
  };
16884
16918
  //#endregion
16885
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Semaphore.js
16919
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Semaphore.js
16886
16920
  /**
16887
16921
  * Creates a `Semaphore` synchronously with the specified total
16888
16922
  * number of permits.
@@ -17043,7 +17077,7 @@ var SemaphoreImpl = class {
17043
17077
  */
17044
17078
  var make$40 = (permits) => sync$1(() => new SemaphoreImpl(permits));
17045
17079
  //#endregion
17046
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Channel.js
17080
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Channel.js
17047
17081
  /**
17048
17082
  * Provides low-level building blocks for streaming data through Effect.
17049
17083
  *
@@ -17952,7 +17986,7 @@ var runFold = /*#__PURE__*/ dual(3, (self, initial, f) => suspend$2(() => {
17952
17986
  */
17953
17987
  var toPullScoped = (self, scope) => toTransform(self)(done(), scope);
17954
17988
  //#endregion
17955
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/stream.js
17989
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/stream.js
17956
17990
  var TypeId$40 = "~effect/Stream";
17957
17991
  var streamVariance = {
17958
17992
  _R: identity,
@@ -17972,7 +18006,7 @@ var fromChannel$2 = (channel) => {
17972
18006
  return self;
17973
18007
  };
17974
18008
  //#endregion
17975
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Sink.js
18009
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Sink.js
17976
18010
  var TypeId$39 = "~effect/Sink";
17977
18011
  var endVoid = /*#__PURE__*/ succeed$4([void 0]);
17978
18012
  var sinkVariance = {
@@ -18194,7 +18228,7 @@ var forEachArray = (f) => fromTransform((upstream) => upstream.pipe(flatMap$1(f)
18194
18228
  */
18195
18229
  var unwrap$1 = (effect) => fromChannel$1(unwrap$2(map$7(effect, toChannel$1)));
18196
18230
  //#endregion
18197
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/MutableHashMap.js
18231
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/MutableHashMap.js
18198
18232
  var TypeId$38 = "~effect/collections/MutableHashMap";
18199
18233
  var MutableHashMapProto = {
18200
18234
  [TypeId$38]: TypeId$38,
@@ -18541,7 +18575,7 @@ var clear = (self) => {
18541
18575
  */
18542
18576
  var size = (self) => self.backing.size;
18543
18577
  //#endregion
18544
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/RcMap.js
18578
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/RcMap.js
18545
18579
  /**
18546
18580
  * Shares scoped resources by key and releases them when no one is using them.
18547
18581
  *
@@ -18742,7 +18776,7 @@ var release = (self, key, entry) => withFiber((fiber) => {
18742
18776
  return void_$1;
18743
18777
  });
18744
18778
  //#endregion
18745
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/rcRef.js
18779
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/rcRef.js
18746
18780
  var TypeId$36 = "~effect/RcRef";
18747
18781
  var stateEmpty = { _tag: "Empty" };
18748
18782
  var stateClosed = { _tag: "Closed" };
@@ -18779,7 +18813,7 @@ var make$38 = (options) => withFiber((fiber) => {
18779
18813
  return close$2;
18780
18814
  }), ref);
18781
18815
  });
18782
- var getState = (self) => uninterruptibleMask((restore) => {
18816
+ var getState = (self) => uninterruptibleMask(function loop(restore) {
18783
18817
  switch (self.state._tag) {
18784
18818
  case "Closed": return interrupt$1;
18785
18819
  case "Acquired":
@@ -18787,18 +18821,21 @@ var getState = (self) => uninterruptibleMask((restore) => {
18787
18821
  return self.state.fiber ? as(interrupt(self.state.fiber), self.state) : succeed$4(self.state);
18788
18822
  case "Empty": {
18789
18823
  const scope = makeUnsafe$5();
18790
- return self.semaphore.withPermits(1)(restore(provideContext$2(self.acquire, add(self.context, Scope, scope))).pipe(map$7((value) => {
18791
- const state = {
18792
- _tag: "Acquired",
18793
- value,
18794
- scope,
18795
- fiber: void 0,
18796
- refCount: 1,
18797
- invalidated: false
18798
- };
18799
- self.state = state;
18800
- return state;
18801
- })));
18824
+ return self.semaphore.withPermit(suspend$2(() => {
18825
+ if (self.state._tag !== "Empty") return loop(restore);
18826
+ return restore(provideContext$2(self.acquire, add(self.context, Scope, scope))).pipe(map$7((value) => {
18827
+ const state = {
18828
+ _tag: "Acquired",
18829
+ value,
18830
+ scope,
18831
+ fiber: void 0,
18832
+ refCount: 1,
18833
+ invalidated: false
18834
+ };
18835
+ self.state = state;
18836
+ return state;
18837
+ }), onExit((exit) => isFailure(exit) ? close(scope, exit) : void_$1));
18838
+ }));
18802
18839
  }
18803
18840
  }
18804
18841
  });
@@ -18830,7 +18867,7 @@ var get$1 = /*#__PURE__*/ fnUntraced(function* (self_) {
18830
18867
  return state.value;
18831
18868
  });
18832
18869
  //#endregion
18833
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/RcRef.js
18870
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/RcRef.js
18834
18871
  /**
18835
18872
  * Creates an `RcRef` from an acquire effect.
18836
18873
  *
@@ -18924,7 +18961,7 @@ var make$37 = make$38;
18924
18961
  */
18925
18962
  var get = get$1;
18926
18963
  //#endregion
18927
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Stream.js
18964
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Stream.js
18928
18965
  /**
18929
18966
  * Describes effectful sources that emit values over time.
18930
18967
  *
@@ -19601,7 +19638,7 @@ var runForEachArray = /*#__PURE__*/ dual(2, (self, f) => runForEach$1(self.chann
19601
19638
  */
19602
19639
  var mkString = (self) => runFold(self.channel, () => "", (acc, chunk) => acc + chunk.join(""));
19603
19640
  //#endregion
19604
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/FileSystem.js
19641
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/FileSystem.js
19605
19642
  /**
19606
19643
  * Defines the portable file system service for Effect programs.
19607
19644
  *
@@ -19813,7 +19850,7 @@ var FileTypeId = "~effect/platform/FileSystem/File";
19813
19850
  */
19814
19851
  var WatchBackend = class extends Service$1()("effect/platform/FileSystem/WatchBackend") {};
19815
19852
  //#endregion
19816
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Path.js
19853
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Path.js
19817
19854
  /**
19818
19855
  * Provides path operations through the Effect environment.
19819
19856
  *
@@ -19907,7 +19944,7 @@ var TypeId$33 = "~effect/platform/Path";
19907
19944
  */
19908
19945
  var Path$1 = /*#__PURE__*/ Service$1("effect/Path");
19909
19946
  //#endregion
19910
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/schema/annotations.js
19947
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/schema/annotations.js
19911
19948
  /** @internal */
19912
19949
  function resolve(ast) {
19913
19950
  return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
@@ -19967,7 +20004,7 @@ var annotationExcludedKeys = /*#__PURE__*/ new Set([
19967
20004
  "toCodecIso"
19968
20005
  ]);
19969
20006
  //#endregion
19970
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/schema/parser.js
20007
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/schema/parser.js
19971
20008
  var missing = /*#__PURE__*/ Symbol();
19972
20009
  var succeed$1 = succeed$6;
19973
20010
  var missingExit = /*#__PURE__*/ succeed$1(missing);
@@ -19975,7 +20012,7 @@ var sameExit = /*#__PURE__*/ succeed$1(missing);
19975
20012
  var toOption = (value) => value === missing ? none() : some(value);
19976
20013
  var fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed$1(option.value);
19977
20014
  //#endregion
19978
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/SchemaIssue.js
20015
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/SchemaIssue.js
19979
20016
  var TypeId$32 = "~effect/SchemaIssue/Issue";
19980
20017
  /**
19981
20018
  * Returns `true` if the given value is an {@link Issue}.
@@ -20707,7 +20744,7 @@ function getMessageAnnotation(annotations, type = "message") {
20707
20744
  if (typeof message === "string") return message;
20708
20745
  }
20709
20746
  //#endregion
20710
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/schema/cause.js
20747
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/schema/cause.js
20711
20748
  /** @internal */
20712
20749
  function getSchemaIssue(cause) {
20713
20750
  let issue;
@@ -20724,7 +20761,7 @@ function getSchemaIssueOrThrow(cause, message) {
20724
20761
  return issue;
20725
20762
  }
20726
20763
  //#endregion
20727
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/DateTime.js
20764
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/DateTime.js
20728
20765
  /**
20729
20766
  * Checks whether a value is a `DateTime`.
20730
20767
  *
@@ -20955,7 +20992,7 @@ Service$1()("effect/DateTime/CurrentTimeZone");
20955
20992
  */
20956
20993
  var formatIso = formatIso$1;
20957
20994
  //#endregion
20958
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Encoding.js
20995
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Encoding.js
20959
20996
  /**
20960
20997
  * Encoding and decoding helpers for Base64, Base64Url, and hexadecimal text.
20961
20998
  * The functions convert between strings, UTF-8 text, and `Uint8Array` bytes.
@@ -21333,7 +21370,7 @@ var base64codes = [
21333
21370
  51
21334
21371
  ];
21335
21372
  //#endregion
21336
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/SchemaGetter.js
21373
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/SchemaGetter.js
21337
21374
  /**
21338
21375
  * Builds one-way conversions used by schemas.
21339
21376
  *
@@ -21832,7 +21869,7 @@ function decodeBase64() {
21832
21869
  return transformOrFail$1((input, options) => mapErrorEager(fromResult(decodeBase64$1(input)), () => new InvalidValue$1({ expected: "a valid Base64 string" }, input, options)));
21833
21870
  }
21834
21871
  //#endregion
21835
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/BigDecimal.js
21872
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/BigDecimal.js
21836
21873
  /**
21837
21874
  * Decimal numbers and arithmetic for cases where JavaScript `number` rounding
21838
21875
  * is not precise enough. A `BigDecimal` stores digits as a `bigint` plus a
@@ -22216,7 +22253,7 @@ var isZero = (n) => n.value === bigint0;
22216
22253
  */
22217
22254
  var isNegative = (n) => n.value < bigint0;
22218
22255
  //#endregion
22219
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/SchemaTransformation.js
22256
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/SchemaTransformation.js
22220
22257
  var TypeId$30 = "~effect/SchemaTransformation/Transformation";
22221
22258
  /**
22222
22259
  * Represents a bidirectional transformation between a decoded type `T` and an encoded
@@ -22610,7 +22647,7 @@ var dateTimeUtcFromString = /*#__PURE__*/ transformOrFail({
22610
22647
  encode: (utc) => succeed$4(formatIso(utc))
22611
22648
  });
22612
22649
  //#endregion
22613
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/SchemaAST.js
22650
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/SchemaAST.js
22614
22651
  /**
22615
22652
  * Represents Effect schemas as runtime trees.
22616
22653
  *
@@ -22698,13 +22735,6 @@ var isArrays = /*#__PURE__*/ makeGuard("Arrays");
22698
22735
  */
22699
22736
  var isObjects = /*#__PURE__*/ makeGuard("Objects");
22700
22737
  /**
22701
- * Narrows an {@link AST} to {@link Union}.
22702
- *
22703
- * @category guards
22704
- * @since 3.10.0
22705
- */
22706
- var isUnion = /*#__PURE__*/ makeGuard("Union");
22707
- /**
22708
22738
  * Narrows an {@link AST} to {@link Suspend}.
22709
22739
  *
22710
22740
  * @category guards
@@ -23911,7 +23941,7 @@ function tuple(elements, checks = void 0) {
23911
23941
  function union(members, mode, checks) {
23912
23942
  return new Union$1(members.map(getAST), mode, void 0, checks);
23913
23943
  }
23914
- var toCandidate = /*#__PURE__*/ memoize((ast) => {
23944
+ var toCandidate = /*#__PURE__*/ memoizeIdempotent((ast) => {
23915
23945
  while (true) {
23916
23946
  if (isSuspend(ast)) return unknown;
23917
23947
  const encoding = ast.encoding;
@@ -24409,6 +24439,11 @@ function modifyOwnPropertyDescriptors(ast, f) {
24409
24439
  f(d);
24410
24440
  return Object.create(Object.getPrototypeOf(ast), d);
24411
24441
  }
24442
+ var contextOwners = /*#__PURE__*/ new WeakMap();
24443
+ /** @internal */
24444
+ function getContextOwner(ast) {
24445
+ return contextOwners.get(ast) ?? ast;
24446
+ }
24412
24447
  /** @internal */
24413
24448
  function replaceEncoding(ast, encoding) {
24414
24449
  if (ast.encoding === encoding) return ast;
@@ -24419,9 +24454,13 @@ function replaceEncoding(ast, encoding) {
24419
24454
  /** @internal */
24420
24455
  function replaceContext(ast, context) {
24421
24456
  if (ast.context === context) return ast;
24422
- return modifyOwnPropertyDescriptors(ast, (d) => {
24457
+ const owner = getContextOwner(ast);
24458
+ if (owner.context === context) return owner;
24459
+ const out = modifyOwnPropertyDescriptors(ast, (d) => {
24423
24460
  d.context.value = context;
24424
24461
  });
24462
+ contextOwners.set(out, owner);
24463
+ return out;
24425
24464
  }
24426
24465
  /** @internal */
24427
24466
  function getLastEncoding(ast) {
@@ -24472,11 +24511,15 @@ function replaceContextLastLink(ast, context) {
24472
24511
  return applyToLastLink((ast) => replaceContext(ast, context))(ast);
24473
24512
  }
24474
24513
  /** @internal */
24475
- function applyToSelfOrLastLinkEncoding(f) {
24514
+ function applyToSelfOrLastLinkEncodingIdempotent(f, options) {
24476
24515
  function out(ast) {
24477
- return ast.encoding ? replaceEncoding(ast, updateLastLink(ast.encoding, out)) : f(ast);
24516
+ if (ast.encoding) {
24517
+ const last = ast.encoding[ast.encoding.length - 1];
24518
+ return options?.stopAt?.(last) ? ast : replaceEncoding(ast, updateLastLink(ast.encoding, out));
24519
+ }
24520
+ return f(ast);
24478
24521
  }
24479
- return memoize(out);
24522
+ return memoizeIdempotent(out);
24480
24523
  }
24481
24524
  function appendTransformation(from, transformation, to) {
24482
24525
  const link = new Link(from, transformation);
@@ -24500,24 +24543,13 @@ function annotateKey(ast, annotations) {
24500
24543
  ...annotations
24501
24544
  }) : new Context(false, false, void 0, annotations));
24502
24545
  }
24503
- var optionalKeyLastLink = /*#__PURE__*/ applyToLastLink(optionalKey$1);
24504
- /**
24505
- * Marks an AST node's property key as optional by setting
24506
- * {@link Context.isOptional} to `true`.
24507
- *
24508
- * **Details**
24509
- *
24510
- * Also propagates the optional flag through the last link of the encoding
24511
- * chain if present.
24512
- *
24513
- * @see {@link isOptional}
24514
- * @see {@link Context}
24515
- * @category transforming
24516
- * @since 4.0.0
24517
- */
24518
- function optionalKey$1(ast) {
24546
+ /** @internal */
24547
+ var optionalKey$1 = /*#__PURE__*/ memoizeIdempotent((ast) => {
24519
24548
  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)));
24520
- }
24549
+ });
24550
+ var optionalKeyLastLink = /*#__PURE__*/ applyToLastLink(optionalKey$1);
24551
+ /** @internal */
24552
+ var optional$4 = /*#__PURE__*/ memoize((ast) => optionalKey$1(new Union$1([ast, undefined_], "anyOf")));
24521
24553
  /** @internal */
24522
24554
  function withConstructorDefault$1(ast, defaultValue) {
24523
24555
  const constructorDefault = new Link(unknown, new Transformation(withDefault$2(defaultValue), passthrough$1()));
@@ -24629,7 +24661,7 @@ function extractStructuralChecks(checks) {
24629
24661
  * @category transforming
24630
24662
  * @since 4.0.0
24631
24663
  */
24632
- var toType$1 = /*#__PURE__*/ memoize((ast) => {
24664
+ var toType$1 = /*#__PURE__*/ memoizeIdempotent((ast) => {
24633
24665
  if (ast.encoding) return toType$1(replaceEncoding(ast, void 0));
24634
24666
  const out = ast;
24635
24667
  const type = out.recur?.(toType$1) ?? out;
@@ -24669,7 +24701,7 @@ var toType$1 = /*#__PURE__*/ memoize((ast) => {
24669
24701
  * @category transforming
24670
24702
  * @since 4.0.0
24671
24703
  */
24672
- var toEncoded$1 = /*#__PURE__*/ memoize((ast) => {
24704
+ var toEncoded$1 = /*#__PURE__*/ memoizeIdempotent((ast) => {
24673
24705
  return toType$1(flip(ast));
24674
24706
  });
24675
24707
  function flipEncoding(ast, encoding) {
@@ -24774,7 +24806,7 @@ function segmentTemplateLiteralParts(ast, input, options) {
24774
24806
  }
24775
24807
  return go(0, 0) ? out : void 0;
24776
24808
  }
24777
- var parameterFromPropertyKey = /*#__PURE__*/ applyToSelfOrLastLinkEncoding((ast) => {
24809
+ var parameterFromPropertyKey = /*#__PURE__*/ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
24778
24810
  switch (ast._tag) {
24779
24811
  default: return ast;
24780
24812
  case "Number": return ast.toCodecStringTree();
@@ -24782,7 +24814,7 @@ var parameterFromPropertyKey = /*#__PURE__*/ applyToSelfOrLastLinkEncoding((ast)
24782
24814
  }
24783
24815
  });
24784
24816
  /** @internal */
24785
- var parameterFromString = /*#__PURE__*/ applyToSelfOrLastLinkEncoding((ast) => {
24817
+ var parameterFromString = /*#__PURE__*/ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
24786
24818
  switch (ast._tag) {
24787
24819
  default: return ast;
24788
24820
  case "Symbol":
@@ -24790,7 +24822,7 @@ var parameterFromString = /*#__PURE__*/ applyToSelfOrLastLinkEncoding((ast) => {
24790
24822
  case "Union": return ast.recur(parameterFromString);
24791
24823
  }
24792
24824
  });
24793
- var partFromString = /*#__PURE__*/ applyToSelfOrLastLinkEncoding((ast) => {
24825
+ var partFromString = /*#__PURE__*/ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
24794
24826
  switch (ast._tag) {
24795
24827
  default: return ast;
24796
24828
  case "Number":
@@ -24965,7 +24997,7 @@ var unknownToStringTree = /*#__PURE__*/ new Link(/* @__PURE__ */ new Declaration
24965
24997
  toCodecStringTree: () => void 0
24966
24998
  }), /*#__PURE__*/ passthrough());
24967
24999
  //#endregion
24968
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Brand.js
25000
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Brand.js
24969
25001
  /**
24970
25002
  * Returns a `Constructor` that **does not apply any runtime checks** and just
24971
25003
  * returns the provided value.
@@ -24989,7 +25021,7 @@ function nominal() {
24989
25021
  });
24990
25022
  }
24991
25023
  //#endregion
24992
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/process/ChildProcessSpawner.js
25024
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/process/ChildProcessSpawner.js
24993
25025
  /**
24994
25026
  * Service boundary for starting and controlling child processes.
24995
25027
  *
@@ -25061,7 +25093,7 @@ var make$31 = (spawn) => {
25061
25093
  */
25062
25094
  var ChildProcessSpawner = class extends Service$1()("effect/process/ChildProcessSpawner") {};
25063
25095
  //#endregion
25064
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/process/ChildProcess.js
25096
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/process/ChildProcess.js
25065
25097
  /**
25066
25098
  * Describes child processes before they are started.
25067
25099
  *
@@ -25269,7 +25301,7 @@ var concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || prevT
25269
25301
  ...nextTokens.slice(1)
25270
25302
  ];
25271
25303
  //#endregion
25272
- //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.105_effect@4.0.0-beta.105/node_modules/@effect/platform-node-shared/dist/internal/utils.js
25304
+ //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.106_effect@4.0.0-beta.106/node_modules/@effect/platform-node-shared/dist/internal/utils.js
25273
25305
  /** @internal */
25274
25306
  var handleErrnoException = (module, method) => (err, [path]) => {
25275
25307
  let reason = "Unknown";
@@ -25304,7 +25336,7 @@ var handleErrnoException = (module, method) => (err, [path]) => {
25304
25336
  });
25305
25337
  };
25306
25338
  //#endregion
25307
- //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.105_effect@4.0.0-beta.105/node_modules/@effect/platform-node-shared/dist/NodeSink.js
25339
+ //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.106_effect@4.0.0-beta.106/node_modules/@effect/platform-node-shared/dist/NodeSink.js
25308
25340
  /**
25309
25341
  * Creates a `Sink` that writes chunks to a Node writable stream, respecting
25310
25342
  * backpressure, mapping writable errors with `onError`, and ending the stream
@@ -25369,7 +25401,7 @@ var pullIntoWritable = (options) => options.pull.pipe(flatMap$1((chunk) => {
25369
25401
  });
25370
25402
  }) : identity);
25371
25403
  //#endregion
25372
- //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.105_effect@4.0.0-beta.105/node_modules/@effect/platform-node-shared/dist/NodeStream.js
25404
+ //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.106_effect@4.0.0-beta.106/node_modules/@effect/platform-node-shared/dist/NodeStream.js
25373
25405
  /**
25374
25406
  * Adapters between Node streams and Effect streams, channels, and readables.
25375
25407
  *
@@ -25449,7 +25481,7 @@ var readableToPullUnsafe = (options) => {
25449
25481
  };
25450
25482
  var defaultOnError = (error) => new UnknownError$1(error);
25451
25483
  //#endregion
25452
- //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.105_effect@4.0.0-beta.105/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
25484
+ //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.106_effect@4.0.0-beta.106/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
25453
25485
  var toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
25454
25486
  var toPlatformError = (method, error, command) => {
25455
25487
  const { commands } = flattenCommand(command);
@@ -25847,7 +25879,7 @@ var flattenCommand = (command) => {
25847
25879
  };
25848
25880
  };
25849
25881
  //#endregion
25850
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Ref.js
25882
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Ref.js
25851
25883
  /**
25852
25884
  * Stores fiber-safe mutable state inside Effect programs.
25853
25885
  *
@@ -25956,7 +25988,7 @@ var make$28 = (value) => sync(() => makeUnsafe(value));
25956
25988
  */
25957
25989
  var updateAndGet = /*#__PURE__*/ dual(2, (self, f) => sync(() => self.ref.current = f(self.ref.current)));
25958
25990
  //#endregion
25959
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/SchemaParser.js
25991
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/SchemaParser.js
25960
25992
  /**
25961
25993
  * Runs schemas against real values.
25962
25994
  *
@@ -26280,7 +26312,7 @@ function makeParser$1(ast, compile, compileConstructorDefault, constructorDefaul
26280
26312
  };
26281
26313
  }
26282
26314
  //#endregion
26283
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/schema/schema.js
26315
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/schema/schema.js
26284
26316
  /** @internal */
26285
26317
  var TypeId$27 = "~effect/Schema/Schema";
26286
26318
  var SchemaProto = {
@@ -26310,7 +26342,7 @@ function make$26(ast, options) {
26310
26342
  return self;
26311
26343
  }
26312
26344
  //#endregion
26313
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Struct.js
26345
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Struct.js
26314
26346
  /**
26315
26347
  * Wraps a plain function as a {@link Lambda} value so it can be used with
26316
26348
  * {@link map}, {@link mapPick}, and {@link mapOmit}.
@@ -26349,14 +26381,14 @@ function make$26(ast, options) {
26349
26381
  */
26350
26382
  var lambda = (f) => f;
26351
26383
  //#endregion
26352
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/errors.js
26384
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/errors.js
26353
26385
  /** @internal */
26354
26386
  function errorWithPath(message, path) {
26355
26387
  if (path.length > 0) message += `\n at ${formatPath(path)}`;
26356
26388
  return new Error(message);
26357
26389
  }
26358
26390
  //#endregion
26359
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/JsonPointer.js
26391
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/JsonPointer.js
26360
26392
  /**
26361
26393
  * Helpers for escaping and unescaping JSON Pointer path segments. JSON Pointer
26362
26394
  * uses `/` to separate path tokens inside a JSON document, so token text must
@@ -26400,6 +26432,109 @@ function errorWithPath(message, path) {
26400
26432
  function escapeToken(token) {
26401
26433
  return token.replace(/~/g, "~0").replace(/\//g, "~1");
26402
26434
  }
26435
+ /**
26436
+ * Decodes a JSON Pointer reference token according to RFC 6901 escaping rules.
26437
+ *
26438
+ * **When to use**
26439
+ *
26440
+ * Use when you need to decode a single escaped JSON Pointer path segment.
26441
+ *
26442
+ * **Details**
26443
+ *
26444
+ * - Returns a new unescaped string
26445
+ * - Replaces `~1` with `/` (forward slash) and `~0` with `~` (tilde)
26446
+ * - Returns the input unchanged if it contains no escaped sequences
26447
+ * - Empty strings are valid and returned unchanged
26448
+ *
26449
+ * **Gotchas**
26450
+ *
26451
+ * The replacement order matters: `~1` is replaced before `~0` to prevent incorrect decoding.
26452
+ *
26453
+ * **Example** (Unescaping special characters)
26454
+ *
26455
+ * ```ts import.meta.vitest
26456
+ * import { JsonPointer } from "effect"
26457
+ *
26458
+ * JsonPointer.unescapeToken("a~1b") // => "a/b"
26459
+ * JsonPointer.unescapeToken("c~0d") // => "c~d"
26460
+ * JsonPointer.unescapeToken("path~1to~0key") // => "path/to~key"
26461
+ * ```
26462
+ *
26463
+ * @see {@link escapeToken} The inverse operation for encoding tokens
26464
+ * @category decoding
26465
+ * @since 4.0.0
26466
+ */
26467
+ function unescapeToken(token) {
26468
+ return token.replace(/~1/g, "/").replace(/~0/g, "~");
26469
+ }
26470
+ [.../* @__PURE__ */ new Set([
26471
+ "$ref",
26472
+ "type",
26473
+ "required",
26474
+ "enum",
26475
+ "title",
26476
+ "description",
26477
+ "default",
26478
+ "format",
26479
+ "pattern",
26480
+ "minLength",
26481
+ "maxLength",
26482
+ "minItems",
26483
+ "maxItems",
26484
+ "minProperties",
26485
+ "maxProperties",
26486
+ "multipleOf",
26487
+ "uniqueItems"
26488
+ ])];
26489
+ function transformSchema(node, transform) {
26490
+ return walk(node);
26491
+ function walk(node) {
26492
+ if (!isObject(node)) return node;
26493
+ const out = {};
26494
+ for (const key of Object.keys(node)) {
26495
+ const value = node[key];
26496
+ let transformed = value;
26497
+ switch (key) {
26498
+ case "$defs":
26499
+ case "properties":
26500
+ case "patternProperties":
26501
+ case "dependentSchemas":
26502
+ transformed = mapObject(value, walk) ?? value;
26503
+ break;
26504
+ case "allOf":
26505
+ case "anyOf":
26506
+ case "oneOf":
26507
+ case "prefixItems":
26508
+ transformed = Array.isArray(value) ? value.map(walk) : value;
26509
+ break;
26510
+ case "not":
26511
+ case "additionalProperties":
26512
+ case "propertyNames":
26513
+ case "unevaluatedProperties":
26514
+ case "items":
26515
+ case "contains":
26516
+ case "unevaluatedItems":
26517
+ case "if":
26518
+ case "then":
26519
+ case "else":
26520
+ case "contentSchema": transformed = walk(value);
26521
+ }
26522
+ assignProperty(out, key, transformed);
26523
+ }
26524
+ return transform(out);
26525
+ }
26526
+ }
26527
+ /** @internal */
26528
+ function rewriteRefs(schema, rewrite) {
26529
+ return transformSchema(schema, (schema) => rewriteSchemaRef(schema, rewrite));
26530
+ }
26531
+ function rewriteSchemaRef(schema, rewrite) {
26532
+ if (typeof schema.$ref === "string") assignProperty(schema, "$ref", rewrite(schema.$ref));
26533
+ return schema;
26534
+ }
26535
+ function mapObject(value, f) {
26536
+ return isObject(value) ? map$11(value, f) : void 0;
26537
+ }
26403
26538
  globalThis.RegExp;
26404
26539
  /**
26405
26540
  * Escapes special characters in a regular expression pattern.
@@ -26421,12 +26556,14 @@ globalThis.RegExp;
26421
26556
  */
26422
26557
  var escape = (string) => string.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
26423
26558
  //#endregion
26424
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
26559
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
26425
26560
  var jsonSchemaAnnotationExcludedKeys = /*#__PURE__*/ new Set([
26426
26561
  ...annotationExcludedKeys,
26427
26562
  IDENTIFIER_FALLBACK_KEY,
26428
26563
  ...jsonSchemaAnnotationKeys
26429
26564
  ]);
26565
+ /** @internal */
26566
+ var toRepresentationOptions = { isAnonymousReferenceAllowed: (ast) => !isDeclaration(ast) };
26430
26567
  function collectJsonSchemaAnnotations(annotations, options) {
26431
26568
  if (annotations === void 0) return void 0;
26432
26569
  const out = {};
@@ -26522,19 +26659,21 @@ function appendJsonSchema(left, right) {
26522
26659
  };
26523
26660
  }
26524
26661
  function compileJsonSchema(representations, rootPaths, references, options) {
26525
- const definitions = {};
26526
26662
  const definitionStates = /* @__PURE__ */ new Map();
26527
26663
  const compiledRepresentations = /* @__PURE__ */ new WeakMap();
26528
26664
  const fallbackDefinitions = /* @__PURE__ */ new Map();
26665
+ let hasAliases = false;
26529
26666
  const referenceKeys = Object.keys(references);
26530
26667
  for (const key of referenceKeys) compileDefinition(key, ["references", key]);
26668
+ const schemas = map$10(representations, (representation, index) => finalizeJsonSchema(recur(representation, rootPaths[index])));
26669
+ const definitions = {};
26531
26670
  for (const key of referenceKeys) {
26532
26671
  const compiled = definitionStates.get(key);
26533
- if (typeof compiled !== "string") assignProperty(definitions, key, compiled);
26672
+ if (typeof compiled !== "string") assignProperty(definitions, key, finalizeJsonSchema(compiled));
26534
26673
  }
26535
26674
  return {
26536
26675
  dialect: "draft-2020-12",
26537
- schemas: map$10(representations, (representation, index) => recur(representation, rootPaths[index])),
26676
+ schemas,
26538
26677
  definitions
26539
26678
  };
26540
26679
  function compileDefinition(key, path) {
@@ -26551,6 +26690,7 @@ function compileJsonSchema(representations, rootPaths, references, options) {
26551
26690
  if (match === void 0) if (candidates === void 0) fallbackDefinitions.set(fallback, [key]);
26552
26691
  else candidates.push(key);
26553
26692
  else {
26693
+ hasAliases = true;
26554
26694
  definitionStates.set(key, match);
26555
26695
  return match;
26556
26696
  }
@@ -26558,6 +26698,13 @@ function compileJsonSchema(representations, rootPaths, references, options) {
26558
26698
  definitionStates.set(key, schema);
26559
26699
  return key;
26560
26700
  }
26701
+ function finalizeJsonSchema(schema) {
26702
+ if (!hasAliases) return schema;
26703
+ return rewriteRefs(schema, ($ref) => $ref.replace(/^#\/\$defs\/([^/]*)/, (match, token) => {
26704
+ const canonical = definitionStates.get(unescapeToken(token));
26705
+ return typeof canonical === "string" ? `#/$defs/${escapeToken(canonical)}` : match;
26706
+ }));
26707
+ }
26561
26708
  function getIdentifierFallback(representation) {
26562
26709
  if (representation._tag === "Reference") return void 0;
26563
26710
  const annotations = representation.checks.length === 0 ? representation.annotations : representation.checks[representation.checks.length - 1].annotations;
@@ -26854,24 +27001,46 @@ function toJsonSchemaDocument$1(document, options) {
26854
27001
  };
26855
27002
  }
26856
27003
  //#endregion
26857
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/schema/toRepresentation.js
27004
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/schema/toRepresentation.js
26858
27005
  /** @internal */
26859
- function toRepresentation(ast) {
26860
- const { references, representations } = toRepresentations([ast]);
27006
+ function toRepresentation(ast, options) {
27007
+ const { references, representations } = toRepresentations([ast], options);
26861
27008
  return {
26862
27009
  representation: representations[0],
26863
27010
  references
26864
27011
  };
26865
27012
  }
26866
27013
  /** @internal */
26867
- function toRepresentations(asts) {
26868
- return fromASTs(asts);
27014
+ function toRepresentations(asts, options) {
27015
+ return fromASTs(asts, options);
26869
27016
  }
26870
27017
  function annotationsField(annotations) {
26871
27018
  return annotations === void 0 ? void 0 : { annotations };
26872
27019
  }
26873
- function isShareable(ast) {
26874
- return isArrays(ast) || isObjects(ast) || isUnion(ast) && ast.types.some(isShareable);
27020
+ function hasShareableStructure(ast, isAnonymousReferenceAllowed) {
27021
+ if (isAnonymousReferenceAllowed?.(ast) === false) return false;
27022
+ switch (ast._tag) {
27023
+ case "Arrays":
27024
+ case "Objects":
27025
+ case "Suspend": return true;
27026
+ case "Declaration": return true;
27027
+ case "Union": return ast.types.some((ast) => hasShareableStructure(ast, isAnonymousReferenceAllowed));
27028
+ default: return false;
27029
+ }
27030
+ }
27031
+ function isWorthReferencing(bodyCost, occurrences) {
27032
+ return occurrences * bodyCost > bodyCost + occurrences + 1;
27033
+ }
27034
+ function isAnonymousReferenceEligible(ast, occurrences, isAnonymousReferenceAllowed) {
27035
+ if (isAnonymousReferenceAllowed?.(ast) === false) return false;
27036
+ if (hasShareableStructure(ast, isAnonymousReferenceAllowed)) return true;
27037
+ switch (ast._tag) {
27038
+ case "Union": return isWorthReferencing(ast.types.length + 1, occurrences);
27039
+ case "Enum": return isWorthReferencing(ast.enums.length + 1, occurrences);
27040
+ case "TemplateLiteral": return isWorthReferencing(ast.parts.length + 1, occurrences);
27041
+ case "Literal": return typeof ast.literal === "string" && isWorthReferencing(ast.literal.length / 32 + 1, occurrences);
27042
+ default: return false;
27043
+ }
26875
27044
  }
26876
27045
  function resolveReferenceIdentifier(input, encoded) {
26877
27046
  const identifier = resolveIdentifier(encoded);
@@ -26882,16 +27051,13 @@ function resolveReferenceIdentifier(input, encoded) {
26882
27051
  fallback
26883
27052
  };
26884
27053
  }
26885
- function fromASTs(asts) {
27054
+ function fromASTs(asts, options) {
26886
27055
  const references = {};
26887
27056
  const anonymousReferences = /* @__PURE__ */ new Map();
26888
27057
  const referenceOwners = /* @__PURE__ */ new Map();
26889
- const valueIds = /* @__PURE__ */ new Map();
26890
- const canonicalByKey = /* @__PURE__ */ new Map();
26891
- let nextValueId = 0;
26892
27058
  const buildingReferences = /* @__PURE__ */ new Set();
26893
27059
  const visiting = /* @__PURE__ */ new Set();
26894
- const visited = /* @__PURE__ */ new Set();
27060
+ const occurrences = /* @__PURE__ */ new Map();
26895
27061
  const shared = /* @__PURE__ */ new Set();
26896
27062
  for (const ast of asts) visit(ast);
26897
27063
  return {
@@ -26908,28 +27074,6 @@ function fromASTs(asts) {
26908
27074
  referenceOwners.set(candidate, owner);
26909
27075
  return candidate;
26910
27076
  }
26911
- function getValueId(value) {
26912
- if (typeof value === "number" && globalThis.Number.isNaN(value)) return nextValueId++;
26913
- const found = valueIds.get(value);
26914
- if (found !== void 0) return found;
26915
- const id = nextValueId++;
26916
- valueIds.set(value, id);
26917
- return id;
26918
- }
26919
- function getIdentityKey(ast) {
26920
- let identity = ast._tag;
26921
- for (const [key, value] of Object.entries(ast)) if (key !== "_tag" && key !== "context") identity += `:${getValueId(value)}`;
26922
- return identity;
26923
- }
26924
- function getCanonicalAST(ast) {
26925
- const key = getIdentityKey(ast);
26926
- const canonical = canonicalByKey.get(key);
26927
- if (canonical === void 0) {
26928
- canonicalByKey.set(key, ast);
26929
- return ast;
26930
- }
26931
- return canonical;
26932
- }
26933
27077
  function annotateReference(ast, referenceIdentifier, reference) {
26934
27078
  const fallback = referenceIdentifier.fallback;
26935
27079
  if (fallback !== void 0) return resolveIdentifierFallback(ast) === fallback ? ast : annotate$1(ast, { [IDENTIFIER_FALLBACK_KEY]: fallback });
@@ -26949,12 +27093,13 @@ function fromASTs(asts) {
26949
27093
  }
26950
27094
  function visit(input) {
26951
27095
  const ast = getLastEncoding(input);
26952
- const owner = getCanonicalAST(ast);
26953
- if (visited.has(owner)) {
26954
- if (isShareable(ast)) shared.add(owner);
27096
+ const owner = getContextOwner(ast);
27097
+ const count = (occurrences.get(owner) ?? 0) + 1;
27098
+ occurrences.set(owner, count);
27099
+ if (count > 1) {
27100
+ if (!shared.has(owner) && isAnonymousReferenceEligible(owner, count, options?.isAnonymousReferenceAllowed)) shared.add(owner);
26955
27101
  return;
26956
27102
  }
26957
- visited.add(owner);
26958
27103
  visitChecks(ast.checks);
26959
27104
  switch (ast._tag) {
26960
27105
  case "Declaration":
@@ -26980,7 +27125,7 @@ function fromASTs(asts) {
26980
27125
  }
26981
27126
  function recur(input) {
26982
27127
  const ast = getLastEncoding(input);
26983
- const owner = getCanonicalAST(ast);
27128
+ const owner = getContextOwner(ast);
26984
27129
  const referenceIdentifier = resolveReferenceIdentifier(input, ast);
26985
27130
  if (referenceIdentifier !== void 0) {
26986
27131
  const reference = getReference(referenceIdentifier.identifier, owner);
@@ -27151,7 +27296,7 @@ function fromASTs(asts) {
27151
27296
  }
27152
27297
  }
27153
27298
  //#endregion
27154
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/internal/redacted.js
27299
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/internal/redacted.js
27155
27300
  /** @internal */
27156
27301
  var redactedRegistry = /*#__PURE__*/ new WeakMap();
27157
27302
  /** @internal */
@@ -27160,7 +27305,7 @@ var value$1 = (self) => {
27160
27305
  else throw new Error("Unable to get redacted value" + (self.label ? ` with label: "${self.label}"` : ""));
27161
27306
  };
27162
27307
  //#endregion
27163
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Redacted.js
27308
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Redacted.js
27164
27309
  /**
27165
27310
  * Wraps sensitive values so normal output does not reveal them.
27166
27311
  *
@@ -27303,7 +27448,7 @@ var value = value$1;
27303
27448
  */
27304
27449
  var makeEquivalence = (isEquivalent) => make$50((x, y) => isEquivalent(value(x), value(y)));
27305
27450
  //#endregion
27306
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/SchemaError.js
27451
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/SchemaError.js
27307
27452
  /**
27308
27453
  * @since 4.0.0
27309
27454
  */
@@ -27362,7 +27507,7 @@ function isSchemaError(u) {
27362
27507
  return hasProperty(u, TypeId$25) && u[TypeId$25] === TypeId$25;
27363
27508
  }
27364
27509
  //#endregion
27365
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Schema.js
27510
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Schema.js
27366
27511
  var TypeId$24 = TypeId$27;
27367
27512
  /**
27368
27513
  * Creates a schema for a **parametric** type (a generic container such as
@@ -27833,7 +27978,10 @@ var optionalKey = /*#__PURE__*/ lambda((schema) => make$24(optionalKey$1(schema.
27833
27978
  * @category combinators
27834
27979
  * @since 3.10.0
27835
27980
  */
27836
- var optional$3 = /*#__PURE__*/ lambda((self) => optionalKey(UndefinedOr(self)));
27981
+ var optional$3 = /*#__PURE__*/ lambda((self) => {
27982
+ const schema = UndefinedOr(self);
27983
+ return make$24(optional$4(self.ast), { schema });
27984
+ });
27837
27985
  /**
27838
27986
  * Extracts the type-side schema: sets `Encoded` to equal the decoded `Type`,
27839
27987
  * discarding the encoding transformation path.
@@ -28295,7 +28443,7 @@ function decodeTo(to, transformation) {
28295
28443
  * ```
28296
28444
  *
28297
28445
  * @category transforming
28298
- * @since 3.10.0
28446
+ * @since 4.0.0
28299
28447
  */
28300
28448
  function decode$1(transformation) {
28301
28449
  return (self) => {
@@ -29514,7 +29662,7 @@ var TaggedError = (identifier) => {
29514
29662
  * @since 4.0.0
29515
29663
  */
29516
29664
  function toJsonSchemaDocument(schema, options) {
29517
- return toJsonSchemaDocument$1(toRepresentation(toCodecJsonAST(schema.ast)), options);
29665
+ return toJsonSchemaDocument$1(toRepresentation(toCodecJsonAST(schema.ast), toRepresentationOptions), options);
29518
29666
  }
29519
29667
  /**
29520
29668
  * Derives a canonical JSON codec from a schema. The encoded form is `Json`, and
@@ -29535,12 +29683,12 @@ function toCodecJson(schema) {
29535
29683
  return make$24(toCodecJsonAST(schema.ast), { schema });
29536
29684
  }
29537
29685
  /** @internal */
29538
- var toCodecJsonAST = /*#__PURE__*/ memoize(/* @__PURE__ */ applyToSelfOrLastLinkEncoding((ast) => {
29539
- const out = toCodecJsonBase(ast, toCodecJsonAST);
29686
+ var toCodecJsonAST = /*#__PURE__*/ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
29687
+ const out = toCodecJsonASTStep(ast, toCodecJsonAST);
29540
29688
  const context = ast.context;
29541
29689
  if (out === ast || context === void 0) return out;
29542
29690
  return replaceContextLastLink(out, withoutConstructorDefault(context));
29543
- }));
29691
+ });
29544
29692
  function withoutConstructorDefault(context) {
29545
29693
  return context.constructorDefault === void 0 ? context : new Context(context.isOptional, context.isMutable, void 0, context.annotations);
29546
29694
  }
@@ -29571,7 +29719,7 @@ var toCodecJsonReorder = /*#__PURE__*/ makeReorder((ast) => {
29571
29719
  default: return 1;
29572
29720
  }
29573
29721
  });
29574
- function toCodecJsonBase(ast, recur) {
29722
+ function toCodecJsonASTStep(ast, recur) {
29575
29723
  switch (ast._tag) {
29576
29724
  case "Declaration": {
29577
29725
  const getLink = ast.annotations?.toCodecJson ?? ast.annotations?.toCodec;
@@ -29615,7 +29763,7 @@ function toCodecJsonBase(ast, recur) {
29615
29763
  * @since 4.0.0
29616
29764
  */
29617
29765
  function toCodecStringTree(schema) {
29618
- return make$24(serializerStringTree(schema.ast), { schema });
29766
+ return make$24(toCodecStringTreeAST(schema.ast), { schema });
29619
29767
  }
29620
29768
  var toStringTreeReorder = /*#__PURE__*/ makeReorder((ast) => {
29621
29769
  switch (ast._tag) {
@@ -29628,7 +29776,7 @@ var toStringTreeReorder = /*#__PURE__*/ makeReorder((ast) => {
29628
29776
  default: return 1;
29629
29777
  }
29630
29778
  });
29631
- function serializerTree(ast, recur, onMissingAnnotation) {
29779
+ function toCodecStringTreeASTStep(ast, recur, onMissingAnnotation) {
29632
29780
  switch (ast._tag) {
29633
29781
  case "Declaration": {
29634
29782
  const typeParameters = ast.typeParameters.map((tp) => make$24(recur(toEncoded$1(tp))));
@@ -29669,16 +29817,15 @@ function serializerTree(ast, recur, onMissingAnnotation) {
29669
29817
  }
29670
29818
  var nullToString = /*#__PURE__*/ new Link(/*#__PURE__*/ new Literal$1("null"), /*#__PURE__*/ new Transformation(/*#__PURE__*/ transform$2(() => null), /*#__PURE__*/ transform$2(() => "null")));
29671
29819
  var 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()));
29672
- var SERIALIZER_ENSURE_ARRAY = "~effect/Schema/SERIALIZER_ENSURE_ARRAY";
29673
- var isSerializerArrayFromSingle = (ast) => isUnion(ast) && ast.annotations?.[SERIALIZER_ENSURE_ARRAY] === true;
29674
- var serializerStringTree = /*#__PURE__*/ applyToSelfOrLastLinkEncoding((ast) => {
29675
- if (isSerializerArrayFromSingle(ast)) return ast;
29676
- const out = serializerTree(ast, serializerStringTree, (ast) => {
29820
+ var arrayFromSingleTransformation = /*#__PURE__*/ new Transformation(/*#__PURE__*/ transform$2((input) => typeof input === "string" ? [input] : input), /*#__PURE__*/ passthrough$1());
29821
+ var isCodecArrayFromSingleLink = (link) => link.transformation === arrayFromSingleTransformation;
29822
+ var toCodecStringTreeAST = /*#__PURE__*/ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
29823
+ const out = toCodecStringTreeASTStep(ast, toCodecStringTreeAST, (ast) => {
29677
29824
  throw new globalThis.Error("Missing structural codec for StringTree", { cause: ast });
29678
29825
  });
29679
29826
  if (out !== ast && ast.context !== void 0) return replaceContextLastLink(out, withoutConstructorDefault(ast.context));
29680
29827
  return out;
29681
- });
29828
+ }, { stopAt: isCodecArrayFromSingleLink });
29682
29829
  /**
29683
29830
  * Schema that accepts and validates any immutable JSON-compatible value.
29684
29831
  *
@@ -29709,7 +29856,7 @@ var MutableJson = /*#__PURE__*/ make$24(/*#__PURE__*/ annotate$1(MutableJson$1,
29709
29856
  Type: "Schema.MutableJson"
29710
29857
  }) }));
29711
29858
  //#endregion
29712
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/Cookies.js
29859
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/Cookies.js
29713
29860
  /**
29714
29861
  * Models HTTP cookies and cookie collections for requests and responses.
29715
29862
  *
@@ -29767,7 +29914,7 @@ var fromIterable = (cookies) => {
29767
29914
  var empty$3 = /*#__PURE__*/ fromIterable([]);
29768
29915
  ({ ...BaseProto });
29769
29916
  //#endregion
29770
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/Headers.js
29917
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/Headers.js
29771
29918
  /**
29772
29919
  * Models HTTP headers for the unstable HTTP client and server modules.
29773
29920
  *
@@ -29950,7 +30097,7 @@ var CurrentRedactedNames = /*#__PURE__*/ Reference("effect/Headers/CurrentRedact
29950
30097
  ] });
29951
30098
  ({ ...PipeInspectableProto });
29952
30099
  //#endregion
29953
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/HttpBody.js
30100
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/HttpBody.js
29954
30101
  /**
29955
30102
  * Describes HTTP request and response bodies before they reach a platform
29956
30103
  * adapter.
@@ -30005,7 +30152,7 @@ var Empty$1 = class extends Proto$9 {
30005
30152
  */
30006
30153
  var empty$1 = /*#__PURE__*/ new Empty$1();
30007
30154
  //#endregion
30008
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/HttpClientError.js
30155
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/HttpClientError.js
30009
30156
  /**
30010
30157
  * Typed failure model for Effect HTTP client operations.
30011
30158
  *
@@ -30038,7 +30185,7 @@ Error$1(TypeId$19)({
30038
30185
  cause: /*#__PURE__*/ optional$3(/*#__PURE__*/ Defect())
30039
30186
  });
30040
30187
  //#endregion
30041
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/FindMyWay/internal/queryString.js
30188
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/FindMyWay/internal/queryString.js
30042
30189
  /**
30043
30190
  * @since 1.0.0
30044
30191
  */
@@ -30103,7 +30250,7 @@ function parse$2(input) {
30103
30250
  return result;
30104
30251
  }
30105
30252
  //#endregion
30106
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/FindMyWay/internal/router.js
30253
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/FindMyWay/internal/router.js
30107
30254
  var FULL_PATH_REGEXP = /^https?:\/\/.*?\//;
30108
30255
  var OPTIONAL_PARAM_REGEXP = /(\/:[^/()]*?)\?(\/?)/;
30109
30256
  /** @internal */
@@ -30652,7 +30799,7 @@ var httpMethods = [
30652
30799
  "UNSUBSCRIBE"
30653
30800
  ];
30654
30801
  //#endregion
30655
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/FindMyWay.js
30802
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/FindMyWay.js
30656
30803
  /**
30657
30804
  * A radix-tree HTTP router used by the unstable HTTP routing modules.
30658
30805
  *
@@ -30693,7 +30840,7 @@ var make$20 = make$21;
30693
30840
  */
30694
30841
  var isGreaterThanOrEqualTo = /*#__PURE__*/ isGreaterThanOrEqualTo$2(LogLevelOrder);
30695
30842
  //#endregion
30696
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/ErrorReporter.js
30843
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/ErrorReporter.js
30697
30844
  /**
30698
30845
  * Defines the runtime property key used to mark an object error as ignored by error
30699
30846
  * reporting.
@@ -30730,7 +30877,7 @@ var isGreaterThanOrEqualTo = /*#__PURE__*/ isGreaterThanOrEqualTo$2(LogLevelOrde
30730
30877
  */
30731
30878
  var ignore = "~effect/ErrorReporter/ignore";
30732
30879
  //#endregion
30733
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/HttpServerResponse.js
30880
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/HttpServerResponse.js
30734
30881
  var TypeId$16 = "~effect/http/HttpServerResponse";
30735
30882
  /**
30736
30883
  * Creates an empty HTTP response.
@@ -30819,7 +30966,7 @@ TaggedError$1("MultipartError");
30819
30966
  var HttpServerRequest = /*#__PURE__*/ Service$1("effect/http/HttpServerRequest");
30820
30967
  Service$1()("effect/http/ParsedSearchParams");
30821
30968
  //#endregion
30822
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/internal/preResponseHandler.js
30969
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/internal/preResponseHandler.js
30823
30970
  /** @internal */
30824
30971
  var requestPreResponseHandlers = /*#__PURE__*/ new WeakMap();
30825
30972
  /** @internal */
@@ -30829,7 +30976,7 @@ var appendPreResponseHandlerUnsafe$1 = (request, handler) => {
30829
30976
  requestPreResponseHandlers.set(request.source, next);
30830
30977
  };
30831
30978
  //#endregion
30832
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/HttpMiddleware.js
30979
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/HttpMiddleware.js
30833
30980
  var loggerDisabledRequests = /*#__PURE__*/ new WeakSet();
30834
30981
  /**
30835
30982
  * Runs an effect with HTTP response logging disabled for the current server request.
@@ -30843,7 +30990,7 @@ var withLoggerDisabled = (self) => withFiber((fiber) => {
30843
30990
  return self;
30844
30991
  });
30845
30992
  //#endregion
30846
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/HttpEffect.js
30993
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/HttpEffect.js
30847
30994
  /**
30848
30995
  * Registers a pre-response handler for the supplied HTTP server request.
30849
30996
  *
@@ -30852,7 +30999,7 @@ var withLoggerDisabled = (self) => withFiber((fiber) => {
30852
30999
  */
30853
31000
  var appendPreResponseHandlerUnsafe = appendPreResponseHandlerUnsafe$1;
30854
31001
  //#endregion
30855
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/http/HttpRouter.js
31002
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/http/HttpRouter.js
30856
31003
  /**
30857
31004
  * Builds server-side routers for Effect HTTP applications.
30858
31005
  *
@@ -30978,7 +31125,7 @@ var getMiddleware = (context) => {
30978
31125
  };
30979
31126
  (/*#__PURE__*/ middleware(withLoggerDisabled)).layer;
30980
31127
  //#endregion
30981
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/workers/Transferable.js
31128
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/workers/Transferable.js
30982
31129
  /**
30983
31130
  * Marks encoded worker message fields that should move through `postMessage` as
30984
31131
  * transfer-list entries.
@@ -31027,7 +31174,7 @@ var makeCollectorUnsafe = () => {
31027
31174
  });
31028
31175
  };
31029
31176
  //#endregion
31030
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/PrimaryKey.js
31177
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/PrimaryKey.js
31031
31178
  /**
31032
31179
  * Defines the unique identifier used to identify objects that implement the `PrimaryKey` interface.
31033
31180
  *
@@ -31045,7 +31192,7 @@ var makeCollectorUnsafe = () => {
31045
31192
  */
31046
31193
  var symbol = "~effect/interfaces/PrimaryKey";
31047
31194
  //#endregion
31048
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/RpcSchema.js
31195
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/RpcSchema.js
31049
31196
  /**
31050
31197
  * RPC schema markers and interruption annotations.
31051
31198
  *
@@ -31104,7 +31251,7 @@ var ClientAbort = class extends Service$1()("effect/rpc/RpcSchema/ClientAbort")
31104
31251
  }));
31105
31252
  };
31106
31253
  //#endregion
31107
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/Rpc.js
31254
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/Rpc.js
31108
31255
  var TypeId$12 = "~effect/rpc/Rpc";
31109
31256
  /**
31110
31257
  * Represents server-side metadata for the client associated with an RPC request.
@@ -31291,7 +31438,7 @@ var WrapperTypeId = "~effect/rpc/Rpc/Wrapper";
31291
31438
  */
31292
31439
  var isWrapper = (u) => WrapperTypeId in u;
31293
31440
  //#endregion
31294
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/RpcMessage.js
31441
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/RpcMessage.js
31295
31442
  /**
31296
31443
  * Converts a bigint or string request id into the branded `RequestId` type.
31297
31444
  *
@@ -33149,7 +33296,7 @@ defaultPackr.pack;
33149
33296
  defaultPackr.pack;
33150
33297
  var { NEVER, ALWAYS, DECIMAL_ROUND, DECIMAL_FIT } = FLOAT32_OPTIONS;
33151
33298
  //#endregion
33152
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/RpcSerialization.js
33299
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/RpcSerialization.js
33153
33300
  /**
33154
33301
  * Service that describes how RPC protocol messages are encoded and decoded,
33155
33302
  * including the content type and whether the serialization format provides
@@ -33418,7 +33565,7 @@ function encodeJsonRpcMessage(response) {
33418
33565
  }
33419
33566
  var jsonRpcInternalError = -32603;
33420
33567
  //#endregion
33421
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/Utils.js
33568
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/Utils.js
33422
33569
  /**
33423
33570
  * Builds a service with a `run` method that buffers writes until `run` installs
33424
33571
  * a writer, replays buffered writes with their original contexts, and restores
@@ -33496,7 +33643,7 @@ var withRunClient = (f) => suspend$2(() => {
33496
33643
  }));
33497
33644
  });
33498
33645
  //#endregion
33499
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/RpcClient.js
33646
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/RpcClient.js
33500
33647
  var requestIdCounter = 0;
33501
33648
  /**
33502
33649
  * Creates an RPC client for an already-decoded message channel, returning the
@@ -33862,7 +34009,7 @@ var Protocol$1 = class extends Service$1()("effect/rpc/RpcClient/Protocol") {
33862
34009
  Service$1()("effect/rpc/RpcClient/ConnectionHooks");
33863
34010
  var decodeDefect = /*#__PURE__*/ decodeSync(/*#__PURE__*/ Defect());
33864
34011
  //#endregion
33865
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Stdio.js
34012
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Stdio.js
33866
34013
  /**
33867
34014
  * Service contract for command-line arguments and standard input, output, and
33868
34015
  * error output. It lets programs depend on standard I/O through the Effect
@@ -33930,7 +34077,7 @@ var make$13 = (options) => ({
33930
34077
  ...options
33931
34078
  });
33932
34079
  //#endregion
33933
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/RpcServer.js
34080
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/RpcServer.js
33934
34081
  /**
33935
34082
  * Creates an RPC server for an already-decoded message channel, running
33936
34083
  * handlers for a group and sending decoded server responses through
@@ -34392,7 +34539,7 @@ var layerProtocolStdio = /*#__PURE__*/ effect(Protocol, /* @__PURE__ */ gen(func
34392
34539
  }));
34393
34540
  }));
34394
34541
  //#endregion
34395
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/RpcGroup.js
34542
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/RpcGroup.js
34396
34543
  var RpcGroupProto = {
34397
34544
  add(...rpcs) {
34398
34545
  const requests = new Map(this.requests);
@@ -34526,7 +34673,7 @@ var make$11 = (...rpcs) => makeProto$1({
34526
34673
  annotations: empty$8()
34527
34674
  });
34528
34675
  //#endregion
34529
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/ConfigProvider.js
34676
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/ConfigProvider.js
34530
34677
  /**
34531
34678
  * Data sources used by `Config` to load raw configuration values. A
34532
34679
  * `ConfigProvider` reads paths from places such as environment variables,
@@ -34750,13 +34897,45 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
34750
34897
  return value === "" && !preserveEmptyStrings ? void 0 : value;
34751
34898
  }
34752
34899
  /**
34900
+ * Creates a `ConfigProvider` backed by an explicit environment record.
34901
+ *
34902
+ * **When to use**
34903
+ *
34904
+ * Use when a restricted runtime cannot evaluate the automatic environment
34905
+ * detection performed by {@link fromEnv}, or whenever the environment record
34906
+ * must be supplied explicitly.
34907
+ *
34908
+ * **Details**
34909
+ *
34910
+ * `undefined` values are ignored. Path lookup and child discovery otherwise
34911
+ * use the same environment-variable semantics as {@link fromEnv}.
34912
+ *
34913
+ * Environment variable names are captured at construction time to establish
34914
+ * record keys and array lengths. The supplied record remains live for value
34915
+ * lookups, so updates to known paths are observed by later loads. Keys added
34916
+ * after construction can be loaded directly, but do not appear in captured
34917
+ * parent record keys or array lengths.
34918
+ *
34919
+ * Literal empty strings are treated as missing values by default. Pass
34920
+ * `{ preserveEmptyStrings: true }` to keep empty strings as explicit values.
34921
+ *
34922
+ * @see {@link fromEnv} – automatically reads the runtime environment
34923
+ *
34924
+ * @category constructors
34925
+ * @since 4.0.0
34926
+ */
34927
+ function fromEnvRecord(env, options) {
34928
+ const preserveEmptyStrings = options?.preserveEmptyStrings === true;
34929
+ const trie = buildEnvTrie(env);
34930
+ return make$10((path) => succeed$4(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
34931
+ }
34932
+ /**
34753
34933
  * Creates a `ConfigProvider` backed by environment variables.
34754
34934
  *
34755
34935
  * **When to use**
34756
34936
  *
34757
34937
  * Use to read configuration from `process.env`, which is the default when no
34758
- * provider is explicitly set, or pass a custom env record for testing or
34759
- * non-Node runtimes.
34938
+ * provider is explicitly set, or pass a custom env record for testing.
34760
34939
  *
34761
34940
  * **Details**
34762
34941
  *
@@ -34797,23 +34976,21 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
34797
34976
  * ```
34798
34977
  *
34799
34978
  * @see {@link fromUnknown} – for JSON objects
34979
+ * @see {@link fromEnvRecord} – for explicit records in restricted runtimes
34800
34980
  * @see {@link constantCase} – bridge camelCase keys to SCREAMING_SNAKE_CASE
34801
34981
  *
34802
34982
  * @category constructors
34803
34983
  * @since 2.0.0
34804
34984
  */
34805
34985
  function fromEnv(options) {
34806
- const env = options?.env ?? {
34986
+ return fromEnvRecord(options?.env ?? {
34807
34987
  ...globalThis.process?.env,
34808
34988
  "BASE_URL": "/",
34809
34989
  "DEV": false,
34810
34990
  "MODE": "production",
34811
34991
  "PROD": true,
34812
34992
  "SSR": false
34813
- };
34814
- const preserveEmptyStrings = options?.preserveEmptyStrings === true;
34815
- const trie = buildEnvTrie(env);
34816
- return make$10((path) => succeed$4(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
34993
+ }, { preserveEmptyStrings: options?.preserveEmptyStrings });
34817
34994
  }
34818
34995
  function buildEnvTrie(env) {
34819
34996
  const trie = {};
@@ -34892,7 +35069,7 @@ var Boolean$1 = /*#__PURE__*/ Literals([...TrueValues.literals, ...FalseValues.l
34892
35069
  encode: (value) => value ? "true" : "false"
34893
35070
  })));
34894
35071
  //#endregion
34895
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Crypto.js
35072
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Crypto.js
34896
35073
  /**
34897
35074
  * Defines a platform-independent service for cryptographic operations.
34898
35075
  *
@@ -35040,7 +35217,7 @@ var formatUUIDv7 = (timestampMillis, bytes) => {
35040
35217
  return formatUUID(bytes);
35041
35218
  };
35042
35219
  //#endregion
35043
- //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.105_effect@4.0.0-beta.105/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
35220
+ //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.106_effect@4.0.0-beta.106/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
35044
35221
  /**
35045
35222
  * Node-compatible implementation of Effect's `Crypto` service.
35046
35223
  *
@@ -35070,7 +35247,7 @@ var digest = (algorithm, data) => try_({
35070
35247
  })
35071
35248
  });
35072
35249
  //#endregion
35073
- //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.105_effect@4.0.0-beta.105_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeCrypto.js
35250
+ //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.106_effect@4.0.0-beta.106_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeCrypto.js
35074
35251
  /**
35075
35252
  * The `NodeCrypto` module provides the Node.js `Crypto` service layer for
35076
35253
  * Effect programs. Provide {@link layer} at the edge of a Node application,
@@ -35095,7 +35272,7 @@ var layer$10 = /* @__PURE__ */ succeed$5(Crypto, /* @__PURE__ */ make$9({
35095
35272
  digest
35096
35273
  }));
35097
35274
  //#endregion
35098
- //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.105_effect@4.0.0-beta.105/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
35275
+ //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.106_effect@4.0.0-beta.106/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
35099
35276
  /**
35100
35277
  * Shared Node-compatible implementation of Effect's `FileSystem` service.
35101
35278
  *
@@ -35449,7 +35626,7 @@ var makeFileSystem = /*#__PURE__*/ map$7(/*#__PURE__*/ serviceOption(WatchBacken
35449
35626
  writeFile: writeFile$1
35450
35627
  }));
35451
35628
  //#endregion
35452
- //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.105_effect@4.0.0-beta.105_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeFileSystem.js
35629
+ //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.106_effect@4.0.0-beta.106_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeFileSystem.js
35453
35630
  /**
35454
35631
  * Node.js `FileSystem` layer for programs that perform real filesystem I/O.
35455
35632
  *
@@ -35468,7 +35645,7 @@ var makeFileSystem = /*#__PURE__*/ map$7(/*#__PURE__*/ serviceOption(WatchBacken
35468
35645
  */
35469
35646
  var layer$8 = /* @__PURE__ */ effect(FileSystem)(makeFileSystem);
35470
35647
  //#endregion
35471
- //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.105_effect@4.0.0-beta.105/node_modules/@effect/platform-node-shared/dist/NodePath.js
35648
+ //#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.106_effect@4.0.0-beta.106/node_modules/@effect/platform-node-shared/dist/NodePath.js
35472
35649
  /**
35473
35650
  * Node-backed provider for Effect's `Path` service.
35474
35651
  *
@@ -35506,7 +35683,7 @@ var fileUrlOps = (windows) => ({
35506
35683
  .../*#__PURE__*/ fileUrlOps(true)
35507
35684
  });
35508
35685
  //#endregion
35509
- //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.105_effect@4.0.0-beta.105_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodePath.js
35686
+ //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.106_effect@4.0.0-beta.106_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodePath.js
35510
35687
  /**
35511
35688
  * Node.js layers for Effect's `Path` service.
35512
35689
  *
@@ -35530,7 +35707,7 @@ var layer$6 = /* @__PURE__ */ succeed$5(Path$1)({
35530
35707
  .../*#__PURE__*/ fileUrlOps(void 0)
35531
35708
  });
35532
35709
  //#endregion
35533
- //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.105_effect@4.0.0-beta.105_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeStdio.js
35710
+ //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.106_effect@4.0.0-beta.106_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeStdio.js
35534
35711
  /**
35535
35712
  * Node.js `Stdio` layer for the current process.
35536
35713
  *
@@ -35584,7 +35761,7 @@ var layer$4 = /* @__PURE__ */ succeed$5(Stdio, /*#__PURE__*/ make$13({
35584
35761
  })
35585
35762
  }));
35586
35763
  //#endregion
35587
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Terminal.js
35764
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Terminal.js
35588
35765
  var TypeId$8 = "~effect/platform/Terminal";
35589
35766
  var QuitErrorTypeId = "effect/platform/Terminal/QuitError";
35590
35767
  /**
@@ -35681,34 +35858,37 @@ var layer$3 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUn
35681
35858
  };
35682
35859
  stdin.once("end", onStdinEnd);
35683
35860
  yield* addFinalizer(() => sync(() => stdin.off("end", onStdinEnd)));
35684
- const rlRef = yield* make$37({ acquire: acquireRelease(sync(() => {
35685
- const rl = readline.createInterface({
35686
- input: stdin,
35687
- escapeCodeTimeout: 50
35688
- });
35689
- const onLine = (line) => offerUnsafe(lines, line);
35690
- const onClose = () => {
35861
+ const rlRef = yield* make$37({
35862
+ acquire: acquireRelease(sync(() => {
35863
+ const rl = readline.createInterface({
35864
+ input: stdin,
35865
+ escapeCodeTimeout: 50
35866
+ });
35867
+ const onLine = (line) => offerUnsafe(lines, line);
35868
+ const onClose = () => {
35869
+ readlineActive = false;
35870
+ endUnsafe(lines);
35871
+ };
35872
+ readlineActive = true;
35873
+ readline.emitKeypressEvents(stdin, rl);
35874
+ rl.on("line", onLine);
35875
+ rl.once("close", onClose);
35876
+ if (stdin.isTTY) stdin.setRawMode(true);
35877
+ return {
35878
+ rl,
35879
+ onClose,
35880
+ onLine
35881
+ };
35882
+ }), ({ rl, onClose, onLine }) => sync(() => {
35691
35883
  readlineActive = false;
35692
- endUnsafe(lines);
35693
- };
35694
- readlineActive = true;
35695
- readline.emitKeypressEvents(stdin, rl);
35696
- rl.on("line", onLine);
35697
- rl.once("close", onClose);
35698
- if (stdin.isTTY) stdin.setRawMode(true);
35699
- return {
35700
- rl,
35701
- onClose,
35702
- onLine
35703
- };
35704
- }), ({ rl, onClose, onLine }) => sync(() => {
35705
- readlineActive = false;
35706
- rl.off("line", onLine);
35707
- rl.off("close", onClose);
35708
- if (stdin.isTTY) stdin.setRawMode(false);
35709
- rl.close();
35710
- if (inputEnded) endUnsafe(lines);
35711
- })) });
35884
+ rl.off("line", onLine);
35885
+ rl.off("close", onClose);
35886
+ if (stdin.isTTY) stdin.setRawMode(false);
35887
+ rl.close();
35888
+ if (inputEnded) endUnsafe(lines);
35889
+ })),
35890
+ idleTimeToLive: "10 millis"
35891
+ });
35712
35892
  const columns = sync(() => stdout.columns ?? 0);
35713
35893
  const rows = sync(() => stdout.rows ?? 0);
35714
35894
  const readInput = gen(function* () {
@@ -35768,7 +35948,7 @@ function defaultShouldQuit(input) {
35768
35948
  return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
35769
35949
  }
35770
35950
  //#endregion
35771
- //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.105_effect@4.0.0-beta.105_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeServices.js
35951
+ //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.106_effect@4.0.0-beta.106_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeServices.js
35772
35952
  /**
35773
35953
  * Provides the default Node implementations for child process spawning,
35774
35954
  * filesystem, path, stdio, and terminal services.
@@ -35778,7 +35958,7 @@ function defaultShouldQuit(input) {
35778
35958
  */
35779
35959
  var layer$1 = /*#__PURE__*/ provideMerge(layer$12, /*#__PURE__*/ mergeAll(layer$8, layer$10, layer$6, layer$4, layer$3));
35780
35960
  //#endregion
35781
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Runtime.js
35961
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Runtime.js
35782
35962
  /**
35783
35963
  * Helpers for turning an `Effect` program into a host application's main entry
35784
35964
  * point. This module is the low-level layer used by platform adapters to run a
@@ -36062,7 +36242,7 @@ var getErrorReported = (u) => {
36062
36242
  return true;
36063
36243
  };
36064
36244
  //#endregion
36065
- //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.105_effect@4.0.0-beta.105_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeRuntime.js
36245
+ //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.106_effect@4.0.0-beta.106_ioredis@5.11.1_supports-color@7.2.0_/node_modules/@effect/platform-node/dist/NodeRuntime.js
36066
36246
  /**
36067
36247
  * Node.js process runner for Effect programs.
36068
36248
  *
@@ -36114,7 +36294,7 @@ var runMain = /* @__PURE__ */ makeRunMain(({ fiber, teardown }) => {
36114
36294
  process.on("SIGTERM", onSigint);
36115
36295
  });
36116
36296
  //#endregion
36117
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Console.js
36297
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Console.js
36118
36298
  /**
36119
36299
  * Context reference for the current console service in the Effect system, allowing access to the active console implementation from within the Effect context.
36120
36300
  *
@@ -36249,7 +36429,7 @@ var log = (...args) => consoleWith((console) => sync$1(() => {
36249
36429
  console.log(...args);
36250
36430
  }));
36251
36431
  //#endregion
36252
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/Logger.js
36432
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/Logger.js
36253
36433
  /**
36254
36434
  * Context reference that routes the built-in default logger and TTY pretty
36255
36435
  * console logger to stderr.
@@ -36273,7 +36453,7 @@ var log = (...args) => consoleWith((console) => sync$1(() => {
36273
36453
  */
36274
36454
  var LogToStderr = LogToStderr$1;
36275
36455
  //#endregion
36276
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/CliError.js
36456
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/CliError.js
36277
36457
  /**
36278
36458
  * Defines structured errors for the unstable CLI parser and runner.
36279
36459
  *
@@ -36745,7 +36925,7 @@ var ShowHelp = class extends TaggedError(`${TypeId$7}/ShowHelp`)("ShowHelp", {
36745
36925
  }
36746
36926
  };
36747
36927
  //#endregion
36748
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/Primitive.js
36928
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/Primitive.js
36749
36929
  /**
36750
36930
  * Parses raw command-line strings into typed values.
36751
36931
  *
@@ -37008,7 +37188,7 @@ var getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.choic
37008
37188
  /** @internal */
37009
37189
  var getPathType = (primitive) => primitive._tag === "Path" ? primitive.pathType : void 0;
37010
37190
  //#endregion
37011
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/ansi.js
37191
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/ansi.js
37012
37192
  /**
37013
37193
  * Internal ANSI escape sequence helpers used by the unstable CLI rendering
37014
37194
  * implementation. This module centralizes the control codes for text styling,
@@ -37088,7 +37268,7 @@ var eraseLines = (rows) => {
37088
37268
  return command;
37089
37269
  };
37090
37270
  //#endregion
37091
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/Prompt.js
37271
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/Prompt.js
37092
37272
  /**
37093
37273
  * Builds interactive terminal prompts for CLI applications.
37094
37274
  *
@@ -38664,7 +38844,7 @@ var entriesToDisplay = (cursor, total, maxVisible) => {
38664
38844
  };
38665
38845
  };
38666
38846
  //#endregion
38667
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/Param.js
38847
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/Param.js
38668
38848
  var TypeId$5 = "~effect/cli/Param";
38669
38849
  /**
38670
38850
  * Defines the kind discriminator for positional argument parameters.
@@ -39361,7 +39541,7 @@ var getParamMetadata = (param) => {
39361
39541
  });
39362
39542
  };
39363
39543
  //#endregion
39364
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/Argument.js
39544
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/Argument.js
39365
39545
  /**
39366
39546
  * Creates a positional string argument.
39367
39547
  *
@@ -39397,7 +39577,7 @@ var string$2 = (name) => string$3(argumentKind, name);
39397
39577
  */
39398
39578
  var withDescription$2 = /*#__PURE__*/ dual(2, (self, description) => withDescription$3(self, description));
39399
39579
  //#endregion
39400
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/CliOutput.js
39580
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/CliOutput.js
39401
39581
  /**
39402
39582
  * Formats CLI help and errors as text.
39403
39583
  *
@@ -39645,7 +39825,7 @@ var formatHelpDocImpl = (doc, colors) => {
39645
39825
  return sections.join("\n");
39646
39826
  };
39647
39827
  //#endregion
39648
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/completions/bash.js
39828
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/completions/bash.js
39649
39829
  var escapeForBash = (s) => s.replace(/'/g, "'\\''");
39650
39830
  var sanitizeFunctionName = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
39651
39831
  var flagNamesForWordlist = (flag) => {
@@ -39849,7 +40029,7 @@ var generate$3 = (executableName, descriptor) => {
39849
40029
  return lines.join("\n");
39850
40030
  };
39851
40031
  //#endregion
39852
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/completions/fish.js
40032
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/completions/fish.js
39853
40033
  var escapeFishString = (s) => s.replace(/'/g, "\\'");
39854
40034
  /**
39855
40035
  * Build a Fish condition that checks the current subcommand context.
@@ -39987,7 +40167,7 @@ var generate$2 = (executableName, descriptor) => {
39987
40167
  return lines.join("\n");
39988
40168
  };
39989
40169
  //#endregion
39990
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/completions/zsh.js
40170
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/completions/zsh.js
39991
40171
  var escapeZsh = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:");
39992
40172
  var sanitize = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
39993
40173
  /**
@@ -40124,7 +40304,7 @@ var generate$1 = (executableName, descriptor) => {
40124
40304
  return lines.join("\n");
40125
40305
  };
40126
40306
  //#endregion
40127
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/Completions.js
40307
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/Completions.js
40128
40308
  /**
40129
40309
  * The `Completions` module turns a plain description of an Effect CLI command
40130
40310
  * tree into shell completion scripts for Bash, Zsh, and Fish. It is the
@@ -40160,7 +40340,7 @@ var generate = (executableName, shell, descriptor) => {
40160
40340
  }
40161
40341
  };
40162
40342
  //#endregion
40163
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/Flag.js
40343
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/Flag.js
40164
40344
  /**
40165
40345
  * Creates a string flag that accepts text input.
40166
40346
  *
@@ -40426,7 +40606,7 @@ var withDefault = withDefault$1;
40426
40606
  */
40427
40607
  var map$1 = /*#__PURE__*/ dual(2, (self, f) => map$2(self, f));
40428
40608
  //#endregion
40429
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/config.js
40609
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/config.js
40430
40610
  /**
40431
40611
  * Config Internal
40432
40612
  * ================
@@ -40545,7 +40725,7 @@ var reconstructTree = (tree, results) => {
40545
40725
  }
40546
40726
  };
40547
40727
  //#endregion
40548
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/command.js
40728
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/command.js
40549
40729
  /**
40550
40730
  * Command Implementation
40551
40731
  * ======================
@@ -40736,7 +40916,7 @@ var checkForDuplicateFlags = (parent, subcommands, options) => {
40736
40916
  }
40737
40917
  };
40738
40918
  //#endregion
40739
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/completions/descriptor.js
40919
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/completions/descriptor.js
40740
40920
  /**
40741
40921
  * CommandDescriptor — pure-data representation of a command tree for
40742
40922
  * shell completion generation.
@@ -40834,7 +41014,7 @@ var fromCommand = (cmd) => {
40834
41014
  };
40835
41015
  };
40836
41016
  //#endregion
40837
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/help.js
41017
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/help.js
40838
41018
  /**
40839
41019
  * Help Documentation
40840
41020
  * ================
@@ -40943,7 +41123,7 @@ var getHelpForCommandPath = (command, commandPath, builtIns) => gen(function* ()
40943
41123
  };
40944
41124
  });
40945
41125
  //#endregion
40946
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/GlobalFlag.js
41126
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/GlobalFlag.js
40947
41127
  /**
40948
41128
  * Global flags for Effect CLI command trees. Global flags are parsed outside a
40949
41129
  * single command's local flags and can apply to a command and its descendants.
@@ -41114,7 +41294,7 @@ var BuiltIns = [
41114
41294
  LogLevel
41115
41295
  ];
41116
41296
  //#endregion
41117
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/CliConfig.js
41297
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/CliConfig.js
41118
41298
  /**
41119
41299
  * Configuration for Effect CLI command execution.
41120
41300
  *
@@ -41141,7 +41321,7 @@ var CliConfig = class extends Reference("effect/unstable/cli/CliConfig", { defau
41141
41321
  */
41142
41322
  var defaults = { builtIns: BuiltIns };
41143
41323
  //#endregion
41144
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/lexer.js
41324
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/lexer.js
41145
41325
  /** @internal */
41146
41326
  function lex(argv) {
41147
41327
  const endIndex = argv.indexOf("--");
@@ -41200,7 +41380,7 @@ var lexTokens = (args) => {
41200
41380
  return tokens;
41201
41381
  };
41202
41382
  //#endregion
41203
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/auto-suggest.js
41383
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/auto-suggest.js
41204
41384
  /**
41205
41385
  * Simple Levenshtein distance implementation (small N, no perf worries)
41206
41386
  */
@@ -41228,7 +41408,7 @@ var suggest = (input, candidates) => {
41228
41408
  return distances.filter(([d]) => d === minDistance).map(([, c]) => c);
41229
41409
  };
41230
41410
  //#endregion
41231
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/parser.js
41411
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/parser.js
41232
41412
  /**
41233
41413
  * Parsing Pipeline for CLI Commands
41234
41414
  * ==================================
@@ -41754,7 +41934,7 @@ var scanCommandLevel = (tokens, context) => {
41754
41934
  return toLeafResult(state);
41755
41935
  };
41756
41936
  //#endregion
41757
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/internal/wizard.js
41937
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/internal/wizard.js
41758
41938
  var run$1 = /*#__PURE__*/ fnUntraced(function* (command, options) {
41759
41939
  const commandPath = options?.commandPath ?? [command.name];
41760
41940
  const selected = getCommandAtPath(command, commandPath);
@@ -41914,7 +42094,7 @@ var wrapCommand = (commandLine) => {
41914
42094
  };
41915
42095
  var formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
41916
42096
  //#endregion
41917
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/cli/Command.js
42097
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/cli/Command.js
41918
42098
  /**
41919
42099
  * Returns `true` if the provided value is a `Command`.
41920
42100
  *
@@ -42514,7 +42694,7 @@ var runWith = (command, config) => {
42514
42694
  };
42515
42695
  var package_default = {
42516
42696
  name: "repo-dive",
42517
- version: "0.12.0",
42697
+ version: "0.13.0",
42518
42698
  description: "Dive into a git repo's history: per-commit snapshots, an indexed metrics catalog and an interactive dashboard",
42519
42699
  keywords: [
42520
42700
  "git",
@@ -42590,8 +42770,8 @@ var package_default = {
42590
42770
  "@changesets/changelog-github": "0.7.0",
42591
42771
  "@changesets/cli": "2.31.1",
42592
42772
  "@changesets/config": "3.1.4",
42593
- "@effect/platform-node": "4.0.0-beta.105",
42594
- "@effect/vitest": "4.0.0-beta.105",
42773
+ "@effect/platform-node": "4.0.0-beta.106",
42774
+ "@effect/vitest": "4.0.0-beta.106",
42595
42775
  "@kachkaev/eslint-config-base": "1.2.0",
42596
42776
  "@kachkaev/markdownlint-config": "1.0.1",
42597
42777
  "@kachkaev/prettier-config": "2.2.1",
@@ -42600,7 +42780,7 @@ var package_default = {
42600
42780
  "@tsconfig/node-ts": "23.6.4",
42601
42781
  "@tsconfig/strictest": "2.0.8",
42602
42782
  "@types/babel__core": "7.20.5",
42603
- "@types/node": "26.1.2",
42783
+ "@types/node": "26.2.0",
42604
42784
  "@types/react": "19.2.18",
42605
42785
  "@types/react-dom": "19.2.4",
42606
42786
  "@typescript/native": "npm:typescript@7.0.2",
@@ -42614,7 +42794,7 @@ var package_default = {
42614
42794
  "babel-plugin-react-compiler": "1.0.0",
42615
42795
  "class-variance-authority": "0.7.1",
42616
42796
  "cspell": "10.0.1",
42617
- "effect": "4.0.0-beta.105",
42797
+ "effect": "4.0.0-beta.106",
42618
42798
  "eslint": "9.39.5",
42619
42799
  "eslint-plugin-react-hooks": "7.1.1",
42620
42800
  "husky": "9.1.7",
@@ -51627,7 +51807,7 @@ var runIndex = ({ repoPath }) => gen(function* () {
51627
51807
  //#region src/cli/index-command.ts
51628
51808
  var indexCommand = make$5("index", { repoPath: string$1("repo").pipe(withDefault("."), withDescription$1("Path to the git repository whose catalog to index (defaults to the current directory)")) }).pipe(withDescription("Normalize collected snapshots into the metrics cube (SQLite) and dashboard data (always rebuilt from raw outputs)"), withHandler((config) => runIndex({ repoPath: config.repoPath })));
51629
51809
  //#endregion
51630
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/Response.js
51810
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/Response.js
51631
51811
  /**
51632
51812
  * Schema for HTTP request details associated with an AI response.
51633
51813
  *
@@ -51743,7 +51923,7 @@ Class("effect/ai/AiResponse/Usage")({
51743
51923
  })
51744
51924
  });
51745
51925
  //#endregion
51746
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/AiError.js
51926
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/AiError.js
51747
51927
  /**
51748
51928
  * Defines shared errors for AI operations.
51749
51929
  *
@@ -52979,7 +53159,7 @@ var isAiErrorReason = (u) => hasProperty(u, ReasonTypeId);
52979
53159
  */
52980
53160
  var make$4 = (params) => new AiError(params);
52981
53161
  //#endregion
52982
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/Tool.js
53162
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/Tool.js
52983
53163
  /**
52984
53164
  * Definitions and helpers for tools that AI models can request during a
52985
53165
  * workflow.
@@ -53359,7 +53539,7 @@ var OpenWorld = /*#__PURE__*/ Reference("effect/ai/Tool/OpenWorld", { defaultVal
53359
53539
  */
53360
53540
  var EmptyParams = /*#__PURE__*/ Record(String$1, Never);
53361
53541
  //#endregion
53362
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/Toolkit.js
53542
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/Toolkit.js
53363
53543
  var TypeId$1 = "~effect/ai/Toolkit";
53364
53544
  var Proto = {
53365
53545
  .../*#__PURE__*/ Prototype({
@@ -53552,7 +53732,7 @@ var resolveInput = (...tools) => {
53552
53732
  */
53553
53733
  var make$2 = (...tools) => makeProto(resolveInput(...tools));
53554
53734
  //#endregion
53555
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/internal/mcpProtocol.js
53735
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/internal/mcpProtocol.js
53556
53736
  /** @internal */
53557
53737
  var make$1 = (options) => {
53558
53738
  const payloadCodecsCache = /* @__PURE__ */ new WeakMap();
@@ -53574,7 +53754,7 @@ var make$1 = (options) => {
53574
53754
  };
53575
53755
  };
53576
53756
  //#endregion
53577
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/rpc/RpcMiddleware.js
53757
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/rpc/RpcMiddleware.js
53578
53758
  /**
53579
53759
  * Middleware services for the unstable RPC runtime.
53580
53760
  *
@@ -53620,7 +53800,7 @@ var Service = () => (id, options) => {
53620
53800
  return ServiceClass;
53621
53801
  };
53622
53802
  //#endregion
53623
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/McpSchema.js
53803
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/McpSchema.js
53624
53804
  /**
53625
53805
  * Defines schemas for Model Context Protocol messages.
53626
53806
  *
@@ -55535,7 +55715,7 @@ var ServerNotificationRpcs = class extends make$11(CancelledNotification, Progre
55535
55715
  */
55536
55716
  var EnabledWhen = class extends Service$1()("effect/unstable/ai/McpSchema/EnabledWhen") {};
55537
55717
  //#endregion
55538
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/McpProtocol.js
55718
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/McpProtocol.js
55539
55719
  /**
55540
55720
  * The MCP 2025-06-18 protocol implementation.
55541
55721
  *
@@ -55554,7 +55734,7 @@ var v2025_06_18 = /*#__PURE__*/ make$1({
55554
55734
  serverNotificationRpcs: ServerNotificationRpcs
55555
55735
  });
55556
55736
  //#endregion
55557
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/internal/mcpProtocolRegistry.js
55737
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/internal/mcpProtocolRegistry.js
55558
55738
  var prefix = (protocol) => `@effect/mcp/${encodeURIComponent(protocol.protocolVersion)}/`;
55559
55739
  var asRpcGroup = (group) => group;
55560
55740
  /** @internal */
@@ -55579,7 +55759,7 @@ var make = /*#__PURE__*/ fnUntraced(function* (protocols) {
55579
55759
  };
55580
55760
  });
55581
55761
  //#endregion
55582
- //#region node_modules/.pnpm/effect@4.0.0-beta.105/node_modules/effect/dist/unstable/ai/McpServer.js
55762
+ //#region node_modules/.pnpm/effect@4.0.0-beta.106/node_modules/effect/dist/unstable/ai/McpServer.js
55583
55763
  /**
55584
55764
  * Builds Model Context Protocol (MCP) servers with Effect.
55585
55765
  *
@@ -55755,7 +55935,7 @@ var runWithProtocolState = /*#__PURE__*/ fnUntraced(function* (options, protocol
55755
55935
  const isHttp = isSome(yield* serviceOption(HttpRouter));
55756
55936
  const sessions = protocolState.sessions;
55757
55937
  const clientProtocols = /* @__PURE__ */ new Map();
55758
- const cancelledRequests = /* @__PURE__ */ new Map();
55938
+ const activeRequests = /* @__PURE__ */ new Map();
55759
55939
  const handlers = yield* build(layerHandlers(options, {
55760
55940
  sessions,
55761
55941
  protocolRegistry
@@ -55811,11 +55991,11 @@ var runWithProtocolState = /*#__PURE__*/ fnUntraced(function* (options, protocol
55811
55991
  ...protocol,
55812
55992
  send: (clientId, response) => {
55813
55993
  if (response._tag === "Exit") {
55814
- const requests = cancelledRequests.get(clientId);
55815
- if (requests?.delete(requestKey(response.requestId)) === true) {
55816
- if (requests.size === 0) cancelledRequests.delete(clientId);
55817
- return void_$1;
55818
- }
55994
+ const requests = activeRequests.get(clientId);
55995
+ const key = requestKey(response.requestId);
55996
+ const cancelled = requests?.get(key);
55997
+ if (requests !== void 0 && requests.delete(key) && requests.size === 0) activeRequests.delete(clientId);
55998
+ if (cancelled === true) return void_$1;
55819
55999
  }
55820
56000
  return protocol.send(clientId, response);
55821
56001
  },
@@ -55856,9 +56036,10 @@ var runWithProtocolState = /*#__PURE__*/ fnUntraced(function* (options, protocol
55856
56036
  return void_$1;
55857
56037
  }
55858
56038
  if (request.tag === "notifications/cancelled") return decodeCancelledNotification(request.payload).pipe(flatMap$1(({ requestId }) => {
55859
- const requests = cancelledRequests.get(clientId) ?? /* @__PURE__ */ new Set();
55860
- requests.add(requestKey(requestId));
55861
- cancelledRequests.set(clientId, requests);
56039
+ const key = requestKey(requestId);
56040
+ const requests = activeRequests.get(clientId);
56041
+ if (requests?.has(key) !== true) return void_$1;
56042
+ requests.set(key, true);
55862
56043
  return f(clientId, {
55863
56044
  _tag: "Interrupt",
55864
56045
  requestId: RequestId$1(requestId)
@@ -55896,7 +56077,14 @@ var runWithProtocolState = /*#__PURE__*/ fnUntraced(function* (options, protocol
55896
56077
  });
55897
56078
  }
55898
56079
  return selectedProtocol.payloadCodecs(rpc).decode(request.payload).pipe(matchEffect({
55899
- onSuccess: () => f(clientId, routedRequest),
56080
+ onSuccess: () => {
56081
+ if (request.isNotification !== true) {
56082
+ const requests = activeRequests.get(clientId) ?? /* @__PURE__ */ new Map();
56083
+ requests.set(requestKey(request.id), false);
56084
+ activeRequests.set(clientId, requests);
56085
+ }
56086
+ return f(clientId, routedRequest);
56087
+ },
55900
56088
  onFailure: () => request.isNotification ? void_$1 : protocol.send(clientId, {
55901
56089
  _tag: "Exit",
55902
56090
  requestId: request.id,
@@ -55914,7 +56102,7 @@ var runWithProtocolState = /*#__PURE__*/ fnUntraced(function* (options, protocol
55914
56102
  case "Ack":
55915
56103
  case "Interrupt": return f(clientId, request);
55916
56104
  case "Eof":
55917
- cancelledRequests.delete(clientId);
56105
+ activeRequests.delete(clientId);
55918
56106
  return f(clientId, request);
55919
56107
  case "Pong":
55920
56108
  case "Exit":