@deslop/auth 0.1.1626 → 0.1.1872

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/server.js CHANGED
@@ -3433,7 +3433,7 @@ const fiberCachedKeys = /*#__PURE__*/ new Set([
3433
3433
  * @category constructors
3434
3434
  * @since 2.0.0
3435
3435
  */
3436
- const make$88 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
3436
+ const make$90 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
3437
3437
  const isStrictEquivalent = (x, y) => x === y;
3438
3438
  /**
3439
3439
  * Creates an equivalence relation that uses strict equality (`===`) to compare values.
@@ -3543,7 +3543,7 @@ const strictEqual = () => isStrictEquivalent;
3543
3543
  * @since 4.0.0
3544
3544
  */
3545
3545
  function Tuple$1(elements) {
3546
- return make$88((self, that) => {
3546
+ return make$90((self, that) => {
3547
3547
  if (self.length !== that.length) return false;
3548
3548
  for (let i = 0; i < self.length; i++) if (!elements[i](self[i], that[i])) return false;
3549
3549
  return true;
@@ -3553,7 +3553,7 @@ function Tuple$1(elements) {
3553
3553
  * @since 4.0.0
3554
3554
  */
3555
3555
  function Array_(item) {
3556
- return make$88((self, that) => {
3556
+ return make$90((self, that) => {
3557
3557
  if (self.length !== that.length) return false;
3558
3558
  for (let i = 0; i < self.length; i++) if (!item(self[i], that[i])) return false;
3559
3559
  return true;
@@ -3756,7 +3756,7 @@ const getSuccess$1 = (self) => isFailure$2(self) ? none$1 : some$2(self.success)
3756
3756
  * @category constructors
3757
3757
  * @since 2.0.0
3758
3758
  */
3759
- function make$87(compare) {
3759
+ function make$89(compare) {
3760
3760
  return (self, that) => self === that ? 0 : compare(self, that);
3761
3761
  }
3762
3762
  /**
@@ -3787,7 +3787,7 @@ function make$87(compare) {
3787
3787
  * @category instances
3788
3788
  * @since 4.0.0
3789
3789
  */
3790
- const String$10 = /*#__PURE__*/ make$87((self, that) => self < that ? -1 : 1);
3790
+ const String$10 = /*#__PURE__*/ make$89((self, that) => self < that ? -1 : 1);
3791
3791
  /**
3792
3792
  * Order instance for numbers that compares them numerically.
3793
3793
  *
@@ -3820,7 +3820,7 @@ const String$10 = /*#__PURE__*/ make$87((self, that) => self < that ? -1 : 1);
3820
3820
  * @category instances
3821
3821
  * @since 4.0.0
3822
3822
  */
3823
- const Number$6 = /*#__PURE__*/ make$87((self, that) => {
3823
+ const Number$6 = /*#__PURE__*/ make$89((self, that) => {
3824
3824
  if (globalThis.Number.isNaN(self) && globalThis.Number.isNaN(that)) return 0;
3825
3825
  if (globalThis.Number.isNaN(self)) return -1;
3826
3826
  if (globalThis.Number.isNaN(that)) return 1;
@@ -3854,7 +3854,7 @@ const Number$6 = /*#__PURE__*/ make$87((self, that) => {
3854
3854
  * @category instances
3855
3855
  * @since 4.0.0
3856
3856
  */
3857
- const BigInt$5 = /*#__PURE__*/ make$87((self, that) => self < that ? -1 : 1);
3857
+ const BigInt$5 = /*#__PURE__*/ make$89((self, that) => self < that ? -1 : 1);
3858
3858
  /**
3859
3859
  * Transforms an `Order` on type `A` into an `Order` on type `B` by providing a function that
3860
3860
  * maps values of type `B` to values of type `A`.
@@ -3888,7 +3888,7 @@ const BigInt$5 = /*#__PURE__*/ make$87((self, that) => self < that ? -1 : 1);
3888
3888
  * @category mapping
3889
3889
  * @since 2.0.0
3890
3890
  */
3891
- const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$87((b1, b2) => self(f(b1), f(b2))));
3891
+ const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$89((b1, b2) => self(f(b1), f(b2))));
3892
3892
  /**
3893
3893
  * Checks whether one value is strictly less than another according to the given order.
3894
3894
  *
@@ -4320,6 +4320,35 @@ const getOrElse$1 = /*#__PURE__*/ dual(2, (self, onNone) => isNone(self) ? onNon
4320
4320
  */
4321
4321
  const orElse$3 = /*#__PURE__*/ dual(2, (self, that) => isNone(self) ? that() : self);
4322
4322
  /**
4323
+ * Returns `Some` of the fallback value if `self` is `None`; otherwise returns
4324
+ * `self`.
4325
+ *
4326
+ * **When to use**
4327
+ *
4328
+ * Use when providing a default plain value (not an `Option`) as fallback
4329
+ *
4330
+ * **Details**
4331
+ *
4332
+ * - `Some` → returns `self` unchanged
4333
+ * - `None` → calls `onNone()`, wraps result in `Some`, and returns it
4334
+ *
4335
+ * **Example** (Providing a fallback value)
4336
+ *
4337
+ * ```ts import.meta.vitest
4338
+ * import { Option } from "effect"
4339
+ *
4340
+ * Option.none().pipe(Option.orElseSome(() => "b")) // => Option.some("b")
4341
+ * Option.some("a").pipe(Option.orElseSome(() => "b")) // => Option.some("a")
4342
+ * ```
4343
+ *
4344
+ * @see {@link orElse} when the fallback is itself an `Option`
4345
+ *
4346
+ * @stability stable
4347
+ * @category error handling
4348
+ * @since 2.0.0
4349
+ */
4350
+ const orElseSome = /*#__PURE__*/ dual(2, (self, onNone) => isNone(self) ? some$1(onNone()) : self);
4351
+ /**
4323
4352
  * Converts a nullable value (`null` or `undefined`) into an `Option`.
4324
4353
  *
4325
4354
  * **When to use**
@@ -4931,7 +4960,7 @@ const Service$1 = function() {
4931
4960
  const ServiceProto = /*#__PURE__*/ Object.assign({ [ServiceTypeId]: ServiceTypeId }, /*#__PURE__*/ Prototype({
4932
4961
  label: "Service",
4933
4962
  evaluate(fiber) {
4934
- return exitSucceed(get$12(fiber.context, this));
4963
+ return exitSucceed(get$13(fiber.context, this));
4935
4964
  }
4936
4965
  }), {
4937
4966
  toJSON() {
@@ -4944,13 +4973,13 @@ const ServiceProto = /*#__PURE__*/ Object.assign({ [ServiceTypeId]: ServiceTypeI
4944
4973
  return self;
4945
4974
  },
4946
4975
  context(self) {
4947
- return make$86(this, self);
4976
+ return make$88(this, self);
4948
4977
  },
4949
4978
  use(f) {
4950
- return withFiber$1((fiber) => f(get$12(fiber.context, this)));
4979
+ return withFiber$1((fiber) => f(get$13(fiber.context, this)));
4951
4980
  },
4952
4981
  useSync(f) {
4953
- return withFiber$1((fiber) => exitSucceed(f(get$12(fiber.context, this))));
4982
+ return withFiber$1((fiber) => exitSucceed(f(get$13(fiber.context, this))));
4954
4983
  }
4955
4984
  });
4956
4985
  const ReferenceTypeId = "~effect/Context/Reference";
@@ -5187,7 +5216,7 @@ const emptyContext = /*#__PURE__*/ makeUnsafe$9(/*#__PURE__*/ new Map());
5187
5216
  * @category constructors
5188
5217
  * @since 2.0.0
5189
5218
  */
5190
- const make$86 = (key, service) => makeUnsafe$9(/* @__PURE__ */ new Map([[key.key, service]]));
5219
+ const make$88 = (key, service) => makeUnsafe$9(/* @__PURE__ */ new Map([[key.key, service]]));
5191
5220
  /**
5192
5221
  * Adds a service to a given `Context`.
5193
5222
  *
@@ -5349,7 +5378,7 @@ const getUnsafe$1 = /*#__PURE__*/ dual(2, (self, service) => {
5349
5378
  * @category getters
5350
5379
  * @since 2.0.0
5351
5380
  */
5352
- const get$12 = getUnsafe$1;
5381
+ const get$13 = getUnsafe$1;
5353
5382
  const defaultValueCacheKey = "~effect/Context/defaultValue";
5354
5383
  const getDefaultValue = (ref) => {
5355
5384
  if (defaultValueCacheKey in ref) return ref[defaultValueCacheKey];
@@ -5606,7 +5635,7 @@ const bigintNanosPerDay = /*#__PURE__*/ BigInt(864e11);
5606
5635
  const bigintNanosPerWeek = /*#__PURE__*/ BigInt(6048e11);
5607
5636
  const roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
5608
5637
  const roundMillisToNanos = (millis) => Number.isInteger(millis) ? BigInt(millis) * bigint1e6 : roundTiesAwayFromZero(millis * 1e6);
5609
- const fromNanosNumber = (nanos) => make$85(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
5638
+ const fromNanosNumber = (nanos) => make$87(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
5610
5639
  const nanosToUnit = (nanos, divisor) => {
5611
5640
  const value = Number(nanos);
5612
5641
  if (Number.isFinite(value)) return value / divisor;
@@ -5629,9 +5658,9 @@ const divideTiesAwayFromZero = (numerator, denominator) => {
5629
5658
  };
5630
5659
  const fromMillisString = (input, scale) => {
5631
5660
  const millis = Number(input) * scale;
5632
- if (!Number.isFinite(millis)) return make$85(millis);
5661
+ if (!Number.isFinite(millis)) return make$87(millis);
5633
5662
  const nanos = parseNanos(input, BigInt(scale) * bigint1e6);
5634
- return make$85(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
5663
+ return make$87(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
5635
5664
  };
5636
5665
  const DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
5637
5666
  /**
@@ -5698,7 +5727,7 @@ const fromInputUnsafe$1 = (input) => {
5698
5727
  if (input[0] === -Infinity || input[1] === -Infinity) return negativeInfinity;
5699
5728
  if (input[0] === Infinity || input[1] === Infinity) return infinity$1;
5700
5729
  const nanos = input[0] * 1e9 + input[1];
5701
- return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$85(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
5730
+ return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$87(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
5702
5731
  }
5703
5732
  const obj = input;
5704
5733
  let millis = 0;
@@ -5709,13 +5738,13 @@ const fromInputUnsafe$1 = (input) => {
5709
5738
  if (obj.seconds) millis += obj.seconds * 1e3;
5710
5739
  if (obj.milliseconds) millis += obj.milliseconds;
5711
5740
  if (!obj.microseconds && !obj.nanoseconds) {
5712
- if (!Number.isFinite(millis)) return make$85(millis);
5741
+ if (!Number.isFinite(millis)) return make$87(millis);
5713
5742
  const exact = sumObjectNanos(obj);
5714
- return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$85(millis) : make$85(exact);
5743
+ return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$87(millis) : make$87(exact);
5715
5744
  }
5716
5745
  const nanos = millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0);
5717
5746
  const exact = Number.isFinite(nanos) ? sumObjectNanos(obj) : void 0;
5718
- return exact === void 0 ? fromNanosNumber(nanos) : make$85(exact);
5747
+ return exact === void 0 ? fromNanosNumber(nanos) : make$87(exact);
5719
5748
  }
5720
5749
  }
5721
5750
  return invalid$3(input);
@@ -5810,7 +5839,7 @@ const DurationProto = {
5810
5839
  return pipeArguments(this, arguments);
5811
5840
  }
5812
5841
  };
5813
- const make$85 = (input) => {
5842
+ const make$87 = (input) => {
5814
5843
  const duration = Object.create(DurationProto);
5815
5844
  if (typeof input === "number") {
5816
5845
  if (isNaN(input) || input === 0 || Object.is(input, -0)) duration.value = zeroDurationValue;
@@ -5933,8 +5962,8 @@ const abs = (self) => {
5933
5962
  switch (self.value._tag) {
5934
5963
  case "Infinity":
5935
5964
  case "NegativeInfinity": return infinity$1;
5936
- case "Millis": return self.value.millis < 0 ? make$85(-self.value.millis) : self;
5937
- case "Nanos": return self.value.nanos < bigint0$5 ? make$85(-self.value.nanos) : self;
5965
+ case "Millis": return self.value.millis < 0 ? make$87(-self.value.millis) : self;
5966
+ case "Nanos": return self.value.nanos < bigint0$5 ? make$87(-self.value.nanos) : self;
5938
5967
  }
5939
5968
  };
5940
5969
  /**
@@ -5952,7 +5981,7 @@ const abs = (self) => {
5952
5981
  * @category constructors
5953
5982
  * @since 2.0.0
5954
5983
  */
5955
- const zero$2 = /*#__PURE__*/ make$85(0);
5984
+ const zero$2 = /*#__PURE__*/ make$87(0);
5956
5985
  /**
5957
5986
  * A Duration representing infinite time.
5958
5987
  *
@@ -5968,7 +5997,7 @@ const zero$2 = /*#__PURE__*/ make$85(0);
5968
5997
  * @category constructors
5969
5998
  * @since 2.0.0
5970
5999
  */
5971
- const infinity$1 = /*#__PURE__*/ make$85(Infinity);
6000
+ const infinity$1 = /*#__PURE__*/ make$87(Infinity);
5972
6001
  /**
5973
6002
  * A Duration representing negative infinite time.
5974
6003
  *
@@ -5984,7 +6013,7 @@ const infinity$1 = /*#__PURE__*/ make$85(Infinity);
5984
6013
  * @category constructors
5985
6014
  * @since 4.0.0
5986
6015
  */
5987
- const negativeInfinity = /*#__PURE__*/ make$85(-Infinity);
6016
+ const negativeInfinity = /*#__PURE__*/ make$87(-Infinity);
5988
6017
  /**
5989
6018
  * Creates a Duration from nanoseconds.
5990
6019
  *
@@ -6000,7 +6029,7 @@ const negativeInfinity = /*#__PURE__*/ make$85(-Infinity);
6000
6029
  * @category constructors
6001
6030
  * @since 2.0.0
6002
6031
  */
6003
- const nanos = (nanos) => make$85(nanos);
6032
+ const nanos = (nanos) => make$87(nanos);
6004
6033
  /**
6005
6034
  * Creates a Duration from milliseconds.
6006
6035
  *
@@ -6016,7 +6045,7 @@ const nanos = (nanos) => make$85(nanos);
6016
6045
  * @category constructors
6017
6046
  * @since 2.0.0
6018
6047
  */
6019
- const millis = (millis) => make$85(millis);
6048
+ const millis = (millis) => make$87(millis);
6020
6049
  /**
6021
6050
  * Creates a Duration from seconds.
6022
6051
  *
@@ -6032,7 +6061,7 @@ const millis = (millis) => make$85(millis);
6032
6061
  * @category constructors
6033
6062
  * @since 2.0.0
6034
6063
  */
6035
- const seconds = (seconds) => make$85(seconds * 1e3);
6064
+ const seconds = (seconds) => make$87(seconds * 1e3);
6036
6065
  /**
6037
6066
  * Creates a Duration from minutes.
6038
6067
  *
@@ -6048,7 +6077,7 @@ const seconds = (seconds) => make$85(seconds * 1e3);
6048
6077
  * @category constructors
6049
6078
  * @since 2.0.0
6050
6079
  */
6051
- const minutes = (minutes) => make$85(minutes * 6e4);
6080
+ const minutes = (minutes) => make$87(minutes * 6e4);
6052
6081
  /**
6053
6082
  * Creates a Duration from hours.
6054
6083
  *
@@ -6064,7 +6093,7 @@ const minutes = (minutes) => make$85(minutes * 6e4);
6064
6093
  * @category constructors
6065
6094
  * @since 2.0.0
6066
6095
  */
6067
- const hours = (hours) => make$85(hours * 36e5);
6096
+ const hours = (hours) => make$87(hours * 36e5);
6068
6097
  /**
6069
6098
  * Converts a Duration to milliseconds.
6070
6099
  *
@@ -6231,7 +6260,7 @@ const matchPair = /*#__PURE__*/ dual(3, (self, that, options) => {
6231
6260
  * @category instances
6232
6261
  * @since 2.0.0
6233
6262
  */
6234
- const Order$6 = /*#__PURE__*/ make$87((self, that) => matchPair(self, that, {
6263
+ const Order$6 = /*#__PURE__*/ make$89((self, that) => matchPair(self, that, {
6235
6264
  onMillis: (self, that) => self < that ? -1 : self > that ? 1 : 0,
6236
6265
  onNanos: (self, that) => self < that ? -1 : self > that ? 1 : 0,
6237
6266
  onInfinity: (self, that) => {
@@ -6320,8 +6349,8 @@ const max = /*#__PURE__*/ max$1(Order$6);
6320
6349
  * @since 2.0.0
6321
6350
  */
6322
6351
  const sum = /*#__PURE__*/ dual(2, (self, that) => matchPair(self, that, {
6323
- onMillis: (self, that) => make$85(self + that),
6324
- onNanos: (self, that) => make$85(self + that),
6352
+ onMillis: (self, that) => make$87(self + that),
6353
+ onNanos: (self, that) => make$87(self + that),
6325
6354
  onInfinity: (self, that) => {
6326
6355
  const s = self.value._tag;
6327
6356
  const t = that.value._tag;
@@ -7213,7 +7242,7 @@ const has$3 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key));
7213
7242
  * @category getters
7214
7243
  * @since 2.0.0
7215
7244
  */
7216
- const get$11 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key) ? some$1(self[key]) : none());
7245
+ const get$12 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key) ? some$1(self[key]) : none());
7217
7246
  /**
7218
7247
  * Maps a record into another record by applying a transformation function to each of its values.
7219
7248
  *
@@ -7456,7 +7485,7 @@ const Array$2 = globalThis.Array;
7456
7485
  * @category constructors
7457
7486
  * @since 2.0.0
7458
7487
  */
7459
- const fromIterable$5 = (collection) => Array$2.isArray(collection) ? collection : Array$2.from(collection);
7488
+ const fromIterable$6 = (collection) => Array$2.isArray(collection) ? collection : Array$2.from(collection);
7460
7489
  /**
7461
7490
  * Normalizes a value that is either a single element or an array into an array.
7462
7491
  *
@@ -7525,30 +7554,6 @@ const ensure = (self) => Array$2.isArray(self) ? self : [self];
7525
7554
  */
7526
7555
  const match$5 = /*#__PURE__*/ dual(2, (self, { onEmpty, onNonEmpty }) => isReadonlyArrayNonEmpty(self) ? onNonEmpty(self) : onEmpty());
7527
7556
  /**
7528
- * Adds a single element to the front of an iterable, returning a `NonEmptyArray`.
7529
- *
7530
- * **When to use**
7531
- *
7532
- * Use when you need to guarantee a non-empty result after adding a required
7533
- * leading value.
7534
- *
7535
- * **Example** (Prepending an element)
7536
- *
7537
- * ```ts import.meta.vitest
7538
- * import { Array } from "effect"
7539
- *
7540
- * Array.prepend([2, 3, 4], 1) // => [1, 2, 3, 4]
7541
- * ```
7542
- *
7543
- * @see {@link append} — add to the end
7544
- * @see {@link prependAll} — prepend multiple elements
7545
- *
7546
- * @stability stable
7547
- * @category combining
7548
- * @since 2.0.0
7549
- */
7550
- const prepend$1 = /*#__PURE__*/ dual(2, (self, head) => [head, ...self]);
7551
- /**
7552
7557
  * Adds a single element to the end of an iterable, returning a `NonEmptyArray`.
7553
7558
  *
7554
7559
  * **When to use**
@@ -7599,7 +7604,7 @@ const append$1 = /*#__PURE__*/ dual(2, (self, last) => [...self, last]);
7599
7604
  * @category combining
7600
7605
  * @since 2.0.0
7601
7606
  */
7602
- const appendAll$1 = /*#__PURE__*/ dual(2, (self, that) => fromIterable$5(self).concat(fromIterable$5(that)));
7607
+ const appendAll$1 = /*#__PURE__*/ dual(2, (self, that) => fromIterable$6(self).concat(fromIterable$6(that)));
7603
7608
  Array$2.isArray;
7604
7609
  /**
7605
7610
  * Checks whether a mutable `Array` is empty, narrowing the type to `[]`.
@@ -7738,7 +7743,7 @@ function isOutOfBounds(i, as) {
7738
7743
  * @category getters
7739
7744
  * @since 2.0.0
7740
7745
  */
7741
- const get$10 = /*#__PURE__*/ dual(2, (self, index) => {
7746
+ const get$11 = /*#__PURE__*/ dual(2, (self, index) => {
7742
7747
  const i = Math.floor(index);
7743
7748
  return isOutOfBounds(i, self) ? none() : some$1(self[i]);
7744
7749
  });
@@ -7799,7 +7804,7 @@ const getUnsafe = /*#__PURE__*/ dual(2, (self, index) => {
7799
7804
  * @category getters
7800
7805
  * @since 2.0.0
7801
7806
  */
7802
- const head = /*#__PURE__*/ get$10(0);
7807
+ const head = /*#__PURE__*/ get$11(0);
7803
7808
  /**
7804
7809
  * Returns the first element of a `NonEmptyReadonlyArray` directly (no `Option`
7805
7810
  * wrapper).
@@ -7878,7 +7883,7 @@ const clampCount = (n, length) => Math.min(normalize$2(n), length);
7878
7883
  * @since 2.0.0
7879
7884
  */
7880
7885
  const take$3 = /*#__PURE__*/ dual(2, (self, n) => {
7881
- const input = fromIterable$5(self);
7886
+ const input = fromIterable$6(self);
7882
7887
  return input.slice(0, clampCount(n, input.length));
7883
7888
  });
7884
7889
  /**
@@ -7911,7 +7916,7 @@ const take$3 = /*#__PURE__*/ dual(2, (self, n) => {
7911
7916
  * @since 2.0.0
7912
7917
  */
7913
7918
  const drop$1 = /*#__PURE__*/ dual(2, (self, n) => {
7914
- const input = fromIterable$5(self);
7919
+ const input = fromIterable$6(self);
7915
7920
  return input.slice(clampCount(n, input.length), input.length);
7916
7921
  });
7917
7922
  /**
@@ -8007,7 +8012,7 @@ const findFirst = findFirst$1;
8007
8012
  * @since 2.0.0
8008
8013
  */
8009
8014
  const findLast = /*#__PURE__*/ dual(2, (self, f) => {
8010
- const input = fromIterable$5(self);
8015
+ const input = fromIterable$6(self);
8011
8016
  for (let i = input.length - 1; i >= 0; i--) {
8012
8017
  const a = input[i];
8013
8018
  const o = f(a, i);
@@ -8174,8 +8179,8 @@ const hashBucketsHas = (buckets, value) => {
8174
8179
  * @since 2.0.0
8175
8180
  */
8176
8181
  const difference = /*#__PURE__*/ dual(2, (self, that) => {
8177
- const thatArray = fromIterable$5(that);
8178
- const selfArray = fromIterable$5(self);
8182
+ const thatArray = fromIterable$6(that);
8183
+ const selfArray = fromIterable$6(self);
8179
8184
  if (selfArray.length === 0) return [];
8180
8185
  if (thatArray.length === 0) return selfArray.filter(() => true);
8181
8186
  const buckets = makeHashBuckets(thatArray);
@@ -8367,7 +8372,7 @@ const getSomes = (self) => {
8367
8372
  * @since 2.0.0
8368
8373
  */
8369
8374
  const filter$3 = /*#__PURE__*/ dual(2, (self, predicate) => {
8370
- const as = fromIterable$5(self);
8375
+ const as = fromIterable$6(self);
8371
8376
  const out = [];
8372
8377
  for (let i = 0; i < as.length; i++) if (predicate(as[i], i)) out.push(as[i]);
8373
8378
  return out;
@@ -8398,7 +8403,7 @@ const filter$3 = /*#__PURE__*/ dual(2, (self, predicate) => {
8398
8403
  * @category folding
8399
8404
  * @since 2.0.0
8400
8405
  */
8401
- const reduce = /*#__PURE__*/ dual(3, (self, b, f) => fromIterable$5(self).reduce((b, a, i) => f(b, a, i), b));
8406
+ const reduce = /*#__PURE__*/ dual(3, (self, b, f) => fromIterable$6(self).reduce((b, a, i) => f(b, a, i), b));
8402
8407
  /**
8403
8408
  * Converts a nullable value to an array: `null`/`undefined` becomes `[]`,
8404
8409
  * anything else becomes `[value]`.
@@ -8518,7 +8523,7 @@ const makeEquivalence$2 = Array_;
8518
8523
  * @since 2.0.0
8519
8524
  */
8520
8525
  const dedupe = (self) => {
8521
- const input = fromIterable$5(self);
8526
+ const input = fromIterable$6(self);
8522
8527
  if (input.length < 2) return [...input];
8523
8528
  const buckets = /* @__PURE__ */ new Map();
8524
8529
  const out = [];
@@ -8542,7 +8547,7 @@ const dedupe = (self) => {
8542
8547
  * @category folding
8543
8548
  * @since 2.0.0
8544
8549
  */
8545
- const join$3 = /*#__PURE__*/ dual(2, (self, sep) => fromIterable$5(self).join(sep));
8550
+ const join$3 = /*#__PURE__*/ dual(2, (self, sep) => fromIterable$6(self).join(sep));
8546
8551
  // ../../node_modules/.pnpm/effect@4.1.7/node_modules/effect/dist/Filter.js
8547
8552
  /**
8548
8553
  * Converts a `Filter` into a function that returns `Some` for passed values
@@ -9177,7 +9182,7 @@ var ParentSpan = class extends (/*#__PURE__*/ Service$1()(ParentSpanKey)) {};
9177
9182
  * @category constructors
9178
9183
  * @since 2.0.0
9179
9184
  */
9180
- const make$84 = (options) => options;
9185
+ const make$86 = (options) => options;
9181
9186
  /**
9182
9187
  * Creates an `ExternalSpan` from trace and span identifiers, defaulting
9183
9188
  * `sampled` to `true` and annotations to an empty context when they are not
@@ -9343,7 +9348,7 @@ const Tracer = /*#__PURE__*/ Reference("effect/Tracer", { defaultValue: () => na
9343
9348
  * @category references
9344
9349
  * @since 4.0.0
9345
9350
  */
9346
- const nativeTracer = /*#__PURE__*/ make$84({ span: (options) => new NativeSpan(options) });
9351
+ const nativeTracer = /*#__PURE__*/ make$86({ span: (options) => new NativeSpan(options) });
9347
9352
  /**
9348
9353
  * Default in-memory `Span` implementation used by the native tracer. It
9349
9354
  * generates span and trace identifiers, stores attributes, events, and links,
@@ -10371,7 +10376,7 @@ const raceAll$1 = (all, options) => withFiber$1((parent) => {
10371
10376
  const fibers = /* @__PURE__ */ new Set();
10372
10377
  onExitUnsafe(parent, () => fibers.size === 0 ? void 0 : fiberInterruptAll(fibers));
10373
10378
  return callback$2((resume) => {
10374
- const effects = fromIterable$5(all);
10379
+ const effects = fromIterable$6(all);
10375
10380
  const len = effects.length;
10376
10381
  let doneCount = 0;
10377
10382
  let done = false;
@@ -11115,7 +11120,7 @@ const whileLoop$1 = /*#__PURE__*/ makePrimitive$1({
11115
11120
  const forEach$2 = /*#__PURE__*/ dual((args) => typeof args[1] === "function", (iterable, f, options) => suspend$4(() => {
11116
11121
  const concurrency = resolveConcurrency(options?.concurrency);
11117
11122
  if (concurrency === 1) return forEachSequential(iterable, f, options);
11118
- const items = fromIterable$5(iterable);
11123
+ const items = fromIterable$6(iterable);
11119
11124
  let length = items.length;
11120
11125
  if (length === 0) return options?.discard ? void_$4 : succeed$9([]);
11121
11126
  const out = options?.discard ? void 0 : new Array(length);
@@ -11495,11 +11500,11 @@ const noopSpan = (options) => Object.assign(Object.create(NoopSpanProto), option
11495
11500
  /** @internal */
11496
11501
  const filterDisablePropagation = (span) => {
11497
11502
  if (!span) return none();
11498
- return get$12(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$2(span.parent)) : none() : some$1(span);
11503
+ return get$13(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$2(span.parent)) : none() : some$1(span);
11499
11504
  };
11500
11505
  /** @internal */
11501
11506
  const makeSpanUnsafe = (fiber, name, options) => {
11502
- const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$12(options.annotations, DisablePropagation);
11507
+ const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$13(options.annotations, DisablePropagation);
11503
11508
  const parent = options?.parent !== void 0 ? some$1(options.parent) : options?.root ? none() : filterDisablePropagation(fiber.cache.span);
11504
11509
  let span;
11505
11510
  if (disablePropagation) span = noopSpan({
@@ -12264,7 +12269,7 @@ const makeUnsafe$8 = () => new DeferredImpl();
12264
12269
  * @category constructors
12265
12270
  * @since 2.0.0
12266
12271
  */
12267
- const make$83 = () => sync$2(() => makeUnsafe$8());
12272
+ const make$85 = () => sync$2(() => makeUnsafe$8());
12268
12273
  const _await = (self) => callback$2((resume) => {
12269
12274
  if (self.effect) return resume(self.effect);
12270
12275
  self.resumes ??= [];
@@ -12855,7 +12860,7 @@ const Scope = scopeTag;
12855
12860
  * @category constructors
12856
12861
  * @since 2.0.0
12857
12862
  */
12858
- const make$82 = scopeMake;
12863
+ const make$84 = scopeMake;
12859
12864
  /**
12860
12865
  * Creates a new `Scope` synchronously without wrapping it in an `Effect`.
12861
12866
  * The finalizer strategy defaults to `"sequential"`.
@@ -13562,8 +13567,8 @@ const buildWithScope = /*#__PURE__*/ dual(2, (self, scope) => withFiber$1((fiber
13562
13567
  * @since 2.0.0
13563
13568
  */
13564
13569
  const succeed$6 = function() {
13565
- if (arguments.length === 1) return (resource) => succeedContext(make$86(arguments[0], resource));
13566
- return succeedContext(make$86(arguments[0], arguments[1]));
13570
+ if (arguments.length === 1) return (resource) => succeedContext(make$88(arguments[0], resource));
13571
+ return succeedContext(make$88(arguments[0], arguments[1]));
13567
13572
  };
13568
13573
  /**
13569
13574
  * Constructs a layer that provides all services in an already available
@@ -13675,8 +13680,8 @@ const empty$11 = /*#__PURE__*/ succeedContext(/*#__PURE__*/ empty$14());
13675
13680
  * @since 2.0.0
13676
13681
  */
13677
13682
  const sync$1 = function() {
13678
- if (arguments.length === 1) return (evaluate) => syncContext(() => make$86(arguments[0], evaluate()));
13679
- return syncContext(() => make$86(arguments[0], arguments[1]()));
13683
+ if (arguments.length === 1) return (evaluate) => syncContext(() => make$88(arguments[0], evaluate()));
13684
+ return syncContext(() => make$88(arguments[0], arguments[1]()));
13680
13685
  };
13681
13686
  /**
13682
13687
  * Constructs a layer lazily that provides all services in a `Context`.
@@ -13760,7 +13765,7 @@ const effect = function() {
13760
13765
  if (arguments.length === 1) return (effect) => effectImpl(arguments[0], effect);
13761
13766
  return effectImpl(arguments[0], arguments[1]);
13762
13767
  };
13763
- const effectImpl = (service, effect) => effectContext(map$9(effect, (value) => make$86(service, value)));
13768
+ const effectImpl = (service, effect) => effectContext(map$9(effect, (value) => make$88(service, value)));
13764
13769
  /**
13765
13770
  * Constructs a layer from an effect that produces all services in a `Context`.
13766
13771
  *
@@ -13868,7 +13873,7 @@ const unwrapKey = /*#__PURE__*/ Service$1("effect/Layer/unwrap");
13868
13873
  * @category converting
13869
13874
  * @since 4.0.0
13870
13875
  */
13871
- const unwrap$7 = (self) => flatMap$4(effect(unwrapKey)(self), get$12(unwrapKey));
13876
+ const unwrap$7 = (self) => flatMap$4(effect(unwrapKey)(self), get$13(unwrapKey));
13872
13877
  const mergeAllEffect = (layers, memoMap, scope) => {
13873
13878
  const parentScope = forkUnsafe(scope, "parallel");
13874
13879
  return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$9((context) => mergeAll$2(...context)));
@@ -15495,7 +15500,7 @@ const isUtc$1 = (self) => self._tag === "Utc";
15495
15500
  /** @internal */
15496
15501
  const isZoned = (self) => self._tag === "Zoned";
15497
15502
  /** @internal */
15498
- const Order$5 = /*#__PURE__*/ make$87((self, that) => self.epochMilliseconds < that.epochMilliseconds ? -1 : self.epochMilliseconds > that.epochMilliseconds ? 1 : 0);
15503
+ const Order$5 = /*#__PURE__*/ make$89((self, that) => self.epochMilliseconds < that.epochMilliseconds ? -1 : self.epochMilliseconds > that.epochMilliseconds ? 1 : 0);
15499
15504
  const makeUtc = (epochMillis) => {
15500
15505
  const self = Object.create(ProtoUtc);
15501
15506
  self.epochMilliseconds = epochMillis;
@@ -15567,7 +15572,7 @@ const makeZonedUnsafe$1 = (input, options) => {
15567
15572
  return makeZonedFromAdjusted(self.epochMilliseconds, zone, options?.disambiguation ?? "compatible");
15568
15573
  };
15569
15574
  /** @internal */
15570
- const make$81 = /*#__PURE__*/ liftThrowable(makeUnsafe$6);
15575
+ const make$83 = /*#__PURE__*/ liftThrowable(makeUnsafe$6);
15571
15576
  /** @internal */
15572
15577
  const now$1 = /*#__PURE__*/ map$9(currentTimeMillis, makeUtc);
15573
15578
  /** @internal */
@@ -17023,7 +17028,7 @@ const empty$10 = () => {
17023
17028
  * @category constructors
17024
17029
  * @since 2.0.0
17025
17030
  */
17026
- const make$80 = (...entries) => fromIterable$4(entries);
17031
+ const make$82 = (...entries) => fromIterable$5(entries);
17027
17032
  /**
17028
17033
  * Creates a MutableHashMap from an iterable collection of key-value pairs.
17029
17034
  *
@@ -17059,7 +17064,7 @@ const make$80 = (...entries) => fromIterable$4(entries);
17059
17064
  * @category constructors
17060
17065
  * @since 2.0.0
17061
17066
  */
17062
- const fromIterable$4 = (entries) => {
17067
+ const fromIterable$5 = (entries) => {
17063
17068
  const self = empty$10();
17064
17069
  for (const [key, value] of entries) set$3(self, key, value);
17065
17070
  return self;
@@ -17097,7 +17102,7 @@ const fromIterable$4 = (entries) => {
17097
17102
  * @category getters
17098
17103
  * @since 2.0.0
17099
17104
  */
17100
- const get$9 = /*#__PURE__*/ dual(2, (self, key) => {
17105
+ const get$10 = /*#__PURE__*/ dual(2, (self, key) => {
17101
17106
  if (self.backing.has(key)) return some$1(self.backing.get(key));
17102
17107
  else if (isSimpleKey(key)) return none();
17103
17108
  const hash$4 = hash(key);
@@ -17218,7 +17223,7 @@ const getRefKey = (bucket, key) => {
17218
17223
  * @category mutations
17219
17224
  * @since 2.0.0
17220
17225
  */
17221
- const remove$3 = /*#__PURE__*/ dual(2, (self, key_) => {
17226
+ const remove$4 = /*#__PURE__*/ dual(2, (self, key_) => {
17222
17227
  if (isSimpleKey(key_)) {
17223
17228
  self.backing.delete(key_);
17224
17229
  return self;
@@ -23021,7 +23026,7 @@ const concat$3 = (chunks) => {
23021
23026
  * @category instances
23022
23027
  * @since 4.0.6
23023
23028
  */
23024
- const Order$2 = /*#__PURE__*/ make$87((self, that) => {
23029
+ const Order$2 = /*#__PURE__*/ make$89((self, that) => {
23025
23030
  const length = Math.min(self.length, that.length);
23026
23031
  for (let i = 0; i < length; i++) if (self[i] !== that[i]) return self[i] < that[i] ? -1 : 1;
23027
23032
  return self.length < that.length ? -1 : self.length > that.length ? 1 : 0;
@@ -23918,7 +23923,7 @@ const binaryUnits = [
23918
23923
  const allUnits = [...decimalUnits, .../*#__PURE__*/ binaryUnits.slice(1)];
23919
23924
  const unitsByName = /*#__PURE__*/ new Map(/*#__PURE__*/ allUnits.flatMap((unit) => unit.names.map((name) => [name, unit])));
23920
23925
  const unitsBySymbol = /*#__PURE__*/ new Map(/*#__PURE__*/ allUnits.map((unit) => [unit.symbol, unit]));
23921
- const make$79 = (value) => value;
23926
+ const make$81 = (value) => value;
23922
23927
  /**
23923
23928
  * The byte size containing zero bytes.
23924
23929
  *
@@ -23926,13 +23931,13 @@ const make$79 = (value) => value;
23926
23931
  * @category constants
23927
23932
  * @since 4.0.0
23928
23933
  */
23929
- const zero$1 = /*#__PURE__*/ make$79(bigint0$3);
23934
+ const zero$1 = /*#__PURE__*/ make$81(bigint0$3);
23930
23935
  const invalid$2 = (message) => {
23931
23936
  throw new Error(`Invalid ByteSize: ${message}`);
23932
23937
  };
23933
23938
  const fromNumber = (input) => {
23934
23939
  if (!Number.isSafeInteger(input) || input < 0) return invalid$2(`expected a non-negative safe integer, received ${input}`);
23935
- return make$79(BigInt(input));
23940
+ return make$81(BigInt(input));
23936
23941
  };
23937
23942
  const maxSafeInteger = /*#__PURE__*/ BigInt(Number.MAX_SAFE_INTEGER);
23938
23943
  const scaleDecimal = (quantity, factor) => {
@@ -23948,14 +23953,14 @@ const scaleDecimal = (quantity, factor) => {
23948
23953
  const fromQuantity = (quantity, unit) => {
23949
23954
  if (typeof quantity === "bigint") {
23950
23955
  if (quantity < bigint0$3) return invalid$2(`expected a non-negative quantity, received ${quantity}`);
23951
- return make$79(quantity * unit.factor);
23956
+ return make$81(quantity * unit.factor);
23952
23957
  }
23953
23958
  if (binaryUnits.includes(unit)) {
23954
23959
  const value = quantity * Number(unit.factor);
23955
- if (Number.isSafeInteger(value) && value >= 0) return make$79(BigInt(value));
23960
+ if (Number.isSafeInteger(value) && value >= 0) return make$81(BigInt(value));
23956
23961
  } else {
23957
23962
  const value = scaleDecimal(String(quantity), unit.factor);
23958
- if (value !== void 0 && value <= maxSafeInteger) return make$79(value);
23963
+ if (value !== void 0 && value <= maxSafeInteger) return make$81(value);
23959
23964
  }
23960
23965
  return invalid$2(`expected an exact non-negative safe-integer byte result, received ${quantity} ${unit.symbol}`);
23961
23966
  };
@@ -23981,7 +23986,7 @@ const fromStringUnsafe$1 = (input) => {
23981
23986
  if (unit === void 0) return invalid$2(`unsupported unit ${JSON.stringify(match[2])}`);
23982
23987
  const value = scaleDecimal(match[1], unit.factor);
23983
23988
  if (value === void 0) return invalid$2(`${JSON.stringify(input)} does not represent an integral number of bytes`);
23984
- return make$79(value);
23989
+ return make$81(value);
23985
23990
  };
23986
23991
  /**
23987
23992
  * Decodes a trusted input into a byte size and throws for invalid input.
@@ -23994,7 +23999,7 @@ const fromInputUnsafe = (input) => {
23994
23999
  switch (typeof input) {
23995
24000
  case "bigint":
23996
24001
  if (input < bigint0$3) return invalid$2(`expected a non-negative bigint, received ${input}`);
23997
- return make$79(input);
24002
+ return make$81(input);
23998
24003
  case "number": return fromNumber(input);
23999
24004
  case "string": return fromStringUnsafe$1(input);
24000
24005
  }
@@ -24630,7 +24635,7 @@ const isNotLink = (error) => isIgnorable(error) || error.reason._tag === "Unknow
24630
24635
  const DIRECTORY_CONCURRENCY = 16;
24631
24636
  const byName = /*#__PURE__*/ mapInput(String$10, (entry) => entry.name);
24632
24637
  /** @internal */
24633
- const make$78 = (fs) => (pattern, options) => walk(fs, compile$4([pattern], options?.dot ?? false), options);
24638
+ const make$80 = (fs) => (pattern, options) => walk(fs, compile$4([pattern], options?.dot ?? false), options);
24634
24639
  const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
24635
24640
  if (compiled.initial.size === 0) return [];
24636
24641
  const root = options?.root ?? "";
@@ -24917,7 +24922,7 @@ const emptyArray = [];
24917
24922
  * @category instances
24918
24923
  * @since 4.0.0
24919
24924
  */
24920
- const makeEquivalence$1 = (isEquivalent) => make$88((self, that) => {
24925
+ const makeEquivalence$1 = (isEquivalent) => make$90((self, that) => {
24921
24926
  if (self.length !== that.length) return false;
24922
24927
  const as = toReadonlyArray(self);
24923
24928
  const bs = toReadonlyArray(that);
@@ -25144,7 +25149,7 @@ const makeUnsafe$5 = makeLatchUnsafe;
25144
25149
  * @category constructors
25145
25150
  * @since 4.0.0
25146
25151
  */
25147
- const make$77 = makeLatch;
25152
+ const make$79 = makeLatch;
25148
25153
  // ../../node_modules/.pnpm/effect@4.1.7/node_modules/effect/dist/MutableRef.js
25149
25154
  const TypeId$60 = "~effect/MutableRef";
25150
25155
  const MutableRefProto = {
@@ -25190,7 +25195,7 @@ const MutableRefProto = {
25190
25195
  * @category constructors
25191
25196
  * @since 2.0.0
25192
25197
  */
25193
- const make$76 = (value) => {
25198
+ const make$78 = (value) => {
25194
25199
  const ref = Object.create(MutableRefProto);
25195
25200
  ref.current = value;
25196
25201
  return ref;
@@ -25306,7 +25311,7 @@ const Empty$2 = /*#__PURE__*/ Symbol.for("effect/MutableList/Empty");
25306
25311
  * @category constructors
25307
25312
  * @since 2.0.0
25308
25313
  */
25309
- const make$75 = () => ({
25314
+ const make$77 = () => ({
25310
25315
  head: void 0,
25311
25316
  tail: void 0,
25312
25317
  length: 0
@@ -25722,7 +25727,7 @@ const filter = (self, f) => {
25722
25727
  * @category mutations
25723
25728
  * @since 4.0.0
25724
25729
  */
25725
- const remove$2 = (self, value) => filter(self, (v) => v !== value);
25730
+ const remove$3 = (self, value) => filter(self, (v) => v !== value);
25726
25731
  // ../../node_modules/.pnpm/effect@4.1.7/node_modules/effect/dist/PubSub.js
25727
25732
  const TypeId$59 = "~effect/PubSub";
25728
25733
  const SubscriptionTypeId = "~effect/PubSub/Subscription";
@@ -25755,7 +25760,7 @@ const SubscriptionTypeId = "~effect/PubSub/Subscription";
25755
25760
  * @category constructors
25756
25761
  * @since 4.0.0
25757
25762
  */
25758
- const make$74 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(), /* @__PURE__ */ new Map(), makeUnsafe$7(), makeUnsafe$5(false), make$76(false), options.strategy(), make$76(none())));
25763
+ const make$76 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(), /* @__PURE__ */ new Map(), makeUnsafe$7(), makeUnsafe$5(false), make$78(false), options.strategy(), make$78(none())));
25759
25764
  /**
25760
25765
  * Creates an unbounded `PubSub`.
25761
25766
  *
@@ -25786,7 +25791,7 @@ const make$74 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(),
25786
25791
  * @category constructors
25787
25792
  * @since 2.0.0
25788
25793
  */
25789
- const unbounded = (options) => make$74({
25794
+ const unbounded = (options) => make$76({
25790
25795
  atomicPubSub: () => makeAtomicUnbounded(options),
25791
25796
  strategy: () => new DroppingStrategy()
25792
25797
  });
@@ -25919,7 +25924,7 @@ const publish = /*#__PURE__*/ dual(2, (self, value) => suspend$3(() => {
25919
25924
  * @since 2.0.0
25920
25925
  */
25921
25926
  const subscribe = (self) => uninterruptible(contextWith((services) => {
25922
- const localScope = get$12(services, Scope);
25927
+ const localScope = get$13(services, Scope);
25923
25928
  const scope = forkUnsafe(self.scope);
25924
25929
  const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
25925
25930
  return addFinalizer$1(scope, unsubscribe(subscription)).pipe(andThen(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
@@ -26002,7 +26007,7 @@ const pollForItem = (self) => callback$1((resume) => {
26002
26007
  self.strategy.completePollersUnsafe(self.pubsub, self.subscribers, self.subscription, self.pollers);
26003
26008
  if (deferred.effect) return resume(deferred.effect);
26004
26009
  deferred.resumes = [resume];
26005
- return sync(() => remove$2(self.pollers, deferred));
26010
+ return sync(() => remove$3(self.pollers, deferred));
26006
26011
  });
26007
26012
  const AbsentValue = /*#__PURE__*/ Symbol.for("effect/PubSub/AbsentValue");
26008
26013
  const addSubscribers = (subscribers, subscription, pollers) => {
@@ -26015,7 +26020,7 @@ const removeSubscribers = (subscribers, subscription, pollers) => {
26015
26020
  set.delete(pollers);
26016
26021
  if (set.size === 0) subscribers.delete(subscription);
26017
26022
  };
26018
- const makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make$75(), makeUnsafe$5(false), make$76(false), strategy, pubsub.replayWindow(), ended);
26023
+ const makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make$77(), makeUnsafe$5(false), make$78(false), strategy, pubsub.replayWindow(), ended);
26019
26024
  var UnboundedPubSub = class {
26020
26025
  publisherHead = {
26021
26026
  value: AbsentValue,
@@ -26483,12 +26488,12 @@ const QueueProto = {
26483
26488
  * @category constructors
26484
26489
  * @since 4.0.0
26485
26490
  */
26486
- const make$73 = (options) => withFiber$1((fiber) => {
26491
+ const make$75 = (options) => withFiber$1((fiber) => {
26487
26492
  const self = Object.create(QueueProto);
26488
26493
  self.dispatcher = fiber.currentDispatcher;
26489
26494
  self.capacity = options?.capacity ?? Number.POSITIVE_INFINITY;
26490
26495
  self.strategy = options?.strategy ?? "suspend";
26491
- self.messages = make$75();
26496
+ self.messages = make$77();
26492
26497
  self.scheduleRunning = false;
26493
26498
  self.state = {
26494
26499
  _tag: "Open",
@@ -26529,7 +26534,7 @@ const make$73 = (options) => withFiber$1((fiber) => {
26529
26534
  * @category constructors
26530
26535
  * @since 2.0.0
26531
26536
  */
26532
- const bounded = (capacity) => make$73({ capacity });
26537
+ const bounded = (capacity) => make$75({ capacity });
26533
26538
  /**
26534
26539
  * Creates a bounded queue with sliding strategy. When the queue reaches capacity,
26535
26540
  * new elements are added and the oldest elements are dropped.
@@ -26566,7 +26571,7 @@ const bounded = (capacity) => make$73({ capacity });
26566
26571
  * @category constructors
26567
26572
  * @since 2.0.0
26568
26573
  */
26569
- const sliding = (capacity) => make$73({
26574
+ const sliding = (capacity) => make$75({
26570
26575
  capacity,
26571
26576
  strategy: "sliding"
26572
26577
  });
@@ -26605,7 +26610,7 @@ const sliding = (capacity) => make$73({
26605
26610
  * @category constructors
26606
26611
  * @since 2.0.0
26607
26612
  */
26608
- const dropping = (capacity) => make$73({
26613
+ const dropping = (capacity) => make$75({
26609
26614
  capacity,
26610
26615
  strategy: "dropping"
26611
26616
  });
@@ -26804,7 +26809,7 @@ const offerAll = /*#__PURE__*/ dual(2, (self, messages) => callback$2((resume) =
26804
26809
  * @since 4.0.0
26805
26810
  */
26806
26811
  const offerAllUnsafe = (self, messages) => {
26807
- if (self.state._tag !== "Open") return fromIterable$5(messages);
26812
+ if (self.state._tag !== "Open") return fromIterable$6(messages);
26808
26813
  else if (self.capacity === Number.POSITIVE_INFINITY || self.strategy === "sliding") {
26809
26814
  appendAll(self.messages, messages);
26810
26815
  if (self.strategy === "sliding") {
@@ -26815,7 +26820,7 @@ const offerAllUnsafe = (self, messages) => {
26815
26820
  return [];
26816
26821
  }
26817
26822
  const free = (self.capacity <= 0 ? self.state.takers.size : self.capacity) - self.messages.length;
26818
- if (free <= 0) return fromIterable$5(messages);
26823
+ if (free <= 0) return fromIterable$6(messages);
26819
26824
  const remaining = [];
26820
26825
  let i = 0;
26821
26826
  for (const message of messages) {
@@ -27765,7 +27770,7 @@ var SemaphoreImpl = class {
27765
27770
  * @category constructors
27766
27771
  * @since 4.0.0
27767
27772
  */
27768
- const make$72 = (permits) => sync$2(() => new SemaphoreImpl(permits));
27773
+ const make$74 = (permits) => sync$2(() => new SemaphoreImpl(permits));
27769
27774
  /**
27770
27775
  * Runs an effect with a single permit and releases the permit when the effect
27771
27776
  * completes.
@@ -27971,7 +27976,7 @@ const fromTransformBracket = (f) => fromTransform$1(fnUntraced(function* (upstre
27971
27976
  * @since 4.0.0
27972
27977
  */
27973
27978
  const toTransform = (channel) => channel.transform;
27974
- const asyncQueue = (scope, f, options) => make$73({
27979
+ const asyncQueue = (scope, f, options) => make$75({
27975
27980
  capacity: options?.bufferSize,
27976
27981
  strategy: options?.strategy
27977
27982
  }).pipe(tap$1((queue) => addFinalizer$1(scope, shutdown(queue))), tap$1((queue) => provide$3(f(queue), scope).pipe(catchCause$2((cause) => failCause$2(queue, cause)), forkIn(scope, { startImmediately: true }))));
@@ -28241,7 +28246,7 @@ const fromReadableStream$1 = (options) => fromTransform$1((_, scope) => readable
28241
28246
  }));
28242
28247
  const readableStreamToPullUnsafe = (options) => {
28243
28248
  const reader = options.readable.getReader();
28244
- const exit = options.exit ?? make$76(void 0);
28249
+ const exit = options.exit ?? make$78(void 0);
28245
28250
  const pull = suspend$3(() => {
28246
28251
  if (exit.current) return exit.current;
28247
28252
  return matchCauseEffect(tryPromise({
@@ -28789,7 +28794,7 @@ const switchMap$1 = /*#__PURE__*/ dual((args) => isChannel(args[0]), (self, f, o
28789
28794
  const mergeAll = /*#__PURE__*/ dual(2, (channels, { bufferSize = 16, concurrency, switch: switch_ = false }) => fromTransformBracket(fnUntraced(function* (upstream, scope, forkedScope) {
28790
28795
  const concurrencyN = concurrency === "unbounded" ? Number.MAX_SAFE_INTEGER : Math.max(1, concurrency);
28791
28796
  const semaphore = switch_ ? void 0 : makeUnsafe$4(concurrencyN);
28792
- const doneLatch = yield* make$77(true);
28797
+ const doneLatch = yield* make$79(true);
28793
28798
  const fibers = /* @__PURE__ */ new Map();
28794
28799
  const queue = yield* bounded(bufferSize);
28795
28800
  yield* addFinalizer$1(forkedScope, shutdown(queue));
@@ -29165,7 +29170,7 @@ const unwrap$6 = (channel) => fromTransform$1((upstream, scope) => {
29165
29170
  */
29166
29171
  const bufferArray = /*#__PURE__*/ dual(2, (self, options) => fromTransform$1(fnUntraced(function* (upstream, scope) {
29167
29172
  const pull = yield* toTransform(self)(upstream, scope);
29168
- const queue = yield* make$73({
29173
+ const queue = yield* make$75({
29169
29174
  capacity: options.capacity === "unbounded" ? void 0 : options.capacity,
29170
29175
  strategy: options.capacity === "unbounded" ? void 0 : options.strategy
29171
29176
  });
@@ -29795,9 +29800,9 @@ const makeUnsafe$3 = (options) => ({
29795
29800
  * @category constructors
29796
29801
  * @since 3.5.0
29797
29802
  */
29798
- const make$71 = (options) => withFiber((fiber) => {
29803
+ const make$73 = (options) => withFiber((fiber) => {
29799
29804
  const context = fiber.context;
29800
- const scope = get$12(context, Scope);
29805
+ const scope = get$13(context, Scope);
29801
29806
  const self = makeUnsafe$3({
29802
29807
  lookup: options.lookup,
29803
29808
  context,
@@ -29860,11 +29865,11 @@ const make$71 = (options) => withFiber((fiber) => {
29860
29865
  * @category combinators
29861
29866
  * @since 3.5.0
29862
29867
  */
29863
- const get$8 = /*#__PURE__*/ dual(2, (self, key) => uninterruptibleMask((restore) => {
29868
+ const get$9 = /*#__PURE__*/ dual(2, (self, key) => uninterruptibleMask((restore) => {
29864
29869
  if (self.state._tag === "Closed") return interrupt$1;
29865
29870
  const state = self.state;
29866
29871
  const parent = getCurrent();
29867
- const o = get$9(state.map, key);
29872
+ const o = get$10(state.map, key);
29868
29873
  let entry;
29869
29874
  if (o._tag === "Some") {
29870
29875
  entry = o.value;
@@ -29898,9 +29903,9 @@ const get$8 = /*#__PURE__*/ dual(2, (self, key) => uninterruptibleMask((restore)
29898
29903
  }));
29899
29904
  const removeInterrupted = (self, key, entry, context) => {
29900
29905
  if (self.state._tag === "Closed") return;
29901
- const o = get$9(self.state.map, key);
29906
+ const o = get$10(self.state.map, key);
29902
29907
  if (o._tag === "None" || o.value !== entry) return;
29903
- remove$3(self.state.map, key);
29908
+ remove$4(self.state.map, key);
29904
29909
  if (entry.refCount > 0) return;
29905
29910
  closeEntry(entry).pipe(ignoreCause({
29906
29911
  log: "Unhandled",
@@ -29915,13 +29920,13 @@ const release$1 = (self, key, entry) => suspend$3(() => {
29915
29920
  entry.refCount--;
29916
29921
  if (entry.refCount > 0) return void_$2;
29917
29922
  else if (self.state._tag === "Closed") return closeEntry(entry);
29918
- const o = get$9(self.state.map, key);
29923
+ const o = get$10(self.state.map, key);
29919
29924
  if (o._tag === "None" || o.value !== entry) return closeEntry(entry);
29920
29925
  else if (isZero$1(entry.idleTimeToLive)) {
29921
- remove$3(self.state.map, key);
29926
+ remove$4(self.state.map, key);
29922
29927
  return closeEntry(entry);
29923
29928
  } else if (!isFinite$1(entry.idleTimeToLive)) return void_$2;
29924
- const clock = get$12(self.context, Clock);
29929
+ const clock = get$13(self.context, Clock);
29925
29930
  resetExpiresAt(entry, clock);
29926
29931
  if (entry.fiber) return void_$2;
29927
29932
  entry.fiber = uninterruptibleMask(function loop(restore) {
@@ -29929,9 +29934,9 @@ const release$1 = (self, key, entry) => suspend$3(() => {
29929
29934
  const remaining = entry.expiresAt - now;
29930
29935
  if (remaining <= 0) {
29931
29936
  if (self.state._tag === "Closed" || entry.refCount > 0) return void_$2;
29932
- const o = get$9(self.state.map, key);
29937
+ const o = get$10(self.state.map, key);
29933
29938
  if (o._tag === "None" || o.value !== entry) return void_$2;
29934
- remove$3(self.state.map, key);
29939
+ remove$4(self.state.map, key);
29935
29940
  return ignoreCause(close(entry.scope, void_$3), {
29936
29941
  log: "Unhandled",
29937
29942
  message: "Unhandled error in RcMap finalizer"
@@ -29969,9 +29974,9 @@ var RcRefImpl = class {
29969
29974
  }
29970
29975
  };
29971
29976
  /** @internal */
29972
- const make$70 = (options) => withFiber((fiber) => {
29977
+ const make$72 = (options) => withFiber((fiber) => {
29973
29978
  const context = fiber.context;
29974
- const scope = get$12(context, Scope);
29979
+ const scope = get$13(context, Scope);
29975
29980
  const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== void 0 ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
29976
29981
  return as(addFinalizerExit(scope, () => {
29977
29982
  const state = ref.state;
@@ -30034,7 +30039,7 @@ const awaitAcquiring = (self, acquiring, restore) => onExit$1(restore(join$2(acq
30034
30039
  return interrupt(acquiring.fiber);
30035
30040
  });
30036
30041
  /** @internal */
30037
- const get$7 = (self_) => {
30042
+ const get$8 = (self_) => {
30038
30043
  const self = self_;
30039
30044
  return uninterruptibleMask((restore) => flatMap$3(scope, (scope) => flatMap$3(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
30040
30045
  };
@@ -30108,7 +30113,7 @@ const release = (self, state) => {
30108
30113
  * @category constructors
30109
30114
  * @since 3.5.0
30110
30115
  */
30111
- const make$69 = make$70;
30116
+ const make$71 = make$72;
30112
30117
  /**
30113
30118
  * Gets the value from an `RcRef`, acquiring it first if needed.
30114
30119
  *
@@ -30154,7 +30159,7 @@ const make$69 = make$70;
30154
30159
  * @category combinators
30155
30160
  * @since 3.5.0
30156
30161
  */
30157
- const get$6 = get$7;
30162
+ const get$7 = get$8;
30158
30163
  // ../../node_modules/.pnpm/effect@4.1.7/node_modules/effect/dist/Stream.js
30159
30164
  /**
30160
30165
  * Describes effectful sources that emit values over time.
@@ -30467,7 +30472,7 @@ const succeed$3 = (value) => fromChannel(succeed$4(of(value)));
30467
30472
  * @category constructors
30468
30473
  * @since 2.0.0
30469
30474
  */
30470
- const make$68 = (...values) => fromArray(values);
30475
+ const make$70 = (...values) => fromArray(values);
30471
30476
  /**
30472
30477
  * Creates a lazily constructed stream.
30473
30478
  *
@@ -32061,10 +32066,10 @@ const FileSystem = /*#__PURE__*/ Service$1("effect/FileSystem");
32061
32066
  * @category constructors
32062
32067
  * @since 4.0.0
32063
32068
  */
32064
- const make$67 = (impl) => FileSystem.of({
32069
+ const make$69 = (impl) => FileSystem.of({
32065
32070
  ...impl,
32066
32071
  [TypeId$51]: TypeId$51,
32067
- glob: make$78(impl),
32072
+ glob: make$80(impl),
32068
32073
  exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed$5(false) : fail$7(e))),
32069
32074
  readFileString: (path, encoding) => flatMap$3(impl.readFile(path), (_) => try_({
32070
32075
  try: () => new TextDecoder(encoding).decode(_),
@@ -32283,7 +32288,7 @@ const Path$1 = /*#__PURE__*/ Service$1("effect/Path");
32283
32288
  * @category constructors
32284
32289
  * @since 4.0.0
32285
32290
  */
32286
- const make$66 = (impl) => Path$1.of({
32291
+ const make$68 = (impl) => Path$1.of({
32287
32292
  ...impl,
32288
32293
  [TypeId$50]: TypeId$50,
32289
32294
  resolveWithin(root, input) {
@@ -33040,7 +33045,7 @@ const makeZonedUnsafe = makeZonedUnsafe$1;
33040
33045
  * @category constructors
33041
33046
  * @since 3.6.0
33042
33047
  */
33043
- const make$65 = make$81;
33048
+ const make$67 = make$83;
33044
33049
  /**
33045
33050
  * Gets the current time using the `Clock` service and converts it to a `DateTime`.
33046
33051
  *
@@ -34562,7 +34567,7 @@ const isBigDecimal = (u) => hasProperty(u, TypeId$48);
34562
34567
  * @category constructors
34563
34568
  * @since 2.0.0
34564
34569
  */
34565
- const make$64 = (value, scale) => {
34570
+ const make$66 = (value, scale) => {
34566
34571
  if (!Number.isSafeInteger(scale)) throw new RangeError(`Scale must be a safe integer, got ${scale}`);
34567
34572
  const o = Object.create(BigDecimalProto);
34568
34573
  o.value = value;
@@ -34570,7 +34575,7 @@ const make$64 = (value, scale) => {
34570
34575
  return o;
34571
34576
  };
34572
34577
  const makeNormalized = (value, scale) => {
34573
- const o = make$64(value, scale);
34578
+ const o = make$66(value, scale);
34574
34579
  o.normalized = o;
34575
34580
  return o;
34576
34581
  };
@@ -34669,7 +34674,7 @@ const compare$1 = (self, that) => {
34669
34674
  * @category instances
34670
34675
  * @since 2.0.0
34671
34676
  */
34672
- const Order$1 = /*#__PURE__*/ make$87(compare$1);
34677
+ const Order$1 = /*#__PURE__*/ make$89(compare$1);
34673
34678
  /**
34674
34679
  * Determines the sign of a given `BigDecimal`.
34675
34680
  *
@@ -37913,7 +37918,7 @@ const makeHandle = (params) => Object.setPrototypeOf({ ...params }, HandleProto)
37913
37918
  * @category constructors
37914
37919
  * @since 4.0.0
37915
37920
  */
37916
- const make$63 = (spawn) => {
37921
+ const make$65 = (spawn) => {
37917
37922
  const streamString = (command, options) => spawn(command).pipe(map$7((handle) => decodeText$1(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap$4);
37918
37923
  const streamLines = (command, options) => splitLines(streamString(command, options));
37919
37924
  return ChildProcessSpawner.of({
@@ -38014,7 +38019,7 @@ const isRedacted = (u) => hasProperty(u, TypeId$45);
38014
38019
  * @category constructors
38015
38020
  * @since 3.3.0
38016
38021
  */
38017
- const make$62 = (value, options) => {
38022
+ const make$64 = (value, options) => {
38018
38023
  const self = Object.create(Proto$18);
38019
38024
  if (options?.label) self.label = options.label;
38020
38025
  redactedRegistry.set(self, value);
@@ -38089,7 +38094,7 @@ const value$2 = value$3;
38089
38094
  * @category instances
38090
38095
  * @since 4.0.0
38091
38096
  */
38092
- const makeEquivalence = (isEquivalent) => make$88((x, y) => isEquivalent(value$2(x), value$2(y)));
38097
+ const makeEquivalence = (isEquivalent) => make$90((x, y) => isEquivalent(value$2(x), value$2(y)));
38093
38098
  // ../../node_modules/.pnpm/effect@4.1.7/node_modules/effect/dist/process/CommandLine.js
38094
38099
  /**
38095
38100
  * Builds command lines, the single strings that a shell or a Windows program
@@ -38352,7 +38357,7 @@ const parseTemplate$1 = (texts, values) => {
38352
38357
  const endWord = () => {
38353
38358
  if (word.length === 0) return;
38354
38359
  const value = word.map(unwrap$3).join("");
38355
- words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$62(value) : value);
38360
+ words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$64(value) : value);
38356
38361
  word = [];
38357
38362
  plain = true;
38358
38363
  braceDepth = 0;
@@ -38495,7 +38500,7 @@ const makeStandardCommand = (command, args, options) => Object.assign(Object.cre
38495
38500
  * @category constructors
38496
38501
  * @since 4.0.0
38497
38502
  */
38498
- const make$61 = function make(...args) {
38503
+ const make$63 = function make(...args) {
38499
38504
  if (isTemplateString(args[0])) {
38500
38505
  const [templates, ...expressions] = args;
38501
38506
  const [command, cmdArgs] = parseTemplate(templates, expressions);
@@ -38816,7 +38821,7 @@ const fromReadableChannel = (options) => fromTransform$1((_, scope) => readableT
38816
38821
  */
38817
38822
  const fromDuplex$1 = (options) => fromTransform$1((upstream, scope) => {
38818
38823
  const duplex = options.evaluate();
38819
- const exit = make$76(void 0);
38824
+ const exit = make$78(void 0);
38820
38825
  const latch = makeUnsafe$5(false);
38821
38826
  return pullIntoWritable({
38822
38827
  pull: upstream,
@@ -38931,7 +38936,7 @@ const readableToPullUnsafe = (options) => {
38931
38936
  const readable = options.readable;
38932
38937
  const chunkSize = options.chunkSize ?? 4096;
38933
38938
  const closeOnDone = options.closeOnDone ?? true;
38934
- const exit = options.exit ?? make$76(void 0);
38939
+ const exit = options.exit ?? make$78(void 0);
38935
38940
  const latch = options.latch ?? makeUnsafe$5(false);
38936
38941
  function onReadable() {
38937
38942
  latch.openUnsafe();
@@ -39412,7 +39417,7 @@ const layer$23 = /*#__PURE__*/ effect(ChildProcessSpawner, /*#__PURE__*/ (/* @__
39412
39417
  const stdinConfig = resolveStdinOption(command.options);
39413
39418
  const sourceStream = unwrap$4(succeed$5(getSourceStream(handles[handles.length - 1], options.from)));
39414
39419
  const toOption = options.to ?? "stdin";
39415
- if (toOption === "stdin") handles.push(yield* spawnCommand(make$61(command.command, command.args, {
39420
+ if (toOption === "stdin") handles.push(yield* spawnCommand(make$63(command.command, command.args, {
39416
39421
  ...command.options,
39417
39422
  stdin: {
39418
39423
  ...stdinConfig,
@@ -39432,14 +39437,14 @@ const layer$23 = /*#__PURE__*/ effect(ChildProcessSpawner, /*#__PURE__*/ (/* @__
39432
39437
  type: "input",
39433
39438
  stream: sourceStream
39434
39439
  };
39435
- handles.push(yield* spawnCommand(make$61(command.command, command.args, {
39440
+ handles.push(yield* spawnCommand(make$63(command.command, command.args, {
39436
39441
  ...command.options,
39437
39442
  additionalFds: {
39438
39443
  ...existingFds,
39439
39444
  [fdName$1]: fdConfig
39440
39445
  }
39441
39446
  })));
39442
- } else handles.push(yield* spawnCommand(make$61(command.command, command.args, {
39447
+ } else handles.push(yield* spawnCommand(make$63(command.command, command.args, {
39443
39448
  ...command.options,
39444
39449
  stdin: {
39445
39450
  ...stdinConfig,
@@ -39471,7 +39476,7 @@ const layer$23 = /*#__PURE__*/ effect(ChildProcessSpawner, /*#__PURE__*/ (/* @__
39471
39476
  }
39472
39477
  }
39473
39478
  });
39474
- return make$63(spawnCommand);
39479
+ return make$65(spawnCommand);
39475
39480
  }))(/*#__PURE__*/ succeed$5(spawnDirect)));
39476
39481
  /**
39477
39482
  * Flattens a `Command` into an array of `StandardCommand`s along with pipe
@@ -39554,7 +39559,7 @@ const RefProto = {
39554
39559
  */
39555
39560
  const makeUnsafe$1 = (value) => {
39556
39561
  const self = Object.create(RefProto);
39557
- self.ref = make$76(value);
39562
+ self.ref = make$78(value);
39558
39563
  return self;
39559
39564
  };
39560
39565
  /**
@@ -39583,7 +39588,7 @@ const makeUnsafe$1 = (value) => {
39583
39588
  * @category constructors
39584
39589
  * @since 2.0.0
39585
39590
  */
39586
- const make$60 = (value) => sync(() => makeUnsafe$1(value));
39591
+ const make$62 = (value) => sync(() => makeUnsafe$1(value));
39587
39592
  /**
39588
39593
  * Gets the current value of the Ref.
39589
39594
  *
@@ -39610,7 +39615,7 @@ const make$60 = (value) => sync(() => makeUnsafe$1(value));
39610
39615
  * @category getters
39611
39616
  * @since 2.0.0
39612
39617
  */
39613
- const get$5 = (self) => sync(() => self.ref.current);
39618
+ const get$6 = (self) => sync(() => self.ref.current);
39614
39619
  /**
39615
39620
  * Updates the value of the Ref atomically using the given function.
39616
39621
  *
@@ -39760,7 +39765,7 @@ const fromReadonlyRecord = (cookies) => {
39760
39765
  * @category constructors
39761
39766
  * @since 4.0.0
39762
39767
  */
39763
- const fromIterable$2 = (cookies) => {
39768
+ const fromIterable$3 = (cookies) => {
39764
39769
  const record = {};
39765
39770
  for (const cookie of cookies) assignProperty(record, cookie.name, cookie);
39766
39771
  return fromReadonlyRecord(record);
@@ -39779,7 +39784,7 @@ const fromSetCookie = (headers) => {
39779
39784
  const cookie = parseSetCookie(header.trim());
39780
39785
  if (cookie) cookies.push(cookie);
39781
39786
  }
39782
- return fromIterable$2(cookies);
39787
+ return fromIterable$3(cookies);
39783
39788
  };
39784
39789
  function parseSetCookie(header) {
39785
39790
  const parts = header.split(";").map((_) => _.trim()).filter((_) => _ !== "");
@@ -39870,7 +39875,7 @@ function parseSetCookie(header) {
39870
39875
  * @category constructors
39871
39876
  * @since 4.0.0
39872
39877
  */
39873
- const empty$7 = /*#__PURE__*/ fromIterable$2([]);
39878
+ const empty$7 = /*#__PURE__*/ fromIterable$3([]);
39874
39879
  /**
39875
39880
  * Returns `true` when the `Cookies` collection contains no cookies.
39876
39881
  *
@@ -40209,7 +40214,7 @@ const TypeId$42 = /*#__PURE__*/ Symbol.for("~effect/http/Headers");
40209
40214
  const Proto$15 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.create(null), {
40210
40215
  [TypeId$42]: { value: TypeId$42 },
40211
40216
  [symbolRedactable]: { value(context) {
40212
- return redact$1(this, get$12(context, CurrentRedactedNames$1));
40217
+ return redact$1(this, get$13(context, CurrentRedactedNames$1));
40213
40218
  } },
40214
40219
  toJSON: { value() {
40215
40220
  return redact$2(this);
@@ -40223,7 +40228,7 @@ const Proto$15 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.crea
40223
40228
  toString: { value: BaseProto.toString },
40224
40229
  [NodeInspectSymbol]: { value: BaseProto[NodeInspectSymbol] }
40225
40230
  });
40226
- const make$59 = (input) => Object.assign(Object.create(Proto$15), input);
40231
+ const make$61 = (input) => Object.assign(Object.create(Proto$15), input);
40227
40232
  /**
40228
40233
  * Provides an `Equivalence` instance that compares `Headers` by header names
40229
40234
  * and string values.
@@ -40294,7 +40299,7 @@ const fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto$15);
40294
40299
  * @category combinators
40295
40300
  * @since 4.0.0
40296
40301
  */
40297
- const get$4 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLowerCase()]));
40302
+ const get$5 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLowerCase()]));
40298
40303
  /**
40299
40304
  * Returns a new `Headers` collection with the given header set.
40300
40305
  *
@@ -40307,7 +40312,7 @@ const get$4 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLo
40307
40312
  * @since 4.0.0
40308
40313
  */
40309
40314
  const set$1 = /*#__PURE__*/ dual(3, (self, key, value) => {
40310
- const out = make$59(self);
40315
+ const out = make$61(self);
40311
40316
  out[key.toLowerCase()] = value;
40312
40317
  return out;
40313
40318
  });
@@ -40322,7 +40327,7 @@ const set$1 = /*#__PURE__*/ dual(3, (self, key, value) => {
40322
40327
  * @category combinators
40323
40328
  * @since 4.0.0
40324
40329
  */
40325
- const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$59({
40330
+ const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$61({
40326
40331
  ...self,
40327
40332
  ...fromInput$1(headers)
40328
40333
  }));
@@ -40338,7 +40343,7 @@ const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$59({
40338
40343
  * @since 4.0.0
40339
40344
  */
40340
40345
  const merge$1 = /*#__PURE__*/ dual(2, (self, headers) => {
40341
- const out = make$59(self);
40346
+ const out = make$61(self);
40342
40347
  Object.assign(out, headers);
40343
40348
  return out;
40344
40349
  });
@@ -40353,8 +40358,8 @@ const merge$1 = /*#__PURE__*/ dual(2, (self, headers) => {
40353
40358
  * @category combinators
40354
40359
  * @since 4.0.0
40355
40360
  */
40356
- const remove$1 = /*#__PURE__*/ dual(2, (self, key) => {
40357
- const out = make$59(self);
40361
+ const remove$2 = /*#__PURE__*/ dual(2, (self, key) => {
40362
+ const out = make$61(self);
40358
40363
  delete out[key.toLowerCase()];
40359
40364
  return out;
40360
40365
  });
@@ -40374,8 +40379,8 @@ const redact$1 = /*#__PURE__*/ dual(2, (self, key) => {
40374
40379
  const modify = (key) => {
40375
40380
  if (typeof key === "string") {
40376
40381
  const k = key.toLowerCase();
40377
- if (k in self) out[k] = make$62(self[k]);
40378
- } else for (const name in self) if (name.search(key) !== -1) out[name] = make$62(self[name]);
40382
+ if (k in self) out[k] = make$64(self[k]);
40383
+ } else for (const name in self) if (name.search(key) !== -1) out[name] = make$64(self[name]);
40379
40384
  };
40380
40385
  if (Array.isArray(key)) for (let i = 0; i < key.length; i++) modify(key[i]);
40381
40386
  else modify(key);
@@ -41646,7 +41651,7 @@ const redactedProto = (typeId, label) => ({
41646
41651
  * Builds a key. Keys compare by reference: comparing key bytes is not constant
41647
41652
  * time, and structural equality would let secret keys act as `HashMap` keys.
41648
41653
  */
41649
- const make$58 = (proto, algorithm, material) => byReferenceUnsafe(Object.create(proto, {
41654
+ const make$60 = (proto, algorithm, material) => byReferenceUnsafe(Object.create(proto, {
41650
41655
  algorithm: {
41651
41656
  value: algorithm,
41652
41657
  enumerable: true
@@ -41654,7 +41659,7 @@ const make$58 = (proto, algorithm, material) => byReferenceUnsafe(Object.create(
41654
41659
  [MaterialId]: { value: material }
41655
41660
  }));
41656
41661
  /** @internal */
41657
- const makeBytes = (proto, algorithm, bytes) => make$58(proto, algorithm, {
41662
+ const makeBytes = (proto, algorithm, bytes) => make$60(proto, algorithm, {
41658
41663
  _tag: "Bytes",
41659
41664
  bytes
41660
41665
  });
@@ -41717,7 +41722,7 @@ const importedAlgorithm = (algorithm, cryptoKey) => {
41717
41722
  */
41718
41723
  const fromCryptoKey$3 = (module, method, proto, algorithm, cryptoKey, expected) => suspend$3(() => {
41719
41724
  const problem = checkCryptoKey(cryptoKey, expected);
41720
- return problem === void 0 ? succeed$5(make$58(proto, importedAlgorithm(algorithm, cryptoKey), {
41725
+ return problem === void 0 ? succeed$5(make$60(proto, importedAlgorithm(algorithm, cryptoKey), {
41721
41726
  _tag: "CryptoKey",
41722
41727
  cryptoKey
41723
41728
  })) : invalidKey(module, method, problem);
@@ -41983,7 +41988,7 @@ const makeUuid = (bytes, randomBytes, format) => {
41983
41988
  * @category constructors
41984
41989
  * @since 4.0.0
41985
41990
  */
41986
- const make$57 = (randomBytes) => {
41991
+ const make$59 = (randomBytes) => {
41987
41992
  const randomBytesChecked = (size) => {
41988
41993
  checkSize(size);
41989
41994
  return randomBytes(size);
@@ -42029,7 +42034,7 @@ const fillRandom = (crypto, size) => {
42029
42034
  * @category layers
42030
42035
  * @since 4.0.0
42031
42036
  */
42032
- const layerWebCrypto$7 = /*#__PURE__*/ effect(SecureRandom, /*#__PURE__*/ WebCrypto.use((crypto) => succeed$5(make$57((size) => fillRandom(crypto, size)))));
42037
+ const layerWebCrypto$7 = /*#__PURE__*/ effect(SecureRandom, /*#__PURE__*/ WebCrypto.use((crypto) => succeed$5(make$59((size) => fillRandom(crypto, size)))));
42033
42038
  /**
42034
42039
  * Synchronously generates `size` cryptographically secure random bytes from
42035
42040
  * `globalThis.crypto`.
@@ -44160,7 +44165,7 @@ var HashMapImpl = class {
44160
44165
  const thatImpl = that;
44161
44166
  if (this.size !== thatImpl.size) return false;
44162
44167
  for (const [key, value] of this) {
44163
- const otherValue = pipe(that, get$3(key));
44168
+ const otherValue = pipe(that, get$4(key));
44164
44169
  if (isNone(otherValue) || !equals$1(value, otherValue.value)) return false;
44165
44170
  }
44166
44171
  return true;
@@ -44193,7 +44198,22 @@ const isHashMap$1 = (u) => hasProperty(u, HashMapTypeId);
44193
44198
  /** @internal */
44194
44199
  const empty$5 = () => new HashMapImpl(false, 0, emptyNode, 0);
44195
44200
  /** @internal */
44196
- const get$3 = /*#__PURE__*/ dual(2, (self, key) => {
44201
+ const make$58 = (...entries) => fromIterable$2(entries);
44202
+ /** @internal */
44203
+ const fromIterable$2 = (entries) => {
44204
+ let root = emptyNode;
44205
+ let size = 0;
44206
+ const added = { value: false };
44207
+ for (const [key, value] of entries) {
44208
+ const hash$2 = hash(key) | 0;
44209
+ added.value = false;
44210
+ root = root.set(NaN, 0, hash$2, key, value, added);
44211
+ if (added.value) size++;
44212
+ }
44213
+ return new HashMapImpl(false, 0, root, size);
44214
+ };
44215
+ /** @internal */
44216
+ const get$4 = /*#__PURE__*/ dual(2, (self, key) => {
44197
44217
  return self._root.get(0, hash(key) | 0, key);
44198
44218
  });
44199
44219
  /** @internal */
@@ -44221,6 +44241,30 @@ const set = /*#__PURE__*/ dual(3, (self, key, value) => {
44221
44241
  const keys = (self) => new HashMapIterator(self._root, identity);
44222
44242
  /** @internal */
44223
44243
  const size$1 = (self) => self.size;
44244
+ /** @internal */
44245
+ const modifyAt$1 = /*#__PURE__*/ dual(3, (self, key, f) => {
44246
+ const updated = f(get$4(self, key));
44247
+ if (isNone(updated)) return has$2(self, key) ? remove$1(self, key) : self;
44248
+ return set(self, key, updated.value);
44249
+ });
44250
+ const removeHash = (self, key, hash) => {
44251
+ const impl = self;
44252
+ const removed = { value: false };
44253
+ const edit = impl._editable ? impl._edit : NaN;
44254
+ const newRoot = impl._root.remove(edit, 0, hash | 0, key, removed);
44255
+ if (!removed.value) return self;
44256
+ if (impl._editable) {
44257
+ impl._root = newRoot ?? emptyNode;
44258
+ impl._size--;
44259
+ return self;
44260
+ }
44261
+ if (newRoot === void 0) return empty$5();
44262
+ return new HashMapImpl(false, impl._edit, newRoot, impl._size - 1);
44263
+ };
44264
+ /** @internal */
44265
+ const remove$1 = /*#__PURE__*/ dual(2, (self, key) => {
44266
+ return removeHash(self, key, hash(key));
44267
+ });
44224
44268
  // ../../node_modules/.pnpm/effect@4.1.7/node_modules/effect/dist/HashMap.js
44225
44269
  /**
44226
44270
  * Stores key/value entries in an immutable hash map.
@@ -44255,6 +44299,74 @@ const size$1 = (self) => self.size;
44255
44299
  * @since 2.0.0
44256
44300
  */
44257
44301
  const isHashMap = isHashMap$1;
44302
+ /**
44303
+ * Constructs a new `HashMap` from an array of key/value pairs.
44304
+ *
44305
+ * **Example** (Creating a HashMap from entries)
44306
+ *
44307
+ * ```ts import.meta.vitest
44308
+ * import { HashMap } from "effect"
44309
+ *
44310
+ * HashMap.make(["a", 1], ["b", 2], ["c", 3]) // => HashMap.make(["a", 1], ["b", 2], ["c", 3])
44311
+ * ```
44312
+ *
44313
+ * @stability stable
44314
+ * @category constructors
44315
+ * @since 2.0.0
44316
+ */
44317
+ const make$57 = make$58;
44318
+ /**
44319
+ * Looks up the value for the specified key in the `HashMap` safely using the
44320
+ * internal hashing function.
44321
+ *
44322
+ * **Example** (Looking up values)
44323
+ *
44324
+ * ```ts import.meta.vitest
44325
+ * import { HashMap, Option } from "effect"
44326
+ *
44327
+ * const map = HashMap.make(["a", 1], ["b", 2])
44328
+ *
44329
+ * HashMap.get(map, "a") // => Option.some(1)
44330
+ * HashMap.get(map, "c") // => Option.none()
44331
+ *
44332
+ * // Using pipe syntax
44333
+ * HashMap.get("b")(map) // => Option.some(2)
44334
+ * ```
44335
+ *
44336
+ * @stability stable
44337
+ * @category getters
44338
+ * @since 2.0.0
44339
+ */
44340
+ const get$3 = get$4;
44341
+ /**
44342
+ * Sets or removes the specified key using an update function.
44343
+ *
44344
+ * **Details**
44345
+ *
44346
+ * The update function receives `Some(value)` when the key exists or `None`
44347
+ * when it does not. Returning `Some(newValue)` stores the value, and returning
44348
+ * `None` removes the key or leaves it absent.
44349
+ *
44350
+ * **Example** (Updating values with Options)
44351
+ *
44352
+ * ```ts import.meta.vitest
44353
+ * import { HashMap, Option } from "effect"
44354
+ *
44355
+ * const map = HashMap.make(["a", 1], ["b", 2])
44356
+ *
44357
+ * // Increment existing value or set to 1 if not present
44358
+ * const updateFn = (option: Option.Option<number>) =>
44359
+ * Option.isSome(option) ? Option.some(option.value + 1) : Option.some(1)
44360
+ *
44361
+ * const updated = HashMap.modifyAt(map, "a", updateFn)
44362
+ * HashMap.get(updated, "a") // => Option.some(2)
44363
+ * ```
44364
+ *
44365
+ * @stability stable
44366
+ * @category transforming
44367
+ * @since 2.0.0
44368
+ */
44369
+ const modifyAt = modifyAt$1;
44258
44370
  // ../../node_modules/.pnpm/effect@4.1.7/node_modules/effect/dist/internal/hashSet.js
44259
44371
  /**
44260
44372
  * @since 2.0.0
@@ -44457,7 +44569,7 @@ const Proto$14 = {
44457
44569
  [symbolRedactable](context) {
44458
44570
  return {
44459
44571
  _id: "UrlParams",
44460
- params: Object.fromEntries(redact(this, get$12(context, CurrentRedactedNames)))
44572
+ params: Object.fromEntries(redact(this, get$13(context, CurrentRedactedNames)))
44461
44573
  };
44462
44574
  },
44463
44575
  toJSON() {
@@ -44510,7 +44622,7 @@ const fromInput = (input) => {
44510
44622
  return make$56(out);
44511
44623
  };
44512
44624
  const fromInputNested = (input) => {
44513
- const entries = typeof input[Symbol.iterator] === "function" ? fromIterable$5(input) : Object.entries(input);
44625
+ const entries = typeof input[Symbol.iterator] === "function" ? fromIterable$6(input) : Object.entries(input);
44514
44626
  const out = [];
44515
44627
  for (const [key, value] of entries) if (Array.isArray(value)) {
44516
44628
  for (let i = 0; i < value.length; i++) if (value[i] !== void 0) out.push([key, coerce(value[i])]);
@@ -44533,7 +44645,7 @@ const coerce = (value) => isRedacted(value) ? value : String(value);
44533
44645
  * @category instances
44534
44646
  * @since 4.0.0
44535
44647
  */
44536
- const Equivalence = /*#__PURE__*/ make$88((a, b) => arrayEquivalence(a.params, b.params));
44648
+ const Equivalence = /*#__PURE__*/ make$90((a, b) => arrayEquivalence(a.params, b.params));
44537
44649
  const arrayEquivalence = /*#__PURE__*/ makeEquivalence$2(/*#__PURE__*/ makeEquivalence$4([/*#__PURE__*/ strictEqual(), /*#__PURE__*/ asEquivalence()]));
44538
44650
  /**
44539
44651
  * An empty `UrlParams` value.
@@ -44591,7 +44703,7 @@ const toString$1 = (input) => new URLSearchParams(fromInput(input).params.map(([
44591
44703
  */
44592
44704
  const redact = /*#__PURE__*/ dual(2, (self, key) => {
44593
44705
  const patterns = Array.isArray(key) ? key : [key];
44594
- return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$62(value) : value]);
44706
+ return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$64(value) : value]);
44595
44707
  });
44596
44708
  /**
44597
44709
  * Checks whether a parameter name matches one of the redaction patterns.
@@ -44670,7 +44782,7 @@ const decodeQueryKey = (key) => {
44670
44782
  return key;
44671
44783
  }
44672
44784
  };
44673
- const currentRedactedNames = () => get$12(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$14(), CurrentRedactedNames);
44785
+ const currentRedactedNames = () => get$13(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$14(), CurrentRedactedNames);
44674
44786
  /**
44675
44787
  * Query parameter names or patterns to redact in inspection, spans and errors.
44676
44788
  *
@@ -46575,7 +46687,7 @@ const recur = /*#__PURE__*/ memoize((ast) => {
46575
46687
  const rest = ast.rest.map(recur);
46576
46688
  const [head, ...tail] = rest;
46577
46689
  const tailLength = tail.length;
46578
- return make$88((a, b) => {
46690
+ return make$90((a, b) => {
46579
46691
  if (!Array.isArray(a) || !Array.isArray(b)) return false;
46580
46692
  const len = a.length;
46581
46693
  if (len !== b.length) return false;
@@ -46592,7 +46704,7 @@ const recur = /*#__PURE__*/ memoize((ast) => {
46592
46704
  if (ast.propertySignatures.length === 0 && ast.indexSignatures.length === 0) return equals$1;
46593
46705
  const propertySignatures = ast.propertySignatures.map((ps) => recur(ps.type));
46594
46706
  const indexSignatures = ast.indexSignatures.map((is) => recur(is.type));
46595
- return make$88((a, b) => {
46707
+ return make$90((a, b) => {
46596
46708
  if (!isObject$2(a) || !isObject$2(b)) return false;
46597
46709
  for (let i = 0; i < propertySignatures.length; i++) {
46598
46710
  const ps = ast.propertySignatures[i];
@@ -46621,7 +46733,7 @@ const recur = /*#__PURE__*/ memoize((ast) => {
46621
46733
  const types = ast.types;
46622
46734
  const index = getCandidateIndex(types);
46623
46735
  const compiled = types.map((candidate) => [_is(candidate), recur(candidate)]);
46624
- return make$88((a, b) => {
46736
+ return make$90((a, b) => {
46625
46737
  const candidates = index(a, false);
46626
46738
  for (let i = 0; i < candidates.length; i++) {
46627
46739
  const [is, equivalence] = compiled[candidates[i]];
@@ -46632,7 +46744,7 @@ const recur = /*#__PURE__*/ memoize((ast) => {
46632
46744
  }
46633
46745
  case "Suspend": {
46634
46746
  let equivalence;
46635
- return make$88((a, b) => (equivalence ??= toEquivalence$1(ast.thunk()))(a, b));
46747
+ return make$90((a, b) => (equivalence ??= toEquivalence$1(ast.thunk()))(a, b));
46636
46748
  }
46637
46749
  }
46638
46750
  });
@@ -49620,7 +49732,7 @@ function Cause(error, defect) {
49620
49732
  }
49621
49733
  function dateTimeUtcFromInput() {
49622
49734
  return transformEffect$1((input, options) => {
49623
- return match$8(make$65(input), {
49735
+ return match$8(make$67(input), {
49624
49736
  onNone: () => fail$7(new InvalidValue$1({ message: "Invalid DateTime input" }, input, options)),
49625
49737
  onSome: (dt) => succeed$5(toUtc(dt))
49626
49738
  });
@@ -49628,7 +49740,7 @@ function dateTimeUtcFromInput() {
49628
49740
  }
49629
49741
  const dateTimeUtcFromString = /*#__PURE__*/ transformEffect({
49630
49742
  decode: (s, options) => {
49631
- return match$8(make$65(s), {
49743
+ return match$8(make$67(s), {
49632
49744
  onNone: () => fail$7(new InvalidValue$1({ expected: "a valid UTC DateTime string" }, s, options)),
49633
49745
  onSome: (result) => succeed$5(toUtc(result))
49634
49746
  });
@@ -49953,7 +50065,7 @@ function Redacted$1(value, options) {
49953
50065
  if (isRedacted(input)) {
49954
50066
  const label = decodeLabel !== void 0 ? mapErrorEager(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_$2;
49955
50067
  return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value)(value$2(input), poptions), {
49956
- onSuccess: (value) => make$62(value, { label: input.label }),
50068
+ onSuccess: (value) => make$64(value, { label: input.label }),
49957
50069
  onFailure: () => {
49958
50070
  return new Composite(ast, [new Pointer(["value"], new InvalidValue$1(void 0, input, poptions))], input, poptions);
49959
50071
  }
@@ -49967,7 +50079,7 @@ function Redacted$1(value, options) {
49967
50079
  },
49968
50080
  expected: "Redacted",
49969
50081
  toCodecJson: ([value]) => link$1()(value, {
49970
- decode: transform$2((e) => make$62(e, { label })),
50082
+ decode: transform$2((e) => make$64(e, { label })),
49971
50083
  encode: disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$2(value$2)
49972
50084
  }),
49973
50085
  toEquivalence: ([value]) => makeEquivalence(value)
@@ -50681,7 +50793,7 @@ const stream$2 = (body, contentType, contentLength) => new Stream$1(body, conten
50681
50793
  /** @internal */
50682
50794
  const CurrentClientPath = /*#__PURE__*/ Reference("effect/http/internal/clientPath/CurrentClientPath", { defaultValue: () => void 0 });
50683
50795
  /** @internal */
50684
- const currentClientPath = () => get$12(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$14(), CurrentClientPath);
50796
+ const currentClientPath = () => get$13(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$14(), CurrentClientPath);
50685
50797
  /**
50686
50798
  * Replaces the path of a URL with its redacted form. A pathname that does not
50687
50799
  * match the expected sent pathname is replaced by `/REDACTED`.
@@ -51120,8 +51232,8 @@ const compressBody$1 = (body, algorithm, options) => {
51120
51232
  * @internal
51121
51233
  */
51122
51234
  const updateHeaders = (headers, body) => {
51123
- if (body._tag === "Empty" || body._tag === "FormData") return remove$1(remove$1(headers, "content-type"), "content-length");
51124
- headers = body.contentType === void 0 ? remove$1(headers, "content-type") : set$1(headers, "content-type", body.contentType);
51235
+ if (body._tag === "Empty" || body._tag === "FormData") return remove$2(remove$2(headers, "content-type"), "content-length");
51236
+ headers = body.contentType === void 0 ? remove$2(headers, "content-type") : set$1(headers, "content-type", body.contentType);
51125
51237
  return updateContentLength(headers, body);
51126
51238
  };
51127
51239
  /**
@@ -51129,7 +51241,7 @@ const updateHeaders = (headers, body) => {
51129
51241
  */
51130
51242
  const updateContentLength = (headers, body) => {
51131
51243
  const contentLength = body._tag === "Empty" || body._tag === "FormData" ? void 0 : body.contentLength;
51132
- return contentLength === void 0 ? remove$1(headers, "content-length") : set$1(headers, "content-length", contentLength.toString());
51244
+ return contentLength === void 0 ? remove$2(headers, "content-length") : set$1(headers, "content-length", contentLength.toString());
51133
51245
  };
51134
51246
  /**
51135
51247
  * @internal
@@ -53488,7 +53600,7 @@ const setHeader = /*#__PURE__*/ dual(3, (self, key, value) => makeResponse(self,
53488
53600
  * @category combinators
53489
53601
  * @since 4.0.0
53490
53602
  */
53491
- const removeHeader = /*#__PURE__*/ dual(2, (self, key) => makeResponse(self, remove$1(self.headers, key)));
53603
+ const removeHeader = /*#__PURE__*/ dual(2, (self, key) => makeResponse(self, remove$2(self.headers, key)));
53492
53604
  /**
53493
53605
  * Returns a response with all supplied headers set on the existing header map.
53494
53606
  *
@@ -53583,12 +53695,12 @@ const omitsBody = (response, withoutBody = false) => withoutBody || response.sta
53583
53695
  * @since 4.0.0
53584
53696
  */
53585
53697
  const fromClientResponse = (response) => {
53586
- const headers = remove$1(response.headers, "set-cookie");
53698
+ const headers = remove$2(response.headers, "set-cookie");
53587
53699
  return makeResponse({
53588
53700
  status: response.status,
53589
53701
  headers,
53590
53702
  cookies: response.cookies,
53591
- body: stream$2(catchIf(response.stream, isEmptyBodyError, () => empty$8), getOrUndefined$2(get$4(headers, "content-type")), parseContentLength(headers["content-length"]))
53703
+ body: stream$2(catchIf(response.stream, isEmptyBodyError, () => empty$8), getOrUndefined$2(get$5(headers, "content-type")), parseContentLength(headers["content-length"]))
53592
53704
  });
53593
53705
  };
53594
53706
  const isEmptyBodyError = (error) => isHttpClientError(error) && error.reason._tag === "EmptyBodyError";
@@ -55733,7 +55845,7 @@ const isMultipartError = (u) => hasProperty(u, MultipartErrorTypeId);
55733
55845
  * @since 4.0.0
55734
55846
  */
55735
55847
  const makeConfig = (headers) => withFiber((fiber) => {
55736
- const mimeTypes = get$12(fiber.context, FieldMimeTypes);
55848
+ const mimeTypes = get$13(fiber.context, FieldMimeTypes);
55737
55849
  return succeed$5({
55738
55850
  headers,
55739
55851
  maxParts: fiber.getRef(MaxParts),
@@ -57126,7 +57238,7 @@ var MiddlewareImpl = class MiddlewareImpl {
57126
57238
  const stack = [getOrUndefinedUnsafe(context$4, fnContextKey)];
57127
57239
  if (this.dependencies) {
57128
57240
  const memoMap = yield* CurrentMemoMap;
57129
- const scope = get$12(context$4, Scope);
57241
+ const scope = get$13(context$4, Scope);
57130
57242
  const depsContext = yield* buildWithMemoMap(this.dependencies, memoMap, scope);
57131
57243
  stack.push(...getMiddleware$1(depsContext));
57132
57244
  }
@@ -57152,7 +57264,7 @@ const getMiddleware$1 = (context) => {
57152
57264
  else {
57153
57265
  const middleware = /* @__PURE__ */ new Set();
57154
57266
  for (let i = maxLength - 1; i >= 0; i--) for (const arr of topLevel) if (i < arr.length) middleware.add(arr[i]);
57155
- arr = fromIterable$5(middleware).reverse();
57267
+ arr = fromIterable$6(middleware).reverse();
57156
57268
  }
57157
57269
  middlewareCache.set(context, arr);
57158
57270
  return arr;
@@ -57181,9 +57293,9 @@ const serve = (appLayer, options) => {
57181
57293
  const layerWithRouter = provideMerge(appLayer, options?.routerConfig ? provide$2(layer$21, succeed$6(RouterConfig)(options.routerConfig)) : layer$21);
57182
57294
  return contextWith((context) => {
57183
57295
  const memoMap = CurrentMemoMap.forkOrCreate(context);
57184
- return buildWithMemoMap(layerWithRouter, memoMap, get$12(context, Scope));
57296
+ return buildWithMemoMap(layerWithRouter, memoMap, get$13(context, Scope));
57185
57297
  }).pipe(map$7((context) => {
57186
- const handler = get$12(context, HttpRouter).asHttpEffect();
57298
+ const handler = get$13(context, HttpRouter).asHttpEffect();
57187
57299
  return provideMerge(middleware ? serve$1(handler, middleware) : serve$1(handler), succeedContext(context));
57188
57300
  }), unwrap$7, options?.disableListenLog ? identity : withLogAddress);
57189
57301
  };
@@ -61518,7 +61630,7 @@ function decodeValueUnchecked(layout, r) {
61518
61630
  const value = r.zigzag();
61519
61631
  const scale = r.zigzag();
61520
61632
  if (scale > MAX_SAFE_BIGINT || -scale > MAX_SAFE_BIGINT) invalid("safe integer length", void 0, r.options);
61521
- return make$64(value, Number(scale));
61633
+ return make$66(value, Number(scale));
61522
61634
  }
61523
61635
  case "json": {
61524
61636
  const text = r.readUtf8(r.end - r.pos);
@@ -62085,7 +62197,7 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
62085
62197
  const disableTracing = options?.disableTracing ?? false;
62086
62198
  const generateRequestId = options?.generateRequestId ?? (() => requestIdCounter++);
62087
62199
  const services = yield* context();
62088
- const scope = get$12(services, Scope);
62200
+ const scope = get$13(services, Scope);
62089
62201
  const entries = /* @__PURE__ */ new Map();
62090
62202
  let isShutdown = false;
62091
62203
  yield* addFinalizer$1(scope, withFiber((parent) => {
@@ -62101,7 +62213,7 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
62101
62213
  const traceFields = (fiber, clientSpan) => {
62102
62214
  if (disableTracing || !fiber.cache.tracerEnabled || fiber.getRef(DisablePropagation)) return void 0;
62103
62215
  const span = clientSpan ?? fiber.cache.span;
62104
- if (!span || get$12(span.annotations, DisablePropagation)) return void 0;
62216
+ if (!span || get$13(span.annotations, DisablePropagation)) return void 0;
62105
62217
  return {
62106
62218
  traceId: span.traceId,
62107
62219
  spanId: span.spanId,
@@ -62111,7 +62223,7 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
62111
62223
  const onRequest = (rpc) => {
62112
62224
  const isStream = isStreamSchema(rpc.successSchema);
62113
62225
  const middleware = getRpcClientMiddleware(rpc);
62114
- const tracing = get$12(rpc.annotations, TracingEnabled);
62226
+ const tracing = get$13(rpc.annotations, TracingEnabled);
62115
62227
  const createSpan = !disableTracing && (tracing === "both" || tracing === "client");
62116
62228
  return (payload, opts) => {
62117
62229
  const headers = opts?.headers ? fromInput$1(opts.headers) : empty$6;
@@ -62441,7 +62553,7 @@ const makeRpcSchemas = (codecFor) => {
62441
62553
  let entry = cache.get(rpc);
62442
62554
  if (entry !== void 0) return entry;
62443
62555
  const streamSchemas = getStreamSchemas(rpc.successSchema);
62444
- const parseOptions = get$12(rpc.annotations, ParseOptions);
62556
+ const parseOptions = get$13(rpc.annotations, ParseOptions);
62445
62557
  const exitSchema$2 = exitSchema(rpc);
62446
62558
  let decodeDiscardExit;
62447
62559
  entry = {
@@ -63153,9 +63265,9 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
63153
63265
  const concurrency = options.concurrency ?? "unbounded";
63154
63266
  const disableFatalDefects = options.disableFatalDefects ?? false;
63155
63267
  const services = yield* context();
63156
- const scope = get$12(services, Scope);
63268
+ const scope = get$13(services, Scope);
63157
63269
  const trackFiber = runIn(forkUnsafe(scope, "parallel"));
63158
- const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$72(concurrency);
63270
+ const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$74(concurrency);
63159
63271
  const clients = /* @__PURE__ */ new Map();
63160
63272
  let isShutdown = false;
63161
63273
  const shutdownLatch = makeUnsafe$5(false);
@@ -63300,7 +63412,7 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
63300
63412
  return close ? ensuring$2(write, close) : write;
63301
63413
  });
63302
63414
  if (opts?.onRequest) effect = opts.onRequest(effect, request);
63303
- const tracing = get$12(rpc.annotations, TracingEnabled);
63415
+ const tracing = get$13(rpc.annotations, TracingEnabled);
63304
63416
  if (enableTracing && (tracing === "both" || tracing === "server")) {
63305
63417
  const parentSpan = getOrUndefined$1(requestFiber.context, ParentSpan);
63306
63418
  effect = withSpan(effect, spanName$1(spanPrefix, request.tag), {
@@ -63396,7 +63508,7 @@ const rpcCodecs = (codecFor, rpc) => {
63396
63508
  let codecs = shared ? sharedRpcCodecs.get(rpc) : void 0;
63397
63509
  if (codecs === void 0) {
63398
63510
  const streamSchemas = getStreamSchemas(rpc.successSchema);
63399
- const parseOptions = get$12(rpc.annotations, ParseOptions);
63511
+ const parseOptions = get$13(rpc.annotations, ParseOptions);
63400
63512
  codecs = {
63401
63513
  decode: decodeUnknownEffect(codecFor(rpc.payloadSchema), parseOptions),
63402
63514
  encodeChunk: encodeUnknownEffect(codecFor(NonEmptyArray(isSome(streamSchemas) ? streamSchemas.value.success : Any)), parseOptions),
@@ -63472,7 +63584,7 @@ const make$33 = /*#__PURE__*/ fnUntraced(function* (group, options) {
63472
63584
  const { codecFor, disconnects, end, run, send, supportsAck, supportsSpanPropagation, supportsTransferables } = yield* Protocol;
63473
63585
  const { encodeDefectUnsafe, encodeUnknownRequestExit } = defectCodecs(codecFor);
63474
63586
  const services = yield* context();
63475
- const scope = yield* make$82();
63587
+ const scope = yield* make$84();
63476
63588
  const writeOptions = options?.onRequest ? { onRequest: options.onRequest } : void 0;
63477
63589
  const server = yield* makeNoSerialization(group, {
63478
63590
  ...options,
@@ -63534,7 +63646,7 @@ const make$33 = /*#__PURE__*/ fnUntraced(function* (group, options) {
63534
63646
  const exitSchema$1 = exitSchema(rpc);
63535
63647
  discardSchemas = {
63536
63648
  ...schemas,
63537
- encodeExit: encodeUnknownEffect(codecFor(Exit(Void, exitSchema$1.error, exitSchema$1.defect)), get$12(rpc.annotations, ParseOptions))
63649
+ encodeExit: encodeUnknownEffect(codecFor(Exit(Void, exitSchema$1.error, exitSchema$1.defect)), get$13(rpc.annotations, ParseOptions))
63538
63650
  };
63539
63651
  discardSchemasCache.set(rpc, discardSchemas);
63540
63652
  }
@@ -63713,7 +63825,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
63713
63825
  const { encodeDefectUnsafe } = defectCodecs(serialization.codecFor);
63714
63826
  const includesFraming = serialization.includesFraming;
63715
63827
  const isBinary = !serialization.contentType.includes("json");
63716
- const disconnects = yield* make$73();
63828
+ const disconnects = yield* make$75();
63717
63829
  let writeRequest;
63718
63830
  let clientId = 0;
63719
63831
  const clients = /* @__PURE__ */ new Map();
@@ -63726,7 +63838,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
63726
63838
  const requestHeaders = Object.entries(request.headers);
63727
63839
  const data = yield* orDie$2(isBinary ? map$7(request.arrayBuffer, (buf) => new Uint8Array(buf)) : request.text);
63728
63840
  const id = clientId++;
63729
- const queue = yield* make$73({ capacity: includesFraming && options.streamBufferSize !== "unbounded" ? options.streamBufferSize ?? 16 : void 0 });
63841
+ const queue = yield* make$75({ capacity: includesFraming && options.streamBufferSize !== "unbounded" ? options.streamBufferSize ?? 16 : void 0 });
63730
63842
  const parser = serialization.makeUnsafe();
63731
63843
  const requestIds = [];
63732
63844
  const offer$1 = (data) => typeof data === "string" ? offer(queue, encoder.encode(data)) : offer(queue, data);
@@ -63819,7 +63931,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
63819
63931
  const makeSocketProtocol = /*#__PURE__*/ gen(function* () {
63820
63932
  const serialization = yield* RpcSerialization;
63821
63933
  const { encodeDefectUnsafe } = defectCodecs(serialization.codecFor);
63822
- const disconnects = yield* make$73();
63934
+ const disconnects = yield* make$75();
63823
63935
  let clientId = 0;
63824
63936
  const clients = /* @__PURE__ */ new Map();
63825
63937
  const clientIds = /* @__PURE__ */ new Set();
@@ -63999,7 +64111,7 @@ const RpcGroupProto = {
63999
64111
  });
64000
64112
  },
64001
64113
  annotateRpcs(service, value) {
64002
- return this.annotateRpcsMerge(make$86(service, value));
64114
+ return this.annotateRpcsMerge(make$88(service, value));
64003
64115
  },
64004
64116
  annotateMerge(context) {
64005
64117
  return makeProto$1({
@@ -65274,8 +65386,8 @@ const make$29 = /*#__PURE__*/ sync(() => {
65274
65386
  };
65275
65387
  const query = (keys, effect) => gen(function* () {
65276
65388
  const services = yield* context();
65277
- const scope = get$12(services, Scope);
65278
- const results = yield* make$73();
65389
+ const scope = get$13(services, Scope);
65390
+ const results = yield* make$75();
65279
65391
  const runFork = flow(runForkWith(services), runIn(scope));
65280
65392
  let running = false;
65281
65393
  let pending = false;
@@ -66807,7 +66919,7 @@ const makeWithTransaction = (options) => {
66807
66919
  return effect;
66808
66920
  });
66809
66921
  const connOption = getOption(services, options.transactionService);
66810
- const conn = connOption._tag === "Some" ? map$7(suspend$3(() => activeTransactionConnection(connOption.value)), (conn) => [void 0, conn]) : flatMap$3(make$82(), (scope) => provide$3(options.acquireConnection(restore), scope).pipe(provideService$2(ParentSpan, span), map$7((conn) => {
66922
+ const conn = connOption._tag === "Some" ? map$7(suspend$3(() => activeTransactionConnection(connOption.value)), (conn) => [void 0, conn]) : flatMap$3(make$84(), (scope) => provide$3(options.acquireConnection(restore), scope).pipe(provideService$2(ParentSpan, span), map$7((conn) => {
66811
66923
  if (waitedClock !== void 0) recordConnectionWait(span, waitedClock);
66812
66924
  return [scope, conn];
66813
66925
  }), onError((cause) => close(scope, failCause$5(cause)))));
@@ -67067,7 +67179,7 @@ const migrationsTableExists = (sql, table) => {
67067
67179
  const quotedTable = sql`${sql(table)}`.compile(true)[0];
67068
67180
  return map$7(sql`SELECT 1 AS found WHERE to_regclass(${quotedTable}) IS NOT NULL`.withoutTransform, (rows) => rows.length > 0);
67069
67181
  };
67070
- const migrationOrder = /*#__PURE__*/ make$87(([a], [b]) => Number$6(a, b));
67182
+ const migrationOrder = /*#__PURE__*/ make$89(([a], [b]) => Number$6(a, b));
67071
67183
  const isConstraintConflict = (error) => error.reason._tag === "ConstraintError" || error.reason._tag === "UniqueViolation";
67072
67184
  /**
67073
67185
  * Creates a migration loader from a record of migration effects keyed by
@@ -71661,7 +71773,7 @@ const writeFile = (path, data, options) => callback$1((resume, signal) => {
71661
71773
  resume(fail$7(handleBadArgument("writeFile")(err)));
71662
71774
  }
71663
71775
  });
71664
- const makeFileSystem = /*#__PURE__*/ map$7(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$67({
71776
+ const makeFileSystem = /*#__PURE__*/ map$7(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$69({
71665
71777
  access,
71666
71778
  chmod,
71667
71779
  chown,
@@ -71958,7 +72070,7 @@ const layer$15 = /*#__PURE__*/ layerMergedContext(/*#__PURE__*/ succeed$5(/* @__
71958
72070
  const fetch = getOrUndefined$1(fiber.context, Fetch);
71959
72071
  const options = getOrUndefined$1(fiber.context, RequestInit) ?? {};
71960
72072
  let headers = options.headers ? merge$1(fromInput$1(options.headers), request.headers) : request.headers;
71961
- if (headers["content-length"]) headers = remove$1(headers, "content-length");
72073
+ if (headers["content-length"]) headers = remove$2(headers, "content-length");
71962
72074
  let uploadController;
71963
72075
  const stopUpload = sync(() => uploadController?.abort());
71964
72076
  const send = (body) => map$7(tryPromise({
@@ -72942,7 +73054,7 @@ const fileUrlOps = (windows) => ({
72942
73054
  * @category layers
72943
73055
  * @since 4.0.0
72944
73056
  */
72945
- const layer$12 = /* @__PURE__ */ succeed$6(Path$1)(/*#__PURE__*/ make$66({
73057
+ const layer$12 = /* @__PURE__ */ succeed$6(Path$1)(/*#__PURE__*/ make$68({
72946
73058
  ...Path,
72947
73059
  .../*#__PURE__*/ fileUrlOps(void 0)
72948
73060
  }));
@@ -73111,7 +73223,7 @@ const make$22 = (impl) => Terminal.of({
73111
73223
  * @since 4.0.0
73112
73224
  */
73113
73225
  const layer$9 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
73114
- const lines = yield* make$73();
73226
+ const lines = yield* make$75();
73115
73227
  let inputEnded = false;
73116
73228
  let readlineActive = false;
73117
73229
  const onStdinEnd = () => {
@@ -73128,7 +73240,7 @@ const layer$9 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
73128
73240
  return stdin;
73129
73241
  };
73130
73242
  yield* addFinalizer(() => sync(() => stdin?.off("end", onStdinEnd)));
73131
- const rlRef = yield* make$69({
73243
+ const rlRef = yield* make$71({
73132
73244
  acquire: acquireRelease(sync(() => {
73133
73245
  const stdin = getStdin();
73134
73246
  const rl = readline.createInterface({
@@ -73162,7 +73274,7 @@ const layer$9 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
73162
73274
  const stdin = getStdin();
73163
73275
  if (stdin.isTTY) stdin.setRawMode(enabled);
73164
73276
  });
73165
- const rawModeRef = yield* make$69({
73277
+ const rawModeRef = yield* make$71({
73166
73278
  acquire: acquireRelease(setRawMode(true), () => setRawMode(false)),
73167
73279
  idleTimeToLive: "10 millis"
73168
73280
  });
@@ -73185,7 +73297,7 @@ const layer$9 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
73185
73297
  });
73186
73298
  const readInput = gen(function* () {
73187
73299
  const stdin = getStdin();
73188
- const queue = yield* make$73();
73300
+ const queue = yield* make$75();
73189
73301
  const handleKeypress = (s, k) => {
73190
73302
  const userInput = {
73191
73303
  input: fromUndefinedOr(s),
@@ -73212,14 +73324,14 @@ const layer$9 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
73212
73324
  stdin.on("keypress", handleKeypress);
73213
73325
  if (inputEnded) handleEnd();
73214
73326
  else {
73215
- yield* get$6(rlRef);
73216
- yield* get$6(rawModeRef);
73327
+ yield* get$7(rlRef);
73328
+ yield* get$7(rawModeRef);
73217
73329
  stdin.once("end", handleEnd);
73218
73330
  }
73219
73331
  return queue;
73220
73332
  });
73221
73333
  const readLine = suspend$3(() => poll(lines).pipe(flatMap$3(match$8({
73222
- onNone: () => scoped(andThen(get$6(rlRef), take(lines))),
73334
+ onNone: () => scoped(andThen(get$7(rlRef), take(lines))),
73223
73335
  onSome: succeed$5
73224
73336
  })), mapError$2(() => new QuitError({}))));
73225
73337
  const display = (prompt) => uninterruptible(callback$1((resume) => {
@@ -74078,7 +74190,7 @@ const TypeId$12 = "~effect/Cache";
74078
74190
  const makeWith = (lookup, options) => contextWith$1((context) => {
74079
74191
  const self = Object.create(Proto$5);
74080
74192
  self.lookup = (key) => updateContext$2(lookup(key), (input) => merge$5(context, input));
74081
- self.map = make$80();
74193
+ self.map = make$82();
74082
74194
  self.capacity = options.capacity;
74083
74195
  self.timeToLive = options.timeToLive ? (exit, key) => fromInputUnsafe$1(options.timeToLive(exit, key)) : defaultTimeToLive;
74084
74196
  return succeed$9(self);
@@ -74192,9 +74304,9 @@ const defaultTimeToLive = (_, _key) => infinity$1;
74192
74304
  * @since 4.0.0
74193
74305
  */
74194
74306
  const get = /*#__PURE__*/ dual(2, (self, key) => withFiber$1((fiber) => {
74195
- const oentry = get$9(self.map, key);
74307
+ const oentry = get$10(self.map, key);
74196
74308
  if (isSome(oentry)) {
74197
- remove$3(self.map, key);
74309
+ remove$4(self.map, key);
74198
74310
  if (!hasExpired(oentry.value, fiber)) {
74199
74311
  set$3(self.map, key, oentry.value);
74200
74312
  return oentry.value.await(fiber);
@@ -74246,8 +74358,8 @@ var EntryImpl = class {
74246
74358
  }
74247
74359
  };
74248
74360
  const removeEntry = (self, key, entry) => {
74249
- const current = get$9(self.map, key);
74250
- if (isSome(current) && current.value === entry) remove$3(self.map, key);
74361
+ const current = get$10(self.map, key);
74362
+ if (isSome(current) && current.value === entry) remove$4(self.map, key);
74251
74363
  };
74252
74364
  const hasExpired = (entry, fiber) => {
74253
74365
  if (entry.expiresAt === void 0) return false;
@@ -74257,7 +74369,7 @@ const checkCapacity = (self) => {
74257
74369
  let diff = size$2(self.map) - self.capacity;
74258
74370
  if (diff <= 0) return;
74259
74371
  for (const [key] of self.map) {
74260
- remove$3(self.map, key);
74372
+ remove$4(self.map, key);
74261
74373
  diff--;
74262
74374
  if (diff === 0) return;
74263
74375
  }
@@ -74979,7 +75091,7 @@ function addScale(scale, offset, maximum = Number.MAX_SAFE_INTEGER) {
74979
75091
  }
74980
75092
  function boundaryCandidate(value, exclusive, direction) {
74981
75093
  if (value === void 0 || exclusive !== true) return value;
74982
- return value.scale < Number.MAX_SAFE_INTEGER ? make$64(value.value * bigint10 + BigInt(direction), value.scale + 1) : make$64(value.value + BigInt(direction), value.scale);
75094
+ return value.scale < Number.MAX_SAFE_INTEGER ? make$66(value.value * bigint10 + BigInt(direction), value.scale + 1) : make$66(value.value + BigInt(direction), value.scale);
74983
75095
  }
74984
75096
  function digits(value) {
74985
75097
  return (value < bigint0$1 ? -value : value).toString().length;
@@ -75038,7 +75150,7 @@ function midpoint(passing, failing, maximumScale) {
75038
75150
  const right = projectExact(failing, scale);
75039
75151
  if (left === void 0 || right === void 0) return void 0;
75040
75152
  const value = left + (right - left) / BigInt(2);
75041
- return value === left || value === right ? void 0 : make$64(value, scale);
75153
+ return value === left || value === right ? void 0 : make$66(value, scale);
75042
75154
  }
75043
75155
  function sample$2(value, target, context, maximumScale = addScale(Math.max(value.scale, target.scale), 128)) {
75044
75156
  return makeSampleWithLazyShrinks(value, () => {
@@ -75050,9 +75162,9 @@ function sample$2(value, target, context, maximumScale = addScale(Math.max(value
75050
75162
  const normalized = normalize(context[0]);
75051
75163
  const scale = addScale(normalized.scale, Math.min(context[1] + 1, 128), maximumScale);
75052
75164
  const projected = projectExact(normalized, scale);
75053
- if (projected !== void 0) next = make$64(projected + BigInt(direction), scale);
75165
+ if (projected !== void 0) next = make$66(projected + BigInt(direction), scale);
75054
75166
  }
75055
- const candidates = (context === void 0 ? shrinkExponents.map((exponent) => make$64(BigInt(direction), -exponent)) : [next]).filter((candidate) => candidate !== void 0 && candidate.scale <= maximumScale && compare(candidate, from) === direction && compare(candidate, value) === -direction);
75167
+ const candidates = (context === void 0 ? shrinkExponents.map((exponent) => make$66(BigInt(direction), -exponent)) : [next]).filter((candidate) => candidate !== void 0 && candidate.scale <= maximumScale && compare(candidate, from) === direction && compare(candidate, value) === -direction);
75056
75168
  if (context === void 0) candidates.unshift(target);
75057
75169
  let previous = context;
75058
75170
  let index = 0;
@@ -75072,7 +75184,7 @@ function make$19(bounds) {
75072
75184
  const value = bounds.minimum;
75073
75185
  return makeCompiled([], () => 0, () => makeSample(value));
75074
75186
  }
75075
- const zero = make$64(bigint0$1, 0);
75187
+ const zero = make$66(bigint0$1, 0);
75076
75188
  const lower = boundaryCandidate(bounds.minimum, bounds.exclusiveMinimum, 1);
75077
75189
  const upper = boundaryCandidate(bounds.maximum, bounds.exclusiveMaximum, -1);
75078
75190
  const witness = [
@@ -75084,12 +75196,12 @@ function make$19(bounds) {
75084
75196
  const target = witness.value < bigint0$1 && upper !== void 0 && isAllowed(upper, bounds) ? upper : witness;
75085
75197
  const special = [
75086
75198
  witness,
75087
- make$64(bigint1$1, 1),
75088
- make$64(bigint1$1, 0),
75089
- make$64(bigint10, 0),
75090
- make$64(-bigint1$1, 1),
75091
- make$64(-bigint1$1, 0),
75092
- make$64(-bigint10, 0),
75199
+ make$66(bigint1$1, 1),
75200
+ make$66(bigint1$1, 0),
75201
+ make$66(bigint10, 0),
75202
+ make$66(-bigint1$1, 1),
75203
+ make$66(-bigint1$1, 0),
75204
+ make$66(-bigint10, 0),
75093
75205
  ...bounds.minimum !== void 0 && bounds.exclusiveMinimum !== true ? [bounds.minimum] : [],
75094
75206
  ...bounds.maximum !== void 0 && bounds.exclusiveMaximum !== true ? [bounds.maximum] : []
75095
75207
  ].filter((value) => isAllowed(value, bounds));
@@ -75099,7 +75211,7 @@ function make$19(bounds) {
75099
75211
  return makeCompiled([], () => 0, (state) => {
75100
75212
  let value;
75101
75213
  if (randomInt(state, 0, 7) === 0) value = special[randomIndex(state, special.length)];
75102
- else if (generatePreferred !== void 0 && randomInt(state, 0, 3) !== 0) value = make$64(generatePreferred(state), boundaryScale);
75214
+ else if (generatePreferred !== void 0 && randomInt(state, 0, 3) !== 0) value = make$66(generatePreferred(state), boundaryScale);
75103
75215
  else {
75104
75216
  value = witness;
75105
75217
  for (let attempt = 0; attempt < 16; attempt++) {
@@ -75109,8 +75221,8 @@ function make$19(bounds) {
75109
75221
  const coefficient = randomCoefficient(state, range);
75110
75222
  if (randomInt(state, 0, 7) === 0 && scale < Number.MAX_SAFE_INTEGER) {
75111
75223
  const trailing = randomInt(state, 1, Math.min(8, Number.MAX_SAFE_INTEGER - scale));
75112
- value = make$64(coefficient * bigint10 ** BigInt(trailing), scale + trailing);
75113
- } else value = make$64(coefficient, scale);
75224
+ value = make$66(coefficient * bigint10 ** BigInt(trailing), scale + trailing);
75225
+ } else value = make$66(coefficient, scale);
75114
75226
  break;
75115
75227
  }
75116
75228
  }
@@ -80114,7 +80226,7 @@ const Strict = /*#__PURE__*/ Reference("effect/ai/Tool/Strict", { defaultValue:
80114
80226
  * @category getters
80115
80227
  * @since 4.0.0
80116
80228
  */
80117
- const getStrictMode = (tool) => get$12(tool.annotations, Strict);
80229
+ const getStrictMode = (tool) => get$13(tool.annotations, Strict);
80118
80230
  /**
80119
80231
  * Schema for denied or interrupted tool calls.
80120
80232
  *
@@ -80335,7 +80447,7 @@ const stringifyToolArguments = (params) => {
80335
80447
  return String(params);
80336
80448
  }
80337
80449
  };
80338
- const failureCause = (error, origin) => annotate$2(fail$8(error), make$86(FailureOrigin, origin));
80450
+ const failureCause = (error, origin) => annotate$2(fail$8(error), make$88(FailureOrigin, origin));
80339
80451
  const failureOrigin = (error) => isSchemaError(error) ? "result" : "handler";
80340
80452
  const Proto$3 = {
80341
80453
  .../*#__PURE__*/ Prototype({
@@ -80410,7 +80522,7 @@ const Proto$3 = {
80410
80522
  const decodedParams = decodedParamsResult.success;
80411
80523
  const capacity = yield* PreliminaryBuffer;
80412
80524
  if (capacity !== "unbounded" && !(Number.isInteger(capacity) && capacity > 0)) return yield* die$2(`Tool "${name}": PreliminaryBuffer must be a positive integer, got ${capacity}`);
80413
- const queue = yield* make$73(capacity === "unbounded" ? void 0 : { capacity });
80525
+ const queue = yield* make$75(capacity === "unbounded" ? void 0 : { capacity });
80414
80526
  const context = {
80415
80527
  toolCallId,
80416
80528
  preliminary: (result) => asVoid(offer(queue, {
@@ -80442,7 +80554,7 @@ const Proto$3 = {
80442
80554
  reason: error
80443
80555
  }) : error;
80444
80556
  };
80445
- return fromQueue(queue).pipe(tool.failureMode === "error" ? catchCause((cause) => failCause(map$8(fromReasons(cause.reasons.map((reason) => isFailReason(reason) ? reason.annotate(make$86(FailureOrigin, failureOrigin(reason.error)), { overwrite: true }) : reason)), normalizeError))) : catch_((error) => succeed$3({
80557
+ return fromQueue(queue).pipe(tool.failureMode === "error" ? catchCause((cause) => failCause(map$8(fromReasons(cause.reasons.map((reason) => isFailReason(reason) ? reason.annotate(make$88(FailureOrigin, failureOrigin(reason.error)), { overwrite: true }) : reason)), normalizeError))) : catch_((error) => succeed$3({
80446
80558
  result: normalizeError(error),
80447
80559
  isFailure: true,
80448
80560
  failureOrigin: failureOrigin(error),
@@ -86571,7 +86683,7 @@ const makeHandlers = (core, _lifecycle, context) => {
86571
86683
  const subscriptionMetadata = { "io.modelcontextprotocol/subscriptionId": requestId };
86572
86684
  const resourceSubscriptions = new Set(honored.resourceSubscriptions);
86573
86685
  const pending = yield* dropping(MAX_PENDING_SUBSCRIPTION_NOTIFICATIONS);
86574
- const overflowed = yield* make$83();
86686
+ const overflowed = yield* make$85();
86575
86687
  yield* gen(function* () {
86576
86688
  while (true) {
86577
86689
  const event = yield* take$1(events);
@@ -86971,7 +87083,7 @@ const getMiddleware = (context) => {
86971
87083
  };
86972
87084
  const isMcpError = (error) => hasProperty(error, "code") && typeof error.code === "number" && hasProperty(error, "message") && typeof error.message === "string";
86973
87085
  const HandlerFailure = /*#__PURE__*/ Reference("effect/ai/McpServer/HandlerFailure", { defaultValue: () => false });
86974
- const handlerFailure = /*#__PURE__*/ make$86(HandlerFailure, true);
87086
+ const handlerFailure = /*#__PURE__*/ make$88(HandlerFailure, true);
86975
87087
  const internalError = /*#__PURE__*/ new InternalError({ message: "Internal error" });
86976
87088
  const rejectWith = (error) => fail$7(new RequestRejected({
86977
87089
  code: error.code,
@@ -87017,7 +87129,7 @@ const runMiddleware = (handler, middleware, invocation, request) => {
87017
87129
  if (isSuccess$1(failure) && !hasDies(cause)) {
87018
87130
  const error = failure.success.error;
87019
87131
  if (isHidden(error)) return fail$7(error);
87020
- if (middleware.length === 0 || get$12(reasonAnnotations(failure.success), HandlerFailure)) return failCause$3(cause);
87132
+ if (middleware.length === 0 || get$13(reasonAnnotations(failure.success), HandlerFailure)) return failCause$3(cause);
87021
87133
  if (isMcpError(error)) return rejectWith(error);
87022
87134
  }
87023
87135
  return logError(cause).pipe(andThen(report(cause)), andThen(rejectWith(internalError)));
@@ -87080,7 +87192,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
87080
87192
  const resources = [];
87081
87193
  const resourceTemplates = [];
87082
87194
  const prompts = [];
87083
- const notificationsQueue = yield* make$73();
87195
+ const notificationsQueue = yield* make$75();
87084
87196
  const globalMiddleware = [];
87085
87197
  const notificationDelivery = {
87086
87198
  consumers: 0,
@@ -87092,7 +87204,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
87092
87204
  const dispatcher = (yield* Scheduler).makeDispatcher();
87093
87205
  const notifications = yield* makeNoSerialization$1(BroadcastServerNotificationRpcs, {
87094
87206
  spanPrefix: "McpServer/Notifications",
87095
- onFromClient: (options) => make$83().pipe(flatMap$3((delivered) => withFiber((fiber) => {
87207
+ onFromClient: (options) => make$85().pipe(flatMap$3((delivered) => withFiber((fiber) => {
87096
87208
  const message = options.message;
87097
87209
  if (message._tag !== "Request") return void_$2;
87098
87210
  const notification = toInternalServerNotification(message);
@@ -87100,7 +87212,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
87100
87212
  const queued = {
87101
87213
  notification,
87102
87214
  delivered,
87103
- requestLiveness: get$12(fiber.context, RequestLiveness),
87215
+ requestLiveness: get$13(fiber.context, RequestLiveness),
87104
87216
  requestContext: getOrUndefined$1(fiber.context, McpRequestContext),
87105
87217
  requestHeaders: getOrUndefined$1(fiber.context, HttpServerRequest)?.headers
87106
87218
  };
@@ -87110,7 +87222,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
87110
87222
  _tag: "Exit",
87111
87223
  exit: void_$3
87112
87224
  }));
87113
- const requestQueue = get$12(fiber.context, RequestNotificationQueue);
87225
+ const requestQueue = get$13(fiber.context, RequestNotificationQueue);
87114
87226
  if (requestQueue !== void 0 && queued.requestContext !== void 0 && isRequestNotification(notification)) {
87115
87227
  offerUnsafe(requestQueue, queued);
87116
87228
  return andThen(_await(delivered), acknowledge);
@@ -87157,7 +87269,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
87157
87269
  });
87158
87270
  const service = McpServer.of({
87159
87271
  notifications: notifications.client,
87160
- notifyElicitationComplete: ({ clientId, elicitationId }) => withoutSharedConsumer() ? void_$2 : make$83().pipe(flatMap$3((delivered) => offer(notificationsQueue, {
87272
+ notifyElicitationComplete: ({ clientId, elicitationId }) => withoutSharedConsumer() ? void_$2 : make$85().pipe(flatMap$3((delivered) => offer(notificationsQueue, {
87161
87273
  notification: ServerNotification.ElicitationComplete({ elicitationId }),
87162
87274
  targetClientId: clientId,
87163
87275
  delivered
@@ -87560,7 +87672,7 @@ const runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, tra
87560
87672
  defaultLogLevel,
87561
87673
  serverInfo: options
87562
87674
  }));
87563
- const clients = yield* make$71({
87675
+ const clients = yield* make$73({
87564
87676
  lookup: fnUntraced(function* (key) {
87565
87677
  const selectedProtocol = runtime.selectProtocol(key.profile.protocolVersion);
87566
87678
  let write;
@@ -87636,7 +87748,7 @@ const runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, tra
87636
87748
  clientInfo: profile.clientInfo,
87637
87749
  initializePayload,
87638
87750
  requestMetadata: isReadonlyObject(payload) && isReadonlyObject(payload._meta) ? payload._meta : void 0,
87639
- getClient: get$8(clients, new McpClientKey({
87751
+ getClient: get$9(clients, new McpClientKey({
87640
87752
  clientId: client.id,
87641
87753
  profile
87642
87754
  })).pipe(map$7(({ client }) => client))
@@ -87673,7 +87785,7 @@ const runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, tra
87673
87785
  const request = request_;
87674
87786
  const httpRequest = isHttp ? getOrUndefined$1(fiber.context, HttpServerRequest) : void 0;
87675
87787
  if (httpRequest !== void 0 && request._tag !== "Eof") appendPreResponseHandlerUnsafe(fiber.context, (_, response) => succeed$5(response.status === 200 && response.body._tag === "Uint8Array" && response.body.contentLength === 0 ? empty$1({
87676
- headers: remove$1(response.headers, "content-type"),
87788
+ headers: remove$2(response.headers, "content-type"),
87677
87789
  status: 202
87678
87790
  }) : response));
87679
87791
  switch (request._tag) {
@@ -87789,7 +87901,7 @@ const runWithRuntime = /*#__PURE__*/ fnUntraced(function* (options, runtime, tra
87789
87901
  version: "unknown"
87790
87902
  }
87791
87903
  };
87792
- return get$8(clients, new McpClientKey({
87904
+ return get$9(clients, new McpClientKey({
87793
87905
  clientId: targetClientId,
87794
87906
  profile
87795
87907
  })).pipe(flatMap$3(({ write }) => write(request)), scoped);
@@ -88075,7 +88187,7 @@ const toServerSentEvents = (response, keepAlive) => {
88075
88187
  const options = {
88076
88188
  status: response.status,
88077
88189
  statusText: response.statusText,
88078
- headers: remove$1(response.headers, "content-type"),
88190
+ headers: remove$2(response.headers, "content-type"),
88079
88191
  cookies: response.cookies,
88080
88192
  contentType: "text/event-stream"
88081
88193
  };
@@ -88237,7 +88349,7 @@ const registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit, options) {
88237
88349
  const failure = findFail(cause);
88238
88350
  if (isSuccess$1(failure)) {
88239
88351
  const error = failure.success.error;
88240
- const origin = get$12(reasonAnnotations(failure.success), FailureOrigin);
88352
+ const origin = get$13(reasonAnnotations(failure.success), FailureOrigin);
88241
88353
  if (origin === "parameters" && isParameterValidationError(error)) return fail$7(new InvalidParams({ message: error.reason.message }));
88242
88354
  if (origin === "handler" && isInvalidParams(error)) return fail$7(error);
88243
88355
  if (origin === "handler" && isDeclaredFailure(error)) return catchCause$2(declaredFailureResult(error), internalToolError);
@@ -88248,7 +88360,7 @@ const registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit, options) {
88248
88360
  const mapper = content && Object.hasOwn(content, tool.name) ? content[tool.name] : void 0;
88249
88361
  const inputSchema = rawJsonSchema === void 0 ? toolJsonSchema(tool.parametersSchema, strict) : yield* catch_$2(decodeUnknownEffect(ToolJson)(rawJsonSchema), (cause) => die$2(`McpServer cannot register tool '${tool.name}': its raw JSON Schema must have an object root (type: "object").\n\n${cause.message}`));
88250
88362
  const title = getOrUndefined$1(tool.annotations, Title);
88251
- const readOnlyHint = get$12(tool.annotations, Readonly);
88363
+ const readOnlyHint = get$13(tool.annotations, Readonly);
88252
88364
  const fields = {
88253
88365
  name: tool.name,
88254
88366
  title,
@@ -88259,8 +88371,8 @@ const registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit, options) {
88259
88371
  ...title !== void 0 ? { title } : void 0,
88260
88372
  readOnlyHint,
88261
88373
  destructiveHint: getOrUndefined$1(tool.annotations, Destructive) ?? !readOnlyHint,
88262
- idempotentHint: get$12(tool.annotations, Idempotent),
88263
- openWorldHint: get$12(tool.annotations, OpenWorld)
88374
+ idempotentHint: get$13(tool.annotations, Idempotent),
88375
+ openWorldHint: get$13(tool.annotations, OpenWorld)
88264
88376
  },
88265
88377
  _meta: isReadonlyObject(toolMeta) ? { ...toolMeta } : toolMeta
88266
88378
  };
@@ -88295,7 +88407,7 @@ const registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit, options) {
88295
88407
  content: []
88296
88408
  }) : successResult(result.encodedResult));
88297
88409
  }
88298
- return result.failureOrigin === "handler" ? succeed$5(failureResult(result.encodedResult)) : failCause$3(annotate$2(fail$8(result.result), make$86(FailureOrigin, result.failureOrigin ?? "result")));
88410
+ return result.failureOrigin === "handler" ? succeed$5(failureResult(result.encodedResult)) : failCause$3(annotate$2(fail$8(result.result), make$88(FailureOrigin, result.failureOrigin ?? "result")));
88299
88411
  }), catchCause$2(handleCause));
88300
88412
  },
88301
88413
  services
@@ -88813,11 +88925,6 @@ function recheckUser(current, found) {
88813
88925
  var CurrentUser = class extends Service$1()("@deslop/runtime/shared/auth/CurrentUser") {};
88814
88926
  var RpcAuth = class extends Service()("@deslop/runtime/shared/auth/RpcAuth", { error: AuthError }) {};
88815
88927
  const Origin = String$6.check(makeFilter((value) => exists(getSuccess(fromString(value)), (url) => contains$1(["http:", "https:"], url.protocol) && url.username === "" && url.password === "" && url.hash === ""), { expected: "an HTTP(S) URL without credentials or a fragment" })).check(makeFilter((value) => exists(getSuccess(fromString(value)), (url) => url.pathname === "/" && url.search === ""), { expected: "an HTTP(S) origin without a path or query" }));
88816
- Origin.check(makeFilter((value) => exists(getSuccess(fromString(value)), (url) => url.protocol === "https:" || contains$1([
88817
- "localhost",
88818
- "127.0.0.1",
88819
- "[::1]"
88820
- ], url.hostname)), { expected: "HTTPS outside loopback" }));
88821
88928
  const Port = String$6.check(isPattern(/^\d{1,5}$/u), makeFilter((value) => exists(parse$2(value), (port) => port >= 1 && port <= 65535), { expected: "a port between 1 and 65535" }));
88822
88929
  const AppVersion = String$6.check(isPattern(/^0\.1\.\d+$/u));
88823
88930
  const RUNTIME_PATH = "/api/runtime";
@@ -88859,7 +88966,7 @@ function identifyRequestOf(headers) {
88859
88966
  }
88860
88967
  const clientAddress = make$39((app) => xForwardedHeaders({ trustedProxies: isLoopback })(gen(function* () {
88861
88968
  const request = yield* HttpServerRequest;
88862
- const unclaimed = remove$1(request.headers, CLIENT_HEADER);
88969
+ const unclaimed = remove$2(request.headers, CLIENT_HEADER);
88863
88970
  const headers = pipe(request.remoteAddress, filter$5((address) => !exists(getSuccess(ipFromString(address)), isLoopback)), match$8({
88864
88971
  onNone: () => unclaimed,
88865
88972
  onSome: (address) => set$1(unclaimed, CLIENT_HEADER, address)
@@ -88875,18 +88982,17 @@ function refusalOf(status, message) {
88875
88982
  }
88876
88983
  var Auth = class Auth extends Service$1()("@deslop/runtime/server/auth") {
88877
88984
  static makeContext = (account) => {
88878
- const user = fn("Auth.user")(function* (headers) {
88879
- const found = yield* account(headers);
88880
- return {
88985
+ function user(headers, options) {
88986
+ return pipe(suspend$3(() => account(headers)), map$7((found) => ({
88881
88987
  admin: found.admin,
88882
88988
  id: found.id,
88883
88989
  name: found.name
88884
- };
88885
- });
88886
- return pipe(make$86(Auth, Auth.of({
88990
+ })), withSpan("Auth.user", options));
88991
+ }
88992
+ return pipe(make$88(Auth, Auth.of({
88887
88993
  account,
88888
88994
  user
88889
- })), add$3(RpcAuth, RpcAuth.of((effect, request) => flatMap$3(user(request.headers), (found) => pipe(effect, provideService$2(CurrentUser, found), raceFirst(recheckUser(user(request.headers), found)))))), add$3(RpcAdmin, RpcAdmin.of((effect, request) => gen(function* () {
88995
+ })), add$3(RpcAuth, RpcAuth.of((effect, request) => flatMap$3(user(request.headers), (found) => pipe(effect, provideService$2(CurrentUser, found), raceFirst(recheckUser(user(request.headers, { root: true }), found)))))), add$3(RpcAdmin, RpcAdmin.of((effect, request) => gen(function* () {
88890
88996
  return yield* provideService$2(effect, CurrentAdmin, yield* requireAdmin(yield* user(request.headers), "Only an admin may perform this action"));
88891
88997
  }))));
88892
88998
  };
@@ -90243,7 +90349,7 @@ const map$1 = /*#__PURE__*/ dual(2, (self, f) => flatMap(self, (a) => succeed(f(
90243
90349
  * @category constructors
90244
90350
  * @since 4.0.0
90245
90351
  */
90246
- const Password = (options) => basePrompt(options, "password").pipe(map$1(make$62));
90352
+ const Password = (options) => basePrompt(options, "password").pipe(map$1(make$64));
90247
90353
  /**
90248
90354
  * Runs a prompt by reading terminal input and rendering prompt frames until the
90249
90355
  * prompt submits a value.
@@ -92278,7 +92384,7 @@ const Formatter = /*#__PURE__*/ Reference("effect/cli/CliOutput", { defaultValue
92278
92384
  */
92279
92385
  const defaultPresenter = { present: /*#__PURE__*/ fnUntraced(function* (event) {
92280
92386
  const context$2 = yield* context();
92281
- const formatter = getOrUndefined$1(context$2, Formatter) ?? defaultFormatter({ colors: get$12(context$2, TerminalCapabilities).canColor });
92387
+ const formatter = getOrUndefined$1(context$2, Formatter) ?? defaultFormatter({ colors: get$13(context$2, TerminalCapabilities).canColor });
92282
92388
  switch (event._tag) {
92283
92389
  case "Help": return yield* log(formatter.formatHelpDoc(event.helpDoc));
92284
92390
  case "InvalidInvocation":
@@ -94697,7 +94803,7 @@ const defaults = { builtIns: BuiltIns };
94697
94803
  *
94698
94804
  * @internal
94699
94805
  */
94700
- const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$5(getOrUndefined$1(context, Formatter) ?? defaultFormatter({ colors: get$12(context, TerminalCapabilities).canColor })));
94806
+ const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$5(getOrUndefined$1(context, Formatter) ?? defaultFormatter({ colors: get$13(context, TerminalCapabilities).canColor })));
94701
94807
  // ../../node_modules/.pnpm/effect@4.1.7/node_modules/effect/dist/cli/internal/lexer.js
94702
94808
  /**
94703
94809
  * @internal
@@ -96200,7 +96306,7 @@ const runWith = (command, config) => {
96200
96306
  }
96201
96307
  const services = match$8(logLevel, {
96202
96308
  onNone: () => empty$14(),
96203
- onSome: (level) => make$86(MinimumLogLevel, level)
96309
+ onSome: (level) => make$88(MinimumLogLevel, level)
96204
96310
  });
96205
96311
  yield* provideContext$2(program, services);
96206
96312
  }, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$10(error) : fail$12(error), (error) => andThen(showHelp(command, error, config.renderErrors !== false), fail$7(error))), catchFilter((error) => {
@@ -96276,6 +96382,9 @@ const packageMetadata = gen(function* () {
96276
96382
  });
96277
96383
  const appName = map$7(packageMetadata, (metadata) => replace("@deslop/", "")(metadata.name));
96278
96384
  // ../../packages/runtime/src/server/iphone-update.ts
96385
+ function indexAssets(launchAsset, assets) {
96386
+ return reduce(assets, make$57([launchAsset.hash, launchAsset]), (index, asset) => modifyAt(index, asset.hash, orElseSome(() => asset)));
96387
+ }
96279
96388
  const registerIPhoneUpdates = fnUntraced(function* (router, auth, origin) {
96280
96389
  const fs = yield* FileSystem;
96281
96390
  const path = yield* Path$1;
@@ -96283,6 +96392,7 @@ const registerIPhoneUpdates = fnUntraced(function* (router, auth, origin) {
96283
96392
  const manifestFile = path.join(directory, "update.json");
96284
96393
  if (!(yield* fs.exists(manifestFile))) return;
96285
96394
  const manifest = yield* decodeEffect(IPhoneExport)(yield* fs.readFileString(manifestFile));
96395
+ const assets = indexAssets(manifest.launchAsset, manifest.assets);
96286
96396
  const assetsPath = `${IPHONE_UPDATE_PATH}/assets`;
96287
96397
  const headers = {
96288
96398
  "cache-control": "no-store",
@@ -96326,10 +96436,8 @@ const registerIPhoneUpdates = fnUntraced(function* (router, auth, origin) {
96326
96436
  }));
96327
96437
  return succeed$5(response);
96328
96438
  }));
96329
- const exported = prepend$1(manifest.assets, manifest.launchAsset);
96330
96439
  yield* router.add("GET", `${assetsPath}/:hash`, authorized(fnUntraced(function* () {
96331
- const params$2 = yield* params;
96332
- return yield* pipe(exported, findFirst((entry) => entry.hash === params$2["hash"]), match$8({
96440
+ return yield* pipe(fromUndefinedOr((yield* params)["hash"]), flatMap$8((hash) => get$3(assets, hash)), match$8({
96333
96441
  onNone: () => succeed$5(empty$1({ status: 404 })),
96334
96442
  onSome: (asset) => file(path.join(directory, asset.path), {
96335
96443
  contentType: asset.contentType,
@@ -96630,7 +96738,7 @@ function recordRpcContracts(group) {
96630
96738
  return gen(function* () {
96631
96739
  yield* match$8(yield* serviceOption(AuthorizationProbe), {
96632
96740
  onNone: () => void_$2,
96633
- onSome: (active) => update(active.rpcs, (saved) => appendAll$1(saved, map$10(fromIterable$5(group.requests.entries()), (entry) => ({
96741
+ onSome: (active) => update(active.rpcs, (saved) => appendAll$1(saved, map$10(fromIterable$6(group.requests.entries()), (entry) => ({
96634
96742
  contract: entry[1],
96635
96743
  name: entry[0]
96636
96744
  }))))
@@ -96659,7 +96767,7 @@ function fail(message) {
96659
96767
  }
96660
96768
  function sample(schema$4, name) {
96661
96769
  return mapError$2(gen(function* () {
96662
- const input = yield* pipe(FIXED_INPUTS, get$11(name), match$8({
96770
+ const input = yield* pipe(FIXED_INPUTS, get$12(name), match$8({
96663
96771
  onNone: () => flatMap$3(sampleEffect(schema(toEncoded(schema$4)), {
96664
96772
  count: 1,
96665
96773
  seed: 1,
@@ -96729,9 +96837,9 @@ function probeServer(start) {
96729
96837
  const canonical = "http://127.0.0.1";
96730
96838
  const probe = AuthorizationProbe.of({
96731
96839
  directory: yield* (yield* FileSystem).makeTempDirectoryScoped({ prefix: `${app}-authorization-` }),
96732
- routes: yield* make$60([]),
96733
- rpcs: yield* make$60([]),
96734
- tools: yield* make$60([])
96840
+ routes: yield* make$62([]),
96841
+ rpcs: yield* make$62([]),
96842
+ tools: yield* make$62([])
96735
96843
  });
96736
96844
  const context = yield* pipe(start(fixtureAuth), provide$2(succeed$6(AuthorizationProbe, probe)), provide$2(succeed$6(ConfigProvider, fromUnknown({
96737
96845
  APP_URL: canonical,
@@ -96744,15 +96852,15 @@ function probeServer(start) {
96744
96852
  HOME: probe.directory,
96745
96853
  HOST: "127.0.0.1"
96746
96854
  }))), build);
96747
- const origin = formatAddress(get$12(context, HttpServer).address);
96855
+ const origin = formatAddress(get$13(context, HttpServer).address);
96748
96856
  for (const identity of ["member", "admin"]) {
96749
96857
  const response = yield* pipe(get$2(`${origin}/api/account`), setHeader$1("x-probe-caller", identity), execute);
96750
96858
  const account = yield* schemaBodyJson$1(Account$1)(response);
96751
96859
  if (response.status !== 200 || account.admin !== (identity === "admin")) return yield* fail(`${app}: fixture ${identity} was not identified correctly`);
96752
96860
  }
96753
- const routes = yield* get$5(probe.routes);
96754
- const rpcs = yield* get$5(probe.rpcs);
96755
- const tools = yield* get$5(probe.tools);
96861
+ const routes = yield* get$6(probe.routes);
96862
+ const rpcs = yield* get$6(probe.rpcs);
96863
+ const tools = yield* get$6(probe.tools);
96756
96864
  if (isReadonlyArrayEmpty(rpcs) || isReadonlyArrayEmpty(routes)) return yield* fail(`${app}: no registered routes or RPC contracts`);
96757
96865
  yield* log(`${app}: routes [${pipe(routes, map$10((route) => `${route.method} ${route.path}`), join$3(", "))}]; RPCs [${pipe(rpcs, map$10((rpc) => rpc.name), join$3(", "))}]; tools [${pipe(tools, map$10((tool) => tool.name), join$3(", "))}]`);
96758
96866
  if (some(routes, (route) => route.path === "/mcp")) {
@@ -96808,8 +96916,8 @@ function probeServer(start) {
96808
96916
  yield* forEach$1(routes, (route) => timeout(gen(function* () {
96809
96917
  const path = pipe(route.path, replaceAll(":index", "0"), replaceAll(/:[a-zA-Z]+/gu, "probe"), replaceAll("*", "probe"));
96810
96918
  const methods = match(route.method === "*", {
96811
- onFalse: () => filter$3(fromIterable$5(all$1), (method) => method === route.method),
96812
- onTrue: () => fromIterable$5(all$1)
96919
+ onFalse: () => filter$3(fromIterable$6(all$1), (method) => method === route.method),
96920
+ onTrue: () => fromIterable$6(all$1)
96813
96921
  });
96814
96922
  if (isReadonlyArrayEmpty(methods)) return yield* fail(`Unprobed HTTP method ${route.method}`);
96815
96923
  for (const method of methods) {
@@ -96998,13 +97106,13 @@ const layerFlusher = /*#__PURE__*/ sync$1(Flusher, () => {
96998
97106
  */
96999
97107
  const make$5 = /*#__PURE__*/ fnUntraced(function* (options) {
97000
97108
  const services = yield* context();
97001
- const clock = get$12(services, Clock);
97002
- const scope = get$12(services, Scope);
97109
+ const clock = get$13(services, Clock);
97110
+ const scope = get$13(services, Scope);
97003
97111
  const exportInterval = max(fromInputUnsafe$1(options.exportInterval), zero$2);
97004
97112
  const batchLimit = options.maxBatchSize === "disabled" ? Infinity : normalizeNonEmpty(options.maxBatchSize);
97005
97113
  const maxQueueSize = options.maxQueueSize === void 0 || Number.isNaN(options.maxQueueSize) ? Number.isFinite(batchLimit) ? Math.max(2048, batchLimit) : 2048 : normalize$2(options.maxQueueSize);
97006
97114
  const concurrency = options.concurrency === "unbounded" ? Infinity : options.concurrency === void 0 || Number.isNaN(options.concurrency) ? 4 : normalizeNonEmpty(options.concurrency);
97007
- const client = get$12(services, HttpClient).pipe(tap((response) => ignore$1(response.arrayBuffer)), tapError((error) => error.response ? ignore$1(error.response.arrayBuffer) : void_$2), filterStatusOk, transformResponse(provideService$2(TracerPropagationEnabled, false)), retryTransient({
97115
+ const client = get$13(services, HttpClient).pipe(tap((response) => ignore$1(response.arrayBuffer)), tapError((error) => error.response ? ignore$1(error.response.arrayBuffer) : void_$2), filterStatusOk, transformResponse(provideService$2(TracerPropagationEnabled, false)), retryTransient({
97008
97116
  schedule: policy,
97009
97117
  times: 3
97010
97118
  }));
@@ -97014,7 +97122,7 @@ const make$5 = /*#__PURE__*/ fnUntraced(function* (options) {
97014
97122
  const headers = set$1(userHeaders, "user-agent", userAgent ? `${userAgent} ${exporterUserAgent}` : exporterUserAgent);
97015
97123
  const request = post(options.url, { headers });
97016
97124
  const exportsEmpty = options.maxBatchSize === "disabled" && options.exportEmpty === true;
97017
- const queue = make$75();
97125
+ const queue = make$77();
97018
97126
  let disabledUntil = void 0;
97019
97127
  let closed = false;
97020
97128
  const isDisabled = () => {
@@ -97047,8 +97155,8 @@ const make$5 = /*#__PURE__*/ fnUntraced(function* (options) {
97047
97155
  waiters.delete(waiter);
97048
97156
  });
97049
97157
  });
97050
- const armed = yield* make$77(exportsEmpty);
97051
- const wake = yield* make$77();
97158
+ const armed = yield* make$79(exportsEmpty);
97159
+ const wake = yield* make$79();
97052
97160
  const exportBatch = (items) => suspend$3(() => {
97053
97161
  const [body, onSuccess] = options.body(items);
97054
97162
  const batchRequest = setBody$1(request, body);
@@ -97470,7 +97578,7 @@ const layer$1 = /*#__PURE__*/ flow(/* @__PURE__ */ fnUntraced(function* (options
97470
97578
  if (!span.sampled) return;
97471
97579
  exporter.push(makeOtlpSpan(span));
97472
97580
  }
97473
- return make$84({
97581
+ return make$86({
97474
97582
  span(options) {
97475
97583
  return new SpanImpl(options, exportFn);
97476
97584
  },
@@ -97787,7 +97895,7 @@ const layerWeb = unwrap$7(gen(function* () {
97787
97895
  }));
97788
97896
  const layerRpcProtocol = effect(Protocol, gen(function* () {
97789
97897
  const websocket = yield* makeProtocolWithHttpEffectWebsocket;
97790
- yield* (yield* HttpRouter).add("GET", RPC_PATH, provideServiceEffect(websocket.httpEffect, HttpServerRequest, map$7(HttpServerRequest, (request) => request.modify({ headers: pipe(request.headers, remove$1(FRAME_HEADERS), set$1(FRAME_HEADERS, "")) }))));
97898
+ yield* (yield* HttpRouter).add("GET", RPC_PATH, provideServiceEffect(websocket.httpEffect, HttpServerRequest, map$7(HttpServerRequest, (request) => request.modify({ headers: pipe(request.headers, remove$2(FRAME_HEADERS), set$1(FRAME_HEADERS, "")) }))));
97791
97899
  return Protocol.of({
97792
97900
  ...websocket.protocol,
97793
97901
  run: (receive) => websocket.protocol.run((clientId, message) => {
@@ -97922,7 +98030,7 @@ const make$1 = (options) => gen(function* () {
97922
98030
  timeToLive: (exit) => isSuccess(exit) ? prepareCacheTTL : zero$2
97923
98031
  });
97924
98032
  const runStatement = (statement, params, raw) => withFiber((fiber) => {
97925
- const useSafeIntegers = get$12(fiber.context, SafeIntegers);
98033
+ const useSafeIntegers = get$13(fiber.context, SafeIntegers);
97926
98034
  return try_({
97927
98035
  try: () => {
97928
98036
  statement.setReadBigInts(useSafeIntegers);
@@ -97937,7 +98045,7 @@ const make$1 = (options) => gen(function* () {
97937
98045
  });
97938
98046
  });
97939
98047
  const runStatementValues = (statement, params) => withFiber((fiber) => {
97940
- const useSafeIntegers = get$12(fiber.context, SafeIntegers);
98048
+ const useSafeIntegers = get$13(fiber.context, SafeIntegers);
97941
98049
  return try_({
97942
98050
  try: () => {
97943
98051
  statement.setReadBigInts(useSafeIntegers);
@@ -97947,7 +98055,7 @@ const make$1 = (options) => gen(function* () {
97947
98055
  });
97948
98056
  });
97949
98057
  const runStatementValuesUnprepared = (statement, params) => withFiber((fiber) => {
97950
- const useSafeIntegers = get$12(fiber.context, SafeIntegers);
98058
+ const useSafeIntegers = get$13(fiber.context, SafeIntegers);
97951
98059
  return try_({
97952
98060
  try: () => {
97953
98061
  statement.setReadBigInts(useSafeIntegers);
@@ -98008,7 +98116,7 @@ const make$1 = (options) => gen(function* () {
98008
98116
  });
98009
98117
  const { acquirer, borrower, isTransaction, onCommitFailure, transactionAcquirer } = makeSqliteAcquirers({
98010
98118
  connection: succeed$5(connection),
98011
- semaphore: yield* make$72(1),
98119
+ semaphore: yield* make$74(1),
98012
98120
  isTransaction: (conn) => conn.isTransaction()
98013
98121
  });
98014
98122
  return Object.assign(yield* make$27({
@@ -98037,7 +98145,7 @@ const make$1 = (options) => gen(function* () {
98037
98145
  * @category layers
98038
98146
  * @since 4.0.0
98039
98147
  */
98040
- const layer = (config) => effectContext(map$7(make$1(config), (client) => make$86(SqliteClient, client).pipe(add$3(SqlClient, client)))).pipe(provide$2(layer$19));
98148
+ const layer = (config) => effectContext(map$7(make$1(config), (client) => make$88(SqliteClient, client).pipe(add$3(SqlClient, client)))).pipe(provide$2(layer$19));
98041
98149
  const classifyError = (cause, message, operation) => classifySqliteError(sqliteCauseWithErrno(cause), {
98042
98150
  message,
98043
98151
  operation
@@ -98159,7 +98267,12 @@ function layerDataStore(directory) {
98159
98267
  });
98160
98268
  yield* sql`PRAGMA auto_vacuum = INCREMENTAL`;
98161
98269
  yield* sql`PRAGMA journal_mode = WAL`;
98162
- if (!some(yield* sql`PRAGMA auto_vacuum`, (row) => row.auto_vacuum === 2)) return yield* die$2(`${filename} was created without incremental vacuum`);
98270
+ const vacuumMode = findAll({
98271
+ Request: Void,
98272
+ Result: Struct$2({ auto_vacuum: Int$1 }),
98273
+ execute: () => sql`PRAGMA auto_vacuum`
98274
+ });
98275
+ if (!some(yield* vacuumMode(), (row) => row.auto_vacuum === 2)) return yield* die$2(`${filename} was created without incremental vacuum`);
98163
98276
  }), scoped, provideServiceEffect(Reactivity, make$29));
98164
98277
  return provideMerge(retiredSessions, provideMerge(tuned, merge$4(layer({ filename }), layer$19)));
98165
98278
  }));
@@ -98175,7 +98288,7 @@ const executeProcess = fn("Process.execute")(function* (command, args, options)
98175
98288
  command,
98176
98289
  "command.arguments": args.length
98177
98290
  });
98178
- const process = yield* make$61(command, args, {
98291
+ const process = yield* make$63(command, args, {
98179
98292
  stderr: "pipe",
98180
98293
  stdout: "pipe"
98181
98294
  });
@@ -98622,7 +98735,7 @@ function server(app, listener = layerNodeHttpServer) {
98622
98735
  }))), provideMerge(listener(frames)), provide$2(layerPlatform));
98623
98736
  }
98624
98737
  function output(text) {
98625
- return flatMap$3(Stdio, (stdio) => run$6(make$68(text), stdio.stdout()));
98738
+ return flatMap$3(Stdio, (stdio) => run$6(make$70(text), stdio.stdout()));
98626
98739
  }
98627
98740
  function runApp(app) {
98628
98741
  const program = gen(function* () {
@@ -98915,6 +99028,7 @@ const Account = Struct$2({
98915
99028
  });
98916
99029
  const Person = Struct$2({
98917
99030
  ...Account.fields,
99031
+ requestedAt: OptionFromNullOr(DateTimeUtcFromMillis),
98918
99032
  since: OptionFromNullOr(DateTimeUtcFromMillis)
98919
99033
  });
98920
99034
  const AdmitParams = Struct$2({
@@ -98935,6 +99049,7 @@ var Member = class extends Class("Member")({
98935
99049
  fullName: FieldOption(String$6),
98936
99050
  id: User.fields.id,
98937
99051
  name: User.fields.name,
99052
+ requestedAt: FieldOption(DateTimeUtcFromMillis),
98938
99053
  since: FieldOption(DateTimeUtcFromMillis),
98939
99054
  status: FieldOption(MemberStatus),
98940
99055
  tailnet: BooleanFromBit
@@ -99020,11 +99135,11 @@ const pendingSignIns = gen(function* () {
99020
99135
  return {
99021
99136
  open: fn("GitHub.resume")(function* (state, sealed) {
99022
99137
  const bytes = yield* fromResult(decode$3(sealed));
99023
- const now$4 = yield* now;
99138
+ const now$5 = yield* now;
99024
99139
  return yield* pipe(aead.decrypt(key, bytes.subarray(NONCE), {
99025
99140
  aad: new TextEncoder().encode(state),
99026
99141
  nonce: bytes.subarray(0, NONCE)
99027
- }), flatMap$3((plain) => decodeEffect(PendingSignInJson)(new TextDecoder().decode(plain))), filterOrFail((pending) => isGreaterThan$1(pending.expires, now$4), () => new NoSuchElementError("The sign-in expired")));
99142
+ }), flatMap$3((plain) => decodeEffect(PendingSignInJson)(new TextDecoder().decode(plain))), filterOrFail((pending) => isGreaterThan$1(pending.expires, now$5), () => new NoSuchElementError("The sign-in expired")));
99028
99143
  }, mapError$2((cause) => AuthError.make({
99029
99144
  cause,
99030
99145
  message: "The sign-in expired or began in another browser"
@@ -99191,7 +99306,8 @@ const peopleMigrations = effectDiscard(make$26({})({
99191
99306
  yield* sql`DROP TABLE members`;
99192
99307
  yield* sql`ALTER TABLE members_next RENAME TO members`;
99193
99308
  }),
99194
- "0005_bindings": flatMap$3(SqlClient, (sql) => sql`CREATE TABLE tailnet_bindings (tailnetId TEXT PRIMARY KEY, userId TEXT NOT NULL) STRICT`)
99309
+ "0005_bindings": flatMap$3(SqlClient, (sql) => sql`CREATE TABLE tailnet_bindings (tailnetId TEXT PRIMARY KEY, userId TEXT NOT NULL) STRICT`),
99310
+ "0006_requested_at": flatMap$3(SqlClient, (sql) => sql`ALTER TABLE members ADD COLUMN requestedAt INTEGER`)
99195
99311
  }),
99196
99312
  table: "members_migrations"
99197
99313
  }));
@@ -99227,47 +99343,66 @@ var Sessions = class Sessions extends Service$1()("@deslop/auth/sessions/server/
99227
99343
  log: "Warn",
99228
99344
  message: "Expired sessions could not be deleted"
99229
99345
  }), repeat(spaced(hours(1))), forkScoped);
99346
+ const current = fn("Sessions.current")(function* (secret) {
99347
+ const id = yield* hash(secret);
99348
+ const now$3 = toEpochMillis(yield* now);
99349
+ const since = toEpochMillis(yield* cutoff);
99350
+ return yield* findOneOption({
99351
+ Request: Void,
99352
+ Result: CookieSession,
99353
+ execute: () => sql`UPDATE ${table} SET lastSeenAt = ${now$3} WHERE id = ${id} AND lastSeenAt > ${since} RETURNING *`
99354
+ })();
99355
+ }, asAuthError("Cannot read the session"));
99356
+ const list = fn("Sessions.list")(function* (user) {
99357
+ const since = toEpochMillis(yield* cutoff);
99358
+ return yield* findAll({
99359
+ Request: Void,
99360
+ Result: CookieSession,
99361
+ execute: () => sql`SELECT * FROM ${table} WHERE userId = ${user} AND lastSeenAt > ${since} ORDER BY lastSeenAt DESC`
99362
+ })();
99363
+ }, asAuthError("Cannot list sessions"));
99230
99364
  return Sessions.of({
99231
99365
  create: fn("Sessions.create")(function* (user, address, browser) {
99232
99366
  const secret = encode$1(yield* random.randomBytes(32));
99233
- const now$2 = yield* now;
99367
+ const now$4 = yield* now;
99234
99368
  yield* insert({
99235
99369
  address,
99236
99370
  browser,
99237
- createdAt: now$2,
99371
+ createdAt: now$4,
99238
99372
  id: yield* hash(secret),
99239
- lastSeenAt: now$2,
99373
+ lastSeenAt: now$4,
99240
99374
  userId: user
99241
99375
  });
99242
99376
  return secret;
99243
99377
  }, mutate, asAuthError("Cannot create the session")),
99244
- current: fn("Sessions.current")(function* (secret) {
99245
- const id = yield* hash(secret);
99246
- const now$3 = toEpochMillis(yield* now);
99247
- const since = toEpochMillis(yield* cutoff);
99248
- return yield* findOneOption({
99249
- Request: Void,
99250
- Result: CookieSession,
99251
- execute: () => sql`UPDATE ${table} SET lastSeenAt = ${now$3} WHERE id = ${id} AND lastSeenAt > ${since} RETURNING *`
99252
- })();
99253
- }, asAuthError("Cannot read the session")),
99378
+ current,
99254
99379
  forget: fn("Sessions.forget")(function* (secret) {
99255
99380
  yield* sql`DELETE FROM ${table} WHERE id = ${yield* hash(secret)}`;
99256
99381
  }, mutate, asAuthError("Cannot sign out; no changes committed")),
99257
99382
  forgetPerson: fn("Sessions.forgetPerson")(function* (user) {
99258
99383
  yield* sql`DELETE FROM ${table} WHERE userId = ${user}`;
99259
99384
  }, mutate, asAuthError("Cannot sign out the person; no changes committed")),
99260
- list: fn("Sessions.list")(function* (user) {
99261
- const since = toEpochMillis(yield* cutoff);
99262
- return yield* findAll({
99263
- Request: Void,
99264
- Result: CookieSession,
99265
- execute: () => sql`SELECT * FROM ${table} WHERE userId = ${user} AND lastSeenAt > ${since} ORDER BY lastSeenAt DESC`
99266
- })();
99267
- }, asAuthError("Cannot list sessions")),
99385
+ list,
99268
99386
  remove: fn("Sessions.remove")(function* (id, user) {
99269
99387
  yield* sql`DELETE FROM ${table} WHERE id = ${id} AND userId = ${user}`;
99270
- }, mutate, asAuthError("Cannot sign out the session; no changes committed"))
99388
+ }, mutate, asAuthError("Cannot sign out the session; no changes committed")),
99389
+ watch: (user, secret) => unwrap$4(gen(function* () {
99390
+ const own = yield* match$8(secret, {
99391
+ onNone: () => succeedNone,
99392
+ onSome: current
99393
+ });
99394
+ const listed = map$7(list(user), map$10((row) => ListedSession.make({
99395
+ address: row.address,
99396
+ browser: row.browser,
99397
+ current: exists(own, (found) => found.id === row.id),
99398
+ id: row.id,
99399
+ lastSeenAt: row.lastSeenAt
99400
+ })));
99401
+ return pipe(tick("1 minute"), switchMap(() => sql.reactive(["sessions"], listed)), changesWith(toEquivalence(ArraySchema(ListedSession))), buffer$1({
99402
+ capacity: 1,
99403
+ strategy: "sliding"
99404
+ }));
99405
+ }))
99271
99406
  });
99272
99407
  })), Sessions.migrations);
99273
99408
  };
@@ -99324,6 +99459,7 @@ function personOf(admins, row) {
99324
99459
  admin: isAdmin(admins, row.id),
99325
99460
  ...pick(row, ["id", "name"]),
99326
99461
  fullName: filter$5(row.fullName, isNonEmpty$1),
99462
+ requestedAt: row.requestedAt,
99327
99463
  role: listedRoleOf(admins, row),
99328
99464
  since: row.since
99329
99465
  });
@@ -99336,6 +99472,7 @@ function listPeople(rows, admins) {
99336
99472
  fullName: none(),
99337
99473
  id: UserId.make(`github:${id}`),
99338
99474
  name: `GitHub ${id}`,
99475
+ requestedAt: none(),
99339
99476
  role: "Admin",
99340
99477
  since: none()
99341
99478
  }))), ...known], mapInput(Order$4, (person) => ROLE_ORDER[person.role]));
@@ -99368,7 +99505,7 @@ var People = class People extends Service$1()("@deslop/auth/people/server/People
99368
99505
  });
99369
99506
  const upsert = void_({
99370
99507
  Request: Member.insert,
99371
- execute: (row) => sql`INSERT INTO ${table} ${sql.insert(row)} ON CONFLICT (id) DO UPDATE SET name = excluded.name, fullName = excluded.fullName, status = excluded.status, tailnet = excluded.tailnet`
99508
+ execute: (row) => sql`INSERT INTO ${table} ${sql.insert(row)} ON CONFLICT (id) DO UPDATE SET name = excluded.name, fullName = excluded.fullName, requestedAt = excluded.requestedAt, status = excluded.status, tailnet = excluded.tailnet`
99372
99509
  });
99373
99510
  const boundRow = findOneOption({
99374
99511
  Request: TailnetUserId,
@@ -99380,14 +99517,17 @@ var People = class People extends Service$1()("@deslop/auth/people/server/People
99380
99517
  yield* sql`DELETE FROM ${bindings} WHERE userId = ${id}`;
99381
99518
  yield* sql`DELETE FROM ${table} WHERE id = ${id}`;
99382
99519
  });
99520
+ const list = fn("People.list")(function* (_admin) {
99521
+ return listPeople(yield* all(), admins);
99522
+ }, asAuthError("Cannot read people"));
99383
99523
  return People.of({
99384
99524
  admit: fn("People.admit")(function* (params) {
99385
99525
  const row = yield* existing(params.id);
99386
99526
  if (!contains$2(row.status, "Waiting") || isAdmin(admins, row.id)) return yield* AuthError.make({ message: "This account is not asking for access" });
99387
- if (params.allow) yield* sql`UPDATE ${table} SET status = 'Allowed', since = ${toEpochMillis(yield* now)} WHERE id = ${params.id}`;
99527
+ if (params.allow) yield* sql`UPDATE ${table} SET status = 'Allowed', requestedAt = NULL, since = ${toEpochMillis(yield* now)} WHERE id = ${params.id}`;
99388
99528
  else if (row.tailnet) {
99389
99529
  yield* sessions.forgetPerson(params.id);
99390
- yield* sql`UPDATE ${table} SET status = NULL WHERE id = ${params.id}`;
99530
+ yield* sql`UPDATE ${table} SET status = NULL, requestedAt = NULL WHERE id = ${params.id}`;
99391
99531
  } else yield* removeRow(params.id);
99392
99532
  return personOf(admins, yield* match(params.allow || row.tailnet, {
99393
99533
  onFalse: () => succeed$5(row),
@@ -99399,9 +99539,7 @@ var People = class People extends Service$1()("@deslop/auth/people/server/People
99399
99539
  }, asAuthError("Cannot bind the tailnet user")),
99400
99540
  bound: fn("People.bound")(boundRow, asAuthError("Cannot read the tailnet user")),
99401
99541
  find,
99402
- list: fn("People.list")(function* () {
99403
- return listPeople(yield* all(), admins);
99404
- }, asAuthError("Cannot read people")),
99542
+ list,
99405
99543
  register: fn("People.register")(function* (user, profileName, tailnet) {
99406
99544
  const fullName = filter$5(profileName, isNonEmpty$1);
99407
99545
  const row = yield* find(user.id);
@@ -99414,11 +99552,23 @@ var People = class People extends Service$1()("@deslop/auth/people/server/People
99414
99552
  });
99415
99553
  const seen = tailnet || exists(row, (member) => member.tailnet);
99416
99554
  if (exists(row, (member) => member.name === user.name && getOrUndefined$2(member.fullName) === getOrUndefined$2(fullName) && getOrUndefined$2(member.status) === getOrUndefined$2(status) && member.tailnet === seen)) return yield* fromOption(row);
99555
+ const now$2 = some$1(yield* now);
99556
+ function requestedAt() {
99557
+ if (!contains$2(status, "Waiting")) return none();
99558
+ return match$8(row, {
99559
+ onNone: () => now$2,
99560
+ onSome: (member) => {
99561
+ if (contains$2(member.status, "Waiting")) return member.requestedAt;
99562
+ return now$2;
99563
+ }
99564
+ });
99565
+ }
99417
99566
  yield* mutate(upsert({
99418
99567
  fullName,
99419
99568
  id: user.id,
99420
99569
  name: user.name,
99421
- since: some$1(yield* now),
99570
+ requestedAt: requestedAt(),
99571
+ since: now$2,
99422
99572
  status,
99423
99573
  tailnet: seen
99424
99574
  }));
@@ -99432,7 +99582,11 @@ var People = class People extends Service$1()("@deslop/auth/people/server/People
99432
99582
  const row = yield* existing(id);
99433
99583
  yield* removeRow(id);
99434
99584
  return personOf(admins, row);
99435
- }, mutate, sql.withTransaction, asAuthError("Cannot remove the person; no changes committed"))
99585
+ }, mutate, sql.withTransaction, asAuthError("Cannot remove the person; no changes committed")),
99586
+ watch: (admin) => buffer$1(sql.reactive(["people"], list(admin)), {
99587
+ capacity: 1,
99588
+ strategy: "sliding"
99589
+ })
99436
99590
  });
99437
99591
  })), People.migrations);
99438
99592
  };
@@ -99493,7 +99647,7 @@ var Identity = class Identity extends Service$1()("@deslop/auth/identity/server/
99493
99647
  const local = yield* localAuth;
99494
99648
  const admins = yield* adminIds;
99495
99649
  const owners = yield* Tailnet;
99496
- const sightings = yield* make$71({ lookup: (_id) => make$72(1) });
99650
+ const sightings = yield* make$73({ lookup: (_id) => make$74(1) });
99497
99651
  const sighted = fnUntraced(function* (profile) {
99498
99652
  const user = yield* github.login(slice(0, -7)(profile.LoginName));
99499
99653
  const member = yield* people.register({
@@ -99505,7 +99659,7 @@ var Identity = class Identity extends Service$1()("@deslop/auth/identity/server/
99505
99659
  });
99506
99660
  const tailnet = fnUntraced(function* (profile) {
99507
99661
  if (endsWith("@github")(profile.LoginName)) return yield* match$8(yield* people.bound(profile.ID), {
99508
- onNone: () => scoped(flatMap$3(get$8(sightings, profile.ID), (lock) => withPermit(lock, flatMap$3(people.bound(profile.ID), match$8({
99662
+ onNone: () => scoped(flatMap$3(get$9(sightings, profile.ID), (lock) => withPermit(lock, flatMap$3(people.bound(profile.ID), match$8({
99509
99663
  onNone: () => sighted(profile),
99510
99664
  onSome: succeed$5
99511
99665
  }))))),
@@ -99534,7 +99688,7 @@ var Identity = class Identity extends Service$1()("@deslop/auth/identity/server/
99534
99688
  onNone: () => gen(function* () {
99535
99689
  const found = yield* owners.status;
99536
99690
  if ((found.Self.Tags?.length ?? 0) > 0) return yield* AuthError.make({ message: "Sign in first" });
99537
- return yield* pipe(found.User, get$11(found.Self.UserID), match$8({
99691
+ return yield* pipe(found.User, get$12(found.Self.UserID), match$8({
99538
99692
  onNone: () => fail$7(AuthError.make({ message: "Sign in first" })),
99539
99693
  onSome: tailnet
99540
99694
  }));
@@ -99577,18 +99731,19 @@ var Identity = class Identity extends Service$1()("@deslop/auth/identity/server/
99577
99731
  return Identity.of({ resolve });
99578
99732
  }));
99579
99733
  };
99580
- // src/identity/handlers.ts
99581
- function authResponse(effect) {
99582
- return pipe(effect, catchIf$2(is$2(AuthError), (error) => succeed$5(text(error.message, failureOptions(error, 401)))), map$7(setHeader("cache-control", "no-store")));
99583
- }
99584
- const identityHandlers = IdentityRpcs.toLayer(gen(function* () {
99734
+ const watchIdentity = gen(function* () {
99585
99735
  const identity = yield* Identity;
99586
99736
  const sql = yield* SqlClient;
99587
- return { "people.account": (_, options) => buffer$1(sql.reactive(["people", "sessions"], identity.resolve(identifyRequestOf(options.headers), true)), {
99737
+ return (request) => buffer$1(sql.reactive(["people", "sessions"], identity.resolve(request, true)), {
99588
99738
  capacity: 1,
99589
99739
  strategy: "sliding"
99590
- }) };
99591
- }));
99740
+ });
99741
+ });
99742
+ // src/identity/handlers.ts
99743
+ function authResponse(effect) {
99744
+ return pipe(effect, catchIf$2(is$2(AuthError), (error) => succeed$5(text(error.message, failureOptions(error, 401)))), map$7(setHeader("cache-control", "no-store")));
99745
+ }
99746
+ const identityHandlers = IdentityRpcs.toLayer(map$7(watchIdentity, (watch) => ({ "people.account": (_, options) => watch(identifyRequestOf(options.headers)) })));
99592
99747
  const identityHttp = use((router) => gen(function* () {
99593
99748
  const identity = yield* Identity;
99594
99749
  yield* router.add("POST", IDENTIFY_PATH, authResponse(gen(function* () {
@@ -99624,15 +99779,11 @@ const peopleToolHandlers = peopleTools.toLayer(map$7(People, (people) => ({
99624
99779
  })));
99625
99780
  const peopleHandlers = PeopleRpcs.toLayer(gen(function* () {
99626
99781
  const people = yield* People;
99627
- const sql = yield* SqlClient;
99628
99782
  return {
99629
99783
  "people.admit": fnUntraced(function* (input) {
99630
99784
  return yield* people.admit(input, yield* CurrentAdmin);
99631
99785
  }),
99632
- "people.watch": () => unwrap$4(map$7(CurrentAdmin, (admin) => buffer$1(sql.reactive(["people"], people.list(admin)), {
99633
- capacity: 1,
99634
- strategy: "sliding"
99635
- })))
99786
+ "people.watch": () => unwrap$4(map$7(CurrentAdmin, people.watch))
99636
99787
  };
99637
99788
  }));
99638
99789
  // src/sessions/handlers.ts
@@ -99658,28 +99809,7 @@ const sessionsToolHandlers = sessionsTools.toLayer(map$7(Sessions, (sessions) =>
99658
99809
  return { id: input.id };
99659
99810
  })
99660
99811
  })));
99661
- const sessionsHandlers = SessionsRpcs.toLayer(gen(function* () {
99662
- const sessions = yield* Sessions;
99663
- const sql = yield* SqlClient;
99664
- return { "sessions.watch": (_, options) => unwrap$4(gen(function* () {
99665
- const user = yield* CurrentUser;
99666
- const own = yield* match$8(identifyRequestOf(options.headers).session, {
99667
- onNone: () => succeedNone,
99668
- onSome: sessions.current
99669
- });
99670
- const listed = map$7(sessions.list(user.id), map$10((row) => ListedSession.make({
99671
- address: row.address,
99672
- browser: row.browser,
99673
- current: exists(own, (found) => found.id === row.id),
99674
- id: row.id,
99675
- lastSeenAt: row.lastSeenAt
99676
- })));
99677
- return pipe(tick("1 minute"), switchMap(() => sql.reactive(["sessions"], listed)), changesWith(toEquivalence(ArraySchema(ListedSession))), buffer$1({
99678
- capacity: 1,
99679
- strategy: "sliding"
99680
- }));
99681
- })) };
99682
- }));
99812
+ const sessionsHandlers = SessionsRpcs.toLayer(map$7(Sessions, (sessions) => ({ "sessions.watch": (_, options) => unwrap$4(map$7(CurrentUser, (user) => sessions.watch(user.id, identifyRequestOf(options.headers).session))) })));
99683
99813
  // src/sign-ins/shared.ts
99684
99814
  function parentDomain(canonical) {
99685
99815
  return pipe(new URL(canonical).hostname, split$1("."), drop$1(1), join$3("."));