@rikalabs/parallel 0.4.0 → 0.4.1
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 +341 -112
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12066,9 +12066,12 @@ var array3 = (O) => make2((self, that) => {
|
|
|
12066
12066
|
}
|
|
12067
12067
|
return number3(aLen, bLen);
|
|
12068
12068
|
});
|
|
12069
|
+
var lessThan = (O) => dual(2, (self, that) => O(self, that) === -1);
|
|
12069
12070
|
var greaterThan = (O) => dual(2, (self, that) => O(self, that) === 1);
|
|
12070
12071
|
var min = (O) => dual(2, (self, that) => self === that || O(self, that) < 1 ? self : that);
|
|
12071
12072
|
var max = (O) => dual(2, (self, that) => self === that || O(self, that) > -1 ? self : that);
|
|
12073
|
+
var clamp = (O) => dual(2, (self, options) => min(O)(options.maximum, max(O)(options.minimum, self)));
|
|
12074
|
+
var between = (O) => dual(2, (self, options) => !lessThan(O)(self, options.minimum) && !greaterThan(O)(self, options.maximum));
|
|
12072
12075
|
|
|
12073
12076
|
// node_modules/effect/dist/esm/Option.js
|
|
12074
12077
|
var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
@@ -12332,7 +12335,7 @@ var isNonEmptyArray2 = isNonEmptyArray;
|
|
|
12332
12335
|
var isNonEmptyReadonlyArray = isNonEmptyArray;
|
|
12333
12336
|
var length = (self) => self.length;
|
|
12334
12337
|
var isOutOfBounds = (i, as2) => i < 0 || i >= as2.length;
|
|
12335
|
-
var
|
|
12338
|
+
var clamp2 = (i, as2) => Math.floor(Math.min(Math.max(0, i), as2.length));
|
|
12336
12339
|
var get = /* @__PURE__ */ dual(2, (self, index) => {
|
|
12337
12340
|
const i = Math.floor(index);
|
|
12338
12341
|
return isOutOfBounds(i, self) ? none2() : some2(self[i]);
|
|
@@ -12362,11 +12365,11 @@ var init = (self) => {
|
|
|
12362
12365
|
var initNonEmpty = (self) => self.slice(0, -1);
|
|
12363
12366
|
var take = /* @__PURE__ */ dual(2, (self, n) => {
|
|
12364
12367
|
const input = fromIterable2(self);
|
|
12365
|
-
return input.slice(0,
|
|
12368
|
+
return input.slice(0, clamp2(n, input));
|
|
12366
12369
|
});
|
|
12367
12370
|
var takeRight = /* @__PURE__ */ dual(2, (self, n) => {
|
|
12368
12371
|
const input = fromIterable2(self);
|
|
12369
|
-
const i =
|
|
12372
|
+
const i = clamp2(n, input);
|
|
12370
12373
|
return i === 0 ? [] : input.slice(-i);
|
|
12371
12374
|
});
|
|
12372
12375
|
var takeWhile = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
@@ -12394,11 +12397,11 @@ var spanIndex = (self, predicate) => {
|
|
|
12394
12397
|
var span = /* @__PURE__ */ dual(2, (self, predicate) => splitAt(self, spanIndex(self, predicate)));
|
|
12395
12398
|
var drop = /* @__PURE__ */ dual(2, (self, n) => {
|
|
12396
12399
|
const input = fromIterable2(self);
|
|
12397
|
-
return input.slice(
|
|
12400
|
+
return input.slice(clamp2(n, input), input.length);
|
|
12398
12401
|
});
|
|
12399
12402
|
var dropRight = /* @__PURE__ */ dual(2, (self, n) => {
|
|
12400
12403
|
const input = fromIterable2(self);
|
|
12401
|
-
return input.slice(0, input.length -
|
|
12404
|
+
return input.slice(0, input.length - clamp2(n, input));
|
|
12402
12405
|
});
|
|
12403
12406
|
var dropWhile = /* @__PURE__ */ dual(2, (self, predicate) => fromIterable2(self).slice(spanIndex(self, predicate)));
|
|
12404
12407
|
var findFirstIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
@@ -13723,6 +13726,56 @@ var takeRight2 = /* @__PURE__ */ dual(2, (self, n) => drop2(self, self.length -
|
|
|
13723
13726
|
var reduce2 = reduce;
|
|
13724
13727
|
|
|
13725
13728
|
// node_modules/effect/dist/esm/Duration.js
|
|
13729
|
+
var exports_Duration = {};
|
|
13730
|
+
__export(exports_Duration, {
|
|
13731
|
+
zero: () => zero,
|
|
13732
|
+
weeks: () => weeks,
|
|
13733
|
+
unsafeToNanos: () => unsafeToNanos,
|
|
13734
|
+
unsafeFormatIso: () => unsafeFormatIso,
|
|
13735
|
+
unsafeDivide: () => unsafeDivide,
|
|
13736
|
+
toWeeks: () => toWeeks,
|
|
13737
|
+
toSeconds: () => toSeconds,
|
|
13738
|
+
toNanos: () => toNanos,
|
|
13739
|
+
toMinutes: () => toMinutes,
|
|
13740
|
+
toMillis: () => toMillis,
|
|
13741
|
+
toHrTime: () => toHrTime,
|
|
13742
|
+
toHours: () => toHours,
|
|
13743
|
+
toDays: () => toDays,
|
|
13744
|
+
times: () => times,
|
|
13745
|
+
sum: () => sum,
|
|
13746
|
+
subtract: () => subtract,
|
|
13747
|
+
seconds: () => seconds,
|
|
13748
|
+
parts: () => parts,
|
|
13749
|
+
nanos: () => nanos,
|
|
13750
|
+
minutes: () => minutes,
|
|
13751
|
+
min: () => min3,
|
|
13752
|
+
millis: () => millis,
|
|
13753
|
+
micros: () => micros,
|
|
13754
|
+
max: () => max3,
|
|
13755
|
+
matchWith: () => matchWith,
|
|
13756
|
+
match: () => match4,
|
|
13757
|
+
lessThanOrEqualTo: () => lessThanOrEqualTo,
|
|
13758
|
+
lessThan: () => lessThan2,
|
|
13759
|
+
isZero: () => isZero,
|
|
13760
|
+
isFinite: () => isFinite2,
|
|
13761
|
+
isDuration: () => isDuration,
|
|
13762
|
+
infinity: () => infinity,
|
|
13763
|
+
hours: () => hours,
|
|
13764
|
+
greaterThanOrEqualTo: () => greaterThanOrEqualTo,
|
|
13765
|
+
greaterThan: () => greaterThan2,
|
|
13766
|
+
fromIso: () => fromIso,
|
|
13767
|
+
formatIso: () => formatIso,
|
|
13768
|
+
format: () => format2,
|
|
13769
|
+
equals: () => equals2,
|
|
13770
|
+
divide: () => divide,
|
|
13771
|
+
decodeUnknown: () => decodeUnknown,
|
|
13772
|
+
decode: () => decode,
|
|
13773
|
+
days: () => days,
|
|
13774
|
+
clamp: () => clamp3,
|
|
13775
|
+
between: () => between2,
|
|
13776
|
+
Order: () => Order,
|
|
13777
|
+
Equivalence: () => Equivalence
|
|
13778
|
+
});
|
|
13726
13779
|
var TypeId6 = /* @__PURE__ */ Symbol.for("effect/Duration");
|
|
13727
13780
|
var bigint0 = /* @__PURE__ */ BigInt(0);
|
|
13728
13781
|
var bigint24 = /* @__PURE__ */ BigInt(24);
|
|
@@ -13781,6 +13834,7 @@ var decode = (input) => {
|
|
|
13781
13834
|
}
|
|
13782
13835
|
throw new Error("Invalid DurationInput");
|
|
13783
13836
|
};
|
|
13837
|
+
var decodeUnknown = /* @__PURE__ */ liftThrowable(decode);
|
|
13784
13838
|
var zeroValue = {
|
|
13785
13839
|
_tag: "Millis",
|
|
13786
13840
|
millis: 0
|
|
@@ -13884,6 +13938,37 @@ var toMillis = (self) => match4(self, {
|
|
|
13884
13938
|
onMillis: (millis2) => millis2,
|
|
13885
13939
|
onNanos: (nanos2) => Number(nanos2) / 1e6
|
|
13886
13940
|
});
|
|
13941
|
+
var toSeconds = (self) => match4(self, {
|
|
13942
|
+
onMillis: (millis2) => millis2 / 1000,
|
|
13943
|
+
onNanos: (nanos2) => Number(nanos2) / 1e9
|
|
13944
|
+
});
|
|
13945
|
+
var toMinutes = (self) => match4(self, {
|
|
13946
|
+
onMillis: (millis2) => millis2 / 60000,
|
|
13947
|
+
onNanos: (nanos2) => Number(nanos2) / 60000000000
|
|
13948
|
+
});
|
|
13949
|
+
var toHours = (self) => match4(self, {
|
|
13950
|
+
onMillis: (millis2) => millis2 / 3600000,
|
|
13951
|
+
onNanos: (nanos2) => Number(nanos2) / 3600000000000
|
|
13952
|
+
});
|
|
13953
|
+
var toDays = (self) => match4(self, {
|
|
13954
|
+
onMillis: (millis2) => millis2 / 86400000,
|
|
13955
|
+
onNanos: (nanos2) => Number(nanos2) / 86400000000000
|
|
13956
|
+
});
|
|
13957
|
+
var toWeeks = (self) => match4(self, {
|
|
13958
|
+
onMillis: (millis2) => millis2 / 604800000,
|
|
13959
|
+
onNanos: (nanos2) => Number(nanos2) / 604800000000000
|
|
13960
|
+
});
|
|
13961
|
+
var toNanos = (self) => {
|
|
13962
|
+
const _self = decode(self);
|
|
13963
|
+
switch (_self.value._tag) {
|
|
13964
|
+
case "Infinity":
|
|
13965
|
+
return none2();
|
|
13966
|
+
case "Nanos":
|
|
13967
|
+
return some2(_self.value.nanos);
|
|
13968
|
+
case "Millis":
|
|
13969
|
+
return some2(BigInt(Math.round(_self.value.millis * 1e6)));
|
|
13970
|
+
}
|
|
13971
|
+
};
|
|
13887
13972
|
var unsafeToNanos = (self) => {
|
|
13888
13973
|
const _self = decode(self);
|
|
13889
13974
|
switch (_self.value._tag) {
|
|
@@ -13929,18 +14014,77 @@ var matchWith = /* @__PURE__ */ dual(3, (self, that, options) => {
|
|
|
13929
14014
|
}
|
|
13930
14015
|
return options.onMillis(_self.value.millis, _that.value.millis);
|
|
13931
14016
|
});
|
|
14017
|
+
var Order = /* @__PURE__ */ make2((self, that) => matchWith(self, that, {
|
|
14018
|
+
onMillis: (self2, that2) => self2 < that2 ? -1 : self2 > that2 ? 1 : 0,
|
|
14019
|
+
onNanos: (self2, that2) => self2 < that2 ? -1 : self2 > that2 ? 1 : 0
|
|
14020
|
+
}));
|
|
14021
|
+
var between2 = /* @__PURE__ */ between(/* @__PURE__ */ mapInput2(Order, decode));
|
|
13932
14022
|
var Equivalence = (self, that) => matchWith(self, that, {
|
|
13933
14023
|
onMillis: (self2, that2) => self2 === that2,
|
|
13934
14024
|
onNanos: (self2, that2) => self2 === that2
|
|
13935
14025
|
});
|
|
14026
|
+
var _min = /* @__PURE__ */ min(Order);
|
|
14027
|
+
var min3 = /* @__PURE__ */ dual(2, (self, that) => _min(decode(self), decode(that)));
|
|
14028
|
+
var _max = /* @__PURE__ */ max(Order);
|
|
14029
|
+
var max3 = /* @__PURE__ */ dual(2, (self, that) => _max(decode(self), decode(that)));
|
|
14030
|
+
var _clamp = /* @__PURE__ */ clamp(Order);
|
|
14031
|
+
var clamp3 = /* @__PURE__ */ dual(2, (self, options) => _clamp(decode(self), {
|
|
14032
|
+
minimum: decode(options.minimum),
|
|
14033
|
+
maximum: decode(options.maximum)
|
|
14034
|
+
}));
|
|
14035
|
+
var divide = /* @__PURE__ */ dual(2, (self, by) => match4(self, {
|
|
14036
|
+
onMillis: (millis2) => {
|
|
14037
|
+
if (by === 0 || isNaN(by) || !Number.isFinite(by)) {
|
|
14038
|
+
return none2();
|
|
14039
|
+
}
|
|
14040
|
+
return some2(make8(millis2 / by));
|
|
14041
|
+
},
|
|
14042
|
+
onNanos: (nanos2) => {
|
|
14043
|
+
if (isNaN(by) || by <= 0 || !Number.isFinite(by)) {
|
|
14044
|
+
return none2();
|
|
14045
|
+
}
|
|
14046
|
+
try {
|
|
14047
|
+
return some2(make8(nanos2 / BigInt(by)));
|
|
14048
|
+
} catch {
|
|
14049
|
+
return none2();
|
|
14050
|
+
}
|
|
14051
|
+
}
|
|
14052
|
+
}));
|
|
14053
|
+
var unsafeDivide = /* @__PURE__ */ dual(2, (self, by) => match4(self, {
|
|
14054
|
+
onMillis: (millis2) => make8(millis2 / by),
|
|
14055
|
+
onNanos: (nanos2) => {
|
|
14056
|
+
if (isNaN(by) || by < 0 || Object.is(by, -0)) {
|
|
14057
|
+
return zero;
|
|
14058
|
+
} else if (Object.is(by, 0) || !Number.isFinite(by)) {
|
|
14059
|
+
return infinity;
|
|
14060
|
+
}
|
|
14061
|
+
return make8(nanos2 / BigInt(by));
|
|
14062
|
+
}
|
|
14063
|
+
}));
|
|
14064
|
+
var times = /* @__PURE__ */ dual(2, (self, times2) => match4(self, {
|
|
14065
|
+
onMillis: (millis2) => make8(millis2 * times2),
|
|
14066
|
+
onNanos: (nanos2) => make8(nanos2 * BigInt(times2))
|
|
14067
|
+
}));
|
|
14068
|
+
var subtract = /* @__PURE__ */ dual(2, (self, that) => matchWith(self, that, {
|
|
14069
|
+
onMillis: (self2, that2) => make8(self2 - that2),
|
|
14070
|
+
onNanos: (self2, that2) => make8(self2 - that2)
|
|
14071
|
+
}));
|
|
13936
14072
|
var sum = /* @__PURE__ */ dual(2, (self, that) => matchWith(self, that, {
|
|
13937
14073
|
onMillis: (self2, that2) => make8(self2 + that2),
|
|
13938
14074
|
onNanos: (self2, that2) => make8(self2 + that2)
|
|
13939
14075
|
}));
|
|
14076
|
+
var lessThan2 = /* @__PURE__ */ dual(2, (self, that) => matchWith(self, that, {
|
|
14077
|
+
onMillis: (self2, that2) => self2 < that2,
|
|
14078
|
+
onNanos: (self2, that2) => self2 < that2
|
|
14079
|
+
}));
|
|
13940
14080
|
var lessThanOrEqualTo = /* @__PURE__ */ dual(2, (self, that) => matchWith(self, that, {
|
|
13941
14081
|
onMillis: (self2, that2) => self2 <= that2,
|
|
13942
14082
|
onNanos: (self2, that2) => self2 <= that2
|
|
13943
14083
|
}));
|
|
14084
|
+
var greaterThan2 = /* @__PURE__ */ dual(2, (self, that) => matchWith(self, that, {
|
|
14085
|
+
onMillis: (self2, that2) => self2 > that2,
|
|
14086
|
+
onNanos: (self2, that2) => self2 > that2
|
|
14087
|
+
}));
|
|
13944
14088
|
var greaterThanOrEqualTo = /* @__PURE__ */ dual(2, (self, that) => matchWith(self, that, {
|
|
13945
14089
|
onMillis: (self2, that2) => self2 >= that2,
|
|
13946
14090
|
onNanos: (self2, that2) => self2 >= that2
|
|
@@ -13961,13 +14105,13 @@ var parts = (self) => {
|
|
|
13961
14105
|
const nanos2 = unsafeToNanos(duration);
|
|
13962
14106
|
const ms = nanos2 / bigint1e6;
|
|
13963
14107
|
const sec = ms / bigint1e3;
|
|
13964
|
-
const
|
|
13965
|
-
const hr =
|
|
14108
|
+
const min4 = sec / bigint60;
|
|
14109
|
+
const hr = min4 / bigint60;
|
|
13966
14110
|
const days2 = hr / bigint24;
|
|
13967
14111
|
return {
|
|
13968
14112
|
days: Number(days2),
|
|
13969
14113
|
hours: Number(hr % bigint24),
|
|
13970
|
-
minutes: Number(
|
|
14114
|
+
minutes: Number(min4 % bigint60),
|
|
13971
14115
|
seconds: Number(sec % bigint60),
|
|
13972
14116
|
millis: Number(ms % bigint1e3),
|
|
13973
14117
|
nanos: Number(nanos2 % bigint1e6)
|
|
@@ -14003,6 +14147,69 @@ var format2 = (self) => {
|
|
|
14003
14147
|
}
|
|
14004
14148
|
return pieces.join(" ");
|
|
14005
14149
|
};
|
|
14150
|
+
var unsafeFormatIso = (self) => {
|
|
14151
|
+
const duration = decode(self);
|
|
14152
|
+
if (!isFinite2(duration)) {
|
|
14153
|
+
throw new RangeError("Cannot format infinite duration");
|
|
14154
|
+
}
|
|
14155
|
+
const fragments = [];
|
|
14156
|
+
const {
|
|
14157
|
+
days: days2,
|
|
14158
|
+
hours: hours2,
|
|
14159
|
+
millis: millis2,
|
|
14160
|
+
minutes: minutes2,
|
|
14161
|
+
nanos: nanos2,
|
|
14162
|
+
seconds: seconds2
|
|
14163
|
+
} = parts(duration);
|
|
14164
|
+
let rest = days2;
|
|
14165
|
+
if (rest >= 365) {
|
|
14166
|
+
const years = Math.floor(rest / 365);
|
|
14167
|
+
rest %= 365;
|
|
14168
|
+
fragments.push(`${years}Y`);
|
|
14169
|
+
}
|
|
14170
|
+
if (rest >= 30) {
|
|
14171
|
+
const months = Math.floor(rest / 30);
|
|
14172
|
+
rest %= 30;
|
|
14173
|
+
fragments.push(`${months}M`);
|
|
14174
|
+
}
|
|
14175
|
+
if (rest >= 7) {
|
|
14176
|
+
const weeks2 = Math.floor(rest / 7);
|
|
14177
|
+
rest %= 7;
|
|
14178
|
+
fragments.push(`${weeks2}W`);
|
|
14179
|
+
}
|
|
14180
|
+
if (rest > 0) {
|
|
14181
|
+
fragments.push(`${rest}D`);
|
|
14182
|
+
}
|
|
14183
|
+
if (hours2 !== 0 || minutes2 !== 0 || seconds2 !== 0 || millis2 !== 0 || nanos2 !== 0) {
|
|
14184
|
+
fragments.push("T");
|
|
14185
|
+
if (hours2 !== 0) {
|
|
14186
|
+
fragments.push(`${hours2}H`);
|
|
14187
|
+
}
|
|
14188
|
+
if (minutes2 !== 0) {
|
|
14189
|
+
fragments.push(`${minutes2}M`);
|
|
14190
|
+
}
|
|
14191
|
+
if (seconds2 !== 0 || millis2 !== 0 || nanos2 !== 0) {
|
|
14192
|
+
const total = BigInt(seconds2) * bigint1e9 + BigInt(millis2) * bigint1e6 + BigInt(nanos2);
|
|
14193
|
+
const str = (Number(total) / 1e9).toFixed(9).replace(/\.?0+$/, "");
|
|
14194
|
+
fragments.push(`${str}S`);
|
|
14195
|
+
}
|
|
14196
|
+
}
|
|
14197
|
+
return `P${fragments.join("") || "T0S"}`;
|
|
14198
|
+
};
|
|
14199
|
+
var formatIso = (self) => {
|
|
14200
|
+
const duration = decode(self);
|
|
14201
|
+
return isFinite2(duration) ? some2(unsafeFormatIso(duration)) : none2();
|
|
14202
|
+
};
|
|
14203
|
+
var fromIso = (iso) => {
|
|
14204
|
+
const result = DURATION_ISO_REGEX.exec(iso);
|
|
14205
|
+
if (result == null) {
|
|
14206
|
+
return none2();
|
|
14207
|
+
}
|
|
14208
|
+
const [years, months, weeks2, days2, hours2, mins, secs] = result.slice(1, 8).map((_) => _ ? Number(_) : 0);
|
|
14209
|
+
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;
|
|
14210
|
+
return some2(seconds(value));
|
|
14211
|
+
};
|
|
14212
|
+
var DURATION_ISO_REGEX = /^P(?!$)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?!$)(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
|
|
14006
14213
|
|
|
14007
14214
|
// node_modules/effect/dist/esm/internal/hashMap/config.js
|
|
14008
14215
|
var SIZE = 5;
|
|
@@ -17432,7 +17639,7 @@ class ClockImpl {
|
|
|
17432
17639
|
var make20 = () => new ClockImpl;
|
|
17433
17640
|
|
|
17434
17641
|
// node_modules/effect/dist/esm/Number.js
|
|
17435
|
-
var
|
|
17642
|
+
var Order2 = number3;
|
|
17436
17643
|
var parse = (s) => {
|
|
17437
17644
|
if (s === "NaN") {
|
|
17438
17645
|
return some(NaN);
|
|
@@ -17701,7 +17908,7 @@ var transpose = (array4) => {
|
|
|
17701
17908
|
};
|
|
17702
17909
|
var indicesFrom = (quotedIndices) => pipe(forEachSequential(quotedIndices, parseQuotedIndex), mapBoth2({
|
|
17703
17910
|
onFailure: () => empty3(),
|
|
17704
|
-
onSuccess: sort(
|
|
17911
|
+
onSuccess: sort(Order2)
|
|
17705
17912
|
}), either2, map10(merge));
|
|
17706
17913
|
var QUOTED_INDEX_REGEX = /^(\[(\d+)\])$/;
|
|
17707
17914
|
var parseQuotedIndex = (str) => {
|
|
@@ -17827,11 +18034,11 @@ class RandomImpl {
|
|
|
17827
18034
|
get nextInt() {
|
|
17828
18035
|
return sync(() => this.PRNG.integer(Number.MAX_SAFE_INTEGER));
|
|
17829
18036
|
}
|
|
17830
|
-
nextRange(
|
|
17831
|
-
return map10(this.next, (n) => (
|
|
18037
|
+
nextRange(min4, max4) {
|
|
18038
|
+
return map10(this.next, (n) => (max4 - min4) * n + min4);
|
|
17832
18039
|
}
|
|
17833
|
-
nextIntBetween(
|
|
17834
|
-
return sync(() => this.PRNG.integer(
|
|
18040
|
+
nextIntBetween(min4, max4) {
|
|
18041
|
+
return sync(() => this.PRNG.integer(max4 - min4) + min4);
|
|
17835
18042
|
}
|
|
17836
18043
|
shuffle(elements) {
|
|
17837
18044
|
return shuffleWith(elements, (n) => this.nextIntBetween(0, n));
|
|
@@ -17896,17 +18103,17 @@ class FixedRandomImpl {
|
|
|
17896
18103
|
return Math.abs(hash(value));
|
|
17897
18104
|
});
|
|
17898
18105
|
}
|
|
17899
|
-
nextRange(
|
|
17900
|
-
return map10(this.next, (n) => (
|
|
18106
|
+
nextRange(min4, max4) {
|
|
18107
|
+
return map10(this.next, (n) => (max4 - min4) * n + min4);
|
|
17901
18108
|
}
|
|
17902
|
-
nextIntBetween(
|
|
18109
|
+
nextIntBetween(min4, max4) {
|
|
17903
18110
|
return sync(() => {
|
|
17904
18111
|
const value = this.getNextValue();
|
|
17905
18112
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
17906
|
-
return Math.max(
|
|
18113
|
+
return Math.max(min4, Math.min(max4 - 1, Math.round(value)));
|
|
17907
18114
|
}
|
|
17908
18115
|
const hash2 = Math.abs(hash(value));
|
|
17909
|
-
return
|
|
18116
|
+
return min4 + hash2 % (max4 - min4);
|
|
17910
18117
|
});
|
|
17911
18118
|
}
|
|
17912
18119
|
shuffle(elements) {
|
|
@@ -18415,8 +18622,8 @@ var Debug = logLevelDebug;
|
|
|
18415
18622
|
var Trace = logLevelTrace;
|
|
18416
18623
|
var None3 = logLevelNone;
|
|
18417
18624
|
var allLevels = allLogLevels;
|
|
18418
|
-
var
|
|
18419
|
-
var
|
|
18625
|
+
var Order3 = /* @__PURE__ */ pipe(Order2, /* @__PURE__ */ mapInput2((level) => level.ordinal));
|
|
18626
|
+
var greaterThan3 = /* @__PURE__ */ greaterThan(Order3);
|
|
18420
18627
|
var fromLiteral = (literal) => {
|
|
18421
18628
|
switch (literal) {
|
|
18422
18629
|
case "All":
|
|
@@ -20504,11 +20711,11 @@ class HistogramState {
|
|
|
20504
20711
|
sum;
|
|
20505
20712
|
[MetricStateTypeId] = metricStateVariance;
|
|
20506
20713
|
[HistogramStateTypeId] = HistogramStateTypeId;
|
|
20507
|
-
constructor(buckets, count,
|
|
20714
|
+
constructor(buckets, count, min4, max4, sum2) {
|
|
20508
20715
|
this.buckets = buckets;
|
|
20509
20716
|
this.count = count;
|
|
20510
|
-
this.min =
|
|
20511
|
-
this.max =
|
|
20717
|
+
this.min = min4;
|
|
20718
|
+
this.max = max4;
|
|
20512
20719
|
this.sum = sum2;
|
|
20513
20720
|
}
|
|
20514
20721
|
[symbol]() {
|
|
@@ -20531,12 +20738,12 @@ class SummaryState {
|
|
|
20531
20738
|
sum;
|
|
20532
20739
|
[MetricStateTypeId] = metricStateVariance;
|
|
20533
20740
|
[SummaryStateTypeId] = SummaryStateTypeId;
|
|
20534
|
-
constructor(error, quantiles, count,
|
|
20741
|
+
constructor(error, quantiles, count, min4, max4, sum2) {
|
|
20535
20742
|
this.error = error;
|
|
20536
20743
|
this.quantiles = quantiles;
|
|
20537
20744
|
this.count = count;
|
|
20538
|
-
this.min =
|
|
20539
|
-
this.max =
|
|
20745
|
+
this.min = min4;
|
|
20746
|
+
this.max = max4;
|
|
20540
20747
|
this.sum = sum2;
|
|
20541
20748
|
}
|
|
20542
20749
|
[symbol]() {
|
|
@@ -20625,9 +20832,9 @@ var histogram4 = (key) => {
|
|
|
20625
20832
|
const boundaries = new Float64Array(size6);
|
|
20626
20833
|
let count = 0;
|
|
20627
20834
|
let sum2 = 0;
|
|
20628
|
-
let
|
|
20629
|
-
let
|
|
20630
|
-
pipe(bounds, sort(
|
|
20835
|
+
let min4 = Number.MAX_VALUE;
|
|
20836
|
+
let max4 = Number.MIN_VALUE;
|
|
20837
|
+
pipe(bounds, sort(Order2), map3((n, i) => {
|
|
20631
20838
|
boundaries[i] = n;
|
|
20632
20839
|
}));
|
|
20633
20840
|
const update4 = (value) => {
|
|
@@ -20652,11 +20859,11 @@ var histogram4 = (key) => {
|
|
|
20652
20859
|
values3[from] = values3[from] + 1;
|
|
20653
20860
|
count = count + 1;
|
|
20654
20861
|
sum2 = sum2 + value;
|
|
20655
|
-
if (value <
|
|
20656
|
-
|
|
20862
|
+
if (value < min4) {
|
|
20863
|
+
min4 = value;
|
|
20657
20864
|
}
|
|
20658
|
-
if (value >
|
|
20659
|
-
|
|
20865
|
+
if (value > max4) {
|
|
20866
|
+
max4 = value;
|
|
20660
20867
|
}
|
|
20661
20868
|
};
|
|
20662
20869
|
const getBuckets = () => {
|
|
@@ -20674,8 +20881,8 @@ var histogram4 = (key) => {
|
|
|
20674
20881
|
get: () => histogram3({
|
|
20675
20882
|
buckets: getBuckets(),
|
|
20676
20883
|
count,
|
|
20677
|
-
min:
|
|
20678
|
-
max:
|
|
20884
|
+
min: min4,
|
|
20885
|
+
max: max4,
|
|
20679
20886
|
sum: sum2
|
|
20680
20887
|
}),
|
|
20681
20888
|
update: update4,
|
|
@@ -20689,13 +20896,13 @@ var summary3 = (key) => {
|
|
|
20689
20896
|
maxSize,
|
|
20690
20897
|
quantiles
|
|
20691
20898
|
} = key.keyType;
|
|
20692
|
-
const sortedQuantiles = pipe(quantiles, sort(
|
|
20899
|
+
const sortedQuantiles = pipe(quantiles, sort(Order2));
|
|
20693
20900
|
const values3 = allocate(maxSize);
|
|
20694
20901
|
let head4 = 0;
|
|
20695
20902
|
let count = 0;
|
|
20696
20903
|
let sum2 = 0;
|
|
20697
|
-
let
|
|
20698
|
-
let
|
|
20904
|
+
let min4 = 0;
|
|
20905
|
+
let max4 = 0;
|
|
20699
20906
|
const snapshot = (now) => {
|
|
20700
20907
|
const builder = [];
|
|
20701
20908
|
let i = 0;
|
|
@@ -20710,7 +20917,7 @@ var summary3 = (key) => {
|
|
|
20710
20917
|
}
|
|
20711
20918
|
i = i + 1;
|
|
20712
20919
|
}
|
|
20713
|
-
return calculateQuantiles(error, sortedQuantiles, sort(builder,
|
|
20920
|
+
return calculateQuantiles(error, sortedQuantiles, sort(builder, Order2));
|
|
20714
20921
|
};
|
|
20715
20922
|
const observe = (value, timestamp) => {
|
|
20716
20923
|
if (maxSize > 0) {
|
|
@@ -20718,8 +20925,8 @@ var summary3 = (key) => {
|
|
|
20718
20925
|
const target = head4 % maxSize;
|
|
20719
20926
|
values3[target] = [timestamp, value];
|
|
20720
20927
|
}
|
|
20721
|
-
|
|
20722
|
-
|
|
20928
|
+
min4 = count === 0 ? value : Math.min(min4, value);
|
|
20929
|
+
max4 = count === 0 ? value : Math.max(max4, value);
|
|
20723
20930
|
count = count + 1;
|
|
20724
20931
|
sum2 = sum2 + value;
|
|
20725
20932
|
};
|
|
@@ -20728,8 +20935,8 @@ var summary3 = (key) => {
|
|
|
20728
20935
|
error,
|
|
20729
20936
|
quantiles: snapshot(Date.now()),
|
|
20730
20937
|
count,
|
|
20731
|
-
min:
|
|
20732
|
-
max:
|
|
20938
|
+
min: min4,
|
|
20939
|
+
max: max4,
|
|
20733
20940
|
sum: sum2
|
|
20734
20941
|
}),
|
|
20735
20942
|
update: ([value, timestamp]) => observe(value, timestamp),
|
|
@@ -21717,7 +21924,7 @@ class FiberRuntime extends Class {
|
|
|
21717
21924
|
log(message, cause2, overrideLogLevel) {
|
|
21718
21925
|
const logLevel = isSome2(overrideLogLevel) ? overrideLogLevel.value : this.getFiberRef(currentLogLevel);
|
|
21719
21926
|
const minimumLogLevel = this.getFiberRef(currentMinimumLogLevel);
|
|
21720
|
-
if (
|
|
21927
|
+
if (greaterThan3(minimumLogLevel, logLevel)) {
|
|
21721
21928
|
return;
|
|
21722
21929
|
}
|
|
21723
21930
|
const spans = this.getFiberRef(currentLogSpan);
|
|
@@ -22196,7 +22403,7 @@ var whenLogLevel = /* @__PURE__ */ dual(2, (effect, level) => {
|
|
|
22196
22403
|
const requiredLogLevel = typeof level === "string" ? fromLiteral(level) : level;
|
|
22197
22404
|
return withFiberRuntime((fiberState) => {
|
|
22198
22405
|
const minimumLogLevel = fiberState.getFiberRef(currentMinimumLogLevel);
|
|
22199
|
-
if (
|
|
22406
|
+
if (greaterThan3(minimumLogLevel, requiredLogLevel)) {
|
|
22200
22407
|
return succeed(none2());
|
|
22201
22408
|
}
|
|
22202
22409
|
return map10(effect, some2);
|
|
@@ -22972,8 +23179,8 @@ var make33 = (startMillis, endMillis) => {
|
|
|
22972
23179
|
endMillis
|
|
22973
23180
|
};
|
|
22974
23181
|
};
|
|
22975
|
-
var
|
|
22976
|
-
var
|
|
23182
|
+
var lessThan3 = /* @__PURE__ */ dual(2, (self, that) => min4(self, that) === self);
|
|
23183
|
+
var min4 = /* @__PURE__ */ dual(2, (self, that) => {
|
|
22977
23184
|
if (self.endMillis <= that.startMillis)
|
|
22978
23185
|
return self;
|
|
22979
23186
|
if (that.endMillis <= self.startMillis)
|
|
@@ -23004,7 +23211,7 @@ var after = (startMilliseconds) => {
|
|
|
23004
23211
|
// node_modules/effect/dist/esm/ScheduleInterval.js
|
|
23005
23212
|
var make34 = make33;
|
|
23006
23213
|
var empty27 = empty26;
|
|
23007
|
-
var
|
|
23214
|
+
var lessThan4 = lessThan3;
|
|
23008
23215
|
var isEmpty7 = isEmpty6;
|
|
23009
23216
|
var intersect2 = intersect;
|
|
23010
23217
|
var size8 = size7;
|
|
@@ -23027,7 +23234,7 @@ var intersectLoop = (_left, _right, _acc) => {
|
|
|
23027
23234
|
while (isNonEmpty(left3) && isNonEmpty(right3)) {
|
|
23028
23235
|
const interval = pipe(headNonEmpty2(left3), intersect2(headNonEmpty2(right3)));
|
|
23029
23236
|
const intervals = isEmpty7(interval) ? acc : pipe(acc, prepend2(interval));
|
|
23030
|
-
if (pipe(headNonEmpty2(left3),
|
|
23237
|
+
if (pipe(headNonEmpty2(left3), lessThan4(headNonEmpty2(right3)))) {
|
|
23031
23238
|
left3 = tailNonEmpty2(left3);
|
|
23032
23239
|
} else {
|
|
23033
23240
|
right3 = tailNonEmpty2(right3);
|
|
@@ -23042,7 +23249,7 @@ var start = (self) => {
|
|
|
23042
23249
|
var end = (self) => {
|
|
23043
23250
|
return pipe(self.intervals, head2, getOrElse(() => empty27)).endMillis;
|
|
23044
23251
|
};
|
|
23045
|
-
var
|
|
23252
|
+
var lessThan5 = /* @__PURE__ */ dual(2, (self, that) => start(self) < start(that));
|
|
23046
23253
|
var isNonEmpty3 = (self) => {
|
|
23047
23254
|
return isNonEmpty(self.intervals);
|
|
23048
23255
|
};
|
|
@@ -23052,7 +23259,7 @@ var make36 = make35;
|
|
|
23052
23259
|
var intersect4 = intersect3;
|
|
23053
23260
|
var start2 = start;
|
|
23054
23261
|
var end2 = end;
|
|
23055
|
-
var
|
|
23262
|
+
var lessThan6 = lessThan5;
|
|
23056
23263
|
var isNonEmpty4 = isNonEmpty3;
|
|
23057
23264
|
|
|
23058
23265
|
// node_modules/effect/dist/esm/internal/schedule/decision.js
|
|
@@ -24436,7 +24643,7 @@ var intersectWithLoop = (self, that, input, lState, out, lInterval, rState, out2
|
|
|
24436
24643
|
if (isNonEmpty4(combined)) {
|
|
24437
24644
|
return succeed([[lState, rState], [out, out2], _continue2(combined)]);
|
|
24438
24645
|
}
|
|
24439
|
-
if (pipe(lInterval,
|
|
24646
|
+
if (pipe(lInterval, lessThan6(rInterval))) {
|
|
24440
24647
|
return flatMap7(self.step(end2(lInterval), input, lState), ([lState2, out3, decision]) => {
|
|
24441
24648
|
if (isDone4(decision)) {
|
|
24442
24649
|
return succeed([[lState2, rState], [out3, out2], done5]);
|
|
@@ -26005,9 +26212,9 @@ class Declaration {
|
|
|
26005
26212
|
encodeUnknown;
|
|
26006
26213
|
annotations;
|
|
26007
26214
|
_tag = "Declaration";
|
|
26008
|
-
constructor(typeParameters,
|
|
26215
|
+
constructor(typeParameters, decodeUnknown2, encodeUnknown, annotations = {}) {
|
|
26009
26216
|
this.typeParameters = typeParameters;
|
|
26010
|
-
this.decodeUnknown =
|
|
26217
|
+
this.decodeUnknown = decodeUnknown2;
|
|
26011
26218
|
this.encodeUnknown = encodeUnknown;
|
|
26012
26219
|
this.annotations = annotations;
|
|
26013
26220
|
}
|
|
@@ -26508,7 +26715,7 @@ var formatTypeLiteral = (ast) => {
|
|
|
26508
26715
|
}
|
|
26509
26716
|
};
|
|
26510
26717
|
var isTypeLiteral = /* @__PURE__ */ createASTGuard("TypeLiteral");
|
|
26511
|
-
var sortCandidates = /* @__PURE__ */ sort(/* @__PURE__ */ mapInput2(
|
|
26718
|
+
var sortCandidates = /* @__PURE__ */ sort(/* @__PURE__ */ mapInput2(Order2, (ast) => {
|
|
26512
26719
|
switch (ast._tag) {
|
|
26513
26720
|
case "AnyKeyword":
|
|
26514
26721
|
return 0;
|
|
@@ -27230,11 +27437,11 @@ var getEffect = (ast, isDecoding, options) => {
|
|
|
27230
27437
|
});
|
|
27231
27438
|
};
|
|
27232
27439
|
var decodeUnknownSync = (schema, options) => getSync(schema.ast, true, options);
|
|
27233
|
-
var
|
|
27440
|
+
var decodeUnknown2 = (schema, options) => getEffect(schema.ast, true, options);
|
|
27234
27441
|
var encodeUnknownSync = (schema, options) => getSync(schema.ast, false, options);
|
|
27235
27442
|
var encodeUnknown = (schema, options) => getEffect(schema.ast, false, options);
|
|
27236
27443
|
var decodeSync = decodeUnknownSync;
|
|
27237
|
-
var decode2 =
|
|
27444
|
+
var decode2 = decodeUnknown2;
|
|
27238
27445
|
var validateSync = (schema, options) => getSync(typeAST(schema.ast), true, options);
|
|
27239
27446
|
var is = (schema, options) => {
|
|
27240
27447
|
const parser = goMemo(typeAST(schema.ast), true);
|
|
@@ -28321,28 +28528,28 @@ class QueueImpl extends Class {
|
|
|
28321
28528
|
});
|
|
28322
28529
|
});
|
|
28323
28530
|
}
|
|
28324
|
-
takeUpTo(
|
|
28531
|
+
takeUpTo(max7) {
|
|
28325
28532
|
return suspend(() => get6(this.shutdownFlag) ? interrupt2 : sync(() => {
|
|
28326
|
-
const values3 = this.queue.pollUpTo(
|
|
28533
|
+
const values3 = this.queue.pollUpTo(max7);
|
|
28327
28534
|
this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers);
|
|
28328
28535
|
return fromIterable3(values3);
|
|
28329
28536
|
}));
|
|
28330
28537
|
}
|
|
28331
|
-
takeBetween(
|
|
28332
|
-
return suspend(() => takeRemainderLoop(this,
|
|
28538
|
+
takeBetween(min5, max7) {
|
|
28539
|
+
return suspend(() => takeRemainderLoop(this, min5, max7, empty6()));
|
|
28333
28540
|
}
|
|
28334
28541
|
}
|
|
28335
|
-
var takeRemainderLoop = (self,
|
|
28336
|
-
if (
|
|
28542
|
+
var takeRemainderLoop = (self, min5, max7, acc) => {
|
|
28543
|
+
if (max7 < min5) {
|
|
28337
28544
|
return succeed(acc);
|
|
28338
28545
|
}
|
|
28339
|
-
return pipe(takeUpTo(self,
|
|
28340
|
-
const remaining =
|
|
28546
|
+
return pipe(takeUpTo(self, max7), flatMap7((bs) => {
|
|
28547
|
+
const remaining = min5 - bs.length;
|
|
28341
28548
|
if (remaining === 1) {
|
|
28342
28549
|
return pipe(take3(self), map10((b) => pipe(acc, appendAll2(bs), append2(b))));
|
|
28343
28550
|
}
|
|
28344
28551
|
if (remaining > 1) {
|
|
28345
|
-
return pipe(take3(self), flatMap7((b) => takeRemainderLoop(self, remaining - 1,
|
|
28552
|
+
return pipe(take3(self), flatMap7((b) => takeRemainderLoop(self, remaining - 1, max7 - bs.length - 1, pipe(acc, appendAll2(bs), append2(b)))));
|
|
28346
28553
|
}
|
|
28347
28554
|
return succeed(pipe(acc, appendAll2(bs)));
|
|
28348
28555
|
}));
|
|
@@ -28386,7 +28593,7 @@ var size9 = (self) => self.size;
|
|
|
28386
28593
|
var shutdown = (self) => self.shutdown;
|
|
28387
28594
|
var offer2 = /* @__PURE__ */ dual(2, (self, value) => self.offer(value));
|
|
28388
28595
|
var take3 = (self) => self.take;
|
|
28389
|
-
var takeUpTo = /* @__PURE__ */ dual(2, (self,
|
|
28596
|
+
var takeUpTo = /* @__PURE__ */ dual(2, (self, max7) => self.takeUpTo(max7));
|
|
28390
28597
|
var backPressureStrategy = () => new BackPressureStrategy;
|
|
28391
28598
|
var droppingStrategy = () => new DroppingStrategy;
|
|
28392
28599
|
var slidingStrategy = () => new SlidingStrategy;
|
|
@@ -28508,8 +28715,8 @@ var unsafeOfferAll = (queue, as5) => {
|
|
|
28508
28715
|
var unsafePollAll = (queue) => {
|
|
28509
28716
|
return pipe(queue, pollUpTo(Number.POSITIVE_INFINITY));
|
|
28510
28717
|
};
|
|
28511
|
-
var unsafePollN = (queue,
|
|
28512
|
-
return pipe(queue, pollUpTo(
|
|
28718
|
+
var unsafePollN = (queue, max7) => {
|
|
28719
|
+
return pipe(queue, pollUpTo(max7));
|
|
28513
28720
|
};
|
|
28514
28721
|
var unsafeRemove = (queue, a) => {
|
|
28515
28722
|
unsafeOfferAll(queue, pipe(unsafePollAll(queue), filter3((b) => a !== b)));
|
|
@@ -30822,9 +31029,9 @@ function asSchema(schema) {
|
|
|
30822
31029
|
var format4 = (schema) => String(schema.ast);
|
|
30823
31030
|
var encodedSchema = (schema) => make50(encodedAST(schema.ast));
|
|
30824
31031
|
var typeSchema = (schema) => make50(typeAST(schema.ast));
|
|
30825
|
-
var
|
|
30826
|
-
const
|
|
30827
|
-
return (u, overrideOptions) => mapError3(
|
|
31032
|
+
var decodeUnknown3 = (schema, options) => {
|
|
31033
|
+
const decodeUnknown4 = decodeUnknown2(schema, options);
|
|
31034
|
+
return (u, overrideOptions) => mapError3(decodeUnknown4(u, overrideOptions), parseError);
|
|
30828
31035
|
};
|
|
30829
31036
|
var isSchema = (u) => hasProperty(u, TypeId17) && isObject(u[TypeId17]);
|
|
30830
31037
|
function getDefaultLiteralAST(literals) {
|
|
@@ -30843,9 +31050,9 @@ function Literal2(...literals) {
|
|
|
30843
31050
|
}
|
|
30844
31051
|
var declareConstructor = (typeParameters, options, annotations2) => makeDeclareClass(typeParameters, new Declaration(typeParameters.map((tp) => tp.ast), (...typeParameters2) => options.decode(...typeParameters2.map(make50)), (...typeParameters2) => options.encode(...typeParameters2.map(make50)), toASTAnnotations(annotations2)));
|
|
30845
31052
|
var declarePrimitive = (is2, annotations2) => {
|
|
30846
|
-
const
|
|
30847
|
-
const encodeUnknown2 =
|
|
30848
|
-
return makeDeclareClass([], new Declaration([],
|
|
31053
|
+
const decodeUnknown4 = () => (input, _, ast) => is2(input) ? succeed9(input) : fail9(new Type2(ast, input));
|
|
31054
|
+
const encodeUnknown2 = decodeUnknown4;
|
|
31055
|
+
return makeDeclareClass([], new Declaration([], decodeUnknown4, encodeUnknown2, toASTAnnotations(annotations2)));
|
|
30849
31056
|
};
|
|
30850
31057
|
function makeDeclareClass(typeParameters, ast) {
|
|
30851
31058
|
return class DeclareClass extends make50(ast) {
|
|
@@ -31769,13 +31976,13 @@ var causePretty = (error3) => (cause3) => {
|
|
|
31769
31976
|
};
|
|
31770
31977
|
return f(cause3);
|
|
31771
31978
|
};
|
|
31772
|
-
var causeParse = (
|
|
31979
|
+
var causeParse = (decodeUnknown4) => (u, options, ast) => isCause2(u) ? toComposite(decodeUnknown4(causeEncode(u), options), causeDecode, ast, u) : fail9(new Type2(ast, u));
|
|
31773
31980
|
var CauseFromSelf = ({
|
|
31774
31981
|
defect,
|
|
31775
31982
|
error: error3
|
|
31776
31983
|
}) => {
|
|
31777
31984
|
return declare([error3, defect], {
|
|
31778
|
-
decode: (error4, defect2) => causeParse(
|
|
31985
|
+
decode: (error4, defect2) => causeParse(decodeUnknown2(causeEncoded(error4, defect2))),
|
|
31779
31986
|
encode: (error4, defect2) => causeParse(encodeUnknown(causeEncoded(error4, defect2)))
|
|
31780
31987
|
}, {
|
|
31781
31988
|
typeConstructor: {
|
|
@@ -34871,12 +35078,12 @@ var Path2 = Path;
|
|
|
34871
35078
|
|
|
34872
35079
|
// node_modules/@effect/cli/dist/esm/internal/prompt/utils.js
|
|
34873
35080
|
var entriesToDisplay = (cursor, total, maxVisible) => {
|
|
34874
|
-
const
|
|
34875
|
-
let startIndex = Math.min(total -
|
|
35081
|
+
const max8 = maxVisible === undefined ? total : maxVisible;
|
|
35082
|
+
let startIndex = Math.min(total - max8, cursor - Math.floor(max8 / 2));
|
|
34876
35083
|
if (startIndex < 0) {
|
|
34877
35084
|
startIndex = 0;
|
|
34878
35085
|
}
|
|
34879
|
-
const endIndex = Math.min(startIndex +
|
|
35086
|
+
const endIndex = Math.min(startIndex + max8, total);
|
|
34880
35087
|
return {
|
|
34881
35088
|
startIndex,
|
|
34882
35089
|
endIndex
|
|
@@ -35169,8 +35376,8 @@ var file = (options3 = {}) => {
|
|
|
35169
35376
|
};
|
|
35170
35377
|
|
|
35171
35378
|
// node_modules/@effect/cli/dist/esm/internal/prompt/number.js
|
|
35172
|
-
var parseInt2 = /* @__PURE__ */ NumberFromString.pipe(/* @__PURE__ */ int(),
|
|
35173
|
-
var parseFloat2 = /* @__PURE__ */
|
|
35379
|
+
var parseInt2 = /* @__PURE__ */ NumberFromString.pipe(/* @__PURE__ */ int(), decodeUnknown3);
|
|
35380
|
+
var parseFloat2 = /* @__PURE__ */ decodeUnknown3(NumberFromString);
|
|
35174
35381
|
var renderBeep3 = /* @__PURE__ */ render3(beep3, {
|
|
35175
35382
|
style: "pretty"
|
|
35176
35383
|
});
|
|
@@ -36297,14 +36504,14 @@ var validateInternal = (self, value5, config2) => {
|
|
|
36297
36504
|
}));
|
|
36298
36505
|
}
|
|
36299
36506
|
case "DateTime": {
|
|
36300
|
-
return attempt(value5, getTypeNameInternal(self),
|
|
36507
|
+
return attempt(value5, getTypeNameInternal(self), decodeUnknown3(Date$));
|
|
36301
36508
|
}
|
|
36302
36509
|
case "Float": {
|
|
36303
|
-
return attempt(value5, getTypeNameInternal(self),
|
|
36510
|
+
return attempt(value5, getTypeNameInternal(self), decodeUnknown3(NumberFromString));
|
|
36304
36511
|
}
|
|
36305
36512
|
case "Integer": {
|
|
36306
36513
|
const intFromString = compose3(NumberFromString, Int);
|
|
36307
|
-
return attempt(value5, getTypeNameInternal(self),
|
|
36514
|
+
return attempt(value5, getTypeNameInternal(self), decodeUnknown3(intFromString));
|
|
36308
36515
|
}
|
|
36309
36516
|
case "Path": {
|
|
36310
36517
|
return flatMap9(FileSystem, (fileSystem) => {
|
|
@@ -36313,13 +36520,13 @@ var validateInternal = (self, value5, config2) => {
|
|
|
36313
36520
|
});
|
|
36314
36521
|
}
|
|
36315
36522
|
case "Redacted": {
|
|
36316
|
-
return attempt(value5, getTypeNameInternal(self),
|
|
36523
|
+
return attempt(value5, getTypeNameInternal(self), decodeUnknown3(String$)).pipe(map15((value6) => make49(value6)));
|
|
36317
36524
|
}
|
|
36318
36525
|
case "Secret": {
|
|
36319
|
-
return attempt(value5, getTypeNameInternal(self),
|
|
36526
|
+
return attempt(value5, getTypeNameInternal(self), decodeUnknown3(String$)).pipe(map15((value6) => fromString2(value6)));
|
|
36320
36527
|
}
|
|
36321
36528
|
case "Text": {
|
|
36322
|
-
return attempt(value5, getTypeNameInternal(self),
|
|
36529
|
+
return attempt(value5, getTypeNameInternal(self), decodeUnknown3(String$));
|
|
36323
36530
|
}
|
|
36324
36531
|
}
|
|
36325
36532
|
};
|
|
@@ -36795,10 +37002,10 @@ var getHelpInternal2 = (self) => {
|
|
|
36795
37002
|
case "Variadic": {
|
|
36796
37003
|
const help = getHelpInternal2(self.args);
|
|
36797
37004
|
return mapDescriptionList(help, (oldSpan, oldBlock) => {
|
|
36798
|
-
const
|
|
36799
|
-
const
|
|
36800
|
-
const newSpan = text4(isSome2(self.max) ? ` ${
|
|
36801
|
-
const newBlock = p(isSome2(self.max) ? `This argument must be repeated at least ${
|
|
37005
|
+
const min6 = getMinSizeInternal(self);
|
|
37006
|
+
const max8 = getMaxSizeInternal(self);
|
|
37007
|
+
const newSpan = text4(isSome2(self.max) ? ` ${min6} - ${max8}` : min6 === 0 ? "..." : ` ${min6}+`);
|
|
37008
|
+
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.`);
|
|
36802
37009
|
return [concat3(oldSpan, newSpan), sequence(oldBlock, newBlock)];
|
|
36803
37010
|
});
|
|
36804
37011
|
}
|
|
@@ -37246,7 +37453,7 @@ var secret3 = (name) => makeSingle(name, empty3(), secret2);
|
|
|
37246
37453
|
var text7 = (name) => makeSingle(name, empty3(), text6);
|
|
37247
37454
|
var atLeast = /* @__PURE__ */ dual(2, (self, times2) => makeVariadic(self, some2(times2), none2()));
|
|
37248
37455
|
var atMost = /* @__PURE__ */ dual(2, (self, times2) => makeVariadic(self, none2(), some2(times2)));
|
|
37249
|
-
var
|
|
37456
|
+
var between3 = /* @__PURE__ */ dual(3, (self, min6, max8) => makeVariadic(self, some2(min6), some2(max8)));
|
|
37250
37457
|
var isBool2 = (self) => isBoolInternal(self);
|
|
37251
37458
|
var getHelp4 = (self) => getHelpInternal3(self);
|
|
37252
37459
|
var getIdentifier = (self) => getIdentifierInternal(self);
|
|
@@ -37339,10 +37546,10 @@ var getHelpInternal3 = (self) => {
|
|
|
37339
37546
|
case "Variadic": {
|
|
37340
37547
|
const help = getHelpInternal3(self.argumentOption);
|
|
37341
37548
|
return mapDescriptionList(help, (oldSpan, oldBlock) => {
|
|
37342
|
-
const
|
|
37343
|
-
const
|
|
37344
|
-
const newSpan = text4(isSome2(self.max) ? ` ${
|
|
37345
|
-
const newBlock = p(isSome2(self.max) ? `This option must be repeated at least ${
|
|
37549
|
+
const min6 = getMinSizeInternal2(self);
|
|
37550
|
+
const max8 = getMaxSizeInternal2(self);
|
|
37551
|
+
const newSpan = text4(isSome2(self.max) ? ` ${min6} - ${max8}` : min6 === 0 ? "..." : ` ${min6}+`);
|
|
37552
|
+
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.`);
|
|
37346
37553
|
return [concat3(oldSpan, newSpan), sequence(oldBlock, newBlock)];
|
|
37347
37554
|
});
|
|
37348
37555
|
}
|
|
@@ -37542,15 +37749,15 @@ var makeSingle = (name, aliases, primitiveType, description = empty36, pseudoNam
|
|
|
37542
37749
|
op.pseudoName = pseudoName;
|
|
37543
37750
|
return op;
|
|
37544
37751
|
};
|
|
37545
|
-
var makeVariadic = (argumentOption,
|
|
37752
|
+
var makeVariadic = (argumentOption, min6, max8) => {
|
|
37546
37753
|
if (!isSingle2(argumentOption)) {
|
|
37547
37754
|
throw new Error("InvalidArgumentException: only single options can be variadic");
|
|
37548
37755
|
}
|
|
37549
37756
|
const op = Object.create(proto22);
|
|
37550
37757
|
op._tag = "Variadic";
|
|
37551
37758
|
op.argumentOption = argumentOption;
|
|
37552
|
-
op.min =
|
|
37553
|
-
op.max =
|
|
37759
|
+
op.min = min6;
|
|
37760
|
+
op.max = max8;
|
|
37554
37761
|
return op;
|
|
37555
37762
|
};
|
|
37556
37763
|
var makeWithDefault = (options3, fallback) => {
|
|
@@ -37719,18 +37926,18 @@ var parseInternal = (self, args2, config2) => {
|
|
|
37719
37926
|
}));
|
|
37720
37927
|
}
|
|
37721
37928
|
case "Variadic": {
|
|
37722
|
-
const
|
|
37723
|
-
const
|
|
37929
|
+
const min6 = getOrElse(self.min, () => 0);
|
|
37930
|
+
const max8 = getOrElse(self.max, () => Number.MAX_SAFE_INTEGER);
|
|
37724
37931
|
const matchedArgument = filterMap2(getNames(self), (name) => get7(args2, name));
|
|
37725
37932
|
const validateMinMax = (values3) => {
|
|
37726
|
-
if (values3.length <
|
|
37933
|
+
if (values3.length < min6) {
|
|
37727
37934
|
const name = self.argumentOption.fullName;
|
|
37728
|
-
const error4 = `Expected at least ${
|
|
37935
|
+
const error4 = `Expected at least ${min6} value(s) for option: '${name}'`;
|
|
37729
37936
|
return fail8(invalidValue(p(error4)));
|
|
37730
37937
|
}
|
|
37731
|
-
if (values3.length >
|
|
37938
|
+
if (values3.length > max8) {
|
|
37732
37939
|
const name = self.argumentOption.fullName;
|
|
37733
|
-
const error4 = `Expected at most ${
|
|
37940
|
+
const error4 = `Expected at most ${max8} value(s) for option: '${name}'`;
|
|
37734
37941
|
return fail8(invalidValue(p(error4)));
|
|
37735
37942
|
}
|
|
37736
37943
|
const primitive2 = self.argumentOption.primitiveType;
|
|
@@ -38340,7 +38547,7 @@ __export(exports_Options, {
|
|
|
38340
38547
|
choiceWithValue: () => choiceWithValue2,
|
|
38341
38548
|
choice: () => choice3,
|
|
38342
38549
|
boolean: () => boolean5,
|
|
38343
|
-
between: () =>
|
|
38550
|
+
between: () => between4,
|
|
38344
38551
|
atMost: () => atMost2,
|
|
38345
38552
|
atLeast: () => atLeast2,
|
|
38346
38553
|
all: () => all8,
|
|
@@ -38371,7 +38578,7 @@ var secret4 = secret3;
|
|
|
38371
38578
|
var text8 = text7;
|
|
38372
38579
|
var atMost2 = atMost;
|
|
38373
38580
|
var atLeast2 = atLeast;
|
|
38374
|
-
var
|
|
38581
|
+
var between4 = between3;
|
|
38375
38582
|
var filterMap9 = filterMap8;
|
|
38376
38583
|
var isBool3 = isBool2;
|
|
38377
38584
|
var map30 = map28;
|
|
@@ -38505,7 +38712,7 @@ var getHelpInternal4 = (self, config2) => {
|
|
|
38505
38712
|
}
|
|
38506
38713
|
};
|
|
38507
38714
|
const printSubcommands = (subcommands) => {
|
|
38508
|
-
const maxUsageLength = reduceRight(subcommands, 0, (
|
|
38715
|
+
const maxUsageLength = reduceRight(subcommands, 0, (max8, [usage]) => Math.max(size11(usage), max8));
|
|
38509
38716
|
const documents = map3(subcommands, ([usage, desc]) => p(spans([usage, text4(" ".repeat(maxUsageLength - size11(usage) + 2)), desc])));
|
|
38510
38717
|
if (isNonEmptyReadonlyArray(documents)) {
|
|
38511
38718
|
return enumeration(documents);
|
|
@@ -41106,6 +41313,10 @@ class ApiError extends Error {
|
|
|
41106
41313
|
}
|
|
41107
41314
|
}
|
|
41108
41315
|
|
|
41316
|
+
class ValidationError extends Error {
|
|
41317
|
+
_tag = "ValidationError";
|
|
41318
|
+
}
|
|
41319
|
+
|
|
41109
41320
|
// src/config/config.ts
|
|
41110
41321
|
import fs from "fs/promises";
|
|
41111
41322
|
import path3 from "path";
|
|
@@ -41156,6 +41367,10 @@ var saveConfigFile = (config2) => exports_Effect.tryPromise({
|
|
|
41156
41367
|
await fs.writeFile(file4, `${JSON.stringify(config2)}
|
|
41157
41368
|
`, { encoding: "utf8" });
|
|
41158
41369
|
await fs.chmod(file4, 384);
|
|
41370
|
+
const stats = await fs.stat(file4);
|
|
41371
|
+
if ((stats.mode & 511) !== 384) {
|
|
41372
|
+
throw new Error("Failed to secure config file permissions");
|
|
41373
|
+
}
|
|
41159
41374
|
return file4;
|
|
41160
41375
|
},
|
|
41161
41376
|
catch: (e) => e instanceof Error ? new ConfigError(e.message) : new ConfigError(String(e))
|
|
@@ -41216,6 +41431,7 @@ function runConfigCommand(cmd) {
|
|
|
41216
41431
|
// src/parallel/api.ts
|
|
41217
41432
|
var API_BASE = "https://api.parallel.ai";
|
|
41218
41433
|
var BETA_HEADER = "search-extract-2025-10-10";
|
|
41434
|
+
var REQUEST_TIMEOUT_MS = 30000;
|
|
41219
41435
|
function getApiKey() {
|
|
41220
41436
|
return exports_Effect.gen(function* () {
|
|
41221
41437
|
const config2 = yield* exports_Effect.catchAll(loadConfigFile, () => exports_Effect.succeed({}));
|
|
@@ -41240,7 +41456,7 @@ function makeRequest(endpoint, body) {
|
|
|
41240
41456
|
body: JSON.stringify(body)
|
|
41241
41457
|
}),
|
|
41242
41458
|
catch: (e) => new CliError(`Network error: ${e instanceof Error ? e.message : String(e)}`)
|
|
41243
|
-
});
|
|
41459
|
+
}).pipe(exports_Effect.timeout(exports_Duration.millis(REQUEST_TIMEOUT_MS)), exports_Effect.catchTag("TimeoutException", () => exports_Effect.fail(new CliError(`Request timed out after ${REQUEST_TIMEOUT_MS}ms`))));
|
|
41244
41460
|
if (!response.ok) {
|
|
41245
41461
|
const text9 = yield* exports_Effect.tryPromise({
|
|
41246
41462
|
try: () => response.text(),
|
|
@@ -41397,6 +41613,18 @@ function runSearchCommand(cmd) {
|
|
|
41397
41613
|
}
|
|
41398
41614
|
|
|
41399
41615
|
// src/parallel/extract.ts
|
|
41616
|
+
function validateUrl(url2) {
|
|
41617
|
+
return exports_Effect.gen(function* () {
|
|
41618
|
+
const parsed = yield* exports_Effect.try({
|
|
41619
|
+
try: () => new URL(url2),
|
|
41620
|
+
catch: (_error) => new ValidationError(`Invalid URL format: ${url2}`)
|
|
41621
|
+
});
|
|
41622
|
+
if (!["http:", "https:"].includes(parsed.protocol)) {
|
|
41623
|
+
yield* exports_Effect.fail(new ValidationError(`Invalid URL protocol: ${url2}. Only http: and https: are allowed`));
|
|
41624
|
+
}
|
|
41625
|
+
return url2;
|
|
41626
|
+
});
|
|
41627
|
+
}
|
|
41400
41628
|
function runExtracts(urls, stdin3, objective, excerpts, fullContent, concurrency, format6, pretty6) {
|
|
41401
41629
|
return exports_Effect.gen(function* () {
|
|
41402
41630
|
let allUrls = [...urls];
|
|
@@ -41410,8 +41638,9 @@ function runExtracts(urls, stdin3, objective, excerpts, fullContent, concurrency
|
|
|
41410
41638
|
if (allUrls.length === 0) {
|
|
41411
41639
|
return yield* exports_Effect.fail(new Error("No URLs provided. Provide URLs as arguments or use --stdin"));
|
|
41412
41640
|
}
|
|
41641
|
+
const validatedUrls = yield* exports_Effect.forEach(allUrls, (url2) => validateUrl(url2), { concurrency: 1 });
|
|
41413
41642
|
const useExcerpts = excerpts || !fullContent;
|
|
41414
|
-
const requests =
|
|
41643
|
+
const requests = validatedUrls.map((url2) => ({
|
|
41415
41644
|
urls: [url2],
|
|
41416
41645
|
objective: exports_Option.isSome(objective) ? objective.value : undefined,
|
|
41417
41646
|
excerpts: useExcerpts,
|