btca 0.0.5 → 0.1.0

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
@@ -13133,6 +13133,56 @@ var reduce2 = reduce;
13133
13133
  var reduceRight2 = reduceRight;
13134
13134
 
13135
13135
  // node_modules/effect/dist/esm/Duration.js
13136
+ var exports_Duration = {};
13137
+ __export(exports_Duration, {
13138
+ zero: () => zero,
13139
+ weeks: () => weeks,
13140
+ unsafeToNanos: () => unsafeToNanos,
13141
+ unsafeFormatIso: () => unsafeFormatIso,
13142
+ unsafeDivide: () => unsafeDivide,
13143
+ toWeeks: () => toWeeks,
13144
+ toSeconds: () => toSeconds,
13145
+ toNanos: () => toNanos,
13146
+ toMinutes: () => toMinutes,
13147
+ toMillis: () => toMillis,
13148
+ toHrTime: () => toHrTime,
13149
+ toHours: () => toHours,
13150
+ toDays: () => toDays,
13151
+ times: () => times,
13152
+ sum: () => sum,
13153
+ subtract: () => subtract,
13154
+ seconds: () => seconds,
13155
+ parts: () => parts,
13156
+ nanos: () => nanos,
13157
+ minutes: () => minutes,
13158
+ min: () => min2,
13159
+ millis: () => millis,
13160
+ micros: () => micros,
13161
+ max: () => max2,
13162
+ matchWith: () => matchWith,
13163
+ match: () => match4,
13164
+ lessThanOrEqualTo: () => lessThanOrEqualTo2,
13165
+ lessThan: () => lessThan2,
13166
+ isZero: () => isZero,
13167
+ isFinite: () => isFinite2,
13168
+ isDuration: () => isDuration,
13169
+ infinity: () => infinity,
13170
+ hours: () => hours,
13171
+ greaterThanOrEqualTo: () => greaterThanOrEqualTo2,
13172
+ greaterThan: () => greaterThan2,
13173
+ fromIso: () => fromIso,
13174
+ formatIso: () => formatIso,
13175
+ format: () => format2,
13176
+ equals: () => equals2,
13177
+ divide: () => divide,
13178
+ decodeUnknown: () => decodeUnknown,
13179
+ decode: () => decode,
13180
+ days: () => days,
13181
+ clamp: () => clamp3,
13182
+ between: () => between2,
13183
+ Order: () => Order,
13184
+ Equivalence: () => Equivalence
13185
+ });
13136
13186
  var TypeId5 = /* @__PURE__ */ Symbol.for("effect/Duration");
13137
13187
  var bigint0 = /* @__PURE__ */ BigInt(0);
13138
13188
  var bigint24 = /* @__PURE__ */ BigInt(24);
@@ -13191,6 +13241,7 @@ var decode = (input) => {
13191
13241
  }
13192
13242
  throw new Error("Invalid DurationInput");
13193
13243
  };
13244
+ var decodeUnknown = /* @__PURE__ */ liftThrowable(decode);
13194
13245
  var zeroValue = {
13195
13246
  _tag: "Millis",
13196
13247
  millis: 0
@@ -13298,6 +13349,22 @@ var toSeconds = (self) => match4(self, {
13298
13349
  onMillis: (millis2) => millis2 / 1000,
13299
13350
  onNanos: (nanos2) => Number(nanos2) / 1e9
13300
13351
  });
13352
+ var toMinutes = (self) => match4(self, {
13353
+ onMillis: (millis2) => millis2 / 60000,
13354
+ onNanos: (nanos2) => Number(nanos2) / 60000000000
13355
+ });
13356
+ var toHours = (self) => match4(self, {
13357
+ onMillis: (millis2) => millis2 / 3600000,
13358
+ onNanos: (nanos2) => Number(nanos2) / 3600000000000
13359
+ });
13360
+ var toDays = (self) => match4(self, {
13361
+ onMillis: (millis2) => millis2 / 86400000,
13362
+ onNanos: (nanos2) => Number(nanos2) / 86400000000000
13363
+ });
13364
+ var toWeeks = (self) => match4(self, {
13365
+ onMillis: (millis2) => millis2 / 604800000,
13366
+ onNanos: (nanos2) => Number(nanos2) / 604800000000000
13367
+ });
13301
13368
  var toNanos = (self) => {
13302
13369
  const _self = decode(self);
13303
13370
  switch (_self.value._tag) {
@@ -13363,11 +13430,52 @@ var Equivalence = (self, that) => matchWith(self, that, {
13363
13430
  onMillis: (self2, that2) => self2 === that2,
13364
13431
  onNanos: (self2, that2) => self2 === that2
13365
13432
  });
13433
+ var _min = /* @__PURE__ */ min(Order);
13434
+ var min2 = /* @__PURE__ */ dual(2, (self, that) => _min(decode(self), decode(that)));
13435
+ var _max = /* @__PURE__ */ max(Order);
13436
+ var max2 = /* @__PURE__ */ dual(2, (self, that) => _max(decode(self), decode(that)));
13366
13437
  var _clamp = /* @__PURE__ */ clamp(Order);
13367
13438
  var clamp3 = /* @__PURE__ */ dual(2, (self, options) => _clamp(decode(self), {
13368
13439
  minimum: decode(options.minimum),
13369
13440
  maximum: decode(options.maximum)
13370
13441
  }));
13442
+ var divide = /* @__PURE__ */ dual(2, (self, by) => match4(self, {
13443
+ onMillis: (millis2) => {
13444
+ if (by === 0 || isNaN(by) || !Number.isFinite(by)) {
13445
+ return none2();
13446
+ }
13447
+ return some2(make8(millis2 / by));
13448
+ },
13449
+ onNanos: (nanos2) => {
13450
+ if (isNaN(by) || by <= 0 || !Number.isFinite(by)) {
13451
+ return none2();
13452
+ }
13453
+ try {
13454
+ return some2(make8(nanos2 / BigInt(by)));
13455
+ } catch {
13456
+ return none2();
13457
+ }
13458
+ }
13459
+ }));
13460
+ var unsafeDivide = /* @__PURE__ */ dual(2, (self, by) => match4(self, {
13461
+ onMillis: (millis2) => make8(millis2 / by),
13462
+ onNanos: (nanos2) => {
13463
+ if (isNaN(by) || by < 0 || Object.is(by, -0)) {
13464
+ return zero;
13465
+ } else if (Object.is(by, 0) || !Number.isFinite(by)) {
13466
+ return infinity;
13467
+ }
13468
+ return make8(nanos2 / BigInt(by));
13469
+ }
13470
+ }));
13471
+ var times = /* @__PURE__ */ dual(2, (self, times2) => match4(self, {
13472
+ onMillis: (millis2) => make8(millis2 * times2),
13473
+ onNanos: (nanos2) => make8(nanos2 * BigInt(times2))
13474
+ }));
13475
+ var subtract = /* @__PURE__ */ dual(2, (self, that) => matchWith(self, that, {
13476
+ onMillis: (self2, that2) => make8(self2 - that2),
13477
+ onNanos: (self2, that2) => make8(self2 - that2)
13478
+ }));
13371
13479
  var sum = /* @__PURE__ */ dual(2, (self, that) => matchWith(self, that, {
13372
13480
  onMillis: (self2, that2) => make8(self2 + that2),
13373
13481
  onNanos: (self2, that2) => make8(self2 + that2)
@@ -13404,13 +13512,13 @@ var parts = (self) => {
13404
13512
  const nanos2 = unsafeToNanos(duration);
13405
13513
  const ms = nanos2 / bigint1e6;
13406
13514
  const sec = ms / bigint1e3;
13407
- const min2 = sec / bigint60;
13408
- const hr = min2 / bigint60;
13515
+ const min3 = sec / bigint60;
13516
+ const hr = min3 / bigint60;
13409
13517
  const days2 = hr / bigint24;
13410
13518
  return {
13411
13519
  days: Number(days2),
13412
13520
  hours: Number(hr % bigint24),
13413
- minutes: Number(min2 % bigint60),
13521
+ minutes: Number(min3 % bigint60),
13414
13522
  seconds: Number(sec % bigint60),
13415
13523
  millis: Number(ms % bigint1e3),
13416
13524
  nanos: Number(nanos2 % bigint1e6)
@@ -13446,6 +13554,69 @@ var format2 = (self) => {
13446
13554
  }
13447
13555
  return pieces.join(" ");
13448
13556
  };
13557
+ var unsafeFormatIso = (self) => {
13558
+ const duration = decode(self);
13559
+ if (!isFinite2(duration)) {
13560
+ throw new RangeError("Cannot format infinite duration");
13561
+ }
13562
+ const fragments = [];
13563
+ const {
13564
+ days: days2,
13565
+ hours: hours2,
13566
+ millis: millis2,
13567
+ minutes: minutes2,
13568
+ nanos: nanos2,
13569
+ seconds: seconds2
13570
+ } = parts(duration);
13571
+ let rest = days2;
13572
+ if (rest >= 365) {
13573
+ const years = Math.floor(rest / 365);
13574
+ rest %= 365;
13575
+ fragments.push(`${years}Y`);
13576
+ }
13577
+ if (rest >= 30) {
13578
+ const months = Math.floor(rest / 30);
13579
+ rest %= 30;
13580
+ fragments.push(`${months}M`);
13581
+ }
13582
+ if (rest >= 7) {
13583
+ const weeks2 = Math.floor(rest / 7);
13584
+ rest %= 7;
13585
+ fragments.push(`${weeks2}W`);
13586
+ }
13587
+ if (rest > 0) {
13588
+ fragments.push(`${rest}D`);
13589
+ }
13590
+ if (hours2 !== 0 || minutes2 !== 0 || seconds2 !== 0 || millis2 !== 0 || nanos2 !== 0) {
13591
+ fragments.push("T");
13592
+ if (hours2 !== 0) {
13593
+ fragments.push(`${hours2}H`);
13594
+ }
13595
+ if (minutes2 !== 0) {
13596
+ fragments.push(`${minutes2}M`);
13597
+ }
13598
+ if (seconds2 !== 0 || millis2 !== 0 || nanos2 !== 0) {
13599
+ const total = BigInt(seconds2) * bigint1e9 + BigInt(millis2) * bigint1e6 + BigInt(nanos2);
13600
+ const str = (Number(total) / 1e9).toFixed(9).replace(/\.?0+$/, "");
13601
+ fragments.push(`${str}S`);
13602
+ }
13603
+ }
13604
+ return `P${fragments.join("") || "T0S"}`;
13605
+ };
13606
+ var formatIso = (self) => {
13607
+ const duration = decode(self);
13608
+ return isFinite2(duration) ? some2(unsafeFormatIso(duration)) : none2();
13609
+ };
13610
+ var fromIso = (iso) => {
13611
+ const result = DURATION_ISO_REGEX.exec(iso);
13612
+ if (result == null) {
13613
+ return none2();
13614
+ }
13615
+ const [years, months, weeks2, days2, hours2, mins, secs] = result.slice(1, 8).map((_) => _ ? Number(_) : 0);
13616
+ const value = years * 365 * 24 * 60 * 60 + months * 30 * 24 * 60 * 60 + weeks2 * 7 * 24 * 60 * 60 + days2 * 24 * 60 * 60 + hours2 * 60 * 60 + mins * 60 + secs;
13617
+ return some2(seconds(value));
13618
+ };
13619
+ var DURATION_ISO_REGEX = /^P(?!$)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?!$)(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
13449
13620
 
13450
13621
  // node_modules/effect/dist/esm/internal/hashMap/config.js
13451
13622
  var SIZE = 5;
@@ -17331,11 +17502,11 @@ class RandomImpl {
17331
17502
  get nextInt() {
17332
17503
  return sync(() => this.PRNG.integer(Number.MAX_SAFE_INTEGER));
17333
17504
  }
17334
- nextRange(min2, max2) {
17335
- return map11(this.next, (n) => (max2 - min2) * n + min2);
17505
+ nextRange(min3, max3) {
17506
+ return map11(this.next, (n) => (max3 - min3) * n + min3);
17336
17507
  }
17337
- nextIntBetween(min2, max2) {
17338
- return sync(() => this.PRNG.integer(max2 - min2) + min2);
17508
+ nextIntBetween(min3, max3) {
17509
+ return sync(() => this.PRNG.integer(max3 - min3) + min3);
17339
17510
  }
17340
17511
  shuffle(elements) {
17341
17512
  return shuffleWith(elements, (n) => this.nextIntBetween(0, n));
@@ -17400,17 +17571,17 @@ class FixedRandomImpl {
17400
17571
  return Math.abs(hash(value));
17401
17572
  });
17402
17573
  }
17403
- nextRange(min2, max2) {
17404
- return map11(this.next, (n) => (max2 - min2) * n + min2);
17574
+ nextRange(min3, max3) {
17575
+ return map11(this.next, (n) => (max3 - min3) * n + min3);
17405
17576
  }
17406
- nextIntBetween(min2, max2) {
17577
+ nextIntBetween(min3, max3) {
17407
17578
  return sync(() => {
17408
17579
  const value = this.getNextValue();
17409
17580
  if (typeof value === "number" && Number.isFinite(value)) {
17410
- return Math.max(min2, Math.min(max2 - 1, Math.round(value)));
17581
+ return Math.max(min3, Math.min(max3 - 1, Math.round(value)));
17411
17582
  }
17412
17583
  const hash2 = Math.abs(hash(value));
17413
- return min2 + hash2 % (max2 - min2);
17584
+ return min3 + hash2 % (max3 - min3);
17414
17585
  });
17415
17586
  }
17416
17587
  shuffle(elements) {
@@ -20025,11 +20196,11 @@ class HistogramState {
20025
20196
  sum;
20026
20197
  [MetricStateTypeId] = metricStateVariance;
20027
20198
  [HistogramStateTypeId] = HistogramStateTypeId;
20028
- constructor(buckets, count, min2, max2, sum2) {
20199
+ constructor(buckets, count, min3, max3, sum2) {
20029
20200
  this.buckets = buckets;
20030
20201
  this.count = count;
20031
- this.min = min2;
20032
- this.max = max2;
20202
+ this.min = min3;
20203
+ this.max = max3;
20033
20204
  this.sum = sum2;
20034
20205
  }
20035
20206
  [symbol]() {
@@ -20052,12 +20223,12 @@ class SummaryState {
20052
20223
  sum;
20053
20224
  [MetricStateTypeId] = metricStateVariance;
20054
20225
  [SummaryStateTypeId] = SummaryStateTypeId;
20055
- constructor(error, quantiles, count, min2, max2, sum2) {
20226
+ constructor(error, quantiles, count, min3, max3, sum2) {
20056
20227
  this.error = error;
20057
20228
  this.quantiles = quantiles;
20058
20229
  this.count = count;
20059
- this.min = min2;
20060
- this.max = max2;
20230
+ this.min = min3;
20231
+ this.max = max3;
20061
20232
  this.sum = sum2;
20062
20233
  }
20063
20234
  [symbol]() {
@@ -20146,8 +20317,8 @@ var histogram4 = (key) => {
20146
20317
  const boundaries = new Float64Array(size6);
20147
20318
  let count = 0;
20148
20319
  let sum2 = 0;
20149
- let min2 = Number.MAX_VALUE;
20150
- let max2 = Number.MIN_VALUE;
20320
+ let min3 = Number.MAX_VALUE;
20321
+ let max3 = Number.MIN_VALUE;
20151
20322
  pipe(bounds, sort(Order2), map4((n, i) => {
20152
20323
  boundaries[i] = n;
20153
20324
  }));
@@ -20173,11 +20344,11 @@ var histogram4 = (key) => {
20173
20344
  values3[from] = values3[from] + 1;
20174
20345
  count = count + 1;
20175
20346
  sum2 = sum2 + value;
20176
- if (value < min2) {
20177
- min2 = value;
20347
+ if (value < min3) {
20348
+ min3 = value;
20178
20349
  }
20179
- if (value > max2) {
20180
- max2 = value;
20350
+ if (value > max3) {
20351
+ max3 = value;
20181
20352
  }
20182
20353
  };
20183
20354
  const getBuckets = () => {
@@ -20195,8 +20366,8 @@ var histogram4 = (key) => {
20195
20366
  get: () => histogram3({
20196
20367
  buckets: getBuckets(),
20197
20368
  count,
20198
- min: min2,
20199
- max: max2,
20369
+ min: min3,
20370
+ max: max3,
20200
20371
  sum: sum2
20201
20372
  }),
20202
20373
  update: update4,
@@ -20215,8 +20386,8 @@ var summary3 = (key) => {
20215
20386
  let head4 = 0;
20216
20387
  let count = 0;
20217
20388
  let sum2 = 0;
20218
- let min2 = 0;
20219
- let max2 = 0;
20389
+ let min3 = 0;
20390
+ let max3 = 0;
20220
20391
  const snapshot = (now) => {
20221
20392
  const builder = [];
20222
20393
  let i = 0;
@@ -20239,8 +20410,8 @@ var summary3 = (key) => {
20239
20410
  const target = head4 % maxSize;
20240
20411
  values3[target] = [timestamp, value];
20241
20412
  }
20242
- min2 = count === 0 ? value : Math.min(min2, value);
20243
- max2 = count === 0 ? value : Math.max(max2, value);
20413
+ min3 = count === 0 ? value : Math.min(min3, value);
20414
+ max3 = count === 0 ? value : Math.max(max3, value);
20244
20415
  count = count + 1;
20245
20416
  sum2 = sum2 + value;
20246
20417
  };
@@ -20249,8 +20420,8 @@ var summary3 = (key) => {
20249
20420
  error,
20250
20421
  quantiles: snapshot(Date.now()),
20251
20422
  count,
20252
- min: min2,
20253
- max: max2,
20423
+ min: min3,
20424
+ max: max3,
20254
20425
  sum: sum2
20255
20426
  }),
20256
20427
  update: ([value, timestamp]) => observe(value, timestamp),
@@ -23031,8 +23202,8 @@ var make34 = (startMillis, endMillis) => {
23031
23202
  endMillis
23032
23203
  };
23033
23204
  };
23034
- var lessThan3 = /* @__PURE__ */ dual(2, (self, that) => min2(self, that) === self);
23035
- var min2 = /* @__PURE__ */ dual(2, (self, that) => {
23205
+ var lessThan3 = /* @__PURE__ */ dual(2, (self, that) => min3(self, that) === self);
23206
+ var min3 = /* @__PURE__ */ dual(2, (self, that) => {
23036
23207
  if (self.endMillis <= that.startMillis)
23037
23208
  return self;
23038
23209
  if (that.endMillis <= self.startMillis)
@@ -24930,7 +25101,7 @@ var calculateNamedOffset = (utcMillis, adjustedMillis, zone) => {
24930
25101
  }
24931
25102
  return result;
24932
25103
  };
24933
- var formatIso = (self) => toDateUtc(self).toISOString();
25104
+ var formatIso2 = (self) => toDateUtc(self).toISOString();
24934
25105
  var formatIsoOffset = (self) => {
24935
25106
  const date = toDate(self);
24936
25107
  return self._tag === "Utc" ? date.toISOString() : `${date.toISOString().slice(0, -1)}${zonedOffsetIso(self)}`;
@@ -26690,9 +26861,9 @@ class Declaration {
26690
26861
  encodeUnknown;
26691
26862
  annotations;
26692
26863
  _tag = "Declaration";
26693
- constructor(typeParameters, decodeUnknown, encodeUnknown, annotations = {}) {
26864
+ constructor(typeParameters, decodeUnknown2, encodeUnknown, annotations = {}) {
26694
26865
  this.typeParameters = typeParameters;
26695
- this.decodeUnknown = decodeUnknown;
26866
+ this.decodeUnknown = decodeUnknown2;
26696
26867
  this.encodeUnknown = encodeUnknown;
26697
26868
  this.annotations = annotations;
26698
26869
  }
@@ -28415,14 +28586,14 @@ var getEffect = (ast, isDecoding, options) => {
28415
28586
  var decodeUnknownSync = (schema, options) => getSync(schema.ast, true, options);
28416
28587
  var decodeUnknownOption = (schema, options) => getOption3(schema.ast, true, options);
28417
28588
  var decodeUnknownEither = (schema, options) => getEither(schema.ast, true, options);
28418
- var decodeUnknown = (schema, options) => getEffect(schema.ast, true, options);
28589
+ var decodeUnknown2 = (schema, options) => getEffect(schema.ast, true, options);
28419
28590
  var encodeUnknownSync = (schema, options) => getSync(schema.ast, false, options);
28420
28591
  var encodeUnknownOption = (schema, options) => getOption3(schema.ast, false, options);
28421
28592
  var encodeUnknownEither = (schema, options) => getEither(schema.ast, false, options);
28422
28593
  var encodeUnknown = (schema, options) => getEffect(schema.ast, false, options);
28423
28594
  var decodeSync = decodeUnknownSync;
28424
28595
  var decodeOption = decodeUnknownOption;
28425
- var decode2 = decodeUnknown;
28596
+ var decode2 = decodeUnknown2;
28426
28597
  var validateSync = (schema, options) => getSync(typeAST(schema.ast), true, options);
28427
28598
  var validateOption = (schema, options) => getOption3(typeAST(schema.ast), true, options);
28428
28599
  var validateEither = (schema, options) => getEither(typeAST(schema.ast), true, options);
@@ -29760,28 +29931,28 @@ class QueueImpl extends Class2 {
29760
29931
  });
29761
29932
  });
29762
29933
  }
29763
- takeUpTo(max5) {
29934
+ takeUpTo(max6) {
29764
29935
  return suspend(() => get6(this.shutdownFlag) ? interrupt2 : sync(() => {
29765
- const values4 = this.queue.pollUpTo(max5);
29936
+ const values4 = this.queue.pollUpTo(max6);
29766
29937
  this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers);
29767
29938
  return fromIterable2(values4);
29768
29939
  }));
29769
29940
  }
29770
- takeBetween(min3, max5) {
29771
- return suspend(() => takeRemainderLoop(this, min3, max5, empty5()));
29941
+ takeBetween(min4, max6) {
29942
+ return suspend(() => takeRemainderLoop(this, min4, max6, empty5()));
29772
29943
  }
29773
29944
  }
29774
- var takeRemainderLoop = (self, min3, max5, acc) => {
29775
- if (max5 < min3) {
29945
+ var takeRemainderLoop = (self, min4, max6, acc) => {
29946
+ if (max6 < min4) {
29776
29947
  return succeed(acc);
29777
29948
  }
29778
- return pipe(takeUpTo(self, max5), flatMap8((bs) => {
29779
- const remaining = min3 - bs.length;
29949
+ return pipe(takeUpTo(self, max6), flatMap8((bs) => {
29950
+ const remaining = min4 - bs.length;
29780
29951
  if (remaining === 1) {
29781
29952
  return pipe(take2(self), map11((b) => pipe(acc, appendAll2(bs), append2(b))));
29782
29953
  }
29783
29954
  if (remaining > 1) {
29784
- return pipe(take2(self), flatMap8((b) => takeRemainderLoop(self, remaining - 1, max5 - bs.length - 1, pipe(acc, appendAll2(bs), append2(b)))));
29955
+ return pipe(take2(self), flatMap8((b) => takeRemainderLoop(self, remaining - 1, max6 - bs.length - 1, pipe(acc, appendAll2(bs), append2(b)))));
29785
29956
  }
29786
29957
  return succeed(pipe(acc, appendAll2(bs)));
29787
29958
  }));
@@ -29833,8 +30004,8 @@ var offerAll2 = /* @__PURE__ */ dual(2, (self, iterable) => self.offerAll(iterab
29833
30004
  var poll5 = (self) => map11(self.takeUpTo(1), head2);
29834
30005
  var take2 = (self) => self.take;
29835
30006
  var takeAll = (self) => self.takeAll;
29836
- var takeUpTo = /* @__PURE__ */ dual(2, (self, max5) => self.takeUpTo(max5));
29837
- var takeBetween = /* @__PURE__ */ dual(3, (self, min3, max5) => self.takeBetween(min3, max5));
30007
+ var takeUpTo = /* @__PURE__ */ dual(2, (self, max6) => self.takeUpTo(max6));
30008
+ var takeBetween = /* @__PURE__ */ dual(3, (self, min4, max6) => self.takeBetween(min4, max6));
29838
30009
  var takeN = /* @__PURE__ */ dual(2, (self, n) => self.takeBetween(n, n));
29839
30010
  var backPressureStrategy = () => new BackPressureStrategy;
29840
30011
  var droppingStrategy = () => new DroppingStrategy;
@@ -29957,8 +30128,8 @@ var unsafeOfferAll = (queue, as4) => {
29957
30128
  var unsafePollAll = (queue) => {
29958
30129
  return pipe(queue, pollUpTo(Number.POSITIVE_INFINITY));
29959
30130
  };
29960
- var unsafePollN = (queue, max5) => {
29961
- return pipe(queue, pollUpTo(max5));
30131
+ var unsafePollN = (queue, max6) => {
30132
+ return pipe(queue, pollUpTo(max6));
29962
30133
  };
29963
30134
  var unsafeRemove = (queue, a) => {
29964
30135
  unsafeOfferAll(queue, pipe(unsafePollAll(queue), filter3((b) => a !== b)));
@@ -30774,39 +30945,39 @@ class SubscriptionImpl extends Class2 {
30774
30945
  return succeed(as4);
30775
30946
  });
30776
30947
  }
30777
- takeUpTo(max5) {
30948
+ takeUpTo(max6) {
30778
30949
  return suspend(() => {
30779
30950
  if (get6(this.shutdownFlag)) {
30780
30951
  return interrupt2;
30781
30952
  }
30782
30953
  let replay = undefined;
30783
- if (this.replayWindow.remaining >= max5) {
30784
- const as5 = this.replayWindow.takeN(max5);
30954
+ if (this.replayWindow.remaining >= max6) {
30955
+ const as5 = this.replayWindow.takeN(max6);
30785
30956
  return succeed(as5);
30786
30957
  } else if (this.replayWindow.remaining > 0) {
30787
30958
  replay = this.replayWindow.takeAll();
30788
- max5 = max5 - replay.length;
30959
+ max6 = max6 - replay.length;
30789
30960
  }
30790
- const as4 = isEmpty9(this.pollers) ? unsafePollN2(this.subscription, max5) : empty5();
30961
+ const as4 = isEmpty9(this.pollers) ? unsafePollN2(this.subscription, max6) : empty5();
30791
30962
  this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers);
30792
30963
  return replay ? succeed(appendAll2(replay, as4)) : succeed(as4);
30793
30964
  });
30794
30965
  }
30795
- takeBetween(min3, max5) {
30796
- return suspend(() => takeRemainderLoop2(this, min3, max5, empty5()));
30966
+ takeBetween(min4, max6) {
30967
+ return suspend(() => takeRemainderLoop2(this, min4, max6, empty5()));
30797
30968
  }
30798
30969
  }
30799
- var takeRemainderLoop2 = (self, min3, max5, acc) => {
30800
- if (max5 < min3) {
30970
+ var takeRemainderLoop2 = (self, min4, max6, acc) => {
30971
+ if (max6 < min4) {
30801
30972
  return succeed(acc);
30802
30973
  }
30803
- return pipe(self.takeUpTo(max5), flatMap8((bs) => {
30804
- const remaining = min3 - bs.length;
30974
+ return pipe(self.takeUpTo(max6), flatMap8((bs) => {
30975
+ const remaining = min4 - bs.length;
30805
30976
  if (remaining === 1) {
30806
30977
  return pipe(self.take, map11((b) => pipe(acc, appendAll2(bs), append2(b))));
30807
30978
  }
30808
30979
  if (remaining > 1) {
30809
- return pipe(self.take, flatMap8((b) => takeRemainderLoop2(self, remaining - 1, max5 - bs.length - 1, pipe(acc, appendAll2(bs), append2(b)))));
30980
+ return pipe(self.take, flatMap8((b) => takeRemainderLoop2(self, remaining - 1, max6 - bs.length - 1, pipe(acc, appendAll2(bs), append2(b)))));
30810
30981
  }
30811
30982
  return succeed(pipe(acc, appendAll2(bs)));
30812
30983
  }));
@@ -30930,8 +31101,8 @@ var unsafePollAllQueue = (queue) => {
30930
31101
  var unsafePollAllSubscription = (subscription) => {
30931
31102
  return subscription.pollUpTo(Number.POSITIVE_INFINITY);
30932
31103
  };
30933
- var unsafePollN2 = (subscription, max5) => {
30934
- return subscription.pollUpTo(max5);
31104
+ var unsafePollN2 = (subscription, max6) => {
31105
+ return subscription.pollUpTo(max6);
30935
31106
  };
30936
31107
  var unsafePublishAll = (pubsub, as4) => {
30937
31108
  return pubsub.publishAll(as4);
@@ -34199,13 +34370,13 @@ class TQueueImpl {
34199
34370
  unsafeSet2(this.ref, [], runtime5.journal);
34200
34371
  return succeed14(queue);
34201
34372
  });
34202
- takeUpTo(max5) {
34373
+ takeUpTo(max6) {
34203
34374
  return withSTMRuntime((runtime5) => {
34204
34375
  const queue = unsafeGet7(this.ref, runtime5.journal);
34205
34376
  if (queue === undefined) {
34206
34377
  return interruptAs2(runtime5.fiberId);
34207
34378
  }
34208
- const [toTake, remaining] = splitAt2(unsafeFromArray(queue), max5);
34379
+ const [toTake, remaining] = splitAt2(unsafeFromArray(queue), max6);
34209
34380
  unsafeSet2(this.ref, Array.from(remaining), runtime5.journal);
34210
34381
  return succeed14(Array.from(toTake));
34211
34382
  });
@@ -34504,7 +34675,7 @@ class TPubSubSubscriptionImpl {
34504
34675
  return succeed14(value);
34505
34676
  });
34506
34677
  takeAll = /* @__PURE__ */ this.takeUpTo(Number.POSITIVE_INFINITY);
34507
- takeUpTo(max5) {
34678
+ takeUpTo(max6) {
34508
34679
  return withSTMRuntime((runtime5) => {
34509
34680
  let currentSubscriberHead = unsafeGet7(this.subscriberHead, runtime5.journal);
34510
34681
  if (currentSubscriberHead === undefined) {
@@ -34512,10 +34683,10 @@ class TPubSubSubscriptionImpl {
34512
34683
  }
34513
34684
  const builder = [];
34514
34685
  let n = 0;
34515
- while (n !== max5) {
34686
+ while (n !== max6) {
34516
34687
  const node = unsafeGet7(currentSubscriberHead, runtime5.journal);
34517
34688
  if (node === undefined) {
34518
- n = max5;
34689
+ n = max6;
34519
34690
  } else {
34520
34691
  const head6 = node.head;
34521
34692
  const tail = node.tail;
@@ -36135,18 +36306,18 @@ var provideServiceEffect3 = /* @__PURE__ */ dual(3, (self, tag, effect4) => prov
36135
36306
  var provideServiceStream = /* @__PURE__ */ dual(3, (self, tag, stream) => contextWithStream((env) => flatMap17(stream, (service3) => pipe(self, provideContext5(add2(env, tag, service3))))));
36136
36307
  var mapInputContext5 = /* @__PURE__ */ dual(2, (self, f) => contextWithStream((env) => pipe(self, provideContext5(f(env)))));
36137
36308
  var provideSomeLayer2 = /* @__PURE__ */ dual(2, (self, layer) => pipe(self, provideLayer(pipe(context4(), merge8(layer)))));
36138
- var range2 = (min3, max5, chunkSize = DefaultChunkSize) => suspend9(() => {
36139
- if (min3 > max5) {
36309
+ var range2 = (min4, max6, chunkSize = DefaultChunkSize) => suspend9(() => {
36310
+ if (min4 > max6) {
36140
36311
  return empty33;
36141
36312
  }
36142
- const go2 = (min4, max6, chunkSize2) => {
36143
- const remaining = max6 - min4 + 1;
36313
+ const go2 = (min5, max7, chunkSize2) => {
36314
+ const remaining = max7 - min5 + 1;
36144
36315
  if (remaining > chunkSize2) {
36145
- return pipe(write(range(min4, min4 + chunkSize2 - 1)), flatMap14(() => go2(min4 + chunkSize2, max6, chunkSize2)));
36316
+ return pipe(write(range(min5, min5 + chunkSize2 - 1)), flatMap14(() => go2(min5 + chunkSize2, max7, chunkSize2)));
36146
36317
  }
36147
- return write(range(min4, min4 + remaining - 1));
36318
+ return write(range(min5, min5 + remaining - 1));
36148
36319
  };
36149
- return new StreamImpl(go2(min3, max5, chunkSize));
36320
+ return new StreamImpl(go2(min4, max6, chunkSize));
36150
36321
  });
36151
36322
  var race3 = /* @__PURE__ */ dual(2, (left3, right3) => raceAll3(left3, right3));
36152
36323
  var raceAll3 = (...streams) => make40().pipe(map17((halt2) => {
@@ -36641,8 +36812,8 @@ var throttleEnforceEffect = (self, cost, units, duration2, burst) => {
36641
36812
  const elapsed2 = currentTimeMillis3 - timestampMillis;
36642
36813
  const cycles = elapsed2 / toMillis(duration2);
36643
36814
  const sum3 = tokens + cycles * units;
36644
- const max5 = units + burst < 0 ? Number.POSITIVE_INFINITY : units + burst;
36645
- const available = sum3 < 0 ? max5 : Math.min(sum3, max5);
36815
+ const max6 = units + burst < 0 ? Number.POSITIVE_INFINITY : units + burst;
36816
+ const available = sum3 < 0 ? max6 : Math.min(sum3, max6);
36646
36817
  if (weight <= available) {
36647
36818
  return pipe(write(input), flatMap14(() => loop3(available - weight, currentTimeMillis3)));
36648
36819
  }
@@ -36660,8 +36831,8 @@ var throttleShapeEffect = (self, costFn, units, duration2, burst) => {
36660
36831
  const elapsed2 = currentTimeMillis3 - timestampMillis;
36661
36832
  const cycles = elapsed2 / toMillis(duration2);
36662
36833
  const sum3 = tokens + cycles * units;
36663
- const max5 = units + burst < 0 ? Number.POSITIVE_INFINITY : units + burst;
36664
- const available = sum3 < 0 ? max5 : Math.min(sum3, max5);
36834
+ const max6 = units + burst < 0 ? Number.POSITIVE_INFINITY : units + burst;
36835
+ const available = sum3 < 0 ? max6 : Math.min(sum3, max6);
36665
36836
  const remaining = available - weight;
36666
36837
  const waitCycles = remaining >= 0 ? 0 : -remaining / units;
36667
36838
  const delay3 = millis(Math.max(0, waitCycles * toMillis(duration2)));
@@ -37770,11 +37941,11 @@ class MapDequeue extends Class2 {
37770
37941
  get takeAll() {
37771
37942
  return pipe(takeAll2(this.dequeue), map17(map5((a) => this.f(a))));
37772
37943
  }
37773
- takeUpTo(max5) {
37774
- return pipe(takeUpTo2(this.dequeue, max5), map17(map5((a) => this.f(a))));
37944
+ takeUpTo(max6) {
37945
+ return pipe(takeUpTo2(this.dequeue, max6), map17(map5((a) => this.f(a))));
37775
37946
  }
37776
- takeBetween(min3, max5) {
37777
- return pipe(takeBetween2(this.dequeue, min3, max5), map17(map5((a) => this.f(a))));
37947
+ takeBetween(min4, max6) {
37948
+ return pipe(takeBetween2(this.dequeue, min4, max6), map17(map5((a) => this.f(a))));
37778
37949
  }
37779
37950
  takeN(n) {
37780
37951
  return pipe(takeN2(this.dequeue, n), map17(map5((a) => this.f(a))));
@@ -38290,7 +38461,7 @@ __export(exports_Schema, {
38290
38461
  decodeUnknownPromise: () => decodeUnknownPromise,
38291
38462
  decodeUnknownOption: () => decodeUnknownOption,
38292
38463
  decodeUnknownEither: () => decodeUnknownEither2,
38293
- decodeUnknown: () => decodeUnknown2,
38464
+ decodeUnknown: () => decodeUnknown3,
38294
38465
  decodeSync: () => decodeSync,
38295
38466
  decodePromise: () => decodePromise,
38296
38467
  decodeOption: () => decodeOption,
@@ -38940,7 +39111,7 @@ var zoneFromString2 = zoneFromString;
38940
39111
  var zoneToString2 = zoneToString;
38941
39112
  var toDateUtc2 = toDateUtc;
38942
39113
  var toEpochMillis2 = toEpochMillis;
38943
- var formatIso2 = formatIso;
39114
+ var formatIso3 = formatIso2;
38944
39115
  var formatIsoZoned2 = formatIsoZoned;
38945
39116
 
38946
39117
  // node_modules/effect/dist/esm/internal/encoding/common.js
@@ -39640,23 +39811,23 @@ var safeMathLog = Math.log;
39640
39811
  function integerLogLike(v) {
39641
39812
  return safeMathFloor(safeMathLog(v) / safeMathLog(2));
39642
39813
  }
39643
- function biasNumericRange(min4, max6, logLike) {
39644
- if (min4 === max6) {
39645
- return [{ min: min4, max: max6 }];
39814
+ function biasNumericRange(min5, max7, logLike) {
39815
+ if (min5 === max7) {
39816
+ return [{ min: min5, max: max7 }];
39646
39817
  }
39647
- if (min4 < 0 && max6 > 0) {
39648
- const logMin = logLike(-min4);
39649
- const logMax = logLike(max6);
39818
+ if (min5 < 0 && max7 > 0) {
39819
+ const logMin = logLike(-min5);
39820
+ const logMax = logLike(max7);
39650
39821
  return [
39651
39822
  { min: -logMin, max: logMax },
39652
- { min: max6 - logMax, max: max6 },
39653
- { min: min4, max: min4 + logMin }
39823
+ { min: max7 - logMax, max: max7 },
39824
+ { min: min5, max: min5 + logMin }
39654
39825
  ];
39655
39826
  }
39656
- const logGap = logLike(max6 - min4);
39657
- const arbCloseToMin = { min: min4, max: min4 + logGap };
39658
- const arbCloseToMax = { min: max6 - logGap, max: max6 };
39659
- return min4 < 0 ? [arbCloseToMax, arbCloseToMin] : [arbCloseToMin, arbCloseToMax];
39827
+ const logGap = logLike(max7 - min5);
39828
+ const arbCloseToMin = { min: min5, max: min5 + logGap };
39829
+ const arbCloseToMax = { min: max7 - logGap, max: max7 };
39830
+ return min5 < 0 ? [arbCloseToMax, arbCloseToMin] : [arbCloseToMin, arbCloseToMax];
39660
39831
  }
39661
39832
 
39662
39833
  // node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkInteger.js
@@ -39697,10 +39868,10 @@ var safeNumberIsInteger = Number.isInteger;
39697
39868
  var safeObjectIs = Object.is;
39698
39869
 
39699
39870
  class IntegerArbitrary extends Arbitrary {
39700
- constructor(min4, max6) {
39871
+ constructor(min5, max7) {
39701
39872
  super();
39702
- this.min = min4;
39703
- this.max = max6;
39873
+ this.min = min5;
39874
+ this.max = max7;
39704
39875
  }
39705
39876
  generate(mrng, biasFactor) {
39706
39877
  const range4 = this.computeGenerateRange(mrng, biasFactor);
@@ -39760,9 +39931,9 @@ class IntegerArbitrary extends Arbitrary {
39760
39931
  // node_modules/fast-check/lib/esm/arbitrary/integer.js
39761
39932
  var safeNumberIsInteger2 = Number.isInteger;
39762
39933
  function buildCompleteIntegerConstraints(constraints) {
39763
- const min4 = constraints.min !== undefined ? constraints.min : -2147483648;
39764
- const max6 = constraints.max !== undefined ? constraints.max : 2147483647;
39765
- return { min: min4, max: max6 };
39934
+ const min5 = constraints.min !== undefined ? constraints.min : -2147483648;
39935
+ const max7 = constraints.max !== undefined ? constraints.max : 2147483647;
39936
+ return { min: min5, max: max7 };
39766
39937
  }
39767
39938
  function integer2(constraints = {}) {
39768
39939
  const fullConstraints = buildCompleteIntegerConstraints(constraints);
@@ -40209,7 +40380,7 @@ var makeStandardFailureFromParseIssue = (issue) => map17(ArrayFormatter.formatIs
40209
40380
  }))
40210
40381
  }));
40211
40382
  var standardSchemaV1 = (schema, overrideOptions) => {
40212
- const decodeUnknown2 = decodeUnknown(schema, {
40383
+ const decodeUnknown3 = decodeUnknown2(schema, {
40213
40384
  errors: "all"
40214
40385
  });
40215
40386
  return class StandardSchemaV1Class extends make59(schema.ast) {
@@ -40218,7 +40389,7 @@ var standardSchemaV1 = (schema, overrideOptions) => {
40218
40389
  vendor: "effect",
40219
40390
  validate(value3) {
40220
40391
  const scheduler = new SyncScheduler;
40221
- const fiber = runFork2(matchEffect2(decodeUnknown2(value3, overrideOptions), {
40392
+ const fiber = runFork2(matchEffect2(decodeUnknown3(value3, overrideOptions), {
40222
40393
  onFailure: makeStandardFailureFromParseIssue,
40223
40394
  onSuccess: (value4) => succeed8({
40224
40395
  value: value4
@@ -40299,19 +40470,19 @@ var encodeUnknownPromise = (schema, options) => {
40299
40470
  var encode4 = encodeUnknown2;
40300
40471
  var encodeEither = encodeUnknownEither2;
40301
40472
  var encodePromise = encodeUnknownPromise;
40302
- var decodeUnknown2 = (schema, options) => {
40303
- const decodeUnknown3 = decodeUnknown(schema, options);
40304
- return (u, overrideOptions) => mapError4(decodeUnknown3(u, overrideOptions), parseError);
40473
+ var decodeUnknown3 = (schema, options) => {
40474
+ const decodeUnknown4 = decodeUnknown2(schema, options);
40475
+ return (u, overrideOptions) => mapError4(decodeUnknown4(u, overrideOptions), parseError);
40305
40476
  };
40306
40477
  var decodeUnknownEither2 = (schema, options) => {
40307
40478
  const decodeUnknownEither3 = decodeUnknownEither(schema, options);
40308
40479
  return (u, overrideOptions) => mapLeft(decodeUnknownEither3(u, overrideOptions), parseError);
40309
40480
  };
40310
40481
  var decodeUnknownPromise = (schema, options) => {
40311
- const parser = decodeUnknown2(schema, options);
40482
+ const parser = decodeUnknown3(schema, options);
40312
40483
  return (u, overrideOptions) => runPromise(parser(u, overrideOptions));
40313
40484
  };
40314
- var decode6 = decodeUnknown2;
40485
+ var decode6 = decodeUnknown3;
40315
40486
  var decodeEither = decodeUnknownEither2;
40316
40487
  var decodePromise = decodeUnknownPromise;
40317
40488
  var validate5 = (schema, options) => {
@@ -40467,9 +40638,9 @@ var TemplateLiteralParser = (...params) => {
40467
40638
  };
40468
40639
  var declareConstructor = (typeParameters, options, annotations2) => makeDeclareClass(typeParameters, new Declaration(typeParameters.map((tp) => tp.ast), (...typeParameters2) => options.decode(...typeParameters2.map(make59)), (...typeParameters2) => options.encode(...typeParameters2.map(make59)), toASTAnnotations(annotations2)));
40469
40640
  var declarePrimitive = (is2, annotations2) => {
40470
- const decodeUnknown3 = () => (input, _, ast) => is2(input) ? succeed9(input) : fail10(new Type2(ast, input));
40471
- const encodeUnknown3 = decodeUnknown3;
40472
- return makeDeclareClass([], new Declaration([], decodeUnknown3, encodeUnknown3, toASTAnnotations(annotations2)));
40641
+ const decodeUnknown4 = () => (input, _, ast) => is2(input) ? succeed9(input) : fail10(new Type2(ast, input));
40642
+ const encodeUnknown3 = decodeUnknown4;
40643
+ return makeDeclareClass([], new Declaration([], decodeUnknown4, encodeUnknown3, toASTAnnotations(annotations2)));
40473
40644
  };
40474
40645
  function makeDeclareClass(typeParameters, ast) {
40475
40646
  return class DeclareClass extends make59(ast) {
@@ -41810,54 +41981,54 @@ class Symbol$ extends (/* @__PURE__ */ transformOrFail(String$.annotations({
41810
41981
  })) {
41811
41982
  }
41812
41983
  var GreaterThanBigIntSchemaId = GreaterThanBigintSchemaId;
41813
- var greaterThanBigInt = (min4, annotations3) => (self) => self.pipe(filter11((a) => a > min4, {
41984
+ var greaterThanBigInt = (min5, annotations3) => (self) => self.pipe(filter11((a) => a > min5, {
41814
41985
  schemaId: GreaterThanBigIntSchemaId,
41815
41986
  [GreaterThanBigIntSchemaId]: {
41816
- min: min4
41987
+ min: min5
41817
41988
  },
41818
- title: `greaterThanBigInt(${min4})`,
41819
- description: min4 === 0n ? "a positive bigint" : `a bigint greater than ${min4}n`,
41989
+ title: `greaterThanBigInt(${min5})`,
41990
+ description: min5 === 0n ? "a positive bigint" : `a bigint greater than ${min5}n`,
41820
41991
  ...annotations3
41821
41992
  }));
41822
41993
  var GreaterThanOrEqualToBigIntSchemaId2 = GreaterThanOrEqualToBigIntSchemaId;
41823
- var greaterThanOrEqualToBigInt = (min4, annotations3) => (self) => self.pipe(filter11((a) => a >= min4, {
41994
+ var greaterThanOrEqualToBigInt = (min5, annotations3) => (self) => self.pipe(filter11((a) => a >= min5, {
41824
41995
  schemaId: GreaterThanOrEqualToBigIntSchemaId2,
41825
41996
  [GreaterThanOrEqualToBigIntSchemaId2]: {
41826
- min: min4
41997
+ min: min5
41827
41998
  },
41828
- title: `greaterThanOrEqualToBigInt(${min4})`,
41829
- description: min4 === 0n ? "a non-negative bigint" : `a bigint greater than or equal to ${min4}n`,
41999
+ title: `greaterThanOrEqualToBigInt(${min5})`,
42000
+ description: min5 === 0n ? "a non-negative bigint" : `a bigint greater than or equal to ${min5}n`,
41830
42001
  ...annotations3
41831
42002
  }));
41832
42003
  var LessThanBigIntSchemaId2 = LessThanBigIntSchemaId;
41833
- var lessThanBigInt = (max6, annotations3) => (self) => self.pipe(filter11((a) => a < max6, {
42004
+ var lessThanBigInt = (max7, annotations3) => (self) => self.pipe(filter11((a) => a < max7, {
41834
42005
  schemaId: LessThanBigIntSchemaId2,
41835
42006
  [LessThanBigIntSchemaId2]: {
41836
- max: max6
42007
+ max: max7
41837
42008
  },
41838
- title: `lessThanBigInt(${max6})`,
41839
- description: max6 === 0n ? "a negative bigint" : `a bigint less than ${max6}n`,
42009
+ title: `lessThanBigInt(${max7})`,
42010
+ description: max7 === 0n ? "a negative bigint" : `a bigint less than ${max7}n`,
41840
42011
  ...annotations3
41841
42012
  }));
41842
42013
  var LessThanOrEqualToBigIntSchemaId2 = LessThanOrEqualToBigIntSchemaId;
41843
- var lessThanOrEqualToBigInt = (max6, annotations3) => (self) => self.pipe(filter11((a) => a <= max6, {
42014
+ var lessThanOrEqualToBigInt = (max7, annotations3) => (self) => self.pipe(filter11((a) => a <= max7, {
41844
42015
  schemaId: LessThanOrEqualToBigIntSchemaId2,
41845
42016
  [LessThanOrEqualToBigIntSchemaId2]: {
41846
- max: max6
42017
+ max: max7
41847
42018
  },
41848
- title: `lessThanOrEqualToBigInt(${max6})`,
41849
- description: max6 === 0n ? "a non-positive bigint" : `a bigint less than or equal to ${max6}n`,
42019
+ title: `lessThanOrEqualToBigInt(${max7})`,
42020
+ description: max7 === 0n ? "a non-positive bigint" : `a bigint less than or equal to ${max7}n`,
41850
42021
  ...annotations3
41851
42022
  }));
41852
42023
  var BetweenBigIntSchemaId = BetweenBigintSchemaId;
41853
- var betweenBigInt = (min4, max6, annotations3) => (self) => self.pipe(filter11((a) => a >= min4 && a <= max6, {
42024
+ var betweenBigInt = (min5, max7, annotations3) => (self) => self.pipe(filter11((a) => a >= min5 && a <= max7, {
41854
42025
  schemaId: BetweenBigIntSchemaId,
41855
42026
  [BetweenBigIntSchemaId]: {
41856
- min: min4,
41857
- max: max6
42027
+ min: min5,
42028
+ max: max7
41858
42029
  },
41859
- title: `betweenBigInt(${min4}, ${max6})`,
41860
- description: `a bigint between ${min4}n and ${max6}n`,
42030
+ title: `betweenBigInt(${min5}, ${max7})`,
42031
+ description: `a bigint between ${min5}n and ${max7}n`,
41861
42032
  ...annotations3
41862
42033
  }));
41863
42034
  var positiveBigInt = (annotations3) => greaterThanBigInt(0n, {
@@ -41935,9 +42106,9 @@ var toComposite = (eff, onSuccess, ast, actual) => mapBoth5(eff, {
41935
42106
  onFailure: (e) => new Composite2(ast, actual, e),
41936
42107
  onSuccess
41937
42108
  });
41938
- var redactedParse = (decodeUnknown3) => (u, options, ast) => isRedacted2(u) ? toComposite(decodeUnknown3(value2(u), options), make58, ast, u) : fail10(new Type2(ast, u));
42109
+ var redactedParse = (decodeUnknown4) => (u, options, ast) => isRedacted2(u) ? toComposite(decodeUnknown4(value2(u), options), make58, ast, u) : fail10(new Type2(ast, u));
41939
42110
  var RedactedFromSelf = (value3) => declare([value3], {
41940
- decode: (value4) => redactedParse(decodeUnknown(value4)),
42111
+ decode: (value4) => redactedParse(decodeUnknown2(value4)),
41941
42112
  encode: (value4) => redactedParse(encodeUnknown(value4))
41942
42113
  }, {
41943
42114
  description: "Redacted(<redacted>)",
@@ -42063,43 +42234,43 @@ var clampDuration = (minimum, maximum) => (self) => transform2(self, self.pipe(t
42063
42234
  encode: identity
42064
42235
  });
42065
42236
  var LessThanDurationSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/LessThanDuration");
42066
- var lessThanDuration = (max6, annotations3) => (self) => self.pipe(filter11((a) => lessThan2(a, max6), {
42237
+ var lessThanDuration = (max7, annotations3) => (self) => self.pipe(filter11((a) => lessThan2(a, max7), {
42067
42238
  schemaId: LessThanDurationSchemaId,
42068
42239
  [LessThanDurationSchemaId]: {
42069
- max: max6
42240
+ max: max7
42070
42241
  },
42071
- title: `lessThanDuration(${max6})`,
42072
- description: `a Duration less than ${decode(max6)}`,
42242
+ title: `lessThanDuration(${max7})`,
42243
+ description: `a Duration less than ${decode(max7)}`,
42073
42244
  ...annotations3
42074
42245
  }));
42075
42246
  var LessThanOrEqualToDurationSchemaId = /* @__PURE__ */ Symbol.for("effect/schema/LessThanOrEqualToDuration");
42076
- var lessThanOrEqualToDuration = (max6, annotations3) => (self) => self.pipe(filter11((a) => lessThanOrEqualTo2(a, max6), {
42247
+ var lessThanOrEqualToDuration = (max7, annotations3) => (self) => self.pipe(filter11((a) => lessThanOrEqualTo2(a, max7), {
42077
42248
  schemaId: LessThanDurationSchemaId,
42078
42249
  [LessThanDurationSchemaId]: {
42079
- max: max6
42250
+ max: max7
42080
42251
  },
42081
- title: `lessThanOrEqualToDuration(${max6})`,
42082
- description: `a Duration less than or equal to ${decode(max6)}`,
42252
+ title: `lessThanOrEqualToDuration(${max7})`,
42253
+ description: `a Duration less than or equal to ${decode(max7)}`,
42083
42254
  ...annotations3
42084
42255
  }));
42085
42256
  var GreaterThanDurationSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/GreaterThanDuration");
42086
- var greaterThanDuration = (min4, annotations3) => (self) => self.pipe(filter11((a) => greaterThan2(a, min4), {
42257
+ var greaterThanDuration = (min5, annotations3) => (self) => self.pipe(filter11((a) => greaterThan2(a, min5), {
42087
42258
  schemaId: GreaterThanDurationSchemaId,
42088
42259
  [GreaterThanDurationSchemaId]: {
42089
- min: min4
42260
+ min: min5
42090
42261
  },
42091
- title: `greaterThanDuration(${min4})`,
42092
- description: `a Duration greater than ${decode(min4)}`,
42262
+ title: `greaterThanDuration(${min5})`,
42263
+ description: `a Duration greater than ${decode(min5)}`,
42093
42264
  ...annotations3
42094
42265
  }));
42095
42266
  var GreaterThanOrEqualToDurationSchemaId = /* @__PURE__ */ Symbol.for("effect/schema/GreaterThanOrEqualToDuration");
42096
- var greaterThanOrEqualToDuration = (min4, annotations3) => (self) => self.pipe(filter11((a) => greaterThanOrEqualTo2(a, min4), {
42267
+ var greaterThanOrEqualToDuration = (min5, annotations3) => (self) => self.pipe(filter11((a) => greaterThanOrEqualTo2(a, min5), {
42097
42268
  schemaId: GreaterThanOrEqualToDurationSchemaId,
42098
42269
  [GreaterThanOrEqualToDurationSchemaId]: {
42099
- min: min4
42270
+ min: min5
42100
42271
  },
42101
- title: `greaterThanOrEqualToDuration(${min4})`,
42102
- description: `a Duration greater than or equal to ${decode(min4)}`,
42272
+ title: `greaterThanOrEqualToDuration(${min5})`,
42273
+ description: `a Duration greater than or equal to ${decode(min5)}`,
42103
42274
  ...annotations3
42104
42275
  }));
42105
42276
  var BetweenDurationSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/BetweenDuration");
@@ -42260,54 +42431,54 @@ var validDate = (annotations3) => (self) => self.pipe(filter11((a) => !Number.is
42260
42431
  ...annotations3
42261
42432
  }));
42262
42433
  var LessThanDateSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/LessThanDate");
42263
- var lessThanDate = (max6, annotations3) => (self) => self.pipe(filter11((a) => a < max6, {
42434
+ var lessThanDate = (max7, annotations3) => (self) => self.pipe(filter11((a) => a < max7, {
42264
42435
  schemaId: LessThanDateSchemaId,
42265
42436
  [LessThanDateSchemaId]: {
42266
- max: max6
42437
+ max: max7
42267
42438
  },
42268
- title: `lessThanDate(${formatDate(max6)})`,
42269
- description: `a date before ${formatDate(max6)}`,
42439
+ title: `lessThanDate(${formatDate(max7)})`,
42440
+ description: `a date before ${formatDate(max7)}`,
42270
42441
  ...annotations3
42271
42442
  }));
42272
42443
  var LessThanOrEqualToDateSchemaId = /* @__PURE__ */ Symbol.for("effect/schema/LessThanOrEqualToDate");
42273
- var lessThanOrEqualToDate = (max6, annotations3) => (self) => self.pipe(filter11((a) => a <= max6, {
42444
+ var lessThanOrEqualToDate = (max7, annotations3) => (self) => self.pipe(filter11((a) => a <= max7, {
42274
42445
  schemaId: LessThanOrEqualToDateSchemaId,
42275
42446
  [LessThanOrEqualToDateSchemaId]: {
42276
- max: max6
42447
+ max: max7
42277
42448
  },
42278
- title: `lessThanOrEqualToDate(${formatDate(max6)})`,
42279
- description: `a date before or equal to ${formatDate(max6)}`,
42449
+ title: `lessThanOrEqualToDate(${formatDate(max7)})`,
42450
+ description: `a date before or equal to ${formatDate(max7)}`,
42280
42451
  ...annotations3
42281
42452
  }));
42282
42453
  var GreaterThanDateSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/GreaterThanDate");
42283
- var greaterThanDate = (min4, annotations3) => (self) => self.pipe(filter11((a) => a > min4, {
42454
+ var greaterThanDate = (min5, annotations3) => (self) => self.pipe(filter11((a) => a > min5, {
42284
42455
  schemaId: GreaterThanDateSchemaId,
42285
42456
  [GreaterThanDateSchemaId]: {
42286
- min: min4
42457
+ min: min5
42287
42458
  },
42288
- title: `greaterThanDate(${formatDate(min4)})`,
42289
- description: `a date after ${formatDate(min4)}`,
42459
+ title: `greaterThanDate(${formatDate(min5)})`,
42460
+ description: `a date after ${formatDate(min5)}`,
42290
42461
  ...annotations3
42291
42462
  }));
42292
42463
  var GreaterThanOrEqualToDateSchemaId = /* @__PURE__ */ Symbol.for("effect/schema/GreaterThanOrEqualToDate");
42293
- var greaterThanOrEqualToDate = (min4, annotations3) => (self) => self.pipe(filter11((a) => a >= min4, {
42464
+ var greaterThanOrEqualToDate = (min5, annotations3) => (self) => self.pipe(filter11((a) => a >= min5, {
42294
42465
  schemaId: GreaterThanOrEqualToDateSchemaId,
42295
42466
  [GreaterThanOrEqualToDateSchemaId]: {
42296
- min: min4
42467
+ min: min5
42297
42468
  },
42298
- title: `greaterThanOrEqualToDate(${formatDate(min4)})`,
42299
- description: `a date after or equal to ${formatDate(min4)}`,
42469
+ title: `greaterThanOrEqualToDate(${formatDate(min5)})`,
42470
+ description: `a date after or equal to ${formatDate(min5)}`,
42300
42471
  ...annotations3
42301
42472
  }));
42302
42473
  var BetweenDateSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/BetweenDate");
42303
- var betweenDate = (min4, max6, annotations3) => (self) => self.pipe(filter11((a) => a <= max6 && a >= min4, {
42474
+ var betweenDate = (min5, max7, annotations3) => (self) => self.pipe(filter11((a) => a <= max7 && a >= min5, {
42304
42475
  schemaId: BetweenDateSchemaId,
42305
42476
  [BetweenDateSchemaId]: {
42306
- max: max6,
42307
- min: min4
42477
+ max: max7,
42478
+ min: min5
42308
42479
  },
42309
- title: `betweenDate(${formatDate(min4)}, ${formatDate(max6)})`,
42310
- description: `a date between ${formatDate(min4)} and ${formatDate(max6)}`,
42480
+ title: `betweenDate(${formatDate(min5)}, ${formatDate(max7)})`,
42481
+ description: `a date between ${formatDate(min5)} and ${formatDate(max7)}`,
42311
42482
  ...annotations3
42312
42483
  }));
42313
42484
  var DateFromSelfSchemaId2 = DateFromSelfSchemaId;
@@ -42401,7 +42572,7 @@ class DateTimeUtc extends (/* @__PURE__ */ transformOrFail(String$.annotations({
42401
42572
  }), DateTimeUtcFromSelf, {
42402
42573
  strict: true,
42403
42574
  decode: (i, _, ast) => decodeDateTimeUtc(i, ast),
42404
- encode: (a) => succeed9(formatIso2(a))
42575
+ encode: (a) => succeed9(formatIso3(a))
42405
42576
  }).annotations({
42406
42577
  identifier: "DateTimeUtc"
42407
42578
  })) {
@@ -42523,10 +42694,10 @@ var optionPretty = (value3) => match2({
42523
42694
  onNone: () => "none()",
42524
42695
  onSome: (a) => `some(${value3(a)})`
42525
42696
  });
42526
- var optionParse = (decodeUnknown3) => (u, options, ast) => isOption2(u) ? isNone2(u) ? succeed9(none2()) : toComposite(decodeUnknown3(u.value, options), some2, ast, u) : fail10(new Type2(ast, u));
42697
+ var optionParse = (decodeUnknown4) => (u, options, ast) => isOption2(u) ? isNone2(u) ? succeed9(none2()) : toComposite(decodeUnknown4(u.value, options), some2, ast, u) : fail10(new Type2(ast, u));
42527
42698
  var OptionFromSelf_ = (value3) => {
42528
42699
  return declare([value3], {
42529
- decode: (value4) => optionParse(decodeUnknown(value4)),
42700
+ decode: (value4) => optionParse(decodeUnknown2(value4)),
42530
42701
  encode: (value4) => optionParse(encodeUnknown(value4))
42531
42702
  }, {
42532
42703
  pretty: optionPretty,
@@ -42622,7 +42793,7 @@ var EitherFromSelf = ({
42622
42793
  right: right3
42623
42794
  }) => {
42624
42795
  return declare([right3, left3], {
42625
- decode: (right4, left4) => eitherParse(decodeUnknown(right4), decodeUnknown(left4)),
42796
+ decode: (right4, left4) => eitherParse(decodeUnknown2(right4), decodeUnknown2(left4)),
42626
42797
  encode: (right4, left4) => eitherParse(encodeUnknown(right4), encodeUnknown(left4))
42627
42798
  }, {
42628
42799
  description: `Either<${format6(right3)}, ${format6(left3)}>`,
@@ -42703,9 +42874,9 @@ var readonlyMapEquivalence = (key, value3) => {
42703
42874
  const arrayEquivalence = getEquivalence3(make(([ka, va], [kb, vb]) => key(ka, kb) && value3(va, vb)));
42704
42875
  return make((a, b) => arrayEquivalence(Array.from(a.entries()), Array.from(b.entries())));
42705
42876
  };
42706
- var readonlyMapParse = (decodeUnknown3) => (u, options, ast) => isMap(u) ? toComposite(decodeUnknown3(Array.from(u.entries()), options), (as10) => new Map(as10), ast, u) : fail10(new Type2(ast, u));
42877
+ var readonlyMapParse = (decodeUnknown4) => (u, options, ast) => isMap(u) ? toComposite(decodeUnknown4(Array.from(u.entries()), options), (as10) => new Map(as10), ast, u) : fail10(new Type2(ast, u));
42707
42878
  var mapFromSelf_ = (key, value3, description) => declare([key, value3], {
42708
- decode: (Key2, Value2) => readonlyMapParse(decodeUnknown(Array$(Tuple(Key2, Value2)))),
42879
+ decode: (Key2, Value2) => readonlyMapParse(decodeUnknown2(Array$(Tuple(Key2, Value2)))),
42709
42880
  encode: (Key2, Value2) => readonlyMapParse(encodeUnknown(Array$(Tuple(Key2, Value2))))
42710
42881
  }, {
42711
42882
  description,
@@ -42788,9 +42959,9 @@ var readonlySetEquivalence = (item) => {
42788
42959
  const arrayEquivalence = getEquivalence3(item);
42789
42960
  return make((a, b) => arrayEquivalence(Array.from(a.values()), Array.from(b.values())));
42790
42961
  };
42791
- var readonlySetParse = (decodeUnknown3) => (u, options, ast) => isSet(u) ? toComposite(decodeUnknown3(Array.from(u.values()), options), (as10) => new Set(as10), ast, u) : fail10(new Type2(ast, u));
42962
+ var readonlySetParse = (decodeUnknown4) => (u, options, ast) => isSet(u) ? toComposite(decodeUnknown4(Array.from(u.values()), options), (as10) => new Set(as10), ast, u) : fail10(new Type2(ast, u));
42792
42963
  var setFromSelf_ = (value3, description) => declare([value3], {
42793
- decode: (item) => readonlySetParse(decodeUnknown(Array$(item))),
42964
+ decode: (item) => readonlySetParse(decodeUnknown2(Array$(item))),
42794
42965
  encode: (item) => readonlySetParse(encodeUnknown(Array$(item)))
42795
42966
  }, {
42796
42967
  description,
@@ -42853,12 +43024,12 @@ class BigDecimalFromNumber extends (/* @__PURE__ */ transform2(Number$.annotatio
42853
43024
  })) {
42854
43025
  }
42855
43026
  var GreaterThanBigDecimalSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/GreaterThanBigDecimal");
42856
- var greaterThanBigDecimal = (min4, annotations3) => (self) => {
42857
- const formatted = format4(min4);
42858
- return self.pipe(filter11((a) => greaterThan4(a, min4), {
43027
+ var greaterThanBigDecimal = (min5, annotations3) => (self) => {
43028
+ const formatted = format4(min5);
43029
+ return self.pipe(filter11((a) => greaterThan4(a, min5), {
42859
43030
  schemaId: GreaterThanBigDecimalSchemaId,
42860
43031
  [GreaterThanBigDecimalSchemaId]: {
42861
- min: min4
43032
+ min: min5
42862
43033
  },
42863
43034
  title: `greaterThanBigDecimal(${formatted})`,
42864
43035
  description: `a BigDecimal greater than ${formatted}`,
@@ -42866,12 +43037,12 @@ var greaterThanBigDecimal = (min4, annotations3) => (self) => {
42866
43037
  }));
42867
43038
  };
42868
43039
  var GreaterThanOrEqualToBigDecimalSchemaId = /* @__PURE__ */ Symbol.for("effect/schema/GreaterThanOrEqualToBigDecimal");
42869
- var greaterThanOrEqualToBigDecimal = (min4, annotations3) => (self) => {
42870
- const formatted = format4(min4);
42871
- return self.pipe(filter11((a) => greaterThanOrEqualTo3(a, min4), {
43040
+ var greaterThanOrEqualToBigDecimal = (min5, annotations3) => (self) => {
43041
+ const formatted = format4(min5);
43042
+ return self.pipe(filter11((a) => greaterThanOrEqualTo3(a, min5), {
42872
43043
  schemaId: GreaterThanOrEqualToBigDecimalSchemaId,
42873
43044
  [GreaterThanOrEqualToBigDecimalSchemaId]: {
42874
- min: min4
43045
+ min: min5
42875
43046
  },
42876
43047
  title: `greaterThanOrEqualToBigDecimal(${formatted})`,
42877
43048
  description: `a BigDecimal greater than or equal to ${formatted}`,
@@ -42879,12 +43050,12 @@ var greaterThanOrEqualToBigDecimal = (min4, annotations3) => (self) => {
42879
43050
  }));
42880
43051
  };
42881
43052
  var LessThanBigDecimalSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/LessThanBigDecimal");
42882
- var lessThanBigDecimal = (max6, annotations3) => (self) => {
42883
- const formatted = format4(max6);
42884
- return self.pipe(filter11((a) => lessThan7(a, max6), {
43053
+ var lessThanBigDecimal = (max7, annotations3) => (self) => {
43054
+ const formatted = format4(max7);
43055
+ return self.pipe(filter11((a) => lessThan7(a, max7), {
42885
43056
  schemaId: LessThanBigDecimalSchemaId,
42886
43057
  [LessThanBigDecimalSchemaId]: {
42887
- max: max6
43058
+ max: max7
42888
43059
  },
42889
43060
  title: `lessThanBigDecimal(${formatted})`,
42890
43061
  description: `a BigDecimal less than ${formatted}`,
@@ -42892,12 +43063,12 @@ var lessThanBigDecimal = (max6, annotations3) => (self) => {
42892
43063
  }));
42893
43064
  };
42894
43065
  var LessThanOrEqualToBigDecimalSchemaId = /* @__PURE__ */ Symbol.for("effect/schema/LessThanOrEqualToBigDecimal");
42895
- var lessThanOrEqualToBigDecimal = (max6, annotations3) => (self) => {
42896
- const formatted = format4(max6);
42897
- return self.pipe(filter11((a) => lessThanOrEqualTo3(a, max6), {
43066
+ var lessThanOrEqualToBigDecimal = (max7, annotations3) => (self) => {
43067
+ const formatted = format4(max7);
43068
+ return self.pipe(filter11((a) => lessThanOrEqualTo3(a, max7), {
42898
43069
  schemaId: LessThanOrEqualToBigDecimalSchemaId,
42899
43070
  [LessThanOrEqualToBigDecimalSchemaId]: {
42900
- max: max6
43071
+ max: max7
42901
43072
  },
42902
43073
  title: `lessThanOrEqualToBigDecimal(${formatted})`,
42903
43074
  description: `a BigDecimal less than or equal to ${formatted}`,
@@ -42975,10 +43146,10 @@ var chunkArbitrary = (item, ctx) => (fc) => {
42975
43146
  return (ctx.depthIdentifier !== undefined ? fc.oneof(ctx, fc.constant([]), items) : items).map(fromIterable2);
42976
43147
  };
42977
43148
  var chunkPretty = (item) => (c) => `Chunk(${toReadonlyArray(c).map(item).join(", ")})`;
42978
- var chunkParse = (decodeUnknown3) => (u, options, ast) => isChunk(u) ? isEmpty(u) ? succeed9(empty5()) : toComposite(decodeUnknown3(toReadonlyArray(u), options), fromIterable2, ast, u) : fail10(new Type2(ast, u));
43149
+ var chunkParse = (decodeUnknown4) => (u, options, ast) => isChunk(u) ? isEmpty(u) ? succeed9(empty5()) : toComposite(decodeUnknown4(toReadonlyArray(u), options), fromIterable2, ast, u) : fail10(new Type2(ast, u));
42979
43150
  var ChunkFromSelf = (value3) => {
42980
43151
  return declare([value3], {
42981
- decode: (item) => chunkParse(decodeUnknown(Array$(item))),
43152
+ decode: (item) => chunkParse(decodeUnknown2(Array$(item))),
42982
43153
  encode: (item) => chunkParse(encodeUnknown(Array$(item)))
42983
43154
  }, {
42984
43155
  description: `Chunk<${format6(value3)}>`,
@@ -42998,10 +43169,10 @@ var nonEmptyChunkArbitrary = (item) => (fc) => array5(item(fc), {
42998
43169
  minLength: 1
42999
43170
  }).map((as10) => unsafeFromNonEmptyArray(as10));
43000
43171
  var nonEmptyChunkPretty = (item) => (c) => `NonEmptyChunk(${toReadonlyArray(c).map(item).join(", ")})`;
43001
- var nonEmptyChunkParse = (decodeUnknown3) => (u, options, ast) => isChunk(u) && isNonEmpty(u) ? toComposite(decodeUnknown3(toReadonlyArray(u), options), unsafeFromNonEmptyArray, ast, u) : fail10(new Type2(ast, u));
43172
+ var nonEmptyChunkParse = (decodeUnknown4) => (u, options, ast) => isChunk(u) && isNonEmpty(u) ? toComposite(decodeUnknown4(toReadonlyArray(u), options), unsafeFromNonEmptyArray, ast, u) : fail10(new Type2(ast, u));
43002
43173
  var NonEmptyChunkFromSelf = (value3) => {
43003
43174
  return declare([value3], {
43004
- decode: (item) => nonEmptyChunkParse(decodeUnknown(NonEmptyArray(item))),
43175
+ decode: (item) => nonEmptyChunkParse(decodeUnknown2(NonEmptyArray(item))),
43005
43176
  encode: (item) => nonEmptyChunkParse(encodeUnknown(NonEmptyArray(item)))
43006
43177
  }, {
43007
43178
  description: `NonEmptyChunk<${format6(value3)}>`,
@@ -43020,10 +43191,10 @@ function NonEmptyChunk(value3) {
43020
43191
  var decodeData = (a) => Array.isArray(a) ? array3(a) : struct2(a);
43021
43192
  var dataArbitrary = (item) => (fc) => item(fc).map(decodeData);
43022
43193
  var dataPretty = (item) => (d) => `Data(${item(d)})`;
43023
- var dataParse = (decodeUnknown3) => (u, options, ast) => isEqual(u) ? toComposite(decodeUnknown3(u, options), decodeData, ast, u) : fail10(new Type2(ast, u));
43194
+ var dataParse = (decodeUnknown4) => (u, options, ast) => isEqual(u) ? toComposite(decodeUnknown4(u, options), decodeData, ast, u) : fail10(new Type2(ast, u));
43024
43195
  var DataFromSelf = (value3) => {
43025
43196
  return declare([value3], {
43026
- decode: (item) => dataParse(decodeUnknown(item)),
43197
+ decode: (item) => dataParse(decodeUnknown2(item)),
43027
43198
  encode: (item) => dataParse(encodeUnknown(item))
43028
43199
  }, {
43029
43200
  description: `Data<${format6(value3)}>`,
@@ -43453,13 +43624,13 @@ var causePretty = (error3) => (cause3) => {
43453
43624
  };
43454
43625
  return f(cause3);
43455
43626
  };
43456
- var causeParse = (decodeUnknown3) => (u, options, ast) => isCause2(u) ? toComposite(decodeUnknown3(causeEncode(u), options), causeDecode, ast, u) : fail10(new Type2(ast, u));
43627
+ var causeParse = (decodeUnknown4) => (u, options, ast) => isCause2(u) ? toComposite(decodeUnknown4(causeEncode(u), options), causeDecode, ast, u) : fail10(new Type2(ast, u));
43457
43628
  var CauseFromSelf = ({
43458
43629
  defect,
43459
43630
  error: error3
43460
43631
  }) => {
43461
43632
  return declare([error3, defect], {
43462
- decode: (error4, defect2) => causeParse(decodeUnknown(causeEncoded(error4, defect2))),
43633
+ decode: (error4, defect2) => causeParse(decodeUnknown2(causeEncoded(error4, defect2))),
43463
43634
  encode: (error4, defect2) => causeParse(encodeUnknown(causeEncoded(error4, defect2)))
43464
43635
  }, {
43465
43636
  title: `Cause<${error3.ast}>`,
@@ -43601,7 +43772,7 @@ var ExitFromSelf = ({
43601
43772
  failure,
43602
43773
  success
43603
43774
  }) => declare([success, failure, defect], {
43604
- decode: (success2, failure2, defect2) => exitParse(decodeUnknown(success2), decodeUnknown(CauseFromSelf({
43775
+ decode: (success2, failure2, defect2) => exitParse(decodeUnknown2(success2), decodeUnknown2(CauseFromSelf({
43605
43776
  error: failure2,
43606
43777
  defect: defect2
43607
43778
  }))),
@@ -43648,10 +43819,10 @@ var hashSetEquivalence = (item) => {
43648
43819
  const arrayEquivalence = getEquivalence3(item);
43649
43820
  return make((a, b) => arrayEquivalence(Array.from(a), Array.from(b)));
43650
43821
  };
43651
- var hashSetParse = (decodeUnknown3) => (u, options, ast) => isHashSet2(u) ? toComposite(decodeUnknown3(Array.from(u), options), fromIterable5, ast, u) : fail10(new Type2(ast, u));
43822
+ var hashSetParse = (decodeUnknown4) => (u, options, ast) => isHashSet2(u) ? toComposite(decodeUnknown4(Array.from(u), options), fromIterable5, ast, u) : fail10(new Type2(ast, u));
43652
43823
  var HashSetFromSelf = (value3) => {
43653
43824
  return declare([value3], {
43654
- decode: (item) => hashSetParse(decodeUnknown(Array$(item))),
43825
+ decode: (item) => hashSetParse(decodeUnknown2(Array$(item))),
43655
43826
  encode: (item) => hashSetParse(encodeUnknown(Array$(item)))
43656
43827
  }, {
43657
43828
  description: `HashSet<${format6(value3)}>`,
@@ -43676,13 +43847,13 @@ var hashMapEquivalence = (key, value3) => {
43676
43847
  const arrayEquivalence = getEquivalence3(make(([ka, va], [kb, vb]) => key(ka, kb) && value3(va, vb)));
43677
43848
  return make((a, b) => arrayEquivalence(Array.from(a), Array.from(b)));
43678
43849
  };
43679
- var hashMapParse = (decodeUnknown3) => (u, options, ast) => isHashMap2(u) ? toComposite(decodeUnknown3(Array.from(u), options), fromIterable6, ast, u) : fail10(new Type2(ast, u));
43850
+ var hashMapParse = (decodeUnknown4) => (u, options, ast) => isHashMap2(u) ? toComposite(decodeUnknown4(Array.from(u), options), fromIterable6, ast, u) : fail10(new Type2(ast, u));
43680
43851
  var HashMapFromSelf = ({
43681
43852
  key,
43682
43853
  value: value3
43683
43854
  }) => {
43684
43855
  return declare([key, value3], {
43685
- decode: (key2, value4) => hashMapParse(decodeUnknown(Array$(Tuple(key2, value4)))),
43856
+ decode: (key2, value4) => hashMapParse(decodeUnknown2(Array$(Tuple(key2, value4)))),
43686
43857
  encode: (key2, value4) => hashMapParse(encodeUnknown(Array$(Tuple(key2, value4))))
43687
43858
  }, {
43688
43859
  description: `HashMap<${format6(key)}, ${format6(value3)}>`,
@@ -43713,10 +43884,10 @@ var listEquivalence = (item) => {
43713
43884
  const arrayEquivalence = getEquivalence3(item);
43714
43885
  return make((a, b) => arrayEquivalence(Array.from(a), Array.from(b)));
43715
43886
  };
43716
- var listParse = (decodeUnknown3) => (u, options, ast) => isList(u) ? toComposite(decodeUnknown3(Array.from(u), options), fromIterable7, ast, u) : fail10(new Type2(ast, u));
43887
+ var listParse = (decodeUnknown4) => (u, options, ast) => isList(u) ? toComposite(decodeUnknown4(Array.from(u), options), fromIterable7, ast, u) : fail10(new Type2(ast, u));
43717
43888
  var ListFromSelf = (value3) => {
43718
43889
  return declare([value3], {
43719
- decode: (item) => listParse(decodeUnknown(Array$(item))),
43890
+ decode: (item) => listParse(decodeUnknown2(Array$(item))),
43720
43891
  encode: (item) => listParse(encodeUnknown(Array$(item)))
43721
43892
  }, {
43722
43893
  description: `List<${format6(value3)}>`,
@@ -43737,10 +43908,10 @@ var sortedSetArbitrary = (item, ord, ctx) => (fc) => {
43737
43908
  return (ctx.depthIdentifier !== undefined ? fc.oneof(ctx, fc.constant([]), items) : items).map((as10) => fromIterable11(as10, ord));
43738
43909
  };
43739
43910
  var sortedSetPretty = (item) => (set10) => `new SortedSet([${Array.from(values3(set10)).map((a) => item(a)).join(", ")}])`;
43740
- var sortedSetParse = (decodeUnknown3, ord) => (u, options, ast) => isSortedSet(u) ? toComposite(decodeUnknown3(Array.from(values3(u)), options), (as10) => fromIterable11(as10, ord), ast, u) : fail10(new Type2(ast, u));
43911
+ var sortedSetParse = (decodeUnknown4, ord) => (u, options, ast) => isSortedSet(u) ? toComposite(decodeUnknown4(Array.from(values3(u)), options), (as10) => fromIterable11(as10, ord), ast, u) : fail10(new Type2(ast, u));
43741
43912
  var SortedSetFromSelf = (value3, ordA, ordI) => {
43742
43913
  return declare([value3], {
43743
- decode: (item) => sortedSetParse(decodeUnknown(Array$(item)), ordA),
43914
+ decode: (item) => sortedSetParse(decodeUnknown2(Array$(item)), ordA),
43744
43915
  encode: (item) => sortedSetParse(encodeUnknown(Array$(item)), ordI)
43745
43916
  }, {
43746
43917
  description: `SortedSet<${format6(value3)}>`,
@@ -43785,7 +43956,7 @@ var symbolSerializable = /* @__PURE__ */ Symbol.for("effect/Schema/Serializable/
43785
43956
  var asSerializable = (serializable) => serializable;
43786
43957
  var serializableSchema = (self) => self[symbolSerializable];
43787
43958
  var serialize = (self) => encodeUnknown2(self[symbolSerializable])(self);
43788
- var deserialize = /* @__PURE__ */ dual(2, (self, value3) => decodeUnknown2(self[symbolSerializable])(value3));
43959
+ var deserialize = /* @__PURE__ */ dual(2, (self, value3) => decodeUnknown3(self[symbolSerializable])(value3));
43789
43960
  var symbolWithResult = /* @__PURE__ */ Symbol.for("effect/Schema/Serializable/symbolResult");
43790
43961
  var asWithResult = (withExit) => withExit;
43791
43962
  var failureSchema = (self) => self[symbolWithResult].failure;
@@ -43812,11 +43983,11 @@ var exitSchema = (self) => {
43812
43983
  return schema;
43813
43984
  };
43814
43985
  var serializeFailure = /* @__PURE__ */ dual(2, (self, value3) => encode4(self[symbolWithResult].failure)(value3));
43815
- var deserializeFailure = /* @__PURE__ */ dual(2, (self, value3) => decodeUnknown2(self[symbolWithResult].failure)(value3));
43986
+ var deserializeFailure = /* @__PURE__ */ dual(2, (self, value3) => decodeUnknown3(self[symbolWithResult].failure)(value3));
43816
43987
  var serializeSuccess = /* @__PURE__ */ dual(2, (self, value3) => encode4(self[symbolWithResult].success)(value3));
43817
- var deserializeSuccess = /* @__PURE__ */ dual(2, (self, value3) => decodeUnknown2(self[symbolWithResult].success)(value3));
43988
+ var deserializeSuccess = /* @__PURE__ */ dual(2, (self, value3) => decodeUnknown3(self[symbolWithResult].success)(value3));
43818
43989
  var serializeExit = /* @__PURE__ */ dual(2, (self, value3) => encode4(exitSchema(self))(value3));
43819
- var deserializeExit = /* @__PURE__ */ dual(2, (self, value3) => decodeUnknown2(exitSchema(self))(value3));
43990
+ var deserializeExit = /* @__PURE__ */ dual(2, (self, value3) => decodeUnknown3(exitSchema(self))(value3));
43820
43991
  var asSerializableWithResult = (procedure) => procedure;
43821
43992
  var TaggedRequest = (identifier2) => (tag2, options, annotations3) => {
43822
43993
  const taggedFields = extendFields({
@@ -45934,8 +46105,8 @@ var run6 = /* @__PURE__ */ fnUntraced2(function* (self) {
45934
46105
  const input = yield* terminal.readInput;
45935
46106
  return yield* runWithInput(self, terminal, input);
45936
46107
  }, /* @__PURE__ */ mapError3(() => new QuitException), scoped2);
45937
- var runWithInput = (prompt2, terminal, input) => suspend3(() => {
45938
- const op = prompt2;
46108
+ var runWithInput = (prompt, terminal, input) => suspend3(() => {
46109
+ const op = prompt;
45939
46110
  switch (op._tag) {
45940
46111
  case "Loop": {
45941
46112
  return runLoop(op, terminal, input);
@@ -46169,8 +46340,8 @@ function eraseText(text5, columns) {
46169
46340
  }
46170
46341
  return eraseLines3(rows);
46171
46342
  }
46172
- function lines(prompt2, columns) {
46173
- const lines2 = prompt2.split(/\r?\n/);
46343
+ function lines(prompt, columns) {
46344
+ const lines2 = prompt.split(/\r?\n/);
46174
46345
  return columns === 0 ? lines2.length : pipe(map4(lines2, (line4) => Math.ceil(line4.length / columns)), reduce(0, (left3, right3) => left3 + right3));
46175
46346
  }
46176
46347
 
@@ -47140,12 +47311,12 @@ var Path2 = Path;
47140
47311
 
47141
47312
  // node_modules/@effect/cli/dist/esm/internal/prompt/utils.js
47142
47313
  var entriesToDisplay = (cursor, total, maxVisible) => {
47143
- const max7 = maxVisible === undefined ? total : maxVisible;
47144
- let startIndex = Math.min(total - max7, cursor - Math.floor(max7 / 2));
47314
+ const max8 = maxVisible === undefined ? total : maxVisible;
47315
+ let startIndex = Math.min(total - max8, cursor - Math.floor(max8 / 2));
47145
47316
  if (startIndex < 0) {
47146
47317
  startIndex = 0;
47147
47318
  }
47148
- const endIndex = Math.min(startIndex + max7, total);
47319
+ const endIndex = Math.min(startIndex + max8, total);
47149
47320
  return {
47150
47321
  startIndex,
47151
47322
  endIndex
@@ -47438,8 +47609,8 @@ var file = (options3 = {}) => {
47438
47609
  };
47439
47610
 
47440
47611
  // node_modules/@effect/cli/dist/esm/internal/prompt/number.js
47441
- var parseInt2 = /* @__PURE__ */ NumberFromString.pipe(/* @__PURE__ */ int(), decodeUnknown2);
47442
- var parseFloat2 = /* @__PURE__ */ decodeUnknown2(NumberFromString);
47612
+ var parseInt2 = /* @__PURE__ */ NumberFromString.pipe(/* @__PURE__ */ int(), decodeUnknown3);
47613
+ var parseFloat2 = /* @__PURE__ */ decodeUnknown3(NumberFromString);
47443
47614
  var renderBeep3 = /* @__PURE__ */ render3(beep3, {
47444
47615
  style: "pretty"
47445
47616
  });
@@ -48566,14 +48737,14 @@ var validateInternal = (self, value6, config2) => {
48566
48737
  }));
48567
48738
  }
48568
48739
  case "DateTime": {
48569
- return attempt(value6, getTypeNameInternal(self), decodeUnknown2(Date$));
48740
+ return attempt(value6, getTypeNameInternal(self), decodeUnknown3(Date$));
48570
48741
  }
48571
48742
  case "Float": {
48572
- return attempt(value6, getTypeNameInternal(self), decodeUnknown2(NumberFromString));
48743
+ return attempt(value6, getTypeNameInternal(self), decodeUnknown3(NumberFromString));
48573
48744
  }
48574
48745
  case "Integer": {
48575
48746
  const intFromString = compose3(NumberFromString, Int);
48576
- return attempt(value6, getTypeNameInternal(self), decodeUnknown2(intFromString));
48747
+ return attempt(value6, getTypeNameInternal(self), decodeUnknown3(intFromString));
48577
48748
  }
48578
48749
  case "Path": {
48579
48750
  return flatMap11(FileSystem, (fileSystem) => {
@@ -48582,13 +48753,13 @@ var validateInternal = (self, value6, config2) => {
48582
48753
  });
48583
48754
  }
48584
48755
  case "Redacted": {
48585
- return attempt(value6, getTypeNameInternal(self), decodeUnknown2(String$)).pipe(map17((value7) => make58(value7)));
48756
+ return attempt(value6, getTypeNameInternal(self), decodeUnknown3(String$)).pipe(map17((value7) => make58(value7)));
48586
48757
  }
48587
48758
  case "Secret": {
48588
- return attempt(value6, getTypeNameInternal(self), decodeUnknown2(String$)).pipe(map17((value7) => fromString4(value7)));
48759
+ return attempt(value6, getTypeNameInternal(self), decodeUnknown3(String$)).pipe(map17((value7) => fromString4(value7)));
48589
48760
  }
48590
48761
  case "Text": {
48591
- return attempt(value6, getTypeNameInternal(self), decodeUnknown2(String$));
48762
+ return attempt(value6, getTypeNameInternal(self), decodeUnknown3(String$));
48592
48763
  }
48593
48764
  }
48594
48765
  };
@@ -49064,10 +49235,10 @@ var getHelpInternal2 = (self) => {
49064
49235
  case "Variadic": {
49065
49236
  const help = getHelpInternal2(self.args);
49066
49237
  return mapDescriptionList(help, (oldSpan, oldBlock) => {
49067
- const min5 = getMinSizeInternal(self);
49068
- const max7 = getMaxSizeInternal(self);
49069
- const newSpan = text4(isSome2(self.max) ? ` ${min5} - ${max7}` : min5 === 0 ? "..." : ` ${min5}+`);
49070
- const newBlock = p(isSome2(self.max) ? `This argument must be repeated at least ${min5} times and may be repeated up to ${max7} times.` : min5 === 0 ? "This argument may be repeated zero or more times." : `This argument must be repeated at least ${min5} times.`);
49238
+ const min6 = getMinSizeInternal(self);
49239
+ const max8 = getMaxSizeInternal(self);
49240
+ const newSpan = text4(isSome2(self.max) ? ` ${min6} - ${max8}` : min6 === 0 ? "..." : ` ${min6}+`);
49241
+ const newBlock = p(isSome2(self.max) ? `This argument must be repeated at least ${min6} times and may be repeated up to ${max8} times.` : min6 === 0 ? "This argument may be repeated zero or more times." : `This argument must be repeated at least ${min6} times.`);
49071
49242
  return [concat4(oldSpan, newSpan), sequence(oldBlock, newBlock)];
49072
49243
  });
49073
49244
  }
@@ -49515,7 +49686,7 @@ var secret3 = (name) => makeSingle(name, empty2(), secret2);
49515
49686
  var text7 = (name) => makeSingle(name, empty2(), text6);
49516
49687
  var atLeast = /* @__PURE__ */ dual(2, (self, times2) => makeVariadic(self, some2(times2), none2()));
49517
49688
  var atMost = /* @__PURE__ */ dual(2, (self, times2) => makeVariadic(self, none2(), some2(times2)));
49518
- var between6 = /* @__PURE__ */ dual(3, (self, min5, max7) => makeVariadic(self, some2(min5), some2(max7)));
49689
+ var between6 = /* @__PURE__ */ dual(3, (self, min6, max8) => makeVariadic(self, some2(min6), some2(max8)));
49519
49690
  var isBool2 = (self) => isBoolInternal(self);
49520
49691
  var getHelp4 = (self) => getHelpInternal3(self);
49521
49692
  var getIdentifier = (self) => getIdentifierInternal(self);
@@ -49549,11 +49720,11 @@ var withFallbackConfig = /* @__PURE__ */ dual(2, (self, config2) => {
49549
49720
  }
49550
49721
  return makeWithFallback(self, config2);
49551
49722
  });
49552
- var withFallbackPrompt = /* @__PURE__ */ dual(2, (self, prompt2) => {
49723
+ var withFallbackPrompt = /* @__PURE__ */ dual(2, (self, prompt) => {
49553
49724
  if (isInstruction(self) && isWithDefault(self)) {
49554
- return makeWithDefault(withFallbackPrompt(self.options, prompt2), self.fallback);
49725
+ return makeWithDefault(withFallbackPrompt(self.options, prompt), self.fallback);
49555
49726
  }
49556
- return makeWithFallback(self, prompt2);
49727
+ return makeWithFallback(self, prompt);
49557
49728
  });
49558
49729
  var withDescription2 = /* @__PURE__ */ dual(2, (self, desc) => modifySingle(self, (single2) => {
49559
49730
  const description = sequence(single2.description, p(desc));
@@ -49608,10 +49779,10 @@ var getHelpInternal3 = (self) => {
49608
49779
  case "Variadic": {
49609
49780
  const help = getHelpInternal3(self.argumentOption);
49610
49781
  return mapDescriptionList(help, (oldSpan, oldBlock) => {
49611
- const min5 = getMinSizeInternal2(self);
49612
- const max7 = getMaxSizeInternal2(self);
49613
- const newSpan = text4(isSome2(self.max) ? ` ${min5} - ${max7}` : min5 === 0 ? "..." : ` ${min5}+`);
49614
- const newBlock = p(isSome2(self.max) ? `This option must be repeated at least ${min5} times and may be repeated up to ${max7} times.` : min5 === 0 ? "This option may be repeated zero or more times." : `This option must be repeated at least ${min5} times.`);
49782
+ const min6 = getMinSizeInternal2(self);
49783
+ const max8 = getMaxSizeInternal2(self);
49784
+ const newSpan = text4(isSome2(self.max) ? ` ${min6} - ${max8}` : min6 === 0 ? "..." : ` ${min6}+`);
49785
+ const newBlock = p(isSome2(self.max) ? `This option must be repeated at least ${min6} times and may be repeated up to ${max8} times.` : min6 === 0 ? "This option may be repeated zero or more times." : `This option must be repeated at least ${min6} times.`);
49615
49786
  return [concat4(oldSpan, newSpan), sequence(oldBlock, newBlock)];
49616
49787
  });
49617
49788
  }
@@ -49811,15 +49982,15 @@ var makeSingle = (name, aliases, primitiveType, description = empty39, pseudoNam
49811
49982
  op.pseudoName = pseudoName;
49812
49983
  return op;
49813
49984
  };
49814
- var makeVariadic = (argumentOption, min5, max7) => {
49985
+ var makeVariadic = (argumentOption, min6, max8) => {
49815
49986
  if (!isSingle2(argumentOption)) {
49816
49987
  throw new Error("InvalidArgumentException: only single options can be variadic");
49817
49988
  }
49818
49989
  const op = Object.create(proto22);
49819
49990
  op._tag = "Variadic";
49820
49991
  op.argumentOption = argumentOption;
49821
- op.min = min5;
49822
- op.max = max7;
49992
+ op.min = min6;
49993
+ op.max = max8;
49823
49994
  return op;
49824
49995
  };
49825
49996
  var makeWithDefault = (options3, fallback) => {
@@ -49988,18 +50159,18 @@ var parseInternal = (self, args2, config2) => {
49988
50159
  }));
49989
50160
  }
49990
50161
  case "Variadic": {
49991
- const min5 = getOrElse(self.min, () => 0);
49992
- const max7 = getOrElse(self.max, () => Number.MAX_SAFE_INTEGER);
50162
+ const min6 = getOrElse(self.min, () => 0);
50163
+ const max8 = getOrElse(self.max, () => Number.MAX_SAFE_INTEGER);
49993
50164
  const matchedArgument = filterMap2(getNames(self), (name) => get7(args2, name));
49994
50165
  const validateMinMax = (values4) => {
49995
- if (values4.length < min5) {
50166
+ if (values4.length < min6) {
49996
50167
  const name = self.argumentOption.fullName;
49997
- const error4 = `Expected at least ${min5} value(s) for option: '${name}'`;
50168
+ const error4 = `Expected at least ${min6} value(s) for option: '${name}'`;
49998
50169
  return fail9(invalidValue(p(error4)));
49999
50170
  }
50000
- if (values4.length > max7) {
50171
+ if (values4.length > max8) {
50001
50172
  const name = self.argumentOption.fullName;
50002
- const error4 = `Expected at most ${max7} value(s) for option: '${name}'`;
50173
+ const error4 = `Expected at most ${max8} value(s) for option: '${name}'`;
50003
50174
  return fail9(invalidValue(p(error4)));
50004
50175
  }
50005
50176
  const primitive2 = self.argumentOption.primitiveType;
@@ -50697,12 +50868,12 @@ var make65 = (name, options3 = none12, args2 = none11) => {
50697
50868
  op.args = args2;
50698
50869
  return op;
50699
50870
  };
50700
- var prompt2 = (name, prompt3) => {
50871
+ var prompt = (name, prompt2) => {
50701
50872
  const op = Object.create(proto23);
50702
50873
  op._tag = "GetUserInput";
50703
50874
  op.name = name;
50704
50875
  op.description = empty39;
50705
- op.prompt = prompt3;
50876
+ op.prompt = prompt2;
50706
50877
  return op;
50707
50878
  };
50708
50879
  var getHelp6 = (self, config2) => getHelpInternal4(self, config2);
@@ -50774,7 +50945,7 @@ var getHelpInternal4 = (self, config2) => {
50774
50945
  }
50775
50946
  };
50776
50947
  const printSubcommands = (subcommands) => {
50777
- const maxUsageLength = reduceRight(subcommands, 0, (max7, [usage]) => Math.max(size16(usage), max7));
50948
+ const maxUsageLength = reduceRight(subcommands, 0, (max8, [usage]) => Math.max(size16(usage), max8));
50778
50949
  const documents = map4(subcommands, ([usage, desc]) => p(spans([usage, text4(" ".repeat(maxUsageLength - size16(usage) + 2)), desc])));
50779
50950
  if (isNonEmptyReadonlyArray(documents)) {
50780
50951
  return enumeration(documents);
@@ -51407,7 +51578,7 @@ __export(exports_Command, {
51407
51578
  provideEffectDiscard: () => provideEffectDiscard2,
51408
51579
  provideEffect: () => provideEffect2,
51409
51580
  provide: () => provide5,
51410
- prompt: () => prompt4,
51581
+ prompt: () => prompt3,
51411
51582
  make: () => make68,
51412
51583
  getZshCompletions: () => getZshCompletions6,
51413
51584
  getUsage: () => getUsage6,
@@ -51541,7 +51712,7 @@ var getUsage5 = (self) => getUsage4(self.descriptor);
51541
51712
  var mapDescriptor = /* @__PURE__ */ dual(2, (self, f) => makeDerive(self, {
51542
51713
  descriptor: f(self.descriptor)
51543
51714
  }));
51544
- var prompt3 = (name, prompt4, handler) => makeProto(map37(prompt2(name, prompt4), (_) => _.value), handler, GenericTag(`@effect/cli/Prompt/${name}`));
51715
+ var prompt2 = (name, prompt3, handler) => makeProto(map37(prompt(name, prompt3), (_) => _.value), handler, GenericTag(`@effect/cli/Prompt/${name}`));
51545
51716
  var withHandler = /* @__PURE__ */ dual(2, (self, handler) => makeDerive(self, {
51546
51717
  handler,
51547
51718
  transform: identity
@@ -51614,7 +51785,7 @@ var getZshCompletions6 = getZshCompletions5;
51614
51785
  var getSubcommands3 = getSubcommands2;
51615
51786
  var getUsage6 = getUsage5;
51616
51787
  var make68 = make67;
51617
- var prompt4 = prompt3;
51788
+ var prompt3 = prompt2;
51618
51789
  var provide5 = provide4;
51619
51790
  var provideEffect2 = provideEffect;
51620
51791
  var provideEffectDiscard2 = provideEffectDiscard;
@@ -52355,18 +52526,18 @@ var toRecord = (self) => {
52355
52526
  };
52356
52527
  };
52357
52528
  var schemaJson = (schema, options3) => {
52358
- const parse8 = decodeUnknown2(parseJson(schema), options3);
52529
+ const parse8 = decodeUnknown3(parseJson(schema), options3);
52359
52530
  return dual(2, (self, field) => parse8(getOrElse(getLast(self, field), () => "")));
52360
52531
  };
52361
52532
  var schemaStruct = (schema, options3) => (self) => {
52362
- const parse8 = decodeUnknown2(schema, options3);
52533
+ const parse8 = decodeUnknown3(schema, options3);
52363
52534
  return parse8(toRecord(self));
52364
52535
  };
52365
52536
 
52366
52537
  // node_modules/@effect/platform/dist/esm/HttpIncomingMessage.js
52367
52538
  var TypeId31 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpIncomingMessage");
52368
52539
  var schemaBodyJson = (schema, options3) => {
52369
- const parse8 = decodeUnknown2(schema, options3);
52540
+ const parse8 = decodeUnknown3(schema, options3);
52370
52541
  return (self) => flatMap11(self.json, parse8);
52371
52542
  };
52372
52543
  var schemaBodyUrlParams = (schema, options3) => {
@@ -52374,7 +52545,7 @@ var schemaBodyUrlParams = (schema, options3) => {
52374
52545
  return (self) => flatMap11(self.urlParamsBody, decode7);
52375
52546
  };
52376
52547
  var schemaHeaders = (schema, options3) => {
52377
- const parse8 = decodeUnknown2(schema, options3);
52548
+ const parse8 = decodeUnknown3(schema, options3);
52378
52549
  return (self) => parse8(self.headers);
52379
52550
  };
52380
52551
 
@@ -54646,10 +54817,10 @@ class MultipartError extends (/* @__PURE__ */ TaggedError2()("MultipartError", {
54646
54817
  return this.reason;
54647
54818
  }
54648
54819
  }
54649
- var schemaPersisted = (schema, options4) => decodeUnknown2(schema, options4);
54820
+ var schemaPersisted = (schema, options4) => decodeUnknown3(schema, options4);
54650
54821
  var schemaJson4 = (schema, options4) => {
54651
54822
  const fromJson = parseJson(schema);
54652
- return dual(2, (persisted, field) => map17(decodeUnknown2(Struct({
54823
+ return dual(2, (persisted, field) => map17(decodeUnknown3(Struct({
54653
54824
  [field]: fromJson
54654
54825
  }), options4)(persisted), (_) => _[field]));
54655
54826
  };
@@ -55106,7 +55277,7 @@ var searchParamsFromURL = (url2) => {
55106
55277
  return out;
55107
55278
  };
55108
55279
  var schemaCookies = (schema, options4) => {
55109
- const parse9 = decodeUnknown2(schema, options4);
55280
+ const parse9 = decodeUnknown3(schema, options4);
55110
55281
  return flatMap11(serverRequestTag, (req) => parse9(req.cookies));
55111
55282
  };
55112
55283
  var schemaHeaders2 = (schema, options4) => {
@@ -55114,7 +55285,7 @@ var schemaHeaders2 = (schema, options4) => {
55114
55285
  return flatMap11(serverRequestTag, parse9);
55115
55286
  };
55116
55287
  var schemaSearchParams = (schema, options4) => {
55117
- const parse9 = decodeUnknown2(schema, options4);
55288
+ const parse9 = decodeUnknown3(schema, options4);
55118
55289
  return flatMap11(parsedSearchParamsTag, parse9);
55119
55290
  };
55120
55291
  var schemaBodyJson2 = (schema, options4) => {
@@ -56346,7 +56517,7 @@ var RouteContext = /* @__PURE__ */ GenericTag("@effect/platform/HttpRouter/Route
56346
56517
  var isRouter = (u) => hasProperty(u, TypeId50);
56347
56518
  var params = /* @__PURE__ */ map17(RouteContext, (_) => _.params);
56348
56519
  var schemaJson5 = (schema, options5) => {
56349
- const parse10 = decodeUnknown2(schema, options5);
56520
+ const parse10 = decodeUnknown3(schema, options5);
56350
56521
  return flatMap11(context3(), (context9) => {
56351
56522
  const request2 = get3(context9, HttpServerRequest);
56352
56523
  const searchParams = get3(context9, ParsedSearchParams);
@@ -56363,7 +56534,7 @@ var schemaJson5 = (schema, options5) => {
56363
56534
  });
56364
56535
  };
56365
56536
  var schemaNoBody = (schema, options5) => {
56366
- const parse10 = decodeUnknown2(schema, options5);
56537
+ const parse10 = decodeUnknown3(schema, options5);
56367
56538
  return flatMap11(context3(), (context9) => {
56368
56539
  const request2 = get3(context9, HttpServerRequest);
56369
56540
  const searchParams = get3(context9, ParsedSearchParams);
@@ -56379,7 +56550,7 @@ var schemaNoBody = (schema, options5) => {
56379
56550
  });
56380
56551
  };
56381
56552
  var schemaParams = (schema, options5) => {
56382
- const parse10 = decodeUnknown2(schema, options5);
56553
+ const parse10 = decodeUnknown3(schema, options5);
56383
56554
  return flatMap11(context3(), (context9) => {
56384
56555
  const searchParams = get3(context9, ParsedSearchParams);
56385
56556
  const routeContext = get3(context9, RouteContext);
@@ -56390,7 +56561,7 @@ var schemaParams = (schema, options5) => {
56390
56561
  });
56391
56562
  };
56392
56563
  var schemaPathParams = (schema, options5) => {
56393
- const parse10 = decodeUnknown2(schema, options5);
56564
+ const parse10 = decodeUnknown3(schema, options5);
56394
56565
  return flatMap11(RouteContext, (_) => parse10(_.params));
56395
56566
  };
56396
56567
  var currentRouterConfig = /* @__PURE__ */ globalValue("@effect/platform/HttpRouter/currentRouterConfig", () => unsafeMake10({}));
@@ -57687,8 +57858,8 @@ var make88 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
57687
57858
  readlineInterface.once("line", onLine);
57688
57859
  return sync4(() => readlineInterface.off("line", onLine));
57689
57860
  })), scoped2);
57690
- const display = (prompt5) => uninterruptible2(async((resume2) => {
57691
- stdout2.write(prompt5, (err) => err ? resume2(fail9(new BadArgument({
57861
+ const display = (prompt4) => uninterruptible2(async((resume2) => {
57862
+ stdout2.write(prompt4, (err) => err ? resume2(fail9(new BadArgument({
57692
57863
  module: "Terminal",
57693
57864
  method: "display",
57694
57865
  description: "Failed to write prompt to stdout",
@@ -59742,53 +59913,19 @@ async function createOpencode(options7) {
59742
59913
  }
59743
59914
 
59744
59915
  // src/services/config.ts
59745
- import { mkdir as mkdir2 } from "fs/promises";
59746
59916
  import * as path3 from "path";
59747
59917
 
59748
- // src/lib/temp-constants.ts
59749
- var CONFIG_DIRECTORY = "~/.config/btca";
59750
- var REPOS_DIRECTORY = `${CONFIG_DIRECTORY}/repos`;
59751
- var PROMPTS_DIRECTORY = `${CONFIG_DIRECTORY}/prompts`;
59752
- var DOCS_PROMPT_FILENAME = "docs-agent.md";
59753
-
59754
- // src/lib/defaults.ts
59755
- var defaultRepos = {
59756
- effect: {
59757
- name: "effect",
59758
- url: "https://github.com/Effect-TS/effect",
59759
- branch: "main"
59760
- },
59761
- opencode: {
59762
- name: "opencode",
59763
- url: "https://github.com/sst/opencode",
59764
- branch: "production"
59765
- },
59766
- svelte: {
59767
- name: "svelte",
59768
- url: "https://github.com/sveltejs/svelte.dev",
59769
- branch: "main"
59770
- },
59771
- daytona: {
59772
- name: "daytona",
59773
- url: "https://github.com/daytonaio/daytona",
59774
- branch: "main"
59775
- }
59776
- };
59777
-
59778
59918
  // src/lib/prompts.ts
59779
59919
  var getDocsAgentPrompt = (args2) => `
59780
- You are an expert internal agent who's job is to answer coding questions and provide accurate and up to date info on different technologies, libraries, frameworks, or tools you're using based on the library codebases you have access to.
59920
+ You are an expert internal agent who's job is to answer coding questions and provide accurate and up to date info on ${args2.repoName} based on the codebase you have access to. It may be the source code, or it may be the documentation. You are running in the background, and the user cannot ask follow up questions. You must always answer the question based on the codebase you have access to. If the question is not related to the codebase you have access to, you must say so and that you are not able to answer the question.
59781
59921
 
59782
- Currently you have access to the following codebases:
59922
+ NEVER SEARCH THE WEB FOR INFORMATION. ALWAYS USE THE CODEBASE YOU HAVE ACCESS TO.
59783
59923
 
59784
- ${args2.repos.map((repo) => `- ${repo.name}`).join(`
59785
- `)}
59786
-
59787
- They are located at the following path:
59924
+ This is what you have access to:
59788
59925
 
59789
- ${args2.reposDirectory}
59926
+ '${args2.repoPath}'
59790
59927
 
59791
- When asked a question regarding the codebase, search the codebase to get an accurate answer.
59928
+ When asked a question regarding ${args2.repoName}, search the codebase to get an accurate answer.
59792
59929
 
59793
59930
  Always search the codebase first before using the web to try to answer the question.
59794
59931
 
@@ -59796,12 +59933,11 @@ When you are searching the codebase, be very careful that you do not read too mu
59796
59933
 
59797
59934
  When responding:
59798
59935
 
59799
- - If something about the question is not clear, ask the user to provide more information
59800
- - Really try to keep your responses concise, you don't need tons of examples, just one really good one
59801
59936
  - Be extremely concise. Sacrifice grammar for the sake of concision.
59802
59937
  - When outputting code snippets, include comments that explain what each piece does
59803
59938
  - Always bias towards simple practical examples over complex theoretical explanations
59804
59939
  - Give your response in markdown format, make sure to have spacing between code blocks and other content
59940
+ - Avoid asking follow up questions, just answer the question
59805
59941
  `;
59806
59942
 
59807
59943
  // src/lib/errors.ts
@@ -59818,10 +59954,14 @@ class ConfigError extends TaggedError("ConfigError") {
59818
59954
  var cloneRepo = (args2) => exports_Effect.tryPromise({
59819
59955
  try: async () => {
59820
59956
  const { repoDir, url: url2, branch } = args2;
59821
- const proc = Bun.spawn(["git", "clone", "--branch", branch, url2, repoDir], {
59822
- stdout: "inherit",
59823
- stderr: "inherit"
59824
- });
59957
+ const proc = Bun.spawn([
59958
+ "git",
59959
+ "clone",
59960
+ "--branch",
59961
+ branch,
59962
+ url2,
59963
+ repoDir
59964
+ ]);
59825
59965
  const exitCode2 = await proc.exited;
59826
59966
  if (exitCode2 !== 0) {
59827
59967
  throw new Error(`git clone failed with exit code ${exitCode2}`);
@@ -59833,9 +59973,7 @@ var pullRepo = (args2) => exports_Effect.tryPromise({
59833
59973
  try: async () => {
59834
59974
  const { repoDir, branch } = args2;
59835
59975
  const proc = Bun.spawn(["git", "pull", "origin", branch], {
59836
- cwd: repoDir,
59837
- stdout: "inherit",
59838
- stderr: "inherit"
59976
+ cwd: repoDir
59839
59977
  });
59840
59978
  const exitCode2 = await proc.exited;
59841
59979
  if (exitCode2 !== 0) {
@@ -59859,42 +59997,143 @@ var directoryExists = (dir2) => exports_Effect.try({
59859
59997
  });
59860
59998
 
59861
59999
  // src/services/config.ts
59862
- var configService = exports_Effect.gen(function* () {
59863
- const promptsDir = expandHome(PROMPTS_DIRECTORY);
59864
- const reposDir = expandHome(REPOS_DIRECTORY);
59865
- const promptPath = path3.join(promptsDir, DOCS_PROMPT_FILENAME);
59866
- const ensureDocsAgentPrompt = (args2) => exports_Effect.gen(function* () {
59867
- const { repos } = args2;
60000
+ var CONFIG_DIRECTORY = "~/.config/btca";
60001
+ var CONFIG_FILENAME = "btca.json";
60002
+ var repoSchema = exports_Schema.Struct({
60003
+ name: exports_Schema.String,
60004
+ url: exports_Schema.String,
60005
+ branch: exports_Schema.String
60006
+ });
60007
+ var configSchema = exports_Schema.Struct({
60008
+ promptsDirectory: exports_Schema.String,
60009
+ reposDirectory: exports_Schema.String,
60010
+ port: exports_Schema.Number,
60011
+ maxInstances: exports_Schema.Number,
60012
+ repos: exports_Schema.Array(repoSchema),
60013
+ model: exports_Schema.String,
60014
+ provider: exports_Schema.String
60015
+ });
60016
+ var DEFAULT_CONFIG = {
60017
+ promptsDirectory: `${CONFIG_DIRECTORY}/prompts`,
60018
+ reposDirectory: `${CONFIG_DIRECTORY}/repos`,
60019
+ port: 3420,
60020
+ maxInstances: 5,
60021
+ repos: [
60022
+ {
60023
+ name: "svelte",
60024
+ url: "https://github.com/sveltejs/svelte.dev",
60025
+ branch: "main"
60026
+ },
60027
+ {
60028
+ name: "effect",
60029
+ url: "https://github.com/Effect-TS/effect",
60030
+ branch: "main"
60031
+ },
60032
+ {
60033
+ name: "nextjs",
60034
+ url: "https://github.com/vercel/next.js",
60035
+ branch: "canary"
60036
+ }
60037
+ ],
60038
+ model: "grok-code",
60039
+ provider: "opencode"
60040
+ };
60041
+ var OPENCODE_CONFIG = (args2) => ({
60042
+ agent: {
60043
+ build: {
60044
+ disable: true
60045
+ },
60046
+ general: {
60047
+ disable: true
60048
+ },
60049
+ plan: {
60050
+ disable: true
60051
+ },
60052
+ ask: {
60053
+ disable: true
60054
+ },
60055
+ docs: {
60056
+ prompt: getDocsAgentPrompt({
60057
+ repoName: args2.repoName,
60058
+ repoPath: path3.join(args2.config.reposDirectory, args2.repoName)
60059
+ }),
60060
+ disable: false,
60061
+ description: "Get answers about libraries and frameworks by searching their source code",
60062
+ permission: {
60063
+ webfetch: "deny",
60064
+ edit: "deny",
60065
+ bash: "allow",
60066
+ external_directory: "allow",
60067
+ doom_loop: "deny"
60068
+ },
60069
+ mode: "primary",
60070
+ tools: {
60071
+ write: false,
60072
+ bash: true,
60073
+ delete: false,
60074
+ read: true,
60075
+ grep: true,
60076
+ glob: true,
60077
+ list: true,
60078
+ path: false,
60079
+ todowrite: false,
60080
+ todoread: false,
60081
+ websearch: false
60082
+ }
60083
+ }
60084
+ }
60085
+ });
60086
+ var onStartLoadConfig = exports_Effect.gen(function* () {
60087
+ const configPath = expandHome(path3.join(CONFIG_DIRECTORY, CONFIG_FILENAME));
60088
+ const configFile = Bun.file(configPath);
60089
+ const exists4 = yield* exports_Effect.promise(() => configFile.exists());
60090
+ if (!exists4) {
60091
+ yield* exports_Effect.log(`Config file not found at ${configPath}, creating default config...`);
59868
60092
  yield* exports_Effect.tryPromise({
59869
- try: () => mkdir2(promptsDir, { recursive: true }),
60093
+ try: () => Bun.write(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2)),
59870
60094
  catch: (error4) => new ConfigError({
59871
- message: "Failed to create prompts directory",
60095
+ message: "Failed to create default config",
59872
60096
  cause: error4
59873
60097
  })
59874
60098
  });
59875
- const promptContent = getDocsAgentPrompt({
59876
- repos: Object.values(repos),
59877
- reposDirectory: reposDir
59878
- });
59879
- yield* exports_Effect.tryPromise({
59880
- try: () => Bun.write(promptPath, promptContent),
60099
+ yield* exports_Effect.log(`Default config created at ${configPath}`);
60100
+ return {
60101
+ ...DEFAULT_CONFIG,
60102
+ promptsDirectory: expandHome(DEFAULT_CONFIG.promptsDirectory),
60103
+ reposDirectory: expandHome(DEFAULT_CONFIG.reposDirectory)
60104
+ };
60105
+ } else {
60106
+ return yield* exports_Effect.tryPromise({
60107
+ try: () => configFile.json(),
59881
60108
  catch: (error4) => new ConfigError({
59882
- message: "Failed to write docs agent prompt",
60109
+ message: "Failed to load config",
59883
60110
  cause: error4
59884
60111
  })
59885
- });
59886
- yield* exports_Effect.log(`Wrote docs agent prompt at ${promptPath}`);
59887
- });
59888
- const getRepo = (repoName) => exports_Effect.gen(function* () {
59889
- if (Object.keys(defaultRepos).includes(repoName)) {
59890
- return defaultRepos[repoName];
60112
+ }).pipe(exports_Effect.flatMap(exports_Schema.decode(configSchema)), exports_Effect.map((loadedConfig) => {
60113
+ return {
60114
+ ...loadedConfig,
60115
+ promptsDirectory: expandHome(loadedConfig.promptsDirectory),
60116
+ reposDirectory: expandHome(loadedConfig.reposDirectory)
60117
+ };
60118
+ }));
60119
+ }
60120
+ });
60121
+ var configService = exports_Effect.gen(function* () {
60122
+ const config2 = yield* onStartLoadConfig;
60123
+ const getRepo = ({
60124
+ repoName,
60125
+ config: config3
60126
+ }) => exports_Effect.gen(function* () {
60127
+ const repo = config3.repos.find((repo2) => repo2.name === repoName);
60128
+ if (!repo) {
60129
+ return yield* exports_Effect.fail(new ConfigError({ message: "Repo not found" }));
59891
60130
  }
59892
- return yield* exports_Effect.fail(new ConfigError({ message: "Repo not found" }));
60131
+ return repo;
59893
60132
  });
59894
60133
  return {
59895
60134
  cloneOrUpdateOneRepoLocally: (repoName) => exports_Effect.gen(function* () {
59896
- const repo = yield* getRepo(repoName);
59897
- const repoDir = path3.join(reposDir, repo.name);
60135
+ const repo = yield* getRepo({ repoName, config: config2 });
60136
+ const repoDir = path3.join(config2.reposDirectory, repo.name);
59898
60137
  const branch = repo.branch ?? "main";
59899
60138
  const exists4 = yield* directoryExists(repoDir);
59900
60139
  if (exists4) {
@@ -59907,49 +60146,11 @@ var configService = exports_Effect.gen(function* () {
59907
60146
  yield* exports_Effect.log(`Done with ${repo.name}`);
59908
60147
  return repo;
59909
60148
  }),
59910
- loadDocsAgentPrompt: (args2) => exports_Effect.gen(function* () {
59911
- const { repos } = args2;
59912
- yield* ensureDocsAgentPrompt({ repos });
60149
+ getOpenCodeConfig: (args2) => exports_Effect.gen(function* () {
60150
+ const { repoName } = args2;
60151
+ return OPENCODE_CONFIG({ repoName, config: config2 });
59913
60152
  }),
59914
- getOpenCodeConfig: () => exports_Effect.succeed({
59915
- agent: {
59916
- build: {
59917
- disable: true
59918
- },
59919
- general: {
59920
- disable: true
59921
- },
59922
- plan: {
59923
- disable: true
59924
- },
59925
- docs: {
59926
- prompt: `{file:${promptPath}}`,
59927
- disable: false,
59928
- description: "Get answers about libraries and frameworks by searching their source code",
59929
- permission: {
59930
- webfetch: "deny",
59931
- edit: "deny",
59932
- bash: "allow",
59933
- external_directory: "allow",
59934
- doom_loop: "deny"
59935
- },
59936
- mode: "primary",
59937
- tools: {
59938
- write: false,
59939
- bash: true,
59940
- delete: false,
59941
- read: true,
59942
- grep: true,
59943
- glob: true,
59944
- list: true,
59945
- path: false,
59946
- todowrite: false,
59947
- todoread: false,
59948
- websearch: false
59949
- }
59950
- }
59951
- }
59952
- })
60153
+ rawConfig: () => exports_Effect.succeed(config2)
59953
60154
  };
59954
60155
  });
59955
60156
 
@@ -59961,20 +60162,36 @@ class ConfigService extends exports_Effect.Service()("ConfigService", {
59961
60162
  // src/services/oc.ts
59962
60163
  var ocService = exports_Effect.gen(function* () {
59963
60164
  const config2 = yield* ConfigService;
59964
- const configObject = yield* config2.getOpenCodeConfig();
59965
- const { client: client3, server: server2 } = yield* exports_Effect.tryPromise({
59966
- try: () => createOpencode({
59967
- port: 3420,
59968
- config: configObject
59969
- }),
59970
- catch: (err) => new OcError({ message: "FAILED TO CREATE OPENCODE CLIENT", cause: err })
60165
+ const rawConfig = yield* config2.rawConfig();
60166
+ const getOpencodeInstance = ({ tech }) => exports_Effect.gen(function* () {
60167
+ let portOffset = 0;
60168
+ const maxInstances = 5;
60169
+ const configObject = yield* config2.getOpenCodeConfig({ repoName: tech });
60170
+ while (portOffset < maxInstances) {
60171
+ const result = yield* exports_Effect.tryPromise(() => createOpencode({
60172
+ port: 3420 + portOffset,
60173
+ config: configObject
60174
+ })).pipe(exports_Effect.catchAll((err) => {
60175
+ if (err.cause instanceof Error && err.cause.stack?.includes("port")) {
60176
+ portOffset++;
60177
+ return exports_Effect.succeed(null);
60178
+ }
60179
+ return exports_Effect.fail(new OcError({
60180
+ message: "FAILED TO CREATE OPENCODE CLIENT",
60181
+ cause: err
60182
+ }));
60183
+ }));
60184
+ if (result !== null) {
60185
+ return result;
60186
+ }
60187
+ }
60188
+ return yield* exports_Effect.fail(new OcError({
60189
+ message: "FAILED TO CREATE OPENCODE CLIENT - all ports exhausted",
60190
+ cause: null
60191
+ }));
59971
60192
  });
59972
- yield* exports_Effect.addFinalizer(() => exports_Effect.sync(() => {
59973
- console.log("CLOSING OPENCODE SERVER");
59974
- server2.close();
59975
- }));
59976
60193
  const streamSessionEvents = (args2) => exports_Effect.gen(function* () {
59977
- const { sessionID } = args2;
60194
+ const { sessionID, client: client3 } = args2;
59978
60195
  const events = yield* exports_Effect.tryPromise({
59979
60196
  try: () => client3.event.subscribe(),
59980
60197
  catch: (err) => new OcError({
@@ -59989,22 +60206,27 @@ var ocService = exports_Effect.gen(function* () {
59989
60206
  return props.sessionID === sessionID;
59990
60207
  }), exports_Stream.takeUntil((event) => event.type === "session.idle" && event.properties.sessionID === sessionID));
59991
60208
  });
59992
- const firePrompt = (args2) => exports_Effect.promise(() => client3.session.prompt({
60209
+ const firePrompt = (args2) => exports_Effect.promise(() => args2.client.session.prompt({
59993
60210
  path: { id: args2.sessionID },
59994
60211
  body: {
59995
60212
  agent: "docs",
59996
60213
  model: {
59997
- providerID: "opencode",
59998
- modelID: "claude-haiku-4-5"
60214
+ providerID: rawConfig.provider,
60215
+ modelID: rawConfig.model
59999
60216
  },
60000
60217
  parts: [{ type: "text", text: args2.text }]
60001
60218
  }
60002
60219
  })).pipe(exports_Effect.catchAll((err) => exports_Deferred.fail(args2.errorDeferred, new OcError({ message: String(err), cause: err }))));
60003
60220
  const streamPrompt = (args2) => exports_Effect.gen(function* () {
60004
- const { sessionID, prompt: prompt5 } = args2;
60005
- const eventStream = yield* streamSessionEvents({ sessionID });
60221
+ const { sessionID, prompt: prompt4, client: client3 } = args2;
60222
+ const eventStream = yield* streamSessionEvents({ sessionID, client: client3 });
60006
60223
  const errorDeferred = yield* exports_Deferred.make();
60007
- yield* firePrompt({ sessionID, text: prompt5, errorDeferred }).pipe(exports_Effect.forkDaemon);
60224
+ yield* firePrompt({
60225
+ sessionID,
60226
+ text: prompt4,
60227
+ errorDeferred,
60228
+ client: client3
60229
+ }).pipe(exports_Effect.forkDaemon);
60008
60230
  return eventStream.pipe(exports_Stream.mapEffect((event) => exports_Effect.gen(function* () {
60009
60231
  if (event.type === "session.error") {
60010
60232
  const props = event.properties;
@@ -60014,13 +60236,20 @@ var ocService = exports_Effect.gen(function* () {
60014
60236
  }));
60015
60237
  }
60016
60238
  return event;
60017
- })), exports_Stream.interruptWhen(exports_Deferred.await(errorDeferred)));
60239
+ })), exports_Stream.ensuring(exports_Effect.sync(() => args2.cleanup())), exports_Stream.interruptWhen(exports_Deferred.await(errorDeferred)));
60018
60240
  });
60019
60241
  return {
60242
+ holdOpenInstanceInBg: () => exports_Effect.gen(function* () {
60243
+ const { client: client3, server: server2 } = yield* getOpencodeInstance({
60244
+ tech: "svelte"
60245
+ });
60246
+ yield* exports_Effect.log(`OPENCODE SERVER IS UP AT ${server2.url}`);
60247
+ yield* exports_Effect.sleep(exports_Duration.days(1));
60248
+ }),
60020
60249
  askQuestion: (args2) => exports_Effect.gen(function* () {
60021
60250
  const { question, tech } = args2;
60022
- const repo = yield* config2.cloneOrUpdateOneRepoLocally(tech);
60023
- yield* config2.loadDocsAgentPrompt({ repos: [repo] });
60251
+ yield* config2.cloneOrUpdateOneRepoLocally(tech);
60252
+ const { client: client3, server: server2 } = yield* getOpencodeInstance({ tech });
60024
60253
  const session = yield* exports_Effect.promise(() => client3.session.create());
60025
60254
  if (session.error) {
60026
60255
  return yield* exports_Effect.fail(new OcError({
@@ -60029,40 +60258,59 @@ var ocService = exports_Effect.gen(function* () {
60029
60258
  }));
60030
60259
  }
60031
60260
  const sessionID = session.data.id;
60032
- yield* exports_Effect.log(`PROMPTING WITH: ${prompt}`);
60033
- return yield* streamPrompt({ sessionID, prompt: question });
60261
+ return yield* streamPrompt({
60262
+ sessionID,
60263
+ prompt: question,
60264
+ client: client3,
60265
+ cleanup: () => {
60266
+ server2.close();
60267
+ }
60268
+ });
60034
60269
  })
60035
60270
  };
60036
60271
  });
60037
60272
 
60038
60273
  class OcService extends exports_Effect.Service()("OcService", {
60039
- scoped: ocService,
60274
+ effect: ocService,
60040
60275
  dependencies: [ConfigService.Default]
60041
60276
  }) {
60042
60277
  }
60043
60278
 
60044
60279
  // src/index.ts
60045
60280
  var programLayer = exports_Layer.mergeAll(OcService.Default);
60046
- var logEvent = (event) => {
60047
- if (event.type === "message.part.updated") {
60048
- const part = event.properties.part;
60049
- if (part.type === "text" && part.text) {
60050
- process.stdout.write(part.text);
60051
- }
60052
- if (part.type === "tool" && part.state?.status === "completed") {
60053
- console.log(`
60054
- [Tool Done] ${part.tool}: ${part.state.title ?? ""}`);
60055
- }
60056
- }
60057
- };
60058
60281
  var questionOption = exports_Options.text("question").pipe(exports_Options.withAlias("q"));
60059
60282
  var techOption = exports_Options.text("tech").pipe(exports_Options.withAlias("t"));
60060
60283
  var askCommand = exports_Command.make("ask", { question: questionOption, tech: techOption }, ({ question, tech }) => exports_Effect.gen(function* () {
60061
60284
  const oc = yield* OcService;
60062
60285
  const eventStream = yield* oc.askQuestion({ tech, question });
60063
- yield* eventStream.pipe(exports_Stream.runForEach((event) => exports_Effect.sync(() => logEvent(event))));
60286
+ const displayMessages = [];
60287
+ let currentMessageId = null;
60288
+ yield* eventStream.pipe(exports_Stream.runForEach((event) => exports_Effect.sync(() => {
60289
+ switch (event.type) {
60290
+ case "message.part.updated":
60291
+ if (event.properties.part.type === "text") {
60292
+ if (currentMessageId === event.properties.part.messageID) {
60293
+ process.stdout.write(event.properties.delta ?? "");
60294
+ } else {
60295
+ currentMessageId = event.properties.part.messageID;
60296
+ process.stdout.write(`
60297
+
60298
+ ` + event.properties.part.text);
60299
+ }
60300
+ }
60301
+ break;
60302
+ default:
60303
+ break;
60304
+ }
60305
+ })));
60064
60306
  console.log(`
60065
60307
  `);
60308
+ displayMessages.forEach((m) => console.log(m.text, `
60309
+ `, m.id));
60310
+ }).pipe(exports_Effect.provide(programLayer)));
60311
+ var openCommand = exports_Command.make("open", {}, () => exports_Effect.gen(function* () {
60312
+ const oc = yield* OcService;
60313
+ yield* oc.holdOpenInstanceInBg();
60066
60314
  }).pipe(exports_Effect.provide(programLayer)));
60067
60315
  var QuestionRequest = exports_Schema.Struct({
60068
60316
  tech: exports_Schema.String,
@@ -60092,7 +60340,7 @@ var serveCommand = exports_Command.make("serve", { port: portOption }, ({ port:
60092
60340
  const HttpLive = router.pipe(exports_HttpServer.serve(), exports_HttpServer.withLogAddress, exports_Layer.provide(ServerLive));
60093
60341
  return yield* exports_Layer.launch(HttpLive);
60094
60342
  }).pipe(exports_Effect.scoped, exports_Effect.provide(programLayer)));
60095
- var mainCommand = exports_Command.make("btca", {}).pipe(exports_Command.withSubcommands([askCommand, serveCommand]));
60343
+ var mainCommand = exports_Command.make("btca", {}).pipe(exports_Command.withSubcommands([askCommand, serveCommand, openCommand]));
60096
60344
  var cli = exports_Command.run(mainCommand, {
60097
60345
  name: "btca",
60098
60346
  version: "0.0.1"