clanka 0.16.1 → 0.17.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.
Files changed (85) hide show
  1. package/README.md +61 -0
  2. package/dist/Agent.d.ts.map +1 -1
  3. package/dist/Agent.js +5 -1
  4. package/dist/Agent.js.map +1 -1
  5. package/dist/AgentCallerConfig.test.js +5 -3
  6. package/dist/AgentCallerConfig.test.js.map +1 -1
  7. package/dist/ChunkRepo.d.ts +1 -1
  8. package/dist/ClaudeAgent.d.ts +111 -0
  9. package/dist/ClaudeAgent.d.ts.map +1 -0
  10. package/dist/ClaudeAgent.js +772 -0
  11. package/dist/ClaudeAgent.js.map +1 -0
  12. package/dist/ClaudeAgent.test.d.ts +2 -0
  13. package/dist/ClaudeAgent.test.d.ts.map +1 -0
  14. package/dist/ClaudeAgent.test.js +416 -0
  15. package/dist/ClaudeAgent.test.js.map +1 -0
  16. package/dist/Compaction.test.js +2 -1
  17. package/dist/Compaction.test.js.map +1 -1
  18. package/dist/CompactionTokens.test.js +15 -8
  19. package/dist/CompactionTokens.test.js.map +1 -1
  20. package/dist/ModelLayer.d.ts +2 -2
  21. package/dist/ModelLayer.d.ts.map +1 -1
  22. package/dist/ModelLayer.js +13 -7
  23. package/dist/ModelLayer.js.map +1 -1
  24. package/dist/ModelLayer.test.js +3 -0
  25. package/dist/ModelLayer.test.js.map +1 -1
  26. package/dist/ModelsRepo.d.ts +7 -6
  27. package/dist/ModelsRepo.d.ts.map +1 -1
  28. package/dist/ModelsRepo.js +44 -27
  29. package/dist/ModelsRepo.js.map +1 -1
  30. package/dist/ModelsRepo.test.js +47 -3
  31. package/dist/ModelsRepo.test.js.map +1 -1
  32. package/dist/bin/{Effect-4B1lzxy4.mjs → Effect-DNYYQ84C.mjs} +467 -365
  33. package/dist/bin/Effect-DNYYQ84C.mjs.map +1 -0
  34. package/dist/bin/Latch-BSlIwuxI.mjs +7 -0
  35. package/dist/bin/Latch-BSlIwuxI.mjs.map +1 -0
  36. package/dist/bin/{McpClient-DMfHHEx3.mjs → McpClient-C7ctqJWo.mjs} +4 -5
  37. package/dist/bin/{McpClient-DMfHHEx3.mjs.map → McpClient-C7ctqJWo.mjs.map} +1 -1
  38. package/dist/bin/{OutputFormatter-DRycCEdr.mjs → OutputFormatter-DXej05JW.mjs} +8 -13
  39. package/dist/bin/{OutputFormatter-DRycCEdr.mjs.map → OutputFormatter-DXej05JW.mjs.map} +1 -1
  40. package/dist/bin/{Schema-D4fxUgEU.mjs → Schema-CSQN_Zso.mjs} +754 -800
  41. package/dist/bin/Schema-CSQN_Zso.mjs.map +1 -0
  42. package/dist/bin/{SemanticSearch-BcLFv9qz.mjs → SemanticSearch-BiwCnpKX.mjs} +241 -148
  43. package/dist/bin/SemanticSearch-BiwCnpKX.mjs.map +1 -0
  44. package/dist/bin/{Stream-i37nF1ep.mjs → Stream-Dwvj9X5X.mjs} +244 -120
  45. package/dist/bin/Stream-Dwvj9X5X.mjs.map +1 -0
  46. package/dist/bin/cli.mjs +5122 -15959
  47. package/dist/bin/cli.mjs.map +1 -1
  48. package/dist/bin/helpers-CljL9OKa.mjs +7157 -0
  49. package/dist/bin/helpers-CljL9OKa.mjs.map +1 -0
  50. package/dist/bin/index.min-ClUfQ5ji.mjs +3782 -0
  51. package/dist/bin/index.min-ClUfQ5ji.mjs.map +1 -0
  52. package/dist/bin/{rolldown-runtime-zY4HT0JA.mjs → rolldown-runtime-5zChB7MF.mjs} +15 -3
  53. package/dist/bin/server-HlLriZxF.mjs +319 -0
  54. package/dist/bin/server-HlLriZxF.mjs.map +1 -0
  55. package/dist/bin/{turndown.cjs-LntFxFyd.mjs → turndown.cjs-C2WBxeA-.mjs} +56 -110
  56. package/dist/bin/{turndown.cjs-LntFxFyd.mjs.map → turndown.cjs-C2WBxeA-.mjs.map} +1 -1
  57. package/dist/bin/types-LcwjLVkt.mjs +5260 -0
  58. package/dist/bin/types-LcwjLVkt.mjs.map +1 -0
  59. package/dist/bin/upgrade-BSNjCnra.mjs +342 -0
  60. package/dist/bin/upgrade-BSNjCnra.mjs.map +1 -0
  61. package/dist/cli.js +4 -0
  62. package/dist/cli.js.map +1 -1
  63. package/dist/index.d.ts +4 -0
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +4 -0
  66. package/dist/index.js.map +1 -1
  67. package/package.json +15 -13
  68. package/src/Agent.ts +7 -1
  69. package/src/AgentCallerConfig.test.ts +5 -3
  70. package/src/ClaudeAgent.test.ts +526 -0
  71. package/src/ClaudeAgent.ts +1113 -0
  72. package/src/Compaction.test.ts +2 -1
  73. package/src/CompactionTokens.test.ts +15 -11
  74. package/src/ModelLayer.test.ts +4 -0
  75. package/src/ModelLayer.ts +21 -15
  76. package/src/ModelsRepo.test.ts +69 -3
  77. package/src/ModelsRepo.ts +24 -8
  78. package/src/cli.ts +4 -0
  79. package/src/index.ts +5 -0
  80. package/dist/bin/Effect-4B1lzxy4.mjs.map +0 -1
  81. package/dist/bin/Schema-D4fxUgEU.mjs.map +0 -1
  82. package/dist/bin/SemanticSearch-BcLFv9qz.mjs.map +0 -1
  83. package/dist/bin/Stream-i37nF1ep.mjs.map +0 -1
  84. package/dist/bin/index.min-Bkz7vIWv.mjs +0 -3300
  85. package/dist/bin/index.min-Bkz7vIWv.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Pipeable.js
1
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Pipeable.js
2
2
  const pipeArguments = (self, args) => {
3
3
  switch (args.length) {
4
4
  case 0: return self;
@@ -26,8 +26,7 @@ const Class$2 = function() {
26
26
  PipeableBase.prototype = Prototype$1;
27
27
  return PipeableBase;
28
28
  }();
29
- //#endregion
30
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Function.js
29
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Function.js
31
30
  const dual = function(arity, body) {
32
31
  if (typeof arity === "function") return function() {
33
32
  return arity(arguments) ? body.apply(this, arguments) : (self) => body(self, ...arguments);
@@ -116,8 +115,7 @@ function memoizeIdempotent(f) {
116
115
  return result;
117
116
  };
118
117
  }
119
- //#endregion
120
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/equal.js
118
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/equal.js
121
119
  const getAllObjectKeys = (obj) => {
122
120
  const keys = new Set(Reflect.ownKeys(obj));
123
121
  if (obj.constructor === Object) return keys;
@@ -134,14 +132,20 @@ const getAllObjectKeys = (obj) => {
134
132
  };
135
133
  const byReferenceInstances = new WeakSet();
136
134
  const viewBytes = (view) => new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
137
- //#endregion
138
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/hash.js
135
+ const isArrayBufferLike = (u) => u instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && u instanceof SharedArrayBuffer;
136
+ const bufferBytes = (buffer) => {
137
+ try {
138
+ return new Uint8Array(buffer);
139
+ } catch {
140
+ return;
141
+ }
142
+ };
143
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/hash.js
139
144
  let backEdges = 0;
140
145
  const addBackEdge = () => {
141
146
  backEdges++;
142
147
  };
143
- //#endregion
144
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Predicate.js
148
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Predicate.js
145
149
  function isString(input) {
146
150
  return typeof input === "string";
147
151
  }
@@ -202,8 +206,7 @@ function isIterable(input) {
202
206
  return hasProperty(input, Symbol.iterator) || isString(input);
203
207
  }
204
208
  const or = dual(2, (self, that) => (a) => self(a) || that(a));
205
- //#endregion
206
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Hash.js
209
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Hash.js
207
210
  const symbol$1 = "~effect/Hash";
208
211
  const hash = (self) => {
209
212
  switch (typeof self) {
@@ -228,9 +231,12 @@ const hash = (self) => {
228
231
  const seen = backEdges;
229
232
  let h;
230
233
  try {
231
- if ("~effect/Hash" in self) h = self[symbol$1]();
234
+ if (isHash(self)) h = self[symbol$1]();
232
235
  else if (typeof self === "function") h = random$1(self);
233
- else if (self instanceof DataView) h = array(viewBytes(self));
236
+ else if (isArrayBufferLike(self)) {
237
+ const bytes = bufferBytes(self);
238
+ h = bytes === void 0 ? random$1(self) : array(bytes);
239
+ } else if (self instanceof DataView) h = array(viewBytes(self));
234
240
  else if (Array.isArray(self) || ArrayBuffer.isView(self)) h = array(self);
235
241
  else if (self instanceof Map) h = hashMap(self);
236
242
  else if (self instanceof Set) h = hashSet(self);
@@ -257,6 +263,7 @@ const mix = (h) => {
257
263
  };
258
264
  const combine$1 = dual(2, (self, b) => mix(Math.imul(self, 2654435761) + Math.imul(b, 2246822507)));
259
265
  const optimize = (n) => n & 3221225471 | n >>> 1 & 1073741824;
266
+ const isHash = (u) => hasProperty(u, "~effect/Hash") && typeof u["~effect/Hash"] === "function";
260
267
  const float64 = new DataView(new ArrayBuffer(8));
261
268
  const number = (n) => {
262
269
  const h = n | 0;
@@ -291,8 +298,7 @@ const hashSet = unordered(setSeed, (element) => combine$1(setSeed, hash(element)
291
298
  const randomHashCache = new WeakMap();
292
299
  const hashCache = new WeakMap();
293
300
  const visitedObjects = new WeakSet();
294
- //#endregion
295
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Equal.js
301
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Equal.js
296
302
  const symbol = "~effect/Equal";
297
303
  function equals$1() {
298
304
  if (arguments.length === 1) return (self) => compareBoth(self, arguments[0]);
@@ -345,6 +351,11 @@ function compareStructure(self, that) {
345
351
  else if (Array.isArray(self)) {
346
352
  if (!Array.isArray(that) || self.length !== that.length) return false;
347
353
  return compareArrays(self, that);
354
+ } else if (isArrayBufferLike(self)) {
355
+ if (!isArrayBufferLike(that) || self instanceof ArrayBuffer !== that instanceof ArrayBuffer) return false;
356
+ const selfBytes = bufferBytes(self);
357
+ const thatBytes = bufferBytes(that);
358
+ return selfBytes !== void 0 && thatBytes !== void 0 && compareTypedArrays(selfBytes, thatBytes);
348
359
  } else if (ArrayBuffer.isView(self)) {
349
360
  const selfIsDataView = self instanceof DataView;
350
361
  if (!ArrayBuffer.isView(that) || self.byteLength !== that.byteLength || selfIsDataView !== that instanceof DataView) return false;
@@ -401,14 +412,13 @@ function compareHashed(self, that, hashOf, equivalent) {
401
412
  }
402
413
  const entryHash = (entry) => hash(entry[0]);
403
414
  const equalEntries = (self, that) => compareBoth(self[0], that[0]) && compareBoth(self[1], that[1]);
404
- const isEqual = (u) => hasProperty(u, symbol);
415
+ const isEqual = (u) => hasProperty(u, "~effect/Equal") && typeof u["~effect/Equal"] === "function";
405
416
  const asEquivalence = () => equals$1;
406
417
  const byReferenceUnsafe = (obj) => {
407
418
  byReferenceInstances.add(obj);
408
419
  return obj;
409
420
  };
410
- //#endregion
411
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Redactable.js
421
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Redactable.js
412
422
  const symbolRedactable = Symbol.for("~effect/Redactable");
413
423
  const isRedactable = (u) => hasProperty(u, symbolRedactable);
414
424
  function redact(u) {
@@ -429,8 +439,7 @@ const emptyContext$1 = {
429
439
  return pipeArguments(this, arguments);
430
440
  }
431
441
  };
432
- //#endregion
433
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Formatter.js
442
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Formatter.js
434
443
  function format$1(input, options) {
435
444
  const space = options?.space ?? 0;
436
445
  const ancestors = new WeakSet();
@@ -518,8 +527,9 @@ function safeGet(input, key) {
518
527
  }
519
528
  function formatJson(input, options) {
520
529
  const ancestors = [];
530
+ const sources = new WeakMap();
521
531
  return JSON.stringify(input, function(key, value) {
522
- const original = Object.getOwnPropertyDescriptor(this, key)?.value;
532
+ const original = Object.getOwnPropertyDescriptor(sources.get(this) ?? this, key)?.value;
523
533
  const redacted = hasProperty(original, symbolRedactable) ? redact(original) : redact(value);
524
534
  if (typeof redacted === "bigint") return format$1(redacted);
525
535
  if (typeof redacted !== "object" || redacted === null) return redacted;
@@ -533,18 +543,28 @@ function formatJson(input, options) {
533
543
  ancestors.push(redacted);
534
544
  if (current !== redacted) ancestors.push(current);
535
545
  if (!hasGetter(current) || isJsonPrimitiveWrapper(current)) return current;
536
- const serialized = new Proxy(current, { get(target, key) {
537
- const value = Reflect.get(target, key, target);
538
- return Object.getOwnPropertyDescriptor(target, key)?.get !== void 0 ? redact(value) : value;
539
- } });
540
- ancestors.push(serialized);
541
- return serialized;
546
+ const view = redactingView(current);
547
+ sources.set(view, current);
548
+ ancestors.push(view);
549
+ return view;
542
550
  }, options?.space) ?? "null";
543
551
  }
544
552
  function hasGetter(object) {
545
553
  for (const key of Object.getOwnPropertyNames(object)) if (Object.getOwnPropertyDescriptor(object, key)?.get !== void 0) return true;
546
554
  return false;
547
555
  }
556
+ function redactingView(object) {
557
+ const view = Array.isArray(object) ? [] : {};
558
+ const keys = Array.isArray(object) ? Array.from({ length: object.length }, (_, i) => String(i)) : Object.keys(object);
559
+ for (const key of keys) Object.defineProperty(view, key, {
560
+ enumerable: true,
561
+ get: () => {
562
+ const value = Reflect.get(object, key);
563
+ return Object.getOwnPropertyDescriptor(object, key)?.get !== void 0 ? redact(value) : value;
564
+ }
565
+ });
566
+ return view;
567
+ }
548
568
  function isJsonPrimitiveWrapper(object) {
549
569
  for (const valueOf of [
550
570
  Number.prototype.valueOf,
@@ -556,8 +576,7 @@ function isJsonPrimitiveWrapper(object) {
556
576
  } catch {}
557
577
  return false;
558
578
  }
559
- //#endregion
560
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Inspectable.js
579
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Inspectable.js
561
580
  const NodeInspectSymbol = Symbol.for("nodejs.util.inspect.custom");
562
581
  const toJson = (input) => {
563
582
  try {
@@ -596,8 +615,7 @@ var Class$1 = class {
596
615
  return format$1(this.toJSON());
597
616
  }
598
617
  };
599
- //#endregion
600
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/stackTraceLimit.js
618
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/stackTraceLimit.js
601
619
  const isStackTraceLimitWritable = () => {
602
620
  const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
603
621
  if (desc === void 0) return Object.isExtensible(Error);
@@ -608,8 +626,7 @@ const getStackTraceLimit = () => Error.stackTraceLimit;
608
626
  const setStackTraceLimit = (value) => {
609
627
  if (canWriteStackTraceLimit) Error.stackTraceLimit = value;
610
628
  };
611
- //#endregion
612
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Utils.js
629
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Utils.js
613
630
  var SingleShotGen = class {
614
631
  constructor(self) {
615
632
  this.value = self;
@@ -645,8 +662,7 @@ const pickInternalCall = () => {
645
662
  return error.stack?.includes(InternalTypeId) === true ? standard[InternalTypeId] : forced[InternalTypeId];
646
663
  };
647
664
  const internalCall = pickInternalCall();
648
- //#endregion
649
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/record.js
665
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/record.js
650
666
  function assignProperty(self, key, value) {
651
667
  if (key === "__proto__") Object.defineProperty(self, key, {
652
668
  value,
@@ -657,10 +673,13 @@ function assignProperty(self, key, value) {
657
673
  else self[key] = value;
658
674
  }
659
675
  function assignProperties(self, source) {
676
+ if (!Object.hasOwn(source, "__proto__")) {
677
+ Object.assign(self, source);
678
+ return;
679
+ }
660
680
  for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProperty(self, key, source[key]);
661
681
  }
662
- //#endregion
663
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/core.js
682
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/core.js
664
683
  const EffectTypeId = `~effect/Effect`;
665
684
  const ExitTypeId = `~effect/Exit`;
666
685
  const effectVariance = {
@@ -735,7 +754,7 @@ var CauseImpl = class {
735
754
  toJSON() {
736
755
  return {
737
756
  _id: "Cause",
738
- failures: this.reasons.map((f) => f.toJSON())
757
+ reasons: this.reasons.map((f) => f.toJSON())
739
758
  };
740
759
  }
741
760
  toString() {
@@ -773,6 +792,7 @@ var ReasonBase = class {
773
792
  if (options?.overwrite !== true && newAnnotations.has(key)) return;
774
793
  newAnnotations.set(key, value);
775
794
  });
795
+ if (options?.overwrite !== true && newAnnotations.size === this.annotations.size) return this;
776
796
  const self = Object.assign(Object.create(Object.getPrototypeOf(this)), this);
777
797
  self.annotations = newAnnotations;
778
798
  return self;
@@ -1030,14 +1050,12 @@ const done$2 = (value) => {
1030
1050
  if (value === void 0) return doneVoid;
1031
1051
  return exitFail(Done$1(value));
1032
1052
  };
1033
- //#endregion
1034
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Effectable.js
1053
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Effectable.js
1035
1054
  const Prototype = (options) => makePrimitiveProto({
1036
1055
  op: options.label,
1037
1056
  [evaluate]: options.evaluate
1038
1057
  });
1039
- //#endregion
1040
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Equivalence.js
1058
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Equivalence.js
1041
1059
  const make$7 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
1042
1060
  const isStrictEquivalent = (x, y) => x === y;
1043
1061
  const strictEqual = () => isStrictEquivalent;
@@ -1055,8 +1073,7 @@ function Array_(item) {
1055
1073
  return true;
1056
1074
  });
1057
1075
  }
1058
- //#endregion
1059
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/option.js
1076
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/option.js
1060
1077
  const TypeId$8 = "~effect/Option";
1061
1078
  const CommonProto$1 = {
1062
1079
  [TypeId$8]: { _A: (_) => _ },
@@ -1117,8 +1134,7 @@ const SomeImpl = function(value) {
1117
1134
  };
1118
1135
  SomeImpl.prototype = SomeProto;
1119
1136
  const some$1 = (value) => new SomeImpl(value);
1120
- //#endregion
1121
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/result.js
1137
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/result.js
1122
1138
  const TypeId$7 = "~effect/Result";
1123
1139
  const CommonProto = {
1124
1140
  [TypeId$7]: {
@@ -1177,14 +1193,13 @@ const FailureImpl = function(failure) {
1177
1193
  this.failure = failure;
1178
1194
  };
1179
1195
  FailureImpl.prototype = FailureProto;
1180
- const fail$5 = (failure) => new FailureImpl(failure);
1196
+ const fail$6 = (failure) => new FailureImpl(failure);
1181
1197
  const SuccessImpl = function(success) {
1182
1198
  this.success = success;
1183
1199
  };
1184
1200
  SuccessImpl.prototype = SuccessProto;
1185
- const succeed$5 = (success) => new SuccessImpl(success);
1186
- //#endregion
1187
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Order.js
1201
+ const succeed$6 = (success) => new SuccessImpl(success);
1202
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Order.js
1188
1203
  function make$6(compare) {
1189
1204
  return (self, that) => self === that ? 0 : compare(self, that);
1190
1205
  }
@@ -1204,8 +1219,7 @@ const isLessThanOrEqualTo = (O) => dual(2, (self, that) => O(self, that) !== 1);
1204
1219
  const isGreaterThanOrEqualTo = (O) => dual(2, (self, that) => O(self, that) !== -1);
1205
1220
  const min$2 = (O) => dual(2, (self, that) => self === that || O(self, that) < 1 ? self : that);
1206
1221
  const max$1 = (O) => dual(2, (self, that) => self === that || O(self, that) > -1 ? self : that);
1207
- //#endregion
1208
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Option.js
1222
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Option.js
1209
1223
  const none = () => none$1;
1210
1224
  const some = some$1;
1211
1225
  const isOption = isOption$1;
@@ -1256,8 +1270,7 @@ const all$2 = (input) => {
1256
1270
  const toArray = (self) => isNone(self) ? [] : [self.value];
1257
1271
  const filter = dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some(self.value) : none());
1258
1272
  const exists = dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));
1259
- //#endregion
1260
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Context.js
1273
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Context.js
1261
1274
  const ServiceTypeId = "~effect/Context/Service";
1262
1275
  const Service = function() {
1263
1276
  function KeyClass() {}
@@ -1305,9 +1318,8 @@ const ServiceProto = {
1305
1318
  const cacheKeys = new Set();
1306
1319
  const ReferenceTypeId = "~effect/Context/Reference";
1307
1320
  const TypeId$6 = "~effect/Context";
1308
- const MaxDepth = 8;
1309
1321
  const FlattenAfterBaseHits = 8;
1310
- const makeImpl = (cacheRoot, base, overlay, depth) => {
1322
+ const makeImpl = (cacheRoot, base, overlay, depth, maxDepth) => {
1311
1323
  const self = Object.create(Proto);
1312
1324
  self.cacheRoot = cacheRoot ?? self;
1313
1325
  self.base = base;
@@ -1315,6 +1327,7 @@ const makeImpl = (cacheRoot, base, overlay, depth) => {
1315
1327
  self.depth = depth;
1316
1328
  self._flat = void 0;
1317
1329
  self.baseHits = 0;
1330
+ self.maxDepth = maxDepth;
1318
1331
  return self;
1319
1332
  };
1320
1333
  const applyOverlays = (map, overlay) => {
@@ -1332,7 +1345,7 @@ const flatten$2 = (self) => {
1332
1345
  const withFlat = (self, f) => {
1333
1346
  const map = new Map(self.mapUnsafe);
1334
1347
  f(map);
1335
- return makeUnsafe$2(map);
1348
+ return makeImpl(void 0, map, void 0, 0, self.maxDepth);
1336
1349
  };
1337
1350
  const notFound = Symbol();
1338
1351
  const lookup = (self, key) => {
@@ -1347,7 +1360,10 @@ const lookup = (self, key) => {
1347
1360
  }
1348
1361
  return value;
1349
1362
  };
1350
- const makeUnsafe$2 = (mapUnsafe) => makeImpl(void 0, mapUnsafe, void 0, 0);
1363
+ const makeUnsafe$2 = (mapUnsafe, options) => {
1364
+ const maxDepth = options?.maxDepth;
1365
+ return makeImpl(void 0, mapUnsafe, void 0, 0, Number.isInteger(maxDepth) && maxDepth >= 0 ? maxDepth : 8);
1366
+ };
1351
1367
  const Proto = {
1352
1368
  get mapUnsafe() {
1353
1369
  return flatten$2(this);
@@ -1385,17 +1401,17 @@ const add = dual(3, (self, key, service) => addUnsafe(self, key.key, service));
1385
1401
  const addUnsafe = (self, key, service) => {
1386
1402
  const impl = self;
1387
1403
  const cacheRoot = cacheKeys.has(key) ? void 0 : impl.cacheRoot;
1388
- if (impl.depth >= MaxDepth) {
1404
+ if (impl.depth >= impl.maxDepth) {
1389
1405
  const map = new Map(impl._flat ?? impl.base);
1390
1406
  if (!impl._flat) applyOverlays(map, impl.overlay);
1391
1407
  map.set(key, service);
1392
- return makeImpl(cacheRoot, map, void 0, 0);
1408
+ return makeImpl(cacheRoot, map, void 0, 0, impl.maxDepth);
1393
1409
  }
1394
1410
  return makeImpl(cacheRoot, impl.base, {
1395
1411
  key,
1396
1412
  value: service,
1397
1413
  parent: impl.overlay
1398
- }, impl.depth + 1);
1414
+ }, impl.depth + 1, impl.maxDepth);
1399
1415
  };
1400
1416
  const getOrUndefined$1 = dual(2, (self, key) => getOrUndefinedUnsafe(self, key.key));
1401
1417
  const getOrUndefinedUnsafe = (self, key) => {
@@ -1442,9 +1458,11 @@ const mergeAll$1 = (...ctxs) => {
1442
1458
  });
1443
1459
  return makeUnsafe$2(map);
1444
1460
  };
1461
+ const omit = (...keys) => (self) => withFlat(self, (map) => {
1462
+ for (let i = 0; i < keys.length; i++) map.delete(keys[i].key);
1463
+ });
1445
1464
  const Reference = Service;
1446
- //#endregion
1447
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Duration.js
1465
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Duration.js
1448
1466
  const TypeId$5 = "~effect/Duration";
1449
1467
  const bigint0$1 = BigInt(0);
1450
1468
  const bigint1 = BigInt(1);
@@ -1454,9 +1472,20 @@ const bigint24 = BigInt(24);
1454
1472
  const bigint60 = BigInt(60);
1455
1473
  const bigint1e3 = BigInt(1e3);
1456
1474
  const bigint1e6 = BigInt(1e6);
1475
+ const bigint1e9 = BigInt(1e9);
1476
+ const bigintNanosPerMinute = BigInt(6e10);
1477
+ const bigintNanosPerHour = BigInt(36e11);
1478
+ const bigintNanosPerDay = BigInt(864e11);
1479
+ const bigintNanosPerWeek = BigInt(6048e11);
1457
1480
  const roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
1458
1481
  const roundMillisToNanos = (millis) => Number.isInteger(millis) ? BigInt(millis) * bigint1e6 : roundTiesAwayFromZero(millis * 1e6);
1459
1482
  const fromNanosNumber = (nanos) => make$4(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
1483
+ const nanosToUnit = (nanos, divisor) => {
1484
+ const value = Number(nanos);
1485
+ if (Number.isFinite(value)) return value / divisor;
1486
+ const scale = BigInt(divisor);
1487
+ return Number(nanos / scale) + Number(nanos % scale) / divisor;
1488
+ };
1460
1489
  const parseNanos = (input, scale) => {
1461
1490
  const decimalIndex = input.indexOf(".");
1462
1491
  if (decimalIndex === -1) return BigInt(input) * scale;
@@ -1471,6 +1500,12 @@ const divideTiesAwayFromZero = (numerator, denominator) => {
1471
1500
  const rounded = absolute / denominator + (absolute % denominator * bigint2 >= denominator ? bigint1 : bigint0$1);
1472
1501
  return numerator < bigint0$1 ? -rounded : rounded;
1473
1502
  };
1503
+ const fromMillisString = (input, scale) => {
1504
+ const millis = Number(input) * scale;
1505
+ if (!Number.isFinite(millis)) return make$4(millis);
1506
+ const nanos = parseNanos(input, BigInt(scale) * bigint1e6);
1507
+ return make$4(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
1508
+ };
1474
1509
  const DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
1475
1510
  const fromInputUnsafe = (input) => {
1476
1511
  switch (typeof input) {
@@ -1484,20 +1519,19 @@ const fromInputUnsafe = (input) => {
1484
1519
  const [_, valueStr, unit] = match;
1485
1520
  if (unit === "nano" || unit === "nanos") return nanos(parseNanos(valueStr, bigint1));
1486
1521
  if (unit === "micro" || unit === "micros") return nanos(parseNanos(valueStr, bigint1e3));
1487
- const value = Number(valueStr);
1488
1522
  switch (unit) {
1489
1523
  case "milli":
1490
- case "millis": return millis(value);
1524
+ case "millis": return fromMillisString(valueStr, 1);
1491
1525
  case "second":
1492
- case "seconds": return seconds(value);
1526
+ case "seconds": return fromMillisString(valueStr, 1e3);
1493
1527
  case "minute":
1494
- case "minutes": return minutes(value);
1528
+ case "minutes": return fromMillisString(valueStr, 6e4);
1495
1529
  case "hour":
1496
- case "hours": return hours(value);
1530
+ case "hours": return fromMillisString(valueStr, 36e5);
1497
1531
  case "day":
1498
- case "days": return days(value);
1532
+ case "days": return fromMillisString(valueStr, 864e5);
1499
1533
  case "week":
1500
- case "weeks": return weeks(value);
1534
+ case "weeks": return fromMillisString(valueStr, 6048e5);
1501
1535
  }
1502
1536
  break;
1503
1537
  }
@@ -1509,7 +1543,8 @@ const fromInputUnsafe = (input) => {
1509
1543
  if (Number.isNaN(input[0]) || Number.isNaN(input[1])) return zero;
1510
1544
  if (input[0] === -Infinity || input[1] === -Infinity) return negativeInfinity;
1511
1545
  if (input[0] === Infinity || input[1] === Infinity) return infinity;
1512
- return fromNanosNumber(input[0] * 1e9 + input[1]);
1546
+ const nanos = input[0] * 1e9 + input[1];
1547
+ return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$4(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
1513
1548
  }
1514
1549
  const obj = input;
1515
1550
  let millis = 0;
@@ -1519,12 +1554,32 @@ const fromInputUnsafe = (input) => {
1519
1554
  if (obj.minutes) millis += obj.minutes * 6e4;
1520
1555
  if (obj.seconds) millis += obj.seconds * 1e3;
1521
1556
  if (obj.milliseconds) millis += obj.milliseconds;
1522
- if (!obj.microseconds && !obj.nanoseconds) return make$4(millis);
1523
- return fromNanosNumber(millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0));
1557
+ if (!obj.microseconds && !obj.nanoseconds) {
1558
+ if (!Number.isFinite(millis)) return make$4(millis);
1559
+ const exact = sumObjectNanos(obj);
1560
+ return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$4(millis) : make$4(exact);
1561
+ }
1562
+ const nanos = millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0);
1563
+ const exact = Number.isFinite(nanos) ? sumObjectNanos(obj) : void 0;
1564
+ return exact === void 0 ? fromNanosNumber(nanos) : make$4(exact);
1524
1565
  }
1525
1566
  }
1526
1567
  return invalid(input);
1527
1568
  };
1569
+ const isIntegerOrUnset = (n) => !n || Number.isInteger(n);
1570
+ const sumObjectNanos = (obj) => {
1571
+ if (!isIntegerOrUnset(obj.weeks) || !isIntegerOrUnset(obj.days) || !isIntegerOrUnset(obj.hours) || !isIntegerOrUnset(obj.minutes) || !isIntegerOrUnset(obj.seconds) || !isIntegerOrUnset(obj.milliseconds) || !isIntegerOrUnset(obj.microseconds) || !isIntegerOrUnset(obj.nanoseconds)) return void 0;
1572
+ let nanos = bigint0$1;
1573
+ if (obj.weeks) nanos += BigInt(obj.weeks) * bigintNanosPerWeek;
1574
+ if (obj.days) nanos += BigInt(obj.days) * bigintNanosPerDay;
1575
+ if (obj.hours) nanos += BigInt(obj.hours) * bigintNanosPerHour;
1576
+ if (obj.minutes) nanos += BigInt(obj.minutes) * bigintNanosPerMinute;
1577
+ if (obj.seconds) nanos += BigInt(obj.seconds) * bigint1e9;
1578
+ if (obj.milliseconds) nanos += BigInt(obj.milliseconds) * bigint1e6;
1579
+ if (obj.microseconds) nanos += BigInt(obj.microseconds) * bigint1e3;
1580
+ if (obj.nanoseconds) nanos += BigInt(obj.nanoseconds);
1581
+ return nanos;
1582
+ };
1528
1583
  const invalid = (input) => {
1529
1584
  throw new Error(`Invalid Input: ${input}`);
1530
1585
  };
@@ -1637,17 +1692,15 @@ const millis = (millis) => make$4(millis);
1637
1692
  const seconds = (seconds) => make$4(seconds * 1e3);
1638
1693
  const minutes = (minutes) => make$4(minutes * 6e4);
1639
1694
  const hours = (hours) => make$4(hours * 36e5);
1640
- const days = (days) => make$4(days * 864e5);
1641
- const weeks = (weeks) => make$4(weeks * 6048e5);
1642
1695
  const toMillis = (self) => match$4(fromInputUnsafe(self), {
1643
1696
  onMillis: identity,
1644
- onNanos: (nanos) => Number(nanos) / 1e6,
1697
+ onNanos: (nanos) => nanosToUnit(nanos, 1e6),
1645
1698
  onInfinity: () => Infinity,
1646
1699
  onNegativeInfinity: () => -Infinity
1647
1700
  });
1648
1701
  const toSeconds = (self) => match$4(fromInputUnsafe(self), {
1649
1702
  onMillis: (millis) => millis / 1e3,
1650
- onNanos: (nanos) => Number(nanos) / 1e9,
1703
+ onNanos: (nanos) => nanosToUnit(nanos, 1e9),
1651
1704
  onInfinity: () => Infinity,
1652
1705
  onNegativeInfinity: () => -Infinity
1653
1706
  });
@@ -1742,29 +1795,30 @@ const format = (self) => {
1742
1795
  if (fragments.nanos !== 0) pieces.push(`${fragments.nanos}ns`);
1743
1796
  return pieces.join(" ");
1744
1797
  };
1745
- //#endregion
1746
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/array.js
1798
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/array.js
1747
1799
  const isArrayNonEmpty$1 = (self) => self.length > 0;
1748
- //#endregion
1749
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Result.js
1750
- const succeed$4 = succeed$5;
1751
- const fail$4 = fail$5;
1752
- const failVoid = fail$4(void 0);
1800
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/count.js
1801
+ const normalize = (n) => n > 0 ? Math.floor(n) : 0;
1802
+ const normalizeNonEmpty = (n) => Math.max(1, normalize(n));
1803
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Result.js
1804
+ const succeed$5 = succeed$6;
1805
+ const fail$5 = fail$6;
1806
+ const failVoid = fail$5(void 0);
1753
1807
  const try_$2 = (evaluate) => {
1754
1808
  if (isFunction(evaluate)) try {
1755
- return succeed$4(evaluate());
1809
+ return succeed$5(evaluate());
1756
1810
  } catch (e) {
1757
- return fail$4(e);
1811
+ return fail$5(e);
1758
1812
  }
1759
1813
  else try {
1760
- return succeed$4(evaluate.try());
1814
+ return succeed$5(evaluate.try());
1761
1815
  } catch (e) {
1762
- return fail$4(evaluate.catch(e));
1816
+ return fail$5(evaluate.catch(e));
1763
1817
  }
1764
1818
  };
1765
1819
  const isFailure$1 = isFailure$2;
1766
1820
  const isSuccess$1 = isSuccess$2;
1767
- const map$4 = dual(2, (self, f) => isSuccess$1(self) ? succeed$4(f(self.success)) : self);
1821
+ const map$4 = dual(2, (self, f) => isSuccess$1(self) ? succeed$5(f(self.success)) : self);
1768
1822
  const match$3 = dual(2, (self, { onFailure, onSuccess }) => isFailure$1(self) ? onFailure(self.failure) : onSuccess(self.success));
1769
1823
  const getOrElse = dual(2, (self, onFailure) => isFailure$1(self) ? onFailure(self.failure) : self.success);
1770
1824
  const getOrUndefined = getOrElse(constUndefined);
@@ -1773,15 +1827,8 @@ const getOrThrowWith = dual(2, (self, onFailure) => {
1773
1827
  throw onFailure(self.failure);
1774
1828
  });
1775
1829
  const getOrThrow = getOrThrowWith(identity);
1776
- const flatMap$4 = dual(2, (self, f) => isFailure$1(self) ? fail$4(self.failure) : f(self.success));
1777
- //#endregion
1778
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Iterable.js
1779
- const size$1 = (self) => {
1780
- const iterator = self[Symbol.iterator]();
1781
- let count = 0;
1782
- while (!iterator.next().done) count++;
1783
- return count;
1784
- };
1830
+ const flatMap$4 = dual(2, (self, f) => isFailure$1(self) ? fail$5(self.failure) : f(self.success));
1831
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Iterable.js
1785
1832
  const headUnsafe = (self) => {
1786
1833
  const result = self[Symbol.iterator]().next();
1787
1834
  if (result.done) throw new Error("headUnsafe: empty iterable");
@@ -1808,11 +1855,12 @@ const constEmptyIterator = { next() {
1808
1855
  };
1809
1856
  } };
1810
1857
  const empty$3 = () => constEmpty;
1811
- //#endregion
1812
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Array.js
1858
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Array.js
1813
1859
  const Array$1 = globalThis.Array;
1814
1860
  const fromIterable$1 = (collection) => Array$1.isArray(collection) ? collection : Array$1.from(collection);
1861
+ const ensure = (self) => Array$1.isArray(self) ? self : [self];
1815
1862
  const match$2 = dual(2, (self, { onEmpty, onNonEmpty }) => isReadonlyArrayNonEmpty(self) ? onNonEmpty(self) : onEmpty());
1863
+ const prepend = dual(2, (self, head) => [head, ...self]);
1816
1864
  const append = dual(2, (self, last) => [...self, last]);
1817
1865
  const appendAll = dual(2, (self, that) => fromIterable$1(self).concat(fromIterable$1(that)));
1818
1866
  const isArray = Array$1.isArray;
@@ -1835,6 +1883,18 @@ const getUnsafe = dual(2, (self, index) => {
1835
1883
  const headNonEmpty = getUnsafe(0);
1836
1884
  const last = (self) => isReadonlyArrayNonEmpty(self) ? some(lastNonEmpty(self)) : none();
1837
1885
  const lastNonEmpty = (self) => self[self.length - 1];
1886
+ const spanIndex = (self, predicate) => {
1887
+ let i = 0;
1888
+ for (const a of self) {
1889
+ if (!predicate(a, i)) break;
1890
+ i++;
1891
+ }
1892
+ return i;
1893
+ };
1894
+ const span = dual(2, (self, predicate) => {
1895
+ const input = fromIterable$1(self);
1896
+ return splitAt(input, spanIndex(input, predicate));
1897
+ });
1838
1898
  const findFirstIndex = dual(2, (self, predicate) => {
1839
1899
  let i = 0;
1840
1900
  for (const a of self) {
@@ -1860,6 +1920,20 @@ const sort = dual(2, (self, O) => {
1860
1920
  out.sort(O);
1861
1921
  return out;
1862
1922
  });
1923
+ const splitAt = dual(2, (self, n) => {
1924
+ const input = Array$1.from(self);
1925
+ const _n = normalize(n);
1926
+ if (isReadonlyArrayNonEmpty(input)) {
1927
+ if (_n >= 1) return splitAtNonEmpty(input, _n);
1928
+ return [[], input];
1929
+ }
1930
+ return [input, []];
1931
+ });
1932
+ const splitAtNonEmpty = dual(2, (self, n) => {
1933
+ const _n = normalizeNonEmpty(n);
1934
+ return _n >= self.length ? [copy(self), []] : [prepend(self.slice(1, _n), headNonEmpty(self)), self.slice(_n)];
1935
+ });
1936
+ const copy = (self) => self.slice();
1863
1937
  const hashBucketsAdd = (buckets, value) => {
1864
1938
  const hash$5 = hash(value);
1865
1939
  const bucket = buckets.get(hash$5);
@@ -1896,10 +1970,9 @@ const dedupe = (self) => {
1896
1970
  return out;
1897
1971
  };
1898
1972
  const join = dual(2, (self, sep) => fromIterable$1(self).join(sep));
1899
- //#endregion
1900
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Filter.js
1973
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Filter.js
1901
1974
  const toPredicate = (self) => (input) => !isFailure$1(self(input));
1902
- const has$1 = (key) => (input) => input.has(key) ? succeed$4(input) : fail$4(input);
1975
+ const has$1 = (key) => (input) => input.has(key) ? succeed$5(input) : fail$5(input);
1903
1976
  const compose = dual(2, (left, right) => (input) => {
1904
1977
  const leftOut = left(input);
1905
1978
  if (isFailure$1(leftOut)) return leftOut;
@@ -1907,17 +1980,16 @@ const compose = dual(2, (left, right) => (input) => {
1907
1980
  });
1908
1981
  const composePassthrough = dual(2, (left, right) => (input) => {
1909
1982
  const leftOut = left(input);
1910
- if (isFailure$1(leftOut)) return fail$4(input);
1983
+ if (isFailure$1(leftOut)) return fail$5(input);
1911
1984
  const rightOut = right(leftOut.success);
1912
- if (isFailure$1(rightOut)) return fail$4(input);
1985
+ if (isFailure$1(rightOut)) return fail$5(input);
1913
1986
  return rightOut;
1914
1987
  });
1915
1988
  const toOption = (self) => (input) => {
1916
1989
  const result = self(input);
1917
1990
  return isFailure$1(result) ? none() : some(result.success);
1918
1991
  };
1919
- //#endregion
1920
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Scheduler.js
1992
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Scheduler.js
1921
1993
  const Scheduler = Reference("effect/Scheduler", {
1922
1994
  fiberCached: true,
1923
1995
  defaultValue: () => new MixedScheduler()
@@ -2020,8 +2092,7 @@ const PreventSchedulerYield = Reference("effect/Scheduler/PreventSchedulerYield"
2020
2092
  fiberCached: true,
2021
2093
  defaultValue: () => false
2022
2094
  });
2023
- //#endregion
2024
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/encoding/Hex.js
2095
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/encoding/Hex.js
2025
2096
  const encode = (input) => typeof input === "string" ? hexEncodeUint8Array(encoder.encode(input)) : hexEncodeUint8Array(input);
2026
2097
  const random = (length) => {
2027
2098
  switch (length) {
@@ -2059,8 +2130,7 @@ const hexEncodeUint8Array = (bytes) => {
2059
2130
  for (let i = 0; i < bytes.length; i++) result += byteToHex[bytes[i]];
2060
2131
  return result;
2061
2132
  };
2062
- //#endregion
2063
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Tracer.js
2133
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Tracer.js
2064
2134
  const ParentSpanKey = "effect/Tracer/ParentSpan";
2065
2135
  var ParentSpan = class extends Service()(ParentSpanKey, { fiberCached: true }) {};
2066
2136
  const make$3 = (options) => options;
@@ -2109,6 +2179,7 @@ var NativeSpan = class {
2109
2179
  return this._events ??= [];
2110
2180
  }
2111
2181
  end(endTime, exit) {
2182
+ if (this.status._tag === "Ended") return;
2112
2183
  this.status = {
2113
2184
  _tag: "Ended",
2114
2185
  endTime,
@@ -2117,9 +2188,11 @@ var NativeSpan = class {
2117
2188
  };
2118
2189
  }
2119
2190
  attribute(key, value) {
2191
+ if (this.status._tag === "Ended") return;
2120
2192
  this.attributes.set(key, value);
2121
2193
  }
2122
2194
  event(name, startTime, attributes) {
2195
+ if (this.status._tag === "Ended") return;
2123
2196
  this.events.push([
2124
2197
  name,
2125
2198
  startTime,
@@ -2127,14 +2200,13 @@ var NativeSpan = class {
2127
2200
  ]);
2128
2201
  }
2129
2202
  addLinks(links) {
2203
+ if (this.status._tag === "Ended") return;
2130
2204
  this.links.push(...links);
2131
2205
  }
2132
2206
  };
2133
- //#endregion
2134
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/metric.js
2207
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/metric.js
2135
2208
  const FiberRuntimeMetricsKey = "effect/Metric/FiberRuntimeMetrics";
2136
- //#endregion
2137
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/references.js
2209
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/references.js
2138
2210
  const CurrentStackFrame = Reference("effect/References/CurrentStackFrame", {
2139
2211
  fiberCached: true,
2140
2212
  defaultValue: constUndefined
@@ -2155,9 +2227,9 @@ const MinimumLogLevel$1 = Reference("effect/References/MinimumLogLevel", {
2155
2227
  fiberCached: true,
2156
2228
  defaultValue: () => "Info"
2157
2229
  });
2230
+ const UnhandledLogLevel = Reference("effect/References/UnhandledLogLevel", { defaultValue: () => "Error" });
2158
2231
  const CurrentLogSpans$1 = Reference("effect/References/CurrentLogSpans", { defaultValue: () => [] });
2159
- //#endregion
2160
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/tracer.js
2232
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/tracer.js
2161
2233
  const addSpanStackTrace = (options) => {
2162
2234
  if (options?.captureStackTrace === false) return options;
2163
2235
  else if (options?.captureStackTrace !== void 0 && typeof options.captureStackTrace !== "boolean") return options;
@@ -2188,8 +2260,7 @@ const makeStackCleaner = (line) => (stack) => {
2188
2260
  };
2189
2261
  };
2190
2262
  const spanCleaner = makeStackCleaner(3);
2191
- //#endregion
2192
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/effect.js
2263
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/effect.js
2193
2264
  var Interrupt = class extends ReasonBase {
2194
2265
  constructor(fiberId, annotations = constEmptyAnnotations) {
2195
2266
  super("Interrupt", annotations, "Interrupted");
@@ -2213,21 +2284,21 @@ var Interrupt = class extends ReasonBase {
2213
2284
  };
2214
2285
  const makeInterruptReason$1 = (fiberId) => new Interrupt(fiberId);
2215
2286
  const causeInterrupt = (fiberId) => new CauseImpl([new Interrupt(fiberId)]);
2216
- const findFail = (self) => {
2217
- const reason = self.reasons.find(isFailReason$1);
2218
- return reason ? succeed$4(reason) : fail$4(self);
2219
- };
2220
- const findError$1 = (self) => {
2287
+ const hasFails = (self) => self.reasons.some(isFailReason$1);
2288
+ const findError = (self) => {
2221
2289
  for (let i = 0; i < self.reasons.length; i++) {
2222
2290
  const reason = self.reasons[i];
2223
- if (reason._tag === "Fail") return succeed$4(reason.error);
2291
+ if (reason._tag === "Fail") return succeed$5(reason.error);
2224
2292
  }
2225
- return fail$4(self);
2293
+ return fail$5(self);
2226
2294
  };
2227
- const findErrorOption$2 = toOption(findError$1);
2295
+ const findErrorOption$2 = toOption(findError);
2296
+ const hasDies = (self) => self.reasons.some(isDieReason$1);
2297
+ const causeElectDefects = (self) => hasDies(self) && hasFails(self) ? causeFromReasons(self.reasons.map((reason) => reason._tag === "Fail" && !isDone$2(reason.error) ? new Die(reason.error, reason.annotations) : reason)) : self;
2298
+ const findRecoverableError = (self) => hasDies(self) ? fail$5(causeElectDefects(self)) : findError(self);
2228
2299
  const findDefect = (self) => {
2229
2300
  const reason = self.reasons.find(isDieReason$1);
2230
- return reason ? succeed$4(reason.defect) : fail$4(self);
2301
+ return reason ? succeed$5(reason.defect) : fail$5(self);
2231
2302
  };
2232
2303
  const hasInterrupts$1 = (self) => self.reasons.some(isInterruptReason);
2233
2304
  const causeFilterInterruptors = (self) => {
@@ -2238,7 +2309,7 @@ const causeFilterInterruptors = (self) => {
2238
2309
  interruptors ??= new Set();
2239
2310
  if (f.fiberId !== void 0) interruptors.add(f.fiberId);
2240
2311
  }
2241
- return interruptors ? succeed$4(interruptors) : fail$4(self);
2312
+ return interruptors ? succeed$5(interruptors) : fail$5(self);
2242
2313
  };
2243
2314
  const causeInterruptors = (self) => {
2244
2315
  const result = causeFilterInterruptors(self);
@@ -2296,11 +2367,13 @@ const causePrettyErrors = (self, options) => {
2296
2367
  }
2297
2368
  return errors;
2298
2369
  };
2299
- const causePrettyError = (original, annotations, options) => {
2370
+ const causePrettyError = (original, annotations, options, seen = new Set()) => {
2300
2371
  const kind = typeof original;
2301
2372
  let error;
2302
2373
  if (original && kind === "object") {
2303
- error = new globalThis.Error(causePrettyMessage(original), { cause: original.cause ? causePrettyError(original.cause) : void 0 });
2374
+ seen.add(original);
2375
+ const cause = original.cause;
2376
+ error = new globalThis.Error(causePrettyMessage(original), { cause: cause !== void 0 && !seen.has(cause) ? causePrettyError(cause, void 0, void 0, seen) : void 0 });
2304
2377
  if (typeof original.name === "string") error.name = original.name;
2305
2378
  if (typeof original.stack === "string") error.stack = cleanErrorStack(original.stack, error, annotations);
2306
2379
  else {
@@ -2453,7 +2526,11 @@ var FiberImpl = class {
2453
2526
  else if (this._asyncContext !== void 0) {
2454
2527
  const asyncContext = this._asyncContext;
2455
2528
  this._asyncContext = void 0;
2456
- return asyncContext.runInAsyncScope(this.evaluate, this, effect);
2529
+ try {
2530
+ return asyncContext.runInAsyncScope(this.evaluate, this, effect);
2531
+ } finally {
2532
+ asyncContext.emitDestroy();
2533
+ }
2457
2534
  } else if (this._yielded !== void 0) {
2458
2535
  const yielded = this._yielded;
2459
2536
  this._yielded = void 0;
@@ -2480,6 +2557,12 @@ var FiberImpl = class {
2480
2557
  this._stack.length = 0;
2481
2558
  this._children = void 0;
2482
2559
  this.context = empty$4();
2560
+ const cache = this.cache;
2561
+ if (cache.span !== void 0 || cache.stackFrame !== void 0) this.cache = {
2562
+ ...cache,
2563
+ span: void 0,
2564
+ stackFrame: void 0
2565
+ };
2483
2566
  }
2484
2567
  runLoop(effect) {
2485
2568
  const prevFiber = globalThis[currentFiberTypeId];
@@ -2611,10 +2694,10 @@ const fiberInterruptChildren = (fiber) => {
2611
2694
  };
2612
2695
  const fiberAwait = (self) => {
2613
2696
  const impl = self;
2614
- if (impl._exit) return succeed$3(impl._exit);
2697
+ if (impl._exit) return succeed$4(impl._exit);
2615
2698
  return callback$1((resume) => {
2616
- if (impl._exit) return resume(succeed$3(impl._exit));
2617
- return sync$1(self.addObserver((exit) => resume(succeed$3(exit))));
2699
+ if (impl._exit) return resume(succeed$4(impl._exit));
2700
+ return sync$1(self.addObserver((exit) => resume(succeed$4(exit))));
2618
2701
  });
2619
2702
  };
2620
2703
  const fiberAwaitAll = (self) => callback$1((resume) => {
@@ -2635,7 +2718,7 @@ const fiberAwaitAll = (self) => callback$1((resume) => {
2635
2718
  });
2636
2719
  return;
2637
2720
  }
2638
- resume(succeed$3(exits));
2721
+ resume(succeed$4(exits));
2639
2722
  }
2640
2723
  loop();
2641
2724
  return sync$1(() => cancel?.());
@@ -2673,13 +2756,14 @@ const fiberInterruptAllAs = dual(2, (fibers, fiberId) => withFiber$1((parent) =>
2673
2756
  }
2674
2757
  return asVoid$1(fiberAwaitAll(fiberArr));
2675
2758
  }));
2676
- const succeed$3 = exitSucceed;
2759
+ const succeed$4 = exitSucceed;
2677
2760
  const failCause$3 = exitFailCause;
2678
- const fail$3 = exitFail;
2761
+ const fail$4 = exitFail;
2679
2762
  const sync$1 = makePrimitive({
2680
2763
  op: "Sync",
2681
2764
  [evaluate](fiber) {
2682
- const value = this[args]();
2765
+ const thunk = this[args];
2766
+ const value = thunk();
2683
2767
  const cont = fiber.getCont(contA);
2684
2768
  return cont ? cont[contA](value, fiber) : fiber.yieldWith(exitSucceed(value));
2685
2769
  }
@@ -2687,13 +2771,14 @@ const sync$1 = makePrimitive({
2687
2771
  const suspend$1 = makePrimitive({
2688
2772
  op: "Suspend",
2689
2773
  [evaluate](_fiber) {
2690
- return this[args]();
2774
+ const thunk = this[args];
2775
+ return thunk();
2691
2776
  }
2692
2777
  });
2693
- const fromOption$1 = dual((args) => args.length >= 2 || isOption(args[0]), (option, onNone) => isNone(option) ? fail$3(onNone ? onNone() : new NoSuchElementError$1("Effect.fromOption: Option.none")) : succeed$3(option.value));
2778
+ const fromOption$1 = dual((args) => args.length >= 2 || isOption(args[0]), (option, onNone) => isNone(option) ? onNone ? failSync$1(onNone) : fail$4(new NoSuchElementError$1("Effect.fromOption: Option.none")) : succeed$4(option.value));
2694
2779
  const fromResult$1 = match$3({
2695
- onFailure: fail$3,
2696
- onSuccess: succeed$3
2780
+ onFailure: fail$4,
2781
+ onSuccess: succeed$4
2697
2782
  });
2698
2783
  const yieldNowWith = makePrimitive({
2699
2784
  op: "Yield",
@@ -2709,25 +2794,25 @@ const yieldNowWith = makePrimitive({
2709
2794
  }
2710
2795
  });
2711
2796
  const yieldNow$1 = yieldNowWith(0);
2712
- const succeedSome$1 = (a) => succeed$3(some(a));
2713
- const succeedNone$1 = succeed$3(none());
2797
+ const succeedSome$1 = (a) => succeed$4(some(a));
2798
+ const succeedNone$1 = succeed$4(none());
2714
2799
  const failCauseSync$1 = (evaluate) => suspend$1(() => failCause$3(evaluate()));
2715
2800
  const die$3 = (defect) => exitDie(defect);
2716
- const failSync = (error) => suspend$1(() => fail$3(error()));
2717
- const void_$2 = succeed$3(void 0);
2801
+ const failSync$1 = (error) => suspend$1(() => fail$4(error()));
2802
+ const void_$2 = succeed$4(void 0);
2718
2803
  const try_$1 = (options) => {
2719
2804
  const evaluate = typeof options === "function" ? options : options.try;
2720
2805
  const catcher = typeof options === "function" ? (cause) => new UnknownError$1(cause, "An error occurred in Effect.try") : options.catch;
2721
2806
  return suspend$1(() => {
2722
2807
  try {
2723
- return succeed$3(evaluate());
2808
+ return succeed$4(evaluate());
2724
2809
  } catch (err) {
2725
- return fail$3(catcher(err));
2810
+ return fail$4(catcher(err));
2726
2811
  }
2727
2812
  });
2728
2813
  };
2729
2814
  const promise$1 = (evaluate) => callbackOptions(function(resume, signal) {
2730
- evaluate(signal).then((a) => resume(succeed$3(a)), (e) => resume(die$3(e)));
2815
+ evaluate(signal).then((a) => resume(succeed$4(a)), (e) => resume(die$3(e)));
2731
2816
  }, evaluate.length !== 0);
2732
2817
  const tryPromise$1 = (options) => {
2733
2818
  const f = typeof options === "function" ? options : options.try;
@@ -2735,19 +2820,18 @@ const tryPromise$1 = (options) => {
2735
2820
  return callbackOptions(function(resume, signal) {
2736
2821
  const failWithCatch = (cause) => suspend$1(() => {
2737
2822
  try {
2738
- return fail$3(internalCall(() => catcher(cause)));
2823
+ return fail$4(internalCall(() => catcher(cause)));
2739
2824
  } catch (err) {
2740
2825
  return die$3(err);
2741
2826
  }
2742
2827
  });
2743
2828
  try {
2744
- f(signal).then((a) => resume(succeed$3(a)), (e) => resume(failWithCatch(e)));
2829
+ f(signal).then((a) => resume(succeed$4(a)), (e) => resume(failWithCatch(e)));
2745
2830
  } catch (err) {
2746
2831
  resume(failWithCatch(err));
2747
2832
  }
2748
2833
  }, f.length !== 0);
2749
2834
  };
2750
- const withFiberId = (f) => withFiber$1((fiber) => f(fiber.id));
2751
2835
  const callbackOptions = function() {
2752
2836
  const Proto = makePrimitiveProto({
2753
2837
  op: "Async",
@@ -2763,9 +2847,9 @@ const callbackOptions = function() {
2763
2847
  }, controller?.signal);
2764
2848
  if (yielded !== false) return yielded;
2765
2849
  yielded = true;
2766
- fiber._yielded = () => {
2850
+ fiber.yieldWith(() => {
2767
2851
  resumed = true;
2768
- };
2852
+ });
2769
2853
  if (controller === void 0 && onCancel === void 0) return Yield;
2770
2854
  fiber._stack.push(asyncFinalizer(() => {
2771
2855
  resumed = true;
@@ -2806,7 +2890,9 @@ const gen$1 = (...args) => {
2806
2890
  const [options, body] = args;
2807
2891
  return suspend$1(() => fromIteratorUnsafe(body.call(options.self)));
2808
2892
  };
2809
- const fnUntraced$1 = (body, ...pipeables) => {
2893
+ const fnBody = (bodyOrOptions, pipeables) => typeof bodyOrOptions === "function" ? bodyOrOptions : pipeables.shift().bind(bodyOrOptions.self);
2894
+ const fnUntraced$1 = (bodyOrOptions, ...pipeables) => {
2895
+ const body = fnBody(bodyOrOptions, pipeables);
2810
2896
  const fn = pipeables.length === 0 ? function() {
2811
2897
  return suspend$1(() => fromIteratorUnsafe(body.apply(this, arguments)));
2812
2898
  } : function() {
@@ -2836,9 +2922,18 @@ const fn$1 = function() {
2836
2922
  return makeFn(name, arguments[0], defError, Array.prototype.slice.call(arguments, 1), nameFirst, spanOptions);
2837
2923
  };
2838
2924
  const makeFn = (name, bodyOrOptions, defError, pipeables, addSpan, spanOptions) => {
2839
- const body = typeof bodyOrOptions === "function" ? bodyOrOptions : pipeables.shift().bind(bodyOrOptions.self);
2925
+ const body = fnBody(bodyOrOptions, pipeables);
2840
2926
  const definitionName = `${name} (definition)`;
2841
2927
  const definitionStack = defError ? fnStackCleaner(() => defError.stack) : constUndefined;
2928
+ const makeCallFrame = (callError) => (prev) => ({
2929
+ name,
2930
+ stack: callError ? fnStackCleaner(() => callError.stack) : constUndefined,
2931
+ parent: {
2932
+ name: definitionName,
2933
+ stack: definitionStack,
2934
+ parent: prev
2935
+ }
2936
+ });
2842
2937
  return defineFunctionLength(body.length, function(...args) {
2843
2938
  let result = suspend$1(() => {
2844
2939
  const iter = body.apply(this, arguments);
@@ -2853,31 +2948,26 @@ const makeFn = (name, bodyOrOptions, defError, pipeables, addSpan, spanOptions)
2853
2948
  callError = new globalThis.Error();
2854
2949
  setStackTraceLimit(prevLimit);
2855
2950
  }
2856
- return updateService$1(addSpan ? useSpan$1(name, spanOptions, (span) => provideParentSpan(result, span)) : result, CurrentStackFrame, (prev) => ({
2857
- name,
2858
- stack: callError ? fnStackCleaner(() => callError.stack) : constUndefined,
2859
- parent: {
2860
- name: definitionName,
2861
- stack: definitionStack,
2862
- parent: prev
2863
- }
2864
- }));
2951
+ return updateService$1(addSpan ? useSpan$1(name, spanOptions, (span) => provideParentSpan(result, span)) : result, CurrentStackFrame, makeCallFrame(callError));
2952
+ });
2953
+ };
2954
+ const fnUntracedEager$1 = (bodyOrOptions, ...pipeables) => {
2955
+ const body = fnBody(bodyOrOptions, pipeables);
2956
+ return defineFunctionLength(body.length, pipeables.length === 0 ? function() {
2957
+ return fromIteratorEagerUnsafe(() => body.apply(this, arguments));
2958
+ } : function() {
2959
+ let effect = fromIteratorEagerUnsafe(() => body.apply(this, arguments));
2960
+ for (const pipeable of pipeables) effect = pipeable(effect, ...arguments);
2961
+ return effect;
2865
2962
  });
2866
2963
  };
2867
- const fnUntracedEager$1 = (body, ...pipeables) => defineFunctionLength(body.length, pipeables.length === 0 ? function() {
2868
- return fromIteratorEagerUnsafe(() => body.apply(this, arguments));
2869
- } : function() {
2870
- let effect = fromIteratorEagerUnsafe(() => body.apply(this, arguments));
2871
- for (const pipeable of pipeables) effect = pipeable(effect, ...arguments);
2872
- return effect;
2873
- });
2874
2964
  const fromIteratorEagerUnsafe = (evaluate) => {
2875
2965
  try {
2876
2966
  const iterator = evaluate();
2877
2967
  let value = void 0;
2878
2968
  while (true) {
2879
2969
  const state = iterator.next(value);
2880
- if (state.done) return succeed$3(state.value);
2970
+ if (state.done) return succeed$4(state.value);
2881
2971
  const primitive = state.value;
2882
2972
  if (primitive && primitive._tag === "Success") {
2883
2973
  value = primitive.value;
@@ -2904,7 +2994,7 @@ const fromIteratorUnsafe = function() {
2904
2994
  const iter = this.iterator;
2905
2995
  while (true) {
2906
2996
  const state = iter.next(value);
2907
- if (state.done) return succeed$3(state.value);
2997
+ if (state.done) return succeed$4(state.value);
2908
2998
  if (!effectIsExit(state.value)) {
2909
2999
  fiber._stack.push(this);
2910
3000
  return state.value;
@@ -2925,7 +3015,7 @@ const fromIteratorUnsafe = function() {
2925
3015
  return new IteratorImpl(iterator, initial);
2926
3016
  };
2927
3017
  }();
2928
- const as$1 = dual(2, (self, value) => new ContImpl(self, returnPayload, succeed$3(value)));
3018
+ const as$1 = dual(2, (self, value) => new ContImpl(self, returnPayload, succeed$4(value)));
2929
3019
  const evaluateCont = function(fiber) {
2930
3020
  fiber._stack.push(this);
2931
3021
  return this[args];
@@ -3017,8 +3107,8 @@ const mapBothEager$1 = dual(2, (self, options) => effectIsExit(self) ? exitMapBo
3017
3107
  const catchEager$1 = dual(2, (self, f) => {
3018
3108
  if (effectIsExit(self)) {
3019
3109
  if (self._tag === "Success") return self;
3020
- const error = findError$1(self.cause);
3021
- if (isFailure$1(error)) return self;
3110
+ const error = findRecoverableError(self.cause);
3111
+ if (isFailure$1(error)) return exitFailCause(error.failure);
3022
3112
  return f(error.success);
3023
3113
  }
3024
3114
  return catch_$1(self, f);
@@ -3026,22 +3116,18 @@ const catchEager$1 = dual(2, (self, f) => {
3026
3116
  const exitInterrupt = (fiberId) => exitFailCause(causeInterrupt(fiberId));
3027
3117
  const exitIsSuccess = (self) => self._tag === "Success";
3028
3118
  const exitIsFailure = (self) => self._tag === "Failure";
3029
- const exitFilterCause = (self) => self._tag === "Failure" ? succeed$4(self.cause) : fail$4(self);
3030
- const exitFindError = composePassthrough(exitFilterCause, findError$1);
3119
+ const exitFilterCause = (self) => self._tag === "Failure" ? succeed$5(self.cause) : fail$5(self);
3120
+ const exitFindError = composePassthrough(exitFilterCause, findError);
3031
3121
  const exitHasInterrupts = (self) => self._tag === "Failure" && hasInterrupts$1(self.cause);
3032
3122
  const exitVoid = exitSucceed(void 0);
3033
3123
  const exitMap = dual(2, (self, f) => self._tag === "Success" ? exitSucceed(f(self.value)) : self);
3034
3124
  const exitMapError = dual(2, (self, f) => {
3035
3125
  if (self._tag === "Success") return self;
3036
- const error = findError$1(self.cause);
3037
- if (isFailure$1(error)) return self;
3038
- return exitFail(f(error.success));
3126
+ return exitFailCause(causeMap(self.cause, f));
3039
3127
  });
3040
3128
  const exitMapBoth = dual(2, (self, options) => {
3041
3129
  if (self._tag === "Success") return exitSucceed(options.onSuccess(self.value));
3042
- const error = findError$1(self.cause);
3043
- if (isFailure$1(error)) return self;
3044
- return exitFail(options.onFailure(error.success));
3130
+ return exitFailCause(causeMap(self.cause, options.onFailure));
3045
3131
  });
3046
3132
  const exitZipRight = dual(2, (self, that) => exitIsSuccess(self) ? that : self);
3047
3133
  const exitAsVoidAll = (exits) => {
@@ -3054,7 +3140,7 @@ const exitFindErrorOption = (self) => {
3054
3140
  return isFailure$1(error) ? none() : some(error.success);
3055
3141
  };
3056
3142
  const service$1 = (service) => service;
3057
- const serviceOption$1 = (service) => withFiber$1((fiber) => succeed$3(getOption(fiber.context, service)));
3143
+ const serviceOption$1 = (service) => withFiber$1((fiber) => succeed$4(getOption(fiber.context, service)));
3058
3144
  const updateContext$1 = dual(2, (self, f) => withFiber$1((fiber) => {
3059
3145
  const prevContext = fiber.context;
3060
3146
  const nextContext = f(prevContext);
@@ -3072,7 +3158,7 @@ const updateService$1 = dual(3, (self, service, f) => updateContext$1(self, (s)
3072
3158
  return add(s, service, next);
3073
3159
  }));
3074
3160
  const context$1 = () => getContext;
3075
- const getContext = withFiber$1((fiber) => succeed$3(fiber.context));
3161
+ const getContext = withFiber$1((fiber) => succeed$4(fiber.context));
3076
3162
  const contextWith$1 = (f) => withFiber$1((fiber) => f(fiber.context));
3077
3163
  const provideContext$1 = dual(2, (self, context) => {
3078
3164
  if (effectIsExit(self)) return self;
@@ -3084,7 +3170,7 @@ const provideService$1 = function() {
3084
3170
  };
3085
3171
  const provideServiceImpl = (self, service, implementation) => updateContext$1(self, add(service, implementation));
3086
3172
  const zipWith$1 = dual((args) => isEffect$1(args[1]), (self, that, f, options) => options?.concurrent ? map$2(all$1([self, that], { concurrency: 2 }), ([a, a2]) => f(a, a2)) : flatMap$2(self, (a) => map$2(that, (a2) => f(a, a2))));
3087
- const filterOrFail$1 = dual((args) => isEffect$1(args[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail$3(orFailWith(a)) : () => fail$3(new NoSuchElementError$1())));
3173
+ const filterOrFail$1 = dual((args) => isEffect$1(args[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail$4(orFailWith(a)) : () => fail$4(new NoSuchElementError$1())));
3088
3174
  const when$1 = dual(2, (self, condition) => flatMap$2(condition, (pass) => pass ? asSome$1(self) : succeedNone$1));
3089
3175
  const forever$2 = dual((args) => isEffect$1(args[0]), (self, options) => whileLoop$1({
3090
3176
  while: constTrue,
@@ -3109,21 +3195,27 @@ const catchCauseFilter = dual(3, (self, filter, f) => catchCause$1(self, (cause)
3109
3195
  const eb = filter(cause);
3110
3196
  return isFailure$1(eb) ? failCause$3(eb.failure) : f(eb.success, cause);
3111
3197
  }));
3112
- const catch_$1 = dual(2, (self, f) => catchCauseFilter(self, findError$1, (e) => f(e)));
3198
+ const catch_$1 = dual(2, (self, f) => catchCauseFilter(self, findRecoverableError, (e) => f(e)));
3113
3199
  const catchNoSuchElement$1 = (self) => matchEffect$2(self, {
3114
- onFailure: (error) => isNoSuchElementError(error) ? succeedNone$1 : fail$3(error),
3200
+ onFailure: (error) => isNoSuchElementError(error) ? succeedNone$1 : fail$4(error),
3115
3201
  onSuccess: succeedSome$1
3116
3202
  });
3117
3203
  const catchDefect$1 = dual(2, (self, f) => catchCauseFilter(self, findDefect, f));
3118
3204
  const tapCause$1 = dual(2, (self, f) => catchCause$1(self, (cause) => andThen$1(f(cause), failCause$3(cause))));
3205
+ const tapCauseFilter = dual(3, (self, filter, f) => catchCause$1(self, (cause) => {
3206
+ const result = filter(cause);
3207
+ if (isFailure$1(result)) return failCause$3(cause);
3208
+ return andThen$1(f(result.success, cause), failCause$3(cause));
3209
+ }));
3210
+ const tapError$1 = dual(2, (self, f) => tapCauseFilter(self, findError, (e) => f(e)));
3119
3211
  const catchIf$1 = dual((args) => isEffect$1(args[0]), (self, predicate, f, orElse) => catchCause$1(self, (cause) => {
3120
- const error = findError$1(cause);
3212
+ const error = findRecoverableError(cause);
3121
3213
  if (isFailure$1(error)) return failCause$3(error.failure);
3122
3214
  if (!predicate(error.success)) return orElse ? orElse(error.success) : failCause$3(cause);
3123
3215
  return f(error.success);
3124
3216
  }));
3125
3217
  const catchFilter$1 = dual((args) => isEffect$1(args[0]), (self, filter, f, orElse) => catchCause$1(self, (cause) => {
3126
- const error = findError$1(cause);
3218
+ const error = findRecoverableError(cause);
3127
3219
  if (isFailure$1(error)) return failCause$3(error.failure);
3128
3220
  const result = filter(error.success);
3129
3221
  if (isFailure$1(result)) return orElse ? orElse(result.failure) : failCause$3(cause);
@@ -3137,42 +3229,57 @@ const catchTags$1 = dual((args) => isEffect$1(args[0]), (self, cases, orElse) =>
3137
3229
  let keys;
3138
3230
  return catchFilter$1(self, (e) => {
3139
3231
  keys ??= Object.keys(cases);
3140
- return hasProperty(e, "_tag") && isString(e["_tag"]) && keys.includes(e["_tag"]) ? succeed$4(e) : fail$4(e);
3232
+ return hasProperty(e, "_tag") && isString(e["_tag"]) && keys.includes(e["_tag"]) ? succeed$5(e) : fail$5(e);
3141
3233
  }, (e) => cases[e["_tag"]](e), orElse);
3142
3234
  });
3143
3235
  const catchReason$1 = dual((args) => isEffect$1(args[0]), (self, errorTag, reasonTag, f, orElse) => catchIf$1(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && (orElse !== void 0 || isTagged(e.reason, reasonTag)), (e) => {
3144
3236
  const reason = e.reason;
3145
3237
  if (isTagged(reason, reasonTag)) return f(reason, e);
3146
- return orElse ? orElse(reason, e) : fail$3(e);
3238
+ return orElse ? orElse(reason, e) : fail$4(e);
3147
3239
  }));
3148
- const mapError$1 = dual(2, (self, f) => catch_$1(self, (error) => failSync(() => f(error))));
3149
- const mapBoth = dual(2, (self, options) => matchEffect$2(self, {
3150
- onFailure: (e) => failSync(() => options.onFailure(e)),
3240
+ const mapError$1 = dual(2, (self, f) => catchCause$1(self, (cause) => failCause$3(causeMap(cause, f))));
3241
+ const mapBoth = dual(2, (self, options) => matchCauseEffect$1(self, {
3242
+ onFailure: (cause) => failCause$3(causeMap(cause, options.onFailure)),
3151
3243
  onSuccess: (a) => sync$1(() => options.onSuccess(a))
3152
3244
  }));
3153
3245
  const orDie$2 = (self) => catch_$1(self, die$3);
3154
3246
  const orElseSucceed$1 = dual(2, (self, f) => catch_$1(self, (error) => sync$1(() => f(error))));
3247
+ const ignoreCauseLogger = (log) => log === "Unhandled" ? (...message) => withFiber$1((fiber) => {
3248
+ const level = fiber.getRef(UnhandledLogLevel);
3249
+ return level === void 0 ? void_$2 : logWithLevel(level)(...message);
3250
+ }) : logWithLevel(log === true ? void 0 : log);
3155
3251
  const ignore$1 = dual((args) => isEffect$1(args[0]), (self, options) => {
3156
3252
  if (!options?.log) return matchEffect$2(self, {
3157
3253
  onFailure: (_) => void_$2,
3158
3254
  onSuccess: (_) => void_$2
3159
3255
  });
3160
- const logEffect = logWithLevel(options.log === true ? void 0 : options.log);
3256
+ const logEffect = ignoreCauseLogger(options.log);
3161
3257
  return matchCauseEffect$1(self, {
3162
3258
  onFailure(cause) {
3163
- const failure = findFail(cause);
3164
- return isFailure$1(failure) ? failCause$3(failure.failure) : options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause);
3259
+ const error = findRecoverableError(cause);
3260
+ return isFailure$1(error) ? failCause$3(error.failure) : options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause);
3165
3261
  },
3166
3262
  onSuccess: (_) => void_$2
3167
3263
  });
3168
3264
  });
3265
+ const ignoreCause$1 = dual((args) => isEffect$1(args[0]), (self, options) => {
3266
+ if (!options?.log) return matchCauseEffect$1(self, {
3267
+ onFailure: (_) => void_$2,
3268
+ onSuccess: (_) => void_$2
3269
+ });
3270
+ const logEffect = ignoreCauseLogger(options.log);
3271
+ return matchCauseEffect$1(self, {
3272
+ onFailure: (cause) => options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause),
3273
+ onSuccess: (_) => void_$2
3274
+ });
3275
+ });
3169
3276
  const option$1 = (self) => match$1(self, {
3170
3277
  onFailure: none,
3171
3278
  onSuccess: some
3172
3279
  });
3173
3280
  const result$1 = (self) => matchEager(self, {
3174
- onFailure: fail$4,
3175
- onSuccess: succeed$4
3281
+ onFailure: fail$5,
3282
+ onSuccess: succeed$5
3176
3283
  });
3177
3284
  const matchCauseEffect$1 = dual(2, (self, options) => new OnSuccessAndFailureImpl(self, options.onSuccess.length !== 1 ? (a) => options.onSuccess(a) : options.onSuccess, options.onFailure.length !== 1 ? (cause) => options.onFailure(cause) : options.onFailure));
3178
3285
  const OnSuccessAndFailureProto = makePrimitiveProto({
@@ -3204,10 +3311,10 @@ const makeMatch = (op, onFailure) => {
3204
3311
  return MatchImpl;
3205
3312
  };
3206
3313
  const MatchImpl = makeMatch("Match", function(cause, fiber) {
3207
- const fail = cause.reasons.find(isFailReason$1);
3208
- if (fail === void 0) return failCause$3(cause);
3314
+ const error = findRecoverableError(cause);
3315
+ if (isFailure$1(error)) return failCause$3(error.failure);
3209
3316
  const handlers = this.payload;
3210
- return fiber.succeedWith(continuationMarksStack ? handlers.onFailure(fail.error) : internalCall(() => handlers.onFailure(fail.error)));
3317
+ return fiber.succeedWith(continuationMarksStack ? handlers.onFailure(error.success) : internalCall(() => handlers.onFailure(error.success)));
3211
3318
  });
3212
3319
  const MatchCauseImpl = makeMatch("MatchCause", function(cause, fiber) {
3213
3320
  const handlers = this.payload;
@@ -3216,8 +3323,8 @@ const MatchCauseImpl = makeMatch("MatchCause", function(cause, fiber) {
3216
3323
  const matchCause = dual(2, (self, options) => new MatchCauseImpl(self, options));
3217
3324
  const matchEffect$2 = dual(2, (self, options) => matchCauseEffect$1(self, {
3218
3325
  onFailure: (cause) => {
3219
- const fail = cause.reasons.find(isFailReason$1);
3220
- return fail ? options.onFailure(fail.error) : failCause$3(cause);
3326
+ const error = findRecoverableError(cause);
3327
+ return isFailure$1(error) ? failCause$3(error.failure) : options.onFailure(error.success);
3221
3328
  },
3222
3329
  onSuccess: options.onSuccess
3223
3330
  }));
@@ -3225,8 +3332,8 @@ const match$1 = dual(2, (self, options) => new MatchImpl(self, options));
3225
3332
  const matchEager = dual(2, (self, options) => {
3226
3333
  if (effectIsExit(self)) {
3227
3334
  if (self._tag === "Success") return exitSucceed(options.onSuccess(self.value));
3228
- const error = findError$1(self.cause);
3229
- if (isFailure$1(error)) return self;
3335
+ const error = findRecoverableError(self.cause);
3336
+ if (isFailure$1(error)) return exitFailCause(error.failure);
3230
3337
  return exitSucceed(options.onFailure(error.success));
3231
3338
  }
3232
3339
  return match$1(self, options);
@@ -3253,13 +3360,13 @@ const exitPrimitive = makePrimitive({
3253
3360
  }
3254
3361
  });
3255
3362
  const delay$1 = dual(2, (self, duration) => andThen$1(sleep$1(duration), self));
3256
- const timeoutOrElse$1 = dual(2, (self, options) => flatMap$2(timeoutOption$1(self, options.duration), (option) => isNone(option) ? options.orElse() : succeed$3(option.value)));
3363
+ const timeoutOrElse$1 = dual(2, (self, options) => flatMap$2(timeoutOption$1(self, options.duration), (option) => isNone(option) ? options.orElse() : succeed$4(option.value)));
3257
3364
  const timeoutErrorFromDuration = (duration) => new TimeoutError$1(`Operation timed out after '${format(duration)}'`);
3258
3365
  const timeout$1 = dual(2, (self, duration) => {
3259
3366
  const decoded = fromInputUnsafe(duration);
3260
3367
  return timeoutOrElse$1(self, {
3261
3368
  duration: decoded,
3262
- orElse: () => fail$3(timeoutErrorFromDuration(decoded))
3369
+ orElse: () => fail$4(timeoutErrorFromDuration(decoded))
3263
3370
  });
3264
3371
  });
3265
3372
  const timeoutOption$1 = dual(2, (self, duration) => raceFirst$1(asSome$1(self), as$1(sleep$1(duration), none())));
@@ -3291,16 +3398,16 @@ const runFinalizer = (finalizer, exit_) => {
3291
3398
  return exitDie(defect);
3292
3399
  }
3293
3400
  };
3294
- const combineFinalizerCause = (exit_, finalizer) => exitIsSuccess(exit_) ? finalizer : catchCause$1(finalizer, (cause) => failCause$3(causeCombine(exit_.cause, cause)));
3401
+ const combineFinalizerCause = (exit_, finalizer) => exitIsSuccess(exit_) ? finalizer : catchCause$1(finalizer, (cause) => failCause$3(causeElectDefects(causeCombine(exit_.cause, cause))));
3295
3402
  const scopeCloseFinalizers = fnUntraced$1(function* (self, finalizers, exit_) {
3296
3403
  let exits = [];
3297
3404
  const fibers = [];
3298
- const arr = Array.from(finalizers.values());
3405
+ const arr = Array.from(finalizers);
3299
3406
  const parent = getCurrentFiber();
3300
3407
  for (let i = arr.length - 1; i >= 0; i--) {
3301
- const finalizer = arr[i];
3408
+ const [key, finalizer] = arr[i];
3302
3409
  if (self.strategy === "sequential") exits.push(yield* exit$1(runFinalizer(finalizer, exit_)));
3303
- else fibers.push(forkUnsafe$1(parent, runFinalizer(finalizer, exit_), true, true, "inherit"));
3410
+ else if (key !== parent) fibers.push(forkUnsafe$1(parent, runFinalizer(finalizer, exit_), true, true, "inherit"));
3304
3411
  }
3305
3412
  if (fibers.length > 0) exits = yield* fiberAwaitAll(fibers);
3306
3413
  return yield* exitAsVoidAll(exits);
@@ -3446,8 +3553,8 @@ const makeCachedUnsafe = (self, ttlMillis) => {
3446
3553
  const join = (fiber, run) => {
3447
3554
  run.awaiters++;
3448
3555
  onExitUnsafe(fiber, () => {
3449
- if (--run.awaiters > 0 || current !== run) return;
3450
- current = void 0;
3556
+ if (--run.awaiters > 0 || run.done) return;
3557
+ if (current === run) current = void 0;
3451
3558
  return fiberInterrupt(run.fiber);
3452
3559
  });
3453
3560
  return fiberJoin(run.fiber);
@@ -3459,11 +3566,13 @@ const makeCachedUnsafe = (self, ttlMillis) => {
3459
3566
  const clock = fiber.getRef(ClockRef);
3460
3567
  const run = {
3461
3568
  fiber: new FiberImpl(fiber.context),
3462
- awaiters: 0
3569
+ awaiters: 0,
3570
+ done: false
3463
3571
  };
3464
3572
  current = run;
3465
3573
  const joined = join(fiber, run);
3466
3574
  run.fiber.evaluate(onExitPrimitive$1(self, (exit_) => {
3575
+ run.done = true;
3467
3576
  if (current !== run) return;
3468
3577
  current = void 0;
3469
3578
  if (exitHasInterrupts(exit_)) return;
@@ -3473,6 +3582,7 @@ const makeCachedUnsafe = (self, ttlMillis) => {
3473
3582
  }));
3474
3583
  return run.fiber._exit ?? joined;
3475
3584
  }), sync$1(() => {
3585
+ current = void 0;
3476
3586
  exit = void 0;
3477
3587
  })];
3478
3588
  };
@@ -3518,15 +3628,7 @@ const uninterruptibleMask$1 = (f) => withFiber$1((fiber) => {
3518
3628
  const all$1 = (arg, options) => {
3519
3629
  if (isIterable(arg)) return options?.mode === "result" ? forEach$2(arg, result$1, options) : forEach$2(arg, identity, options);
3520
3630
  else if (options?.discard) return options.mode === "result" ? forEach$2(Object.values(arg), result$1, options) : forEach$2(Object.values(arg), identity, options);
3521
- return suspend$1(() => {
3522
- const out = {};
3523
- return as$1(forEach$2(Object.entries(arg), ([key, effect]) => map$2(options?.mode === "result" ? result$1(effect) : effect, (value) => {
3524
- assignProperty(out, key, value);
3525
- }), {
3526
- discard: true,
3527
- concurrency: options?.concurrency
3528
- }), out);
3529
- });
3631
+ return suspend$1(() => map$2(forEach$2(Object.entries(arg), ([key, effect]) => map$2(options?.mode === "result" ? result$1(effect) : effect, (value) => [key, value]), { concurrency: options?.concurrency }), Object.fromEntries));
3530
3632
  };
3531
3633
  const whileLoop$1 = makePrimitive({
3532
3634
  op: "While",
@@ -3551,13 +3653,13 @@ const forEach$2 = dual((args) => typeof args[1] === "function", (iterable, f, op
3551
3653
  if (concurrency === 1) return forEachSequential(iterable, f, options);
3552
3654
  const items = fromIterable$1(iterable);
3553
3655
  let length = items.length;
3554
- if (length === 0) return options?.discard ? void_$2 : succeed$3([]);
3656
+ if (length === 0) return options?.discard ? void_$2 : succeed$4([]);
3555
3657
  const out = options?.discard ? void 0 : new Array(length);
3556
3658
  const eff = forEachConcurrent({
3557
3659
  f,
3558
3660
  out
3559
3661
  }, items, { concurrency });
3560
- return eff ? as$1(eff, out) : succeed$3(out);
3662
+ return eff ? as$1(eff, out) : succeed$4(out);
3561
3663
  }));
3562
3664
  const forEachSequential = (iterable, f, options) => suspend$1(() => {
3563
3665
  const out = options?.discard ? void 0 : [];
@@ -3651,7 +3753,7 @@ const iterateConcurrentImpl = (options) => {
3651
3753
  const reasons = exit.cause.reasons.filter((reason) => reason._tag !== "Interrupt");
3652
3754
  if (reasons.length > 0) {
3653
3755
  const cause = causeFromReasons(reasons);
3654
- terminal = exitFailCause(terminal._tag === "Failure" ? causeCombine(terminal.cause, cause) : cause);
3756
+ terminal = exitFailCause(terminal._tag === "Failure" ? causeElectDefects(causeCombine(terminal.cause, cause)) : cause);
3655
3757
  }
3656
3758
  }
3657
3759
  } else {
@@ -3701,10 +3803,10 @@ const forEachConcurrent = iterateConcurrentImpl({
3701
3803
  else if (state.out) state.out[index] = exit.value;
3702
3804
  }
3703
3805
  });
3704
- const filterOrElse = dual(3, (self, predicate, orElse) => flatMap$2(self, (a) => predicate(a) ? succeed$3(a) : orElse(a)));
3806
+ const filterOrElse = dual(3, (self, predicate, orElse) => flatMap$2(self, (a) => predicate(a) ? succeed$4(a) : orElse(a)));
3705
3807
  const forkChild$1 = dual((args) => isEffect$1(args[0]), (self, options) => withFiber$1((fiber) => {
3706
3808
  interruptChildrenPatch();
3707
- return succeed$3(forkUnsafe$1(fiber, self, options?.startImmediately, false, options?.uninterruptible ?? false));
3809
+ return succeed$4(forkUnsafe$1(fiber, self, options?.startImmediately, false, options?.uninterruptible ?? false));
3708
3810
  }));
3709
3811
  const forkUnsafe$1 = (parent, effect, immediate = false, daemon = false, uninterruptible = false) => {
3710
3812
  const parentRuntime = parent;
@@ -3721,17 +3823,17 @@ const forkUnsafe$1 = (parent, effect, immediate = false, daemon = false, uninter
3721
3823
  }
3722
3824
  return child;
3723
3825
  };
3826
+ const forkDetach$1 = dual((args) => isEffect$1(args[0]), (self, options) => withFiber$1((fiber) => succeed$4(forkUnsafe$1(fiber, self, options?.startImmediately, true, options?.uninterruptible))));
3827
+ const fiberScopeFinalizer = (fiber) => () => withFiber$1((current) => current === fiber ? void_$2 : fiberInterrupt(fiber));
3724
3828
  const forkIn$1 = dual((args) => isEffect$1(args[0]), (self, scope, options) => withFiber$1((parent) => {
3725
- const fiber = forkUnsafe$1(parent, self, options?.startImmediately, true, options?.uninterruptible);
3829
+ const fiber = scope.state._tag === "Closed" ? new FiberImpl(parent.context) : forkUnsafe$1(parent, self, options?.startImmediately, true, options?.uninterruptible);
3726
3830
  if (!fiber._exit) {
3727
3831
  if (scope.state._tag !== "Closed") {
3728
- const key = {};
3729
- const finalizer = () => withFiberId((interruptor) => interruptor === fiber.id ? void_$2 : fiberInterrupt(fiber));
3730
- scopeAddFinalizerUnsafe(scope, key, finalizer);
3731
- fiber.addObserver(() => scopeRemoveFinalizerUnsafe(scope, key));
3832
+ scopeAddFinalizerUnsafe(scope, fiber, fiberScopeFinalizer(fiber));
3833
+ fiber.addObserver(() => scopeRemoveFinalizerUnsafe(scope, fiber));
3732
3834
  } else fiber.interruptUnsafe(parent.id, fiberStackAnnotations(parent));
3733
3835
  }
3734
- return succeed$3(fiber);
3836
+ return succeed$4(fiber);
3735
3837
  }));
3736
3838
  const forkScoped$1 = dual((args) => isEffect$1(args[0]), (self, options) => flatMap$2(scope$1, (scope) => forkIn$1(self, scope, options)));
3737
3839
  const runForkWith$1 = (context) => (effect, options) => {
@@ -3756,11 +3858,27 @@ const fiberRunIn = dual(2, (self, scope) => {
3756
3858
  return self;
3757
3859
  }
3758
3860
  scopeRemoveFinalizerUnsafe(scope, self);
3759
- scopeAddFinalizerUnsafe(scope, self, () => fiberInterrupt(self));
3861
+ scopeAddFinalizerUnsafe(scope, self, fiberScopeFinalizer(self));
3760
3862
  self.addObserver(() => scopeRemoveFinalizerUnsafe(scope, self));
3761
3863
  return self;
3762
3864
  });
3763
3865
  const runFork$1 = runForkWith$1(empty$4());
3866
+ const runPromiseExitWith = (context) => {
3867
+ const runFork = runForkWith$1(context);
3868
+ return (effect, options) => {
3869
+ const fiber = runFork(effect, options);
3870
+ return new Promise((resolve) => {
3871
+ fiber.addObserver((exit) => resolve(exit));
3872
+ });
3873
+ };
3874
+ };
3875
+ const runPromiseWith$1 = (context) => {
3876
+ const runPromiseExit = runPromiseExitWith(context);
3877
+ return (effect, options) => runPromiseExit(effect, options).then((exit) => {
3878
+ if (exit._tag === "Failure") throw causeSquash(exit.cause);
3879
+ return exit.value;
3880
+ });
3881
+ };
3764
3882
  const runSyncExitWith = (context) => {
3765
3883
  const runFork = runForkWith$1(context);
3766
3884
  return (effect) => {
@@ -3781,8 +3899,8 @@ const runSyncWith = (context) => {
3781
3899
  };
3782
3900
  };
3783
3901
  const runSync$1 = runSyncWith(empty$4());
3784
- const succeedTrue = succeed$3(true);
3785
- const succeedFalse = succeed$3(false);
3902
+ const succeedTrue = succeed$4(true);
3903
+ const succeedFalse = succeed$4(false);
3786
3904
  var Latch = class {
3787
3905
  waiters = [];
3788
3906
  scheduled = void 0;
@@ -3962,7 +4080,7 @@ const withSpan$1 = function() {
3962
4080
  };
3963
4081
  const annotateCurrentSpan$1 = (...args) => withFiber$1((fiber) => {
3964
4082
  const span = fiber.currentSpanLocal;
3965
- if (span) {
4083
+ if (span && span.status._tag !== "Ended") {
3966
4084
  if (args.length === 1) for (const [key, value] of Object.entries(args[0])) span.attribute(key, value);
3967
4085
  else span.attribute(args[0], args[1]);
3968
4086
  }
@@ -4022,10 +4140,10 @@ const wallTimeNanos = function() {
4022
4140
  return origin + monotonic;
4023
4141
  };
4024
4142
  }();
4025
- const clockWith$1 = (f) => withFiber$1((fiber) => f(fiber.getRef(ClockRef)));
4026
- const sleep$1 = (duration) => clockWith$1((clock) => clock.sleep(fromInputUnsafe(duration)));
4027
- const currentTimeMillis = clockWith$1((clock) => clock.currentTimeMillis);
4028
- const monotonicTimeNanos = clockWith$1((clock) => clock.monotonicTimeNanos);
4143
+ const clockWith = (f) => withFiber$1((fiber) => f(fiber.getRef(ClockRef)));
4144
+ const sleep$1 = (duration) => clockWith((clock) => clock.sleep(fromInputUnsafe(duration)));
4145
+ const currentTimeMillis = clockWith((clock) => clock.currentTimeMillis);
4146
+ const monotonicTimeNanos = clockWith((clock) => clock.monotonicTimeNanos);
4029
4147
  const TimeoutErrorTypeId = "~effect/Cause/TimeoutError";
4030
4148
  const isTimeoutError$1 = (u) => hasProperty(u, TimeoutErrorTypeId);
4031
4149
  var TimeoutError$1 = class extends TaggedError("TimeoutError") {
@@ -4166,7 +4284,7 @@ const tracerLogger = loggerMake(({ cause, fiber, logLevel, message }) => {
4166
4284
  const clock = fiber.getRef(ClockRef);
4167
4285
  const annotations = fiber.getRef(CurrentLogAnnotations$1);
4168
4286
  const span = fiber.cache.span;
4169
- if (span === void 0 || span._tag === "ExternalSpan") return;
4287
+ if (span === void 0 || span._tag === "ExternalSpan" || span.status._tag === "Ended") return;
4170
4288
  const attributes = {};
4171
4289
  for (const [key, value] of Object.entries(annotations)) assignProperty(attributes, key, value);
4172
4290
  attributes["effect.fiberId"] = fiber.id;
@@ -4177,13 +4295,12 @@ const tracerLogger = loggerMake(({ cause, fiber, logLevel, message }) => {
4177
4295
  function interruptChildrenPatch() {
4178
4296
  fiberMiddleware.interruptChildren ??= fiberInterruptChildren;
4179
4297
  }
4180
- const undefined_$1 = succeed$3(void 0);
4181
- //#endregion
4182
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Exit.js
4298
+ const undefined_$1 = succeed$4(void 0);
4299
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Exit.js
4183
4300
  const isExit = isExit$1;
4184
- const succeed$2 = exitSucceed;
4301
+ const succeed$3 = exitSucceed;
4185
4302
  const failCause$2 = exitFailCause;
4186
- const fail$2 = exitFail;
4303
+ const fail$3 = exitFail;
4187
4304
  const die$2 = exitDie;
4188
4305
  const interrupt$1 = exitInterrupt;
4189
4306
  const void_$1 = exitVoid;
@@ -4191,8 +4308,7 @@ const isSuccess = exitIsSuccess;
4191
4308
  const isFailure = exitIsFailure;
4192
4309
  const asVoidAll = exitAsVoidAll;
4193
4310
  const findErrorOption$1 = exitFindErrorOption;
4194
- //#endregion
4195
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Deferred.js
4311
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Deferred.js
4196
4312
  const TypeId$4 = "~effect/Deferred";
4197
4313
  const DeferredProto = {
4198
4314
  [TypeId$4]: {
@@ -4223,10 +4339,12 @@ const _await = (self) => callback$1((resume) => {
4223
4339
  });
4224
4340
  const completeWith = dual(2, (self, effect) => sync$1(() => doneUnsafe(self, effect)));
4225
4341
  const done$1 = completeWith;
4342
+ const fail$2 = dual(2, (self, error) => done$1(self, exitFail(error)));
4226
4343
  const failCause$1 = dual(2, (self, cause) => done$1(self, exitFailCause(cause)));
4227
4344
  const interruptWith = dual(2, (self, fiberId) => failCause$1(self, causeInterrupt(fiberId)));
4228
4345
  const isDone$1 = (self) => sync$1(() => isDoneUnsafe(self));
4229
4346
  const isDoneUnsafe = (self) => self.effect !== void 0;
4347
+ const succeed$2 = dual(2, (self, value) => done$1(self, exitSucceed(value)));
4230
4348
  const doneUnsafe = (self, effect) => {
4231
4349
  if (self.effect) return false;
4232
4350
  self.effect = effect;
@@ -4238,14 +4356,12 @@ const doneUnsafe = (self, effect) => {
4238
4356
  return true;
4239
4357
  };
4240
4358
  const into = dual(2, (self, deferred) => uninterruptibleMask$1((restore) => flatMap$2(exit$1(restore(self)), (exit) => done$1(deferred, exit))));
4241
- //#endregion
4242
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/References.js
4359
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/References.js
4243
4360
  const CurrentLogAnnotations = CurrentLogAnnotations$1;
4244
4361
  const CurrentLogSpans = CurrentLogSpans$1;
4245
4362
  const MinimumLogLevel = MinimumLogLevel$1;
4246
4363
  const TracerTimingEnabled = TracerTimingEnabled$1;
4247
- //#endregion
4248
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Scope.js
4364
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Scope.js
4249
4365
  const Scope = scopeTag;
4250
4366
  const make$1 = scopeMake;
4251
4367
  const makeUnsafe = scopeMakeUnsafe;
@@ -4255,8 +4371,7 @@ const addFinalizer$1 = scopeAddFinalizer;
4255
4371
  const fork = scopeFork;
4256
4372
  const forkUnsafe = scopeForkUnsafe;
4257
4373
  const close = scopeClose;
4258
- //#endregion
4259
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Layer.js
4374
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Layer.js
4260
4375
  const TypeId$3 = "~effect/Layer";
4261
4376
  const MemoMapTypeId = "~effect/Layer/MemoMap";
4262
4377
  const makeMemoMapEntry = (memoMap, layer) => {
@@ -4350,7 +4465,7 @@ const succeed$1 = function() {
4350
4465
  if (arguments.length === 1) return (resource) => succeedContext(make$5(arguments[0], resource));
4351
4466
  return succeedContext(make$5(arguments[0], arguments[1]));
4352
4467
  };
4353
- const succeedContext = (context) => fromBuildUnsafe(constant(succeed$3(context)));
4468
+ const succeedContext = (context) => fromBuildUnsafe(constant(succeed$4(context)));
4354
4469
  const empty$1 = succeedContext(empty$4());
4355
4470
  const effect = function() {
4356
4471
  if (arguments.length === 1) return (effect) => effectImpl(arguments[0], effect);
@@ -4365,9 +4480,9 @@ const mergeAllEffect = (layers, memoMap, scope) => {
4365
4480
  const parentScope = forkUnsafe(scope, "parallel");
4366
4481
  return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$2((context) => mergeAll$1(...context)));
4367
4482
  };
4368
- const mergeAll = (...layers) => fromBuild((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
4483
+ const mergeAll = (...layers) => fromBuildMemo((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
4369
4484
  const merge = dual(2, (self, that) => mergeAll(self, ...Array.isArray(that) ? that : [that]));
4370
- const provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap$2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$2((merged) => f(merged, context)))));
4485
+ const provideWith = (self, that, f) => fromBuildMemo((memoMap, scope) => flatMap$2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$2((merged) => f(merged, context)))));
4371
4486
  const provide$2 = dual(2, (self, that) => provideWith(self, that, identity));
4372
4487
  const provideMerge = dual(2, (self, that) => provideWith(self, that, (self, that) => merge$1(that, self)));
4373
4488
  const flatMap$1 = dual(2, (self, f) => fromBuild((memoMap, scope) => flatMap$2(self.build(memoMap, scope), (context) => f(context).build(memoMap, scope))));
@@ -4394,13 +4509,13 @@ const makeUnimplemented = (error) => {
4394
4509
  [StreamTypeId]: StreamTypeId,
4395
4510
  channel: {
4396
4511
  [ChannelTypeId]: ChannelTypeId,
4397
- transform: () => succeed$3(dead),
4512
+ transform: () => succeed$4(dead),
4398
4513
  pipe() {
4399
4514
  return pipeArguments(this, arguments);
4400
4515
  }
4401
4516
  },
4402
4517
  [ChannelTypeId]: ChannelTypeId,
4403
- transform: () => succeed$3(dead)
4518
+ transform: () => succeed$4(dead)
4404
4519
  });
4405
4520
  function unimplemented() {
4406
4521
  return dead;
@@ -4411,8 +4526,7 @@ const makeUnimplemented = (error) => {
4411
4526
  };
4412
4527
  const StreamTypeId = "~effect/Stream";
4413
4528
  const ChannelTypeId = "~effect/Channel";
4414
- //#endregion
4415
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Cause.js
4529
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Cause.js
4416
4530
  const isCause = isCause$1;
4417
4531
  const isReason = isCauseReason;
4418
4532
  const isFailReason = isFailReason$1;
@@ -4427,7 +4541,6 @@ const hasInterruptsOnly = hasInterruptsOnly$1;
4427
4541
  const map$1 = causeMap;
4428
4542
  const combine = causeCombine;
4429
4543
  const squash = causeSquash;
4430
- const findError = findError$1;
4431
4544
  const findErrorOption = findErrorOption$2;
4432
4545
  const hasInterrupts = hasInterrupts$1;
4433
4546
  const interruptors = causeInterruptors;
@@ -4444,8 +4557,7 @@ const UnknownError = UnknownError$1;
4444
4557
  const annotate = causeAnnotate;
4445
4558
  const reasonAnnotations = reasonAnnotations$1;
4446
4559
  var StackTrace = class extends Service()("effect/Cause/StackTrace") {};
4447
- //#endregion
4448
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Number.js
4560
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Number.js
4449
4561
  const Number$1 = globalThis.Number;
4450
4562
  const remainder = dual(2, (self, divisor) => {
4451
4563
  if (!globalThis.Number.isFinite(self) || !globalThis.Number.isFinite(divisor) || divisor === 0) return NaN;
@@ -4466,8 +4578,8 @@ function toScientificInteger(n) {
4466
4578
  return [BigInt(digits) * (n < 0 ? -BigInt(1) : BigInt(1)), globalThis.Number(scientific.slice(eIndex + 1)) - digits.length + 1];
4467
4579
  }
4468
4580
  const nextPow2 = (n) => {
4469
- const nextPow = Math.ceil(Math.log(n) / Math.log(2));
4470
- return Math.max(Math.pow(2, nextPow), 2);
4581
+ const nextPow = Math.pow(2, Math.ceil(Math.log2(n)));
4582
+ return Math.max(nextPow < n ? nextPow * 2 : nextPow, 2);
4471
4583
  };
4472
4584
  const parse = (s) => {
4473
4585
  if (s === "NaN") return some(NaN);
@@ -4481,8 +4593,7 @@ const round = dual(2, (self, precision) => {
4481
4593
  const factor = Math.pow(10, precision);
4482
4594
  return Math.round(self * factor) / factor;
4483
4595
  });
4484
- //#endregion
4485
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/random.js
4596
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/random.js
4486
4597
  const Random = Reference("effect/Random", { defaultValue: () => ({
4487
4598
  nextIntUnsafe() {
4488
4599
  return Math.floor(Math.random() * (Number.MAX_SAFE_INTEGER - Number.MIN_SAFE_INTEGER + 1)) + Number.MIN_SAFE_INTEGER;
@@ -4491,18 +4602,7 @@ const Random = Reference("effect/Random", { defaultValue: () => ({
4491
4602
  return Math.random();
4492
4603
  }
4493
4604
  }) });
4494
- const nextBetween = (min, max, draw) => {
4495
- const value = draw * (max - min) + min;
4496
- if (value !== max || min >= max || !Number.isFinite(max)) return value;
4497
- if (max === 0) return -Number.MIN_VALUE;
4498
- const view = new DataView(new ArrayBuffer(8));
4499
- view.setFloat64(0, max);
4500
- const bits = view.getBigUint64(0);
4501
- view.setBigUint64(0, max > 0 ? bits - BigInt(1) : bits + BigInt(1));
4502
- return view.getFloat64(0);
4503
- };
4504
- //#endregion
4505
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Pull.js
4605
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Pull.js
4506
4606
  const catchDone = dual(2, (effect, f) => catchCauseFilter(effect, filterDoneLeftover, (l) => f(l)));
4507
4607
  const isDoneCause = (cause) => cause.reasons.some(isDoneFailure);
4508
4608
  const isDoneFailure = (failure) => failure._tag === "Fail" && isDone(failure.error);
@@ -4511,16 +4611,16 @@ const filterDone = (cause) => {
4511
4611
  let hasFailure = false;
4512
4612
  for (const reason of cause.reasons) if (isDoneFailure(reason)) done ??= reason.error;
4513
4613
  else if (reason._tag !== "Interrupt") hasFailure = true;
4514
- if (done === void 0) return fail$4(cause);
4515
- return hasFailure ? fail$4(fromReasons(cause.reasons.filter((reason) => !isDoneFailure(reason)))) : succeed$4(done);
4614
+ if (done === void 0) return fail$5(cause);
4615
+ return hasFailure ? fail$5(fromReasons(cause.reasons.filter((reason) => !isDoneFailure(reason)))) : succeed$5(done);
4516
4616
  };
4517
4617
  const filterDoneLeftover = (cause) => {
4518
4618
  const done = filterDone(cause);
4519
- return isFailure$1(done) ? done : succeed$4(done.success.value);
4619
+ return isFailure$1(done) ? done : succeed$5(done.success.value);
4520
4620
  };
4521
4621
  const doneExitFromCause = (cause) => {
4522
4622
  const halt = filterDone(cause);
4523
- return !isFailure$1(halt) ? succeed$2(halt.success.value) : failCause$2(halt.failure);
4623
+ return !isFailure$1(halt) ? succeed$3(halt.success.value) : failCause$2(halt.failure);
4524
4624
  };
4525
4625
  const matchEffect$1 = dual(2, (self, options) => matchCauseEffect$1(self, {
4526
4626
  onSuccess: options.onSuccess,
@@ -4529,8 +4629,7 @@ const matchEffect$1 = dual(2, (self, options) => matchCauseEffect$1(self, {
4529
4629
  return !isFailure$1(halt) ? options.onDone(halt.success.value) : options.onFailure(halt.failure);
4530
4630
  }
4531
4631
  }));
4532
- //#endregion
4533
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Schedule.js
4632
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Schedule.js
4534
4633
  const TypeId$2 = "~effect/Schedule";
4535
4634
  const randomNext = Random.useSync((random) => random.nextDoubleUnsafe());
4536
4635
  const CurrentMetadata = Reference("effect/Schedule/CurrentMetadata", { defaultValue: constant({
@@ -4582,8 +4681,8 @@ const fromStepWithMetadata = (step) => fromStep(map$2(step, (f) => {
4582
4681
  const meta = metadataFn();
4583
4682
  return (now, input) => f(meta(now, input));
4584
4683
  }));
4585
- const toStep = (schedule) => catchCause$1(schedule.step, (cause) => succeed$3(() => failCause$3(cause)));
4586
- const toStepWithMetadata = (schedule) => clockWith$1((clock) => map$2(toStep(schedule), (step) => {
4684
+ const toStep = (schedule) => catchCause$1(schedule.step, (cause) => succeed$4(() => failCause$3(cause)));
4685
+ const toStepWithMetadata = (schedule) => clockWith((clock) => map$2(toStep(schedule), (step) => {
4587
4686
  const metaFn = metadataFn();
4588
4687
  return (input) => suspend$1(() => {
4589
4688
  const now = clock.currentTimeMillisUnsafe();
@@ -4596,13 +4695,13 @@ const toStepWithMetadata = (schedule) => clockWith$1((clock) => map$2(toStep(sch
4596
4695
  });
4597
4696
  }));
4598
4697
  const min = (schedules) => fromStep(map$2(all$1(schedules.map(toStep)), (steps) => (now, input) => flatMap$2(forEach$2(steps, (step) => matchEffect$1(step(now, input), {
4599
- onSuccess: (result) => succeed$3(result[1]),
4698
+ onSuccess: (result) => succeed$4(result[1]),
4600
4699
  onDone: () => undefined_$1,
4601
4700
  onFailure: failCause$3
4602
4701
  })), (results) => {
4603
4702
  const duration = minDuration(results);
4604
4703
  if (duration === void 0) return done(zero);
4605
- return succeed$3([duration, duration]);
4704
+ return succeed$4([duration, duration]);
4606
4705
  })));
4607
4706
  const minDuration = (results) => {
4608
4707
  let min = void 0;
@@ -4614,9 +4713,9 @@ const minDuration = (results) => {
4614
4713
  };
4615
4714
  const exponential = (base, factor = 2) => {
4616
4715
  const baseMillis = toMillis(fromInputUnsafe(base));
4617
- return fromStepWithMetadata(succeed$3((meta) => {
4716
+ return fromStepWithMetadata(succeed$4((meta) => {
4618
4717
  const duration = millis(baseMillis * Math.pow(factor, meta.attempt - 1));
4619
- return succeed$3([duration, duration]);
4718
+ return succeed$4([duration, duration]);
4620
4719
  }));
4621
4720
  };
4622
4721
  const modifyDelay = dual(2, (self, f) => fromStep(map$2(toStep(self), (step) => {
@@ -4632,13 +4731,13 @@ const jittered = (self) => modifyDelay(self, ({ duration }) => map$2(randomNext,
4632
4731
  return millis(millis$1 * .8 * (1 - random) + millis$1 * 1.2 * random);
4633
4732
  }));
4634
4733
  const passthrough = (self) => fromStep(map$2(toStep(self), (step) => (now, input) => matchEffect$1(step(now, input), {
4635
- onSuccess: (result) => succeed$3([input, result[1]]),
4734
+ onSuccess: (result) => succeed$4([input, result[1]]),
4636
4735
  onFailure: failCause$3,
4637
4736
  onDone: () => done(input)
4638
4737
  })));
4639
4738
  const spaced = (duration) => {
4640
4739
  const decoded = fromInputUnsafe(duration);
4641
- return fromStepWithMetadata(succeed$3((meta) => succeed$3([meta.attempt - 1, decoded])));
4740
+ return fromStepWithMetadata(succeed$4((meta) => succeed$4([meta.attempt - 1, decoded])));
4642
4741
  };
4643
4742
  const while_ = dual(2, (self, predicate) => fromStep(map$2(toStep(self), (step) => {
4644
4743
  const meta = metadataFn();
@@ -4649,27 +4748,30 @@ const while_ = dual(2, (self, predicate) => fromStep(map$2(toStep(self), (step)
4649
4748
  output,
4650
4749
  duration
4651
4750
  });
4652
- return flatMap$2(isEffect$1(eff) ? eff : succeed$3(eff), (check) => check ? succeed$3(result) : done(output));
4751
+ return flatMap$2(isEffect$1(eff) ? eff : succeed$4(eff), (check) => check ? succeed$4(result) : done(output));
4653
4752
  });
4654
4753
  })));
4655
4754
  const forever$1 = spaced(zero);
4656
- //#endregion
4657
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/layer.js
4755
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/layer.js
4658
4756
  const provideLayer = (self, layer, options) => scopedWith$1((scope) => flatMap$2(options?.local ? buildWithMemoMap(layer, makeMemoMapUnsafe(), scope) : buildWithScope(layer, scope), (context) => provideContext$1(self, context)));
4659
4757
  const provide$1 = dual((args) => isEffect$1(args[0]), (self, source, options) => isContext(source) ? provideContext$1(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll(...source) : source, options));
4660
- //#endregion
4661
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schedule.js
4662
- const findErrorOnly = (cause) => cause.reasons.every(isFailReason$1) ? findError$1(cause) : fail$4(cause);
4758
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schedule.js
4663
4759
  const repeatOrElse = dual(3, (self, schedule, orElse) => flatMap$2(toStepWithMetadata(schedule), (step) => {
4664
4760
  let meta = CurrentMetadata.defaultValue();
4665
- return catchCauseFilter(catchDone(forever$2(tap$1(flatMap$2(suspend$1(() => provideService$1(self, CurrentMetadata, meta)), step), (meta_) => sync$1(() => {
4666
- meta = meta_;
4667
- })), { disableYield: true }), (out) => succeed$3(out)), findErrorOnly, (error) => orElse(error, meta.attempt === 0 ? none() : some(meta)));
4761
+ const loop = (input) => matchEffect$1(step(input), {
4762
+ onSuccess(meta_) {
4763
+ meta = meta_;
4764
+ return flatMap$2(provideService$1(self, CurrentMetadata, meta), loop);
4765
+ },
4766
+ onFailure: failCause$3,
4767
+ onDone: succeed$4
4768
+ });
4769
+ return catchCauseFilter(flatMap$2(provideService$1(self, CurrentMetadata, meta), loop), findRecoverableError, (error) => orElse(error, meta.attempt === 0 ? none() : some(meta)));
4668
4770
  }));
4669
4771
  const retryOrElse = dual(3, (self, policy, orElse) => flatMap$2(toStepWithMetadata(policy), (step) => {
4670
4772
  let meta = CurrentMetadata.defaultValue();
4671
4773
  let lastError;
4672
- const loop = catchCauseFilter(suspend$1(() => provideService$1(self, CurrentMetadata, meta)), findErrorOnly, (error) => {
4774
+ const loop = catchCauseFilter(suspend$1(() => provideService$1(self, CurrentMetadata, meta)), findRecoverableError, (error) => {
4673
4775
  lastError = error;
4674
4776
  return flatMap$2(step(error), (meta_) => {
4675
4777
  meta = meta_;
@@ -4680,28 +4782,27 @@ const retryOrElse = dual(3, (self, policy, orElse) => flatMap$2(toStepWithMetada
4680
4782
  }));
4681
4783
  const repeat$1 = dual(2, (self, options) => {
4682
4784
  const schedule = typeof options === "function" ? options(identity) : isSchedule(options) ? options : buildFromOptions(options);
4683
- return repeatOrElse(self, schedule, fail$3);
4785
+ return repeatOrElse(self, schedule, fail$4);
4684
4786
  });
4685
4787
  const retry$1 = dual(2, (self, options) => {
4686
4788
  const schedule = typeof options === "function" ? options(identity) : isSchedule(options) ? options : buildFromOptions(options);
4687
- return retryOrElse(self, schedule, fail$3);
4789
+ return retryOrElse(self, schedule, fail$4);
4688
4790
  });
4689
4791
  const passthroughForever = passthrough(forever$1);
4690
4792
  const buildFromOptions = (options) => {
4691
4793
  let schedule = options.schedule ? passthrough(options.schedule) : passthroughForever;
4692
4794
  if (options.while) schedule = while_(schedule, ({ input }) => {
4693
4795
  const applied = options.while(input);
4694
- return isEffect$1(applied) ? applied : succeed$3(applied);
4796
+ return isEffect$1(applied) ? applied : succeed$4(applied);
4695
4797
  });
4696
4798
  if (options.until) schedule = while_(schedule, ({ input }) => {
4697
4799
  const applied = options.until(input);
4698
- return isEffect$1(applied) ? map$2(applied, (b) => !b) : succeed$3(!applied);
4800
+ return isEffect$1(applied) ? map$2(applied, (b) => !b) : succeed$4(!applied);
4699
4801
  });
4700
- if (options.times !== void 0) schedule = while_(schedule, ({ attempt }) => succeed$3(attempt <= options.times));
4802
+ if (options.times !== void 0) schedule = while_(schedule, ({ attempt }) => succeed$4(attempt <= options.times));
4701
4803
  return schedule;
4702
4804
  };
4703
- //#endregion
4704
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/MutableHashMap.js
4805
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/MutableHashMap.js
4705
4806
  const TypeId$1 = "~effect/MutableHashMap";
4706
4807
  const MutableHashMapProto = {
4707
4808
  [TypeId$1]: TypeId$1,
@@ -4800,8 +4901,7 @@ const isEmpty = (self) => self.backing.size === 0;
4800
4901
  const forEach$1 = dual(2, (self, f) => {
4801
4902
  self.backing.forEach(f);
4802
4903
  });
4803
- //#endregion
4804
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Request.js
4904
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Request.js
4805
4905
  const TypeId = "~effect/Request";
4806
4906
  const requestVariance = byReferenceUnsafe({
4807
4907
  _E: (_) => _,
@@ -4825,8 +4925,7 @@ const TaggedClass = (tag) => {
4825
4925
  };
4826
4926
  };
4827
4927
  const makeEntry = (options) => options;
4828
- //#endregion
4829
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/request.js
4928
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/request.js
4830
4929
  const request$1 = dual(2, (self, resolver) => {
4831
4930
  const withResolver = (resolver) => callback$1((resume) => {
4832
4931
  const entry = addEntry(resolver, self, resume, getCurrentFiber());
@@ -4845,8 +4944,27 @@ const makeBatchMap = (resolver) => {
4845
4944
  delete: (key) => remove(map, key)
4846
4945
  };
4847
4946
  };
4848
- const batchPool = [];
4849
4947
  const pendingBatches = new WeakMap();
4948
+ const makeBatch = (key, context, resolver, map) => {
4949
+ const batch = {
4950
+ key,
4951
+ context,
4952
+ resolver,
4953
+ map,
4954
+ entrySet: new Set(),
4955
+ entries: new Set(),
4956
+ delayEffect: flatMap$2(withFiber$1((delayFiber) => {
4957
+ batch.fiber = delayFiber;
4958
+ return batch.resolver.delay;
4959
+ }), (_) => runBatch(batch)),
4960
+ run: onExit$1(suspend$1(() => batch.resolver.runAll(Array.from(batch.entries), batch.key)), (exit) => {
4961
+ for (const entry of batch.entrySet) entry.completeUnsafe(exit._tag === "Success" ? exitDie(new Error("Effect.request: RequestResolver did not complete request", { cause: entry.request })) : exit);
4962
+ batch.entries.clear();
4963
+ return void_$2;
4964
+ })
4965
+ };
4966
+ return batch;
4967
+ };
4850
4968
  const addEntry = (resolver, request, resume, fiber) => {
4851
4969
  let batchMap = pendingBatches.get(resolver);
4852
4970
  if (!batchMap) {
@@ -4869,44 +4987,21 @@ const addEntry = (resolver, request, resume, fiber) => {
4869
4987
  if (resolver.preCheck !== void 0 && !resolver.preCheck(entry)) return entry;
4870
4988
  const key = resolver.batchKey(entry);
4871
4989
  batch = batchMap.get(key);
4990
+ const isNewBatch = batch === void 0;
4872
4991
  if (!batch) {
4873
- if (batchPool.length > 0) {
4874
- batch = batchPool.pop();
4875
- batch.key = key;
4876
- batch.resolver = resolver;
4877
- batch.map = batchMap;
4878
- } else {
4879
- const newBatch = {
4880
- key,
4881
- resolver,
4882
- map: batchMap,
4883
- entrySet: new Set(),
4884
- entries: new Set(),
4885
- delayEffect: flatMap$2(suspend$1(() => newBatch.resolver.delay), (_) => runBatch(newBatch)),
4886
- run: onExit$1(suspend$1(() => newBatch.resolver.runAll(Array.from(newBatch.entries), newBatch.key)), (exit) => {
4887
- for (const entry of newBatch.entrySet) entry.completeUnsafe(exit._tag === "Success" ? exitDie(new Error("Effect.request: RequestResolver did not complete request", { cause: entry.request })) : exit);
4888
- newBatch.entries.clear();
4889
- if (batchPool.length < 128) {
4890
- newBatch.entrySet.clear();
4891
- newBatch.key = void 0;
4892
- newBatch.fiber = void 0;
4893
- newBatch.resolver = void 0;
4894
- newBatch.map = void 0;
4895
- batchPool.push(newBatch);
4896
- }
4897
- return void_$2;
4898
- })
4899
- };
4900
- batch = newBatch;
4901
- }
4992
+ batch = makeBatch(key, fiber.context, resolver, batchMap);
4902
4993
  batchMap.set(key, batch);
4903
- batch.fiber = runForkWith$1(fiber.context)(batch.delayEffect, { scheduler: fiber.cache.scheduler });
4904
4994
  }
4905
4995
  batch.entrySet.add(entry);
4906
4996
  batch.entries.add(entry);
4997
+ if (isNewBatch) {
4998
+ const delayFiber = runForkWith$1(fiber.context)(batch.delayEffect, { scheduler: fiber.cache.scheduler });
4999
+ if (completed || batchMap.get(key) !== batch) return entry;
5000
+ batch.fiber = delayFiber;
5001
+ }
4907
5002
  if (batch.resolver.collectWhile(batch.entries)) return entry;
4908
5003
  batch.fiber.interruptUnsafe(fiber.id);
4909
- batch.fiber = runForkWith$1(fiber.context)(runBatch(batch), { scheduler: fiber.cache.scheduler });
5004
+ runForkWith$1(batch.context)(runBatch(batch), { scheduler: get$1(batch.context, Scheduler) });
4910
5005
  return entry;
4911
5006
  };
4912
5007
  const removeEntryUnsafe = (resolver, entry) => {
@@ -4932,15 +5027,14 @@ function runBatch(batch) {
4932
5027
  batch.map.delete(batch.key);
4933
5028
  return batch.run;
4934
5029
  }
4935
- //#endregion
4936
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Effect.js
5030
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Effect.js
4937
5031
  const isEffect = isEffect$1;
4938
5032
  const all = all$1;
4939
5033
  const forEach = forEach$2;
4940
5034
  const whileLoop = whileLoop$1;
4941
5035
  const promise = promise$1;
4942
5036
  const tryPromise = tryPromise$1;
4943
- const succeed = succeed$3;
5037
+ const succeed = succeed$4;
4944
5038
  const succeedNone = succeedNone$1;
4945
5039
  const succeedSome = succeedSome$1;
4946
5040
  const suspend = suspend$1;
@@ -4950,7 +5044,8 @@ const undefined_ = undefined_$1;
4950
5044
  const callback = callback$1;
4951
5045
  const never = never$1;
4952
5046
  const gen = gen$1;
4953
- const fail = fail$3;
5047
+ const fail = fail$4;
5048
+ const failSync = failSync$1;
4954
5049
  const failCause = failCause$3;
4955
5050
  const failCauseSync = failCauseSync$1;
4956
5051
  const die = die$3;
@@ -4983,9 +5078,11 @@ const catchNoSuchElement = catchNoSuchElement$1;
4983
5078
  const catchCauseIf = catchCauseIf$1;
4984
5079
  const mapError = mapError$1;
4985
5080
  const orDie = orDie$2;
5081
+ const tapError = tapError$1;
4986
5082
  const tapCause = tapCause$1;
4987
5083
  const retry = retry$1;
4988
5084
  const ignore = ignore$1;
5085
+ const ignoreCause = ignoreCause$1;
4989
5086
  const orElseSucceed = orElseSucceed$1;
4990
5087
  const timeout = timeout$1;
4991
5088
  const timeoutOption = timeoutOption$1;
@@ -5036,13 +5133,14 @@ const request = request$1;
5036
5133
  const forkChild = forkChild$1;
5037
5134
  const forkIn = forkIn$1;
5038
5135
  const forkScoped = forkScoped$1;
5136
+ const forkDetach = forkDetach$1;
5039
5137
  const runFork = runFork$1;
5040
5138
  const runForkWith = runForkWith$1;
5139
+ const runPromiseWith = runPromiseWith$1;
5041
5140
  const runSync = runSync$1;
5042
5141
  const runSyncExit = runSyncExit$1;
5043
5142
  const fnUntraced = fnUntraced$1;
5044
5143
  const fn = fn$1;
5045
- const clockWith = clockWith$1;
5046
5144
  const logFatal = logWithLevel("Fatal");
5047
5145
  const logWarning = logWithLevel("Warn");
5048
5146
  const logError = logWithLevel("Error");
@@ -5061,14 +5159,19 @@ const withLogSpan = dual(2, (effect, label) => flatMap$2(currentTimeMillis, (now
5061
5159
  return [[label, now], ...spans];
5062
5160
  })));
5063
5161
  const effectify = (fn, onError, onSyncError) => (...args) => callback((resume) => {
5162
+ let synchronous = true;
5163
+ let pending;
5064
5164
  try {
5065
5165
  fn(...args, (err, result) => {
5066
- if (err) resume(onError ? suspend(() => fail(onError(err, args))) : fail(err));
5067
- else resume(succeed(result));
5166
+ const effect = err ? onError ? suspend(() => fail(onError(err, args))) : fail(err) : succeed(result);
5167
+ if (synchronous) pending ??= effect;
5168
+ else resume(effect);
5068
5169
  });
5069
5170
  } catch (err) {
5070
- resume(onSyncError ? fail(onSyncError(err, args)) : die(err));
5171
+ pending = onSyncError ? fail(onSyncError(err, args)) : die(err);
5071
5172
  }
5173
+ synchronous = false;
5174
+ if (pending) resume(pending);
5072
5175
  });
5073
5176
  const mapEager = mapEager$1;
5074
5177
  const mapErrorEager = mapErrorEager$1;
@@ -5076,7 +5179,6 @@ const mapBothEager = mapBothEager$1;
5076
5179
  const flatMapEager = flatMapEager$1;
5077
5180
  const catchEager = catchEager$1;
5078
5181
  const fnUntracedEager = fnUntracedEager$1;
5079
- //#endregion
5080
- export { interruptible as $, max as $a, sync$1 as $i, combine as $n, Tuple as $o, interruptWith as $r, isNotNullish as $s, tryPromise as $t, effectify as A, reduce as Aa, fiberAwait as Ai, isSchedule as An, getOrNull as Ao, mergeAll as Ar, redact as As, request as At, fn as B, isFailure$1 as Ba, iterateConcurrent as Bi, Random as Bn, orElse as Bo, addFinalizerExit as Br, optimize as Bs, service as Bt, catchTags as C, join as Ca, pipe as Cc, currentTimeMillis as Ci, make as Cn, flatMap$5 as Co, buildWithScope as Cr, toJson as Cs, orElseSucceed as Ct, contextWith as D, map$3 as Da, exitInterrupt as Di, exponential as Dn, fromNullishOr$1 as Do, empty$1 as Dr, formatPath as Ds, provideService as Dt, context as E, makeEquivalence as Ea, pipeArguments as Ec, exitHasInterrupts as Ei, size as En, fromNullOr as Eo, effectDiscard as Er, formatJson as Es, provideContext as Et, failCauseSync as F, fail$4 as Fa, fiberJoin as Fi, catchDone as Fn, isSome as Fo, succeed$1 as Fr, symbol as Fs, runSync as Ft, forkChild as G, try_$2 as Ga, map$2 as Gi, round as Gn, Date$1 as Go, makeUnsafe as Gr, hasProperty as Gs, succeedSome as Gt, fnUntracedEager as H, map$4 as Ha, makeLatch as Hi, nextPow2 as Hn, some as Ho, fork as Hr, structure as Hs, sleep as Ht, filterOrFail as I, failVoid as Ia, fiberRunIn as Ii, doneExitFromCause as In, liftThrowable as Io, succeedContext as Ir, array as Is, runSyncExit as It, fromOption as J, hours as Ja, onExitUnsafe as Ji, NoSuchElementError as Jn, isGreaterThan as Jo, MinimumLogLevel as Jr, isError as Js, tap as Jt, forkIn as K, format as Ka, monotonicTimeNanos as Ki, Done as Kn, Number$2 as Ko, provide$3 as Kr, isBigInt as Ks, suspend as Kt, flatMap as L, flatMap$4 as La, flatMap$2 as Li, filterDone as Ln, map$5 as Lo, unwrap as Lr, combine$1 as Ls, scope as Lt, exit as M, empty$3 as Ma, fiberInterruptAll as Mi, min as Mn, getOrUndefined$2 as Mo, orDie$1 as Mr, asEquivalence as Ms, retry as Mt, fail as N, headUnsafe as Na, fiberInterruptAllAs as Ni, spaced as Nn, isNone as No, provide$2 as Nr, byReferenceUnsafe as Ns, runFork as Nt, delay as O, match$2 as Oa, exitVoid as Oi, forever$1 as On, fromUndefinedOr as Oo, fresh as Or, formatPropertyKey as Os, raceFirst as Ot, failCause as P, size$1 as Pa, fiberInterruptAs as Pi, toStep as Pn, isOption as Po, provideMerge as Pr, equals$1 as Ps, runForkWith as Pt, interrupt as Q, isZero as Qa, suspend$1 as Qi, annotate as Qn, make$6 as Qo, doneUnsafe as Qr, isNotNull as Qs, timeoutOrElse as Qt, flatMapEager as R, getOrThrow as Ra, forkUnsafe$1 as Ri, isDoneCause as Rn, match$5 as Ro, Scope as Rr, hash as Rs, scoped as Rt, catchTag as S, isReadonlyArrayNonEmpty as Sa, memoizeIdempotent as Sc, contextWith$1 as Si, isEmpty as Sn, filter as So, build as Sr, NodeInspectSymbol as Ss, orDie as St, clockWith as T, lastNonEmpty as Ta, Prototype$1 as Tc, endSpan as Ti, set as Tn, flatten$3 as To, effectContext as Tr, formatDate as Ts, provide as Tt, forEach as U, match$3 as Ua, makeLatchUnsafe as Ui, parse as Un, toArray as Uo, forkUnsafe as Ur, structureKeys as Us, succeed as Ut, fnUntraced as V, isSuccess$1 as Va, iterateEager as Vi, nextBetween as Vn, orElseSome as Vo, close as Vr, string as Vs, serviceOption as Vt, forever as W, succeed$4 as Wa, makeSpanUnsafe as Wi, remainder as Wn, BigInt$1 as Wo, make$1 as Wr, symbol$1 as Ws, succeedNone as Wt, gen as X, isDuration as Xa, succeed$3 as Xi, TimeoutError as Xn, isLessThan as Xo, _await as Xr, isIterable as Xs, timeout as Xt, fromResult as Y, infinity as Ya, resolveConcurrency as Yi, StackTrace as Yn, isGreaterThanOrEqualTo as Yo, TracerTimingEnabled as Yr, isFunction as Ys, tapCause as Yt, ignore as Z, isFinite as Za, succeedNone$1 as Zi, UnknownError as Zn, isLessThanOrEqualTo as Zo, done$1 as Zr, isNever as Zs, timeoutOption as Zt, catchEager as _, flatMapNullishOr as _a, constant as _c, ConsoleRef as _i, Class as _n, make$5 as _o, makeInterruptReason as _r, assignProperty as _s, onError as _t, andThen as a, encode as aa, isObjectKeyword as ac, asVoidAll as ai, updateService as an, toMillis as ao, findErrorOption as ar, PipeInspectableProto as as, logWarning as at, catchNoSuchElement as b, isArrayNonEmpty as ba, identity as bc, asSome$1 as bi, forEach$1 as bn, all$2 as bo, reasonAnnotations as br, BaseProto as bs, onInterrupt as bt, as as c, toPredicate as ca, isSymbol as cc, failCause$2 as ci, when as cn, Reference as co, hasInterruptsOnly as cr, causeFail as cs, mapBothEager as ct, cached as d, appendAll as da, isUnknown as dc, isExit as di, withLogSpan as dn, empty$4 as do, isDieReason as dr, exitFailCause as ds, mapErrorEager as dt, uninterruptibleMask$1 as ea, isNotUndefined as ec, into as ei, try_ as en, millis as eo, die$1 as er, make$7 as es, isEffect as et, cachedWithTTL as f, dedupe as fa, or as fc, isFailure as fi, withParentSpan as fn, get$1 as fo, isFailReason as fr, exitSucceed as fs, match as ft, catchDefect as g, findLast as ga, constVoid as gc, ClockRef as gi, equalBatchKeys as gn, getUnsafe$1 as go, makeFailReason as gr, assignProperties as gs, never as gt, catchCauseIf as h, findFirstIndex as ha, constUndefined as hc, void_$1 as hi, zipWith as hn, getOrUndefinedUnsafe as ho, makeDieReason as hr, withFiber$1 as hs, matchEffect as ht, all as i, ParentSpan as ia, isObject as ic, makeUnsafe$1 as ii, updateContext as in, seconds as io, findError as ir, Error$1 as is, logInfo as it, ensuring as j, sort as ja, fiberInterrupt as ji, jittered as jn, getOrThrow$1 as jo, mock as jr, symbolRedactable as js, result as jt, die as k, of as ka, exitZipRight as ki, fromStep as kn, getOrElse$1 as ko, merge as kr, currentFiberTypeId as ks, repeat as kt, asSome as l, Array$1 as la, isTagged as lc, findErrorOption$1 as li, whileLoop as ln, Service as lo, interruptors as lr, evaluate as ls, mapEager as lt, catchCause as m, findFirst as ma, constTrue as mc, succeed$2 as mi, yieldNow as mn, getOrUndefined$1 as mo, isTimeoutError as mr, makePrimitive as ms, matchCauseEffect as mt, acquireUseRelease as n, void_$2 as na, isNullish as nc, isDoneUnsafe as ni, uninterruptible as nn, nanos as no, fail$1 as nr, Prototype as ns, logError as nt, annotateCurrentSpan as o, compose as oa, isPropertyKey as oc, die$2 as oi, useSpan as on, toSeconds as oo, fromReasons as or, TaggedError as os, makeSpanScoped as ot, callback as p, empty$2 as pa, constFalse as pc, isSuccess as pi, withSpan as pn, getOption as po, isReason as pr, isExit$1 as ps, matchCauseEager as pt, forkScoped as q, fromInputUnsafe as qa, onExitPrimitive$1 as qi, IllegalArgumentError as qn, String$1 as qo, CurrentLogAnnotations as qr, isBoolean as qs, sync as qt, addFinalizer as r, DisablePropagation as ra, isNumber as rc, make$2 as ri, uninterruptibleMask as rn, negativeInfinity as ro, filterInterruptors as rr, Done$1 as rs, logFatal as rt, annotateLogs as s, has$1 as sa, isString as sc, fail$2 as si, void_ as sn, zero as so, hasInterrupts as sr, args as ss, map as st, acquireRelease as t, updateContext$1 as ta, isNull as tc, isDone$1 as ti, undefined_ as tn, minutes as to, done as tr, strictEqual as ts, logDebug as tt, asVoid as u, append as ua, isUndefined as uc, interrupt$1 as ui, withFiber as un, add as uo, isCause as ur, exitFail as us, mapError as ut, catchFilter as v, fromIterable$1 as va, dual as vc, LogToStderr as vi, TaggedClass as vn, makeUnsafe$2 as vo, map$1 as vr, getStackTraceLimit as vs, onExit as vt, catch_ as w, last as wa, Class$2 as wc, effectIsExit as wi, remove as wn, flatMapNullishOr$1 as wo, effect as wr, format$1 as ws, promise as wt, catchReason as x, isCanonicalArrayIndex as xa, memoize as xc, callback$1 as xi, get as xn, exists as xo, squash as xr, Class$1 as xs, option as xt, catchIf as y, headNonEmpty as ya, flow as yc, andThen$1 as yi, empty as yn, merge$1 as yo, pretty as yr, setStackTraceLimit as ys, onExitPrimitive as yt, flatten as z, getOrUndefined as za, getCurrentFiber as zi, matchEffect$1 as zn, none as zo, addFinalizer$1 as zr, number as zs, scopedWith as zt };
5182
+ export { ignoreCause as $, try_$2 as $a, resolveConcurrency as $i, TimeoutError as $n, some as $o, _await as $r, random$1 as $s, tapError as $t, ensuring as A, isReadonlyArrayNonEmpty as Aa, constant as Ac, exitHasInterrupts as Ai, size as An, omit as Ao, empty$1 as Ar, getStackTraceLimit as As, raceFirst as At, fn as B, span as Ba, findRecoverableError as Bi, doneExitFromCause as Bn, getOrElse$1 as Bo, unwrap as Br, formatPropertyKey as Bs, scope as Bt, catchTags as C, findLast as Ca, isUndefined as Cc, andThen$1 as Ci, empty as Cn, getOption as Co, reasonAnnotations as Cr, exitFailCause as Cs, option as Ct, delay as D, isArray as Da, constTrue as Dc, currentTimeMillis as Di, make as Dn, make$5 as Do, effect as Dr, withFiber$1 as Ds, provide as Dt, contextWith as E, headNonEmpty as Ea, constFalse as Ec, contextWith$1 as Ei, isEmpty as En, getUnsafe$1 as Eo, buildWithScope as Er, makePrimitive as Es, promise as Et, failSync as F, map$3 as Fa, memoizeIdempotent as Fc, fiberInterrupt as Fi, jittered as Fn, flatMapNullishOr$1 as Fo, orDie$1 as Fr, toJson as Fs, runFork as Ft, forkChild as G, flatMap$4 as Ga, iterateEager as Gi, nextPow2 as Gn, isOption as Go, fork as Gr, byReferenceUnsafe as Gs, sleep as Gt, fnUntracedEager as H, headUnsafe as Ha, forkUnsafe$1 as Hi, isDoneCause as Hn, getOrThrow$1 as Ho, addFinalizer$1 as Hr, redact as Hs, scopedWith as Ht, filterOrFail as I, match$2 as Ia, pipe as Ic, fiberInterruptAll as Ii, min as In, flatten$3 as Io, provide$2 as Ir, format$1 as Is, runForkWith as It, forkScoped as J, isFailure$1 as Ja, makeSpanUnsafe as Ji, round as Jn, map$5 as Jo, makeUnsafe as Jr, array as Js, succeedSome as Jt, forkDetach as K, getOrThrow as Ka, makeLatch as Ki, parse as Kn, isSome as Ko, forkUnsafe as Kr, equals$1 as Ks, succeed as Kt, flatMap as L, of as La, Class$2 as Lc, fiberInterruptAllAs as Li, spaced as Ln, fromNullOr as Lo, provideMerge as Lr, formatDate as Ls, runPromiseWith as Lt, fail as M, last as Ma, flow as Mc, exitVoid as Mi, forever$1 as Mn, exists as Mo, merge as Mr, BaseProto as Ms, request as Mt, failCause as N, lastNonEmpty as Na, identity as Nc, exitZipRight as Ni, fromStep as Nn, filter as No, mergeAll as Nr, Class$1 as Ns, result as Nt, die as O, isArrayNonEmpty as Oa, constUndefined as Oc, effectIsExit as Oi, remove as On, makeUnsafe$2 as Oo, effectContext as Or, assignProperties as Os, provideContext as Ot, failCauseSync as P, makeEquivalence as Pa, memoize as Pc, fiberAwait as Pi, isSchedule as Pn, flatMap$5 as Po, mock as Pr, NodeInspectSymbol as Ps, retry as Pt, ignore as Q, succeed$5 as Qa, onExitUnsafe as Qi, StackTrace as Qn, orElseSome as Qo, TracerTimingEnabled as Qr, optimize as Qs, tapCause as Qt, flatMapEager as R, reduce as Ra, Prototype$1 as Rc, fiberJoin as Ri, toStep as Rn, fromNullishOr$1 as Ro, succeed$1 as Rr, formatJson as Rs, runSync as Rt, catchTag as S, findFirstIndex as Sa, isTagged as Sc, LogToStderr as Si, TaggedClass as Sn, get$1 as So, pretty as Sr, exitFail as Ss, onInterrupt as St, context as T, fromIterable$1 as Ta, or as Tc, callback$1 as Ti, get as Tn, getOrUndefinedUnsafe as To, build as Tr, isExit$1 as Ts, orElseSucceed as Tt, forEach as U, fail$5 as Ua, getCurrentFiber as Ui, matchEffect$1 as Un, getOrUndefined$2 as Uo, addFinalizerExit as Ur, symbolRedactable as Us, service as Ut, fnUntraced as V, empty$3 as Va, flatMap$2 as Vi, filterDone as Vn, getOrNull as Vo, Scope as Vr, currentFiberTypeId as Vs, scoped as Vt, forever as W, failVoid as Wa, iterateConcurrent as Wi, Random as Wn, isNone as Wo, close as Wr, asEquivalence as Ws, serviceOption as Wt, fromResult as X, map$4 as Xa, monotonicTimeNanos as Xi, IllegalArgumentError as Xn, none as Xo, CurrentLogAnnotations as Xr, hash as Xs, sync as Xt, fromOption as Y, isSuccess$1 as Ya, map$2 as Yi, Done as Yn, match$5 as Yo, provide$3 as Yr, combine$1 as Ys, suspend as Yt, gen as Z, match$3 as Za, onExitPrimitive$1 as Zi, NoSuchElementError as Zn, orElse as Zo, MinimumLogLevel as Zr, number as Zs, tap as Zt, catchEager as _, appendAll as _a, isObject as _c, isSuccess as _i, withSpan as _n, zero as _o, isTimeoutError as _r, PipeInspectableProto as _s, matchEffect as _t, andThen as a, sync$1 as aa, isBigInt as ac, isDoneUnsafe as ai, undefined_ as an, infinity as ao, fail$1 as ar, isGreaterThan as as, logFatal as at, catchNoSuchElement as b, ensure as ba, isString as bc, ClockRef as bi, equalBatchKeys as bn, add as bo, makeInterruptReason as br, causeFail as bs, onExit as bt, as as c, void_$2 as ca, isFunction as cc, succeed$2 as ci, updateContext as cn, isZero as co, fromReasons as cr, isLessThanOrEqualTo as cs, makeSpanScoped as ct, cached as d, encode as da, isNotNull as dc, fail$3 as di, void_ as dn, minutes as do, interruptors as dr, Tuple as ds, mapEager as dt, scope$1 as ea, string as ec, doneUnsafe as ei, timeout as en, normalize as eo, UnknownError as er, toArray as es, interrupt as et, cachedWithTTL as f, compose as fa, isNotNullish as fc, failCause$2 as fi, when as fn, nanos as fo, isCause as fr, make$7 as fs, mapError as ft, catchDefect as g, append as ga, isNumber as gc, isFailure as gi, withParentSpan as gn, toSeconds as go, isReason as gr, Error$1 as gs, matchCauseEffect as gt, catchCauseIf as h, Array$1 as ha, isNullish as hc, isExit as hi, withLogSpan as hn, toMillis as ho, isFailReason as hr, Done$1 as hs, matchCauseEager as ht, all as i, suspend$1 as ia, hasProperty as ic, isDone$1 as ii, try_ as in, hours as io, done as ir, String$1 as is, logError as it, exit as j, join as ja, dual as jc, exitInterrupt as ji, exponential as jn, all$2 as jo, fresh as jr, setStackTraceLimit as js, repeat as jt, effectify as k, isCanonicalArrayIndex as ka, constVoid as kc, endSpan as ki, set as kn, merge$1 as ko, effectDiscard as kr, assignProperty as ks, provideService as kt, asSome as l, DisablePropagation as la, isIterable as lc, asVoidAll as li, updateService as ln, max as lo, hasInterrupts as lr, make$6 as ls, map as lt, catchCause as m, toPredicate as ma, isNull as mc, interrupt$1 as mi, withFiber as mn, seconds as mo, isDone as mr, Prototype as ms, match as mt, acquireUseRelease as n, succeed$4 as na, structureKeys as nc, interruptWith as ni, timeoutOrElse as nn, format as no, combine as nr, Date$1 as ns, isEffect as nt, annotateCurrentSpan as o, uninterruptibleMask$1 as oa, isBoolean as oc, make$2 as oi, uninterruptible as on, isDuration as oo, filterInterruptors as or, isGreaterThanOrEqualTo as os, logInfo as ot, callback as p, has$1 as pa, isNotUndefined as pc, findErrorOption$1 as pi, whileLoop as pn, negativeInfinity as po, isDieReason as pr, strictEqual as ps, mapErrorEager as pt, forkIn as q, getOrUndefined as qa, makeLatchUnsafe as qi, remainder as qn, liftThrowable as qo, make$1 as qr, symbol as qs, succeedNone as qt, addFinalizer as r, succeedNone$1 as ra, symbol$1 as rc, into as ri, tryPromise as rn, fromInputUnsafe as ro, die$1 as rr, Number$2 as rs, logDebug as rt, annotateLogs as s, updateContext$1 as sa, isError as sc, makeUnsafe$1 as si, uninterruptibleMask as sn, isFinite as so, findErrorOption as sr, isLessThan as ss, logWarning as st, acquireRelease as t, scopeAddFinalizer as ta, structure as tc, fail$2 as ti, timeoutOption as tn, normalizeNonEmpty as to, annotate as tr, BigInt$1 as ts, interruptible as tt, asVoid as u, ParentSpan as ua, isNever as uc, die$2 as ui, useSpan as un, millis as uo, hasInterruptsOnly as ur, mapInput as us, mapBothEager as ut, catchFilter as v, dedupe as va, isObjectKeyword as vc, succeed$3 as vi, yieldNow as vn, Reference as vo, makeDieReason as vr, TaggedError as vs, never as vt, catch_ as w, flatMapNullishOr as wa, isUnknown as wc, asSome$1 as wi, forEach$1 as wn, getOrUndefined$1 as wo, squash as wr, exitSucceed as ws, orDie as wt, catchReason as x, findFirst as xa, isSymbol as xc, ConsoleRef as xi, Class as xn, empty$4 as xo, map$1 as xr, evaluate as xs, onExitPrimitive as xt, catchIf as y, empty$2 as ya, isPropertyKey as yc, void_$1 as yi, zipWith as yn, Service as yo, makeFailReason as yr, args as ys, onError as yt, flatten as z, sort as za, pipeArguments as zc, fiberRunIn as zi, catchDone as zn, fromUndefinedOr as zo, succeedContext as zr, formatPath as zs, runSyncExit as zt };
5081
5183
 
5082
- //# sourceMappingURL=Effect-4B1lzxy4.mjs.map
5184
+ //# sourceMappingURL=Effect-DNYYQ84C.mjs.map