lalph 0.3.114 → 0.3.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -7858,7 +7858,7 @@ var FiberImpl = class {
7858
7858
  if (this.currentStackFrame) cause = causeAnnotate(cause, make$89(StackTraceKey, this.currentStackFrame));
7859
7859
  if (annotations) cause = causeAnnotate(cause, annotations);
7860
7860
  this._interruptedCause = this._interruptedCause ? causeCombine(this._interruptedCause, cause) : cause;
7861
- if (this.interruptible) this.evaluate(failCause$6(this._interruptedCause));
7861
+ if (this.interruptible) this.evaluate(failCause$5(this._interruptedCause));
7862
7862
  }
7863
7863
  pollUnsafe() {
7864
7864
  return this._exit;
@@ -8049,7 +8049,7 @@ const fiberInterruptAll = (fibers) => withFiber$1((parent) => {
8049
8049
  /** @internal */
8050
8050
  const succeed$8 = exitSucceed;
8051
8051
  /** @internal */
8052
- const failCause$6 = exitFailCause;
8052
+ const failCause$5 = exitFailCause;
8053
8053
  /** @internal */
8054
8054
  const fail$9 = exitFail;
8055
8055
  /** @internal */
@@ -8159,7 +8159,7 @@ const asyncFinalizer = /* @__PURE__ */ makePrimitive$1({
8159
8159
  }
8160
8160
  },
8161
8161
  [contE](cause, _fiber) {
8162
- return hasInterrupts$2(cause) ? flatMap$7(this[args](), () => failCause$6(cause)) : failCause$6(cause);
8162
+ return hasInterrupts$2(cause) ? flatMap$7(this[args](), () => failCause$5(cause)) : failCause$5(cause);
8163
8163
  }
8164
8164
  });
8165
8165
  /** @internal */
@@ -8289,7 +8289,7 @@ const tap$2 = /* @__PURE__ */ dual(2, (self, f) => flatMap$7(self, (a) => as$2(i
8289
8289
  /** @internal */
8290
8290
  const asVoid$2 = (self) => flatMap$7(self, (_) => exitVoid);
8291
8291
  /** @internal */
8292
- const sandbox$1 = (self) => catchCause$4(self, fail$9);
8292
+ const sandbox$1 = (self) => catchCause$3(self, fail$9);
8293
8293
  /** @internal */
8294
8294
  const raceAllFirst$1 = (all, options) => withFiber$1((parent) => callback$2((resume) => {
8295
8295
  let done = false;
@@ -8461,7 +8461,7 @@ const forever$2 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, opt
8461
8461
  step: constVoid
8462
8462
  }));
8463
8463
  /** @internal */
8464
- const catchCause$4 = /* @__PURE__ */ dual(2, (self, f) => {
8464
+ const catchCause$3 = /* @__PURE__ */ dual(2, (self, f) => {
8465
8465
  const onFailure = Object.create(OnFailureProto);
8466
8466
  onFailure[args] = self;
8467
8467
  onFailure[contE] = f.length !== 1 ? (cause) => f(cause) : f;
@@ -8475,9 +8475,9 @@ const OnFailureProto = /* @__PURE__ */ makePrimitiveProto({
8475
8475
  }
8476
8476
  });
8477
8477
  /** @internal */
8478
- const catchCauseFilter$2 = /* @__PURE__ */ dual(3, (self, filter, f) => catchCause$4(self, (cause) => {
8478
+ const catchCauseFilter$2 = /* @__PURE__ */ dual(3, (self, filter, f) => catchCause$3(self, (cause) => {
8479
8479
  const eb = filter(cause);
8480
- return isFailure$4(eb) ? failCause$6(eb.failure) : internalCall(() => f(eb.success, cause));
8480
+ return isFailure$4(eb) ? failCause$5(eb.failure) : internalCall(() => f(eb.success, cause));
8481
8481
  }));
8482
8482
  /** @internal */
8483
8483
  const catch_$3 = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter$2(self, findError$2, (e) => f(e)));
@@ -8489,12 +8489,12 @@ const catchNoSuchElement$1 = (self) => matchEffect$2(self, {
8489
8489
  /** @internal */
8490
8490
  const catchDefect$1 = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter$2(self, findDefect$2, f));
8491
8491
  /** @internal */
8492
- const tapCause$2 = /* @__PURE__ */ dual(2, (self, f) => catchCause$4(self, (cause) => andThen$1(internalCall(() => f(cause)), failCause$6(cause))));
8492
+ const tapCause$2 = /* @__PURE__ */ dual(2, (self, f) => catchCause$3(self, (cause) => andThen$1(internalCall(() => f(cause)), failCause$5(cause))));
8493
8493
  /** @internal */
8494
- const tapCauseFilter$1 = /* @__PURE__ */ dual(3, (self, filter, f) => catchCause$4(self, (cause) => {
8494
+ const tapCauseFilter$1 = /* @__PURE__ */ dual(3, (self, filter, f) => catchCause$3(self, (cause) => {
8495
8495
  const result = filter(cause);
8496
- if (isFailure$4(result)) return failCause$6(cause);
8497
- return andThen$1(internalCall(() => f(result.success, cause)), failCause$6(cause));
8496
+ if (isFailure$4(result)) return failCause$5(cause);
8497
+ return andThen$1(internalCall(() => f(result.success, cause)), failCause$5(cause));
8498
8498
  }));
8499
8499
  /** @internal */
8500
8500
  const tapError$1 = /* @__PURE__ */ dual(2, (self, f) => tapCauseFilter$1(self, findError$2, (e) => f(e)));
@@ -8504,18 +8504,18 @@ const tapErrorTag$1 = /* @__PURE__ */ dual(3, (self, k, f) => {
8504
8504
  return tapError$1(self, (error) => predicate(error) ? f(error) : void_$4);
8505
8505
  });
8506
8506
  /** @internal */
8507
- const catchIf$3 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, predicate, f, orElse) => catchCause$4(self, (cause) => {
8507
+ const catchIf$3 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, predicate, f, orElse) => catchCause$3(self, (cause) => {
8508
8508
  const error = findError$2(cause);
8509
- if (isFailure$4(error)) return failCause$6(error.failure);
8510
- if (!predicate(error.success)) return orElse ? internalCall(() => orElse(error.success)) : failCause$6(cause);
8509
+ if (isFailure$4(error)) return failCause$5(error.failure);
8510
+ if (!predicate(error.success)) return orElse ? internalCall(() => orElse(error.success)) : failCause$5(cause);
8511
8511
  return internalCall(() => f(error.success));
8512
8512
  }));
8513
8513
  /** @internal */
8514
- const catchFilter$3 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, filter, f, orElse) => catchCause$4(self, (cause) => {
8514
+ const catchFilter$3 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, filter, f, orElse) => catchCause$3(self, (cause) => {
8515
8515
  const error = findError$2(cause);
8516
- if (isFailure$4(error)) return failCause$6(error.failure);
8516
+ if (isFailure$4(error)) return failCause$5(error.failure);
8517
8517
  const result = filter(error.success);
8518
- if (isFailure$4(result)) return orElse ? internalCall(() => orElse(result.failure)) : failCause$6(cause);
8518
+ if (isFailure$4(result)) return orElse ? internalCall(() => orElse(result.failure)) : failCause$5(cause);
8519
8519
  return internalCall(() => f(result.success));
8520
8520
  }));
8521
8521
  /** @internal */
@@ -8558,7 +8558,7 @@ const ignore$2 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, opti
8558
8558
  return matchCauseEffect$1(self, {
8559
8559
  onFailure(cause) {
8560
8560
  const failure = findFail$1(cause);
8561
- return isFailure$4(failure) ? failCause$6(failure.failure) : options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause);
8561
+ return isFailure$4(failure) ? failCause$5(failure.failure) : options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause);
8562
8562
  },
8563
8563
  onSuccess: (_) => void_$4
8564
8564
  });
@@ -8597,7 +8597,7 @@ const matchCause$1 = /* @__PURE__ */ dual(2, (self, options) => matchCauseEffect
8597
8597
  const matchEffect$2 = /* @__PURE__ */ dual(2, (self, options) => matchCauseEffect$1(self, {
8598
8598
  onFailure: (cause) => {
8599
8599
  const fail = cause.reasons.find(isFailReason$1);
8600
- return fail ? internalCall(() => options.onFailure(fail.error)) : failCause$6(cause);
8600
+ return fail ? internalCall(() => options.onFailure(fail.error)) : failCause$5(cause);
8601
8601
  },
8602
8602
  onSuccess: options.onSuccess
8603
8603
  }));
@@ -8642,9 +8642,9 @@ const exitPrimitive = /* @__PURE__ */ makePrimitive$1({
8642
8642
  /** @internal */
8643
8643
  const delay$1 = /* @__PURE__ */ dual(2, (self, duration) => andThen$1(sleep$1(duration), self));
8644
8644
  /** @internal */
8645
- const timeoutOrElse$2 = /* @__PURE__ */ dual(2, (self, options) => raceFirst$1(self, flatMap$7(sleep$1(options.duration), options.orElse)));
8645
+ const timeoutOrElse$1 = /* @__PURE__ */ dual(2, (self, options) => raceFirst$1(self, flatMap$7(sleep$1(options.duration), options.orElse)));
8646
8646
  /** @internal */
8647
- const timeout$1 = /* @__PURE__ */ dual(2, (self, duration) => timeoutOrElse$2(self, {
8647
+ const timeout$1 = /* @__PURE__ */ dual(2, (self, duration) => timeoutOrElse$1(self, {
8648
8648
  duration,
8649
8649
  orElse: () => fail$9(new TimeoutError$1())
8650
8650
  }));
@@ -8832,7 +8832,7 @@ const cachedWithTTL$1 = /* @__PURE__ */ dual(2, (self, timeToLive) => map$13(cac
8832
8832
  /** @internal */
8833
8833
  const cached$2 = (self) => cachedWithTTL$1(self, infinity);
8834
8834
  /** @internal */
8835
- const interrupt$4 = /* @__PURE__ */ withFiber$1((fiber) => failCause$6(causeInterrupt(fiber.id)));
8835
+ const interrupt$4 = /* @__PURE__ */ withFiber$1((fiber) => failCause$5(causeInterrupt(fiber.id)));
8836
8836
  /** @internal */
8837
8837
  const uninterruptible$1 = (self) => withFiber$1((fiber) => {
8838
8838
  if (!fiber.interruptible) return self;
@@ -8844,7 +8844,7 @@ const setInterruptible = /* @__PURE__ */ makePrimitive$1({
8844
8844
  op: "SetInterruptible",
8845
8845
  [contAll](fiber) {
8846
8846
  fiber.interruptible = this[args];
8847
- if (fiber._interruptedCause && fiber.interruptible) return () => failCause$6(fiber._interruptedCause);
8847
+ if (fiber._interruptedCause && fiber.interruptible) return () => failCause$5(fiber._interruptedCause);
8848
8848
  }
8849
8849
  });
8850
8850
  const setInterruptibleTrue = /* @__PURE__ */ setInterruptible(true);
@@ -8854,7 +8854,7 @@ const interruptible$1 = (self) => withFiber$1((fiber) => {
8854
8854
  if (fiber.interruptible) return self;
8855
8855
  fiber.interruptible = true;
8856
8856
  fiber._stack.push(setInterruptibleFalse);
8857
- if (fiber._interruptedCause) return failCause$6(fiber._interruptedCause);
8857
+ if (fiber._interruptedCause) return failCause$5(fiber._interruptedCause);
8858
8858
  return self;
8859
8859
  });
8860
8860
  /** @internal */
@@ -9630,7 +9630,7 @@ const succeed$7 = exitSucceed;
9630
9630
  * @category constructors
9631
9631
  * @since 2.0.0
9632
9632
  */
9633
- const failCause$5 = exitFailCause;
9633
+ const failCause$4 = exitFailCause;
9634
9634
  /**
9635
9635
  * Creates a failed Exit from a typed error value.
9636
9636
  *
@@ -9952,7 +9952,7 @@ const done$1 = completeWith;
9952
9952
  * @since 2.0.0
9953
9953
  * @category utils
9954
9954
  */
9955
- const failCause$4 = /* @__PURE__ */ dual(2, (self, cause) => done$1(self, exitFailCause(cause)));
9955
+ const failCause$3 = /* @__PURE__ */ dual(2, (self, cause) => done$1(self, exitFailCause(cause)));
9956
9956
  /**
9957
9957
  * Completes the `Deferred` with interruption. This will interrupt all fibers
9958
9958
  * waiting on the value of the `Deferred` with the specified `FiberId`.
@@ -9971,7 +9971,7 @@ const failCause$4 = /* @__PURE__ */ dual(2, (self, cause) => done$1(self, exitFa
9971
9971
  * @since 2.0.0
9972
9972
  * @category utils
9973
9973
  */
9974
- const interruptWith = /* @__PURE__ */ dual(2, (self, fiberId) => failCause$4(self, causeInterrupt(fiberId)));
9974
+ const interruptWith = /* @__PURE__ */ dual(2, (self, fiberId) => failCause$3(self, causeInterrupt(fiberId)));
9975
9975
  /**
9976
9976
  * Returns `true` if this `Deferred` has already been completed with a value or
9977
9977
  * an error, `false` otherwise.
@@ -11424,7 +11424,7 @@ const flatMap$6 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope
11424
11424
  * @since 4.0.0
11425
11425
  * @category sequencing
11426
11426
  */
11427
- const tapCause$1 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope) => catchCause$4(self.build(memoMap, scope), (cause) => provide$4(andThen$1(f(cause), failCause$6(cause)), scope))));
11427
+ const tapCause$1 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope) => catchCause$3(self.build(memoMap, scope), (cause) => provide$4(andThen$1(f(cause), failCause$5(cause)), scope))));
11428
11428
  /**
11429
11429
  * Translates effect failure into death of the fiber, making all failures
11430
11430
  * unchecked and not a part of the type of the layer.
@@ -11528,7 +11528,7 @@ const orDie$3 = (self) => fromBuildUnsafe((memoMap, scope) => orDie$4(self.build
11528
11528
  * @since 2.0.0
11529
11529
  * @category error handling
11530
11530
  */
11531
- const catchCause$3 = /* @__PURE__ */ dual(2, (self, onError) => fromBuildUnsafe((memoMap, scope) => catchCause$4(self.build(memoMap, scope), (cause) => onError(cause).build(memoMap, scope))));
11531
+ const catchCause$2 = /* @__PURE__ */ dual(2, (self, onError) => fromBuildUnsafe((memoMap, scope) => catchCause$3(self.build(memoMap, scope), (cause) => onError(cause).build(memoMap, scope))));
11532
11532
  /**
11533
11533
  * Creates a fresh version of this layer that will not be shared.
11534
11534
  *
@@ -12786,7 +12786,7 @@ const filterDoneLeftover = /* @__PURE__ */ composePassthrough(findError, (e) =>
12786
12786
  */
12787
12787
  const doneExitFromCause = (cause) => {
12788
12788
  const halt = filterDone(cause);
12789
- return !isFailure$4(halt) ? succeed$7(halt.success.value) : failCause$5(halt.failure);
12789
+ return !isFailure$4(halt) ? succeed$7(halt.success.value) : failCause$4(halt.failure);
12790
12790
  };
12791
12791
  /**
12792
12792
  * Pattern matches on a Pull, handling success, failure, and done cases.
@@ -12993,7 +12993,7 @@ const fromStepWithMetadata = (step) => fromStep(map$13(step, (f) => {
12993
12993
  * @since 4.0.0
12994
12994
  * @category destructors
12995
12995
  */
12996
- const toStep = (schedule) => catchCause$4(schedule.step, (cause) => succeed$8(() => failCause$6(cause)));
12996
+ const toStep = (schedule) => catchCause$3(schedule.step, (cause) => succeed$8(() => failCause$5(cause)));
12997
12997
  /**
12998
12998
  * Extracts a step function from a Schedule that provides metadata about each
12999
12999
  * execution. It will also handle sleeping for the computed delay.
@@ -13126,7 +13126,7 @@ const either = /* @__PURE__ */ dual(2, (self, other) => eitherWith(self, other,
13126
13126
  */
13127
13127
  const eitherWith = /* @__PURE__ */ dual(3, (self, other, combine) => fromStep(map$13(zip$1(toStep(self), toStep(other)), ([stepLeft, stepRight]) => (now, input) => matchEffect$1(stepLeft(now, input), {
13128
13128
  onSuccess: (leftResult) => stepRight(now, input).pipe(map$13((rightResult) => [combine(leftResult[0], rightResult[0]), min$2(leftResult[1], rightResult[1])]), catchDone((rightDone) => succeed$8([combine(leftResult[0], rightDone), leftResult[1]]))),
13129
- onFailure: failCause$6,
13129
+ onFailure: failCause$5,
13130
13130
  onDone: (leftDone) => stepRight(now, input).pipe(map$13((rightResult) => [combine(leftDone, rightResult[0]), rightResult[1]]), catchDone((rightDone) => done(combine(leftDone, rightDone))))
13131
13131
  }))));
13132
13132
  /**
@@ -13259,7 +13259,7 @@ const jittered = (self) => modifyDelay(self, (_, delay) => map$13(randomNext, (r
13259
13259
  */
13260
13260
  const passthrough$2 = (self) => fromStep(map$13(toStep(self), (step) => (now, input) => matchEffect$1(step(now, input), {
13261
13261
  onSuccess: (result) => succeed$8([input, result[1]]),
13262
- onFailure: failCause$6,
13262
+ onFailure: failCause$5,
13263
13263
  onDone: () => done(input)
13264
13264
  })));
13265
13265
  /**
@@ -14296,7 +14296,7 @@ const fail$6 = fail$9;
14296
14296
  * @since 2.0.0
14297
14297
  * @category Creating Effects
14298
14298
  */
14299
- const failCause$3 = failCause$6;
14299
+ const failCause$2 = failCause$5;
14300
14300
  /**
14301
14301
  * Creates an effect that terminates a fiber with a specified error.
14302
14302
  *
@@ -15095,7 +15095,7 @@ const catchReason$2 = catchReason$3;
15095
15095
  * @since 4.0.0
15096
15096
  * @category Error Handling
15097
15097
  */
15098
- const catchCause$2 = catchCause$4;
15098
+ const catchCause$1 = catchCause$3;
15099
15099
  /**
15100
15100
  * Recovers from all defects using a provided recovery function.
15101
15101
  *
@@ -15660,7 +15660,7 @@ const timeout = timeout$1;
15660
15660
  * @since 3.1.0
15661
15661
  * @category Delays & Timeouts
15662
15662
  */
15663
- const timeoutOrElse$1 = timeoutOrElse$2;
15663
+ const timeoutOrElse = timeoutOrElse$1;
15664
15664
  /**
15665
15665
  * Returns an effect that is delayed from this effect by the specified
15666
15666
  * `Duration`.
@@ -26766,7 +26766,7 @@ const offerAllUnsafe = (self, messages) => {
26766
26766
  * @category Completion
26767
26767
  * @since 4.0.0
26768
26768
  */
26769
- const fail$4 = (self, error) => failCause$2(self, causeFail(error));
26769
+ const fail$4 = (self, error) => failCause$1(self, causeFail(error));
26770
26770
  /**
26771
26771
  * Fail the queue with a cause. If the queue is already done, `false` is
26772
26772
  * returned.
@@ -26793,7 +26793,7 @@ const fail$4 = (self, error) => failCause$2(self, causeFail(error));
26793
26793
  * @category Completion
26794
26794
  * @since 4.0.0
26795
26795
  */
26796
- const failCause$2 = /* @__PURE__ */ dual(2, (self, cause) => sync$2(() => failCauseUnsafe(self, cause)));
26796
+ const failCause$1 = /* @__PURE__ */ dual(2, (self, cause) => sync$2(() => failCauseUnsafe(self, cause)));
26797
26797
  /**
26798
26798
  * Fail the queue with a cause synchronously. If the queue is already done, `false` is
26799
26799
  * returned.
@@ -26870,7 +26870,7 @@ const failCauseUnsafe = (self, cause) => {
26870
26870
  * @category Completion
26871
26871
  * @since 4.0.0
26872
26872
  */
26873
- const end = (self) => failCause$2(self, causeFail(Done$1()));
26873
+ const end = (self) => failCause$1(self, causeFail(Done$1()));
26874
26874
  /**
26875
26875
  * Signal that the queue is complete synchronously. If the queue is already done, `false` is
26876
26876
  * returned.
@@ -27514,7 +27514,7 @@ const ChannelProto = {
27514
27514
  */
27515
27515
  const fromTransform$1 = (transform) => {
27516
27516
  const self = Object.create(ChannelProto);
27517
- self.transform = (upstream, scope) => catchCause$2(transform(upstream, scope), (cause) => succeed$4(failCause$3(cause)));
27517
+ self.transform = (upstream, scope) => catchCause$1(transform(upstream, scope), (cause) => succeed$4(failCause$2(cause)));
27518
27518
  return self;
27519
27519
  };
27520
27520
  /**
@@ -27806,7 +27806,7 @@ const fail$3 = (error) => fromPull$1(succeed$4(fail$6(error)));
27806
27806
  * @since 2.0.0
27807
27807
  * @category constructors
27808
27808
  */
27809
- const failCause$1 = (cause) => fromPull$1(failCause$3(cause));
27809
+ const failCause = (cause) => fromPull$1(failCause$2(cause));
27810
27810
  /**
27811
27811
  * Constructs a channel that fails immediately with the specified defect.
27812
27812
  *
@@ -27830,7 +27830,7 @@ const failCause$1 = (cause) => fromPull$1(failCause$3(cause));
27830
27830
  * @since 2.0.0
27831
27831
  * @category constructors
27832
27832
  */
27833
- const die$1 = (defect) => failCause$1(die$3(defect));
27833
+ const die$1 = (defect) => failCause(die$3(defect));
27834
27834
  /**
27835
27835
  * Use an effect to write a single value to the channel.
27836
27836
  *
@@ -28289,17 +28289,17 @@ const mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntrace
28289
28289
  const semaphore = makeUnsafe$9(concurrencyN);
28290
28290
  const release = constant(semaphore.release(1));
28291
28291
  const handle = matchCauseEffect({
28292
- onFailure: (cause) => flatMap$5(failCause$2(queue, cause), release),
28292
+ onFailure: (cause) => flatMap$5(failCause$1(queue, cause), release),
28293
28293
  onSuccess: (value) => flatMap$5(offer(queue, value), release)
28294
28294
  });
28295
28295
  yield* semaphore.take(1).pipe(flatMap$5(() => pull), flatMap$5((value) => {
28296
28296
  trackFiber(runFork(handle(f(value, i++))));
28297
28297
  return void_$2;
28298
- }), forever({ disableYield: true }), catchCause$2((cause) => semaphore.withPermits(concurrencyN - 1)(failCause$2(queue, cause))), forkIn(forkedScope));
28298
+ }), forever({ disableYield: true }), catchCause$1((cause) => semaphore.withPermits(concurrencyN - 1)(failCause$1(queue, cause))), forkIn(forkedScope));
28299
28299
  } else {
28300
28300
  const effects = yield* bounded(concurrencyN - 2);
28301
28301
  yield* addFinalizer$1(forkedScope, shutdown(queue));
28302
- yield* take$1(effects).pipe(flatten$1, flatMap$5((value) => offer(queue, value)), forever({ disableYield: true }), catchCause$2((cause) => failCause$2(queue, cause)), forkIn(forkedScope));
28302
+ yield* take$1(effects).pipe(flatten$1, flatMap$5((value) => offer(queue, value)), forever({ disableYield: true }), catchCause$1((cause) => failCause$1(queue, cause)), forkIn(forkedScope));
28303
28303
  let errorCause;
28304
28304
  const onExit = (exit) => {
28305
28305
  if (exit._tag === "Success") return;
@@ -28307,12 +28307,12 @@ const mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntrace
28307
28307
  failCauseUnsafe(queue, exit.cause);
28308
28308
  };
28309
28309
  yield* pull.pipe(flatMap$5((value) => {
28310
- if (errorCause) return failCause$3(errorCause);
28310
+ if (errorCause) return failCause$2(errorCause);
28311
28311
  const fiber = runFork(f(value, i++));
28312
28312
  trackFiber(fiber);
28313
28313
  fiber.addObserver(onExit);
28314
28314
  return offer(effects, join$2(fiber));
28315
- }), forever({ disableYield: true }), catchCause$2((cause) => offer(effects, failCause$5(cause)).pipe(andThen(failCause$2(effects, cause)))), forkIn(forkedScope));
28315
+ }), forever({ disableYield: true }), catchCause$1((cause) => offer(effects, failCause$4(cause)).pipe(andThen(failCause$1(effects, cause)))), forkIn(forkedScope));
28316
28316
  }
28317
28317
  return take$1(queue);
28318
28318
  }));
@@ -28511,14 +28511,14 @@ const filterMapArrayEffect = /* @__PURE__ */ dual(2, (self, filter) => transform
28511
28511
  * @since 4.0.0
28512
28512
  * @category Error handling
28513
28513
  */
28514
- const catchCause$1 = /* @__PURE__ */ dual(2, (self, f) => fromTransform$1((upstream, scope) => {
28514
+ const catchCause = /* @__PURE__ */ dual(2, (self, f) => fromTransform$1((upstream, scope) => {
28515
28515
  let forkedScope = forkUnsafe(scope);
28516
28516
  return map$10(toTransform(self)(upstream, forkedScope), (pull) => {
28517
- let currentPull = pull.pipe(catchCause$2((cause) => {
28518
- if (isDoneCause(cause)) return failCause$3(cause);
28517
+ let currentPull = pull.pipe(catchCause$1((cause) => {
28518
+ if (isDoneCause(cause)) return failCause$2(cause);
28519
28519
  const toClose = forkedScope;
28520
28520
  forkedScope = forkUnsafe(scope);
28521
- return close(toClose, failCause$5(cause)).pipe(andThen(toTransform(f(cause))(upstream, forkedScope)), flatMap$5((childPull) => {
28521
+ return close(toClose, failCause$4(cause)).pipe(andThen(toTransform(f(cause))(upstream, forkedScope)), flatMap$5((childPull) => {
28522
28522
  currentPull = childPull;
28523
28523
  return childPull;
28524
28524
  }));
@@ -28530,9 +28530,9 @@ const catchCause$1 = /* @__PURE__ */ dual(2, (self, f) => fromTransform$1((upstr
28530
28530
  * @since 4.0.0
28531
28531
  * @category Error handling
28532
28532
  */
28533
- const catchCauseFilter = /* @__PURE__ */ dual(3, (self, filter, f) => catchCause$1(self, (cause) => {
28533
+ const catchCauseFilter = /* @__PURE__ */ dual(3, (self, filter, f) => catchCause(self, (cause) => {
28534
28534
  const result = filter(cause);
28535
- return isFailure$4(result) ? failCause$1(result.failure) : f(result.success, cause);
28535
+ return isFailure$4(result) ? failCause(result.failure) : f(result.success, cause);
28536
28536
  }));
28537
28537
  const catch_$1 = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter(self, findError, (e) => f(e)));
28538
28538
  /**
@@ -28712,18 +28712,18 @@ const mergeAll$1 = /* @__PURE__ */ dual(2, (channels, { bufferSize = 16, concurr
28712
28712
  }
28713
28713
  const fiber = yield* childPull.pipe(tap$1(() => yieldNow), flatMap$5((value) => offer(queue, value)), forever({ disableYield: true }), onError(fnUntraced(function* (cause) {
28714
28714
  const halt = filterDone(cause);
28715
- yield* exit(close(childScope, !isFailure$4(halt) ? succeed$7(halt.success.value) : failCause$5(halt.failure)));
28715
+ yield* exit(close(childScope, !isFailure$4(halt) ? succeed$7(halt.success.value) : failCause$4(halt.failure)));
28716
28716
  if (!fibers.has(fiber)) return;
28717
28717
  fibers.delete(fiber);
28718
28718
  if (semaphore) yield* semaphore.release(1);
28719
28719
  if (fibers.size === 0) yield* doneLatch.open;
28720
28720
  if (isSuccess$5(halt)) return;
28721
- return yield* failCause$2(queue, cause);
28721
+ return yield* failCause$1(queue, cause);
28722
28722
  })), forkChild);
28723
28723
  doneLatch.closeUnsafe();
28724
28724
  fibers.add(fiber);
28725
28725
  }
28726
- }).pipe(catchCause$2((cause) => doneLatch.whenOpen(failCause$2(queue, cause))), forkIn(forkedScope));
28726
+ }).pipe(catchCause$1((cause) => doneLatch.whenOpen(failCause$1(queue, cause))), forkIn(forkedScope));
28727
28727
  return take$1(queue);
28728
28728
  })));
28729
28729
  /**
@@ -28761,12 +28761,12 @@ const merge$5 = /* @__PURE__ */ dual((args) => isChannel(args[0]) && isChannel(a
28761
28761
  let done = 0;
28762
28762
  function onExit(side, cause) {
28763
28763
  done++;
28764
- if (!isDoneCause(cause)) return failCause$2(queue, cause);
28764
+ if (!isDoneCause(cause)) return failCause$1(queue, cause);
28765
28765
  switch (strategy) {
28766
- case "both": return done === 2 ? failCause$2(queue, cause) : void_$2;
28766
+ case "both": return done === 2 ? failCause$1(queue, cause) : void_$2;
28767
28767
  case "left":
28768
- case "right": return side === strategy ? failCause$2(queue, cause) : void_$2;
28769
- case "either": return failCause$2(queue, cause);
28768
+ case "right": return side === strategy ? failCause$1(queue, cause) : void_$2;
28769
+ case "either": return failCause$1(queue, cause);
28770
28770
  }
28771
28771
  }
28772
28772
  const runSide = (side, channel, scope) => toTransform(channel)(upstream, scope).pipe(flatMap$5((pull) => pull.pipe(flatMap$5((value) => offer(queue, value)), forever)), onError((cause) => andThen(close(scope, doneExitFromCause(cause)), onExit(side, cause))), forkIn(forkedScope));
@@ -29106,7 +29106,7 @@ const toPull$1 = /* @__PURE__ */ fnUntraced(function* (self) {
29106
29106
  const context = yield* services();
29107
29107
  const scope = get$16(context, Scope);
29108
29108
  return (yield* toTransform(self)(done(), scope)).pipe(provideServices$2(context), semaphore.withPermits(1));
29109
- }, /* @__PURE__ */ catchCause$2((cause) => succeed$4(failCause$3(cause))));
29109
+ }, /* @__PURE__ */ catchCause$1((cause) => succeed$4(failCause$2(cause))));
29110
29110
  /**
29111
29111
  * Converts a channel to a Pull within an existing scope.
29112
29112
  *
@@ -30381,30 +30381,6 @@ const suspend$1 = (stream) => fromChannel(suspend$2(() => stream().channel));
30381
30381
  */
30382
30382
  const fail$2 = (error) => fromChannel(fail$3(error));
30383
30383
  /**
30384
- * Creates a stream that fails with the specified `Cause`.
30385
- *
30386
- * @example
30387
- * ```ts
30388
- * import { Cause, Console, Effect, Stream } from "effect"
30389
- *
30390
- * const stream = Stream.failCause(Cause.fail("Database connection failed")).pipe(
30391
- * Stream.catchCause(() => Stream.succeed("recovered"))
30392
- * )
30393
- *
30394
- * const program = Effect.gen(function*() {
30395
- * const values = yield* Stream.runCollect(stream)
30396
- * yield* Console.log(values)
30397
- * // Output: [ "recovered" ]
30398
- * })
30399
- *
30400
- * Effect.runPromise(program)
30401
- * ```
30402
- *
30403
- * @since 2.0.0
30404
- * @category Constructors
30405
- */
30406
- const failCause = (cause) => fromChannel(failCause$1(cause));
30407
- /**
30408
30384
  * The stream that dies with the specified defect.
30409
30385
  *
30410
30386
  * @example
@@ -30936,43 +30912,6 @@ const switchMap = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, f, op
30936
30912
  */
30937
30913
  const flatten = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => flatMap$3(self, identity, options));
30938
30914
  /**
30939
- * @since 2.0.0
30940
- * @category Rate Limiting
30941
- */
30942
- const timeoutOrElse = /* @__PURE__ */ dual(2, (self, options) => {
30943
- const duration = fromInputUnsafe(options.duration);
30944
- if (!isFinite$2(duration)) return self;
30945
- if (isZero$1(duration)) return suspend$1(options.orElse);
30946
- const timeoutSymbol = Symbol();
30947
- return catchCause(suspend$1(() => {
30948
- const clock = getCurrent().getRef(Clock);
30949
- const durationMs = toMillis(duration);
30950
- let deadline = void 0;
30951
- const latch = makeUnsafe$10(false);
30952
- return merge$4(transformPull(self, (pull, _scope) => suspend$3(() => {
30953
- deadline = clock.currentTimeMillisUnsafe() + durationMs;
30954
- latch.openUnsafe();
30955
- return pull;
30956
- }).pipe(map$10((arr) => {
30957
- latch.closeUnsafe();
30958
- deadline = void 0;
30959
- return arr;
30960
- }), succeed$4)), fromEffectDrain(gen(function* () {
30961
- while (true) {
30962
- yield* latch.await;
30963
- if (deadline === void 0) continue;
30964
- yield* sleep(deadline - clock.currentTimeMillisUnsafe());
30965
- if (deadline === void 0) continue;
30966
- if (deadline - clock.currentTimeMillisUnsafe() > 0) continue;
30967
- return yield* die$2(timeoutSymbol);
30968
- }
30969
- })), { haltStrategy: "left" });
30970
- }), (cause) => {
30971
- if (cause.reasons.find((r) => r._tag === "Die" && r.defect === timeoutSymbol)) return options.orElse();
30972
- return failCause(cause);
30973
- });
30974
- });
30975
- /**
30976
30915
  * Submerges the iterables emitted by this stream into the stream's structure.
30977
30916
  *
30978
30917
  * **Previously Known As**
@@ -31142,43 +31081,6 @@ const filterMap$2 = /* @__PURE__ */ dual(2, (self, filter) => fromChannel(filter
31142
31081
  * @category Filtering
31143
31082
  */
31144
31083
  const filterMapEffect = /* @__PURE__ */ dual(2, (self, filter) => fromChannel(filterMapArrayEffect(toChannel(self), filter)));
31145
- /**
31146
- * Switches over to the stream produced by the provided function in case this
31147
- * one fails. Allows recovery from all causes of failure, including
31148
- * interruption if the stream is uninterruptible.
31149
- *
31150
- * **Previously Known As**
31151
- *
31152
- * This API replaces the following from Effect 3.x:
31153
- *
31154
- * - `Stream.catchAllCause`
31155
- *
31156
- * @example
31157
- * ```ts
31158
- * import { Console, Effect, Stream } from "effect"
31159
- *
31160
- * const stream = Stream.make(1, 2).pipe(
31161
- * Stream.concat(Stream.fail("Oops!")),
31162
- * Stream.concat(Stream.make(3, 4))
31163
- * )
31164
- *
31165
- * const recovered = stream.pipe(
31166
- * Stream.catchCause(() => Stream.make(999))
31167
- * )
31168
- *
31169
- * const program = Effect.gen(function*() {
31170
- * const values = yield* Stream.runCollect(recovered)
31171
- * yield* Console.log(values)
31172
- * })
31173
- *
31174
- * Effect.runPromise(program)
31175
- * // Output: [ 1, 2, 999 ]
31176
- * ```
31177
- *
31178
- * @since 4.0.0
31179
- * @category Error Handling
31180
- */
31181
- const catchCause = /* @__PURE__ */ dual(2, (self, f) => self.channel.pipe(catchCause$1((cause) => f(cause).channel), fromChannel));
31182
31084
  const catch_ = /* @__PURE__ */ dual(2, (self, f) => fromChannel(catch_$1(self.channel, (error) => f(error).channel)));
31183
31085
  /**
31184
31086
  * Recovers from errors that match a predicate by switching to a recovery stream.
@@ -31586,7 +31488,7 @@ const debounce = /* @__PURE__ */ dual(2, (self, duration) => transformPull(self,
31586
31488
  const eff = succeed$4(of$1(lastNonEmpty(lastArr)));
31587
31489
  lastArr = void 0;
31588
31490
  return eff;
31589
- } else if (cause) return failCause$3(cause);
31491
+ } else if (cause) return failCause$2(cause);
31590
31492
  return loop();
31591
31493
  });
31592
31494
  });
@@ -31597,7 +31499,7 @@ const debounce = /* @__PURE__ */ dual(2, (self, duration) => transformPull(self,
31597
31499
  lastArr = void 0;
31598
31500
  return eff;
31599
31501
  }
31600
- return failCause$3(cause);
31502
+ return failCause$2(cause);
31601
31503
  }
31602
31504
  pullLatch.openUnsafe();
31603
31505
  return emitLatch.whenOpen(sleepLoop);
@@ -36817,7 +36719,7 @@ function Exit(value, error, defect) {
36817
36719
  onFailure: (issue) => new Composite(ast, some$2(input), [new Pointer(["value"], issue)])
36818
36720
  });
36819
36721
  case "Failure": return mapBothEager(decodeUnknownEffect$1(cause)(input.cause, options), {
36820
- onSuccess: failCause$5,
36722
+ onSuccess: failCause$4,
36821
36723
  onFailure: (issue) => new Composite(ast, some$2(input), [new Pointer(["cause"], issue)])
36822
36724
  });
36823
36725
  }
@@ -36837,7 +36739,7 @@ function Exit(value, error, defect) {
36837
36739
  _tag: Literal("Failure"),
36838
36740
  cause: Cause(error, defect)
36839
36741
  })]), transform$3({
36840
- decode: (e) => e._tag === "Success" ? succeed$7(e.value) : failCause$5(e.cause),
36742
+ decode: (e) => e._tag === "Success" ? succeed$7(e.value) : failCause$4(e.cause),
36841
36743
  encode: (exit) => isSuccess$3(exit) ? {
36842
36744
  _tag: "Success",
36843
36745
  value: exit.value
@@ -36849,7 +36751,7 @@ function Exit(value, error, defect) {
36849
36751
  toArbitrary: ([value, error, defect]) => (fc, ctx) => fc.oneof(ctx?.isSuspend ? {
36850
36752
  maxDepth: 2,
36851
36753
  depthIdentifier: "Exit"
36852
- } : {}, value.map((v) => succeed$7(v)), causeToArbitrary(error, defect)(fc, ctx).map((cause) => failCause$5(cause))),
36754
+ } : {}, value.map((v) => succeed$7(v)), causeToArbitrary(error, defect)(fc, ctx).map((cause) => failCause$4(cause))),
36853
36755
  toEquivalence: ([value, error, defect]) => {
36854
36756
  const cause = causeToEquivalence(error, defect);
36855
36757
  return (a, b) => {
@@ -57068,7 +56970,7 @@ const makeUnsafe = (scope, value) => {
57068
56970
  */
57069
56971
  const fromAcquire = /* @__PURE__ */ fnUntraced(function* (acquire) {
57070
56972
  const scope = makeUnsafe$13();
57071
- const self = makeUnsafe(scope, yield* acquire.pipe(provide$4(scope), tapCause((cause) => close(scope, failCause$5(cause)))));
56973
+ const self = makeUnsafe(scope, yield* acquire.pipe(provide$4(scope), tapCause((cause) => close(scope, failCause$4(cause)))));
57072
56974
  yield* addFinalizer((exit) => close(self.backing.backing.ref.current[0], exit));
57073
56975
  return self;
57074
56976
  }, uninterruptible);
@@ -57100,7 +57002,7 @@ const get$7 = (self) => sync(() => getUnsafe(self));
57100
57002
  const set$4 = /* @__PURE__ */ dual(2, /* @__PURE__ */ fnUntraced(function* (self, acquire) {
57101
57003
  yield* close(self.backing.backing.ref.current[0], void_$3);
57102
57004
  const scope = makeUnsafe$13();
57103
- const value = yield* acquire.pipe(provide$4(scope), tapCause((cause) => close(scope, failCause$5(cause))));
57005
+ const value = yield* acquire.pipe(provide$4(scope), tapCause((cause) => close(scope, failCause$4(cause))));
57104
57006
  self.backing.backing.ref.current = [scope, value];
57105
57007
  }, uninterruptible, (effect, self) => self.backing.semaphore.withPermit(effect)));
57106
57008
  //#endregion
@@ -59543,7 +59445,7 @@ const layer$30 = /* @__PURE__ */ effect$1(ChildProcessSpawner, /* @__PURE__ */ g
59543
59445
  });
59544
59446
  const withTimeout = (childProcess, command, options) => (kill) => {
59545
59447
  const killSignal = options?.killSignal ?? "SIGTERM";
59546
- return isUndefined(options?.forceKillAfter) ? kill(command, childProcess, killSignal) : timeoutOrElse$1(kill(command, childProcess, killSignal), {
59448
+ return isUndefined(options?.forceKillAfter) ? kill(command, childProcess, killSignal) : timeoutOrElse(kill(command, childProcess, killSignal), {
59547
59449
  duration: options.forceKillAfter,
59548
59450
  orElse: () => kill(command, childProcess, "SIGKILL")
59549
59451
  });
@@ -61092,7 +60994,7 @@ const make$40 = (f) => makeWith((effect) => flatMap$5(effect, (request) => withF
61092
60994
  },
61093
60995
  onFailure(cause) {
61094
60996
  if (hasInterrupts(cause)) controller.abort();
61095
- return failCause$3(cause);
60997
+ return failCause$2(cause);
61096
60998
  }
61097
60999
  }));
61098
61000
  }
@@ -61120,7 +61022,7 @@ const make$40 = (f) => makeWith((effect) => flatMap$5(effect, (request) => withF
61120
61022
  },
61121
61023
  onFailure(cause) {
61122
61024
  if (!scopedController && hasInterrupts(cause)) controller.abort();
61123
- return failCause$3(cause);
61025
+ return failCause$2(cause);
61124
61026
  }
61125
61027
  })));
61126
61028
  });
@@ -62042,7 +61944,7 @@ const notFound = /* @__PURE__ */ empty$2({ status: 404 });
62042
61944
  */
62043
61945
  const toResponseOrElse = (u, orElse) => {
62044
61946
  if (isHttpServerResponse(u)) return succeed$4(u);
62045
- else if (isRespondable(u)) return catchCause$2(u[symbol](), () => succeed$4(orElse));
61947
+ else if (isRespondable(u)) return catchCause$1(u[symbol](), () => succeed$4(orElse));
62046
61948
  else if (isSchemaError(u)) return succeed$4(badRequest);
62047
61949
  else if (isNoSuchElementError(u)) return succeed$4(notFound);
62048
61950
  return succeed$4(orElse);
@@ -62053,7 +61955,7 @@ const toResponseOrElse = (u, orElse) => {
62053
61955
  */
62054
61956
  const toResponseOrElseDefect = (u, orElse) => {
62055
61957
  if (isHttpServerResponse(u)) return succeed$4(u);
62056
- else if (isRespondable(u)) return catchCause$2(u[symbol](), () => succeed$4(orElse));
61958
+ else if (isRespondable(u)) return catchCause$1(u[symbol](), () => succeed$4(orElse));
62057
61959
  return succeed$4(orElse);
62058
61960
  };
62059
61961
  //#endregion
@@ -62424,7 +62326,7 @@ const fromWebSocket = (acquire, options) => withFiber((fiber) => {
62424
62326
  open = true;
62425
62327
  doneUnsafe(openDeferred, void_$2);
62426
62328
  }, { once: true });
62427
- yield* _await(openDeferred).pipe(timeoutOrElse$1({
62329
+ yield* _await(openDeferred).pipe(timeoutOrElse({
62428
62330
  duration: options?.openTimeout ?? 1e4,
62429
62331
  orElse: () => fail$6(new SocketError({ reason: new SocketOpenError({
62430
62332
  kind: "Timeout",
@@ -63631,7 +63533,7 @@ const toHandled = (self, handleResponse, middleware) => {
63631
63533
  reportCauseUnsafe(fiber, cause);
63632
63534
  const request = getUnsafe$4(fiber.services, HttpServerRequest);
63633
63535
  const handler = requestPreResponseHandlers.get(request.source);
63634
- const cont = cause.reasons.length === 0 ? succeed$4(response) : failCause$3(cause);
63536
+ const cont = cause.reasons.length === 0 ? succeed$4(response) : failCause$2(cause);
63635
63537
  if (handler === void 0) {
63636
63538
  request[handledSymbol] = true;
63637
63539
  return flatMapEager(handleResponse(request, response), () => cont);
@@ -64423,7 +64325,7 @@ const makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options
64423
64325
  const clearEntries = fnUntraced(function* (exit) {
64424
64326
  for (const [id, entry] of entries) {
64425
64327
  entries.delete(id);
64426
- if (entry._tag === "Queue") yield* exit._tag === "Success" ? end(entry.queue) : failCause$2(entry.queue, exit.cause);
64328
+ if (entry._tag === "Queue") yield* exit._tag === "Success" ? end(entry.queue) : failCause$1(entry.queue, exit.cause);
64427
64329
  else entry.resume(exit);
64428
64330
  }
64429
64331
  });
@@ -64519,7 +64421,7 @@ const makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options
64519
64421
  sampled: span.sampled
64520
64422
  } : {},
64521
64423
  headers: merge$3(fiber.getRef(CurrentHeaders), headers)
64522
- }).pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity, catchCause$2((error) => failCause$2(queue, error)), interruptible, forkIn(scope, { startImmediately: true }));
64424
+ }).pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity, catchCause$1((error) => failCause$1(queue, error)), interruptible, forkIn(scope, { startImmediately: true }));
64523
64425
  return queue;
64524
64426
  });
64525
64427
  const getRpcClientMiddleware = (rpc) => {
@@ -64568,7 +64470,7 @@ const makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options
64568
64470
  },
64569
64471
  context: entry.context,
64570
64472
  discard: false
64571
- })) : identity, catchCause$2((cause) => failCause$2(entry.queue, cause)));
64473
+ })) : identity, catchCause$1((cause) => failCause$1(entry.queue, cause)));
64572
64474
  }
64573
64475
  case "Exit": {
64574
64476
  const requestId = message.requestId;
@@ -64579,7 +64481,7 @@ const makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options
64579
64481
  entry.resume(message.exit);
64580
64482
  return void_$2;
64581
64483
  }
64582
- return message.exit._tag === "Success" ? end(entry.queue) : failCause$2(entry.queue, message.exit.cause);
64484
+ return message.exit._tag === "Success" ? end(entry.queue) : failCause$1(entry.queue, message.exit.cause);
64583
64485
  }
64584
64486
  case "Defect": return clearEntries(die$4(message.defect));
64585
64487
  case "ClientEnd": return void_$2;
@@ -64668,7 +64570,7 @@ const make$27 = /* @__PURE__ */ fnUntraced(function* (group, options) {
64668
64570
  _tag: "Exit",
64669
64571
  clientId: 0,
64670
64572
  requestId: RequestId(message.requestId),
64671
- exit: failCause$5(cause)
64573
+ exit: failCause$4(cause)
64672
64574
  })));
64673
64575
  }
64674
64576
  case "Exit": {
@@ -64687,7 +64589,7 @@ const make$27 = /* @__PURE__ */ fnUntraced(function* (group, options) {
64687
64589
  _tag: "Exit",
64688
64590
  clientId: 0,
64689
64591
  requestId,
64690
- exit: failCause$5(cause)
64592
+ exit: failCause$4(cause)
64691
64593
  })
64692
64594
  }));
64693
64595
  }
@@ -64707,7 +64609,7 @@ const make$27 = /* @__PURE__ */ fnUntraced(function* (group, options) {
64707
64609
  }
64708
64610
  default: return void_$2;
64709
64611
  }
64710
- }).pipe(catchCause$2(logError), interruptible, forkScoped);
64612
+ }).pipe(catchCause$1(logError), interruptible, forkScoped);
64711
64613
  return client;
64712
64614
  });
64713
64615
  const rpcSchemasCache = /* @__PURE__ */ new WeakMap();
@@ -64958,7 +64860,7 @@ const make$25 = ({ dumpSchema = () => void_$2 }) => ({ loader, schemaDirectory,
64958
64860
  });
64959
64861
  yield* ensureMigrationsTable;
64960
64862
  const completed = yield* pipe$1(sql.withTransaction(run), catchTag$1("MigrationError", (_) => _.kind === "Locked" ? as$1(logDebug(_.message), []) : fail$6(_)));
64961
- if (schemaDirectory && completed.length > 0) yield* dumpSchema(`${schemaDirectory}/_schema.sql`, table).pipe(catchCause$2((cause) => logInfo("Could not dump schema", cause)));
64863
+ if (schemaDirectory && completed.length > 0) yield* dumpSchema(`${schemaDirectory}/_schema.sql`, table).pipe(catchCause$1((cause) => logInfo("Could not dump schema", cause)));
64962
64864
  return completed;
64963
64865
  });
64964
64866
  const migrationOrder = /* @__PURE__ */ make$91(([a], [b]) => Number$5(a, b));
@@ -90915,7 +90817,7 @@ const make$20 = /* @__PURE__ */ fnUntraced(function* (evaluate, options) {
90915
90817
  else resume(void_$2);
90916
90818
  });
90917
90819
  }).pipe(cached$1);
90918
- const preemptiveShutdown = options.disablePreemptiveShutdown ? void_$2 : timeoutOrElse$1(shutdown, {
90820
+ const preemptiveShutdown = options.disablePreemptiveShutdown ? void_$2 : timeoutOrElse(shutdown, {
90919
90821
  duration: options.gracefulShutdownTimeout ?? seconds(20),
90920
90822
  orElse: () => void_$2
90921
90823
  });
@@ -91187,7 +91089,7 @@ const handleCause = (nodeResponse, originalResponse) => (originalCause) => flatM
91187
91089
  const headersSent = nodeResponse.headersSent;
91188
91090
  if (!headersSent) nodeResponse.writeHead(response.status);
91189
91091
  if (!nodeResponse.writableEnded) nodeResponse.end();
91190
- return failCause$3(headersSent ? combine$1(originalCause, die$3(originalResponse)) : cause);
91092
+ return failCause$2(headersSent ? combine$1(originalCause, die$3(originalResponse)) : cause);
91191
91093
  });
91192
91094
  //#endregion
91193
91095
  //#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.40_effect@4.0.0-beta.40_ioredis@5.10.0/node_modules/@effect/platform-node/dist/NodeRuntime.js
@@ -91783,7 +91685,7 @@ const getOrThrow = (self) => getOrThrowWith$1(value(self), () => new NoSuchEleme
91783
91685
  const toExit = (self) => {
91784
91686
  switch (self._tag) {
91785
91687
  case "Success": return succeed$7(self.value);
91786
- case "Failure": return failCause$5(self.cause);
91688
+ case "Failure": return failCause$4(self.cause);
91787
91689
  default: return fail$8(new NoSuchElementError());
91788
91690
  }
91789
91691
  };
@@ -92211,7 +92113,7 @@ const LifetimeProto = {
92211
92113
  if (options?.suspendOnWaiting && result.waiting) return never$5;
92212
92114
  switch (result._tag) {
92213
92115
  case "Initial": return never$5;
92214
- case "Failure": return failCause$5(result.cause);
92116
+ case "Failure": return failCause$4(result.cause);
92215
92117
  case "Success": return succeed$4(result.value);
92216
92118
  }
92217
92119
  },
@@ -92287,7 +92189,7 @@ const LifetimeProto = {
92287
92189
  }));
92288
92190
  },
92289
92191
  streamResult(atom, options) {
92290
- return this.stream(atom, options).pipe(filter$3(isNotInitial), mapEffect$1((result) => result._tag === "Success" ? succeed$4(result.value) : failCause$3(result.cause)));
92192
+ return this.stream(atom, options).pipe(filter$3(isNotInitial), mapEffect$1((result) => result._tag === "Success" ? succeed$4(result.value) : failCause$2(result.cause)));
92291
92193
  },
92292
92194
  dispose() {
92293
92195
  this.disposed = true;
@@ -92630,7 +92532,7 @@ function makeStream(ctx, stream, initialValue, services = empty$16()) {
92630
92532
  step(arr) {
92631
92533
  ctx.setSelf(success(lastNonEmpty(arr), { waiting: true }));
92632
92534
  }
92633
- }))).pipe(catchCause$2((cause) => {
92535
+ }))).pipe(catchCause$1((cause) => {
92634
92536
  if (isDoneCause(cause)) pipe$1(ctx.self(), flatMap$9(value), match$10({
92635
92537
  onNone: () => ctx.setSelf(failWithPrevious(new NoSuchElementError(), { previous: ctx.self() })),
92636
92538
  onSome: (a) => ctx.setSelf(success(a))
@@ -92730,7 +92632,7 @@ const makeStreamPullEffect = (get, pullSignal, create, options) => flatMap$5(toP
92730
92632
  items: acc
92731
92633
  });
92732
92634
  }
92733
- return failCause$3(cause);
92635
+ return failCause$2(cause);
92734
92636
  },
92735
92637
  onSuccess(chunk) {
92736
92638
  let items;
@@ -182835,7 +182737,7 @@ var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(e
182835
182737
  });
182836
182738
  Ze.glob = Ze;
182837
182739
  //#endregion
182838
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/ApplyPatch.js
182740
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/ApplyPatch.js
182839
182741
  /**
182840
182742
  * @since 1.0.0
182841
182743
  */
@@ -183291,10 +183193,7 @@ function assignProp(target, prop, value) {
183291
183193
  }
183292
183194
  function mergeDefs(...defs) {
183293
183195
  const mergedDescriptors = {};
183294
- for (const def of defs) {
183295
- const descriptors = Object.getOwnPropertyDescriptors(def);
183296
- Object.assign(mergedDescriptors, descriptors);
183297
- }
183196
+ for (const def of defs) Object.assign(mergedDescriptors, Object.getOwnPropertyDescriptors(def));
183298
183197
  return Object.defineProperties({}, mergedDescriptors);
183299
183198
  }
183300
183199
  function esc(str) {
@@ -186501,7 +186400,7 @@ const optionalProcessor = (schema, ctx, _json, params) => {
186501
186400
  seen.ref = def.innerType;
186502
186401
  };
186503
186402
  //#endregion
186504
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
186403
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
186505
186404
  function isZ4Schema(s) {
186506
186405
  return !!s._zod;
186507
186406
  }
@@ -187275,7 +187174,7 @@ function number(params) {
187275
187174
  return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
187276
187175
  }
187277
187176
  //#endregion
187278
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
187177
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
187279
187178
  const LATEST_PROTOCOL_VERSION = "2025-11-25";
187280
187179
  const SUPPORTED_PROTOCOL_VERSIONS = [
187281
187180
  LATEST_PROTOCOL_VERSION,
@@ -188468,7 +188367,7 @@ var UrlElicitationRequiredError = class extends McpError {
188468
188367
  }
188469
188368
  };
188470
188369
  //#endregion
188471
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
188370
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
188472
188371
  /**
188473
188372
  * Experimental task interfaces for MCP SDK.
188474
188373
  * WARNING: These APIs are experimental and may change without notice.
@@ -188485,7 +188384,7 @@ function isTerminal(status) {
188485
188384
  return status === "completed" || status === "failed" || status === "cancelled";
188486
188385
  }
188487
188386
  //#endregion
188488
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
188387
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
188489
188388
  function getMethodLiteral(schema) {
188490
188389
  const methodSchema = getObjectShape(schema)?.method;
188491
188390
  if (!methodSchema) throw new Error("Schema is missing a method literal");
@@ -188679,6 +188578,8 @@ var Protocol = class {
188679
188578
  this._progressHandlers.clear();
188680
188579
  this._taskProgressTokens.clear();
188681
188580
  this._pendingDebouncedNotifications.clear();
188581
+ for (const info of this._timeoutInfo.values()) clearTimeout(info.timeoutId);
188582
+ this._timeoutInfo.clear();
188682
188583
  for (const controller of this._requestHandlerAbortControllers.values()) controller.abort();
188683
188584
  this._requestHandlerAbortControllers.clear();
188684
188585
  const error = McpError.fromError(ErrorCode.ConnectionClosed, "Connection closed");
@@ -188782,7 +188683,7 @@ var Protocol = class {
188782
188683
  }, capturedTransport?.sessionId);
188783
188684
  else await capturedTransport?.send(errorResponse);
188784
188685
  }).catch((error) => this._onerror(/* @__PURE__ */ new Error(`Failed to send response: ${error}`))).finally(() => {
188785
- this._requestHandlerAbortControllers.delete(request.id);
188686
+ if (this._requestHandlerAbortControllers.get(request.id) === abortController) this._requestHandlerAbortControllers.delete(request.id);
188786
188687
  });
188787
188688
  }
188788
188689
  _onprogress(notification) {
@@ -195416,7 +195317,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
195416
195317
  exports.default = formatsPlugin;
195417
195318
  }));
195418
195319
  //#endregion
195419
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
195320
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
195420
195321
  var import_ajv = /* @__PURE__ */ __toESM(require_ajv(), 1);
195421
195322
  var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
195422
195323
  function createDefaultAjvInstance() {
@@ -195492,7 +195393,7 @@ var AjvJsonSchemaValidator = class {
195492
195393
  }
195493
195394
  };
195494
195395
  //#endregion
195495
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
195396
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
195496
195397
  /**
195497
195398
  * Experimental client task features for MCP SDK.
195498
195399
  * WARNING: These APIs are experimental and may change without notice.
@@ -195665,7 +195566,7 @@ var ExperimentalClientTasks = class {
195665
195566
  }
195666
195567
  };
195667
195568
  //#endregion
195668
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
195569
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
195669
195570
  /**
195670
195571
  * Experimental task capability assertion helpers.
195671
195572
  * WARNING: These APIs are experimental and may change without notice.
@@ -195716,7 +195617,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
195716
195617
  }
195717
195618
  }
195718
195619
  //#endregion
195719
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
195620
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
195720
195621
  /**
195721
195622
  * Elicitation default application helper. Applies defaults to the data based on the schema.
195722
195623
  *
@@ -196196,7 +196097,7 @@ var Client = class extends Protocol {
196196
196097
  }
196197
196098
  };
196198
196099
  //#endregion
196199
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js
196100
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js
196200
196101
  /**
196201
196102
  * Normalizes HeadersInit to a plain Record<string, string> for manipulation.
196202
196103
  * Handles Headers objects, arrays of tuples, and plain objects.
@@ -196283,7 +196184,7 @@ async function pkceChallenge(length) {
196283
196184
  };
196284
196185
  }
196285
196186
  //#endregion
196286
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
196187
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
196287
196188
  /**
196288
196189
  * Reusable URL validation that disallows javascript: scheme
196289
196190
  */
@@ -196455,7 +196356,7 @@ object({
196455
196356
  token_type_hint: string().optional()
196456
196357
  }).strip();
196457
196358
  //#endregion
196458
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
196359
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
196459
196360
  /**
196460
196361
  * Utilities for handling OAuth resource URIs.
196461
196362
  */
@@ -196488,7 +196389,7 @@ function checkResourceAllowed({ requestedResource, configuredResource }) {
196488
196389
  return requestedPath.startsWith(configuredPath);
196489
196390
  }
196490
196391
  //#endregion
196491
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
196392
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
196492
196393
  /**
196493
196394
  * Base class for all OAuth errors
196494
196395
  */
@@ -196638,7 +196539,7 @@ const OAUTH_ERRORS = {
196638
196539
  [InvalidTargetError.errorCode]: InvalidTargetError
196639
196540
  };
196640
196541
  //#endregion
196641
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
196542
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
196642
196543
  var UnauthorizedError = class extends Error {
196643
196544
  constructor(message) {
196644
196545
  super(message ?? "Unauthorized");
@@ -196667,8 +196568,8 @@ const AUTHORIZATION_CODE_CHALLENGE_METHOD = "S256";
196667
196568
  */
196668
196569
  function selectClientAuthMethod(clientInformation, supportedMethods) {
196669
196570
  const hasClientSecret = clientInformation.client_secret !== void 0;
196670
- if (supportedMethods.length === 0) return hasClientSecret ? "client_secret_post" : "none";
196671
- if ("token_endpoint_auth_method" in clientInformation && clientInformation.token_endpoint_auth_method && isClientAuthMethod(clientInformation.token_endpoint_auth_method) && supportedMethods.includes(clientInformation.token_endpoint_auth_method)) return clientInformation.token_endpoint_auth_method;
196571
+ if ("token_endpoint_auth_method" in clientInformation && clientInformation.token_endpoint_auth_method && isClientAuthMethod(clientInformation.token_endpoint_auth_method) && (supportedMethods.length === 0 || supportedMethods.includes(clientInformation.token_endpoint_auth_method))) return clientInformation.token_endpoint_auth_method;
196572
+ if (supportedMethods.length === 0) return hasClientSecret ? "client_secret_basic" : "none";
196672
196573
  if (hasClientSecret && supportedMethods.includes("client_secret_basic")) return "client_secret_basic";
196673
196574
  if (hasClientSecret && supportedMethods.includes("client_secret_post")) return "client_secret_post";
196674
196575
  if (supportedMethods.includes("none")) return "none";
@@ -196801,6 +196702,7 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res
196801
196702
  });
196802
196703
  }
196803
196704
  const resource = await selectResourceURL(serverUrl, provider, resourceMetadata);
196705
+ const resolvedScope = scope || resourceMetadata?.scopes_supported?.join(" ") || provider.clientMetadata.scope;
196804
196706
  let clientInformation = await Promise.resolve(provider.clientInformation());
196805
196707
  if (!clientInformation) {
196806
196708
  if (authorizationCode !== void 0) throw new Error("Existing OAuth client information is required when exchanging an authorization code");
@@ -196815,6 +196717,7 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res
196815
196717
  const fullInformation = await registerClient(authorizationServerUrl, {
196816
196718
  metadata,
196817
196719
  clientMetadata: provider.clientMetadata,
196720
+ scope: resolvedScope,
196818
196721
  fetchFn
196819
196722
  });
196820
196723
  await provider.saveClientInformation(fullInformation);
@@ -196853,7 +196756,7 @@ async function authInternal(provider, { serverUrl, authorizationCode, scope, res
196853
196756
  clientInformation,
196854
196757
  state,
196855
196758
  redirectUrl: provider.redirectUrl,
196856
- scope: scope || resourceMetadata?.scopes_supported?.join(" ") || provider.clientMetadata.scope,
196759
+ scope: resolvedScope,
196857
196760
  resource
196858
196761
  });
196859
196762
  await provider.saveCodeVerifier(codeVerifier);
@@ -197241,8 +197144,12 @@ async function fetchToken(provider, authorizationServerUrl, { metadata, resource
197241
197144
  }
197242
197145
  /**
197243
197146
  * Performs OAuth 2.0 Dynamic Client Registration according to RFC 7591.
197147
+ *
197148
+ * If `scope` is provided, it overrides `clientMetadata.scope` in the registration
197149
+ * request body. This allows callers to apply the Scope Selection Strategy (SEP-835)
197150
+ * consistently across both DCR and the subsequent authorization request.
197244
197151
  */
197245
- async function registerClient(authorizationServerUrl, { metadata, clientMetadata, fetchFn }) {
197152
+ async function registerClient(authorizationServerUrl, { metadata, clientMetadata, scope, fetchFn }) {
197246
197153
  let registrationUrl;
197247
197154
  if (metadata) {
197248
197155
  if (!metadata.registration_endpoint) throw new Error("Incompatible auth server: does not support dynamic client registration");
@@ -197251,7 +197158,10 @@ async function registerClient(authorizationServerUrl, { metadata, clientMetadata
197251
197158
  const response = await (fetchFn ?? fetch)(registrationUrl, {
197252
197159
  method: "POST",
197253
197160
  headers: { "Content-Type": "application/json" },
197254
- body: JSON.stringify(clientMetadata)
197161
+ body: JSON.stringify({
197162
+ ...clientMetadata,
197163
+ ...scope !== void 0 ? { scope } : {}
197164
+ })
197255
197165
  });
197256
197166
  if (!response.ok) throw await parseErrorResponse(response);
197257
197167
  return OAuthClientInformationFullSchema.parse(await response.json());
@@ -197378,7 +197288,7 @@ var EventSourceParserStream = class extends TransformStream {
197378
197288
  }
197379
197289
  };
197380
197290
  //#endregion
197381
- //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.27.1_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
197291
+ //#region node_modules/.pnpm/@modelcontextprotocol+sdk@1.28.0_zod@4.3.6/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js
197382
197292
  const DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS = {
197383
197293
  initialReconnectionDelay: 1e3,
197384
197294
  maxReconnectionDelay: 3e4,
@@ -197708,7 +197618,7 @@ var StreamableHTTPClientTransport = class {
197708
197618
  }
197709
197619
  };
197710
197620
  //#endregion
197711
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/McpClient.js
197621
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/McpClient.js
197712
197622
  /**
197713
197623
  * @since 1.0.0
197714
197624
  */
@@ -197753,7 +197663,7 @@ const layer$13 = effect$1(McpClient, gen(function* () {
197753
197663
  });
197754
197664
  }));
197755
197665
  //#endregion
197756
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/ExaSearch.js
197666
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/ExaSearch.js
197757
197667
  /**
197758
197668
  * @since 1.0.0
197759
197669
  */
@@ -212703,7 +212613,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin$1(((exports) => {
212703
212613
  exports.impl = impl;
212704
212614
  }));
212705
212615
  //#endregion
212706
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/WebToMarkdown.js
212616
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/WebToMarkdown.js
212707
212617
  /**
212708
212618
  * @since 1.0.0
212709
212619
  */
@@ -215286,7 +215196,7 @@ const Proto$2 = {
215286
215196
  isFailure: false,
215287
215197
  preliminary: false
215288
215198
  })), updateServices((input) => merge$7(schemas.services, input)), matchCauseEffect({
215289
- onFailure: (cause) => failCause$2(queue, cause),
215199
+ onFailure: (cause) => failCause$1(queue, cause),
215290
215200
  onSuccess: () => end(queue)
215291
215201
  }), forkChild);
215292
215202
  const encodeResult = (result) => schemas.encodeResult(result).pipe(mapError$2((cause) => make$15({
@@ -215842,7 +215752,7 @@ function isEmptyParamsRecord(indexSignature) {
215842
215752
  return indexSignature.parameter === string$3 && isNever(indexSignature.type);
215843
215753
  }
215844
215754
  //#endregion
215845
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/SemanticSearch/Service.js
215755
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/SemanticSearch/Service.js
215846
215756
  /**
215847
215757
  * @since 1.0.0
215848
215758
  */
@@ -215868,7 +215778,7 @@ const maybeRemoveFile = (path) => serviceOption(SemanticSearch).pipe(flatMap$5(m
215868
215778
  onSome: (service) => service.removeFile(path)
215869
215779
  })));
215870
215780
  //#endregion
215871
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/AgentTools.js
215781
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/AgentTools.js
215872
215782
  /**
215873
215783
  * @since 1.0.0
215874
215784
  */
@@ -216140,7 +216050,7 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
216140
216050
  return yield* execute(make$45("bash", ["-c", options.command], {
216141
216051
  cwd,
216142
216052
  stdin: "ignore"
216143
- })).pipe(timeoutOrElse$1({
216053
+ })).pipe(timeoutOrElse({
216144
216054
  duration: timeoutMs,
216145
216055
  orElse: () => die$2(/* @__PURE__ */ new Error(`Command timed out after ${timeoutMs}ms`))
216146
216056
  }));
@@ -216271,7 +216181,7 @@ const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$12, laye
216271
216181
  AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
216272
216182
  var ApplyPatchError = class extends TaggedClass$2("ApplyPatchError") {};
216273
216183
  //#endregion
216274
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/TypeBuilder.js
216184
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/TypeBuilder.js
216275
216185
  const resolveDocumentation = resolveAt("documentation");
216276
216186
  const identifierPattern = /^[$A-Z_a-z][$0-9A-Z_a-z]*$/u;
216277
216187
  const Precedence = {
@@ -216544,7 +216454,7 @@ const render = (schema, options) => {
216544
216454
  return printNode({ text: documentation === void 0 ? rendered.text : `${renderJsDoc(documentation, 0, printerOptions)}${printerOptions.newLine}${rendered.text}` }, printerOptions);
216545
216455
  };
216546
216456
  //#endregion
216547
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/ToolkitRenderer.js
216457
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/ToolkitRenderer.js
216548
216458
  /**
216549
216459
  * @since 1.0.0
216550
216460
  */
@@ -216566,7 +216476,7 @@ declare function ${name}(${params}): Promise<${render(tool.successSchema)}>`);
216566
216476
  }) });
216567
216477
  };
216568
216478
  //#endregion
216569
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/ScriptPreprocessing.js
216479
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/ScriptPreprocessing.js
216570
216480
  const callTemplateTargets = ["applyPatch", "taskComplete"];
216571
216481
  const objectPropertyTargets = [{
216572
216482
  functionName: "writeFile",
@@ -216639,6 +216549,14 @@ const findTemplateEnd = (text, start, isTerminator) => {
216639
216549
  }
216640
216550
  return end;
216641
216551
  };
216552
+ const findTemplateEndFirst = (text, start, isTerminator) => {
216553
+ for (let index = start + 1; index < text.length; index++) {
216554
+ if (text[index] !== "`" || isEscaped(text, index)) continue;
216555
+ if (isTerminator(text[index + 1])) return index;
216556
+ if (isTerminator(text[skipWhitespace(text, index + 1)])) return index;
216557
+ }
216558
+ return -1;
216559
+ };
216642
216560
  const findTypeAnnotationAssignment = (text, start) => {
216643
216561
  let index = start;
216644
216562
  while (index < text.length) {
@@ -216874,6 +216792,23 @@ const escapeTemplateLiteralContent = (text) => {
216874
216792
  return out;
216875
216793
  };
216876
216794
  const normalizeObjectLiteralTemplateMarkers = (text) => text.replace(/\\{2,}(?=`|\$\{)/g, "\\");
216795
+ const escapeTaggedTemplateLiteralContent = (text) => {
216796
+ if (!needsTemplateEscaping(text)) return text;
216797
+ let out = "";
216798
+ for (let index = 0; index < text.length; index++) {
216799
+ const char = text[index];
216800
+ if (char === "`" && !isEscaped(text, index)) {
216801
+ out += "\\`";
216802
+ continue;
216803
+ }
216804
+ if (char === "$" && text[index + 1] === "{" && !isEscaped(text, index)) {
216805
+ out += "\\$";
216806
+ continue;
216807
+ }
216808
+ out += char;
216809
+ }
216810
+ return out;
216811
+ };
216877
216812
  const replaceSlice = (text, start, end, replacement) => `${text.slice(0, start)}${replacement}${text.slice(end)}`;
216878
216813
  const rewriteTemplateContents = (script, findNext, rewrite) => {
216879
216814
  let out = script;
@@ -216966,6 +216901,28 @@ const findObjectPropertyTemplate = (text, target, from) => {
216966
216901
  };
216967
216902
  }
216968
216903
  };
216904
+ const findTaggedTemplate = (text, tag, from) => {
216905
+ let cursor = from;
216906
+ while (cursor < text.length) {
216907
+ const tagStart = findNextIdentifier(text, tag, cursor);
216908
+ if (tagStart === -1) return;
216909
+ const templateStart = skipWhitespace(text, tagStart + tag.length);
216910
+ if (text[templateStart] !== "`") {
216911
+ cursor = tagStart + tag.length;
216912
+ continue;
216913
+ }
216914
+ const templateEnd = findTemplateEndFirst(text, templateStart, (char) => char === void 0 || char === "+" || char === "," || char === ";" || char === ")" || char === "}" || char === "]");
216915
+ if (templateEnd === -1) {
216916
+ cursor = templateStart + 1;
216917
+ continue;
216918
+ }
216919
+ return {
216920
+ contentStart: templateStart + 1,
216921
+ contentEnd: templateEnd,
216922
+ nextCursor: templateEnd + 1
216923
+ };
216924
+ }
216925
+ };
216969
216926
  const collectCallArgumentIdentifiers = (script, functionName) => {
216970
216927
  const identifiers = /* @__PURE__ */ new Set();
216971
216928
  let cursor = 0;
@@ -217103,6 +217060,7 @@ const collectObjectEntryMapSources = (script, valueIdentifier) => {
217103
217060
  };
217104
217061
  const rewriteDirectTemplates = (script) => {
217105
217062
  let out = script;
217063
+ out = rewriteTemplateContents(out, (text, from) => findTaggedTemplate(text, "String.raw", from), escapeTaggedTemplateLiteralContent);
217106
217064
  for (const target of objectPropertyTargets) out = rewriteTemplateContents(out, (text, from) => findObjectPropertyTemplate(text, target, from), escapeTemplateLiteralContent);
217107
217065
  for (const functionName of callTemplateTargets) out = rewriteTemplateContents(out, (text, from) => findDirectCallTemplate(text, functionName, from), escapeTemplateLiteralContent);
217108
217066
  return out;
@@ -217128,7 +217086,7 @@ const rewriteAssignedTargets = (script) => {
217128
217086
  };
217129
217087
  const preprocessScript = (script) => rewriteAssignedTargets(rewriteDirectTemplates(script));
217130
217088
  //#endregion
217131
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/AgentExecutor.js
217089
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/AgentExecutor.js
217132
217090
  /**
217133
217091
  * @since 1.0.0
217134
217092
  */
@@ -217207,7 +217165,7 @@ const makeLocal = fnUntraced(function* (options) {
217207
217165
  yield* yieldNow;
217208
217166
  if (running === 0) break;
217209
217167
  }
217210
- }).pipe(ensuring$2(close(handlerScope, void_$3)), catchCause$2(logFatal), provideService$2(Console$1, console), ensuring$2(end(output)), forkScoped);
217168
+ }).pipe(ensuring$2(close(handlerScope, void_$3)), catchCause$1(logFatal), provideService$2(Console$1, console), ensuring$2(end(output)), forkScoped);
217211
217169
  return fromQueue(output);
217212
217170
  }, unwrap);
217213
217171
  return AgentExecutor.of({
@@ -217313,7 +217271,7 @@ var QueueWriteStream = class extends Writable {
217313
217271
  }
217314
217272
  };
217315
217273
  //#endregion
217316
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/ScriptExtraction.js
217274
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/ScriptExtraction.js
217317
217275
  const stripWrappingCodeFence = (script) => {
217318
217276
  const lines = script.split(/\r?\n/);
217319
217277
  if (lines.length < 2) return script;
@@ -218643,7 +218601,7 @@ const make$10 = /* @__PURE__ */ fnUntraced(function* (params) {
218643
218601
  else immediateParts.push(part);
218644
218602
  if (immediateParts.length > 0) yield* offerAll(queue, immediateParts);
218645
218603
  for (const part of chunk) if (part.type === "tool-call" && part.providerExecuted !== true) yield* run$2(toolCallFibers, handleToolCall(part));
218646
- })), andThen(raceFirst(join$1(toolCallFibers), awaitEmpty(toolCallFibers))), andThen(offerAll(queue, deferredFinishParts)), andThen(end(queue)), tapCause((cause) => failCause$2(queue, cause)), forkScoped);
218604
+ })), andThen(raceFirst(join$1(toolCallFibers), awaitEmpty(toolCallFibers))), andThen(offerAll(queue, deferredFinishParts)), andThen(end(queue)), tapCause((cause) => failCause$1(queue, cause)), forkScoped);
218647
218605
  return fromQueue(queue);
218648
218606
  });
218649
218607
  return {
@@ -218862,7 +218820,7 @@ const applySpanTransformer = (transformer, response, options) => {
218862
218820
  });
218863
218821
  };
218864
218822
  //#endregion
218865
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/Agent.js
218823
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/Agent.js
218866
218824
  /**
218867
218825
  * @since 1.0.0
218868
218826
  */
@@ -218905,7 +218863,6 @@ ${content}
218905
218863
  const subagentModel = yield* SubagentModel;
218906
218864
  const modelConfig = yield* AgentModelConfig;
218907
218865
  const conversationMode = yield* ConversationMode;
218908
- const turnTimeout = yield* TurnTimeout;
218909
218866
  let finalSummary = none$4();
218910
218867
  const output = yield* make$75();
218911
218868
  let inputTokens = 0;
@@ -219027,13 +218984,10 @@ ${content}
219027
218984
  let reasoningStarted = false;
219028
218985
  let hadReasoningDelta = false;
219029
218986
  let hadToolCall = false;
219030
- yield* pipe$1(ai.streamText({
218987
+ yield* pipe$1(suspend$1(() => ai.streamText({
219031
218988
  prompt: prompt.current,
219032
218989
  toolkit: singleTool
219033
- }), timeoutOrElse({
219034
- duration: turnTimeout,
219035
- orElse: () => fail$2(new TimeoutError())
219036
- }), takeUntil((part) => {
218990
+ })), takeUntil((part) => {
219037
218991
  if ((part.type === "text-end" || part.type === "reasoning-end") && pendingMessages.size > 0) return true;
219038
218992
  return false;
219039
218993
  }), runForEachArray((parts) => {
@@ -219093,16 +219047,21 @@ ${content}
219093
219047
  return void_$2;
219094
219048
  }), retry$1({
219095
219049
  while: (err) => {
219050
+ if (err.isRetryable) {
219051
+ maybeSend({
219052
+ agentId,
219053
+ part: new ErrorRetry({ error: err })
219054
+ });
219055
+ switch (err.reason._tag) {
219056
+ case "ToolNotFoundError":
219057
+ case "InvalidOutputError": update$1(prompt, concat(fromResponseParts(response).pipe(concat(`There was an error, please try again using the "execute" tool:\n\n${pretty$1(fail$7(err))}`))));
219058
+ }
219059
+ }
219096
219060
  response = [];
219097
- if (err._tag === "TimeoutError") return true;
219098
- if (err.isRetryable) maybeSend({
219099
- agentId,
219100
- part: new ErrorRetry({ error: err })
219101
- });
219102
219061
  return err.isRetryable;
219103
219062
  },
219104
219063
  schedule: retryPolicy
219105
- }), catchTag$1("TimeoutError", die$2), modelConfig.systemPromptTransform ? (effect) => modelConfig.systemPromptTransform(system, effect) : identity);
219064
+ }), modelConfig.systemPromptTransform ? (effect) => modelConfig.systemPromptTransform(system, effect) : identity);
219106
219065
  update$1(prompt, concat(fromResponseParts(response)));
219107
219066
  if (conversationMode && !hadToolCall && pendingMessages.size === 0) finalSummary = some$2(responseToSummary(response));
219108
219067
  }
@@ -219116,7 +219075,7 @@ ${content}
219116
219075
  part: new ScriptDelta({ delta: script })
219117
219076
  });
219118
219077
  return executeScript(script);
219119
- }), catchCause$2((cause) => failCause$2(output, cause)), forkScoped);
219078
+ }), catchCause$1((cause) => failCause$1(output, cause)), forkScoped);
219120
219079
  yield* offer(output, new AgentStart({
219121
219080
  id: opts.agentId,
219122
219081
  prompt: opts.prompt,
@@ -219154,7 +219113,7 @@ ${options.toolInstructions}
219154
219113
 
219155
219114
  ${options.agentsMd}
219156
219115
  `;
219157
- const generateSystemTools = (capabilities, conversationMode) => `You only have one tool available: "execute", to run javascript code to do your work.
219116
+ const generateSystemTools = (capabilities, conversationMode) => `YOU ONLY HAVE ONE TOOL AVAILABLE: "execute", to run javascript code to do your work.
219158
219117
 
219159
219118
  - Use \`console.log\` to print any output you need.
219160
219119
  - Use top level await.${capabilities.supportsSearch ? `
@@ -219246,15 +219205,6 @@ var ConversationMode = class ConversationMode extends Reference("clanka/Agent/Co
219246
219205
  static layer = (enabled) => succeed$5(ConversationMode, enabled);
219247
219206
  };
219248
219207
  /**
219249
- * Specify an inactivity timeout before retrying a turn.
219250
- *
219251
- * @since 1.0.0
219252
- * @category Turn timeout
219253
- */
219254
- var TurnTimeout = class TurnTimeout extends Reference("clanka/Agent/TurnTimeout", { defaultValue: () => minutes(2) }) {
219255
- static layer = (timeout) => succeed$5(TurnTimeout, fromInputUnsafe(timeout));
219256
- };
219257
- /**
219258
219208
  * @since 1.0.0
219259
219209
  * @category System prompts
219260
219210
  */
@@ -228013,7 +227963,7 @@ const makeSocket = /* @__PURE__ */ gen(function* () {
228013
227963
  }
228014
227964
  offerUnsafe(currentQueue, event);
228015
227965
  } catch {}
228016
- }).pipe(catchCause$2((cause) => {
227966
+ }).pipe(catchCause$1((cause) => {
228017
227967
  tracker.clearUnsafe();
228018
227968
  return currentQueue ? fail$4(currentQueue, make$15({
228019
227969
  module: "OpenAiClient",
@@ -230382,7 +230332,7 @@ const transformToolCallParams = /* @__PURE__ */ fnUntraced(function* (tools, too
230382
230332
  })));
230383
230333
  });
230384
230334
  //#endregion
230385
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/CodexAuth.js
230335
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/CodexAuth.js
230386
230336
  /**
230387
230337
  * @since 1.0.0
230388
230338
  */
@@ -230602,7 +230552,7 @@ var CodexAuth = class CodexAuth extends Service$1()("clanka/CodexAuth") {
230602
230552
  static layerClient = this.layerClientNoDeps.pipe(provide$3(CodexAuth.layer));
230603
230553
  };
230604
230554
  //#endregion
230605
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/Codex.js
230555
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/Codex.js
230606
230556
  /**
230607
230557
  * @since 1.0.0
230608
230558
  */
@@ -230628,7 +230578,7 @@ const layerModel = (model, options) => layer$7({
230628
230578
  }
230629
230579
  }).pipe(merge$6(AgentModelConfig.layer({ systemPromptTransform: (system, effect) => withConfigOverride(effect, { instructions: system }) })));
230630
230580
  //#endregion
230631
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/CodeChunker.js
230581
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/CodeChunker.js
230632
230582
  /**
230633
230583
  * @since 1.0.0
230634
230584
  */
@@ -231171,7 +231121,7 @@ const mapStatusCodeError = /* @__PURE__ */ fnUntraced(function* (error, method)
231171
231121
  const status = response.status;
231172
231122
  const headers = response.headers;
231173
231123
  const requestId = headers["x-request-id"];
231174
- let body = yield* response.text.pipe(catchCause$2(() => succeed$4(description?.startsWith("{") ? description : void 0)));
231124
+ let body = yield* response.text.pipe(catchCause$1(() => succeed$4(description?.startsWith("{") ? description : void 0)));
231175
231125
  const decoded = OpenAiErrorBodyJson(body);
231176
231126
  return yield* make$15({
231177
231127
  module: "OpenAiClient",
@@ -232388,7 +232338,7 @@ const getUsageDetailNumber = (details, field) => {
232388
232338
  return typeof value === "number" ? value : void 0;
232389
232339
  };
232390
232340
  //#endregion
232391
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/CopilotAuth.js
232341
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/CopilotAuth.js
232392
232342
  /**
232393
232343
  * @since 1.0.0
232394
232344
  */
@@ -232579,7 +232529,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service$1()("clanka/Gith
232579
232529
  static layerClient = this.layerClientNoDeps.pipe(provide$3(GithubCopilotAuth.layer));
232580
232530
  };
232581
232531
  //#endregion
232582
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/Copilot.js
232532
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/Copilot.js
232583
232533
  /**
232584
232534
  * @since 1.0.0
232585
232535
  */
@@ -232999,7 +232949,7 @@ Object.defineProperties(createChalk.prototype, styles);
232999
232949
  const chalk = createChalk();
233000
232950
  createChalk({ level: stderrColor ? stderrColor.level : 0 });
233001
232951
  //#endregion
233002
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/OutputFormatter.js
232952
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/OutputFormatter.js
233003
232953
  /**
233004
232954
  * @since 1.0.0
233005
232955
  */
@@ -233606,7 +233556,7 @@ const partitionRequests = function* (requests, schema) {
233606
233556
  const encode = encodeEffect(schema);
233607
233557
  const handle = matchCauseEager({
233608
233558
  onFailure(cause) {
233609
- entry.completeUnsafe(failCause$5(cause));
233559
+ entry.completeUnsafe(failCause$4(cause));
233610
233560
  },
233611
233561
  onSuccess(value) {
233612
233562
  inputs.push(value);
@@ -233626,7 +233576,7 @@ const partitionRequestsById = function* (requests, schema) {
233626
233576
  const encode = encodeEffect(schema);
233627
233577
  const handle = matchCauseEager({
233628
233578
  onFailure(cause) {
233629
- entry.completeUnsafe(failCause$5(cause));
233579
+ entry.completeUnsafe(failCause$4(cause));
233630
233580
  },
233631
233581
  onSuccess(value) {
233632
233582
  inputs.push(value);
@@ -233707,7 +233657,7 @@ select * from ${sql(options.tableName)} where ${sql(idColumn)} = LAST_INSERT_ID(
233707
233657
  };
233708
233658
  });
233709
233659
  //#endregion
233710
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/ChunkRepo.js
233660
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/ChunkRepo.js
233711
233661
  /**
233712
233662
  * @since 1.0.0
233713
233663
  * @category Models
@@ -233973,7 +233923,7 @@ const run$1 = /* @__PURE__ */ make$25({});
233973
233923
  */
233974
233924
  const layer$1 = (options) => effectDiscard(run$1(options));
233975
233925
  //#endregion
233976
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/internal/sqlite-vector.js
233926
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/internal/sqlite-vector.js
233977
233927
  /**
233978
233928
  * Binary extension for each platform
233979
233929
  */
@@ -234090,7 +234040,7 @@ function getExtensionPath() {
234090
234040
  throw new ExtensionNotFoundError(`SQLite Vector extension not found for platform: ${getCurrentPlatform()}\n\nThe platform-specific package "${getPlatformPackageName()}" is not installed.\nThis usually happens when:\n 1. Your platform is not supported\n 2. npm failed to install optional dependencies\n 3. You're installing with --no-optional flag\n\nTry running: npm install --force`);
234091
234041
  }
234092
234042
  //#endregion
234093
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/Sqlite.js
234043
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/Sqlite.js
234094
234044
  /**
234095
234045
  * @since 1.0.0
234096
234046
  */
@@ -234118,7 +234068,7 @@ const SqliteLayer = (database) => layer$1({ loader: fromRecord({ "0001_create_ch
234118
234068
  yield* fs.makeDirectory(directory, { recursive: true });
234119
234069
  }))));
234120
234070
  //#endregion
234121
- //#region node_modules/.pnpm/clanka@0.2.38_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_8b26d89888c4b7e6bcb90ea99ae4f7cf/node_modules/clanka/dist/SemanticSearch.js
234071
+ //#region node_modules/.pnpm/clanka@0.2.41_@effect+ai-openai-compat@4.0.0-beta.40_effect@4.0.0-beta.40__@effect+ai-o_6376d741d1c21dc6594a81ad54906cf7/node_modules/clanka/dist/SemanticSearch.js
234122
234072
  /**
234123
234073
  * @since 1.0.0
234124
234074
  */
@@ -237984,10 +237934,9 @@ var import_light = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin$1(((ex
237984
237934
  }
237985
237935
  };
237986
237936
  var version = "2.19.5";
237987
- var version$1 = { version };
237988
237937
  var version$2 = /* @__PURE__ */ Object.freeze({
237989
237938
  version,
237990
- default: version$1
237939
+ default: { version }
237991
237940
  });
237992
237941
  var require$$2 = () => console.log("You must import the full version of Bottleneck in order to use this feature.");
237993
237942
  var require$$3 = () => console.log("You must import the full version of Bottleneck in order to use this feature.");
@@ -242331,7 +242280,7 @@ var Worktree = class extends Service$1()("lalph/Worktree", { make: gen(function*
242331
242280
  yield* copySharedBack({
242332
242281
  shared,
242333
242282
  worktreeShared
242334
- }).pipe(catchCause$2(logWarning));
242283
+ }).pipe(catchCause$1(logWarning));
242335
242284
  }));
242336
242285
  return {
242337
242286
  directory,
@@ -242351,7 +242300,7 @@ var Worktree = class extends Service$1()("lalph/Worktree", { make: gen(function*
242351
242300
  };
242352
242301
  }));
242353
242302
  };
242354
- const execIgnore = (spawner, command) => command.pipe(spawner.exitCode, catchCause$2(logWarning));
242303
+ const execIgnore = (spawner, command) => command.pipe(spawner.exitCode, catchCause$1(logWarning));
242355
242304
  const seedSetupScript = fnUntraced(function* (setupPath) {
242356
242305
  const fs = yield* FileSystem;
242357
242306
  const pathService = yield* Path$1;
@@ -242747,7 +242696,7 @@ const SemanticSearchLayer = unwrap$3(gen(function* () {
242747
242696
  return layer({
242748
242697
  directory: worktree.directory,
242749
242698
  database: pathService.join(worktree.directory, ".lalph", "shared", "search.sqlite")
242750
- }).pipe(orDie$3, provide$3(model$1("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$9({ apiKey: apiKey.value }).pipe(provide$3(layerUndici))), tapCause$1((cause) => logWarning(`Failed to create SemanticSearch layer`, cause)), catchCause$3(() => empty$15));
242699
+ }).pipe(orDie$3, provide$3(model$1("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$9({ apiKey: apiKey.value }).pipe(provide$3(layerUndici))), tapCause$1((cause) => logWarning(`Failed to create SemanticSearch layer`, cause)), catchCause$2(() => empty$15));
242751
242700
  }).pipe(orDie$2));
242752
242701
  const runClanka = fnUntraced(function* (options) {
242753
242702
  const muxer = yield* Muxer;
@@ -242761,7 +242710,7 @@ const runClanka = fnUntraced(function* (options) {
242761
242710
  yield* log$1(`Received steer message: ${message}`);
242762
242711
  yield* agent.steer(message);
242763
242712
  }, fromEffectDrain)), runDrain, forkScoped);
242764
- return yield* output.pipe(options.maxContext ? tap((part) => {
242713
+ return yield* (options.stallTimeout ? withStallTimeout(options.stallTimeout)(output) : output).pipe(options.maxContext ? tap((part) => {
242765
242714
  if (part._tag !== "Usage") return void_$2;
242766
242715
  if (part.contextTokens <= options.maxContext) return void_$2;
242767
242716
  return fail$6(new TimeoutError("Max context reached"));
@@ -242819,6 +242768,7 @@ ${research}`
242819
242768
  }),
242820
242769
  maxContext: options.maxContext,
242821
242770
  steer: options.steer,
242771
+ stallTimeout: options.stallTimeout,
242822
242772
  mode: CurrentTask.$match(options.currentTask, {
242823
242773
  task: () => "default",
242824
242774
  ralph: () => "ralph"
@@ -242975,7 +242925,8 @@ const agentChooser = fnUntraced(function* (options) {
242975
242925
  directory: worktree.directory,
242976
242926
  model: options.preset.extraArgs.join(" "),
242977
242927
  prompt: promptGen.promptChooseClanka({ gitFlow }),
242978
- mode: "choose"
242928
+ mode: "choose",
242929
+ stallTimeout: options.stallTimeout
242979
242930
  }).pipe(provideService$2(ChosenTaskDeferred, deferred), flatMap$5(() => fail$6(new ChosenTaskNotFound$1())), raceFirst(_await(deferred)));
242980
242931
  const prdTask = yield* source.findById(projectId, result.taskId);
242981
242932
  if (!prdTask) return yield* new ChosenTaskNotFound$1();
@@ -242990,7 +242941,7 @@ const agentChooser = fnUntraced(function* (options) {
242990
242941
  prompt: promptGen.promptChoose({ gitFlow }),
242991
242942
  prdFilePath: pathService.join(".lalph", "prd.yml"),
242992
242943
  extraArgs: options.preset.extraArgs
242993
- }), setCwd(worktree.directory), options.preset.withCommandPrefix, worktree.execWithWorkerOutput({ cliAgent: options.preset.cliAgent }), timeoutOrElse$1({
242944
+ }), setCwd(worktree.directory), options.preset.withCommandPrefix, worktree.execWithWorkerOutput({ cliAgent: options.preset.cliAgent }), timeoutOrElse({
242994
242945
  duration: options.stallTimeout,
242995
242946
  orElse: () => fail$6(new RunnerStalled())
242996
242947
  }), raceFirst(taskJsonCreated));
@@ -243036,6 +242987,7 @@ const agentReviewer = fnUntraced(function* (options) {
243036
242987
  prompt: options.instructions,
243037
242988
  gitFlow
243038
242989
  })),
242990
+ stallTimeout: options.stallTimeout,
243039
242991
  mode
243040
242992
  });
243041
242993
  return ExitCode(0);
@@ -243092,6 +243044,7 @@ const agentTimeout = fnUntraced(function* (options) {
243092
243044
  model: options.preset.extraArgs.join(" "),
243093
243045
  system: timeoutMode.system,
243094
243046
  prompt: timeoutMode.clankaPrompt,
243047
+ stallTimeout: options.stallTimeout,
243095
243048
  mode: timeoutMode.mode
243096
243049
  });
243097
243050
  return ExitCode(0);
@@ -243115,7 +243068,8 @@ const agentResearcher = fnUntraced(function* (options) {
243115
243068
  directory: worktree.directory,
243116
243069
  model: options.preset.extraArgs.join(" "),
243117
243070
  system: promptGen.systemClanka(options),
243118
- prompt: promptGen.promptResearch({ task: options.task })
243071
+ prompt: promptGen.promptResearch({ task: options.task }),
243072
+ stallTimeout: options.stallTimeout
243119
243073
  }).pipe(asSome);
243120
243074
  });
243121
243075
  //#endregion
@@ -243135,7 +243089,7 @@ const agentChooserRalph = fnUntraced(function* (options) {
243135
243089
  prompt: promptGen.promptChooseRalph({ specFile: options.specFile }),
243136
243090
  prdFilePath: void 0,
243137
243091
  extraArgs: options.preset.extraArgs
243138
- }), setCwd(worktree.directory), options.preset.withCommandPrefix, worktree.execWithWorkerOutput({ cliAgent: options.preset.cliAgent }), timeoutOrElse$1({
243092
+ }), setCwd(worktree.directory), options.preset.withCommandPrefix, worktree.execWithWorkerOutput({ cliAgent: options.preset.cliAgent }), timeoutOrElse({
243139
243093
  duration: options.stallTimeout,
243140
243094
  orElse: () => fail$6(new RunnerStalled())
243141
243095
  }));
@@ -243187,7 +243141,7 @@ const run = fnUntraced(function* (options) {
243187
243141
  });
243188
243142
  yield* prd.setChosenIssueId(taskId);
243189
243143
  yield* prd.setAutoMerge(chosenTask.prd.autoMerge);
243190
- yield* source.ensureInProgress(projectId, taskId).pipe(timeoutOrElse$1({
243144
+ yield* source.ensureInProgress(projectId, taskId).pipe(timeoutOrElse({
243191
243145
  duration: "1 minute",
243192
243146
  orElse: () => fail$6(new RunnerStalled())
243193
243147
  }));
@@ -243428,7 +243382,7 @@ const runProject = fnUntraced(function* (options) {
243428
243382
  quit = true;
243429
243383
  return void_$2;
243430
243384
  }
243431
- }), catchCause$2((cause) => logWarning(cause).pipe(andThen(sleep(seconds(10))))), ensuring$2(semaphore.release(1)), ensuring$2(completeWith(startedDeferred, void_$2)), run$2(fibers));
243385
+ }), catchCause$1((cause) => logWarning(cause).pipe(andThen(sleep(seconds(10))))), ensuring$2(semaphore.release(1)), ensuring$2(completeWith(startedDeferred, void_$2)), run$2(fibers));
243432
243386
  if (executionMode._tag === "ralph") {
243433
243387
  yield* await_(fiber);
243434
243388
  if (ralphDone) break;
@@ -243799,7 +243753,7 @@ const commandEdit = make$60("edit").pipe(withDescription("Open the selected proj
243799
243753
  const commandSource = make$60("source").pipe(withDescription("Select the issue source to use (e.g. GitHub Issues or Linear). This applies to all projects."), withHandler(() => selectIssueSource), provide(Settings.layer));
243800
243754
  //#endregion
243801
243755
  //#region package.json
243802
- var version = "0.3.114";
243756
+ var version = "0.3.115";
243803
243757
  //#endregion
243804
243758
  //#region src/Tracing.ts
243805
243759
  const TracingLayer = unwrap$3(gen(function* () {