@deslop/opm 0.1.1249 → 0.1.1256

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/server.js +684 -253
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -3158,7 +3158,7 @@ const Prototype = (options) => makePrimitiveProto({
3158
3158
  * @category constructors
3159
3159
  * @since 2.0.0
3160
3160
  */
3161
- const make$70 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
3161
+ const make$71 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
3162
3162
  const isStrictEquivalent = (x, y) => x === y;
3163
3163
  /**
3164
3164
  * Creates an equivalence relation that uses strict equality (`===`) to compare values.
@@ -3268,7 +3268,7 @@ const strictEqual = () => isStrictEquivalent;
3268
3268
  * @since 4.0.0
3269
3269
  */
3270
3270
  function Tuple$1(elements) {
3271
- return make$70((self, that) => {
3271
+ return make$71((self, that) => {
3272
3272
  if (self.length !== that.length) return false;
3273
3273
  for (let i = 0; i < self.length; i++) if (!elements[i](self[i], that[i])) return false;
3274
3274
  return true;
@@ -3278,7 +3278,7 @@ function Tuple$1(elements) {
3278
3278
  * @since 4.0.0
3279
3279
  */
3280
3280
  function Array_(item) {
3281
- return make$70((self, that) => {
3281
+ return make$71((self, that) => {
3282
3282
  if (self.length !== that.length) return false;
3283
3283
  for (let i = 0; i < self.length; i++) if (!item(self[i], that[i])) return false;
3284
3284
  return true;
@@ -3479,7 +3479,7 @@ const getSuccess$1 = (self) => isFailure$2(self) ? none$1 : some$3(self.success)
3479
3479
  * @category constructors
3480
3480
  * @since 2.0.0
3481
3481
  */
3482
- function make$69(compare) {
3482
+ function make$70(compare) {
3483
3483
  return (self, that) => self === that ? 0 : compare(self, that);
3484
3484
  }
3485
3485
  /**
@@ -3510,7 +3510,7 @@ function make$69(compare) {
3510
3510
  * @category instances
3511
3511
  * @since 4.0.0
3512
3512
  */
3513
- const String$10 = /*#__PURE__*/ make$69((self, that) => self < that ? -1 : 1);
3513
+ const String$10 = /*#__PURE__*/ make$70((self, that) => self < that ? -1 : 1);
3514
3514
  /**
3515
3515
  * Order instance for numbers that compares them numerically.
3516
3516
  *
@@ -3543,7 +3543,7 @@ const String$10 = /*#__PURE__*/ make$69((self, that) => self < that ? -1 : 1);
3543
3543
  * @category instances
3544
3544
  * @since 4.0.0
3545
3545
  */
3546
- const Number$6 = /*#__PURE__*/ make$69((self, that) => {
3546
+ const Number$6 = /*#__PURE__*/ make$70((self, that) => {
3547
3547
  if (globalThis.Number.isNaN(self) && globalThis.Number.isNaN(that)) return 0;
3548
3548
  if (globalThis.Number.isNaN(self)) return -1;
3549
3549
  if (globalThis.Number.isNaN(that)) return 1;
@@ -3580,7 +3580,7 @@ const Number$6 = /*#__PURE__*/ make$69((self, that) => {
3580
3580
  * @since 4.0.0
3581
3581
  */
3582
3582
  function flip$1(O) {
3583
- return make$69((self, that) => O(that, self));
3583
+ return make$70((self, that) => O(that, self));
3584
3584
  }
3585
3585
  /**
3586
3586
  * Transforms an `Order` on type `A` into an `Order` on type `B` by providing a function that
@@ -3615,7 +3615,7 @@ function flip$1(O) {
3615
3615
  * @category mapping
3616
3616
  * @since 2.0.0
3617
3617
  */
3618
- const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$69((b1, b2) => self(f(b1), f(b2))));
3618
+ const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$70((b1, b2) => self(f(b1), f(b2))));
3619
3619
  /**
3620
3620
  * Checks whether one value is strictly less than another according to the given order.
3621
3621
  *
@@ -4524,7 +4524,7 @@ const ServiceProto = {
4524
4524
  .../*#__PURE__*/ Prototype({
4525
4525
  label: "Service",
4526
4526
  evaluate(fiber) {
4527
- return exitSucceed(get$10(fiber.context, this));
4527
+ return exitSucceed(get$11(fiber.context, this));
4528
4528
  }
4529
4529
  }),
4530
4530
  toJSON() {
@@ -4537,13 +4537,13 @@ const ServiceProto = {
4537
4537
  return self;
4538
4538
  },
4539
4539
  context(self) {
4540
- return make$68(this, self);
4540
+ return make$69(this, self);
4541
4541
  },
4542
4542
  use(f) {
4543
- return withFiber$1((fiber) => f(get$10(fiber.context, this)));
4543
+ return withFiber$1((fiber) => f(get$11(fiber.context, this)));
4544
4544
  },
4545
4545
  useSync(f) {
4546
- return withFiber$1((fiber) => exitSucceed(f(get$10(fiber.context, this))));
4546
+ return withFiber$1((fiber) => exitSucceed(f(get$11(fiber.context, this))));
4547
4547
  }
4548
4548
  };
4549
4549
  const cacheKeys = /*#__PURE__*/ new Set();
@@ -4760,7 +4760,7 @@ const emptyContext = /*#__PURE__*/ makeUnsafe$9(/*#__PURE__*/ new Map());
4760
4760
  * @category constructors
4761
4761
  * @since 2.0.0
4762
4762
  */
4763
- const make$68 = (key, service) => makeUnsafe$9(/* @__PURE__ */ new Map([[key.key, service]]));
4763
+ const make$69 = (key, service) => makeUnsafe$9(/* @__PURE__ */ new Map([[key.key, service]]));
4764
4764
  /**
4765
4765
  * Adds a service to a given `Context`.
4766
4766
  *
@@ -4922,7 +4922,7 @@ const getUnsafe$2 = /*#__PURE__*/ dual(2, (self, service) => {
4922
4922
  * @category getters
4923
4923
  * @since 2.0.0
4924
4924
  */
4925
- const get$10 = getUnsafe$2;
4925
+ const get$11 = getUnsafe$2;
4926
4926
  const defaultValueCacheKey = "~effect/Context/defaultValue";
4927
4927
  const getDefaultValue = (ref) => {
4928
4928
  if (defaultValueCacheKey in ref) return ref[defaultValueCacheKey];
@@ -5571,7 +5571,7 @@ const all$3 = (input) => {
5571
5571
  * @category constructors
5572
5572
  * @since 2.0.0
5573
5573
  */
5574
- const make$67 = (...elements) => elements;
5574
+ const make$68 = (...elements) => elements;
5575
5575
  /**
5576
5576
  * Creates an `Equivalence` for tuples by comparing corresponding elements
5577
5577
  * using the provided per-position `Equivalence`s. Two tuples are equivalent
@@ -5604,7 +5604,7 @@ const make$67 = (...elements) => elements;
5604
5604
  * @category instances
5605
5605
  * @since 4.0.0
5606
5606
  */
5607
- const makeEquivalence$3 = Tuple$1;
5607
+ const makeEquivalence$4 = Tuple$1;
5608
5608
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Iterable.js
5609
5609
  /**
5610
5610
  * Gets the first element of an `Iterable` without returning an `Option`.
@@ -5823,6 +5823,36 @@ const toEntries = /*#__PURE__*/ collect$1((key, value) => [key, value]);
5823
5823
  */
5824
5824
  const has$5 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key));
5825
5825
  /**
5826
+ * Removes a key from a record.
5827
+ *
5828
+ * **When to use**
5829
+ *
5830
+ * Use to create a shallow copy of a record without one property.
5831
+ *
5832
+ * **Details**
5833
+ *
5834
+ * If the key is not present, the result is still a shallow copy of the original
5835
+ * record.
5836
+ *
5837
+ * **Example** (Removing a key)
5838
+ *
5839
+ * ```ts import.meta.vitest
5840
+ * import { Record } from "effect"
5841
+ *
5842
+ * Record.remove({ a: 1, b: 2 }, "a") // => { b: 2 }
5843
+ * ```
5844
+ *
5845
+ * @stability stable
5846
+ * @category mutations
5847
+ * @since 2.0.0
5848
+ */
5849
+ const remove$4 = /*#__PURE__*/ dual(2, (self, key) => {
5850
+ if (!has$5(self, key)) return { ...self };
5851
+ const out = { ...self };
5852
+ delete out[key];
5853
+ return out;
5854
+ });
5855
+ /**
5826
5856
  * Maps a record into another record by applying a transformation function to each of its values.
5827
5857
  *
5828
5858
  * **Example** (Mapping record values)
@@ -5955,7 +5985,7 @@ const isSubrecordBy = (equivalence) => dual(2, (self, that) => {
5955
5985
  * @category instances
5956
5986
  * @since 4.0.0
5957
5987
  */
5958
- const makeEquivalence$2 = (equivalence) => {
5988
+ const makeEquivalence$3 = (equivalence) => {
5959
5989
  const is = isSubrecordBy(equivalence);
5960
5990
  return (self, that) => is(self, that) && is(that, self);
5961
5991
  };
@@ -6303,7 +6333,7 @@ function isOutOfBounds(i, as) {
6303
6333
  * @category getters
6304
6334
  * @since 2.0.0
6305
6335
  */
6306
- const get$9 = /*#__PURE__*/ dual(2, (self, index) => {
6336
+ const get$10 = /*#__PURE__*/ dual(2, (self, index) => {
6307
6337
  const i = Math.floor(index);
6308
6338
  return isOutOfBounds(i, self) ? none() : some$2(self[i]);
6309
6339
  });
@@ -6364,7 +6394,7 @@ const getUnsafe$1 = /*#__PURE__*/ dual(2, (self, index) => {
6364
6394
  * @category getters
6365
6395
  * @since 2.0.0
6366
6396
  */
6367
- const head = /*#__PURE__*/ get$9(0);
6397
+ const head = /*#__PURE__*/ get$10(0);
6368
6398
  /**
6369
6399
  * Returns the first element of a `NonEmptyReadonlyArray` directly (no `Option`
6370
6400
  * wrapper).
@@ -6576,7 +6606,7 @@ const sort = /*#__PURE__*/ dual(2, (self, O) => {
6576
6606
  * @category zipping
6577
6607
  * @since 2.0.0
6578
6608
  */
6579
- const zip = /*#__PURE__*/ dual(2, (self, that) => zipWith$2(self, that, make$67));
6609
+ const zip = /*#__PURE__*/ dual(2, (self, that) => zipWith$2(self, that, make$68));
6580
6610
  /**
6581
6611
  * Combines elements from two iterables pairwise using a function. If the
6582
6612
  * iterables differ in length, extra elements are discarded.
@@ -7232,7 +7262,7 @@ const some$1 = /*#__PURE__*/ dual(2, (self, predicate) => self.some(predicate));
7232
7262
  * @category instances
7233
7263
  * @since 4.0.0
7234
7264
  */
7235
- const makeEquivalence$1 = Array_;
7265
+ const makeEquivalence$2 = Array_;
7236
7266
  /**
7237
7267
  * Removes duplicates using `Equal.asEquivalence()`, preserving the order of the
7238
7268
  * first occurrence.
@@ -7300,7 +7330,7 @@ const bigintNanosPerDay = /*#__PURE__*/ BigInt(864e11);
7300
7330
  const bigintNanosPerWeek = /*#__PURE__*/ BigInt(6048e11);
7301
7331
  const roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
7302
7332
  const roundMillisToNanos = (millis) => Number.isInteger(millis) ? BigInt(millis) * bigint1e6 : roundTiesAwayFromZero(millis * 1e6);
7303
- const fromNanosNumber = (nanos) => make$66(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
7333
+ const fromNanosNumber = (nanos) => make$67(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
7304
7334
  const nanosToUnit = (nanos, divisor) => {
7305
7335
  const value = Number(nanos);
7306
7336
  if (Number.isFinite(value)) return value / divisor;
@@ -7323,9 +7353,9 @@ const divideTiesAwayFromZero = (numerator, denominator) => {
7323
7353
  };
7324
7354
  const fromMillisString = (input, scale) => {
7325
7355
  const millis = Number(input) * scale;
7326
- if (!Number.isFinite(millis)) return make$66(millis);
7356
+ if (!Number.isFinite(millis)) return make$67(millis);
7327
7357
  const nanos = parseNanos(input, BigInt(scale) * bigint1e6);
7328
- return make$66(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
7358
+ return make$67(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
7329
7359
  };
7330
7360
  const DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
7331
7361
  /**
@@ -7392,7 +7422,7 @@ const fromInputUnsafe$1 = (input) => {
7392
7422
  if (input[0] === -Infinity || input[1] === -Infinity) return negativeInfinity;
7393
7423
  if (input[0] === Infinity || input[1] === Infinity) return infinity;
7394
7424
  const nanos = input[0] * 1e9 + input[1];
7395
- return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$66(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
7425
+ return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$67(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
7396
7426
  }
7397
7427
  const obj = input;
7398
7428
  let millis = 0;
@@ -7403,13 +7433,13 @@ const fromInputUnsafe$1 = (input) => {
7403
7433
  if (obj.seconds) millis += obj.seconds * 1e3;
7404
7434
  if (obj.milliseconds) millis += obj.milliseconds;
7405
7435
  if (!obj.microseconds && !obj.nanoseconds) {
7406
- if (!Number.isFinite(millis)) return make$66(millis);
7436
+ if (!Number.isFinite(millis)) return make$67(millis);
7407
7437
  const exact = sumObjectNanos(obj);
7408
- return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$66(millis) : make$66(exact);
7438
+ return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$67(millis) : make$67(exact);
7409
7439
  }
7410
7440
  const nanos = millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0);
7411
7441
  const exact = Number.isFinite(nanos) ? sumObjectNanos(obj) : void 0;
7412
- return exact === void 0 ? fromNanosNumber(nanos) : make$66(exact);
7442
+ return exact === void 0 ? fromNanosNumber(nanos) : make$67(exact);
7413
7443
  }
7414
7444
  }
7415
7445
  return invalid$3(input);
@@ -7486,7 +7516,7 @@ const DurationProto = {
7486
7516
  return pipeArguments(this, arguments);
7487
7517
  }
7488
7518
  };
7489
- const make$66 = (input) => {
7519
+ const make$67 = (input) => {
7490
7520
  const duration = Object.create(DurationProto);
7491
7521
  if (typeof input === "number") {
7492
7522
  if (isNaN(input) || input === 0 || Object.is(input, -0)) duration.value = zeroDurationValue;
@@ -7609,8 +7639,8 @@ const abs = (self) => {
7609
7639
  switch (self.value._tag) {
7610
7640
  case "Infinity":
7611
7641
  case "NegativeInfinity": return infinity;
7612
- case "Millis": return self.value.millis < 0 ? make$66(-self.value.millis) : self;
7613
- case "Nanos": return self.value.nanos < bigint0$3 ? make$66(-self.value.nanos) : self;
7642
+ case "Millis": return self.value.millis < 0 ? make$67(-self.value.millis) : self;
7643
+ case "Nanos": return self.value.nanos < bigint0$3 ? make$67(-self.value.nanos) : self;
7614
7644
  }
7615
7645
  };
7616
7646
  /**
@@ -7628,7 +7658,7 @@ const abs = (self) => {
7628
7658
  * @category constructors
7629
7659
  * @since 2.0.0
7630
7660
  */
7631
- const zero$2 = /*#__PURE__*/ make$66(0);
7661
+ const zero$2 = /*#__PURE__*/ make$67(0);
7632
7662
  /**
7633
7663
  * A Duration representing infinite time.
7634
7664
  *
@@ -7644,7 +7674,7 @@ const zero$2 = /*#__PURE__*/ make$66(0);
7644
7674
  * @category constructors
7645
7675
  * @since 2.0.0
7646
7676
  */
7647
- const infinity = /*#__PURE__*/ make$66(Infinity);
7677
+ const infinity = /*#__PURE__*/ make$67(Infinity);
7648
7678
  /**
7649
7679
  * A Duration representing negative infinite time.
7650
7680
  *
@@ -7660,7 +7690,7 @@ const infinity = /*#__PURE__*/ make$66(Infinity);
7660
7690
  * @category constructors
7661
7691
  * @since 4.0.0
7662
7692
  */
7663
- const negativeInfinity = /*#__PURE__*/ make$66(-Infinity);
7693
+ const negativeInfinity = /*#__PURE__*/ make$67(-Infinity);
7664
7694
  /**
7665
7695
  * Creates a Duration from nanoseconds.
7666
7696
  *
@@ -7676,7 +7706,7 @@ const negativeInfinity = /*#__PURE__*/ make$66(-Infinity);
7676
7706
  * @category constructors
7677
7707
  * @since 2.0.0
7678
7708
  */
7679
- const nanos = (nanos) => make$66(nanos);
7709
+ const nanos = (nanos) => make$67(nanos);
7680
7710
  /**
7681
7711
  * Creates a Duration from milliseconds.
7682
7712
  *
@@ -7692,7 +7722,7 @@ const nanos = (nanos) => make$66(nanos);
7692
7722
  * @category constructors
7693
7723
  * @since 2.0.0
7694
7724
  */
7695
- const millis = (millis) => make$66(millis);
7725
+ const millis = (millis) => make$67(millis);
7696
7726
  /**
7697
7727
  * Creates a Duration from seconds.
7698
7728
  *
@@ -7708,7 +7738,7 @@ const millis = (millis) => make$66(millis);
7708
7738
  * @category constructors
7709
7739
  * @since 2.0.0
7710
7740
  */
7711
- const seconds = (seconds) => make$66(seconds * 1e3);
7741
+ const seconds = (seconds) => make$67(seconds * 1e3);
7712
7742
  /**
7713
7743
  * Converts a Duration to milliseconds.
7714
7744
  *
@@ -7875,7 +7905,7 @@ const matchPair = /*#__PURE__*/ dual(3, (self, that, options) => {
7875
7905
  * @category instances
7876
7906
  * @since 2.0.0
7877
7907
  */
7878
- const Order$2 = /*#__PURE__*/ make$69((self, that) => matchPair(self, that, {
7908
+ const Order$2 = /*#__PURE__*/ make$70((self, that) => matchPair(self, that, {
7879
7909
  onMillis: (self, that) => self < that ? -1 : self > that ? 1 : 0,
7880
7910
  onNanos: (self, that) => self < that ? -1 : self > that ? 1 : 0,
7881
7911
  onInfinity: (self, that) => {
@@ -7948,8 +7978,8 @@ const max = /*#__PURE__*/ max$1(Order$2);
7948
7978
  * @since 2.0.0
7949
7979
  */
7950
7980
  const sum = /*#__PURE__*/ dual(2, (self, that) => matchPair(self, that, {
7951
- onMillis: (self, that) => make$66(self + that),
7952
- onNanos: (self, that) => make$66(self + that),
7981
+ onMillis: (self, that) => make$67(self + that),
7982
+ onNanos: (self, that) => make$67(self + that),
7953
7983
  onInfinity: (self, that) => {
7954
7984
  const s = self.value._tag;
7955
7985
  const t = that.value._tag;
@@ -8773,7 +8803,7 @@ var ParentSpan = class extends (/*#__PURE__*/ Service$1()(ParentSpanKey, { fiber
8773
8803
  * @category constructors
8774
8804
  * @since 2.0.0
8775
8805
  */
8776
- const make$65 = (options) => options;
8806
+ const make$66 = (options) => options;
8777
8807
  /**
8778
8808
  * Creates an `ExternalSpan` from trace and span identifiers, defaulting
8779
8809
  * `sampled` to `true` and annotations to an empty context when they are not
@@ -8953,7 +8983,7 @@ const Tracer = /*#__PURE__*/ Reference(TracerKey, {
8953
8983
  * @category references
8954
8984
  * @since 4.0.0
8955
8985
  */
8956
- const nativeTracer = /*#__PURE__*/ make$65({ span: (options) => new NativeSpan(options) });
8986
+ const nativeTracer = /*#__PURE__*/ make$66({ span: (options) => new NativeSpan(options) });
8957
8987
  /**
8958
8988
  * Default in-memory `Span` implementation used by the native tracer. It
8959
8989
  * generates span and trace identifiers, stores attributes, events, and links,
@@ -9367,7 +9397,7 @@ var FiberImpl = class {
9367
9397
  return this._dispatcher ??= this.cache.scheduler.makeDispatcher();
9368
9398
  }
9369
9399
  getRef(ref) {
9370
- return get$10(this.context, ref);
9400
+ return get$11(this.context, ref);
9371
9401
  }
9372
9402
  addObserver(cb) {
9373
9403
  if (this._exit) {
@@ -9386,7 +9416,7 @@ var FiberImpl = class {
9386
9416
  interruptUnsafe(fiberId, annotations) {
9387
9417
  if (this._exit) return;
9388
9418
  let cause = causeInterrupt(fiberId);
9389
- if (this.cache.stackFrame) cause = causeAnnotate(cause, make$68(StackTraceKey, this.cache.stackFrame));
9419
+ if (this.cache.stackFrame) cause = causeAnnotate(cause, make$69(StackTraceKey, this.cache.stackFrame));
9390
9420
  if (annotations) cause = causeAnnotate(cause, annotations);
9391
9421
  this._interruptedCause = this._interruptedCause ? causeAddInterrupts(this._interruptedCause, cause) : cause;
9392
9422
  if (this.interruptible) {
@@ -9535,17 +9565,17 @@ var FiberImpl = class {
9535
9565
  const makeFiberContextCache = (context) => {
9536
9566
  const currentTracer = getOrUndefinedUnsafe(context, TracerKey);
9537
9567
  return {
9538
- scheduler: get$10(context, Scheduler),
9568
+ scheduler: get$11(context, Scheduler),
9539
9569
  tracer: currentTracer,
9540
9570
  tracerContext: currentTracer ? currentTracer["context"] : void 0,
9541
- tracerEnabled: get$10(context, TracerEnabled),
9571
+ tracerEnabled: get$11(context, TracerEnabled),
9542
9572
  span: getOrUndefinedUnsafe(context, ParentSpanKey),
9543
- logLevel: get$10(context, CurrentLogLevel),
9544
- minimumLogLevel: get$10(context, MinimumLogLevel$1),
9545
- stackFrame: get$10(context, CurrentStackFrame),
9573
+ logLevel: get$11(context, CurrentLogLevel),
9574
+ minimumLogLevel: get$11(context, MinimumLogLevel$1),
9575
+ stackFrame: get$11(context, CurrentStackFrame),
9546
9576
  runtimeMetrics: getOrUndefinedUnsafe(context, FiberRuntimeMetricsKey),
9547
- maxOpsBeforeYield: get$10(context, MaxOpsBeforeYield),
9548
- preventYield: get$10(context, PreventSchedulerYield)
9577
+ maxOpsBeforeYield: get$11(context, MaxOpsBeforeYield),
9578
+ preventYield: get$11(context, PreventSchedulerYield)
9549
9579
  };
9550
9580
  };
9551
9581
  const deferredInterruptCont = {
@@ -11051,11 +11081,11 @@ const NoopSpanProto = {
11051
11081
  const noopSpan = (options) => Object.assign(Object.create(NoopSpanProto), options);
11052
11082
  const filterDisablePropagation = (span) => {
11053
11083
  if (!span) return none();
11054
- return get$10(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some$2(span);
11084
+ return get$11(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some$2(span);
11055
11085
  };
11056
11086
  /** @internal */
11057
11087
  const makeSpanUnsafe = (fiber, name, options) => {
11058
- const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$10(options.annotations, DisablePropagation);
11088
+ const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$11(options.annotations, DisablePropagation);
11059
11089
  const parent = options?.parent !== void 0 ? some$2(options.parent) : options?.root ? none() : filterDisablePropagation(fiber.cache.span);
11060
11090
  let span;
11061
11091
  if (disablePropagation) span = noopSpan({
@@ -12951,7 +12981,7 @@ const Scope = scopeTag;
12951
12981
  * @category constructors
12952
12982
  * @since 2.0.0
12953
12983
  */
12954
- const make$64 = scopeMake;
12984
+ const make$65 = scopeMake;
12955
12985
  /**
12956
12986
  * Creates a new `Scope` synchronously without wrapping it in an `Effect`.
12957
12987
  * This is useful when you need a scope immediately but should be used with caution
@@ -13600,8 +13630,8 @@ const buildWithScope = /*#__PURE__*/ dual(2, (self, scope) => withFiber$1((fiber
13600
13630
  * @since 2.0.0
13601
13631
  */
13602
13632
  const succeed$6 = function() {
13603
- if (arguments.length === 1) return (resource) => succeedContext(make$68(arguments[0], resource));
13604
- return succeedContext(make$68(arguments[0], arguments[1]));
13633
+ if (arguments.length === 1) return (resource) => succeedContext(make$69(arguments[0], resource));
13634
+ return succeedContext(make$69(arguments[0], arguments[1]));
13605
13635
  };
13606
13636
  /**
13607
13637
  * Constructs a layer that provides all services in an already available
@@ -13713,8 +13743,8 @@ const empty$10 = /*#__PURE__*/ succeedContext(/*#__PURE__*/ empty$14());
13713
13743
  * @since 2.0.0
13714
13744
  */
13715
13745
  const sync$1 = function() {
13716
- if (arguments.length === 1) return (evaluate) => syncContext(() => make$68(arguments[0], evaluate()));
13717
- return syncContext(() => make$68(arguments[0], arguments[1]()));
13746
+ if (arguments.length === 1) return (evaluate) => syncContext(() => make$69(arguments[0], evaluate()));
13747
+ return syncContext(() => make$69(arguments[0], arguments[1]()));
13718
13748
  };
13719
13749
  /**
13720
13750
  * Constructs a layer lazily that provides all services in a `Context`.
@@ -13798,7 +13828,7 @@ const effect = function() {
13798
13828
  if (arguments.length === 1) return (effect) => effectImpl(arguments[0], effect);
13799
13829
  return effectImpl(arguments[0], arguments[1]);
13800
13830
  };
13801
- const effectImpl = (service, effect) => effectContext(map$8(effect, (value) => make$68(service, value)));
13831
+ const effectImpl = (service, effect) => effectContext(map$8(effect, (value) => make$69(service, value)));
13802
13832
  /**
13803
13833
  * Constructs a layer from an effect that produces all services in a `Context`.
13804
13834
  *
@@ -13906,7 +13936,7 @@ const unwrapKey = /*#__PURE__*/ Service$1("effect/Layer/unwrap");
13906
13936
  * @category converting
13907
13937
  * @since 4.0.0
13908
13938
  */
13909
- const unwrap$8 = (self) => flatMap$4(effect(unwrapKey)(self), get$10(unwrapKey));
13939
+ const unwrap$8 = (self) => flatMap$4(effect(unwrapKey)(self), get$11(unwrapKey));
13910
13940
  const mergeAllEffect = (layers, memoMap, scope) => {
13911
13941
  const parentScope = forkUnsafe(scope, "parallel");
13912
13942
  return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$8((context) => mergeAll$2(...context)));
@@ -14676,7 +14706,7 @@ const makeZonedUnsafe$1 = (input, options) => {
14676
14706
  return makeZonedFromAdjusted(self.epochMilliseconds, zone, options?.disambiguation ?? "compatible");
14677
14707
  };
14678
14708
  /** @internal */
14679
- const make$63 = /*#__PURE__*/ liftThrowable(makeUnsafe$6);
14709
+ const make$64 = /*#__PURE__*/ liftThrowable(makeUnsafe$6);
14680
14710
  const validZoneCache = /*#__PURE__*/ new Map();
14681
14711
  const formatOptions = {
14682
14712
  day: "numeric",
@@ -20914,7 +20944,7 @@ const Empty$2 = /*#__PURE__*/ Symbol.for("effect/MutableList/Empty");
20914
20944
  * @category constructors
20915
20945
  * @since 2.0.0
20916
20946
  */
20917
- const make$62 = () => ({
20947
+ const make$63 = () => ({
20918
20948
  head: void 0,
20919
20949
  tail: void 0,
20920
20950
  length: 0
@@ -21289,12 +21319,12 @@ const QueueProto = {
21289
21319
  * @category constructors
21290
21320
  * @since 4.0.0
21291
21321
  */
21292
- const make$61 = (options) => withFiber$1((fiber) => {
21322
+ const make$62 = (options) => withFiber$1((fiber) => {
21293
21323
  const self = Object.create(QueueProto);
21294
21324
  self.dispatcher = fiber.currentDispatcher;
21295
21325
  self.capacity = options?.capacity ?? Number.POSITIVE_INFINITY;
21296
21326
  self.strategy = options?.strategy ?? "suspend";
21297
- self.messages = make$62();
21327
+ self.messages = make$63();
21298
21328
  self.scheduleRunning = false;
21299
21329
  self.state = {
21300
21330
  _tag: "Open",
@@ -21335,7 +21365,7 @@ const make$61 = (options) => withFiber$1((fiber) => {
21335
21365
  * @category constructors
21336
21366
  * @since 2.0.0
21337
21367
  */
21338
- const bounded = (capacity) => make$61({ capacity });
21368
+ const bounded = (capacity) => make$62({ capacity });
21339
21369
  /**
21340
21370
  * Creates a bounded queue with sliding strategy. When the queue reaches capacity,
21341
21371
  * new elements are added and the oldest elements are dropped.
@@ -21372,7 +21402,7 @@ const bounded = (capacity) => make$61({ capacity });
21372
21402
  * @category constructors
21373
21403
  * @since 2.0.0
21374
21404
  */
21375
- const sliding = (capacity) => make$61({
21405
+ const sliding = (capacity) => make$62({
21376
21406
  capacity,
21377
21407
  strategy: "sliding"
21378
21408
  });
@@ -22402,7 +22432,7 @@ const makeUuid = (bytes, randomBytes, format) => {
22402
22432
  * @category constructors
22403
22433
  * @since 4.0.0
22404
22434
  */
22405
- const make$60 = (randomBytes) => {
22435
+ const make$61 = (randomBytes) => {
22406
22436
  const randomBytesChecked = (size) => {
22407
22437
  checkSize(size);
22408
22438
  return randomBytes(size);
@@ -22448,7 +22478,7 @@ const fillRandom = (crypto, size) => {
22448
22478
  * @category layers
22449
22479
  * @since 4.0.0
22450
22480
  */
22451
- const layerWebCrypto$7 = /*#__PURE__*/ effect(SecureRandom, /*#__PURE__*/ WebCrypto.use((crypto) => succeed$5(make$60((size) => fillRandom(crypto, size)))));
22481
+ const layerWebCrypto$7 = /*#__PURE__*/ effect(SecureRandom, /*#__PURE__*/ WebCrypto.use((crypto) => succeed$5(make$61((size) => fillRandom(crypto, size)))));
22452
22482
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Random.js
22453
22483
  /**
22454
22484
  * Represents a service for generating pseudo-random numbers.
@@ -22700,7 +22730,7 @@ var SemaphoreImpl = class {
22700
22730
  * @category constructors
22701
22731
  * @since 4.0.0
22702
22732
  */
22703
- const make$59 = (permits) => sync$2(() => new SemaphoreImpl(permits));
22733
+ const make$60 = (permits) => sync$2(() => new SemaphoreImpl(permits));
22704
22734
  /**
22705
22735
  * Runs an effect with a single permit and releases the permit when the effect
22706
22736
  * completes.
@@ -22820,7 +22850,7 @@ const isBigDecimal = (u) => hasProperty(u, TypeId$52);
22820
22850
  * @category constructors
22821
22851
  * @since 2.0.0
22822
22852
  */
22823
- const make$58 = (value, scale) => {
22853
+ const make$59 = (value, scale) => {
22824
22854
  if (!Number.isSafeInteger(scale)) throw new RangeError(`Scale must be a safe integer, got ${scale}`);
22825
22855
  const o = Object.create(BigDecimalProto);
22826
22856
  o.value = value;
@@ -22828,7 +22858,7 @@ const make$58 = (value, scale) => {
22828
22858
  return o;
22829
22859
  };
22830
22860
  const makeNormalized = (value, scale) => {
22831
- const o = make$58(value, scale);
22861
+ const o = make$59(value, scale);
22832
22862
  o.normalized = o;
22833
22863
  return o;
22834
22864
  };
@@ -23262,7 +23292,7 @@ const binaryUnits = [
23262
23292
  const allUnits = [...decimalUnits, .../*#__PURE__*/ binaryUnits.slice(1)];
23263
23293
  const unitsByName = /*#__PURE__*/ new Map(/*#__PURE__*/ allUnits.flatMap((unit) => unit.names.map((name) => [name, unit])));
23264
23294
  const unitsBySymbol = /*#__PURE__*/ new Map(/*#__PURE__*/ allUnits.map((unit) => [unit.symbol, unit]));
23265
- const make$57 = (value) => value;
23295
+ const make$58 = (value) => value;
23266
23296
  /**
23267
23297
  * The byte size containing zero bytes.
23268
23298
  *
@@ -23270,13 +23300,13 @@ const make$57 = (value) => value;
23270
23300
  * @category constants
23271
23301
  * @since 4.0.0
23272
23302
  */
23273
- const zero = /*#__PURE__*/ make$57(bigint0);
23303
+ const zero = /*#__PURE__*/ make$58(bigint0);
23274
23304
  const invalid$2 = (message) => {
23275
23305
  throw new Error(`Invalid ByteSize: ${message}`);
23276
23306
  };
23277
23307
  const fromNumber = (input) => {
23278
23308
  if (!Number.isSafeInteger(input) || input < 0) return invalid$2(`expected a non-negative safe integer, received ${input}`);
23279
- return make$57(BigInt(input));
23309
+ return make$58(BigInt(input));
23280
23310
  };
23281
23311
  const maxSafeInteger = /*#__PURE__*/ BigInt(Number.MAX_SAFE_INTEGER);
23282
23312
  const scaleDecimal = (quantity, factor) => {
@@ -23292,14 +23322,14 @@ const scaleDecimal = (quantity, factor) => {
23292
23322
  const fromQuantity = (quantity, unit) => {
23293
23323
  if (typeof quantity === "bigint") {
23294
23324
  if (quantity < bigint0) return invalid$2(`expected a non-negative quantity, received ${quantity}`);
23295
- return make$57(quantity * unit.factor);
23325
+ return make$58(quantity * unit.factor);
23296
23326
  }
23297
23327
  if (binaryUnits.includes(unit)) {
23298
23328
  const value = quantity * Number(unit.factor);
23299
- if (Number.isSafeInteger(value) && value >= 0) return make$57(BigInt(value));
23329
+ if (Number.isSafeInteger(value) && value >= 0) return make$58(BigInt(value));
23300
23330
  } else {
23301
23331
  const value = scaleDecimal(String(quantity), unit.factor);
23302
- if (value !== void 0 && value <= maxSafeInteger) return make$57(value);
23332
+ if (value !== void 0 && value <= maxSafeInteger) return make$58(value);
23303
23333
  }
23304
23334
  return invalid$2(`expected an exact non-negative safe-integer byte result, received ${quantity} ${unit.symbol}`);
23305
23335
  };
@@ -23325,7 +23355,7 @@ const fromStringUnsafe = (input) => {
23325
23355
  if (unit === void 0) return invalid$2(`unsupported unit ${JSON.stringify(match[2])}`);
23326
23356
  const value = scaleDecimal(match[1], unit.factor);
23327
23357
  if (value === void 0) return invalid$2(`${JSON.stringify(input)} does not represent an integral number of bytes`);
23328
- return make$57(value);
23358
+ return make$58(value);
23329
23359
  };
23330
23360
  /**
23331
23361
  * Decodes a trusted input into a byte size and throws for invalid input.
@@ -23338,7 +23368,7 @@ const fromInputUnsafe = (input) => {
23338
23368
  switch (typeof input) {
23339
23369
  case "bigint":
23340
23370
  if (input < bigint0) return invalid$2(`expected a non-negative bigint, received ${input}`);
23341
- return make$57(input);
23371
+ return make$58(input);
23342
23372
  case "number": return fromNumber(input);
23343
23373
  case "string": return fromStringUnsafe(input);
23344
23374
  }
@@ -23398,14 +23428,14 @@ const emptyArray = [];
23398
23428
  * @category instances
23399
23429
  * @since 4.0.0
23400
23430
  */
23401
- const makeEquivalence = (isEquivalent) => make$70((self, that) => {
23431
+ const makeEquivalence$1 = (isEquivalent) => make$71((self, that) => {
23402
23432
  if (self.length !== that.length) return false;
23403
23433
  const as = toReadonlyArray(self);
23404
23434
  const bs = toReadonlyArray(that);
23405
23435
  for (let i = 0; i < as.length; i++) if (!isEquivalent(as[i], bs[i])) return false;
23406
23436
  return true;
23407
23437
  });
23408
- const _equivalence = /*#__PURE__*/ makeEquivalence(equals$1);
23438
+ const _equivalence = /*#__PURE__*/ makeEquivalence$1(equals$1);
23409
23439
  const ChunkProto = {
23410
23440
  [TypeId$51]: { _A: (_) => _ },
23411
23441
  toString() {
@@ -24572,7 +24602,7 @@ const redactedProto = (typeId, label) => ({
24572
24602
  * Builds a key. Keys compare by reference: comparing key bytes is not constant
24573
24603
  * time, and structural equality would let secret keys act as `HashMap` keys.
24574
24604
  */
24575
- const make$56 = (proto, algorithm, material) => byReferenceUnsafe(Object.create(proto, {
24605
+ const make$57 = (proto, algorithm, material) => byReferenceUnsafe(Object.create(proto, {
24576
24606
  algorithm: {
24577
24607
  value: algorithm,
24578
24608
  enumerable: true
@@ -24580,7 +24610,7 @@ const make$56 = (proto, algorithm, material) => byReferenceUnsafe(Object.create(
24580
24610
  [MaterialId]: { value: material }
24581
24611
  }));
24582
24612
  /** @internal */
24583
- const makeBytes = (proto, algorithm, bytes) => make$56(proto, algorithm, {
24613
+ const makeBytes = (proto, algorithm, bytes) => make$57(proto, algorithm, {
24584
24614
  _tag: "Bytes",
24585
24615
  bytes
24586
24616
  });
@@ -24643,7 +24673,7 @@ const importedAlgorithm = (algorithm, cryptoKey) => {
24643
24673
  */
24644
24674
  const fromCryptoKey$3 = (module, method, proto, algorithm, cryptoKey, expected) => suspend$2(() => {
24645
24675
  const problem = checkCryptoKey(cryptoKey, expected);
24646
- return problem === void 0 ? succeed$5(make$56(proto, importedAlgorithm(algorithm, cryptoKey), {
24676
+ return problem === void 0 ? succeed$5(make$57(proto, importedAlgorithm(algorithm, cryptoKey), {
24647
24677
  _tag: "CryptoKey",
24648
24678
  cryptoKey
24649
24679
  })) : invalidKey(module, method, problem);
@@ -26681,7 +26711,7 @@ const makeZonedUnsafe = makeZonedUnsafe$1;
26681
26711
  * @category constructors
26682
26712
  * @since 3.6.0
26683
26713
  */
26684
- const make$55 = make$63;
26714
+ const make$56 = make$64;
26685
26715
  /**
26686
26716
  * Gets the milliseconds since the Unix epoch of a `DateTime`.
26687
26717
  *
@@ -27192,7 +27222,7 @@ var HashMapImpl = class {
27192
27222
  const thatImpl = that;
27193
27223
  if (this.size !== thatImpl.size) return false;
27194
27224
  for (const [key, value] of this) {
27195
- const otherValue = pipe(that, get$8(key));
27225
+ const otherValue = pipe(that, get$9(key));
27196
27226
  if (isNone(otherValue) || !equals$1(value, otherValue.value)) return false;
27197
27227
  }
27198
27228
  return true;
@@ -27238,7 +27268,7 @@ const fromIterable$5 = (entries) => {
27238
27268
  return new HashMapImpl(false, 0, root, size);
27239
27269
  };
27240
27270
  /** @internal */
27241
- const get$8 = /*#__PURE__*/ dual(2, (self, key) => {
27271
+ const get$9 = /*#__PURE__*/ dual(2, (self, key) => {
27242
27272
  return self._root.get(0, hash(key), key);
27243
27273
  });
27244
27274
  /** @internal */
@@ -27259,7 +27289,7 @@ const setHash$1 = (self, key, hash, value) => {
27259
27289
  return new HashMapImpl(false, impl._edit, newRoot, impl._size + (added.value ? 1 : 0));
27260
27290
  };
27261
27291
  /** @internal */
27262
- const set$2 = /*#__PURE__*/ dual(3, (self, key, value) => {
27292
+ const set$3 = /*#__PURE__*/ dual(3, (self, key, value) => {
27263
27293
  return setHash$1(self, key, hash(key), value);
27264
27294
  });
27265
27295
  /** @internal */
@@ -27341,7 +27371,7 @@ const fromIterable$4 = fromIterable$5;
27341
27371
  * @category getters
27342
27372
  * @since 2.0.0
27343
27373
  */
27344
- const get$7 = get$8;
27374
+ const get$8 = get$9;
27345
27375
  /**
27346
27376
  * Returns an `IterableIterator` of the values within the `HashMap`.
27347
27377
  *
@@ -27405,7 +27435,7 @@ const keyMap = (self) => self.keyMap;
27405
27435
  /** @internal */
27406
27436
  const fromIterable$3 = (values) => {
27407
27437
  let map = empty$9();
27408
- for (const value of values) map = set$2(map, value, true);
27438
+ for (const value of values) map = set$3(map, value, true);
27409
27439
  return makeImpl(map);
27410
27440
  };
27411
27441
  /** @internal */
@@ -27930,7 +27960,7 @@ const isRedacted = (u) => hasProperty(u, TypeId$45);
27930
27960
  * @category constructors
27931
27961
  * @since 3.3.0
27932
27962
  */
27933
- const make$54 = (value, options) => {
27963
+ const make$55 = (value, options) => {
27934
27964
  const self = Object.create(Proto$17);
27935
27965
  if (options?.label) self.label = options.label;
27936
27966
  redactedRegistry.set(self, value);
@@ -27976,6 +28006,36 @@ const Proto$17 = {
27976
28006
  * @since 3.3.0
27977
28007
  */
27978
28008
  const value = value$1;
28009
+ /**
28010
+ * Generates an equivalence relation for `Redacted<A>` values based on an
28011
+ * equivalence relation for the underlying values `A`. This function is useful
28012
+ * for comparing `Redacted` instances without exposing their contents.
28013
+ *
28014
+ * **When to use**
28015
+ *
28016
+ * Use when you need to compare wrapped secrets through an approved equality
28017
+ * rule without exposing the underlying values at each comparison site.
28018
+ *
28019
+ * **Example** (Comparing redacted values)
28020
+ *
28021
+ * ```ts import.meta.vitest
28022
+ * import { Equivalence, Redacted } from "effect"
28023
+ *
28024
+ * const API_KEY1 = Redacted.make("1234567890")
28025
+ * const API_KEY2 = Redacted.make("1-34567890")
28026
+ * const API_KEY3 = Redacted.make("1234567890")
28027
+ *
28028
+ * const equivalence = Redacted.makeEquivalence(Equivalence.strictEqual<string>())
28029
+ *
28030
+ * equivalence(API_KEY1, API_KEY2) // => false
28031
+ * equivalence(API_KEY1, API_KEY3) // => true
28032
+ * ```
28033
+ *
28034
+ * @stability stable
28035
+ * @category instances
28036
+ * @since 4.0.0
28037
+ */
28038
+ const makeEquivalence = (isEquivalent) => make$71((x, y) => isEquivalent(value(x), value(y)));
27979
28039
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/Headers.js
27980
28040
  /**
27981
28041
  * Models HTTP headers for the unstable HTTP client and server modules.
@@ -28004,7 +28064,7 @@ const TypeId$44 = /*#__PURE__*/ Symbol.for("~effect/http/Headers");
28004
28064
  const Proto$16 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.create(null), {
28005
28065
  [TypeId$44]: { value: TypeId$44 },
28006
28066
  [symbolRedactable]: { value(context) {
28007
- return redact$1(this, get$10(context, CurrentRedactedNames$1));
28067
+ return redact$1(this, get$11(context, CurrentRedactedNames$1));
28008
28068
  } },
28009
28069
  toJSON: { value() {
28010
28070
  return redact$2(this);
@@ -28018,7 +28078,7 @@ const Proto$16 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.crea
28018
28078
  toString: { value: BaseProto.toString },
28019
28079
  [NodeInspectSymbol]: { value: BaseProto[NodeInspectSymbol] }
28020
28080
  });
28021
- const make$53 = (input) => Object.assign(Object.create(Proto$16), input);
28081
+ const make$54 = (input) => Object.assign(Object.create(Proto$16), input);
28022
28082
  /**
28023
28083
  * Provides an `Equivalence` instance that compares `Headers` by header names
28024
28084
  * and string values.
@@ -28027,7 +28087,7 @@ const make$53 = (input) => Object.assign(Object.create(Proto$16), input);
28027
28087
  * @category instances
28028
28088
  * @since 4.0.0
28029
28089
  */
28030
- const Equivalence$2 = /*#__PURE__*/ makeEquivalence$2(/*#__PURE__*/ strictEqual());
28090
+ const Equivalence$2 = /*#__PURE__*/ makeEquivalence$3(/*#__PURE__*/ strictEqual());
28031
28091
  /**
28032
28092
  * An empty `Headers` collection.
28033
28093
  *
@@ -28082,7 +28142,7 @@ const fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto$16);
28082
28142
  * @category combinators
28083
28143
  * @since 4.0.0
28084
28144
  */
28085
- const get$6 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLowerCase()]));
28145
+ const get$7 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLowerCase()]));
28086
28146
  /**
28087
28147
  * Returns a new `Headers` collection with the given header set.
28088
28148
  *
@@ -28094,8 +28154,8 @@ const get$6 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLo
28094
28154
  * @category combinators
28095
28155
  * @since 4.0.0
28096
28156
  */
28097
- const set$1 = /*#__PURE__*/ dual(3, (self, key, value) => {
28098
- const out = make$53(self);
28157
+ const set$2 = /*#__PURE__*/ dual(3, (self, key, value) => {
28158
+ const out = make$54(self);
28099
28159
  out[key.toLowerCase()] = value;
28100
28160
  return out;
28101
28161
  });
@@ -28110,7 +28170,7 @@ const set$1 = /*#__PURE__*/ dual(3, (self, key, value) => {
28110
28170
  * @category combinators
28111
28171
  * @since 4.0.0
28112
28172
  */
28113
- const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$53({
28173
+ const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$54({
28114
28174
  ...self,
28115
28175
  ...fromInput$1(headers)
28116
28176
  }));
@@ -28126,7 +28186,7 @@ const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$53({
28126
28186
  * @since 4.0.0
28127
28187
  */
28128
28188
  const merge$3 = /*#__PURE__*/ dual(2, (self, headers) => {
28129
- const out = make$53(self);
28189
+ const out = make$54(self);
28130
28190
  Object.assign(out, headers);
28131
28191
  return out;
28132
28192
  });
@@ -28142,7 +28202,7 @@ const merge$3 = /*#__PURE__*/ dual(2, (self, headers) => {
28142
28202
  * @since 4.0.0
28143
28203
  */
28144
28204
  const remove$2 = /*#__PURE__*/ dual(2, (self, key) => {
28145
- const out = make$53(self);
28205
+ const out = make$54(self);
28146
28206
  delete out[key.toLowerCase()];
28147
28207
  return out;
28148
28208
  });
@@ -28162,8 +28222,8 @@ const redact$1 = /*#__PURE__*/ dual(2, (self, key) => {
28162
28222
  const modify = (key) => {
28163
28223
  if (typeof key === "string") {
28164
28224
  const k = key.toLowerCase();
28165
- if (k in self) out[k] = make$54(self[k]);
28166
- } else for (const name in self) if (name.search(key) !== -1) out[name] = make$54(self[name]);
28225
+ if (k in self) out[k] = make$55(self[k]);
28226
+ } else for (const name in self) if (name.search(key) !== -1) out[name] = make$55(self[name]);
28167
28227
  };
28168
28228
  if (Array.isArray(key)) for (let i = 0; i < key.length; i++) modify(key[i]);
28169
28229
  else modify(key);
@@ -28439,7 +28499,7 @@ const Proto$15 = {
28439
28499
  [symbolRedactable](context) {
28440
28500
  return {
28441
28501
  _id: "UrlParams",
28442
- params: Object.fromEntries(redact(this, get$10(context, CurrentRedactedNames)))
28502
+ params: Object.fromEntries(redact(this, get$11(context, CurrentRedactedNames)))
28443
28503
  };
28444
28504
  },
28445
28505
  toJSON() {
@@ -28463,7 +28523,7 @@ const Proto$15 = {
28463
28523
  * @category constructors
28464
28524
  * @since 4.0.0
28465
28525
  */
28466
- const make$52 = (params) => {
28526
+ const make$53 = (params) => {
28467
28527
  const self = Object.create(Proto$15);
28468
28528
  self.params = params;
28469
28529
  return self;
@@ -28489,7 +28549,7 @@ const fromInput = (input) => {
28489
28549
  const [keys, value] = parsed[i];
28490
28550
  out.push([`${keys[0]}[${keys.slice(1).join("][")}]`, value]);
28491
28551
  } else out.push(parsed[i]);
28492
- return make$52(out);
28552
+ return make$53(out);
28493
28553
  };
28494
28554
  const fromInputNested = (input) => {
28495
28555
  const entries = typeof input[Symbol.iterator] === "function" ? fromIterable$6(input) : Object.entries(input);
@@ -28515,8 +28575,8 @@ const coerce = (value) => isRedacted(value) ? value : String(value);
28515
28575
  * @category instances
28516
28576
  * @since 4.0.0
28517
28577
  */
28518
- const Equivalence$1 = /*#__PURE__*/ make$70((a, b) => arrayEquivalence(a.params, b.params));
28519
- const arrayEquivalence = /*#__PURE__*/ makeEquivalence$1(/*#__PURE__*/ makeEquivalence$3([/*#__PURE__*/ strictEqual(), /*#__PURE__*/ asEquivalence()]));
28578
+ const Equivalence$1 = /*#__PURE__*/ make$71((a, b) => arrayEquivalence(a.params, b.params));
28579
+ const arrayEquivalence = /*#__PURE__*/ makeEquivalence$2(/*#__PURE__*/ makeEquivalence$4([/*#__PURE__*/ strictEqual(), /*#__PURE__*/ asEquivalence()]));
28520
28580
  /**
28521
28581
  * An empty `UrlParams` value.
28522
28582
  *
@@ -28524,7 +28584,7 @@ const arrayEquivalence = /*#__PURE__*/ makeEquivalence$1(/*#__PURE__*/ makeEquiv
28524
28584
  * @category constructors
28525
28585
  * @since 4.0.0
28526
28586
  */
28527
- const empty$6 = /*#__PURE__*/ make$52([]);
28587
+ const empty$6 = /*#__PURE__*/ make$53([]);
28528
28588
  /**
28529
28589
  * Sets multiple query parameters from input.
28530
28590
  *
@@ -28545,7 +28605,7 @@ const setAll = /*#__PURE__*/ dual(2, (self, input) => {
28545
28605
  if (keys.has(self.params[i][0])) continue;
28546
28606
  params.push(self.params[i]);
28547
28607
  }
28548
- return make$52(params);
28608
+ return make$53(params);
28549
28609
  });
28550
28610
  /**
28551
28611
  * Returns the parameter pairs with selected values wrapped in `Redacted`.
@@ -28561,7 +28621,7 @@ const setAll = /*#__PURE__*/ dual(2, (self, input) => {
28561
28621
  */
28562
28622
  const redact = /*#__PURE__*/ dual(2, (self, key) => {
28563
28623
  const patterns = Array.isArray(key) ? key : [key];
28564
- return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$54(value) : value]);
28624
+ return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$55(value) : value]);
28565
28625
  });
28566
28626
  /**
28567
28627
  * Checks whether a parameter name matches one of the redaction patterns.
@@ -28640,7 +28700,7 @@ const decodeQueryKey = (key) => {
28640
28700
  return key;
28641
28701
  }
28642
28702
  };
28643
- const currentRedactedNames = () => get$10(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$14(), CurrentRedactedNames);
28703
+ const currentRedactedNames = () => get$11(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$14(), CurrentRedactedNames);
28644
28704
  /**
28645
28705
  * Query parameter names or patterns to redact in inspection, spans and errors.
28646
28706
  *
@@ -28950,6 +29010,24 @@ function makeCompositeAtKey(compositeAst, pointerKey, pointerIssue, compositeInp
28950
29010
  return new Composite(compositeAst, [new Pointer([pointerKey], pointerIssue)], compositeInput, parseOptions);
28951
29011
  }
28952
29012
  /**
29013
+ * Constructs a schema issue for a forbidden parsing operation.
29014
+ *
29015
+ * @stability stable
29016
+ * @category constructors
29017
+ * @since 4.0.0
29018
+ */
29019
+ const Forbidden = class extends IssueNodeImpl {
29020
+ _tag = "Forbidden";
29021
+ /**
29022
+ * The metadata for the issue.
29023
+ */
29024
+ annotations;
29025
+ constructor(annotations, input, options) {
29026
+ super(input, options);
29027
+ this.annotations = annotations;
29028
+ }
29029
+ };
29030
+ /**
28953
29031
  * Constructs a schema issue for a value that matches no union member.
28954
29032
  *
28955
29033
  * @stability stable
@@ -29277,6 +29355,84 @@ const compose = /*#__PURE__*/ dual(2, (self, other) => {
29277
29355
  case "TransformOptionalEffect": return composeOptionalEffect(self, other);
29278
29356
  }
29279
29357
  });
29358
+ /**
29359
+ * Creates a getter that always fails with the given issue.
29360
+ *
29361
+ * **When to use**
29362
+ *
29363
+ * Use when you need a schema getter that unconditionally rejects input.
29364
+ * - Building custom validation getters that produce specific error types.
29365
+ *
29366
+ * **Details**
29367
+ *
29368
+ * - Always fails with the `Issue` returned by `f`.
29369
+ * - The failure function receives the original `Option<E>` input and the
29370
+ * effective `ParseOptions` for error context.
29371
+ *
29372
+ * **Example** (Defining an always-failing getter)
29373
+ *
29374
+ * ```ts import.meta.vitest
29375
+ * import { Effect, Option, SchemaGetter, SchemaIssue } from "effect"
29376
+ *
29377
+ * const rejectAll = SchemaGetter.fail<string, string>(
29378
+ * () => new SchemaIssue.InvalidValue({ message: "not allowed" })
29379
+ * )
29380
+ * const issue = await Effect.runPromise(
29381
+ * Effect.flip(SchemaGetter.run(rejectAll, Option.some("x"), {}))
29382
+ * )
29383
+ * issue._tag // => "InvalidValue"
29384
+ * ```
29385
+ *
29386
+ * @see {@link forbidden} for a convenience helper for `Forbidden` issues
29387
+ * @see {@link checkEffect} to fail conditionally based on input value
29388
+ *
29389
+ * @stability stable
29390
+ * @category constructors
29391
+ * @since 4.0.0
29392
+ */
29393
+ function fail$2(f) {
29394
+ return transformOptionalEffect((oe, options) => fail$6(f(oe, options)));
29395
+ }
29396
+ /**
29397
+ * Creates a getter that always fails with a `Forbidden` issue.
29398
+ *
29399
+ * **When to use**
29400
+ *
29401
+ * Use when you need a schema getter to disallow a field or direction
29402
+ * (encode/decode) entirely.
29403
+ * - You want a clear "forbidden" error message in schema validation output.
29404
+ *
29405
+ * **Details**
29406
+ *
29407
+ * - Always fails with `SchemaIssue.Forbidden`.
29408
+ * - The message function receives the `Option<E>` input for context.
29409
+ *
29410
+ * **Example** (Forbidding a decode direction)
29411
+ *
29412
+ * ```ts import.meta.vitest
29413
+ * import { Effect, Option, SchemaGetter } from "effect"
29414
+ *
29415
+ * const noEncode = SchemaGetter.forbidden<string, number>(
29416
+ * () => "encoding is not supported"
29417
+ * )
29418
+ * const issue = await Effect.runPromise(
29419
+ * Effect.flip(SchemaGetter.run(noEncode, Option.some(1), {}))
29420
+ * )
29421
+ * issue._tag // => "Forbidden"
29422
+ * ```
29423
+ *
29424
+ * @see {@link fail} to fail with a custom issue type
29425
+ *
29426
+ * @stability stable
29427
+ * @category constructors
29428
+ * @since 4.0.0
29429
+ */
29430
+ function forbidden(message) {
29431
+ return fail$2((oe, options) => {
29432
+ const annotations = { message: message(oe) };
29433
+ return isSome(oe) ? new Forbidden(annotations, oe.value, options) : new Forbidden(annotations);
29434
+ });
29435
+ }
29280
29436
  const passthrough_$1 = /*#__PURE__*/ makeGetter({ _tag: "Passthrough" });
29281
29437
  function passthrough$1() {
29282
29438
  return passthrough_$1;
@@ -32120,13 +32276,13 @@ function canPreserveEncodingChecks(ast) {
32120
32276
  * @category transforming
32121
32277
  * @since 4.0.0
32122
32278
  */
32123
- const toType = /*#__PURE__*/ memoizeIdempotent((ast) => {
32279
+ const toType$1 = /*#__PURE__*/ memoizeIdempotent((ast) => {
32124
32280
  const owner = getContextOwner(ast);
32125
32281
  if (owner !== ast) {
32126
- const type = toType(owner);
32282
+ const type = toType$1(owner);
32127
32283
  return type === owner && ast.encoding === void 0 ? ast : replaceContext(type, ast.context);
32128
32284
  }
32129
- const type = "recur" in ast ? ast.recur(toType) : ast;
32285
+ const type = "recur" in ast ? ast.recur(toType$1) : ast;
32130
32286
  if ("encodingChecks" in type && type.encodingChecks) {
32131
32287
  const checks = canPreserveEncodingChecks(ast) ? type.encodingChecks : isArrays(type) || isObjects(type) || isDeclaration(type) && type.typeParameters.length > 0 ? extractStructuralChecks(type.encodingChecks) : void 0;
32132
32288
  return copy$1(type, {
@@ -32164,7 +32320,7 @@ const toType = /*#__PURE__*/ memoizeIdempotent((ast) => {
32164
32320
  * @since 4.0.0
32165
32321
  */
32166
32322
  const toEncoded = /*#__PURE__*/ memoizeIdempotent((ast) => {
32167
- return toType(flip(ast));
32323
+ return toType$1(flip(ast));
32168
32324
  });
32169
32325
  function flipEncoding(ast, encoding) {
32170
32326
  const links = encoding;
@@ -32634,7 +32790,7 @@ function makeEffect(schema) {
32634
32790
  const ast = schema.ast;
32635
32791
  let parser;
32636
32792
  return (input, options) => {
32637
- return (parser ??= runWithCompiler(constructorCompiler, toType(ast)))(input, options?.disableChecks ? options?.parseOptions ? {
32793
+ return (parser ??= runWithCompiler(constructorCompiler, toType$1(ast)))(input, options?.disableChecks ? options?.parseOptions ? {
32638
32794
  ...options.parseOptions,
32639
32795
  disableChecks: true
32640
32796
  } : { disableChecks: true } : options?.parseOptions);
@@ -32694,8 +32850,8 @@ function makeOption(schema) {
32694
32850
  * @category constructors
32695
32851
  * @since 4.0.0
32696
32852
  */
32697
- function make$51(schema) {
32698
- return makeConstructorSync(toType(schema.ast));
32853
+ function make$52(schema) {
32854
+ return makeConstructorSync(toType$1(schema.ast));
32699
32855
  }
32700
32856
  /**
32701
32857
  * Creates a type guard that checks whether an input satisfies the schema's decoded
@@ -32737,7 +32893,7 @@ function makeIs(ast) {
32737
32893
  }
32738
32894
  /** @internal */
32739
32895
  function _is(ast) {
32740
- const typeAST = toType(ast);
32896
+ const typeAST = toType$1(ast);
32741
32897
  let guard = (input) => {
32742
32898
  guard = makeIs(typeAST);
32743
32899
  return guard(input);
@@ -32888,7 +33044,7 @@ const RebuildOptions = /*#__PURE__*/ Symbol();
32888
33044
  const SchemaProto = {
32889
33045
  [TypeId$39]: TypeId$39,
32890
33046
  get make() {
32891
- const value = make$51(this);
33047
+ const value = make$52(this);
32892
33048
  Object.defineProperty(this, "make", {
32893
33049
  value,
32894
33050
  enumerable: true
@@ -32924,11 +33080,11 @@ const SchemaProto = {
32924
33080
  return this.rebuild(appendChecks(this.ast, checks));
32925
33081
  },
32926
33082
  rebuild(ast) {
32927
- return make$50(ast, this[RebuildOptions]);
33083
+ return make$51(ast, this[RebuildOptions]);
32928
33084
  }
32929
33085
  };
32930
33086
  /** @internal */
32931
- function make$50(ast, options) {
33087
+ function make$51(ast, options) {
32932
33088
  function Schema() {}
32933
33089
  const self = Object.setPrototypeOf(Schema, SchemaProto);
32934
33090
  if (options && (Object.hasOwn(options, "name") || Object.hasOwn(options, "length") || Object.hasOwn(options, "__proto__"))) Object.defineProperties(self, Object.getOwnPropertyDescriptors({ ...options }));
@@ -32940,7 +33096,7 @@ function make$50(ast, options) {
32940
33096
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toCodec.js
32941
33097
  /** @internal */
32942
33098
  function toCodecJson$1(schema) {
32943
- return make$50(toCodecJsonAST(schema.ast), { schema });
33099
+ return make$51(toCodecJsonAST(schema.ast), { schema });
32944
33100
  }
32945
33101
  /** @internal */
32946
33102
  const toCodecJsonAST = /*#__PURE__*/ makeCodecDerivation(toCodecJsonASTStep);
@@ -32984,7 +33140,7 @@ function toCodecJsonASTStep(ast, recur) {
32984
33140
  case "Declaration": {
32985
33141
  const getLink = ast.annotations?.toCodecJson ?? ast.annotations?.toCodec;
32986
33142
  if (!isFunction(getLink)) return replaceEncoding(ast, [unknownToJson]);
32987
- const link = getLink(ast.typeParameters.map((tp) => make$50(toEncoded(tp))));
33143
+ const link = getLink(ast.typeParameters.map((tp) => make$51(toEncoded(tp))));
32988
33144
  return link === void 0 ? ast : replaceEncoding(ast, [mapLink(link, recur)]);
32989
33145
  }
32990
33146
  case "Unknown": return replaceEncoding(ast, [unknownToJson]);
@@ -33011,7 +33167,7 @@ function toCodecJsonASTStep(ast, recur) {
33011
33167
  }
33012
33168
  /** @internal */
33013
33169
  function toCodecStringTree$1(schema) {
33014
- return make$50(toCodecStringTreeAST(schema.ast), { schema });
33170
+ return make$51(toCodecStringTreeAST(schema.ast), { schema });
33015
33171
  }
33016
33172
  const toStringTreeReorder = /*#__PURE__*/ makeReorder((ast) => {
33017
33173
  switch (ast._tag) {
@@ -33027,7 +33183,7 @@ const toStringTreeReorder = /*#__PURE__*/ makeReorder((ast) => {
33027
33183
  function toCodecStringTreeASTStep(ast, recur, onMissingAnnotation) {
33028
33184
  switch (ast._tag) {
33029
33185
  case "Declaration": {
33030
- const typeParameters = ast.typeParameters.map((tp) => make$50(recur(toEncoded(tp))));
33186
+ const typeParameters = ast.typeParameters.map((tp) => make$51(recur(toEncoded(tp))));
33031
33187
  const getStringTreeLink = ast.annotations?.toCodecStringTree;
33032
33188
  if (isFunction(getStringTreeLink)) {
33033
33189
  const link = getStringTreeLink(typeParameters);
@@ -33230,7 +33386,7 @@ const concat$2 = (chunks) => {
33230
33386
  * @category instances
33231
33387
  * @since 4.0.6
33232
33388
  */
33233
- const Order = /*#__PURE__*/ make$69((self, that) => {
33389
+ const Order = /*#__PURE__*/ make$70((self, that) => {
33234
33390
  const length = Math.min(self.length, that.length);
33235
33391
  for (let i = 0; i < length; i++) if (self[i] !== that[i]) return self[i] < that[i] ? -1 : 1;
33236
33392
  return self.length < that.length ? -1 : self.length > that.length ? 1 : 0;
@@ -33831,7 +33987,7 @@ const TypeId$36 = TypeId$39;
33831
33987
  */
33832
33988
  function declareConstructor() {
33833
33989
  return (typeParameters, run, annotations) => {
33834
- return make$49(new Declaration(typeParameters.map(getAST), (typeParameters) => run(typeParameters.map((ast) => make$49(ast))), annotations));
33990
+ return make$50(new Declaration(typeParameters.map(getAST), (typeParameters) => run(typeParameters.map((ast) => make$50(ast))), annotations));
33835
33991
  };
33836
33992
  }
33837
33993
  /**
@@ -34245,7 +34401,7 @@ const encodeSync = encodeUnknownSync$1;
34245
34401
  * @category constructors
34246
34402
  * @since 3.10.0
34247
34403
  */
34248
- const make$49 = make$50;
34404
+ const make$50 = make$51;
34249
34405
  /**
34250
34406
  * Checks whether a value is a `Schema`.
34251
34407
  *
@@ -34279,7 +34435,7 @@ function isSchema(u) {
34279
34435
  * @category combinators
34280
34436
  * @since 4.0.0
34281
34437
  */
34282
- const optionalKey = /*#__PURE__*/ lambda((schema) => make$49(optionalKey$1(schema.ast), { schema }));
34438
+ const optionalKey = /*#__PURE__*/ lambda((schema) => make$50(optionalKey$1(schema.ast), { schema }));
34283
34439
  /**
34284
34440
  * Marks a struct field as optional, allowing the key to be absent or
34285
34441
  * `undefined`.
@@ -34312,9 +34468,18 @@ const optionalKey = /*#__PURE__*/ lambda((schema) => make$49(optionalKey$1(schem
34312
34468
  */
34313
34469
  const optional$2 = /*#__PURE__*/ lambda((self) => {
34314
34470
  const schema = UndefinedOr(self);
34315
- return make$49(optional$3(self.ast), { schema });
34471
+ return make$50(optional$3(self.ast), { schema });
34316
34472
  });
34317
34473
  /**
34474
+ * Extracts the type-side schema: sets `Encoded` to equal the decoded `Type`,
34475
+ * discarding the encoding transformation path.
34476
+ *
34477
+ * @stability stable
34478
+ * @category transforming
34479
+ * @since 4.0.0
34480
+ */
34481
+ const toType = /*#__PURE__*/ lambda((schema) => make$50(toType$1(schema.ast), { schema }));
34482
+ /**
34318
34483
  * Creates a schema for a single literal value (string, number, bigint, boolean, or null).
34319
34484
  *
34320
34485
  * **Example** (Defining a string literal)
@@ -34335,7 +34500,7 @@ const optional$2 = /*#__PURE__*/ lambda((self) => {
34335
34500
  * @since 3.10.0
34336
34501
  */
34337
34502
  function Literal(literal) {
34338
- const out = make$49(new Literal$1(literal), {
34503
+ const out = make$50(new Literal$1(literal), {
34339
34504
  literal,
34340
34505
  transform(to) {
34341
34506
  return out.pipe(decodeTo(Literal(to), {
@@ -34386,7 +34551,7 @@ function templateLiteralParts(parts) {
34386
34551
  * @since 3.10.0
34387
34552
  */
34388
34553
  function TemplateLiteralParser(parts) {
34389
- return make$49(templateLiteralParser(templateLiteralParts(parts)), { parts });
34554
+ return make$50(templateLiteralParser(templateLiteralParts(parts)), { parts });
34390
34555
  }
34391
34556
  /**
34392
34557
  * Schema for the `never` type. Always fails validation — no value satisfies it.
@@ -34395,7 +34560,7 @@ function TemplateLiteralParser(parts) {
34395
34560
  * @category schemas
34396
34561
  * @since 3.10.0
34397
34562
  */
34398
- const Never = /*#__PURE__*/ make$49(never);
34563
+ const Never = /*#__PURE__*/ make$50(never);
34399
34564
  /**
34400
34565
  * Schema for the `any` type. Accepts any value without validation.
34401
34566
  *
@@ -34404,7 +34569,7 @@ const Never = /*#__PURE__*/ make$49(never);
34404
34569
  * @category schemas
34405
34570
  * @since 3.10.0
34406
34571
  */
34407
- const Any = /*#__PURE__*/ make$49(any);
34572
+ const Any = /*#__PURE__*/ make$50(any);
34408
34573
  /**
34409
34574
  * Schema for the `unknown` type. Accepts any value without validation.
34410
34575
  *
@@ -34418,7 +34583,7 @@ const Any = /*#__PURE__*/ make$49(any);
34418
34583
  * @category schemas
34419
34584
  * @since 3.10.0
34420
34585
  */
34421
- const Unknown = /*#__PURE__*/ make$49(unknown);
34586
+ const Unknown = /*#__PURE__*/ make$50(unknown);
34422
34587
  /**
34423
34588
  * Schema for the `null` literal. Validates that the input is strictly `null`.
34424
34589
  *
@@ -34427,7 +34592,7 @@ const Unknown = /*#__PURE__*/ make$49(unknown);
34427
34592
  * @category schemas
34428
34593
  * @since 3.10.0
34429
34594
  */
34430
- const Null = /*#__PURE__*/ make$49(null_);
34595
+ const Null = /*#__PURE__*/ make$50(null_);
34431
34596
  /**
34432
34597
  * Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
34433
34598
  *
@@ -34436,7 +34601,7 @@ const Null = /*#__PURE__*/ make$49(null_);
34436
34601
  * @category schemas
34437
34602
  * @since 3.10.0
34438
34603
  */
34439
- const Undefined = /*#__PURE__*/ make$49(undefined_);
34604
+ const Undefined = /*#__PURE__*/ make$50(undefined_);
34440
34605
  /**
34441
34606
  * Schema for `string` values. Validates that the input is `typeof` `"string"`.
34442
34607
  *
@@ -34444,7 +34609,7 @@ const Undefined = /*#__PURE__*/ make$49(undefined_);
34444
34609
  * @category schemas
34445
34610
  * @since 4.0.0
34446
34611
  */
34447
- const String$6 = /*#__PURE__*/ make$49(string);
34612
+ const String$6 = /*#__PURE__*/ make$50(string);
34448
34613
  /**
34449
34614
  * Schema for `number` values, including `NaN`, `Infinity`, and `-Infinity`.
34450
34615
  *
@@ -34460,7 +34625,7 @@ const String$6 = /*#__PURE__*/ make$49(string);
34460
34625
  * @category schemas
34461
34626
  * @since 4.0.0
34462
34627
  */
34463
- const Number$2 = /*#__PURE__*/ make$49(number);
34628
+ const Number$2 = /*#__PURE__*/ make$50(number);
34464
34629
  /**
34465
34630
  * Schema for `boolean` values. Validates that the input is `typeof` `"boolean"`.
34466
34631
  *
@@ -34474,7 +34639,7 @@ const Number$2 = /*#__PURE__*/ make$49(number);
34474
34639
  * @category schemas
34475
34640
  * @since 4.0.0
34476
34641
  */
34477
- const Boolean$5 = /*#__PURE__*/ make$49(boolean);
34642
+ const Boolean$5 = /*#__PURE__*/ make$50(boolean);
34478
34643
  /**
34479
34644
  * Schema for a TypeScript `void` return value.
34480
34645
  *
@@ -34495,9 +34660,9 @@ const Boolean$5 = /*#__PURE__*/ make$49(boolean);
34495
34660
  * @category schemas
34496
34661
  * @since 3.10.0
34497
34662
  */
34498
- const Void = /*#__PURE__*/ make$49(void_);
34663
+ const Void = /*#__PURE__*/ make$50(void_);
34499
34664
  function makeStruct(ast, fields) {
34500
- return make$49(ast, {
34665
+ return make$50(ast, {
34501
34666
  fields,
34502
34667
  mapFields(f, options) {
34503
34668
  const fields = f(this.fields);
@@ -34590,13 +34755,13 @@ function Struct(fields) {
34590
34755
  * @since 3.10.0
34591
34756
  */
34592
34757
  function Record$1(key, value) {
34593
- return make$49(record(key.ast, value.ast), {
34758
+ return make$50(record(key.ast, value.ast), {
34594
34759
  key,
34595
34760
  value
34596
34761
  });
34597
34762
  }
34598
34763
  function makeTuple(ast, elements) {
34599
- return make$49(ast, {
34764
+ return make$50(ast, {
34600
34765
  elements,
34601
34766
  mapElements(f, options) {
34602
34767
  const elements = f(this.elements);
@@ -34628,7 +34793,7 @@ function Tuple(elements) {
34628
34793
  * @category constructors
34629
34794
  * @since 4.0.0
34630
34795
  */
34631
- const ArraySchema = /*#__PURE__*/ lambda((schema) => make$49(new Arrays(false, [], [schema.ast]), { value: schema }));
34796
+ const ArraySchema = /*#__PURE__*/ lambda((schema) => make$50(new Arrays(false, [], [schema.ast]), { value: schema }));
34632
34797
  /**
34633
34798
  * Defines a non-empty `ReadonlyArray` schema — at least one element required.
34634
34799
  * Type is `readonly [T, ...T[]]`.
@@ -34647,9 +34812,9 @@ const ArraySchema = /*#__PURE__*/ lambda((schema) => make$49(new Arrays(false, [
34647
34812
  * @category constructors
34648
34813
  * @since 3.10.0
34649
34814
  */
34650
- const NonEmptyArray = /*#__PURE__*/ lambda((schema) => make$49(new Arrays(false, [schema.ast], [schema.ast]), { value: schema }));
34815
+ const NonEmptyArray = /*#__PURE__*/ lambda((schema) => make$50(new Arrays(false, [schema.ast], [schema.ast]), { value: schema }));
34651
34816
  function makeUnion(ast, members) {
34652
- return make$49(ast, {
34817
+ return make$50(ast, {
34653
34818
  members,
34654
34819
  mapMembers(f, options) {
34655
34820
  const members = f(this.members);
@@ -34704,7 +34869,7 @@ function Union(members, options) {
34704
34869
  */
34705
34870
  function Literals(literals) {
34706
34871
  const members = literals.map(Literal);
34707
- return make$49(union$1(members, void 0, void 0), {
34872
+ return make$50(union$1(members, void 0, void 0), {
34708
34873
  literals,
34709
34874
  members,
34710
34875
  mapMembers(f) {
@@ -34736,7 +34901,7 @@ const NullOr = /*#__PURE__*/ lambda((self) => Union([self, Null]));
34736
34901
  const UndefinedOr = /*#__PURE__*/ lambda((self) => Union([self, Undefined]));
34737
34902
  function decodeTo(to, transformation) {
34738
34903
  return (from) => {
34739
- return make$49(decodeTo$1(from.ast, to.ast, transformation ? makeTransformation$1(transformation) : passthrough()), {
34904
+ return make$50(decodeTo$1(from.ast, to.ast, transformation ? makeTransformation$1(transformation) : passthrough()), {
34740
34905
  from,
34741
34906
  to
34742
34907
  });
@@ -34791,7 +34956,7 @@ const BooleanLiterals = /*#__PURE__*/ Literals([...TrueLiterals.literals, ...Fal
34791
34956
  * @since 3.10.0
34792
34957
  */
34793
34958
  function withConstructorDefault(defaultValue) {
34794
- return (schema) => make$49(withConstructorDefault$1(schema.ast, defaultValue), { schema });
34959
+ return (schema) => make$50(withConstructorDefault$1(schema.ast, defaultValue), { schema });
34795
34960
  }
34796
34961
  /**
34797
34962
  * Combines a {@link Literal} schema with {@link withConstructorDefault}, making it ideal
@@ -35004,7 +35169,7 @@ function isPattern(regExp, annotations) {
35004
35169
  * @category schemas
35005
35170
  * @since 3.10.0
35006
35171
  */
35007
- const Finite = /*#__PURE__*/ make$49(finite);
35172
+ const Finite = /*#__PURE__*/ make$50(finite);
35008
35173
  /**
35009
35174
  * Creates an inclusive or exclusive range check for any ordered type from an
35010
35175
  * `Order.Order` instance.
@@ -35445,7 +35610,7 @@ function CauseReason(error, defect) {
35445
35610
  }
35446
35611
  }))
35447
35612
  });
35448
- return make$49(schema.ast, {
35613
+ return make$50(schema.ast, {
35449
35614
  error,
35450
35615
  defect
35451
35616
  });
@@ -35498,7 +35663,7 @@ function Cause(error, defect) {
35498
35663
  encode: ({ reasons: failures }) => failures
35499
35664
  }))
35500
35665
  });
35501
- return make$49(schema.ast, {
35666
+ return make$50(schema.ast, {
35502
35667
  error,
35503
35668
  defect
35504
35669
  });
@@ -35564,12 +35729,90 @@ function Exit(value, error, defect) {
35564
35729
  }
35565
35730
  }))
35566
35731
  });
35567
- return make$49(schema.ast, {
35732
+ return make$50(schema.ast, {
35568
35733
  value,
35569
35734
  error,
35570
35735
  defect
35571
35736
  });
35572
35737
  }
35738
+ /**
35739
+ * Schema for `Redacted` values, which hide their contents from inspection.
35740
+ *
35741
+ * **Details**
35742
+ *
35743
+ * Options:
35744
+ *
35745
+ * - `label`: When provided, the schema will behave as follows:
35746
+ * - Values will be validated against the label in addition to the wrapped schema
35747
+ * - The default JSON serializer will deserialize into a `Redacted` instance with the label
35748
+ * - The arbitrary generator will produce a `Redacted` instance with the label
35749
+ * - The formatter will return the label
35750
+ * - `disallowJsonEncode`: When set to `true`, when attempting to encode a `Redacted` instance
35751
+ * into JSON, it will fail with an error. This is useful when the wrapped schema is
35752
+ * sensitive and should not be exposed in JSON.
35753
+ *
35754
+ * @see {@link RedactedFromValue} for decoding raw values and wrapping them in `Redacted`.
35755
+ * @stability stable
35756
+ * @category schemas
35757
+ * @since 3.10.0
35758
+ */
35759
+ function Redacted(value$7, options) {
35760
+ const label = typeof options?.label === "string" ? options.label : void 0;
35761
+ const disallowJsonEncode = options?.disallowJsonEncode === true;
35762
+ const normalizedOptions = label !== void 0 ? disallowJsonEncode ? {
35763
+ label,
35764
+ disallowJsonEncode: true
35765
+ } : { label } : disallowJsonEncode ? { disallowJsonEncode: true } : void 0;
35766
+ const decodeLabel = label !== void 0 ? decodeUnknownEffect$1(Literal(label)) : void 0;
35767
+ const schema = declareConstructor()([value$7], ([value$9]) => (input, ast, poptions) => {
35768
+ if (isRedacted(input)) {
35769
+ const label = decodeLabel !== void 0 ? mapErrorEager(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_$1;
35770
+ return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$9)(value(input), poptions), {
35771
+ onSuccess: (value) => make$55(value, { label: input.label }),
35772
+ onFailure: () => {
35773
+ return new Composite(ast, [new Pointer(["value"], new InvalidValue$1(void 0, input, poptions))], input, poptions);
35774
+ }
35775
+ }));
35776
+ }
35777
+ return fail$6(new InvalidType(ast, input, poptions));
35778
+ }, {
35779
+ representation: {
35780
+ id: "effect/schema/Redacted",
35781
+ payload: normalizedOptions ?? null
35782
+ },
35783
+ toCode: ({ typeParameters }) => ({
35784
+ runtime: normalizedOptions !== void 0 ? `Schema.Redacted(${typeParameters[0].runtime}, ${format$2(normalizedOptions)})` : `Schema.Redacted(${typeParameters[0].runtime})`,
35785
+ Type: `Redacted.Redacted<${typeParameters[0].Type}>`,
35786
+ importDeclarations: [`import * as Redacted from "effect/Redacted"`]
35787
+ }),
35788
+ expected: "Redacted",
35789
+ toCodecJson: ([value$6]) => link$1()(value$6, {
35790
+ decode: transform$3((e) => make$55(e, { label })),
35791
+ encode: disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$3(value)
35792
+ }),
35793
+ toEquivalence: ([value]) => makeEquivalence(value)
35794
+ });
35795
+ return make$50(schema.ast, { value: value$7 });
35796
+ }
35797
+ /**
35798
+ * Decodes a value and wraps it in `Redacted<A>`. Unlike {@link Redacted} which
35799
+ * expects the input to already be a `Redacted` instance, this schema decodes
35800
+ * the raw value and wraps it.
35801
+ *
35802
+ * @see {@link Redacted} for schemas whose input is already a `Redacted` value.
35803
+ * @stability stable
35804
+ * @category schemas
35805
+ * @since 4.0.0
35806
+ */
35807
+ function RedactedFromValue(value$8, options) {
35808
+ return decodeTo(Redacted(toType(value$8), {
35809
+ label: options?.label,
35810
+ disallowJsonEncode: options?.disallowEncode
35811
+ }), {
35812
+ decode: transform$3((t) => make$55(t, { label: options?.label })),
35813
+ encode: options?.disallowEncode ? forbidden((oe) => "Cannot encode Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$3(value)
35814
+ })(value$8);
35815
+ }
35573
35816
  const immerable = /*#__PURE__*/ globalThis.Symbol.for("immer-draftable");
35574
35817
  const payloadToken = {};
35575
35818
  function makeClass(Inherited, identifier, struct$1, annotations, proto) {
@@ -35605,7 +35848,7 @@ function makeClass(Inherited, identifier, struct$1, annotations, proto) {
35605
35848
  return getClassSchema(this).rebuild(ast);
35606
35849
  }
35607
35850
  static make(input, options) {
35608
- return makeClassSync(toType(getClassSchema(this).ast), input ?? {}, options, (fields) => makeClassTrusted(this, fields));
35851
+ return makeClassSync(toType$1(getClassSchema(this).ast), input ?? {}, options, (fields) => makeClassTrusted(this, fields));
35609
35852
  }
35610
35853
  static makeOption(input, options) {
35611
35854
  return makeOption(getClassSchema(this))(input ?? {}, options);
@@ -35665,7 +35908,7 @@ function getClassSchemaFactory(from, identifier, annotations) {
35665
35908
  const ClassTypeId = getClassTypeId(identifier);
35666
35909
  const isClassValue = (input) => input instanceof self || hasProperty(input, ClassTypeId);
35667
35910
  const transformation = getClassTransformation(self);
35668
- return memo = decodeTo(make$49(new Declaration([from.ast], () => (input, ast, options) => {
35911
+ return memo = decodeTo(make$50(new Declaration([from.ast], () => (input, ast, options) => {
35669
35912
  return isClassValue(input) ? succeed$5(input) : fail$6(new InvalidType(ast, input, options));
35670
35913
  }, {
35671
35914
  identifier,
@@ -35898,7 +36141,7 @@ const toCodecStringTree = toCodecStringTree$1;
35898
36141
  * @category schemas
35899
36142
  * @since 4.0.0
35900
36143
  */
35901
- const Json = /*#__PURE__*/ make$49(/*#__PURE__*/ annotate$1(Json$1, { toCode: () => ({
36144
+ const Json = /*#__PURE__*/ make$50(/*#__PURE__*/ annotate$1(Json$1, { toCode: () => ({
35902
36145
  runtime: "Schema.Json",
35903
36146
  Type: "Schema.Json"
35904
36147
  }) }));
@@ -36021,7 +36264,7 @@ const makeUnsafe$3 = makeLatchUnsafe;
36021
36264
  * @category constructors
36022
36265
  * @since 4.0.0
36023
36266
  */
36024
- const make$48 = makeLatch;
36267
+ const make$49 = makeLatch;
36025
36268
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/MutableRef.js
36026
36269
  const TypeId$35 = "~effect/MutableRef";
36027
36270
  const MutableRefProto = {
@@ -36067,7 +36310,7 @@ const MutableRefProto = {
36067
36310
  * @category constructors
36068
36311
  * @since 2.0.0
36069
36312
  */
36070
- const make$47 = (value) => {
36313
+ const make$48 = (value) => {
36071
36314
  const ref = Object.create(MutableRefProto);
36072
36315
  ref.current = value;
36073
36316
  return ref;
@@ -36123,7 +36366,7 @@ const make$47 = (value) => {
36123
36366
  * @category mutations
36124
36367
  * @since 2.0.0
36125
36368
  */
36126
- const set = /*#__PURE__*/ dual(2, (self, value) => {
36369
+ const set$1 = /*#__PURE__*/ dual(2, (self, value) => {
36127
36370
  self.current = value;
36128
36371
  return self;
36129
36372
  });
@@ -36172,7 +36415,7 @@ const SubscriptionTypeId = "~effect/PubSub/Subscription";
36172
36415
  * @category constructors
36173
36416
  * @since 4.0.0
36174
36417
  */
36175
- const make$46 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(), /* @__PURE__ */ new Map(), makeUnsafe$7(), makeUnsafe$3(false), make$47(false), options.strategy(), make$47(none())));
36418
+ const make$47 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(), /* @__PURE__ */ new Map(), makeUnsafe$7(), makeUnsafe$3(false), make$48(false), options.strategy(), make$48(none())));
36176
36419
  /**
36177
36420
  * Creates an unbounded `PubSub`.
36178
36421
  *
@@ -36203,7 +36446,7 @@ const make$46 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(),
36203
36446
  * @category constructors
36204
36447
  * @since 2.0.0
36205
36448
  */
36206
- const unbounded = (options) => make$46({
36449
+ const unbounded = (options) => make$47({
36207
36450
  atomicPubSub: () => makeAtomicUnbounded(options),
36208
36451
  strategy: () => new DroppingStrategy()
36209
36452
  });
@@ -36328,13 +36571,13 @@ const publishUnsafe = /*#__PURE__*/ dual(2, (self, value) => {
36328
36571
  * @since 2.0.0
36329
36572
  */
36330
36573
  const subscribe = (self) => uninterruptible(contextWith((services) => {
36331
- const localScope = get$10(services, Scope);
36574
+ const localScope = get$11(services, Scope);
36332
36575
  const scope = forkUnsafe(self.scope);
36333
36576
  const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
36334
36577
  return addFinalizer$1(scope, unsubscribe(subscription)).pipe(andThen(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
36335
36578
  }));
36336
36579
  const unsubscribe = (self) => uninterruptible(withFiber((state) => {
36337
- set(self.shutdownFlag, true);
36580
+ set$1(self.shutdownFlag, true);
36338
36581
  return forEach$1(takeAll$2(self.pollers), (d) => interruptWith(d, state.id), {
36339
36582
  discard: true,
36340
36583
  concurrency: "unbounded"
@@ -36417,7 +36660,7 @@ const removeSubscribers = (subscribers, subscription, pollers) => {
36417
36660
  set.delete(pollers);
36418
36661
  if (set.size === 0) subscribers.delete(subscription);
36419
36662
  };
36420
- const makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make$62(), makeUnsafe$3(false), make$47(false), strategy, pubsub.replayWindow(), ended);
36663
+ const makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make$63(), makeUnsafe$3(false), make$48(false), strategy, pubsub.replayWindow(), ended);
36421
36664
  var UnboundedPubSub = class {
36422
36665
  publisherHead = {
36423
36666
  value: AbsentValue,
@@ -36974,7 +37217,7 @@ const fromTransformBracket = (f) => fromTransform$1(fnUntraced(function* (upstre
36974
37217
  * @since 4.0.0
36975
37218
  */
36976
37219
  const toTransform = (channel) => channel.transform;
36977
- const asyncQueue = (scope, f, options) => make$61({
37220
+ const asyncQueue = (scope, f, options) => make$62({
36978
37221
  capacity: options?.bufferSize,
36979
37222
  strategy: options?.strategy
36980
37223
  }).pipe(tap$1((queue) => addFinalizer$1(scope, shutdown(queue))), tap$1((queue) => provide$3(f(queue), scope).pipe(catchCause$1((cause) => failCause$1(queue, cause)), forkIn(scope, { startImmediately: true }))));
@@ -37490,7 +37733,7 @@ const fromReadableStream$1 = (options) => fromTransform$1((_, scope) => readable
37490
37733
  }));
37491
37734
  const readableStreamToPullUnsafe = (options) => {
37492
37735
  const reader = options.readable.getReader();
37493
- const exit = options.exit ?? make$47(void 0);
37736
+ const exit = options.exit ?? make$48(void 0);
37494
37737
  const pull = suspend$2(() => {
37495
37738
  if (exit.current) return exit.current;
37496
37739
  return matchCauseEffect(tryPromise({
@@ -37961,7 +38204,7 @@ const orDie$1 = (self) => catch_(self, die$1);
37961
38204
  const mergeAll = /*#__PURE__*/ dual(2, (channels, { bufferSize = 16, concurrency, switch: switch_ = false }) => fromTransformBracket(fnUntraced(function* (upstream, scope, forkedScope) {
37962
38205
  const concurrencyN = concurrency === "unbounded" ? Number.MAX_SAFE_INTEGER : Math.max(1, concurrency);
37963
38206
  const semaphore = switch_ ? void 0 : makeUnsafe$5(concurrencyN);
37964
- const doneLatch = yield* make$48(true);
38207
+ const doneLatch = yield* make$49(true);
37965
38208
  const fibers = /* @__PURE__ */ new Map();
37966
38209
  const queue = yield* bounded(bufferSize);
37967
38210
  yield* addFinalizer$1(forkedScope, shutdown(queue));
@@ -39010,7 +39253,7 @@ const isNotLink = (error) => isIgnorable(error) || error.reason._tag === "Unknow
39010
39253
  const DIRECTORY_CONCURRENCY = 16;
39011
39254
  const byName = /*#__PURE__*/ mapInput(String$10, (entry) => entry.name);
39012
39255
  /** @internal */
39013
- const make$45 = (fs) => (pattern, options) => walk(fs, compile$3([pattern], options?.dot ?? false), options);
39256
+ const make$46 = (fs) => (pattern, options) => walk(fs, compile$3([pattern], options?.dot ?? false), options);
39014
39257
  const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
39015
39258
  if (compiled.initial.size === 0) return [];
39016
39259
  const root = options?.root ?? "";
@@ -39502,9 +39745,9 @@ var RcRefImpl = class {
39502
39745
  }
39503
39746
  };
39504
39747
  /** @internal */
39505
- const make$44 = (options) => withFiber((fiber) => {
39748
+ const make$45 = (options) => withFiber((fiber) => {
39506
39749
  const context = fiber.context;
39507
- const scope = get$10(context, Scope);
39750
+ const scope = get$11(context, Scope);
39508
39751
  const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== void 0 ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
39509
39752
  return as(addFinalizerExit(scope, () => {
39510
39753
  const state = ref.state;
@@ -39567,7 +39810,7 @@ const awaitAcquiring = (self, acquiring, restore) => onExit$1(restore(join$1(acq
39567
39810
  return interrupt(acquiring.fiber);
39568
39811
  });
39569
39812
  /** @internal */
39570
- const get$5 = (self_) => {
39813
+ const get$6 = (self_) => {
39571
39814
  const self = self_;
39572
39815
  return uninterruptibleMask((restore) => flatMap$3(scope, (scope) => flatMap$3(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
39573
39816
  };
@@ -39641,7 +39884,7 @@ const release = (self, state) => {
39641
39884
  * @category constructors
39642
39885
  * @since 3.5.0
39643
39886
  */
39644
- const make$43 = make$44;
39887
+ const make$44 = make$45;
39645
39888
  /**
39646
39889
  * Gets the value from an `RcRef`, acquiring it first if needed.
39647
39890
  *
@@ -39687,7 +39930,7 @@ const make$43 = make$44;
39687
39930
  * @category combinators
39688
39931
  * @since 3.5.0
39689
39932
  */
39690
- const get$4 = get$5;
39933
+ const get$5 = get$6;
39691
39934
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Stream.js
39692
39935
  /**
39693
39936
  * Describes effectful sources that emit values over time.
@@ -39906,7 +40149,7 @@ const succeed$2 = (value) => fromChannel(succeed$3(of(value)));
39906
40149
  * @category constructors
39907
40150
  * @since 2.0.0
39908
40151
  */
39909
- const make$42 = (...values) => fromArray(values);
40152
+ const make$43 = (...values) => fromArray(values);
39910
40153
  /**
39911
40154
  * Creates a lazily constructed stream.
39912
40155
  *
@@ -41121,10 +41364,10 @@ const FileSystem = /*#__PURE__*/ Service$1("effect/FileSystem");
41121
41364
  * @category constructors
41122
41365
  * @since 4.0.0
41123
41366
  */
41124
- const make$41 = (impl) => FileSystem.of({
41367
+ const make$42 = (impl) => FileSystem.of({
41125
41368
  ...impl,
41126
41369
  [TypeId$27]: TypeId$27,
41127
- glob: make$45(impl),
41370
+ glob: make$46(impl),
41128
41371
  exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed$5(false) : fail$6(e))),
41129
41372
  readFileString: (path, encoding) => flatMap$3(impl.readFile(path), (_) => try_({
41130
41373
  try: () => new TextDecoder(encoding).decode(_),
@@ -41343,7 +41586,7 @@ const Path$1 = /*#__PURE__*/ Service$1("effect/Path");
41343
41586
  * @category constructors
41344
41587
  * @since 4.0.0
41345
41588
  */
41346
- const make$40 = (impl) => Path$1.of({
41589
+ const make$41 = (impl) => Path$1.of({
41347
41590
  ...impl,
41348
41591
  [TypeId$26]: TypeId$26,
41349
41592
  resolveWithin(root, input) {
@@ -41579,7 +41822,7 @@ function makeOrElse(first, second) {
41579
41822
  * @category constructors
41580
41823
  * @since 4.0.0
41581
41824
  */
41582
- function make$39(get) {
41825
+ function make$40(get) {
41583
41826
  return makeSource(get, identityPath);
41584
41827
  }
41585
41828
  /**
@@ -41682,7 +41925,7 @@ const orElse = /*#__PURE__*/ dual(2, (self, that) => makeOrElse(self, that));
41682
41925
  */
41683
41926
  function fromUnknown(root, options) {
41684
41927
  const preserveEmptyStrings = options?.preserveEmptyStrings === true;
41685
- return make$39((path) => succeed$5(nodeAtJson(root, path, preserveEmptyStrings)));
41928
+ return make$40((path) => succeed$5(nodeAtJson(root, path, preserveEmptyStrings)));
41686
41929
  }
41687
41930
  function nodeAtJson(root, path, preserveEmptyStrings) {
41688
41931
  let cur = root;
@@ -41750,7 +41993,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
41750
41993
  function fromEnvRecord(env, options) {
41751
41994
  const preserveEmptyStrings = options?.preserveEmptyStrings === true;
41752
41995
  const trie = buildEnvTrie(env);
41753
- return make$39((path) => succeed$5(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
41996
+ return make$40((path) => succeed$5(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
41754
41997
  }
41755
41998
  /**
41756
41999
  * Creates a `ConfigProvider` backed by environment variables.
@@ -41924,7 +42167,7 @@ const Proto$13 = {
41924
42167
  return { _id: "Config" };
41925
42168
  }
41926
42169
  };
41927
- function make$38(evaluator) {
42170
+ function make$39(evaluator) {
41928
42171
  const self = Object.create(Proto$13);
41929
42172
  self.evaluator = evaluator;
41930
42173
  self.parse = (provider) => flatMapEager(evaluator(provider, []), fromResult);
@@ -41959,7 +42202,7 @@ const evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, path
41959
42202
  * @since 2.0.0
41960
42203
  */
41961
42204
  const map$3 = /*#__PURE__*/ dual(2, (self, f) => {
41962
- return make$38((provider, pathPrefix) => map$6(evaluateAt(self, provider, pathPrefix), map$11(f)));
42205
+ return make$39((provider, pathPrefix) => map$6(evaluateAt(self, provider, pathPrefix), map$11(f)));
41963
42206
  });
41964
42207
  /**
41965
42208
  * Combines multiple configs into a single config that parses all of them.
@@ -42006,7 +42249,7 @@ const map$3 = /*#__PURE__*/ dual(2, (self, f) => {
42006
42249
  */
42007
42250
  function all(arg) {
42008
42251
  const configs = globalThis.Array.isArray(arg) ? arg : Symbol.iterator in arg ? [...arg] : arg;
42009
- return make$38((provider, pathPrefix) => globalThis.Array.isArray(configs) ? mapEager(all$1(configs.map((config) => evaluateAt(config, provider, pathPrefix))), all$3) : mapEager(all$1(map$10(configs, (config) => evaluateAt(config, provider, pathPrefix))), all$3));
42252
+ return make$39((provider, pathPrefix) => globalThis.Array.isArray(configs) ? mapEager(all$1(configs.map((config) => evaluateAt(config, provider, pathPrefix))), all$3) : mapEager(all$1(map$10(configs, (config) => evaluateAt(config, provider, pathPrefix))), all$3));
42010
42253
  }
42011
42254
  /**
42012
42255
  * Provides a fallback value when the config is absent.
@@ -42045,7 +42288,7 @@ function all(arg) {
42045
42288
  * @since 2.0.0
42046
42289
  */
42047
42290
  const withDefault$2 = /*#__PURE__*/ dual(2, (self, defaultValue) => {
42048
- return make$38((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure$1(resolution) ? succeed$9(defaultValue) : resolution));
42291
+ return make$39((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure$1(resolution) ? succeed$9(defaultValue) : resolution));
42049
42292
  });
42050
42293
  /**
42051
42294
  * Makes a config optional: returns `Some(value)` on success and `None` when the
@@ -42286,9 +42529,9 @@ const toConfigCursorAST = /*#__PURE__*/ memoize((root) => {
42286
42529
  function schema$1(codec, path) {
42287
42530
  const codecStringTree = toCodecStringTree(codec);
42288
42531
  const encodedAst = toEncoded(codecStringTree.ast);
42289
- const decodeCursor = decodeUnknownEffect$1(make$49(toConfigCursorAST(codecStringTree.ast)));
42532
+ const decodeCursor = decodeUnknownEffect$1(make$50(toConfigCursorAST(codecStringTree.ast)));
42290
42533
  const localPath = typeof path === "string" ? [path] : path ?? [];
42291
- return make$38((provider, pathPrefix) => {
42534
+ return make$39((provider, pathPrefix) => {
42292
42535
  const fullPath = [...pathPrefix, ...localPath];
42293
42536
  return loadCursor(provider, fullPath).pipe(flatMapEager((cursor) => decodeCursor(cursor).pipe(mapEager(succeed$9), catchEager((issue) => {
42294
42537
  const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
@@ -42327,7 +42570,7 @@ const isPath = (u) => isString$1(u) || globalThis.Array.isArray(u);
42327
42570
  * @since 2.0.0
42328
42571
  */
42329
42572
  function succeed$1(value) {
42330
- return make$38(() => succeed$5(succeed$9(value)));
42573
+ return make$39(() => succeed$5(succeed$9(value)));
42331
42574
  }
42332
42575
  /**
42333
42576
  * Creates a config for a single string value.
@@ -42688,7 +42931,7 @@ const makeUnsafe$2 = (backing, deferred) => {
42688
42931
  * @category constructors
42689
42932
  * @since 2.0.0
42690
42933
  */
42691
- const make$37 = () => acquireRelease(sync(() => makeUnsafe$2(/* @__PURE__ */ new Set(), makeUnsafe$8())), (set) => suspend$2(() => {
42934
+ const make$38 = () => acquireRelease(sync(() => makeUnsafe$2(/* @__PURE__ */ new Set(), makeUnsafe$8())), (set) => suspend$2(() => {
42692
42935
  const state = set.state;
42693
42936
  if (state._tag === "Closed") return void_$1;
42694
42937
  set.state = { _tag: "Closed" };
@@ -42980,7 +43223,7 @@ const LogToStderr = LogToStderr$1;
42980
43223
  * @category constructors
42981
43224
  * @since 2.0.0
42982
43225
  */
42983
- const make$36 = loggerMake;
43226
+ const make$37 = loggerMake;
42984
43227
  /**
42985
43228
  * Creates a `Layer` which will overwrite the current set of loggers with the
42986
43229
  * specified array of `loggers`.
@@ -43018,6 +43261,19 @@ const layer$20 = (loggers, options) => effect(CurrentLoggers, withFiber$1(fnUntr
43018
43261
  return currentLoggers;
43019
43262
  })));
43020
43263
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Ref.js
43264
+ /**
43265
+ * Stores fiber-safe mutable state inside Effect programs.
43266
+ *
43267
+ * A `Ref<A>` holds one value and exposes reads, writes, and atomic
43268
+ * transformations as effects, so state changes compose with Effect's
43269
+ * concurrency model. This module includes constructors, safe and unsafe reads,
43270
+ * set and get-and-set helpers, update and modify helpers, and conditional
43271
+ * update variants that leave the value unchanged when an `Option.none` result
43272
+ * is returned.
43273
+ *
43274
+ * @stability stable
43275
+ * @since 2.0.0
43276
+ */
43021
43277
  const RefProto = {
43022
43278
  ["~effect/Ref"]: { _A: identity },
43023
43279
  ...PipeInspectableProto,
@@ -43055,9 +43311,99 @@ const RefProto = {
43055
43311
  */
43056
43312
  const makeUnsafe$1 = (value) => {
43057
43313
  const self = Object.create(RefProto);
43058
- self.ref = make$47(value);
43314
+ self.ref = make$48(value);
43059
43315
  return self;
43060
43316
  };
43317
+ /**
43318
+ * Creates a new Ref with the specified initial value.
43319
+ *
43320
+ * **When to use**
43321
+ *
43322
+ * Use to create a `Ref` for shared mutable state inside an Effect program.
43323
+ *
43324
+ * **Example** (Creating a ref)
43325
+ *
43326
+ * ```ts import.meta.vitest
43327
+ * import { Effect, Ref } from "effect"
43328
+ *
43329
+ * const program = Effect.gen(function*() {
43330
+ * const ref = yield* Ref.make(42)
43331
+ * return yield* Ref.get(ref)
43332
+ * })
43333
+ *
43334
+ * await Effect.runPromise(program) // => 42
43335
+ * ```
43336
+ *
43337
+ * @see {@link makeUnsafe} for synchronous construction outside Effect code
43338
+ *
43339
+ * @stability stable
43340
+ * @category constructors
43341
+ * @since 2.0.0
43342
+ */
43343
+ const make$36 = (value) => sync(() => makeUnsafe$1(value));
43344
+ /**
43345
+ * Gets the current value of the Ref.
43346
+ *
43347
+ * **When to use**
43348
+ *
43349
+ * Use to read the current `Ref` value without changing it.
43350
+ *
43351
+ * **Example** (Getting the current value)
43352
+ *
43353
+ * ```ts import.meta.vitest
43354
+ * import { Effect, Ref } from "effect"
43355
+ *
43356
+ * const program = Effect.gen(function*() {
43357
+ * const ref = yield* Ref.make(42)
43358
+ * return yield* Ref.get(ref)
43359
+ * })
43360
+ *
43361
+ * await Effect.runPromise(program) // => 42
43362
+ * ```
43363
+ *
43364
+ * @see {@link set} for replacing the current value
43365
+ *
43366
+ * @stability stable
43367
+ * @category getters
43368
+ * @since 2.0.0
43369
+ */
43370
+ const get$4 = (self) => sync(() => self.ref.current);
43371
+ /**
43372
+ * Sets the value of the Ref to the specified value.
43373
+ *
43374
+ * **When to use**
43375
+ *
43376
+ * Use to replace the current `Ref` value with a known value.
43377
+ *
43378
+ * **Example** (Setting a value)
43379
+ *
43380
+ * ```ts import.meta.vitest
43381
+ * import { Effect, Ref } from "effect"
43382
+ *
43383
+ * const program = Effect.gen(function*() {
43384
+ * const ref = yield* Ref.make(0)
43385
+ * yield* Ref.set(ref, 42)
43386
+ * return yield* Ref.get(ref)
43387
+ * })
43388
+ *
43389
+ * const program2 = Effect.gen(function*() {
43390
+ * const ref = yield* Ref.make(0)
43391
+ * yield* Ref.set(ref, 100)
43392
+ * return yield* Ref.get(ref)
43393
+ * })
43394
+ *
43395
+ * await Effect.runPromise(program) // => 42
43396
+ * await Effect.runPromise(program2) // => 100
43397
+ * ```
43398
+ *
43399
+ * @see {@link getAndSet} for setting while returning the previous value
43400
+ * @see {@link setAndGet} for setting while returning the new value
43401
+ *
43402
+ * @stability stable
43403
+ * @category mutations
43404
+ * @since 2.0.0
43405
+ */
43406
+ const set = /*#__PURE__*/ dual(2, (self, value) => sync(() => set$1(self.ref, value)));
43061
43407
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/UndefinedOr.js
43062
43408
  /**
43063
43409
  * Pattern matches on an `A | undefined` value, running `onDefined` when the
@@ -44054,7 +44400,7 @@ const schema = /*#__PURE__*/ declare(isStream);
44054
44400
  * @since 4.0.0
44055
44401
  */
44056
44402
  function Stream$1(success, error) {
44057
- return make$49(schema.ast, {
44403
+ return make$50(schema.ast, {
44058
44404
  [StreamSchemaTypeId]: StreamSchemaTypeId,
44059
44405
  success,
44060
44406
  error
@@ -44857,7 +45203,7 @@ const compressBody$1 = (body, algorithm, options) => {
44857
45203
  */
44858
45204
  const updateHeaders = (headers, body) => {
44859
45205
  if (body._tag === "Empty" || body._tag === "FormData") return remove$2(remove$2(headers, "content-type"), "content-length");
44860
- headers = body.contentType === void 0 ? remove$2(headers, "content-type") : set$1(headers, "content-type", body.contentType);
45206
+ headers = body.contentType === void 0 ? remove$2(headers, "content-type") : set$2(headers, "content-type", body.contentType);
44861
45207
  return updateContentLength(headers, body);
44862
45208
  };
44863
45209
  /**
@@ -44865,7 +45211,7 @@ const updateHeaders = (headers, body) => {
44865
45211
  */
44866
45212
  const updateContentLength = (headers, body) => {
44867
45213
  const contentLength = body._tag === "Empty" || body._tag === "FormData" ? void 0 : body.contentLength;
44868
- return contentLength === void 0 ? remove$2(headers, "content-length") : set$1(headers, "content-length", contentLength.toString());
45214
+ return contentLength === void 0 ? remove$2(headers, "content-length") : set$2(headers, "content-length", contentLength.toString());
44869
45215
  };
44870
45216
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/Url.js
44871
45217
  /**
@@ -45072,7 +45418,7 @@ const setMethod = /*#__PURE__*/ dual(2, (self, method) => makeWith$1(method, sel
45072
45418
  * @category combinators
45073
45419
  * @since 4.0.0
45074
45420
  */
45075
- const setHeader$1 = /*#__PURE__*/ dual(3, (self, key, value) => makeWith$1(self.method, self.url, self.urlParams, self.hash, set$1(self.headers, key, value), self.body));
45421
+ const setHeader$1 = /*#__PURE__*/ dual(3, (self, key, value) => makeWith$1(self.method, self.url, self.urlParams, self.hash, set$2(self.headers, key, value), self.body));
45076
45422
  /**
45077
45423
  * Sets multiple request headers from an input collection, replacing existing values with matching names.
45078
45424
  *
@@ -45172,7 +45518,7 @@ const setBody$1 = /*#__PURE__*/ dual(2, (self, body) => {
45172
45518
  */
45173
45519
  const compressBody = /*#__PURE__*/ dual((args) => isHttpClientRequest(args[0]), (self, algorithm, options) => {
45174
45520
  if (self.headers["content-encoding"] !== void 0) return succeed$5(self);
45175
- return map$6(compressBody$1(self.body, algorithm, options), (body) => body === self.body ? self : makeWith$1(self.method, self.url, self.urlParams, self.hash, set$1(updateContentLength(self.headers, body), "content-encoding", algorithm), body));
45521
+ return map$6(compressBody$1(self.body, algorithm, options), (body) => body === self.body ? self : makeWith$1(self.method, self.url, self.urlParams, self.hash, set$2(updateContentLength(self.headers, body), "content-encoding", algorithm), body));
45176
45522
  });
45177
45523
  /**
45178
45524
  * Encodes a value as a JSON request body and sets it on the request, failing with `HttpBodyError` if encoding fails.
@@ -45746,6 +46092,14 @@ const endSpanWithStatusError = (fiber, span, request, response) => {
45746
46092
  span.end(fiber.getRef(TracerTimingEnabled) ? fiber.getRef(Clock).currentTimeNanosUnsafe() : BigInt(0), exit);
45747
46093
  };
45748
46094
  /**
46095
+ * Appends an effectful transformation of the request object before sending it.
46096
+ *
46097
+ * @stability unstable
46098
+ * @category mapping
46099
+ * @since 4.0.0
46100
+ */
46101
+ const mapRequestEffect = /*#__PURE__*/ dual(2, (self, f) => makeWith(self.postprocess, (request) => flatMap$3(self.preprocess(request), f)));
46102
+ /**
45749
46103
  * Retries common transient errors, such as rate limiting, timeouts or network issues.
45750
46104
  *
45751
46105
  * **When to use**
@@ -47942,7 +48296,7 @@ function toBinaryASTStep(ast) {
47942
48296
  const getJson = ast.annotations?.toCodecJson;
47943
48297
  const getCodec = ast.annotations?.toCodec;
47944
48298
  if (!isFunction(getJson) && !isFunction(getCodec)) return ast;
47945
- const typeParameters = ast.typeParameters.map((tp) => make$49(toEncoded(tp)));
48299
+ const typeParameters = ast.typeParameters.map((tp) => make$50(toEncoded(tp)));
47946
48300
  const link = (isFunction(getJson) ? getJson(typeParameters) : void 0) ?? (isFunction(getCodec) ? getCodec(typeParameters) : void 0);
47947
48301
  return link === void 0 ? ast : replaceEncoding(ast, [mapLink(link, toBinaryAST)]);
47948
48302
  }
@@ -50378,7 +50732,7 @@ function decodeValueUnchecked(layout, r) {
50378
50732
  const value = r.zigzag();
50379
50733
  const scale = r.zigzag();
50380
50734
  if (scale > MAX_SAFE_BIGINT || -scale > MAX_SAFE_BIGINT) invalid("safe integer length", void 0, r.options);
50381
- return make$58(value, Number(scale));
50735
+ return make$59(value, Number(scale));
50382
50736
  }
50383
50737
  case "json": {
50384
50738
  const text = r.readUtf8(r.end - r.pos);
@@ -50493,7 +50847,7 @@ function compileMode(layout, fingerprint) {
50493
50847
  return fingerprint === true ? fingerprintModeMemo(layout) : defaultMode;
50494
50848
  }
50495
50849
  const compileTargetFromAst = /*#__PURE__*/ memoize((ast) => {
50496
- const raw = make$49(toBinaryAST(ast));
50850
+ const raw = make$50(toBinaryAST(ast));
50497
50851
  const { exact, exitSuccess, layout, recursive } = compileLayout(raw.ast);
50498
50852
  return {
50499
50853
  target: recursive ? withCycleGuard(raw) : raw,
@@ -50512,10 +50866,10 @@ function takeTrusted(trusted, input) {
50512
50866
  return true;
50513
50867
  }
50514
50868
  function bypassPass(target, decodeAccept, encodeAccept) {
50515
- const type = make$49(toType(target.ast));
50869
+ const type = make$50(toType$1(target.ast));
50516
50870
  const parse = decodeUnknownEffect$1(type);
50517
50871
  const run = (accept) => () => (input, _ast, options) => accept(input, options) ? sameExit : parse(input, options);
50518
- return make$49(new Declaration([type.ast], run(decodeAccept), { identifier: "binary value" }, void 0, void 0, void 0, void 0, run(encodeAccept)));
50872
+ return make$50(new Declaration([type.ast], run(decodeAccept), { identifier: "binary value" }, void 0, void 0, void 0, void 0, run(encodeAccept)));
50519
50873
  }
50520
50874
  function reportsExcess(_input, options) {
50521
50875
  return options.onExcessProperty !== "error";
@@ -50536,7 +50890,7 @@ function passThrough(target) {
50536
50890
  return bypassPass(target, reportsExcess, reportsExcess);
50537
50891
  }
50538
50892
  function withCycleGuard(target) {
50539
- const type = make$49(toType(target.ast));
50893
+ const type = make$50(toType$1(target.ast));
50540
50894
  const decoded = /* @__PURE__ */ new WeakSet();
50541
50895
  return decodeTo(declareConstructor()([type], ([type]) => (input, ast, options) => {
50542
50896
  if (isObjectOrArray(input) && decoded.delete(input)) return succeed$5(input);
@@ -50787,7 +51141,7 @@ const RpcGroupProto = {
50787
51141
  });
50788
51142
  },
50789
51143
  annotateRpcs(service, value) {
50790
- return this.annotateRpcsMerge(make$68(service, value));
51144
+ return this.annotateRpcsMerge(make$69(service, value));
50791
51145
  },
50792
51146
  annotateMerge(context) {
50793
51147
  return makeProto({
@@ -51872,7 +52226,7 @@ const stream$1 = (body, options) => {
51872
52226
  * @category combinators
51873
52227
  * @since 4.0.0
51874
52228
  */
51875
- const setHeader = /*#__PURE__*/ dual(3, (self, key, value) => makeResponse(self, set$1(self.headers, key, value)));
52229
+ const setHeader = /*#__PURE__*/ dual(3, (self, key, value) => makeResponse(self, set$2(self.headers, key, value)));
51876
52230
  /**
51877
52231
  * Returns a response with the specified header removed.
51878
52232
  *
@@ -52567,7 +52921,7 @@ const make$22 = /*#__PURE__*/ fnUntraced(function* (impl) {
52567
52921
  const limit = bytesToRead === void 0 ? void 0 : offset + contentLength;
52568
52922
  const start = yield* fileResponseNumber(offset, "offset");
52569
52923
  const end = limit === void 0 ? void 0 : yield* fileResponseNumber(limit, "end");
52570
- const headers = set$1(optionHeaders(options), "etag", toString$1(etag));
52924
+ const headers = set$2(optionHeaders(options), "etag", toString$1(etag));
52571
52925
  if (isSome(info.mtime)) headers["last-modified"] = info.mtime.value.toUTCString();
52572
52926
  return impl.fileResponse(path, options?.status ?? 200, options?.statusText, headers, start, end, contentLength);
52573
52927
  }),
@@ -52584,7 +52938,7 @@ const make$22 = /*#__PURE__*/ fnUntraced(function* (impl) {
52584
52938
  });
52585
52939
  const optionHeaders = (options) => {
52586
52940
  const headers = options?.headers ? fromInput$1(options.headers) : empty$7;
52587
- return options?.contentType ? set$1(headers, "content-type", options.contentType) : headers;
52941
+ return options?.contentType ? set$2(headers, "content-type", options.contentType) : headers;
52588
52942
  };
52589
52943
  const fileResponseSize = (input, field) => {
52590
52944
  const size = fromInput$2(input);
@@ -53670,7 +54024,7 @@ const isMultipartError = (u) => hasProperty(u, MultipartErrorTypeId);
53670
54024
  * @since 4.0.0
53671
54025
  */
53672
54026
  const makeConfig = (headers) => withFiber((fiber) => {
53673
- const mimeTypes = get$10(fiber.context, FieldMimeTypes);
54027
+ const mimeTypes = get$11(fiber.context, FieldMimeTypes);
53674
54028
  return succeed$5({
53675
54029
  headers,
53676
54030
  maxParts: fiber.getRef(MaxParts),
@@ -54698,7 +55052,7 @@ var MiddlewareImpl = class MiddlewareImpl {
54698
55052
  const stack = [getOrUndefinedUnsafe(context$3, fnContextKey)];
54699
55053
  if (this.dependencies) {
54700
55054
  const memoMap = yield* CurrentMemoMap;
54701
- const scope = get$10(context$3, Scope);
55055
+ const scope = get$11(context$3, Scope);
54702
55056
  const depsContext = yield* buildWithMemoMap(this.dependencies, memoMap, scope);
54703
55057
  stack.push(...getMiddleware(depsContext));
54704
55058
  }
@@ -54753,9 +55107,9 @@ const serve = (appLayer, options) => {
54753
55107
  const layerWithRouter = provideMerge(appLayer, options?.routerConfig ? provide$2(layer$18, succeed$6(RouterConfig)(options.routerConfig)) : layer$18);
54754
55108
  return contextWith((context) => {
54755
55109
  const memoMap = CurrentMemoMap.forkOrCreate(context);
54756
- return buildWithMemoMap(layerWithRouter, memoMap, get$10(context, Scope));
55110
+ return buildWithMemoMap(layerWithRouter, memoMap, get$11(context, Scope));
54757
55111
  }).pipe(map$6((context) => {
54758
- const handler = get$10(context, HttpRouter).asHttpEffect();
55112
+ const handler = get$11(context, HttpRouter).asHttpEffect();
54759
55113
  return merge$4(middleware ? serve$1(handler, middleware) : serve$1(handler), succeedContext(context));
54760
55114
  }), unwrap$8, options?.disableListenLog ? identity : withLogAddress);
54761
55115
  };
@@ -54792,9 +55146,9 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
54792
55146
  const concurrency = options.concurrency ?? "unbounded";
54793
55147
  const disableFatalDefects = options.disableFatalDefects ?? false;
54794
55148
  const services = yield* context();
54795
- const scope = get$10(services, Scope);
55149
+ const scope = get$11(services, Scope);
54796
55150
  const trackFiber = runIn(forkUnsafe(scope, "parallel"));
54797
- const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$59(concurrency);
55151
+ const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$60(concurrency);
54798
55152
  const clients = /* @__PURE__ */ new Map();
54799
55153
  let isShutdown = false;
54800
55154
  const shutdownLatch = makeUnsafe$3(false);
@@ -55033,7 +55387,7 @@ const rpcCodecs = (codecFor, rpc) => {
55033
55387
  let codecs = shared ? sharedRpcCodecs.get(rpc) : void 0;
55034
55388
  if (codecs === void 0) {
55035
55389
  const streamSchemas = getStreamSchemas(rpc.successSchema);
55036
- const parseOptions = get$10(rpc.annotations, ParseOptions);
55390
+ const parseOptions = get$11(rpc.annotations, ParseOptions);
55037
55391
  codecs = {
55038
55392
  decode: decodeUnknownEffect(codecFor(rpc.payloadSchema), parseOptions),
55039
55393
  encodeChunk: encodeUnknownEffect(codecFor(NonEmptyArray(isSome(streamSchemas) ? streamSchemas.value.success : Any)), parseOptions),
@@ -55097,7 +55451,7 @@ const make$14 = /*#__PURE__*/ fnUntraced(function* (group, options) {
55097
55451
  const { codecFor, disconnects, end, run, send, supportsAck, supportsSpanPropagation, supportsTransferables } = yield* Protocol;
55098
55452
  const { encodeDefectUnsafe, encodeUnknownRequestExit } = defectCodecs(codecFor);
55099
55453
  const services = yield* context();
55100
- const scope = yield* make$64();
55454
+ const scope = yield* make$65();
55101
55455
  const server = yield* makeNoSerialization(group, {
55102
55456
  ...options,
55103
55457
  disableClientAcks: !supportsAck,
@@ -55158,7 +55512,7 @@ const make$14 = /*#__PURE__*/ fnUntraced(function* (group, options) {
55158
55512
  const exitSchema$1 = exitSchema(rpc);
55159
55513
  discardSchemas = {
55160
55514
  ...schemas,
55161
- encodeExit: encodeUnknownEffect(codecFor(Exit(Void, exitSchema$1.error, exitSchema$1.defect)), get$10(rpc.annotations, ParseOptions))
55515
+ encodeExit: encodeUnknownEffect(codecFor(Exit(Void, exitSchema$1.error, exitSchema$1.defect)), get$11(rpc.annotations, ParseOptions))
55162
55516
  };
55163
55517
  discardSchemasCache.set(rpc, discardSchemas);
55164
55518
  }
@@ -55373,7 +55727,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
55373
55727
  const { encodeDefectUnsafe } = defectCodecs(serialization.codecFor);
55374
55728
  const includesFraming = serialization.includesFraming;
55375
55729
  const isBinary = !serialization.contentType.includes("json");
55376
- const disconnects = yield* make$61();
55730
+ const disconnects = yield* make$62();
55377
55731
  let writeRequest;
55378
55732
  let clientId = 0;
55379
55733
  const clients = /* @__PURE__ */ new Map();
@@ -55386,7 +55740,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
55386
55740
  const requestHeaders = Object.entries(request.headers);
55387
55741
  const data = yield* orDie$2(isBinary ? map$6(request.arrayBuffer, (buf) => new Uint8Array(buf)) : request.text);
55388
55742
  const id = clientId++;
55389
- const queue = yield* make$61({ capacity: includesFraming && options.streamBufferSize !== "unbounded" ? options.streamBufferSize ?? 16 : void 0 });
55743
+ const queue = yield* make$62({ capacity: includesFraming && options.streamBufferSize !== "unbounded" ? options.streamBufferSize ?? 16 : void 0 });
55390
55744
  const parser = serialization.makeUnsafe();
55391
55745
  const requestIds = [];
55392
55746
  const offer$1 = (data) => typeof data === "string" ? offer(queue, encoder.encode(data)) : offer(queue, data);
@@ -55491,7 +55845,7 @@ const layerProtocolHttp = (options) => {
55491
55845
  const makeSocketProtocol = /*#__PURE__*/ gen(function* () {
55492
55846
  const serialization = yield* RpcSerialization;
55493
55847
  const { encodeDefectUnsafe } = defectCodecs(serialization.codecFor);
55494
- const disconnects = yield* make$61();
55848
+ const disconnects = yield* make$62();
55495
55849
  let clientId = 0;
55496
55850
  const clients = /* @__PURE__ */ new Map();
55497
55851
  const clientIds = /* @__PURE__ */ new Set();
@@ -55908,7 +56262,7 @@ const parseTemplate$1 = (texts, values) => {
55908
56262
  const endWord = () => {
55909
56263
  if (word.length === 0) return;
55910
56264
  const value = word.map(unwrap$2).join("");
55911
- words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$54(value) : value);
56265
+ words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$55(value) : value);
55912
56266
  word = [];
55913
56267
  plain = true;
55914
56268
  braceDepth = 0;
@@ -56372,7 +56726,7 @@ const fromReadableChannel = (options) => fromTransform$1((_, scope) => readableT
56372
56726
  */
56373
56727
  const fromDuplex$1 = (options) => fromTransform$1((upstream, scope) => {
56374
56728
  const duplex = options.evaluate();
56375
- const exit = make$47(void 0);
56729
+ const exit = make$48(void 0);
56376
56730
  const latch = makeUnsafe$3(false);
56377
56731
  return pullIntoWritable({
56378
56732
  pull: upstream,
@@ -56483,7 +56837,7 @@ const readableToPullUnsafe = (options) => {
56483
56837
  const readable = options.readable;
56484
56838
  const chunkSize = options.chunkSize ?? 4096;
56485
56839
  const closeOnDone = options.closeOnDone ?? true;
56486
- const exit = options.exit ?? make$47(void 0);
56840
+ const exit = options.exit ?? make$48(void 0);
56487
56841
  const latch = options.latch ?? makeUnsafe$3(false);
56488
56842
  function onReadable() {
56489
56843
  latch.openUnsafe();
@@ -61567,7 +61921,7 @@ const writeFile = (path, data, options) => callback$1((resume, signal) => {
61567
61921
  resume(fail$6(handleBadArgument("writeFile")(err)));
61568
61922
  }
61569
61923
  });
61570
- const makeFileSystem = /*#__PURE__*/ map$6(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$41({
61924
+ const makeFileSystem = /*#__PURE__*/ map$6(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$42({
61571
61925
  access,
61572
61926
  chmod,
61573
61927
  chown,
@@ -62803,7 +63157,7 @@ const fileUrlOps = (windows) => ({
62803
63157
  * @category layers
62804
63158
  * @since 4.0.0
62805
63159
  */
62806
- const layer$9 = /* @__PURE__ */ succeed$6(Path$1)(/*#__PURE__*/ make$40({
63160
+ const layer$9 = /* @__PURE__ */ succeed$6(Path$1)(/*#__PURE__*/ make$41({
62807
63161
  ...Path,
62808
63162
  .../*#__PURE__*/ fileUrlOps(void 0)
62809
63163
  }));
@@ -62874,7 +63228,7 @@ const layer$7 = /* @__PURE__ */ succeed$6(Stdio, /*#__PURE__*/ make$33({
62874
63228
  const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
62875
63229
  const stdin = process.stdin;
62876
63230
  const stdout = process.stdout;
62877
- const lines = yield* make$61();
63231
+ const lines = yield* make$62();
62878
63232
  let inputEnded = stdin.readableEnded;
62879
63233
  let readlineActive = false;
62880
63234
  const onStdinEnd = () => {
@@ -62883,7 +63237,7 @@ const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
62883
63237
  };
62884
63238
  stdin.once("end", onStdinEnd);
62885
63239
  yield* addFinalizer(() => sync(() => stdin.off("end", onStdinEnd)));
62886
- const rlRef = yield* make$43({
63240
+ const rlRef = yield* make$44({
62887
63241
  acquire: acquireRelease(sync(() => {
62888
63242
  const rl = readline.createInterface({
62889
63243
  input: stdin,
@@ -62915,7 +63269,7 @@ const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
62915
63269
  const setRawMode = (enabled) => sync(() => {
62916
63270
  if (stdin.isTTY) stdin.setRawMode(enabled);
62917
63271
  });
62918
- const rawModeRef = yield* make$43({
63272
+ const rawModeRef = yield* make$44({
62919
63273
  acquire: acquireRelease(setRawMode(true), () => setRawMode(false)),
62920
63274
  idleTimeToLive: "10 millis"
62921
63275
  });
@@ -62936,7 +63290,7 @@ const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
62936
63290
  return queue;
62937
63291
  });
62938
63292
  const readInput = gen(function* () {
62939
- const queue = yield* make$61();
63293
+ const queue = yield* make$62();
62940
63294
  const handleKeypress = (s, k) => {
62941
63295
  const userInput = {
62942
63296
  input: fromUndefinedOr(s),
@@ -62963,14 +63317,14 @@ const layer$6 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
62963
63317
  stdin.on("keypress", handleKeypress);
62964
63318
  if (inputEnded) handleEnd();
62965
63319
  else {
62966
- yield* get$4(rlRef);
62967
- yield* get$4(rawModeRef);
63320
+ yield* get$5(rlRef);
63321
+ yield* get$5(rawModeRef);
62968
63322
  stdin.once("end", handleEnd);
62969
63323
  }
62970
63324
  return queue;
62971
63325
  });
62972
63326
  const readLine = suspend$2(() => poll(lines).pipe(flatMap$3(match$8({
62973
- onNone: () => scoped(andThen(get$4(rlRef), take(lines))),
63327
+ onNone: () => scoped(andThen(get$5(rlRef), take(lines))),
62974
63328
  onSome: succeed$5
62975
63329
  })), mapError$2(() => new QuitError({}))));
62976
63330
  const display = (prompt) => uninterruptible(callback$1((resume) => {
@@ -65063,7 +65417,7 @@ const map$2 = /*#__PURE__*/ dual(2, (self, f) => flatMap(self, (a) => succeed(f(
65063
65417
  * @category constructors
65064
65418
  * @since 4.0.0
65065
65419
  */
65066
- const Password = (options) => basePrompt(options, "password").pipe(map$2(make$54));
65420
+ const Password = (options) => basePrompt(options, "password").pipe(map$2(make$55));
65067
65421
  /**
65068
65422
  * Runs a prompt by reading terminal input and rendering prompt frames until the
65069
65423
  * prompt submits a value.
@@ -67087,7 +67441,7 @@ const Formatter = /*#__PURE__*/ Reference("effect/cli/CliOutput", { defaultValue
67087
67441
  */
67088
67442
  const defaultPresenter = { present: /*#__PURE__*/ fnUntraced(function* (event) {
67089
67443
  const context$2 = yield* context();
67090
- const formatter = getOrUndefined(context$2, Formatter) ?? defaultFormatter({ colors: get$10(context$2, TerminalCapabilities).canColor });
67444
+ const formatter = getOrUndefined(context$2, Formatter) ?? defaultFormatter({ colors: get$11(context$2, TerminalCapabilities).canColor });
67091
67445
  switch (event._tag) {
67092
67446
  case "Help": return yield* log(formatter.formatHelpDoc(event.helpDoc));
67093
67447
  case "InvalidInvocation":
@@ -69482,7 +69836,7 @@ const defaults = { builtIns: BuiltIns };
69482
69836
  *
69483
69837
  * @internal
69484
69838
  */
69485
- const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$5(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$10(context, TerminalCapabilities).canColor })));
69839
+ const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$5(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$11(context, TerminalCapabilities).canColor })));
69486
69840
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/cli/internal/lexer.js
69487
69841
  /**
69488
69842
  * @internal
@@ -70951,7 +71305,7 @@ const runWith = (command, config) => {
70951
71305
  }
70952
71306
  const services = match$8(logLevel, {
70953
71307
  onNone: () => empty$14(),
70954
- onSome: (level) => make$68(MinimumLogLevel, level)
71308
+ onSome: (level) => make$69(MinimumLogLevel, level)
70955
71309
  });
70956
71310
  yield* provideContext$2(program, services);
70957
71311
  }, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$9(error) : fail$11(error), (error) => andThen(showHelp(command, error, config.renderErrors !== false), fail$6(error))), catchFilter((error) => {
@@ -71469,17 +71823,17 @@ const layerFlusher = /*#__PURE__*/ sync$1(Flusher, () => {
71469
71823
  */
71470
71824
  const make$3 = /*#__PURE__*/ fnUntraced(function* (options) {
71471
71825
  const services = yield* context();
71472
- const clock = get$10(services, Clock);
71473
- const scope = get$10(services, Scope);
71826
+ const clock = get$11(services, Clock);
71827
+ const scope = get$11(services, Scope);
71474
71828
  const exportInterval = max(fromInputUnsafe$1(options.exportInterval), zero$2);
71475
- const client = get$10(services, HttpClient).pipe(tap((response) => ignore$1(response.arrayBuffer)), tapError((error) => error.response ? ignore$1(error.response.arrayBuffer) : void_$1), filterStatusOk, transformResponse(provideService(TracerPropagationEnabled, false)), retryTransient({
71829
+ const client = get$11(services, HttpClient).pipe(tap((response) => ignore$1(response.arrayBuffer)), tapError((error) => error.response ? ignore$1(error.response.arrayBuffer) : void_$1), filterStatusOk, transformResponse(provideService(TracerPropagationEnabled, false)), retryTransient({
71476
71830
  schedule: policy,
71477
71831
  times: 3
71478
71832
  }));
71479
71833
  const exporterUserAgent = `OTel-OTLP-Exporter-JavaScript-Effect-${options.label}/${getCurrentVersion()}`;
71480
71834
  const userHeaders = fromInput$1(options.headers);
71481
71835
  const userAgent = userHeaders["user-agent"];
71482
- const headers = set$1(userHeaders, "user-agent", userAgent ? `${userAgent} ${exporterUserAgent}` : exporterUserAgent);
71836
+ const headers = set$2(userHeaders, "user-agent", userAgent ? `${userAgent} ${exporterUserAgent}` : exporterUserAgent);
71483
71837
  const request = post(options.url, { headers });
71484
71838
  const exportsEmpty = options.maxBatchSize === "disabled" && options.exportEmpty === true;
71485
71839
  let buffer = [];
@@ -71506,15 +71860,15 @@ const make$3 = /*#__PURE__*/ fnUntraced(function* (options) {
71506
71860
  package: "@effect/opentelemetry",
71507
71861
  module: options.label
71508
71862
  }));
71509
- const exportFibers = yield* make$37();
71863
+ const exportFibers = yield* make$38();
71510
71864
  const runExportFork = yield* runtime(exportFibers)();
71511
71865
  yield* addFinalizer$1(scope, suspend$2(() => {
71512
71866
  if (disabledUntil !== void 0) return void_$1;
71513
71867
  runExportFork(runExport);
71514
71868
  return awaitEmpty(exportFibers);
71515
71869
  }).pipe(ignore$1, interruptible, timeoutOption(options.shutdownTimeout)));
71516
- const armed = yield* make$48(exportsEmpty);
71517
- const wake = yield* make$48();
71870
+ const armed = yield* make$49(exportsEmpty);
71871
+ const wake = yield* make$49();
71518
71872
  const disarmIfEmpty = sync(() => {
71519
71873
  if (exportsEmpty || buffer.length > 0 || !armed.closeUnsafe()) return;
71520
71874
  wake.openUnsafe();
@@ -71761,7 +72115,7 @@ const make$1 = /*#__PURE__*/ fnUntraced(function* (options) {
71761
72115
  excludeLogSpans: options.excludeLogSpans ?? false,
71762
72116
  clock: yield* Clock
71763
72117
  };
71764
- return make$36((options) => {
72118
+ return make$37((options) => {
71765
72119
  exporter.push(makeLogRecord(options, opts));
71766
72120
  });
71767
72121
  });
@@ -71886,7 +72240,7 @@ const layer = /*#__PURE__*/ flow(/* @__PURE__ */ fnUntraced(function* (options)
71886
72240
  if (!span.sampled) return;
71887
72241
  exporter.push(makeOtlpSpan(span));
71888
72242
  }
71889
- return make$65({
72243
+ return make$66({
71890
72244
  span(options) {
71891
72245
  return new SpanImpl(options, exportFn);
71892
72246
  },
@@ -72111,6 +72465,71 @@ function failureOptions(error, status) {
72111
72465
  }
72112
72466
  var CurrentUser = class extends Service$1()("@deslop/runtime/auth/lib/utils/CurrentUser") {};
72113
72467
  var RpcAuth = class extends Service()("@deslop/runtime/auth/lib/utils/RpcAuth", { error: AuthError }) {};
72468
+ Literals([
72469
+ "anthropic",
72470
+ "openrouter",
72471
+ "opencode-zen",
72472
+ "opencode-go"
72473
+ ]);
72474
+ // ../../packages/runtime/src/ai/service.ts
72475
+ var AiUnavailable = class extends TaggedError()("AiUnavailable", { message: String$6 }) {};
72476
+ fromJsonString(Struct({ error: Struct({ message: String$6 }) }));
72477
+ var AiGateway = class AiGateway extends Service$1()("@deslop/runtime/ai/service/AiGateway") {
72478
+ static layer = effect(this, gen(function* () {
72479
+ const gateway = yield* option(String$5("GATEWAY_URL"));
72480
+ const local = yield* localAuth;
72481
+ const app = yield* String$5("APP_URL");
72482
+ const client = yield* HttpClient;
72483
+ const store = toSchemaStore(yield* KeyValueStore, Record$1(String$6, RedactedFromValue(String$6)));
72484
+ const grants = yield* make$36(getOrElse(yield* store.get("ai-gateway-grants"), () => ({})));
72485
+ const lock = yield* make$60(1);
72486
+ return AiGateway.of({
72487
+ apiUrl: (provider) => match$8(gateway, {
72488
+ onNone: () => fail$6(AiUnavailable.make({ message: "Start the app with --gateway" })),
72489
+ onSome: (url) => succeed$5(`${url}/ai/${provider}${match$1(provider === "openrouter", {
72490
+ onFalse: () => "",
72491
+ onTrue: () => "/v1"
72492
+ })}`)
72493
+ }),
72494
+ authorize: (userId) => (http) => pipe(mapRequestEffect(http, (request) => gen(function* () {
72495
+ if (local) return request;
72496
+ const token = (yield* get$4(grants))[userId];
72497
+ if (token === void 0) return yield* new HttpClientError({ reason: new TransportError({
72498
+ description: "AI access is unavailable; sign in again to enroll with Gateway",
72499
+ request
72500
+ }) });
72501
+ return setHeader$1(request, "authorization", `Bearer ${value(token)}`);
72502
+ })), tap((response) => pipe(gen(function* () {
72503
+ if (local || response.headers["x-gateway-grant-refused"] === void 0 || !exists(gateway, (url) => startsWith(`${url}/ai/`)(response.request.url))) return;
72504
+ const current = yield* get$4(grants);
72505
+ const token = current[userId];
72506
+ if (token === void 0 || response.request.headers["authorization"] !== `Bearer ${value(token)}`) return;
72507
+ const next = remove$4(current, userId);
72508
+ yield* pipe(store.set("ai-gateway-grants", next), ignore$1({
72509
+ log: "Warn",
72510
+ message: "The rejected AI grant could not be removed from storage"
72511
+ }));
72512
+ yield* set(grants, next);
72513
+ }), withPermit(lock)))),
72514
+ enroll: fnUntraced(function* (userId, headers) {
72515
+ return yield* pipe(gen(function* () {
72516
+ if (local || isNone(gateway) || (yield* get$4(grants))[userId] !== void 0) return;
72517
+ const response = yield* client.execute(yield* bodyJson(post(`${getOrElse(gateway, () => "")}/ai/grants`, { headers: match$1(headers["authorization"] !== void 0, {
72518
+ onFalse: () => ({ cookie: headers["cookie"] ?? "" }),
72519
+ onTrue: () => ({ authorization: headers["authorization"] })
72520
+ }) }), { app }));
72521
+ const result = yield* schemaBodyJson(Struct({ token: String$6 }))(response);
72522
+ const next = {
72523
+ ...yield* get$4(grants),
72524
+ [userId]: make$55(result.token)
72525
+ };
72526
+ yield* store.set("ai-gateway-grants", next);
72527
+ yield* set(grants, next);
72528
+ }), withPermit(lock), timeout$1("10 seconds"), catch_$1(() => logWarning("AI Gateway enrollment failed")));
72529
+ })
72530
+ });
72531
+ }));
72532
+ };
72114
72533
  // ../../packages/runtime/src/auth/service.ts
72115
72534
  function rejected(message) {
72116
72535
  return mapError$2((cause) => {
@@ -72129,12 +72548,18 @@ function rejected(message) {
72129
72548
  function developer() {
72130
72549
  return succeed$5(DEVELOPER);
72131
72550
  }
72551
+ function enrolled(user, headers) {
72552
+ return gen(function* () {
72553
+ const gateway = getOrUndefined(yield* context(), AiGateway);
72554
+ if (gateway !== void 0) yield* gateway.enroll(user.id, headers);
72555
+ });
72556
+ }
72132
72557
  const unavailable = text$2("The authorization service is temporarily unavailable; retry later", {
72133
72558
  headers: { "retry-after": "5" },
72134
72559
  status: 503
72135
72560
  });
72136
72561
  var Auth = class Auth extends Service$1()("@deslop/runtime/auth/service/Auth") {
72137
- static makeContext = (auth) => pipe(make$68(Auth, auth), add$2(RpcAuth, RpcAuth.of((effect, request) => pipe(auth.user(request.headers), tap$1(() => {
72562
+ static makeContext = (auth) => pipe(make$69(Auth, auth), add$2(RpcAuth, RpcAuth.of((effect, request) => pipe(auth.user(request.headers), tap$1((user) => enrolled(user, request.headers)), tap$1(() => {
72138
72563
  if (isStreamSchema(request.rpc.successSchema)) return annotateCurrentSpan("rpc.stream", true);
72139
72564
  return void_$1;
72140
72565
  }), flatMap$3((user) => raceFirst(provideService(effect, CurrentUser, user), pipe(delay(auth.user(request.headers), "5 minutes"), retry({ while: (error) => error.error === "temporarily_unavailable" }), forever)))))));
@@ -72155,7 +72580,7 @@ var Auth = class Auth extends Service$1()("@deslop/runtime/auth/service/Auth") {
72155
72580
  return Auth.makeContext(Auth.of({
72156
72581
  access,
72157
72582
  user: fn("Auth.user")(function* (headers) {
72158
- if (isSome(get$6(headers, "authorization"))) return yield* access(headers, canonical);
72583
+ if (isSome(get$7(headers, "authorization"))) return yield* access(headers, canonical);
72159
72584
  return yield* pipe(client.get(new URL(SESSION_PATH, issuer).href, { headers: { cookie: headers["cookie"] ?? "" } }), flatMap$3(schemaBodyJson(User)), timeout$1("10 seconds"));
72160
72585
  }, rejected("Sign in first"))
72161
72586
  }));
@@ -72169,6 +72594,7 @@ middleware()(gen(function* () {
72169
72594
  if (user.failure.error === "temporarily_unavailable") return unavailable;
72170
72595
  return text$2("Sign in first", { status: 401 });
72171
72596
  }
72597
+ yield* enrolled(user.success, (yield* HttpServerRequest).headers);
72172
72598
  return yield* provideService(app, CurrentUser, user.success);
72173
72599
  });
72174
72600
  }));
@@ -72239,7 +72665,7 @@ function layerKeyValueStore(directory) {
72239
72665
  const base = yield* KeyValueStore;
72240
72666
  const fs = yield* FileSystem;
72241
72667
  const path = yield* Path$1;
72242
- const writes = yield* make$59(1);
72668
+ const writes = yield* make$60(1);
72243
72669
  return make$35({
72244
72670
  ...omit(base, [
72245
72671
  "set",
@@ -72527,6 +72953,11 @@ const SETTINGS = {
72527
72953
  flag: "auth",
72528
72954
  schema: SecureOrigin
72529
72955
  },
72956
+ GATEWAY_URL: {
72957
+ description: "Deslop Gateway origin for AI calls",
72958
+ flag: "gateway",
72959
+ schema: Origin
72960
+ },
72530
72961
  HOST: {
72531
72962
  description: `Listen address; defaults to ${DEFAULT_HOST}`,
72532
72963
  flag: "host",
@@ -72558,7 +72989,7 @@ function server(app) {
72558
72989
  return pipe(serve(pipe(mergeAll$1(app.routes, layerRoutes, layerIcon(app.icon), layerWeb, layerAnnounce), provide$2(match$8(fromUndefinedOr(app.middleware), {
72559
72990
  onNone: () => empty$10,
72560
72991
  onSome: (middleware$1) => middleware()(middleware$1).layer
72561
- })), provide$2(Auth.layer)), {
72992
+ })), provide$2(Auth.layer), provideMerge(pipe(AiGateway.layer, provide$2(layerDataStore)))), {
72562
72993
  disableLogger: true,
72563
72994
  middleware: guard
72564
72995
  }), provide$2(mergeAll$1(layerProtocol, match$1(app.telemetry === false, {
@@ -72567,7 +72998,7 @@ function server(app) {
72567
72998
  }))), provide$2(layerNodeHttpServer), provide$2(layerPlatform), launch);
72568
72999
  }
72569
73000
  function output(text) {
72570
- return flatMap$3(Stdio, (stdio) => run$4(make$42(text), stdio.stdout()));
73001
+ return flatMap$3(Stdio, (stdio) => run$4(make$43(text), stdio.stdout()));
72571
73002
  }
72572
73003
  function runApp(app) {
72573
73004
  const program = gen(function* () {
@@ -119495,7 +119926,7 @@ function postFrom(entry) {
119495
119926
  return pipe(fromNullishOr(TITLE.exec(trim(entry.title))?.groups), flatMap$8((groups) => all$4({
119496
119927
  links: liftPredicate(dedupe(map$9(fromIterable$6(matchAll(CUBARI_LINKS)(entry.content)), (match) => match[0])), isArrayNonEmpty),
119497
119928
  number: parse$9(groups["number"] ?? ""),
119498
- postedAt: map$12(make$55(entry.published), toEpochMillis),
119929
+ postedAt: map$12(make$56(entry.published), toEpochMillis),
119499
119930
  revised: some$2(includes("revised")(toLowerCase(groups["tags"] ?? ""))),
119500
119931
  series: some$2(seriesFromTags(groups["tags"] ?? ""))
119501
119932
  })));
@@ -119589,7 +120020,7 @@ function change(chapters, key, update) {
119589
120020
  }
119590
120021
  function changed(chapters, before) {
119591
120022
  const previous = fromIterable$4(map$9(before, (chapter) => [keyOf(chapter), chapter]));
119592
- return filter$4(chapters, (chapter) => !exists(get$7(previous, keyOf(chapter)), (item) => item === chapter));
120023
+ return filter$4(chapters, (chapter) => !exists(get$8(previous, keyOf(chapter)), (item) => item === chapter));
119593
120024
  }
119594
120025
  function postsOf(feed) {
119595
120026
  const $ = load(feed, { xml: true });
@@ -119679,7 +120110,7 @@ var Chapters = class Chapters extends Service$1()("@deslop/opm/services/chapters
119679
120110
  const posts = sort([...ARCHIVE_POSTS, ...flatten$4(getSomes(feeds))], mapInput(Number$6, (post) => post.postedAt));
119680
120111
  const known = fromIterable$4(map$9(yield* get$2(state), (chapter) => [keyOf(chapter), chapter]));
119681
120112
  const now = yield* currentTimeMillis;
119682
- const candidates = filterMap(posts, (post) => match$6(filter$4(post.links, (link) => match$8(get$7(known, keyOf(post)), {
120113
+ const candidates = filterMap(posts, (post) => match$6(filter$4(post.links, (link) => match$8(get$8(known, keyOf(post)), {
119683
120114
  onNone: () => true,
119684
120115
  onSome: (item) => post.revised && post.postedAt > (item.revisedAt ?? item.postedAt) && link !== item.source
119685
120116
  })), {
@@ -119692,7 +120123,7 @@ var Chapters = class Chapters extends Service$1()("@deslop/opm/services/chapters
119692
120123
  const found = yield* forEach$1(toEntries(groupBy(candidates, (candidate) => keyOf(candidate.post))), (entry) => pipe(firstSuccessOf(flatMap$6(entry[1], (candidate) => map$9(candidate.links, (link) => resolve(candidate.post, link)))), asSome, tapError$3((error) => logWarning(`Chapter ${entry[0]} has no readable pages`, error)), orElseSucceed(none)), { concurrency: 1 });
119693
120124
  const loaded = fromIterable$4(map$9(getSomes(found), (chapter) => [keyOf(chapter), chapter]));
119694
120125
  yield* save((current) => {
119695
- const revised = map$9(current, (item) => match$8(get$7(loaded, keyOf(item)), {
120126
+ const revised = map$9(current, (item) => match$8(get$8(loaded, keyOf(item)), {
119696
120127
  onNone: () => item,
119697
120128
  onSome: (chapter) => ({
119698
120129
  ...item,