chatroom-cli 1.38.4 → 1.38.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1019,7 +1019,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1019
1019
  this._exitCallback = (err) => {
1020
1020
  if (err.code !== "commander.executeSubCommandAsync") {
1021
1021
  throw err;
1022
- } else {}
1022
+ }
1023
1023
  };
1024
1024
  }
1025
1025
  return this;
@@ -11022,7 +11022,23 @@ var init_either = __esm(() => {
11022
11022
  });
11023
11023
 
11024
11024
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/Order.js
11025
- var make2 = (compare) => (self2, that) => self2 === that ? 0 : compare(self2, that), number3, mapInput2, lessThan = (O) => dual(2, (self2, that) => O(self2, that) === -1), greaterThan = (O) => dual(2, (self2, that) => O(self2, that) === 1), min = (O) => dual(2, (self2, that) => self2 === that || O(self2, that) < 1 ? self2 : that), max = (O) => dual(2, (self2, that) => self2 === that || O(self2, that) > -1 ? self2 : that), clamp = (O) => dual(2, (self2, options) => min(O)(options.maximum, max(O)(options.minimum, self2))), between = (O) => dual(2, (self2, options) => !lessThan(O)(self2, options.minimum) && !greaterThan(O)(self2, options.maximum));
11025
+ var make2 = (compare) => (self2, that) => self2 === that ? 0 : compare(self2, that), number3, mapInput2, all = (collection) => {
11026
+ return make2((x, y) => {
11027
+ const len2 = Math.min(x.length, y.length);
11028
+ let collectionLength = 0;
11029
+ for (const O of collection) {
11030
+ if (collectionLength >= len2) {
11031
+ break;
11032
+ }
11033
+ const o = O(x[collectionLength], y[collectionLength]);
11034
+ if (o !== 0) {
11035
+ return o;
11036
+ }
11037
+ collectionLength++;
11038
+ }
11039
+ return 0;
11040
+ });
11041
+ }, tuple = (...elements) => all(elements), lessThan = (O) => dual(2, (self2, that) => O(self2, that) === -1), greaterThan = (O) => dual(2, (self2, that) => O(self2, that) === 1), min = (O) => dual(2, (self2, that) => self2 === that || O(self2, that) < 1 ? self2 : that), max = (O) => dual(2, (self2, that) => self2 === that || O(self2, that) > -1 ? self2 : that), clamp = (O) => dual(2, (self2, options) => min(O)(options.maximum, max(O)(options.minimum, self2))), between = (O) => dual(2, (self2, options) => !lessThan(O)(self2, options.minimum) && !greaterThan(O)(self2, options.maximum));
11026
11042
  var init_Order = __esm(() => {
11027
11043
  init_Function();
11028
11044
  number3 = /* @__PURE__ */ make2((self2, that) => self2 < that ? -1 : 1);
@@ -11541,7 +11557,7 @@ var init_Duration = __esm(() => {
11541
11557
  });
11542
11558
 
11543
11559
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/Either.js
11544
- var right2, left2, fromOption2, isLeft2, isRight2, map2, match3, merge, all = (input) => {
11560
+ var right2, left2, fromOption2, isLeft2, isRight2, map2, match3, merge, all2 = (input) => {
11545
11561
  if (Symbol.iterator in input) {
11546
11562
  const out2 = [];
11547
11563
  for (const e of input) {
@@ -12686,7 +12702,7 @@ var HashSetSymbolKey = "effect/HashSet", HashSetTypeId, HashSetProto, makeImpl2
12686
12702
  add(set2, value);
12687
12703
  }
12688
12704
  return endMutation2(set2);
12689
- }, has2, size2 = (self2) => size(self2._keyMap), beginMutation2 = (self2) => makeImpl2(beginMutation(self2._keyMap)), endMutation2 = (self2) => {
12705
+ }, has2, some3, every, size2 = (self2) => size(self2._keyMap), beginMutation2 = (self2) => makeImpl2(beginMutation(self2._keyMap)), endMutation2 = (self2) => {
12690
12706
  self2._keyMap._editable = false;
12691
12707
  return self2;
12692
12708
  }, mutate2, add, remove3, difference2, union2, forEach2, reduce3;
@@ -12731,6 +12747,17 @@ var init_hashSet = __esm(() => {
12731
12747
  };
12732
12748
  _empty3 = /* @__PURE__ */ makeImpl2(/* @__PURE__ */ empty3());
12733
12749
  has2 = /* @__PURE__ */ dual(2, (self2, value) => has(self2._keyMap, value));
12750
+ some3 = /* @__PURE__ */ dual(2, (self2, f) => {
12751
+ let found = false;
12752
+ for (const value of self2) {
12753
+ found = f(value);
12754
+ if (found) {
12755
+ break;
12756
+ }
12757
+ }
12758
+ return found;
12759
+ });
12760
+ every = /* @__PURE__ */ dual(2, (self2, refinement) => !some3(self2, (a) => !refinement(a)));
12734
12761
  mutate2 = /* @__PURE__ */ dual(2, (self2, f) => {
12735
12762
  const transient = beginMutation2(self2);
12736
12763
  f(transient);
@@ -12754,13 +12781,14 @@ var init_hashSet = __esm(() => {
12754
12781
  });
12755
12782
 
12756
12783
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/HashSet.js
12757
- var empty5, fromIterable5, make8, has3, size3, add2, remove4, difference3, union3, reduce4;
12784
+ var empty5, fromIterable5, make8, has3, every2, size3, add2, remove4, difference3, union3, reduce4;
12758
12785
  var init_HashSet = __esm(() => {
12759
12786
  init_hashSet();
12760
12787
  empty5 = empty4;
12761
12788
  fromIterable5 = fromIterable4;
12762
12789
  make8 = make7;
12763
12790
  has3 = has2;
12791
+ every2 = every;
12764
12792
  size3 = size2;
12765
12793
  add2 = add;
12766
12794
  remove4 = remove3;
@@ -13568,7 +13596,9 @@ var init_MutableRef = __esm(() => {
13568
13596
  });
13569
13597
 
13570
13598
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/fiberId.js
13571
- var FiberIdSymbolKey = "effect/FiberId", FiberIdTypeId, OP_NONE = "None", OP_RUNTIME = "Runtime", OP_COMPOSITE = "Composite", emptyHash, None, Runtime, Composite, none3, isFiberId = (self2) => hasProperty(self2, FiberIdTypeId), combine2, ids = (self2) => {
13599
+ var FiberIdSymbolKey = "effect/FiberId", FiberIdTypeId, OP_NONE = "None", OP_RUNTIME = "Runtime", OP_COMPOSITE = "Composite", emptyHash, None, Runtime, Composite, none3, isFiberId = (self2) => hasProperty(self2, FiberIdTypeId), isNone3 = (self2) => {
13600
+ return self2._tag === OP_NONE || pipe(toSet(self2), every2((id) => isNone3(id)));
13601
+ }, combine2, getOrElse3, ids = (self2) => {
13572
13602
  switch (self2._tag) {
13573
13603
  case OP_NONE: {
13574
13604
  return empty5();
@@ -13583,6 +13613,18 @@ var FiberIdSymbolKey = "effect/FiberId", FiberIdTypeId, OP_NONE = "None", OP_RUN
13583
13613
  }, _fiberCounter, threadName = (self2) => {
13584
13614
  const identifiers = Array.from(ids(self2)).map((n) => `#${n}`).join(",");
13585
13615
  return identifiers;
13616
+ }, toSet = (self2) => {
13617
+ switch (self2._tag) {
13618
+ case OP_NONE: {
13619
+ return empty5();
13620
+ }
13621
+ case OP_RUNTIME: {
13622
+ return make8(self2);
13623
+ }
13624
+ case OP_COMPOSITE: {
13625
+ return pipe(toSet(self2.left), union3(toSet(self2.right)));
13626
+ }
13627
+ }
13586
13628
  }, unsafeMake = () => {
13587
13629
  const id = get6(_fiberCounter);
13588
13630
  pipe(_fiberCounter, set2(id + 1));
@@ -13693,15 +13735,18 @@ var init_fiberId = __esm(() => {
13693
13735
  }
13694
13736
  return new Composite(self2, that);
13695
13737
  });
13738
+ getOrElse3 = /* @__PURE__ */ dual(2, (self2, that) => isNone3(self2) ? that : self2);
13696
13739
  _fiberCounter = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Fiber/Id/_fiberCounter"), () => make11(0));
13697
13740
  });
13698
13741
 
13699
13742
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/FiberId.js
13700
- var none4, combine3, threadName2, unsafeMake2;
13743
+ var none4, combine3, getOrElse4, ids2, threadName2, unsafeMake2;
13701
13744
  var init_FiberId = __esm(() => {
13702
13745
  init_fiberId();
13703
13746
  none4 = none3;
13704
13747
  combine3 = combine2;
13748
+ getOrElse4 = getOrElse3;
13749
+ ids2 = ids;
13705
13750
  threadName2 = threadName;
13706
13751
  unsafeMake2 = unsafeMake;
13707
13752
  });
@@ -14804,7 +14849,7 @@ var blocked = (blockedRequests, _continue) => {
14804
14849
  const effect = new EffectPrimitiveFailure(OP_FAILURE);
14805
14850
  effect.effect_instruction_i0 = cause;
14806
14851
  return effect;
14807
- }, exitFlatMap, exitFlatten = (self2) => pipe(self2, exitFlatMap(identity)), exitInterrupt = (fiberId2) => exitFailCause(interrupt(fiberId2)), exitMap, exitMatch, exitMatchEffect, exitSucceed = (value) => {
14852
+ }, exitFlatMap, exitFlatten = (self2) => pipe(self2, exitFlatMap(identity)), exitForEachEffect, exitInterrupt = (fiberId2) => exitFailCause(interrupt(fiberId2)), exitMap, exitMatch, exitMatchEffect, exitSucceed = (value) => {
14808
14853
  const effect = new EffectPrimitiveSuccess(OP_SUCCESS);
14809
14854
  effect.effect_instruction_i0 = value;
14810
14855
  return effect;
@@ -15420,6 +15465,16 @@ ${this.stack.split(`
15420
15465
  }
15421
15466
  }
15422
15467
  });
15468
+ exitForEachEffect = /* @__PURE__ */ dual(2, (self2, f) => {
15469
+ switch (self2._tag) {
15470
+ case OP_FAILURE: {
15471
+ return succeed(exitFailCause(self2.effect_instruction_i0));
15472
+ }
15473
+ case OP_SUCCESS: {
15474
+ return exit(f(self2.effect_instruction_i0));
15475
+ }
15476
+ }
15477
+ });
15423
15478
  exitMap = /* @__PURE__ */ dual(2, (self2, f) => {
15424
15479
  switch (self2._tag) {
15425
15480
  case OP_FAILURE:
@@ -16657,7 +16712,7 @@ var init_FiberRefsPatch = __esm(() => {
16657
16712
  });
16658
16713
 
16659
16714
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/fiberStatus.js
16660
- var FiberStatusSymbolKey = "effect/FiberStatus", FiberStatusTypeId, OP_DONE = "Done", OP_RUNNING = "Running", OP_SUSPENDED = "Suspended", DoneHash, Done, Running, Suspended, done2, running = (runtimeFlags2) => new Running(runtimeFlags2), suspended = (runtimeFlags2, blockingOn) => new Suspended(runtimeFlags2, blockingOn), isFiberStatus = (u) => hasProperty(u, FiberStatusTypeId), isDone = (self2) => self2._tag === OP_DONE;
16715
+ var FiberStatusSymbolKey = "effect/FiberStatus", FiberStatusTypeId, OP_DONE = "Done", OP_RUNNING = "Running", OP_SUSPENDED = "Suspended", DoneHash, Done, Running, Suspended, done2, running = (runtimeFlags2) => new Running(runtimeFlags2), suspended = (runtimeFlags2, blockingOn) => new Suspended(runtimeFlags2, blockingOn), isFiberStatus = (u) => hasProperty(u, FiberStatusTypeId), isDone = (self2) => self2._tag === OP_DONE, isRunning = (self2) => self2._tag === OP_RUNNING, isSuspended = (self2) => self2._tag === OP_SUSPENDED;
16661
16716
  var init_fiberStatus = __esm(() => {
16662
16717
  init_Equal();
16663
16718
  init_Function();
@@ -16709,13 +16764,15 @@ var init_fiberStatus = __esm(() => {
16709
16764
  });
16710
16765
 
16711
16766
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/FiberStatus.js
16712
- var done3, running2, suspended2, isDone2;
16767
+ var done3, running2, suspended2, isDone2, isRunning2, isSuspended2;
16713
16768
  var init_FiberStatus = __esm(() => {
16714
16769
  init_fiberStatus();
16715
16770
  done3 = done2;
16716
16771
  running2 = running;
16717
16772
  suspended2 = suspended;
16718
16773
  isDone2 = isDone;
16774
+ isRunning2 = isRunning;
16775
+ isSuspended2 = isSuspended;
16719
16776
  });
16720
16777
 
16721
16778
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/LogLevel.js
@@ -18115,11 +18172,18 @@ var init_core_effect = __esm(() => {
18115
18172
  });
18116
18173
 
18117
18174
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/Exit.js
18118
- var flatten5, succeed3;
18175
+ var isSuccess2, fail3, failCause3, flatten5, forEachEffect, interrupt3, match9, succeed3, zipWith3;
18119
18176
  var init_Exit = __esm(() => {
18120
18177
  init_core();
18178
+ isSuccess2 = exitIsSuccess;
18179
+ fail3 = exitFail;
18180
+ failCause3 = exitFailCause;
18121
18181
  flatten5 = exitFlatten;
18182
+ forEachEffect = exitForEachEffect;
18183
+ interrupt3 = exitInterrupt;
18184
+ match9 = exitMatch;
18122
18185
  succeed3 = exitSucceed;
18186
+ zipWith3 = exitZipWith;
18123
18187
  });
18124
18188
 
18125
18189
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/fiberMessage.js
@@ -18175,14 +18239,79 @@ var init_fiberScope = __esm(() => {
18175
18239
  });
18176
18240
 
18177
18241
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/fiber.js
18178
- var FiberSymbolKey = "effect/Fiber", FiberTypeId, fiberVariance2, fiberProto, RuntimeFiberSymbolKey = "effect/Fiber", RuntimeFiberTypeId, isRuntimeFiber = (self2) => (RuntimeFiberTypeId in self2), _await = (self2) => self2.await, inheritAll = (self2) => self2.inheritAll, interruptAllAs, interruptAsFork, join4 = (self2) => zipLeft(flatten4(self2.await), self2.inheritAll), _never, currentFiberURI = "effect/FiberCurrent";
18242
+ var FiberSymbolKey = "effect/Fiber", FiberTypeId, fiberVariance2, fiberProto, RuntimeFiberSymbolKey = "effect/Fiber", RuntimeFiberTypeId, Order4, isFiber = (u) => hasProperty(u, FiberTypeId), isRuntimeFiber = (self2) => (RuntimeFiberTypeId in self2), _await = (self2) => self2.await, children = (self2) => self2.children, done4 = (exit2) => {
18243
+ const _fiber = {
18244
+ ...CommitPrototype,
18245
+ commit() {
18246
+ return join4(this);
18247
+ },
18248
+ ...fiberProto,
18249
+ id: () => none4,
18250
+ await: succeed(exit2),
18251
+ children: succeed([]),
18252
+ inheritAll: void_,
18253
+ poll: succeed(some2(exit2)),
18254
+ interruptAsFork: () => void_
18255
+ };
18256
+ return _fiber;
18257
+ }, dump = (self2) => map9(self2.status, (status) => ({
18258
+ id: self2.id(),
18259
+ status
18260
+ })), dumpAll = (fibers) => forEachSequential(fibers, dump), fail4 = (error) => done4(fail3(error)), failCause4 = (cause2) => done4(failCause3(cause2)), fromEffect = (effect) => map9(exit(effect), done4), id = (self2) => self2.id(), inheritAll = (self2) => self2.inheritAll, interrupted = (fiberId2) => done4(interrupt3(fiberId2)), interruptAll = (fibers) => flatMap7(fiberId, (fiberId2) => pipe(fibers, interruptAllAs(fiberId2))), interruptAllAs, interruptAsFork, join4 = (self2) => zipLeft(flatten4(self2.await), self2.inheritAll), map10, mapEffect, mapFiber, match10, _never, never2, orElse2, orElseEither, poll = (self2) => self2.poll, parseMs = (milliseconds) => {
18261
+ const roundTowardsZero = milliseconds > 0 ? Math.floor : Math.ceil;
18262
+ return {
18263
+ days: roundTowardsZero(milliseconds / 86400000),
18264
+ hours: roundTowardsZero(milliseconds / 3600000) % 24,
18265
+ minutes: roundTowardsZero(milliseconds / 60000) % 60,
18266
+ seconds: roundTowardsZero(milliseconds / 1000) % 60,
18267
+ milliseconds: roundTowardsZero(milliseconds) % 1000,
18268
+ microseconds: roundTowardsZero(milliseconds * 1000) % 1000,
18269
+ nanoseconds: roundTowardsZero(milliseconds * 1e6) % 1000
18270
+ };
18271
+ }, renderStatus = (status) => {
18272
+ if (isDone2(status)) {
18273
+ return "Done";
18274
+ }
18275
+ if (isRunning2(status)) {
18276
+ return "Running";
18277
+ }
18278
+ const isInterruptible = interruptible(status.runtimeFlags) ? "interruptible" : "uninterruptible";
18279
+ return `Suspended(${isInterruptible})`;
18280
+ }, pretty2 = (self2) => flatMap7(currentTimeMillis2, (now) => map9(dump(self2), (dump2) => {
18281
+ const time = now - dump2.id.startTimeMillis;
18282
+ const {
18283
+ days: days2,
18284
+ hours: hours2,
18285
+ milliseconds,
18286
+ minutes: minutes2,
18287
+ seconds: seconds2
18288
+ } = parseMs(time);
18289
+ const lifeMsg = (days2 === 0 ? "" : `${days2}d`) + (days2 === 0 && hours2 === 0 ? "" : `${hours2}h`) + (days2 === 0 && hours2 === 0 && minutes2 === 0 ? "" : `${minutes2}m`) + (days2 === 0 && hours2 === 0 && minutes2 === 0 && seconds2 === 0 ? "" : `${seconds2}s`) + `${milliseconds}ms`;
18290
+ const waitMsg = isSuspended2(dump2.status) ? (() => {
18291
+ const ids3 = ids2(dump2.status.blockingOn);
18292
+ return size3(ids3) > 0 ? `waiting on ` + Array.from(ids3).map((id2) => `${id2}`).join(", ") : "";
18293
+ })() : "";
18294
+ const statusMsg = renderStatus(dump2.status);
18295
+ return `[Fiber](#${dump2.id.id}) (${lifeMsg}) ${waitMsg}
18296
+ Status: ${statusMsg}`;
18297
+ })), unsafeRoots = () => Array.from(globalScope.roots), roots, status = (self2) => self2.status, succeed4 = (value) => done4(succeed3(value)), void_3, currentFiberURI = "effect/FiberCurrent", getCurrentFiber = () => fromNullable(globalThis[currentFiberURI]);
18179
18298
  var init_fiber = __esm(() => {
18299
+ init_Clock();
18300
+ init_Either();
18301
+ init_Exit();
18180
18302
  init_FiberId();
18303
+ init_FiberStatus();
18181
18304
  init_Function();
18305
+ init_HashSet();
18306
+ init_Number();
18182
18307
  init_Option();
18308
+ init_Order();
18183
18309
  init_Pipeable();
18310
+ init_Predicate();
18184
18311
  init_core();
18185
18312
  init_effectable();
18313
+ init_fiberScope();
18314
+ init_runtimeFlags();
18186
18315
  FiberTypeId = /* @__PURE__ */ Symbol.for(FiberSymbolKey);
18187
18316
  fiberVariance2 = {
18188
18317
  _E: (_) => _,
@@ -18195,6 +18324,7 @@ var init_fiber = __esm(() => {
18195
18324
  }
18196
18325
  };
18197
18326
  RuntimeFiberTypeId = /* @__PURE__ */ Symbol.for(RuntimeFiberSymbolKey);
18327
+ Order4 = /* @__PURE__ */ pipe(/* @__PURE__ */ tuple(Order2, Order2), /* @__PURE__ */ mapInput2((fiber) => [fiber.id().startTimeMillis, fiber.id().id]));
18198
18328
  interruptAllAs = /* @__PURE__ */ dual(2, /* @__PURE__ */ fnUntraced(function* (fibers, fiberId2) {
18199
18329
  for (const fiber of fibers) {
18200
18330
  if (isRuntimeFiber(fiber)) {
@@ -18211,6 +18341,43 @@ var init_fiber = __esm(() => {
18211
18341
  }
18212
18342
  }));
18213
18343
  interruptAsFork = /* @__PURE__ */ dual(2, (self2, fiberId2) => self2.interruptAsFork(fiberId2));
18344
+ map10 = /* @__PURE__ */ dual(2, (self2, f) => mapEffect(self2, (a) => sync(() => f(a))));
18345
+ mapEffect = /* @__PURE__ */ dual(2, (self2, f) => {
18346
+ const _fiber = {
18347
+ ...CommitPrototype,
18348
+ commit() {
18349
+ return join4(this);
18350
+ },
18351
+ ...fiberProto,
18352
+ id: () => self2.id(),
18353
+ await: flatMap7(self2.await, forEachEffect(f)),
18354
+ children: self2.children,
18355
+ inheritAll: self2.inheritAll,
18356
+ poll: flatMap7(self2.poll, (result) => {
18357
+ switch (result._tag) {
18358
+ case "None":
18359
+ return succeed(none2());
18360
+ case "Some":
18361
+ return pipe(forEachEffect(result.value, f), map9(some2));
18362
+ }
18363
+ }),
18364
+ interruptAsFork: (id2) => self2.interruptAsFork(id2)
18365
+ };
18366
+ return _fiber;
18367
+ });
18368
+ mapFiber = /* @__PURE__ */ dual(2, (self2, f) => map9(self2.await, match9({
18369
+ onFailure: (cause2) => failCause4(cause2),
18370
+ onSuccess: (a) => f(a)
18371
+ })));
18372
+ match10 = /* @__PURE__ */ dual(2, (self2, {
18373
+ onFiber,
18374
+ onRuntimeFiber
18375
+ }) => {
18376
+ if (isRuntimeFiber(self2)) {
18377
+ return onRuntimeFiber(self2);
18378
+ }
18379
+ return onFiber(self2);
18380
+ });
18214
18381
  _never = {
18215
18382
  ...CommitPrototype,
18216
18383
  commit() {
@@ -18224,6 +18391,32 @@ var init_fiber = __esm(() => {
18224
18391
  poll: /* @__PURE__ */ succeed(/* @__PURE__ */ none2()),
18225
18392
  interruptAsFork: () => never
18226
18393
  };
18394
+ never2 = _never;
18395
+ orElse2 = /* @__PURE__ */ dual(2, (self2, that) => ({
18396
+ ...CommitPrototype,
18397
+ commit() {
18398
+ return join4(this);
18399
+ },
18400
+ ...fiberProto,
18401
+ id: () => getOrElse4(self2.id(), that.id()),
18402
+ await: zipWith2(self2.await, that.await, (exit1, exit2) => isSuccess2(exit1) ? exit1 : exit2),
18403
+ children: self2.children,
18404
+ inheritAll: zipRight(that.inheritAll, self2.inheritAll),
18405
+ poll: zipWith2(self2.poll, that.poll, (option1, option2) => {
18406
+ switch (option1._tag) {
18407
+ case "None": {
18408
+ return none2();
18409
+ }
18410
+ case "Some": {
18411
+ return isSuccess2(option1.value) ? option1 : option2;
18412
+ }
18413
+ }
18414
+ }),
18415
+ interruptAsFork: (id2) => pipe(interruptAsFiber(self2, id2), zipRight(pipe(that, interruptAsFiber(id2))), asVoid)
18416
+ }));
18417
+ orElseEither = /* @__PURE__ */ dual(2, (self2, that) => orElse2(map10(self2, left2), map10(that, right2)));
18418
+ roots = /* @__PURE__ */ sync(unsafeRoots);
18419
+ void_3 = /* @__PURE__ */ succeed4(undefined);
18227
18420
  });
18228
18421
 
18229
18422
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/logger.js
@@ -19242,9 +19435,9 @@ var init_request = __esm(() => {
19242
19435
  ...StructuralPrototype,
19243
19436
  [RequestTypeId]: requestVariance
19244
19437
  };
19245
- complete = /* @__PURE__ */ dual(2, (self2, result) => fiberRefGetWith(currentRequestMap, (map10) => sync(() => {
19246
- if (map10.has(self2)) {
19247
- const entry = map10.get(self2);
19438
+ complete = /* @__PURE__ */ dual(2, (self2, result) => fiberRefGetWith(currentRequestMap, (map11) => sync(() => {
19439
+ if (map11.has(self2)) {
19440
+ const entry = map11.get(self2);
19248
19441
  if (!entry.state.completed) {
19249
19442
  entry.state.completed = true;
19250
19443
  deferredUnsafeDone(entry.result, result);
@@ -19256,7 +19449,7 @@ var init_request = __esm(() => {
19256
19449
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/supervisor.js
19257
19450
  var SupervisorSymbolKey = "effect/Supervisor", SupervisorTypeId, supervisorVariance, ProxySupervisor, Zip, isZip = (self2) => hasProperty(self2, SupervisorTypeId) && isTagged(self2, "Zip"), Track, Const, unsafeTrack = () => {
19258
19451
  return new Track;
19259
- }, track, fromEffect = (effect) => {
19452
+ }, track, fromEffect2 = (effect) => {
19260
19453
  return new Const(effect);
19261
19454
  }, none8;
19262
19455
  var init_supervisor = __esm(() => {
@@ -19389,7 +19582,7 @@ var init_supervisor = __esm(() => {
19389
19582
  }
19390
19583
  };
19391
19584
  track = /* @__PURE__ */ sync(unsafeTrack);
19392
- none8 = /* @__PURE__ */ globalValue("effect/Supervisor/none", () => fromEffect(void_));
19585
+ none8 = /* @__PURE__ */ globalValue("effect/Supervisor/none", () => fromEffect2(void_));
19393
19586
  });
19394
19587
 
19395
19588
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/Differ.js
@@ -19493,18 +19686,18 @@ var init_patch2 = __esm(() => {
19493
19686
  var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, EvaluationSignalContinue = "Continue", EvaluationSignalDone = "Done", EvaluationSignalYieldNow = "Yield", runtimeFiberVariance, absurd = (_) => {
19494
19687
  throw new Error(`BUG: FiberRuntime - ${toStringUnknown(_)} - please report an issue at https://github.com/Effect-TS/effect/issues`);
19495
19688
  }, YieldedOp, yieldedOpChannel, contOpSuccess, drainQueueWhileRunningTable, runBlockedRequests = (self2) => forEachSequentialDiscard(flatten3(self2), (requestsByRequestResolver) => forEachConcurrentDiscard(sequentialCollectionToChunk(requestsByRequestResolver), ([dataSource, sequential4]) => {
19496
- const map10 = new Map;
19689
+ const map11 = new Map;
19497
19690
  const arr = [];
19498
19691
  for (const block of sequential4) {
19499
19692
  arr.push(toReadonlyArray(block));
19500
19693
  for (const entry of block) {
19501
- map10.set(entry.request, entry);
19694
+ map11.set(entry.request, entry);
19502
19695
  }
19503
19696
  }
19504
19697
  const flat = arr.flat();
19505
19698
  return fiberRefLocally(invokeWithInterrupt(dataSource.runAll(arr), flat, () => flat.forEach((entry) => {
19506
19699
  entry.listeners.interrupted = true;
19507
- })), currentRequestMap, map10);
19700
+ })), currentRequestMap, map11);
19508
19701
  }, false, false)), _version, FiberRuntime, currentMinimumLogLevel, loggerWithConsoleLog = (self2) => makeLogger((opts) => {
19509
19702
  const services = getOrDefault2(opts.context, currentServices);
19510
19703
  get5(services, consoleTag).unsafe.log(self2.log(opts));
@@ -19606,7 +19799,7 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19606
19799
  batching: options?.batching,
19607
19800
  concurrentFinalizers: options?.concurrentFinalizers
19608
19801
  }), (eithers) => reconcile._tag === "Some" ? reconcile.value(eithers) : eithers);
19609
- }, all3 = (arg, options) => {
19802
+ }, all4 = (arg, options) => {
19610
19803
  const [effects, reconcile] = allResolveInput(arg);
19611
19804
  if (options?.mode === "validate") {
19612
19805
  return allValidate(effects, reconcile, options);
@@ -19614,7 +19807,7 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19614
19807
  return allEither(effects, reconcile, options);
19615
19808
  }
19616
19809
  return options?.discard !== true && reconcile._tag === "Some" ? map9(forEach4(effects, identity, options), reconcile.value) : forEach4(effects, identity, options);
19617
- }, allWith = (options) => (arg) => all3(arg, options), allSuccesses = (elements, options) => map9(all3(fromIterable(elements).map(exit), options), filterMap((exit2) => exitIsSuccess(exit2) ? some2(exit2.effect_instruction_i0) : none2())), replicate, replicateEffect, forEach4, forEachParUnbounded = (self2, f, batching) => suspend(() => {
19810
+ }, allWith = (options) => (arg) => all4(arg, options), allSuccesses = (elements, options) => map9(all4(fromIterable(elements).map(exit), options), filterMap((exit2) => exitIsSuccess(exit2) ? some2(exit2.effect_instruction_i0) : none2())), replicate, replicateEffect, forEach4, forEachParUnbounded = (self2, f, batching) => suspend(() => {
19618
19811
  const as2 = fromIterable(self2);
19619
19812
  const array3 = new Array(as2.length);
19620
19813
  const fn = (a, i2) => flatMap7(f(a, i2), (b) => sync(() => array3[i2] = b));
@@ -19626,11 +19819,11 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19626
19819
  return void_;
19627
19820
  }
19628
19821
  let counter6 = 0;
19629
- let interrupted = false;
19822
+ let interrupted2 = false;
19630
19823
  const fibersCount = n ? Math.min(todos.length, n) : todos.length;
19631
19824
  const fibers = new Set;
19632
19825
  const results = new Array;
19633
- const interruptAll = () => fibers.forEach((fiber) => {
19826
+ const interruptAll2 = () => fibers.forEach((fiber) => {
19634
19827
  fiber.currentScheduler.scheduleTask(() => {
19635
19828
  fiber.unsafeInterruptAsFork(parent.id());
19636
19829
  }, 0, fiber);
@@ -19665,8 +19858,8 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19665
19858
  target -= todos.length;
19666
19859
  todos = [];
19667
19860
  }
19668
- interrupted = true;
19669
- interruptAll();
19861
+ interrupted2 = true;
19862
+ interruptAll2();
19670
19863
  };
19671
19864
  const stepOrExit = batching ? step2 : exit;
19672
19865
  const processingFiber = runFiber(async_((resume2) => {
@@ -19678,7 +19871,7 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19678
19871
  index,
19679
19872
  exit: res
19680
19873
  });
19681
- if (res._op === "Failure" && !interrupted) {
19874
+ if (res._op === "Failure" && !interrupted2) {
19682
19875
  onInterruptSignal();
19683
19876
  }
19684
19877
  }
@@ -19705,7 +19898,7 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19705
19898
  const fiber = runFiber(todo);
19706
19899
  startOrder.push(fiber);
19707
19900
  fibers.add(fiber);
19708
- if (interrupted) {
19901
+ if (interrupted2) {
19709
19902
  fiber.currentScheduler.scheduleTask(() => {
19710
19903
  fiber.unsafeInterruptAsFork(parent.id());
19711
19904
  }, 0, fiber);
@@ -19778,7 +19971,7 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19778
19971
  const array3 = new Array(as2.length);
19779
19972
  const fn = (a, i2) => map9(f(a, i2), (b) => array3[i2] = b);
19780
19973
  return zipRight(forEachConcurrentDiscard(as2, fn, batching, false, n), succeed(array3));
19781
- }), fork = (self2) => withFiberRuntime((state, status) => succeed(unsafeFork(self2, state, status.runtimeFlags))), forkDaemon = (self2) => forkWithScopeOverride(self2, globalScope), forkWithErrorHandler, unsafeFork = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {
19974
+ }), fork = (self2) => withFiberRuntime((state, status2) => succeed(unsafeFork(self2, state, status2.runtimeFlags))), forkDaemon = (self2) => forkWithScopeOverride(self2, globalScope), forkWithErrorHandler, unsafeFork = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {
19782
19975
  const childFiber = unsafeMakeChildFiber(effect, parentFiber, parentRuntimeFlags, overrideScope);
19783
19976
  childFiber.resume(effect);
19784
19977
  return childFiber;
@@ -19797,20 +19990,20 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19797
19990
  const parentScope = overrideScope !== null ? overrideScope : pipe(parentFiber.getFiberRef(currentForkScopeOverride), getOrElse(() => parentFiber.scope()));
19798
19991
  parentScope.add(parentRuntimeFlags, childFiber);
19799
19992
  return childFiber;
19800
- }, forkWithScopeOverride = (self2, scopeOverride) => withFiberRuntime((parentFiber, parentStatus) => succeed(unsafeFork(self2, parentFiber, parentStatus.runtimeFlags, scopeOverride))), mergeAll3, partition3, validateAll, raceAll = (all4) => withFiberRuntime((state, status) => async_((resume2) => {
19993
+ }, forkWithScopeOverride = (self2, scopeOverride) => withFiberRuntime((parentFiber, parentStatus) => succeed(unsafeFork(self2, parentFiber, parentStatus.runtimeFlags, scopeOverride))), mergeAll3, partition3, validateAll, raceAll = (all5) => withFiberRuntime((state, status2) => async_((resume2) => {
19801
19994
  const fibers = new Set;
19802
19995
  let winner;
19803
19996
  let failures2 = empty6;
19804
- const interruptAll = () => {
19997
+ const interruptAll2 = () => {
19805
19998
  for (const fiber of fibers) {
19806
19999
  fiber.unsafeInterruptAsFork(state.id());
19807
20000
  }
19808
20001
  };
19809
20002
  let latch = false;
19810
20003
  let empty23 = true;
19811
- for (const self2 of all4) {
20004
+ for (const self2 of all5) {
19812
20005
  empty23 = false;
19813
- const fiber = unsafeFork(interruptible2(self2), state, status.runtimeFlags);
20006
+ const fiber = unsafeFork(interruptible2(self2), state, status2.runtimeFlags);
19814
20007
  fibers.add(fiber);
19815
20008
  fiber.addObserver((exit2) => {
19816
20009
  fibers.delete(fiber);
@@ -19819,7 +20012,7 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19819
20012
  latch = true;
19820
20013
  winner = fiber;
19821
20014
  failures2 = empty6;
19822
- interruptAll();
20015
+ interruptAll2();
19823
20016
  } else {
19824
20017
  failures2 = parallel(exit2.cause, failures2);
19825
20018
  }
@@ -19914,7 +20107,7 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19914
20107
  return join4(this);
19915
20108
  },
19916
20109
  [FiberTypeId]: fiberVariance2,
19917
- id: () => fromIterable(fibers).reduce((id, fiber) => combine3(id, fiber.id()), none4),
20110
+ id: () => fromIterable(fibers).reduce((id2, fiber) => combine3(id2, fiber.id()), none4),
19918
20111
  await: exit(forEachParUnbounded(fibers, (fiber) => flatten4(fiber.await), false)),
19919
20112
  children: map9(forEachParUnbounded(fibers, (fiber) => fiber.children, false), flatten),
19920
20113
  inheritAll: forEachSequentialDiscard(fibers, (fiber) => fiber.inheritAll),
@@ -19941,11 +20134,11 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19941
20134
  interruptAsFork: (fiberId2) => forEachSequentialDiscard(fibers, (fiber) => fiber.interruptAsFork(fiberId2))
19942
20135
  };
19943
20136
  return _fiberAll;
19944
- }, raceWith, disconnect = (self2) => uninterruptibleMask((restore) => fiberIdWith((fiberId2) => flatMap7(forkDaemon(restore(self2)), (fiber) => pipe(restore(join4(fiber)), onInterrupt(() => pipe(fiber, interruptAsFork(fiberId2))))))), race, raceFibersWith, completeRace = (winner, loser, cont, ab, cb) => {
20137
+ }, fiberInterruptFork = (self2) => asVoid(forkDaemon(interruptFiber(self2))), fiberJoinAll = (fibers) => join4(fiberAll(fibers)), fiberScoped = (self2) => acquireRelease(succeed(self2), interruptFiber), raceWith, disconnect = (self2) => uninterruptibleMask((restore) => fiberIdWith((fiberId2) => flatMap7(forkDaemon(restore(self2)), (fiber) => pipe(restore(join4(fiber)), onInterrupt(() => pipe(fiber, interruptAsFork(fiberId2))))))), race, raceFibersWith, completeRace = (winner, loser, cont, ab, cb) => {
19945
20138
  if (compareAndSet(true, false)(ab)) {
19946
20139
  cb(cont(winner, loser));
19947
20140
  }
19948
- }, ensuring, invokeWithInterrupt = (self2, entries2, onInterrupt2) => fiberIdWith((id) => ensuring(flatMap7(forkDaemon(interruptible2(self2)), (processing) => async_((cb) => {
20141
+ }, ensuring, invokeWithInterrupt = (self2, entries2, onInterrupt2) => fiberIdWith((id2) => ensuring(flatMap7(forkDaemon(interruptible2(self2)), (processing) => async_((cb) => {
19949
20142
  const counts = entries2.map((_) => _.listeners.count);
19950
20143
  const checkDone = () => {
19951
20144
  if (counts.every((count) => count === 0)) {
@@ -19987,7 +20180,7 @@ var fiberStarted, fiberActive, fiberSuccesses, fiberFailures, fiberLifetimes, Ev
19987
20180
  }
19988
20181
  return [];
19989
20182
  });
19990
- return forEachSequentialDiscard(residual, (entry) => complete(entry.request, exitInterrupt(id)));
20183
+ return forEachSequentialDiscard(residual, (entry) => complete(entry.request, exitInterrupt(id2)));
19991
20184
  }))), makeSpanScoped = (name, options) => {
19992
20185
  options = addSpanStackTrace(options);
19993
20186
  return uninterruptible(withFiberRuntime((fiber) => {
@@ -20186,14 +20379,14 @@ var init_fiberRuntime = __esm(() => {
20186
20379
  this.tell(resume(effect));
20187
20380
  }
20188
20381
  get status() {
20189
- return this.ask((_, status) => status);
20382
+ return this.ask((_, status2) => status2);
20190
20383
  }
20191
20384
  get runtimeFlags() {
20192
- return this.ask((state, status) => {
20193
- if (isDone2(status)) {
20385
+ return this.ask((state, status2) => {
20386
+ if (isDone2(status2)) {
20194
20387
  return state.currentRuntimeFlags;
20195
20388
  }
20196
- return status.runtimeFlags;
20389
+ return status2.runtimeFlags;
20197
20390
  });
20198
20391
  }
20199
20392
  scope() {
@@ -20217,8 +20410,8 @@ var init_fiberRuntime = __esm(() => {
20217
20410
  ask(f) {
20218
20411
  return suspend(() => {
20219
20412
  const deferred = deferredUnsafeMake(this._fiberId);
20220
- this.tell(stateful((fiber, status) => {
20221
- deferredUnsafeDone(deferred, sync(() => f(fiber, status)));
20413
+ this.tell(stateful((fiber, status2) => {
20414
+ deferredUnsafeDone(deferred, sync(() => f(fiber, status2)));
20222
20415
  }));
20223
20416
  return deferredAwait(deferred);
20224
20417
  });
@@ -20324,10 +20517,10 @@ var init_fiberRuntime = __esm(() => {
20324
20517
  this.getChildren().delete(child);
20325
20518
  }
20326
20519
  transferChildren(scope) {
20327
- const children = this._children;
20520
+ const children2 = this._children;
20328
20521
  this._children = null;
20329
- if (children !== null && children.size > 0) {
20330
- for (const child of children) {
20522
+ if (children2 !== null && children2.size > 0) {
20523
+ for (const child of children2) {
20331
20524
  if (child._exitValue === null) {
20332
20525
  scope.add(this.currentRuntimeFlags, child);
20333
20526
  }
@@ -20941,7 +21134,7 @@ var init_fiberRuntime = __esm(() => {
20941
21134
  replicate = /* @__PURE__ */ dual(2, (self2, n) => Array.from({
20942
21135
  length: n
20943
21136
  }, () => self2));
20944
- replicateEffect = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self2, n, options) => all3(replicate(self2, n), options));
21137
+ replicateEffect = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self2, n, options) => all4(replicate(self2, n), options));
20945
21138
  forEach4 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]), (self2, f, options) => withFiberRuntime((r) => {
20946
21139
  const isRequestBatchingEnabled = options?.batching === true || options?.batching === "inherit" && r.getFiberRef(currentRequestBatching);
20947
21140
  if (options?.discard) {
@@ -21004,7 +21197,7 @@ var init_fiberRuntime = __esm(() => {
21004
21197
  }
21005
21198
  return zipWithOptions(self2, that, (_, b) => b, options);
21006
21199
  });
21007
- zipWithOptions = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self2, that, f, options) => map9(all3([self2, that], {
21200
+ zipWithOptions = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self2, that, f, options) => map9(all4([self2, that], {
21008
21201
  concurrency: options?.concurrent ? 2 : 1,
21009
21202
  batching: options?.batching,
21010
21203
  concurrentFinalizers: options?.concurrentFinalizers
@@ -21318,7 +21511,7 @@ var OP_CONTINUE = "Continue", OP_DONE2 = "Done", _continue = (intervals) => {
21318
21511
  _tag: OP_CONTINUE,
21319
21512
  intervals: make35(of2(interval))
21320
21513
  };
21321
- }, done4, isContinue = (self2) => {
21514
+ }, done5, isContinue = (self2) => {
21322
21515
  return self2._tag === OP_CONTINUE;
21323
21516
  }, isDone3 = (self2) => {
21324
21517
  return self2._tag === OP_DONE2;
@@ -21326,18 +21519,18 @@ var OP_CONTINUE = "Continue", OP_DONE2 = "Done", _continue = (intervals) => {
21326
21519
  var init_decision = __esm(() => {
21327
21520
  init_Chunk();
21328
21521
  init_ScheduleIntervals();
21329
- done4 = {
21522
+ done5 = {
21330
21523
  _tag: OP_DONE2
21331
21524
  };
21332
21525
  });
21333
21526
 
21334
21527
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/ScheduleDecision.js
21335
- var _continue2, continueWith2, done5, isContinue2, isDone4;
21528
+ var _continue2, continueWith2, done6, isContinue2, isDone4;
21336
21529
  var init_ScheduleDecision = __esm(() => {
21337
21530
  init_decision();
21338
21531
  _continue2 = _continue;
21339
21532
  continueWith2 = continueWith;
21340
- done5 = done4;
21533
+ done6 = done5;
21341
21534
  isContinue2 = isContinue;
21342
21535
  isDone4 = isDone3;
21343
21536
  });
@@ -21435,29 +21628,33 @@ var unsafeMakeSemaphore = (permits) => new Semaphore(permits), makeSemaphore = (
21435
21628
  }
21436
21629
  }
21437
21630
  })), flatMap7((option2) => isNone2(option2) ? dieMessage("BUG: Effect.cachedInvalidate - please report an issue at https://github.com/Effect-TS/effect/issues") : restore(deferredAwait(option2.value[1]))))), invalidateCache = (cache) => set4(cache, none2()), ensuringChild, ensuringChildren, forkAll, forkIn, forkScoped = (self2) => scopeWith((scope2) => forkIn(self2, scope2)), fromFiber = (fiber) => join4(fiber), fromFiberEffect = (fiber) => suspend(() => flatMap7(fiber, join4)), memoKeySymbol, Key, cachedFunction = (f, eq) => {
21438
- return pipe(sync(() => empty21()), flatMap7(makeSynchronized), map9((ref) => (a) => pipe(ref.modifyEffect((map10) => {
21439
- const result = pipe(map10, get12(new Key(a, eq)));
21631
+ return pipe(sync(() => empty21()), flatMap7(makeSynchronized), map9((ref) => (a) => pipe(ref.modifyEffect((map11) => {
21632
+ const result = pipe(map11, get12(new Key(a, eq)));
21440
21633
  if (isNone2(result)) {
21441
- return pipe(deferredMake(), tap((deferred) => pipe(diffFiberRefs(f(a)), intoDeferred(deferred), fork)), map9((deferred) => [deferred, pipe(map10, set5(new Key(a, eq), deferred))]));
21634
+ return pipe(deferredMake(), tap((deferred) => pipe(diffFiberRefs(f(a)), intoDeferred(deferred), fork)), map9((deferred) => [deferred, pipe(map11, set5(new Key(a, eq), deferred))]));
21442
21635
  }
21443
- return succeed([result.value, map10]);
21636
+ return succeed([result.value, map11]);
21444
21637
  }), flatMap7(deferredAwait), flatMap7(([patch9, b]) => pipe(patchFiberRefs(patch9), as(b))))));
21445
21638
  }, raceFirst, supervised, timeout, timeoutFail, timeoutFailCause, timeoutOption, timeoutTo, SynchronizedSymbolKey = "effect/Ref/SynchronizedRef", SynchronizedTypeId, synchronizedVariance, SynchronizedImpl, makeSynchronized = (value) => sync(() => unsafeMakeSynchronized(value)), unsafeMakeSynchronized = (value) => {
21446
21639
  const ref = unsafeMake4(value);
21447
21640
  const sem = unsafeMakeSemaphore(1);
21448
21641
  return new SynchronizedImpl(ref, sem.withPermits(1));
21449
- }, updateSomeAndGetEffectSynchronized, bindAll;
21642
+ }, updateSomeAndGetEffectSynchronized, zipFiber, zipLeftFiber, zipRightFiber, zipWithFiber, bindAll;
21450
21643
  var init_circular = __esm(() => {
21451
21644
  init_Duration();
21452
21645
  init_Effectable();
21453
21646
  init_Equal();
21647
+ init_Exit();
21648
+ init_FiberId();
21454
21649
  init_Function();
21455
21650
  init_Hash();
21456
21651
  init_MutableHashMap();
21457
21652
  init_Option();
21653
+ init_Pipeable();
21458
21654
  init_Predicate();
21459
21655
  init_Readable();
21460
21656
  init_Scheduler();
21657
+ init_cause();
21461
21658
  init_core_effect();
21462
21659
  init_core();
21463
21660
  init_fiber();
@@ -21533,13 +21730,13 @@ var init_circular = __esm(() => {
21533
21730
  return zipRight(this.await, self2);
21534
21731
  };
21535
21732
  };
21536
- cached2 = /* @__PURE__ */ dual(2, (self2, timeToLive) => map9(cachedInvalidateWithTTL(self2, timeToLive), (tuple) => tuple[0]));
21733
+ cached2 = /* @__PURE__ */ dual(2, (self2, timeToLive) => map9(cachedInvalidateWithTTL(self2, timeToLive), (tuple2) => tuple2[0]));
21537
21734
  cachedInvalidateWithTTL = /* @__PURE__ */ dual(2, (self2, timeToLive) => {
21538
21735
  const duration = decode(timeToLive);
21539
21736
  return flatMap7(context(), (env) => map9(makeSynchronized(none2()), (cache) => [provideContext(getCachedValue(self2, duration, cache), env), invalidateCache(cache)]));
21540
21737
  });
21541
- ensuringChild = /* @__PURE__ */ dual(2, (self2, f) => ensuringChildren(self2, (children) => f(fiberAll(children))));
21542
- ensuringChildren = /* @__PURE__ */ dual(2, (self2, children) => flatMap7(track, (supervisor) => pipe(supervised(self2, supervisor), ensuring(flatMap7(supervisor.value, children)))));
21738
+ ensuringChild = /* @__PURE__ */ dual(2, (self2, f) => ensuringChildren(self2, (children2) => f(fiberAll(children2))));
21739
+ ensuringChildren = /* @__PURE__ */ dual(2, (self2, children2) => flatMap7(track, (supervisor) => pipe(supervised(self2, supervisor), ensuring(flatMap7(supervisor.value, children2)))));
21543
21740
  forkAll = /* @__PURE__ */ dual((args2) => isIterable(args2[0]), (effects, options) => options?.discard ? forEachSequentialDiscard(effects, fork) : map9(forEachSequential(effects, fork), fiberAll));
21544
21741
  forkIn = /* @__PURE__ */ dual(2, (self2, scope2) => withFiberRuntime((parent, parentStatus) => {
21545
21742
  const scopeImpl = scope2;
@@ -21670,7 +21867,31 @@ var init_circular = __esm(() => {
21670
21867
  }
21671
21868
  }
21672
21869
  }));
21673
- bindAll = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self2, f, options) => flatMap7(self2, (a) => all3(f(a), options).pipe(map9((record) => Object.assign({}, a, record)))));
21870
+ zipFiber = /* @__PURE__ */ dual(2, (self2, that) => zipWithFiber(self2, that, (a, b) => [a, b]));
21871
+ zipLeftFiber = /* @__PURE__ */ dual(2, (self2, that) => zipWithFiber(self2, that, (a, _) => a));
21872
+ zipRightFiber = /* @__PURE__ */ dual(2, (self2, that) => zipWithFiber(self2, that, (_, b) => b));
21873
+ zipWithFiber = /* @__PURE__ */ dual(3, (self2, that, f) => ({
21874
+ ...CommitPrototype2,
21875
+ commit() {
21876
+ return join4(this);
21877
+ },
21878
+ [FiberTypeId]: fiberVariance2,
21879
+ id: () => pipe(self2.id(), getOrElse4(that.id())),
21880
+ await: pipe(self2.await, flatten4, zipWithOptions(flatten4(that.await), f, {
21881
+ concurrent: true
21882
+ }), exit),
21883
+ children: self2.children,
21884
+ inheritAll: zipRight(that.inheritAll, self2.inheritAll),
21885
+ poll: zipWith2(self2.poll, that.poll, (optionA, optionB) => pipe(optionA, flatMap((exitA) => pipe(optionB, map((exitB) => zipWith3(exitA, exitB, {
21886
+ onSuccess: f,
21887
+ onFailure: parallel
21888
+ })))))),
21889
+ interruptAsFork: (id2) => zipRight(self2.interruptAsFork(id2), that.interruptAsFork(id2)),
21890
+ pipe() {
21891
+ return pipeArguments(this, arguments);
21892
+ }
21893
+ }));
21894
+ bindAll = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self2, f, options) => flatMap7(self2, (a) => all4(f(a), options).pipe(map9((record) => Object.assign({}, a, record)))));
21674
21895
  });
21675
21896
 
21676
21897
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/managedRuntime/circular.js
@@ -21683,10 +21904,107 @@ var init_circular2 = __esm(() => {
21683
21904
  var OP_FRESH = "Fresh", OP_FROM_EFFECT = "FromEffect", OP_SCOPED = "Scoped", OP_SUSPEND = "Suspend", OP_PROVIDE = "Provide", OP_PROVIDE_MERGE = "ProvideMerge", OP_MERGE_ALL = "MergeAll";
21684
21905
 
21685
21906
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/Fiber.js
21686
- var interruptAs;
21907
+ var exports_Fiber = {};
21908
+ __export(exports_Fiber, {
21909
+ zipWith: () => zipWith4,
21910
+ zipRight: () => zipRight2,
21911
+ zipLeft: () => zipLeft2,
21912
+ zip: () => zip4,
21913
+ void: () => void_4,
21914
+ unsafeRoots: () => unsafeRoots2,
21915
+ succeed: () => succeed5,
21916
+ status: () => status2,
21917
+ scoped: () => scoped,
21918
+ roots: () => roots2,
21919
+ pretty: () => pretty3,
21920
+ poll: () => poll2,
21921
+ orElseEither: () => orElseEither3,
21922
+ orElse: () => orElse3,
21923
+ never: () => never3,
21924
+ match: () => match11,
21925
+ mapFiber: () => mapFiber2,
21926
+ mapEffect: () => mapEffect2,
21927
+ map: () => map11,
21928
+ joinAll: () => joinAll,
21929
+ join: () => join5,
21930
+ isRuntimeFiber: () => isRuntimeFiber2,
21931
+ isFiber: () => isFiber2,
21932
+ interrupted: () => interrupted2,
21933
+ interruptFork: () => interruptFork,
21934
+ interruptAsFork: () => interruptAsFork2,
21935
+ interruptAs: () => interruptAs,
21936
+ interruptAllAs: () => interruptAllAs2,
21937
+ interruptAll: () => interruptAll2,
21938
+ interrupt: () => interrupt4,
21939
+ inheritAll: () => inheritAll2,
21940
+ id: () => id2,
21941
+ getCurrentFiber: () => getCurrentFiber2,
21942
+ fromEffect: () => fromEffect3,
21943
+ failCause: () => failCause5,
21944
+ fail: () => fail5,
21945
+ dumpAll: () => dumpAll2,
21946
+ dump: () => dump2,
21947
+ done: () => done7,
21948
+ children: () => children2,
21949
+ awaitAll: () => awaitAll,
21950
+ await: () => _await2,
21951
+ all: () => all5,
21952
+ RuntimeFiberTypeId: () => RuntimeFiberTypeId2,
21953
+ Order: () => Order5,
21954
+ FiberTypeId: () => FiberTypeId2
21955
+ });
21956
+ var FiberTypeId2, RuntimeFiberTypeId2, Order5, isFiber2, isRuntimeFiber2, id2, _await2, awaitAll, children2, all5, done7, dump2, dumpAll2, fail5, failCause5, fromEffect3, getCurrentFiber2, inheritAll2, interrupt4, interrupted2, interruptAs, interruptAsFork2, interruptAll2, interruptAllAs2, interruptFork, join5, joinAll, map11, mapEffect2, mapFiber2, match11, never3, orElse3, orElseEither3, poll2, pretty3, roots2, unsafeRoots2, scoped, status2, succeed5, void_4, zip4, zipLeft2, zipRight2, zipWith4;
21687
21957
  var init_Fiber = __esm(() => {
21688
21958
  init_core();
21959
+ init_circular();
21960
+ init_fiber();
21961
+ init_fiberRuntime();
21962
+ FiberTypeId2 = FiberTypeId;
21963
+ RuntimeFiberTypeId2 = RuntimeFiberTypeId;
21964
+ Order5 = Order4;
21965
+ isFiber2 = isFiber;
21966
+ isRuntimeFiber2 = isRuntimeFiber;
21967
+ id2 = id;
21968
+ _await2 = _await;
21969
+ awaitAll = fiberAwaitAll;
21970
+ children2 = children;
21971
+ all5 = fiberAll;
21972
+ done7 = done4;
21973
+ dump2 = dump;
21974
+ dumpAll2 = dumpAll;
21975
+ fail5 = fail4;
21976
+ failCause5 = failCause4;
21977
+ fromEffect3 = fromEffect;
21978
+ getCurrentFiber2 = getCurrentFiber;
21979
+ inheritAll2 = inheritAll;
21980
+ interrupt4 = interruptFiber;
21981
+ interrupted2 = interrupted;
21689
21982
  interruptAs = interruptAsFiber;
21983
+ interruptAsFork2 = interruptAsFork;
21984
+ interruptAll2 = interruptAll;
21985
+ interruptAllAs2 = interruptAllAs;
21986
+ interruptFork = fiberInterruptFork;
21987
+ join5 = join4;
21988
+ joinAll = fiberJoinAll;
21989
+ map11 = map10;
21990
+ mapEffect2 = mapEffect;
21991
+ mapFiber2 = mapFiber;
21992
+ match11 = match10;
21993
+ never3 = never2;
21994
+ orElse3 = orElse2;
21995
+ orElseEither3 = orElseEither;
21996
+ poll2 = poll;
21997
+ pretty3 = pretty2;
21998
+ roots2 = roots;
21999
+ unsafeRoots2 = unsafeRoots;
22000
+ scoped = fiberScoped;
22001
+ status2 = status;
22002
+ succeed5 = succeed4;
22003
+ void_4 = void_3;
22004
+ zip4 = zipFiber;
22005
+ zipLeft2 = zipLeftFiber;
22006
+ zipRight2 = zipRightFiber;
22007
+ zipWith4 = zipWithFiber;
21690
22008
  });
21691
22009
 
21692
22010
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/runtime.js
@@ -21741,7 +22059,7 @@ var makeDual = (f) => function() {
21741
22059
  return exitFail(new NoSuchElementException);
21742
22060
  }
21743
22061
  }
21744
- }, unsafeRunSyncExit, unsafeRunPromise, unsafeRunPromiseExit, make36 = (options) => new RuntimeImpl(options.context, options.runtimeFlags, options.fiberRefs), runtime2 = () => withFiberRuntime((state, status) => succeed(new RuntimeImpl(state.getFiberRef(currentContext), status.runtimeFlags, state.getFiberRefs()))), defaultRuntimeFlags, defaultRuntime, unsafeRunEffect, unsafeForkEffect, unsafeRunPromiseEffect, unsafeRunPromiseExitEffect, unsafeRunSyncEffect, unsafeRunSyncExitEffect, asyncEffect = (register) => suspend(() => {
22062
+ }, unsafeRunSyncExit, unsafeRunPromise, unsafeRunPromiseExit, make36 = (options) => new RuntimeImpl(options.context, options.runtimeFlags, options.fiberRefs), runtime2 = () => withFiberRuntime((state, status3) => succeed(new RuntimeImpl(state.getFiberRef(currentContext), status3.runtimeFlags, state.getFiberRefs()))), defaultRuntimeFlags, defaultRuntime, unsafeRunEffect, unsafeForkEffect, unsafeRunPromiseEffect, unsafeRunPromiseExitEffect, unsafeRunSyncEffect, unsafeRunSyncExitEffect, asyncEffect = (register) => suspend(() => {
21745
22063
  let cleanup = undefined;
21746
22064
  return flatMap7(deferredMake(), (deferred) => flatMap7(runtime2(), (runtime3) => uninterruptibleMask((restore) => zipRight(fork(restore(matchCauseEffect(register((cb) => unsafeRunCallback(runtime3)(intoDeferred(cb, deferred))), {
21747
22065
  onFailure: (cause2) => deferredFailCause(deferred, cause2),
@@ -21787,7 +22105,7 @@ var init_runtime = __esm(() => {
21787
22105
  const fiberRuntime = new FiberRuntime(fiberId2, fiberRefs3, runtime2.runtimeFlags);
21788
22106
  let effect = self2;
21789
22107
  if (options?.scope) {
21790
- effect = flatMap7(fork2(options.scope, sequential2), (closeableScope) => zipRight(scopeAddFinalizer(closeableScope, fiberIdWith((id) => equals(id, fiberRuntime.id()) ? void_ : interruptAsFiber(fiberRuntime, id))), onExit(self2, (exit2) => close(closeableScope, exit2))));
22108
+ effect = flatMap7(fork2(options.scope, sequential2), (closeableScope) => zipRight(scopeAddFinalizer(closeableScope, fiberIdWith((id3) => equals(id3, fiberRuntime.id()) ? void_ : interruptAsFiber(fiberRuntime, id3))), onExit(self2, (exit2) => close(closeableScope, exit2))));
21791
22109
  }
21792
22110
  const supervisor = fiberRuntime.currentSupervisor;
21793
22111
  if (supervisor !== none8) {
@@ -21809,7 +22127,7 @@ var init_runtime = __esm(() => {
21809
22127
  options.onExit(exit2);
21810
22128
  });
21811
22129
  }
21812
- return (id, cancelOptions) => unsafeRunCallback(runtime2)(pipe(fiberRuntime, interruptAs(id ?? none4)), {
22130
+ return (id3, cancelOptions) => unsafeRunCallback(runtime2)(pipe(fiberRuntime, interruptAs(id3 ?? none4)), {
21813
22131
  ...cancelOptions,
21814
22132
  onExit: cancelOptions?.onExit ? (exit2) => cancelOptions.onExit(flatten5(exit2)) : undefined
21815
22133
  });
@@ -21931,10 +22249,10 @@ var init_synchronizedRef = __esm(() => {
21931
22249
 
21932
22250
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/layer.js
21933
22251
  function fromEffectContext(effect) {
21934
- const fromEffect3 = Object.create(proto3);
21935
- fromEffect3._op_layer = OP_FROM_EFFECT;
21936
- fromEffect3.effect = effect;
21937
- return fromEffect3;
22252
+ const fromEffect5 = Object.create(proto3);
22253
+ fromEffect5._op_layer = OP_FROM_EFFECT;
22254
+ fromEffect5.effect = effect;
22255
+ return fromEffect5;
21938
22256
  }
21939
22257
  var LayerSymbolKey = "effect/Layer", LayerTypeId, layerVariance, proto3, MemoMapTypeIdKey = "effect/Layer/MemoMap", MemoMapTypeId, CurrentMemoMap, isLayer = (u) => hasProperty(u, LayerTypeId), isFresh = (self2) => {
21940
22258
  return self2._op_layer === OP_FRESH;
@@ -21993,17 +22311,17 @@ var LayerSymbolKey = "effect/Layer", LayerTypeId, layerVariance, proto3, MemoMap
21993
22311
  });
21994
22312
  }
21995
22313
  }
21996
- }, context2 = () => fromEffectContext(context()), fromEffect2, mergeAll4 = (...layers) => {
22314
+ }, context2 = () => fromEffectContext(context()), fromEffect4, mergeAll4 = (...layers) => {
21997
22315
  const mergeAll5 = Object.create(proto3);
21998
22316
  mergeAll5._op_layer = OP_MERGE_ALL;
21999
22317
  mergeAll5.layers = layers;
22000
22318
  return mergeAll5;
22001
- }, scoped, scopedContext = (effect) => {
22002
- const scoped2 = Object.create(proto3);
22003
- scoped2._op_layer = OP_SCOPED;
22004
- scoped2.effect = effect;
22005
- return scoped2;
22006
- }, succeed4, suspend2 = (evaluate2) => {
22319
+ }, scoped2, scopedContext = (effect) => {
22320
+ const scoped3 = Object.create(proto3);
22321
+ scoped3._op_layer = OP_SCOPED;
22322
+ scoped3.effect = effect;
22323
+ return scoped3;
22324
+ }, succeed6, suspend2 = (evaluate2) => {
22007
22325
  const suspend3 = Object.create(proto3);
22008
22326
  suspend3._op_layer = OP_SUSPEND;
22009
22327
  suspend3.evaluate = evaluate2;
@@ -22049,15 +22367,15 @@ var init_layer = __esm(() => {
22049
22367
  this[MemoMapTypeId] = MemoMapTypeId;
22050
22368
  }
22051
22369
  getOrElseMemoize(layer, scope2) {
22052
- return pipe(modifyEffect(this.ref, (map10) => {
22053
- const inMap = map10.get(layer);
22370
+ return pipe(modifyEffect(this.ref, (map12) => {
22371
+ const inMap = map12.get(layer);
22054
22372
  if (inMap !== undefined) {
22055
22373
  const [acquire, release] = inMap;
22056
22374
  const cached3 = pipe(acquire, flatMap7(([patch9, b]) => pipe(patchFiberRefs(patch9), as(b))), onExit(exitMatch({
22057
22375
  onFailure: () => void_,
22058
22376
  onSuccess: () => scopeAddFinalizerExit(scope2, release)
22059
22377
  })));
22060
- return succeed([cached3, map10]);
22378
+ return succeed([cached3, map12]);
22061
22379
  }
22062
22380
  return pipe(make23(0), flatMap7((observers) => pipe(deferredMake(), flatMap7((deferred) => pipe(make23(() => void_), map9((finalizerRef) => {
22063
22381
  const resource = uninterruptibleMask((restore) => pipe(scopeMake(), flatMap7((innerScope) => pipe(restore(flatMap7(makeBuilder(layer, innerScope, true), (f) => diffFiberRefs(f(this)))), exit, flatMap7((exit2) => {
@@ -22066,7 +22384,7 @@ var init_layer = __esm(() => {
22066
22384
  return pipe(deferredFailCause(deferred, exit2.effect_instruction_i0), zipRight(scopeClose(innerScope, exit2)), zipRight(failCause(exit2.effect_instruction_i0)));
22067
22385
  }
22068
22386
  case OP_SUCCESS: {
22069
- return pipe(set4(finalizerRef, (exit3) => pipe(scopeClose(innerScope, exit3), whenEffect(modify3(observers, (n) => [n === 1, n - 1])), asVoid)), zipRight(update2(observers, (n) => n + 1)), zipRight(scopeAddFinalizerExit(scope2, (exit3) => pipe(sync(() => map10.delete(layer)), zipRight(get10(finalizerRef)), flatMap7((finalizer) => finalizer(exit3))))), zipRight(deferredSucceed(deferred, exit2.effect_instruction_i0)), as(exit2.effect_instruction_i0[1]));
22387
+ return pipe(set4(finalizerRef, (exit3) => pipe(scopeClose(innerScope, exit3), whenEffect(modify3(observers, (n) => [n === 1, n - 1])), asVoid)), zipRight(update2(observers, (n) => n + 1)), zipRight(scopeAddFinalizerExit(scope2, (exit3) => pipe(sync(() => map12.delete(layer)), zipRight(get10(finalizerRef)), flatMap7((finalizer) => finalizer(exit3))))), zipRight(deferredSucceed(deferred, exit2.effect_instruction_i0)), as(exit2.effect_instruction_i0[1]));
22070
22388
  }
22071
22389
  }
22072
22390
  })))));
@@ -22074,7 +22392,7 @@ var init_layer = __esm(() => {
22074
22392
  onFailure: () => void_,
22075
22393
  onSuccess: () => update2(observers, (n) => n + 1)
22076
22394
  }))), (exit2) => pipe(get10(finalizerRef), flatMap7((finalizer) => finalizer(exit2)))];
22077
- return [resource, isFresh(layer) ? map10 : map10.set(layer, memoized)];
22395
+ return [resource, isFresh(layer) ? map12 : map12.set(layer, memoized)];
22078
22396
  }))))));
22079
22397
  }), flatten4);
22080
22398
  }
@@ -22082,19 +22400,19 @@ var init_layer = __esm(() => {
22082
22400
  makeMemoMap = /* @__PURE__ */ suspend(() => map9(makeSynchronized(new Map), (ref) => new MemoMapImpl(ref)));
22083
22401
  buildWithScope = /* @__PURE__ */ dual(2, (self2, scope2) => flatMap7(makeMemoMap, (memoMap) => buildWithMemoMap(self2, memoMap, scope2)));
22084
22402
  buildWithMemoMap = /* @__PURE__ */ dual(3, (self2, memoMap, scope2) => flatMap7(makeBuilder(self2, scope2), (run) => provideService(run(memoMap), CurrentMemoMap, memoMap)));
22085
- fromEffect2 = /* @__PURE__ */ dual(2, (a, b) => {
22403
+ fromEffect4 = /* @__PURE__ */ dual(2, (a, b) => {
22086
22404
  const tagFirst = isTag2(a);
22087
22405
  const tag = tagFirst ? a : b;
22088
22406
  const effect = tagFirst ? b : a;
22089
22407
  return fromEffectContext(map9(effect, (service) => make10(tag, service)));
22090
22408
  });
22091
- scoped = /* @__PURE__ */ dual(2, (a, b) => {
22409
+ scoped2 = /* @__PURE__ */ dual(2, (a, b) => {
22092
22410
  const tagFirst = isTag2(a);
22093
22411
  const tag = tagFirst ? a : b;
22094
22412
  const effect = tagFirst ? b : a;
22095
22413
  return scopedContext(map9(effect, (service) => make10(tag, service)));
22096
22414
  });
22097
- succeed4 = /* @__PURE__ */ dual(2, (a, b) => {
22415
+ succeed6 = /* @__PURE__ */ dual(2, (a, b) => {
22098
22416
  const tagFirst = isTag2(a);
22099
22417
  const tag = tagFirst ? a : b;
22100
22418
  const resource = tagFirst ? b : a;
@@ -22449,11 +22767,11 @@ var TypeId13, TimeZoneTypeId, Proto2, ProtoUtc, ProtoZoned, ProtoTimeZone, Proto
22449
22767
  }
22450
22768
  return makeZonedProto(adjustedMillis - afterOffset, zone);
22451
22769
  }, offsetRegex, parseOffset = (offset) => {
22452
- const match9 = offsetRegex.exec(offset);
22453
- if (match9 === null) {
22770
+ const match12 = offsetRegex.exec(offset);
22771
+ if (match12 === null) {
22454
22772
  return null;
22455
22773
  }
22456
- const [, sign, hours2, minutes2] = match9;
22774
+ const [, sign, hours2, minutes2] = match12;
22457
22775
  return (sign === "+" ? 1 : -1) * (Number(hours2) * 60 + Number(minutes2)) * 60 * 1000;
22458
22776
  }, calculateNamedOffset = (utcMillis, adjustedMillis, zone) => {
22459
22777
  const offset = zone.format.formatToParts(utcMillis).find((_) => _.type === "timeZoneName")?.value ?? "";
@@ -22693,7 +23011,7 @@ var TypeId14, CronProto, isCron = (u) => hasProperty(u, TypeId14), make37 = (val
22693
23011
  message: `Invalid time zone in cron expression`,
22694
23012
  input: tz
22695
23013
  }));
22696
- return all({
23014
+ return all2({
22697
23015
  tz: zone,
22698
23016
  seconds: parseSegment(seconds2, secondOptions),
22699
23017
  minutes: parseSegment(minutes2, minuteOptions),
@@ -22702,7 +23020,7 @@ var TypeId14, CronProto, isCron = (u) => hasProperty(u, TypeId14), make37 = (val
22702
23020
  months: parseSegment(months, monthOptions),
22703
23021
  weekdays: parseSegment(weekdays, weekdayOptions)
22704
23022
  }).pipe(map2(make37));
22705
- }, match9 = (cron, date) => {
23023
+ }, match12 = (cron, date) => {
22706
23024
  const parts2 = unsafeMakeZoned(date, {
22707
23025
  timeZone: getOrUndefined(cron.tz)
22708
23026
  }).pipe(toParts);
@@ -23081,7 +23399,7 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23081
23399
  elapsed: millis(now - prev.start),
23082
23400
  elapsedSincePrevious: millis(now - prev.now),
23083
23401
  start: prev.start
23084
- }), ScheduleDriverImpl, makeWithState = (initial, step3) => new ScheduleImpl(initial, step3), addDelay, addDelayEffect, andThen3, andThenEither, as2, asVoid2 = (self2) => map10(self2, constVoid), bothInOut, check, checkEffect, collectAllInputs = () => collectAllOutputs(identity2()), collectAllOutputs = (self2) => reduce9(self2, empty2(), (outs, out) => pipe(outs, append2(out))), collectUntil = (f) => collectAllOutputs(recurUntil(f)), collectUntilEffect = (f) => collectAllOutputs(recurUntilEffect(f)), collectWhile = (f) => collectAllOutputs(recurWhile(f)), collectWhileEffect = (f) => collectAllOutputs(recurWhileEffect(f)), compose, mapInput3, mapInputContext2, mapInputEffect, cron = (expression, tz) => {
23402
+ }), ScheduleDriverImpl, makeWithState = (initial, step3) => new ScheduleImpl(initial, step3), addDelay, addDelayEffect, andThen3, andThenEither, as2, asVoid2 = (self2) => map12(self2, constVoid), bothInOut, check, checkEffect, collectAllInputs = () => collectAllOutputs(identity2()), collectAllOutputs = (self2) => reduce9(self2, empty2(), (outs, out) => pipe(outs, append2(out))), collectUntil = (f) => collectAllOutputs(recurUntil(f)), collectUntilEffect = (f) => collectAllOutputs(recurUntilEffect(f)), collectWhile = (f) => collectAllOutputs(recurWhile(f)), collectWhileEffect = (f) => collectAllOutputs(recurWhileEffect(f)), compose, mapInput3, mapInputContext2, mapInputEffect, cron = (expression, tz) => {
23085
23403
  const parsed = isCron(expression) ? right2(expression) : parse(expression, tz);
23086
23404
  return makeWithState([true, [Number.MIN_SAFE_INTEGER, 0, 0]], (now, _, [initial, previous]) => {
23087
23405
  if (now < previous[0]) {
@@ -23093,7 +23411,7 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23093
23411
  const cron2 = parsed.right;
23094
23412
  const date = new Date(now);
23095
23413
  let next4;
23096
- if (initial && match9(cron2, date)) {
23414
+ if (initial && match12(cron2, date)) {
23097
23415
  next4 = now;
23098
23416
  }
23099
23417
  next4 = next2(cron2, date).getTime();
@@ -23135,13 +23453,13 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23135
23453
  }))), mapBoth2, mapBothEffect, driver = (self2) => pipe(make23([none2(), self2.initial]), map9((ref) => new ScheduleDriverImpl(self2, ref))), duration = (durationInput) => {
23136
23454
  const duration2 = decode(durationInput);
23137
23455
  const durationMillis = toMillis(duration2);
23138
- return makeWithState(true, (now, _, state) => succeed(state ? [false, duration2, continueWith2(after2(now + durationMillis))] : [false, zero, done5]));
23456
+ return makeWithState(true, (now, _, state) => succeed(state ? [false, duration2, continueWith2(after2(now + durationMillis))] : [false, zero, done6]));
23139
23457
  }, either3, eitherWith, ensuring2, exponential2 = (baseInput, factor = 2) => {
23140
23458
  const base = decode(baseInput);
23141
- return delayedSchedule(map10(forever2, (i2) => times(base, Math.pow(factor, i2))));
23459
+ return delayedSchedule(map12(forever2, (i2) => times(base, Math.pow(factor, i2))));
23142
23460
  }, fibonacci = (oneInput) => {
23143
23461
  const one = decode(oneInput);
23144
- return delayedSchedule(pipe(unfold2([one, one], ([a, b]) => [b, sum(a, b)]), map10((out) => out[0])));
23462
+ return delayedSchedule(pipe(unfold2([one, one], ([a, b]) => [b, sum(a, b)]), map12((out) => out[0])));
23145
23463
  }, fixed3 = (intervalInput) => {
23146
23464
  const interval = decode(intervalInput);
23147
23465
  const intervalMillis = toMillis(interval);
@@ -23170,8 +23488,8 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23170
23488
  const y = durations.slice(1);
23171
23489
  return [[[x, ...y], false], x, continueWith2(interval)];
23172
23490
  }
23173
- return [[durations, false], zero, done5];
23174
- })), fromFunction = (f) => map10(identity2(), f), hourOfDay = (hour) => makeWithState([Number.NEGATIVE_INFINITY, 0], (now, _, state) => {
23491
+ return [[durations, false], zero, done6];
23492
+ })), fromFunction = (f) => map12(identity2(), f), hourOfDay = (hour) => makeWithState([Number.NEGATIVE_INFINITY, 0], (now, _, state) => {
23175
23493
  if (!Number.isInteger(hour) || hour < 0 || 23 < hour) {
23176
23494
  return dieSync(() => new IllegalArgumentException(`Invalid argument in: hourOfDay(${hour}). Must be in range 0...23`));
23177
23495
  }
@@ -23190,14 +23508,14 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23190
23508
  if (pipe(lInterval, lessThan6(rInterval))) {
23191
23509
  return flatMap7(self2.step(end2(lInterval), input, lState), ([lState2, out3, decision]) => {
23192
23510
  if (isDone4(decision)) {
23193
- return succeed([[lState2, rState], [out3, out2], done5]);
23511
+ return succeed([[lState2, rState], [out3, out2], done6]);
23194
23512
  }
23195
23513
  return intersectWithLoop(self2, that, input, lState2, out3, decision.intervals, rState, out2, rInterval, f);
23196
23514
  });
23197
23515
  }
23198
23516
  return flatMap7(that.step(end2(rInterval), input, rState), ([rState2, out22, decision]) => {
23199
23517
  if (isDone4(decision)) {
23200
- return succeed([[lState, rState2], [out, out22], done5]);
23518
+ return succeed([[lState, rState2], [out, out22], done6]);
23201
23519
  }
23202
23520
  return intersectWithLoop(self2, that, input, lState, out, lInterval, rState2, out22, decision.intervals, f);
23203
23521
  });
@@ -23206,8 +23524,8 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23206
23524
  max: 1.2
23207
23525
  }), jitteredWith, linear = (baseInput) => {
23208
23526
  const base = decode(baseInput);
23209
- return delayedSchedule(map10(forever2, (i2) => times(base, i2 + 1)));
23210
- }, map10, mapEffect, minuteOfHour = (minute) => makeWithState([Number.MIN_SAFE_INTEGER, 0], (now, _, state) => {
23527
+ return delayedSchedule(map12(forever2, (i2) => times(base, i2 + 1)));
23528
+ }, map12, mapEffect3, minuteOfHour = (minute) => makeWithState([Number.MIN_SAFE_INTEGER, 0], (now, _, state) => {
23211
23529
  if (!Number.isInteger(minute) || minute < 0 || 59 < minute) {
23212
23530
  return dieSync(() => new IllegalArgumentException(`Invalid argument in: minuteOfHour(${minute}). Must be in range 0...59`));
23213
23531
  }
@@ -23218,7 +23536,7 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23218
23536
  const end3 = endOfMinute(minute0);
23219
23537
  const interval = make33(start3, end3);
23220
23538
  return succeed([[end3, n + 1], n, continueWith2(interval)]);
23221
- }), modifyDelay, modifyDelayEffect, onDecision, passthrough = (self2) => makeWithState(self2.initial, (now, input, state) => pipe(self2.step(now, input, state), map9(([state2, _, decision]) => [state2, input, decision]))), provideContext3, provideService2, recurUntil = (f) => untilInput(identity2(), f), recurUntilEffect = (f) => untilInputEffect(identity2(), f), recurUntilOption = (pf) => untilOutput(map10(identity2(), pf), isSome2), recurUpTo = (durationInput) => {
23539
+ }), modifyDelay, modifyDelayEffect, onDecision, passthrough = (self2) => makeWithState(self2.initial, (now, input, state) => pipe(self2.step(now, input, state), map9(([state2, _, decision]) => [state2, input, decision]))), provideContext3, provideService2, recurUntil = (f) => untilInput(identity2(), f), recurUntilEffect = (f) => untilInputEffect(identity2(), f), recurUntilOption = (pf) => untilOutput(map12(identity2(), pf), isSome2), recurUpTo = (durationInput) => {
23222
23540
  const duration2 = decode(durationInput);
23223
23541
  return whileOutput(elapsed, (elapsed) => lessThan2(elapsed, duration2));
23224
23542
  }, recurWhile = (f) => whileInput(identity2(), f), recurWhileEffect = (f) => whileInputEffect(identity2(), f), recurs = (n) => whileOutput(forever2, (out) => out < n), reduce9, reduceEffect2, repetitions = (self2) => reduce9(self2, 0, (n, _) => n + 1), resetAfter, resetWhen, run, runLoop = (self2, now, inputs, state, acc) => {
@@ -23244,7 +23562,7 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23244
23562
  const end3 = endOfSecond(second0);
23245
23563
  const interval = make33(start3, end3);
23246
23564
  return succeed([[end3, n + 1], n, continueWith2(interval)]);
23247
- }), spaced = (duration2) => addDelay(forever2, () => duration2), succeed5 = (value) => map10(forever2, () => value), sync3 = (evaluate2) => map10(forever2, evaluate2), tapInput, tapOutput, unfold2 = (initial, f) => makeWithState(initial, (now, _, state) => sync(() => [f(state), state, continueWith2(after2(now))])), union8, unionWith2, untilInput, untilInputEffect, untilOutput, untilOutputEffect, upTo, whileInput, whileInputEffect, whileOutput, whileOutputEffect, windowed = (intervalInput) => {
23565
+ }), spaced = (duration2) => addDelay(forever2, () => duration2), succeed7 = (value) => map12(forever2, () => value), sync3 = (evaluate2) => map12(forever2, evaluate2), tapInput, tapOutput, unfold2 = (initial, f) => makeWithState(initial, (now, _, state) => sync(() => [f(state), state, continueWith2(after2(now))])), union8, unionWith2, untilInput, untilInputEffect, untilOutput, untilOutputEffect, upTo, whileInput, whileInputEffect, whileOutput, whileOutputEffect, windowed = (intervalInput) => {
23248
23566
  const interval = decode(intervalInput);
23249
23567
  const millis2 = toMillis(interval);
23250
23568
  return makeWithState([none2(), 0], (now, _, [option2, n]) => {
@@ -23257,7 +23575,7 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23257
23575
  }
23258
23576
  }
23259
23577
  });
23260
- }, zipLeft2, zipRight2, zipWith3, beginningOfSecond = (now) => {
23578
+ }, zipLeft3, zipRight3, zipWith5, beginningOfSecond = (now) => {
23261
23579
  const date = new Date(now);
23262
23580
  return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0).getTime();
23263
23581
  }, endOfSecond = (now) => {
@@ -23340,11 +23658,11 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23340
23658
  }, ScheduleDefectTypeId, ScheduleDefect, isScheduleDefect = (u) => hasProperty(u, ScheduleDefectTypeId), scheduleDefectWrap = (self2) => catchAll(self2, (e) => die2(new ScheduleDefect(e))), scheduleDefectRefailCause = (cause2) => match(find(cause2, (_) => isDieType(_) && isScheduleDefect(_.defect) ? some2(_.defect) : none2()), {
23341
23659
  onNone: () => cause2,
23342
23660
  onSome: (error) => fail(error.error)
23343
- }), scheduleDefectRefail = (effect) => catchAllCause(effect, (cause2) => failCause(scheduleDefectRefailCause(cause2))), repeat_Effect, repeat_combined, repeatOrElse_Effect, repeatOrElseEffectLoop = (self2, driver2, orElse2, value) => matchEffect(driver2.next(value), {
23661
+ }), scheduleDefectRefail = (effect) => catchAllCause(effect, (cause2) => failCause(scheduleDefectRefailCause(cause2))), repeat_Effect, repeat_combined, repeatOrElse_Effect, repeatOrElseEffectLoop = (self2, driver2, orElse4, value) => matchEffect(driver2.next(value), {
23344
23662
  onFailure: () => orDie(driver2.last),
23345
23663
  onSuccess: (b) => matchEffect(self2, {
23346
- onFailure: (error) => orElse2(error, some2(b)),
23347
- onSuccess: (value2) => repeatOrElseEffectLoop(self2, driver2, orElse2, value2)
23664
+ onFailure: (error) => orElse4(error, some2(b)),
23665
+ onSuccess: (value2) => repeatOrElseEffectLoop(self2, driver2, orElse4, value2)
23348
23666
  })
23349
23667
  }), retry_Effect, retry_combined, fromRetryOptions = (options) => {
23350
23668
  const base = options.schedule ?? forever2;
@@ -23363,10 +23681,10 @@ var ScheduleSymbolKey = "effect/Schedule", ScheduleTypeId, isSchedule = (u) => h
23363
23681
  return scheduleDefectWrap(applied);
23364
23682
  }) : withWhile;
23365
23683
  return options.times !== undefined ? intersect5(withUntil, recurs(options.times)) : withUntil;
23366
- }, retryOrElse_Effect, retryOrElse_EffectLoop = (self2, driver2, orElse2) => {
23684
+ }, retryOrElse_Effect, retryOrElse_EffectLoop = (self2, driver2, orElse4) => {
23367
23685
  return catchAll(self2, (e) => matchEffect(driver2.next(e), {
23368
- onFailure: () => pipe(driver2.last, orDie, flatMap7((out) => orElse2(e, out))),
23369
- onSuccess: () => retryOrElse_EffectLoop(self2, driver2, orElse2)
23686
+ onFailure: () => pipe(driver2.last, orDie, flatMap7((out) => orElse4(e, out))),
23687
+ onSuccess: () => retryOrElse_EffectLoop(self2, driver2, orElse4)
23370
23688
  }));
23371
23689
  }, schedule_Effect, scheduleFrom_Effect, scheduleFrom_EffectLoop = (self2, initial, driver2) => matchEffect(driver2.next(initial), {
23372
23690
  onFailure: () => orDie(driver2.last),
@@ -23438,7 +23756,7 @@ var init_schedule = __esm(() => {
23438
23756
  this.ref = ref;
23439
23757
  }
23440
23758
  get state() {
23441
- return map9(get10(this.ref), (tuple) => tuple[1]);
23759
+ return map9(get10(this.ref), (tuple2) => tuple2[1]);
23442
23760
  }
23443
23761
  get last() {
23444
23762
  return flatMap7(get10(this.ref), ([element, _]) => {
@@ -23457,7 +23775,7 @@ var init_schedule = __esm(() => {
23457
23775
  return set4(this.ref, [none2(), this.schedule.initial]).pipe(zipLeft(set4(this.iterationMeta, defaultIterationMetadata)));
23458
23776
  }
23459
23777
  next(input) {
23460
- return pipe(map9(get10(this.ref), (tuple) => tuple[1]), flatMap7((state) => pipe(currentTimeMillis2, flatMap7((now) => pipe(suspend(() => this.schedule.step(now, input, state)), flatMap7(([state2, out, decision]) => {
23778
+ return pipe(map9(get10(this.ref), (tuple2) => tuple2[1]), flatMap7((state) => pipe(currentTimeMillis2, flatMap7((now) => pipe(suspend(() => this.schedule.step(now, input, state)), flatMap7(([state2, out, decision]) => {
23461
23779
  const setState = set4(this.ref, [some2(out), state2]);
23462
23780
  if (isDone4(decision)) {
23463
23781
  return setState.pipe(zipRight(fail2(none2())));
@@ -23473,29 +23791,29 @@ var init_schedule = __esm(() => {
23473
23791
  };
23474
23792
  addDelay = /* @__PURE__ */ dual(2, (self2, f) => addDelayEffect(self2, (out) => sync(() => f(out))));
23475
23793
  addDelayEffect = /* @__PURE__ */ dual(2, (self2, f) => modifyDelayEffect(self2, (out, duration) => map9(f(out), (delay2) => sum(duration, decode(delay2)))));
23476
- andThen3 = /* @__PURE__ */ dual(2, (self2, that) => map10(andThenEither(self2, that), merge));
23794
+ andThen3 = /* @__PURE__ */ dual(2, (self2, that) => map12(andThenEither(self2, that), merge));
23477
23795
  andThenEither = /* @__PURE__ */ dual(2, (self2, that) => makeWithState([self2.initial, that.initial, true], (now, input, state) => state[2] ? flatMap7(self2.step(now, input, state[0]), ([lState, out, decision]) => {
23478
23796
  if (isDone4(decision)) {
23479
23797
  return map9(that.step(now, input, state[1]), ([rState, out2, decision2]) => [[lState, rState, false], right2(out2), decision2]);
23480
23798
  }
23481
23799
  return succeed([[lState, state[1], true], left2(out), decision]);
23482
23800
  }) : map9(that.step(now, input, state[1]), ([rState, out, decision]) => [[state[0], rState, false], right2(out), decision])));
23483
- as2 = /* @__PURE__ */ dual(2, (self2, out) => map10(self2, () => out));
23801
+ as2 = /* @__PURE__ */ dual(2, (self2, out) => map12(self2, () => out));
23484
23802
  bothInOut = /* @__PURE__ */ dual(2, (self2, that) => makeWithState([self2.initial, that.initial], (now, [in1, in2], state) => zipWith2(self2.step(now, in1, state[0]), that.step(now, in2, state[1]), ([lState, out, lDecision], [rState, out2, rDecision]) => {
23485
23803
  if (isContinue2(lDecision) && isContinue2(rDecision)) {
23486
23804
  const interval = pipe(lDecision.intervals, union7(rDecision.intervals));
23487
23805
  return [[lState, rState], [out, out2], _continue2(interval)];
23488
23806
  }
23489
- return [[lState, rState], [out, out2], done5];
23807
+ return [[lState, rState], [out, out2], done6];
23490
23808
  })));
23491
23809
  check = /* @__PURE__ */ dual(2, (self2, test) => checkEffect(self2, (input, out) => sync(() => test(input, out))));
23492
23810
  checkEffect = /* @__PURE__ */ dual(2, (self2, test) => makeWithState(self2.initial, (now, input, state) => flatMap7(self2.step(now, input, state), ([state2, out, decision]) => {
23493
23811
  if (isDone4(decision)) {
23494
- return succeed([state2, out, done5]);
23812
+ return succeed([state2, out, done6]);
23495
23813
  }
23496
- return map9(test(input, out), (cont) => cont ? [state2, out, decision] : [state2, out, done5]);
23814
+ return map9(test(input, out), (cont) => cont ? [state2, out, decision] : [state2, out, done6]);
23497
23815
  })));
23498
- compose = /* @__PURE__ */ dual(2, (self2, that) => makeWithState([self2.initial, that.initial], (now, input, state) => flatMap7(self2.step(now, input, state[0]), ([lState, out, lDecision]) => map9(that.step(now, out, state[1]), ([rState, out2, rDecision]) => isDone4(lDecision) ? [[lState, rState], out2, done5] : isDone4(rDecision) ? [[lState, rState], out2, done5] : [[lState, rState], out2, _continue2(pipe(lDecision.intervals, max5(rDecision.intervals)))]))));
23816
+ compose = /* @__PURE__ */ dual(2, (self2, that) => makeWithState([self2.initial, that.initial], (now, input, state) => flatMap7(self2.step(now, input, state[0]), ([lState, out, lDecision]) => map9(that.step(now, out, state[1]), ([rState, out2, rDecision]) => isDone4(lDecision) ? [[lState, rState], out2, done6] : isDone4(rDecision) ? [[lState, rState], out2, done6] : [[lState, rState], out2, _continue2(pipe(lDecision.intervals, max5(rDecision.intervals)))]))));
23499
23817
  mapInput3 = /* @__PURE__ */ dual(2, (self2, f) => mapInputEffect(self2, (input2) => sync(() => f(input2))));
23500
23818
  mapInputContext2 = /* @__PURE__ */ dual(2, (self2, f) => makeWithState(self2.initial, (now, input, state) => mapInputContext(self2.step(now, input, state), f)));
23501
23819
  mapInputEffect = /* @__PURE__ */ dual(2, (self2, f) => makeWithState(self2.initial, (now, input2, state) => flatMap7(f(input2), (input) => self2.step(now, input, state))));
@@ -23504,11 +23822,11 @@ var init_schedule = __esm(() => {
23504
23822
  mapBoth2 = /* @__PURE__ */ dual(2, (self2, {
23505
23823
  onInput,
23506
23824
  onOutput
23507
- }) => map10(mapInput3(self2, onInput), onOutput));
23825
+ }) => map12(mapInput3(self2, onInput), onOutput));
23508
23826
  mapBothEffect = /* @__PURE__ */ dual(2, (self2, {
23509
23827
  onInput,
23510
23828
  onOutput
23511
- }) => mapEffect(mapInputEffect(self2, onInput), onOutput));
23829
+ }) => mapEffect3(mapInputEffect(self2, onInput), onOutput));
23512
23830
  either3 = /* @__PURE__ */ dual(2, (self2, that) => union8(self2, that));
23513
23831
  eitherWith = /* @__PURE__ */ dual(3, (self2, that, f) => unionWith2(self2, that, f));
23514
23832
  ensuring2 = /* @__PURE__ */ dual(2, (self2, finalizer) => makeWithState(self2.initial, (now, input, state) => flatMap7(self2.step(now, input, state), ([state2, out, decision]) => isDone4(decision) ? as(finalizer, [state2, out, decision]) : succeed([state2, out, decision]))));
@@ -23517,7 +23835,7 @@ var init_schedule = __esm(() => {
23517
23835
  if (isContinue2(lDecision) && isContinue2(rDecision)) {
23518
23836
  return intersectWithLoop(self2, that, input, lState, out, lDecision.intervals, rState, out2, rDecision.intervals, f);
23519
23837
  }
23520
- return succeed([[lState, rState], [out, out2], done5]);
23838
+ return succeed([[lState, rState], [out, out2], done6]);
23521
23839
  }))));
23522
23840
  jitteredWith = /* @__PURE__ */ dual(2, (self2, options) => {
23523
23841
  const {
@@ -23533,8 +23851,8 @@ var init_schedule = __esm(() => {
23533
23851
  return millis(jittered2);
23534
23852
  }));
23535
23853
  });
23536
- map10 = /* @__PURE__ */ dual(2, (self2, f) => mapEffect(self2, (out) => sync(() => f(out))));
23537
- mapEffect = /* @__PURE__ */ dual(2, (self2, f) => makeWithState(self2.initial, (now, input, state) => flatMap7(self2.step(now, input, state), ([state2, out, decision]) => map9(f(out), (out2) => [state2, out2, decision]))));
23854
+ map12 = /* @__PURE__ */ dual(2, (self2, f) => mapEffect3(self2, (out) => sync(() => f(out))));
23855
+ mapEffect3 = /* @__PURE__ */ dual(2, (self2, f) => makeWithState(self2.initial, (now, input, state) => flatMap7(self2.step(now, input, state), ([state2, out, decision]) => map9(f(out), (out2) => [state2, out2, decision]))));
23538
23856
  modifyDelay = /* @__PURE__ */ dual(2, (self2, f) => modifyDelayEffect(self2, (out, duration2) => sync(() => f(out, duration2))));
23539
23857
  modifyDelayEffect = /* @__PURE__ */ dual(2, (self2, f) => makeWithState(self2.initial, (now, input, state) => flatMap7(self2.step(now, input, state), ([state2, out, decision]) => {
23540
23858
  if (isDone4(decision)) {
@@ -23559,7 +23877,7 @@ var init_schedule = __esm(() => {
23559
23877
  reduceEffect2 = /* @__PURE__ */ dual(3, (self2, zero2, f) => makeWithState([self2.initial, zero2], (now, input, [s, z]) => flatMap7(self2.step(now, input, s), ([s2, out, decision]) => isDone4(decision) ? succeed([[s2, z], z, decision]) : map9(f(z, out), (z2) => [[s2, z2], z, decision]))));
23560
23878
  resetAfter = /* @__PURE__ */ dual(2, (self2, durationInput) => {
23561
23879
  const duration2 = decode(durationInput);
23562
- return pipe(self2, intersect5(elapsed), resetWhen(([, time]) => greaterThanOrEqualTo(time, duration2)), map10((out) => out[0]));
23880
+ return pipe(self2, intersect5(elapsed), resetWhen(([, time]) => greaterThanOrEqualTo(time, duration2)), map12((out) => out[0]));
23563
23881
  });
23564
23882
  resetWhen = /* @__PURE__ */ dual(2, (self2, f) => makeWithState(self2.initial, (now, input, state) => flatMap7(self2.step(now, input, state), ([state2, out, decision]) => f(out) ? self2.step(now, input, self2.initial) : succeed([state2, out, decision]))));
23565
23883
  run = /* @__PURE__ */ dual(3, (self2, now, input) => pipe(runLoop(self2, now, fromIterable2(input), self2.initial, empty2()), map9((list) => reverse2(list))));
@@ -23568,7 +23886,7 @@ var init_schedule = __esm(() => {
23568
23886
  union8 = /* @__PURE__ */ dual(2, (self2, that) => unionWith2(self2, that, union7));
23569
23887
  unionWith2 = /* @__PURE__ */ dual(3, (self2, that, f) => makeWithState([self2.initial, that.initial], (now, input, state) => zipWith2(self2.step(now, input, state[0]), that.step(now, input, state[1]), ([lState, l, lDecision], [rState, r, rDecision]) => {
23570
23888
  if (isDone4(lDecision) && isDone4(rDecision)) {
23571
- return [[lState, rState], [l, r], done5];
23889
+ return [[lState, rState], [l, r], done6];
23572
23890
  }
23573
23891
  if (isDone4(lDecision) && isContinue2(rDecision)) {
23574
23892
  return [[lState, rState], [l, r], _continue2(rDecision.intervals)];
@@ -23586,14 +23904,14 @@ var init_schedule = __esm(() => {
23586
23904
  untilInputEffect = /* @__PURE__ */ dual(2, (self2, f) => checkEffect(self2, (input, _) => negate(f(input))));
23587
23905
  untilOutput = /* @__PURE__ */ dual(2, (self2, f) => check(self2, (_, out) => !f(out)));
23588
23906
  untilOutputEffect = /* @__PURE__ */ dual(2, (self2, f) => checkEffect(self2, (_, out) => negate(f(out))));
23589
- upTo = /* @__PURE__ */ dual(2, (self2, duration2) => zipLeft2(self2, recurUpTo(duration2)));
23907
+ upTo = /* @__PURE__ */ dual(2, (self2, duration2) => zipLeft3(self2, recurUpTo(duration2)));
23590
23908
  whileInput = /* @__PURE__ */ dual(2, (self2, f) => check(self2, (input, _) => f(input)));
23591
23909
  whileInputEffect = /* @__PURE__ */ dual(2, (self2, f) => checkEffect(self2, (input, _) => f(input)));
23592
23910
  whileOutput = /* @__PURE__ */ dual(2, (self2, f) => check(self2, (_, out) => f(out)));
23593
23911
  whileOutputEffect = /* @__PURE__ */ dual(2, (self2, f) => checkEffect(self2, (_, out) => f(out)));
23594
- zipLeft2 = /* @__PURE__ */ dual(2, (self2, that) => map10(intersect5(self2, that), (out) => out[0]));
23595
- zipRight2 = /* @__PURE__ */ dual(2, (self2, that) => map10(intersect5(self2, that), (out) => out[1]));
23596
- zipWith3 = /* @__PURE__ */ dual(3, (self2, that, f) => map10(intersect5(self2, that), ([out, out2]) => f(out, out2)));
23912
+ zipLeft3 = /* @__PURE__ */ dual(2, (self2, that) => map12(intersect5(self2, that), (out) => out[0]));
23913
+ zipRight3 = /* @__PURE__ */ dual(2, (self2, that) => map12(intersect5(self2, that), (out) => out[1]));
23914
+ zipWith5 = /* @__PURE__ */ dual(3, (self2, that, f) => map12(intersect5(self2, that), ([out, out2]) => f(out, out2)));
23597
23915
  ScheduleDefectTypeId = /* @__PURE__ */ Symbol.for("effect/Schedule/ScheduleDefect");
23598
23916
  ScheduleDefect = class ScheduleDefect {
23599
23917
  error;
@@ -23623,12 +23941,12 @@ var init_schedule = __esm(() => {
23623
23941
  }
23624
23942
  return scheduleDefectWrap(applied);
23625
23943
  }) : withWhile;
23626
- const withTimes = options.times ? intersect5(withUntil, recurs(options.times)).pipe(map10((intersectionPair) => intersectionPair[0])) : withUntil;
23944
+ const withTimes = options.times ? intersect5(withUntil, recurs(options.times)).pipe(map12((intersectionPair) => intersectionPair[0])) : withUntil;
23627
23945
  return scheduleDefectRefail(repeat_Effect(self2, withTimes));
23628
23946
  });
23629
- repeatOrElse_Effect = /* @__PURE__ */ dual(3, (self2, schedule, orElse2) => flatMap7(driver(schedule), (driver2) => matchEffect(self2, {
23630
- onFailure: (error) => orElse2(error, none2()),
23631
- onSuccess: (value) => repeatOrElseEffectLoop(provideServiceEffect(self2, CurrentIterationMetadata, get10(driver2.iterationMeta)), driver2, (error, option2) => provideServiceEffect(orElse2(error, option2), CurrentIterationMetadata, get10(driver2.iterationMeta)), value)
23947
+ repeatOrElse_Effect = /* @__PURE__ */ dual(3, (self2, schedule, orElse4) => flatMap7(driver(schedule), (driver2) => matchEffect(self2, {
23948
+ onFailure: (error) => orElse4(error, none2()),
23949
+ onSuccess: (value) => repeatOrElseEffectLoop(provideServiceEffect(self2, CurrentIterationMetadata, get10(driver2.iterationMeta)), driver2, (error, option2) => provideServiceEffect(orElse4(error, option2), CurrentIterationMetadata, get10(driver2.iterationMeta)), value)
23632
23950
  })));
23633
23951
  retry_Effect = /* @__PURE__ */ dual(2, (self2, policy) => retryOrElse_Effect(self2, policy, (e, _) => fail2(e)));
23634
23952
  retry_combined = /* @__PURE__ */ dual(2, (self2, options) => {
@@ -23637,7 +23955,7 @@ var init_schedule = __esm(() => {
23637
23955
  }
23638
23956
  return scheduleDefectRefail(retry_Effect(self2, fromRetryOptions(options)));
23639
23957
  });
23640
- retryOrElse_Effect = /* @__PURE__ */ dual(3, (self2, policy, orElse2) => flatMap7(driver(policy), (driver2) => retryOrElse_EffectLoop(provideServiceEffect(self2, CurrentIterationMetadata, get10(driver2.iterationMeta)), driver2, (e, out) => provideServiceEffect(orElse2(e, out), CurrentIterationMetadata, get10(driver2.iterationMeta)))));
23958
+ retryOrElse_Effect = /* @__PURE__ */ dual(3, (self2, policy, orElse4) => flatMap7(driver(policy), (driver2) => retryOrElse_EffectLoop(provideServiceEffect(self2, CurrentIterationMetadata, get10(driver2.iterationMeta)), driver2, (e, out) => provideServiceEffect(orElse4(e, out), CurrentIterationMetadata, get10(driver2.iterationMeta)))));
23641
23959
  schedule_Effect = /* @__PURE__ */ dual(2, (self2, schedule) => scheduleFrom_Effect(self2, undefined, schedule));
23642
23960
  scheduleFrom_Effect = /* @__PURE__ */ dual(3, (self2, initial, schedule) => flatMap7(driver(schedule), (driver2) => scheduleFrom_EffectLoop(provideServiceEffect(self2, CurrentIterationMetadata, get10(driver2.iterationMeta)), initial, driver2)));
23643
23961
  count = /* @__PURE__ */ unfold2(0, (n) => n + 1);
@@ -23713,12 +24031,12 @@ var init_executionPlan = __esm(() => {
23713
24031
  });
23714
24032
 
23715
24033
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/Deferred.js
23716
- var _await2, done6, interrupt3, unsafeMake8;
24034
+ var _await3, done8, interrupt5, unsafeMake8;
23717
24035
  var init_Deferred = __esm(() => {
23718
24036
  init_core();
23719
- _await2 = deferredAwait;
23720
- done6 = deferredDone;
23721
- interrupt3 = deferredInterrupt;
24037
+ _await3 = deferredAwait;
24038
+ done8 = deferredDone;
24039
+ interrupt5 = deferredInterrupt;
23722
24040
  unsafeMake8 = deferredUnsafeMake;
23723
24041
  });
23724
24042
 
@@ -23771,27 +24089,27 @@ var init_MutableList = __esm(() => {
23771
24089
  MutableListProto = {
23772
24090
  [TypeId15]: TypeId15,
23773
24091
  [Symbol.iterator]() {
23774
- let done7 = false;
24092
+ let done9 = false;
23775
24093
  let head4 = this.head;
23776
24094
  return {
23777
24095
  next() {
23778
- if (done7) {
24096
+ if (done9) {
23779
24097
  return this.return();
23780
24098
  }
23781
24099
  if (head4 == null) {
23782
- done7 = true;
24100
+ done9 = true;
23783
24101
  return this.return();
23784
24102
  }
23785
24103
  const value = head4.value;
23786
24104
  head4 = head4.next;
23787
24105
  return {
23788
- done: done7,
24106
+ done: done9,
23789
24107
  value
23790
24108
  };
23791
24109
  },
23792
24110
  return(value) {
23793
- if (!done7) {
23794
- done7 = true;
24111
+ if (!done9) {
24112
+ done9 = true;
23795
24113
  }
23796
24114
  return {
23797
24115
  done: true,
@@ -23839,7 +24157,7 @@ var TypeId16, EmptyMutableQueue, MutableQueueProto, make38 = (capacity) => {
23839
24157
  queue.queue = empty26();
23840
24158
  queue.capacity = capacity;
23841
24159
  return queue;
23842
- }, unbounded = () => make38(undefined), offer, poll;
24160
+ }, unbounded = () => make38(undefined), offer, poll3;
23843
24161
  var init_MutableQueue = __esm(() => {
23844
24162
  init_Function();
23845
24163
  init_Inspectable();
@@ -23876,7 +24194,7 @@ var init_MutableQueue = __esm(() => {
23876
24194
  append3(value)(self2.queue);
23877
24195
  return true;
23878
24196
  });
23879
- poll = /* @__PURE__ */ dual(2, (self2, def) => {
24197
+ poll3 = /* @__PURE__ */ dual(2, (self2, def) => {
23880
24198
  if (isEmpty8(self2.queue)) {
23881
24199
  return def;
23882
24200
  }
@@ -23942,8 +24260,8 @@ var complete2 = (key, exit2, entryStats, timeToLiveMillis) => struct({
23942
24260
  _tag: "Refreshing",
23943
24261
  deferred,
23944
24262
  complete: complete3
23945
- }), MapKeyTypeId, MapKeyImpl, makeMapKey = (current) => new MapKeyImpl(current), isMapKey = (u) => hasProperty(u, MapKeyTypeId), makeKeySet = () => new KeySetImpl, makeCacheState = (map11, keys3, accesses, updating, hits, misses) => ({
23946
- map: map11,
24263
+ }), MapKeyTypeId, MapKeyImpl, makeMapKey = (current) => new MapKeyImpl(current), isMapKey = (u) => hasProperty(u, MapKeyTypeId), makeKeySet = () => new KeySetImpl, makeCacheState = (map13, keys3, accesses, updating, hits, misses) => ({
24264
+ map: map13,
23947
24265
  keys: keys3,
23948
24266
  accesses,
23949
24267
  updating,
@@ -24158,10 +24476,10 @@ var init_cache = __esm(() => {
24158
24476
  }), asVoid);
24159
24477
  }
24160
24478
  case "Pending": {
24161
- return _await2(value.deferred);
24479
+ return _await3(value.deferred);
24162
24480
  }
24163
24481
  case "Refreshing": {
24164
- return _await2(value.deferred);
24482
+ return _await3(value.deferred);
24165
24483
  }
24166
24484
  }
24167
24485
  }
@@ -24232,7 +24550,7 @@ var init_cache = __esm(() => {
24232
24550
  if (ignorePending) {
24233
24551
  return succeed(none2());
24234
24552
  }
24235
- return map9(_await2(value.deferred), some2);
24553
+ return map9(_await3(value.deferred), some2);
24236
24554
  }
24237
24555
  case "Refreshing": {
24238
24556
  this.trackAccess(value.complete.key);
@@ -24241,7 +24559,7 @@ var init_cache = __esm(() => {
24241
24559
  if (ignorePending) {
24242
24560
  return succeed(none2());
24243
24561
  }
24244
- return map9(_await2(value.deferred), some2);
24562
+ return map9(_await3(value.deferred), some2);
24245
24563
  }
24246
24564
  return map9(value.complete.exit, some2);
24247
24565
  }
@@ -24259,7 +24577,7 @@ var init_cache = __esm(() => {
24259
24577
  if (compareAndSet(this.cacheState.updating, false, true)) {
24260
24578
  let loop2 = true;
24261
24579
  while (loop2) {
24262
- const key2 = poll(this.cacheState.accesses, EmptyMutableQueue);
24580
+ const key2 = poll3(this.cacheState.accesses, EmptyMutableQueue);
24263
24581
  if (key2 === EmptyMutableQueue) {
24264
24582
  loop2 = false;
24265
24583
  } else {
@@ -24294,8 +24612,8 @@ var init_cache = __esm(() => {
24294
24612
  const stats = makeEntryStats(now);
24295
24613
  const value = complete2(makeMapKey(key), exit2, stats, now + toMillis(decode(this.timeToLive(exit2))));
24296
24614
  set5(this.cacheState.map, key, value);
24297
- return zipRight(done6(deferred, exit2), exit2);
24298
- }), onInterrupt(() => zipRight(interrupt3(deferred), sync(() => {
24615
+ return zipRight(done8(deferred, exit2), exit2);
24616
+ }), onInterrupt(() => zipRight(interrupt5(deferred), sync(() => {
24299
24617
  remove5(this.cacheState.map, key);
24300
24618
  }))));
24301
24619
  }));
@@ -24304,7 +24622,7 @@ var init_cache = __esm(() => {
24304
24622
  });
24305
24623
 
24306
24624
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/internal/query.js
24307
- var currentCache, currentCacheEnabled, fromRequest = (request, dataSource) => flatMap7(isEffect(dataSource) ? dataSource : succeed(dataSource), (ds) => fiberIdWith((id) => {
24625
+ var currentCache, currentCacheEnabled, fromRequest = (request, dataSource) => flatMap7(isEffect(dataSource) ? dataSource : succeed(dataSource), (ds) => fiberIdWith((id3) => {
24308
24626
  const proxy = new Proxy(request, {});
24309
24627
  return fiberRefGetWith(currentCacheEnabled, (cacheEnabled) => {
24310
24628
  if (cacheEnabled) {
@@ -24326,7 +24644,7 @@ var currentCache, currentCacheEnabled, fromRequest = (request, dataSource) => fl
24326
24644
  request: proxy,
24327
24645
  result: orNew.right.handle,
24328
24646
  listeners: orNew.right.listeners,
24329
- ownerId: id,
24647
+ ownerId: id3,
24330
24648
  state: {
24331
24649
  completed: false
24332
24650
  }
@@ -24345,7 +24663,7 @@ var currentCache, currentCacheEnabled, fromRequest = (request, dataSource) => fl
24345
24663
  request: proxy,
24346
24664
  result: ref,
24347
24665
  listeners,
24348
- ownerId: id,
24666
+ ownerId: id3,
24349
24667
  state: {
24350
24668
  completed: false
24351
24669
  }
@@ -24395,10 +24713,10 @@ var init_Request = __esm(() => {
24395
24713
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/Effect.js
24396
24714
  var exports_Effect = {};
24397
24715
  __export(exports_Effect, {
24398
- zipWith: () => zipWith4,
24399
- zipRight: () => zipRight3,
24400
- zipLeft: () => zipLeft3,
24401
- zip: () => zip4,
24716
+ zipWith: () => zipWith6,
24717
+ zipRight: () => zipRight4,
24718
+ zipLeft: () => zipLeft4,
24719
+ zip: () => zip5,
24402
24720
  yieldNow: () => yieldNow4,
24403
24721
  withUnhandledErrorLogLevel: () => withUnhandledErrorLogLevel2,
24404
24722
  withTracerTiming: () => withTracerTiming2,
@@ -24485,7 +24803,7 @@ __export(exports_Effect, {
24485
24803
  summarized: () => summarized2,
24486
24804
  succeedSome: () => succeedSome2,
24487
24805
  succeedNone: () => succeedNone2,
24488
- succeed: () => succeed7,
24806
+ succeed: () => succeed9,
24489
24807
  step: () => step3,
24490
24808
  spanLinks: () => spanLinks2,
24491
24809
  spanAnnotations: () => spanAnnotations2,
@@ -24500,7 +24818,7 @@ __export(exports_Effect, {
24500
24818
  serviceConstants: () => serviceConstants2,
24501
24819
  sequentialFinalizers: () => sequentialFinalizers2,
24502
24820
  scopedWith: () => scopedWith2,
24503
- scoped: () => scoped2,
24821
+ scoped: () => scoped3,
24504
24822
  scopeWith: () => scopeWith2,
24505
24823
  scope: () => scope2,
24506
24824
  scheduleFrom: () => scheduleFrom,
@@ -24544,7 +24862,7 @@ __export(exports_Effect, {
24544
24862
  parallelErrors: () => parallelErrors2,
24545
24863
  orElseSucceed: () => orElseSucceed2,
24546
24864
  orElseFail: () => orElseFail2,
24547
- orElse: () => orElse2,
24865
+ orElse: () => orElse4,
24548
24866
  orDieWith: () => orDieWith2,
24549
24867
  orDie: () => orDie2,
24550
24868
  optionFromOptional: () => optionFromOptional2,
@@ -24554,7 +24872,7 @@ __export(exports_Effect, {
24554
24872
  onExit: () => onExit3,
24555
24873
  onError: () => onError2,
24556
24874
  none: () => none9,
24557
- never: () => never2,
24875
+ never: () => never4,
24558
24876
  negate: () => negate2,
24559
24877
  metricLabels: () => metricLabels2,
24560
24878
  mergeAll: () => mergeAll5,
@@ -24562,13 +24880,13 @@ __export(exports_Effect, {
24562
24880
  matchEffect: () => matchEffect2,
24563
24881
  matchCauseEffect: () => matchCauseEffect3,
24564
24882
  matchCause: () => matchCause2,
24565
- match: () => match10,
24883
+ match: () => match13,
24566
24884
  mapInputContext: () => mapInputContext3,
24567
24885
  mapErrorCause: () => mapErrorCause2,
24568
24886
  mapError: () => mapError2,
24569
24887
  mapBoth: () => mapBoth3,
24570
24888
  mapAccum: () => mapAccum3,
24571
- map: () => map11,
24889
+ map: () => map13,
24572
24890
  makeSpanScoped: () => makeSpanScoped2,
24573
24891
  makeSpan: () => makeSpan2,
24574
24892
  makeSemaphore: () => makeSemaphore2,
@@ -24594,14 +24912,14 @@ __export(exports_Effect, {
24594
24912
  labelMetricsScoped: () => labelMetricsScoped2,
24595
24913
  labelMetrics: () => labelMetrics2,
24596
24914
  iterate: () => iterate2,
24597
- isSuccess: () => isSuccess2,
24915
+ isSuccess: () => isSuccess3,
24598
24916
  isFailure: () => isFailure2,
24599
24917
  isEffect: () => isEffect2,
24600
24918
  intoDeferred: () => intoDeferred2,
24601
24919
  interruptibleMask: () => interruptibleMask2,
24602
24920
  interruptible: () => interruptible4,
24603
24921
  interruptWith: () => interruptWith2,
24604
- interrupt: () => interrupt4,
24922
+ interrupt: () => interrupt6,
24605
24923
  inheritFiberRefs: () => inheritFiberRefs2,
24606
24924
  ignoreLogged: () => ignoreLogged2,
24607
24925
  ignore: () => ignore2,
@@ -24643,8 +24961,8 @@ __export(exports_Effect, {
24643
24961
  fiberId: () => fiberId2,
24644
24962
  failSync: () => failSync2,
24645
24963
  failCauseSync: () => failCauseSync2,
24646
- failCause: () => failCause4,
24647
- fail: () => fail4,
24964
+ failCause: () => failCause7,
24965
+ fail: () => fail7,
24648
24966
  exit: () => exit2,
24649
24967
  exists: () => exists2,
24650
24968
  every: () => every5,
@@ -24716,7 +25034,7 @@ __export(exports_Effect, {
24716
25034
  allowInterrupt: () => allowInterrupt2,
24717
25035
  allWith: () => allWith2,
24718
25036
  allSuccesses: () => allSuccesses2,
24719
- all: () => all4,
25037
+ all: () => all6,
24720
25038
  addFinalizer: () => addFinalizer2,
24721
25039
  acquireUseRelease: () => acquireUseRelease2,
24722
25040
  acquireReleaseInterruptible: () => acquireReleaseInterruptible2,
@@ -24751,7 +25069,7 @@ function fnApply(options) {
24751
25069
  effect = x(effect, ...options.args);
24752
25070
  }
24753
25071
  } catch (error) {
24754
- effect = fnError ? failCause4(sequential(die(fnError), die(error))) : die3(error);
25072
+ effect = fnError ? failCause7(sequential(die(fnError), die(error))) : die3(error);
24755
25073
  }
24756
25074
  }
24757
25075
  let cache = false;
@@ -24785,8 +25103,8 @@ ${endStackCall}`;
24785
25103
  };
24786
25104
  return withSpan2(effect, options.spanName, opts);
24787
25105
  }
24788
- var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3, cachedFunction2, once3, all4, allWith2, allSuccesses2, dropUntil2, dropWhile2, takeUntil2, takeWhile2, every5, exists2, filter5, filterMap4, findFirst4, forEach5, head4, mergeAll5, partition4, reduce10, reduceWhile2, reduceRight3, reduceEffect3, replicate2, replicateEffect2, validateAll2, validateFirst2, async, asyncEffect2, custom2, withFiberRuntime2, fail4, failSync2, failCause4, failCauseSync2, die3, dieMessage2, dieSync2, gen2, never2, none9, promise2, succeed7, succeedNone2, succeedSome2, suspend3, sync4, _void, yieldNow4, _catch2, catchAll2, catchAllCause2, catchAllDefect2, catchIf2, catchSome2, catchSomeCause2, catchSomeDefect2, catchTag2, catchTags2, cause2, eventually2, ignore2, ignoreLogged2, parallelErrors2, sandbox2, retry, withExecutionPlan2, retryOrElse, try_2, tryMap2, tryMapPromise2, tryPromise2, unsandbox2, allowInterrupt2, checkInterruptible2, disconnect2, interrupt4, interruptWith2, interruptible4, interruptibleMask2, onInterrupt2, uninterruptible2, uninterruptibleMask3, liftPredicate2, as3, asSome2, asSomeError2, asVoid3, flip2, flipWith2, map11, mapAccum3, mapBoth3, mapError2, mapErrorCause2, merge6, negate2, acquireRelease2, acquireReleaseInterruptible2, acquireUseRelease2, addFinalizer2, ensuring3, onError2, onExit3, parallelFinalizers2, sequentialFinalizers2, finalizersMask2, scope2, scopeWith2, scopedWith2, scoped2, using2, withEarlyRelease2, awaitAllChildren2, daemonChildren2, descriptor2, descriptorWith2, diffFiberRefs2, ensuringChild2, ensuringChildren2, fiberId2, fiberIdWith2, fork3, forkDaemon2, forkAll2, forkIn2, forkScoped2, forkWithErrorHandler2, fromFiber2, fromFiberEffect2, supervised2, transplant2, withConcurrency2, withScheduler2, withSchedulingPriority2, withMaxOpsBeforeYield2, clock2, clockWith4, withClockScoped2, withClock2, console3, consoleWith2, withConsoleScoped2, withConsole2, delay2, sleep4, timed2, timedWith2, timeout2, timeoutOption2, timeoutFail2, timeoutFailCause2, timeoutTo2, configProviderWith2, withConfigProvider2, withConfigProviderScoped2, context3, contextWith2, contextWithEffect2, mapInputContext3, provide2, provideService3, provideServiceEffect2, serviceFunction2, serviceFunctionEffect2, serviceFunctions2, serviceConstants2, serviceMembers2, serviceOption2, serviceOptional2, updateService2, Do2, bind3, bindAll2, bindTo3, let_3, option2, either4, exit2, intoDeferred2, if_2, filterOrDie2, filterOrDieMessage2, filterOrElse2, filterOrFail2, filterEffectOrElse2, filterEffectOrFail2, unless2, unlessEffect2, when2, whenEffect2, whenFiberRef2, whenRef2, flatMap9, andThen4, flatten6, race2, raceAll2, raceFirst2, raceWith2, summarized2, tap2, tapBoth2, tapDefect2, tapError2, tapErrorTag2, tapErrorCause2, forever3, iterate2, loop2, repeat, repeatN2, repeatOrElse, schedule, scheduleForked2, scheduleFrom, whileLoop2, getFiberRefs, inheritFiberRefs2, locally, locallyWith, locallyScoped, locallyScopedWith, patchFiberRefs2, setFiberRefs2, updateFiberRefs2, isFailure2, isSuccess2, match10, matchCause2, matchCauseEffect3, matchEffect2, log2, logWithLevel2 = (level, ...message) => logWithLevel(level)(...message), logTrace2, logDebug2, logInfo2, logWarning2, logError2, logFatal2, withLogSpan2, annotateLogs2, annotateLogsScoped2, logAnnotations2, withUnhandledErrorLogLevel2, whenLogLevel2, orDie2, orDieWith2, orElse2, orElseFail2, orElseSucceed2, firstSuccessOf2, random3, randomWith2, withRandom2, withRandomFixed, withRandomScoped2, runtime3, getRuntimeFlags, patchRuntimeFlags, withRuntimeFlagsPatch, withRuntimeFlagsPatchScoped, tagMetrics2, labelMetrics2, tagMetricsScoped2, labelMetricsScoped2, metricLabels2, withMetric2, unsafeMakeSemaphore2, makeSemaphore2, unsafeMakeLatch2, makeLatch2, runFork2, runCallback, runPromise, runPromiseExit, runSync, runSyncExit, validate2, validateWith2, zip4, zipLeft3, zipRight3, zipWith4, ap, blocked2, runRequestBlock2, step3, request, cacheRequestResult, withRequestBatching2, withRequestCaching2, withRequestCache2, tracer2, tracerWith4, withTracer2, withTracerScoped2, withTracerEnabled2, withTracerTiming2, annotateSpans2, annotateCurrentSpan2, currentSpan2, currentPropagatedSpan2, currentParentSpan2, spanAnnotations2, spanLinks2, linkSpans2, linkSpanCurrent2, makeSpan2, makeSpanScoped2, useSpan2, withSpan2, functionWithSpan2, withSpanScoped2, withParentSpan2, fromNullable3, optionFromOptional2, transposeOption = (self2) => {
24789
- return isNone(self2) ? succeedNone2 : map11(self2.value, some);
25106
+ var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3, cachedFunction2, once3, all6, allWith2, allSuccesses2, dropUntil2, dropWhile2, takeUntil2, takeWhile2, every5, exists2, filter5, filterMap4, findFirst4, forEach5, head4, mergeAll5, partition4, reduce10, reduceWhile2, reduceRight3, reduceEffect3, replicate2, replicateEffect2, validateAll2, validateFirst2, async, asyncEffect2, custom2, withFiberRuntime2, fail7, failSync2, failCause7, failCauseSync2, die3, dieMessage2, dieSync2, gen2, never4, none9, promise2, succeed9, succeedNone2, succeedSome2, suspend3, sync4, _void, yieldNow4, _catch2, catchAll2, catchAllCause2, catchAllDefect2, catchIf2, catchSome2, catchSomeCause2, catchSomeDefect2, catchTag2, catchTags2, cause2, eventually2, ignore2, ignoreLogged2, parallelErrors2, sandbox2, retry, withExecutionPlan2, retryOrElse, try_2, tryMap2, tryMapPromise2, tryPromise2, unsandbox2, allowInterrupt2, checkInterruptible2, disconnect2, interrupt6, interruptWith2, interruptible4, interruptibleMask2, onInterrupt2, uninterruptible2, uninterruptibleMask3, liftPredicate2, as3, asSome2, asSomeError2, asVoid3, flip2, flipWith2, map13, mapAccum3, mapBoth3, mapError2, mapErrorCause2, merge6, negate2, acquireRelease2, acquireReleaseInterruptible2, acquireUseRelease2, addFinalizer2, ensuring3, onError2, onExit3, parallelFinalizers2, sequentialFinalizers2, finalizersMask2, scope2, scopeWith2, scopedWith2, scoped3, using2, withEarlyRelease2, awaitAllChildren2, daemonChildren2, descriptor2, descriptorWith2, diffFiberRefs2, ensuringChild2, ensuringChildren2, fiberId2, fiberIdWith2, fork3, forkDaemon2, forkAll2, forkIn2, forkScoped2, forkWithErrorHandler2, fromFiber2, fromFiberEffect2, supervised2, transplant2, withConcurrency2, withScheduler2, withSchedulingPriority2, withMaxOpsBeforeYield2, clock2, clockWith4, withClockScoped2, withClock2, console3, consoleWith2, withConsoleScoped2, withConsole2, delay2, sleep4, timed2, timedWith2, timeout2, timeoutOption2, timeoutFail2, timeoutFailCause2, timeoutTo2, configProviderWith2, withConfigProvider2, withConfigProviderScoped2, context3, contextWith2, contextWithEffect2, mapInputContext3, provide2, provideService3, provideServiceEffect2, serviceFunction2, serviceFunctionEffect2, serviceFunctions2, serviceConstants2, serviceMembers2, serviceOption2, serviceOptional2, updateService2, Do2, bind3, bindAll2, bindTo3, let_3, option2, either4, exit2, intoDeferred2, if_2, filterOrDie2, filterOrDieMessage2, filterOrElse2, filterOrFail2, filterEffectOrElse2, filterEffectOrFail2, unless2, unlessEffect2, when2, whenEffect2, whenFiberRef2, whenRef2, flatMap9, andThen4, flatten6, race2, raceAll2, raceFirst2, raceWith2, summarized2, tap2, tapBoth2, tapDefect2, tapError2, tapErrorTag2, tapErrorCause2, forever3, iterate2, loop2, repeat, repeatN2, repeatOrElse, schedule, scheduleForked2, scheduleFrom, whileLoop2, getFiberRefs, inheritFiberRefs2, locally, locallyWith, locallyScoped, locallyScopedWith, patchFiberRefs2, setFiberRefs2, updateFiberRefs2, isFailure2, isSuccess3, match13, matchCause2, matchCauseEffect3, matchEffect2, log2, logWithLevel2 = (level, ...message) => logWithLevel(level)(...message), logTrace2, logDebug2, logInfo2, logWarning2, logError2, logFatal2, withLogSpan2, annotateLogs2, annotateLogsScoped2, logAnnotations2, withUnhandledErrorLogLevel2, whenLogLevel2, orDie2, orDieWith2, orElse4, orElseFail2, orElseSucceed2, firstSuccessOf2, random3, randomWith2, withRandom2, withRandomFixed, withRandomScoped2, runtime3, getRuntimeFlags, patchRuntimeFlags, withRuntimeFlagsPatch, withRuntimeFlagsPatchScoped, tagMetrics2, labelMetrics2, tagMetricsScoped2, labelMetricsScoped2, metricLabels2, withMetric2, unsafeMakeSemaphore2, makeSemaphore2, unsafeMakeLatch2, makeLatch2, runFork2, runCallback, runPromise, runPromiseExit, runSync, runSyncExit, validate2, validateWith2, zip5, zipLeft4, zipRight4, zipWith6, ap, blocked2, runRequestBlock2, step3, request, cacheRequestResult, withRequestBatching2, withRequestCaching2, withRequestCache2, tracer2, tracerWith4, withTracer2, withTracerScoped2, withTracerEnabled2, withTracerTiming2, annotateSpans2, annotateCurrentSpan2, currentSpan2, currentPropagatedSpan2, currentParentSpan2, spanAnnotations2, spanLinks2, linkSpans2, linkSpanCurrent2, makeSpan2, makeSpanScoped2, useSpan2, withSpan2, functionWithSpan2, withSpanScoped2, withParentSpan2, fromNullable3, optionFromOptional2, transposeOption = (self2) => {
25107
+ return isNone(self2) ? succeedNone2 : map13(self2.value, some);
24790
25108
  }, transposeMapOption, makeTagProxy = (TagClass) => {
24791
25109
  const cache = new Map;
24792
25110
  return new Proxy(TagClass, {
@@ -24819,14 +25137,14 @@ var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3,
24819
25137
  return fn;
24820
25138
  }
24821
25139
  });
24822
- }, Tag2 = (id) => () => {
25140
+ }, Tag2 = (id3) => () => {
24823
25141
  const limit = Error.stackTraceLimit;
24824
25142
  Error.stackTraceLimit = 2;
24825
25143
  const creationError = new Error;
24826
25144
  Error.stackTraceLimit = limit;
24827
25145
  function TagClass() {}
24828
25146
  Object.setPrototypeOf(TagClass, TagProto);
24829
- TagClass.key = id;
25147
+ TagClass.key = id3;
24830
25148
  Object.defineProperty(TagClass, "use", {
24831
25149
  get() {
24832
25150
  return (body) => andThen2(this, body);
@@ -24840,7 +25158,7 @@ var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3,
24840
25158
  return makeTagProxy(TagClass);
24841
25159
  }, Service = function() {
24842
25160
  return function() {
24843
- const [id, maker] = arguments;
25161
+ const [id3, maker] = arguments;
24844
25162
  const proxy = "accessors" in maker ? maker["accessors"] : false;
24845
25163
  const limit = Error.stackTraceLimit;
24846
25164
  Error.stackTraceLimit = 2;
@@ -24865,7 +25183,7 @@ var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3,
24865
25183
  return service;
24866
25184
  }
24867
25185
  };
24868
- TagClass.prototype._tag = id;
25186
+ TagClass.prototype._tag = id3;
24869
25187
  Object.defineProperty(TagClass, "make", {
24870
25188
  get() {
24871
25189
  return (service) => new this(service);
@@ -24876,7 +25194,7 @@ var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3,
24876
25194
  return (body) => andThen2(this, body);
24877
25195
  }
24878
25196
  });
24879
- TagClass.key = id;
25197
+ TagClass.key = id3;
24880
25198
  Object.assign(TagClass, TagProto);
24881
25199
  Object.defineProperty(TagClass, "stack", {
24882
25200
  get() {
@@ -24893,10 +25211,10 @@ var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3,
24893
25211
  get() {
24894
25212
  if (isFunction3) {
24895
25213
  return function() {
24896
- return fromEffect2(TagClass, map11(maker.effect.apply(null, arguments), (_) => new this(_)));
25214
+ return fromEffect4(TagClass, map13(maker.effect.apply(null, arguments), (_) => new this(_)));
24897
25215
  }.bind(this);
24898
25216
  }
24899
- return layerCache ??= fromEffect2(TagClass, map11(maker.effect, (_) => new this(_)));
25217
+ return layerCache ??= fromEffect4(TagClass, map13(maker.effect, (_) => new this(_)));
24900
25218
  }
24901
25219
  });
24902
25220
  } else if ("scoped" in maker) {
@@ -24905,10 +25223,10 @@ var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3,
24905
25223
  get() {
24906
25224
  if (isFunction3) {
24907
25225
  return function() {
24908
- return scoped(TagClass, map11(maker.scoped.apply(null, arguments), (_) => new this(_)));
25226
+ return scoped2(TagClass, map13(maker.scoped.apply(null, arguments), (_) => new this(_)));
24909
25227
  }.bind(this);
24910
25228
  }
24911
- return layerCache ??= scoped(TagClass, map11(maker.scoped, (_) => new this(_)));
25229
+ return layerCache ??= scoped2(TagClass, map13(maker.scoped, (_) => new this(_)));
24912
25230
  }
24913
25231
  });
24914
25232
  } else if ("sync" in maker) {
@@ -24920,7 +25238,7 @@ var EffectTypeId3, isEffect2, cachedWithTTL, cachedInvalidateWithTTL2, cached3,
24920
25238
  } else {
24921
25239
  Object.defineProperty(TagClass, layerName, {
24922
25240
  get() {
24923
- return layerCache ??= succeed4(TagClass, new this(maker.succeed));
25241
+ return layerCache ??= succeed6(TagClass, new this(maker.succeed));
24924
25242
  }
24925
25243
  });
24926
25244
  }
@@ -25013,7 +25331,7 @@ var init_Effect = __esm(() => {
25013
25331
  cached3 = memoize;
25014
25332
  cachedFunction2 = cachedFunction;
25015
25333
  once3 = once;
25016
- all4 = all3;
25334
+ all6 = all4;
25017
25335
  allWith2 = allWith;
25018
25336
  allSuccesses2 = allSuccesses;
25019
25337
  dropUntil2 = dropUntil;
@@ -25041,18 +25359,18 @@ var init_Effect = __esm(() => {
25041
25359
  asyncEffect2 = asyncEffect;
25042
25360
  custom2 = custom;
25043
25361
  withFiberRuntime2 = withFiberRuntime;
25044
- fail4 = fail2;
25362
+ fail7 = fail2;
25045
25363
  failSync2 = failSync;
25046
- failCause4 = failCause;
25364
+ failCause7 = failCause;
25047
25365
  failCauseSync2 = failCauseSync;
25048
25366
  die3 = die2;
25049
25367
  dieMessage2 = dieMessage;
25050
25368
  dieSync2 = dieSync;
25051
25369
  gen2 = gen;
25052
- never2 = never;
25370
+ never4 = never;
25053
25371
  none9 = none6;
25054
25372
  promise2 = promise;
25055
- succeed7 = succeed;
25373
+ succeed9 = succeed;
25056
25374
  succeedNone2 = succeedNone;
25057
25375
  succeedSome2 = succeedSome;
25058
25376
  suspend3 = suspend;
@@ -25086,7 +25404,7 @@ var init_Effect = __esm(() => {
25086
25404
  allowInterrupt2 = allowInterrupt;
25087
25405
  checkInterruptible2 = checkInterruptible;
25088
25406
  disconnect2 = disconnect;
25089
- interrupt4 = interrupt2;
25407
+ interrupt6 = interrupt2;
25090
25408
  interruptWith2 = interruptWith;
25091
25409
  interruptible4 = interruptible2;
25092
25410
  interruptibleMask2 = interruptibleMask;
@@ -25100,7 +25418,7 @@ var init_Effect = __esm(() => {
25100
25418
  asVoid3 = asVoid;
25101
25419
  flip2 = flip;
25102
25420
  flipWith2 = flipWith;
25103
- map11 = map9;
25421
+ map13 = map9;
25104
25422
  mapAccum3 = mapAccum2;
25105
25423
  mapBoth3 = mapBoth;
25106
25424
  mapError2 = mapError;
@@ -25120,7 +25438,7 @@ var init_Effect = __esm(() => {
25120
25438
  scope2 = scope;
25121
25439
  scopeWith2 = scopeWith;
25122
25440
  scopedWith2 = scopedWith;
25123
- scoped2 = scopedEffect;
25441
+ scoped3 = scopedEffect;
25124
25442
  using2 = using;
25125
25443
  withEarlyRelease2 = withEarlyRelease;
25126
25444
  awaitAllChildren2 = awaitAllChildren;
@@ -25237,8 +25555,8 @@ var init_Effect = __esm(() => {
25237
25555
  setFiberRefs2 = setFiberRefs;
25238
25556
  updateFiberRefs2 = updateFiberRefs;
25239
25557
  isFailure2 = isFailure;
25240
- isSuccess2 = isSuccess;
25241
- match10 = match8;
25558
+ isSuccess3 = isSuccess;
25559
+ match13 = match8;
25242
25560
  matchCause2 = matchCause;
25243
25561
  matchCauseEffect3 = matchCauseEffect;
25244
25562
  matchEffect2 = matchEffect;
@@ -25257,7 +25575,7 @@ var init_Effect = __esm(() => {
25257
25575
  whenLogLevel2 = whenLogLevel;
25258
25576
  orDie2 = orDie;
25259
25577
  orDieWith2 = orDieWith;
25260
- orElse2 = orElse;
25578
+ orElse4 = orElse;
25261
25579
  orElseFail2 = orElseFail;
25262
25580
  orElseSucceed2 = orElseSucceed;
25263
25581
  firstSuccessOf2 = firstSuccessOf;
@@ -25289,11 +25607,11 @@ var init_Effect = __esm(() => {
25289
25607
  runSyncExit = unsafeRunSyncExitEffect;
25290
25608
  validate2 = validate;
25291
25609
  validateWith2 = validateWith;
25292
- zip4 = zipOptions;
25293
- zipLeft3 = zipLeftOptions;
25294
- zipRight3 = zipRightOptions;
25295
- zipWith4 = zipWithOptions;
25296
- ap = /* @__PURE__ */ dual(2, (self2, that) => zipWith4(self2, that, (f, a) => f(a)));
25610
+ zip5 = zipOptions;
25611
+ zipLeft4 = zipLeftOptions;
25612
+ zipRight4 = zipRightOptions;
25613
+ zipWith6 = zipWithOptions;
25614
+ ap = /* @__PURE__ */ dual(2, (self2, that) => zipWith6(self2, that, (f, a) => f(a)));
25297
25615
  blocked2 = blocked;
25298
25616
  runRequestBlock2 = runRequestBlock;
25299
25617
  step3 = step2;
@@ -25326,16 +25644,16 @@ var init_Effect = __esm(() => {
25326
25644
  withParentSpan2 = withParentSpan;
25327
25645
  fromNullable3 = fromNullable2;
25328
25646
  optionFromOptional2 = optionFromOptional;
25329
- transposeMapOption = /* @__PURE__ */ dual(2, (self2, f) => isNone(self2) ? succeedNone2 : map11(f(self2.value), some));
25647
+ transposeMapOption = /* @__PURE__ */ dual(2, (self2, f) => isNone(self2) ? succeedNone2 : map13(f(self2.value), some));
25330
25648
  fnUntraced2 = fnUntraced;
25331
25649
  });
25332
25650
 
25333
25651
  // ../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/esm/Schedule.js
25334
25652
  var exports_Schedule = {};
25335
25653
  __export(exports_Schedule, {
25336
- zipWith: () => zipWith5,
25337
- zipRight: () => zipRight4,
25338
- zipLeft: () => zipLeft4,
25654
+ zipWith: () => zipWith7,
25655
+ zipRight: () => zipRight5,
25656
+ zipLeft: () => zipLeft5,
25339
25657
  windowed: () => windowed2,
25340
25658
  whileOutputEffect: () => whileOutputEffect2,
25341
25659
  whileOutput: () => whileOutput2,
@@ -25352,7 +25670,7 @@ __export(exports_Schedule, {
25352
25670
  tapOutput: () => tapOutput2,
25353
25671
  tapInput: () => tapInput2,
25354
25672
  sync: () => sync5,
25355
- succeed: () => succeed8,
25673
+ succeed: () => succeed10,
25356
25674
  stop: () => stop2,
25357
25675
  spaced: () => spaced2,
25358
25676
  secondOfMinute: () => secondOfMinute2,
@@ -25381,10 +25699,10 @@ __export(exports_Schedule, {
25381
25699
  mapInputEffect: () => mapInputEffect2,
25382
25700
  mapInputContext: () => mapInputContext4,
25383
25701
  mapInput: () => mapInput4,
25384
- mapEffect: () => mapEffect2,
25702
+ mapEffect: () => mapEffect4,
25385
25703
  mapBothEffect: () => mapBothEffect2,
25386
25704
  mapBoth: () => mapBoth4,
25387
- map: () => map12,
25705
+ map: () => map14,
25388
25706
  makeWithState: () => makeWithState2,
25389
25707
  linear: () => linear2,
25390
25708
  jitteredWith: () => jitteredWith2,
@@ -25435,7 +25753,7 @@ __export(exports_Schedule, {
25435
25753
  ScheduleDriverTypeId: () => ScheduleDriverTypeId2,
25436
25754
  CurrentIterationMetadata: () => CurrentIterationMetadata2
25437
25755
  });
25438
- var ScheduleTypeId2, ScheduleDriverTypeId2, makeWithState2, isSchedule2, addDelay2, addDelayEffect2, andThen5, andThenEither2, as4, asVoid4, bothInOut2, check2, checkEffect2, collectAllInputs2, collectAllOutputs2, collectUntil2, collectUntilEffect2, collectWhile2, collectWhileEffect2, compose2, mapInput4, mapInputEffect2, mapInputContext4, count2, cron2, secondOfMinute2, minuteOfHour2, hourOfDay2, dayOfMonth2, dayOfWeek2, delayed2, delayedEffect2, delayedSchedule2, delays2, mapBoth4, mapBothEffect2, driver2, duration2, either5, eitherWith2, elapsed2, ensuring4, exponential3, fibonacci2, fixed4, forever4, fromDelay2, fromDelays2, fromFunction2, identity3, passthrough2, intersect6, intersectWith2, jittered2, jitteredWith2, linear2, map12, mapEffect2, modifyDelay2, modifyDelayEffect2, onDecision2, once4, provideContext4, provideService4, recurUntil2, recurUntilEffect2, recurUntilOption2, recurUpTo2, recurWhile2, recurWhileEffect2, recurs2, reduce11, reduceEffect4, repeatForever, repetitions2, resetAfter2, resetWhen2, run2, spaced2, stop2, succeed8, sync5, tapInput2, tapOutput2, unfold3, union9, unionWith3, untilInput2, untilInputEffect2, untilOutput2, untilOutputEffect2, upTo2, whileInput2, whileInputEffect2, whileOutput2, whileOutputEffect2, windowed2, zipLeft4, zipRight4, zipWith5, CurrentIterationMetadata2;
25756
+ var ScheduleTypeId2, ScheduleDriverTypeId2, makeWithState2, isSchedule2, addDelay2, addDelayEffect2, andThen5, andThenEither2, as4, asVoid4, bothInOut2, check2, checkEffect2, collectAllInputs2, collectAllOutputs2, collectUntil2, collectUntilEffect2, collectWhile2, collectWhileEffect2, compose2, mapInput4, mapInputEffect2, mapInputContext4, count2, cron2, secondOfMinute2, minuteOfHour2, hourOfDay2, dayOfMonth2, dayOfWeek2, delayed2, delayedEffect2, delayedSchedule2, delays2, mapBoth4, mapBothEffect2, driver2, duration2, either5, eitherWith2, elapsed2, ensuring4, exponential3, fibonacci2, fixed4, forever4, fromDelay2, fromDelays2, fromFunction2, identity3, passthrough2, intersect6, intersectWith2, jittered2, jitteredWith2, linear2, map14, mapEffect4, modifyDelay2, modifyDelayEffect2, onDecision2, once4, provideContext4, provideService4, recurUntil2, recurUntilEffect2, recurUntilOption2, recurUpTo2, recurWhile2, recurWhileEffect2, recurs2, reduce11, reduceEffect4, repeatForever, repetitions2, resetAfter2, resetWhen2, run2, spaced2, stop2, succeed10, sync5, tapInput2, tapOutput2, unfold3, union9, unionWith3, untilInput2, untilInputEffect2, untilOutput2, untilOutputEffect2, upTo2, whileInput2, whileInputEffect2, whileOutput2, whileOutputEffect2, windowed2, zipLeft5, zipRight5, zipWith7, CurrentIterationMetadata2;
25439
25757
  var init_Schedule = __esm(() => {
25440
25758
  init_schedule();
25441
25759
  ScheduleTypeId2 = ScheduleTypeId;
@@ -25494,8 +25812,8 @@ var init_Schedule = __esm(() => {
25494
25812
  jittered2 = jittered;
25495
25813
  jitteredWith2 = jitteredWith;
25496
25814
  linear2 = linear;
25497
- map12 = map10;
25498
- mapEffect2 = mapEffect;
25815
+ map14 = map12;
25816
+ mapEffect4 = mapEffect3;
25499
25817
  modifyDelay2 = modifyDelay;
25500
25818
  modifyDelayEffect2 = modifyDelayEffect;
25501
25819
  onDecision2 = onDecision;
@@ -25518,7 +25836,7 @@ var init_Schedule = __esm(() => {
25518
25836
  run2 = run;
25519
25837
  spaced2 = spaced;
25520
25838
  stop2 = stop;
25521
- succeed8 = succeed5;
25839
+ succeed10 = succeed7;
25522
25840
  sync5 = sync3;
25523
25841
  tapInput2 = tapInput;
25524
25842
  tapOutput2 = tapOutput;
@@ -25535,9 +25853,9 @@ var init_Schedule = __esm(() => {
25535
25853
  whileOutput2 = whileOutput;
25536
25854
  whileOutputEffect2 = whileOutputEffect;
25537
25855
  windowed2 = windowed;
25538
- zipLeft4 = zipLeft2;
25539
- zipRight4 = zipRight2;
25540
- zipWith5 = zipWith3;
25856
+ zipLeft5 = zipLeft3;
25857
+ zipRight5 = zipRight3;
25858
+ zipWith7 = zipWith5;
25541
25859
  CurrentIterationMetadata2 = CurrentIterationMetadata;
25542
25860
  });
25543
25861
 
@@ -25545,6 +25863,7 @@ var init_Schedule = __esm(() => {
25545
25863
  var init_esm = __esm(() => {
25546
25864
  init_Duration();
25547
25865
  init_Effect();
25866
+ init_Fiber();
25548
25867
  init_Schedule();
25549
25868
  });
25550
25869
 
@@ -25661,12 +25980,12 @@ class BaseCLIAgentService {
25661
25980
  if (outcome._tag !== "Output")
25662
25981
  return null;
25663
25982
  const output = outcome.stdout.trim();
25664
- const match11 = output.match(/v?(\d+)\.(\d+)\.(\d+)/);
25665
- if (!match11)
25983
+ const match14 = output.match(/v?(\d+)\.(\d+)\.(\d+)/);
25984
+ if (!match14)
25666
25985
  return null;
25667
25986
  return {
25668
- version: `${match11[1]}.${match11[2]}.${match11[3]}`,
25669
- major: parseInt(match11[1], 10)
25987
+ version: `${match14[1]}.${match14[2]}.${match14[3]}`,
25988
+ major: parseInt(match14[1], 10)
25670
25989
  };
25671
25990
  }
25672
25991
  async runListCommand(harnessName, command, options) {
@@ -26579,8 +26898,8 @@ var init_copilot = __esm(() => {
26579
26898
  function registerHarness(service) {
26580
26899
  registry.set(service.id, service);
26581
26900
  }
26582
- function getHarness(id) {
26583
- return registry.get(id);
26901
+ function getHarness(id3) {
26902
+ return registry.get(id3);
26584
26903
  }
26585
26904
  function getAllHarnesses() {
26586
26905
  return [...registry.values()];
@@ -26838,8 +27157,8 @@ var createSseClient = ({ onSseError, onSseEvent, responseTransformer, responseVa
26838
27157
  signal.addEventListener("abort", abortHandler);
26839
27158
  try {
26840
27159
  while (true) {
26841
- const { done: done7, value } = await reader.read();
26842
- if (done7)
27160
+ const { done: done9, value } = await reader.read();
27161
+ if (done9)
26843
27162
  break;
26844
27163
  buffer += value;
26845
27164
  const chunks = buffer.split(`
@@ -27041,9 +27360,9 @@ var PATH_PARAM_RE, defaultPathSerializer = ({ path, url: _url }) => {
27041
27360
  let url = _url;
27042
27361
  const matches = _url.match(PATH_PARAM_RE);
27043
27362
  if (matches) {
27044
- for (const match11 of matches) {
27363
+ for (const match14 of matches) {
27045
27364
  let explode = false;
27046
- let name = match11.substring(1, match11.length - 1);
27365
+ let name = match14.substring(1, match14.length - 1);
27047
27366
  let style = "simple";
27048
27367
  if (name.endsWith("*")) {
27049
27368
  explode = true;
@@ -27061,11 +27380,11 @@ var PATH_PARAM_RE, defaultPathSerializer = ({ path, url: _url }) => {
27061
27380
  continue;
27062
27381
  }
27063
27382
  if (Array.isArray(value)) {
27064
- url = url.replace(match11, serializeArrayParam({ explode, name, style, value }));
27383
+ url = url.replace(match14, serializeArrayParam({ explode, name, style, value }));
27065
27384
  continue;
27066
27385
  }
27067
27386
  if (typeof value === "object") {
27068
- url = url.replace(match11, serializeObjectParam({
27387
+ url = url.replace(match14, serializeObjectParam({
27069
27388
  explode,
27070
27389
  name,
27071
27390
  style,
@@ -27075,14 +27394,14 @@ var PATH_PARAM_RE, defaultPathSerializer = ({ path, url: _url }) => {
27075
27394
  continue;
27076
27395
  }
27077
27396
  if (style === "matrix") {
27078
- url = url.replace(match11, `;${serializePrimitiveParam({
27397
+ url = url.replace(match14, `;${serializePrimitiveParam({
27079
27398
  name,
27080
27399
  value
27081
27400
  })}`);
27082
27401
  continue;
27083
27402
  }
27084
27403
  const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
27085
- url = url.replace(match11, replaceValue);
27404
+ url = url.replace(match14, replaceValue);
27086
27405
  }
27087
27406
  }
27088
27407
  return url;
@@ -27114,28 +27433,28 @@ class Interceptors {
27114
27433
  clear() {
27115
27434
  this._fns = [];
27116
27435
  }
27117
- getInterceptorIndex(id) {
27118
- if (typeof id === "number") {
27119
- return this._fns[id] ? id : -1;
27436
+ getInterceptorIndex(id3) {
27437
+ if (typeof id3 === "number") {
27438
+ return this._fns[id3] ? id3 : -1;
27120
27439
  } else {
27121
- return this._fns.indexOf(id);
27440
+ return this._fns.indexOf(id3);
27122
27441
  }
27123
27442
  }
27124
- exists(id) {
27125
- const index = this.getInterceptorIndex(id);
27443
+ exists(id3) {
27444
+ const index = this.getInterceptorIndex(id3);
27126
27445
  return !!this._fns[index];
27127
27446
  }
27128
- eject(id) {
27129
- const index = this.getInterceptorIndex(id);
27447
+ eject(id3) {
27448
+ const index = this.getInterceptorIndex(id3);
27130
27449
  if (this._fns[index]) {
27131
27450
  this._fns[index] = null;
27132
27451
  }
27133
27452
  }
27134
- update(id, fn2) {
27135
- const index = this.getInterceptorIndex(id);
27453
+ update(id3, fn2) {
27454
+ const index = this.getInterceptorIndex(id3);
27136
27455
  if (this._fns[index]) {
27137
27456
  this._fns[index] = fn2;
27138
- return id;
27457
+ return id3;
27139
27458
  } else {
27140
27459
  return false;
27141
27460
  }
@@ -28487,11 +28806,11 @@ var require_shebang_regex = __commonJS((exports, module) => {
28487
28806
  var require_shebang_command = __commonJS((exports, module) => {
28488
28807
  var shebangRegex = require_shebang_regex();
28489
28808
  module.exports = (string2 = "") => {
28490
- const match11 = string2.match(shebangRegex);
28491
- if (!match11) {
28809
+ const match14 = string2.match(shebangRegex);
28810
+ if (!match14) {
28492
28811
  return null;
28493
28812
  }
28494
- const [path, argument] = match11[0].replace(/#! ?/, "").split(" ");
28813
+ const [path, argument] = match14[0].replace(/#! ?/, "").split(" ");
28495
28814
  const binary = path.split("/").pop();
28496
28815
  if (binary === "env") {
28497
28816
  return argument;
@@ -28604,14 +28923,14 @@ var require_enoent = __commonJS((exports, module) => {
28604
28923
  return originalEmit.apply(cp, arguments);
28605
28924
  };
28606
28925
  }
28607
- function verifyENOENT(status, parsed) {
28608
- if (isWin && status === 1 && !parsed.file) {
28926
+ function verifyENOENT(status3, parsed) {
28927
+ if (isWin && status3 === 1 && !parsed.file) {
28609
28928
  return notFoundError(parsed.original, "spawn");
28610
28929
  }
28611
28930
  return null;
28612
28931
  }
28613
- function verifyENOENTSync(status, parsed) {
28614
- if (isWin && status === 1 && !parsed.file) {
28932
+ function verifyENOENTSync(status3, parsed) {
28933
+ if (isWin && status3 === 1 && !parsed.file) {
28615
28934
  return notFoundError(parsed.original, "spawnSync");
28616
28935
  }
28617
28936
  return null;
@@ -28723,10 +29042,10 @@ async function waitForListeningUrl(child, options) {
28723
29042
  };
28724
29043
  const tryMatch = (key, chunk2) => {
28725
29044
  buffers[key] += typeof chunk2 === "string" ? chunk2 : chunk2.toString("utf8");
28726
- const match11 = buffers[key].match(LISTENING_URL_RE);
28727
- if (match11) {
29045
+ const match14 = buffers[key].match(LISTENING_URL_RE);
29046
+ if (match14) {
28728
29047
  cleanup();
28729
- resolve(match11[1]);
29048
+ resolve(match14[1]);
28730
29049
  return;
28731
29050
  }
28732
29051
  const lastNl = buffers[key].lastIndexOf(`
@@ -28956,12 +29275,12 @@ function startSessionEventForwarder(client4, options) {
28956
29275
  // src/infrastructure/services/remote-agents/opencode-sdk/session-metadata-store.ts
28957
29276
  import { existsSync, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
28958
29277
  import { homedir as homedir2 } from "node:os";
28959
- import { dirname as dirname2, join as join5 } from "node:path";
29278
+ import { dirname as dirname2, join as join6 } from "node:path";
28960
29279
 
28961
29280
  class FileSessionMetadataStore {
28962
29281
  filePath;
28963
29282
  constructor(filePath) {
28964
- this.filePath = filePath ?? join5(homedir2(), ".chatroom", "opencode-sdk-sessions.json");
29283
+ this.filePath = filePath ?? join6(homedir2(), ".chatroom", "opencode-sdk-sessions.json");
28965
29284
  }
28966
29285
  load() {
28967
29286
  try {
@@ -29259,13 +29578,13 @@ async function detectAvailableHarnesses() {
29259
29578
  const program2 = exports_Effect.forEach(services, detectOne, { concurrency: "unbounded" });
29260
29579
  const results = await exports_Effect.runPromise(program2);
29261
29580
  const installed = [];
29262
- for (const { id, result } of results) {
29581
+ for (const { id: id3, result } of results) {
29263
29582
  if (isInstalled(result)) {
29264
- installed.push(id);
29583
+ installed.push(id3);
29265
29584
  } else if (isDetectionError(result)) {
29266
29585
  console.warn(JSON.stringify({
29267
29586
  event: "harness-detection-error",
29268
- harness: id,
29587
+ harness: id3,
29269
29588
  reason: result.reason,
29270
29589
  attempts: result.attempts
29271
29590
  }));
@@ -29287,16 +29606,16 @@ var MACHINE_CONFIG_VERSION = "1";
29287
29606
  import { randomUUID } from "node:crypto";
29288
29607
  import * as fs2 from "node:fs/promises";
29289
29608
  import { homedir as homedir3, hostname as hostname2 } from "node:os";
29290
- import { join as join6 } from "node:path";
29609
+ import { join as join7 } from "node:path";
29291
29610
  function chatroomConfigDir() {
29292
- return join6(homedir3(), ".chatroom");
29611
+ return join7(homedir3(), ".chatroom");
29293
29612
  }
29294
29613
  async function ensureConfigDir2() {
29295
29614
  const dir = chatroomConfigDir();
29296
29615
  await fs2.mkdir(dir, { recursive: true, mode: 448 });
29297
29616
  }
29298
29617
  function getMachineConfigPath() {
29299
- return join6(chatroomConfigDir(), MACHINE_FILE);
29618
+ return join7(chatroomConfigDir(), MACHINE_FILE);
29300
29619
  }
29301
29620
  async function loadConfigFile() {
29302
29621
  const configPath = getMachineConfigPath();
@@ -29388,7 +29707,7 @@ var init_storage2 = __esm(() => {
29388
29707
  // src/infrastructure/machine/daemon-state.ts
29389
29708
  import * as fs3 from "node:fs/promises";
29390
29709
  import { homedir as homedir4 } from "node:os";
29391
- import { join as join7 } from "node:path";
29710
+ import { join as join8 } from "node:path";
29392
29711
  function agentKey(chatroomId, role) {
29393
29712
  return `${chatroomId}/${role}`;
29394
29713
  }
@@ -29396,7 +29715,7 @@ async function ensureStateDir() {
29396
29715
  await fs3.mkdir(STATE_DIR, { recursive: true, mode: 448 });
29397
29716
  }
29398
29717
  function stateFilePath(machineId) {
29399
- return join7(STATE_DIR, `${machineId}.json`);
29718
+ return join8(STATE_DIR, `${machineId}.json`);
29400
29719
  }
29401
29720
  async function loadDaemonState(machineId) {
29402
29721
  const filePath = stateFilePath(machineId);
@@ -29478,8 +29797,8 @@ async function loadEventCursor(machineId) {
29478
29797
  }
29479
29798
  var CHATROOM_DIR2, STATE_DIR, STATE_VERSION = "1";
29480
29799
  var init_daemon_state = __esm(() => {
29481
- CHATROOM_DIR2 = join7(homedir4(), ".chatroom");
29482
- STATE_DIR = join7(CHATROOM_DIR2, "machines", "state");
29800
+ CHATROOM_DIR2 = join8(homedir4(), ".chatroom");
29801
+ STATE_DIR = join8(CHATROOM_DIR2, "machines", "state");
29483
29802
  });
29484
29803
 
29485
29804
  // src/infrastructure/machine/index.ts
@@ -29852,9 +30171,9 @@ var init_init = __esm(() => {
29852
30171
  });
29853
30172
 
29854
30173
  // src/tools/output.ts
29855
- import { join as join8 } from "node:path";
30174
+ import { join as join9 } from "node:path";
29856
30175
  function resolveChatroomDir(workingDir) {
29857
- return join8(workingDir, CHATROOM_DIR3);
30176
+ return join9(workingDir, CHATROOM_DIR3);
29858
30177
  }
29859
30178
  async function ensureChatroomDir(deps, workingDir) {
29860
30179
  const dir = resolveChatroomDir(workingDir);
@@ -29862,7 +30181,7 @@ async function ensureChatroomDir(deps, workingDir) {
29862
30181
  return dir;
29863
30182
  }
29864
30183
  async function ensureGitignore(deps, workingDir) {
29865
- const gitignorePath = join8(workingDir, ".gitignore");
30184
+ const gitignorePath = join9(workingDir, ".gitignore");
29866
30185
  const entry = CHATROOM_DIR3;
29867
30186
  let content = "";
29868
30187
  try {
@@ -29892,7 +30211,7 @@ function formatOutputTimestamp(date = new Date) {
29892
30211
  function generateOutputPath(workingDir, toolName, extension, date) {
29893
30212
  const timestamp = formatOutputTimestamp(date);
29894
30213
  const filename = `${toolName}-${timestamp}.${extension}`;
29895
- return join8(resolveChatroomDir(workingDir), filename);
30214
+ return join9(resolveChatroomDir(workingDir), filename);
29896
30215
  }
29897
30216
  var CHATROOM_DIR3 = ".chatroom";
29898
30217
  var init_output = () => {};
@@ -30958,12 +31277,12 @@ var init_index_esm = __esm(() => {
30958
31277
  var dependenciesFulfilled = null;
30959
31278
  var runDependencyTracking = {};
30960
31279
  var runDependencyWatcher = null;
30961
- function addRunDependency(id) {
31280
+ function addRunDependency(id3) {
30962
31281
  runDependencies++;
30963
31282
  Module["monitorRunDependencies"]?.(runDependencies);
30964
- if (id) {
30965
- assert(!runDependencyTracking[id]);
30966
- runDependencyTracking[id] = 1;
31283
+ if (id3) {
31284
+ assert(!runDependencyTracking[id3]);
31285
+ runDependencyTracking[id3] = 1;
30967
31286
  if (runDependencyWatcher === null && typeof setInterval != "undefined") {
30968
31287
  runDependencyWatcher = setInterval(() => {
30969
31288
  if (ABORT) {
@@ -30988,12 +31307,12 @@ var init_index_esm = __esm(() => {
30988
31307
  err("warning: run dependency added without ID");
30989
31308
  }
30990
31309
  }
30991
- function removeRunDependency(id) {
31310
+ function removeRunDependency(id3) {
30992
31311
  runDependencies--;
30993
31312
  Module["monitorRunDependencies"]?.(runDependencies);
30994
- if (id) {
30995
- assert(runDependencyTracking[id]);
30996
- delete runDependencyTracking[id];
31313
+ if (id3) {
31314
+ assert(runDependencyTracking[id3]);
31315
+ delete runDependencyTracking[id3];
30997
31316
  } else {
30998
31317
  err("warning: run dependency removed without ID");
30999
31318
  }
@@ -31391,8 +31710,7 @@ var init_index_esm = __esm(() => {
31391
31710
  result += `
31392
31711
  `;
31393
31712
  }
31394
- } else
31395
- ;
31713
+ }
31396
31714
  if (!result) {
31397
31715
  return null;
31398
31716
  }
@@ -31867,12 +32185,12 @@ var init_index_esm = __esm(() => {
31867
32185
  return new Uint8Array(arrayBuffer);
31868
32186
  };
31869
32187
  var FS_createDataFile = (...args2) => FS.createDataFile(...args2);
31870
- var getUniqueRunDependency = (id) => {
31871
- var orig = id;
32188
+ var getUniqueRunDependency = (id3) => {
32189
+ var orig = id3;
31872
32190
  while (true) {
31873
- if (!runDependencyTracking[id])
31874
- return id;
31875
- id = orig + Math.random();
32191
+ if (!runDependencyTracking[id3])
32192
+ return id3;
32193
+ id3 = orig + Math.random();
31876
32194
  }
31877
32195
  };
31878
32196
  var preloadPlugins = [];
@@ -32479,10 +32797,10 @@ var init_index_esm = __esm(() => {
32479
32797
  FS.syncFSRequests--;
32480
32798
  return callback(errCode);
32481
32799
  }
32482
- function done7(errCode) {
32800
+ function done9(errCode) {
32483
32801
  if (errCode) {
32484
- if (!done7.errored) {
32485
- done7.errored = true;
32802
+ if (!done9.errored) {
32803
+ done9.errored = true;
32486
32804
  return doCallback(errCode);
32487
32805
  }
32488
32806
  return;
@@ -32493,9 +32811,9 @@ var init_index_esm = __esm(() => {
32493
32811
  }
32494
32812
  mounts.forEach((mount) => {
32495
32813
  if (!mount.type.syncfs) {
32496
- return done7(null);
32814
+ return done9(null);
32497
32815
  }
32498
- mount.type.syncfs(mount, populate, done7);
32816
+ mount.type.syncfs(mount, populate, done9);
32499
32817
  });
32500
32818
  },
32501
32819
  mount(type, opts, mountpoint) {
@@ -33702,15 +34020,15 @@ var init_index_esm = __esm(() => {
33702
34020
  var startIdx = Math.floor(off / struct_size);
33703
34021
  var endIdx = Math.min(stream.getdents.length, startIdx + Math.floor(count3 / struct_size));
33704
34022
  for (var idx = startIdx;idx < endIdx; idx++) {
33705
- var id;
34023
+ var id3;
33706
34024
  var type;
33707
34025
  var name = stream.getdents[idx];
33708
34026
  if (name === ".") {
33709
- id = stream.node.id;
34027
+ id3 = stream.node.id;
33710
34028
  type = 4;
33711
34029
  } else if (name === "..") {
33712
34030
  var lookup2 = FS.lookupPath(stream.path, { parent: true });
33713
- id = lookup2.node.id;
34031
+ id3 = lookup2.node.id;
33714
34032
  type = 4;
33715
34033
  } else {
33716
34034
  var child;
@@ -33722,11 +34040,11 @@ var init_index_esm = __esm(() => {
33722
34040
  }
33723
34041
  throw e;
33724
34042
  }
33725
- id = child.id;
34043
+ id3 = child.id;
33726
34044
  type = FS.isChrdev(child.mode) ? 2 : FS.isDir(child.mode) ? 4 : FS.isLink(child.mode) ? 10 : 8;
33727
34045
  }
33728
- assert(id);
33729
- HEAP64[dirp + pos >> 3] = BigInt(id);
34046
+ assert(id3);
34047
+ HEAP64[dirp + pos >> 3] = BigInt(id3);
33730
34048
  HEAP64[dirp + pos + 8 >> 3] = BigInt((idx + 1) * struct_size);
33731
34049
  HEAP16[dirp + pos + 16 >> 1] = 280;
33732
34050
  HEAP8[dirp + pos + 18] = type;
@@ -36418,14 +36736,14 @@ var require_semver = __commonJS((exports, module) => {
36418
36736
  if (!m[4]) {
36419
36737
  this.prerelease = [];
36420
36738
  } else {
36421
- this.prerelease = m[4].split(".").map((id) => {
36422
- if (/^[0-9]+$/.test(id)) {
36423
- const num = +id;
36739
+ this.prerelease = m[4].split(".").map((id3) => {
36740
+ if (/^[0-9]+$/.test(id3)) {
36741
+ const num = +id3;
36424
36742
  if (num >= 0 && num < MAX_SAFE_INTEGER) {
36425
36743
  return num;
36426
36744
  }
36427
36745
  }
36428
- return id;
36746
+ return id3;
36429
36747
  });
36430
36748
  }
36431
36749
  this.build = m[5] ? m[5].split(".") : [];
@@ -36535,8 +36853,8 @@ var require_semver = __commonJS((exports, module) => {
36535
36853
  throw new Error("invalid increment argument: identifier is empty");
36536
36854
  }
36537
36855
  if (identifier2) {
36538
- const match11 = `-${identifier2}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
36539
- if (!match11 || match11[1] !== identifier2) {
36856
+ const match14 = `-${identifier2}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
36857
+ if (!match14 || match14[1] !== identifier2) {
36540
36858
  throw new Error(`invalid identifier: ${identifier2}`);
36541
36859
  }
36542
36860
  }
@@ -36675,28 +36993,28 @@ var require_coerce = __commonJS((exports, module) => {
36675
36993
  return null;
36676
36994
  }
36677
36995
  options = options || {};
36678
- let match11 = null;
36996
+ let match14 = null;
36679
36997
  if (!options.rtl) {
36680
- match11 = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
36998
+ match14 = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
36681
36999
  } else {
36682
37000
  const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
36683
37001
  let next4;
36684
- while ((next4 = coerceRtlRegex.exec(version2)) && (!match11 || match11.index + match11[0].length !== version2.length)) {
36685
- if (!match11 || next4.index + next4[0].length !== match11.index + match11[0].length) {
36686
- match11 = next4;
37002
+ while ((next4 = coerceRtlRegex.exec(version2)) && (!match14 || match14.index + match14[0].length !== version2.length)) {
37003
+ if (!match14 || next4.index + next4[0].length !== match14.index + match14[0].length) {
37004
+ match14 = next4;
36687
37005
  }
36688
37006
  coerceRtlRegex.lastIndex = next4.index + next4[1].length + next4[2].length;
36689
37007
  }
36690
37008
  coerceRtlRegex.lastIndex = -1;
36691
37009
  }
36692
- if (match11 === null) {
37010
+ if (match14 === null) {
36693
37011
  return null;
36694
37012
  }
36695
- const major = match11[2];
36696
- const minor = match11[3] || "0";
36697
- const patch9 = match11[4] || "0";
36698
- const prerelease = options.includePrerelease && match11[5] ? `-${match11[5]}` : "";
36699
- const build = options.includePrerelease && match11[6] ? `+${match11[6]}` : "";
37013
+ const major = match14[2];
37014
+ const minor = match14[3] || "0";
37015
+ const patch9 = match14[4] || "0";
37016
+ const prerelease = options.includePrerelease && match14[5] ? `-${match14[5]}` : "";
37017
+ const build = options.includePrerelease && match14[6] ? `+${match14[6]}` : "";
36700
37018
  return parse2(`${major}.${minor}.${patch9}${prerelease}${build}`, options);
36701
37019
  };
36702
37020
  module.exports = coerce;
@@ -37127,7 +37445,7 @@ var require_range = __commonJS((exports, module) => {
37127
37445
  debug("stars", comp);
37128
37446
  return comp;
37129
37447
  };
37130
- var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
37448
+ var isX = (id3) => !id3 || id3.toLowerCase() === "x" || id3 === "*";
37131
37449
  var replaceTildes = (comp, options) => {
37132
37450
  return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
37133
37451
  };
@@ -37677,11 +37995,11 @@ var require_libvips = __commonJS((exports, module) => {
37677
37995
  return "";
37678
37996
  }
37679
37997
  };
37680
- var skipSearch = (status, reason, logger) => {
37998
+ var skipSearch = (status3, reason, logger) => {
37681
37999
  if (logger) {
37682
38000
  logger(`Detected ${reason}, skipping search for globally-installed libvips`);
37683
38001
  }
37684
- return status;
38002
+ return status3;
37685
38003
  };
37686
38004
  var useGlobalLibvips = (logger) => {
37687
38005
  if (Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS) === true) {
@@ -39483,9 +39801,9 @@ var require_color = __commonJS((exports, module) => {
39483
39801
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39484
39802
  var __getOwnPropNames3 = Object.getOwnPropertyNames;
39485
39803
  var __hasOwnProp3 = Object.prototype.hasOwnProperty;
39486
- var __export2 = (target, all5) => {
39487
- for (var name in all5)
39488
- __defProp17(target, name, { get: all5[name], enumerable: true });
39804
+ var __export2 = (target, all7) => {
39805
+ for (var name in all7)
39806
+ __defProp17(target, name, { get: all7[name], enumerable: true });
39489
39807
  };
39490
39808
  var __copyProps2 = (to, from, except, desc) => {
39491
39809
  if (from && typeof from === "object" || typeof from === "function") {
@@ -39700,50 +40018,50 @@ var require_color = __commonJS((exports, module) => {
39700
40018
  const per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i;
39701
40019
  const keyword = /^(\w+)$/;
39702
40020
  let rgb = [0, 0, 0, 1];
39703
- let match11;
40021
+ let match14;
39704
40022
  let i2;
39705
40023
  let hexAlpha;
39706
- if (match11 = string2.match(hex)) {
39707
- hexAlpha = match11[2];
39708
- match11 = match11[1];
40024
+ if (match14 = string2.match(hex)) {
40025
+ hexAlpha = match14[2];
40026
+ match14 = match14[1];
39709
40027
  for (i2 = 0;i2 < 3; i2++) {
39710
40028
  const i22 = i2 * 2;
39711
- rgb[i2] = Number.parseInt(match11.slice(i22, i22 + 2), 16);
40029
+ rgb[i2] = Number.parseInt(match14.slice(i22, i22 + 2), 16);
39712
40030
  }
39713
40031
  if (hexAlpha) {
39714
40032
  rgb[3] = Number.parseInt(hexAlpha, 16) / 255;
39715
40033
  }
39716
- } else if (match11 = string2.match(abbr)) {
39717
- match11 = match11[1];
39718
- hexAlpha = match11[3];
40034
+ } else if (match14 = string2.match(abbr)) {
40035
+ match14 = match14[1];
40036
+ hexAlpha = match14[3];
39719
40037
  for (i2 = 0;i2 < 3; i2++) {
39720
- rgb[i2] = Number.parseInt(match11[i2] + match11[i2], 16);
40038
+ rgb[i2] = Number.parseInt(match14[i2] + match14[i2], 16);
39721
40039
  }
39722
40040
  if (hexAlpha) {
39723
40041
  rgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;
39724
40042
  }
39725
- } else if (match11 = string2.match(rgba)) {
40043
+ } else if (match14 = string2.match(rgba)) {
39726
40044
  for (i2 = 0;i2 < 3; i2++) {
39727
- rgb[i2] = Number.parseFloat(match11[i2 + 1]);
40045
+ rgb[i2] = Number.parseFloat(match14[i2 + 1]);
39728
40046
  }
39729
- if (match11[4]) {
39730
- rgb[3] = match11[5] ? Number.parseFloat(match11[4]) * 0.01 : Number.parseFloat(match11[4]);
40047
+ if (match14[4]) {
40048
+ rgb[3] = match14[5] ? Number.parseFloat(match14[4]) * 0.01 : Number.parseFloat(match14[4]);
39731
40049
  }
39732
- } else if (match11 = string2.match(per)) {
40050
+ } else if (match14 = string2.match(per)) {
39733
40051
  for (i2 = 0;i2 < 3; i2++) {
39734
- rgb[i2] = Math.round(Number.parseFloat(match11[i2 + 1]) * 2.55);
40052
+ rgb[i2] = Math.round(Number.parseFloat(match14[i2 + 1]) * 2.55);
39735
40053
  }
39736
- if (match11[4]) {
39737
- rgb[3] = match11[5] ? Number.parseFloat(match11[4]) * 0.01 : Number.parseFloat(match11[4]);
40054
+ if (match14[4]) {
40055
+ rgb[3] = match14[5] ? Number.parseFloat(match14[4]) * 0.01 : Number.parseFloat(match14[4]);
39738
40056
  }
39739
- } else if (match11 = string2.toLowerCase().match(keyword)) {
39740
- if (match11[1] === "transparent") {
40057
+ } else if (match14 = string2.toLowerCase().match(keyword)) {
40058
+ if (match14[1] === "transparent") {
39741
40059
  return [0, 0, 0, 0];
39742
40060
  }
39743
- if (!Object.hasOwn(color_name_default, match11[1])) {
40061
+ if (!Object.hasOwn(color_name_default, match14[1])) {
39744
40062
  return null;
39745
40063
  }
39746
- rgb = color_name_default[match11[1]].slice();
40064
+ rgb = color_name_default[match14[1]].slice();
39747
40065
  rgb[3] = 1;
39748
40066
  return rgb;
39749
40067
  } else {
@@ -39760,12 +40078,12 @@ var require_color = __commonJS((exports, module) => {
39760
40078
  return null;
39761
40079
  }
39762
40080
  const hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i;
39763
- const match11 = string2.match(hsl);
39764
- if (match11) {
39765
- const alpha = Number.parseFloat(match11[4]);
39766
- const h = (Number.parseFloat(match11[1]) % 360 + 360) % 360;
39767
- const s = clamp4(Number.parseFloat(match11[2]), 0, 100);
39768
- const l = clamp4(Number.parseFloat(match11[3]), 0, 100);
40081
+ const match14 = string2.match(hsl);
40082
+ if (match14) {
40083
+ const alpha = Number.parseFloat(match14[4]);
40084
+ const h = (Number.parseFloat(match14[1]) % 360 + 360) % 360;
40085
+ const s = clamp4(Number.parseFloat(match14[2]), 0, 100);
40086
+ const l = clamp4(Number.parseFloat(match14[3]), 0, 100);
39769
40087
  const a = clamp4(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
39770
40088
  return [h, s, l, a];
39771
40089
  }
@@ -39776,12 +40094,12 @@ var require_color = __commonJS((exports, module) => {
39776
40094
  return null;
39777
40095
  }
39778
40096
  const hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i;
39779
- const match11 = string2.match(hwb);
39780
- if (match11) {
39781
- const alpha = Number.parseFloat(match11[4]);
39782
- const h = (Number.parseFloat(match11[1]) % 360 + 360) % 360;
39783
- const w = clamp4(Number.parseFloat(match11[2]), 0, 100);
39784
- const b = clamp4(Number.parseFloat(match11[3]), 0, 100);
40097
+ const match14 = string2.match(hwb);
40098
+ if (match14) {
40099
+ const alpha = Number.parseFloat(match14[4]);
40100
+ const h = (Number.parseFloat(match14[1]) % 360 + 360) % 360;
40101
+ const w = clamp4(Number.parseFloat(match14[2]), 0, 100);
40102
+ const b = clamp4(Number.parseFloat(match14[3]), 0, 100);
39785
40103
  const a = clamp4(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
39786
40104
  return [h, w, b, a];
39787
40105
  }
@@ -40383,12 +40701,12 @@ var require_color = __commonJS((exports, module) => {
40383
40701
  return "000000".slice(string2.length) + string2;
40384
40702
  };
40385
40703
  convert.hex.rgb = function(args2) {
40386
- const match11 = args2.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
40387
- if (!match11) {
40704
+ const match14 = args2.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
40705
+ if (!match14) {
40388
40706
  return [0, 0, 0];
40389
40707
  }
40390
- let colorString = match11[0];
40391
- if (match11[0].length === 3) {
40708
+ let colorString = match14[0];
40709
+ if (match14[0].length === 3) {
40392
40710
  colorString = [...colorString].map((char) => char + char).join("");
40393
40711
  }
40394
40712
  const integer = Number.parseInt(colorString, 16);
@@ -43478,13 +43796,13 @@ var require_createJob = __commonJS((exports, module) => {
43478
43796
  action,
43479
43797
  payload = {}
43480
43798
  }) => {
43481
- let id = _id;
43482
- if (typeof id === "undefined") {
43483
- id = getId("Job", jobCounter);
43799
+ let id3 = _id;
43800
+ if (typeof id3 === "undefined") {
43801
+ id3 = getId("Job", jobCounter);
43484
43802
  jobCounter += 1;
43485
43803
  }
43486
43804
  return {
43487
- id,
43805
+ id: id3,
43488
43806
  action,
43489
43807
  payload
43490
43808
  };
@@ -43508,7 +43826,7 @@ var require_createScheduler = __commonJS((exports, module) => {
43508
43826
  var getId = require_getId();
43509
43827
  var schedulerCounter = 0;
43510
43828
  module.exports = () => {
43511
- const id = getId("Scheduler", schedulerCounter);
43829
+ const id3 = getId("Scheduler", schedulerCounter);
43512
43830
  const workers = {};
43513
43831
  const runningWorkers = {};
43514
43832
  let jobQueue = [];
@@ -43540,20 +43858,20 @@ var require_createScheduler = __commonJS((exports, module) => {
43540
43858
  dequeue();
43541
43859
  }
43542
43860
  });
43543
- log3(`[${id}]: Add ${job.id} to JobQueue`);
43544
- log3(`[${id}]: JobQueue length=${jobQueue.length}`);
43861
+ log3(`[${id3}]: Add ${job.id} to JobQueue`);
43862
+ log3(`[${id3}]: JobQueue length=${jobQueue.length}`);
43545
43863
  dequeue();
43546
43864
  });
43547
43865
  const addWorker = (w) => {
43548
43866
  workers[w.id] = w;
43549
- log3(`[${id}]: Add ${w.id}`);
43550
- log3(`[${id}]: Number of workers=${getNumWorkers()}`);
43867
+ log3(`[${id3}]: Add ${w.id}`);
43868
+ log3(`[${id3}]: Number of workers=${getNumWorkers()}`);
43551
43869
  dequeue();
43552
43870
  return w.id;
43553
43871
  };
43554
43872
  const addJob = async (action, ...payload) => {
43555
43873
  if (getNumWorkers() === 0) {
43556
- throw Error(`[${id}]: You need to have at least one worker before adding jobs`);
43874
+ throw Error(`[${id3}]: You need to have at least one worker before adding jobs`);
43557
43875
  }
43558
43876
  return queue(action, payload);
43559
43877
  };
@@ -43878,8 +44196,8 @@ var require_tr46 = __commonJS((exports, module) => {
43878
44196
  var len2 = countSymbols(domain_name);
43879
44197
  for (var i2 = 0;i2 < len2; ++i2) {
43880
44198
  var codePoint = domain_name.codePointAt(i2);
43881
- var status = findStatus(codePoint);
43882
- switch (status[1]) {
44199
+ var status3 = findStatus(codePoint);
44200
+ switch (status3[1]) {
43883
44201
  case "disallowed":
43884
44202
  hasError = true;
43885
44203
  processed += String.fromCodePoint(codePoint);
@@ -43887,11 +44205,11 @@ var require_tr46 = __commonJS((exports, module) => {
43887
44205
  case "ignored":
43888
44206
  break;
43889
44207
  case "mapped":
43890
- processed += String.fromCodePoint.apply(String, status[2]);
44208
+ processed += String.fromCodePoint.apply(String, status3[2]);
43891
44209
  break;
43892
44210
  case "deviation":
43893
44211
  if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {
43894
- processed += String.fromCodePoint.apply(String, status[2]);
44212
+ processed += String.fromCodePoint.apply(String, status3[2]);
43895
44213
  } else {
43896
44214
  processed += String.fromCodePoint(codePoint);
43897
44215
  }
@@ -43904,7 +44222,7 @@ var require_tr46 = __commonJS((exports, module) => {
43904
44222
  hasError = true;
43905
44223
  processed += String.fromCodePoint(codePoint);
43906
44224
  } else {
43907
- processed += String.fromCodePoint.apply(String, status[2]);
44225
+ processed += String.fromCodePoint.apply(String, status3[2]);
43908
44226
  }
43909
44227
  break;
43910
44228
  case "disallowed_STD3_valid":
@@ -43932,8 +44250,8 @@ var require_tr46 = __commonJS((exports, module) => {
43932
44250
  }
43933
44251
  var len2 = countSymbols(label);
43934
44252
  for (var i2 = 0;i2 < len2; ++i2) {
43935
- var status = findStatus(label.codePointAt(i2));
43936
- if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") {
44253
+ var status3 = findStatus(label.codePointAt(i2));
44254
+ if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status3[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status3[1] !== "valid" && status3[1] !== "deviation") {
43937
44255
  error = true;
43938
44256
  break;
43939
44257
  }
@@ -44993,11 +45311,11 @@ var require_url_state_machine = __commonJS((exports, module) => {
44993
45311
  }
44994
45312
  return output;
44995
45313
  }
44996
- function serializeOrigin(tuple) {
44997
- let result = tuple.scheme + "://";
44998
- result += serializeHost(tuple.host);
44999
- if (tuple.port !== null) {
45000
- result += ":" + tuple.port;
45314
+ function serializeOrigin(tuple2) {
45315
+ let result = tuple2.scheme + "://";
45316
+ result += serializeHost(tuple2.host);
45317
+ if (tuple2.port !== null) {
45318
+ result += ":" + tuple2.port;
45001
45319
  }
45002
45320
  return result;
45003
45321
  }
@@ -45837,9 +46155,9 @@ var require_lib3 = __commonJS((exports, module) => {
45837
46155
  throw new TypeError(`${value} is not a legal HTTP header value`);
45838
46156
  }
45839
46157
  }
45840
- function find2(map13, name) {
46158
+ function find2(map15, name) {
45841
46159
  name = name.toLowerCase();
45842
- for (const key in map13) {
46160
+ for (const key in map15) {
45843
46161
  if (key.toLowerCase() === name) {
45844
46162
  return key;
45845
46163
  }
@@ -46066,7 +46384,7 @@ var require_lib3 = __commonJS((exports, module) => {
46066
46384
  let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
46067
46385
  let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46068
46386
  Body.call(this, body, opts);
46069
- const status = opts.status || 200;
46387
+ const status3 = opts.status || 200;
46070
46388
  const headers = new Headers2(opts.headers);
46071
46389
  if (body != null && !headers.has("Content-Type")) {
46072
46390
  const contentType = extractContentType(body);
@@ -46076,8 +46394,8 @@ var require_lib3 = __commonJS((exports, module) => {
46076
46394
  }
46077
46395
  this[INTERNALS$1] = {
46078
46396
  url: opts.url,
46079
- status,
46080
- statusText: opts.statusText || STATUS_CODES[status],
46397
+ status: status3,
46398
+ statusText: opts.statusText || STATUS_CODES[status3],
46081
46399
  headers,
46082
46400
  counter: opts.counter
46083
46401
  };
@@ -46551,11 +46869,11 @@ var require_is_url = __commonJS((exports, module) => {
46551
46869
  if (typeof string2 !== "string") {
46552
46870
  return false;
46553
46871
  }
46554
- var match11 = string2.match(protocolAndDomainRE);
46555
- if (!match11) {
46872
+ var match14 = string2.match(protocolAndDomainRE);
46873
+ if (!match14) {
46556
46874
  return false;
46557
46875
  }
46558
- var everythingAfterProtocol = match11[1];
46876
+ var everythingAfterProtocol = match14[1];
46559
46877
  if (!everythingAfterProtocol) {
46560
46878
  return false;
46561
46879
  }
@@ -46629,7 +46947,7 @@ var require_createWorker = __commonJS((exports, module) => {
46629
46947
  } = require_node();
46630
46948
  var workerCounter = 0;
46631
46949
  module.exports = async (langs = "eng", oem = OEM.LSTM_ONLY, _options = {}, config = {}) => {
46632
- const id = getId("Worker", workerCounter);
46950
+ const id3 = getId("Worker", workerCounter);
46633
46951
  const {
46634
46952
  logger,
46635
46953
  errorHandler,
@@ -46656,11 +46974,11 @@ var require_createWorker = __commonJS((exports, module) => {
46656
46974
  worker.onerror = workerError;
46657
46975
  workerCounter += 1;
46658
46976
  const startJob = ({ id: jobId, action, payload }) => new Promise((resolve, reject) => {
46659
- log3(`[${id}]: Start ${jobId}, action=${action}`);
46977
+ log3(`[${id3}]: Start ${jobId}, action=${action}`);
46660
46978
  const promiseId = `${action}-${jobId}`;
46661
46979
  promises[promiseId] = { resolve, reject };
46662
46980
  send(worker, {
46663
- workerId: id,
46981
+ workerId: id3,
46664
46982
  jobId,
46665
46983
  action,
46666
46984
  payload
@@ -46758,16 +47076,16 @@ var require_createWorker = __commonJS((exports, module) => {
46758
47076
  onMessage(worker, ({
46759
47077
  workerId,
46760
47078
  jobId,
46761
- status,
47079
+ status: status3,
46762
47080
  action,
46763
47081
  data
46764
47082
  }) => {
46765
47083
  const promiseId = `${action}-${jobId}`;
46766
- if (status === "resolve") {
47084
+ if (status3 === "resolve") {
46767
47085
  log3(`[${workerId}]: Complete ${jobId}`);
46768
47086
  promises[promiseId].resolve({ jobId, data });
46769
47087
  delete promises[promiseId];
46770
- } else if (status === "reject") {
47088
+ } else if (status3 === "reject") {
46771
47089
  promises[promiseId].reject(data);
46772
47090
  delete promises[promiseId];
46773
47091
  if (action === "load")
@@ -46777,12 +47095,12 @@ var require_createWorker = __commonJS((exports, module) => {
46777
47095
  } else {
46778
47096
  throw Error(data);
46779
47097
  }
46780
- } else if (status === "progress") {
47098
+ } else if (status3 === "progress") {
46781
47099
  logger({ ...data, userJobId: jobId });
46782
47100
  }
46783
47101
  });
46784
47102
  const resolveObj = {
46785
- id,
47103
+ id: id3,
46786
47104
  worker,
46787
47105
  load,
46788
47106
  writeText,
@@ -56377,12 +56695,12 @@ var require_mime_types = __commonJS((exports) => {
56377
56695
  if (!type || typeof type !== "string") {
56378
56696
  return false;
56379
56697
  }
56380
- var match11 = EXTRACT_TYPE_REGEXP.exec(type);
56381
- var mime = match11 && db[match11[1].toLowerCase()];
56698
+ var match14 = EXTRACT_TYPE_REGEXP.exec(type);
56699
+ var mime = match14 && db[match14[1].toLowerCase()];
56382
56700
  if (mime && mime.charset) {
56383
56701
  return mime.charset;
56384
56702
  }
56385
- if (match11 && TEXT_TYPE_REGEXP.test(match11[1])) {
56703
+ if (match14 && TEXT_TYPE_REGEXP.test(match14[1])) {
56386
56704
  return "UTF-8";
56387
56705
  }
56388
56706
  return false;
@@ -56406,8 +56724,8 @@ var require_mime_types = __commonJS((exports) => {
56406
56724
  if (!type || typeof type !== "string") {
56407
56725
  return false;
56408
56726
  }
56409
- var match11 = EXTRACT_TYPE_REGEXP.exec(type);
56410
- var exts = match11 && exports.extensions[match11[1].toLowerCase()];
56727
+ var match14 = EXTRACT_TYPE_REGEXP.exec(type);
56728
+ var exts = match14 && exports.extensions[match14[1].toLowerCase()];
56411
56729
  if (!exts || !exts.length) {
56412
56730
  return false;
56413
56731
  }
@@ -57226,8 +57544,8 @@ var require_get_intrinsic = __commonJS((exports, module) => {
57226
57544
  throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
57227
57545
  }
57228
57546
  var result = [];
57229
- $replace(string2, rePropName, function(match11, number4, quote, subString) {
57230
- result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number4 || match11;
57547
+ $replace(string2, rePropName, function(match14, number4, quote, subString) {
57548
+ result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number4 || match14;
57231
57549
  });
57232
57550
  return result;
57233
57551
  };
@@ -57815,8 +58133,8 @@ function encode(str) {
57815
58133
  "%20": "+",
57816
58134
  "%00": "\x00"
57817
58135
  };
57818
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match11) {
57819
- return charMap[match11];
58136
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match14) {
58137
+ return charMap[match14];
57820
58138
  });
57821
58139
  }
57822
58140
  function AxiosURLSearchParams(params, options) {
@@ -57888,9 +58206,9 @@ class InterceptorManager {
57888
58206
  });
57889
58207
  return this.handlers.length - 1;
57890
58208
  }
57891
- eject(id) {
57892
- if (this.handlers[id]) {
57893
- this.handlers[id] = null;
58209
+ eject(id3) {
58210
+ if (this.handlers[id3]) {
58211
+ this.handlers[id3] = null;
57894
58212
  }
57895
58213
  }
57896
58214
  clear() {
@@ -58015,8 +58333,8 @@ var init_toURLEncodedForm = __esm(() => {
58015
58333
 
58016
58334
  // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/formDataToJSON.js
58017
58335
  function parsePropPath(name) {
58018
- return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match11) => {
58019
- return match11[0] === "[]" ? "" : match11[1] || match11[0];
58336
+ return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match14) => {
58337
+ return match14[0] === "[]" ? "" : match14[1] || match14[0];
58020
58338
  });
58021
58339
  }
58022
58340
  function arrayToObject(arr) {
@@ -58170,8 +58488,8 @@ var init_defaults = __esm(() => {
58170
58488
  FormData: platform_default.classes.FormData,
58171
58489
  Blob: platform_default.classes.Blob
58172
58490
  },
58173
- validateStatus: function validateStatus(status) {
58174
- return status >= 200 && status < 300;
58491
+ validateStatus: function validateStatus(status3) {
58492
+ return status3 >= 200 && status3 < 300;
58175
58493
  },
58176
58494
  headers: {
58177
58495
  common: {
@@ -58271,9 +58589,9 @@ function normalizeValue(value) {
58271
58589
  function parseTokens(str) {
58272
58590
  const tokens = Object.create(null);
58273
58591
  const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
58274
- let match11;
58275
- while (match11 = tokensRE.exec(str)) {
58276
- tokens[match11[1]] = match11[2];
58592
+ let match14;
58593
+ while (match14 = tokensRE.exec(str)) {
58594
+ tokens[match14[1]] = match14[2];
58277
58595
  }
58278
58596
  return tokens;
58279
58597
  }
@@ -58667,12 +58985,12 @@ var require_ms = __commonJS((exports, module) => {
58667
58985
  if (str.length > 100) {
58668
58986
  return;
58669
58987
  }
58670
- var match11 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
58671
- if (!match11) {
58988
+ var match14 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
58989
+ if (!match14) {
58672
58990
  return;
58673
58991
  }
58674
- var n = parseFloat(match11[1]);
58675
- var type = (match11[2] || "ms").toLowerCase();
58992
+ var n = parseFloat(match14[1]);
58993
+ var type = (match14[2] || "ms").toLowerCase();
58676
58994
  switch (type) {
58677
58995
  case "years":
58678
58996
  case "year":
@@ -58801,19 +59119,19 @@ var require_common = __commonJS((exports, module) => {
58801
59119
  args2.unshift("%O");
58802
59120
  }
58803
59121
  let index = 0;
58804
- args2[0] = args2[0].replace(/%([a-zA-Z%])/g, (match11, format4) => {
58805
- if (match11 === "%%") {
59122
+ args2[0] = args2[0].replace(/%([a-zA-Z%])/g, (match14, format4) => {
59123
+ if (match14 === "%%") {
58806
59124
  return "%";
58807
59125
  }
58808
59126
  index++;
58809
59127
  const formatter = createDebug.formatters[format4];
58810
59128
  if (typeof formatter === "function") {
58811
59129
  const val = args2[index];
58812
- match11 = formatter.call(self2, val);
59130
+ match14 = formatter.call(self2, val);
58813
59131
  args2.splice(index, 1);
58814
59132
  index--;
58815
59133
  }
58816
- return match11;
59134
+ return match14;
58817
59135
  });
58818
59136
  createDebug.formatArgs.call(self2, args2);
58819
59137
  const logFn = self2.log || createDebug.log;
@@ -59042,12 +59360,12 @@ var require_browser = __commonJS((exports, module) => {
59042
59360
  args2.splice(1, 0, c, "color: inherit");
59043
59361
  let index = 0;
59044
59362
  let lastC = 0;
59045
- args2[0].replace(/%[a-zA-Z%]/g, (match11) => {
59046
- if (match11 === "%%") {
59363
+ args2[0].replace(/%[a-zA-Z%]/g, (match14) => {
59364
+ if (match14 === "%%") {
59047
59365
  return;
59048
59366
  }
59049
59367
  index++;
59050
- if (match11 === "%c") {
59368
+ if (match14 === "%c") {
59051
59369
  lastC = index;
59052
59370
  }
59053
59371
  });
@@ -59881,8 +60199,8 @@ var VERSION = "1.15.0";
59881
60199
 
59882
60200
  // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/parseProtocol.js
59883
60201
  function parseProtocol(url2) {
59884
- const match11 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
59885
- return match11 && match11[1] || "";
60202
+ const match14 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
60203
+ return match14 && match14[1] || "";
59886
60204
  }
59887
60205
 
59888
60206
  // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/fromDataURI.js
@@ -59894,13 +60212,13 @@ function fromDataURI(uri, asBlob, options) {
59894
60212
  }
59895
60213
  if (protocol === "data") {
59896
60214
  uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
59897
- const match11 = DATA_URL_PATTERN.exec(uri);
59898
- if (!match11) {
60215
+ const match14 = DATA_URL_PATTERN.exec(uri);
60216
+ if (!match14) {
59899
60217
  throw new AxiosError_default("Invalid URL", AxiosError_default.ERR_INVALID_URL);
59900
60218
  }
59901
- const mime = match11[1];
59902
- const isBase64 = match11[2];
59903
- const body = match11[3];
60219
+ const mime = match14[1];
60220
+ const isBase64 = match14[2];
60221
+ const body = match14[3];
59904
60222
  const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
59905
60223
  if (asBlob) {
59906
60224
  if (!_Blob) {
@@ -60086,11 +60404,11 @@ class FormDataPart {
60086
60404
  yield CRLF_BYTES;
60087
60405
  }
60088
60406
  static escapeName(name) {
60089
- return String(name).replace(/[\r\n"]/g, (match11) => ({
60407
+ return String(name).replace(/[\r\n"]/g, (match14) => ({
60090
60408
  "\r": "%0D",
60091
60409
  "\n": "%0A",
60092
60410
  '"': "%22"
60093
- })[match11]);
60411
+ })[match14]);
60094
60412
  }
60095
60413
  }
60096
60414
  var BOUNDARY_ALPHABET, textEncoder, CRLF = `\r
@@ -60563,18 +60881,18 @@ var import_follow_redirects, zlibOptions, brotliOptions, isBrotliSupported, http
60563
60881
  return new Promise((resolve, reject) => {
60564
60882
  let onDone;
60565
60883
  let isDone5;
60566
- const done7 = (value, isRejected) => {
60884
+ const done9 = (value, isRejected) => {
60567
60885
  if (isDone5)
60568
60886
  return;
60569
60887
  isDone5 = true;
60570
60888
  onDone && onDone(value, isRejected);
60571
60889
  };
60572
60890
  const _resolve = (value) => {
60573
- done7(value);
60891
+ done9(value);
60574
60892
  resolve(value);
60575
60893
  };
60576
60894
  const _reject = (reason) => {
60577
- done7(reason, true);
60895
+ done9(reason, true);
60578
60896
  reject(reason);
60579
60897
  };
60580
60898
  asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
@@ -60642,10 +60960,10 @@ var init_http = __esm(() => {
60642
60960
  req.once("response", (responseHeaders) => {
60643
60961
  const response = req;
60644
60962
  responseHeaders = Object.assign({}, responseHeaders);
60645
- const status = responseHeaders[HTTP2_HEADER_STATUS];
60963
+ const status3 = responseHeaders[HTTP2_HEADER_STATUS];
60646
60964
  delete responseHeaders[HTTP2_HEADER_STATUS];
60647
60965
  response.headers = responseHeaders;
60648
- response.statusCode = +status;
60966
+ response.statusCode = +status3;
60649
60967
  cb(response);
60650
60968
  });
60651
60969
  return req;
@@ -61088,8 +61406,8 @@ var init_cookies = __esm(() => {
61088
61406
  read(name) {
61089
61407
  if (typeof document === "undefined")
61090
61408
  return null;
61091
- const match11 = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
61092
- return match11 ? decodeURIComponent(match11[1]) : null;
61409
+ const match14 = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
61410
+ return match14 ? decodeURIComponent(match14[1]) : null;
61093
61411
  },
61094
61412
  remove(name) {
61095
61413
  this.write(name, "", Date.now() - 86400000, "/");
@@ -61255,7 +61573,7 @@ var init_xhr = __esm(() => {
61255
61573
  let onCanceled;
61256
61574
  let uploadThrottled, downloadThrottled;
61257
61575
  let flushUpload, flushDownload;
61258
- function done7() {
61576
+ function done9() {
61259
61577
  flushUpload && flushUpload();
61260
61578
  flushDownload && flushDownload();
61261
61579
  _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
@@ -61280,10 +61598,10 @@ var init_xhr = __esm(() => {
61280
61598
  };
61281
61599
  settle(function _resolve(value) {
61282
61600
  resolve(value);
61283
- done7();
61601
+ done9();
61284
61602
  }, function _reject(err) {
61285
61603
  reject(err);
61286
- done7();
61604
+ done9();
61287
61605
  }, response);
61288
61606
  request2 = null;
61289
61607
  }
@@ -61435,8 +61753,8 @@ var streamChunk = function* (chunk2, chunkSize) {
61435
61753
  const reader = stream4.getReader();
61436
61754
  try {
61437
61755
  for (;; ) {
61438
- const { done: done7, value } = await reader.read();
61439
- if (done7) {
61756
+ const { done: done9, value } = await reader.read();
61757
+ if (done9) {
61440
61758
  break;
61441
61759
  }
61442
61760
  yield value;
@@ -61447,18 +61765,18 @@ var streamChunk = function* (chunk2, chunkSize) {
61447
61765
  }, trackStream = (stream4, chunkSize, onProgress, onFinish) => {
61448
61766
  const iterator2 = readBytes(stream4, chunkSize);
61449
61767
  let bytes = 0;
61450
- let done7;
61768
+ let done9;
61451
61769
  let _onFinish = (e) => {
61452
- if (!done7) {
61453
- done7 = true;
61770
+ if (!done9) {
61771
+ done9 = true;
61454
61772
  onFinish && onFinish(e);
61455
61773
  }
61456
61774
  };
61457
61775
  return new ReadableStream({
61458
61776
  async pull(controller) {
61459
61777
  try {
61460
- const { done: done8, value } = await iterator2.next();
61461
- if (done8) {
61778
+ const { done: done10, value } = await iterator2.next();
61779
+ if (done10) {
61462
61780
  _onFinish();
61463
61781
  controller.close();
61464
61782
  return;
@@ -61654,12 +61972,12 @@ var DEFAULT_CHUNK_SIZE, isFunction4, globalFetchAPI, ReadableStream2, TextEncode
61654
61972
  let env = config && config.env || {};
61655
61973
  const { fetch: fetch2, Request: Request3, Response: Response2 } = env;
61656
61974
  const seeds = [Request3, Response2, fetch2];
61657
- let len2 = seeds.length, i2 = len2, seed, target, map13 = seedCache;
61975
+ let len2 = seeds.length, i2 = len2, seed, target, map15 = seedCache;
61658
61976
  while (i2--) {
61659
61977
  seed = seeds[i2];
61660
- target = map13.get(seed);
61661
- target === undefined && map13.set(seed, target = i2 ? new Map : factory(env));
61662
- map13 = target;
61978
+ target = map15.get(seed);
61979
+ target === undefined && map15.set(seed, target = i2 ? new Map : factory(env));
61980
+ map15 = target;
61663
61981
  }
61664
61982
  return target;
61665
61983
  }, adapter;
@@ -61692,21 +62010,21 @@ function getAdapter(adapters, config) {
61692
62010
  const rejectedReasons = {};
61693
62011
  for (let i2 = 0;i2 < length2; i2++) {
61694
62012
  nameOrAdapter = adapters[i2];
61695
- let id;
62013
+ let id3;
61696
62014
  adapter2 = nameOrAdapter;
61697
62015
  if (!isResolvedHandle(nameOrAdapter)) {
61698
- adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
62016
+ adapter2 = knownAdapters[(id3 = String(nameOrAdapter)).toLowerCase()];
61699
62017
  if (adapter2 === undefined) {
61700
- throw new AxiosError_default(`Unknown adapter '${id}'`);
62018
+ throw new AxiosError_default(`Unknown adapter '${id3}'`);
61701
62019
  }
61702
62020
  }
61703
62021
  if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) {
61704
62022
  break;
61705
62023
  }
61706
- rejectedReasons[id || "#" + i2] = adapter2;
62024
+ rejectedReasons[id3 || "#" + i2] = adapter2;
61707
62025
  }
61708
62026
  if (!adapter2) {
61709
- const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
62027
+ const reasons = Object.entries(rejectedReasons).map(([id3, state]) => `adapter ${id3} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
61710
62028
  let s = length2 ? reasons.length > 1 ? `since :
61711
62029
  ` + reasons.map(renderReason).join(`
61712
62030
  `) : " " + renderReason(reasons[0]) : "as no adapter specified";
@@ -62253,7 +62571,7 @@ var init_axios = __esm(() => {
62253
62571
  axios.toFormData = toFormData_default;
62254
62572
  axios.AxiosError = AxiosError_default;
62255
62573
  axios.Cancel = axios.CanceledError;
62256
- axios.all = function all5(promises) {
62574
+ axios.all = function all7(promises) {
62257
62575
  return Promise.all(promises);
62258
62576
  };
62259
62577
  axios.spread = spread;
@@ -65863,8 +66181,8 @@ async function decompressDeflateRawWithLimit(data, { maximumLength = maximumZipE
65863
66181
  let totalLength = 0;
65864
66182
  try {
65865
66183
  for (;; ) {
65866
- const { done: done7, value } = await reader.read();
65867
- if (done7) {
66184
+ const { done: done9, value } = await reader.read();
66185
+ if (done9) {
65868
66186
  break;
65869
66187
  }
65870
66188
  totalLength += value.length;
@@ -65992,8 +66310,8 @@ function createByteLimitedReadableStream(stream4, maximumBytes) {
65992
66310
  await cancelSource();
65993
66311
  return;
65994
66312
  }
65995
- const { done: done7, value } = await reader.read();
65996
- if (done7 || !value) {
66313
+ const { done: done9, value } = await reader.read();
66314
+ if (done9 || !value) {
65997
66315
  sourceDone = true;
65998
66316
  controller.close();
65999
66317
  return;
@@ -66409,9 +66727,9 @@ class FileTypeParser {
66409
66727
  let firstChunk;
66410
66728
  const reader = stream4.getReader({ mode: "byob" });
66411
66729
  try {
66412
- const { value: chunk2, done: done7 } = await readByobReaderWithSignal(reader, new Uint8Array(sampleSize), this.options.signal);
66730
+ const { value: chunk2, done: done9 } = await readByobReaderWithSignal(reader, new Uint8Array(sampleSize), this.options.signal);
66413
66731
  firstChunk = chunk2;
66414
- if (!done7 && chunk2) {
66732
+ if (!done9 && chunk2) {
66415
66733
  try {
66416
66734
  detectedFileType = await this.fromBuffer(chunk2.subarray(0, sampleSize));
66417
66735
  } catch (error) {
@@ -66918,12 +67236,12 @@ class FileTypeParser {
66918
67236
  ++ic;
66919
67237
  mask >>= 1;
66920
67238
  }
66921
- const id = new Uint8Array(ic + 1);
66922
- await safeReadBuffer(tokenizer, id, undefined, {
66923
- maximumLength: id.length,
67239
+ const id3 = new Uint8Array(ic + 1);
67240
+ await safeReadBuffer(tokenizer, id3, undefined, {
67241
+ maximumLength: id3.length,
66924
67242
  reason: "EBML field"
66925
67243
  });
66926
- return id;
67244
+ return id3;
66927
67245
  }
66928
67246
  async function readElement() {
66929
67247
  const idField = await readField();
@@ -66937,9 +67255,9 @@ class FileTypeParser {
66937
67255
  len: getUintBE(lengthView)
66938
67256
  };
66939
67257
  }
66940
- async function readChildren(children) {
67258
+ async function readChildren(children3) {
66941
67259
  let ebmlElementCount = 0;
66942
- while (children > 0) {
67260
+ while (children3 > 0) {
66943
67261
  ebmlElementCount++;
66944
67262
  if (ebmlElementCount > maximumEbmlElementCount) {
66945
67263
  return;
@@ -66964,7 +67282,7 @@ class FileTypeParser {
66964
67282
  maximumLength: hasUnknownFileSize(tokenizer) ? maximumEbmlElementPayloadSizeInBytes : tokenizer.fileInfo.size,
66965
67283
  reason: "EBML payload"
66966
67284
  });
66967
- --children;
67285
+ --children3;
66968
67286
  if (tokenizer.position <= previousPosition) {
66969
67287
  return;
66970
67288
  }
@@ -69842,9 +70160,9 @@ function decodeMultiParam(input, expectedParams, requiredParams) {
69842
70160
  let currentContent = [];
69843
70161
  for (let i2 = 0;i2 < lines.length; i2++) {
69844
70162
  const line = lines[i2];
69845
- const match11 = line.match(delimiterPattern);
69846
- if (match11) {
69847
- const paramName = match11[1];
70163
+ const match14 = line.match(delimiterPattern);
70164
+ if (match14) {
70165
+ const paramName = match14[1];
69848
70166
  if (currentParam !== null) {
69849
70167
  const content = currentContent.join(`
69850
70168
  `).trim();
@@ -70110,8 +70428,8 @@ ${error instanceof Error ? error.message : String(error)}`);
70110
70428
  console.log(`\uD83D\uDCCB Summary: ${message}`);
70111
70429
  if (attachedArtifactIds.length > 0) {
70112
70430
  console.log(`\uD83D\uDCCE Attached artifacts: ${attachedArtifactIds.length}`);
70113
- attachedArtifactIds.forEach((id) => {
70114
- console.log(` • ${id}`);
70431
+ attachedArtifactIds.forEach((id3) => {
70432
+ console.log(` • ${id3}`);
70115
70433
  });
70116
70434
  }
70117
70435
  if (resolvedWorkflowIds.length > 0) {
@@ -70763,8 +71081,8 @@ async function closeBacklog(chatroomId, options, deps) {
70763
71081
  return;
70764
71082
  }
70765
71083
  }
70766
- function getStatusEmoji(status) {
70767
- switch (status) {
71084
+ function getStatusEmoji(status3) {
71085
+ switch (status3) {
70768
71086
  case "pending":
70769
71087
  return "\uD83D\uDFE2";
70770
71088
  case "acknowledged":
@@ -70966,13 +71284,13 @@ function parseSections(input, requiredSections, optionalSections) {
70966
71284
  const markerPattern = allSections.map((s) => `---${s}---`).join("|");
70967
71285
  const regex = new RegExp(`(${markerPattern})`, "g");
70968
71286
  const markers = [];
70969
- let match11;
70970
- while ((match11 = regex.exec(input)) !== null) {
70971
- const sectionName = match11[1].replace(/^---/, "").replace(/---$/, "");
71287
+ let match14;
71288
+ while ((match14 = regex.exec(input)) !== null) {
71289
+ const sectionName = match14[1].replace(/^---/, "").replace(/---$/, "");
70972
71290
  markers.push({
70973
71291
  section: sectionName,
70974
- index: match11.index + match11[0].length,
70975
- matchStart: match11.index
71292
+ index: match14.index + match14[0].length,
71293
+ matchStart: match14.index
70976
71294
  });
70977
71295
  }
70978
71296
  for (let i2 = 0;i2 < markers.length; i2++) {
@@ -70996,8 +71314,8 @@ function parseSections(input, requiredSections, optionalSections) {
70996
71314
  }
70997
71315
  return result;
70998
71316
  }
70999
- function getStepStatusEmoji(status) {
71000
- switch (status) {
71317
+ function getStepStatusEmoji(status3) {
71318
+ switch (status3) {
71001
71319
  case "pending":
71002
71320
  return "⏳";
71003
71321
  case "in_progress":
@@ -71010,8 +71328,8 @@ function getStepStatusEmoji(status) {
71010
71328
  return "⚫";
71011
71329
  }
71012
71330
  }
71013
- function getWorkflowStatusEmoji(status) {
71014
- switch (status) {
71331
+ function getWorkflowStatusEmoji(status3) {
71332
+ switch (status3) {
71015
71333
  case "draft":
71016
71334
  return "\uD83D\uDCDD";
71017
71335
  case "active":
@@ -72532,20 +72850,20 @@ function formatTimestamp() {
72532
72850
 
72533
72851
  // src/infrastructure/services/workspace/workspace-resolver.ts
72534
72852
  import { readFile as readFile5, readdir, stat } from "node:fs/promises";
72535
- import { join as join10, basename, resolve as resolve3 } from "node:path";
72853
+ import { join as join11, basename, resolve as resolve3 } from "node:path";
72536
72854
  async function resolveGlobPattern(rootDir, pattern) {
72537
72855
  const cleaned = pattern.replace(/\/+$/, "");
72538
72856
  if (cleaned.includes("..")) {
72539
72857
  return [];
72540
72858
  }
72541
72859
  if (cleaned.endsWith("/*")) {
72542
- const parentDir = join10(rootDir, cleaned.slice(0, -2));
72860
+ const parentDir = join11(rootDir, cleaned.slice(0, -2));
72543
72861
  try {
72544
72862
  const entries2 = await readdir(parentDir, { withFileTypes: true });
72545
72863
  const dirs = [];
72546
72864
  for (const entry of entries2) {
72547
72865
  if (entry.isDirectory()) {
72548
- const dirPath = join10(parentDir, entry.name);
72866
+ const dirPath = join11(parentDir, entry.name);
72549
72867
  if (resolve3(dirPath).startsWith(resolve3(rootDir))) {
72550
72868
  dirs.push(dirPath);
72551
72869
  }
@@ -72556,7 +72874,7 @@ async function resolveGlobPattern(rootDir, pattern) {
72556
72874
  return [];
72557
72875
  }
72558
72876
  } else {
72559
- const dir = join10(rootDir, cleaned);
72877
+ const dir = join11(rootDir, cleaned);
72560
72878
  try {
72561
72879
  if (!resolve3(dir).startsWith(resolve3(rootDir)))
72562
72880
  return [];
@@ -72569,7 +72887,7 @@ async function resolveGlobPattern(rootDir, pattern) {
72569
72887
  }
72570
72888
  async function readPackageJson(dir) {
72571
72889
  try {
72572
- const content = await readFile5(join10(dir, "package.json"), "utf-8");
72890
+ const content = await readFile5(join11(dir, "package.json"), "utf-8");
72573
72891
  const pkg = JSON.parse(content);
72574
72892
  return {
72575
72893
  name: pkg.name || basename(dir),
@@ -72581,7 +72899,7 @@ async function readPackageJson(dir) {
72581
72899
  }
72582
72900
  async function readPnpmWorkspacePatterns(rootDir) {
72583
72901
  try {
72584
- const content = await readFile5(join10(rootDir, "pnpm-workspace.yaml"), "utf-8");
72902
+ const content = await readFile5(join11(rootDir, "pnpm-workspace.yaml"), "utf-8");
72585
72903
  const patterns = [];
72586
72904
  let inPackages = false;
72587
72905
  for (const line of content.split(`
@@ -72608,7 +72926,7 @@ async function readPnpmWorkspacePatterns(rootDir) {
72608
72926
  }
72609
72927
  async function readPackageJsonWorkspacePatterns(rootDir) {
72610
72928
  try {
72611
- const content = await readFile5(join10(rootDir, "package.json"), "utf-8");
72929
+ const content = await readFile5(join11(rootDir, "package.json"), "utf-8");
72612
72930
  const pkg = JSON.parse(content);
72613
72931
  if (!pkg.workspaces)
72614
72932
  return [];
@@ -72657,11 +72975,11 @@ var init_workspace_resolver = () => {};
72657
72975
 
72658
72976
  // src/infrastructure/services/workspace/command-discovery.ts
72659
72977
  import { access as access2, readFile as readFile6 } from "node:fs/promises";
72660
- import { join as join11, relative, basename as basename2 } from "node:path";
72978
+ import { join as join12, relative, basename as basename2 } from "node:path";
72661
72979
  async function detectPackageManager(workingDir) {
72662
72980
  for (const { file, manager } of LOCKFILE_MAP) {
72663
72981
  try {
72664
- await access2(join11(workingDir, file));
72982
+ await access2(join12(workingDir, file));
72665
72983
  return manager;
72666
72984
  } catch {}
72667
72985
  }
@@ -72708,7 +73026,7 @@ async function discoverCommands(workingDir) {
72708
73026
  const turboTaskNames = [];
72709
73027
  let rootPackageName = basename2(workingDir);
72710
73028
  try {
72711
- const pkgPath = join11(workingDir, "package.json");
73029
+ const pkgPath = join12(workingDir, "package.json");
72712
73030
  const pkgContent = await readFile6(pkgPath, "utf-8");
72713
73031
  const pkg = JSON.parse(pkgContent);
72714
73032
  if (pkg.name)
@@ -72729,7 +73047,7 @@ async function discoverCommands(workingDir) {
72729
73047
  } catch {}
72730
73048
  const rootSubWorkspace = { type: "npm", path: ".", name: rootPackageName };
72731
73049
  try {
72732
- const turboPath = join11(workingDir, "turbo.json");
73050
+ const turboPath = join12(workingDir, "turbo.json");
72733
73051
  const turboContent = await readFile6(turboPath, "utf-8");
72734
73052
  const turbo = JSON.parse(turboContent);
72735
73053
  if (turbo.tasks && typeof turbo.tasks === "object") {
@@ -73167,6 +73485,82 @@ var init_file_tree_subscription = __esm(() => {
73167
73485
  init_convex_error();
73168
73486
  });
73169
73487
 
73488
+ // src/infrastructure/harnesses/opencode-sdk/sse-event-buffer.ts
73489
+ var SseEventBuffer;
73490
+ var init_sse_event_buffer = __esm(() => {
73491
+ SseEventBuffer = class SseEventBuffer {
73492
+ _capacity;
73493
+ _onOverflow;
73494
+ _queue = [];
73495
+ _closed = false;
73496
+ _iteratorTaken = false;
73497
+ _waiter = null;
73498
+ constructor(options) {
73499
+ this._capacity = options?.capacity ?? 1024;
73500
+ this._onOverflow = options?.onOverflow;
73501
+ }
73502
+ push(event) {
73503
+ if (this._closed) {
73504
+ return;
73505
+ }
73506
+ let dropped = 0;
73507
+ while (this._queue.length >= this._capacity) {
73508
+ this._queue.shift();
73509
+ dropped++;
73510
+ }
73511
+ if (dropped > 0 && this._onOverflow) {
73512
+ this._onOverflow(dropped);
73513
+ }
73514
+ this._queue.push(event);
73515
+ this._wake();
73516
+ }
73517
+ close() {
73518
+ if (this._closed)
73519
+ return;
73520
+ this._closed = true;
73521
+ this._wake();
73522
+ }
73523
+ get closed() {
73524
+ return this._closed;
73525
+ }
73526
+ get size() {
73527
+ return this._queue.length;
73528
+ }
73529
+ _wake() {
73530
+ if (this._waiter) {
73531
+ const resolve5 = this._waiter;
73532
+ this._waiter = null;
73533
+ resolve5();
73534
+ }
73535
+ }
73536
+ _waitForData() {
73537
+ return new Promise((resolve5) => {
73538
+ this._waiter = resolve5;
73539
+ });
73540
+ }
73541
+ [Symbol.asyncIterator]() {
73542
+ if (this._iteratorTaken) {
73543
+ throw new Error("SseEventBuffer: [Symbol.asyncIterator]() called more than once — only a single consumer is allowed.");
73544
+ }
73545
+ this._iteratorTaken = true;
73546
+ const self2 = this;
73547
+ return {
73548
+ async next() {
73549
+ while (true) {
73550
+ if (self2._queue.length > 0) {
73551
+ return { done: false, value: self2._queue.shift() };
73552
+ }
73553
+ if (self2._closed) {
73554
+ return { done: true, value: undefined };
73555
+ }
73556
+ await self2._waitForData();
73557
+ }
73558
+ }
73559
+ };
73560
+ }
73561
+ };
73562
+ });
73563
+
73170
73564
  // src/infrastructure/harnesses/opencode-sdk/opencode-session.ts
73171
73565
  function toSessionEvent(event) {
73172
73566
  return { type: event.type, payload: event.properties ?? {}, timestamp: Date.now() };
@@ -73174,21 +73568,36 @@ function toSessionEvent(event) {
73174
73568
 
73175
73569
  class OpencodeSdkSession {
73176
73570
  opencodeSessionId;
73177
- sessionTitle;
73571
+ _sessionTitle;
73572
+ get sessionTitle() {
73573
+ return this._sessionTitle;
73574
+ }
73178
73575
  client;
73179
73576
  options;
73180
73577
  onEventListeners = new Set;
73181
73578
  closed = false;
73579
+ _idleResolve = null;
73580
+ _buffer;
73581
+ _consumerStarted = false;
73582
+ _consumerDone = Promise.resolve();
73182
73583
  constructor(options) {
73183
73584
  this.options = options;
73184
73585
  this.opencodeSessionId = options.opencodeSessionId;
73185
- this.sessionTitle = options.sessionTitle;
73586
+ this._sessionTitle = options.sessionTitle;
73186
73587
  this.client = options.client;
73588
+ this._buffer = new SseEventBuffer;
73187
73589
  }
73188
73590
  async prompt(input) {
73189
73591
  if (this.closed)
73190
73592
  throw new Error("Session is closed");
73191
- await this.client.session.prompt({
73593
+ const idlePromise = new Promise((resolve5) => {
73594
+ this._idleResolve = resolve5;
73595
+ });
73596
+ const IDLE_TIMEOUT_MS = 300000;
73597
+ const timeoutPromise = new Promise((_, reject) => {
73598
+ setTimeout(() => reject(new Error("Timed out waiting for session.idle")), IDLE_TIMEOUT_MS);
73599
+ });
73600
+ await this.client.session.promptAsync({
73192
73601
  path: { id: this.opencodeSessionId },
73193
73602
  body: {
73194
73603
  agent: input.agent,
@@ -73198,9 +73607,27 @@ class OpencodeSdkSession {
73198
73607
  ...input.tools ? { tools: input.tools } : {}
73199
73608
  }
73200
73609
  });
73610
+ console.log(`[opencode-session] promptAsync submitted for session ${this.opencodeSessionId}, waiting for session.idle via SSE`);
73611
+ try {
73612
+ await Promise.race([idlePromise, timeoutPromise]);
73613
+ console.log(`[opencode-session] session.idle received via SSE for session ${this.opencodeSessionId}`);
73614
+ } catch (err) {
73615
+ console.warn(`[opencode-session] ${err instanceof Error ? err.message : String(err)} — session ${this.opencodeSessionId}`);
73616
+ this._emit({ type: "session.idle", payload: {}, timestamp: Date.now() });
73617
+ } finally {
73618
+ this._idleResolve = null;
73619
+ }
73620
+ console.log(`[opencode-session] prompt() completed for session ${this.opencodeSessionId}`);
73201
73621
  }
73202
73622
  onEvent(listener) {
73203
73623
  this.onEventListeners.add(listener);
73624
+ if (!this._consumerStarted && !this.closed) {
73625
+ this._consumerStarted = true;
73626
+ this._consumerDone = this._startConsumer().catch((err) => {
73627
+ if (!this.closed)
73628
+ console.warn("[opencode-session] consumer error:", err);
73629
+ });
73630
+ }
73204
73631
  return () => {
73205
73632
  this.onEventListeners.delete(listener);
73206
73633
  };
@@ -73209,6 +73636,8 @@ class OpencodeSdkSession {
73209
73636
  if (this.closed)
73210
73637
  return;
73211
73638
  this.closed = true;
73639
+ this._buffer.close();
73640
+ await this._consumerDone;
73212
73641
  try {
73213
73642
  await this.client.session.abort({ path: { id: this.opencodeSessionId } });
73214
73643
  } catch (err) {
@@ -73219,31 +73648,42 @@ class OpencodeSdkSession {
73219
73648
  this.options.onClose?.(this.opencodeSessionId);
73220
73649
  }
73221
73650
  setTitle(title) {
73222
- this.sessionTitle = title;
73651
+ this._sessionTitle = title;
73223
73652
  }
73224
73653
  _receiveEvent(raw) {
73225
- this._emit(toSessionEvent(raw));
73654
+ this._buffer.push(raw);
73226
73655
  }
73227
73656
  _emit(event) {
73228
73657
  for (const listener of this.onEventListeners)
73229
73658
  listener(event);
73230
73659
  }
73660
+ async _startConsumer() {
73661
+ for await (const raw of this._buffer) {
73662
+ const evt = toSessionEvent(raw);
73663
+ for (const l of this.onEventListeners)
73664
+ l(evt);
73665
+ if (raw.type === "session.idle")
73666
+ this._idleResolve?.();
73667
+ }
73668
+ }
73231
73669
  }
73232
73670
  function isHttpError(err, statusCode) {
73233
73671
  return !!(err && typeof err === "object" && ("status" in err) && err.status === statusCode);
73234
73672
  }
73673
+ var init_opencode_session = __esm(() => {
73674
+ init_sse_event_buffer();
73675
+ });
73235
73676
 
73236
73677
  // src/infrastructure/harnesses/opencode-sdk/opencode-harness.ts
73237
73678
  import { spawn as spawn3 } from "node:child_process";
73238
73679
  function harnessEventSessionId(event) {
73239
73680
  const p = event.properties;
73240
- if (!p || typeof p !== "object")
73681
+ if (!p)
73241
73682
  return;
73242
73683
  if ("sessionID" in p && typeof p.sessionID === "string")
73243
73684
  return p.sessionID;
73244
- const part = p.part;
73245
- if (part && typeof part === "object" && "sessionID" in part && typeof part.sessionID === "string") {
73246
- return part.sessionID;
73685
+ if ("part" in p && p.part && typeof p.part === "object" && "sessionID" in p.part) {
73686
+ return p.part.sessionID;
73247
73687
  }
73248
73688
  return;
73249
73689
  }
@@ -73257,8 +73697,11 @@ class OpencodeSdkHarness {
73257
73697
  baseUrl;
73258
73698
  closed = false;
73259
73699
  sessionListeners = new Map;
73260
- eventLoopRunning = false;
73261
- eventLoopStopped = false;
73700
+ _sseFiber = null;
73701
+ _subscribeCallCount = 0;
73702
+ _debugSubscribeCount() {
73703
+ return this._subscribeCallCount;
73704
+ }
73262
73705
  constructor(options) {
73263
73706
  this.client = options.client;
73264
73707
  this.childProcess = options.process;
@@ -73291,9 +73734,9 @@ class OpencodeSdkHarness {
73291
73734
  }
73292
73735
  async listProviders() {
73293
73736
  const result = await this.client.provider.list();
73294
- const all6 = result.data?.all ?? [];
73737
+ const all8 = result.data?.all ?? [];
73295
73738
  const connected = new Set(result.data?.connected ?? []);
73296
- return all6.filter((p) => connected.has(p.id)).map((p) => ({
73739
+ return all8.filter((p) => connected.has(p.id)).map((p) => ({
73297
73740
  providerID: p.id,
73298
73741
  name: p.name,
73299
73742
  models: Object.entries(p.models ?? {}).map(([modelID, m]) => ({
@@ -73328,7 +73771,8 @@ class OpencodeSdkHarness {
73328
73771
  client: this.client,
73329
73772
  opencodeSessionId: sessionId,
73330
73773
  sessionTitle,
73331
- onClose: (id) => this.unregisterSessionListener(id)
73774
+ cwd: this.cwd,
73775
+ onClose: (id3) => this.unregisterSessionListener(id3)
73332
73776
  });
73333
73777
  this.registerSessionListener(sessionId, session);
73334
73778
  return session;
@@ -73349,7 +73793,8 @@ class OpencodeSdkHarness {
73349
73793
  client: this.client,
73350
73794
  opencodeSessionId: sessionId,
73351
73795
  sessionTitle,
73352
- onClose: (id) => this.unregisterSessionListener(id)
73796
+ cwd: this.cwd,
73797
+ onClose: (id3) => this.unregisterSessionListener(id3)
73353
73798
  });
73354
73799
  this.registerSessionListener(sessionId, session);
73355
73800
  return session;
@@ -73361,53 +73806,89 @@ class OpencodeSdkHarness {
73361
73806
  }
73362
73807
  registerSessionListener(opencodeSessionId, session) {
73363
73808
  this.sessionListeners.set(opencodeSessionId, session);
73364
- if (!this.eventLoopRunning) {
73365
- this.eventLoopRunning = true;
73366
- this.eventLoopStopped = false;
73367
- this.runEventLoop().catch((err) => {
73368
- if (!this.closed)
73369
- console.warn("[opencode-harness] SSE event loop error:", err);
73370
- });
73809
+ console.log(`[opencode-harness] Registered session listener: "${opencodeSessionId}"`);
73810
+ if (this._sseFiber === null && !this.closed) {
73811
+ this._sseFiber = exports_Effect.runFork(this.buildSseProgram());
73371
73812
  }
73372
73813
  }
73373
73814
  unregisterSessionListener(opencodeSessionId) {
73374
73815
  this.sessionListeners.delete(opencodeSessionId);
73375
- if (this.sessionListeners.size === 0) {
73376
- this.eventLoopStopped = true;
73377
- }
73378
- }
73379
- async runEventLoop() {
73380
- let attempt = 0;
73381
- while (!this.closed && !this.eventLoopStopped && attempt < 2) {
73382
- attempt++;
73383
- try {
73384
- const result = await this.client.event.subscribe();
73385
- const stream4 = result.stream;
73386
- const iterator2 = stream4[Symbol.asyncIterator]();
73387
- while (true) {
73388
- let next4;
73816
+ console.log(`[opencode-harness] Unregistered session listener: "${opencodeSessionId}"`);
73817
+ if (this.sessionListeners.size === 0 && this._sseFiber !== null) {
73818
+ const fiber = this._sseFiber;
73819
+ this._sseFiber = null;
73820
+ exports_Effect.runFork(exports_Fiber.interrupt(fiber));
73821
+ }
73822
+ }
73823
+ buildSseProgram() {
73824
+ const self2 = this;
73825
+ return exports_Effect.async((resume2) => {
73826
+ let interrupted3 = false;
73827
+ let abortController = null;
73828
+ const runLoop2 = async () => {
73829
+ while (!interrupted3 && !self2.closed) {
73830
+ self2._subscribeCallCount++;
73831
+ let result = null;
73832
+ abortController = new AbortController;
73389
73833
  try {
73390
- next4 = await iterator2.next();
73391
- } catch {
73392
- break;
73834
+ result = await self2.client.global.event({ signal: abortController.signal });
73835
+ } catch (e) {
73836
+ if (interrupted3 || self2.closed)
73837
+ break;
73838
+ console.warn("[opencode-harness] SSE subscribe error:", e);
73839
+ await new Promise((r) => setTimeout(r, 500));
73840
+ continue;
73841
+ } finally {
73842
+ abortController = null;
73393
73843
  }
73394
- if (next4.done || this.closed || this.eventLoopStopped)
73844
+ if (interrupted3 || self2.closed)
73395
73845
  break;
73396
- const raw = next4.value;
73397
- const sid = harnessEventSessionId(raw);
73398
- if (sid) {
73399
- this.sessionListeners.get(sid)?._receiveEvent(raw);
73846
+ if (!result || !result.stream) {
73847
+ await new Promise((r) => setTimeout(r, 100));
73848
+ continue;
73849
+ }
73850
+ const iterator2 = result.stream[Symbol.asyncIterator]();
73851
+ try {
73852
+ while (!interrupted3 && !self2.closed) {
73853
+ let next4;
73854
+ try {
73855
+ next4 = await iterator2.next();
73856
+ } catch {
73857
+ break;
73858
+ }
73859
+ if (next4.done)
73860
+ break;
73861
+ const globalEvent = next4.value;
73862
+ const raw = globalEvent.payload;
73863
+ try {
73864
+ const sid = harnessEventSessionId(raw);
73865
+ if (sid) {
73866
+ const session = self2.sessionListeners.get(sid);
73867
+ if (session) {
73868
+ session._receiveEvent(raw);
73869
+ } else {
73870
+ console.warn(`[opencode-harness] Event type="${raw.type}" has sessionID="${sid}" but NO matching listener`);
73871
+ }
73872
+ } else if (raw?.type !== "server.connected") {}
73873
+ } catch (e) {
73874
+ console.warn("[opencode-harness] Error routing event:", e);
73875
+ }
73876
+ }
73877
+ } finally {
73878
+ iterator2.return?.();
73879
+ }
73880
+ if (!interrupted3 && !self2.closed) {
73881
+ await new Promise((r) => setTimeout(r, 100));
73400
73882
  }
73401
73883
  }
73402
- if (this.closed || this.eventLoopStopped)
73403
- break;
73404
- } catch {
73405
- if (this.closed || this.eventLoopStopped || attempt >= 2)
73406
- break;
73407
- await new Promise((resolve5) => setTimeout(resolve5, 500));
73408
- }
73409
- }
73410
- this.eventLoopRunning = false;
73884
+ resume2(exports_Effect.succeed(undefined));
73885
+ };
73886
+ runLoop2();
73887
+ return exports_Effect.sync(() => {
73888
+ interrupted3 = true;
73889
+ abortController?.abort();
73890
+ });
73891
+ });
73411
73892
  }
73412
73893
  async fetchSessionTitle(opencodeSessionId) {
73413
73894
  try {
@@ -73421,7 +73902,11 @@ class OpencodeSdkHarness {
73421
73902
  if (this.closed)
73422
73903
  return;
73423
73904
  this.closed = true;
73424
- this.eventLoopStopped = true;
73905
+ if (this._sseFiber !== null) {
73906
+ const fiber = this._sseFiber;
73907
+ this._sseFiber = null;
73908
+ await exports_Effect.runPromise(exports_Fiber.interrupt(fiber));
73909
+ }
73425
73910
  this.sessionListeners.clear();
73426
73911
  this.childProcess.kill("SIGTERM");
73427
73912
  await new Promise((resolve5) => {
@@ -73471,6 +73956,8 @@ var OPENCODE_COMMAND3 = "opencode", SERVE_STARTUP_TIMEOUT_MS2 = 1e4, startOpenco
73471
73956
  };
73472
73957
  var init_opencode_harness = __esm(() => {
73473
73958
  init_dist();
73959
+ init_esm();
73960
+ init_opencode_session();
73474
73961
  init_parse_listening_url();
73475
73962
  });
73476
73963
 
@@ -74191,7 +74678,7 @@ var init_on_request_stop_agent = () => {};
74191
74678
  import { createHash as createHash4 } from "node:crypto";
74192
74679
  import { existsSync as existsSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync2, unlinkSync, mkdirSync as mkdirSync2 } from "node:fs";
74193
74680
  import { homedir as homedir5 } from "node:os";
74194
- import { join as join13 } from "node:path";
74681
+ import { join as join14 } from "node:path";
74195
74682
  function getUrlHash() {
74196
74683
  const url2 = getConvexUrl();
74197
74684
  return createHash4("sha256").update(url2).digest("hex").substring(0, 8);
@@ -74205,7 +74692,7 @@ function ensureChatroomDir2() {
74205
74692
  }
74206
74693
  }
74207
74694
  function getPidFilePath() {
74208
- return join13(CHATROOM_DIR4, getPidFileName());
74695
+ return join14(CHATROOM_DIR4, getPidFileName());
74209
74696
  }
74210
74697
  function isProcessRunning(pid) {
74211
74698
  try {
@@ -74270,7 +74757,7 @@ function releaseLock() {
74270
74757
  var CHATROOM_DIR4;
74271
74758
  var init_pid = __esm(() => {
74272
74759
  init_client2();
74273
- CHATROOM_DIR4 = join13(homedir5(), ".chatroom");
74760
+ CHATROOM_DIR4 = join14(homedir5(), ".chatroom");
74274
74761
  });
74275
74762
 
74276
74763
  // src/infrastructure/git/types.ts
@@ -74634,10 +75121,10 @@ async function getRemotes(cwd) {
74634
75121
  const seen = new Set;
74635
75122
  const remotes = [];
74636
75123
  for (const line of lines) {
74637
- const match11 = line.match(/^(\S+)\s+(\S+)\s+\((\w+)\)$/);
74638
- if (!match11)
75124
+ const match14 = line.match(/^(\S+)\s+(\S+)\s+\((\w+)\)$/);
75125
+ if (!match14)
74639
75126
  continue;
74640
- const [, name, url2, type] = match11;
75127
+ const [, name, url2, type] = match14;
74641
75128
  if (!name || !url2)
74642
75129
  continue;
74643
75130
  if (type === "fetch" && !seen.has(name)) {
@@ -74931,9 +75418,9 @@ async function processRecentCommits(ctx, req) {
74931
75418
  }
74932
75419
  async function processRequests(ctx, requests, processedRequestIds, dedupTtlMs) {
74933
75420
  const evictBefore = Date.now() - dedupTtlMs;
74934
- for (const [id, ts] of processedRequestIds) {
75421
+ for (const [id3, ts] of processedRequestIds) {
74935
75422
  if (ts < evictBefore)
74936
- processedRequestIds.delete(id);
75423
+ processedRequestIds.delete(id3);
74937
75424
  }
74938
75425
  for (const req of requests) {
74939
75426
  const requestId = req._id.toString();
@@ -75371,6 +75858,9 @@ function evictStalePendingStops() {
75371
75858
  pendingStops.delete(runId);
75372
75859
  }
75373
75860
  }
75861
+ function buildCommandKey(machineId, workingDir, commandName) {
75862
+ return `${machineId}|${workingDir}|${commandName}`;
75863
+ }
75374
75864
  async function reportRunFailed(ctx, runId, reason) {
75375
75865
  try {
75376
75866
  await ctx.deps.backend.mutation(api.commands.updateRunStatus, {
@@ -75408,9 +75898,42 @@ function appendToBuffer(ctx, tracked, data) {
75408
75898
  flushOutput(ctx, tracked).catch(() => {});
75409
75899
  }
75410
75900
  }
75901
+ function killProcess(child, signal) {
75902
+ try {
75903
+ child.kill(signal);
75904
+ } catch {}
75905
+ }
75906
+ function waitForExit(runIdStr, ms) {
75907
+ return new Promise((resolve5) => {
75908
+ const interval = 100;
75909
+ let elapsed3 = 0;
75910
+ const timer = setInterval(() => {
75911
+ if (!runningProcesses.has(runIdStr)) {
75912
+ clearInterval(timer);
75913
+ resolve5(true);
75914
+ return;
75915
+ }
75916
+ elapsed3 += interval;
75917
+ if (elapsed3 >= ms) {
75918
+ clearInterval(timer);
75919
+ resolve5(false);
75920
+ }
75921
+ }, interval);
75922
+ });
75923
+ }
75924
+ async function killTrackedProcess(tracked) {
75925
+ killProcess(tracked.process, "SIGTERM");
75926
+ const exited = await waitForExit(tracked.runId, SIGTERM_GRACE_PERIOD_MS);
75927
+ if (!exited) {
75928
+ console.log(`[${formatTimestamp()}] \uD83D\uDD2A Force-killing process: ${tracked.runId}`);
75929
+ killProcess(tracked.process, "SIGKILL");
75930
+ await waitForExit(tracked.runId, 1000);
75931
+ }
75932
+ }
75411
75933
  async function onCommandRun(ctx, event) {
75412
75934
  const { workingDir, commandName, script, runId } = event;
75413
75935
  const runIdStr = runId.toString();
75936
+ const commandKey = buildCommandKey(ctx.machineId, workingDir, commandName);
75414
75937
  if (runningProcesses.has(runIdStr)) {
75415
75938
  console.log(`[${formatTimestamp()}] ⚠️ Command already running: ${runIdStr}`);
75416
75939
  return;
@@ -75430,6 +75953,19 @@ async function onCommandRun(ctx, event) {
75430
75953
  }
75431
75954
  return;
75432
75955
  }
75956
+ const priorRunId = runningProcessesByCommand.get(commandKey);
75957
+ if (priorRunId) {
75958
+ const priorTracked = runningProcesses.get(priorRunId);
75959
+ if (priorTracked) {
75960
+ console.log(`[${formatTimestamp()}] \uD83D\uDD04 Replacing prior run ${priorRunId} with ${runIdStr} for ${commandName}`);
75961
+ clearInterval(priorTracked.flushTimer);
75962
+ if (priorTracked.softTimeoutTimer)
75963
+ clearTimeout(priorTracked.softTimeoutTimer);
75964
+ await killTrackedProcess(priorTracked);
75965
+ runningProcesses.delete(priorRunId);
75966
+ runningProcessesByCommand.delete(commandKey);
75967
+ }
75968
+ }
75433
75969
  console.log(`[${formatTimestamp()}] \uD83D\uDE80 Running command: ${commandName} → ${script}`);
75434
75970
  if (!workingDir.startsWith("/")) {
75435
75971
  console.error(`[${formatTimestamp()}] ❌ Rejected command: workingDir is not absolute: ${workingDir}`);
@@ -75446,49 +75982,48 @@ async function onCommandRun(ctx, event) {
75446
75982
  const child = spawn4("sh", ["-c", script], {
75447
75983
  cwd: workingDir,
75448
75984
  env: { ...process.env },
75449
- stdio: ["ignore", "pipe", "pipe"],
75450
- detached: true
75985
+ stdio: ["ignore", "pipe", "pipe"]
75451
75986
  });
75452
- const timeoutTimer = setTimeout(() => {
75453
- console.log(`[${formatTimestamp()}] ⏰ Command timed out after ${DEFAULT_COMMAND_TIMEOUT_MS / 60000} minutes: ${commandName} (runId: ${runIdStr})`);
75454
- const pid = child.pid;
75455
- if (pid) {
75456
- try {
75457
- process.kill(-pid, "SIGTERM");
75458
- } catch {
75459
- child.kill("SIGTERM");
75460
- }
75461
- } else {
75462
- child.kill("SIGTERM");
75463
- }
75464
- setTimeout(() => {
75465
- if (!runningProcesses.has(runIdStr))
75466
- return;
75467
- console.log(`[${formatTimestamp()}] \uD83D\uDD2A Force-killing timed-out process: ${runIdStr}`);
75468
- if (pid) {
75469
- try {
75470
- process.kill(-pid, "SIGKILL");
75471
- } catch {
75472
- child.kill("SIGKILL");
75473
- }
75474
- } else {
75475
- child.kill("SIGKILL");
75476
- }
75477
- }, SIGTERM_GRACE_PERIOD_MS);
75478
- }, DEFAULT_COMMAND_TIMEOUT_MS);
75479
- timeoutTimer.unref?.();
75480
75987
  const tracked = {
75481
75988
  process: child,
75482
75989
  runId: runIdStr,
75990
+ commandKey,
75483
75991
  outputBuffer: "",
75484
75992
  chunkIndex: 0,
75485
75993
  flushTimer: setInterval(() => {
75486
75994
  flushOutput(ctx, tracked).catch(() => {});
75487
75995
  }, OUTPUT_FLUSH_INTERVAL_MS),
75488
- timeoutTimer
75996
+ softTimeoutTimer: null
75489
75997
  };
75490
75998
  tracked.flushTimer.unref?.();
75491
75999
  runningProcesses.set(runIdStr, tracked);
76000
+ runningProcessesByCommand.set(commandKey, runIdStr);
76001
+ const softTimeoutTimer = setTimeout(async () => {
76002
+ console.log(`[${formatTimestamp()}] ⏰ Command soft timeout (24h): ${commandName} (runId: ${runIdStr})`);
76003
+ const currentTracked = runningProcesses.get(runIdStr);
76004
+ if (!currentTracked)
76005
+ return;
76006
+ try {
76007
+ await ctx.deps.backend.mutation(api.commands.updateRunStatus, {
76008
+ sessionId: ctx.sessionId,
76009
+ machineId: ctx.machineId,
76010
+ runId,
76011
+ status: "killed",
76012
+ terminationReason: "timeout-24h"
76013
+ });
76014
+ } catch (err) {
76015
+ console.warn(`[${formatTimestamp()}] ⚠️ Failed to mark run as killed (timeout): ${getErrorMessage(err)}`);
76016
+ }
76017
+ killProcess(child, "SIGTERM");
76018
+ setTimeout(() => {
76019
+ if (!runningProcesses.has(runIdStr))
76020
+ return;
76021
+ console.log(`[${formatTimestamp()}] \uD83D\uDD2A Force-killing timed-out process: ${runIdStr}`);
76022
+ killProcess(child, "SIGKILL");
76023
+ }, SIGTERM_GRACE_PERIOD_MS);
76024
+ }, SOFT_TIMEOUT_MS);
76025
+ softTimeoutTimer.unref?.();
76026
+ tracked.softTimeoutTimer = softTimeoutTimer;
75492
76027
  try {
75493
76028
  await ctx.deps.backend.mutation(api.commands.updateRunStatus, {
75494
76029
  sessionId: ctx.sessionId,
@@ -75510,16 +76045,19 @@ async function onCommandRun(ctx, event) {
75510
76045
  console.log(`[${formatTimestamp()}] \uD83C\uDFC1 Command exited: ${commandName} (code=${code2}, signal=${signal})`);
75511
76046
  await flushOutput(ctx, tracked).catch(() => {});
75512
76047
  clearInterval(tracked.flushTimer);
75513
- if (tracked.timeoutTimer)
75514
- clearTimeout(tracked.timeoutTimer);
76048
+ if (tracked.softTimeoutTimer)
76049
+ clearTimeout(tracked.softTimeoutTimer);
75515
76050
  runningProcesses.delete(runIdStr);
75516
- const status = code2 === 0 ? "completed" : signal ? "stopped" : "failed";
76051
+ if (runningProcessesByCommand.get(commandKey) === runIdStr) {
76052
+ runningProcessesByCommand.delete(commandKey);
76053
+ }
76054
+ const status3 = code2 === 0 ? "completed" : signal ? "stopped" : "failed";
75517
76055
  try {
75518
76056
  await ctx.deps.backend.mutation(api.commands.updateRunStatus, {
75519
76057
  sessionId: ctx.sessionId,
75520
76058
  machineId: ctx.machineId,
75521
76059
  runId,
75522
- status,
76060
+ status: status3,
75523
76061
  exitCode: code2 ?? undefined
75524
76062
  });
75525
76063
  } catch (err) {
@@ -75529,9 +76067,12 @@ async function onCommandRun(ctx, event) {
75529
76067
  child.on("error", async (err) => {
75530
76068
  console.error(`[${formatTimestamp()}] ❌ Command spawn failed: ${commandName}: ${err.message}`);
75531
76069
  clearInterval(tracked.flushTimer);
75532
- if (tracked.timeoutTimer)
75533
- clearTimeout(tracked.timeoutTimer);
76070
+ if (tracked.softTimeoutTimer)
76071
+ clearTimeout(tracked.softTimeoutTimer);
75534
76072
  runningProcesses.delete(runIdStr);
76073
+ if (runningProcessesByCommand.get(commandKey) === runIdStr) {
76074
+ runningProcessesByCommand.delete(commandKey);
76075
+ }
75535
76076
  try {
75536
76077
  await ctx.deps.backend.mutation(api.commands.updateRunStatus, {
75537
76078
  sessionId: ctx.sessionId,
@@ -75544,36 +76085,6 @@ async function onCommandRun(ctx, event) {
75544
76085
  }
75545
76086
  });
75546
76087
  }
75547
- function killProcess(child, signal) {
75548
- const pid = child.pid;
75549
- if (pid) {
75550
- try {
75551
- process.kill(-pid, signal);
75552
- return;
75553
- } catch {}
75554
- }
75555
- try {
75556
- child.kill(signal);
75557
- } catch {}
75558
- }
75559
- function waitForExit(runIdStr, ms) {
75560
- return new Promise((resolve5) => {
75561
- const interval = 100;
75562
- let elapsed3 = 0;
75563
- const timer = setInterval(() => {
75564
- if (!runningProcesses.has(runIdStr)) {
75565
- clearInterval(timer);
75566
- resolve5(true);
75567
- return;
75568
- }
75569
- elapsed3 += interval;
75570
- if (elapsed3 >= ms) {
75571
- clearInterval(timer);
75572
- resolve5(false);
75573
- }
75574
- }, interval);
75575
- });
75576
- }
75577
76088
  async function onCommandStop(ctx, event) {
75578
76089
  const runIdStr = event.runId.toString();
75579
76090
  const tracked = runningProcesses.get(runIdStr);
@@ -75594,19 +76105,16 @@ async function onCommandStop(ctx, event) {
75594
76105
  return;
75595
76106
  }
75596
76107
  console.log(`[${formatTimestamp()}] \uD83D\uDED1 Stopping command run: ${runIdStr}`);
75597
- if (tracked.timeoutTimer) {
75598
- clearTimeout(tracked.timeoutTimer);
75599
- tracked.timeoutTimer = null;
76108
+ if (tracked.softTimeoutTimer) {
76109
+ clearTimeout(tracked.softTimeoutTimer);
76110
+ tracked.softTimeoutTimer = null;
75600
76111
  }
75601
76112
  killProcess(tracked.process, "SIGTERM");
75602
76113
  const exitedAfterSigterm = await waitForExit(runIdStr, SIGTERM_GRACE_PERIOD_MS);
75603
76114
  if (!exitedAfterSigterm) {
75604
76115
  console.log(`[${formatTimestamp()}] \uD83D\uDD2A Force-killing process: ${runIdStr}`);
75605
76116
  killProcess(tracked.process, "SIGKILL");
75606
- const exitedAfterSigkill = await waitForExit(runIdStr, 1000);
75607
- if (!exitedAfterSigkill) {
75608
- console.error(`[${formatTimestamp()}] ❌ Failed to stop process for run: ${runIdStr} — process did not exit after SIGKILL`);
75609
- }
76117
+ await waitForExit(runIdStr, 1000);
75610
76118
  }
75611
76119
  try {
75612
76120
  await ctx.deps.backend.mutation(api.commands.updateRunStatus, {
@@ -75623,49 +76131,47 @@ async function shutdownAllCommands(ctx) {
75623
76131
  if (runningProcesses.size === 0)
75624
76132
  return;
75625
76133
  console.log(`[${formatTimestamp()}] Shutting down ${runningProcesses.size} running command(s)...`);
75626
- for (const [, tracked] of runningProcesses) {
76134
+ const trackedEntries = [...runningProcesses.entries()];
76135
+ for (const [, tracked] of trackedEntries) {
75627
76136
  clearInterval(tracked.flushTimer);
75628
- if (tracked.timeoutTimer)
75629
- clearTimeout(tracked.timeoutTimer);
76137
+ if (tracked.softTimeoutTimer)
76138
+ clearTimeout(tracked.softTimeoutTimer);
75630
76139
  await flushOutput(ctx, tracked).catch(() => {});
75631
- const pid = tracked.process.pid;
75632
- if (pid) {
75633
- try {
75634
- process.kill(-pid, "SIGTERM");
75635
- } catch {
75636
- tracked.process.kill("SIGTERM");
75637
- }
75638
- } else {
75639
- tracked.process.kill("SIGTERM");
76140
+ try {
76141
+ await ctx.deps.backend.mutation(api.commands.updateRunStatus, {
76142
+ sessionId: ctx.sessionId,
76143
+ machineId: ctx.machineId,
76144
+ runId: tracked.runId,
76145
+ status: "killed",
76146
+ terminationReason: "daemon-shutdown"
76147
+ });
76148
+ } catch (err) {
76149
+ console.warn(`[${formatTimestamp()}] ⚠️ Failed to mark run as killed on shutdown: ${getErrorMessage(err)}`);
75640
76150
  }
76151
+ killProcess(tracked.process, "SIGTERM");
75641
76152
  }
75642
76153
  await new Promise((resolve5) => {
75643
76154
  const t = setTimeout(resolve5, 3000);
75644
76155
  t.unref?.();
75645
76156
  });
75646
- for (const [, tracked] of runningProcesses) {
75647
- const pid = tracked.process.pid;
75648
- if (pid) {
75649
- try {
75650
- process.kill(-pid, "SIGKILL");
75651
- } catch {}
75652
- } else {
75653
- try {
75654
- tracked.process.kill("SIGKILL");
75655
- } catch {}
76157
+ for (const [, tracked] of trackedEntries) {
76158
+ if (runningProcesses.has(tracked.runId)) {
76159
+ killProcess(tracked.process, "SIGKILL");
75656
76160
  }
75657
76161
  }
75658
76162
  runningProcesses.clear();
76163
+ runningProcessesByCommand.clear();
75659
76164
  console.log(`[${formatTimestamp()}] All commands stopped`);
75660
76165
  }
75661
- var runningProcesses, pendingStops, PENDING_STOP_TTL_MS = 60000, OUTPUT_FLUSH_INTERVAL_MS = 3000, MAX_BUFFER_SIZE, DEFAULT_COMMAND_TIMEOUT_MS, SIGTERM_GRACE_PERIOD_MS = 5000;
76166
+ var runningProcesses, runningProcessesByCommand, pendingStops, PENDING_STOP_TTL_MS = 60000, OUTPUT_FLUSH_INTERVAL_MS = 3000, MAX_BUFFER_SIZE, SOFT_TIMEOUT_MS, SIGTERM_GRACE_PERIOD_MS = 5000;
75662
76167
  var init_command_runner = __esm(() => {
75663
76168
  init_api3();
75664
76169
  init_convex_error();
75665
76170
  runningProcesses = new Map;
76171
+ runningProcessesByCommand = new Map;
75666
76172
  pendingStops = new Map;
75667
76173
  MAX_BUFFER_SIZE = 100 * 1024;
75668
- DEFAULT_COMMAND_TIMEOUT_MS = 30 * 60 * 1000;
76174
+ SOFT_TIMEOUT_MS = 24 * 60 * 60 * 1000;
75669
76175
  });
75670
76176
 
75671
76177
  // src/commands/machine/daemon-start/handlers/ping.ts
@@ -77063,16 +77569,23 @@ class ConvexOutputRepository {
77063
77569
  const { backend, sessionId } = this.options;
77064
77570
  if (chunks.length === 0)
77065
77571
  return;
77066
- await backend.mutation(api.daemon.directHarness.messages.appendMessages, {
77067
- sessionId,
77068
- harnessSessionId,
77069
- chunks: chunks.map((c) => ({
77070
- content: c.content,
77071
- timestamp: c.timestamp,
77072
- messageId: c.messageId,
77073
- partType: c.partType
77074
- }))
77075
- });
77572
+ console.log(`[output-repo] Calling appendMessages: harnessSessionId="${harnessSessionId}", ${chunks.length} chunks`);
77573
+ try {
77574
+ await backend.mutation(api.daemon.directHarness.messages.appendMessages, {
77575
+ sessionId,
77576
+ harnessSessionId,
77577
+ chunks: chunks.map((c) => ({
77578
+ content: c.content,
77579
+ timestamp: c.timestamp,
77580
+ messageId: c.messageId,
77581
+ partType: c.partType
77582
+ }))
77583
+ });
77584
+ console.log(`[output-repo] appendMessages succeeded for "${harnessSessionId}"`);
77585
+ } catch (err) {
77586
+ console.error(`[output-repo] appendMessages FAILED for "${harnessSessionId}": ${err instanceof Error ? err.message : String(err)}`);
77587
+ throw err;
77588
+ }
77076
77589
  }
77077
77590
  }
77078
77591
  var init_convex_output_repository = __esm(() => {
@@ -77086,7 +77599,7 @@ class BufferedJournalFactory {
77086
77599
  this.options = options;
77087
77600
  }
77088
77601
  create(harnessSessionId) {
77089
- const { outputRepository, flushIntervalMs = 1000, logger = console } = this.options;
77602
+ const { outputRepository, flushIntervalMs = 500, logger = console } = this.options;
77090
77603
  const buffer = [];
77091
77604
  let flushInProgress = false;
77092
77605
  const intervalHandle = setInterval(() => {
@@ -77094,9 +77607,10 @@ class BufferedJournalFactory {
77094
77607
  return;
77095
77608
  flushInProgress = true;
77096
77609
  const batch = buffer.splice(0);
77610
+ console.log(`[journal] Flushing ${batch.length} chunks for session ${harnessSessionId}`);
77097
77611
  outputRepository.appendChunks(harnessSessionId, batch).catch((err) => {
77098
77612
  buffer.unshift(...batch);
77099
- logger.warn("Journal flush failed, re-queued %d chunks: %s", batch.length, err instanceof Error ? err.message : String(err));
77613
+ logger.warn(`[journal] Flush FAILED for ${harnessSessionId}: ${err instanceof Error ? err.message : String(err)}`);
77100
77614
  }).finally(() => {
77101
77615
  flushInProgress = false;
77102
77616
  });
@@ -77112,6 +77626,7 @@ class BufferedJournalFactory {
77112
77626
  messageId: chunk2.messageId,
77113
77627
  partType: chunk2.partType
77114
77628
  });
77629
+ logger.log?.(`[journal] chunk recorded session=${harnessSessionId} messageId=${chunk2.messageId ?? "-"} partType=${chunk2.partType ?? "text"} bytes=${chunk2.content.length}`);
77115
77630
  },
77116
77631
  async flush() {
77117
77632
  if (buffer.length === 0)
@@ -77360,8 +77875,8 @@ function diffModels(previous, next4) {
77360
77875
  hasChanges: Object.keys(added).length > 0 || Object.keys(removed).length > 0
77361
77876
  };
77362
77877
  }
77363
- function formatModelMap(map13) {
77364
- return Object.entries(map13).map(([harness, models]) => `${harness}: ${models.join(", ")}`).join("; ");
77878
+ function formatModelMap(map15) {
77879
+ return Object.entries(map15).map(([harness, models]) => `${harness}: ${models.join(", ")}`).join("; ");
77365
77880
  }
77366
77881
  async function refreshModels(ctx) {
77367
77882
  if (!ctx.config) {
@@ -77404,33 +77919,33 @@ async function refreshModels(ctx) {
77404
77919
  }
77405
77920
  function evictStaleDedupEntries(tracker) {
77406
77921
  const evictBefore = Date.now() - AGENT_REQUEST_DEADLINE_MS;
77407
- for (const [id, ts] of tracker.commandIds) {
77922
+ for (const [id3, ts] of tracker.commandIds) {
77408
77923
  if (ts < evictBefore)
77409
- tracker.commandIds.delete(id);
77924
+ tracker.commandIds.delete(id3);
77410
77925
  }
77411
- for (const [id, ts] of tracker.pingIds) {
77926
+ for (const [id3, ts] of tracker.pingIds) {
77412
77927
  if (ts < evictBefore)
77413
- tracker.pingIds.delete(id);
77928
+ tracker.pingIds.delete(id3);
77414
77929
  }
77415
- for (const [id, ts] of tracker.gitRefreshIds) {
77930
+ for (const [id3, ts] of tracker.gitRefreshIds) {
77416
77931
  if (ts < evictBefore)
77417
- tracker.gitRefreshIds.delete(id);
77932
+ tracker.gitRefreshIds.delete(id3);
77418
77933
  }
77419
- for (const [id, ts] of tracker.capabilitiesRefreshIds) {
77934
+ for (const [id3, ts] of tracker.capabilitiesRefreshIds) {
77420
77935
  if (ts < evictBefore)
77421
- tracker.capabilitiesRefreshIds.delete(id);
77936
+ tracker.capabilitiesRefreshIds.delete(id3);
77422
77937
  }
77423
- for (const [id, ts] of tracker.localActionIds) {
77938
+ for (const [id3, ts] of tracker.localActionIds) {
77424
77939
  if (ts < evictBefore)
77425
- tracker.localActionIds.delete(id);
77940
+ tracker.localActionIds.delete(id3);
77426
77941
  }
77427
- for (const [id, ts] of tracker.commandRunIds) {
77942
+ for (const [id3, ts] of tracker.commandRunIds) {
77428
77943
  if (ts < evictBefore)
77429
- tracker.commandRunIds.delete(id);
77944
+ tracker.commandRunIds.delete(id3);
77430
77945
  }
77431
- for (const [id, ts] of tracker.commandStopIds) {
77946
+ for (const [id3, ts] of tracker.commandStopIds) {
77432
77947
  if (ts < evictBefore)
77433
- tracker.commandStopIds.delete(id);
77948
+ tracker.commandStopIds.delete(id3);
77434
77949
  }
77435
77950
  evictStalePendingStops();
77436
77951
  }
@@ -77494,17 +78009,17 @@ async function dispatchCommandEvent(ctx, event, tracker) {
77494
78009
  if (!batchId) {
77495
78010
  return;
77496
78011
  }
77497
- let status;
78012
+ let status3;
77498
78013
  let errorMessage;
77499
78014
  if (outcome.kind === "pushed") {
77500
- status = "completed";
78015
+ status3 = "completed";
77501
78016
  } else if (outcome.kind === "skipped_no_changes") {
77502
- status = "skipped_no_changes";
78017
+ status3 = "skipped_no_changes";
77503
78018
  } else if (outcome.kind === "failed") {
77504
- status = "failed";
78019
+ status3 = "failed";
77505
78020
  errorMessage = outcome.message;
77506
78021
  } else {
77507
- status = "failed";
78022
+ status3 = "failed";
77508
78023
  errorMessage = "Daemon configuration unavailable";
77509
78024
  }
77510
78025
  try {
@@ -77512,7 +78027,7 @@ async function dispatchCommandEvent(ctx, event, tracker) {
77512
78027
  sessionId: ctx.sessionId,
77513
78028
  batchId,
77514
78029
  machineId: ctx.machineId,
77515
- status,
78030
+ status: status3,
77516
78031
  errorMessage
77517
78032
  });
77518
78033
  } catch (error) {
@@ -78793,5 +79308,5 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
78793
79308
  });
78794
79309
  program2.parse();
78795
79310
 
78796
- //# debugId=5C16A49415B864E364756E2164756E21
79311
+ //# debugId=1884CBA22481288264756E2164756E21
78797
79312
  //# sourceMappingURL=index.js.map