@glasser-ai/cli 0.1.133 → 0.1.135

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/glasser.js +547 -310
  2. package/package.json +1 -1
package/dist/glasser.js CHANGED
@@ -22,9 +22,9 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
22
22
  var __commonJS = (cb, mod) => function __require2() {
23
23
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
24
  };
25
- var __export = (target, all5) => {
26
- for (var name in all5)
27
- __defProp(target, name, { get: all5[name], enumerable: true });
25
+ var __export = (target, all6) => {
26
+ for (var name in all6)
27
+ __defProp(target, name, { get: all6[name], enumerable: true });
28
28
  };
29
29
  var __copyProps = (to, from, except, desc) => {
30
30
  if (from && typeof from === "object" || typeof from === "function") {
@@ -14856,7 +14856,7 @@ var require_snapshot_recorder = __commonJS({
14856
14856
  "../../node_modules/@effect/platform-node/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
14857
14857
  "use strict";
14858
14858
  var { writeFile: writeFile3, readFile: readFile3, mkdir: mkdir2 } = __require("node:fs/promises");
14859
- var { dirname: dirname2, resolve: resolve4 } = __require("node:path");
14859
+ var { dirname: dirname3, resolve: resolve4 } = __require("node:path");
14860
14860
  var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
14861
14861
  var { InvalidArgumentError, UndiciError } = require_errors();
14862
14862
  var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
@@ -15102,7 +15102,7 @@ var require_snapshot_recorder = __commonJS({
15102
15102
  throw new InvalidArgumentError("Snapshot path is required");
15103
15103
  }
15104
15104
  const resolvedPath = resolve4(path10);
15105
- await mkdir2(dirname2(resolvedPath), { recursive: true });
15105
+ await mkdir2(dirname3(resolvedPath), { recursive: true });
15106
15106
  const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot2]) => ({
15107
15107
  hash: hash2,
15108
15108
  snapshot: snapshot2
@@ -28462,6 +28462,7 @@ var succeed = (success) => {
28462
28462
  };
28463
28463
  var getFailure = (self) => isSuccess(self) ? none : some(self.failure);
28464
28464
  var getSuccess = (self) => isFailure(self) ? none : some(self.success);
28465
+ var fromOption = /* @__PURE__ */ dual(2, (self, onNone2) => isNone(self) ? fail(onNone2()) : succeed(self.value));
28465
28466
 
28466
28467
  // ../../node_modules/effect/dist/Order.js
28467
28468
  function make4(compare) {
@@ -28664,8 +28665,55 @@ function makeReducerFailFast(reducer2) {
28664
28665
  }
28665
28666
 
28666
28667
  // ../../node_modules/effect/dist/Result.js
28668
+ var Result_exports = {};
28669
+ __export(Result_exports, {
28670
+ Do: () => Do2,
28671
+ all: () => all2,
28672
+ andThen: () => andThen2,
28673
+ bind: () => bind3,
28674
+ bindTo: () => bindTo3,
28675
+ fail: () => fail2,
28676
+ failVoid: () => failVoid,
28677
+ filterOrFail: () => filterOrFail,
28678
+ flatMap: () => flatMap2,
28679
+ flip: () => flip,
28680
+ fromNullishOr: () => fromNullishOr2,
28681
+ fromOption: () => fromOption2,
28682
+ gen: () => gen2,
28683
+ getFailure: () => getFailure3,
28684
+ getOrElse: () => getOrElse2,
28685
+ getOrNull: () => getOrNull2,
28686
+ getOrThrow: () => getOrThrow2,
28687
+ getOrThrowWith: () => getOrThrowWith2,
28688
+ getOrUndefined: () => getOrUndefined2,
28689
+ getSuccess: () => getSuccess3,
28690
+ isFailure: () => isFailure2,
28691
+ isResult: () => isResult2,
28692
+ isSuccess: () => isSuccess2,
28693
+ let: () => let_3,
28694
+ liftPredicate: () => liftPredicate2,
28695
+ makeEquivalence: () => makeEquivalence2,
28696
+ map: () => map2,
28697
+ mapBoth: () => mapBoth,
28698
+ mapError: () => mapError,
28699
+ match: () => match2,
28700
+ merge: () => merge,
28701
+ orElse: () => orElse2,
28702
+ succeed: () => succeed2,
28703
+ succeedNone: () => succeedNone,
28704
+ succeedSome: () => succeedSome,
28705
+ tap: () => tap2,
28706
+ transposeMapOption: () => transposeMapOption,
28707
+ transposeOption: () => transposeOption,
28708
+ try: () => try_,
28709
+ void: () => void_2
28710
+ });
28667
28711
  var succeed2 = succeed;
28668
28712
  var fail2 = fail;
28713
+ var void_2 = /* @__PURE__ */ succeed2(void 0);
28714
+ var failVoid = /* @__PURE__ */ fail2(void 0);
28715
+ var fromNullishOr2 = /* @__PURE__ */ dual(2, (self, onNullish) => self == null ? fail2(onNullish(self)) : succeed2(self));
28716
+ var fromOption2 = fromOption;
28669
28717
  var try_ = (evaluate2) => {
28670
28718
  if (isFunction(evaluate2)) {
28671
28719
  try {
@@ -28684,15 +28732,92 @@ var try_ = (evaluate2) => {
28684
28732
  var isResult2 = isResult;
28685
28733
  var isFailure2 = isFailure;
28686
28734
  var isSuccess2 = isSuccess;
28735
+ var getSuccess3 = getSuccess;
28736
+ var getFailure3 = getFailure;
28687
28737
  var makeEquivalence2 = (success, failure) => make2((x, y) => isFailure2(x) ? isFailure2(y) && failure(x.failure, y.failure) : isSuccess2(y) && success(x.success, y.success));
28738
+ var mapBoth = /* @__PURE__ */ dual(2, (self, {
28739
+ onFailure,
28740
+ onSuccess
28741
+ }) => isFailure2(self) ? fail2(onFailure(self.failure)) : succeed2(onSuccess(self.success)));
28688
28742
  var mapError = /* @__PURE__ */ dual(2, (self, f) => isFailure2(self) ? fail2(f(self.failure)) : self);
28689
28743
  var map2 = /* @__PURE__ */ dual(2, (self, f) => isSuccess2(self) ? succeed2(f(self.success)) : self);
28690
28744
  var match2 = /* @__PURE__ */ dual(2, (self, {
28691
28745
  onFailure,
28692
28746
  onSuccess
28693
28747
  }) => isFailure2(self) ? onFailure(self.failure) : onSuccess(self.success));
28748
+ var liftPredicate2 = /* @__PURE__ */ dual(3, (a, predicate, orFailWith) => predicate(a) ? succeed2(a) : fail2(orFailWith(a)));
28749
+ var filterOrFail = /* @__PURE__ */ dual(3, (self, predicate, orFailWith) => flatMap2(self, (a) => predicate(a) ? succeed2(a) : fail2(orFailWith(a))));
28750
+ var merge = /* @__PURE__ */ match2({
28751
+ onFailure: identity,
28752
+ onSuccess: identity
28753
+ });
28694
28754
  var getOrElse2 = /* @__PURE__ */ dual(2, (self, onFailure) => isFailure2(self) ? onFailure(self.failure) : self.success);
28755
+ var getOrNull2 = /* @__PURE__ */ getOrElse2(constNull);
28756
+ var getOrUndefined2 = /* @__PURE__ */ getOrElse2(constUndefined);
28757
+ var getOrThrowWith2 = /* @__PURE__ */ dual(2, (self, onFailure) => {
28758
+ if (isSuccess2(self)) {
28759
+ return self.success;
28760
+ }
28761
+ throw onFailure(self.failure);
28762
+ });
28763
+ var getOrThrow2 = /* @__PURE__ */ getOrThrowWith2(identity);
28764
+ var orElse2 = /* @__PURE__ */ dual(2, (self, that) => isFailure2(self) ? that(self.failure) : succeed2(self.success));
28695
28765
  var flatMap2 = /* @__PURE__ */ dual(2, (self, f) => isFailure2(self) ? fail2(self.failure) : f(self.success));
28766
+ var andThen2 = /* @__PURE__ */ dual(2, (self, f) => flatMap2(self, (a) => {
28767
+ const out = isFunction(f) ? f(a) : f;
28768
+ return isResult2(out) ? out : succeed2(out);
28769
+ }));
28770
+ var all2 = (input) => {
28771
+ if (Symbol.iterator in input) {
28772
+ const out2 = [];
28773
+ for (const e of input) {
28774
+ if (isFailure2(e)) {
28775
+ return e;
28776
+ }
28777
+ out2.push(e.success);
28778
+ }
28779
+ return succeed2(out2);
28780
+ }
28781
+ const out = {};
28782
+ for (const key of Object.keys(input)) {
28783
+ const e = input[key];
28784
+ if (isFailure2(e)) {
28785
+ return e;
28786
+ }
28787
+ assignProperty(out, key, e.success);
28788
+ }
28789
+ return succeed2(out);
28790
+ };
28791
+ var flip = (self) => isFailure2(self) ? succeed2(self.failure) : fail2(self.success);
28792
+ var gen2 = (...args2) => {
28793
+ const f = args2.length === 1 ? args2[0] : args2[1].bind(args2[0]);
28794
+ const iterator = f();
28795
+ let state = iterator.next();
28796
+ while (!state.done) {
28797
+ const current = state.value;
28798
+ if (isFailure2(current)) {
28799
+ return current;
28800
+ }
28801
+ state = iterator.next(current.success);
28802
+ }
28803
+ return succeed2(state.value);
28804
+ };
28805
+ var Do2 = /* @__PURE__ */ succeed2({});
28806
+ var bind3 = /* @__PURE__ */ bind(map2, flatMap2);
28807
+ var bindTo3 = /* @__PURE__ */ bindTo(map2);
28808
+ var let_3 = /* @__PURE__ */ let_(map2);
28809
+ var transposeOption = (self) => {
28810
+ return isNone(self) ? succeedNone : map2(self.value, some);
28811
+ };
28812
+ var transposeMapOption = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? succeedNone : map2(f(self.value), some));
28813
+ var succeedNone = /* @__PURE__ */ succeed2(none);
28814
+ var succeedSome = (a) => succeed2(some(a));
28815
+ var tap2 = /* @__PURE__ */ dual(2, (self, f) => {
28816
+ if (isSuccess2(self)) {
28817
+ f(self.success);
28818
+ }
28819
+ return self;
28820
+ });
28696
28821
 
28697
28822
  // ../../node_modules/effect/dist/Tuple.js
28698
28823
  var makeEquivalence3 = Tuple;
@@ -28912,7 +29037,7 @@ __export(Context_exports, {
28912
29037
  get: () => get,
28913
29038
  getOption: () => getOption,
28914
29039
  getOrElse: () => getOrElse3,
28915
- getOrUndefined: () => getOrUndefined2,
29040
+ getOrUndefined: () => getOrUndefined3,
28916
29041
  getOrUndefinedUnsafe: () => getOrUndefinedUnsafe,
28917
29042
  getUnsafe: () => getUnsafe,
28918
29043
  hasSameCache: () => hasSameCache,
@@ -28921,7 +29046,7 @@ __export(Context_exports, {
28921
29046
  isReference: () => isReference,
28922
29047
  make: () => make5,
28923
29048
  makeUnsafe: () => makeUnsafe,
28924
- merge: () => merge,
29049
+ merge: () => merge2,
28925
29050
  mergeAll: () => mergeAll,
28926
29051
  omit: () => omit,
28927
29052
  pick: () => pick
@@ -29086,12 +29211,12 @@ var addUnsafe = (self, key, service3) => {
29086
29211
  }, impl.depth + 1);
29087
29212
  };
29088
29213
  var addOrOmit = /* @__PURE__ */ dual(3, (self, key, service3) => service3._tag === "None" ? omit(key)(self) : add(self, key, service3.value));
29089
- var getOrElse3 = /* @__PURE__ */ dual(3, (self, key, orElse7) => {
29214
+ var getOrElse3 = /* @__PURE__ */ dual(3, (self, key, orElse8) => {
29090
29215
  const value3 = lookup(self, key.key);
29091
29216
  if (value3 !== notFound) return value3;
29092
- return isReference(key) ? getDefaultValue(key) : orElse7();
29217
+ return isReference(key) ? getDefaultValue(key) : orElse8();
29093
29218
  });
29094
- var getOrUndefined2 = /* @__PURE__ */ dual(2, (self, key) => getOrUndefinedUnsafe(self, key.key));
29219
+ var getOrUndefined3 = /* @__PURE__ */ dual(2, (self, key) => getOrUndefinedUnsafe(self, key.key));
29095
29220
  var getOrUndefinedUnsafe = (self, key) => {
29096
29221
  const value3 = lookup(self, key);
29097
29222
  return value3 === notFound ? void 0 : value3;
@@ -29126,7 +29251,7 @@ var getOption = /* @__PURE__ */ dual(2, (self, service3) => {
29126
29251
  if (value3 !== notFound) return some2(value3);
29127
29252
  return isReference(service3) ? some2(getDefaultValue(service3)) : none2();
29128
29253
  });
29129
- var merge = /* @__PURE__ */ dual(2, (self, that) => {
29254
+ var merge2 = /* @__PURE__ */ dual(2, (self, that) => {
29130
29255
  if (self.mapUnsafe.size === 0) return that;
29131
29256
  if (that.mapUnsafe.size === 0) return self;
29132
29257
  return withFlat(self, (map18) => that.mapUnsafe.forEach((value3, key) => map18.set(key, value3)));
@@ -30775,7 +30900,7 @@ var fiberAwaitAll = (self) => callback((resume) => {
30775
30900
  var fiberInterrupt = (self) => withFiber((fiber3) => fiberInterruptAs(self, fiber3.id));
30776
30901
  var fiberInterruptAs = /* @__PURE__ */ dual((args2) => hasProperty(args2[0], FiberTypeId), (self, fiberId3, annotations2) => withFiber((parent) => {
30777
30902
  let ann = fiberStackAnnotations(parent);
30778
- ann = ann && annotations2 ? merge(ann, annotations2) : ann ?? annotations2;
30903
+ ann = ann && annotations2 ? merge2(ann, annotations2) : ann ?? annotations2;
30779
30904
  self.interruptUnsafe(fiberId3, ann);
30780
30905
  return asVoid2(fiberAwait(self));
30781
30906
  }));
@@ -30805,12 +30930,12 @@ var suspend = /* @__PURE__ */ makePrimitive({
30805
30930
  return this[args]();
30806
30931
  }
30807
30932
  });
30808
- var fromOption2 = /* @__PURE__ */ dual((args2) => args2.length >= 2 || isOption2(args2[0]), (option4, onNone2) => isNone2(option4) ? fail3(onNone2 ? onNone2() : new NoSuchElementError("Effect.fromOption: Option.none")) : succeed3(option4.value));
30933
+ var fromOption3 = /* @__PURE__ */ dual((args2) => args2.length >= 2 || isOption2(args2[0]), (option4, onNone2) => isNone2(option4) ? fail3(onNone2 ? onNone2() : new NoSuchElementError("Effect.fromOption: Option.none")) : succeed3(option4.value));
30809
30934
  var fromResult = /* @__PURE__ */ match2({
30810
30935
  onFailure: fail3,
30811
30936
  onSuccess: succeed3
30812
30937
  });
30813
- var fromNullishOr2 = (value3) => value3 == null ? fail3(new NoSuchElementError()) : succeed3(value3);
30938
+ var fromNullishOr3 = (value3) => value3 == null ? fail3(new NoSuchElementError()) : succeed3(value3);
30814
30939
  var yieldNowWith = /* @__PURE__ */ makePrimitive({
30815
30940
  op: "Yield",
30816
30941
  [evaluate](fiber3) {
@@ -30825,13 +30950,13 @@ var yieldNowWith = /* @__PURE__ */ makePrimitive({
30825
30950
  }
30826
30951
  });
30827
30952
  var yieldNow = /* @__PURE__ */ yieldNowWith(0);
30828
- var succeedSome = (a) => succeed3(some2(a));
30829
- var succeedNone = /* @__PURE__ */ succeed3(/* @__PURE__ */ none2());
30830
- var transposeOption = (self) => isNone2(self) ? succeedNone : map5(self.value, some2);
30953
+ var succeedSome2 = (a) => succeed3(some2(a));
30954
+ var succeedNone2 = /* @__PURE__ */ succeed3(/* @__PURE__ */ none2());
30955
+ var transposeOption2 = (self) => isNone2(self) ? succeedNone2 : map5(self.value, some2);
30831
30956
  var failCauseSync = (evaluate2) => suspend(() => failCause(internalCall(evaluate2)));
30832
30957
  var die = (defect) => exitDie(defect);
30833
30958
  var failSync = (error2) => suspend(() => fail3(internalCall(error2)));
30834
- var void_2 = /* @__PURE__ */ succeed3(void 0);
30959
+ var void_3 = /* @__PURE__ */ succeed3(void 0);
30835
30960
  var try_2 = (options4) => {
30836
30961
  const evaluate2 = typeof options4 === "function" ? options4 : options4.try;
30837
30962
  const catcher = typeof options4 === "function" ? (cause) => new UnknownError(cause, "An error occurred in Effect.try") : options4.catch;
@@ -30914,7 +31039,7 @@ var asyncFinalizer = /* @__PURE__ */ makePrimitive({
30914
31039
  });
30915
31040
  var callback = (register) => callbackOptions(register, register.length >= 2);
30916
31041
  var never = /* @__PURE__ */ callback(constVoid);
30917
- var gen2 = (...args2) => suspend(() => fromIteratorUnsafe(args2.length === 1 ? args2[0]() : args2[1].call(args2[0].self)));
31042
+ var gen3 = (...args2) => suspend(() => fromIteratorUnsafe(args2.length === 1 ? args2[0]() : args2[1].call(args2[0].self)));
30918
31043
  var fnUntraced = (body, ...pipeables) => {
30919
31044
  const fn3 = pipeables.length === 0 ? function() {
30920
31045
  return suspend(() => fromIteratorUnsafe(body.apply(this, arguments)));
@@ -31039,16 +31164,16 @@ var as2 = /* @__PURE__ */ dual(2, (self, value3) => {
31039
31164
  return flatMap3(self, (_) => b);
31040
31165
  });
31041
31166
  var asSome = (self) => map5(self, some2);
31042
- var flip = (self) => matchEffect(self, {
31167
+ var flip2 = (self) => matchEffect(self, {
31043
31168
  onFailure: succeed3,
31044
31169
  onSuccess: fail3
31045
31170
  });
31046
- var andThen2 = /* @__PURE__ */ dual(2, (self, f) => flatMap3(self, (a) => isEffect(f) ? f : internalCall(() => f(a))));
31047
- var tap2 = /* @__PURE__ */ dual(2, (self, f) => flatMap3(self, (a) => as2(isEffect(f) ? f : internalCall(() => f(a)), a)));
31171
+ var andThen3 = /* @__PURE__ */ dual(2, (self, f) => flatMap3(self, (a) => isEffect(f) ? f : internalCall(() => f(a))));
31172
+ var tap3 = /* @__PURE__ */ dual(2, (self, f) => flatMap3(self, (a) => as2(isEffect(f) ? f : internalCall(() => f(a)), a)));
31048
31173
  var asVoid2 = (self) => flatMap3(self, (_) => exitVoid);
31049
31174
  var sandbox = (self) => catchCause(self, fail3);
31050
- var raceAll = (all5, options4) => withFiber((parent) => callback((resume) => {
31051
- const effects = fromIterable2(all5);
31175
+ var raceAll = (all6, options4) => withFiber((parent) => callback((resume) => {
31176
+ const effects = fromIterable2(all6);
31052
31177
  const len = effects.length;
31053
31178
  let doneCount = 0;
31054
31179
  let done4 = false;
@@ -31085,7 +31210,7 @@ var raceAll = (all5, options4) => withFiber((parent) => callback((resume) => {
31085
31210
  }
31086
31211
  return fiberInterruptAll(fibers);
31087
31212
  }));
31088
- var raceAllFirst = (all5, options4) => withFiber((parent) => callback((resume) => {
31213
+ var raceAllFirst = (all6, options4) => withFiber((parent) => callback((resume) => {
31089
31214
  let done4 = false;
31090
31215
  const fibers = /* @__PURE__ */ new Set();
31091
31216
  const onExit4 = (exit3) => {
@@ -31093,7 +31218,7 @@ var raceAllFirst = (all5, options4) => withFiber((parent) => callback((resume) =
31093
31218
  resume(fibers.size === 0 ? exit3 : flatMap3(uninterruptible(fiberInterruptAll(fibers)), () => exit3));
31094
31219
  };
31095
31220
  let i = 0;
31096
- for (const effect2 of all5) {
31221
+ for (const effect2 of all6) {
31097
31222
  if (done4) break;
31098
31223
  const index2 = i++;
31099
31224
  const fiber3 = forkUnsafe(parent, effect2, true, true, false);
@@ -31145,7 +31270,7 @@ var flatten3 = (self) => flatMap3(self, identity);
31145
31270
  var map5 = /* @__PURE__ */ dual(2, (self, f) => flatMap3(self, (a) => succeed3(internalCall(() => f(a)))));
31146
31271
  var mapEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMap(self, f) : map5(self, f));
31147
31272
  var mapErrorEager = /* @__PURE__ */ dual(2, (self, f) => effectIsExit(self) ? exitMapError(self, f) : mapError2(self, f));
31148
- var mapBothEager = /* @__PURE__ */ dual(2, (self, options4) => effectIsExit(self) ? exitMapBoth(self, options4) : mapBoth(self, options4));
31273
+ var mapBothEager = /* @__PURE__ */ dual(2, (self, options4) => effectIsExit(self) ? exitMapBoth(self, options4) : mapBoth2(self, options4));
31149
31274
  var catchEager = /* @__PURE__ */ dual(2, (self, f) => {
31150
31275
  if (effectIsExit(self)) {
31151
31276
  if (self._tag === "Success") return self;
@@ -31185,7 +31310,7 @@ var exitAsVoidAll = (exits) => {
31185
31310
  };
31186
31311
  var service = (service3) => service3;
31187
31312
  var serviceOption = (service3) => withFiber((fiber3) => succeed3(getOption(fiber3.context, service3)));
31188
- var serviceOptional = (service3) => withFiber((fiber3) => fromOption2(getOption(fiber3.context, service3)));
31313
+ var serviceOptional = (service3) => withFiber((fiber3) => fromOption3(getOption(fiber3.context, service3)));
31189
31314
  var updateContext = /* @__PURE__ */ dual(2, (self, f) => withFiber((fiber3) => {
31190
31315
  const prevContext = fiber3.context;
31191
31316
  const nextContext = f(prevContext);
@@ -31210,13 +31335,13 @@ var updateServiceScoped = (service3, update3, options4) => uninterruptible(withF
31210
31335
  const current = getUnsafe(fiber3.context, service3);
31211
31336
  let next;
31212
31337
  if (options4?.reset === void 0) {
31213
- if (current !== updated) return void_2;
31338
+ if (current !== updated) return void_3;
31214
31339
  next = original;
31215
31340
  } else {
31216
31341
  next = options4.reset(original, updated, current);
31217
31342
  }
31218
31343
  fiber3.setContext(add(fiber3.context, service3, next));
31219
- return void_2;
31344
+ return void_3;
31220
31345
  });
31221
31346
  }));
31222
31347
  var context = () => getContext;
@@ -31225,7 +31350,7 @@ var contextWith = (f) => withFiber((fiber3) => f(fiber3.context));
31225
31350
  var setContext = /* @__PURE__ */ dual(2, (self, context3) => updateContext(self, constant(context3)));
31226
31351
  var provideContext = /* @__PURE__ */ dual(2, (self, context3) => {
31227
31352
  if (effectIsExit(self)) return self;
31228
- return updateContext(self, merge(context3));
31353
+ return updateContext(self, merge2(context3));
31229
31354
  });
31230
31355
  var provideService = function() {
31231
31356
  if (arguments.length === 1) {
@@ -31236,15 +31361,15 @@ var provideService = function() {
31236
31361
  var provideServiceImpl = (self, service3, implementation) => updateContext(self, add(service3, implementation));
31237
31362
  var provideServiceEffect = /* @__PURE__ */ dual(3, (self, service3, acquire) => flatMap3(acquire, (implementation) => provideService(self, service3, implementation)));
31238
31363
  var zip = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self, that, options4) => zipWith2(self, that, (a, a2) => [a, a2], options4));
31239
- var zipWith2 = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self, that, f, options4) => options4?.concurrent ? map5(all2([self, that], {
31364
+ var zipWith2 = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self, that, f, options4) => options4?.concurrent ? map5(all3([self, that], {
31240
31365
  concurrency: 2
31241
31366
  }), ([a, a2]) => internalCall(() => f(a, a2))) : flatMap3(self, (a) => map5(that, (a2) => internalCall(() => f(a, a2)))));
31242
- var filterOrFail = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail3(orFailWith(a)) : () => fail3(new NoSuchElementError())));
31243
- var when = /* @__PURE__ */ dual(2, (self, condition) => flatMap3(condition, (pass) => pass ? asSome(self) : succeedNone));
31367
+ var filterOrFail2 = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail3(orFailWith(a)) : () => fail3(new NoSuchElementError())));
31368
+ var when = /* @__PURE__ */ dual(2, (self, condition) => flatMap3(condition, (pass) => pass ? asSome(self) : succeedNone2));
31244
31369
  var replicate = /* @__PURE__ */ dual(2, (self, n) => Array.from({
31245
31370
  length: n
31246
31371
  }, () => self));
31247
- var replicateEffect = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, n, options4) => all2(replicate(self, n), options4));
31372
+ var replicateEffect = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, n, options4) => all3(replicate(self, n), options4));
31248
31373
  var forever = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options4) => whileLoop({
31249
31374
  while: constTrue,
31250
31375
  body: constant(options4?.disableYield ? self : flatMap3(self, (_) => yieldNow)),
@@ -31275,59 +31400,59 @@ var catchCauseFilter = /* @__PURE__ */ dual(3, (self, filter12, f) => catchCause
31275
31400
  }));
31276
31401
  var catch_ = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter(self, findError, (e) => f(e)));
31277
31402
  var catchNoSuchElement = (self) => matchEffect(self, {
31278
- onFailure: (error2) => isNoSuchElementError(error2) ? succeedNone : fail3(error2),
31279
- onSuccess: succeedSome
31403
+ onFailure: (error2) => isNoSuchElementError(error2) ? succeedNone2 : fail3(error2),
31404
+ onSuccess: succeedSome2
31280
31405
  });
31281
31406
  var catchDefect = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter(self, findDefect, f));
31282
- var tapCause = /* @__PURE__ */ dual(2, (self, f) => catchCause(self, (cause) => andThen2(internalCall(() => f(cause)), failCause(cause))));
31283
- var tapCauseIf = /* @__PURE__ */ dual(3, (self, predicate, f) => catchCauseIf(self, predicate, (cause) => andThen2(internalCall(() => f(cause)), failCause(cause))));
31407
+ var tapCause = /* @__PURE__ */ dual(2, (self, f) => catchCause(self, (cause) => andThen3(internalCall(() => f(cause)), failCause(cause))));
31408
+ var tapCauseIf = /* @__PURE__ */ dual(3, (self, predicate, f) => catchCauseIf(self, predicate, (cause) => andThen3(internalCall(() => f(cause)), failCause(cause))));
31284
31409
  var tapCauseFilter = /* @__PURE__ */ dual(3, (self, filter12, f) => catchCause(self, (cause) => {
31285
31410
  const result3 = filter12(cause);
31286
31411
  if (isFailure2(result3)) {
31287
31412
  return failCause(cause);
31288
31413
  }
31289
- return andThen2(internalCall(() => f(result3.success, cause)), failCause(cause));
31414
+ return andThen3(internalCall(() => f(result3.success, cause)), failCause(cause));
31290
31415
  }));
31291
31416
  var tapError = /* @__PURE__ */ dual(2, (self, f) => tapCauseFilter(self, findError, (e) => f(e)));
31292
31417
  var tapErrorTag = /* @__PURE__ */ dual(3, (self, k, f) => {
31293
31418
  const predicate = Array.isArray(k) ? (e) => hasProperty(e, "_tag") && k.includes(e._tag) : isTagged(k);
31294
- return tapError(self, (error2) => predicate(error2) ? f(error2) : void_2);
31419
+ return tapError(self, (error2) => predicate(error2) ? f(error2) : void_3);
31295
31420
  });
31296
31421
  var tapDefect = /* @__PURE__ */ dual(2, (self, f) => tapCauseFilter(self, findDefect, (_) => f(_)));
31297
- var catchIf = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, predicate, f, orElse7) => catchCause(self, (cause) => {
31422
+ var catchIf = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, predicate, f, orElse8) => catchCause(self, (cause) => {
31298
31423
  const error2 = findError(cause);
31299
31424
  if (isFailure2(error2)) return failCause(error2.failure);
31300
31425
  if (!predicate(error2.success)) {
31301
- return orElse7 ? internalCall(() => orElse7(error2.success)) : failCause(cause);
31426
+ return orElse8 ? internalCall(() => orElse8(error2.success)) : failCause(cause);
31302
31427
  }
31303
31428
  return internalCall(() => f(error2.success));
31304
31429
  }));
31305
- var catchFilter = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, filter12, f, orElse7) => catchCause(self, (cause) => {
31430
+ var catchFilter = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, filter12, f, orElse8) => catchCause(self, (cause) => {
31306
31431
  const error2 = findError(cause);
31307
31432
  if (isFailure2(error2)) return failCause(error2.failure);
31308
31433
  const result3 = filter12(error2.success);
31309
31434
  if (isFailure2(result3)) {
31310
- return orElse7 ? internalCall(() => orElse7(result3.failure)) : failCause(cause);
31435
+ return orElse8 ? internalCall(() => orElse8(result3.failure)) : failCause(cause);
31311
31436
  }
31312
31437
  return internalCall(() => f(result3.success));
31313
31438
  }));
31314
- var catchTag = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, k, f, orElse7) => {
31439
+ var catchTag = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, k, f, orElse8) => {
31315
31440
  const pred = Array.isArray(k) ? (e) => hasProperty(e, "_tag") && k.includes(e._tag) : isTagged(k);
31316
- return catchIf(self, pred, f, orElse7);
31441
+ return catchIf(self, pred, f, orElse8);
31317
31442
  });
31318
- var catchTags = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, cases, orElse7) => {
31443
+ var catchTags = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, cases, orElse8) => {
31319
31444
  let keys4;
31320
31445
  return catchFilter(self, (e) => {
31321
31446
  keys4 ??= Object.keys(cases);
31322
31447
  return hasProperty(e, "_tag") && isString(e["_tag"]) && keys4.includes(e["_tag"]) ? succeed2(e) : fail2(e);
31323
- }, (e) => internalCall(() => cases[e["_tag"]](e)), orElse7);
31448
+ }, (e) => internalCall(() => cases[e["_tag"]](e)), orElse8);
31324
31449
  });
31325
- var catchReason = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, errorTag, reasonTag, f, orElse7) => catchIf(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason"), (e) => {
31450
+ var catchReason = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, errorTag, reasonTag, f, orElse8) => catchIf(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason"), (e) => {
31326
31451
  const reason = e.reason;
31327
31452
  if (isTagged(reason, reasonTag)) return f(reason, e);
31328
- return orElse7 ? internalCall(() => orElse7(reason, e)) : fail3(e);
31453
+ return orElse8 ? internalCall(() => orElse8(reason, e)) : fail3(e);
31329
31454
  }));
31330
- var catchReasons = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, errorTag, cases, orElse7) => {
31455
+ var catchReasons = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, errorTag, cases, orElse8) => {
31331
31456
  let keys4;
31332
31457
  return catchIf(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && hasProperty(e.reason, "_tag") && isString(e.reason._tag), (e) => {
31333
31458
  const reason = e.reason;
@@ -31335,7 +31460,7 @@ var catchReasons = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, er
31335
31460
  if (keys4.includes(reason._tag)) {
31336
31461
  return internalCall(() => cases[reason._tag](reason, e));
31337
31462
  }
31338
- return orElse7 ? internalCall(() => orElse7(reason, e)) : fail3(e);
31463
+ return orElse8 ? internalCall(() => orElse8(reason, e)) : fail3(e);
31339
31464
  });
31340
31465
  });
31341
31466
  var unwrapReason = /* @__PURE__ */ dual(2, (self, errorTag) => catchFilter(self, (e) => {
@@ -31345,7 +31470,7 @@ var unwrapReason = /* @__PURE__ */ dual(2, (self, errorTag) => catchFilter(self,
31345
31470
  return fail2(e);
31346
31471
  }, fail3));
31347
31472
  var mapError2 = /* @__PURE__ */ dual(2, (self, f) => catch_(self, (error2) => failSync(() => f(error2))));
31348
- var mapBoth = /* @__PURE__ */ dual(2, (self, options4) => matchEffect(self, {
31473
+ var mapBoth2 = /* @__PURE__ */ dual(2, (self, options4) => matchEffect(self, {
31349
31474
  onFailure: (e) => failSync(() => options4.onFailure(e)),
31350
31475
  onSuccess: (a) => sync(() => options4.onSuccess(a))
31351
31476
  }));
@@ -31368,8 +31493,8 @@ var eventually = (self) => catch_(self, (_) => flatMap3(yieldNow, () => eventual
31368
31493
  var ignore = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options4) => {
31369
31494
  if (!options4?.log) {
31370
31495
  return matchEffect(self, {
31371
- onFailure: (_) => void_2,
31372
- onSuccess: (_) => void_2
31496
+ onFailure: (_) => void_3,
31497
+ onSuccess: (_) => void_3
31373
31498
  });
31374
31499
  }
31375
31500
  const logEffect = logWithLevel(options4.log === true ? void 0 : options4.log);
@@ -31378,20 +31503,20 @@ var ignore = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options4
31378
31503
  const failure = findFail(cause);
31379
31504
  return isFailure2(failure) ? failCause(failure.failure) : options4.message === void 0 ? logEffect(cause) : logEffect(options4.message, cause);
31380
31505
  },
31381
- onSuccess: (_) => void_2
31506
+ onSuccess: (_) => void_3
31382
31507
  });
31383
31508
  });
31384
31509
  var ignoreCause = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options4) => {
31385
31510
  if (!options4?.log) {
31386
31511
  return matchCauseEffect(self, {
31387
- onFailure: (_) => void_2,
31388
- onSuccess: (_) => void_2
31512
+ onFailure: (_) => void_3,
31513
+ onSuccess: (_) => void_3
31389
31514
  });
31390
31515
  }
31391
31516
  const logEffect = logWithLevel(options4.log === true ? void 0 : options4.log);
31392
31517
  return matchCauseEffect(self, {
31393
31518
  onFailure: (cause) => options4.message === void 0 ? logEffect(cause) : logEffect(options4.message, cause),
31394
- onSuccess: (_) => void_2
31519
+ onSuccess: (_) => void_3
31395
31520
  });
31396
31521
  });
31397
31522
  var option = (self) => match5(self, {
@@ -31469,7 +31594,7 @@ var isSuccess3 = /* @__PURE__ */ matchEager({
31469
31594
  onFailure: () => false,
31470
31595
  onSuccess: () => true
31471
31596
  });
31472
- var delay = /* @__PURE__ */ dual(2, (self, duration2) => andThen2(sleep(duration2), self));
31597
+ var delay = /* @__PURE__ */ dual(2, (self, duration2) => andThen3(sleep(duration2), self));
31473
31598
  var timeoutOrElse = /* @__PURE__ */ dual(2, (self, options4) => raceFirst(self, flatMap3(sleep(options4.duration), options4.orElse)));
31474
31599
  var timeout = /* @__PURE__ */ dual(2, (self, duration2) => timeoutOrElse(self, {
31475
31600
  duration: duration2,
@@ -31483,7 +31608,7 @@ var timed = (self) => clockWith((clock) => {
31483
31608
  var ScopeTypeId = "~effect/Scope";
31484
31609
  var ScopeCloseableTypeId = "~effect/Scope/Closeable";
31485
31610
  var scopeTag = /* @__PURE__ */ Service("effect/Scope");
31486
- var scopeClose = (self, exit_) => suspend(() => scopeCloseUnsafe(self, exit_) ?? void_2);
31611
+ var scopeClose = (self, exit_) => suspend(() => scopeCloseUnsafe(self, exit_) ?? void_3);
31487
31612
  var scopeCloseUnsafe = (self, exit_) => {
31488
31613
  if (self.state._tag === "Closed") return;
31489
31614
  const closed = {
@@ -31543,7 +31668,7 @@ var scopeAddFinalizerExit = (scope3, finalizer) => {
31543
31668
  return finalizer(scope3.state.exit);
31544
31669
  }
31545
31670
  scopeAddFinalizerUnsafe(scope3, {}, finalizer);
31546
- return void_2;
31671
+ return void_3;
31547
31672
  });
31548
31673
  };
31549
31674
  var scopeAddFinalizer = (scope3, finalizer) => scopeAddFinalizerExit(scope3, constant(finalizer));
@@ -31603,9 +31728,9 @@ var scoped = (self) => withFiber((fiber3) => {
31603
31728
  });
31604
31729
  var scopedWith = (f) => suspend(() => {
31605
31730
  const scope3 = scopeMakeUnsafe();
31606
- return onExit(f(scope3), (exit3) => suspend(() => scopeCloseUnsafe(scope3, exit3) ?? void_2));
31731
+ return onExit(f(scope3), (exit3) => suspend(() => scopeCloseUnsafe(scope3, exit3) ?? void_3));
31607
31732
  });
31608
- var acquireRelease = (acquire, release, options4) => contextWith((context3) => uninterruptibleMask((restore) => flatMap3(scope, (scope3) => tap2(options4?.interruptible ? restore(acquire) : acquire, (a) => scopeAddFinalizerExit(scope3, (exit3) => provideContext(release(a, exit3), context3))))));
31733
+ var acquireRelease = (acquire, release, options4) => contextWith((context3) => uninterruptibleMask((restore) => flatMap3(scope, (scope3) => tap3(options4?.interruptible ? restore(acquire) : acquire, (a) => scopeAddFinalizerExit(scope3, (exit3) => provideContext(release(a, exit3), context3))))));
31609
31734
  var addFinalizer = (finalizer) => flatMap3(scope, (scope3) => contextWith((context3) => scopeAddFinalizerExit(scope3, (exit3) => provideContext(finalizer(exit3), context3))));
31610
31735
  var onExitPrimitive = /* @__PURE__ */ makePrimitive({
31611
31736
  op: "OnExit",
@@ -31635,13 +31760,13 @@ var onExit = /* @__PURE__ */ dual(2, onExitPrimitive);
31635
31760
  var ensuring = /* @__PURE__ */ dual(2, (self, finalizer) => onExit(self, (_) => finalizer));
31636
31761
  var onExitIf = /* @__PURE__ */ dual(3, (self, predicate, f) => onExit(self, (exit3) => {
31637
31762
  if (!predicate(exit3)) {
31638
- return void_2;
31763
+ return void_3;
31639
31764
  }
31640
31765
  return f(exit3);
31641
31766
  }));
31642
31767
  var onExitFilter = /* @__PURE__ */ dual(3, (self, filter12, f) => onExit(self, (exit3) => {
31643
31768
  const b = filter12(exit3);
31644
- return isFailure2(b) ? void_2 : f(b.success, exit3);
31769
+ return isFailure2(b) ? void_3 : f(b.success, exit3);
31645
31770
  }));
31646
31771
  var onError = /* @__PURE__ */ dual(2, (self, f) => onExitFilter(self, exitFilterCause, f));
31647
31772
  var onErrorIf = /* @__PURE__ */ dual(3, (self, predicate, f) => onExitIf(self, (exit3) => {
@@ -31652,10 +31777,10 @@ var onErrorIf = /* @__PURE__ */ dual(3, (self, predicate, f) => onExitIf(self, (
31652
31777
  }, (exit3) => f(exit3.cause)));
31653
31778
  var onErrorFilter = /* @__PURE__ */ dual(3, (self, filter12, f) => onExit(self, (exit3) => {
31654
31779
  if (exit3._tag !== "Failure") {
31655
- return void_2;
31780
+ return void_3;
31656
31781
  }
31657
31782
  const result3 = filter12(exit3.cause);
31658
- return isFailure2(result3) ? void_2 : f(result3.success, exit3.cause);
31783
+ return isFailure2(result3) ? void_3 : f(result3.success, exit3.cause);
31659
31784
  }));
31660
31785
  var onInterrupt = /* @__PURE__ */ dual(2, (self, finalizer) => onErrorFilter(causeFilterInterruptors, finalizer)(self));
31661
31786
  var acquireUseRelease = (acquire, use, release) => uninterruptibleMask((restore) => flatMap3(acquire, (a) => onExitPrimitive(restore(use(a)), (exit3) => release(a, exit3), true)));
@@ -31729,7 +31854,7 @@ var interruptibleMask = (f) => withFiber((fiber3) => {
31729
31854
  return interrupted ?? effect2;
31730
31855
  });
31731
31856
  var abortSignal = /* @__PURE__ */ map5(/* @__PURE__ */ acquireRelease(/* @__PURE__ */ sync(() => new AbortController()), (controller) => sync(() => controller.abort())), (_) => _.signal);
31732
- var all2 = (arg, options4) => {
31857
+ var all3 = (arg, options4) => {
31733
31858
  if (isIterable(arg)) {
31734
31859
  return options4?.mode === "result" ? forEach(arg, result, options4) : forEach(arg, identity, options4);
31735
31860
  } else if (options4?.discard) {
@@ -31768,7 +31893,7 @@ var validate = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect
31768
31893
  if (isArrayNonEmpty2(excluded)) {
31769
31894
  return fail3(excluded);
31770
31895
  }
31771
- return options4?.discard ? void_2 : succeed3(satisfying);
31896
+ return options4?.discard ? void_3 : succeed3(satisfying);
31772
31897
  }));
31773
31898
  var findFirst3 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect(args2[0]), (elements, predicate) => suspend(() => {
31774
31899
  const iterator = elements[Symbol.iterator]();
@@ -31833,7 +31958,7 @@ var forEach = /* @__PURE__ */ dual((args2) => typeof args2[1] === "function", (i
31833
31958
  const items = fromIterable2(iterable);
31834
31959
  let length = items.length;
31835
31960
  if (length === 0) {
31836
- return options4?.discard ? void_2 : succeed3([]);
31961
+ return options4?.discard ? void_3 : succeed3([]);
31837
31962
  }
31838
31963
  const out = options4?.discard ? void 0 : new Array(length);
31839
31964
  const eff = forEachConcurrent({
@@ -31870,7 +31995,7 @@ var iterateEagerImpl = (options4) => {
31870
31995
  const item = items[index2];
31871
31996
  const effect2 = onItem(state, item, index2);
31872
31997
  if (!effectIsExit(effect2)) {
31873
- return flatMap3(exit(effect2), (itemExit) => step(state, item, itemExit, index2) ?? runSequential(state, items, index2 + 1, end) ?? void_2);
31998
+ return flatMap3(exit(effect2), (itemExit) => step(state, item, itemExit, index2) ?? runSequential(state, items, index2 + 1, end) ?? void_3);
31874
31999
  }
31875
32000
  const terminal = step(state, item, effect2, index2);
31876
32001
  if (terminal) return terminal._tag === "Failure" ? terminal : void 0;
@@ -31937,7 +32062,7 @@ var iterateEagerImpl = (options4) => {
31937
32062
  return suspend(() => {
31938
32063
  terminal = exitVoid;
31939
32064
  interrupted = true;
31940
- return fibers ? fiberInterruptAll(fibers) : void_2;
32065
+ return fibers ? fiberInterruptAll(fibers) : void_3;
31941
32066
  });
31942
32067
  });
31943
32068
  } else {
@@ -31976,7 +32101,7 @@ var iterateEagerImpl = (options4) => {
31976
32101
  const eff2 = go();
31977
32102
  if (eff2) resume(eff2);
31978
32103
  } else if (done4 && fibers.size === 0) {
31979
- resume(terminal ?? void_2);
32104
+ resume(terminal ?? void_3);
31980
32105
  }
31981
32106
  } catch (error2) {
31982
32107
  resume(failDefect(error2));
@@ -32002,7 +32127,7 @@ var iterateEagerImpl = (options4) => {
32002
32127
  if (!fibers) {
32003
32128
  return exitVoid;
32004
32129
  } else if (fibers.size === 0) {
32005
- resume(void_2);
32130
+ resume(void_3);
32006
32131
  }
32007
32132
  }
32008
32133
  };
@@ -32021,10 +32146,10 @@ var forEachConcurrent = /* @__PURE__ */ iterateEagerImpl({
32021
32146
  }
32022
32147
  }
32023
32148
  });
32024
- var filterOrElse = /* @__PURE__ */ dual(3, (self, predicate, orElse7) => flatMap3(self, (a) => predicate(a) ? succeed3(a) : orElse7(a)));
32025
- var filterMapOrElse = /* @__PURE__ */ dual(3, (self, filter12, orElse7) => flatMap3(self, (a) => {
32149
+ var filterOrElse = /* @__PURE__ */ dual(3, (self, predicate, orElse8) => flatMap3(self, (a) => predicate(a) ? succeed3(a) : orElse8(a)));
32150
+ var filterMapOrElse = /* @__PURE__ */ dual(3, (self, filter12, orElse8) => flatMap3(self, (a) => {
32026
32151
  const result3 = filter12(a);
32027
- return isFailure2(result3) ? orElse7(result3.failure) : succeed3(result3.success);
32152
+ return isFailure2(result3) ? orElse8(result3.failure) : succeed3(result3.success);
32028
32153
  }));
32029
32154
  var filterMapOrFail = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, filter12, orFailWith) => filterMapOrElse(self, filter12, orFailWith ? (x) => fail3(orFailWith(x)) : () => fail3(new NoSuchElementError())));
32030
32155
  var filter4 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect(args2[0]), (elements, predicate, options4) => suspend(() => {
@@ -32033,7 +32158,7 @@ var filter4 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect(
32033
32158
  const result3 = predicate(a, i);
32034
32159
  if (typeof result3 === "boolean") {
32035
32160
  if (result3) out.push(a);
32036
- return void_2;
32161
+ return void_3;
32037
32162
  }
32038
32163
  return map5(result3, (keep) => {
32039
32164
  if (keep) {
@@ -32066,10 +32191,10 @@ var filterMapEffect = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !i
32066
32191
  concurrency: options4?.concurrency
32067
32192
  }), out);
32068
32193
  }));
32069
- var Do2 = /* @__PURE__ */ succeed3({});
32070
- var bindTo3 = /* @__PURE__ */ bindTo(map5);
32071
- var bind3 = /* @__PURE__ */ bind(map5, flatMap3);
32072
- var let_3 = /* @__PURE__ */ let_(map5);
32194
+ var Do3 = /* @__PURE__ */ succeed3({});
32195
+ var bindTo4 = /* @__PURE__ */ bindTo(map5);
32196
+ var bind4 = /* @__PURE__ */ bind(map5, flatMap3);
32197
+ var let_4 = /* @__PURE__ */ let_(map5);
32073
32198
  var forkChild = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options4) => withFiber((fiber3) => {
32074
32199
  interruptChildrenPatch();
32075
32200
  return succeed3(forkUnsafe(fiber3, self, options4?.startImmediately, false, options4?.uninterruptible ?? false));
@@ -32095,7 +32220,7 @@ var awaitAllChildren = (self) => withFiber((fiber3) => {
32095
32220
  return onExit(self, (_) => {
32096
32221
  let children = fiber3._children;
32097
32222
  if (children === void 0 || children.size === 0) {
32098
- return void_2;
32223
+ return void_3;
32099
32224
  } else if (initialChildren) {
32100
32225
  children = filter2(children, (child) => !initialChildren.has(child));
32101
32226
  }
@@ -32107,7 +32232,7 @@ var forkIn = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, scope3,
32107
32232
  if (!fiber3._exit) {
32108
32233
  if (scope3.state._tag !== "Closed") {
32109
32234
  const key = {};
32110
- const finalizer = () => withFiberId((interruptor) => interruptor === fiber3.id ? void_2 : fiberInterrupt(fiber3));
32235
+ const finalizer = () => withFiberId((interruptor) => interruptor === fiber3.id ? void_3 : fiberInterrupt(fiber3));
32111
32236
  scopeAddFinalizerUnsafe(scope3, key, finalizer);
32112
32237
  fiber3.addObserver(() => scopeRemoveFinalizerUnsafe(scope3, key));
32113
32238
  } else {
@@ -32259,7 +32384,7 @@ var Latch = class {
32259
32384
  }
32260
32385
  await = /* @__PURE__ */ callback((resume) => {
32261
32386
  if (this._isOpen) {
32262
- return resume(void_2);
32387
+ return resume(void_3);
32263
32388
  }
32264
32389
  this.waiters.push(resume);
32265
32390
  return sync(() => {
@@ -32285,7 +32410,7 @@ var Latch = class {
32285
32410
  return this._isOpen;
32286
32411
  }
32287
32412
  };
32288
- var makeLatchUnsafe = (open3) => new Latch(open3 ?? false);
32413
+ var makeLatchUnsafe = (open4) => new Latch(open4 ?? false);
32289
32414
  var tracer = /* @__PURE__ */ withFiber((fiber3) => succeed3(fiber3.getRef(Tracer)));
32290
32415
  var withTracer = /* @__PURE__ */ dual(2, (effect2, tracer3) => provideService(effect2, Tracer, tracer3));
32291
32416
  var withTracerEnabled = /* @__PURE__ */ provideService(TracerEnabled);
@@ -32460,7 +32585,7 @@ var annotateCurrentSpan = (...args2) => withFiber((fiber3) => {
32460
32585
  span2.attribute(args2[0], args2[1]);
32461
32586
  }
32462
32587
  }
32463
- return void_2;
32588
+ return void_3;
32464
32589
  });
32465
32590
  var currentSpan = /* @__PURE__ */ withFiber((fiber3) => {
32466
32591
  const span2 = fiber3.currentSpanLocal;
@@ -32491,7 +32616,7 @@ var ClockImpl = class {
32491
32616
  if (millis2 <= 0) return yieldNow;
32492
32617
  else if (!Number.isFinite(millis2)) return never;
32493
32618
  return callback((resume) => {
32494
- const continuation = millis2 > MAX_TIMER_MILLIS ? this.sleepMillis(millis2 - MAX_TIMER_MILLIS) : void_2;
32619
+ const continuation = millis2 > MAX_TIMER_MILLIS ? this.sleepMillis(millis2 - MAX_TIMER_MILLIS) : void_3;
32495
32620
  const handle = setTimeout(() => resume(continuation), Math.min(millis2, MAX_TIMER_MILLIS));
32496
32621
  return sync(() => clearTimeout(handle));
32497
32622
  });
@@ -32642,7 +32767,7 @@ var annotateLogsScoped = function() {
32642
32767
  }
32643
32768
  }
32644
32769
  fiber3.setContext(add(fiber3.context, CurrentLogAnnotations, next2));
32645
- return void_2;
32770
+ return void_3;
32646
32771
  });
32647
32772
  }));
32648
32773
  };
@@ -32687,7 +32812,7 @@ var logWithLevel = (level) => (...message) => {
32687
32812
  return withFiber((fiber3) => {
32688
32813
  const logLevel2 = level ?? fiber3.currentLogLevel;
32689
32814
  if (isLogLevelGreaterThan(fiber3.minimumLogLevel, logLevel2)) {
32690
- return void_2;
32815
+ return void_3;
32691
32816
  }
32692
32817
  const clock = fiber3.getRef(ClockRef);
32693
32818
  const loggers = fiber3.getRef(CurrentLoggers);
@@ -32703,7 +32828,7 @@ var logWithLevel = (level) => (...message) => {
32703
32828
  });
32704
32829
  }
32705
32830
  }
32706
- return void_2;
32831
+ return void_3;
32707
32832
  });
32708
32833
  };
32709
32834
  var colors = {
@@ -32781,7 +32906,7 @@ function interruptChildrenPatch() {
32781
32906
  var undefined_ = /* @__PURE__ */ succeed3(void 0);
32782
32907
  var withErrorReporting = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options4) => onError(self, (cause) => withFiber((fiber3) => {
32783
32908
  reportCauseUnsafe(fiber3, cause, options4?.defectsOnly);
32784
- return void_2;
32909
+ return void_3;
32785
32910
  })));
32786
32911
  var reportCauseUnsafe = (fiber3, cause, defectsOnly) => {
32787
32912
  const reporters = fiber3.getRef(CurrentErrorReporters);
@@ -32843,7 +32968,7 @@ var doneUnsafe = (self, effect2) => {
32843
32968
  // ../../node_modules/effect/dist/Effect.js
32844
32969
  var Effect_exports = {};
32845
32970
  __export(Effect_exports, {
32846
- Do: () => Do3,
32971
+ Do: () => Do4,
32847
32972
  Transaction: () => Transaction,
32848
32973
  TypeId: () => TypeId12,
32849
32974
  abortSignal: () => abortSignal2,
@@ -32851,8 +32976,8 @@ __export(Effect_exports, {
32851
32976
  acquireRelease: () => acquireRelease2,
32852
32977
  acquireUseRelease: () => acquireUseRelease2,
32853
32978
  addFinalizer: () => addFinalizer3,
32854
- all: () => all3,
32855
- andThen: () => andThen3,
32979
+ all: () => all4,
32980
+ andThen: () => andThen4,
32856
32981
  annotateCurrentSpan: () => annotateCurrentSpan2,
32857
32982
  annotateLogs: () => annotateLogs,
32858
32983
  annotateLogsScoped: () => annotateLogsScoped2,
@@ -32861,8 +32986,8 @@ __export(Effect_exports, {
32861
32986
  asSome: () => asSome2,
32862
32987
  asVoid: () => asVoid3,
32863
32988
  awaitAllChildren: () => awaitAllChildren2,
32864
- bind: () => bind4,
32865
- bindTo: () => bindTo4,
32989
+ bind: () => bind5,
32990
+ bindTo: () => bindTo5,
32866
32991
  cached: () => cached2,
32867
32992
  cachedInvalidateWithTTL: () => cachedInvalidateWithTTL2,
32868
32993
  cachedWithTTL: () => cachedWithTTL2,
@@ -32903,14 +33028,14 @@ __export(Effect_exports, {
32903
33028
  filterMapOrElse: () => filterMapOrElse2,
32904
33029
  filterMapOrFail: () => filterMapOrFail2,
32905
33030
  filterOrElse: () => filterOrElse2,
32906
- filterOrFail: () => filterOrFail2,
33031
+ filterOrFail: () => filterOrFail3,
32907
33032
  findFirst: () => findFirst4,
32908
33033
  findFirstFilter: () => findFirstFilter2,
32909
33034
  firstSuccessOf: () => firstSuccessOf2,
32910
33035
  flatMap: () => flatMap5,
32911
33036
  flatMapEager: () => flatMapEager2,
32912
33037
  flatten: () => flatten4,
32913
- flip: () => flip2,
33038
+ flip: () => flip3,
32914
33039
  fn: () => fn2,
32915
33040
  fnUntraced: () => fnUntraced2,
32916
33041
  fnUntracedEager: () => fnUntracedEager2,
@@ -32920,10 +33045,10 @@ __export(Effect_exports, {
32920
33045
  forkDetach: () => forkDetach2,
32921
33046
  forkIn: () => forkIn2,
32922
33047
  forkScoped: () => forkScoped2,
32923
- fromNullishOr: () => fromNullishOr3,
32924
- fromOption: () => fromOption3,
33048
+ fromNullishOr: () => fromNullishOr4,
33049
+ fromOption: () => fromOption4,
32925
33050
  fromResult: () => fromResult2,
32926
- gen: () => gen3,
33051
+ gen: () => gen4,
32927
33052
  head: () => head2,
32928
33053
  ignore: () => ignore2,
32929
33054
  ignoreCause: () => ignoreCause2,
@@ -32933,7 +33058,7 @@ __export(Effect_exports, {
32933
33058
  isEffect: () => isEffect2,
32934
33059
  isFailure: () => isFailure5,
32935
33060
  isSuccess: () => isSuccess5,
32936
- let: () => let_4,
33061
+ let: () => let_5,
32937
33062
  linkSpans: () => linkSpans2,
32938
33063
  log: () => log,
32939
33064
  logDebug: () => logDebug,
@@ -32946,7 +33071,7 @@ __export(Effect_exports, {
32946
33071
  makeSpan: () => makeSpan2,
32947
33072
  makeSpanScoped: () => makeSpanScoped2,
32948
33073
  map: () => map7,
32949
- mapBoth: () => mapBoth2,
33074
+ mapBoth: () => mapBoth3,
32950
33075
  mapBothEager: () => mapBothEager2,
32951
33076
  mapEager: () => mapEager2,
32952
33077
  mapError: () => mapError3,
@@ -33018,11 +33143,11 @@ __export(Effect_exports, {
33018
33143
  spanAnnotations: () => spanAnnotations2,
33019
33144
  spanLinks: () => spanLinks2,
33020
33145
  succeed: () => succeed6,
33021
- succeedNone: () => succeedNone2,
33022
- succeedSome: () => succeedSome2,
33146
+ succeedNone: () => succeedNone3,
33147
+ succeedSome: () => succeedSome3,
33023
33148
  suspend: () => suspend3,
33024
33149
  sync: () => sync3,
33025
- tap: () => tap4,
33150
+ tap: () => tap5,
33026
33151
  tapCause: () => tapCause3,
33027
33152
  tapCauseFilter: () => tapCauseFilter2,
33028
33153
  tapCauseIf: () => tapCauseIf2,
@@ -33039,7 +33164,7 @@ __export(Effect_exports, {
33039
33164
  trackDuration: () => trackDuration,
33040
33165
  trackErrors: () => trackErrors,
33041
33166
  trackSuccesses: () => trackSuccesses,
33042
- transposeOption: () => transposeOption2,
33167
+ transposeOption: () => transposeOption3,
33043
33168
  try: () => try_3,
33044
33169
  tryPromise: () => tryPromise2,
33045
33170
  tx: () => tx,
@@ -33053,7 +33178,7 @@ __export(Effect_exports, {
33053
33178
  updateServiceScoped: () => updateServiceScoped2,
33054
33179
  useSpan: () => useSpan2,
33055
33180
  validate: () => validate2,
33056
- void: () => void_4,
33181
+ void: () => void_5,
33057
33182
  when: () => when2,
33058
33183
  whileLoop: () => whileLoop2,
33059
33184
  withErrorReporting: () => withErrorReporting2,
@@ -33078,7 +33203,7 @@ var isExit2 = isExit;
33078
33203
  var succeed4 = exitSucceed;
33079
33204
  var failCause2 = exitFailCause;
33080
33205
  var fail4 = exitFail;
33081
- var void_3 = exitVoid;
33206
+ var void_4 = exitVoid;
33082
33207
  var isSuccess4 = exitIsSuccess;
33083
33208
  var isFailure4 = exitIsFailure;
33084
33209
 
@@ -33106,7 +33231,7 @@ __export(Layer_exports, {
33106
33231
  launch: () => launch,
33107
33232
  makeMemoMap: () => makeMemoMap,
33108
33233
  makeMemoMapUnsafe: () => makeMemoMapUnsafe,
33109
- merge: () => merge2,
33234
+ merge: () => merge3,
33110
33235
  mergeAll: () => mergeAll2,
33111
33236
  mock: () => mock,
33112
33237
  orDie: () => orDie2,
@@ -33122,7 +33247,7 @@ __export(Layer_exports, {
33122
33247
  suspend: () => suspend2,
33123
33248
  sync: () => sync2,
33124
33249
  syncContext: () => syncContext,
33125
- tap: () => tap3,
33250
+ tap: () => tap4,
33126
33251
  tapCause: () => tapCause2,
33127
33252
  tapError: () => tapError2,
33128
33253
  unwrap: () => unwrap,
@@ -33151,7 +33276,7 @@ var TypeId6 = "~effect/Layer";
33151
33276
  var MemoMapTypeId = "~effect/Layer/MemoMap";
33152
33277
  var memoMapReuse = (entry, scope3) => {
33153
33278
  entry.observers++;
33154
- return andThen2(scopeAddFinalizerExit(scope3, (exit3) => entry.finalizer(exit3)), entry.effect);
33279
+ return andThen3(scopeAddFinalizerExit(scope3, (exit3) => entry.finalizer(exit3)), entry.effect);
33155
33280
  };
33156
33281
  var isLayer = (u) => hasProperty(u, TypeId6);
33157
33282
  var LayerProto = {
@@ -33171,7 +33296,7 @@ var fromBuildUnsafe = (build2) => {
33171
33296
  };
33172
33297
  var fromBuild = (build2) => fromBuildUnsafe((memoMap, scope3) => {
33173
33298
  const layerScope = forkUnsafe2(scope3);
33174
- return onExit(build2(memoMap, layerScope), (exit3) => exit3._tag === "Failure" ? close(layerScope, exit3) : void_2);
33299
+ return onExit(build2(memoMap, layerScope), (exit3) => exit3._tag === "Failure" ? close(layerScope, exit3) : void_3);
33175
33300
  });
33176
33301
  var fromBuildMemo = (build2) => {
33177
33302
  const self = fromBuild((memoMap, scope3) => memoMap.getOrElseMemoize(self, scope3, build2));
@@ -33189,7 +33314,7 @@ var memoMapBuild = (memoMap, layer16, scope3, build2) => {
33189
33314
  memoMap.map.delete(layer16);
33190
33315
  return close(layerScope, exit3);
33191
33316
  }
33192
- return void_2;
33317
+ return void_3;
33193
33318
  })
33194
33319
  };
33195
33320
  memoMap.map.set(layer16, entry);
@@ -33230,7 +33355,7 @@ var makeMemoMap = /* @__PURE__ */ sync(makeMemoMapUnsafe);
33230
33355
  var forkMemoMap = (parent) => sync(() => forkMemoMapUnsafe(parent));
33231
33356
  var CurrentMemoMap = class _CurrentMemoMap extends (/* @__PURE__ */ Service()("effect/Layer/CurrentMemoMap")) {
33232
33357
  static forkOrCreate(self) {
33233
- const current = getOrUndefined2(self, _CurrentMemoMap);
33358
+ const current = getOrUndefined3(self, _CurrentMemoMap);
33234
33359
  return current ? forkMemoMapUnsafe(current) : makeMemoMapUnsafe();
33235
33360
  }
33236
33361
  };
@@ -33273,21 +33398,21 @@ var mergeAllEffect = (layers, memoMap, scope3) => {
33273
33398
  }).pipe(map5((context3) => mergeAll(...context3)));
33274
33399
  };
33275
33400
  var mergeAll2 = (...layers) => fromBuild((memoMap, scope3) => mergeAllEffect(layers, memoMap, scope3));
33276
- var merge2 = /* @__PURE__ */ dual(2, (self, that) => mergeAll2(self, ...Array.isArray(that) ? that : [that]));
33401
+ var merge3 = /* @__PURE__ */ dual(2, (self, that) => mergeAll2(self, ...Array.isArray(that) ? that : [that]));
33277
33402
  var provideWith = (self, that, f) => fromBuild((memoMap, scope3) => flatMap3(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope3) : that.build(memoMap, scope3), (context3) => self.build(memoMap, scope3).pipe(provideContext(context3), map5((merged) => f(merged, context3)))));
33278
33403
  var provide2 = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, identity));
33279
- var provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self2, that2) => merge(that2, self2)));
33404
+ var provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self2, that2) => merge2(that2, self2)));
33280
33405
  var flatMap4 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope3) => flatMap3(self.build(memoMap, scope3), (context3) => f(context3).build(memoMap, scope3))));
33281
- var tap3 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope3) => flatMap3(self.build(memoMap, scope3), (context3) => provide(as2(f(context3), context3), scope3))));
33282
- var tapError2 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope3) => catch_(self.build(memoMap, scope3), (error2) => provide(andThen2(f(error2), fail3(error2)), scope3))));
33283
- var tapCause2 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope3) => catchCause(self.build(memoMap, scope3), (cause) => provide(andThen2(f(cause), failCause(cause)), scope3))));
33406
+ var tap4 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope3) => flatMap3(self.build(memoMap, scope3), (context3) => provide(as2(f(context3), context3), scope3))));
33407
+ var tapError2 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope3) => catch_(self.build(memoMap, scope3), (error2) => provide(andThen3(f(error2), fail3(error2)), scope3))));
33408
+ var tapCause2 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope3) => catchCause(self.build(memoMap, scope3), (cause) => provide(andThen3(f(cause), failCause(cause)), scope3))));
33284
33409
  var orDie2 = (self) => fromBuildUnsafe((memoMap, scope3) => orDie(self.build(memoMap, scope3)));
33285
33410
  var catch_2 = /* @__PURE__ */ dual(2, (self, onError4) => fromBuildUnsafe((memoMap, scope3) => catch_(self.build(memoMap, scope3), (e) => onError4(e).build(memoMap, scope3))));
33286
33411
  var catchTag2 = /* @__PURE__ */ dual(3, (self, k, f) => fromBuildUnsafe((memoMap, scope3) => catchTag(self.build(memoMap, scope3), k, (error2) => f(error2).build(memoMap, scope3))));
33287
33412
  var catchCause2 = /* @__PURE__ */ dual(2, (self, onError4) => fromBuildUnsafe((memoMap, scope3) => catchCause(self.build(memoMap, scope3), (cause) => onError4(cause).build(memoMap, scope3))));
33288
33413
  var updateService2 = /* @__PURE__ */ dual(3, (layer16, service3, f) => provide2(layer16, effect(service3, map5(service3, f))));
33289
33414
  var fresh = (self) => fromBuildUnsafe((_, scope3) => self.build(makeMemoMapUnsafe(), scope3));
33290
- var launch = (self) => scoped(andThen2(build(self), never));
33415
+ var launch = (self) => scoped(andThen3(build(self), never));
33291
33416
  var mock = function() {
33292
33417
  if (arguments.length === 1) {
33293
33418
  return (implementation) => mockImpl(arguments[0], implementation);
@@ -33337,7 +33462,7 @@ var satisfiesErrorType = () => (layer16) => layer16;
33337
33462
  var satisfiesServicesType = () => (layer16) => layer16;
33338
33463
  var span = (name, options4) => {
33339
33464
  options4 = addSpanStackTrace(options4);
33340
- return effect(ParentSpan, options4?.onEnd ? tap2(makeSpanScoped(name, options4), (span2) => addFinalizer((exit3) => options4.onEnd(span2, exit3))) : makeSpanScoped(name, options4));
33465
+ return effect(ParentSpan, options4?.onEnd ? tap3(makeSpanScoped(name, options4), (span2) => addFinalizer((exit3) => options4.onEnd(span2, exit3))) : makeSpanScoped(name, options4));
33341
33466
  };
33342
33467
  var parentSpan = (span2) => succeedContext(ParentSpan.context(span2));
33343
33468
  var withSpan2 = function() {
@@ -33346,9 +33471,9 @@ var withSpan2 = function() {
33346
33471
  const options4 = addSpanStackTrace(dataFirst ? arguments[2] : arguments[1]);
33347
33472
  if (dataFirst) {
33348
33473
  const self = arguments[0];
33349
- return unwrap(map5(options4?.onEnd !== void 0 ? tap2(makeSpanScoped(name, options4), (span2) => addFinalizer((exit3) => options4.onEnd(span2, exit3))) : makeSpanScoped(name, options4), (span2) => withParentSpan2(self, span2)));
33474
+ return unwrap(map5(options4?.onEnd !== void 0 ? tap3(makeSpanScoped(name, options4), (span2) => addFinalizer((exit3) => options4.onEnd(span2, exit3))) : makeSpanScoped(name, options4), (span2) => withParentSpan2(self, span2)));
33350
33475
  }
33351
- return (self) => unwrap(map5(options4?.onEnd !== void 0 ? tap2(makeSpanScoped(name, options4), (span2) => addFinalizer((exit3) => options4.onEnd(span2, exit3))) : makeSpanScoped(name, options4), (span2) => withParentSpan2(self, span2)));
33476
+ return (self) => unwrap(map5(options4?.onEnd !== void 0 ? tap3(makeSpanScoped(name, options4), (span2) => addFinalizer((exit3) => options4.onEnd(span2, exit3))) : makeSpanScoped(name, options4), (span2) => withParentSpan2(self, span2)));
33352
33477
  };
33353
33478
  var withParentSpan2 = function() {
33354
33479
  const dataFirst = isLayer(arguments[0]);
@@ -34041,15 +34166,15 @@ var provideLayer = (self, layer16, options4) => scopedWith((scope3) => flatMap3(
34041
34166
  var provide3 = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, source, options4) => isContext(source) ? provideContext(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll2(...source) : source, options4));
34042
34167
 
34043
34168
  // ../../node_modules/effect/dist/internal/schedule.js
34044
- var repeatOrElse = /* @__PURE__ */ dual(3, (self, schedule3, orElse7) => flatMap3(toStepWithMetadata(schedule3), (step) => {
34169
+ var repeatOrElse = /* @__PURE__ */ dual(3, (self, schedule3, orElse8) => flatMap3(toStepWithMetadata(schedule3), (step) => {
34045
34170
  let meta = CurrentMetadata2.defaultValue();
34046
- return catch_(forever(tap2(flatMap3(suspend(() => provideService(self, CurrentMetadata2, meta)), step), (meta_) => sync(() => {
34171
+ return catch_(forever(tap3(flatMap3(suspend(() => provideService(self, CurrentMetadata2, meta)), step), (meta_) => sync(() => {
34047
34172
  meta = meta_;
34048
34173
  })), {
34049
34174
  disableYield: true
34050
- }), (error2) => isDone(error2) ? succeed3(error2.value) : orElse7(error2, meta.attempt === 0 ? none2() : some2(meta)));
34175
+ }), (error2) => isDone(error2) ? succeed3(error2.value) : orElse8(error2, meta.attempt === 0 ? none2() : some2(meta)));
34051
34176
  }));
34052
- var retryOrElse = /* @__PURE__ */ dual(3, (self, policy, orElse7) => flatMap3(toStepWithMetadata(policy), (step) => {
34177
+ var retryOrElse = /* @__PURE__ */ dual(3, (self, policy, orElse8) => flatMap3(toStepWithMetadata(policy), (step) => {
34053
34178
  let meta = CurrentMetadata2.defaultValue();
34054
34179
  let lastError;
34055
34180
  const loop = catch_(suspend(() => provideService(self, CurrentMetadata2, meta)), (error2) => {
@@ -34059,7 +34184,7 @@ var retryOrElse = /* @__PURE__ */ dual(3, (self, policy, orElse7) => flatMap3(to
34059
34184
  return loop;
34060
34185
  });
34061
34186
  });
34062
- return catchDone(loop, (out) => internalCall(() => orElse7(lastError, out)));
34187
+ return catchDone(loop, (out) => internalCall(() => orElse8(lastError, out)));
34063
34188
  }));
34064
34189
  var repeat = /* @__PURE__ */ dual(2, (self, options4) => {
34065
34190
  const schedule3 = typeof options4 === "function" ? options4(identity) : isSchedule(options4) ? options4 : buildFromOptions(options4);
@@ -34302,7 +34427,7 @@ var addEntry = (resolver, request5, resume, fiber3) => {
34302
34427
  newBatch.map = void 0;
34303
34428
  batchPool.push(newBatch);
34304
34429
  }
34305
- return void_2;
34430
+ return void_3;
34306
34431
  })
34307
34432
  };
34308
34433
  batch = newBatch;
@@ -34337,7 +34462,7 @@ var removeEntryUnsafe = (resolver, entry) => {
34337
34462
  };
34338
34463
  var maybeRemoveEntry = (resolver, entry) => sync(() => removeEntryUnsafe(resolver, entry));
34339
34464
  function runBatch(batch) {
34340
- if (!batch.map.has(batch.key)) return void_2;
34465
+ if (!batch.map.has(batch.key)) return void_3;
34341
34466
  batch.map.delete(batch.key);
34342
34467
  return batch.run;
34343
34468
  }
@@ -34445,7 +34570,7 @@ function attributesToRecord(attributes) {
34445
34570
  // ../../node_modules/effect/dist/Effect.js
34446
34571
  var TypeId12 = EffectTypeId;
34447
34572
  var isEffect2 = isEffect;
34448
- var all3 = all2;
34573
+ var all4 = all3;
34449
34574
  var partition3 = partition2;
34450
34575
  var reduce3 = reduce2;
34451
34576
  var validate2 = validate;
@@ -34457,19 +34582,19 @@ var whileLoop2 = whileLoop;
34457
34582
  var promise2 = promise;
34458
34583
  var tryPromise2 = tryPromise;
34459
34584
  var succeed6 = succeed3;
34460
- var succeedNone2 = succeedNone;
34461
- var succeedSome2 = succeedSome;
34585
+ var succeedNone3 = succeedNone2;
34586
+ var succeedSome3 = succeedSome2;
34462
34587
  var suspend3 = suspend;
34463
34588
  var sync3 = sync;
34464
- var void_4 = void_2;
34589
+ var void_5 = void_3;
34465
34590
  var undefined_2 = undefined_;
34466
34591
  var callback2 = callback;
34467
34592
  var never2 = never;
34468
- var Do3 = Do2;
34469
- var bindTo4 = bindTo3;
34470
- var let_4 = let_3;
34471
- var bind4 = bind3;
34472
- var gen3 = gen2;
34593
+ var Do4 = Do3;
34594
+ var bindTo5 = bindTo4;
34595
+ var let_5 = let_4;
34596
+ var bind5 = bind4;
34597
+ var gen4 = gen3;
34473
34598
  var fail6 = fail3;
34474
34599
  var failSync2 = failSync;
34475
34600
  var failCause3 = failCause;
@@ -34480,13 +34605,13 @@ var yieldNow2 = yieldNow;
34480
34605
  var yieldNowWith2 = yieldNowWith;
34481
34606
  var withFiber2 = withFiber;
34482
34607
  var fromResult2 = fromResult;
34483
- var fromOption3 = fromOption2;
34484
- var transposeOption2 = transposeOption;
34485
- var fromNullishOr3 = fromNullishOr2;
34608
+ var fromOption4 = fromOption3;
34609
+ var transposeOption3 = transposeOption2;
34610
+ var fromNullishOr4 = fromNullishOr3;
34486
34611
  var flatMap5 = flatMap3;
34487
34612
  var flatten4 = flatten3;
34488
- var andThen3 = andThen2;
34489
- var tap4 = tap2;
34613
+ var andThen4 = andThen3;
34614
+ var tap5 = tap3;
34490
34615
  var result2 = result;
34491
34616
  var option2 = option;
34492
34617
  var exit2 = exit;
@@ -34494,7 +34619,7 @@ var map7 = map5;
34494
34619
  var as3 = as2;
34495
34620
  var asSome2 = asSome;
34496
34621
  var asVoid3 = asVoid2;
34497
- var flip2 = flip;
34622
+ var flip3 = flip2;
34498
34623
  var zip2 = zip;
34499
34624
  var zipWith3 = zipWith2;
34500
34625
  var catch_3 = catch_;
@@ -34511,7 +34636,7 @@ var catchNoSuchElement2 = catchNoSuchElement;
34511
34636
  var catchCauseIf2 = catchCauseIf;
34512
34637
  var catchCauseFilter2 = catchCauseFilter;
34513
34638
  var mapError3 = mapError2;
34514
- var mapBoth2 = mapBoth;
34639
+ var mapBoth3 = mapBoth2;
34515
34640
  var orDie3 = orDie;
34516
34641
  var tapError3 = tapError;
34517
34642
  var tapErrorTag2 = tapErrorTag;
@@ -34544,7 +34669,7 @@ var filterMap3 = filterMap2;
34544
34669
  var filterMapEffect2 = filterMapEffect;
34545
34670
  var filterOrElse2 = filterOrElse;
34546
34671
  var filterMapOrElse2 = filterMapOrElse;
34547
- var filterOrFail2 = filterOrFail;
34672
+ var filterOrFail3 = filterOrFail2;
34548
34673
  var filterMapOrFail2 = filterMapOrFail;
34549
34674
  var when2 = when;
34550
34675
  var match6 = match5;
@@ -34673,7 +34798,7 @@ var track = /* @__PURE__ */ dual((args2) => isEffect2(args2[0]), (self, metric,
34673
34798
  const input = f === void 0 ? exit3 : internalCall(() => f(exit3));
34674
34799
  return update(metric, input);
34675
34800
  }));
34676
- var trackSuccesses = /* @__PURE__ */ dual((args2) => isEffect2(args2[0]), (self, metric, f) => tap4(self, (value3) => {
34801
+ var trackSuccesses = /* @__PURE__ */ dual((args2) => isEffect2(args2[0]), (self, metric, f) => tap5(self, (value3) => {
34677
34802
  const input = f === void 0 ? value3 : f(value3);
34678
34803
  return update(metric, input);
34679
34804
  }));
@@ -34697,7 +34822,7 @@ var trackDuration = /* @__PURE__ */ dual((args2) => isEffect2(args2[0]), (self,
34697
34822
  var Transaction = class extends (/* @__PURE__ */ Service()("effect/Effect/Transaction")) {
34698
34823
  };
34699
34824
  var tx = (effect2) => withFiber2((fiber3) => {
34700
- let state = getOrUndefined2(fiber3.context, Transaction);
34825
+ let state = getOrUndefined3(fiber3.context, Transaction);
34701
34826
  if (state) {
34702
34827
  return effect2;
34703
34828
  }
@@ -34709,7 +34834,7 @@ var tx = (effect2) => withFiber2((fiber3) => {
34709
34834
  return uninterruptibleMask2((restore) => flatMap5(whileLoop2({
34710
34835
  while: () => !result3,
34711
34836
  body: constant(restore(effect2).pipe(provideService2(Transaction, state), tapCause3(() => {
34712
- if (!state.retry) return void_4;
34837
+ if (!state.retry) return void_5;
34713
34838
  return restore(awaitPendingTransaction(state));
34714
34839
  }), exit2)),
34715
34840
  step(exit3) {
@@ -34746,7 +34871,7 @@ var awaitPendingTransaction = (state) => suspend3(() => {
34746
34871
  return callback2((resume) => {
34747
34872
  const onCall = () => {
34748
34873
  clearPending();
34749
- resume(void_4);
34874
+ resume(void_5);
34750
34875
  };
34751
34876
  for (const ref of refs) {
34752
34877
  ref.pending.set(key, onCall);
@@ -35261,8 +35386,8 @@ var shutdown = (self) => sync(() => {
35261
35386
  return true;
35262
35387
  });
35263
35388
  var takeAll2 = (self) => takeBetween(self, 1, Number.POSITIVE_INFINITY);
35264
- var takeBetween = (self, min6, max6) => suspend(() => takeBetweenUnsafe(self, min6, max6) ?? andThen2(awaitTake(self), takeBetween(self, 1, max6)));
35265
- var take2 = (self) => suspend(() => takeUnsafe(self) ?? andThen2(awaitTake(self), take2(self)));
35389
+ var takeBetween = (self, min6, max6) => suspend(() => takeBetweenUnsafe(self, min6, max6) ?? andThen3(awaitTake(self), takeBetween(self, 1, max6)));
35390
+ var take2 = (self) => suspend(() => takeUnsafe(self) ?? andThen3(awaitTake(self), take2(self)));
35266
35391
  var poll = (self) => suspend(() => {
35267
35392
  const result3 = takeUnsafe(self);
35268
35393
  if (result3 === void 0) {
@@ -35470,9 +35595,9 @@ var SemaphoreImpl = class {
35470
35595
  resize(permits) {
35471
35596
  return withFiber((fiber3) => {
35472
35597
  this.permits = permits;
35473
- if (this.free < 0) return void_2;
35598
+ if (this.free < 0) return void_3;
35474
35599
  this.releaseUnsafe(fiber3, 0);
35475
- return void_2;
35600
+ return void_3;
35476
35601
  });
35477
35602
  }
35478
35603
  release(n) {
@@ -35485,7 +35610,7 @@ var SemaphoreImpl = class {
35485
35610
  return (self) => uninterruptibleMask((restore) => {
35486
35611
  const acquire = suspend(() => {
35487
35612
  if (this.free < n) {
35488
- const wait = waitForPermits(this, n, void_2);
35613
+ const wait = waitForPermits(this, n, void_3);
35489
35614
  return flatMap3(restore(wait), () => acquire);
35490
35615
  }
35491
35616
  this.taken += n;
@@ -35500,7 +35625,7 @@ var SemaphoreImpl = class {
35500
35625
  withPermit = /* @__PURE__ */ this.withPermits(1);
35501
35626
  withPermitsIfAvailable(n) {
35502
35627
  return (self) => uninterruptibleMask((restore) => {
35503
- if (this.free < n) return succeedNone;
35628
+ if (this.free < n) return succeedNone2;
35504
35629
  this.taken += n;
35505
35630
  return onExitPrimitive(restore(asSome(self)), () => {
35506
35631
  this.releaseUnsafe(getCurrentFiber(), n);
@@ -35543,7 +35668,7 @@ var DefaultChunkSize = 4096;
35543
35668
  var asyncQueue = (scope3, f, options4) => make11({
35544
35669
  capacity: options4?.bufferSize,
35545
35670
  strategy: options4?.strategy
35546
- }).pipe(tap4((queue) => addFinalizer2(scope3, shutdown(queue))), tap4((queue) => forkIn2(provide(f(queue), scope3), scope3)));
35671
+ }).pipe(tap5((queue) => addFinalizer2(scope3, shutdown(queue))), tap5((queue) => forkIn2(provide(f(queue), scope3), scope3)));
35547
35672
  var callbackArray = (f, options4) => fromTransform((_, scope3) => map7(asyncQueue(scope3, f, options4), takeAll2));
35548
35673
  var suspend4 = (evaluate2) => fromTransform((upstream, scope3) => suspend3(() => toTransform(evaluate2())(upstream, scope3)));
35549
35674
  var fromIteratorArray = (iterator, chunkSize = DefaultChunkSize) => fromPull(sync3(() => {
@@ -35621,7 +35746,7 @@ var catchCause4 = /* @__PURE__ */ dual(2, (self, f) => fromTransform((upstream,
35621
35746
  }
35622
35747
  const toClose = forkedScope;
35623
35748
  forkedScope = forkUnsafe2(scope3);
35624
- return close(toClose, failCause2(cause)).pipe(andThen3(toTransform(f(cause))(upstream, forkedScope)), flatMap5((childPull) => {
35749
+ return close(toClose, failCause2(cause)).pipe(andThen4(toTransform(f(cause))(upstream, forkedScope)), flatMap5((childPull) => {
35625
35750
  currentPull = childPull;
35626
35751
  return childPull;
35627
35752
  }));
@@ -35635,7 +35760,7 @@ var catchCauseFilter3 = /* @__PURE__ */ dual(3, (self, filter12, f) => catchCaus
35635
35760
  }));
35636
35761
  var catch_4 = /* @__PURE__ */ dual(2, (self, f) => catchCauseFilter3(self, findError2, (e) => f(e)));
35637
35762
  var mapError4 = /* @__PURE__ */ dual(2, (self, f) => catch_4(self, (err) => fail7(f(err))));
35638
- var merge3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]) && isChannel(args2[1]), (left, right, options4) => fromTransformBracket(fnUntraced2(function* (upstream, _scope, forkedScope) {
35763
+ var merge4 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]) && isChannel(args2[1]), (left, right, options4) => fromTransformBracket(fnUntraced2(function* (upstream, _scope, forkedScope) {
35639
35764
  const strategy = options4?.haltStrategy ?? "both";
35640
35765
  const queue = yield* bounded(0);
35641
35766
  yield* addFinalizer2(forkedScope, shutdown(queue));
@@ -35647,18 +35772,18 @@ var merge3 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]) && isChannel(ar
35647
35772
  }
35648
35773
  switch (strategy) {
35649
35774
  case "both": {
35650
- return done4 === 2 ? failCause4(queue, cause) : void_4;
35775
+ return done4 === 2 ? failCause4(queue, cause) : void_5;
35651
35776
  }
35652
35777
  case "left":
35653
35778
  case "right": {
35654
- return side === strategy ? failCause4(queue, cause) : void_4;
35779
+ return side === strategy ? failCause4(queue, cause) : void_5;
35655
35780
  }
35656
35781
  case "either": {
35657
35782
  return failCause4(queue, cause);
35658
35783
  }
35659
35784
  }
35660
35785
  }
35661
- const runSide = (side, channel, scope3) => toTransform(channel)(upstream, scope3).pipe(flatMap5((pull) => pull.pipe(flatMap5((value3) => offer(queue, value3)), forever3)), onError2((cause) => andThen3(close(scope3, doneExitFromCause(cause)), onExit4(side, cause))), forkIn2(forkedScope));
35786
+ const runSide = (side, channel, scope3) => toTransform(channel)(upstream, scope3).pipe(flatMap5((pull) => pull.pipe(flatMap5((value3) => offer(queue, value3)), forever3)), onError2((cause) => andThen4(close(scope3, doneExitFromCause(cause)), onExit4(side, cause))), forkIn2(forkedScope));
35662
35787
  yield* runSide("left", left, forkUnsafe2(forkedScope));
35663
35788
  yield* runSide("right", right, forkUnsafe2(forkedScope));
35664
35789
  return take2(queue);
@@ -35748,7 +35873,7 @@ var unwrap2 = (channel) => fromTransform((upstream, scope3) => {
35748
35873
  return channel.pipe(provide(scope3), flatMap5((channel2) => toTransform(channel2)(upstream, scope3)), flatMap5((pull_) => pull = pull_));
35749
35874
  }));
35750
35875
  });
35751
- var onExit3 = /* @__PURE__ */ dual(2, (self, finalizer) => fromTransformBracket((upstream, scope3, forkedScope) => addFinalizerExit(forkedScope, finalizer).pipe(andThen3(toTransform(self)(upstream, scope3)))));
35876
+ var onExit3 = /* @__PURE__ */ dual(2, (self, finalizer) => fromTransformBracket((upstream, scope3, forkedScope) => addFinalizerExit(forkedScope, finalizer).pipe(andThen4(toTransform(self)(upstream, scope3)))));
35752
35877
  var ensuring3 = /* @__PURE__ */ dual(2, (self, finalizer) => onExit3(self, (_) => finalizer));
35753
35878
  var runWith = (self, f, onHalt) => suspend3(() => {
35754
35879
  const scope3 = makeUnsafe3();
@@ -35884,7 +36009,7 @@ var make12 = (options4) => withFiber2((fiber3) => {
35884
36009
  const scope3 = get(context3, Scope);
35885
36010
  const ref = new RcRefImpl(options4.acquire, context3, scope3, options4.idleTimeToLive ? fromInputUnsafe(options4.idleTimeToLive) : void 0);
35886
36011
  return as3(addFinalizerExit(scope3, () => {
35887
- const close3 = ref.state._tag === "Acquired" ? close(ref.state.scope, void_3) : void_4;
36012
+ const close3 = ref.state._tag === "Acquired" ? close(ref.state.scope, void_4) : void_5;
35888
36013
  ref.state = stateClosed;
35889
36014
  return close3;
35890
36015
  }), ref);
@@ -35915,7 +36040,7 @@ var getState = (self) => uninterruptibleMask2(function loop(restore) {
35915
36040
  };
35916
36041
  self.state = state;
35917
36042
  return state;
35918
- }), onExit2((exit3) => isFailure4(exit3) ? close(scope3, exit3) : void_4));
36043
+ }), onExit2((exit3) => isFailure4(exit3) ? close(scope3, exit3) : void_5));
35919
36044
  }));
35920
36045
  }
35921
36046
  }
@@ -35928,26 +36053,26 @@ var get2 = /* @__PURE__ */ fnUntraced2(function* (self_) {
35928
36053
  yield* addFinalizerExit(scope3, () => {
35929
36054
  state.refCount--;
35930
36055
  if (state.refCount > 0) {
35931
- return void_4;
36056
+ return void_5;
35932
36057
  }
35933
36058
  if (self.idleTimeToLive === void 0) {
35934
36059
  self.state = stateEmpty;
35935
- return close(state.scope, void_3);
36060
+ return close(state.scope, void_4);
35936
36061
  } else if (state.invalidated) {
35937
- return close(state.scope, void_3);
36062
+ return close(state.scope, void_4);
35938
36063
  } else if (!isFinite4) {
35939
- return void_4;
36064
+ return void_5;
35940
36065
  }
35941
36066
  state.fiber = sleep2(self.idleTimeToLive).pipe(flatMap5(() => {
35942
36067
  if (self.state._tag === "Acquired" && self.state.refCount === 0) {
35943
36068
  self.state = stateEmpty;
35944
- return close(state.scope, void_3);
36069
+ return close(state.scope, void_4);
35945
36070
  }
35946
- return void_4;
36071
+ return void_5;
35947
36072
  }), ensuring2(sync3(() => {
35948
36073
  state.fiber = void 0;
35949
36074
  })), runForkWith2(self.context), runIn(self.scope));
35950
- return void_4;
36075
+ return void_5;
35951
36076
  });
35952
36077
  return state.value;
35953
36078
  });
@@ -35976,7 +36101,7 @@ var map9 = /* @__PURE__ */ dual(2, (self, f) => suspend5(() => {
35976
36101
  let i = 0;
35977
36102
  return fromChannel3(map8(self.channel, map4((o) => f(o, i++))));
35978
36103
  }));
35979
- var merge4 = /* @__PURE__ */ dual((args2) => isStream(args2[0]) && isStream(args2[1]), (self, that, options4) => fromChannel3(merge3(toChannel2(self), toChannel2(that), options4)));
36104
+ var merge5 = /* @__PURE__ */ dual((args2) => isStream(args2[0]) && isStream(args2[1]), (self, that, options4) => fromChannel3(merge4(toChannel2(self), toChannel2(that), options4)));
35980
36105
  var mapError5 = /* @__PURE__ */ dual(2, (self, f) => fromChannel3(mapError4(self.channel, f)));
35981
36106
  var transduce = /* @__PURE__ */ dual(2, (self, sink) => transformPull2(self, (upstream, scope3) => sync3(() => {
35982
36107
  let done4;
@@ -37088,7 +37213,7 @@ var Getter = class _Getter extends Class {
37088
37213
  }
37089
37214
  };
37090
37215
  function succeed10(t) {
37091
- return new Getter(() => succeedSome2(t));
37216
+ return new Getter(() => succeedSome3(t));
37092
37217
  }
37093
37218
  function fail10(f) {
37094
37219
  return new Getter((oe, options4) => fail6(f(oe, options4)));
@@ -37121,7 +37246,7 @@ function required(annotations2) {
37121
37246
  return onNone(() => fail6(new MissingKey(annotations2)));
37122
37247
  }
37123
37248
  function onSome(f) {
37124
- return new Getter((oe, options4) => isNone2(oe) ? succeedNone2 : f(oe.value, options4));
37249
+ return new Getter((oe, options4) => isNone2(oe) ? succeedNone3 : f(oe.value, options4));
37125
37250
  }
37126
37251
  function checkEffect(f) {
37127
37252
  return onSome((t, options4) => {
@@ -37141,7 +37266,7 @@ function transformOptional(f) {
37141
37266
  return new Getter((oe) => succeed6(f(oe)));
37142
37267
  }
37143
37268
  function omit2() {
37144
- return new Getter(() => succeedNone2);
37269
+ return new Getter(() => succeedNone3);
37145
37270
  }
37146
37271
  function withDefault(defaultValue) {
37147
37272
  return new Getter((o) => {
@@ -38033,7 +38158,7 @@ var Void = class extends Base2 {
38033
38158
  return "void";
38034
38159
  }
38035
38160
  };
38036
- var void_5 = /* @__PURE__ */ new Void();
38161
+ var void_6 = /* @__PURE__ */ new Void();
38037
38162
  var Never = class extends Base2 {
38038
38163
  _tag = "Never";
38039
38164
  /** @internal */
@@ -38612,14 +38737,14 @@ var Objects = class _Objects extends Base2 {
38612
38737
  let indexes;
38613
38738
  const finishIndex = (s, key, k2, inputValue, exitValue) => {
38614
38739
  if (exitValue._tag === "Failure") {
38615
- return wrapPropertyKeyIssue(s, ast, key, exitValue) ?? void_3;
38740
+ return wrapPropertyKeyIssue(s, ast, key, exitValue) ?? void_4;
38616
38741
  }
38617
38742
  const value3 = exitValue === sameExit ? inputValue : exitValue[args];
38618
38743
  if (k2 !== missing && value3 !== missing) {
38619
- if (hasProperties && (expectedKeysSet.has(key) || expectedKeysSet.has(k2))) return void_3;
38744
+ if (hasProperties && (expectedKeysSet.has(key) || expectedKeysSet.has(k2))) return void_4;
38620
38745
  assignProperty(s.out, k2, value3);
38621
38746
  }
38622
- return void_3;
38747
+ return void_4;
38623
38748
  };
38624
38749
  const parseIndex = (s, key, index2, exitKey) => {
38625
38750
  if (!exitKey) {
@@ -38630,7 +38755,7 @@ var Objects = class _Objects extends Base2 {
38630
38755
  exitKey = eff;
38631
38756
  }
38632
38757
  if (exitKey._tag === "Failure") {
38633
- return wrapPropertyKeyIssue(s, ast, key, exitKey) ?? void_3;
38758
+ return wrapPropertyKeyIssue(s, ast, key, exitKey) ?? void_4;
38634
38759
  }
38635
38760
  const k2 = exitKey === sameExit ? key : exitKey[args];
38636
38761
  const inputValue = s.input[key];
@@ -39087,7 +39212,7 @@ function getIndex(types) {
39087
39212
  }
39088
39213
  }
39089
39214
  if (directKey === void 0) {
39090
- for (const [key, [byValue, all5]] of bySentinel) {
39215
+ for (const [key, [byValue, all6]] of bySentinel) {
39091
39216
  const hasKey = Object.hasOwn(input, key);
39092
39217
  const value3 = hasKey ? input[key] : void 0;
39093
39218
  if (hasKey && (!isConstructor || value3 !== void 0)) {
@@ -39096,18 +39221,18 @@ function getIndex(types) {
39096
39221
  for (const i of match9) selected.add(i);
39097
39222
  }
39098
39223
  } else if (isConstructor) {
39099
- for (const i of all5) selected.add(i);
39224
+ for (const i of all6) selected.add(i);
39100
39225
  }
39101
39226
  }
39102
39227
  }
39103
- for (const [key, [byValue, all5]] of bySentinel) {
39228
+ for (const [key, [byValue, all6]] of bySentinel) {
39104
39229
  if (key === directKey) continue;
39105
39230
  const hasKey = Object.hasOwn(input, key);
39106
39231
  const value3 = hasKey ? input[key] : void 0;
39107
39232
  if (hasKey && (!isConstructor || value3 !== void 0)) {
39108
39233
  const match9 = byValue.get(value3);
39109
39234
  for (const i of selected) {
39110
- if (all5.has(i) && !match9?.has(i)) selected.delete(i);
39235
+ if (all6.has(i) && !match9?.has(i)) selected.delete(i);
39111
39236
  }
39112
39237
  }
39113
39238
  }
@@ -39255,7 +39380,7 @@ var parseUnion = /* @__PURE__ */ iterateEager()({
39255
39380
  if (s.successes) {
39256
39381
  s.successes.push(candidate);
39257
39382
  } else {
39258
- return void_3;
39383
+ return void_4;
39259
39384
  }
39260
39385
  }
39261
39386
  }
@@ -39630,29 +39755,29 @@ var toType = /* @__PURE__ */ memoizeIdempotent((ast) => {
39630
39755
  return type;
39631
39756
  });
39632
39757
  var toEncoded = /* @__PURE__ */ memoizeIdempotent((ast) => {
39633
- return toType(flip3(ast));
39758
+ return toType(flip4(ast));
39634
39759
  });
39635
39760
  function flipEncoding(ast, encoding) {
39636
39761
  const links = encoding;
39637
39762
  const len = links.length;
39638
39763
  const last = links[len - 1];
39639
- const ls = [new Link(flip3(replaceEncoding(ast, void 0)), links[0].transformation.flip())];
39764
+ const ls = [new Link(flip4(replaceEncoding(ast, void 0)), links[0].transformation.flip())];
39640
39765
  for (let i = 1; i < len; i++) {
39641
- ls.unshift(new Link(flip3(links[i - 1].to), links[i].transformation.flip()));
39766
+ ls.unshift(new Link(flip4(links[i - 1].to), links[i].transformation.flip()));
39642
39767
  }
39643
- const to = flip3(last.to);
39768
+ const to = flip4(last.to);
39644
39769
  if (to.encoding) {
39645
39770
  return replaceEncoding(to, [...to.encoding, ...ls]);
39646
39771
  } else {
39647
39772
  return replaceEncoding(to, ls);
39648
39773
  }
39649
39774
  }
39650
- var flip3 = /* @__PURE__ */ memoize((ast) => {
39775
+ var flip4 = /* @__PURE__ */ memoize((ast) => {
39651
39776
  if (ast.encoding) {
39652
39777
  return flipEncoding(ast, ast.encoding);
39653
39778
  }
39654
39779
  const out = ast;
39655
- return out.flip?.(flip3) ?? out.recur?.(flip3) ?? out;
39780
+ return out.flip?.(flip4) ?? out.recur?.(flip4) ?? out;
39656
39781
  });
39657
39782
  function containsUndefined(ast) {
39658
39783
  switch (ast._tag) {
@@ -40187,7 +40312,7 @@ var pullIntoWritable = (options4) => options4.pull.pipe(flatMap5((chunk) => {
40187
40312
  return;
40188
40313
  }
40189
40314
  }
40190
- resume(void_4);
40315
+ resume(void_5);
40191
40316
  });
40192
40317
  }), forever3({
40193
40318
  disableYield: true
@@ -40394,7 +40519,7 @@ var taskkill = (childProcess, onExit4 = () => {
40394
40519
  }) => NodeChildProcess.execFile("taskkill", ["/pid", String(childProcess.pid), "/T", "/F"], {
40395
40520
  windowsHide: true
40396
40521
  }, onExit4);
40397
- var make21 = /* @__PURE__ */ gen3(function* () {
40522
+ var make21 = /* @__PURE__ */ gen4(function* () {
40398
40523
  const fs = yield* FileSystem;
40399
40524
  const path10 = yield* Path;
40400
40525
  const resolveWorkingDirectory = fnUntraced2(function* (options4) {
@@ -40585,11 +40710,11 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40585
40710
  if (isSink(stderrConfig.stream)) {
40586
40711
  stderr = transduce(stderr, stderrConfig.stream);
40587
40712
  }
40588
- const all5 = merge4(stdout, stderr);
40713
+ const all6 = merge5(stdout, stderr);
40589
40714
  return {
40590
40715
  stdout,
40591
40716
  stderr,
40592
- all: all5
40717
+ all: all6
40593
40718
  };
40594
40719
  };
40595
40720
  const spawn3 = (command, spawnOptions) => callback2((resume) => {
@@ -40615,7 +40740,7 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40615
40740
  if (error2) {
40616
40741
  resume(fail6(toPlatformError("kill", toError(error2), command)));
40617
40742
  } else {
40618
- resume(void_4);
40743
+ resume(void_5);
40619
40744
  }
40620
40745
  });
40621
40746
  });
@@ -40643,7 +40768,7 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40643
40768
  const error2 = new globalThis.Error("Failed to kill child process");
40644
40769
  return fail6(toPlatformError("kill", error2, command));
40645
40770
  }
40646
- return void_4;
40771
+ return void_5;
40647
40772
  });
40648
40773
  const withTimeout = (childProcess, command, options4) => (kill) => {
40649
40774
  const killSignal = options4?.killSignal ?? "SIGTERM";
@@ -40653,8 +40778,8 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40653
40778
  });
40654
40779
  };
40655
40780
  const getSourceStream = (handle, from) => {
40656
- const fromOption4 = from ?? "stdout";
40657
- switch (fromOption4) {
40781
+ const fromOption5 = from ?? "stdout";
40782
+ switch (fromOption5) {
40658
40783
  case "stdout":
40659
40784
  return handle.stdout;
40660
40785
  case "stderr":
@@ -40662,7 +40787,7 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40662
40787
  case "all":
40663
40788
  return handle.all;
40664
40789
  default: {
40665
- const fd = parseFdName(fromOption4);
40790
+ const fd = parseFdName(fromOption5);
40666
40791
  if (isNotUndefined(fd)) {
40667
40792
  return handle.getOutputFd(fd);
40668
40793
  }
@@ -40693,12 +40818,12 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40693
40818
  if (code !== 0 && isNotNull(code)) {
40694
40819
  return yield* ignore2(killWithTimeout(killProcessGroup));
40695
40820
  }
40696
- return yield* void_4;
40821
+ return yield* void_5;
40697
40822
  }
40698
40823
  if (!isReferenced) {
40699
- return yield* void_4;
40824
+ return yield* void_5;
40700
40825
  }
40701
- return yield* killWithTimeout((command, childProcess3, signal) => killProcessGroup(command, childProcess3, signal).pipe(catch_3(() => killProcess(command, childProcess3, signal)), andThen3(_await(exitSignal2)))).pipe(ignore2);
40826
+ return yield* killWithTimeout((command, childProcess3, signal) => killProcessGroup(command, childProcess3, signal).pipe(catch_3(() => killProcess(command, childProcess3, signal)), andThen4(_await(exitSignal2)))).pipe(ignore2);
40702
40827
  }));
40703
40828
  const pid = ProcessId(childProcess.pid);
40704
40829
  childProcess.on("exit", (code) => {
@@ -40721,7 +40846,7 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40721
40846
  });
40722
40847
  const stdin = yield* setupChildStdin(cmd, childProcess, stdinConfig);
40723
40848
  const {
40724
- all: all5,
40849
+ all: all6,
40725
40850
  stderr,
40726
40851
  stdout
40727
40852
  } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);
@@ -40739,7 +40864,7 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40739
40864
  });
40740
40865
  const kill = (options4) => {
40741
40866
  const killWithTimeout = withTimeout(childProcess, cmd, options4);
40742
- return killWithTimeout((command, childProcess2, signal) => killProcessGroup(command, childProcess2, signal).pipe(catch_3(() => killProcess(command, childProcess2, signal)), andThen3(_await(exitSignal)))).pipe(asVoid3);
40867
+ return killWithTimeout((command, childProcess2, signal) => killProcessGroup(command, childProcess2, signal).pipe(catch_3(() => killProcess(command, childProcess2, signal)), andThen4(_await(exitSignal)))).pipe(asVoid3);
40743
40868
  };
40744
40869
  return makeHandle({
40745
40870
  pid,
@@ -40749,7 +40874,7 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40749
40874
  stdin,
40750
40875
  stdout,
40751
40876
  stderr,
40752
- all: all5,
40877
+ all: all6,
40753
40878
  getInputFd,
40754
40879
  getOutputFd,
40755
40880
  unref
@@ -40806,7 +40931,7 @@ var make21 = /* @__PURE__ */ gen3(function* () {
40806
40931
  const kill = (options4) => forEach2([...handles].reverse(), (handle2) => ignore2(handle2.kill(options4)), {
40807
40932
  discard: true
40808
40933
  });
40809
- const unref = gen3(function* () {
40934
+ const unref = gen4(function* () {
40810
40935
  const rerefs = [];
40811
40936
  for (const handle2 of handles) {
40812
40937
  rerefs.push(yield* handle2.unref);
@@ -40877,7 +41002,7 @@ __export(HttpClient_exports, {
40877
41002
  del: () => del2,
40878
41003
  execute: () => execute,
40879
41004
  filterOrElse: () => filterOrElse3,
40880
- filterOrFail: () => filterOrFail3,
41005
+ filterOrFail: () => filterOrFail4,
40881
41006
  filterStatus: () => filterStatus2,
40882
41007
  filterStatusOk: () => filterStatusOk2,
40883
41008
  followRedirects: () => followRedirects,
@@ -40897,7 +41022,7 @@ __export(HttpClient_exports, {
40897
41022
  put: () => put2,
40898
41023
  retry: () => retry4,
40899
41024
  retryTransient: () => retryTransient,
40900
- tap: () => tap5,
41025
+ tap: () => tap6,
40901
41026
  tapError: () => tapError5,
40902
41027
  tapRequest: () => tapRequest,
40903
41028
  transform: () => transform4,
@@ -41113,7 +41238,7 @@ __export(Schema_exports, {
41113
41238
  encodeUnknownSync: () => encodeUnknownSync2,
41114
41239
  extendTo: () => extendTo,
41115
41240
  fieldsAssign: () => fieldsAssign,
41116
- flip: () => flip4,
41241
+ flip: () => flip5,
41117
41242
  fromBrand: () => fromBrand,
41118
41243
  fromFormData: () => fromFormData2,
41119
41244
  fromJsonString: () => fromJsonString2,
@@ -42227,7 +42352,7 @@ function decodeUnknownSync(schema2, options4) {
42227
42352
  }
42228
42353
  var decodeSync = decodeUnknownSync;
42229
42354
  function encodeUnknownEffect(schema2, options4) {
42230
- const parser = run2(flip3(schema2.ast));
42355
+ const parser = run2(flip4(schema2.ast));
42231
42356
  return options4 === void 0 ? parser : (input, overrideOptions) => parser(input, mergeParseOptions(options4, overrideOptions));
42232
42357
  }
42233
42358
  function encodeUnknownExit(schema2, options4) {
@@ -42519,9 +42644,9 @@ function makeCombiner(combiners, options4) {
42519
42644
  const keys4 = Reflect.ownKeys(combiners);
42520
42645
  const out = {};
42521
42646
  for (const key of keys4) {
42522
- const merge7 = combiners[key].combine(self[key], that[key]);
42523
- if (omitKeyWhen(merge7)) continue;
42524
- assignProperty(out, key, merge7);
42647
+ const merge8 = combiners[key].combine(self[key], that[key]);
42648
+ if (omitKeyWhen(merge8)) continue;
42649
+ assignProperty(out, key, merge8);
42525
42650
  }
42526
42651
  return out;
42527
42652
  });
@@ -45226,7 +45351,7 @@ function annotate2(annotations2) {
45226
45351
  return (self) => self.annotate(annotations2);
45227
45352
  }
45228
45353
  function annotateEncoded(annotations2) {
45229
- return (self) => flip4(flip4(self).annotate(annotations2));
45354
+ return (self) => flip5(flip5(self).annotate(annotations2));
45230
45355
  }
45231
45356
  function annotateKey2(annotations2) {
45232
45357
  return (self) => {
@@ -45502,11 +45627,11 @@ var FlipTypeId = "~effect/Schema/flip";
45502
45627
  function isFlip$(schema2) {
45503
45628
  return hasProperty(schema2, FlipTypeId) && schema2[FlipTypeId] === FlipTypeId;
45504
45629
  }
45505
- function flip4(schema2) {
45630
+ function flip5(schema2) {
45506
45631
  if (isFlip$(schema2)) {
45507
- return schema2.schema.rebuild(flip3(schema2.ast));
45632
+ return schema2.schema.rebuild(flip4(schema2.ast));
45508
45633
  }
45509
- return make29(flip3(schema2.ast), {
45634
+ return make29(flip4(schema2.ast), {
45510
45635
  [FlipTypeId]: FlipTypeId,
45511
45636
  schema: schema2
45512
45637
  });
@@ -45551,7 +45676,7 @@ var Number6 = /* @__PURE__ */ make29(number2);
45551
45676
  var Boolean5 = /* @__PURE__ */ make29(boolean);
45552
45677
  var Symbol3 = /* @__PURE__ */ make29(symbol3);
45553
45678
  var BigInt5 = /* @__PURE__ */ make29(bigInt);
45554
- var Void2 = /* @__PURE__ */ make29(void_5);
45679
+ var Void2 = /* @__PURE__ */ make29(void_6);
45555
45680
  var ObjectKeyword2 = /* @__PURE__ */ make29(objectKeyword);
45556
45681
  function UniqueSymbol2(symbol5) {
45557
45682
  return make29(new UniqueSymbol(symbol5));
@@ -45886,18 +46011,18 @@ function toTaggedUnion(tag2) {
45886
46011
  function matchOrElse() {
45887
46012
  if (arguments.length === 2) {
45888
46013
  const cases3 = arguments[0];
45889
- const orElse8 = arguments[1];
46014
+ const orElse9 = arguments[1];
45890
46015
  return function(value4) {
45891
46016
  const key2 = value4[tag2];
45892
- const handler2 = Object.hasOwn(cases3, key2) ? cases3[key2] ?? orElse8 : orElse8;
46017
+ const handler2 = Object.hasOwn(cases3, key2) ? cases3[key2] ?? orElse9 : orElse9;
45893
46018
  return handler2(value4);
45894
46019
  };
45895
46020
  }
45896
46021
  const value3 = arguments[0];
45897
46022
  const cases2 = arguments[1];
45898
- const orElse7 = arguments[2];
46023
+ const orElse8 = arguments[2];
45899
46024
  const key = value3[tag2];
45900
- const handler = Object.hasOwn(cases2, key) ? cases2[key] ?? orElse7 : orElse7;
46025
+ const handler = Object.hasOwn(cases2, key) ? cases2[key] ?? orElse8 : orElse8;
45901
46026
  return handler(value3);
45902
46027
  }
45903
46028
  };
@@ -47278,7 +47403,7 @@ function Option(value3) {
47278
47403
  const schema2 = declareConstructor()([value3], ([value4]) => (input, ast, options4) => {
47279
47404
  if (isOption2(input)) {
47280
47405
  if (isNone2(input)) {
47281
- return succeedNone2;
47406
+ return succeedNone3;
47282
47407
  }
47283
47408
  return mapBothEager2(decodeUnknownEffect(value4)(input.value, options4), {
47284
47409
  onSuccess: some2,
@@ -47458,7 +47583,7 @@ function Redacted(value3, options4) {
47458
47583
  const decodeLabel = label !== void 0 ? decodeUnknownEffect(Literal2(label)) : void 0;
47459
47584
  const schema2 = declareConstructor()([value3], ([value4]) => (input, ast, poptions) => {
47460
47585
  if (isRedacted(input)) {
47461
- const label2 = decodeLabel !== void 0 ? mapErrorEager2(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_4;
47586
+ const label2 = decodeLabel !== void 0 ? mapErrorEager2(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_5;
47462
47587
  return flatMapEager2(label2, () => mapBothEager2(decodeUnknownEffect(value4)(value2(input), poptions), {
47463
47588
  onSuccess: () => input,
47464
47589
  onFailure: () => {
@@ -49798,7 +49923,7 @@ var CookieProto = {
49798
49923
  };
49799
49924
  }
49800
49925
  };
49801
- var merge5 = /* @__PURE__ */ dual(2, (self, that) => fromReadonlyRecord({
49926
+ var merge6 = /* @__PURE__ */ dual(2, (self, that) => fromReadonlyRecord({
49802
49927
  ...self.cookies,
49803
49928
  ...that.cookies
49804
49929
  }));
@@ -49901,7 +50026,7 @@ var setAll = /* @__PURE__ */ dual(2, (self, headers) => make30({
49901
50026
  ...self,
49902
50027
  ...fromInput2(headers)
49903
50028
  }));
49904
- var merge6 = /* @__PURE__ */ dual(2, (self, headers) => {
50029
+ var merge7 = /* @__PURE__ */ dual(2, (self, headers) => {
49905
50030
  const out = make30(self);
49906
50031
  Object.assign(out, headers);
49907
50032
  return out;
@@ -50945,8 +51070,8 @@ var transformResponse = /* @__PURE__ */ dual(2, (self, f) => makeWith2((request5
50945
51070
  var catch_5 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, catch_3(f)));
50946
51071
  var catchTag4 = /* @__PURE__ */ dual(3, (self, tag2, f) => transformResponse(self, (effect2) => catchTag3(effect2, tag2, f)));
50947
51072
  var catchTags3 = /* @__PURE__ */ dual(2, (self, cases) => transformResponse(self, catchTags2(cases)));
50948
- var filterOrElse3 = /* @__PURE__ */ dual(3, (self, f, orElse7) => transformResponse(self, filterOrElse2(f, orElse7)));
50949
- var filterOrFail3 = /* @__PURE__ */ dual(3, (self, f, orFailWith) => transformResponse(self, filterOrFail2(f, orFailWith)));
51073
+ var filterOrElse3 = /* @__PURE__ */ dual(3, (self, f, orElse8) => transformResponse(self, filterOrElse2(f, orElse8)));
51074
+ var filterOrFail4 = /* @__PURE__ */ dual(3, (self, f, orFailWith) => transformResponse(self, filterOrFail3(f, orFailWith)));
50950
51075
  var filterStatus2 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, flatMap5(filterStatus(f))));
50951
51076
  var filterStatusOk2 = /* @__PURE__ */ transformResponse(/* @__PURE__ */ flatMap5(filterStatusOk));
50952
51077
  var makeWith2 = (postprocess, preprocess) => {
@@ -51276,14 +51401,14 @@ var getHeader = (headers, ...keys4) => {
51276
51401
  }
51277
51402
  return void 0;
51278
51403
  };
51279
- var tap5 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tap4(f)));
51404
+ var tap6 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tap5(f)));
51280
51405
  var tapError5 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tapError3(f)));
51281
- var tapRequest = /* @__PURE__ */ dual(2, (self, f) => makeWith2(self.postprocess, (request5) => tap4(self.preprocess(request5), f)));
51282
- var withCookiesRef = /* @__PURE__ */ dual(2, (self, ref) => makeWith2((request5) => tap4(self.postprocess(request5), (response) => update2(ref, (cookies) => merge5(cookies, response.cookies))), (request5) => flatMap5(self.preprocess(request5), (request6) => map7(get4(ref), (cookies) => isEmpty3(cookies) ? request6 : setHeader(request6, "cookie", toCookieHeader(cookies))))));
51406
+ var tapRequest = /* @__PURE__ */ dual(2, (self, f) => makeWith2(self.postprocess, (request5) => tap5(self.preprocess(request5), f)));
51407
+ var withCookiesRef = /* @__PURE__ */ dual(2, (self, ref) => makeWith2((request5) => tap5(self.postprocess(request5), (response) => update2(ref, (cookies) => merge6(cookies, response.cookies))), (request5) => flatMap5(self.preprocess(request5), (request6) => map7(get4(ref), (cookies) => isEmpty3(cookies) ? request6 : setHeader(request6, "cookie", toCookieHeader(cookies))))));
51283
51408
  var withScope = (self) => transform4(self, (effect2, request5) => {
51284
51409
  const controller = new AbortController();
51285
51410
  scopedRequests.set(request5, controller);
51286
- return andThen3(addFinalizer3(() => sync3(() => controller.abort())), effect2);
51411
+ return andThen4(addFinalizer3(() => sync3(() => controller.abort())), effect2);
51287
51412
  });
51288
51413
  var followRedirects = /* @__PURE__ */ dual((args2) => isHttpClient(args2[0]), (self, maxRedirects) => makeWith2((request5) => {
51289
51414
  const loop = (request6, redirects) => flatMap5(self.postprocess(succeed6(request6)), (response) => {
@@ -51317,7 +51442,7 @@ var TracerPropagationEnabled = /* @__PURE__ */ Reference("effect/HttpClient/Trac
51317
51442
  var SpanNameGenerator = /* @__PURE__ */ Reference("effect/http/HttpClient/SpanNameGenerator", {
51318
51443
  defaultValue: () => (request5) => `http.client ${request5.method}`
51319
51444
  });
51320
- var layerMergedContext = (effect2) => effect(HttpClient)(contextWith2((context3) => map7(effect2, (client) => transformResponse(client, updateContext2((input) => merge(context3, input))))));
51445
+ var layerMergedContext = (effect2) => effect(HttpClient)(contextWith2((context3) => map7(effect2, (client) => transformResponse(client, updateContext2((input) => merge2(context3, input))))));
51321
51446
  var responseRegistry = /* @__PURE__ */ (() => {
51322
51447
  if ("FinalizationRegistry" in globalThis && globalThis.FinalizationRegistry) {
51323
51448
  const registry = /* @__PURE__ */ new FinalizationRegistry((controller) => {
@@ -51454,7 +51579,7 @@ var ServerHttpClientResponse = class extends Class2 {
51454
51579
  }
51455
51580
  cachedHeaders;
51456
51581
  get headers() {
51457
- return this.cachedHeaders ??= this.response.body._tag === "FormData" ? merge6(this.response.headers, fromInput2(this.getFormDataResponse().headers)) : this.response.headers;
51582
+ return this.cachedHeaders ??= this.response.body._tag === "FormData" ? merge7(this.response.headers, fromInput2(this.getFormDataResponse().headers)) : this.response.headers;
51458
51583
  }
51459
51584
  get cookies() {
51460
51585
  return this.response.cookies;
@@ -52474,14 +52599,14 @@ var makeChannel = (headers) => fromTransform((upstream) => map7(makeConfig(heade
52474
52599
  for (let i = 0; i < chunk.length; i++) {
52475
52600
  parser.write(chunk[i]);
52476
52601
  }
52477
- return void_4;
52602
+ return void_5;
52478
52603
  }), catchCause3((cause) => {
52479
52604
  if (isDoneCause(cause)) {
52480
52605
  parser.end();
52481
52606
  } else {
52482
52607
  exit3 = some2(failCause2(cause));
52483
52608
  }
52484
- return void_4;
52609
+ return void_5;
52485
52610
  }));
52486
52611
  return pump.pipe(flatMap5(function loop() {
52487
52612
  if (!isReadonlyArrayNonEmpty(partsBuffer)) {
@@ -52572,7 +52697,7 @@ var FileImpl = class extends PartBase {
52572
52697
  }
52573
52698
  };
52574
52699
  var defaultWriteFile = (path10, file5) => flatMap5(FileSystem, (fs) => mapError3(run(file5.content, fs.sink(path10)), (cause) => MultipartError.fromReason("InternalError", cause)));
52575
- var toPersisted = (stream2, writeFile3 = defaultWriteFile) => gen3(function* () {
52700
+ var toPersisted = (stream2, writeFile3 = defaultWriteFile) => gen4(function* () {
52576
52701
  const fs = yield* FileSystem;
52577
52702
  const path_ = yield* Path;
52578
52703
  const dir2 = yield* fs.makeTempDirectoryScoped();
@@ -52589,9 +52714,9 @@ var toPersisted = (stream2, writeFile3 = defaultWriteFile) => gen3(function* ()
52589
52714
  ;
52590
52715
  persisted[part.key].push(part.value);
52591
52716
  }
52592
- return void_4;
52717
+ return void_5;
52593
52718
  } else if (part.name === "") {
52594
- return void_4;
52719
+ return void_5;
52595
52720
  }
52596
52721
  const file5 = part;
52597
52722
  const fileName = path_.basename(file5.name).slice(-128);
@@ -53064,7 +53189,7 @@ var middleware = function() {
53064
53189
  }
53065
53190
  return makeMiddleware(arguments[0], arguments[1]);
53066
53191
  };
53067
- var makeMiddleware = (middleware2, options4) => options4?.global ? effectDiscard(gen3(function* () {
53192
+ var makeMiddleware = (middleware2, options4) => options4?.global ? effectDiscard(gen4(function* () {
53068
53193
  const router = yield* HttpRouter;
53069
53194
  const fn3 = isEffect2(middleware2) ? yield* middleware2 : middleware2;
53070
53195
  yield* router.addGlobalMiddleware(fn3);
@@ -53079,7 +53204,7 @@ var MiddlewareImpl = class _MiddlewareImpl {
53079
53204
  this.layerFn = layerFn;
53080
53205
  this.dependencies = dependencies;
53081
53206
  const contextKey = `effect/http/HttpRouter/Middleware-${++middlewareId}`;
53082
- this.layer = effectContext(gen3({
53207
+ this.layer = effectContext(gen4({
53083
53208
  self: this
53084
53209
  }, function* () {
53085
53210
  const context3 = yield* context2();
@@ -53151,7 +53276,7 @@ __export(Config_exports, {
53151
53276
  Port: () => Port,
53152
53277
  Record: () => Record2,
53153
53278
  TrueValues: () => TrueValues,
53154
- all: () => all4,
53279
+ all: () => all5,
53155
53280
  boolean: () => boolean2,
53156
53281
  date: () => date,
53157
53282
  duration: () => duration,
@@ -53168,7 +53293,7 @@ __export(Config_exports, {
53168
53293
  nonEmptyString: () => nonEmptyString,
53169
53294
  number: () => number3,
53170
53295
  option: () => option3,
53171
- orElse: () => orElse3,
53296
+ orElse: () => orElse4,
53172
53297
  port: () => port,
53173
53298
  redacted: () => redacted,
53174
53299
  schema: () => schema,
@@ -53199,7 +53324,7 @@ __export(ConfigProvider_exports, {
53199
53324
  makeValue: () => makeValue,
53200
53325
  mapInput: () => mapInput2,
53201
53326
  nested: () => nested,
53202
- orElse: () => orElse2
53327
+ orElse: () => orElse3
53203
53328
  });
53204
53329
  function makeValue(value3) {
53205
53330
  return {
@@ -53250,7 +53375,7 @@ function makeOrElse(first, second) {
53250
53375
  function make40(get11) {
53251
53376
  return makeSource(get11, identityPath);
53252
53377
  }
53253
- var orElse2 = /* @__PURE__ */ dual(2, (self, that) => makeOrElse(self, that));
53378
+ var orElse3 = /* @__PURE__ */ dual(2, (self, that) => makeOrElse(self, that));
53254
53379
  var mapInput2 = /* @__PURE__ */ dual(2, (self, f) => self.mapInput(f));
53255
53380
  var constantCase = /* @__PURE__ */ mapInput2((path10) => path10.map((seg) => typeof seg === "number" ? seg : configCase(seg)));
53256
53381
  var nested = /* @__PURE__ */ dual(2, (self, prefix) => {
@@ -53258,10 +53383,10 @@ var nested = /* @__PURE__ */ dual(2, (self, prefix) => {
53258
53383
  return mapInput2(self, (input) => [...path10, ...input]);
53259
53384
  });
53260
53385
  var layer2 = (self) => isEffect2(self) ? effect(ConfigProvider)(self) : succeed5(ConfigProvider)(self);
53261
- var layerAdd = (self, options4) => effect(ConfigProvider)(gen3(function* () {
53386
+ var layerAdd = (self, options4) => effect(ConfigProvider)(gen4(function* () {
53262
53387
  const current = yield* ConfigProvider;
53263
53388
  const configProvider = isEffect2(self) ? yield* self : self;
53264
- return options4?.asPrimary ? orElse2(configProvider, current) : orElse2(current, configProvider);
53389
+ return options4?.asPrimary ? orElse3(configProvider, current) : orElse3(current, configProvider);
53265
53390
  }));
53266
53391
  function fromUnknown(root2, options4) {
53267
53392
  const preserveEmptyStrings = options4?.preserveEmptyStrings === true;
@@ -53494,18 +53619,18 @@ var map13 = /* @__PURE__ */ dual(2, (self, f) => {
53494
53619
  var mapOrFail = /* @__PURE__ */ dual(2, (self, f) => {
53495
53620
  return make41((provider, pathPrefix) => flatMap5(evaluateAt(self, provider, pathPrefix), (resolution) => resolution._tag === "Resolved" ? f(resolution.value).pipe(mapEager2((value3) => resolved(value3, resolution.hasInput)), mapErrorEager2((error2) => evaluationFailure(error2, resolution.hasInput))) : succeed6(resolution)));
53496
53621
  });
53497
- var orElse3 = /* @__PURE__ */ dual(2, (self, that) => {
53622
+ var orElse4 = /* @__PURE__ */ dual(2, (self, that) => {
53498
53623
  return make41((provider, pathPrefix) => matchEffect3(evaluateAt(self, provider, pathPrefix), {
53499
53624
  onFailure: (failure) => preserveInputEvidence(evaluateAt(that(failure.error), provider, pathPrefix), failure.hasInput),
53500
53625
  onSuccess: (resolution) => resolution._tag === "Absent" ? evaluateAt(that(resolution.error), provider, pathPrefix) : succeed6(resolution)
53501
53626
  }));
53502
53627
  });
53503
- function all4(arg) {
53628
+ function all5(arg) {
53504
53629
  const configs = Array.isArray(arg) ? arg : Symbol.iterator in arg ? [...arg] : arg;
53505
53630
  if (Array.isArray(configs)) {
53506
- return make41((provider, pathPrefix) => flatMapEager2(all3(configs.map((config) => result2(evaluateAt(config, provider, pathPrefix)))), resolveArray));
53631
+ return make41((provider, pathPrefix) => flatMapEager2(all4(configs.map((config) => result2(evaluateAt(config, provider, pathPrefix)))), resolveArray));
53507
53632
  } else {
53508
- return make41((provider, pathPrefix) => flatMapEager2(all3(map3(configs, (config) => result2(evaluateAt(config, provider, pathPrefix)))), resolveRecord));
53633
+ return make41((provider, pathPrefix) => flatMapEager2(all4(map3(configs, (config) => result2(evaluateAt(config, provider, pathPrefix)))), resolveRecord));
53509
53634
  }
53510
53635
  }
53511
53636
  var resolveArray = (results) => {
@@ -53569,7 +53694,7 @@ var withDefault2 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
53569
53694
  var option3 = (self) => self.pipe(map13(some2), withDefault2(none2()));
53570
53695
  var unwrap5 = (wrapped) => {
53571
53696
  if (isConfig(wrapped)) return wrapped;
53572
- return all4(map3(wrapped, (config) => unwrap5(config)));
53697
+ return all5(map3(wrapped, (config) => unwrap5(config)));
53573
53698
  };
53574
53699
  var cursorToString = () => "<configuration>";
53575
53700
  var loadCursor = (provider, path10) => provider.load(path10).pipe(orDie3, mapEager2((node) => ({
@@ -54090,7 +54215,7 @@ var makeFile = /* @__PURE__ */ (() => {
54090
54215
  if (!this.append) {
54091
54216
  this.position = position + BigInt(bytesWritten);
54092
54217
  }
54093
- return bytesWritten < buffer2.length ? this.writeAllChunk(buffer2.subarray(bytesWritten)) : void_4;
54218
+ return bytesWritten < buffer2.length ? this.writeAllChunk(buffer2.subarray(bytesWritten)) : void_5;
54094
54219
  });
54095
54220
  });
54096
54221
  }
@@ -54234,7 +54359,7 @@ var writeFile2 = (path10, data, options4) => callback2((resume, signal) => {
54234
54359
  if (err) {
54235
54360
  resume(fail6(handleErrnoException("FileSystem", "writeFile")(err, [path10])));
54236
54361
  } else {
54237
- resume(void_4);
54362
+ resume(void_5);
54238
54363
  }
54239
54364
  });
54240
54365
  } catch (err) {
@@ -54393,8 +54518,8 @@ var RequestInit = class extends (/* @__PURE__ */ Service()("effect/http/FetchHtt
54393
54518
  };
54394
54519
  var fetch2 = /* @__PURE__ */ make34((request5, url2, signal, fiber3) => {
54395
54520
  const fetch3 = fiber3.getRef(Fetch);
54396
- const options4 = getOrUndefined2(fiber3.context, RequestInit) ?? {};
54397
- let headers = options4.headers ? merge6(fromInput2(options4.headers), request5.headers) : request5.headers;
54521
+ const options4 = getOrUndefined3(fiber3.context, RequestInit) ?? {};
54522
+ let headers = options4.headers ? merge7(fromInput2(options4.headers), request5.headers) : request5.headers;
54398
54523
  if (headers["content-length"]) {
54399
54524
  headers = remove5(headers, "content-length");
54400
54525
  }
@@ -54441,7 +54566,7 @@ var dispatcherLayerGlobal = /* @__PURE__ */ sync2(Dispatcher)(() => Undici_expor
54441
54566
  var UndiciOptions = /* @__PURE__ */ Reference("@effect/platform-node/NodeHttpClient/UndiciOptions", {
54442
54567
  defaultValue: () => ({})
54443
54568
  });
54444
- var makeUndici = /* @__PURE__ */ gen3(function* () {
54569
+ var makeUndici = /* @__PURE__ */ gen4(function* () {
54445
54570
  const dispatcher = yield* Dispatcher;
54446
54571
  return make34((request5, url2, signal, fiber3) => convertBody(request5.body).pipe(flatMap5((body) => tryPromise2({
54447
54572
  try: () => dispatcher.request({
@@ -54622,7 +54747,7 @@ var makeAgent = (options4) => zipWith3(acquireRelease2(sync3(() => new Http.Agen
54622
54747
  }));
54623
54748
  var layerAgentOptions = /* @__PURE__ */ flow(makeAgent, /* @__PURE__ */ effect(HttpAgent));
54624
54749
  var layerAgent = /* @__PURE__ */ layerAgentOptions();
54625
- var makeNodeHttp = /* @__PURE__ */ gen3(function* () {
54750
+ var makeNodeHttp = /* @__PURE__ */ gen4(function* () {
54626
54751
  const agent = yield* HttpAgent;
54627
54752
  return make34((request5, url2, signal) => {
54628
54753
  const nodeRequest = url2.protocol === "https:" ? Https.request(url2, {
@@ -54636,7 +54761,7 @@ var makeNodeHttp = /* @__PURE__ */ gen3(function* () {
54636
54761
  headers: request5.headers,
54637
54762
  signal
54638
54763
  });
54639
- return raceFirst2(waitForResponse(nodeRequest, request5), sendBody(nodeRequest, request5, request5.body).pipe(andThen3(never2))).pipe(onError2(() => sync3(() => nodeRequest.destroy())), map7((_) => new NodeHttpResponse(request5, _)));
54764
+ return raceFirst2(waitForResponse(nodeRequest, request5), sendBody(nodeRequest, request5, request5.body).pipe(andThen4(never2))).pipe(onError2(() => sync3(() => nodeRequest.destroy())), map7((_) => new NodeHttpResponse(request5, _)));
54640
54765
  });
54641
54766
  });
54642
54767
  var sendBody = (nodeRequest, request5, body) => suspend3(() => {
@@ -54717,7 +54842,7 @@ var waitForFinish = (nodeRequest, request5) => callback2((resume) => {
54717
54842
  nodeRequest.once("error", onError4);
54718
54843
  function onFinish() {
54719
54844
  nodeRequest.off("error", onError4);
54720
- resume(void_4);
54845
+ resume(void_5);
54721
54846
  }
54722
54847
  nodeRequest.once("finish", onFinish);
54723
54848
  return sync3(() => {
@@ -54957,7 +55082,7 @@ var make45 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
54957
55082
  });
54958
55083
  const columns = sync3(() => stdout.columns ?? 0);
54959
55084
  const rows = sync3(() => stdout.rows ?? 0);
54960
- const readInput = gen3(function* () {
55085
+ const readInput = gen4(function* () {
54961
55086
  const queue = yield* make11();
54962
55087
  const handleKeypress = (s, k) => {
54963
55088
  const userInput = {
@@ -54995,11 +55120,11 @@ var make45 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
54995
55120
  return queue;
54996
55121
  });
54997
55122
  const readLine = suspend3(() => poll(lines2).pipe(flatMap5(match({
54998
- onNone: () => scoped2(andThen3(get3(rlRef), take2(lines2))),
55123
+ onNone: () => scoped2(andThen4(get3(rlRef), take2(lines2))),
54999
55124
  onSome: succeed6
55000
55125
  })), mapError3(() => new QuitError({}))));
55001
55126
  const display = (prompt) => uninterruptible2(callback2((resume) => {
55002
- stdout.write(prompt, (err) => isNullish(err) ? resume(void_4) : resume(fail6(badArgument({
55127
+ stdout.write(prompt, (err) => isNullish(err) ? resume(void_5) : resume(fail6(badArgument({
55003
55128
  module: "Terminal",
55004
55129
  method: "display",
55005
55130
  description: "Failed to write prompt to stdout",
@@ -55048,9 +55173,9 @@ var defaultTeardown = (exit3, onExit4) => {
55048
55173
  };
55049
55174
  var makeRunMain = (f) => dual((args2) => isEffect2(args2[0]), (effect2, options4) => {
55050
55175
  const fiber3 = options4?.disableErrorReporting === true ? runFork2(effect2) : runFork2(tapCause3(effect2, (cause) => {
55051
- if (hasInterruptsOnly2(cause)) return void_4;
55176
+ if (hasInterruptsOnly2(cause)) return void_5;
55052
55177
  const isReported = getErrorReported(squash(cause));
55053
- return isReported ? logError(cause) : void_4;
55178
+ return isReported ? logError(cause) : void_5;
55054
55179
  }));
55055
55180
  try {
55056
55181
  const keepAlive = globalThis.setInterval(constVoid, 2147483647);
@@ -55238,7 +55363,7 @@ __export(Argument_exports, {
55238
55363
  mapTryCatch: () => mapTryCatch2,
55239
55364
  none: () => none5,
55240
55365
  optional: () => optional4,
55241
- orElse: () => orElse5,
55366
+ orElse: () => orElse6,
55242
55367
  orElseResult: () => orElseResult3,
55243
55368
  path: () => path3,
55244
55369
  redacted: () => redacted4,
@@ -58594,9 +58719,9 @@ var withSchema = /* @__PURE__ */ dual(2, (self, schema2) => {
58594
58719
  });
58595
58720
  }));
58596
58721
  });
58597
- var orElse4 = /* @__PURE__ */ dual(2, (self, orElse7) => transform5(self, (parse5, alternatives) => (args2) => catch_3(parse5(args2), () => alternatives[0]()(args2)), [orElse7]));
58598
- var orElseResult2 = /* @__PURE__ */ dual(2, (self, orElse7) => {
58599
- return transform5(self, (parse5, alternatives) => (args2) => catch_3(map7(parse5(args2), ([leftover, value3]) => [leftover, succeed2(value3)]), () => map7(alternatives[0]()(args2), ([leftover, value3]) => [leftover, fail2(value3)])), [orElse7]);
58722
+ var orElse5 = /* @__PURE__ */ dual(2, (self, orElse8) => transform5(self, (parse5, alternatives) => (args2) => catch_3(parse5(args2), () => alternatives[0]()(args2)), [orElse8]));
58723
+ var orElseResult2 = /* @__PURE__ */ dual(2, (self, orElse8) => {
58724
+ return transform5(self, (parse5, alternatives) => (args2) => catch_3(map7(parse5(args2), ([leftover, value3]) => [leftover, succeed2(value3)]), () => map7(alternatives[0]()(args2), ([leftover, value3]) => [leftover, fail2(value3)])), [orElse8]);
58600
58725
  });
58601
58726
  var parsePositional = /* @__PURE__ */ fnUntraced2(function* (name, primitiveType, args2) {
58602
58727
  if (args2.arguments.length === 0) {
@@ -58788,7 +58913,7 @@ var choiceWithValue2 = (name, choices) => choiceWithValue(argumentKind, name, ch
58788
58913
  var withMetavar2 = /* @__PURE__ */ dual(2, (self, metavar) => withMetavar(self, metavar));
58789
58914
  var filter10 = /* @__PURE__ */ dual(3, (self, predicate, onFalse) => filter9(self, predicate, onFalse));
58790
58915
  var filterMap6 = /* @__PURE__ */ dual(3, (self, f, onNone2) => filterMap5(self, f, onNone2));
58791
- var orElse5 = /* @__PURE__ */ dual(2, (self, that) => orElse4(self, that));
58916
+ var orElse6 = /* @__PURE__ */ dual(2, (self, that) => orElse5(self, that));
58792
58917
  var orElseResult3 = /* @__PURE__ */ dual(2, (self, that) => orElseResult2(self, that));
58793
58918
 
58794
58919
  // ../../node_modules/effect/dist/unstable/cli/CliConfig.js
@@ -59671,7 +59796,7 @@ __export(Flag_exports, {
59671
59796
  mapTryCatch: () => mapTryCatch3,
59672
59797
  none: () => none6,
59673
59798
  optional: () => optional5,
59674
- orElse: () => orElse6,
59799
+ orElse: () => orElse7,
59675
59800
  orElseResult: () => orElseResult4,
59676
59801
  path: () => path4,
59677
59802
  redacted: () => redacted5,
@@ -59717,7 +59842,7 @@ var atMost3 = /* @__PURE__ */ dual(2, (self, max6) => atMost(self, max6));
59717
59842
  var between5 = /* @__PURE__ */ dual(3, (self, min6, max6) => between3(self, min6, max6));
59718
59843
  var filterMap7 = /* @__PURE__ */ dual(3, (self, f, onNone2) => filterMap5(self, f, onNone2));
59719
59844
  var filter11 = /* @__PURE__ */ dual(3, (self, predicate, onFalse) => filter9(self, predicate, onFalse));
59720
- var orElse6 = /* @__PURE__ */ dual(2, (self, that) => orElse4(self, that));
59845
+ var orElse7 = /* @__PURE__ */ dual(2, (self, that) => orElse5(self, that));
59721
59846
  var orElseResult4 = /* @__PURE__ */ dual(2, (self, that) => orElseResult2(self, that));
59722
59847
  var withSchema3 = /* @__PURE__ */ dual(2, (self, schema2) => withSchema(self, schema2));
59723
59848
 
@@ -60226,7 +60351,7 @@ var getSharedFlagsForCommandPath = (commands, currentFlags) => {
60226
60351
  return sharedFlags;
60227
60352
  };
60228
60353
  var getGlobalFlagsForCommandTree = (command, builtIns) => dedupeGlobalFlags([...builtIns, ...collectDeclaredGlobalFlags(command)]);
60229
- var getHelpForCommandPath = (command, commandPath, builtIns) => gen3(function* () {
60354
+ var getHelpForCommandPath = (command, commandPath, builtIns) => gen4(function* () {
60230
60355
  const commands = getCommandsForCommandPath(command, commandPath);
60231
60356
  const currentCommand = commands.length > 0 ? commands[commands.length - 1] : command;
60232
60357
  const baseDoc = toImpl2(currentCommand).buildHelpDoc(commandPath);
@@ -60291,7 +60416,7 @@ var Version = /* @__PURE__ */ action({
60291
60416
  });
60292
60417
  var Wizard = /* @__PURE__ */ action({
60293
60418
  flag: /* @__PURE__ */ boolean5("wizard").pipe(/* @__PURE__ */ withDescription3("Start wizard mode for a command"), /* @__PURE__ */ withDefault5(false)),
60294
- run: () => void_4
60419
+ run: () => void_5
60295
60420
  });
60296
60421
  var Completions = /* @__PURE__ */ action({
60297
60422
  flag: /* @__PURE__ */ choice4("completions", ["bash", "zsh", "fish", "sh"]).pipe(optional5, /* @__PURE__ */ map17((v) => map(v, (s) => s === "sh" ? "bash" : s)), /* @__PURE__ */ withMetavar3("<bash|zsh|fish|sh>"), /* @__PURE__ */ withDescription3("Print shell completion script")),
@@ -60447,7 +60572,7 @@ var getCommandPath = (parsedInput) => match(parsedInput.subcommand, {
60447
60572
  onNone: () => [],
60448
60573
  onSome: (subcommand) => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]
60449
60574
  });
60450
- var parseArgs = (lexResult, command, commandPath = []) => gen3(function* () {
60575
+ var parseArgs = (lexResult, command, commandPath = []) => gen4(function* () {
60451
60576
  const {
60452
60577
  tokens,
60453
60578
  trailingOperands: afterEndOfOptions
@@ -61356,7 +61481,7 @@ var annotateMerge = /* @__PURE__ */ dual(2, (self, annotations2) => {
61356
61481
  const impl = toImpl2(self);
61357
61482
  return makeCommand({
61358
61483
  ...impl,
61359
- annotations: merge(impl.annotations, annotations2)
61484
+ annotations: merge2(impl.annotations, annotations2)
61360
61485
  });
61361
61486
  });
61362
61487
  var withExamples = /* @__PURE__ */ dual(2, (self, examples) => makeCommand({
@@ -61373,7 +61498,7 @@ var mapHandler = (self, f) => {
61373
61498
  var provide6 = /* @__PURE__ */ dual((args2) => isCommand(args2[0]), (self, layer16, options4) => mapHandler(self, (handler, input) => provide4(handler, typeof layer16 === "function" ? layer16(input) : layer16, options4)));
61374
61499
  var provideSync = /* @__PURE__ */ dual(3, (self, service3, implementation) => mapHandler(self, (handler, input) => provideService2(handler, service3, typeof implementation === "function" ? implementation(input) : implementation)));
61375
61500
  var provideEffect = /* @__PURE__ */ dual(3, (self, service3, effect2) => mapHandler(self, (handler, input) => provideServiceEffect2(handler, service3, typeof effect2 === "function" ? effect2(input) : effect2)));
61376
- var provideEffectDiscard = /* @__PURE__ */ dual(2, (self, effect2) => mapHandler(self, (handler, input) => andThen3(typeof effect2 === "function" ? effect2(input) : effect2, handler)));
61501
+ var provideEffectDiscard = /* @__PURE__ */ dual(2, (self, effect2) => mapHandler(self, (handler, input) => andThen4(typeof effect2 === "function" ? effect2(input) : effect2, handler)));
61377
61502
  var wizard = (command, options4) => map7(run4(command, options4), (result3) => result3.args);
61378
61503
  var getOutOfScopeGlobalFlagErrors = (allFlags, activeFlags, flagMap, commandPath) => {
61379
61504
  const activeSet = new Set(activeFlags);
@@ -61403,7 +61528,7 @@ var getOutOfScopeGlobalFlagErrors = (allFlags, activeFlags, flagMap, commandPath
61403
61528
  }
61404
61529
  return errors;
61405
61530
  };
61406
- var showHelp = (command, error2, renderErrors) => gen3(function* () {
61531
+ var showHelp = (command, error2, renderErrors) => gen4(function* () {
61407
61532
  const {
61408
61533
  builtIns
61409
61534
  } = yield* CliConfig;
@@ -61414,7 +61539,7 @@ var showHelp = (command, error2, renderErrors) => gen3(function* () {
61414
61539
  yield* error(formatter.formatErrors(error2.errors));
61415
61540
  }
61416
61541
  });
61417
- var showUserError = (error2) => gen3(function* () {
61542
+ var showUserError = (error2) => gen4(function* () {
61418
61543
  const formatter = yield* Formatter;
61419
61544
  yield* error(formatter.formatError(error2));
61420
61545
  error2[errorReported] = false;
@@ -61474,7 +61599,7 @@ var runWith2 = (command, config) => {
61474
61599
  if (!hasEntry) continue;
61475
61600
  const [, value3] = yield* flag.flag.parse(emptyArgs);
61476
61601
  if (flag === Wizard) {
61477
- return yield* gen3(function* () {
61602
+ return yield* gen4(function* () {
61478
61603
  yield* log2(renderIntroduction(command.name, config.version, command.description));
61479
61604
  const prefix = [command.name, ...args2.filter((arg) => arg !== "--wizard" && !arg.startsWith("--wizard="))];
61480
61605
  const wizardResult = yield* run4(command, {
@@ -61526,7 +61651,7 @@ var runWith2 = (command, config) => {
61526
61651
  onSome: (level) => make5(MinimumLogLevel2, level)
61527
61652
  });
61528
61653
  yield* provideContext2(program2, services);
61529
- }, catchFilter2((error2) => isCliError(error2) && error2._tag === "ShowHelp" ? succeed2(error2) : fail2(error2), (error2) => andThen3(showHelp(command, error2, config.renderErrors !== false), fail6(error2))), catchFilter2((error2) => config.renderErrors !== false && isCliError(error2) && error2._tag === "UserError" ? succeed2(error2) : fail2(error2), (error2) => andThen3(showUserError(error2), fail6(error2))), catchFilter2((e) => isQuitError(e) ? succeed2(e) : fail2(e), (_) => interrupt2));
61654
+ }, catchFilter2((error2) => isCliError(error2) && error2._tag === "ShowHelp" ? succeed2(error2) : fail2(error2), (error2) => andThen4(showHelp(command, error2, config.renderErrors !== false), fail6(error2))), catchFilter2((error2) => config.renderErrors !== false && isCliError(error2) && error2._tag === "UserError" ? succeed2(error2) : fail2(error2), (error2) => andThen4(showUserError(error2), fail6(error2))), catchFilter2((e) => isQuitError(e) ? succeed2(e) : fail2(e), (_) => interrupt2));
61530
61655
  };
61531
61656
 
61532
61657
  // ../../packages/contract/src/client.ts
@@ -62147,7 +62272,7 @@ var Proto18 = {
62147
62272
  annotateMerge(annotations2) {
62148
62273
  return makeProto2({
62149
62274
  ...optionsFromEndpoint(this),
62150
- annotations: merge(this.annotations, annotations2)
62275
+ annotations: merge2(this.annotations, annotations2)
62151
62276
  });
62152
62277
  }
62153
62278
  };
@@ -62444,7 +62569,7 @@ var Proto19 = {
62444
62569
  };
62445
62570
  for (const key of Object.keys(api2.groups)) {
62446
62571
  const group3 = api2.groups[key];
62447
- assignProperty(newGroups, key, group3.annotateMerge(merge(api2.annotations, group3.annotations)));
62572
+ assignProperty(newGroups, key, group3.annotateMerge(merge2(api2.annotations, group3.annotations)));
62448
62573
  }
62449
62574
  return makeProto3({
62450
62575
  ...optionsFromApi(this),
@@ -62472,7 +62597,7 @@ var Proto19 = {
62472
62597
  annotateMerge(annotations2) {
62473
62598
  return makeProto3({
62474
62599
  ...optionsFromApi(this),
62475
- annotations: merge(this.annotations, annotations2)
62600
+ annotations: merge2(this.annotations, annotations2)
62476
62601
  });
62477
62602
  }
62478
62603
  };
@@ -62495,7 +62620,7 @@ var make49 = (identifier2) => makeProto3({
62495
62620
  var reflect = (self, options4) => {
62496
62621
  const groups = Object.values(self.groups);
62497
62622
  for (const group3 of groups) {
62498
- const groupAnnotations = merge(self.annotations, group3.annotations);
62623
+ const groupAnnotations = merge2(self.annotations, group3.annotations);
62499
62624
  options4.onGroup({
62500
62625
  group: group3,
62501
62626
  mergedAnnotations: groupAnnotations
@@ -62510,7 +62635,7 @@ var reflect = (self, options4) => {
62510
62635
  group: group3,
62511
62636
  endpoint: endpoint2,
62512
62637
  middleware: endpoint2.middlewares,
62513
- mergedAnnotations: merge(groupAnnotations, endpoint2.annotations),
62638
+ mergedAnnotations: merge2(groupAnnotations, endpoint2.annotations),
62514
62639
  successes: extractResponseContent(getSuccessSchemas(endpoint2), getStatusSuccessSchema),
62515
62640
  errors: extractResponseContent(getErrorSchemas(endpoint2), getStatusErrorSchema)
62516
62641
  });
@@ -62577,7 +62702,7 @@ var decode3 = (options4) => fromTransform((upstream, _scope) => sync3(() => {
62577
62702
  return fail6(error2);
62578
62703
  }
62579
62704
  }
62580
- return void_4;
62705
+ return void_5;
62581
62706
  });
62582
62707
  return suspend3(function loop() {
62583
62708
  if (isArrayNonEmpty2(buffer2)) {
@@ -62989,10 +63114,10 @@ function getError(error2) {
62989
63114
  return new Set(Array.isArray(error2) ? error2 : [error2]);
62990
63115
  }
62991
63116
  var layerSchemaErrorTransform = (service3, transform6) => succeed5(service3, (httpEffect, options4) => catch_3(httpEffect, (e) => HttpApiSchemaError.is(e) ? transform6(e, options4) : fail6(e)));
62992
- var layerClient = (tag2, service3) => effectContext(gen3(function* () {
63117
+ var layerClient = (tag2, service3) => effectContext(gen4(function* () {
62993
63118
  const services = (yield* context2()).pipe(omit(Scope));
62994
63119
  const middleware2 = isEffect2(service3) ? yield* service3 : service3;
62995
- return makeUnsafe(/* @__PURE__ */ new Map([[`${tag2.key}/Client`, (options4) => updateContext2(middleware2(options4), (requestContext) => merge(services, requestContext))]]));
63120
+ return makeUnsafe(/* @__PURE__ */ new Map([[`${tag2.key}/Client`, (options4) => updateContext2(middleware2(options4), (requestContext) => merge2(services, requestContext))]]));
62996
63121
  }));
62997
63122
 
62998
63123
  // ../../node_modules/effect/dist/unstable/httpapi/OpenApi.js
@@ -63633,7 +63758,7 @@ __export(HttpApiClient_exports, {
63633
63758
  makeWith: () => makeWith3,
63634
63759
  urlBuilder: () => urlBuilder
63635
63760
  });
63636
- var makeClient = (api2, options4) => gen3(function* () {
63761
+ var makeClient = (api2, options4) => gen4(function* () {
63637
63762
  const services = yield* context2();
63638
63763
  const httpClient = options4.httpClient.pipe(options4?.baseUrl === void 0 ? identity : mapRequest(prependUrl(options4.baseUrl.toString())));
63639
63764
  function executeMiddleware(group3, endpoint2, request5, middlewareKeys, index2) {
@@ -64154,7 +64279,7 @@ var Proto20 = {
64154
64279
  annotateMerge(annotations2) {
64155
64280
  return makeProto4({
64156
64281
  ...optionsFromGroup(this),
64157
- annotations: merge(this.annotations, annotations2)
64282
+ annotations: merge2(this.annotations, annotations2)
64158
64283
  });
64159
64284
  },
64160
64285
  annotate(annotation, value3) {
@@ -64237,7 +64362,7 @@ var basic = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Proto21)
64237
64362
  });
64238
64363
  var annotateMerge2 = /* @__PURE__ */ dual(2, (self, annotations2) => Object.assign(Object.create(Proto21), {
64239
64364
  ...self,
64240
- annotations: merge(self.annotations, annotations2)
64365
+ annotations: merge2(self.annotations, annotations2)
64241
64366
  }));
64242
64367
  var annotate5 = /* @__PURE__ */ dual(3, (self, service3, value3) => Object.assign(Object.create(Proto21), {
64243
64368
  ...self,
@@ -64851,6 +64976,16 @@ var ChargeBasis = Schema_exports.Struct({
64851
64976
  clause: ChargeClause,
64852
64977
  quantity: Schema_exports.NullOr(Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)))
64853
64978
  });
64979
+ var ResponseFile = Schema_exports.Struct({
64980
+ body_field: Schema_exports.Literals(["output", "provider_response.error"]),
64981
+ state: Schema_exports.Literals(["available", "link_pending", "expired", "unavailable"]),
64982
+ download_url: Schema_exports.NullOr(Schema_exports.String),
64983
+ link_expires_at: Schema_exports.NullOr(Timestamp),
64984
+ file_expires_at: Timestamp,
64985
+ bytes: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)),
64986
+ sha256: Schema_exports.String,
64987
+ content_type: Schema_exports.Literal("application/json")
64988
+ });
64854
64989
  var Run = Schema_exports.Struct({
64855
64990
  id: Schema_exports.String,
64856
64991
  /**
@@ -64879,6 +65014,11 @@ var Run = Schema_exports.Struct({
64879
65014
  * provider_response.error 上,这里为 null。
64880
65015
  */
64881
65016
  output: JsonValue,
65017
+ response_file: Schema_exports.optionalKey(
65018
+ ResponseFile.annotate({
65019
+ description: "Complete large Provider body, delivered as a JSON file. Glasser applies a 32 MiB runtime resource guard to captured bodies and serialized files. body_field identifies the replaced field; output is null or provider_response.error is omitted. Download URLs expire after at most one hour. Authenticated Get Run refreshes the URL while the file is available, for 7 days. Reads and downloads do not execute or charge another Run. If state is link_pending, read the same Run to prepare the link without another execution or charge. The URL grants temporary read access: share it only with intended recipients."
65020
+ })
65021
+ ),
64882
65022
  /** COMPLETED ⇔ 非 null。 */
64883
65023
  provider_response: Schema_exports.NullOr(ProviderResponse).annotate({
64884
65024
  description: "Non-null only when status is COMPLETED.\n\n- For 2xx responses, output contains Provider-native JSON (any shape), or null for an empty body.\n- For non-2xx responses, error contains the Provider's error body and output is null.\n\nSensitive fields are removed from both bodies."
@@ -66558,7 +66698,7 @@ Each row is a summary: input and output contain {"omitted": true}, and Provider
66558
66698
  operation(
66559
66699
  "runs-get",
66560
66700
  "Get a Run",
66561
- "Read a Run's current status, result, and charge. Use this to check an unfinished Run or retrieve a previous result.\n\nCheck status and provider_response before using output. A COMPLETED Run can include a Provider error; a FAILED Run can still have a charge."
66701
+ "Read a Run's current status, result, and charge. Use this to check an unfinished Run or retrieve a previous result. Large bodies are delivered in response_file as complete JSON downloads, with size, SHA-256 and expiry. Download links expire after at most one hour; authenticated Get Run refreshes the link during the 7-day file availability period. Reading and downloading do not create or charge another Run.\n\nCheck status and provider_response before using output. A COMPLETED Run can include a Provider error; a FAILED Run can still have a charge."
66562
66702
  )
66563
66703
  )
66564
66704
  ).add(
@@ -66886,6 +67026,8 @@ var WaitTimeout = class extends Data_exports.TaggedError("WaitTimeout") {
66886
67026
  };
66887
67027
  var LocalIoError = class extends Data_exports.TaggedError("LocalIoError") {
66888
67028
  };
67029
+ var CompletedRunReadFailed = class extends Data_exports.TaggedError("CompletedRunReadFailed") {
67030
+ };
66889
67031
  var RunNotUsable = class extends Data_exports.TaggedError("RunNotUsable") {
66890
67032
  };
66891
67033
  var ExitCode2 = class extends Data_exports.TaggedError("ExitCode") {
@@ -68000,6 +68142,60 @@ function waitForTerminal(getRun2, options4) {
68000
68142
  // src/commands/run-shared.ts
68001
68143
  import { writeFileSync as writeFileSync3 } from "node:fs";
68002
68144
 
68145
+ // src/download-response.ts
68146
+ import { createHash as createHash2, randomUUID } from "node:crypto";
68147
+ import { open as open3, rename as rename3, rm as rm2 } from "node:fs/promises";
68148
+ import { basename, dirname as dirname2, join as join4 } from "node:path";
68149
+ var downloadResponse = (file5, target) => Effect_exports.tryPromise({
68150
+ try: async (signal) => {
68151
+ if (file5.state !== "available" || file5.download_url === null || file5.link_expires_at === null) {
68152
+ throw new Error(`Response file is ${file5.state}; use runs get to check availability`);
68153
+ }
68154
+ const url2 = new URL(file5.download_url);
68155
+ if (url2.protocol !== "https:" && !(url2.protocol === "http:" && ["127.0.0.1", "localhost", "[::1]"].includes(url2.hostname))) {
68156
+ throw new Error("Invalid response file URL");
68157
+ }
68158
+ if (Date.parse(file5.link_expires_at) <= Date.now())
68159
+ throw new Error("Download link expired; use runs get to refresh it");
68160
+ const temporary = join4(dirname2(target), `.${basename(target)}.${randomUUID()}.tmp`);
68161
+ const handle = await open3(temporary, "wx", 384);
68162
+ try {
68163
+ const response = await fetch(url2, {
68164
+ signal: AbortSignal.any([signal, AbortSignal.timeout(12e4)]),
68165
+ redirect: "error"
68166
+ });
68167
+ if (!response.ok || response.body === null)
68168
+ throw new Error(`Download failed: HTTP ${response.status}`);
68169
+ const hash2 = createHash2("sha256");
68170
+ let bytes = 0;
68171
+ const reader = response.body.getReader();
68172
+ try {
68173
+ while (true) {
68174
+ const { done: done4, value: chunk } = await reader.read();
68175
+ if (done4) break;
68176
+ bytes += chunk.byteLength;
68177
+ if (bytes > file5.bytes) throw new Error("Downloaded file exceeds its declared size");
68178
+ hash2.update(chunk);
68179
+ await handle.writeFile(chunk);
68180
+ }
68181
+ } finally {
68182
+ await reader.cancel();
68183
+ reader.releaseLock();
68184
+ }
68185
+ if (bytes !== file5.bytes || hash2.digest("hex") !== file5.sha256)
68186
+ throw new Error("Downloaded file failed size or SHA-256 verification");
68187
+ await handle.close();
68188
+ await rename3(temporary, target);
68189
+ } finally {
68190
+ await handle.close();
68191
+ await rm2(temporary, { force: true });
68192
+ }
68193
+ },
68194
+ catch: (error2) => new LocalIoError({
68195
+ message: `Cannot save complete response to ${target}: ${error2 instanceof Error ? error2.message : "download failed"}`
68196
+ })
68197
+ });
68198
+
68003
68199
  // src/render/run.ts
68004
68200
  function renderRun(run7, options4 = {}) {
68005
68201
  const lines2 = kvBlock([
@@ -68041,6 +68237,16 @@ function formatCharge(run7) {
68041
68237
  function renderBody(run7, includeOutput) {
68042
68238
  if (run7.failure !== null) return `Failure: ${run7.failure.kind} \u2014 ${run7.failure.message}`;
68043
68239
  if (run7.status === "COMPLETED") {
68240
+ if (run7.response_file !== void 0) {
68241
+ const file5 = run7.response_file;
68242
+ return [
68243
+ `Response file: ${file5.state} (${file5.bytes} bytes, ${file5.body_field})`,
68244
+ ...file5.download_url === null ? [] : [`Download: ${file5.download_url}`, `Link expires: ${file5.link_expires_at}`],
68245
+ `File available until: ${file5.file_expires_at}`,
68246
+ `SHA-256: ${file5.sha256}`,
68247
+ `Save with: glasser runs get -r ${run7.id} -o response.json`
68248
+ ].join("\n");
68249
+ }
68044
68250
  if (includeOutput && run7.output !== null && run7.output !== void 0)
68045
68251
  return jsonPretty(run7.output);
68046
68252
  if (run7.provider_response?.error !== void 0) {
@@ -68075,7 +68281,7 @@ var outputFileFlag = Flag_exports.string("output").pipe(
68075
68281
  Flag_exports.withAlias("o"),
68076
68282
  Flag_exports.optional,
68077
68283
  Flag_exports.withDescription(
68078
- "Save COMPLETED output to a file; human mode prints a summary, --json keeps the full Run"
68284
+ "Save complete COMPLETED output to a file; downloads and verifies response_file when present. --json keeps the Run envelope"
68079
68285
  )
68080
68286
  );
68081
68287
  var DEFAULT_WAIT_TIMEOUT_SECONDS = 300;
@@ -68084,13 +68290,33 @@ function getRun(apiHandle, runId) {
68084
68290
  }
68085
68291
  function presentRun(run7, options4) {
68086
68292
  return Effect_exports.gen(function* () {
68087
- const body = Option_exports.isSome(options4.outputPath) ? outputForFile(run7) : null;
68293
+ let delivered = run7;
68294
+ if (Option_exports.isSome(options4.outputPath) && run7.response_file?.state === "link_pending") {
68295
+ const refreshed = yield* Effect_exports.gen(function* () {
68296
+ return yield* getRun(yield* api, run7.id);
68297
+ }).pipe(Effect_exports.result);
68298
+ if (Result_exports.isFailure(refreshed)) {
68299
+ yield* Console_exports.log(options4.json ? jsonPretty(run7) : renderRun(run7));
68300
+ return yield* new CompletedRunReadFailed({
68301
+ cause: refreshed.failure,
68302
+ runId: run7.id,
68303
+ recoveryCommand: `glasser runs get -r ${shellQuote(run7.id)} -o ${shellQuote(options4.outputPath.value)}`
68304
+ });
68305
+ }
68306
+ delivered = refreshed.success;
68307
+ }
68308
+ const file5 = delivered.status === "COMPLETED" ? delivered.response_file : void 0;
68309
+ const body = Option_exports.isSome(options4.outputPath) ? outputForFile(delivered) : null;
68088
68310
  yield* Console_exports.log(
68089
- options4.json ? jsonPretty(run7) : renderRun(run7, { includeOutput: body === null })
68311
+ options4.json ? jsonPretty(delivered) : renderRun(delivered, { includeOutput: body === null })
68090
68312
  );
68091
68313
  if (Option_exports.isSome(options4.outputPath)) {
68092
68314
  const target = options4.outputPath.value;
68093
- if (body === null) {
68315
+ if (file5 !== void 0) {
68316
+ yield* downloadResponse(file5, target);
68317
+ if (!options4.json)
68318
+ yield* Console_exports.error(`Complete output saved to ${target} (size and SHA-256 verified)`);
68319
+ } else if (body === null) {
68094
68320
  if (!options4.json) {
68095
68321
  yield* Console_exports.error(
68096
68322
  `Nothing written to ${target}: only a COMPLETED Run with output is saved.`
@@ -68104,12 +68330,12 @@ function presentRun(run7, options4) {
68104
68330
  if (!options4.json) yield* Console_exports.error(`Output saved to ${target}`);
68105
68331
  }
68106
68332
  }
68107
- if ((options4.failTerminal ?? true) && (run7.status === "FAILED" || run7.status === "STOPPED")) {
68333
+ if ((options4.failTerminal ?? true) && (delivered.status === "FAILED" || delivered.status === "STOPPED")) {
68108
68334
  return yield* new RunNotUsable({
68109
- message: `Run ${run7.id} ended ${run7.status}; the awaited result did not materialize.`
68335
+ message: `Run ${delivered.id} ended ${delivered.status}; the awaited result did not materialize.`
68110
68336
  });
68111
68337
  }
68112
- return run7;
68338
+ return delivered;
68113
68339
  });
68114
68340
  }
68115
68341
 
@@ -68338,7 +68564,7 @@ import os3 from "node:os";
68338
68564
  import { existsSync as existsSync2, mkdirSync as mkdirSync3, writeFileSync as writeFileSync4 } from "node:fs";
68339
68565
  import os2 from "node:os";
68340
68566
  import path8 from "node:path";
68341
- var SKILL_MARKDOWN = true ? "---\nname: glasser\nversion: 0.1.133\ndescription: >\n Reach for this when a task needs external or paid data \u2014 person or company\n enrichment and search, contact unlock, job postings, social media profiles,\n posts and comments (TikTok, Douyin, Instagram, YouTube, X, Reddit and\n more), SEO keywords and backlinks, web,\n news, image, video, maps, places, scholar or shopping search, US property\n and rental data, SEC filings, company financials and stock prices, vehicle\n history and car listings, software reviews, AI model benchmarks, customs\n trade records, US statutes, compliance and KYC checks, movie, TV and game\n data, Chinese e-commerce listings and reviews, creator audience analytics,\n phone number checks, webpage scraping, or\n any other paid data API \u2014 and check the data sources before writing a\n scraper or telling the user something is inaccessible. 2,000+ paid\n endpoints across 80+ providers behind one Key: search, inspect\n the price, run, pay per call, no signup at each vendor. Works through the\n glasser CLI, or through the Glasser MCP server where the runtime cannot\n shell out. If the user already has their own key or integration for a\n specific provider, use that first.\n---\n\n# Glasser\n\nGlasser is a broker: it sells runnable third-party API operations\n(\"Endpoints\") under a single Key. You search the data sources, inspect an\nEndpoint's contract and Price, and run it \u2014 the response is the provider's\nown output, nothing renamed or reshaped.\n\n## Identify your surface FIRST\n\nDecide by the actual execution environment, not the product name and not\nwhether a terminal exists. The wrong setup cannot work.\n\n- **`glasser` MCP tools already loaded** (`search`, `inspect`, `run`,\n `runs_get`, `runs_list`, `runs_stop`, `balance`): nothing to install. The\n verbs map one to one onto the CLI commands below; only `run` differs, in\n that it needs an `idempotency_key` you generate (a UUID). Call `balance`;\n if it succeeds, skip to **First run**. The rules in this file apply either\n way.\n\n- **Hosted assistant** (claude.ai, Claude Desktop chat, Cowork, ChatGPT,\n Gemini \u2014 even with a code sandbox: it runs in the provider's cloud, not on\n the human's machine, and resets between tasks): do NOT install anything.\n Tell the human to add Glasser as a custom MCP connector, then stop. In\n Claude, give them this link; it opens the Add custom connector dialog\n with the name and URL filled in:\n https://api.glasser.ai/connect/claude\n Then Continue \u2192 Add \u2192 sign in to Glasser, choose the Workspace, Allow.\n Glasser is on in the next chat. Other products: the server URL is\n `https://api.glasser.ai/mcp`; steps per client at\n https://glasser.ai/docs/mcp-server.md. If the product has no custom\n connectors, say so and point to the same account's coding agent\n (ChatGPT \u2192 Codex, Gemini \u2192 Gemini CLI, Claude \u2192 Claude Code).\n\n- **Local coding agent** (Claude Code, Codex, Cursor, Copilot, Gemini CLI,\n OpenClaw, Hermes on the user's machine; Grok Bot on its own persistent\n cloud computer): the human authorized the whole flow by pasting this. If\n your runtime asks permission for shell commands, request it ONCE and work\n straight through. Continue to **Setup**.\n\n- **Sandboxed agent** (cloud container, restricted egress): run\n `curl -sI https://api.glasser.ai/health` first. A proxy 403, DNS failure\n or timeout means an egress allowlist. Do not retry, do not try other\n hosts. Tell the human `api.glasser.ai` is blocked by the environment's\n network policy, offer the MCP connector or an allowlist for `glasser.ai`\n and `api.glasser.ai` on 443, then stop.\n\nNever ask the human to paste a Key into chat.\n\n## Setup\n\n```sh\nglasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest\n```\n\nOne command when the CLI is missing, and it installs the current version.\nWithout npm, `curl -fsSL https://glasser.ai/install.sh | sh` does the same\njob. A fresh install selects the latest version, so no separate registry\nversion check is needed. The installer reports what it needs and where it\nwrote the binary \u2014 read its output rather than guessing. If the CLI was\nalready installed, the server tells you when to upgrade (see **Upgrading**).\n\nFor agents with persistent skills, run `glasser skill install`. It saves\nthis file for every coding agent it finds (Claude Code, Codex, Cursor, Gemini\nCLI, Copilot and others), so future sessions load it; the installer already\nran it. For any other agent, save the complete file from\nhttps://glasser.ai/SKILL.md in your user-level skill directory and enable it\nfor future sessions. Do this only during setup or CLI upgrades.\n\n## Authentication\n\nRun `glasser balance --json`. Exit 0 means authentication works; continue to\n**First run**. A missing or rejected Key needs one. Handle other failures\nfrom the error message instead of starting another login.\n\n**Where a Key comes from.** Two sources, and the environment takes precedence\nover the local store. `GLASSER_API_KEY` needs no file on disk, so it is what\nCI, scripts and scheduled jobs use, and it is the source that still works on a\nmachine whose own store will not outlive the session \u2014 a cloud session, a\ncontainer. Mint that Key in the console. The local store is what `glasser\nlogin` writes and what `glasser keys add --label <l> --key <k>` fills by hand;\nit lives on the machine the CLI ran on, and lasts as long as that machine does.\n\n**With a user present**, in this order:\n\n1. Run `glasser login` with your shell tool's background execution support.\n The CLI opens the sign-in page when possible and prints a fallback URL and\n a matching code.\n2. Relay that URL and code exactly as printed \u2014 a plain URL, readable in a\n terminal \u2014 with a brief explanation of the next step. Nothing else starts\n until this message is out.\n3. Wait for that same command to finish, using the shell tool's wait or output\n operation with short waits. A pending result means wait again, not return\n a final reply. Browser approval needs no further chat message. Give brief\n progress updates during the wait; the CLI polls for up to 15 minutes.\n Stop waiting when login succeeds, fails, expires, or the user cancels.\n\nOnce login succeeds, use the available balance in its output and continue to\n**First run**, unless login warns that `GLASSER_API_KEY` overrides the saved\nKey or the summary has no available balance. In either case, run\n`glasser balance --json` in the environment subsequent commands will use. Login's\nsummary uses the new Key directly; it does not verify an environment Key.\n\nIf that check rejects an environment Key, another login will not fix it.\nPreserve runtime-managed authentication: changing the variable or bypassing\nit for a command needs the user's authorization. When the user requires it\nto stay unchanged, report the blocker and the runtime correction needed.\nFor other failures, report the actual error; a network failure does not show\nthat a Key is invalid. If authorization expires, a new login needs a new\nURL and code relayed before waiting again.\nNever ask the user to paste a Key. `glasser login --json` is a usage error by\ndesign \u2014 that flow needs a human.\n\n## First run\n\nSetup is finished when login succeeds and reports the available balance\nwithout an environment Key override, or `glasser balance` exits 0 in the\nenvironment subsequent commands will use \u2014 with the MCP tools, when\n`balance` succeeds.\nIf setup is blocked, give a brief status, the confirmed cause, and the next\nstep needed to resolve it. You may state which steps succeeded, but do not\nclaim readiness or offer task prompts while authentication is blocked.\nLogin's balance is not usable evidence for commands that use a rejected Key.\n\nOnce setup is finished, if the user already gave you a task, continue it.\nFor a setup-only request, reply briefly in the user's language: confirm\nGlasser is ready, report the available balance from login or the balance\ncheck, then recommend one small, ready-to-send example task.\nUse a conversational lead-in that explains how the suggestion can help\nthe user, rather than a generic list heading. Connect it to their goals\nwhen known, or briefly describe what they could accomplish with Glasser.\n\nBase the task on the user's project, interests or goals when that context\nis available. Otherwise, choose one example from Glasser's\ncapabilities. Give it a concrete subject and a clear result the user can ask for.\n\nFor both completed and blocked setup, omit Workspace names/slugs, Key\nlabels/values/prefixes, and installation details such as versions, paths or\npackage-manager output. Name a configuration variable when it explains the\nblocker. Report useful status, not a transcript of the setup commands.\n\nWhen a balance response includes `first_run_reward.description`, relay that\nmessage in the user's language alongside the task suggestion. If absent,\nomit rewards. Use `glasser balance --json` when checking balance through the\nCLI. Reuse the setup response; do not call balance just for rewards or delay\nan existing task.\n\nFor a setup-only request, finish with the task suggestion and wait for the\nuser to choose it. Then follow the normal inspect, pricing and approval rules\nbefore a paid Run.\n\n## Upgrading\n\nThe server tells you when to upgrade \u2014 you do not have to compare versions\nby hand. Upgrade when any of these appears:\n\n- a response carries a `client` block. It is present only when this CLI is\n behind, and it says everything needed to act: `client_version`,\n `minimum_version`, `latest_version`, a runnable `upgrade_command`, and a\n `reason`. It rides in the response body,\n so it reaches `-j` output like any other field;\n- a command fails with `control: \"client.version_unsupported\"`. This CLI is\n too old to read part of the catalog, and `search` and `inspect` are refused\n rather than answered with a shortened list \u2014 a missing row would be\n invisible to you. Run the `upgrade_command` from `details`, then retry;\n- a command printed an `Update available` notice \u2014 the CLI asks the npm\n registry at most once every three hours and prints this on stderr. This one\n never\n appears in `-j` mode, because both streams stay machine-clean; the `client`\n block above is the `-j` signal.\n\nAfter upgrading, refresh the installed Skill as described in **Setup**.\nThe Skill and the CLI update together. Never downgrade. An available update\nnever interrupts work: finish the task at hand, then upgrade before the\nnext one. If the registry is unreachable, proceed with the installed\nversion \u2014 do not block the task on an upgrade check.\n\n## When to use\n\n- The task needs a capability (enrich a person or company, search the web,\n etc.) and no key or integration for it exists in the environment.\n- Workflow, in order:\n 0. Every search needs `--use-case \"<what they asked for>\"`, a browse with no\n query included: the user's own request, in their words, with the subject\n in it. Search refuses to run without it. One piece of the user's work is\n one **task**. Search prints a task id; pass it back\n with `--task <id>` on every later search, inspect and run for that same\n piece of work. Run that first search on its own and wait for the id:\n searches started in parallel before you have it each open a separate\n task. After that, search in parallel as much as you like, each with\n `--task <id>`. Every command that prints a follow-up command already\n carries the id in it, so working from what you are given keeps a task\n together with no bookkeeping.\n\n The use case and the task id cost nothing. The task id lets you list one\n task's Runs together with `glasser runs list --task <id>`.\n 1. `glasser search \"<capability>\" --use-case \"<what they asked for>\"` \u2014 find candidate Endpoints. The\n Provider column reads `pdl (People Data Labs)`: the first word is the\n slug every `-p` flag takes, the name in parentheses is who the data\n comes from \u2014 use it when the user names a vendor, and when you report\n the source back. Several Providers may sell the same capability: the\n list is ranked by relevance only, the Price sits beside each row, and\n the choice is yours.\n - A page holds 5 rows and the footer says how many matches there are in\n total. Pass the printed cursor with `--cursor` to see the rest.\n - The Score column is the cosine similarity between your words and that\n Endpoint's description, in [-1, 1], shown as `-` when semantic scoring\n did not run. It is a similarity signal for comparing rows on one page,\n not a verdict: the row order comes from fusing a keyword and a semantic\n ranking, and the ranking always returns its nearest candidates.\n - **Neither a page of low scores nor reaching the last page shows that\n the catalog lacks a capability.** Before you tell the user something is\n unavailable: read the total, page through with `--cursor`, search again\n with different words (the catalog is indexed on how each Endpoint\n describes itself, which may not be your phrasing), and inspect every\n candidate whose name is close to the task \u2014 `inspect` is free.\n 2. `glasser inspect -p <provider> -e <endpoint>` \u2014 **read the Price and\n the charge clauses BEFORE running.** The Price is what a normal\n COMPLETED call costs; the charge clauses list the exceptions (e.g.\n `NO_RESULT $0.00` means an empty answer is free). For any given\n endpoint the clauses are authoritative. Also identify which input\n fields control result volume (`num`, `size`, `limit`, arrays of\n queries) \u2014 the charge rule may read the input, so volume parameters\n can change what a call costs. Start small; raise only when the user\n needs more.\n 3. `glasser run -p <provider> -e <endpoint> -i '<json>'` \u2014 execute.\n 4. Report the result AND the charge to the user (run output includes the\n charged amount). Every Run also prints a `Run URL` (the `run_url` field\n in `-j`; absent from the `-o` file): the Workspace console page holding\n that Run's records exactly as the Provider returned them, private to\n Workspace members. When your answer relies on a Run, cite that URL as\n its source \u2014 the Run id alone opens nothing for the user.\n\n## When NOT to use\n\n- **Precedence: an explicit user instruction > the user's own integrations\n and keys > Glasser.** If the user has their own key, client, or\n integration for the capability, use that instead.\n- **Runs spend the Workspace balance.** Do not run Endpoints speculatively,\n in loops, or for bulk operations without telling the user the per-call\n Price and getting their go-ahead.\n- Do not use it for capabilities the environment already provides for free.\n- **The catalog changes often** \u2014 Endpoints and Providers are added weekly.\n Search every time you need one; never cache or reuse a listing from an\n earlier session, and never answer \"what can Glasser do\" from memory.\n\n## Adding funds\n\nOnly the user can add funds, in the console at https://app.glasser.ai/balance \u2014\nno command or tool does it. Raise this only when a Run fails with\n`insufficient balance` or the user asks.\n\n- **Top up** on the Balance page.\n- **Grants** are free balance; users often call them \"credits\". The Balance\n page lists the Grants a Workspace can receive and their terms. Send the\n user there.\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `glasser login` | Browser device authorization; stores a Key |\n| `glasser search [\"<query>\"] --use-case \"<sentence>\" [--limit N] [--cursor C] [--task T]` | Search Endpoints, 5 per page (max 20); `--use-case` is required on every search; `-q`/`--query` takes the same query; use `--query=<query>` when it starts with `-`; the footer prints the match total, the task id, the next-page cursor for `--cursor`, and a search-again command that carries the task and the use case |\n| `glasser inspect -p <provider> -e <endpoint> [--endpoint-version N] [--task T]` | Schemas, current Price, charge clauses, supported version |\n| `glasser run -p <provider> -e <endpoint> [-i '<json>' \\| -f <file>] [--idempotency-key K] [--task T] [--wait] [--wait-timeout s] [-o file]` | Execute an Endpoint |\n| `glasser runs list [--limit --cursor --status --provider --endpoint --task]` | List past Runs; `--task` is an exact match |\n| `glasser runs get -r <runId> [--wait] [-o file]` | Fetch one Run |\n| `glasser runs stop -r <runId>` | Stop a queued/running Run |\n| `glasser balance` | Balance, held and available; doubles as the auth probe |\n| `glasser balance history [--limit --cursor --kind]` | Ledger of charges, refunds, top-ups and Grants |\n| `glasser keys add/list/activate/remove` | Manage Keys stored on this machine |\n\nGlobal flags: `-j/--json` (raw JSON to stdout, errors as a single JSON\nobject on stderr), `--help`, `--version`.\n\nFacts that matter when scripting:\n\n- Exit codes: `0` success, `1` runtime failure, `2` usage error, `130`\n interrupted.\n- In `-j` mode, stdout is data only; parse stderr for the error object.\n- For large outputs, prefer `-o <file>` and read the file selectively \u2014\n dumping a full provider payload into your context wastes it.\n- Money is always an **exact decimal string** (e.g. `\"0.0125\"`), never a\n float. Do not do float arithmetic on it.\n- Env: `GLASSER_API_KEY`, `GLASSER_API_BASE_URL` (default\n `https://api.glasser.ai`; point it elsewhere and that stack's Workspace\n is what gets billed), `NO_COLOR`.\n\n## Run statuses and waiting\n\n| Status | Meaning |\n|---|---|\n| `QUEUED` | Accepted, not yet dispatched to the provider |\n| `RUNNING` | Dispatched, provider has not answered yet |\n| `COMPLETED` | Terminal \u2014 the provider answered (its answer may still be a \"not found\") |\n| `FAILED` | Terminal \u2014 no usable provider answer; the failure block says why |\n| `STOPPED` | Terminal \u2014 stopped via `runs stop`. Dispatch wins the race: a Run already sent to the provider completes and is charged |\n\nInspect shows each Endpoint's run mode: a `sync` Endpoint returns the\nfinished Run in the same response (its timeout is printed next to the\nmode) \u2014 `--wait` on those adds nothing. For anything still `QUEUED` or\n`RUNNING`, either pass `--wait` up front or poll with\n`glasser runs get -r <runId> --wait`; interactive sessions that want to\nkeep talking can fire without `--wait` and poll between replies.\n\n## Troubleshooting\n\n| Symptom | Meaning / action |\n|---|---|\n| `Invalid or missing API key` | Check the Key source. If `GLASSER_API_KEY` is set, correct it through its owner; login does not replace it. With no environment Key, use `glasser login` to replace a missing or rejected local Key |\n| Exit `2` | Your command line is wrong \u2014 fix it from the message; nothing reached the API and nothing was charged |\n| `Input does not match the endpoint's input schema` | Read the `issues:` lines under the error \u2014 they name the exact field and constraint. No Run was created and nothing was charged; fix the input and run again |\n| `insufficient balance` | The Workspace cannot cover the Price. Tell the user to add funds in the console (see **Adding funds**) \u2014 do not retry |\n| `rate_limited` | The Workspace or the endpoint is at its limit. Wait `retry_after_ms` (the error carries it; the hint prints it), then retry the same command once \u2014 do not loop |\n| Transport error / timeout with a retry hint | Outcome unknown \u2014 a Run may exist. Retry with the SAME Idempotency-Key exactly as the hint prints it |\n| `COMPLETED` but the provider answered 4xx / 5xx (`provider_response.http_status`) | The provider's own error; `charge_basis.clause` says what it cost: PROVIDER_ERROR, or NO_RESULT when the Endpoint reads that status (often 404) as a miss. Read the provider's message: run the same input once more with a NEW Idempotency-Key when it says so (the same key only replays this Run), then try another Endpoint \u2014 the same text can mean a bad input or a provider outage |\n| `FAILED` with a charge shown | Legitimate when the charge clauses say so \u2014 report both the failure and the charge |\n| `Update available` notice | Finish the current task, re-run the installer, then update the installed skill as described in **Upgrading** |\n\n## Running safely\n\n- `run` prints `Charge: $X (rule)` \u2014 the amount billed under the\n endpoint's charge rule. Report that number to the user.\n- `run` prints the Idempotency-Key it used (auto-generated when omitted;\n `--json` mode requires an explicit `--idempotency-key`). On an ambiguous\n failure \u2014 timeout, dropped connection, nonzero exit with no clear answer \u2014\n **retry with the SAME key**: it returns the original Run instead of\n charging again.\n- **Two indicators, not one.** A Run's status and the provider's response\n are separate. `COMPLETED` means the provider answered \u2014 a `COMPLETED` Run\n whose payload is a provider 404 (\"person not found\") is a normal outcome,\n not an error. Whether it is charged follows the endpoint's charge clauses\n from inspect. Report both the Run status and what the provider actually\n said.\n- Use `--wait` to block until the Run settles; without it, poll with\n `glasser runs get -r <runId> --wait`.\n\n## Rules for agents\n\n1. The user's own keys, integrations and explicit instructions outrank\n Glasser \u2014 it fills gaps, never routes around what the user has.\n2. Always inspect before running; never guess input parameters \u2014 the input\n schema and charge clauses from `inspect` are the source of truth.\n3. Runs spend the Workspace balance: no speculative, looped, or bulk runs\n without naming the per-call Price and getting the user's go-ahead.\n4. Start with small volume parameters; raise them only on request.\n5. Interactive auth is `glasser login` \u2014 never ask the user to paste a Key.\n6. On an ambiguous failure, retry with the SAME Idempotency-Key.\n7. Carry the SAME `--task` through one piece of work, the way you carry that\n key \u2014 search prints it, inspect and run take it.\n8. Report two indicators after every run \u2014 the Run status and what the\n provider said \u2014 plus the printed `Charge:` amount; cite the `Run URL`,\n never the bare Run id, as the source of what your answer used.\n9. Money is an exact decimal string; never do float arithmetic on it.\n10. Prefer `-o <file>` for large outputs; `-j` when you parse.\n11. When any command prints an `Update available` notice: finish the task,\n re-run the installer, then update the installed skill as described in\n **Upgrading**.\n12. The CLI is the source of truth for flags \u2014 run `glasser <command>\n --help` when unsure.\n13. `rate_limited` means back off: wait `retry_after_ms`, then retry the\n same command once; never loop on it.\n\n`--endpoint-version` selects a supported compatible contract. It does not lock Price.\nCompatible updates keep the version; older versions work until explicitly retired.\nNew Runs use the selected version's Price at admission. Accepted Runs keep their original Price.\n" : readFileSync4(new URL("../../api/src/http/skill/SKILL.md", import.meta.url), "utf8");
68567
+ var SKILL_MARKDOWN = true ? "---\nname: glasser\nversion: 0.1.135\ndescription: >\n Reach for this when a task needs external or paid data \u2014 person or company\n enrichment and search, contact unlock, job postings, social media profiles,\n posts and comments (TikTok, Douyin, Instagram, YouTube, X, Reddit and\n more), SEO keywords and backlinks, web,\n news, image, video, maps, places, scholar or shopping search, US property\n and rental data, SEC filings, company financials and stock prices, vehicle\n history and car listings, software reviews, AI model benchmarks, customs\n trade records, US statutes, compliance and KYC checks, movie, TV and game\n data, Chinese e-commerce listings and reviews, creator audience analytics,\n phone number checks, webpage scraping, or\n any other paid data API \u2014 and check the data sources before writing a\n scraper or telling the user something is inaccessible. 2,000+ paid\n endpoints across 80+ providers behind one Key: search, inspect\n the price, run, pay per call, no signup at each vendor. Works through the\n glasser CLI, or through the Glasser MCP server where the runtime cannot\n shell out. If the user already has their own key or integration for a\n specific provider, use that first.\n---\n\n# Glasser\n\nGlasser is a broker: it sells runnable third-party API operations\n(\"Endpoints\") under a single Key. You search the data sources, inspect an\nEndpoint's contract and Price, and run it \u2014 the response is the provider's\nown output, nothing renamed or reshaped.\n\n## Identify your surface FIRST\n\nDecide by the actual execution environment, not the product name and not\nwhether a terminal exists. The wrong setup cannot work.\n\n- **`glasser` MCP tools already loaded** (`search`, `inspect`, `run`,\n `runs_get`, `runs_list`, `runs_stop`, `balance`): nothing to install. The\n verbs map one to one onto the CLI commands below; only `run` differs, in\n that it needs an `idempotency_key` you generate (a UUID). Call `balance`;\n if it succeeds, skip to **First run**. The rules in this file apply either\n way.\n\n- **Hosted assistant** (claude.ai, Claude Desktop chat, Cowork, ChatGPT,\n Gemini \u2014 even with a code sandbox: it runs in the provider's cloud, not on\n the human's machine, and resets between tasks): do NOT install anything.\n Tell the human to add Glasser as a custom MCP connector, then stop. In\n Claude, give them this link; it opens the Add custom connector dialog\n with the name and URL filled in:\n https://api.glasser.ai/connect/claude\n Then Continue \u2192 Add \u2192 sign in to Glasser, choose the Workspace, Allow.\n Glasser is on in the next chat. Other products: the server URL is\n `https://api.glasser.ai/mcp`; steps per client at\n https://glasser.ai/docs/mcp-server.md. If the product has no custom\n connectors, say so and point to the same account's coding agent\n (ChatGPT \u2192 Codex, Gemini \u2192 Gemini CLI, Claude \u2192 Claude Code).\n\n- **Local coding agent** (Claude Code, Codex, Cursor, Copilot, Gemini CLI,\n OpenClaw, Hermes on the user's machine; Grok Bot on its own persistent\n cloud computer): the human authorized the whole flow by pasting this. If\n your runtime asks permission for shell commands, request it ONCE and work\n straight through. Continue to **Setup**.\n\n- **Sandboxed agent** (cloud container, restricted egress): run\n `curl -sI https://api.glasser.ai/health` first. A proxy 403, DNS failure\n or timeout means an egress allowlist. Do not retry, do not try other\n hosts. Tell the human `api.glasser.ai` is blocked by the environment's\n network policy, offer the MCP connector or an allowlist for `glasser.ai`\n and `api.glasser.ai` on 443, then stop.\n\nNever ask the human to paste a Key into chat.\n\n## Setup\n\n```sh\nglasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest\n```\n\nOne command when the CLI is missing, and it installs the current version.\nWithout npm, `curl -fsSL https://glasser.ai/install.sh | sh` does the same\njob. A fresh install selects the latest version, so no separate registry\nversion check is needed. The installer reports what it needs and where it\nwrote the binary \u2014 read its output rather than guessing. If the CLI was\nalready installed, the server tells you when to upgrade (see **Upgrading**).\n\nFor agents with persistent skills, run `glasser skill install`. It saves\nthis file for every coding agent it finds (Claude Code, Codex, Cursor, Gemini\nCLI, Copilot and others), so future sessions load it; the installer already\nran it. For any other agent, save the complete file from\nhttps://glasser.ai/SKILL.md in your user-level skill directory and enable it\nfor future sessions. Do this only during setup or CLI upgrades.\n\n## Authentication\n\nRun `glasser balance --json`. Exit 0 means authentication works; continue to\n**First run**. A missing or rejected Key needs one. Handle other failures\nfrom the error message instead of starting another login.\n\n**Where a Key comes from.** Two sources, and the environment takes precedence\nover the local store. `GLASSER_API_KEY` needs no file on disk, so it is what\nCI, scripts and scheduled jobs use, and it is the source that still works on a\nmachine whose own store will not outlive the session \u2014 a cloud session, a\ncontainer. Mint that Key in the console. The local store is what `glasser\nlogin` writes and what `glasser keys add --label <l> --key <k>` fills by hand;\nit lives on the machine the CLI ran on, and lasts as long as that machine does.\n\n**With a user present**, in this order:\n\n1. Run `glasser login` with your shell tool's background execution support.\n The CLI opens the sign-in page when possible and prints a fallback URL and\n a matching code.\n2. Relay that URL and code exactly as printed \u2014 a plain URL, readable in a\n terminal \u2014 with a brief explanation of the next step. Nothing else starts\n until this message is out.\n3. Wait for that same command to finish, using the shell tool's wait or output\n operation with short waits. A pending result means wait again, not return\n a final reply. Browser approval needs no further chat message. Give brief\n progress updates during the wait; the CLI polls for up to 15 minutes.\n Stop waiting when login succeeds, fails, expires, or the user cancels.\n\nOnce login succeeds, use the available balance in its output and continue to\n**First run**, unless login warns that `GLASSER_API_KEY` overrides the saved\nKey or the summary has no available balance. In either case, run\n`glasser balance --json` in the environment subsequent commands will use. Login's\nsummary uses the new Key directly; it does not verify an environment Key.\n\nIf that check rejects an environment Key, another login will not fix it.\nPreserve runtime-managed authentication: changing the variable or bypassing\nit for a command needs the user's authorization. When the user requires it\nto stay unchanged, report the blocker and the runtime correction needed.\nFor other failures, report the actual error; a network failure does not show\nthat a Key is invalid. If authorization expires, a new login needs a new\nURL and code relayed before waiting again.\nNever ask the user to paste a Key. `glasser login --json` is a usage error by\ndesign \u2014 that flow needs a human.\n\n## First run\n\nSetup is finished when login succeeds and reports the available balance\nwithout an environment Key override, or `glasser balance` exits 0 in the\nenvironment subsequent commands will use \u2014 with the MCP tools, when\n`balance` succeeds.\nIf setup is blocked, give a brief status, the confirmed cause, and the next\nstep needed to resolve it. You may state which steps succeeded, but do not\nclaim readiness or offer task prompts while authentication is blocked.\nLogin's balance is not usable evidence for commands that use a rejected Key.\n\nOnce setup is finished, if the user already gave you a task, continue it.\nFor a setup-only request, reply briefly in the user's language: confirm\nGlasser is ready, report the available balance from login or the balance\ncheck, then recommend one small, ready-to-send example task.\nUse a conversational lead-in that explains how the suggestion can help\nthe user, rather than a generic list heading. Connect it to their goals\nwhen known, or briefly describe what they could accomplish with Glasser.\n\nBase the task on the user's project, interests or goals when that context\nis available. Otherwise, choose one example from Glasser's\ncapabilities. Give it a concrete subject and a clear result the user can ask for.\n\nFor both completed and blocked setup, omit Workspace names/slugs, Key\nlabels/values/prefixes, and installation details such as versions, paths or\npackage-manager output. Name a configuration variable when it explains the\nblocker. Report useful status, not a transcript of the setup commands.\n\nWhen a balance response includes `first_run_reward.description`, relay that\nmessage in the user's language alongside the task suggestion. If absent,\nomit rewards. Use `glasser balance --json` when checking balance through the\nCLI. Reuse the setup response; do not call balance just for rewards or delay\nan existing task.\n\nFor a setup-only request, finish with the task suggestion and wait for the\nuser to choose it. Then follow the normal inspect, pricing and approval rules\nbefore a paid Run.\n\n## Upgrading\n\nThe server tells you when to upgrade \u2014 you do not have to compare versions\nby hand. Upgrade when any of these appears:\n\n- a response carries a `client` block. It is present only when this CLI is\n behind, and it says everything needed to act: `client_version`,\n `minimum_version`, `latest_version`, a runnable `upgrade_command`, and a\n `reason`. It rides in the response body,\n so it reaches `-j` output like any other field;\n- a command fails with `control: \"client.version_unsupported\"`. This CLI is\n too old to read part of the catalog, and `search` and `inspect` are refused\n rather than answered with a shortened list \u2014 a missing row would be\n invisible to you. Run the `upgrade_command` from `details`, then retry;\n- a command printed an `Update available` notice \u2014 the CLI asks the npm\n registry at most once every three hours and prints this on stderr. This one\n never\n appears in `-j` mode, because both streams stay machine-clean; the `client`\n block above is the `-j` signal.\n\nAfter upgrading, refresh the installed Skill as described in **Setup**.\nThe Skill and the CLI update together. Never downgrade. An available update\nnever interrupts work: finish the task at hand, then upgrade before the\nnext one. If the registry is unreachable, proceed with the installed\nversion \u2014 do not block the task on an upgrade check.\n\n## When to use\n\n- The task needs a capability (enrich a person or company, search the web,\n etc.) and no key or integration for it exists in the environment.\n- Workflow, in order:\n 0. Every search needs `--use-case \"<what they asked for>\"`, a browse with no\n query included: the user's own request, in their words, with the subject\n in it. Search refuses to run without it. One piece of the user's work is\n one **task**. Search prints a task id; pass it back\n with `--task <id>` on every later search, inspect and run for that same\n piece of work. Run that first search on its own and wait for the id:\n searches started in parallel before you have it each open a separate\n task. After that, search in parallel as much as you like, each with\n `--task <id>`. Every command that prints a follow-up command already\n carries the id in it, so working from what you are given keeps a task\n together with no bookkeeping.\n\n The use case and the task id cost nothing. The task id lets you list one\n task's Runs together with `glasser runs list --task <id>`.\n 1. `glasser search \"<capability>\" --use-case \"<what they asked for>\"` \u2014 find candidate Endpoints. The\n Provider column reads `pdl (People Data Labs)`: the first word is the\n slug every `-p` flag takes, the name in parentheses is who the data\n comes from \u2014 use it when the user names a vendor, and when you report\n the source back. Several Providers may sell the same capability: the\n list is ranked by relevance only, the Price sits beside each row, and\n the choice is yours.\n - A page holds 5 rows and the footer says how many matches there are in\n total. Pass the printed cursor with `--cursor` to see the rest.\n - The Score column is the cosine similarity between your words and that\n Endpoint's description, in [-1, 1], shown as `-` when semantic scoring\n did not run. It is a similarity signal for comparing rows on one page,\n not a verdict: the row order comes from fusing a keyword and a semantic\n ranking, and the ranking always returns its nearest candidates.\n - **Neither a page of low scores nor reaching the last page shows that\n the catalog lacks a capability.** Before you tell the user something is\n unavailable: read the total, page through with `--cursor`, search again\n with different words (the catalog is indexed on how each Endpoint\n describes itself, which may not be your phrasing), and inspect every\n candidate whose name is close to the task \u2014 `inspect` is free.\n 2. `glasser inspect -p <provider> -e <endpoint>` \u2014 **read the Price and\n the charge clauses BEFORE running.** The Price is what a normal\n COMPLETED call costs; the charge clauses list the exceptions (e.g.\n `NO_RESULT $0.00` means an empty answer is free). For any given\n endpoint the clauses are authoritative. Also identify which input\n fields control result volume (`num`, `size`, `limit`, arrays of\n queries) \u2014 the charge rule may read the input, so volume parameters\n can change what a call costs. Start small; raise only when the user\n needs more.\n Follow the inspected `input_schema`: some Endpoints take an object;\n native task submissions take an array of task objects. A completed\n submission returns receipts and task IDs. Use the matching task-result\n Endpoint to retrieve the data, with a task ID from the same Workspace.\n 3. `glasser run -p <provider> -e <endpoint> -i '<json>'` \u2014 execute.\n 4. Report the result AND the charge to the user (run output includes the\n charged amount). Every Run also prints a `Run URL` (the `run_url` field\n in `-j`; absent from the `-o` file): the Workspace console page holding\n that Run's records exactly as the Provider returned them, private to\n Workspace members. When your answer relies on a Run, cite that URL as\n its source \u2014 the Run id alone opens nothing for the user.\n\n## When NOT to use\n\n- **Precedence: an explicit user instruction > the user's own integrations\n and keys > Glasser.** If the user has their own key, client, or\n integration for the capability, use that instead.\n- **Runs spend the Workspace balance.** Do not run Endpoints speculatively,\n in loops, or for bulk operations without telling the user the per-call\n Price and getting their go-ahead.\n- Do not use it for capabilities the environment already provides for free.\n- **The catalog changes often** \u2014 Endpoints and Providers are added weekly.\n Search every time you need one; never cache or reuse a listing from an\n earlier session, and never answer \"what can Glasser do\" from memory.\n\n## Adding funds\n\nOnly the user can add funds, in the console at https://app.glasser.ai/balance \u2014\nno command or tool does it. Raise this only when a Run fails with\n`insufficient balance` or the user asks.\n\n- **Top up** on the Balance page.\n- **Grants** are free balance; users often call them \"credits\". The Balance\n page lists the Grants a Workspace can receive and their terms. Send the\n user there.\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `glasser login` | Browser device authorization; stores a Key |\n| `glasser search [\"<query>\"] --use-case \"<sentence>\" [--limit N] [--cursor C] [--task T]` | Search Endpoints, 5 per page (max 20); `--use-case` is required on every search; `-q`/`--query` takes the same query; use `--query=<query>` when it starts with `-`; the footer prints the match total, the task id, the next-page cursor for `--cursor`, and a search-again command that carries the task and the use case |\n| `glasser inspect -p <provider> -e <endpoint> [--endpoint-version N] [--task T]` | Schemas, current Price, charge clauses, supported version |\n| `glasser run -p <provider> -e <endpoint> [-i '<json>' \\| -f <file>] [--idempotency-key K] [--task T] [--wait] [--wait-timeout s] [-o file]` | Execute an Endpoint |\n| `glasser runs list [--limit --cursor --status --provider --endpoint --task]` | List past Runs; `--task` is an exact match |\n| `glasser runs get -r <runId> [--wait] [-o file]` | Fetch one Run |\n| `glasser runs stop -r <runId>` | Stop a queued/running Run |\n| `glasser balance` | Balance, held and available; doubles as the auth probe |\n| `glasser balance history [--limit --cursor --kind]` | Ledger of charges, refunds, top-ups and Grants |\n| `glasser keys add/list/activate/remove` | Manage Keys stored on this machine |\n\nGlobal flags: `-j/--json` (raw JSON to stdout, errors as a single JSON\nobject on stderr), `--help`, `--version`.\n\nFacts that matter when scripting:\n\n- Exit codes: `0` success, `1` runtime failure, `2` usage error, `130`\n interrupted.\n- In `-j` mode, stdout is data only; parse stderr for the error object.\n- For large outputs, prefer `-o <file>` and read the file selectively \u2014\n dumping a full provider payload into your context wastes it.\n- If a Run has `response_file`, check its `state` and `body_field`.\n If its state is `link_pending`, read the same Run to prepare the link; do not\n execute the Endpoint again. `-o` makes this read automatically, downloads an\n available complete JSON file and verifies its byte count\n and SHA-256. `output: null` alone does not mean an empty result. Download\n links expire after at most one hour; `runs get` refreshes them during the\n file's 7-day availability period without another execution or charge.\n Provider-native download links remain part of the Provider's own output.\n- Money is always an **exact decimal string** (e.g. `\"0.0125\"`), never a\n float. Do not do float arithmetic on it.\n- Env: `GLASSER_API_KEY`, `GLASSER_API_BASE_URL` (default\n `https://api.glasser.ai`; point it elsewhere and that stack's Workspace\n is what gets billed), `NO_COLOR`.\n\n## Run statuses and waiting\n\n| Status | Meaning |\n|---|---|\n| `QUEUED` | Accepted, not yet dispatched to the provider |\n| `RUNNING` | Dispatched, provider has not answered yet |\n| `COMPLETED` | Terminal \u2014 the provider answered (its answer may still be a \"not found\") |\n| `FAILED` | Terminal \u2014 no usable provider answer; the failure block says why |\n| `STOPPED` | Terminal \u2014 stopped via `runs stop`. Dispatch wins the race: a Run already sent to the provider completes and is charged |\n\nInspect shows each Endpoint's run mode: a `sync` Endpoint returns the\nfinished Run in the same response (its timeout is printed next to the\nmode) \u2014 `--wait` on those adds nothing. For anything still `QUEUED` or\n`RUNNING`, either pass `--wait` up front or poll with\n`glasser runs get -r <runId> --wait`; interactive sessions that want to\nkeep talking can fire without `--wait` and poll between replies.\n\n## Troubleshooting\n\n| Symptom | Meaning / action |\n|---|---|\n| `Invalid or missing API key` | Check the Key source. If `GLASSER_API_KEY` is set, correct it through its owner; login does not replace it. With no environment Key, use `glasser login` to replace a missing or rejected local Key |\n| Exit `2` | Your command line is wrong \u2014 fix it from the message; nothing reached the API and nothing was charged |\n| `Input does not match the endpoint's input schema` | Read the `issues:` lines under the error \u2014 they name the exact field and constraint. No Run was created and nothing was charged; fix the input and run again |\n| `insufficient balance` | The Workspace cannot cover the Price. Tell the user to add funds in the console (see **Adding funds**) \u2014 do not retry |\n| `rate_limited` | The Workspace or the endpoint is at its limit. Wait `retry_after_ms` (the error carries it; the hint prints it), then retry the same command once \u2014 do not loop |\n| Transport error / timeout with a retry hint | Outcome unknown \u2014 a Run may exist. Retry with the SAME Idempotency-Key exactly as the hint prints it |\n| `COMPLETED` but the provider answered 4xx / 5xx (`provider_response.http_status`) | The provider's own error; `charge_basis.clause` says what it cost: PROVIDER_ERROR, or NO_RESULT when the Endpoint reads that status (often 404) as a miss. Read the provider's message: run the same input once more with a NEW Idempotency-Key when it says so (the same key only replays this Run), then try another Endpoint \u2014 the same text can mean a bad input or a provider outage |\n| `FAILED` with a charge shown | Legitimate when the charge clauses say so \u2014 report both the failure and the charge |\n| `Update available` notice | Finish the current task, re-run the installer, then update the installed skill as described in **Upgrading** |\n\n## Running safely\n\n- `run` prints `Charge: $X (rule)` \u2014 the amount billed under the\n endpoint's charge rule. Report that number to the user.\n- `run` prints the Idempotency-Key it used (auto-generated when omitted;\n `--json` mode requires an explicit `--idempotency-key`). On an ambiguous\n failure \u2014 timeout, dropped connection, nonzero exit with no clear answer \u2014\n **retry with the SAME key**: it returns the original Run instead of\n charging again.\n- **Two indicators, not one.** A Run's status and the provider's response\n are separate. `COMPLETED` means the provider answered \u2014 a `COMPLETED` Run\n whose payload is a provider 404 (\"person not found\") is a normal outcome,\n not an error. Whether it is charged follows the endpoint's charge clauses\n from inspect. Report both the Run status and what the provider actually\n said.\n- Use `--wait` to block until the Run settles; without it, poll with\n `glasser runs get -r <runId> --wait`.\n\n## Rules for agents\n\n1. The user's own keys, integrations and explicit instructions outrank\n Glasser \u2014 it fills gaps, never routes around what the user has.\n2. Always inspect before running; never guess input parameters \u2014 the input\n schema and charge clauses from `inspect` are the source of truth.\n3. Runs spend the Workspace balance: no speculative, looped, or bulk runs\n without naming the per-call Price and getting the user's go-ahead.\n4. Start with small volume parameters; raise them only on request.\n5. Interactive auth is `glasser login` \u2014 never ask the user to paste a Key.\n6. On an ambiguous failure, retry with the SAME Idempotency-Key.\n7. Carry the SAME `--task` through one piece of work, the way you carry that\n key \u2014 search prints it, inspect and run take it.\n8. Report two indicators after every run \u2014 the Run status and what the\n provider said \u2014 plus the printed `Charge:` amount; cite the `Run URL`,\n never the bare Run id, as the source of what your answer used.\n9. Money is an exact decimal string; never do float arithmetic on it.\n10. Prefer `-o <file>` for large outputs; `-j` when you parse.\n11. When any command prints an `Update available` notice: finish the task,\n re-run the installer, then update the installed skill as described in\n **Upgrading**.\n12. The CLI is the source of truth for flags \u2014 run `glasser <command>\n --help` when unsure.\n13. `rate_limited` means back off: wait `retry_after_ms`, then retry the\n same command once; never loop on it.\n\n`--endpoint-version` selects a supported compatible contract. It does not lock Price.\nCompatible updates keep the version; older versions work until explicitly retired.\nNew Runs use the selected version's Price at admission. Accepted Runs keep their original Price.\n" : readFileSync4(new URL("../../api/src/http/skill/SKILL.md", import.meta.url), "utf8");
68342
68568
  var SKILL_NAME = "glasser";
68343
68569
  var absolute = (value3, fallback) => value3 !== void 0 && path8.isAbsolute(value3) ? value3 : fallback;
68344
68570
  function agents(env) {
@@ -68448,7 +68674,7 @@ var skill = Command_exports.make("skill").pipe(
68448
68674
  // package.json
68449
68675
  var package_default = {
68450
68676
  name: "@glasser-ai/cli",
68451
- version: "0.1.133",
68677
+ version: "0.1.135",
68452
68678
  description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
68453
68679
  license: "MIT",
68454
68680
  type: "module",
@@ -68667,6 +68893,16 @@ function describe(error2) {
68667
68893
  exitCode: 2
68668
68894
  };
68669
68895
  }
68896
+ if (error2 instanceof CompletedRunReadFailed) {
68897
+ const base2 = describe(error2.cause);
68898
+ return {
68899
+ ...base2,
68900
+ message: `Run ${error2.runId} is already complete. Download link refresh failed: ${base2.message}`,
68901
+ // 替换通用 429 的“重试原命令”,保留 retry_after_ms / request_id 等诊断。
68902
+ hint: `Recover the completed Run without another execution or charge: ${error2.recoveryCommand}`,
68903
+ exitCode: 1
68904
+ };
68905
+ }
68670
68906
  if (error2 instanceof ApiFailure) {
68671
68907
  const base2 = describeApiCause(error2.cause, error2.requestId);
68672
68908
  if (error2.hint === void 0) return base2;
@@ -68873,7 +69109,8 @@ var program = Effect_exports.catch(
68873
69109
  if (error2 instanceof CliError_exports.ShowHelp && error2.errors.length === 0) {
68874
69110
  return yield* new ExitCode2({ code: 0 });
68875
69111
  }
68876
- if (jsonMode && error2 instanceof RunNotUsable) flushStdoutBuffer();
69112
+ if (jsonMode && (error2 instanceof RunNotUsable || error2 instanceof CompletedRunReadFailed))
69113
+ flushStdoutBuffer();
68877
69114
  const described = describeFailure(error2);
68878
69115
  yield* Console_exports.error(jsonMode ? renderJson(described) : renderHuman(described));
68879
69116
  return yield* new ExitCode2({ code: described.exitCode });