repo-dive 0.20.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -45,7 +45,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
45
45
  value: mod,
46
46
  enumerable: true
47
47
  }) : target, mod));
48
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Pipeable.js
48
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Pipeable.js
49
49
  var pipeArguments, Prototype$1, Class$3;
50
50
  var init_Pipeable = __esmMin((() => {
51
51
  pipeArguments = (self, args) => {
@@ -76,7 +76,7 @@ var init_Pipeable = __esmMin((() => {
76
76
  return PipeableBase;
77
77
  }();
78
78
  }));
79
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Function.js
79
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Function.js
80
80
  function pipe(a, ...args) {
81
81
  return pipeArguments(a, args);
82
82
  }
@@ -220,13 +220,23 @@ var init_Function = __esmMin((() => {
220
220
  constUndefined = /*#__PURE__*/ constant(void 0);
221
221
  constVoid = constUndefined;
222
222
  }));
223
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/equal.js
224
- var getAllObjectKeys, byReferenceInstances, viewBytes, isArrayBufferLike, bufferBytes;
223
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/equal.js
224
+ var errorSiteKeys, getAllObjectKeys, byReferenceInstances, viewBytes, isArrayBufferLike, bufferBytes;
225
225
  var init_equal = __esmMin((() => {
226
+ errorSiteKeys = [
227
+ "line",
228
+ "column",
229
+ "sourceURL",
230
+ "originalLine",
231
+ "originalColumn"
232
+ ];
226
233
  getAllObjectKeys = (obj) => {
227
234
  const keys = new Set(Reflect.ownKeys(obj));
228
235
  if (obj.constructor === Object) return keys;
229
- if (obj instanceof Error) keys.delete("stack");
236
+ if (obj instanceof Error) {
237
+ keys.delete("stack");
238
+ for (const key of errorSiteKeys) if (!Object.prototype.propertyIsEnumerable.call(obj, key)) keys.delete(key);
239
+ }
230
240
  const proto = Object.getPrototypeOf(obj);
231
241
  let current = proto;
232
242
  while (current !== null && current !== Object.prototype) {
@@ -248,7 +258,7 @@ var init_equal = __esmMin((() => {
248
258
  }
249
259
  };
250
260
  }));
251
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/hash.js
261
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/hash.js
252
262
  var backEdges, addBackEdge;
253
263
  var init_hash = __esmMin((() => {
254
264
  backEdges = 0;
@@ -256,7 +266,7 @@ var init_hash = __esmMin((() => {
256
266
  backEdges++;
257
267
  };
258
268
  }));
259
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Predicate.js
269
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Predicate.js
260
270
  /**
261
271
  * Checks whether a value is a `string`.
262
272
  *
@@ -846,7 +856,7 @@ var init_Predicate = __esmMin((() => {
846
856
  hasProperty = /*#__PURE__*/ dual(2, (self, property) => isObjectKeyword(self) && property in self);
847
857
  isTagged = /*#__PURE__*/ dual(2, (self, tag) => hasProperty(self, "_tag") && self["_tag"] === tag);
848
858
  }));
849
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Hash.js
859
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Hash.js
850
860
  var symbol$3, hash, random$1, mix, combine$1, optimize, isHash, float64, number$1, string$2, structureKeys, structure, unordered, array, hashMap, setSeed, hashSet, randomHashCache, hashCache, visitedObjects;
851
861
  var init_Hash = __esmMin((() => {
852
862
  init_Function();
@@ -945,7 +955,7 @@ var init_Hash = __esmMin((() => {
945
955
  hashCache = /*#__PURE__*/ new WeakMap();
946
956
  visitedObjects = /*#__PURE__*/ new WeakSet();
947
957
  }));
948
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Equal.js
958
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Equal.js
949
959
  function equals$1() {
950
960
  if (arguments.length === 1) return (self) => compareBoth(self, arguments[0]);
951
961
  return compareBoth(arguments[0], arguments[1]);
@@ -1066,7 +1076,7 @@ var init_Equal = __esmMin((() => {
1066
1076
  equalEntries = (self, that) => compareBoth(self[0], that[0]) && compareBoth(self[1], that[1]);
1067
1077
  isEqual = (u) => hasProperty(u, "~effect/Equal") && typeof u["~effect/Equal"] === "function";
1068
1078
  }));
1069
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Redactable.js
1079
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Redactable.js
1070
1080
  /**
1071
1081
  * Returns a redacted value if it implements {@link Redactable}, otherwise returns it
1072
1082
  * unchanged.
@@ -1141,7 +1151,7 @@ var init_Redactable = __esmMin((() => {
1141
1151
  }
1142
1152
  };
1143
1153
  }));
1144
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Formatter.js
1154
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Formatter.js
1145
1155
  /**
1146
1156
  * Converts any JavaScript value into a human-readable string.
1147
1157
  *
@@ -1455,7 +1465,7 @@ var init_Inspectable = __esmMin((() => {
1455
1465
  }
1456
1466
  };
1457
1467
  }));
1458
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/stackTraceLimit.js
1468
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/stackTraceLimit.js
1459
1469
  var isStackTraceLimitWritable, canWriteStackTraceLimit, getStackTraceLimit, setStackTraceLimit;
1460
1470
  var init_stackTraceLimit = __esmMin((() => {
1461
1471
  isStackTraceLimitWritable = () => {
@@ -1469,7 +1479,7 @@ var init_stackTraceLimit = __esmMin((() => {
1469
1479
  if (canWriteStackTraceLimit) Error.stackTraceLimit = value;
1470
1480
  };
1471
1481
  }));
1472
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Utils.js
1482
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Utils.js
1473
1483
  var SingleShotGen, pickInternalCall, internalCall;
1474
1484
  var init_Utils = __esmMin((() => {
1475
1485
  init_stackTraceLimit();
@@ -1519,7 +1529,7 @@ var init_Utils = __esmMin((() => {
1519
1529
  };
1520
1530
  internalCall = /*#__PURE__*/ pickInternalCall();
1521
1531
  }));
1522
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/record.js
1532
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/record.js
1523
1533
  /** @internal */
1524
1534
  function assignProperty(self, key, value) {
1525
1535
  if (key === "__proto__") Object.defineProperty(self, key, {
@@ -1539,11 +1549,11 @@ function assignProperties(self, source) {
1539
1549
  for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProperty(self, key, source[key]);
1540
1550
  }
1541
1551
  var init_record = __esmMin((() => {}));
1542
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/core.js
1552
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/core.js
1543
1553
  function defaultEvaluate(_fiber) {
1544
1554
  return exitDie(`Effect.evaluate: Not implemented`);
1545
1555
  }
1546
- var EffectTypeId, ExitTypeId, effectVariance, identifier, args, evaluate, contA, contE, contAll, Yield, PipeInspectableProto, EffectProto, isEffect$1, isExit$1, CauseTypeId, CauseReasonTypeId, isCause$1, isCauseReason, CauseImpl, annotationsMap, ReasonBase, constEmptyAnnotations, Fail, causeFromReasons, dedupeReasons, causeCombine, causeAddInterrupts, causeEmpty, causeFail, Die, causeDie, causeAnnotate, isFailReason$1, isDieReason, isInterruptReason, makePrimitiveProto, makePrimitive$1, makeExit, exitSucceed, StackTraceKey, InterruptorStackTrace, exitFailCause, exitFail, exitDie, withFiber$1, YieldableError, Error$3, TaggedError$2, NoSuchElementErrorTypeId, NoSuchElementError, DoneTypeId, isDone$2, DoneVoid, Done$1, doneVoid, done$2;
1556
+ var EffectTypeId, ExitTypeId, effectVariance, identifier, args, evaluate, contA, contE, contAll, Yield, PipeInspectableProto, EffectProto, isEffect$1, isExit$1, CauseTypeId, CauseReasonTypeId, isCause$1, isCauseReason, CauseImpl, annotationsMap, ReasonBase, constEmptyAnnotations, Fail, causeFromReasons, dedupeReasons, causeCombine, causeAddInterrupts, causeEmpty, causeFail, Die, causeDie, causeAnnotate, isFailReason$1, isDieReason$1, isInterruptReason, makePrimitiveProto, makePrimitive$1, makeExit, exitSucceed, StackTraceKey, InterruptorStackTrace, exitFailCause, exitFail, exitDie, withFiber$1, YieldableError, Error$3, TaggedError$2, NoSuchElementErrorTypeId, NoSuchElementError, DoneTypeId, isDone$2, DoneVoid, Done$1, doneVoid, done$2;
1547
1557
  var init_core = __esmMin((() => {
1548
1558
  init_Equal();
1549
1559
  init_Formatter();
@@ -1733,7 +1743,7 @@ var init_core = __esmMin((() => {
1733
1743
  };
1734
1744
  }
1735
1745
  [symbol$2](that) {
1736
- return isDieReason(that) && equals$1(this.defect, that.defect) && equals$1(this.annotations, that.annotations);
1746
+ return isDieReason$1(that) && equals$1(this.defect, that.defect) && equals$1(this.annotations, that.annotations);
1737
1747
  }
1738
1748
  [symbol$3]() {
1739
1749
  return combine$1(string$2(this._tag))(combine$1(hash(this.defect))(hash(this.annotations)));
@@ -1745,7 +1755,7 @@ var init_core = __esmMin((() => {
1745
1755
  return new CauseImpl(self.reasons.map((f) => f.annotate(annotations, options)));
1746
1756
  });
1747
1757
  isFailReason$1 = (self) => self._tag === "Fail";
1748
- isDieReason = (self) => self._tag === "Die";
1758
+ isDieReason$1 = (self) => self._tag === "Die";
1749
1759
  isInterruptReason = (self) => self._tag === "Interrupt";
1750
1760
  makePrimitiveProto = (options) => ({
1751
1761
  ...EffectProto,
@@ -1909,7 +1919,7 @@ var init_core = __esmMin((() => {
1909
1919
  return exitFail(Done$1(value));
1910
1920
  };
1911
1921
  }));
1912
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Effectable.js
1922
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Effectable.js
1913
1923
  var Prototype;
1914
1924
  var init_Effectable = __esmMin((() => {
1915
1925
  init_core();
@@ -1924,7 +1934,7 @@ var init_Equivalence = __esmMin((() => {
1924
1934
  isStrictEquivalent = (x, y) => x === y;
1925
1935
  strictEqual = () => isStrictEquivalent;
1926
1936
  }));
1927
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/option.js
1937
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/option.js
1928
1938
  var TypeId$54, CommonProto$1, SomeProto, NoneHash, NoneProto, isOption$1, isNone$1, isSome$1, none$1, SomeImpl, some$1;
1929
1939
  var init_option = __esmMin((() => {
1930
1940
  init_Equal();
@@ -1995,7 +2005,7 @@ var init_option = __esmMin((() => {
1995
2005
  SomeImpl.prototype = SomeProto;
1996
2006
  some$1 = (value) => new SomeImpl(value);
1997
2007
  }));
1998
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/result.js
2008
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/result.js
1999
2009
  var TypeId$53, CommonProto, SuccessProto, FailureProto, isResult$1, isFailure$2, isSuccess$2, FailureImpl, fail$9, SuccessImpl, succeed$10;
2000
2010
  var init_result = __esmMin((() => {
2001
2011
  init_Equal();
@@ -2071,7 +2081,7 @@ var init_result = __esmMin((() => {
2071
2081
  SuccessImpl.prototype = SuccessProto;
2072
2082
  succeed$10 = (success) => new SuccessImpl(success);
2073
2083
  }));
2074
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Order.js
2084
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Order.js
2075
2085
  /**
2076
2086
  * Creates a new `Order` instance from a comparison function.
2077
2087
  *
@@ -2127,7 +2137,7 @@ var init_Order = __esmMin((() => {
2127
2137
  isLessThanOrEqualTo$1 = (O) => dual(2, (self, that) => O(self, that) !== 1);
2128
2138
  isGreaterThanOrEqualTo$2 = (O) => dual(2, (self, that) => O(self, that) !== -1);
2129
2139
  }));
2130
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Option.js
2140
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Option.js
2131
2141
  var none, some, isOption, isNone, isSome, match$5, getOrElse, orElse, fromNullishOr, fromUndefinedOr, getOrUndefined$1, liftThrowable, map$10, flatMap$4, filter$3, exists$1;
2132
2142
  var init_Option = __esmMin((() => {
2133
2143
  init_Function();
@@ -2155,7 +2165,7 @@ var init_Option = __esmMin((() => {
2155
2165
  filter$3 = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some(self.value) : none());
2156
2166
  exists$1 = /*#__PURE__*/ dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));
2157
2167
  }));
2158
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Context.js
2168
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Context.js
2159
2169
  var ServiceTypeId, Service$1, ServiceProto, cacheKeys, ReferenceTypeId, TypeId$52, FlattenAfterBaseHits, makeImpl, applyOverlays, flatten$2, withFlat, notFound$1, lookup, makeUnsafe$8, Proto$16, hasSameCache, isContext, isReference, empty$11, emptyContext, make$53, add, addUnsafe, getOrUndefined, getOrUndefinedUnsafe, getUnsafe, get$5, defaultValueCacheKey, getDefaultValue, serviceNotFoundError, getOption, merge$4, mergeAll$1, Reference, init_Context = __esmMin((() => {
2160
2170
  init_Effectable();
2161
2171
  init_Equal();
@@ -2673,7 +2683,7 @@ var init_Duration = __esmMin((() => {
2673
2683
  return pieces.join(" ");
2674
2684
  };
2675
2685
  }));
2676
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/array.js
2686
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/array.js
2677
2687
  var isArrayNonEmpty$1;
2678
2688
  var init_array = __esmMin((() => {
2679
2689
  isArrayNonEmpty$1 = (self) => self.length > 0;
@@ -2701,7 +2711,7 @@ var init_Tuple = __esmMin((() => {
2701
2711
  init_Equivalence();
2702
2712
  init_Predicate();
2703
2713
  }));
2704
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Iterable.js
2714
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Iterable.js
2705
2715
  var findFirst$1;
2706
2716
  var init_Iterable = __esmMin((() => {
2707
2717
  init_Function();
@@ -2719,7 +2729,7 @@ var init_Iterable = __esmMin((() => {
2719
2729
  return none();
2720
2730
  });
2721
2731
  }));
2722
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Record.js
2732
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Record.js
2723
2733
  var has, map$8, keys, isSubrecordBy, makeEquivalence$2, init_Record = __esmMin((() => {
2724
2734
  init_Function();
2725
2735
  init_record();
@@ -2800,7 +2810,17 @@ var init_Array = __esmMin((() => {
2800
2810
  });
2801
2811
  reduce = /*#__PURE__*/ dual(3, (self, b, f) => fromIterable$2(self).reduce((b, a, i) => f(b, a, i), b));
2802
2812
  }));
2803
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Scheduler.js
2813
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Filter.js
2814
+ var toOption$1;
2815
+ var init_Filter = __esmMin((() => {
2816
+ init_Option();
2817
+ init_Result();
2818
+ toOption$1 = (self) => (input) => {
2819
+ const result = self(input);
2820
+ return isFailure$1(result) ? none() : some(result.success);
2821
+ };
2822
+ }));
2823
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Scheduler.js
2804
2824
  var Scheduler, setMicrotask, setTimer, setImmediate$1, PriorityBuckets, MixedScheduler, MixedSchedulerDispatcher, MaxOpsBeforeYield, PreventSchedulerYield;
2805
2825
  var init_Scheduler = __esmMin((() => {
2806
2826
  init_Context();
@@ -2939,7 +2959,7 @@ var init_Scheduler = __esmMin((() => {
2939
2959
  defaultValue: () => false
2940
2960
  });
2941
2961
  }));
2942
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Data.js
2962
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Data.js
2943
2963
  function taggedMatch() {
2944
2964
  if (arguments.length === 1) {
2945
2965
  const cases = arguments[0];
@@ -2987,7 +3007,7 @@ var init_Data = __esmMin((() => {
2987
3007
  */
2988
3008
  [EncodingErrorTypeId] = EncodingErrorTypeId;
2989
3009
  };
2990
- })), random, hexCharCodes, randomWord, random8, random16, random32;
3010
+ })), random, hexCharCodes, randomWord, random8, random16, random32, hexCodes;
2991
3011
  var init_Hex = __esmMin((() => {
2992
3012
  random = (length) => {
2993
3013
  switch (length) {
@@ -3018,8 +3038,13 @@ var init_Hex = __esmMin((() => {
3018
3038
  const d = randomWord();
3019
3039
  return String.fromCharCode(hexCharCodes[a >>> 28], hexCharCodes[a >>> 24 & 15], hexCharCodes[a >>> 20 & 15], hexCharCodes[a >>> 16 & 15], hexCharCodes[a >>> 12 & 15], hexCharCodes[a >>> 8 & 15], hexCharCodes[a >>> 4 & 15], hexCharCodes[a & 15], hexCharCodes[b >>> 28], hexCharCodes[b >>> 24 & 15], hexCharCodes[b >>> 20 & 15], hexCharCodes[b >>> 16 & 15], hexCharCodes[b >>> 12 & 15], hexCharCodes[b >>> 8 & 15], hexCharCodes[b >>> 4 & 15], hexCharCodes[b & 15], hexCharCodes[c >>> 28], hexCharCodes[c >>> 24 & 15], hexCharCodes[c >>> 20 & 15], hexCharCodes[c >>> 16 & 15], hexCharCodes[c >>> 12 & 15], hexCharCodes[c >>> 8 & 15], hexCharCodes[c >>> 4 & 15], hexCharCodes[c & 15], hexCharCodes[d >>> 28], hexCharCodes[d >>> 24 & 15], hexCharCodes[d >>> 20 & 15], hexCharCodes[d >>> 16 & 15], hexCharCodes[d >>> 12 & 15], hexCharCodes[d >>> 8 & 15], hexCharCodes[d >>> 4 & 15], hexCharCodes[d & 15]);
3020
3040
  };
3041
+ hexCodes = /*#__PURE__*/ (/* @__PURE__ */ new Uint8Array(256)).fill(255);
3042
+ for (let i = 0; i < 16; i++) {
3043
+ hexCodes[/*#__PURE__*/ "0123456789abcdef".charCodeAt(i)] = i;
3044
+ hexCodes[/*#__PURE__*/ "0123456789ABCDEF".charCodeAt(i)] = i;
3045
+ }
3021
3046
  }));
3022
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Tracer.js
3047
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Tracer.js
3023
3048
  var ParentSpanKey, ParentSpan, make$51, externalSpan, DisablePropagation, CurrentTraceLevel, MinimumTraceLevel, TracerKey, nativeTracer, NativeSpan;
3024
3049
  var init_Tracer = __esmMin((() => {
3025
3050
  init_Context();
@@ -3107,12 +3132,12 @@ var init_Tracer = __esmMin((() => {
3107
3132
  }
3108
3133
  };
3109
3134
  }));
3110
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/metric.js
3135
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/metric.js
3111
3136
  var FiberRuntimeMetricsKey;
3112
3137
  var init_metric = __esmMin((() => {
3113
3138
  FiberRuntimeMetricsKey = "effect/Metric/FiberRuntimeMetrics";
3114
3139
  }));
3115
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/references.js
3140
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/references.js
3116
3141
  var CurrentErrorReporters, CurrentStackFrame, TracerEnabled, TracerTimingEnabled, TracerSpanAnnotations, TracerSpanLinks, CurrentLogAnnotations$1, CurrentLogLevel$1, MinimumLogLevel$1, UnhandledLogLevel, CurrentLogSpans;
3117
3142
  var init_references = __esmMin((() => {
3118
3143
  init_Context();
@@ -3141,7 +3166,7 @@ var init_references = __esmMin((() => {
3141
3166
  UnhandledLogLevel = /*#__PURE__*/ Reference("effect/References/UnhandledLogLevel", { defaultValue: () => "Error" });
3142
3167
  CurrentLogSpans = /*#__PURE__*/ Reference("effect/References/CurrentLogSpans", { defaultValue: () => [] });
3143
3168
  }));
3144
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/tracer.js
3169
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/tracer.js
3145
3170
  var addSpanStackTrace, makeStackCleaner, spanCleaner;
3146
3171
  var init_tracer = __esmMin((() => {
3147
3172
  init_stackTraceLimit();
@@ -3176,17 +3201,18 @@ var init_tracer = __esmMin((() => {
3176
3201
  };
3177
3202
  spanCleaner = /*#__PURE__*/ makeStackCleaner(3);
3178
3203
  }));
3179
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/effect.js
3204
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/effect.js
3180
3205
  /** @internal */
3181
3206
  function interruptChildrenPatch() {
3182
3207
  fiberMiddleware.interruptChildren ??= fiberInterruptChildren;
3183
3208
  }
3184
- var Interrupt, makeInterruptReason$1, causeInterrupt, hasFails, findFail$1, findError, hasDies$1, causeElectDefects, findRecoverableError, findDefect, hasInterrupts$2, causeFilterInterruptors, causeInterruptors, emptySet, hasInterruptsOnly$1, reasonAnnotations$1, causeMap, causeSquash, causePrettyErrors, causePrettyError, causePrettyMessage, locationRegExp, cleanErrorStack, addStackAnnotations, interruptCauseStack, currentStackTrace, causePretty, renderPrettyError, renderErrorCause, FiberTypeId, fiberVariance, fiberIdStore, AsyncResource, captureAsyncContext, getCurrentFiber, FiberImpl, makeFiberContextCache, deferredInterruptCont, maxInlineSteps, fiberMiddleware, fiberStackAnnotations, fiberInterruptChildren, fiberAwait, fiberAwaitAll, fiberJoin, fiberInterrupt, fiberInterruptAs, fiberInterruptAll, succeed$8, failCause$6, fail$7, sync$1, suspend$3, fromOption$1, fromResult$1, yieldNowWith, yieldNow, succeedSome$1, succeedNone$1, failCauseSync$1, die$3, failSync$1, void_$3, try_$1, promise$1, tryPromise$1, callbackOptions, asyncFinalizer, callback$2, never$2, gen$1, fnBody, fnUntraced$1, defineFunctionLength, fnStackCleaner, fn$1, makeFn, fnUntracedEager$1, fromIteratorEagerUnsafe, fromIteratorUnsafe, as$1, evaluateCont, OnSuccessProto, ContImpl, returnPayload, succeedPayload, continuationMarksStack, mapCont, andThenCont, tapCont, tapEffectCont, asSome, andThen$1, tap$1, asVoid$1, sandbox$1, raceAllFirst, raceFirst$1, flatMap$2, effectIsExit, flatMapEager$1, flatten$1, map$6, mapEager$1, mapErrorEager$1, mapBothEager$1, exitInterrupt$1, exitIsSuccess, exitIsFailure, exitFilterCause, exitHasInterrupts, exitVoid, exitMap, exitMapError, exitMapBoth, exitZipRight, exitAsVoidAll, serviceOption$1, updateContext$1, updateService, context$1, getContext, contextWith$1, provideContext$3, provideService$1, provideServiceImpl, zipWith$1, when$3, forever$2, catchCause$3, OnFailureProto, OnFailureImpl, catchCauseIf$1, catchCauseFilter$1, catch_$3, catchDefect$1, tapCause$1, tapCauseFilter, tapError$3, catchIf$1, catchFilter$1, catchTag$1, catchTags$1, catchReason$1, mapError$3, mapBoth, orDie$1, orElseSucceed$1, ignoreCauseLogger, ignore$2, ignoreCause$1, result$2, matchCauseEffect$1, OnSuccessAndFailureProto, OnSuccessAndFailureImpl, matchSuccess, makeMatch, MatchImpl, matchEffect$2, match$1, matchEager, exit$1, exitPrimitive, timeoutOrElse, timeoutErrorFromDuration, timeout$1, timeoutOption, timed$1, ScopeTypeId, ScopeCloseableTypeId, scopeTag, scopeClose, scopeCloseUnsafe, runFinalizer, combineFinalizerCause, scopeCloseFinalizers, scopeForkUnsafe, scopeAddFinalizerExit, scopeAddFinalizer, scopeAddFinalizerUnsafe, scopeRemoveFinalizerUnsafe, scopeMakeUnsafe, makeScope, constScopeEmpty, scopeMake, scope$1, provideScope, scoped$1, scopedWith$1, acquireRelease$1, addFinalizer$2, OnExitImpl, onExitPrimitive$1, onExitUnsafe, onExit$2, ensuring$3, onExitFilter, onError$1, onErrorFilter, onInterrupt$1, acquireUseRelease$1, infiniteTTL, makeCachedUnsafe, cached$1, interrupt$3, uninterruptible$1, setInterruptible, setInterruptibleTrue, setInterruptibleFalse, setFiberInterruptible, fiberEnterUninterruptibleUnsafe, interruptible$1, uninterruptibleMask$1, all$1, whileLoop$1, forEach$2, forEachSequential, resolveConcurrency, iterateEager, iterateConcurrentImpl, iterateConcurrent, forEachConcurrent, filter$1, forkChild$1, forkUnsafe$1, forkDetach$1, fiberScopeFinalizer, forkIn$1, forkScoped$1, runForkWith$1, fiberRunIn, runFork$1, runSyncExitWith, runSyncExit$1, succeedTrue, succeedFalse, Latch, makeLatchUnsafe, bigint0$2, NoopSpanProto, noopSpan, filterDisablePropagation, makeSpanUnsafe, makeSpanScoped$1, provideSpanStackFrame, endSpan, useSpan$1, provideParentSpan, withParentSpan$1, withSpan$1, annotateCurrentSpan$1, ClockRef, MAX_TIMER_MILLIS, ClockImpl, nanosPerMilli, monotonicNowNanos, wallTimeNanos, clockWith, sleep$1, currentTimeMillis$1, TimeoutErrorTypeId, TimeoutError, IllegalArgumentErrorTypeId, IllegalArgumentError$1, ExceededCapacityErrorTypeId, ExceededCapacityError$1, AsyncFiberErrorTypeId, AsyncFiberError, UnknownErrorTypeId, isUnknownError$1, UnknownError$2, ConsoleRef, logLevelToOrder, LogLevelOrder, isLogLevelGreaterThan, CurrentLoggers, LogToStderr$1, LoggerTypeId, LoggerProto, loggerMake, formatLabel, formatLogSpan, logWithLevel, colors, defaultDateFormat, defaultLogger, tracerLogger, reportCauseUnsafe;
3209
+ var Interrupt, makeInterruptReason$1, causeInterrupt, hasFails, findFail$1, findError, findErrorOption$1, hasDies$1, causeElectDefects, findRecoverableError, findDefect, hasInterrupts$2, causeFilterInterruptors, causeInterruptors, emptySet, hasInterruptsOnly$1, reasonAnnotations$1, causeMap, causeSquash, causePrettyErrors, causePrettyError, causePrettyMessage, locationRegExp, cleanErrorStack, addStackAnnotations, interruptCauseStack, currentStackTrace, causePretty, renderPrettyError, renderErrorCause, FiberTypeId, fiberVariance, fiberIdStore, AsyncResource, captureAsyncContext, getCurrentFiber, FiberImpl, makeFiberContextCache, deferredInterruptCont, maxInlineSteps, fiberMiddleware, fiberStackAnnotations, fiberInterruptChildren, fiberAwait, fiberAwaitAll, fiberJoin, fiberInterrupt, fiberInterruptAs, fiberInterruptAll, succeed$8, failCause$6, fail$7, sync$1, suspend$3, fromOption$1, fromResult$1, yieldNowWith, yieldNow, succeedSome$1, succeedNone$1, failCauseSync$1, die$3, failSync$1, void_$3, try_$1, promise$1, tryPromise$1, callbackOptions, asyncFinalizer, callback$2, never$2, gen$1, fnBody, fnUntraced$1, defineFunctionLength, fnStackCleaner, fn$1, makeFn, fnUntracedEager$1, fromIteratorEagerUnsafe, fromIteratorUnsafe, as$1, evaluateCont, OnSuccessProto, ContImpl, returnPayload, succeedPayload, continuationMarksStack, mapCont, andThenCont, tapCont, tapEffectCont, asSome, andThen$1, tap$1, asVoid$1, sandbox$1, raceAllFirst, interruptRaceLosers, raceFirst$1, flatMap$2, effectIsExit, flatMapEager$1, flatten$1, map$6, mapEager$1, mapErrorEager$1, mapBothEager$1, exitInterrupt$1, exitIsSuccess, exitIsFailure, exitFilterCause, exitHasInterrupts, exitVoid, exitMap, exitMapError, exitMapBoth, exitZipRight, exitAsVoidAll, serviceOption$1, updateContext$1, updateService, context$1, getContext, contextWith$1, provideContext$3, provideService$1, provideServiceImpl, zipWith$1, when$3, forever$2, catchCause$3, OnFailureProto, OnFailureImpl, catchCauseIf$1, catchCauseFilter$1, catch_$3, catchDefect$1, tapCause$1, tapCauseFilter, tapError$3, catchIf$1, catchFilter$1, catchTag$1, catchTags$1, catchReason$1, mapError$3, mapBoth, orDie$1, orElseSucceed$1, ignoreCauseLogger, ignore$2, ignoreCause$1, result$2, matchCauseEffect$1, OnSuccessAndFailureProto, OnSuccessAndFailureImpl, matchSuccess, makeMatch, MatchImpl, matchEffect$2, match$1, matchEager, exit$1, exitPrimitive, timeoutOrElse, timeoutErrorFromDuration, timeout$1, timeoutOption, timed$1, ScopeTypeId, ScopeCloseableTypeId, scopeTag, scopeClose, scopeCloseUnsafe, runFinalizer, combineFinalizerCause, scopeCloseFinalizers, scopeForkUnsafe, scopeAddFinalizerExit, scopeAddFinalizer, scopeAddFinalizerUnsafe, scopeRemoveFinalizerUnsafe, scopeMakeUnsafe, makeScope, constScopeEmpty, scopeMake, scope$1, provideScope, scoped$1, scopedWith$1, acquireRelease$1, addFinalizer$2, OnExitImpl, onExitPrimitive$1, onExitUnsafe, onExit$2, ensuring$3, onExitFilter, onError$1, onErrorFilter, onInterrupt$1, acquireUseRelease$1, infiniteTTL, makeCachedUnsafe, cached$1, interrupt$3, uninterruptible$1, setInterruptible, setInterruptibleTrue, setInterruptibleFalse, setFiberInterruptible, fiberEnterUninterruptibleUnsafe, interruptible$1, uninterruptibleMask$1, all$1, whileLoop$1, forEach$2, forEachSequential, resolveConcurrency, iterateEager, iterateConcurrentImpl, iterateConcurrent, forEachConcurrent, filter$1, forkChild$1, forkUnsafe$1, forkDetach$1, fiberScopeFinalizer, forkIn$1, forkScoped$1, runForkWith$1, fiberRunIn, runFork$1, runSyncExitWith, runSyncExit$1, succeedTrue, succeedFalse, Latch, makeLatchUnsafe, bigint0$2, NoopSpanProto, noopSpan, filterDisablePropagation, makeSpanUnsafe, makeSpan$1, makeSpanScoped$1, provideSpanStackFrame, endSpan, useSpan$1, provideParentSpan, withParentSpan$1, withSpan$1, annotateCurrentSpan$1, ClockRef, MAX_TIMER_MILLIS, ClockImpl, nanosPerMilli, monotonicNowNanos, wallTimeNanos, clockWith, sleep$1, currentTimeMillis$1, TimeoutErrorTypeId, TimeoutError, IllegalArgumentErrorTypeId, IllegalArgumentError$1, ExceededCapacityErrorTypeId, ExceededCapacityError$1, AsyncFiberErrorTypeId, AsyncFiberError, UnknownErrorTypeId, isUnknownError$1, UnknownError$2, ConsoleRef, logLevelToOrder, LogLevelOrder, isLogLevelGreaterThan, CurrentLoggers, LogToStderr$1, LoggerTypeId, LoggerProto, loggerMake, formatLabel, formatLogSpan, logWithLevel, colors, defaultDateFormat, defaultLogger, tracerLogger, reportCauseUnsafe;
3185
3210
  var init_effect = __esmMin((() => {
3186
3211
  init_Array();
3187
3212
  init_Context();
3188
3213
  init_Duration();
3189
3214
  init_Equal();
3215
+ init_Filter();
3190
3216
  init_Formatter();
3191
3217
  init_Function();
3192
3218
  init_Hash();
@@ -3241,11 +3267,12 @@ var init_effect = __esmMin((() => {
3241
3267
  }
3242
3268
  return fail$8(self);
3243
3269
  };
3244
- hasDies$1 = (self) => self.reasons.some(isDieReason);
3270
+ findErrorOption$1 = /*#__PURE__*/ toOption$1(findError);
3271
+ hasDies$1 = (self) => self.reasons.some(isDieReason$1);
3245
3272
  causeElectDefects = (self) => hasDies$1(self) && hasFails(self) ? causeFromReasons(self.reasons.map((reason) => reason._tag === "Fail" && !isDone$2(reason.error) ? new Die(reason.error, reason.annotations) : reason)) : self;
3246
3273
  findRecoverableError = (self) => hasDies$1(self) ? fail$8(causeElectDefects(self)) : findError(self);
3247
3274
  findDefect = (self) => {
3248
- const reason = self.reasons.find(isDieReason);
3275
+ const reason = self.reasons.find(isDieReason$1);
3249
3276
  return reason ? succeed$9(reason.defect) : fail$8(self);
3250
3277
  };
3251
3278
  hasInterrupts$2 = (self) => self.reasons.some(isInterruptReason);
@@ -3426,6 +3453,7 @@ var init_effect = __esmMin((() => {
3426
3453
  this._children = void 0;
3427
3454
  this._interruptedCause = void 0;
3428
3455
  this._yielded = void 0;
3456
+ this._autoYielded = false;
3429
3457
  this._running = false;
3430
3458
  this._deferredInterrupt = false;
3431
3459
  this._parent = void 0;
@@ -3518,8 +3546,10 @@ var init_effect = __esmMin((() => {
3518
3546
  const prevRunning = this._running;
3519
3547
  this._running = true;
3520
3548
  let yielding = false;
3549
+ let resuming = this._autoYielded;
3550
+ this._autoYielded = false;
3521
3551
  let current = effect;
3522
- this.currentOpCount = 0;
3552
+ this.currentOpCount = resuming ? 1 : 0;
3523
3553
  try {
3524
3554
  while (true) try {
3525
3555
  if (this._deferredInterrupt) {
@@ -3528,12 +3558,13 @@ var init_effect = __esmMin((() => {
3528
3558
  }
3529
3559
  this.currentOpCount++;
3530
3560
  const cache = this.cache;
3531
- if (!yielding && !cache.preventYield && cache.scheduler.shouldYield(this)) {
3561
+ if (!resuming && !yielding && !cache.preventYield && cache.scheduler.shouldYield(this)) {
3532
3562
  yielding = true;
3533
- const prev = current;
3534
- current = flatMap$2(yieldNow, () => prev);
3563
+ current = this.yieldNow(current, 0, true);
3564
+ } else {
3565
+ resuming = false;
3566
+ current = cache.tracerContext ? cache.tracerContext(current, this) : current[evaluate](this);
3535
3567
  }
3536
- current = cache.tracerContext ? cache.tracerContext(current, this) : current[evaluate](this);
3537
3568
  if (current === Yield) {
3538
3569
  const yielded = this._yielded;
3539
3570
  if ("~effect/Exit" in yielded) {
@@ -3584,6 +3615,17 @@ var init_effect = __esmMin((() => {
3584
3615
  this._yielded = value;
3585
3616
  return Yield;
3586
3617
  }
3618
+ yieldNow(effect, priority = 0, automatic = false) {
3619
+ let resumed = false;
3620
+ this.currentDispatcher.scheduleTask(() => {
3621
+ if (resumed) return;
3622
+ this._autoYielded = automatic;
3623
+ this.evaluate(effect);
3624
+ }, priority);
3625
+ return this.yieldWith(() => {
3626
+ resumed = true;
3627
+ });
3628
+ }
3587
3629
  children() {
3588
3630
  return this._children ??= /* @__PURE__ */ new Set();
3589
3631
  }
@@ -3722,14 +3764,7 @@ var init_effect = __esmMin((() => {
3722
3764
  yieldNowWith = /*#__PURE__*/ makePrimitive$1({
3723
3765
  op: "Yield",
3724
3766
  [evaluate](fiber) {
3725
- let resumed = false;
3726
- fiber.currentDispatcher.scheduleTask(() => {
3727
- if (resumed) return;
3728
- fiber.evaluate(exitVoid);
3729
- }, this["~effect/Effect/args"] ?? 0);
3730
- return fiber.yieldWith(() => {
3731
- resumed = true;
3732
- });
3767
+ return fiber.yieldNow(exitVoid, this["~effect/Effect/args"] ?? 0);
3733
3768
  }
3734
3769
  });
3735
3770
  yieldNow = /*#__PURE__*/ yieldNowWith(0);
@@ -4023,15 +4058,22 @@ var init_effect = __esmMin((() => {
4023
4058
  const isWinner = !done;
4024
4059
  done = true;
4025
4060
  resume(exit);
4026
- if (isWinner && options?.onWinner) options.onWinner({
4027
- fiber,
4028
- index,
4029
- parentFiber: parent
4030
- });
4061
+ if (isWinner) {
4062
+ interruptRaceLosers(fibers, parent);
4063
+ options?.onWinner?.({
4064
+ fiber,
4065
+ index,
4066
+ parentFiber: parent
4067
+ });
4068
+ }
4031
4069
  });
4032
4070
  }
4033
4071
  });
4034
4072
  });
4073
+ interruptRaceLosers = (fibers, parent) => {
4074
+ const annotations = fiberStackAnnotations(parent);
4075
+ for (const fiber of fibers) fiber.interruptUnsafe(parent.id, annotations);
4076
+ };
4035
4077
  raceFirst$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[1]), (self, that, options) => raceAllFirst([self, that], options));
4036
4078
  flatMap$2 = /*#__PURE__*/ dual(2, (self, f) => new ContImpl(self, andThenCont, f));
4037
4079
  effectIsExit = (effect) => effect[ExitTypeId] !== void 0;
@@ -4905,6 +4947,7 @@ var init_effect = __esmMin((() => {
4905
4947
  }
4906
4948
  return span;
4907
4949
  };
4950
+ makeSpan$1 = (name, options) => withFiber$1((fiber) => succeed$8(makeSpanUnsafe(fiber, name, options)));
4908
4951
  makeSpanScoped$1 = (name, options) => uninterruptible$1(withFiber$1((fiber) => {
4909
4952
  const scope = getUnsafe(fiber.context, scopeTag);
4910
4953
  const span = makeSpanUnsafe(fiber, name, options ?? {});
@@ -5183,7 +5226,7 @@ var init_effect = __esmMin((() => {
5183
5226
  reporters.forEach((reporter) => reporter.report(opts));
5184
5227
  };
5185
5228
  }));
5186
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Exit.js
5229
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Exit.js
5187
5230
  var isExit, succeed$7, failCause$5, fail$6, die$2, interrupt$2, void_$2, isSuccess, isFailure, hasInterrupts$1, asVoidAll;
5188
5231
  var init_Exit = __esmMin((() => {
5189
5232
  init_core();
@@ -5200,7 +5243,7 @@ var init_Exit = __esmMin((() => {
5200
5243
  hasInterrupts$1 = exitHasInterrupts;
5201
5244
  asVoidAll = exitAsVoidAll;
5202
5245
  }));
5203
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Deferred.js
5246
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Deferred.js
5204
5247
  var TypeId$50, isDeferred, DeferredProto, DeferredImpl, makeUnsafe$7, make$50, _await, completeWith, done$1, fail$5, failCause$4, interruptWith, isDone$1, isDoneUnsafe, succeed$6, doneUnsafe;
5205
5248
  var init_Deferred = __esmMin((() => {
5206
5249
  init_Function();
@@ -5256,7 +5299,7 @@ var init_Deferred = __esmMin((() => {
5256
5299
  return true;
5257
5300
  };
5258
5301
  }));
5259
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/References.js
5302
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/References.js
5260
5303
  var CurrentLogAnnotations, CurrentLogLevel, MinimumLogLevel;
5261
5304
  var init_References = __esmMin((() => {
5262
5305
  init_references();
@@ -5265,7 +5308,7 @@ var init_References = __esmMin((() => {
5265
5308
  CurrentLogLevel = CurrentLogLevel$1;
5266
5309
  MinimumLogLevel = MinimumLogLevel$1;
5267
5310
  }));
5268
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Scope.js
5311
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Scope.js
5269
5312
  var Scope, make$49, makeUnsafe$6, provide$3, addFinalizerExit, addFinalizer$1, forkUnsafe, close, closeUnsafe;
5270
5313
  var init_Scope = __esmMin((() => {
5271
5314
  init_effect();
@@ -5279,7 +5322,7 @@ var init_Scope = __esmMin((() => {
5279
5322
  close = scopeClose;
5280
5323
  closeUnsafe = scopeCloseUnsafe;
5281
5324
  }));
5282
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Layer.js
5325
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Layer.js
5283
5326
  var TypeId$49, MemoMapTypeId, makeMemoMapEntry, memoMapObserve, LayerProto, fromBuildUnsafe, fromBuild, fromBuildMemo, MemoMapImpl, makeMemoMapUnsafe, forkMemoMapUnsafe, CurrentMemoMap, buildWithMemoMap, build, buildWithScope, succeed$5, succeedContext, empty$9, effect, effectImpl, effectContext, effectDiscard, mergeAllEffect, mergeAll, provideWith, provide$2, provideMerge, launch;
5284
5327
  var init_Layer = __esmMin((() => {
5285
5328
  init_Context();
@@ -5401,8 +5444,8 @@ var init_Layer = __esmMin((() => {
5401
5444
  provideMerge = /*#__PURE__*/ dual(2, (self, that) => provideWith(self, that, (self, that) => merge$4(that, self)));
5402
5445
  launch = (self) => scoped$1(andThen$1(build(self), never$2));
5403
5446
  }));
5404
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Cause.js
5405
- var isCause, isReason, isFailReason, fromReasons, fail$4, die$1, makeFailReason, makeDieReason, makeInterruptReason, hasInterruptsOnly, map$5, squash, findFail, hasDies, hasInterrupts, interruptors, isDone, Done, done, IllegalArgumentError, ExceededCapacityError, isUnknownError, UnknownError$1, annotate$2, reasonAnnotations, StackTrace;
5447
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Cause.js
5448
+ var isCause, isReason, isFailReason, isDieReason, fromReasons, fail$4, die$1, makeFailReason, makeDieReason, makeInterruptReason, hasInterruptsOnly, map$5, squash, findFail, findErrorOption, hasDies, hasInterrupts, interruptors, isDone, Done, done, IllegalArgumentError, ExceededCapacityError, isUnknownError, UnknownError$1, annotate$2, reasonAnnotations, StackTrace;
5406
5449
  var init_Cause = __esmMin((() => {
5407
5450
  init_Context();
5408
5451
  init_core();
@@ -5410,6 +5453,7 @@ var init_Cause = __esmMin((() => {
5410
5453
  isCause = isCause$1;
5411
5454
  isReason = isCauseReason;
5412
5455
  isFailReason = isFailReason$1;
5456
+ isDieReason = isDieReason$1;
5413
5457
  fromReasons = causeFromReasons;
5414
5458
  fail$4 = causeFail;
5415
5459
  die$1 = causeDie;
@@ -5420,6 +5464,7 @@ var init_Cause = __esmMin((() => {
5420
5464
  map$5 = causeMap;
5421
5465
  squash = causeSquash;
5422
5466
  findFail = findFail$1;
5467
+ findErrorOption = findErrorOption$1;
5423
5468
  hasDies = hasDies$1;
5424
5469
  hasInterrupts = hasInterrupts$2;
5425
5470
  interruptors = causeInterruptors;
@@ -5434,7 +5479,7 @@ var init_Cause = __esmMin((() => {
5434
5479
  reasonAnnotations = reasonAnnotations$1;
5435
5480
  StackTrace = class extends (/*#__PURE__*/ Service$1()("effect/Cause/StackTrace")) {};
5436
5481
  }));
5437
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Clock.js
5482
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Clock.js
5438
5483
  var Clock, currentTimeMillis, init_Clock = __esmMin((() => {
5439
5484
  init_effect();
5440
5485
  Clock = ClockRef;
@@ -5623,7 +5668,7 @@ var init_Number = __esmMin((() => {
5623
5668
  return Math.round(self * factor) / factor;
5624
5669
  });
5625
5670
  }));
5626
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Pull.js
5671
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Pull.js
5627
5672
  var catchDone, isDoneCause, isDoneFailure, filterDone, filterDoneLeftover, doneExitFromCause, matchEffect$1, init_Pull = __esmMin((() => {
5628
5673
  init_Cause();
5629
5674
  init_Exit();
@@ -5896,7 +5941,7 @@ var catchDone, isDoneCause, isDoneFailure, filterDone, filterDoneLeftover, doneE
5896
5941
  return self;
5897
5942
  };
5898
5943
  size = (self) => self.backing.size;
5899
- })), isEffect, all, forEach$1, whileLoop, promise, tryPromise, succeed$4, succeedNone, succeedSome, suspend$2, sync, void_$1, callback$1, never$1, gen, fail$3, failSync, failCause$3, failCauseSync, die, try_, withFiber, fromResult, fromOption, flatMap$1, flatten, andThen, tap, result$1, exit, map$4, as, asVoid, zipWith, catch_$2, catchTag, catchTags, catchReason, catchCause$2, catchDefect, catchIf, catchFilter, catchCauseIf, mapError$2, orDie, tapError$2, tapCause, retry, sandbox, ignore$1, ignoreCause, orElseSucceed, timeout, sleep, timed, raceFirst, filter, when$2, match, matchCauseEffect, matchEffect, context, contextWith, provide, provideContext$2, serviceOption, updateContext, provideService, scope, scoped, scopedWith, acquireRelease, acquireUseRelease, addFinalizer, ensuring$2, onError, onExitPrimitive, onExit$1, cached, interrupt$1, interruptible, onInterrupt, uninterruptible, uninterruptibleMask, forever, annotateCurrentSpan, makeSpanScoped, useSpan, withSpan, withParentSpan, forkChild, forkIn, forkScoped, forkDetach, runFork, runForkWith, runSyncExit, fnUntraced, fn, logFatal, logError, logDebug, annotateLogs, effectify, mapEager, mapErrorEager, mapBothEager, flatMapEager, fnUntracedEager, init_Effect = __esmMin((() => {
5944
+ })), isEffect, all, forEach$1, whileLoop, promise, tryPromise, succeed$4, succeedNone, succeedSome, suspend$2, sync, void_$1, callback$1, never$1, gen, fail$3, failSync, failCause$3, failCauseSync, die, try_, withFiber, fromResult, fromOption, flatMap$1, flatten, andThen, tap, result$1, exit, map$4, as, asVoid, zipWith, catch_$2, catchTag, catchTags, catchReason, catchCause$2, catchDefect, catchIf, catchFilter, catchCauseIf, mapError$2, orDie, tapError$2, tapCause, retry, sandbox, ignore$1, ignoreCause, orElseSucceed, timeout, sleep, timed, raceFirst, filter, when$2, match, matchCauseEffect, matchEffect, context, contextWith, provide, provideContext$2, serviceOption, updateContext, provideService, scope, scoped, scopedWith, acquireRelease, acquireUseRelease, addFinalizer, ensuring$2, onError, onExitPrimitive, onExit$1, cached, interrupt$1, interruptible, onInterrupt, uninterruptible, uninterruptibleMask, forever, annotateCurrentSpan, makeSpan, makeSpanScoped, useSpan, withSpan, withParentSpan, forkChild, forkIn, forkScoped, forkDetach, runFork, runForkWith, runSyncExit, fnUntraced, fn, logFatal, logError, logDebug, annotateLogs, effectify, mapEager, mapErrorEager, mapBothEager, flatMapEager, fnUntracedEager, init_Effect = __esmMin((() => {
5900
5945
  init_Function();
5901
5946
  init_core();
5902
5947
  init_effect();
@@ -5990,6 +6035,7 @@ var catchDone, isDoneCause, isDoneFailure, filterDone, filterDoneLeftover, doneE
5990
6035
  uninterruptibleMask = uninterruptibleMask$1;
5991
6036
  forever = forever$2;
5992
6037
  annotateCurrentSpan = annotateCurrentSpan$1;
6038
+ makeSpan = makeSpan$1;
5993
6039
  makeSpanScoped = makeSpanScoped$1;
5994
6040
  useSpan = useSpan$1;
5995
6041
  withSpan = withSpan$1;
@@ -6299,16 +6345,18 @@ var init_ByteSize = __esmMin((() => {
6299
6345
  };
6300
6346
  bytes = (value) => typeof value === "bigint" ? fromInputUnsafe(value) : fromNumber(value);
6301
6347
  }));
6302
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Fiber.js
6303
- var join$1, interrupt, getCurrent, runIn;
6348
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Fiber.js
6349
+ var await_, join$1, interrupt, interruptAs, getCurrent, runIn;
6304
6350
  var init_Fiber = __esmMin((() => {
6305
6351
  init_effect();
6352
+ await_ = fiberAwait;
6306
6353
  join$1 = fiberJoin;
6307
6354
  interrupt = fiberInterrupt;
6355
+ interruptAs = fiberInterruptAs;
6308
6356
  getCurrent = getCurrentFiber;
6309
6357
  runIn = fiberRunIn;
6310
6358
  }));
6311
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/glob.js
6359
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/glob.js
6312
6360
  init_Array();
6313
6361
  init_Deferred();
6314
6362
  init_Effect();
@@ -6863,7 +6911,7 @@ var walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
6863
6911
  finishing = true;
6864
6912
  })), _await(failed));
6865
6913
  });
6866
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/PlatformError.js
6914
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/PlatformError.js
6867
6915
  init_Data();
6868
6916
  var TypeId$43 = "~effect/PlatformError";
6869
6917
  /**
@@ -7009,13 +7057,13 @@ var systemError = (options) => new PlatformError(new SystemError(options));
7009
7057
  * @since 4.0.0
7010
7058
  */
7011
7059
  var badArgument = (options) => new PlatformError(new BadArgument(options));
7012
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Latch.js
7060
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Latch.js
7013
7061
  var makeUnsafe$4;
7014
7062
  var init_Latch = __esmMin((() => {
7015
7063
  init_effect();
7016
7064
  makeUnsafe$4 = makeLatchUnsafe;
7017
7065
  }));
7018
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/MutableRef.js
7066
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/MutableRef.js
7019
7067
  var TypeId$42, MutableRefProto, make$45, set$3;
7020
7068
  var init_MutableRef = __esmMin((() => {
7021
7069
  init_Function();
@@ -7042,8 +7090,8 @@ var init_MutableRef = __esmMin((() => {
7042
7090
  return self;
7043
7091
  });
7044
7092
  }));
7045
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/MutableList.js
7046
- var Empty$2, make$44, compactHead, emptyBucket, append, prepend, appendAll, appendAllUnsafe, clear, takeN, takeAll$1, take$1;
7093
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/MutableList.js
7094
+ var Empty$2, make$44, compactHead, emptyBucket, append, prepend, appendAll, appendAllUnsafe, clear, takeN, takeNVoid, takeAll$1, take$1;
7047
7095
  var init_MutableList = __esmMin((() => {
7048
7096
  init_count();
7049
7097
  Empty$2 = /*#__PURE__*/ Symbol.for("effect/MutableList/Empty");
@@ -7134,6 +7182,30 @@ var init_MutableList = __esmMin((() => {
7134
7182
  clear(self);
7135
7183
  return array;
7136
7184
  };
7185
+ takeNVoid = (self, n) => {
7186
+ n = normalize$2(n);
7187
+ if (n <= 0 || !self.head) return;
7188
+ n = Math.min(n, self.length);
7189
+ if (n === self.length && self.head?.offset === 0 && !self.head.next) {
7190
+ clear(self);
7191
+ return;
7192
+ }
7193
+ let count = 0;
7194
+ let chunk = self.head;
7195
+ while (chunk) {
7196
+ const size = chunk.array.length - chunk.offset;
7197
+ if (count + size > n) {
7198
+ chunk.offset += n - count;
7199
+ self.head = chunk;
7200
+ self.length -= n;
7201
+ compactHead(self);
7202
+ return;
7203
+ }
7204
+ count += size;
7205
+ chunk = chunk.next;
7206
+ }
7207
+ clear(self);
7208
+ };
7137
7209
  takeAll$1 = (self) => takeN(self, self.length);
7138
7210
  take$1 = (self) => {
7139
7211
  if (!self.head) return Empty$2;
@@ -7148,7 +7220,7 @@ var init_MutableList = __esmMin((() => {
7148
7220
  return message;
7149
7221
  };
7150
7222
  }));
7151
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/PubSub.js
7223
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/PubSub.js
7152
7224
  var TypeId$41, SubscriptionTypeId, make$43, unbounded, makeAtomicUnbounded, publish, subscribe, unsubscribe, AbsentValue, addSubscribers, removeSubscribers, makeSubscriptionUnsafe, UnboundedPubSub, UnboundedPubSubSubscription, SubscriptionImpl, PubSubImpl, makePubSubUnsafe, DroppingStrategy, strategyCompletePollersUnsafe, strategyCompleteSubscribersUnsafe, ReplayBuffer, ReplayWindowImpl, emptyReplayWindow;
7153
7225
  var init_PubSub = __esmMin((() => {
7154
7226
  init_Context();
@@ -7554,7 +7626,7 @@ var init_PubSub = __esmMin((() => {
7554
7626
  close: () => void 0
7555
7627
  };
7556
7628
  }));
7557
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Queue.js
7629
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Queue.js
7558
7630
  var TypeId$40, EnqueueTypeId, DequeueTypeId, variance$1, QueueProto, make$42, bounded, sliding, offer, offerUnsafe, offerAll, offerAllUnsafe, failCause$2, failCauseUnsafe, end, endUnsafe, shutdown, shutdownUnsafe, takeAll, takeBetween, take, poll, takeUnsafe, sizeUnsafe, exitFalse, exitTrue, exitFailDone, exitInterrupt, releaseTakers, scheduleReleaseTaker, takeBetweenUnsafe, suspendTake, canTake, awaitTake, offerOrWait, waitToOffer, resumeUnoffered, takeOfferUnsafe, releaseCapacity, finalize, init_Queue = __esmMin((() => {
7559
7631
  init_Array();
7560
7632
  init_Function();
@@ -7608,14 +7680,17 @@ var TypeId$40, EnqueueTypeId, DequeueTypeId, variance$1, QueueProto, make$42, bo
7608
7680
  offerUnsafe = (self, message) => {
7609
7681
  if (self.state._tag !== "Open") return false;
7610
7682
  else if (self.messages.length >= self.capacity) {
7611
- if (self.strategy === "sliding") {
7612
- take$1(self.messages);
7613
- append(self.messages, message);
7614
- return true;
7615
- } else if (self.capacity <= 0 && self.state.takers.size > 0) {
7683
+ if (self.capacity <= 0 && self.state.takers.size > (self.strategy === "sliding" ? 0 : self.messages.length)) {
7616
7684
  append(self.messages, message);
7685
+ if (self.strategy === "sliding") takeNVoid(self.messages, self.messages.length - self.state.takers.size);
7617
7686
  releaseTakers(self);
7618
7687
  return true;
7688
+ } else if (self.strategy === "sliding") {
7689
+ if (self.capacity > 0) {
7690
+ take$1(self.messages);
7691
+ append(self.messages, message);
7692
+ }
7693
+ return true;
7619
7694
  }
7620
7695
  return false;
7621
7696
  }
@@ -7637,12 +7712,15 @@ var TypeId$40, EnqueueTypeId, DequeueTypeId, variance$1, QueueProto, make$42, bo
7637
7712
  if (self.state._tag !== "Open") return fromIterable$2(messages);
7638
7713
  else if (self.capacity === Number.POSITIVE_INFINITY || self.strategy === "sliding") {
7639
7714
  appendAll(self.messages, messages);
7640
- if (self.strategy === "sliding") takeN(self.messages, self.messages.length - self.capacity);
7715
+ if (self.strategy === "sliding") {
7716
+ const capacity = self.capacity <= 0 ? self.state.takers.size : self.capacity;
7717
+ takeNVoid(self.messages, self.messages.length - capacity);
7718
+ }
7641
7719
  scheduleReleaseTaker(self);
7642
7720
  return [];
7643
7721
  }
7644
- const free = self.capacity <= 0 ? self.state.takers.size : self.capacity - self.messages.length;
7645
- if (free === 0) return fromIterable$2(messages);
7722
+ const free = (self.capacity <= 0 ? self.state.takers.size : self.capacity) - self.messages.length;
7723
+ if (free <= 0) return fromIterable$2(messages);
7646
7724
  const remaining = [];
7647
7725
  let i = 0;
7648
7726
  for (const message of messages) {
@@ -7930,7 +8008,7 @@ var TypeId$40, EnqueueTypeId, DequeueTypeId, variance$1, QueueProto, make$42, bo
7930
8008
  }
7931
8009
  };
7932
8010
  make$41 = (permits) => sync$1(() => new SemaphoreImpl(permits));
7933
- })), TypeId$39, isChannel, ChannelProto, fromTransform$1, transformPull$1, fromPull$1, fromTransformBracket, toTransform, asyncQueue, callbackArray, suspend$1, succeed$3, empty$7, fail$2, failCause$1, fromEffect$1, fromEffectDrain, fromQueueArray, map$3, mapDone, mapDoneEffect, concurrencyIsSequential, mapEffect$2, mapEffectSequential, mapEffectConcurrent, flattenArray, catchCause$1, catchCauseFilter, catch_$1, tapError$1, merge$3, mergeEffect$1, splitLines$2, decodeText$2, pipeTo, isUpstreamFailure, hasUpstreamFailure, upstreamFailureToDefect, unwrapUpstreamFailure, restoreUpstreamFailure, unwrap$5, onExit, ensuring$1, runWith$1, provideContext$1, runDrain$1, runForEach$1, runLast$1, runFold, toPullScoped;
8011
+ })), TypeId$39, isChannel, ChannelProto, fromTransform$1, transformPull$1, fromPull$1, fromTransformBracket, toTransform, asyncQueue, callbackArray, suspend$1, succeed$3, empty$7, fail$2, failCause$1, fromEffect$1, fromEffectDrain, fromQueueArray, map$3, mapDone, mapDoneEffect, concurrencyIsSequential, mapEffect$1, mapEffectSequential, mapEffectConcurrent, flattenArray, catchCause$1, catchCauseFilter, catch_$1, tapError$1, merge$3, mergeEffect$1, splitLines$2, decodeText$2, pipeTo, isUpstreamFailure, hasUpstreamFailure, upstreamFailureToDefect, unwrapUpstreamFailure, restoreUpstreamFailure, unwrap$5, onExit, ensuring$1, runWith$1, provideContext$1, runDrain$1, runForEach$1, runLast$1, runFold, toPullScoped;
7934
8012
  var init_Channel = __esmMin((() => {
7935
8013
  init_Array();
7936
8014
  init_Cause();
@@ -8004,7 +8082,7 @@ var init_Channel = __esmMin((() => {
8004
8082
  mapDone = /*#__PURE__*/ dual(2, (self, f) => mapDoneEffect(self, (o) => succeed$4(f(o))));
8005
8083
  mapDoneEffect = /*#__PURE__*/ dual(2, (self, f) => transformPull$1(self, (pull) => succeed$4(catchDone(pull, (done$14) => flatMap$1(f(done$14), done)))));
8006
8084
  concurrencyIsSequential = (concurrency) => concurrency === void 0 || concurrency !== "unbounded" && concurrency <= 1;
8007
- mapEffect$2 = /*#__PURE__*/ dual((args) => isChannel(args[0]), (self, f, options) => concurrencyIsSequential(options?.concurrency) ? mapEffectSequential(self, f) : mapEffectConcurrent(self, f, options));
8085
+ mapEffect$1 = /*#__PURE__*/ dual((args) => isChannel(args[0]), (self, f, options) => concurrencyIsSequential(options?.concurrency) ? mapEffectSequential(self, f) : mapEffectConcurrent(self, f, options));
8008
8086
  mapEffectSequential = (self, f) => fromTransform$1((upstream, scope) => {
8009
8087
  let i = 0;
8010
8088
  return map$4(toTransform(self)(upstream, scope), flatMap$1((o) => f(o, i++)));
@@ -8240,7 +8318,7 @@ var init_Channel = __esmMin((() => {
8240
8318
  }));
8241
8319
  toPullScoped = (self, scope) => toTransform(self)(done(), scope);
8242
8320
  }));
8243
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/stream.js
8321
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/stream.js
8244
8322
  var TypeId$38, streamVariance, Stream$1, fromChannel$2;
8245
8323
  var init_stream = __esmMin((() => {
8246
8324
  init_Function();
@@ -8262,7 +8340,7 @@ var init_stream = __esmMin((() => {
8262
8340
  };
8263
8341
  fromChannel$2 = (channel) => new Stream$1(channel);
8264
8342
  }));
8265
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Sink.js
8343
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Sink.js
8266
8344
  var TypeId$37, endVoid, sinkVariance, SinkProto, isSink, fromChannel$1, fromTransform, toChannel$1, drain, forEach, forEachArray, unwrap$4;
8267
8345
  var init_Sink = __esmMin((() => {
8268
8346
  init_Cause();
@@ -8300,8 +8378,8 @@ var init_Sink = __esmMin((() => {
8300
8378
  forEachArray = (f) => fromTransform((upstream) => upstream.pipe(flatMap$1(f), forever({ disableYield: true }), catchDone(() => endVoid)));
8301
8379
  unwrap$4 = (effect) => fromChannel$1(unwrap$5(map$4(effect, toChannel$1)));
8302
8380
  }));
8303
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/RcMap.js
8304
- var TypeId$36, makeUnsafe$2, make$40, get$3, removeInterrupted, closeEntry, release$1;
8381
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/RcMap.js
8382
+ var TypeId$36, makeUnsafe$2, make$40, get$3, removeInterrupted, closeEntry, resetExpiresAt, release$1;
8305
8383
  var init_RcMap = __esmMin((() => {
8306
8384
  init_Cause();
8307
8385
  init_Clock();
@@ -8398,7 +8476,10 @@ var init_RcMap = __esmMin((() => {
8398
8476
  }), runForkWith(context), runIn(self.scope));
8399
8477
  };
8400
8478
  closeEntry = (entry) => entry.fiber ? interrupt(entry.fiber).pipe(andThen(close(entry.scope, void_$2))) : close(entry.scope, void_$2);
8401
- release$1 = (self, key, entry) => withFiber((fiber) => {
8479
+ resetExpiresAt = (entry, clock) => {
8480
+ entry.expiresAt = clock.currentTimeMillisUnsafe() + toMillis(entry.idleTimeToLive);
8481
+ };
8482
+ release$1 = (self, key, entry) => suspend$2(() => {
8402
8483
  entry.refCount--;
8403
8484
  if (entry.refCount > 0) return void_$1;
8404
8485
  else if (self.state._tag === "Closed") return closeEntry(entry);
@@ -8408,8 +8489,8 @@ var init_RcMap = __esmMin((() => {
8408
8489
  remove$2(self.state.map, key);
8409
8490
  return closeEntry(entry);
8410
8491
  } else if (!isFinite$2(entry.idleTimeToLive)) return void_$1;
8411
- const clock = fiber.getRef(Clock);
8412
- entry.expiresAt = clock.currentTimeMillisUnsafe() + toMillis(entry.idleTimeToLive);
8492
+ const clock = get$5(self.context, Clock);
8493
+ resetExpiresAt(entry, clock);
8413
8494
  if (entry.fiber) return void_$1;
8414
8495
  entry.fiber = uninterruptibleMask(function loop(restore) {
8415
8496
  const now = clock.currentTimeMillisUnsafe();
@@ -8427,11 +8508,11 @@ var init_RcMap = __esmMin((() => {
8427
8508
  return flatMap$1(restore(clock.sleep(millis(remaining))), () => loop(restore));
8428
8509
  }).pipe(ensuring$2(sync(() => {
8429
8510
  entry.fiber = void 0;
8430
- })), runForkWith(fiber.context), runIn(self.scope));
8511
+ })), runForkWith(self.context), runIn(self.scope));
8431
8512
  return void_$1;
8432
8513
  });
8433
8514
  }));
8434
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/rcRef.js
8515
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/rcRef.js
8435
8516
  var TypeId$35, stateEmpty, stateClosed, variance, RcRefImpl, make$39, getState, awaitAcquiring, get$2, release;
8436
8517
  var init_rcRef = __esmMin((() => {
8437
8518
  init_Context();
@@ -8557,12 +8638,12 @@ var init_rcRef = __esmMin((() => {
8557
8638
  return void_$1;
8558
8639
  };
8559
8640
  }));
8560
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/RcRef.js
8641
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/RcRef.js
8561
8642
  var make$38, get$1, init_RcRef = __esmMin((() => {
8562
8643
  init_rcRef();
8563
8644
  make$38 = make$39;
8564
8645
  get$1 = get$2;
8565
- })), TypeId$34, isStream, fromChannel, fromEffect, fromPull, transformPull, toChannel, callback, empty$6, succeed$2, make$37, suspend, suspendedStreams, fail$1, failCause, fromArray, fromQueue, unwrap$3, mapEffect$1, drainFork, merge$2, mergeEffect, catchCause, catch_, tapError, transduce, decodeText$1, splitLines$1, ensuring, provideContext, run$4, runSink, runCollect, runLast, runForEach, runForEachArray, runDrain, mkString;
8646
+ })), TypeId$34, isStream, fromChannel, fromEffect, fromPull, transformPull, toChannel, callback, empty$6, succeed$2, make$37, suspend, suspendedStreams, fail$1, failCause, fromArray, fromQueue, unwrap$3, mapEffect, drainFork, merge$2, mergeEffect, catchCause, catch_, tapError, transduce, decodeText$1, splitLines$1, ensuring, provideContext, run$4, runSink, runCollect, runLast, runForEach, runForEachArray, runDrain, mkString;
8566
8647
  var init_Stream = __esmMin((() => {
8567
8648
  init_Array();
8568
8649
  init_Cause();
@@ -8597,7 +8678,7 @@ var init_Stream = __esmMin((() => {
8597
8678
  fromArray = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel(succeed$3(array)) : empty$6;
8598
8679
  fromQueue = (queue) => fromChannel(fromQueueArray(queue));
8599
8680
  unwrap$3 = (effect) => fromChannel(unwrap$5(map$4(effect, toChannel)));
8600
- mapEffect$1 = /*#__PURE__*/ dual((args) => isStream(args[0]), (self, f, options) => self.channel.pipe(flattenArray, mapEffect$2(f, options), map$3(of), fromChannel));
8681
+ mapEffect = /*#__PURE__*/ dual((args) => isStream(args[0]), (self, f, options) => self.channel.pipe(flattenArray, mapEffect$1(f, options), map$3(of), fromChannel));
8601
8682
  drainFork = /*#__PURE__*/ dual(2, (self, that) => mergeEffect(self, runDrain(that)));
8602
8683
  merge$2 = /*#__PURE__*/ dual((args) => isStream(args[0]) && isStream(args[1]), (self, that, options) => fromChannel(merge$3(toChannel(self), toChannel(that), options)));
8603
8684
  mergeEffect = /*#__PURE__*/ dual(2, (self, effect) => self.channel.pipe(mergeEffect$1(effect), fromChannel));
@@ -8647,7 +8728,7 @@ var init_Stream = __esmMin((() => {
8647
8728
  runDrain = (self) => runDrain$1(self.channel);
8648
8729
  mkString = (self) => runFold(self.channel, () => "", (acc, chunk) => acc + chunk.join(""));
8649
8730
  }));
8650
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/FileSystem.js
8731
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/FileSystem.js
8651
8732
  init_Array();
8652
8733
  init_ByteSize();
8653
8734
  init_Cause();
@@ -8831,7 +8912,7 @@ var FileTypeId = "~effect/FileSystem/File";
8831
8912
  * @since 4.0.0
8832
8913
  */
8833
8914
  var WatchBackend = class extends (/*#__PURE__*/ Service$1()("effect/FileSystem/WatchBackend")) {};
8834
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Path.js
8915
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Path.js
8835
8916
  init_Context();
8836
8917
  init_Option();
8837
8918
  /**
@@ -8948,7 +9029,7 @@ var make$35 = (impl) => Path$1.of({
8948
9029
  return relative === ".." || relative.startsWith(`..${impl.sep}`) || impl.isAbsolute(relative) ? none() : some(candidate);
8949
9030
  }
8950
9031
  });
8951
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/annotations.js
9032
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/annotations.js
8952
9033
  /** @internal */
8953
9034
  function resolve$1(ast) {
8954
9035
  return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
@@ -9000,20 +9081,21 @@ var init_annotations = __esmMin((() => {
9000
9081
  "toCodecArbitrary"
9001
9082
  ]);
9002
9083
  }));
9003
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/parser.js
9004
- var missing, succeed$1, missingExit, sameExit, toOption, fromOptionExit;
9084
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/parser.js
9085
+ var missing, succeed$1, missingExit, sameExit, isSameExit, toOption, fromOptionExit;
9005
9086
  var init_parser = __esmMin((() => {
9006
9087
  init_Exit();
9007
9088
  init_Option();
9008
9089
  init_core();
9009
- missing = /*#__PURE__*/ Symbol();
9090
+ missing = /*#__PURE__*/ Symbol.for("effect/schema/parser/missing");
9010
9091
  succeed$1 = succeed$7;
9011
9092
  missingExit = /*#__PURE__*/ succeed$1(missing);
9012
- sameExit = /*#__PURE__*/ succeed$1(missing);
9093
+ sameExit = /*#__PURE__*/ Object.assign(/*#__PURE__*/ succeed$1(missing), { [missing]: true });
9094
+ isSameExit = (result) => result[missing] === true;
9013
9095
  toOption = (value) => value === missing ? none() : some(value);
9014
9096
  fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed$1(option.value);
9015
9097
  }));
9016
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaIssue.js
9098
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/SchemaIssue.js
9017
9099
  /**
9018
9100
  * Returns `true` if the given value is an {@link Issue}.
9019
9101
  *
@@ -9383,7 +9465,7 @@ var init_SchemaIssue = __esmMin((() => {
9383
9465
  defaultCheckHook = (issue) => findMessage(issue) ?? findMessage(issue.issue);
9384
9466
  defaultFormatter$1 = /*#__PURE__*/ makeFormatterDefault();
9385
9467
  }));
9386
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/cause.js
9468
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/cause.js
9387
9469
  /** @internal */
9388
9470
  function getSchemaIssue(cause) {
9389
9471
  let issue;
@@ -9413,9 +9495,26 @@ var init_DateTime = __esmMin((() => {
9413
9495
  toUtc = toUtc$1;
9414
9496
  formatIso = formatIso$1;
9415
9497
  }));
9416
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/encoding/Base64.js
9417
- var encode, decode$1, encodeBytes, encodeShort, encodeLong, encoder$1, decoder$2, stripCrlf, alphabet, alphabetCodes, paddingCode, codes, getCode;
9498
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/base64.js
9499
+ var decodeNative, stripCrlf;
9500
+ var init_base64 = __esmMin((() => {
9501
+ decodeNative = (str, decodedLength, options) => {
9502
+ if (str.length < 128) return void 0;
9503
+ const NativeUint8Array = Uint8Array;
9504
+ if (typeof NativeUint8Array.fromBase64 !== "function") return void 0;
9505
+ try {
9506
+ const bytes = NativeUint8Array.fromBase64(str, options);
9507
+ return bytes.length === decodedLength ? bytes : null;
9508
+ } catch {
9509
+ return null;
9510
+ }
9511
+ };
9512
+ stripCrlf = (str) => str.indexOf("\n") === -1 && str.indexOf("\r") === -1 ? str : str.replace(/[\n\r]/g, "");
9513
+ }));
9514
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/encoding/Base64.js
9515
+ var encode, decode$1, encodeBytes, encodeShort, encodeLong, encoder$1, decoder$2, alphabet, alphabetCodes, paddingCode, invalidCharacter, codes, getCode;
9418
9516
  var init_Base64 = __esmMin((() => {
9517
+ init_base64();
9419
9518
  init_Result();
9420
9519
  init_EncodingError();
9421
9520
  encode = (input) => encodeBytes(typeof input === "string" ? encoder$1.encode(input) : input);
@@ -9435,9 +9534,21 @@ var init_Base64 = __esmMin((() => {
9435
9534
  input: stripped,
9436
9535
  message: "Found a '=' character, but it is not at the end"
9437
9536
  }));
9537
+ const missingOctets = stripped.endsWith("==") ? 2 : stripped.endsWith("=") ? 1 : 0;
9538
+ const decodedLength = 3 * (length / 4) - missingOctets;
9539
+ const native = decodeNative(stripped, decodedLength, void 0);
9540
+ if (native) return succeed$9(native);
9541
+ if (native === null) {
9542
+ const invalid = invalidCharacter.exec(stripped);
9543
+ if (invalid !== null) return fail$8(new EncodingError({
9544
+ kind: "Decode",
9545
+ module: "Base64",
9546
+ input: stripped,
9547
+ message: `Invalid character ${invalid[0]}`
9548
+ }));
9549
+ }
9438
9550
  try {
9439
- const missingOctets = stripped.endsWith("==") ? 2 : stripped.endsWith("=") ? 1 : 0;
9440
- const result = new Uint8Array(3 * (length / 4) - missingOctets);
9551
+ const result = new Uint8Array(decodedLength);
9441
9552
  for (let i = 0, j = 0; i < length; i += 4, j += 3) {
9442
9553
  const buffer = getCode(stripped.charCodeAt(i)) << 18 | getCode(stripped.charCodeAt(i + 1)) << 12 | getCode(stripped.charCodeAt(i + 2)) << 6 | getCode(stripped.charCodeAt(i + 3));
9443
9554
  result[j] = buffer >> 16;
@@ -9509,11 +9620,11 @@ var init_Base64 = __esmMin((() => {
9509
9620
  return decoder$2.decode(result);
9510
9621
  };
9511
9622
  encoder$1 = /*#__PURE__*/ new TextEncoder();
9512
- decoder$2 = /*#__PURE__*/ new TextDecoder();
9513
- stripCrlf = (str) => str.replace(/[\n\r]/g, "");
9623
+ decoder$2 = /*#__PURE__*/ new TextDecoder("utf-8", { ignoreBOM: true });
9514
9624
  alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
9515
9625
  alphabetCodes = /*#__PURE__*/ encoder$1.encode(alphabet);
9516
9626
  paddingCode = /*#__PURE__*/ "=".charCodeAt(0);
9627
+ invalidCharacter = /[^A-Za-z0-9+/=]/;
9517
9628
  codes = /*#__PURE__*/ (/* @__PURE__ */ new Uint8Array(123)).fill(255);
9518
9629
  for (let i = 0; i < 64; i++) codes[/*#__PURE__*/ alphabet.charCodeAt(i)] = i;
9519
9630
  codes[/*#__PURE__*/ "=".charCodeAt(0)] = 0;
@@ -9522,7 +9633,7 @@ var init_Base64 = __esmMin((() => {
9522
9633
  return codes[charCode];
9523
9634
  };
9524
9635
  }));
9525
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaGetter.js
9636
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/SchemaGetter.js
9526
9637
  /**
9527
9638
  * Creates a getter that always fails with the given issue.
9528
9639
  *
@@ -10086,7 +10197,7 @@ var init_BigDecimal = __esmMin((() => {
10086
10197
  };
10087
10198
  isZero = (n) => n.value === bigint0;
10088
10199
  }));
10089
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/content.js
10200
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/content.js
10090
10201
  /** @internal */
10091
10202
  function getContent(operation) {
10092
10203
  return operation[ContentTypeId];
@@ -10095,7 +10206,7 @@ var ContentTypeId;
10095
10206
  var init_content = __esmMin((() => {
10096
10207
  ContentTypeId = /*#__PURE__*/ Symbol.for("~effect/Schema/content");
10097
10208
  }));
10098
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaTransformation.js
10209
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/SchemaTransformation.js
10099
10210
  /**
10100
10211
  * Returns `true` if `u` is a `Transformation` instance.
10101
10212
  *
@@ -10309,7 +10420,7 @@ var init_SchemaTransformation = __esmMin((() => {
10309
10420
  });
10310
10421
  uint8ArrayFromBase64String = /*#__PURE__*/ new Transformation(/*#__PURE__*/ decodeBase64(), /*#__PURE__*/ encodeBase64());
10311
10422
  }));
10312
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaAST.js
10423
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/SchemaAST.js
10313
10424
  function makeGuard(tag) {
10314
10425
  return (ast) => ast._tag === tag;
10315
10426
  }
@@ -10361,7 +10472,7 @@ function hasCheck(checks, id) {
10361
10472
  /** @internal */
10362
10473
  function stepArray(s, item, exit, i) {
10363
10474
  if (exit._tag === "Failure") return wrapPropertyKeyIssue(s, s.ast, i, exit);
10364
- const value = exit === sameExit ? item : exit[args];
10475
+ const value = isSameExit(exit) ? item : exit[args];
10365
10476
  if (value !== missing) s.output[i] = value;
10366
10477
  else {
10367
10478
  const p = s.getParser(s.tailThreshold, i);
@@ -10419,7 +10530,7 @@ function isIndexSignatureParameter(ast) {
10419
10530
  /** @internal */
10420
10531
  function stepProperty(s, p, exit) {
10421
10532
  if (exit._tag === "Failure") return wrapPropertyKeyIssue(s, s.ast, p.name, exit);
10422
- if (exit === sameExit) return;
10533
+ if (isSameExit(exit)) return;
10423
10534
  const value = exit[args];
10424
10535
  if (value !== missing) {
10425
10536
  assignProperty(s.out, p.name, value);
@@ -10695,8 +10806,7 @@ function parseUnionCandidates(ast, parser, candidates, input, options) {
10695
10806
  }
10696
10807
  function resumeUnion(eff, state) {
10697
10808
  return flatMapEager(eff, (_) => {
10698
- if (state.out === sameExit) return succeed$4(state.input);
10699
- if (state.out) return state.out;
10809
+ if (state.out) return isSameExit(state.out) ? succeed$4(state.input) : state.out;
10700
10810
  return fail$3(new AnyOf(state.ast, state.issues ?? [], state.input, state.options));
10701
10811
  });
10702
10812
  }
@@ -11181,7 +11291,7 @@ function isJson(u) {
11181
11291
  function isStringTree(u) {
11182
11292
  return isTree(u, isStringTreeLeaf);
11183
11293
  }
11184
- var isDeclaration, isNever, isLiteral, isUniqueSymbol, isArrays, isObjects, isSuspend, Link, defaultParseOptions, Context, TypeId$28, ASTNodeImpl, Declaration, Null$1, null_, Undefined$1, undefinedToNull, undefined_, Void$1, void_, Never$1, never, Any$1, any, Unknown$1, unknown, TemplateLiteral$1, Literal$1, String$7, string$1, Number$3, number, Boolean$5, boolean, BigInt$2, bigInt, Arrays, parseArrayOptions, parseArray, parseArrayConcurrent, wrapPropertyKeyIssue, FINITE_PATTERN, PropertySignature, IndexSignature, Objects, parsePropertiesOptions, parseProperties, parsePropertiesConcurrent, toCandidate, candidateIndexCache, emptyCandidates, getRuntimeType, hasPropertySignature, Union$1, parseUnion, nonFiniteLiterals, Filter, FilterGroup, finite, numberToJson, bodyOwners, optionalKey$1, optionalKeyLastLink, optional$9, toType$1, toEncoded$1, flip, parameterFromPropertyKey, parameterFromString, partFromString, STRING_PATTERN, isStringFiniteRegExp, isStringNumberRegExp, finiteString, finiteToString, numberToString, isStringBigIntRegExp, bigIntString, bigIntToString, resolveDescription, Json$1, MutableJson$1, unknownToJson, objectKeywordToJson, StringTree, unknownToStringTree;
11294
+ var isDeclaration, isNever, isLiteral, isUniqueSymbol, isArrays, isObjects, isSuspend, Link, defaultParseOptions, Context, TypeId$28, ASTNodeImpl, Declaration, Null$1, null_, Undefined$1, undefinedToNull, undefined_, Void$1, void_, Never$1, never, Any$1, any, Unknown$1, unknown, TemplateLiteral$1, Literal$1, String$7, string$1, Number$3, number, Boolean$5, boolean, BigInt$2, bigInt, Arrays, parseArrayOptions, parseArray, parseArrayConcurrent, wrapPropertyKeyIssue, FINITE_PATTERN, PropertySignature, IndexSignature, Objects, parsePropertiesOptions, parseProperties, parsePropertiesConcurrent, toCandidate, candidateIndexCache, emptyCandidates, getRuntimeType, objectPrototypeKeys, requiresOwnProperty, hasPropertySignature, Union$1, parseUnion, nonFiniteLiterals, Filter, FilterGroup, finite, numberToJson, bodyOwners, optionalKey$1, optionalKeyLastLink, optional$9, toType$1, toEncoded$1, flip, parameterFromPropertyKey, parameterFromString, partFromString, STRING_PATTERN, isStringFiniteRegExp, isStringNumberRegExp, finiteString, finiteToString, numberToString, isStringBigIntRegExp, bigIntString, bigIntToString, resolveDescription, Json$1, MutableJson$1, unknownToJson, objectKeywordToJson, StringTree, unknownToStringTree;
11185
11295
  var init_SchemaAST = __esmMin((() => {
11186
11296
  init_Array();
11187
11297
  init_Cause();
@@ -11714,7 +11824,8 @@ var init_SchemaAST = __esmMin((() => {
11714
11824
  properties = ast.propertySignatures.map((ps) => ({
11715
11825
  parser: compileField(ps.type),
11716
11826
  name: ps.name,
11717
- type: ps.type
11827
+ type: ps.type,
11828
+ ownOnly: requiresOwnProperty(ps.name)
11718
11829
  }));
11719
11830
  indexes = indexCount ? ast.indexSignatures.map((is) => ({
11720
11831
  is,
@@ -11728,7 +11839,7 @@ var init_SchemaAST = __esmMin((() => {
11728
11839
  const expectedKeys = new Set(ast.propertySignatures.map((ps) => typeof ps.name === "number" ? globalThis.String(ps.name) : ps.name));
11729
11840
  const finishIndex = (s, key, k2, inputValue, exitValue) => {
11730
11841
  if (exitValue._tag === "Failure") return wrapPropertyKeyIssue(s, ast, key, exitValue) ?? void_$2;
11731
- const value = exitValue === sameExit ? inputValue : exitValue[args];
11842
+ const value = isSameExit(exitValue) ? inputValue : exitValue[args];
11732
11843
  if (k2 !== missing && value !== missing) {
11733
11844
  if (hasProperties && (expectedKeys.has(key) || expectedKeys.has(typeof k2 === "number" ? globalThis.String(k2) : k2))) return void_$2;
11734
11845
  assignProperty(s.out, k2, value);
@@ -11742,7 +11853,7 @@ var init_SchemaAST = __esmMin((() => {
11742
11853
  exitKey = eff;
11743
11854
  }
11744
11855
  if (exitKey._tag === "Failure") return wrapPropertyKeyIssue(s, ast, key, exitKey) ?? void_$2;
11745
- const k2 = exitKey === sameExit ? key : exitKey[args];
11856
+ const k2 = isSameExit(exitKey) ? key : exitKey[args];
11746
11857
  const inputValue = s.input[key];
11747
11858
  const result = index.parserValue(inputValue, s.options);
11748
11859
  return effectIsExit(result) ? finishIndex(s, key, k2, inputValue, result) : flatMap$1(exit(result), (exit) => finishIndex(s, key, k2, inputValue, exit));
@@ -11852,11 +11963,11 @@ var init_SchemaAST = __esmMin((() => {
11852
11963
  for (let index = 0; index < props.length; index++) {
11853
11964
  const property = props[index];
11854
11965
  const name = property.name;
11855
- const hasKey = hasPropertySignature(record, name);
11966
+ const hasKey = property.ownOnly ? Object.hasOwn(record, name) : name in record;
11856
11967
  const value = hasKey ? record[name] : missing;
11857
11968
  const exit = property.parser(value, options);
11858
11969
  if (!effectIsExit(exit)) return resume(state, index, exit);
11859
- if (exit === sameExit) {
11970
+ if (isSameExit(exit)) {
11860
11971
  if (hasKey) assignProperty(out, name, value);
11861
11972
  continue;
11862
11973
  }
@@ -11897,7 +12008,7 @@ var init_SchemaAST = __esmMin((() => {
11897
12008
  };
11898
12009
  parsePropertiesOptions = {
11899
12010
  onItem(s, p) {
11900
- if (!hasPropertySignature(s.input, p.name)) return p.parser(missing, s.options);
12011
+ if (!(p.ownOnly ? Object.hasOwn(s.input, p.name) : p.name in s.input)) return p.parser(missing, s.options);
11901
12012
  const value = s.input[p.name];
11902
12013
  assignProperty(s.out, p.name, value);
11903
12014
  return p.parser(value, s.options);
@@ -11918,7 +12029,9 @@ var init_SchemaAST = __esmMin((() => {
11918
12029
  candidateIndexCache = /*#__PURE__*/ new WeakMap();
11919
12030
  emptyCandidates = /*#__PURE__*/ Object.freeze([]);
11920
12031
  getRuntimeType = (input) => input === null ? "null" : Array.isArray(input) ? "array" : typeof input;
11921
- hasPropertySignature = (input, key) => key === "__proto__" ? Object.hasOwn(input, key) : key in input;
12032
+ objectPrototypeKeys = /*#__PURE__*/ new Set(Reflect.ownKeys(Object.prototype)).add("__proto__");
12033
+ requiresOwnProperty = (key) => objectPrototypeKeys.has(typeof key === "number" ? globalThis.String(key) : key);
12034
+ hasPropertySignature = (input, key) => Object.hasOwn(input, key) || key in input && !requiresOwnProperty(key);
11922
12035
  Union$1 = class extends ASTNodeImpl {
11923
12036
  _tag = "Union";
11924
12037
  types;
@@ -12080,13 +12193,10 @@ var init_SchemaAST = __esmMin((() => {
12080
12193
  return type === owner && ast.encoding === void 0 ? ast : replaceContext(type, ast.context);
12081
12194
  }
12082
12195
  const type = "recur" in ast ? ast.recur(toType$1) : ast;
12083
- if ("encodingChecks" in type && type.encodingChecks) {
12084
- const checks = canPreserveEncodingChecks(ast) ? type.encodingChecks : isArrays(type) || isObjects(type) || isDeclaration(type) && type.typeParameters.length > 0 ? extractStructuralChecks(type.encodingChecks) : void 0;
12085
- return copy$1(type, {
12086
- encodingChecks: void 0,
12087
- checks: combineChecks(type.checks, checks)
12088
- });
12089
- }
12196
+ if ("encodingChecks" in type && type.encodingChecks) return copy$1(type, {
12197
+ encodingChecks: void 0,
12198
+ checks: combineChecks(canPreserveEncodingChecks(ast) ? type.encodingChecks : isArrays(type) || isObjects(type) || isDeclaration(type) && type.typeParameters.length > 0 ? extractStructuralChecks(type.encodingChecks) : void 0, type.checks)
12199
+ });
12090
12200
  return type;
12091
12201
  });
12092
12202
  toEncoded$1 = /*#__PURE__*/ memoizeIdempotent((ast) => {
@@ -12156,7 +12266,7 @@ var init_SchemaAST = __esmMin((() => {
12156
12266
  });
12157
12267
  unknownToStringTree = /*#__PURE__*/ new Link(StringTree, /*#__PURE__*/ passthrough());
12158
12268
  }));
12159
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Brand.js
12269
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Brand.js
12160
12270
  init_Option();
12161
12271
  init_Result();
12162
12272
  /**
@@ -12182,7 +12292,7 @@ function nominal() {
12182
12292
  is: (_) => true
12183
12293
  });
12184
12294
  }
12185
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/process/ChildProcessSpawner.js
12295
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/process/ChildProcessSpawner.js
12186
12296
  /**
12187
12297
  * Service boundary for starting and controlling child processes.
12188
12298
  *
@@ -12263,7 +12373,7 @@ var make$32 = (spawn) => {
12263
12373
  * @since 4.0.0
12264
12374
  */
12265
12375
  var ChildProcessSpawner = class extends (/*#__PURE__*/ Service$1()("effect/process/ChildProcessSpawner")) {};
12266
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/redacted.js
12376
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/redacted.js
12267
12377
  var redactedRegistry, value$3;
12268
12378
  var init_redacted = __esmMin((() => {
12269
12379
  redactedRegistry = /*#__PURE__*/ new WeakMap();
@@ -12272,7 +12382,7 @@ var init_redacted = __esmMin((() => {
12272
12382
  else throw new Error("Unable to get redacted value" + (self.label ? ` with label: "${self.label}"` : ""));
12273
12383
  };
12274
12384
  }));
12275
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Redacted.js
12385
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Redacted.js
12276
12386
  var TypeId$27, isRedacted, make$31, Proto$14, value$2, makeEquivalence;
12277
12387
  var init_Redacted = __esmMin((() => {
12278
12388
  init_Equal();
@@ -12309,7 +12419,7 @@ var init_Redacted = __esmMin((() => {
12309
12419
  value$2 = value$3;
12310
12420
  makeEquivalence = (isEquivalent) => make$55((x, y) => isEquivalent(value$2(x), value$2(y)));
12311
12421
  }));
12312
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/process/CommandLine.js
12422
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/process/CommandLine.js
12313
12423
  init_Data();
12314
12424
  init_Redacted();
12315
12425
  init_Result();
@@ -12334,7 +12444,7 @@ init_Result();
12334
12444
  *
12335
12445
  * @stability unstable
12336
12446
  * @category errors
12337
- * @since 4.0.7
12447
+ * @since 4.1.0
12338
12448
  */
12339
12449
  var CommandLineError = class extends (/*#__PURE__*/ TaggedError$1("CommandLineError")) {};
12340
12450
  /**
@@ -12375,7 +12485,7 @@ var CommandLineError = class extends (/*#__PURE__*/ TaggedError$1("CommandLineEr
12375
12485
  *
12376
12486
  * @stability unstable
12377
12487
  * @category encoding
12378
- * @since 4.0.7
12488
+ * @since 4.1.0
12379
12489
  */
12380
12490
  var display = (words, options) => {
12381
12491
  if (words.length === 0) return "";
@@ -12439,7 +12549,7 @@ var display = (words, options) => {
12439
12549
  *
12440
12550
  * @stability unstable
12441
12551
  * @category constructors
12442
- * @since 4.0.7
12552
+ * @since 4.1.0
12443
12553
  */
12444
12554
  var template = (strings, ...expressions) => {
12445
12555
  const index = strings.findIndex((text) => text === void 0);
@@ -12610,7 +12720,7 @@ var parseTemplate$1 = (texts, values) => {
12610
12720
  endWord();
12611
12721
  return succeed$9(words);
12612
12722
  };
12613
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/process/ChildProcess.js
12723
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/process/ChildProcess.js
12614
12724
  init_Context();
12615
12725
  init_Effectable();
12616
12726
  init_Result();
@@ -12745,7 +12855,7 @@ var shellScript = (templates, expressions) => {
12745
12855
  });
12746
12856
  return script;
12747
12857
  };
12748
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
12858
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
12749
12859
  var buildSpawnOptions = (options, base, platform) => {
12750
12860
  const detached = options.detached ?? platform !== "win32";
12751
12861
  return {
@@ -12755,7 +12865,7 @@ var buildSpawnOptions = (options, base, platform) => {
12755
12865
  windowsHide: options.windowsHide ?? !detached
12756
12866
  };
12757
12867
  };
12758
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/internal/utils.js
12868
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/internal/utils.js
12759
12869
  /** @internal */
12760
12870
  var handleErrnoException = (module, method) => (err, [path]) => {
12761
12871
  let reason = "Unknown";
@@ -12790,7 +12900,7 @@ var handleErrnoException = (module, method) => (err, [path]) => {
12790
12900
  cause: err
12791
12901
  });
12792
12902
  };
12793
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/internal/stream.js
12903
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/internal/stream.js
12794
12904
  var destroyStream = (stream, cleanup, onDestroyed) => {
12795
12905
  if (!("closed" in stream)) {
12796
12906
  cleanup();
@@ -12817,7 +12927,7 @@ var destroyStream = (stream, cleanup, onDestroyed) => {
12817
12927
  cleanup();
12818
12928
  if (!stream.closed) stream.destroy();
12819
12929
  };
12820
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/NodeSink.js
12930
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/NodeSink.js
12821
12931
  init_Cause();
12822
12932
  init_Channel();
12823
12933
  init_Deferred();
@@ -12943,7 +13053,7 @@ var pullIntoWritable = (options) => withFiber((fiber) => {
12943
13053
  } else removeErrorListener();
12944
13054
  })));
12945
13055
  });
12946
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/NodeStream.js
13056
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/NodeStream.js
12947
13057
  init_Array();
12948
13058
  init_Cause();
12949
13059
  init_Channel();
@@ -13020,7 +13130,7 @@ var readableToPullUnsafe = (options) => {
13020
13130
  })), pull);
13021
13131
  };
13022
13132
  var defaultOnError = (error) => new UnknownError$1(error);
13023
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
13133
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
13024
13134
  init_Deferred();
13025
13135
  init_Duration();
13026
13136
  init_Effect();
@@ -13028,6 +13138,7 @@ init_Exit();
13028
13138
  init_Layer();
13029
13139
  init_Predicate();
13030
13140
  init_Redacted();
13141
+ init_Scope();
13031
13142
  init_Sink();
13032
13143
  init_Stream();
13033
13144
  var toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
@@ -13388,11 +13499,7 @@ var layer$10 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(fun
13388
13499
  const cwd = yield* resolveWorkingDirectory(cmd.options);
13389
13500
  const env = resolveEnvironment(cmd.options);
13390
13501
  const stdio = buildStdioArray(stdinConfig, stdoutConfig, stderrConfig, resolvedAdditionalFds);
13391
- const [childProcess, exitSignal] = yield* acquireRelease(spawn(cmd, buildSpawnOptions(cmd.options, {
13392
- cwd,
13393
- env,
13394
- stdio
13395
- }, process.platform)), fnUntraced(function* ([childProcess, exitSignal]) {
13502
+ const releaseProcess = fnUntraced(function* (childProcess, exitSignal) {
13396
13503
  if (yield* isDone$1(exitSignal)) {
13397
13504
  const [code] = yield* _await(exitSignal);
13398
13505
  if (code !== 0 && isNotNull(code)) yield* ignore$1(terminateProcessGroup(cmd, childProcess, exitSignal, cmd.options));
@@ -13401,6 +13508,15 @@ var layer$10 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(fun
13401
13508
  }
13402
13509
  if (!isReferenced) return;
13403
13510
  yield* ignore$1(terminateProcessGroup(cmd, childProcess, exitSignal, cmd.options));
13511
+ });
13512
+ const inputScope = makeUnsafe$6();
13513
+ const [childProcess, exitSignal] = yield* acquireRelease(spawn(cmd, buildSpawnOptions(cmd.options, {
13514
+ cwd,
13515
+ env,
13516
+ stdio
13517
+ }, process.platform)), ([childProcess, exitSignal], exit) => all([close(inputScope, exit), releaseProcess(childProcess, exitSignal)], {
13518
+ concurrency: "unbounded",
13519
+ discard: true
13404
13520
  }));
13405
13521
  const pid = ProcessId(childProcess.pid);
13406
13522
  if (cmd.options.detached !== false) childProcess.on("exit", (code) => {
@@ -13420,9 +13536,9 @@ var layer$10 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(fun
13420
13536
  return reref;
13421
13537
  });
13422
13538
  const inputFailure = makeUnsafe$7();
13423
- const stdin = yield* setupChildStdin(cmd, childProcess, stdinConfig, inputFailure);
13424
- const { all, stderr, stdout } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);
13425
- const { getInputFd, getOutputFd } = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds, inputFailure);
13539
+ const stdin = yield* provide$3(inputScope)(setupChildStdin(cmd, childProcess, stdinConfig, inputFailure));
13540
+ const { all: all$2, stderr, stdout } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);
13541
+ const { getInputFd, getOutputFd } = yield* provide$3(inputScope)(setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds, inputFailure));
13426
13542
  const isRunning = map$4(isDone$1(exitSignal), (done) => !done);
13427
13543
  const exitCode = flatMap$1(raceFirst(_await(exitSignal), _await(inputFailure)), ([code, signal]) => {
13428
13544
  if (isDoneUnsafe(inputFailure)) return _await(inputFailure);
@@ -13439,7 +13555,7 @@ var layer$10 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(fun
13439
13555
  stdin,
13440
13556
  stdout,
13441
13557
  stderr,
13442
- all,
13558
+ all: all$2,
13443
13559
  getInputFd,
13444
13560
  getOutputFd,
13445
13561
  unref
@@ -13546,7 +13662,7 @@ var flattenCommand = (command) => {
13546
13662
  pipeOptions
13547
13663
  };
13548
13664
  };
13549
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Ref.js
13665
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Ref.js
13550
13666
  init_Effect();
13551
13667
  init_Function();
13552
13668
  init_core();
@@ -13717,7 +13833,10 @@ var get = (self) => sync(() => self.ref.current), set$2 = /*#__PURE__*/ dual(2,
13717
13833
  if (input === void 0) return empty$4;
13718
13834
  else if (Symbol.iterator in input) {
13719
13835
  const out = Object.create(Proto$11);
13720
- for (const [k, v] of input) out[k.toLowerCase()] = v;
13836
+ for (const [k, v] of input) {
13837
+ const key = k.toLowerCase();
13838
+ out[key] = key in out ? `${out[key]}, ${v}` : v;
13839
+ }
13721
13840
  return out;
13722
13841
  }
13723
13842
  const out = Object.create(Proto$11);
@@ -13831,7 +13950,7 @@ var init_UrlParams = __esmMin((() => {
13831
13950
  };
13832
13951
  coerce = (value) => isRedacted(value) ? value : String(value);
13833
13952
  }));
13834
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/interpreter.js
13953
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/interpreter.js
13835
13954
  function compileTransformation(transformation) {
13836
13955
  const apply = compileTransformationUnsafe(transformation);
13837
13956
  return (result, current, options) => {
@@ -13844,12 +13963,12 @@ function compileTransformation(transformation) {
13844
13963
  }
13845
13964
  function compileTransformationUnsafe(transformation) {
13846
13965
  if (transformation._tag === "Middleware") return (result, current, options) => {
13847
- const transformed = result === sameExit ? transformation.decode(succeed$1(toOption(current)), options) : transformation.decode(mapEager(result, toOption), options);
13966
+ const transformed = isSameExit(result) ? transformation.decode(succeed$1(toOption(current)), options) : transformation.decode(mapEager(result, toOption), options);
13848
13967
  return fromOptionalEffect(transformed);
13849
13968
  };
13850
13969
  const getter = transformation.decode;
13851
13970
  switch (getter._tag) {
13852
- case "Passthrough": return (result, current) => result === sameExit ? succeed$1(current) : result;
13971
+ case "Passthrough": return (result, current) => isSameExit(result) ? succeed$1(current) : result;
13853
13972
  case "Transform": {
13854
13973
  const transform = (value) => value === missing ? missingExit : succeed$1(getter.transform(value));
13855
13974
  return (result, current) => flatMapTransformation(result, current, transform);
@@ -13879,11 +13998,11 @@ function withDefault$2(ast, parser) {
13879
13998
  const result = defaultValue;
13880
13999
  if (effectIsExit(result) && result._tag === "Success") {
13881
14000
  const local = parser(result[args], options);
13882
- return local === sameExit ? result : local;
14001
+ return isSameExit(local) ? result : local;
13883
14002
  }
13884
14003
  return flatMapEager(wrapEncoding(ast, input, options, result), (value) => {
13885
14004
  const local = parser(value, options);
13886
- return local === sameExit ? succeed$1(value) : local;
14005
+ return isSameExit(local) ? succeed$1(value) : local;
13887
14006
  });
13888
14007
  };
13889
14008
  }
@@ -13909,7 +14028,7 @@ function compile(ast, compile, compileField, base, specialize) {
13909
14028
  if (encodingChecks && !options.disableChecks) {
13910
14029
  if (effectIsExit(result)) {
13911
14030
  if (result._tag === "Success") {
13912
- const output = result === sameExit ? input : result[args];
14031
+ const output = isSameExit(result) ? input : result[args];
13913
14032
  if (input !== missing && output !== missing) {
13914
14033
  const issues = collectIssues(encodingChecks, input, void 0, ast, options);
13915
14034
  if (issues) result = fail$3(new Composite(ast, issues, input, options));
@@ -13926,7 +14045,7 @@ function compile(ast, compile, compileField, base, specialize) {
13926
14045
  if (checks && !options.disableChecks) {
13927
14046
  if (effectIsExit(result)) {
13928
14047
  if (result._tag === "Success") {
13929
- const value = result === sameExit ? input : result[args];
14048
+ const value = isSameExit(result) ? input : result[args];
13930
14049
  if (value === missing) return result;
13931
14050
  const issues = collectIssues(checks, value, void 0, ast, options);
13932
14051
  if (issues) result = fail$3(new Composite(ast, issues, value, options));
@@ -13959,19 +14078,19 @@ function compile(ast, compile, compileField, base, specialize) {
13959
14078
  result = next(current, options);
13960
14079
  } else result = flatMapEager(result, (value) => {
13961
14080
  const nextResult = next(value, options);
13962
- return nextResult === sameExit ? succeed$1(value) : nextResult;
14081
+ return isSameExit(nextResult) ? succeed$1(value) : nextResult;
13963
14082
  });
13964
14083
  }
13965
14084
  }
13966
14085
  if (result._tag === "Success") {
13967
14086
  const value = result[args];
13968
14087
  const local = parseLocal(value, options);
13969
- return local === sameExit ? result : local;
14088
+ return isSameExit(local) ? result : local;
13970
14089
  }
13971
14090
  result = wrapEncoding(ast, input, options, result);
13972
14091
  return flatMapEager(result, (value) => {
13973
14092
  const local = parseLocal(value, options);
13974
- return local === sameExit ? succeed$1(value) : local;
14093
+ return isSameExit(local) ? succeed$1(value) : local;
13975
14094
  });
13976
14095
  };
13977
14096
  }
@@ -13983,11 +14102,11 @@ var init_interpreter = __esmMin((() => {
13983
14102
  init_SchemaIssue();
13984
14103
  init_effect();
13985
14104
  init_parser();
13986
- flatMapTransformation = (result, current, f) => result === sameExit ? f(current) : flatMapEager(result, f);
14105
+ flatMapTransformation = (result, current, f) => isSameExit(result) ? f(current) : flatMapEager(result, f);
13987
14106
  fromOptionalEffect = (effect) => flatMapEager(effect, fromOptionExit);
13988
14107
  wrapEncoding = (ast, input, options, effect) => catchCause$2(effect, (cause) => failCauseSync(() => map$5(cause, (issue) => new Encoding(ast, issue, input, options))));
13989
14108
  }));
13990
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/compilerRegistry.js
14109
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/compilerRegistry.js
13991
14110
  /** @internal */
13992
14111
  function withDecode(fastDecode, decodeEffect) {
13993
14112
  let detailed;
@@ -14085,7 +14204,7 @@ var init_compilerRegistry = __esmMin((() => {
14085
14204
  }
14086
14205
  };
14087
14206
  }));
14088
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaParser.js
14207
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/SchemaParser.js
14089
14208
  /**
14090
14209
  * Creates an effectful maker for the schema's decoded type side.
14091
14210
  *
@@ -14324,7 +14443,7 @@ function run$3(ast) {
14324
14443
  return runWithCompiler(normalCompiler, ast);
14325
14444
  }
14326
14445
  function parserResult(result, input) {
14327
- if (result === sameExit) return succeed$4(input);
14446
+ if (isSameExit(result)) return succeed$4(input);
14328
14447
  if (!effectIsExit(result)) return flatMapEager(result, getValue);
14329
14448
  return result["~effect/Effect/args"] === missing ? getValue(missing) : result;
14330
14449
  }
@@ -14332,7 +14451,7 @@ function runWithCompiler(compiler, ast) {
14332
14451
  let parser;
14333
14452
  return (input, options) => {
14334
14453
  const result = (parser ??= compiler(ast))(input, options ?? defaultParseOptions);
14335
- if (result === sameExit) return succeed$4(input);
14454
+ if (isSameExit(result)) return succeed$4(input);
14336
14455
  if (!effectIsExit(result)) return flatMapEager(result, getValue);
14337
14456
  return result["~effect/Effect/args"] === missing ? getValue(missing) : result;
14338
14457
  };
@@ -14424,7 +14543,7 @@ var init_SchemaParser = __esmMin((() => {
14424
14543
  normalCompiler = (ast) => resolve(ast).parser;
14425
14544
  constructorCompiler = (ast) => resolve(ast).makeEffect;
14426
14545
  }));
14427
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/make.js
14546
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/make.js
14428
14547
  /** @internal */
14429
14548
  function make$24(ast, options) {
14430
14549
  function Schema() {}
@@ -14485,7 +14604,7 @@ var init_make = __esmMin((() => {
14485
14604
  }
14486
14605
  };
14487
14606
  }));
14488
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/jsonSchema.js
14607
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/jsonSchema.js
14489
14608
  /** @internal */
14490
14609
  function getSubschemaKind(keyword) {
14491
14610
  switch (keyword) {
@@ -14511,7 +14630,7 @@ function getSubschemaKind(keyword) {
14511
14630
  }
14512
14631
  }
14513
14632
  var init_jsonSchema = __esmMin((() => {}));
14514
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/JsonPointer.js
14633
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/JsonPointer.js
14515
14634
  /**
14516
14635
  * Helpers for escaping JSON Pointer path segments and converting JSON Pointer
14517
14636
  * URI fragments. JSON Pointer uses `/` to separate path tokens inside a JSON
@@ -14650,7 +14769,7 @@ function parseUriFragment(fragment) {
14650
14769
  return pointer === void 0 ? void 0 : pointer.length === 0 ? [] : pointer.slice(1).split("/").map(unescapeToken);
14651
14770
  }
14652
14771
  var init_JsonPointer = __esmMin((() => {}));
14653
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/JsonSchema.js
14772
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/JsonSchema.js
14654
14773
  /** @internal */
14655
14774
  function getReferenceKey($ref) {
14656
14775
  const path = $ref.startsWith("#") ? parseUriFragment($ref) : void 0;
@@ -14723,7 +14842,7 @@ var init_JsonSchema = __esmMin((() => {
14723
14842
  [...PRE_2020_TO_2020_COLLISIONS];
14724
14843
  [...PRE_2020_TO_2020_COLLISIONS];
14725
14844
  }));
14726
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toCodec.js
14845
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/toCodec.js
14727
14846
  /** @internal */
14728
14847
  function toCodecJson$1(schema) {
14729
14848
  return make$24(toCodecJsonAST(schema.ast), { schema });
@@ -14868,7 +14987,7 @@ var init_RegExp = __esmMin((() => {
14868
14987
  globalThis.RegExp;
14869
14988
  escape = (string) => string.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
14870
14989
  }));
14871
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/errors.js
14990
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/errors.js
14872
14991
  /** @internal */
14873
14992
  function errorWithPath(message, path) {
14874
14993
  if (path.length > 0) message += `\n at ${formatPath(path)}`;
@@ -14877,7 +14996,7 @@ function errorWithPath(message, path) {
14877
14996
  var init_errors = __esmMin((() => {
14878
14997
  init_Formatter();
14879
14998
  }));
14880
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
14999
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
14881
15000
  function formatDefinitionReference(key) {
14882
15001
  return `#/$defs/${formatUriFragmentToken(key)}`;
14883
15002
  }
@@ -15503,7 +15622,7 @@ var init_toJsonSchemaDocument = __esmMin((() => {
15503
15622
  promotableAnnotationKeywords = "|title|description|default|examples|readOnly|writeOnly|";
15504
15623
  inlineableAnnotatedCheckKeywords = inlineableCheckKeywords + promotableAnnotationKeywords;
15505
15624
  }));
15506
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toRepresentation.js
15625
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schema/toRepresentation.js
15507
15626
  function annotationsField(annotations) {
15508
15627
  return annotations === void 0 ? void 0 : { annotations };
15509
15628
  }
@@ -15755,7 +15874,7 @@ var init_toRepresentation = __esmMin((() => {
15755
15874
  init_content();
15756
15875
  defaultReferencePolicy = ({ identifier }) => identifier;
15757
15876
  }));
15758
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Struct.js
15877
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Struct.js
15759
15878
  function hasPropertyKey(keys, key) {
15760
15879
  return keys.some((candidate) => candidate === key || typeof candidate === "number" && String(candidate) === key);
15761
15880
  }
@@ -15789,7 +15908,7 @@ var init_Struct = __esmMin((() => {
15789
15908
  });
15790
15909
  lambda = (f) => f;
15791
15910
  }));
15792
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schemaError.js
15911
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/schemaError.js
15793
15912
  function isSchemaError$1(u) {
15794
15913
  return hasProperty(u, "~effect/Schema/SchemaError") && u["~effect/Schema/SchemaError"] === "~effect/Schema/SchemaError";
15795
15914
  }
@@ -15798,7 +15917,7 @@ var init_schemaError = __esmMin((() => {
15798
15917
  init_Predicate();
15799
15918
  SchemaErrorTypeId = "~effect/Schema/SchemaError";
15800
15919
  }));
15801
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Schema.js
15920
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Schema.js
15802
15921
  /**
15803
15922
  * Creates a schema for a **parametric** type (a generic container such as
15804
15923
  * `Array<A>`, `Option<A>`, etc.) by accepting a list of type-parameter schemas
@@ -16166,8 +16285,8 @@ function templateLiteralParts(parts) {
16166
16285
  return parts.map((part) => isSchema(part) ? part.ast : new Literal$1(part));
16167
16286
  }
16168
16287
  /**
16169
- * Creates a schema that validates strings by matching ordered template literal
16170
- * parts.
16288
+ * Creates a schema that validates strings against a fixed-length tuple of
16289
+ * template literal parts.
16171
16290
  *
16172
16291
  * **When to use**
16173
16292
  *
@@ -16182,6 +16301,9 @@ function templateLiteralParts(parts) {
16182
16301
  *
16183
16302
  * **Gotchas**
16184
16303
  *
16304
+ * Use an inline tuple or `as const` for `parts`. Widened arrays and open-ended
16305
+ * tuples are unsupported despite being accepted by the signature.
16306
+ *
16185
16307
  * Parts must not contain encodings, including inside unions or nested templates.
16186
16308
  * Construction throws for transformed parts even when their decoded and encoded
16187
16309
  * types are the same. Use {@link TemplateLiteralParser} to decode transformed parts.
@@ -16304,11 +16426,14 @@ function Record(key, value) {
16304
16426
  });
16305
16427
  }
16306
16428
  /**
16307
- * Extends a struct schema with one or more record (index-signature) schemas,
16308
- * producing a schema whose decoded type intersects the struct and all records.
16429
+ * Extends a struct schema with a fixed-length tuple of record schemas, producing
16430
+ * a schema whose decoded type intersects the struct and all records.
16309
16431
  *
16310
16432
  * **Gotchas**
16311
16433
  *
16434
+ * Keep `records` as a tuple using an inline literal or `as const`. Widened arrays
16435
+ * and open-ended tuples are unsupported and can lose inferred index signatures.
16436
+ *
16312
16437
  * The base schema must have an object-shaped encoded type. Whole-object
16313
16438
  * transformations are not supported, even with an empty rest array. Apply
16314
16439
  * transformations such as `Schema.fromJsonString` to the completed
@@ -16355,7 +16480,12 @@ function makeTuple(ast, elements) {
16355
16480
  });
16356
16481
  }
16357
16482
  /**
16358
- * Defines a fixed-length tuple schema from an array of element schemas.
16483
+ * Defines a tuple schema from a fixed-length tuple of element schemas.
16484
+ *
16485
+ * **Gotchas**
16486
+ *
16487
+ * Use an inline tuple or `as const`. Widened arrays and open-ended tuples are
16488
+ * unsupported despite being accepted by the signature.
16359
16489
  *
16360
16490
  * **Example** (Defining a pair of string and number)
16361
16491
  *
@@ -16384,8 +16514,8 @@ function makeUnion(ast, members) {
16384
16514
  });
16385
16515
  }
16386
16516
  /**
16387
- * Creates a union schema from an array of member schemas. Members are tested in
16388
- * order; the first match is returned.
16517
+ * Creates a union schema from a fixed-length tuple of member schemas. Members
16518
+ * are tested in order; the first match is returned.
16389
16519
  *
16390
16520
  * **Details**
16391
16521
  *
@@ -16393,6 +16523,12 @@ function makeUnion(ast, members) {
16393
16523
  * - `"anyOf"` (default) — matches if any member matches.
16394
16524
  * - `"oneOf"` — matches if exactly one member matches.
16395
16525
  *
16526
+ * **Gotchas**
16527
+ *
16528
+ * Use an inline tuple or `as const`. Widened arrays, such as `Object.values(...)`
16529
+ * or `.map(...)` results, and open-ended tuples are unsupported despite being
16530
+ * accepted by the signature.
16531
+ *
16396
16532
  * **Example** (Defining a string or number union)
16397
16533
  *
16398
16534
  * ```ts import.meta.vitest
@@ -16412,7 +16548,12 @@ function Union(members, options) {
16412
16548
  return makeUnion(union(members, options, void 0), members);
16413
16549
  }
16414
16550
  /**
16415
- * Creates a union schema from an array of literal values.
16551
+ * Creates a union schema from a fixed-length tuple of literal values.
16552
+ *
16553
+ * **Gotchas**
16554
+ *
16555
+ * Use an inline tuple or `as const` to preserve positions for `mapMembers` and
16556
+ * `transform`. Widened arrays and open-ended tuples are unsupported.
16416
16557
  *
16417
16558
  * **Example** (Defining status codes)
16418
16559
  *
@@ -17669,7 +17810,7 @@ var init_Schema = __esmMin((() => {
17669
17810
  Type: "Schema.MutableJson"
17670
17811
  }) }));
17671
17812
  }));
17672
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpBody.js
17813
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpBody.js
17673
17814
  init_Formatter();
17674
17815
  init_Inspectable();
17675
17816
  var TypeId$20 = "~effect/http/HttpBody";
@@ -17783,14 +17924,14 @@ var text = (body, contentType) => {
17783
17924
  * @since 4.0.0
17784
17925
  */
17785
17926
  var jsonUnsafe$1 = (body, contentType) => text(JSON.stringify(body), contentType ?? "application/json");
17786
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpClientError.js
17927
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpClientError.js
17787
17928
  init_Data();
17788
17929
  init_UrlParams();
17789
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/Url.js
17930
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/Url.js
17790
17931
  init_Data();
17791
17932
  init_Result();
17792
17933
  init_urlParams();
17793
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpClientRequest.js
17934
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpClientRequest.js
17794
17935
  init_Inspectable();
17795
17936
  init_Option();
17796
17937
  init_Pipeable();
@@ -17799,10 +17940,10 @@ init_Result();
17799
17940
  init_Headers();
17800
17941
  init_UrlParams();
17801
17942
  ({ ...BaseProto });
17802
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpIncomingMessage.js
17943
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpIncomingMessage.js
17803
17944
  init_Context();
17804
17945
  init_Redactable();
17805
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpClientResponse.js
17946
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpClientResponse.js
17806
17947
  init_Effect();
17807
17948
  init_Inspectable();
17808
17949
  init_Option();
@@ -17812,7 +17953,41 @@ init_Cookies();
17812
17953
  init_Headers();
17813
17954
  init_urlParams();
17814
17955
  init_UrlParams();
17815
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/FindMyWay/internal/queryString.js
17956
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpTraceContext.js
17957
+ init_Option();
17958
+ init_Tracer();
17959
+ var w3cTraceId = /^[0-9a-f]{32}$/;
17960
+ var w3cSpanId = /^[0-9a-f]{16}$/;
17961
+ var w3cTraceFlags = /^[0-9a-f]{2}$/;
17962
+ /**
17963
+ * Decodes an external span safely from the W3C `traceparent` header.
17964
+ *
17965
+ * **Details**
17966
+ *
17967
+ * Only version `00` headers with valid trace and span identifiers and trace
17968
+ * flags are accepted.
17969
+ *
17970
+ * @stability unstable
17971
+ * @category decoding
17972
+ * @since 4.0.0
17973
+ */
17974
+ var w3c = (headers) => {
17975
+ if (!headers["traceparent"]) return none();
17976
+ const parts = headers["traceparent"].split("-");
17977
+ if (parts.length !== 4) return none();
17978
+ const [version, traceId, spanId, flags] = parts;
17979
+ switch (version) {
17980
+ case "00":
17981
+ if (w3cTraceId.test(traceId) === false || w3cSpanId.test(spanId) === false || w3cTraceFlags.test(flags) === false || traceId === "00000000000000000000000000000000" || spanId === "0000000000000000") return none();
17982
+ return some(externalSpan({
17983
+ traceId,
17984
+ spanId,
17985
+ sampled: (parseInt(flags, 16) & 1) === 1
17986
+ }));
17987
+ default: return none();
17988
+ }
17989
+ };
17990
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/FindMyWay/internal/queryString.js
17816
17991
  /**
17817
17992
  * @since 1.0.0
17818
17993
  */
@@ -17880,7 +18055,7 @@ function parse$2(input) {
17880
18055
  }
17881
18056
  return result;
17882
18057
  }
17883
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/FindMyWay/internal/router.js
18058
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/FindMyWay/internal/router.js
17884
18059
  var FULL_PATH_REGEXP = /^https?:\/\/.*?\//;
17885
18060
  var OPTIONAL_PARAM_REGEXP = /(\/:[^/()]*?)\?(\/?)/;
17886
18061
  var emptyParamsArray = [];
@@ -18498,7 +18673,7 @@ var httpMethods = [
18498
18673
  "UNLOCK",
18499
18674
  "UNSUBSCRIBE"
18500
18675
  ];
18501
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/FindMyWay.js
18676
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/FindMyWay.js
18502
18677
  /**
18503
18678
  * A radix-tree HTTP router used by the unstable HTTP routing modules.
18504
18679
  *
@@ -18513,7 +18688,7 @@ var httpMethods = [
18513
18688
  * @since 4.0.0
18514
18689
  */
18515
18690
  var make$20 = make$21;
18516
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/LogLevel.js
18691
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/LogLevel.js
18517
18692
  init_effect();
18518
18693
  init_Order();
18519
18694
  /**
@@ -18546,7 +18721,7 @@ init_Order();
18546
18721
  * @since 4.0.0
18547
18722
  */
18548
18723
  var isGreaterThanOrEqualTo = /*#__PURE__*/ isGreaterThanOrEqualTo$2(LogLevelOrder);
18549
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ErrorReporter.js
18724
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ErrorReporter.js
18550
18725
  init_Effect();
18551
18726
  init_effect();
18552
18727
  /**
@@ -18620,14 +18795,14 @@ var report = (cause) => withFiber((fiber) => {
18620
18795
  * @since 4.0.0
18621
18796
  */
18622
18797
  var ignore = "~effect/ErrorReporter/ignore";
18623
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/internal/headers.js
18798
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/internal/headers.js
18624
18799
  init_Headers();
18625
18800
  var Proto$7 = /*#__PURE__*/ Object.getPrototypeOf(empty$4);
18626
18801
  /**
18627
18802
  * @internal
18628
18803
  */
18629
18804
  var emptyMutableUnsafe = () => Object.create(Proto$7);
18630
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpServerResponse.js
18805
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpServerResponse.js
18631
18806
  init_Effect();
18632
18807
  init_Function();
18633
18808
  init_Inspectable();
@@ -18735,14 +18910,14 @@ var makeResponse = (options, ownedHeaders) => {
18735
18910
  } else self.headers = ownedHeaders ?? options.headers ?? empty$4;
18736
18911
  return self;
18737
18912
  };
18738
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpServerError.js
18913
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpServerError.js
18739
18914
  init_Cause();
18740
18915
  init_Context();
18741
18916
  init_Data();
18742
18917
  init_Effect();
18743
18918
  init_Function();
18744
18919
  init_urlParams();
18745
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/MultipartParser/internal/headers.js
18920
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/MultipartParser/internal/headers.js
18746
18921
  init_Bytes();
18747
18922
  var constNameChars = /*#__PURE__*/ new Uint8Array(256);
18748
18923
  for (const char of "!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") constNameChars[/*#__PURE__*/ char.charCodeAt(0)] = 1;
@@ -18750,10 +18925,10 @@ var constValueChars = /*#__PURE__*/ new Uint8Array(256);
18750
18925
  constValueChars[9] = 1;
18751
18926
  for (let i = 32; i <= 126; i++) constValueChars[i] = 1;
18752
18927
  for (let i = 128; i <= 255; i++) constValueChars[i] = 1;
18753
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/MultipartParser/internal/multipart.js
18928
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/MultipartParser/internal/multipart.js
18754
18929
  init_Bytes();
18755
18930
  init_ByteSize();
18756
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/Multipart.js
18931
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/Multipart.js
18757
18932
  init_Array();
18758
18933
  init_ByteSize();
18759
18934
  init_Cause();
@@ -18769,7 +18944,7 @@ init_Predicate();
18769
18944
  init_Pull();
18770
18945
  init_Schema();
18771
18946
  init_Stream();
18772
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpServerRequest.js
18947
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpServerRequest.js
18773
18948
  init_Context();
18774
18949
  init_Effect();
18775
18950
  init_Inspectable();
@@ -18810,7 +18985,7 @@ var HttpServerRequest = /*#__PURE__*/ Service$1("effect/http/HttpServerRequest")
18810
18985
  * @since 4.0.0
18811
18986
  */
18812
18987
  var ParsedSearchParams = class extends (/*#__PURE__*/ Service$1()("effect/http/ParsedSearchParams")) {};
18813
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/internal/requestState.js
18988
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/internal/requestState.js
18814
18989
  init_Context();
18815
18990
  init_Effect();
18816
18991
  /**
@@ -18829,7 +19004,7 @@ var appendPreResponseHandlerUnsafe$1 = (context, handler) => {
18829
19004
  const prev = state.preResponseHandler;
18830
19005
  state.preResponseHandler = prev ? (request, response) => flatMap$1(prev(request, response), (response) => handler(request, response)) : handler;
18831
19006
  };
18832
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpMiddleware.js
19007
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpMiddleware.js
18833
19008
  init_Context();
18834
19009
  init_Effect();
18835
19010
  /**
@@ -18844,7 +19019,7 @@ var withLoggerDisabled = (self) => withFiber((fiber) => {
18844
19019
  if (state !== void 0) state.loggerDisabled = true;
18845
19020
  return self;
18846
19021
  });
18847
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpEffect.js
19022
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpEffect.js
18848
19023
  /**
18849
19024
  * Registers a pre-response handler for the HTTP server request that owns the
18850
19025
  * supplied fiber context. Does nothing outside a server request.
@@ -18854,7 +19029,7 @@ var withLoggerDisabled = (self) => withFiber((fiber) => {
18854
19029
  * @since 4.0.0
18855
19030
  */
18856
19031
  var appendPreResponseHandlerUnsafe = appendPreResponseHandlerUnsafe$1;
18857
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/HttpRouter.js
19032
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/HttpRouter.js
18858
19033
  init_Array();
18859
19034
  init_Context();
18860
19035
  init_Effect();
@@ -18992,7 +19167,7 @@ var getMiddleware$1 = (context) => {
18992
19167
  return arr;
18993
19168
  };
18994
19169
  (/*#__PURE__*/ middleware(withLoggerDisabled)).layer;
18995
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/workers/Transferable.js
19170
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/workers/Transferable.js
18996
19171
  init_Context();
18997
19172
  init_Effect();
18998
19173
  /**
@@ -19032,7 +19207,7 @@ var makeCollectorUnsafe = () => {
19032
19207
  clear: sync(unsafeClear)
19033
19208
  });
19034
19209
  };
19035
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/internal/tracing.js
19210
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/internal/tracing.js
19036
19211
  /**
19037
19212
  * Names the span after the RPC method, or `${spanPrefix}.${tag}` when a prefix
19038
19213
  * is configured.
@@ -19050,7 +19225,7 @@ var spanAttributes = (tag, attributes) => ({
19050
19225
  "rpc.method": tag,
19051
19226
  ...attributes
19052
19227
  });
19053
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/PrimaryKey.js
19228
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/PrimaryKey.js
19054
19229
  /**
19055
19230
  * Defines the unique identifier used to identify objects that implement the `PrimaryKey` interface.
19056
19231
  *
@@ -19068,7 +19243,7 @@ var spanAttributes = (tag, attributes) => ({
19068
19243
  * @since 2.0.0
19069
19244
  */
19070
19245
  var symbol = "~effect/PrimaryKey";
19071
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/RpcSchema.js
19246
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/RpcSchema.js
19072
19247
  init_Cause();
19073
19248
  init_Context();
19074
19249
  init_Function();
@@ -19128,7 +19303,7 @@ var ClientAbort = class extends (/*#__PURE__*/ Service$1()("effect/rpc/RpcSchema
19128
19303
  parent: void 0
19129
19304
  }));
19130
19305
  };
19131
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/Rpc.js
19306
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/Rpc.js
19132
19307
  init_Context();
19133
19308
  init_Option();
19134
19309
  init_Pipeable();
@@ -19340,7 +19515,7 @@ var WrapperTypeId = "~effect/rpc/Rpc/Wrapper";
19340
19515
  * @since 4.0.0
19341
19516
  */
19342
19517
  var isWrapper = (u) => WrapperTypeId in u;
19343
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/RpcMessage.js
19518
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/RpcMessage.js
19344
19519
  init_Schema();
19345
19520
  /**
19346
19521
  * Converts a bigint or string request id into the branded `RequestId` type.
@@ -19382,7 +19557,7 @@ var ResponseDefectEncoded = (encodedDefect) => ({
19382
19557
  * @since 4.0.0
19383
19558
  */
19384
19559
  var constPong = { _tag: "Pong" };
19385
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/RpcSerialization.js
19560
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/RpcSerialization.js
19386
19561
  init_Context();
19387
19562
  init_Data();
19388
19563
  init_Predicate();
@@ -19708,7 +19883,7 @@ function encodeJsonRpcMessage(response) {
19708
19883
  }
19709
19884
  }
19710
19885
  var jsonRpcInternalError = -32603;
19711
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/Utils.js
19886
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/Utils.js
19712
19887
  init_Effect();
19713
19888
  init_Semaphore();
19714
19889
  /**
@@ -19788,7 +19963,7 @@ var withRunClient = (f) => suspend$2(() => {
19788
19963
  }
19789
19964
  }));
19790
19965
  });
19791
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/RpcClient.js
19966
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/RpcClient.js
19792
19967
  init_Cause();
19793
19968
  init_Context();
19794
19969
  init_Deferred();
@@ -20225,7 +20400,370 @@ var Protocol$1 = class extends (/*#__PURE__*/ Service$1()("effect/rpc/RpcClient/
20225
20400
  */
20226
20401
  static make = withRunClient;
20227
20402
  };
20228
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Stdio.js
20403
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Runtime.js
20404
+ init_Cause();
20405
+ init_Context();
20406
+ init_Effect();
20407
+ init_Exit();
20408
+ init_Function();
20409
+ /**
20410
+ * Annotation specifying the exit code for an interruption handled by
20411
+ * {@link defaultTeardown}.
20412
+ *
20413
+ * **When to use**
20414
+ *
20415
+ * Use when a component finishes a program by interrupting its main fiber on
20416
+ * purpose, such as a stdio server shutting down after stdin closes, and that
20417
+ * shutdown should not report the `130` code reserved for external interruption.
20418
+ *
20419
+ * **Details**
20420
+ *
20421
+ * Pass the annotation through `Fiber.interruptAs`. {@link defaultTeardown}
20422
+ * reads it from the interrupt reasons of the final `Cause`.
20423
+ *
20424
+ * **Gotchas**
20425
+ *
20426
+ * The annotation is read from the `Cause`, not from the running effect's
20427
+ * services, so providing it with `Effect.provideService` has no effect.
20428
+ *
20429
+ * **Example** (Exiting with 0 after an intentional interruption)
20430
+ *
20431
+ * ```ts import.meta.vitest
20432
+ * import { Context, Effect, Fiber, Runtime } from "effect"
20433
+ *
20434
+ * const program = Effect.gen(function*() {
20435
+ * const main = yield* Effect.forkChild(Effect.never)
20436
+ * yield* Fiber.interruptAs(main, undefined, Context.make(Runtime.InterruptExitCode, 0))
20437
+ * return yield* Fiber.await(main)
20438
+ * })
20439
+ *
20440
+ * const exitCodes: Array<number> = []
20441
+ * Runtime.defaultTeardown(await Effect.runPromise(program), (code) => exitCodes.push(code))
20442
+ *
20443
+ * exitCodes // => [0]
20444
+ * ```
20445
+ *
20446
+ * @see {@link defaultTeardown} for how annotated and unannotated interruptions combine
20447
+ * @see {@link errorExitCode} for the equivalent marker on failures
20448
+ *
20449
+ * @stability stable
20450
+ * @category annotations
20451
+ * @since 4.1.3
20452
+ */
20453
+ var InterruptExitCode = class extends (/*#__PURE__*/ Service$1()("effect/Runtime/InterruptExitCode")) {};
20454
+ /**
20455
+ * The default teardown function that determines exit codes from an Effect exit.
20456
+ *
20457
+ * **When to use**
20458
+ *
20459
+ * Use as the standard teardown for main programs with conventional process
20460
+ * exit codes and support for {@link errorExitCode}.
20461
+ *
20462
+ * **Details**
20463
+ *
20464
+ * This teardown follows these exit-code rules:
20465
+ *
20466
+ * - `0` for successful completion.
20467
+ * - The largest {@link InterruptExitCode} when every reason is an annotated interruption.
20468
+ * - `130` for interruption-only failures with any unannotated reason.
20469
+ * - The squashed error's {@link errorExitCode} value for other failures when
20470
+ * present.
20471
+ * - `1` for other failures.
20472
+ *
20473
+ * **Gotchas**
20474
+ *
20475
+ * Interruption codes apply only when the Cause contains nothing but
20476
+ * interruptions. A Cause that mixes interruptions with errors or defects uses
20477
+ * the squashed error path instead.
20478
+ *
20479
+ * **Example** (Referencing default teardown)
20480
+ *
20481
+ * ```ts import.meta.vitest
20482
+ * import { Exit, Runtime } from "effect"
20483
+ *
20484
+ * const exitCodes: Array<number> = []
20485
+ * const collectExitCode = (exit: Exit.Exit<any, any>) =>
20486
+ * Runtime.defaultTeardown(exit, (code) => exitCodes.push(code))
20487
+ *
20488
+ * collectExitCode(Exit.succeed(42))
20489
+ * collectExitCode(Exit.fail("error"))
20490
+ * collectExitCode(Exit.interrupt(123))
20491
+ *
20492
+ * exitCodes // => [0, 1, 130]
20493
+ * ```
20494
+ *
20495
+ * **Example** (Distinguishing completion from external interruption)
20496
+ *
20497
+ * ```ts import.meta.vitest
20498
+ * import { Cause, Context, Exit, Runtime } from "effect"
20499
+ *
20500
+ * const completed = Cause.annotate(Cause.interrupt(1), Context.make(Runtime.InterruptExitCode, 0))
20501
+ * const custom = Cause.annotate(Cause.interrupt(2), Context.make(Runtime.InterruptExitCode, 7))
20502
+ * const external = Cause.interrupt(3)
20503
+ * const exitCodes: Array<number> = []
20504
+ * const collectExitCode = (cause: Cause.Cause<never>) =>
20505
+ * Runtime.defaultTeardown(Exit.failCause(cause), (code) => exitCodes.push(code))
20506
+ *
20507
+ * collectExitCode(completed)
20508
+ * collectExitCode(Cause.combine(completed, custom))
20509
+ * collectExitCode(Cause.combine(custom, completed))
20510
+ * collectExitCode(Cause.combine(completed, external))
20511
+ * collectExitCode(Cause.combine(external, completed))
20512
+ *
20513
+ * exitCodes // => [0, 7, 7, 130, 130]
20514
+ * ```
20515
+ *
20516
+ * @see {@link errorExitCode} for customizing failure exit codes
20517
+ *
20518
+ * @stability stable
20519
+ * @category running
20520
+ * @since 4.0.0
20521
+ */
20522
+ var defaultTeardown = (exit, onExit) => {
20523
+ if (isSuccess(exit)) return onExit(0);
20524
+ if (hasInterruptsOnly(exit.cause)) {
20525
+ let code = -Infinity;
20526
+ for (const reason of exit.cause.reasons) {
20527
+ const annotated = getOrUndefined(reasonAnnotations(reason), InterruptExitCode);
20528
+ if (annotated === void 0) return onExit(130);
20529
+ code = Math.max(code, annotated);
20530
+ }
20531
+ return onExit(code);
20532
+ }
20533
+ return onExit(getErrorExitCode(squash(exit.cause)));
20534
+ };
20535
+ /**
20536
+ * Creates a platform-specific main program runner that handles Effect execution lifecycle.
20537
+ *
20538
+ * **When to use**
20539
+ *
20540
+ * Use when building a runtime adapter for a host platform.
20541
+ *
20542
+ * **Details**
20543
+ *
20544
+ * The setup function runs before user code and receives the main fiber and a
20545
+ * teardown callback to install platform-specific signal handlers, observers,
20546
+ * and exit behavior.
20547
+ *
20548
+ * Most applications should use a platform-provided runner, such as
20549
+ * `NodeRuntime.runMain`, rather than constructing one directly.
20550
+ *
20551
+ * `disableErrorReporting` disables the automatic log emitted for unreported
20552
+ * non-interruption failures. It does not change exit-code calculation or the
20553
+ * custom teardown callback.
20554
+ *
20555
+ * **Gotchas**
20556
+ *
20557
+ * The setup function is responsible for observing the fiber and eventually
20558
+ * invoking teardown. `makeRunMain` also tries to keep the host process alive
20559
+ * with a long interval while the main fiber is running; if the host blocks
20560
+ * timers, the runner still starts but cannot use that keep-alive fallback.
20561
+ *
20562
+ * **Example** (Creating platform runners)
20563
+ *
20564
+ * ```ts import.meta.vitest
20565
+ * import { Effect, Exit, Runtime } from "effect"
20566
+ *
20567
+ * const events: Array<string> = []
20568
+ * const completed = new Promise<readonly [Exit.Exit<unknown, unknown>, number]>((resolve) => {
20569
+ * // Create a simple runner for a hypothetical platform
20570
+ * const runMain = Runtime.makeRunMain(({ fiber, teardown }) => {
20571
+ * // Handle fiber completion
20572
+ * fiber.addObserver((exit) => {
20573
+ * teardown(exit, (code) => resolve([exit, code]))
20574
+ * })
20575
+ * })
20576
+ *
20577
+ * // Use the runner
20578
+ * const program = Effect.sync(() => {
20579
+ * events.push("Starting program", "Program completed")
20580
+ * return "success"
20581
+ * })
20582
+ *
20583
+ * runMain(program, {
20584
+ * teardown: (exit, onExit) => {
20585
+ * events.push("Custom teardown logic")
20586
+ * Runtime.defaultTeardown(exit, onExit)
20587
+ * }
20588
+ * })
20589
+ * })
20590
+ *
20591
+ * const result = await completed
20592
+ * result // => [Exit.succeed("success"), 0]
20593
+ * events // => ["Starting program", "Program completed", "Custom teardown logic"]
20594
+ * ```
20595
+ *
20596
+ * @stability stable
20597
+ * @category running
20598
+ * @since 4.0.0
20599
+ */
20600
+ var makeRunMain = (f) => dual((args) => isEffect(args[0]), (effect, options) => {
20601
+ const main = options?.disableErrorReporting === true ? effect : tapCause(effect, (cause) => {
20602
+ if (hasInterruptsOnly(cause)) return void_$1;
20603
+ return getErrorReported(squash(cause)) ? logError(cause) : void_$1;
20604
+ });
20605
+ const teardown = options?.teardown ?? defaultTeardown;
20606
+ runFork(withFiber((fiber) => {
20607
+ try {
20608
+ const keepAlive = globalThis.setInterval(constVoid, 2147483647);
20609
+ fiber.addObserver(() => {
20610
+ clearInterval(keepAlive);
20611
+ });
20612
+ } catch {}
20613
+ f({
20614
+ fiber,
20615
+ teardown
20616
+ });
20617
+ return main;
20618
+ }));
20619
+ });
20620
+ /**
20621
+ * Allows associating an exit code with an error for determining the process
20622
+ * exit code on failure.
20623
+ *
20624
+ * **When to use**
20625
+ *
20626
+ * Use when error classes should map failures to a specific process exit code
20627
+ * when handled by {@link defaultTeardown}.
20628
+ *
20629
+ * **Details**
20630
+ *
20631
+ * Attach this marker as a readonly property on an error object. When the main
20632
+ * program fails, {@link defaultTeardown} squashes the Cause and reads the marker
20633
+ * from the resulting error value.
20634
+ *
20635
+ * **Gotchas**
20636
+ *
20637
+ * The marker is read from the squashed failure value. If a Cause contains
20638
+ * multiple failures, the selected squashed error determines the exit code.
20639
+ *
20640
+ * **Example** (Setting a process exit code)
20641
+ *
20642
+ * ```ts import.meta.vitest
20643
+ * import { Data, Runtime } from "effect"
20644
+ *
20645
+ * class MyError extends Data.TaggedError("MyError") {
20646
+ * readonly [Runtime.errorExitCode] = 42
20647
+ * }
20648
+ *
20649
+ * Runtime.getErrorExitCode(new MyError()) // => 42
20650
+ * ```
20651
+ *
20652
+ * @see {@link errorReported} for controlling automatic error logging
20653
+ * @see {@link defaultTeardown} for the default failure exit-code rules that read this marker
20654
+ * @see {@link getErrorExitCode} for reading the marker from unknown error values
20655
+ *
20656
+ * @stability stable
20657
+ * @category symbols
20658
+ * @since 4.0.0
20659
+ */
20660
+ var errorExitCode = "~effect/Runtime/errorExitCode";
20661
+ /**
20662
+ * Reads the runtime exit-code marker from an unknown error value.
20663
+ *
20664
+ * **When to use**
20665
+ *
20666
+ * Use to read a custom failure exit code from an unknown error value, falling
20667
+ * back to the default failure code.
20668
+ *
20669
+ * **Details**
20670
+ *
20671
+ * Returns the numeric `[Runtime.errorExitCode]` property when it is present on
20672
+ * an object. Otherwise returns `1`, the default failure exit code used by
20673
+ * `defaultTeardown`.
20674
+ *
20675
+ * **Gotchas**
20676
+ *
20677
+ * Non-object values, missing markers, and non-number marker values all return
20678
+ * `1`.
20679
+ *
20680
+ * @see {@link errorExitCode} for the marker read by this function
20681
+ *
20682
+ * @stability stable
20683
+ * @category getters
20684
+ * @since 4.0.0
20685
+ */
20686
+ var getErrorExitCode = (u) => {
20687
+ if (typeof u === "object" && u !== null && "~effect/Runtime/errorExitCode" in u) {
20688
+ const code = u[errorExitCode];
20689
+ if (typeof code === "number") return code;
20690
+ }
20691
+ return 1;
20692
+ };
20693
+ /**
20694
+ * Defines the runtime marker that controls default `runMain` error logging for an error.
20695
+ *
20696
+ * **When to use**
20697
+ *
20698
+ * Use when you need error classes reported by application code to avoid being
20699
+ * logged again by the default main runner.
20700
+ *
20701
+ * **Details**
20702
+ *
20703
+ * Set `[Runtime.errorReported]` to `false` on an error object to suppress the
20704
+ * runtime log because the error has already been reported. Omitted or
20705
+ * non-boolean values are treated as `true`, so failures are logged by default.
20706
+ *
20707
+ * **Gotchas**
20708
+ *
20709
+ * This marker controls only automatic error logging. It does not change the
20710
+ * failure Cause or the process exit code.
20711
+ * `makeRunMain` reads the marker from `Cause.squash(cause)`, so for causes
20712
+ * with multiple failures, the squashed error determines whether default logging
20713
+ * is suppressed.
20714
+ *
20715
+ * **Example** (Suppressing error reporting)
20716
+ *
20717
+ * ```ts import.meta.vitest
20718
+ * import { Data, Runtime } from "effect"
20719
+ *
20720
+ * class MyError extends Data.TaggedError("MyError") {
20721
+ * readonly [Runtime.errorReported] = false
20722
+ * }
20723
+ *
20724
+ * Runtime.getErrorReported(new MyError()) // => false
20725
+ * ```
20726
+ *
20727
+ * @see {@link errorExitCode} for controlling failure exit codes
20728
+ * @see {@link getErrorReported} for reading the marker from unknown error values
20729
+ *
20730
+ * @stability stable
20731
+ * @category symbols
20732
+ * @since 4.0.0
20733
+ */
20734
+ var errorReported = "~effect/Runtime/errorReported";
20735
+ /**
20736
+ * Reads the runtime error-reporting marker from an unknown error value.
20737
+ *
20738
+ * **When to use**
20739
+ *
20740
+ * Use to read whether an unknown error value should be treated as already
20741
+ * reported by the default main runner.
20742
+ *
20743
+ * **Details**
20744
+ *
20745
+ * Returns a boolean `[Runtime.errorReported]` property when it is present on an
20746
+ * object. Otherwise returns `true`, so failures are logged by default.
20747
+ *
20748
+ * **Gotchas**
20749
+ *
20750
+ * Non-object values, missing markers, and non-boolean marker values all return
20751
+ * `true`.
20752
+ *
20753
+ * @see {@link errorReported} for the marker read by this function
20754
+ *
20755
+ * @stability stable
20756
+ * @category getters
20757
+ * @since 4.0.0
20758
+ */
20759
+ var getErrorReported = (u) => {
20760
+ if (typeof u === "object" && u !== null && "~effect/Runtime/errorReported" in u) {
20761
+ const isReported = u[errorReported];
20762
+ if (typeof isReported === "boolean") return isReported;
20763
+ }
20764
+ return true;
20765
+ };
20766
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Stdio.js
20229
20767
  init_Context();
20230
20768
  init_Effect();
20231
20769
  /**
@@ -20285,7 +20823,7 @@ var make$13 = (options) => ({
20285
20823
  stderrIsTerminal: succeed$4(false),
20286
20824
  ...options
20287
20825
  });
20288
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/RpcServer.js
20826
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/RpcServer.js
20289
20827
  init_Cause();
20290
20828
  init_Context();
20291
20829
  init_Deferred();
@@ -20296,7 +20834,6 @@ init_Function();
20296
20834
  init_Headers();
20297
20835
  init_effect();
20298
20836
  init_Latch();
20299
- init_Layer();
20300
20837
  init_Option();
20301
20838
  init_Pull();
20302
20839
  init_Queue();
@@ -20480,7 +21017,7 @@ var makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options) {
20480
21017
  if (exit._tag === "Failure") reportCauseUnsafe(getCurrent(), exit.cause);
20481
21018
  return close ? ensuring$2(write, close) : write;
20482
21019
  });
20483
- if (opts?.onRequest) effect = opts.onRequest(effect);
21020
+ if (opts?.onRequest) effect = opts.onRequest(effect, request);
20484
21021
  if (enableTracing) {
20485
21022
  const parentSpan = getOrUndefined(requestFiber.context, ParentSpan);
20486
21023
  effect = withSpan(effect, spanName(spanPrefix, request.tag), {
@@ -20625,6 +21162,12 @@ var applyMiddleware = (context, handler, options) => {
20625
21162
  * client's requests, so use the `onDisconnect` option to observe disconnects
20626
21163
  * instead of taking from that queue.
20627
21164
  *
21165
+ * `onRequest` wraps the effect that runs one decoded request: its middleware
21166
+ * and handler and, when the handler returns its result directly, the response
21167
+ * write. The wrapped effect is interrupted when the request is cancelled, its
21168
+ * client disconnects or the server stops. It runs inside the request's tracing
21169
+ * span unless tracing is disabled.
21170
+ *
20628
21171
  * `onDisconnect` is called for each disconnect reported by the `Protocol`,
20629
21172
  * after the server has requested interruption of that client's in-flight
20630
21173
  * requests. It does not wait for those requests to finish. It is not called
@@ -20636,6 +21179,12 @@ var applyMiddleware = (context, handler, options) => {
20636
21179
  * callbacks are interrupted when the server stops. Failures are ignored and
20637
21180
  * logged at `References.UnhandledLogLevel`.
20638
21181
  *
21182
+ * **Gotchas**
21183
+ *
21184
+ * When a handler succeeds with a `Deferred`, the effect wrapped by
21185
+ * `onRequest` ends at that point. The reply is sent once the `Deferred`
21186
+ * completes, outside the wrapped effect.
21187
+ *
20639
21188
  * @stability unstable
20640
21189
  * @category running
20641
21190
  * @since 4.0.0
@@ -20645,6 +21194,7 @@ var make$12 = /*#__PURE__*/ fnUntraced(function* (group, options) {
20645
21194
  const { encodeDefectUnsafe, encodeUnknownRequestExit } = defectCodecs(codecFor);
20646
21195
  const services = yield* context();
20647
21196
  const scope = yield* make$49();
21197
+ const writeOptions = options?.onRequest ? { onRequest: options.onRequest } : void 0;
20648
21198
  const server = yield* makeNoSerialization(group, {
20649
21199
  ...options,
20650
21200
  disableClientAcks: !supportsAck,
@@ -20764,7 +21314,7 @@ var make$12 = /*#__PURE__*/ fnUntraced(function* (group, options) {
20764
21314
  decoded.id = requestId;
20765
21315
  decoded.payload = payload;
20766
21316
  decoded.headers = headers;
20767
- return server.write(client.id, decoded);
21317
+ return server.write(client.id, decoded, writeOptions);
20768
21318
  };
20769
21319
  let notificationCount = 0;
20770
21320
  return yield* run((clientId, request) => {
@@ -20842,14 +21392,14 @@ var Protocol = class extends (/*#__PURE__*/ Service$1()("effect/rpc/RpcServer/Pr
20842
21392
  static make = /*#__PURE__*/ withRun();
20843
21393
  };
20844
21394
  /**
20845
- * Provides a server `Protocol` that reads RPC messages from `Stdio.stdin` and
21395
+ * Creates a server `Protocol` that reads RPC messages from `Stdio.stdin` and
20846
21396
  * writes encoded responses to `Stdio.stdout`.
20847
21397
  *
20848
21398
  * @stability unstable
20849
- * @category layers
21399
+ * @category protocols
20850
21400
  * @since 4.0.0
20851
21401
  */
20852
- var layerProtocolStdio = /*#__PURE__*/ effect(Protocol, /* @__PURE__ */ gen(function* () {
21402
+ var makeProtocolStdio = /*#__PURE__*/ gen(function* () {
20853
21403
  const stdio = yield* Stdio;
20854
21404
  const fiber = getCurrent();
20855
21405
  const serialization = yield* RpcSerialization;
@@ -20866,7 +21416,10 @@ var layerProtocolStdio = /*#__PURE__*/ effect(Protocol, /* @__PURE__ */ gen(func
20866
21416
  step: constVoid
20867
21417
  });
20868
21418
  }), sandbox, tapError$2(logError), retry(spaced(500)), andThen(() => writeRequest(0, constEof)), forkScoped);
20869
- yield* fromQueue(queue).pipe(run$4(stdio.stdout()), retry(spaced(500)), ensuring$2(forkDetach(interrupt(fiber), { startImmediately: true })), forkScoped);
21419
+ yield* fromQueue(queue).pipe(run$4(stdio.stdout()), retry(spaced(500)), onExit$1((exit) => {
21420
+ if (isFailure(exit) && hasInterruptsOnly(exit.cause)) return void_$1;
21421
+ return forkDetach(isSuccess(exit) ? interruptAs(fiber, void 0, make$53(InterruptExitCode, 0)) : interrupt(fiber), { startImmediately: true });
21422
+ }), forkScoped);
20870
21423
  return {
20871
21424
  disconnects: yield* make$42(),
20872
21425
  send(_clientId, response) {
@@ -20886,8 +21439,8 @@ var layerProtocolStdio = /*#__PURE__*/ effect(Protocol, /* @__PURE__ */ gen(func
20886
21439
  codecFor: serialization.codecFor
20887
21440
  };
20888
21441
  }));
20889
- }));
20890
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/RpcGroup.js
21442
+ });
21443
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/RpcGroup.js
20891
21444
  init_Context();
20892
21445
  init_Effect();
20893
21446
  init_Function();
@@ -21026,7 +21579,7 @@ var make$11 = (...rpcs) => makeProto$1({
21026
21579
  requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
21027
21580
  annotations: empty$11()
21028
21581
  });
21029
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
21582
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
21030
21583
  init_BigInt();
21031
21584
  init_ByteSize();
21032
21585
  init_Cause();
@@ -21160,7 +21713,10 @@ var makeFile = /*#__PURE__*/ (() => {
21160
21713
  const nodeStat = /*#__PURE__*/ effectify(NFS.fstat, /*#__PURE__*/ handleErrnoException("FileSystem", "stat"), /*#__PURE__*/ handleBadArgument("stat"));
21161
21714
  const nodeTruncate = /*#__PURE__*/ effectify(NFS.ftruncate, /*#__PURE__*/ handleErrnoException("FileSystem", "truncate"), /*#__PURE__*/ handleBadArgument("truncate"));
21162
21715
  const nodeSync = /*#__PURE__*/ effectify(NFS.fsync, /*#__PURE__*/ handleErrnoException("FileSystem", "sync"), /*#__PURE__*/ handleBadArgument("sync"));
21163
- const nodeWriteFactory = (method) => effectify(NFS.write, handleErrnoException("FileSystem", method), handleBadArgument(method));
21716
+ const nodeWriteFactory = (method) => {
21717
+ const write = effectify(NFS.write, handleErrnoException("FileSystem", method), handleBadArgument(method));
21718
+ return (fd, buffer, position) => write(fd, buffer, 0, buffer.length, position);
21719
+ };
21164
21720
  const nodeWrite = /*#__PURE__*/ nodeWriteFactory("write");
21165
21721
  const nodeWriteAll = /*#__PURE__*/ nodeWriteFactory("writeAll");
21166
21722
  class FileImpl {
@@ -21243,7 +21799,7 @@ var makeFile = /*#__PURE__*/ (() => {
21243
21799
  write(buffer) {
21244
21800
  return suspend$2(() => {
21245
21801
  const position = this.position;
21246
- return flatMap$1(this.append ? succeed$4(void 0) : positionToNumber(position, "write"), (nodePosition) => map$4(nodeWrite(this.fd, buffer, void 0, void 0, nodePosition), (bytesWritten) => {
21802
+ return flatMap$1(this.append ? succeed$4(void 0) : positionToNumber(position, "write"), (nodePosition) => map$4(nodeWrite(this.fd, buffer, nodePosition), (bytesWritten) => {
21247
21803
  if (!this.append) this.position = position + BigInt(bytesWritten);
21248
21804
  return bytesWritten;
21249
21805
  }));
@@ -21252,7 +21808,7 @@ var makeFile = /*#__PURE__*/ (() => {
21252
21808
  writeAllChunk(buffer) {
21253
21809
  return suspend$2(() => {
21254
21810
  const position = this.position;
21255
- return flatMap$1(this.append ? succeed$4(void 0) : positionToNumber(position, "writeAll"), (nodePosition) => flatMap$1(nodeWriteAll(this.fd, buffer, void 0, void 0, nodePosition), (bytesWritten) => {
21811
+ return flatMap$1(this.append ? succeed$4(void 0) : positionToNumber(position, "writeAll"), (nodePosition) => flatMap$1(nodeWriteAll(this.fd, buffer, nodePosition), (bytesWritten) => {
21256
21812
  if (bytesWritten === 0) return fail$3(systemError({
21257
21813
  module: "FileSystem",
21258
21814
  method: "writeAll",
@@ -21445,7 +22001,7 @@ var makeFileSystem = /*#__PURE__*/ map$4(/*#__PURE__*/ serviceOption(WatchBacken
21445
22001
  },
21446
22002
  writeFile: writeFile$1
21447
22003
  }));
21448
- // node_modules/.pnpm/@effect+platform-node@4.1.2_effect@4.1.2_redis@6.3.0/node_modules/@effect/platform-node/dist/NodeFileSystem.js
22004
+ // node_modules/.pnpm/@effect+platform-node@4.1.4_effect@4.1.4_redis@6.3.1/node_modules/@effect/platform-node/dist/NodeFileSystem.js
21449
22005
  /**
21450
22006
  * Node.js `FileSystem` layer for programs that perform real filesystem I/O.
21451
22007
  *
@@ -21465,7 +22021,7 @@ var makeFileSystem = /*#__PURE__*/ map$4(/*#__PURE__*/ serviceOption(WatchBacken
21465
22021
  * @since 4.0.0
21466
22022
  */
21467
22023
  var layer$8 = /* @__PURE__ */ effect(FileSystem)(makeFileSystem);
21468
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/NodePath.js
22024
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/NodePath.js
21469
22025
  init_Effect();
21470
22026
  init_Layer();
21471
22027
  var fileUrlOps = (windows) => ({
@@ -21494,7 +22050,7 @@ var fileUrlOps = (windows) => ({
21494
22050
  ...Path.win32,
21495
22051
  .../*#__PURE__*/ fileUrlOps(true)
21496
22052
  });
21497
- // node_modules/.pnpm/@effect+platform-node@4.1.2_effect@4.1.2_redis@6.3.0/node_modules/@effect/platform-node/dist/NodePath.js
22053
+ // node_modules/.pnpm/@effect+platform-node@4.1.4_effect@4.1.4_redis@6.3.1/node_modules/@effect/platform-node/dist/NodePath.js
21498
22054
  /**
21499
22055
  * Node.js layers for Effect's `Path` service.
21500
22056
  *
@@ -21518,10 +22074,10 @@ var layer$6 = /* @__PURE__ */ succeed$5(Path$1)(/*#__PURE__*/ make$35({
21518
22074
  ...Path,
21519
22075
  .../*#__PURE__*/ fileUrlOps(void 0)
21520
22076
  }));
21521
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
22077
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
21522
22078
  init_Effect();
21523
22079
  init_Layer();
21524
- // node_modules/.pnpm/@effect+platform-node@4.1.2_effect@4.1.2_redis@6.3.0/node_modules/@effect/platform-node/dist/NodeStdio.js
22080
+ // node_modules/.pnpm/@effect+platform-node@4.1.4_effect@4.1.4_redis@6.3.1/node_modules/@effect/platform-node/dist/NodeStdio.js
21525
22081
  /**
21526
22082
  * Node.js `Stdio` layer for the current process.
21527
22083
  *
@@ -21577,7 +22133,7 @@ var layer$4 = /* @__PURE__ */ succeed$5(Stdio, /*#__PURE__*/ make$13({
21577
22133
  closeOnDone: false
21578
22134
  })
21579
22135
  }));
21580
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Terminal.js
22136
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Terminal.js
21581
22137
  init_Context();
21582
22138
  init_Predicate();
21583
22139
  init_Schema();
@@ -21662,7 +22218,7 @@ var make$10 = (impl) => Terminal.of({
21662
22218
  ...impl,
21663
22219
  [TypeId$9]: TypeId$9
21664
22220
  });
21665
- // node_modules/.pnpm/@effect+platform-node-shared@4.1.2_effect@4.1.2/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
22221
+ // node_modules/.pnpm/@effect+platform-node-shared@4.1.4_effect@4.1.4/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
21666
22222
  init_Effect();
21667
22223
  init_Layer();
21668
22224
  init_Option();
@@ -21678,19 +22234,26 @@ init_RcRef();
21678
22234
  * @since 4.0.0
21679
22235
  */
21680
22236
  var layer$3 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
21681
- const stdin = process.stdin;
21682
- const stdout = process.stdout;
21683
22237
  const lines = yield* make$42();
21684
- let inputEnded = stdin.readableEnded;
22238
+ let inputEnded = false;
21685
22239
  let readlineActive = false;
21686
22240
  const onStdinEnd = () => {
21687
22241
  inputEnded = true;
21688
22242
  if (!readlineActive) endUnsafe(lines);
21689
22243
  };
21690
- stdin.once("end", onStdinEnd);
21691
- yield* addFinalizer(() => sync(() => stdin.off("end", onStdinEnd)));
22244
+ let stdin;
22245
+ const getStdin = () => {
22246
+ if (stdin === void 0) {
22247
+ stdin = process.stdin;
22248
+ if (stdin.readableEnded) onStdinEnd();
22249
+ else stdin.once("end", onStdinEnd);
22250
+ }
22251
+ return stdin;
22252
+ };
22253
+ yield* addFinalizer(() => sync(() => stdin?.off("end", onStdinEnd)));
21692
22254
  const rlRef = yield* make$38({
21693
22255
  acquire: acquireRelease(sync(() => {
22256
+ const stdin = getStdin();
21694
22257
  const rl = readline.createInterface({
21695
22258
  input: stdin,
21696
22259
  escapeCodeTimeout: 50
@@ -21719,15 +22282,17 @@ var layer$3 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUn
21719
22282
  idleTimeToLive: "10 millis"
21720
22283
  });
21721
22284
  const setRawMode = (enabled) => sync(() => {
22285
+ const stdin = getStdin();
21722
22286
  if (stdin.isTTY) stdin.setRawMode(enabled);
21723
22287
  });
21724
22288
  const rawModeRef = yield* make$38({
21725
22289
  acquire: acquireRelease(setRawMode(true), () => setRawMode(false)),
21726
22290
  idleTimeToLive: "10 millis"
21727
22291
  });
21728
- const columns = sync(() => stdout.columns ?? 0);
21729
- const rows = sync(() => stdout.rows ?? 0);
22292
+ const columns = sync(() => process.stdout.columns ?? 0);
22293
+ const rows = sync(() => process.stdout.rows ?? 0);
21730
22294
  const size = gen(function* () {
22295
+ const stdout = process.stdout;
21731
22296
  const queue = yield* sliding(1);
21732
22297
  const onResize = () => offerUnsafe(queue, {
21733
22298
  columns: stdout.columns ?? 0,
@@ -21742,6 +22307,7 @@ var layer$3 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUn
21742
22307
  return queue;
21743
22308
  });
21744
22309
  const readInput = gen(function* () {
22310
+ const stdin = getStdin();
21745
22311
  const queue = yield* make$42();
21746
22312
  const handleKeypress = (s, k) => {
21747
22313
  const userInput = {
@@ -21780,7 +22346,7 @@ var layer$3 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUn
21780
22346
  onSome: succeed$4
21781
22347
  })), mapError$2(() => new QuitError({}))));
21782
22348
  const display = (prompt) => uninterruptible(callback$1((resume) => {
21783
- stdout.write(prompt, (err) => isNullish(err) ? resume(void_$1) : resume(fail$3(badArgument({
22349
+ process.stdout.write(prompt, (err) => isNullish(err) ? resume(void_$1) : resume(fail$3(badArgument({
21784
22350
  module: "Terminal",
21785
22351
  method: "display",
21786
22352
  description: "Failed to write prompt to stdout",
@@ -21800,7 +22366,7 @@ function defaultShouldQuit(input) {
21800
22366
  const key = input.key;
21801
22367
  return key.name === "escape" || key.ctrl && (key.name === "c" || key.name === "d");
21802
22368
  }
21803
- // node_modules/.pnpm/@effect+platform-node@4.1.2_effect@4.1.2_redis@6.3.0/node_modules/@effect/platform-node/dist/NodeTerminal.js
22369
+ // node_modules/.pnpm/@effect+platform-node@4.1.4_effect@4.1.4_redis@6.3.1/node_modules/@effect/platform-node/dist/NodeTerminal.js
21804
22370
  /**
21805
22371
  * Node.js implementation of the Effect `Terminal` service.
21806
22372
  *
@@ -21820,7 +22386,7 @@ function defaultShouldQuit(input) {
21820
22386
  * @since 4.0.0
21821
22387
  */
21822
22388
  var layer$2 = layer$3;
21823
- // node_modules/.pnpm/@effect+platform-node@4.1.2_effect@4.1.2_redis@6.3.0/node_modules/@effect/platform-node/dist/NodeServices.js
22389
+ // node_modules/.pnpm/@effect+platform-node@4.1.4_effect@4.1.4_redis@6.3.1/node_modules/@effect/platform-node/dist/NodeServices.js
21824
22390
  init_Layer();
21825
22391
  /**
21826
22392
  * Provides the default Node implementations for child process spawning,
@@ -21831,293 +22397,7 @@ init_Layer();
21831
22397
  * @since 4.0.0
21832
22398
  */
21833
22399
  var layer$1 = /*#__PURE__*/ provideMerge(layer$10, /*#__PURE__*/ mergeAll(layer$8, layer$6, layer$4, layer$2));
21834
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Runtime.js
21835
- init_Cause();
21836
- init_Effect();
21837
- init_Exit();
21838
- init_Function();
21839
- /**
21840
- * The default teardown function that determines exit codes from an Effect exit.
21841
- *
21842
- * **When to use**
21843
- *
21844
- * Use as the standard teardown for main programs with conventional process
21845
- * exit codes and support for {@link errorExitCode}.
21846
- *
21847
- * **Details**
21848
- *
21849
- * This teardown follows these exit-code rules:
21850
- *
21851
- * - `0` for successful completion.
21852
- * - `130` for interruption-only failures.
21853
- * - The squashed error's {@link errorExitCode} value for other failures when
21854
- * present.
21855
- * - `1` for other failures.
21856
- *
21857
- * **Gotchas**
21858
- *
21859
- * The `130` code is used only when the Cause contains interruptions and no
21860
- * other failure reasons. Mixed causes use the squashed error path instead.
21861
- *
21862
- * **Example** (Referencing default teardown)
21863
- *
21864
- * ```ts import.meta.vitest
21865
- * import { Exit, Runtime } from "effect"
21866
- *
21867
- * const exitCodes: Array<number> = []
21868
- * const collectExitCode = (exit: Exit.Exit<any, any>) =>
21869
- * Runtime.defaultTeardown(exit, (code) => exitCodes.push(code))
21870
- *
21871
- * collectExitCode(Exit.succeed(42))
21872
- * collectExitCode(Exit.fail("error"))
21873
- * collectExitCode(Exit.interrupt(123))
21874
- *
21875
- * exitCodes // => [0, 1, 130]
21876
- * ```
21877
- *
21878
- * @see {@link errorExitCode} for customizing failure exit codes
21879
- *
21880
- * @stability stable
21881
- * @category running
21882
- * @since 4.0.0
21883
- */
21884
- var defaultTeardown = (exit, onExit) => {
21885
- if (isSuccess(exit)) return onExit(0);
21886
- if (hasInterruptsOnly(exit.cause)) return onExit(130);
21887
- return onExit(getErrorExitCode(squash(exit.cause)));
21888
- };
21889
- /**
21890
- * Creates a platform-specific main program runner that handles Effect execution lifecycle.
21891
- *
21892
- * **When to use**
21893
- *
21894
- * Use when building a runtime adapter for a host platform.
21895
- *
21896
- * **Details**
21897
- *
21898
- * The setup function runs before user code and receives the main fiber and a
21899
- * teardown callback to install platform-specific signal handlers, observers,
21900
- * and exit behavior.
21901
- *
21902
- * Most applications should use a platform-provided runner, such as
21903
- * `NodeRuntime.runMain`, rather than constructing one directly.
21904
- *
21905
- * `disableErrorReporting` disables the automatic log emitted for unreported
21906
- * non-interruption failures. It does not change exit-code calculation or the
21907
- * custom teardown callback.
21908
- *
21909
- * **Gotchas**
21910
- *
21911
- * The setup function is responsible for observing the fiber and eventually
21912
- * invoking teardown. `makeRunMain` also tries to keep the host process alive
21913
- * with a long interval while the main fiber is running; if the host blocks
21914
- * timers, the runner still starts but cannot use that keep-alive fallback.
21915
- *
21916
- * **Example** (Creating platform runners)
21917
- *
21918
- * ```ts import.meta.vitest
21919
- * import { Effect, Exit, Runtime } from "effect"
21920
- *
21921
- * const events: Array<string> = []
21922
- * const completed = new Promise<readonly [Exit.Exit<unknown, unknown>, number]>((resolve) => {
21923
- * // Create a simple runner for a hypothetical platform
21924
- * const runMain = Runtime.makeRunMain(({ fiber, teardown }) => {
21925
- * // Handle fiber completion
21926
- * fiber.addObserver((exit) => {
21927
- * teardown(exit, (code) => resolve([exit, code]))
21928
- * })
21929
- * })
21930
- *
21931
- * // Use the runner
21932
- * const program = Effect.sync(() => {
21933
- * events.push("Starting program", "Program completed")
21934
- * return "success"
21935
- * })
21936
- *
21937
- * runMain(program, {
21938
- * teardown: (exit, onExit) => {
21939
- * events.push("Custom teardown logic")
21940
- * Runtime.defaultTeardown(exit, onExit)
21941
- * }
21942
- * })
21943
- * })
21944
- *
21945
- * const result = await completed
21946
- * result // => [Exit.succeed("success"), 0]
21947
- * events // => ["Starting program", "Program completed", "Custom teardown logic"]
21948
- * ```
21949
- *
21950
- * @stability stable
21951
- * @category running
21952
- * @since 4.0.0
21953
- */
21954
- var makeRunMain = (f) => dual((args) => isEffect(args[0]), (effect, options) => {
21955
- const main = options?.disableErrorReporting === true ? effect : tapCause(effect, (cause) => {
21956
- if (hasInterruptsOnly(cause)) return void_$1;
21957
- return getErrorReported(squash(cause)) ? logError(cause) : void_$1;
21958
- });
21959
- const teardown = options?.teardown ?? defaultTeardown;
21960
- runFork(withFiber((fiber) => {
21961
- try {
21962
- const keepAlive = globalThis.setInterval(constVoid, 2147483647);
21963
- fiber.addObserver(() => {
21964
- clearInterval(keepAlive);
21965
- });
21966
- } catch {}
21967
- f({
21968
- fiber,
21969
- teardown
21970
- });
21971
- return main;
21972
- }));
21973
- });
21974
- /**
21975
- * Allows associating an exit code with an error for determining the process
21976
- * exit code on failure.
21977
- *
21978
- * **When to use**
21979
- *
21980
- * Use when error classes should map failures to a specific process exit code
21981
- * when handled by {@link defaultTeardown}.
21982
- *
21983
- * **Details**
21984
- *
21985
- * Attach this marker as a readonly property on an error object. When the main
21986
- * program fails, {@link defaultTeardown} squashes the Cause and reads the marker
21987
- * from the resulting error value.
21988
- *
21989
- * **Gotchas**
21990
- *
21991
- * The marker is read from the squashed failure value. If a Cause contains
21992
- * multiple failures, the selected squashed error determines the exit code.
21993
- *
21994
- * **Example** (Setting a process exit code)
21995
- *
21996
- * ```ts import.meta.vitest
21997
- * import { Data, Runtime } from "effect"
21998
- *
21999
- * class MyError extends Data.TaggedError("MyError") {
22000
- * readonly [Runtime.errorExitCode] = 42
22001
- * }
22002
- *
22003
- * Runtime.getErrorExitCode(new MyError()) // => 42
22004
- * ```
22005
- *
22006
- * @see {@link errorReported} for controlling automatic error logging
22007
- * @see {@link defaultTeardown} for the default failure exit-code rules that read this marker
22008
- * @see {@link getErrorExitCode} for reading the marker from unknown error values
22009
- *
22010
- * @stability stable
22011
- * @category symbols
22012
- * @since 4.0.0
22013
- */
22014
- var errorExitCode = "~effect/Runtime/errorExitCode";
22015
- /**
22016
- * Reads the runtime exit-code marker from an unknown error value.
22017
- *
22018
- * **When to use**
22019
- *
22020
- * Use to read a custom failure exit code from an unknown error value, falling
22021
- * back to the default failure code.
22022
- *
22023
- * **Details**
22024
- *
22025
- * Returns the numeric `[Runtime.errorExitCode]` property when it is present on
22026
- * an object. Otherwise returns `1`, the default failure exit code used by
22027
- * `defaultTeardown`.
22028
- *
22029
- * **Gotchas**
22030
- *
22031
- * Non-object values, missing markers, and non-number marker values all return
22032
- * `1`.
22033
- *
22034
- * @see {@link errorExitCode} for the marker read by this function
22035
- *
22036
- * @stability stable
22037
- * @category getters
22038
- * @since 4.0.0
22039
- */
22040
- var getErrorExitCode = (u) => {
22041
- if (typeof u === "object" && u !== null && "~effect/Runtime/errorExitCode" in u) {
22042
- const code = u[errorExitCode];
22043
- if (typeof code === "number") return code;
22044
- }
22045
- return 1;
22046
- };
22047
- /**
22048
- * Defines the runtime marker that controls default `runMain` error logging for an error.
22049
- *
22050
- * **When to use**
22051
- *
22052
- * Use when you need error classes reported by application code to avoid being
22053
- * logged again by the default main runner.
22054
- *
22055
- * **Details**
22056
- *
22057
- * Set `[Runtime.errorReported]` to `false` on an error object to suppress the
22058
- * runtime log because the error has already been reported. Omitted or
22059
- * non-boolean values are treated as `true`, so failures are logged by default.
22060
- *
22061
- * **Gotchas**
22062
- *
22063
- * This marker controls only automatic error logging. It does not change the
22064
- * failure Cause or the process exit code.
22065
- * `makeRunMain` reads the marker from `Cause.squash(cause)`, so for causes
22066
- * with multiple failures, the squashed error determines whether default logging
22067
- * is suppressed.
22068
- *
22069
- * **Example** (Suppressing error reporting)
22070
- *
22071
- * ```ts import.meta.vitest
22072
- * import { Data, Runtime } from "effect"
22073
- *
22074
- * class MyError extends Data.TaggedError("MyError") {
22075
- * readonly [Runtime.errorReported] = false
22076
- * }
22077
- *
22078
- * Runtime.getErrorReported(new MyError()) // => false
22079
- * ```
22080
- *
22081
- * @see {@link errorExitCode} for controlling failure exit codes
22082
- * @see {@link getErrorReported} for reading the marker from unknown error values
22083
- *
22084
- * @stability stable
22085
- * @category symbols
22086
- * @since 4.0.0
22087
- */
22088
- var errorReported = "~effect/Runtime/errorReported";
22089
- /**
22090
- * Reads the runtime error-reporting marker from an unknown error value.
22091
- *
22092
- * **When to use**
22093
- *
22094
- * Use to read whether an unknown error value should be treated as already
22095
- * reported by the default main runner.
22096
- *
22097
- * **Details**
22098
- *
22099
- * Returns a boolean `[Runtime.errorReported]` property when it is present on an
22100
- * object. Otherwise returns `true`, so failures are logged by default.
22101
- *
22102
- * **Gotchas**
22103
- *
22104
- * Non-object values, missing markers, and non-boolean marker values all return
22105
- * `true`.
22106
- *
22107
- * @see {@link errorReported} for the marker read by this function
22108
- *
22109
- * @stability stable
22110
- * @category getters
22111
- * @since 4.0.0
22112
- */
22113
- var getErrorReported = (u) => {
22114
- if (typeof u === "object" && u !== null && "~effect/Runtime/errorReported" in u) {
22115
- const isReported = u[errorReported];
22116
- if (typeof isReported === "boolean") return isReported;
22117
- }
22118
- return true;
22119
- };
22120
- // node_modules/.pnpm/@effect+platform-node@4.1.2_effect@4.1.2_redis@6.3.0/node_modules/@effect/platform-node/dist/NodeRuntime.js
22400
+ // node_modules/.pnpm/@effect+platform-node@4.1.4_effect@4.1.4_redis@6.3.1/node_modules/@effect/platform-node/dist/NodeRuntime.js
22121
22401
  /**
22122
22402
  * Node.js process runner for Effect programs.
22123
22403
  *
@@ -22170,7 +22450,7 @@ var runMain = /* @__PURE__ */ makeRunMain(({ fiber, teardown }) => {
22170
22450
  process.on("SIGINT", onSigint);
22171
22451
  process.on("SIGTERM", onSigint);
22172
22452
  });
22173
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Console.js
22453
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Console.js
22174
22454
  init_core();
22175
22455
  init_effect();
22176
22456
  /**
@@ -22310,7 +22590,7 @@ var error = (...args) => consoleWith((console) => sync$1(() => {
22310
22590
  var log = (...args) => consoleWith((console) => sync$1(() => {
22311
22591
  console.log(...args);
22312
22592
  }));
22313
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Logger.js
22593
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Logger.js
22314
22594
  init_effect();
22315
22595
  /**
22316
22596
  * Context reference that routes the built-in default logger and TTY pretty
@@ -22335,7 +22615,7 @@ init_effect();
22335
22615
  * @since 4.0.0
22336
22616
  */
22337
22617
  var LogToStderr = LogToStderr$1;
22338
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/matcher.js
22618
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/internal/matcher.js
22339
22619
  init_Function();
22340
22620
  init_Pipeable();
22341
22621
  init_Result();
@@ -22406,7 +22686,7 @@ var discriminator = (field) => (...pattern) => {
22406
22686
  };
22407
22687
  /** @internal */
22408
22688
  var discriminators = (field) => (fields) => {
22409
- const predicate = makeWhen((arg) => arg != null && Object.hasOwn(fields, arg[field]), (data) => fields[data[field]](data));
22689
+ const predicate = makeWhen((arg) => arg != null && Object.hasOwn(fields, arg[field]) && fields[arg[field]] !== void 0, (data) => fields[data[field]](data));
22410
22690
  return (self) => self.add(predicate);
22411
22691
  };
22412
22692
  /** @internal */
@@ -22458,7 +22738,7 @@ var exhaustive$1 = (self) => {
22458
22738
  throw new Error(getExhaustiveAbsurdErrorMessage);
22459
22739
  };
22460
22740
  };
22461
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Match.js
22741
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Match.js
22462
22742
  /**
22463
22743
  * Builds pattern matchers for TypeScript values.
22464
22744
  *
@@ -22724,7 +23004,7 @@ var is = is$1;
22724
23004
  * @since 4.0.0
22725
23005
  */
22726
23006
  var exhaustive = exhaustive$1;
22727
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/CliError.js
23007
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/CliError.js
22728
23008
  init_Predicate();
22729
23009
  init_Schema();
22730
23010
  /**
@@ -22766,10 +23046,11 @@ var isCliError = (u) => hasProperty(u, TypeId$7);
22766
23046
  *
22767
23047
  * **Details**
22768
23048
  *
22769
- * When a handler failure has a string `[CliError.userMessage]`, `Command.run`
22770
- * renders it with the installed formatter, sets `Runtime.errorReported` to
22771
- * `false`, and rethrows the original error, so its tag is preserved. The
22772
- * global `Error` interface declares this key as an optional string.
23049
+ * When a handler or `Command.validate` failure has a string
23050
+ * `[CliError.userMessage]`, `Command.run` renders it with the installed
23051
+ * formatter, sets `Runtime.errorReported` to `false`, and rethrows the
23052
+ * original error, so its tag is preserved. The global `Error` interface
23053
+ * declares this key as an optional string.
22773
23054
  *
22774
23055
  * **Example** (Rendering a tagged handler failure)
22775
23056
  *
@@ -23179,6 +23460,8 @@ var UnknownSubcommand = class extends (/*#__PURE__*/ TaggedError(`${TypeId$7}/Un
23179
23460
  * Fail with it from `Command.validate`, `Flag.mapEffect` or
23180
23461
  * `Argument.mapEffect`. The runner shows it with the command help, like any
23181
23462
  * other parse error. Handlers report their own failures with `UserError`.
23463
+ * To report a `Command.validate` failure without help, fail with your own
23464
+ * error instead.
23182
23465
  *
23183
23466
  * **Example** (Rejecting a flag combination)
23184
23467
  *
@@ -23340,7 +23623,7 @@ var ShowHelp = class extends (/*#__PURE__*/ TaggedError(`${TypeId$7}/ShowHelp`)(
23340
23623
  return "Help requested";
23341
23624
  }
23342
23625
  };
23343
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/Primitive.js
23626
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/Primitive.js
23344
23627
  init_Effect();
23345
23628
  init_Formatter();
23346
23629
  init_Function();
@@ -23613,7 +23896,7 @@ var getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.choic
23613
23896
  * @internal
23614
23897
  */
23615
23898
  var getPathType = (primitive) => primitive._tag === "Path" ? primitive.pathType : void 0;
23616
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/ansi.js
23899
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/ansi.js
23617
23900
  /**
23618
23901
  * Internal ANSI escape sequence helpers used by the unstable CLI rendering
23619
23902
  * implementation. This module centralizes the control codes for text styling,
@@ -23743,7 +24026,7 @@ var eraseLines = (rows) => {
23743
24026
  if (rows > 0) command += `${ESC}G`;
23744
24027
  return command;
23745
24028
  };
23746
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/Prompt.js
24029
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/Prompt.js
23747
24030
  init_Array();
23748
24031
  init_Context();
23749
24032
  init_Data();
@@ -25378,7 +25661,7 @@ var entriesToDisplay = (cursor, total, maxVisible) => {
25378
25661
  endIndex
25379
25662
  };
25380
25663
  };
25381
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/TerminalCapabilities.js
25664
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/TerminalCapabilities.js
25382
25665
  init_Context();
25383
25666
  /**
25384
25667
  * Reference to the terminal capabilities of the current process.
@@ -25424,7 +25707,8 @@ var fromProcess = () => {
25424
25707
  stdoutIsTerminal: process?.stdout?.isTTY === true
25425
25708
  });
25426
25709
  };
25427
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/Param.js
25710
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/Param.js
25711
+ init_Context();
25428
25712
  init_Effect();
25429
25713
  init_Function();
25430
25714
  init_Option();
@@ -25513,6 +25797,7 @@ var makeSingle = (params) => {
25513
25797
  description: params.description ?? none(),
25514
25798
  aliases: params.aliases ?? [],
25515
25799
  hidden: params.hidden ?? false,
25800
+ annotations: params.annotations ?? empty$11(),
25516
25801
  parse
25517
25802
  }, Proto$3);
25518
25803
  };
@@ -25734,7 +26019,7 @@ var map$1 = /*#__PURE__*/ dual(2, (self, f) => {
25734
26019
  parse
25735
26020
  });
25736
26021
  });
25737
- var transform = (self, f, alternatives = []) => {
26022
+ var transform = (self, f, alternatives = [], fallback) => {
25738
26023
  const alternativeParsers = alternatives.map((alternative) => () => alternative().parse);
25739
26024
  return Object.assign(Object.create(Proto$3), {
25740
26025
  _tag: "Transform",
@@ -25742,67 +26027,11 @@ var transform = (self, f, alternatives = []) => {
25742
26027
  param: self,
25743
26028
  alternatives,
25744
26029
  f,
26030
+ fallback,
25745
26031
  parse: f(self.parse, alternativeParsers)
25746
26032
  });
25747
26033
  };
25748
26034
  /**
25749
- * Transforms the parsed value of an option using an effectful mapping function.
25750
- *
25751
- * **Example** (Mapping parsed values effectfully)
25752
- *
25753
- * ```ts import.meta.vitest
25754
- * import { Effect, FileSystem, Layer, Path, Stdio, Terminal } from "effect"
25755
- * import { CliError, Param } from "effect/cli"
25756
- * import { ChildProcessSpawner } from "effect/process"
25757
- *
25758
- * const CliTestLayer = Layer.mergeAll(
25759
- * FileSystem.layerNoop({}),
25760
- * Path.layer,
25761
- * Stdio.layerTest({}),
25762
- * Layer.succeed(Terminal.Terminal, Terminal.make({
25763
- * columns: Effect.succeed(80),
25764
- * rows: Effect.succeed(24),
25765
- * size: Effect.die("unused"),
25766
- * readInput: Effect.die("unused"),
25767
- * readLine: Effect.die("unused"),
25768
- * display: () => Effect.void
25769
- * })),
25770
- * Layer.succeed(
25771
- * ChildProcessSpawner.ChildProcessSpawner,
25772
- * ChildProcessSpawner.make(() => Effect.die("unused"))
25773
- * )
25774
- * )
25775
- *
25776
- * const validatedEmail = Param.String(Param.flagKind, "email").pipe(
25777
- * Param.mapEffect((email) =>
25778
- * email.includes("@")
25779
- * ? Effect.succeed(email)
25780
- * : Effect.fail(
25781
- * new CliError.InvalidValue({
25782
- * option: "email",
25783
- * value: email,
25784
- * expected: "valid email format",
25785
- * kind: "flag"
25786
- * })
25787
- * )
25788
- * )
25789
- * )
25790
- *
25791
- * const [, value] = await Effect.runPromise(
25792
- * validatedEmail.parse({
25793
- * arguments: [],
25794
- * flags: { email: ["alice@example.com"] }
25795
- * }).pipe(Effect.provide(CliTestLayer))
25796
- * )
25797
- * value // => "alice@example.com"
25798
- * ```
25799
- *
25800
- * @stability unstable
25801
- * @category combinators
25802
- * @since 4.0.0
25803
- */
25804
- var mapEffect = /*#__PURE__*/ dual(2, (self, f) => transform(self, (parse) => (args) => flatMap$1(parse(args), ([leftover, a]) => f(a).pipe(map$4((b) => [leftover, b])))));
25805
- /**
25806
26035
  * Makes a flag or positional argument optional.
25807
26036
  *
25808
26037
  * **Details**
@@ -25871,11 +26100,14 @@ var optional$7 = (param) => {
25871
26100
  * @since 4.0.0
25872
26101
  */
25873
26102
  var withDefault$1 = /*#__PURE__*/ dual(2, (self, defaultValue) => {
25874
- if (!isEffect(defaultValue)) return map$1(optional$7(self), getOrElse(() => defaultValue));
25875
- return mapEffect(optional$7(self), match$5({
25876
- onNone: () => defaultValue,
25877
- onSome: succeed$4
25878
- }));
26103
+ if (!isEffect(defaultValue)) return transform(optional$7(self), (parse) => (args) => map$4(parse(args), ([leftover, value]) => [leftover, getOrElse(value, () => defaultValue)]), [], {
26104
+ _tag: "Default",
26105
+ value: defaultValue
26106
+ });
26107
+ return transform(optional$7(self), (parse) => (args) => flatMap$1(parse(args), ([leftover, value]) => match$5(value, {
26108
+ onNone: () => map$4(defaultValue, (b) => [leftover, b]),
26109
+ onSome: (a) => succeed$4([leftover, a])
26110
+ })), [], { _tag: "DefaultEffect" });
25879
26111
  });
25880
26112
  /**
25881
26113
  * Creates a variadic parameter that can be specified multiple times.
@@ -26058,7 +26290,7 @@ var transformSingle = (param, f) => {
26058
26290
  return matchParam(param, {
26059
26291
  Single: (single) => f(single),
26060
26292
  Map: (mapped) => map$1(transformSingle(mapped.param, f), mapped.f),
26061
- Transform: (mapped) => transform(transformSingle(mapped.param, f), mapped.f, mapped.alternatives.map((alternative) => () => transformSingle(alternative(), f))),
26293
+ Transform: (mapped) => transform(transformSingle(mapped.param, f), mapped.f, mapped.alternatives.map((alternative) => () => transformSingle(alternative(), f)), mapped.fallback),
26062
26294
  Optional: (p) => optional$7(transformSingle(p.param, f)),
26063
26295
  Variadic: (p) => variadic(transformSingle(p.param, f), {
26064
26296
  min: getOrUndefined$1(p.min),
@@ -26099,28 +26331,33 @@ var getUnderlyingSingleOrThrow = (param) => {
26099
26331
  * @internal
26100
26332
  */
26101
26333
  var getParamMetadata = (param) => {
26102
- return matchParam(param, {
26103
- Single: () => ({
26104
- isOptional: false,
26105
- isVariadic: false,
26106
- variadicMin: none(),
26107
- variadicMax: none()
26108
- }),
26109
- Map: (mapped) => getParamMetadata(mapped.param),
26110
- Transform: (mapped) => getParamMetadata(mapped.param),
26111
- Optional: (optional) => ({
26112
- ...getParamMetadata(optional.param),
26113
- isOptional: true
26114
- }),
26115
- Variadic: (variadic) => ({
26116
- ...getParamMetadata(variadic.param),
26117
- isVariadic: true,
26118
- variadicMin: variadic.min,
26119
- variadicMax: variadic.max
26120
- })
26121
- });
26334
+ const metadata = collectParamMetadata(param);
26335
+ return {
26336
+ ...metadata,
26337
+ isRequired: !metadata.isOptional && (!metadata.isVariadic || exists$1(metadata.variadicMin, (min) => min > 0))
26338
+ };
26122
26339
  };
26123
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/Argument.js
26340
+ var collectParamMetadata = (param) => matchParam(param, {
26341
+ Single: () => ({
26342
+ isOptional: false,
26343
+ isVariadic: false,
26344
+ variadicMin: none(),
26345
+ variadicMax: none()
26346
+ }),
26347
+ Map: (mapped) => collectParamMetadata(mapped.param),
26348
+ Transform: (mapped) => collectParamMetadata(mapped.param),
26349
+ Optional: (optional) => ({
26350
+ ...collectParamMetadata(optional.param),
26351
+ isOptional: true
26352
+ }),
26353
+ Variadic: (variadic) => ({
26354
+ ...collectParamMetadata(variadic.param),
26355
+ isVariadic: true,
26356
+ variadicMin: variadic.min,
26357
+ variadicMax: variadic.max
26358
+ })
26359
+ });
26360
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/Argument.js
26124
26361
  init_Function();
26125
26362
  /**
26126
26363
  * Creates a positional string argument.
@@ -26158,7 +26395,7 @@ var String$2 = (name) => String$3(argumentKind, name);
26158
26395
  * @since 4.0.0
26159
26396
  */
26160
26397
  var withDescription$2 = /*#__PURE__*/ dual(2, (self, description) => withDescription$3(self, description));
26161
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/CliOutput.js
26398
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/CliOutput.js
26162
26399
  /**
26163
26400
  * Formats and presents CLI help, errors, and version information.
26164
26401
  *
@@ -26549,7 +26786,7 @@ var formatHelpDocImpl = (doc, colors, options) => {
26549
26786
  if (sections[sections.length - 1] === "") sections.pop();
26550
26787
  return sections.join("\n");
26551
26788
  };
26552
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/config.js
26789
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/config.js
26553
26790
  init_record();
26554
26791
  var ConfigInternalTypeId = "~effect/cli/Command/Config/Internal";
26555
26792
  /**
@@ -26622,7 +26859,7 @@ var reconstructTree = (tree, results) => {
26622
26859
  }
26623
26860
  }
26624
26861
  };
26625
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/command.js
26862
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/command.js
26626
26863
  init_Array();
26627
26864
  init_Context();
26628
26865
  init_Effect();
@@ -26668,7 +26905,7 @@ var makeCommand = (options) => {
26668
26905
  name: single.name,
26669
26906
  type: single.typeName ?? getTypeName(single.primitiveType),
26670
26907
  description: single.description,
26671
- required: !metadata.isOptional && (!metadata.isVariadic || exists$1(metadata.variadicMin, (min) => min > 0)),
26908
+ required: metadata.isRequired,
26672
26909
  variadic: metadata.isVariadic
26673
26910
  });
26674
26911
  }
@@ -26817,7 +27054,7 @@ var checkForDuplicateFlags = (parent, subcommands, options) => {
26817
27054
  }
26818
27055
  }
26819
27056
  };
26820
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/completions/descriptor.js
27057
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/completions/descriptor.js
26821
27058
  init_Option();
26822
27059
  var toFlagType = (single) => {
26823
27060
  switch (single.primitiveType._tag) {
@@ -26865,6 +27102,20 @@ var toArgumentType = (single) => {
26865
27102
  }
26866
27103
  };
26867
27104
  /**
27105
+ * Pairs each single flag with whether it can be repeated. The outermost
27106
+ * variadic decides, and each `orElse` alternative is resolved separately.
27107
+ */
27108
+ var repeatableSingles = (param, repeatable) => {
27109
+ const p = param;
27110
+ switch (p._tag) {
27111
+ case "Single": return [[p, repeatable === true]];
27112
+ case "Map":
27113
+ case "Optional": return repeatableSingles(p.param, repeatable);
27114
+ case "Transform": return [...repeatableSingles(p.param, repeatable), ...p.alternatives.flatMap((alternative) => repeatableSingles(alternative(), repeatable))];
27115
+ case "Variadic": return repeatableSingles(p.param, repeatable ?? !exists$1(p.max, (max) => max <= 1));
27116
+ }
27117
+ };
27118
+ /**
26868
27119
  * @internal
26869
27120
  */
26870
27121
  var fromCommand$1 = (cmd, inheritedFlags = []) => {
@@ -26872,22 +27123,19 @@ var fromCommand$1 = (cmd, inheritedFlags = []) => {
26872
27123
  const config = impl.config;
26873
27124
  const flags = [];
26874
27125
  const seen = /* @__PURE__ */ new Set();
26875
- for (const [index, flag] of [...config.flags, ...inheritedFlags].entries()) {
26876
- const singles = extractSingleParams(flag);
26877
- for (const single of singles) {
26878
- if (single.kind !== "flag") continue;
26879
- if (single.hidden) continue;
26880
- if (index >= config.flags.length && seen.has(single.name)) continue;
26881
- seen.add(single.name);
26882
- flags.push({
26883
- name: single.name,
26884
- aliases: single.aliases,
26885
- description: getOrUndefined$1(single.description),
26886
- type: toFlagType(single),
26887
- optionalValue: single.optionalValue !== void 0,
26888
- negation: single.negation
26889
- });
26890
- }
27126
+ for (const [index, flag] of [...config.flags, ...inheritedFlags].entries()) for (const [single, repeatable] of repeatableSingles(flag)) {
27127
+ if (single.hidden) continue;
27128
+ if (index >= config.flags.length && seen.has(single.name)) continue;
27129
+ seen.add(single.name);
27130
+ flags.push({
27131
+ name: single.name,
27132
+ aliases: single.aliases,
27133
+ description: getOrUndefined$1(single.description),
27134
+ type: toFlagType(single),
27135
+ optionalValue: single.optionalValue !== void 0,
27136
+ repeatable,
27137
+ negation: single.negation
27138
+ });
26891
27139
  }
26892
27140
  const args = [];
26893
27141
  for (const arg of config.arguments) {
@@ -26898,7 +27146,7 @@ var fromCommand$1 = (cmd, inheritedFlags = []) => {
26898
27146
  args.push({
26899
27147
  name: single.name,
26900
27148
  description: getOrUndefined$1(single.description),
26901
- required: !metadata.isOptional,
27149
+ required: !metadata.isOptional && (!metadata.isVariadic || exists$1(metadata.variadicMin, (min) => min > 0)),
26902
27150
  variadic: metadata.isVariadic,
26903
27151
  type: toArgumentType(single)
26904
27152
  });
@@ -26936,7 +27184,7 @@ var takesSeparateValue = (flag) => flag.type._tag !== "Boolean" && flag.optional
26936
27184
  * @internal
26937
27185
  */
26938
27186
  var negatedName$1 = (flag) => flag.type._tag !== "Boolean" || flag.negation === false ? void 0 : flag.negation ?? `no-${flag.name}`;
26939
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/completions/bash.js
27187
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/completions/bash.js
26940
27188
  var escapeForBash = (s) => s.replace(/'/g, "'\\''");
26941
27189
  var sanitizeFunctionName = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
26942
27190
  var flagNamesForWordlist = (flag) => {
@@ -26960,7 +27208,8 @@ var buildFlagGroupDeclarations = (flags, lines) => {
26960
27208
  lines.push(` done`);
26961
27209
  lines.push(` local _filtered_flags=""`);
26962
27210
  groups.forEach((forms, index) => {
26963
- lines.push(` [[ -n "$_used_${index}" ]] || _filtered_flags+=" ${forms.join(" ")}"`);
27211
+ const guard = flags[index].repeatable === true ? "" : `[[ -n "$_used_${index}" ]] || `;
27212
+ lines.push(` ${guard}_filtered_flags+=" ${forms.join(" ")}"`);
26964
27213
  });
26965
27214
  lines.push(``);
26966
27215
  };
@@ -27073,12 +27322,10 @@ var pathsHelper = (helpers, lines) => {
27073
27322
  lines.push(`}`);
27074
27323
  lines.push(``);
27075
27324
  };
27325
+ var choicesCompletion = (values, helpers) => `${helpers.choices} "$cur" "$_comp_word" ${values.map((value) => `'${escapeForBash(value)}'`).join(" ")}`;
27076
27326
  var valueCompletion = (type, helpers) => {
27077
27327
  switch (type._tag) {
27078
- case "Choice": {
27079
- const values = type.values.map((value) => `'${escapeForBash(value)}'`).join(" ");
27080
- return `${helpers.choices} "$cur" "$_comp_word" ${values}`;
27081
- }
27328
+ case "Choice": return choicesCompletion(type.values, helpers);
27082
27329
  case "Path": return `${helpers.paths} ${type.pathType === "directory" ? "-d" : "-f"} "$cur" "$_comp_word"`;
27083
27330
  default: return;
27084
27331
  }
@@ -27196,10 +27443,7 @@ var generateFunction$1 = (descriptor, parentPath, lines, helpers) => {
27196
27443
  lines.push(` return`);
27197
27444
  lines.push(` fi`);
27198
27445
  }
27199
- } else if (descriptor.subcommands.length > 0) {
27200
- const subNames = descriptor.subcommands.map((s) => s.name);
27201
- lines.push(` COMPREPLY=( $(compgen -W '${subNames.join(" ")}' -- "$cur") )`);
27202
- }
27446
+ } else if (descriptor.subcommands.length > 0) lines.push(` ${choicesCompletion(descriptor.subcommands.map((s) => s.name), helpers)}`);
27203
27447
  lines.push(`}`);
27204
27448
  lines.push(``);
27205
27449
  for (const sub of descriptor.subcommands) generateFunction$1(sub, currentPath, lines, helpers);
@@ -27255,7 +27499,7 @@ var generate$4 = (executableName, descriptor) => {
27255
27499
  lines.push(`###-end-${escapeForBash(executableName)}-completions-###`);
27256
27500
  return lines.join("\n");
27257
27501
  };
27258
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/completions/fish.js
27502
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/completions/fish.js
27259
27503
  var escapeFishString = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
27260
27504
  /** Escape choices for Fish's second expansion of `complete -a`. */
27261
27505
  var escapeFishChoice = (s) => escapeFishString(s.replace(/[^A-Za-z0-9_.,/@%+-]/gu, "\\$&"));
@@ -27338,8 +27582,7 @@ var generateCompletions = (executableName, descriptor, parentPath, lines) => {
27338
27582
  lines.push(parts.join(" "));
27339
27583
  }
27340
27584
  for (const flag of descriptor.flags) {
27341
- const dedup = takesSeparateValue(flag) ? valueFlagDedupCondition(flag) : flagContainsOptCondition(flag);
27342
- const flagCondition = condition ? `${condition}; and ${dedup}` : dedup;
27585
+ const flagCondition = [condition, flag.repeatable === true ? "" : takesSeparateValue(flag) ? valueFlagDedupCondition(flag) : flagContainsOptCondition(flag)].filter((part) => part !== "").join("; and ");
27343
27586
  const flagCondArg = flagCondition ? `-n '${flagCondition}'` : ``;
27344
27587
  const parts = [`complete -c ${executableName}`];
27345
27588
  if (flagCondArg) parts.push(flagCondArg);
@@ -27358,7 +27601,7 @@ var generateCompletions = (executableName, descriptor, parentPath, lines) => {
27358
27601
  const notDash = `not string match -q -- "-*" (commandline -ct)`;
27359
27602
  const bareBase = condition ? `${condition}; and ${notDash}` : notDash;
27360
27603
  for (const flag of descriptor.flags) {
27361
- const bareCondition = `${bareBase}; and ${flagContainsOptCondition(flag)}`;
27604
+ const bareCondition = flag.repeatable === true ? bareBase : `${bareBase}; and ${flagContainsOptCondition(flag)}`;
27362
27605
  const negation = negatedName$1(flag);
27363
27606
  const parts = [`complete -c ${executableName}`];
27364
27607
  parts.push(`-n '${bareCondition}'`);
@@ -27404,7 +27647,7 @@ var generate$3 = (executableName, descriptor) => {
27404
27647
  lines.push(`###-end-${executableName}-completions-###`);
27405
27648
  return lines.join("\n");
27406
27649
  };
27407
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/completions/powershell.js
27650
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/completions/powershell.js
27408
27651
  /**
27409
27652
  * Encode non-ASCII and control characters as `[char]` code units. Windows
27410
27653
  * PowerShell 5.1 can misread BOM-less UTF-8 as ANSI, turning some bytes into
@@ -27433,7 +27676,7 @@ var flagForms = (flag) => [`--${flag.name}`, ...flag.aliases.map((alias) => alia
27433
27676
  var valueFields = (type) => `values = ${psArray(type._tag === "Choice" ? type.values : [])}; pathType = ${type._tag === "Path" ? quotePs(type.pathType) : "$null"}`;
27434
27677
  var flagEntry = (flag) => {
27435
27678
  const negation = negatedName$1(flag);
27436
- return `@{ name = ${quotePs(flag.name)}; forms = ${psArray(flagForms(flag))}; takesValue = $${flag.type._tag !== "Boolean"}; ` + (negation === void 0 ? "" : `negation = ${quotePs(`--${negation}`)}; `) + (flag.optionalValue === true ? `optionalValue = $true; ` : "") + `${valueFields(flag.type)}; description = ${psOptional(flag.description)} }`;
27679
+ return `@{ name = ${quotePs(flag.name)}; forms = ${psArray(flagForms(flag))}; takesValue = $${flag.type._tag !== "Boolean"}; ` + (negation === void 0 ? "" : `negation = ${quotePs(`--${negation}`)}; `) + (flag.optionalValue === true ? `optionalValue = $true; ` : "") + (flag.repeatable === true ? `repeatable = $true; ` : "") + `${valueFields(flag.type)}; description = ${psOptional(flag.description)} }`;
27437
27680
  };
27438
27681
  var argumentEntry = (argument) => `@{ name = ${quotePs(argument.name)}; variadic = $${argument.variadic}; ${valueFields(argument.type)}; description = ${psOptional(argument.description)} }`;
27439
27682
  var pushList = (lines, field, entries) => {
@@ -27510,7 +27753,7 @@ var completer = (dataName) => String.raw` param($wordToComplete, $commandAst, $
27510
27753
  $addFlags = {
27511
27754
  param([string]$typed)
27512
27755
  foreach ($flag in $context.flags) {
27513
- if ($used.ContainsKey($flag.name)) { continue }
27756
+ if (-not $flag.repeatable -and $used.ContainsKey($flag.name)) { continue }
27514
27757
  foreach ($form in $flag.forms) {
27515
27758
  & $add $form 'ParameterName' $flag.description $typed ''
27516
27759
  }
@@ -27680,7 +27923,7 @@ var generate$2 = (executableName, descriptor) => {
27680
27923
  lines.push(`###-end-${executableName}-completions-###`);
27681
27924
  return lines.join("\n");
27682
27925
  };
27683
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/completions/zsh.js
27926
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/completions/zsh.js
27684
27927
  var escapeZsh = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:");
27685
27928
  var escapeZshExplanation = (s) => escapeZsh(s).replace(/]/g, "\\]");
27686
27929
  /** Escape choices for the second parse of a Zsh `_arguments` action. */
@@ -27724,7 +27967,7 @@ var flagSpecs = (flag) => {
27724
27967
  const optional = flag.optionalValue === true && flag.type._tag !== "Boolean";
27725
27968
  const valueSuffix = optional ? "=-" : "";
27726
27969
  const action = optional ? `:${valueAction(flag.type)}` : valueAction(flag.type);
27727
- const excl = `(${allForms(flag).join(" ")})`;
27970
+ const excl = flag.repeatable === true ? "*" : `(${allForms(flag).join(" ")})`;
27728
27971
  specs.push(`'${excl}--${flag.name}${valueSuffix}${desc}${action}'`);
27729
27972
  for (const alias of flag.aliases) {
27730
27973
  const prefix = alias.length === 1 ? "-" : "--";
@@ -27754,7 +27997,7 @@ var generateFunction = (descriptor, parentPath, lines) => {
27754
27997
  lines.push(` commands=(`);
27755
27998
  for (const sub of descriptor.subcommands) {
27756
27999
  const desc = sub.description ? escapeZsh(sub.description) : "";
27757
- lines.push(` '${sub.name}:${desc}'`);
28000
+ lines.push(` '${escapeZsh(sub.name)}:${desc}'`);
27758
28001
  }
27759
28002
  lines.push(` )`);
27760
28003
  lines.push(``);
@@ -27831,7 +28074,7 @@ var generate$1 = (executableName, descriptor) => {
27831
28074
  lines.push(`###-end-${executableName}-completions-###`);
27832
28075
  return lines.join("\n");
27833
28076
  };
27834
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/Completions.js
28077
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/Completions.js
27835
28078
  /**
27836
28079
  * Converts a command tree into a `CommandDescriptor` for completion script
27837
28080
  * generation.
@@ -27908,7 +28151,7 @@ var generate = (executableName, shell, descriptor) => {
27908
28151
  case "powershell": return generate$2(executableName, descriptor);
27909
28152
  }
27910
28153
  };
27911
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/Flag.js
28154
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/Flag.js
27912
28155
  init_Function();
27913
28156
  /**
27914
28157
  * Creates a string flag that accepts text input.
@@ -28074,6 +28317,27 @@ var withMetavar = /*#__PURE__*/ dual(2, (self, metavar) => withMetavar$1(self, m
28074
28317
  /**
28075
28318
  * Makes a flag optional, returning an Option type that can be None if not provided.
28076
28319
  *
28320
+ * **When to use**
28321
+ *
28322
+ * Use when the handler or a `Command.validate` rule needs to know whether the
28323
+ * flag was passed at all, for example to reject `--force=false` together with
28324
+ * another flag while ignoring an omitted `--force`.
28325
+ *
28326
+ * **Details**
28327
+ *
28328
+ * An omitted flag gives `Option.none()`. A flag passed with any value gives
28329
+ * `Option.some`, including `--flag=false`, `--flag false` and `--no-flag`
28330
+ * for boolean flags. Apply the default afterwards with `Option.getOrElse`.
28331
+ * Help output is the same as with `withDefault`.
28332
+ *
28333
+ * **Gotchas**
28334
+ *
28335
+ * Presence is lost once a default or fallback has filled the value in.
28336
+ * `withDefault(...)` followed by `optional` always gives `Option.some`, and
28337
+ * so does `withFallbackConfig(...)` followed by `optional` when the config
28338
+ * has a value. `optional` followed by `withFallbackConfig(...)` never reads
28339
+ * the config, because `optional` already handled the missing flag.
28340
+ *
28077
28341
  * **Example** (Making flags optional)
28078
28342
  *
28079
28343
  * ```ts import.meta.vitest
@@ -28142,7 +28406,7 @@ var optional$6 = (param) => optional$7(param);
28142
28406
  * @since 4.0.0
28143
28407
  */
28144
28408
  var withDefault = withDefault$1;
28145
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/help.js
28409
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/help.js
28146
28410
  init_Effect();
28147
28411
  var dedupeGlobalFlags = (flags) => {
28148
28412
  const seen = /* @__PURE__ */ new Set();
@@ -28251,7 +28515,7 @@ var getHelpForCommandPath = (command, commandPath, builtIns) => gen(function* ()
28251
28515
  commandPath
28252
28516
  };
28253
28517
  });
28254
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/GlobalFlag.js
28518
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/GlobalFlag.js
28255
28519
  /**
28256
28520
  * Global flags for Effect CLI command trees. Global flags are parsed outside a
28257
28521
  * single command's local flags and can apply to a command and its descendants.
@@ -28444,7 +28708,7 @@ var BuiltIns = [
28444
28708
  Completions,
28445
28709
  LogLevel
28446
28710
  ];
28447
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/CliConfig.js
28711
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/CliConfig.js
28448
28712
  init_Context();
28449
28713
  /**
28450
28714
  * Context reference for configuration shared by CLI parsing, help generation,
@@ -28468,7 +28732,7 @@ var CliConfig = class extends (/*#__PURE__*/ Reference("effect/cli/CliConfig", {
28468
28732
  * @since 4.0.0
28469
28733
  */
28470
28734
  var defaults = { builtIns: BuiltIns };
28471
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/formatter.js
28735
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/formatter.js
28472
28736
  init_Context();
28473
28737
  init_Effect();
28474
28738
  /**
@@ -28479,7 +28743,7 @@ init_Effect();
28479
28743
  * @internal
28480
28744
  */
28481
28745
  var resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$4(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$5(context, TerminalCapabilities).canColor })));
28482
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/lexer.js
28746
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/lexer.js
28483
28747
  /**
28484
28748
  * @internal
28485
28749
  */
@@ -28494,6 +28758,18 @@ function lex(argv) {
28494
28758
  trailingOperands: argv.slice(endIndex + 1)
28495
28759
  };
28496
28760
  }
28761
+ /**
28762
+ * Formats a token as an argument. Short option clusters become one argument
28763
+ * per flag.
28764
+ *
28765
+ * @internal
28766
+ */
28767
+ var formatToken = (token) => {
28768
+ if (token._tag === "Value") return token.value;
28769
+ if (token._tag === "LongOption") return token.raw;
28770
+ const flag = negativeNumberRegex.test(token.raw) ? `--${token.flag}` : token.raw;
28771
+ return token.value === void 0 ? flag : `${flag}=${token.value}`;
28772
+ };
28497
28773
  var negativeNumberRegex = /^-(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/;
28498
28774
  var lexTokens = (args) => {
28499
28775
  const tokens = [];
@@ -28551,7 +28827,7 @@ var lexTokens = (args) => {
28551
28827
  });
28552
28828
  return tokens;
28553
28829
  };
28554
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/auto-suggest.js
28830
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/auto-suggest.js
28555
28831
  /**
28556
28832
  * Simple Levenshtein distance implementation (small N, no perf worries)
28557
28833
  */
@@ -28578,7 +28854,7 @@ var suggest = (input, candidates) => {
28578
28854
  const minDistance = distances[0][0];
28579
28855
  return distances.filter(([d]) => d === minDistance).map(([, c]) => c);
28580
28856
  };
28581
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/parser.js
28857
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/parser.js
28582
28858
  init_Effect();
28583
28859
  init_Option();
28584
28860
  /**
@@ -28594,19 +28870,7 @@ var getCommandPath = (parsedInput) => match$5(parsedInput.subcommand, {
28594
28870
  var parseArgs = (lexResult, command, commandPath = []) => gen(function* () {
28595
28871
  const { tokens, trailingOperands: afterEndOfOptions } = lexResult;
28596
28872
  const newCommandPath = [...commandPath, command.name];
28597
- const commandImpl = toImpl(command);
28598
- const flagParams = commandImpl.config.flags.flatMap(extractSingleParams).filter(isFlagParam);
28599
- const flagRegistry = createFlagRegistry(flagParams);
28600
- const inheritedFlagParams = commandImpl.contextConfig.flags.flatMap(extractSingleParams).filter(isFlagParam);
28601
- const inheritedFlagRegistry = createFlagRegistry(inheritedFlagParams);
28602
- const inheritedNames = new Set(inheritedFlagParams.map((param) => param.name));
28603
- const result = scanCommandLevel(tokens, {
28604
- command,
28605
- commandPath: newCommandPath,
28606
- flagRegistry,
28607
- inheritedFlagRegistry,
28608
- localFlagNames: flagParams.filter((param) => !inheritedNames.has(param.name)).map((param) => param.name)
28609
- });
28873
+ const result = scanCommandLevel(tokens, makeCommandContext(command, newCommandPath));
28610
28874
  if (result._tag === "Leaf") return {
28611
28875
  flags: result.flags,
28612
28876
  arguments: [...result.arguments, ...afterEndOfOptions],
@@ -28628,6 +28892,16 @@ var parseArgs = (lexResult, command, commandPath = []) => gen(function* () {
28628
28892
  ...allErrors.length > 0 && { errors: allErrors }
28629
28893
  };
28630
28894
  });
28895
+ /**
28896
+ * Returns the subset of `tokens` left for the selected command once its
28897
+ * ancestors have consumed subcommand names and inherited flags.
28898
+ *
28899
+ * @internal
28900
+ */
28901
+ var getSelectedCommandTokens = (tokens, command) => {
28902
+ const result = scanCommandLevel(tokens, makeCommandContext(command, []));
28903
+ return result._tag === "Leaf" ? tokens : getSelectedCommandTokens(result.childTokens, result.sub);
28904
+ };
28631
28905
  var makeCursor = (tokens) => {
28632
28906
  let i = 0;
28633
28907
  return {
@@ -29075,6 +29349,18 @@ var processValue = (value, cursor, context, state) => {
29075
29349
  }
29076
29350
  state.arguments.push(value);
29077
29351
  };
29352
+ var makeCommandContext = (command, commandPath) => {
29353
+ const flagParams = extractFlagParams(command);
29354
+ const inheritedFlagParams = extractContextFlagParams(command);
29355
+ const inheritedNames = new Set(inheritedFlagParams.map((param) => param.name));
29356
+ return {
29357
+ command,
29358
+ commandPath,
29359
+ flagRegistry: createFlagRegistry(flagParams),
29360
+ inheritedFlagRegistry: createFlagRegistry(inheritedFlagParams),
29361
+ localFlagNames: flagParams.filter((param) => !inheritedNames.has(param.name)).map((param) => param.name)
29362
+ };
29363
+ };
29078
29364
  /**
29079
29365
  * Scans a single command level, processing all tokens.
29080
29366
  *
@@ -29099,7 +29385,7 @@ var scanCommandLevel = (tokens, context) => {
29099
29385
  }
29100
29386
  return toLeafResult(state);
29101
29387
  };
29102
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/wizard.js
29388
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/wizard.js
29103
29389
  init_Effect();
29104
29390
  init_Option();
29105
29391
  init_Redacted();
@@ -29135,6 +29421,7 @@ var promptCommand = /*#__PURE__*/ fnUntraced(function* (command, commandLine, se
29135
29421
  }
29136
29422
  if (config.arguments.length > 0) {
29137
29423
  yield* log(renderSection(sectionName, "ARGUMENTS", colors));
29424
+ if (visibleSubcommands.length === 0) commandLine.push(commandLineArg("--"));
29138
29425
  for (const param of config.arguments) commandLine.push(...yield* promptParam(param));
29139
29426
  if (visibleSubcommands.length > 0) yield* logCurrentCommand(commandLine, colors);
29140
29427
  }
@@ -29272,7 +29559,7 @@ var wrapCommand = (commandLine) => {
29272
29559
  return lines;
29273
29560
  };
29274
29561
  var formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
29275
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/Command.js
29562
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/Command.js
29276
29563
  init_Context();
29277
29564
  init_Effect();
29278
29565
  init_Function();
@@ -29393,6 +29680,12 @@ var make$8 = (name, config, handler) => {
29393
29680
  /**
29394
29681
  * Adds or replaces the handler for a command.
29395
29682
  *
29683
+ * **Details**
29684
+ *
29685
+ * The command keeps its existing error type, so failures from validations
29686
+ * added with `validate` stay in the result type. When this replaces a handler,
29687
+ * the previous handler's errors stay in the type as well.
29688
+ *
29396
29689
  * **Example** (Adding command handlers)
29397
29690
  *
29398
29691
  * ```ts import.meta.vitest
@@ -29855,10 +30148,11 @@ var runWith = (command, config) => {
29855
30148
  trailingOperands
29856
30149
  }, command);
29857
30150
  const commandPath = [command.name, ...getCommandPath(parsedArgs)];
29858
- const toShowHelp = mapError$2((error) => error._tag === "ShowHelp" ? error : new ShowHelp({
30151
+ const toShowHelpError = (error) => error._tag === "ShowHelp" ? error : new ShowHelp({
29859
30152
  commandPath,
29860
30153
  errors: [error]
29861
- }));
30154
+ });
30155
+ const toShowHelp = mapError$2(toShowHelpError);
29862
30156
  const handlerCtx = {
29863
30157
  builtIns,
29864
30158
  command,
@@ -29889,7 +30183,8 @@ var runWith = (command, config) => {
29889
30183
  const { colors } = yield* Theme;
29890
30184
  return yield* gen(function* () {
29891
30185
  yield* log(renderIntroduction(command.name, config.version, command.description, colors));
29892
- const prefix = [command.name, ...args.filter((arg) => arg !== "--wizard" && !arg.startsWith("--wizard="))];
30186
+ const selectedTokens = new Set(getSelectedCommandTokens(remainder, command));
30187
+ const prefix = [command.name, ...tokens.filter((token) => !selectedTokens.has(token) && !(token._tag === "LongOption" && token.name === "wizard")).map(formatToken)];
29893
30188
  const wizardResult = yield* run$1(command, {
29894
30189
  commandPath,
29895
30190
  prefix
@@ -29916,7 +30211,7 @@ var runWith = (command, config) => {
29916
30211
  commandPath,
29917
30212
  errors: parsedArgs.errors
29918
30213
  });
29919
- const input = yield* commandImpl.parse(parsedArgs).pipe(toShowHelp);
30214
+ const input = yield* commandImpl.parse(parsedArgs).pipe(mapError$2((error) => isCliError(error) ? toShowHelpError(error) : error));
29920
30215
  let program = commandImpl.handle(input, [command.name]);
29921
30216
  const logLevel = activeFlags.includes(LogLevel) ? (yield* LogLevel.flag.parse(emptyArgs).pipe(toShowHelp))[1] : none();
29922
30217
  program = provideService(program, LogLevel, logLevel);
@@ -29941,7 +30236,7 @@ var runWith = (command, config) => {
29941
30236
  };
29942
30237
  var package_default = {
29943
30238
  name: "repo-dive",
29944
- version: "0.20.0",
30239
+ version: "0.20.1",
29945
30240
  description: "Dive into a git repo's history: per-commit snapshots, an indexed metrics catalog and an interactive dashboard",
29946
30241
  keywords: [
29947
30242
  "git",
@@ -30010,20 +30305,20 @@ var package_default = {
30010
30305
  "lint-staged": { "**": ["prettier --ignore-unknown --write"] },
30011
30306
  prettier: "@kachkaev/prettier-config",
30012
30307
  devDependencies: {
30013
- "@babel/core": "8.1.0",
30308
+ "@babel/core": "8.1.2",
30014
30309
  "@base-ui/react": "1.9.0",
30015
30310
  "@changesets/changelog-github": "1.0.1",
30016
30311
  "@changesets/cli": "3.0.3",
30017
30312
  "@changesets/config": "4.0.1",
30018
- "@effect/platform-node": "4.1.2",
30019
- "@effect/vitest": "4.1.2",
30313
+ "@effect/platform-node": "4.1.4",
30314
+ "@effect/vitest": "4.1.4",
30020
30315
  "@kachkaev/eslint-config-base": "2.0.0",
30021
30316
  "@kachkaev/markdownlint-config": "1.0.1",
30022
30317
  "@kachkaev/prettier-config": "2.2.1",
30023
- "@rolldown/plugin-babel": "0.3.0",
30318
+ "@rolldown/plugin-babel": "0.3.1",
30024
30319
  "@tailwindcss/vite": "4.3.5",
30025
- "@tsconfig/node-ts": "23.6.4",
30026
- "@tsconfig/strictest": "2.0.8",
30320
+ "@tsconfig/node-ts": "23.6.5",
30321
+ "@tsconfig/strictest": "2.0.9",
30027
30322
  "@types/babel__core": "7.20.5",
30028
30323
  "@types/node": "26.6.5",
30029
30324
  "@types/picomatch": "4.0.3",
@@ -30036,15 +30331,15 @@ var package_default = {
30036
30331
  "@visx/group": "4.0.0",
30037
30332
  "@visx/scale": "4.0.0",
30038
30333
  "@visx/shape": "4.0.0",
30039
- "@vitejs/plugin-react": "6.2.1",
30334
+ "@vitejs/plugin-react": "6.3.0",
30040
30335
  "babel-plugin-react-compiler": "1.0.0",
30041
30336
  "class-variance-authority": "0.7.1",
30042
- "cspell": "10.4.1",
30043
- "effect": "4.1.2",
30044
- "eslint": "10.14.0",
30337
+ "cspell": "10.5.1",
30338
+ "effect": "4.1.4",
30339
+ "eslint": "10.15.0",
30045
30340
  "eslint-plugin-react-hooks": "7.1.1",
30046
30341
  "husky": "9.1.7",
30047
- "knip": "6.44.2",
30342
+ "knip": "6.45.1",
30048
30343
  "lint-staged": "17.6.0",
30049
30344
  "lucide-react": "1.70.0",
30050
30345
  "markdownlint-cli": "0.50.0",
@@ -30056,7 +30351,7 @@ var package_default = {
30056
30351
  "tailwind-merge": "3.7.0",
30057
30352
  "tailwindcss": "4.3.5",
30058
30353
  "typescript": "npm:@typescript/typescript6@6.0.2",
30059
- "vite": "8.3.6",
30354
+ "vite": "8.3.8",
30060
30355
  "vitest": "5.1.0",
30061
30356
  "yaml": "2.9.1"
30062
30357
  },
@@ -30064,7 +30359,7 @@ var package_default = {
30064
30359
  engines: { "node": ">=22.15.0" },
30065
30360
  devEngines: { "runtime": {
30066
30361
  "name": "node",
30067
- "version": "22.23.4",
30362
+ "version": "22.23.5",
30068
30363
  "onFail": "download"
30069
30364
  } },
30070
30365
  publishConfig: {
@@ -42355,7 +42650,7 @@ var runIndex = fn("runIndex")(function* ({ repoPath }) {
42355
42650
  });
42356
42651
  // src/cli/index-command.ts
42357
42652
  var indexCommand = make$8("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 })));
42358
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/AiError.js
42653
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/AiError.js
42359
42654
  init_Duration();
42360
42655
  init_Effect();
42361
42656
  init_Predicate();
@@ -43745,7 +44040,7 @@ var isAiErrorReason = (u) => hasProperty(u, ReasonTypeId);
43745
44040
  * @since 4.0.0
43746
44041
  */
43747
44042
  var make$7 = (params) => new AiError(params);
43748
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/Tool.js
44043
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/Tool.js
43749
44044
  init_Context();
43750
44045
  init_Function();
43751
44046
  init_Pipeable();
@@ -43804,9 +44099,26 @@ var DynamicTypeId = "~effect/ai/Tool/Dynamic";
43804
44099
  * @since 4.0.0
43805
44100
  */
43806
44101
  var isDynamic = (u) => hasProperty(u, DynamicTypeId);
44102
+ /**
44103
+ * Returns whether calls to a tool are executed by the application that sent
44104
+ * the request rather than by a handler.
44105
+ *
44106
+ * **Details**
44107
+ *
44108
+ * Narrows the tool to the same type with execution mode `"client"`, so it and
44109
+ * the tools its combinators return need no handler.
44110
+ *
44111
+ * @stability unstable
44112
+ * @category guards
44113
+ * @since 4.1.0
44114
+ */
44115
+ var isClientExecuted = (tool) => tool.execution === "client";
43807
44116
  var clone = (self, overrides) => Object.assign(Object.create(Object.getPrototypeOf(self)), self, overrides);
43808
44117
  var Proto$1 = {
43809
- [TypeId$2]: { _Requirements: identity },
44118
+ [TypeId$2]: {
44119
+ _Config: identity,
44120
+ _Requirements: identity
44121
+ },
43810
44122
  pipe() {
43811
44123
  return pipeArguments(this, arguments);
43812
44124
  },
@@ -43887,7 +44199,8 @@ var make$6 = (name, options) => {
43887
44199
  failureMode: options?.failureMode ?? "error",
43888
44200
  annotations: empty$11(),
43889
44201
  needsApproval: options?.needsApproval,
43890
- toModelOutput: options?.toModelOutput
44202
+ toModelOutput: options?.toModelOutput,
44203
+ execution: options?.execution
43891
44204
  });
43892
44205
  };
43893
44206
  /**
@@ -44150,7 +44463,7 @@ var failureResultSchema = (tool) => Union([
44150
44463
  * @since 4.0.0
44151
44464
  */
44152
44465
  var EmptyParams = /*#__PURE__*/ Record(String$6, Never);
44153
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/structured-output.js
44466
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/structured-output.js
44154
44467
  init_JsonSchema();
44155
44468
  /**
44156
44469
  * @internal
@@ -44178,11 +44491,12 @@ function resolveTopLevelReference(document) {
44178
44491
  schema
44179
44492
  };
44180
44493
  }
44181
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/Toolkit.js
44494
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/Toolkit.js
44182
44495
  init_Cause();
44183
44496
  init_Context();
44184
44497
  init_Effect();
44185
44498
  init_Effectable();
44499
+ init_Exit();
44186
44500
  init_Fiber();
44187
44501
  init_Function();
44188
44502
  init_record();
@@ -44284,6 +44598,47 @@ var FailureOrigin = /*#__PURE__*/ Reference("effect/ai/Toolkit/FailureOrigin", {
44284
44598
  * @since 4.1.0
44285
44599
  */
44286
44600
  var PreliminaryBuffer = /*#__PURE__*/ Reference("effect/ai/Toolkit/PreliminaryBuffer", { defaultValue: () => "unbounded" });
44601
+ /**
44602
+ * Controls whether tool call arguments are recorded on the current span.
44603
+ *
44604
+ * **Details**
44605
+ *
44606
+ * Defaults to `false`: `Toolkit.handle` records only `gen_ai.tool.name` and,
44607
+ * when a call id is given, `gen_ai.tool.call.id`. Provide `true` to also record
44608
+ * the arguments as JSON in `gen_ai.tool.call.arguments`. `McpServer` reads the
44609
+ * same setting for `tools/call` requests.
44610
+ *
44611
+ * **Gotchas**
44612
+ *
44613
+ * Arguments can contain user data. Only enable this where your traces may hold
44614
+ * it.
44615
+ *
44616
+ * **Example** (Recording tool arguments)
44617
+ *
44618
+ * ```ts import.meta.vitest
44619
+ * import { Layer } from "effect"
44620
+ * import { Toolkit } from "effect/ai"
44621
+ *
44622
+ * export const RecordToolArgumentsLive = Layer.succeed(Toolkit.RecordToolArguments, true)
44623
+ * ```
44624
+ *
44625
+ * @stability unstable
44626
+ * @category services
44627
+ * @since 4.1.3
44628
+ */
44629
+ var RecordToolArguments = /*#__PURE__*/ Reference("effect/ai/Toolkit/RecordToolArguments", { defaultValue: () => false });
44630
+ /**
44631
+ * Formats tool arguments for the `gen_ai.tool.call.arguments` span attribute.
44632
+ *
44633
+ * @internal
44634
+ */
44635
+ var stringifyToolArguments = (params) => {
44636
+ try {
44637
+ return JSON.stringify(params) ?? "null";
44638
+ } catch {
44639
+ return String(params);
44640
+ }
44641
+ };
44287
44642
  var failureCause = (error, origin) => annotate$2(fail$4(error), make$53(FailureOrigin, origin));
44288
44643
  var failureOrigin = (error) => isSchemaError(error) ? "result" : "handler";
44289
44644
  var Proto = {
@@ -44297,9 +44652,9 @@ var Proto = {
44297
44652
  let schemas = schemasCache.get(tool);
44298
44653
  if (isUndefined(schemas)) {
44299
44654
  const handler = services.mapUnsafe.get(tool.id);
44300
- const decodeParameters = isSchema(tool.parametersSchema) ? decodeUnknownEffect(tool.parametersSchema) : (u) => succeed$4(u);
44301
- const encodeSuccess = encodeUnknownEffect(tool.successSchema);
44302
- const encodeFailure = encodeUnknownEffect(failureResultSchema(tool));
44655
+ const decodeParameters = isSchema(tool.parametersSchema) ? decodeUnknownEffect(toCodecJson(tool.parametersSchema)) : (u) => succeed$4(u);
44656
+ const encodeSuccess = encodeUnknownEffect(toCodecJson(tool.successSchema));
44657
+ const encodeFailure = encodeUnknownEffect(toCodecJson(failureResultSchema(tool)));
44303
44658
  const encodeResult = (u, isFailure) => isFailure ? encodeFailure(u) : encodeSuccess(u);
44304
44659
  schemas = {
44305
44660
  context: handler.context,
@@ -44315,10 +44670,9 @@ var Proto = {
44315
44670
  tools,
44316
44671
  handle: fnUntraced(function* (name, params, toolCallId, options) {
44317
44672
  const tool = Object.hasOwn(tools, name) ? tools[name] : void 0;
44318
- yield* annotateCurrentSpan({
44319
- tool: name,
44320
- parameters: params
44321
- });
44673
+ yield* annotateCurrentSpan("gen_ai.tool.name", name);
44674
+ if (toolCallId !== void 0) yield* annotateCurrentSpan("gen_ai.tool.call.id", toolCallId);
44675
+ if (yield* RecordToolArguments) yield* annotateCurrentSpan("gen_ai.tool.call.arguments", stringifyToolArguments(params));
44322
44676
  if (isUndefined(tool)) return yield* make$7({
44323
44677
  module: "Toolkit",
44324
44678
  method: `${name}.handle`,
@@ -44327,6 +44681,7 @@ var Proto = {
44327
44681
  availableTools: Object.keys(tools)
44328
44682
  })
44329
44683
  });
44684
+ if (isClientExecuted(tool)) return yield* die(/* @__PURE__ */ new Error(`Tool "${name}" is executed by the client and has no handler`));
44330
44685
  const schemas = getSchemas(tool);
44331
44686
  const encodeResult = (result, isFailure) => schemas.encodeResult(result, isFailure).pipe(mapError$2((cause) => make$7({
44332
44687
  module: "Toolkit",
@@ -44395,7 +44750,7 @@ var Proto = {
44395
44750
  isFailure: true,
44396
44751
  failureOrigin: failureOrigin(error),
44397
44752
  preliminary: false
44398
- })), mapEffect$1(fnUntraced(function* (output) {
44753
+ })), mapEffect(fnUntraced(function* (output) {
44399
44754
  const encodedResult = yield* encodeResult(output.result, output.isFailure);
44400
44755
  if (output.isFailure || output.preliminary || tool.toModelOutput === void 0) return {
44401
44756
  ...output,
@@ -44406,7 +44761,10 @@ var Proto = {
44406
44761
  encodedResult,
44407
44762
  modelOutput: tool.toModelOutput(output.result)
44408
44763
  };
44409
- })), ensuring(interrupt(fiber)));
44764
+ })), ensuring(flatMap$1(andThen(interrupt(fiber), await_(fiber)), (exit) => {
44765
+ const dies = isFailure(exit) ? exit.cause.reasons.filter(isDieReason) : [];
44766
+ return dies.length > 0 ? failCause$3(fromReasons(dies)) : void_$1;
44767
+ })));
44410
44768
  })
44411
44769
  };
44412
44770
  })
@@ -44488,7 +44846,7 @@ var resolveInput = (...tools) => {
44488
44846
  * @since 4.0.0
44489
44847
  */
44490
44848
  var make$5 = (...tools) => makeProto(resolveInput(...tools));
44491
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/RpcMiddleware.js
44849
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/rpc/RpcMiddleware.js
44492
44850
  init_Context();
44493
44851
  init_stackTraceLimit();
44494
44852
  init_Schema();
@@ -44529,7 +44887,7 @@ var Service = () => (id, options) => {
44529
44887
  ServiceClass_.requiredForClient = options?.requiredForClient ?? false;
44530
44888
  return ServiceClass;
44531
44889
  };
44532
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/McpSchema.js
44890
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/McpSchema.js
44533
44891
  init_Context();
44534
44892
  init_Data();
44535
44893
  init_Effect();
@@ -46502,7 +46860,7 @@ var ServerNotificationRpcs$3 = class extends (/*#__PURE__*/ make$11(CancelledNot
46502
46860
  * @since 4.0.0
46503
46861
  */
46504
46862
  var EnabledWhen = class extends (/*#__PURE__*/ Service$1()("effect/ai/McpSchema/EnabledWhen")) {};
46505
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpCore.js
46863
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpCore.js
46506
46864
  init_Array();
46507
46865
  init_Cause();
46508
46866
  init_Data();
@@ -46595,15 +46953,11 @@ var make$4 = /*#__PURE__*/ sync(() => {
46595
46953
  registrations.set(registration.descriptor.name, registration);
46596
46954
  }),
46597
46955
  list: (invocation) => filterList(registrations.values(), invocation),
46598
- find: (name, profile) => {
46599
- const registration = registrations.get(name);
46600
- return registration !== void 0 && registration.isVisible(profile) ? registration.descriptor : void 0;
46601
- },
46602
- call: (call, invocation) => suspend$2(() => {
46956
+ call: (call, invocation, beforeHandle) => suspend$2(() => {
46603
46957
  const registration = registrations.get(call.name);
46604
46958
  if (registration === void 0) return new ToolNotFound({ name: call.name });
46605
46959
  if (!registration.isVisible(invocation.protocol)) return new ToolNotFound({ name: call.name });
46606
- return registration.handle(call, invocation);
46960
+ return registration.handle(call, invocation, beforeHandle === void 0 ? void_$1 : suspend$2(() => beforeHandle(registration.descriptor)));
46607
46961
  })
46608
46962
  },
46609
46963
  resources: {
@@ -46700,7 +47054,7 @@ var make$4 = /*#__PURE__*/ sync(() => {
46700
47054
  }))
46701
47055
  };
46702
47056
  });
46703
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpProtocol.js
47057
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpProtocol.js
46704
47058
  init_Data();
46705
47059
  init_Effect();
46706
47060
  init_Base64();
@@ -46795,7 +47149,7 @@ var invocationFromClient = (request) => ({
46795
47149
  *
46796
47150
  * @internal
46797
47151
  */
46798
- var listForClient = (list) => McpServerClient.use((request) => list(invocationFromClient(request)).pipe(mapError$2(ProtocolError.fromFeature)));
47152
+ var listForClient = (list, cursor) => andThen(rejectCursor(cursor), McpServerClient.use((request) => list(invocationFromClient(request)).pipe(mapError$2(ProtocolError.fromFeature))));
46799
47153
  /**
46800
47154
  * @internal
46801
47155
  */
@@ -46869,6 +47223,16 @@ var decodeProtocolErrorFields = /*#__PURE__*/ decodeUnknownResult(/* @__PURE__ *
46869
47223
  data: /*#__PURE__*/ optionalKey(Unknown)
46870
47224
  }));
46871
47225
  var isReverseOperationUnsupported = (cause) => isTagged(cause, "McpReverseOperationUnsupported");
47226
+ var unknownCursor = /*#__PURE__*/ new ProtocolError({
47227
+ code: INVALID_PARAMS_ERROR_CODE,
47228
+ message: "Unknown cursor"
47229
+ });
47230
+ /**
47231
+ * Rejects supplied cursors because lists return a complete page without issuing cursors.
47232
+ *
47233
+ * @internal
47234
+ */
47235
+ var rejectCursor = (cursor) => cursor === void 0 ? void_$1 : fail$3(unknownCursor);
46872
47236
  /**
46873
47237
  * @internal
46874
47238
  */
@@ -46976,7 +47340,7 @@ var make$3 = (options) => {
46976
47340
  makeReverseClient
46977
47341
  };
46978
47342
  };
46979
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpSchema/v2024_11_05.js
47343
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpSchema/v2024_11_05.js
46980
47344
  init_Option();
46981
47345
  init_Schema();
46982
47346
  init_SchemaGetter();
@@ -47335,15 +47699,13 @@ var ToolListChangedNotification = class extends (/*#__PURE__*/ make$15("notifica
47335
47699
  * @internal
47336
47700
  */
47337
47701
  var PromptListChangedNotification = class extends (/*#__PURE__*/ make$15("notifications/prompts/list_changed", { payload: /*#__PURE__*/ UndefinedOr(NotificationMeta) })) {};
47338
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpSchema/v2025_03_26.js
47702
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpSchema/v2025_03_26.js
47339
47703
  /**
47340
47704
  * Exact MCP v2025-03-26 wire schemas.
47341
47705
  *
47342
47706
  * This revision is expressed as a frozen delta from the exact 2024-11-05
47343
47707
  * schemas. Transport envelopes (including JSON-RPC batches) are owned by the
47344
47708
  * transport codec rather than Effect RPC payload schemas.
47345
- *
47346
- * @internal
47347
47709
  */
47348
47710
  init_Schema();
47349
47711
  var optional$3 = optional$4;
@@ -47393,14 +47755,12 @@ var ProgressNotification$1 = class extends (/*#__PURE__*/ make$15("notifications
47393
47755
  total: /*#__PURE__*/ optional$3(Finite),
47394
47756
  message: /*#__PURE__*/ optional$3(String$6)
47395
47757
  } })) {};
47396
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpSchema/v2025_06_18.js
47758
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpSchema/v2025_06_18.js
47397
47759
  /**
47398
47760
  * Exact MCP v2025-06-18 wire schemas.
47399
47761
  *
47400
47762
  * This module is independent of the public compatibility-oriented McpSchema
47401
47763
  * surface and is frozen as a dated delta from v2025-03-26.
47402
- *
47403
- * @internal
47404
47764
  */
47405
47765
  init_Schema();
47406
47766
  /**
@@ -47863,14 +48223,12 @@ var ServerRequestRpcs$1 = class extends (/*#__PURE__*/ make$11(Ping, CreateMessa
47863
48223
  * @internal
47864
48224
  */
47865
48225
  var ServerNotificationRpcs$1 = class extends (/*#__PURE__*/ make$11(CancelledNotification$1, ProgressNotification$1, LoggingMessageNotification$1, ResourceUpdatedNotification$1, ResourceListChangedNotification, ToolListChangedNotification, PromptListChangedNotification)) {};
47866
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpSchema/v2025_11_25.js
48226
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpSchema/v2025_11_25.js
47867
48227
  /**
47868
48228
  * Supported non-Task MCP v2025-11-25 wire schemas.
47869
48229
  *
47870
48230
  * This module is a dated delta from v2025-06-18. Experimental Tasks are not
47871
48231
  * part of the supported vocabulary for this adapter.
47872
- *
47873
- * @internal
47874
48232
  */
47875
48233
  init_Schema();
47876
48234
  var optional$1 = optional$4;
@@ -48020,11 +48378,9 @@ var Root$1 = /*#__PURE__*/ Struct({
48020
48378
  ({ ...GetPromptResult$2.fields });
48021
48379
  ({ ...PaginatedResult$1.fields });
48022
48380
  ({ ...RequestMeta.fields });
48023
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpSchema/v2026_07_28.js
48381
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpSchema/v2026_07_28.js
48024
48382
  /**
48025
48383
  * MCP v2026-07-28 wire schemas.
48026
- *
48027
- * @internal
48028
48384
  */
48029
48385
  init_Schema();
48030
48386
  var optional = optional$4;
@@ -48245,7 +48601,7 @@ var PaginatedResult = {
48245
48601
  ({ ...NotificationParams.fields });
48246
48602
  ({ ...NotificationParams.fields });
48247
48603
  ({ ...NotificationParams.fields });
48248
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpSkills.js
48604
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpSkills.js
48249
48605
  init_Effect();
48250
48606
  init_Schema();
48251
48607
  /**
@@ -48330,10 +48686,6 @@ var methodNotFound = (method) => new ProtocolError({
48330
48686
  code: METHOD_NOT_FOUND_ERROR_CODE,
48331
48687
  message: `Method not found: ${method}`
48332
48688
  });
48333
- var unknownCursor = /*#__PURE__*/ new ProtocolError({
48334
- code: INVALID_PARAMS_ERROR_CODE,
48335
- message: "Unknown cursor"
48336
- });
48337
48689
  /**
48338
48690
  * Fails with `Method not found` while no skill is registered, as a server
48339
48691
  * that does not declare the extension.
@@ -48342,10 +48694,6 @@ var unknownCursor = /*#__PURE__*/ new ProtocolError({
48342
48694
  */
48343
48695
  var requireSkills = (core, method) => flatMap$1(core.registrationPresence, (presence) => presence.skills ? void_$1 : fail$3(methodNotFound(method)));
48344
48696
  /**
48345
- * @internal
48346
- */
48347
- var rejectCursor = (cursor) => cursor === void 0 ? void_$1 : fail$3(unknownCursor);
48348
- /**
48349
48697
  * Handlers for {@link LegacyRpcs}, for the sessionful adapters.
48350
48698
  *
48351
48699
  * @internal
@@ -48353,8 +48701,7 @@ var rejectCursor = (cursor) => cursor === void 0 ? void_$1 : fail$3(unknownCurso
48353
48701
  var legacyHandlers = (core) => ({
48354
48702
  "skills/list": fnUntraced(function* (request) {
48355
48703
  yield* requireSkills(core, "skills/list");
48356
- yield* rejectCursor(request?.cursor);
48357
- return { skills: yield* listForClient(core.skills.list) };
48704
+ return { skills: yield* listForClient(core.skills.list, request?.cursor) };
48358
48705
  }),
48359
48706
  "skills/get": fnUntraced(function* (request) {
48360
48707
  yield* requireSkills(core, "skills/get");
@@ -48368,7 +48715,7 @@ var legacyHandlers = (core) => ({
48368
48715
  return { resources: yield* core.skills.readDirectory(request.uri, invocationFromClient(client)).pipe(mapError$2(ProtocolError.fromFeature)) };
48369
48716
  })
48370
48717
  });
48371
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpProtocolRegistry.js
48718
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpProtocolRegistry.js
48372
48719
  init_Cause();
48373
48720
  init_Effect();
48374
48721
  var prefix = (protocol) => `@effect/mcp/${encodeURIComponent(protocol.protocolVersion)}/`;
@@ -48390,6 +48737,10 @@ var make$2 = /*#__PURE__*/ fnUntraced(function* (protocols) {
48390
48737
  clientRpcs,
48391
48738
  select: (offeredVersion) => byVersion.get(offeredVersion) ?? snapshot[0],
48392
48739
  protocolForInternalTag: (tag) => snapshot.find((protocol) => tag.startsWith(prefix(protocol))) ?? snapshot[0],
48740
+ methodForInternalTag: (tag) => {
48741
+ const protocol = snapshot.find((protocol) => tag.startsWith(prefix(protocol)));
48742
+ return protocol === void 0 ? tag : tag.slice(prefix(protocol).length);
48743
+ },
48393
48744
  routeClientRequest: (protocol, request) => ({
48394
48745
  ...request,
48395
48746
  tag: `${prefix(protocol)}${request.tag}`
@@ -48408,7 +48759,7 @@ var make$2 = /*#__PURE__*/ fnUntraced(function* (protocols) {
48408
48759
  })
48409
48760
  };
48410
48761
  });
48411
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpStatefulRuntime.js
48762
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpStatefulRuntime.js
48412
48763
  init_Effect();
48413
48764
  var MCP_SESSION_ID_HEADER$2 = "mcp-session-id";
48414
48765
  var makeSession = (registration) => ({
@@ -48494,7 +48845,7 @@ var make$1 = () => {
48494
48845
  }
48495
48846
  };
48496
48847
  };
48497
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpRuntime.js
48848
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpRuntime.js
48498
48849
  init_Cause();
48499
48850
  init_Context();
48500
48851
  init_SecureRandom();
@@ -48654,6 +49005,7 @@ var make = /*#__PURE__*/ fnUntraced(function* (protocols) {
48654
49005
  clientRpcs: registry.clientRpcs,
48655
49006
  selectProtocol: registry.select,
48656
49007
  protocolForInternalTag: registry.protocolForInternalTag,
49008
+ methodForInternalTag: registry.methodForInternalTag,
48657
49009
  routeClientRequest: registry.routeClientRequest,
48658
49010
  prepareRequest: fnUntraced(function* (clientId, headers, request) {
48659
49011
  const metadata = asRecord(request.payload)?._meta;
@@ -48773,6 +49125,7 @@ var make = /*#__PURE__*/ fnUntraced(function* (protocols) {
48773
49125
  const installationContext = {
48774
49126
  subscribeServerNotifications: options.subscribeServerNotifications,
48775
49127
  getListChangeRevision: options.getListChangeRevision,
49128
+ awaitClientEnd: options.awaitClientEnd,
48776
49129
  ...options.sendNotification === void 0 ? {} : { sendNotification: options.sendNotification },
48777
49130
  ...options.markSubscriptionCancelled === void 0 ? {} : { markSubscriptionCancelled: options.markSubscriptionCancelled },
48778
49131
  ...options.terminateSubscription === void 0 ? {} : { terminateSubscription: options.terminateSubscription },
@@ -48856,7 +49209,7 @@ var make = /*#__PURE__*/ fnUntraced(function* (protocols) {
48856
49209
  * @internal
48857
49210
  */
48858
49211
  var layer = (protocols) => effect(ServerRuntime)(make(protocols));
48859
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/internal/mcpProtocol/v2025_06_18.js
49212
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/internal/mcpProtocol/v2025_06_18.js
48860
49213
  init_Effect();
48861
49214
  init_Base64();
48862
49215
  init_Predicate();
@@ -48928,7 +49281,7 @@ var projectResourceContents = (content) => "text" in content ? {
48928
49281
  };
48929
49282
  var projectStructuredContent = (content) => content === void 0 || isObject(content) ? content : void 0;
48930
49283
  var isObject = (value) => isReadonlyObject(value);
48931
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/McpProtocol.js
49284
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/McpProtocol.js
48932
49285
  /**
48933
49286
  * The MCP 2025-06-18 protocol implementation.
48934
49287
  *
@@ -48974,8 +49327,8 @@ var v2025_06_18 = /* @__PURE__ */ make$3({
48974
49327
  metadata: progress._meta
48975
49328
  }), client.id, headers),
48976
49329
  "notifications/roots/list_changed": (_, { client, headers }) => lifecycle.clientNotification(ClientNotification.RootsChanged(), client.id, headers),
48977
- "resources/list": (_pageRequest) => listForClient(core.resources.list).pipe(map$4((resources) => ListResourcesResult$2.make({ resources }))),
48978
- "resources/templates/list": (_pageRequest) => listForClient(core.resources.listTemplates).pipe(map$4((resourceTemplates) => ListResourceTemplatesResult$2.make({ resourceTemplates }))),
49330
+ "resources/list": (pageRequest) => listForClient(core.resources.list, pageRequest?.cursor).pipe(map$4((resources) => ListResourcesResult$2.make({ resources }))),
49331
+ "resources/templates/list": (pageRequest) => listForClient(core.resources.listTemplates, pageRequest?.cursor).pipe(map$4((resourceTemplates) => ListResourceTemplatesResult$2.make({ resourceTemplates }))),
48979
49332
  "resources/read": fnUntraced(function* ({ uri }) {
48980
49333
  const request = yield* McpServerClient;
48981
49334
  const result = yield* core.resources.read(uri, invocationFromClient(request)).pipe(mapError$2(ProtocolError.fromFeature));
@@ -48986,7 +49339,7 @@ var v2025_06_18 = /* @__PURE__ */ make$3({
48986
49339
  }),
48987
49340
  "resources/subscribe": ({ uri }, { client, headers }) => lifecycle.subscribe(uri, client.id, headers).pipe(as({})),
48988
49341
  "resources/unsubscribe": ({ uri }, { client, headers }) => lifecycle.unsubscribe(uri, client.id, headers).pipe(as({})),
48989
- "prompts/list": (_pageRequest) => listForClient(core.prompts.list).pipe(map$4((prompts) => ListPromptsResult$2.make({ prompts }))),
49342
+ "prompts/list": (pageRequest) => listForClient(core.prompts.list, pageRequest?.cursor).pipe(map$4((prompts) => ListPromptsResult$2.make({ prompts }))),
48990
49343
  "prompts/get": fnUntraced(function* ({ arguments: args, name }) {
48991
49344
  const request = yield* McpServerClient;
48992
49345
  const outcome = yield* core.prompts.get(name, args ?? {}, invocationFromClient(request)).pipe(mapError$2(ProtocolError.fromFeature));
@@ -49029,8 +49382,8 @@ var v2025_06_18 = /* @__PURE__ */ make$3({
49029
49382
  _meta: result.metadata
49030
49383
  });
49031
49384
  }),
49032
- "tools/list": fnUntraced(function* () {
49033
- const tools = yield* listForClient(core.tools.list);
49385
+ "tools/list": fnUntraced(function* (pageRequest) {
49386
+ const tools = yield* listForClient(core.tools.list, pageRequest?.cursor);
49034
49387
  return ListToolsResult$2.make({ tools: tools.map((tool) => Tool$2.make({
49035
49388
  name: tool.name,
49036
49389
  title: tool.title,
@@ -49091,9 +49444,10 @@ var v2025_06_18 = /* @__PURE__ */ make$3({
49091
49444
  metadata: request._meta
49092
49445
  })))
49093
49446
  });
49094
- // node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/ai/McpServer.js
49447
+ // node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/ai/McpServer.js
49095
49448
  init_Array();
49096
49449
  init_Cause();
49450
+ init_Clock();
49097
49451
  init_Context();
49098
49452
  init_Data();
49099
49453
  init_Deferred();
@@ -49102,6 +49456,7 @@ init_Effect();
49102
49456
  init_Exit();
49103
49457
  init_Fiber();
49104
49458
  init_Headers();
49459
+ init_Latch();
49105
49460
  init_Layer();
49106
49461
  init_Option();
49107
49462
  init_Predicate();
@@ -49117,6 +49472,7 @@ init_Stream();
49117
49472
  init_Tracer();
49118
49473
  var internalState = /*#__PURE__*/ new WeakMap();
49119
49474
  var RequestNotificationQueue = /*#__PURE__*/ Reference("effect/ai/McpServer/RequestNotificationQueue", { defaultValue: () => void 0 });
49475
+ var RequestLiveness = /*#__PURE__*/ Reference("effect/ai/McpServer/RequestLiveness", { defaultValue: () => void 0 });
49120
49476
  var isRequestNotification = (notification) => notification._tag === "Progress" || notification._tag === "LoggingMessage";
49121
49477
  var BroadcastServerNotificationRpcs = /*#__PURE__*/ ServerNotificationRpcs$3.omit("notifications/elicitation/complete");
49122
49478
  var isLoggingLevel = /*#__PURE__*/ is$2(LoggingLevel$2);
@@ -49336,6 +49692,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
49336
49692
  const queued = {
49337
49693
  notification,
49338
49694
  delivered,
49695
+ requestLiveness: get$5(fiber.context, RequestLiveness),
49339
49696
  requestContext: getOrUndefined(fiber.context, McpRequestContext),
49340
49697
  requestHeaders: getOrUndefined(fiber.context, HttpServerRequest)?.headers
49341
49698
  };
@@ -49412,7 +49769,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
49412
49769
  }),
49413
49770
  visible: visible("tools/list", options.tool.name),
49414
49771
  isVisible: isEnabled(options.annotations),
49415
- handle: (call, invocation) => invoke(options.handle(call.arguments), invocation, {
49772
+ handle: (call, invocation, beforeHandle) => invoke(andThen(beforeHandle, () => options.handle(call.arguments)), invocation, {
49416
49773
  method: "tools/call",
49417
49774
  target: call.name,
49418
49775
  payload: call
@@ -49585,6 +49942,75 @@ var MCP_INVALID_BATCH_METHOD = "invalid/json-rpc-batch";
49585
49942
  var cancelledResponses = /*#__PURE__*/ new WeakMap();
49586
49943
  var httpPostResponses = /*#__PURE__*/ new WeakMap();
49587
49944
  var requestKey = (requestId) => `${typeof requestId}:${requestId}`;
49945
+ var requestErrorCodes = /*#__PURE__*/ new Set([
49946
+ -32700,
49947
+ -32600,
49948
+ -32601,
49949
+ -32602,
49950
+ -32002
49951
+ ]);
49952
+ var remoteParentSpan = (params) => {
49953
+ const meta = params?._meta;
49954
+ if (!isReadonlyObject(meta) || typeof meta.traceparent !== "string") return;
49955
+ return getOrUndefined$1(w3c(fromInput$1({ traceparent: meta.traceparent })));
49956
+ };
49957
+ var requestSpanOptions = (method, request, options) => {
49958
+ const params = isReadonlyObject(request.payload) ? request.payload : void 0;
49959
+ const attributes = {
49960
+ "mcp.method.name": method,
49961
+ "mcp.protocol.version": options.protocolVersion
49962
+ };
49963
+ if (request.isNotification !== true) attributes["jsonrpc.request.id"] = String(request.id);
49964
+ if (options.sessionId !== void 0) attributes["mcp.session.id"] = options.sessionId;
49965
+ if (options.networkTransport !== void 0) attributes["network.transport"] = options.networkTransport;
49966
+ let target;
49967
+ switch (method) {
49968
+ case "tools/call":
49969
+ attributes["gen_ai.operation.name"] = "execute_tool";
49970
+ if (typeof params?.name === "string") {
49971
+ target = params.name;
49972
+ attributes["gen_ai.tool.name"] = target;
49973
+ }
49974
+ if (options.recordToolArguments && params?.arguments !== void 0) attributes["gen_ai.tool.call.arguments"] = stringifyToolArguments(params.arguments);
49975
+ break;
49976
+ case "prompts/get":
49977
+ if (typeof params?.name === "string") {
49978
+ target = params.name;
49979
+ attributes["gen_ai.prompt.name"] = target;
49980
+ }
49981
+ break;
49982
+ case "resources/read":
49983
+ case "resources/subscribe":
49984
+ case "resources/unsubscribe": if (typeof params?.uri === "string") attributes["mcp.resource.uri"] = params.uri;
49985
+ }
49986
+ return {
49987
+ name: target === void 0 ? method : `${method} ${target}`,
49988
+ kind: "server",
49989
+ attributes,
49990
+ parent: remoteParentSpan(params)
49991
+ };
49992
+ };
49993
+ var CurrentRequestSpan = /*#__PURE__*/ Reference("effect/ai/McpServer/CurrentRequestSpan", { defaultValue: () => void 0 });
49994
+ var errorResponseSpans = /*#__PURE__*/ new WeakSet();
49995
+ var recordErrorResponse = (span, code) => {
49996
+ errorResponseSpans.add(span);
49997
+ span.attribute("rpc.status_code", String(code));
49998
+ span.attribute("error.type", String(code));
49999
+ };
50000
+ var endRequestSpan = (span, method, exit, endTime) => {
50001
+ if (errorResponseSpans.has(span)) return span.end(endTime, exit);
50002
+ if (isSuccess(exit)) {
50003
+ if (method === "tools/call" && hasProperty(exit.value, "isError") && exit.value.isError === true) span.attribute("error.type", "tool_error");
50004
+ return span.end(endTime, exit);
50005
+ }
50006
+ const error = findErrorOption(exit.cause);
50007
+ if (isNone(error) || !hasProperty(error.value, "code") || typeof error.value.code !== "number") return span.end(endTime, exit);
50008
+ const code = error.value.code;
50009
+ span.attribute("rpc.status_code", String(code));
50010
+ if (requestErrorCodes.has(code)) return span.end(endTime, void_$2);
50011
+ span.attribute("error.type", String(code));
50012
+ span.end(endTime, exit);
50013
+ };
49588
50014
  var McpClientKey = class extends Class$1 {};
49589
50015
  var normalizeCacheHints = (cacheHints) => {
49590
50016
  if (cacheHints === void 0) return succeed$4(void 0);
@@ -49608,10 +50034,30 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49608
50034
  const server = yield* McpServer;
49609
50035
  const defaultLogLevel = yield* CurrentLogLevel;
49610
50036
  const isHttp = transport === "http";
50037
+ const networkTransport = isHttp ? "tcp" : transport === "stdio" ? "pipe" : void 0;
50038
+ const traceRequest = (effect, request) => withFiber((fiber) => {
50039
+ const method = runtime.methodForInternalTag(request.tag);
50040
+ const { name, ...spanOptions } = requestSpanOptions(method, request, {
50041
+ protocolVersion: runtime.protocolForInternalTag(request.tag).protocolVersion,
50042
+ networkTransport,
50043
+ sessionId: isHttp ? getOrUndefined(fiber.context, HttpServerRequest)?.headers[MCP_SESSION_ID_HEADER] : void 0,
50044
+ recordToolArguments: fiber.getRef(RecordToolArguments)
50045
+ });
50046
+ const ambientParent = getOrUndefined(fiber.context, ParentSpan);
50047
+ return flatMap$1(makeSpan(name, {
50048
+ ...spanOptions,
50049
+ links: spanOptions.parent !== void 0 && ambientParent !== void 0 ? [{
50050
+ span: ambientParent,
50051
+ attributes: {}
50052
+ }] : void 0
50053
+ }), (span) => onExit$1(effect.pipe(provideService(ParentSpan, span), provideService(CurrentRequestSpan, span)), (exit) => sync(() => endRequestSpan(span, method, exit, fiber.getRef(Clock).currentTimeNanosUnsafe()))));
50054
+ });
49611
50055
  const clientStates = /* @__PURE__ */ new Map();
49612
50056
  const activeRequests = /* @__PURE__ */ new Map();
50057
+ const stdioEnd = transport === "stdio" ? makeUnsafe$4() : void 0;
49613
50058
  const reverseRequestClients = /* @__PURE__ */ new Map();
49614
50059
  const disconnectClient = (clientId) => {
50060
+ for (const request of activeRequests.get(clientId)?.values() ?? []) request.liveness.active = false;
49615
50061
  activeRequests.delete(clientId);
49616
50062
  clientStates.delete(clientId);
49617
50063
  runtime.disconnect(clientId);
@@ -49660,6 +50106,7 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49660
50106
  const key = requestKey(requestId);
49661
50107
  const request = requests?.get(key);
49662
50108
  if (request === void 0) return false;
50109
+ request.liveness.active = false;
49663
50110
  requests.set(key, {
49664
50111
  ...request,
49665
50112
  cancelled: true
@@ -49684,6 +50131,7 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49684
50131
  getListChangeRevision: () => notificationDelivery.listChangeRevision,
49685
50132
  ...!protocol.supportsNotifications || options.allowSubscriptions === false ? {} : {
49686
50133
  sendNotification,
50134
+ awaitClientEnd: stdioEnd?.await,
49687
50135
  markSubscriptionCancelled: (clientId, requestId) => sync(() => {
49688
50136
  cancelRequest(clientId, requestId);
49689
50137
  }),
@@ -49780,6 +50228,7 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49780
50228
  const requests = activeRequests.get(clientId);
49781
50229
  const key = requestKey(response.requestId);
49782
50230
  const active = requests?.get(key);
50231
+ if (active !== void 0) active.liveness.active = false;
49783
50232
  if (requests !== void 0 && requests.delete(key) && requests.size === 0) activeRequests.delete(clientId);
49784
50233
  if (active?.cancelled === true) {
49785
50234
  if (transport === "custom") return void_$1;
@@ -49790,7 +50239,9 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49790
50239
  if (response.exit._tag === "Failure" && !response.exit.cause.some((failure) => failure._tag === "Fail")) return sendRequestError(clientId, response.requestId, {
49791
50240
  code: INTERNAL_ERROR_CODE,
49792
50241
  message: "Internal error"
49793
- });
50242
+ }).pipe(andThen(CurrentRequestSpan), map$4((span) => {
50243
+ if (span !== void 0) recordErrorResponse(span, INTERNAL_ERROR_CODE);
50244
+ }));
49794
50245
  }
49795
50246
  return protocol.send(clientId, response);
49796
50247
  },
@@ -49870,17 +50321,19 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49870
50321
  }
49871
50322
  const decoded = yield* result$1(selectedProtocol.payloadCodecs(rpc).decode(request.payload));
49872
50323
  if (isFailure$1(decoded)) return yield* request.isNotification ? void_$1 : sendRequestError(clientId, request.id, new InvalidParams({ message: "Invalid method parameters" }));
50324
+ const liveness = { active: true };
49873
50325
  if (request.isNotification !== true) {
49874
50326
  const requests = activeRequests.get(clientId) ?? /* @__PURE__ */ new Map();
49875
50327
  requests.set(requestKey(request.id), {
49876
50328
  requestId: RequestId$3(request.id),
49877
50329
  prepared,
50330
+ liveness,
49878
50331
  cancelled: false,
49879
50332
  httpPost: httpRequest === void 0 ? void 0 : httpPostResponses.get(httpRequest)
49880
50333
  });
49881
50334
  activeRequests.set(clientId, requests);
49882
50335
  }
49883
- const handled = f(clientId, routedRequest);
50336
+ const handled = provideService(f(clientId, routedRequest), RequestLiveness, liveness);
49884
50337
  return yield* prepared.requestContext === void 0 ? handled : provideService(handled, McpRequestContext, prepared.requestContext);
49885
50338
  }).pipe(catch_$2((error) => request.isNotification ? void_$1 : sendRequestError(clientId, request.id, isTagged(error, "ProtocolError") ? ProtocolError.fromFeature(error) : new InvalidParams({ message: "Invalid request metadata" }))));
49886
50339
  }
@@ -49888,7 +50341,10 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49888
50341
  case "Ack":
49889
50342
  case "Interrupt": return f(clientId, request);
49890
50343
  case "Eof":
49891
- if (!isHttp) disconnectClient(clientId);
50344
+ if (!isHttp) {
50345
+ stdioEnd?.openUnsafe();
50346
+ disconnectClient(clientId);
50347
+ }
49892
50348
  return f(clientId, request);
49893
50349
  case "Pong":
49894
50350
  case "Exit":
@@ -49977,6 +50433,10 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49977
50433
  const rpc = selectedProtocol.serverNotificationRpcs.requests.get(projected.tag);
49978
50434
  if (!rpc) return;
49979
50435
  const encoded = yield* selectedProtocol.payloadCodecs(rpc).encode(projected.payload);
50436
+ if (notification._tag === "Progress") {
50437
+ if (!(yield* patchedProtocol.clientIds).has(clientId)) return;
50438
+ if (queued.requestLiveness?.active === false) return;
50439
+ }
49980
50440
  yield* patchedProtocol.send(clientId, {
49981
50441
  _tag: "Request",
49982
50442
  id: "",
@@ -49998,8 +50458,10 @@ var runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, trans
49998
50458
  }).pipe(forkScoped({ startImmediately: true }));
49999
50459
  })), ignoreCause, forever, forkScoped);
50000
50460
  return yield* make$12(runtime.clientRpcs, {
50001
- spanPrefix: "McpServer",
50002
- disableFatalDefects: true
50461
+ disableTracing: true,
50462
+ disableFatalDefects: true,
50463
+ onDisconnect: (clientId) => sync(() => disconnectClient(clientId)),
50464
+ onRequest: (effect, request) => traceRequest(effect, request)
50003
50465
  }).pipe(provideService(Protocol, patchedProtocol), provideService(McpServerClientMiddleware, clientMiddleware), provide(handlers));
50004
50466
  }, scoped);
50005
50467
  var layerWithRuntime = (options, transport) => effectDiscard(gen(function* () {
@@ -50030,6 +50492,10 @@ var layerWithRuntime = (options, transport) => effectDiscard(gen(function* () {
50030
50492
  * dependencies it supplies (see `ProvidedServices`); any other `McpRequest`
50031
50493
  * marker stays in the layer's requirements and must be met by MCP middleware.
50032
50494
  *
50495
+ * Each call builds its own `RpcServer.Protocol`, so several stdio servers can
50496
+ * live in one layer graph as long as each is provided its own `Stdio`. They
50497
+ * still share the memoized `McpServer` registry.
50498
+ *
50033
50499
  * @see {@link layer} for running over an existing `RpcServer.Protocol`
50034
50500
  * @see {@link layerHttp} for the single-endpoint HTTP transport
50035
50501
  *
@@ -50037,7 +50503,7 @@ var layerWithRuntime = (options, transport) => effectDiscard(gen(function* () {
50037
50503
  * @category layers
50038
50504
  * @since 4.0.0
50039
50505
  */
50040
- var layerStdio = (options) => layerWithRuntime(options, "stdio").pipe(provide$2(layer(options.protocols)), provide$2(layerProtocolStdio), provide$2(succeed$5(RpcSerialization, mcpStdioSerialization(options.protocols))));
50506
+ var layerStdio = (options) => layerWithRuntime(options, "stdio").pipe(provide$2(layer(options.protocols)), provide$2(effect(Protocol, makeProtocolStdio)), provide$2(succeed$5(RpcSerialization, mcpStdioSerialization(options.protocols))));
50041
50507
  var mcpStdioSerialization = (protocols) => {
50042
50508
  const serialization = mcpJsonRpcSerialization({ contentType: "application/json-rpc" });
50043
50509
  return RpcSerialization.of({
@@ -50195,31 +50661,26 @@ var registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit) {
50195
50661
  const annotations = tool.annotations;
50196
50662
  const toolMeta = getOrUndefined(annotations, Meta$3);
50197
50663
  const isDeclaredFailure = is$2(tool.failureSchema);
50198
- const encodeJson = (schema) => {
50199
- const encode = encodeUnknownEffect(toCodecJson(schema));
50200
- return (toolResult) => mapError$2(encode(toolResult), (cause) => make$7({
50201
- module: "McpServer",
50202
- method: "registerToolkit",
50203
- reason: new ToolResultEncodingError({
50204
- toolName: tool.name,
50205
- toolResult,
50206
- description: cause.message
50207
- })
50208
- }));
50209
- };
50210
- const encodeFailure = encodeJson(tool.failureSchema);
50211
- const encodeReturnedFailure = encodeJson(toEncoded(tool.failureSchema));
50212
- const encodeStructured = encodeJson(toEncoded(tool.successSchema));
50664
+ const encodeFailureJson = encodeUnknownEffect(toCodecJson(tool.failureSchema));
50665
+ const encodeFailure = (toolResult) => mapError$2(encodeFailureJson(toolResult), (cause) => make$7({
50666
+ module: "McpServer",
50667
+ method: "registerToolkit",
50668
+ reason: new ToolResultEncodingError({
50669
+ toolName: tool.name,
50670
+ toolResult,
50671
+ description: cause.message
50672
+ })
50673
+ }));
50213
50674
  const failureResult = (encoded) => new CallToolResult$5({
50214
50675
  isError: true,
50215
50676
  content: toolResultContent(encoded)
50216
50677
  });
50217
50678
  const declaredFailureResult = (error) => error instanceof Error && error.message !== "" ? succeed$4(toolErrorResult(error.message)) : map$4(encodeFailure(error), failureResult);
50218
- const successResult = (result) => map$4(encodeStructured(result), (structuredContent) => new CallToolResult$5({
50679
+ const successResult = (structuredContent) => new CallToolResult$5({
50219
50680
  isError: false,
50220
50681
  structuredContent,
50221
50682
  content: toolResultContent(structuredContent)
50222
- }));
50683
+ });
50223
50684
  const handleCause = (cause) => {
50224
50685
  const failure = findFail(cause);
50225
50686
  if (isSuccess$1(failure)) {
@@ -50251,11 +50712,11 @@ var registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit) {
50251
50712
  annotations,
50252
50713
  handle(payload) {
50253
50714
  return built.handle(tool.name, payload ?? {}, void 0, decodeOptions).pipe(unwrap$3, runLast, flatMap$1(fromOption), flatMap$1((result) => {
50254
- if (!result.isFailure) return result.encodedResult === void 0 ? succeed$4(new CallToolResult$5({
50715
+ if (!result.isFailure) return succeed$4(result.result === void 0 ? new CallToolResult$5({
50255
50716
  isError: false,
50256
50717
  content: []
50257
- })) : successResult(result.encodedResult);
50258
- return result.failureOrigin === "handler" ? map$4(encodeReturnedFailure(result.encodedResult), failureResult) : failCause$3(annotate$2(fail$4(result.result), make$53(FailureOrigin, result.failureOrigin ?? "result")));
50718
+ }) : successResult(result.encodedResult));
50719
+ return result.failureOrigin === "handler" ? succeed$4(failureResult(result.encodedResult)) : failCause$3(annotate$2(fail$4(result.result), make$53(FailureOrigin, result.failureOrigin ?? "result")));
50259
50720
  }), catchCause$2(handleCause));
50260
50721
  },
50261
50722
  services