@grepai/cli 0.4.11 → 0.4.12
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/index.js +476 -1402
- package/index.js.map +3 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4794,8 +4794,8 @@ var require_Collection = __commonJS((exports) => {
|
|
|
4794
4794
|
return this.items.every((node) => {
|
|
4795
4795
|
if (!identity3.isPair(node))
|
|
4796
4796
|
return false;
|
|
4797
|
-
const
|
|
4798
|
-
return
|
|
4797
|
+
const n = node.value;
|
|
4798
|
+
return n == null || allowScalar && identity3.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
|
|
4799
4799
|
});
|
|
4800
4800
|
}
|
|
4801
4801
|
hasIn(path) {
|
|
@@ -6168,18 +6168,18 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
6168
6168
|
const num = typeof value3 === "number" ? value3 : Number(value3);
|
|
6169
6169
|
if (!isFinite(num))
|
|
6170
6170
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
6171
|
-
let
|
|
6172
|
-
if (!format5 && minFractionDigits && (!tag2 || tag2 === "tag:yaml.org,2002:float") && /^\d/.test(
|
|
6173
|
-
let i =
|
|
6171
|
+
let n = Object.is(value3, -0) ? "-0" : JSON.stringify(value3);
|
|
6172
|
+
if (!format5 && minFractionDigits && (!tag2 || tag2 === "tag:yaml.org,2002:float") && /^\d/.test(n)) {
|
|
6173
|
+
let i = n.indexOf(".");
|
|
6174
6174
|
if (i < 0) {
|
|
6175
|
-
i =
|
|
6176
|
-
|
|
6175
|
+
i = n.length;
|
|
6176
|
+
n += ".";
|
|
6177
6177
|
}
|
|
6178
|
-
let d = minFractionDigits - (
|
|
6178
|
+
let d = minFractionDigits - (n.length - i - 1);
|
|
6179
6179
|
while (d-- > 0)
|
|
6180
|
-
|
|
6180
|
+
n += "0";
|
|
6181
6181
|
}
|
|
6182
|
-
return
|
|
6182
|
+
return n;
|
|
6183
6183
|
}
|
|
6184
6184
|
exports.stringifyNumber = stringifyNumber;
|
|
6185
6185
|
});
|
|
@@ -6399,9 +6399,9 @@ var require_binary = __commonJS((exports) => {
|
|
|
6399
6399
|
type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
|
|
6400
6400
|
if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
|
|
6401
6401
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
6402
|
-
const
|
|
6403
|
-
const lines = new Array(
|
|
6404
|
-
for (let i = 0, o = 0;i <
|
|
6402
|
+
const n = Math.ceil(str.length / lineWidth);
|
|
6403
|
+
const lines = new Array(n);
|
|
6404
|
+
for (let i = 0, o = 0;i < n; ++i, o += lineWidth) {
|
|
6405
6405
|
lines[i] = str.substr(o, lineWidth);
|
|
6406
6406
|
}
|
|
6407
6407
|
str = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? `
|
|
@@ -6656,11 +6656,11 @@ var require_int2 = __commonJS((exports) => {
|
|
|
6656
6656
|
str = `0x${str}`;
|
|
6657
6657
|
break;
|
|
6658
6658
|
}
|
|
6659
|
-
const
|
|
6660
|
-
return sign === "-" ? BigInt(-1) *
|
|
6659
|
+
const n2 = BigInt(str);
|
|
6660
|
+
return sign === "-" ? BigInt(-1) * n2 : n2;
|
|
6661
6661
|
}
|
|
6662
|
-
const
|
|
6663
|
-
return sign === "-" ? -1 *
|
|
6662
|
+
const n = parseInt(str, radix);
|
|
6663
|
+
return sign === "-" ? -1 * n : n;
|
|
6664
6664
|
}
|
|
6665
6665
|
function intStringify(node, radix, prefix) {
|
|
6666
6666
|
const { value: value3 } = node;
|
|
@@ -6800,15 +6800,15 @@ var require_timestamp = __commonJS((exports) => {
|
|
|
6800
6800
|
function parseSexagesimal(str, asBigInt) {
|
|
6801
6801
|
const sign = str[0];
|
|
6802
6802
|
const parts2 = sign === "-" || sign === "+" ? str.substring(1) : str;
|
|
6803
|
-
const num = (
|
|
6803
|
+
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
6804
6804
|
const res = parts2.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
|
|
6805
6805
|
return sign === "-" ? num(-1) * res : res;
|
|
6806
6806
|
}
|
|
6807
6807
|
function stringifySexagesimal(node) {
|
|
6808
6808
|
let { value: value3 } = node;
|
|
6809
|
-
let num = (
|
|
6809
|
+
let num = (n) => n;
|
|
6810
6810
|
if (typeof value3 === "bigint")
|
|
6811
|
-
num = (
|
|
6811
|
+
num = (n) => BigInt(n);
|
|
6812
6812
|
else if (isNaN(value3) || !isFinite(value3))
|
|
6813
6813
|
return stringifyNumber.stringifyNumber(node);
|
|
6814
6814
|
let sign = "";
|
|
@@ -6828,7 +6828,7 @@ var require_timestamp = __commonJS((exports) => {
|
|
|
6828
6828
|
parts2.unshift(value3);
|
|
6829
6829
|
}
|
|
6830
6830
|
}
|
|
6831
|
-
return sign + parts2.map((
|
|
6831
|
+
return sign + parts2.map((n) => String(n).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
|
|
6832
6832
|
}
|
|
6833
6833
|
var intTime = {
|
|
6834
6834
|
identify: (value3) => typeof value3 === "bigint" || Number.isInteger(value3),
|
|
@@ -8201,9 +8201,9 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
8201
8201
|
if (!chomp && (ch === "-" || ch === "+"))
|
|
8202
8202
|
chomp = ch;
|
|
8203
8203
|
else {
|
|
8204
|
-
const
|
|
8205
|
-
if (!indent &&
|
|
8206
|
-
indent =
|
|
8204
|
+
const n = Number(ch);
|
|
8205
|
+
if (!indent && n)
|
|
8206
|
+
indent = n;
|
|
8207
8207
|
else if (error3 === -1)
|
|
8208
8208
|
error3 = offset + i;
|
|
8209
8209
|
}
|
|
@@ -9375,8 +9375,8 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9375
9375
|
`;
|
|
9376
9376
|
return false;
|
|
9377
9377
|
}
|
|
9378
|
-
charAt(
|
|
9379
|
-
return this.buffer[this.pos +
|
|
9378
|
+
charAt(n) {
|
|
9379
|
+
return this.buffer[this.pos + n];
|
|
9380
9380
|
}
|
|
9381
9381
|
continueScalar(offset) {
|
|
9382
9382
|
let ch = this.buffer[offset];
|
|
@@ -9413,8 +9413,8 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9413
9413
|
end5 -= 1;
|
|
9414
9414
|
return this.buffer.substring(this.pos, end5);
|
|
9415
9415
|
}
|
|
9416
|
-
hasChars(
|
|
9417
|
-
return this.pos +
|
|
9416
|
+
hasChars(n) {
|
|
9417
|
+
return this.pos + n <= this.buffer.length;
|
|
9418
9418
|
}
|
|
9419
9419
|
setNext(state) {
|
|
9420
9420
|
this.buffer = this.buffer.substring(this.pos);
|
|
@@ -9423,8 +9423,8 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9423
9423
|
this.next = state;
|
|
9424
9424
|
return null;
|
|
9425
9425
|
}
|
|
9426
|
-
peek(
|
|
9427
|
-
return this.buffer.substr(this.pos,
|
|
9426
|
+
peek(n) {
|
|
9427
|
+
return this.buffer.substr(this.pos, n);
|
|
9428
9428
|
}
|
|
9429
9429
|
*parseNext(next) {
|
|
9430
9430
|
switch (next) {
|
|
@@ -9473,8 +9473,8 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9473
9473
|
else
|
|
9474
9474
|
break;
|
|
9475
9475
|
}
|
|
9476
|
-
const
|
|
9477
|
-
yield* this.pushCount(line.length -
|
|
9476
|
+
const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
|
|
9477
|
+
yield* this.pushCount(line.length - n);
|
|
9478
9478
|
this.pushNewline();
|
|
9479
9479
|
return "stream";
|
|
9480
9480
|
}
|
|
@@ -9512,9 +9512,9 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9512
9512
|
if (!ch1 && !this.atEnd)
|
|
9513
9513
|
return this.setNext("block-start");
|
|
9514
9514
|
if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty11(ch1)) {
|
|
9515
|
-
const
|
|
9515
|
+
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
9516
9516
|
this.indentNext = this.indentValue + 1;
|
|
9517
|
-
this.indentValue +=
|
|
9517
|
+
this.indentValue += n;
|
|
9518
9518
|
return yield* this.parseBlockStart();
|
|
9519
9519
|
}
|
|
9520
9520
|
return "doc";
|
|
@@ -9524,10 +9524,10 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9524
9524
|
const line = this.getLine();
|
|
9525
9525
|
if (line === null)
|
|
9526
9526
|
return this.setNext("doc");
|
|
9527
|
-
let
|
|
9528
|
-
switch (line[
|
|
9527
|
+
let n = yield* this.pushIndicators();
|
|
9528
|
+
switch (line[n]) {
|
|
9529
9529
|
case "#":
|
|
9530
|
-
yield* this.pushCount(line.length -
|
|
9530
|
+
yield* this.pushCount(line.length - n);
|
|
9531
9531
|
case undefined:
|
|
9532
9532
|
yield* this.pushNewline();
|
|
9533
9533
|
return yield* this.parseLineStart();
|
|
@@ -9549,9 +9549,9 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9549
9549
|
return yield* this.parseQuotedScalar();
|
|
9550
9550
|
case "|":
|
|
9551
9551
|
case ">":
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
yield* this.pushCount(line.length -
|
|
9552
|
+
n += yield* this.parseBlockScalarHeader();
|
|
9553
|
+
n += yield* this.pushSpaces(true);
|
|
9554
|
+
yield* this.pushCount(line.length - n);
|
|
9555
9555
|
yield* this.pushNewline();
|
|
9556
9556
|
return yield* this.parseBlockScalar();
|
|
9557
9557
|
default:
|
|
@@ -9582,18 +9582,18 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9582
9582
|
return yield* this.parseLineStart();
|
|
9583
9583
|
}
|
|
9584
9584
|
}
|
|
9585
|
-
let
|
|
9586
|
-
while (line[
|
|
9587
|
-
|
|
9588
|
-
|
|
9585
|
+
let n = 0;
|
|
9586
|
+
while (line[n] === ",") {
|
|
9587
|
+
n += yield* this.pushCount(1);
|
|
9588
|
+
n += yield* this.pushSpaces(true);
|
|
9589
9589
|
this.flowKey = false;
|
|
9590
9590
|
}
|
|
9591
|
-
|
|
9592
|
-
switch (line[
|
|
9591
|
+
n += yield* this.pushIndicators();
|
|
9592
|
+
switch (line[n]) {
|
|
9593
9593
|
case undefined:
|
|
9594
9594
|
return "flow";
|
|
9595
9595
|
case "#":
|
|
9596
|
-
yield* this.pushCount(line.length -
|
|
9596
|
+
yield* this.pushCount(line.length - n);
|
|
9597
9597
|
return "flow";
|
|
9598
9598
|
case "{":
|
|
9599
9599
|
case "[":
|
|
@@ -9636,10 +9636,10 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9636
9636
|
end5 = this.buffer.indexOf("'", end5 + 2);
|
|
9637
9637
|
} else {
|
|
9638
9638
|
while (end5 !== -1) {
|
|
9639
|
-
let
|
|
9640
|
-
while (this.buffer[end5 - 1 -
|
|
9641
|
-
|
|
9642
|
-
if (
|
|
9639
|
+
let n = 0;
|
|
9640
|
+
while (this.buffer[end5 - 1 - n] === "\\")
|
|
9641
|
+
n += 1;
|
|
9642
|
+
if (n % 2 === 0)
|
|
9643
9643
|
break;
|
|
9644
9644
|
end5 = this.buffer.indexOf('"', end5 + 1);
|
|
9645
9645
|
}
|
|
@@ -9803,11 +9803,11 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9803
9803
|
yield* this.pushToIndex(end5 + 1, true);
|
|
9804
9804
|
return inFlow ? "flow" : "doc";
|
|
9805
9805
|
}
|
|
9806
|
-
*pushCount(
|
|
9807
|
-
if (
|
|
9808
|
-
yield this.buffer.substr(this.pos,
|
|
9809
|
-
this.pos +=
|
|
9810
|
-
return
|
|
9806
|
+
*pushCount(n) {
|
|
9807
|
+
if (n > 0) {
|
|
9808
|
+
yield this.buffer.substr(this.pos, n);
|
|
9809
|
+
this.pos += n;
|
|
9810
|
+
return n;
|
|
9811
9811
|
}
|
|
9812
9812
|
return 0;
|
|
9813
9813
|
}
|
|
@@ -9881,12 +9881,12 @@ var require_lexer = __commonJS((exports) => {
|
|
|
9881
9881
|
do {
|
|
9882
9882
|
ch = this.buffer[++i];
|
|
9883
9883
|
} while (ch === " " || allowTabs && ch === "\t");
|
|
9884
|
-
const
|
|
9885
|
-
if (
|
|
9886
|
-
yield this.buffer.substr(this.pos,
|
|
9884
|
+
const n = i - this.pos;
|
|
9885
|
+
if (n > 0) {
|
|
9886
|
+
yield this.buffer.substr(this.pos, n);
|
|
9887
9887
|
this.pos = i;
|
|
9888
9888
|
}
|
|
9889
|
-
return
|
|
9889
|
+
return n;
|
|
9890
9890
|
}
|
|
9891
9891
|
*pushUntil(test) {
|
|
9892
9892
|
let i = this.pos;
|
|
@@ -10132,8 +10132,8 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
10132
10132
|
}
|
|
10133
10133
|
yield* this.pop();
|
|
10134
10134
|
}
|
|
10135
|
-
peek(
|
|
10136
|
-
return this.stack[this.stack.length -
|
|
10135
|
+
peek(n) {
|
|
10136
|
+
return this.stack[this.stack.length - n];
|
|
10137
10137
|
}
|
|
10138
10138
|
*pop(error3) {
|
|
10139
10139
|
const token = error3 ?? this.stack.pop();
|
|
@@ -12873,932 +12873,6 @@ var require_src = __commonJS((exports) => {
|
|
|
12873
12873
|
};
|
|
12874
12874
|
});
|
|
12875
12875
|
|
|
12876
|
-
// ../../node_modules/.bun/tree-sitter@0.25.0/node_modules/tree-sitter/build/Release/tree_sitter_runtime_binding.node
|
|
12877
|
-
var require_tree_sitter_runtime_binding = __commonJS((exports, module) => {
|
|
12878
|
-
module.exports = __require("./tree_sitter_runtime_binding-awbsccqq.node");
|
|
12879
|
-
});
|
|
12880
|
-
|
|
12881
|
-
// ../../node_modules/.bun/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js
|
|
12882
|
-
var require_node_gyp_build = __commonJS((exports, module) => {
|
|
12883
|
-
var fs = __require("fs");
|
|
12884
|
-
var path4 = __require("path");
|
|
12885
|
-
var os = __require("os");
|
|
12886
|
-
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
12887
|
-
var vars = process.config && process.config.variables || {};
|
|
12888
|
-
var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
|
|
12889
|
-
var abi = process.versions.modules;
|
|
12890
|
-
var runtime6 = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
|
|
12891
|
-
var arch = process.env.npm_config_arch || os.arch();
|
|
12892
|
-
var platform = process.env.npm_config_platform || os.platform();
|
|
12893
|
-
var libc = process.env.LIBC || (isAlpine(platform) ? "musl" : "glibc");
|
|
12894
|
-
var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
|
|
12895
|
-
var uv = (process.versions.uv || "").split(".")[0];
|
|
12896
|
-
module.exports = load;
|
|
12897
|
-
function load(dir2) {
|
|
12898
|
-
return runtimeRequire(load.resolve(dir2));
|
|
12899
|
-
}
|
|
12900
|
-
load.resolve = load.path = function(dir2) {
|
|
12901
|
-
dir2 = path4.resolve(dir2 || ".");
|
|
12902
|
-
try {
|
|
12903
|
-
var name21 = runtimeRequire(path4.join(dir2, "package.json")).name.toUpperCase().replace(/-/g, "_");
|
|
12904
|
-
if (process.env[name21 + "_PREBUILD"])
|
|
12905
|
-
dir2 = process.env[name21 + "_PREBUILD"];
|
|
12906
|
-
} catch (err) {}
|
|
12907
|
-
if (!prebuildsOnly) {
|
|
12908
|
-
var release = getFirst(path4.join(dir2, "build/Release"), matchBuild);
|
|
12909
|
-
if (release)
|
|
12910
|
-
return release;
|
|
12911
|
-
var debug2 = getFirst(path4.join(dir2, "build/Debug"), matchBuild);
|
|
12912
|
-
if (debug2)
|
|
12913
|
-
return debug2;
|
|
12914
|
-
}
|
|
12915
|
-
var prebuild = resolve4(dir2);
|
|
12916
|
-
if (prebuild)
|
|
12917
|
-
return prebuild;
|
|
12918
|
-
var nearby = resolve4(path4.dirname(process.execPath));
|
|
12919
|
-
if (nearby)
|
|
12920
|
-
return nearby;
|
|
12921
|
-
var target = [
|
|
12922
|
-
"platform=" + platform,
|
|
12923
|
-
"arch=" + arch,
|
|
12924
|
-
"runtime=" + runtime6,
|
|
12925
|
-
"abi=" + abi,
|
|
12926
|
-
"uv=" + uv,
|
|
12927
|
-
armv ? "armv=" + armv : "",
|
|
12928
|
-
"libc=" + libc,
|
|
12929
|
-
"node=" + process.versions.node,
|
|
12930
|
-
process.versions.electron ? "electron=" + process.versions.electron : "",
|
|
12931
|
-
typeof __webpack_require__ === "function" ? "webpack=true" : ""
|
|
12932
|
-
].filter(Boolean).join(" ");
|
|
12933
|
-
throw new Error("No native build was found for " + target + `
|
|
12934
|
-
loaded from: ` + dir2 + `
|
|
12935
|
-
`);
|
|
12936
|
-
function resolve4(dir3) {
|
|
12937
|
-
var tuples = readdirSync(path4.join(dir3, "prebuilds")).map(parseTuple);
|
|
12938
|
-
var tuple4 = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
|
|
12939
|
-
if (!tuple4)
|
|
12940
|
-
return;
|
|
12941
|
-
var prebuilds = path4.join(dir3, "prebuilds", tuple4.name);
|
|
12942
|
-
var parsed = readdirSync(prebuilds).map(parseTags);
|
|
12943
|
-
var candidates = parsed.filter(matchTags(runtime6, abi));
|
|
12944
|
-
var winner = candidates.sort(compareTags(runtime6))[0];
|
|
12945
|
-
if (winner)
|
|
12946
|
-
return path4.join(prebuilds, winner.file);
|
|
12947
|
-
}
|
|
12948
|
-
};
|
|
12949
|
-
function readdirSync(dir2) {
|
|
12950
|
-
try {
|
|
12951
|
-
return fs.readdirSync(dir2);
|
|
12952
|
-
} catch (err) {
|
|
12953
|
-
return [];
|
|
12954
|
-
}
|
|
12955
|
-
}
|
|
12956
|
-
function getFirst(dir2, filter13) {
|
|
12957
|
-
var files = readdirSync(dir2).filter(filter13);
|
|
12958
|
-
return files[0] && path4.join(dir2, files[0]);
|
|
12959
|
-
}
|
|
12960
|
-
function matchBuild(name21) {
|
|
12961
|
-
return /\.node$/.test(name21);
|
|
12962
|
-
}
|
|
12963
|
-
function parseTuple(name21) {
|
|
12964
|
-
var arr = name21.split("-");
|
|
12965
|
-
if (arr.length !== 2)
|
|
12966
|
-
return;
|
|
12967
|
-
var platform2 = arr[0];
|
|
12968
|
-
var architectures = arr[1].split("+");
|
|
12969
|
-
if (!platform2)
|
|
12970
|
-
return;
|
|
12971
|
-
if (!architectures.length)
|
|
12972
|
-
return;
|
|
12973
|
-
if (!architectures.every(Boolean))
|
|
12974
|
-
return;
|
|
12975
|
-
return { name: name21, platform: platform2, architectures };
|
|
12976
|
-
}
|
|
12977
|
-
function matchTuple(platform2, arch2) {
|
|
12978
|
-
return function(tuple4) {
|
|
12979
|
-
if (tuple4 == null)
|
|
12980
|
-
return false;
|
|
12981
|
-
if (tuple4.platform !== platform2)
|
|
12982
|
-
return false;
|
|
12983
|
-
return tuple4.architectures.includes(arch2);
|
|
12984
|
-
};
|
|
12985
|
-
}
|
|
12986
|
-
function compareTuples(a, b) {
|
|
12987
|
-
return a.architectures.length - b.architectures.length;
|
|
12988
|
-
}
|
|
12989
|
-
function parseTags(file8) {
|
|
12990
|
-
var arr = file8.split(".");
|
|
12991
|
-
var extension = arr.pop();
|
|
12992
|
-
var tags2 = { file: file8, specificity: 0 };
|
|
12993
|
-
if (extension !== "node")
|
|
12994
|
-
return;
|
|
12995
|
-
for (var i = 0;i < arr.length; i++) {
|
|
12996
|
-
var tag5 = arr[i];
|
|
12997
|
-
if (tag5 === "node" || tag5 === "electron" || tag5 === "node-webkit") {
|
|
12998
|
-
tags2.runtime = tag5;
|
|
12999
|
-
} else if (tag5 === "napi") {
|
|
13000
|
-
tags2.napi = true;
|
|
13001
|
-
} else if (tag5.slice(0, 3) === "abi") {
|
|
13002
|
-
tags2.abi = tag5.slice(3);
|
|
13003
|
-
} else if (tag5.slice(0, 2) === "uv") {
|
|
13004
|
-
tags2.uv = tag5.slice(2);
|
|
13005
|
-
} else if (tag5.slice(0, 4) === "armv") {
|
|
13006
|
-
tags2.armv = tag5.slice(4);
|
|
13007
|
-
} else if (tag5 === "glibc" || tag5 === "musl") {
|
|
13008
|
-
tags2.libc = tag5;
|
|
13009
|
-
} else {
|
|
13010
|
-
continue;
|
|
13011
|
-
}
|
|
13012
|
-
tags2.specificity++;
|
|
13013
|
-
}
|
|
13014
|
-
return tags2;
|
|
13015
|
-
}
|
|
13016
|
-
function matchTags(runtime7, abi2) {
|
|
13017
|
-
return function(tags2) {
|
|
13018
|
-
if (tags2 == null)
|
|
13019
|
-
return false;
|
|
13020
|
-
if (tags2.runtime && tags2.runtime !== runtime7 && !runtimeAgnostic(tags2))
|
|
13021
|
-
return false;
|
|
13022
|
-
if (tags2.abi && tags2.abi !== abi2 && !tags2.napi)
|
|
13023
|
-
return false;
|
|
13024
|
-
if (tags2.uv && tags2.uv !== uv)
|
|
13025
|
-
return false;
|
|
13026
|
-
if (tags2.armv && tags2.armv !== armv)
|
|
13027
|
-
return false;
|
|
13028
|
-
if (tags2.libc && tags2.libc !== libc)
|
|
13029
|
-
return false;
|
|
13030
|
-
return true;
|
|
13031
|
-
};
|
|
13032
|
-
}
|
|
13033
|
-
function runtimeAgnostic(tags2) {
|
|
13034
|
-
return tags2.runtime === "node" && tags2.napi;
|
|
13035
|
-
}
|
|
13036
|
-
function compareTags(runtime7) {
|
|
13037
|
-
return function(a, b) {
|
|
13038
|
-
if (a.runtime !== b.runtime) {
|
|
13039
|
-
return a.runtime === runtime7 ? -1 : 1;
|
|
13040
|
-
} else if (a.abi !== b.abi) {
|
|
13041
|
-
return a.abi ? -1 : 1;
|
|
13042
|
-
} else if (a.specificity !== b.specificity) {
|
|
13043
|
-
return a.specificity > b.specificity ? -1 : 1;
|
|
13044
|
-
} else {
|
|
13045
|
-
return 0;
|
|
13046
|
-
}
|
|
13047
|
-
};
|
|
13048
|
-
}
|
|
13049
|
-
function isNwjs() {
|
|
13050
|
-
return !!(process.versions && process.versions.nw);
|
|
13051
|
-
}
|
|
13052
|
-
function isElectron() {
|
|
13053
|
-
if (process.versions && process.versions.electron)
|
|
13054
|
-
return true;
|
|
13055
|
-
if (process.env.ELECTRON_RUN_AS_NODE)
|
|
13056
|
-
return true;
|
|
13057
|
-
return typeof window !== "undefined" && window.process && window.process.type === "renderer";
|
|
13058
|
-
}
|
|
13059
|
-
function isAlpine(platform2) {
|
|
13060
|
-
return platform2 === "linux" && fs.existsSync("/etc/alpine-release");
|
|
13061
|
-
}
|
|
13062
|
-
load.parseTags = parseTags;
|
|
13063
|
-
load.matchTags = matchTags;
|
|
13064
|
-
load.compareTags = compareTags;
|
|
13065
|
-
load.parseTuple = parseTuple;
|
|
13066
|
-
load.matchTuple = matchTuple;
|
|
13067
|
-
load.compareTuples = compareTuples;
|
|
13068
|
-
});
|
|
13069
|
-
|
|
13070
|
-
// ../../node_modules/.bun/node-gyp-build@4.8.4/node_modules/node-gyp-build/index.js
|
|
13071
|
-
var require_node_gyp_build2 = __commonJS((exports, module) => {
|
|
13072
|
-
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
13073
|
-
if (typeof runtimeRequire.addon === "function") {
|
|
13074
|
-
module.exports = runtimeRequire.addon.bind(runtimeRequire);
|
|
13075
|
-
} else {
|
|
13076
|
-
module.exports = require_node_gyp_build();
|
|
13077
|
-
}
|
|
13078
|
-
});
|
|
13079
|
-
|
|
13080
|
-
// ../../node_modules/.bun/tree-sitter@0.25.0/node_modules/tree-sitter/index.js
|
|
13081
|
-
var require_tree_sitter = __commonJS((exports, module) => {
|
|
13082
|
-
var __dirname = "/Users/bismuth/projects/grepai/node_modules/.bun/tree-sitter@0.25.0/node_modules/tree-sitter";
|
|
13083
|
-
var binding = typeof process.versions.bun === "string" ? require_tree_sitter_runtime_binding() : require_node_gyp_build2()(__dirname);
|
|
13084
|
-
var { Query, Parser, NodeMethods, Tree, TreeCursor, LookaheadIterator } = binding;
|
|
13085
|
-
var util2 = __require("util");
|
|
13086
|
-
var { rootNode, rootNodeWithOffset, edit } = Tree.prototype;
|
|
13087
|
-
Object.defineProperty(Tree.prototype, "rootNode", {
|
|
13088
|
-
get() {
|
|
13089
|
-
if (this instanceof Tree && rootNode) {
|
|
13090
|
-
return unmarshalNode(rootNode.call(this), this);
|
|
13091
|
-
}
|
|
13092
|
-
},
|
|
13093
|
-
configurable: true
|
|
13094
|
-
});
|
|
13095
|
-
Tree.prototype.rootNodeWithOffset = function(offset_bytes, offset_extent) {
|
|
13096
|
-
return unmarshalNode(rootNodeWithOffset.call(this, offset_bytes, offset_extent.row, offset_extent.column), this);
|
|
13097
|
-
};
|
|
13098
|
-
Tree.prototype.edit = function(arg) {
|
|
13099
|
-
if (this instanceof Tree && edit) {
|
|
13100
|
-
edit.call(this, arg.startPosition.row, arg.startPosition.column, arg.oldEndPosition.row, arg.oldEndPosition.column, arg.newEndPosition.row, arg.newEndPosition.column, arg.startIndex, arg.oldEndIndex, arg.newEndIndex);
|
|
13101
|
-
}
|
|
13102
|
-
};
|
|
13103
|
-
Tree.prototype.walk = function() {
|
|
13104
|
-
return this.rootNode.walk();
|
|
13105
|
-
};
|
|
13106
|
-
|
|
13107
|
-
class SyntaxNode {
|
|
13108
|
-
constructor(tree) {
|
|
13109
|
-
this.tree = tree;
|
|
13110
|
-
}
|
|
13111
|
-
[util2.inspect.custom]() {
|
|
13112
|
-
return this.constructor.name + ` {
|
|
13113
|
-
` + " type: " + this.type + `,
|
|
13114
|
-
` + " startPosition: " + pointToString(this.startPosition) + `,
|
|
13115
|
-
` + " endPosition: " + pointToString(this.endPosition) + `,
|
|
13116
|
-
` + " childCount: " + this.childCount + `,
|
|
13117
|
-
` + "}";
|
|
13118
|
-
}
|
|
13119
|
-
get id() {
|
|
13120
|
-
marshalNode(this);
|
|
13121
|
-
return NodeMethods.id(this.tree);
|
|
13122
|
-
}
|
|
13123
|
-
get typeId() {
|
|
13124
|
-
marshalNode(this);
|
|
13125
|
-
return NodeMethods.typeId(this.tree);
|
|
13126
|
-
}
|
|
13127
|
-
get grammarId() {
|
|
13128
|
-
marshalNode(this);
|
|
13129
|
-
return NodeMethods.grammarId(this.tree);
|
|
13130
|
-
}
|
|
13131
|
-
get type() {
|
|
13132
|
-
marshalNode(this);
|
|
13133
|
-
return NodeMethods.type(this.tree);
|
|
13134
|
-
}
|
|
13135
|
-
get grammarType() {
|
|
13136
|
-
marshalNode(this);
|
|
13137
|
-
return NodeMethods.grammarType(this.tree);
|
|
13138
|
-
}
|
|
13139
|
-
get isExtra() {
|
|
13140
|
-
marshalNode(this);
|
|
13141
|
-
return NodeMethods.isExtra(this.tree);
|
|
13142
|
-
}
|
|
13143
|
-
get isNamed() {
|
|
13144
|
-
marshalNode(this);
|
|
13145
|
-
return NodeMethods.isNamed(this.tree);
|
|
13146
|
-
}
|
|
13147
|
-
get isMissing() {
|
|
13148
|
-
marshalNode(this);
|
|
13149
|
-
return NodeMethods.isMissing(this.tree);
|
|
13150
|
-
}
|
|
13151
|
-
get hasChanges() {
|
|
13152
|
-
marshalNode(this);
|
|
13153
|
-
return NodeMethods.hasChanges(this.tree);
|
|
13154
|
-
}
|
|
13155
|
-
get hasError() {
|
|
13156
|
-
marshalNode(this);
|
|
13157
|
-
return NodeMethods.hasError(this.tree);
|
|
13158
|
-
}
|
|
13159
|
-
get isError() {
|
|
13160
|
-
marshalNode(this);
|
|
13161
|
-
return NodeMethods.isError(this.tree);
|
|
13162
|
-
}
|
|
13163
|
-
get text() {
|
|
13164
|
-
return this.tree.getText(this);
|
|
13165
|
-
}
|
|
13166
|
-
get startPosition() {
|
|
13167
|
-
marshalNode(this);
|
|
13168
|
-
NodeMethods.startPosition(this.tree);
|
|
13169
|
-
return unmarshalPoint();
|
|
13170
|
-
}
|
|
13171
|
-
get endPosition() {
|
|
13172
|
-
marshalNode(this);
|
|
13173
|
-
NodeMethods.endPosition(this.tree);
|
|
13174
|
-
return unmarshalPoint();
|
|
13175
|
-
}
|
|
13176
|
-
get startIndex() {
|
|
13177
|
-
marshalNode(this);
|
|
13178
|
-
return NodeMethods.startIndex(this.tree);
|
|
13179
|
-
}
|
|
13180
|
-
get endIndex() {
|
|
13181
|
-
marshalNode(this);
|
|
13182
|
-
return NodeMethods.endIndex(this.tree);
|
|
13183
|
-
}
|
|
13184
|
-
get parent() {
|
|
13185
|
-
marshalNode(this);
|
|
13186
|
-
return unmarshalNode(NodeMethods.parent(this.tree), this.tree);
|
|
13187
|
-
}
|
|
13188
|
-
get children() {
|
|
13189
|
-
marshalNode(this);
|
|
13190
|
-
return unmarshalNodes(NodeMethods.children(this.tree), this.tree);
|
|
13191
|
-
}
|
|
13192
|
-
get namedChildren() {
|
|
13193
|
-
marshalNode(this);
|
|
13194
|
-
return unmarshalNodes(NodeMethods.namedChildren(this.tree), this.tree);
|
|
13195
|
-
}
|
|
13196
|
-
get childCount() {
|
|
13197
|
-
marshalNode(this);
|
|
13198
|
-
return NodeMethods.childCount(this.tree);
|
|
13199
|
-
}
|
|
13200
|
-
get namedChildCount() {
|
|
13201
|
-
marshalNode(this);
|
|
13202
|
-
return NodeMethods.namedChildCount(this.tree);
|
|
13203
|
-
}
|
|
13204
|
-
get firstChild() {
|
|
13205
|
-
marshalNode(this);
|
|
13206
|
-
return unmarshalNode(NodeMethods.firstChild(this.tree), this.tree);
|
|
13207
|
-
}
|
|
13208
|
-
get firstNamedChild() {
|
|
13209
|
-
marshalNode(this);
|
|
13210
|
-
return unmarshalNode(NodeMethods.firstNamedChild(this.tree), this.tree);
|
|
13211
|
-
}
|
|
13212
|
-
get lastChild() {
|
|
13213
|
-
marshalNode(this);
|
|
13214
|
-
return unmarshalNode(NodeMethods.lastChild(this.tree), this.tree);
|
|
13215
|
-
}
|
|
13216
|
-
get lastNamedChild() {
|
|
13217
|
-
marshalNode(this);
|
|
13218
|
-
return unmarshalNode(NodeMethods.lastNamedChild(this.tree), this.tree);
|
|
13219
|
-
}
|
|
13220
|
-
get nextSibling() {
|
|
13221
|
-
marshalNode(this);
|
|
13222
|
-
return unmarshalNode(NodeMethods.nextSibling(this.tree), this.tree);
|
|
13223
|
-
}
|
|
13224
|
-
get nextNamedSibling() {
|
|
13225
|
-
marshalNode(this);
|
|
13226
|
-
return unmarshalNode(NodeMethods.nextNamedSibling(this.tree), this.tree);
|
|
13227
|
-
}
|
|
13228
|
-
get previousSibling() {
|
|
13229
|
-
marshalNode(this);
|
|
13230
|
-
return unmarshalNode(NodeMethods.previousSibling(this.tree), this.tree);
|
|
13231
|
-
}
|
|
13232
|
-
get previousNamedSibling() {
|
|
13233
|
-
marshalNode(this);
|
|
13234
|
-
return unmarshalNode(NodeMethods.previousNamedSibling(this.tree), this.tree);
|
|
13235
|
-
}
|
|
13236
|
-
get parseState() {
|
|
13237
|
-
marshalNode(this);
|
|
13238
|
-
return NodeMethods.parseState(this.tree);
|
|
13239
|
-
}
|
|
13240
|
-
get nextParseState() {
|
|
13241
|
-
marshalNode(this);
|
|
13242
|
-
return NodeMethods.nextParseState(this.tree);
|
|
13243
|
-
}
|
|
13244
|
-
get descendantCount() {
|
|
13245
|
-
marshalNode(this);
|
|
13246
|
-
return NodeMethods.descendantCount(this.tree);
|
|
13247
|
-
}
|
|
13248
|
-
toString() {
|
|
13249
|
-
marshalNode(this);
|
|
13250
|
-
return NodeMethods.toString(this.tree);
|
|
13251
|
-
}
|
|
13252
|
-
child(index) {
|
|
13253
|
-
marshalNode(this);
|
|
13254
|
-
return unmarshalNode(NodeMethods.child(this.tree, index), this.tree);
|
|
13255
|
-
}
|
|
13256
|
-
namedChild(index) {
|
|
13257
|
-
marshalNode(this);
|
|
13258
|
-
return unmarshalNode(NodeMethods.namedChild(this.tree, index), this.tree);
|
|
13259
|
-
}
|
|
13260
|
-
childForFieldName(fieldName) {
|
|
13261
|
-
marshalNode(this);
|
|
13262
|
-
return unmarshalNode(NodeMethods.childForFieldName(this.tree, fieldName), this.tree);
|
|
13263
|
-
}
|
|
13264
|
-
childForFieldId(fieldId) {
|
|
13265
|
-
marshalNode(this);
|
|
13266
|
-
return unmarshalNode(NodeMethods.childForFieldId(this.tree, fieldId), this.tree);
|
|
13267
|
-
}
|
|
13268
|
-
fieldNameForChild(childIndex) {
|
|
13269
|
-
marshalNode(this);
|
|
13270
|
-
return NodeMethods.fieldNameForChild(this.tree, childIndex);
|
|
13271
|
-
}
|
|
13272
|
-
fieldNameForNamedChild(namedChildIndex) {
|
|
13273
|
-
marshalNode(this);
|
|
13274
|
-
return NodeMethods.fieldNameForNamedChild(this.tree, namedChildIndex);
|
|
13275
|
-
}
|
|
13276
|
-
childrenForFieldName(fieldName) {
|
|
13277
|
-
marshalNode(this);
|
|
13278
|
-
return unmarshalNodes(NodeMethods.childrenForFieldName(this.tree, fieldName), this.tree);
|
|
13279
|
-
}
|
|
13280
|
-
childrenForFieldId(fieldId) {
|
|
13281
|
-
marshalNode(this);
|
|
13282
|
-
return unmarshalNodes(NodeMethods.childrenForFieldId(this.tree, fieldId), this.tree);
|
|
13283
|
-
}
|
|
13284
|
-
firstChildForIndex(index) {
|
|
13285
|
-
marshalNode(this);
|
|
13286
|
-
return unmarshalNode(NodeMethods.firstChildForIndex(this.tree, index), this.tree);
|
|
13287
|
-
}
|
|
13288
|
-
firstNamedChildForIndex(index) {
|
|
13289
|
-
marshalNode(this);
|
|
13290
|
-
return unmarshalNode(NodeMethods.firstNamedChildForIndex(this.tree, index), this.tree);
|
|
13291
|
-
}
|
|
13292
|
-
childWithDescendant(descendant) {
|
|
13293
|
-
marshalNodes([this, descendant]);
|
|
13294
|
-
return unmarshalNode(NodeMethods.childWithDescendant(this.tree, descendant.tree), this.tree);
|
|
13295
|
-
}
|
|
13296
|
-
namedDescendantForIndex(start4, end5) {
|
|
13297
|
-
marshalNode(this);
|
|
13298
|
-
if (end5 == null)
|
|
13299
|
-
end5 = start4;
|
|
13300
|
-
return unmarshalNode(NodeMethods.namedDescendantForIndex(this.tree, start4, end5), this.tree);
|
|
13301
|
-
}
|
|
13302
|
-
descendantForIndex(start4, end5) {
|
|
13303
|
-
marshalNode(this);
|
|
13304
|
-
if (end5 == null)
|
|
13305
|
-
end5 = start4;
|
|
13306
|
-
return unmarshalNode(NodeMethods.descendantForIndex(this.tree, start4, end5), this.tree);
|
|
13307
|
-
}
|
|
13308
|
-
descendantsOfType(types, start4, end5) {
|
|
13309
|
-
marshalNode(this);
|
|
13310
|
-
if (typeof types === "string")
|
|
13311
|
-
types = [types];
|
|
13312
|
-
return unmarshalNodes(NodeMethods.descendantsOfType(this.tree, types, start4, end5), this.tree);
|
|
13313
|
-
}
|
|
13314
|
-
namedDescendantForPosition(start4, end5) {
|
|
13315
|
-
marshalNode(this);
|
|
13316
|
-
if (end5 == null)
|
|
13317
|
-
end5 = start4;
|
|
13318
|
-
return unmarshalNode(NodeMethods.namedDescendantForPosition(this.tree, start4, end5), this.tree);
|
|
13319
|
-
}
|
|
13320
|
-
descendantForPosition(start4, end5) {
|
|
13321
|
-
marshalNode(this);
|
|
13322
|
-
if (end5 == null)
|
|
13323
|
-
end5 = start4;
|
|
13324
|
-
return unmarshalNode(NodeMethods.descendantForPosition(this.tree, start4, end5), this.tree);
|
|
13325
|
-
}
|
|
13326
|
-
closest(types) {
|
|
13327
|
-
marshalNode(this);
|
|
13328
|
-
if (typeof types === "string")
|
|
13329
|
-
types = [types];
|
|
13330
|
-
return unmarshalNode(NodeMethods.closest(this.tree, types), this.tree);
|
|
13331
|
-
}
|
|
13332
|
-
walk() {
|
|
13333
|
-
marshalNode(this);
|
|
13334
|
-
const cursor = NodeMethods.walk(this.tree);
|
|
13335
|
-
cursor.tree = this.tree;
|
|
13336
|
-
unmarshalNode(cursor.currentNode, this.tree);
|
|
13337
|
-
return cursor;
|
|
13338
|
-
}
|
|
13339
|
-
}
|
|
13340
|
-
var { parse: parse12, setLanguage } = Parser.prototype;
|
|
13341
|
-
var languageSymbol = Symbol("parser.language");
|
|
13342
|
-
Parser.prototype.setLanguage = function(language2) {
|
|
13343
|
-
if (this instanceof Parser && setLanguage) {
|
|
13344
|
-
setLanguage.call(this, language2);
|
|
13345
|
-
}
|
|
13346
|
-
this[languageSymbol] = language2;
|
|
13347
|
-
if (!language2.nodeSubclasses) {
|
|
13348
|
-
initializeLanguageNodeClasses(language2);
|
|
13349
|
-
}
|
|
13350
|
-
return this;
|
|
13351
|
-
};
|
|
13352
|
-
Parser.prototype.getLanguage = function(_language) {
|
|
13353
|
-
return this[languageSymbol] || null;
|
|
13354
|
-
};
|
|
13355
|
-
Parser.prototype.parse = function(input, oldTree, { bufferSize, includedRanges } = {}) {
|
|
13356
|
-
let getText2, treeInput = input;
|
|
13357
|
-
if (typeof input === "string") {
|
|
13358
|
-
const inputString = input;
|
|
13359
|
-
input = (offset, _position) => inputString.slice(offset);
|
|
13360
|
-
getText2 = getTextFromString;
|
|
13361
|
-
} else {
|
|
13362
|
-
getText2 = getTextFromFunction;
|
|
13363
|
-
}
|
|
13364
|
-
const tree = this instanceof Parser && parse12 ? parse12.call(this, input, oldTree, bufferSize, includedRanges) : undefined;
|
|
13365
|
-
if (tree) {
|
|
13366
|
-
tree.input = treeInput;
|
|
13367
|
-
tree.getText = getText2;
|
|
13368
|
-
tree.language = this.getLanguage();
|
|
13369
|
-
}
|
|
13370
|
-
return tree;
|
|
13371
|
-
};
|
|
13372
|
-
var { startPosition, endPosition, currentNode } = TreeCursor.prototype;
|
|
13373
|
-
Object.defineProperties(TreeCursor.prototype, {
|
|
13374
|
-
currentNode: {
|
|
13375
|
-
get() {
|
|
13376
|
-
if (this instanceof TreeCursor && currentNode) {
|
|
13377
|
-
return unmarshalNode(currentNode.call(this), this.tree);
|
|
13378
|
-
}
|
|
13379
|
-
},
|
|
13380
|
-
configurable: true
|
|
13381
|
-
},
|
|
13382
|
-
startPosition: {
|
|
13383
|
-
get() {
|
|
13384
|
-
if (this instanceof TreeCursor && startPosition) {
|
|
13385
|
-
startPosition.call(this);
|
|
13386
|
-
return unmarshalPoint();
|
|
13387
|
-
}
|
|
13388
|
-
},
|
|
13389
|
-
configurable: true
|
|
13390
|
-
},
|
|
13391
|
-
endPosition: {
|
|
13392
|
-
get() {
|
|
13393
|
-
if (this instanceof TreeCursor && endPosition) {
|
|
13394
|
-
endPosition.call(this);
|
|
13395
|
-
return unmarshalPoint();
|
|
13396
|
-
}
|
|
13397
|
-
},
|
|
13398
|
-
configurable: true
|
|
13399
|
-
},
|
|
13400
|
-
nodeText: {
|
|
13401
|
-
get() {
|
|
13402
|
-
return this.tree.getText(this);
|
|
13403
|
-
},
|
|
13404
|
-
configurable: true
|
|
13405
|
-
}
|
|
13406
|
-
});
|
|
13407
|
-
var { _matches, _captures } = Query.prototype;
|
|
13408
|
-
var PREDICATE_STEP_TYPE = {
|
|
13409
|
-
DONE: 0,
|
|
13410
|
-
CAPTURE: 1,
|
|
13411
|
-
STRING: 2
|
|
13412
|
-
};
|
|
13413
|
-
var ZERO_POINT = { row: 0, column: 0 };
|
|
13414
|
-
Query.prototype._init = function() {
|
|
13415
|
-
const predicateDescriptions = this._getPredicates();
|
|
13416
|
-
const patternCount = predicateDescriptions.length;
|
|
13417
|
-
const setProperties = new Array(patternCount);
|
|
13418
|
-
const assertedProperties = new Array(patternCount);
|
|
13419
|
-
const refutedProperties = new Array(patternCount);
|
|
13420
|
-
const predicates = new Array(patternCount);
|
|
13421
|
-
const FIRST = 0;
|
|
13422
|
-
const SECOND = 2;
|
|
13423
|
-
const THIRD = 4;
|
|
13424
|
-
for (let i = 0;i < predicateDescriptions.length; i++) {
|
|
13425
|
-
predicates[i] = [];
|
|
13426
|
-
for (let j = 0;j < predicateDescriptions[i].length; j++) {
|
|
13427
|
-
const steps = predicateDescriptions[i][j];
|
|
13428
|
-
const stepsLength = steps.length / 2;
|
|
13429
|
-
if (steps[FIRST] !== PREDICATE_STEP_TYPE.STRING) {
|
|
13430
|
-
throw new Error("Predicates must begin with a literal value");
|
|
13431
|
-
}
|
|
13432
|
-
const operator = steps[FIRST + 1];
|
|
13433
|
-
let isPositive = true;
|
|
13434
|
-
let matchAll = true;
|
|
13435
|
-
let captureName;
|
|
13436
|
-
switch (operator) {
|
|
13437
|
-
case "any-not-eq?":
|
|
13438
|
-
case "not-eq?":
|
|
13439
|
-
isPositive = false;
|
|
13440
|
-
case "any-eq?":
|
|
13441
|
-
case "eq?":
|
|
13442
|
-
if (stepsLength !== 3)
|
|
13443
|
-
throw new Error(`Wrong number of arguments to \`#eq?\` predicate. Expected 2, got ${stepsLength - 1}`);
|
|
13444
|
-
if (steps[SECOND] !== PREDICATE_STEP_TYPE.CAPTURE)
|
|
13445
|
-
throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${steps[SECOND + 1]}"`);
|
|
13446
|
-
matchAll = !operator.startsWith("any-");
|
|
13447
|
-
if (steps[THIRD] === PREDICATE_STEP_TYPE.CAPTURE) {
|
|
13448
|
-
const captureName1 = steps[SECOND + 1];
|
|
13449
|
-
const captureName2 = steps[THIRD + 1];
|
|
13450
|
-
predicates[i].push(function(captures) {
|
|
13451
|
-
let nodes_1 = [];
|
|
13452
|
-
let nodes_2 = [];
|
|
13453
|
-
for (const c of captures) {
|
|
13454
|
-
if (c.name === captureName1)
|
|
13455
|
-
nodes_1.push(c.node);
|
|
13456
|
-
if (c.name === captureName2)
|
|
13457
|
-
nodes_2.push(c.node);
|
|
13458
|
-
}
|
|
13459
|
-
let compare2 = (n1, n2, positive) => {
|
|
13460
|
-
return positive ? n1.text === n2.text : n1.text !== n2.text;
|
|
13461
|
-
};
|
|
13462
|
-
return matchAll ? nodes_1.every((n1) => nodes_2.some((n2) => compare2(n1, n2, isPositive))) : nodes_1.some((n1) => nodes_2.some((n2) => compare2(n1, n2, isPositive)));
|
|
13463
|
-
});
|
|
13464
|
-
} else {
|
|
13465
|
-
captureName = steps[SECOND + 1];
|
|
13466
|
-
const stringValue = steps[THIRD + 1];
|
|
13467
|
-
let matches = (n2) => n2.text === stringValue;
|
|
13468
|
-
let doesNotMatch = (n2) => n2.text !== stringValue;
|
|
13469
|
-
predicates[i].push(function(captures) {
|
|
13470
|
-
let nodes = [];
|
|
13471
|
-
for (const c of captures) {
|
|
13472
|
-
if (c.name === captureName)
|
|
13473
|
-
nodes.push(c.node);
|
|
13474
|
-
}
|
|
13475
|
-
let test = isPositive ? matches : doesNotMatch;
|
|
13476
|
-
return matchAll ? nodes.every(test) : nodes.some(test);
|
|
13477
|
-
});
|
|
13478
|
-
}
|
|
13479
|
-
break;
|
|
13480
|
-
case "any-not-match?":
|
|
13481
|
-
case "not-match?":
|
|
13482
|
-
isPositive = false;
|
|
13483
|
-
case "any-match?":
|
|
13484
|
-
case "match?":
|
|
13485
|
-
if (stepsLength !== 3)
|
|
13486
|
-
throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${stepsLength - 1}.`);
|
|
13487
|
-
if (steps[SECOND] !== PREDICATE_STEP_TYPE.CAPTURE)
|
|
13488
|
-
throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${steps[SECOND + 1]}".`);
|
|
13489
|
-
if (steps[THIRD] !== PREDICATE_STEP_TYPE.STRING)
|
|
13490
|
-
throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${steps[THIRD + 1]}.`);
|
|
13491
|
-
captureName = steps[SECOND + 1];
|
|
13492
|
-
const regex = new RegExp(steps[THIRD + 1]);
|
|
13493
|
-
matchAll = !operator.startsWith("any-");
|
|
13494
|
-
predicates[i].push(function(captures) {
|
|
13495
|
-
const nodes = [];
|
|
13496
|
-
for (const c of captures) {
|
|
13497
|
-
if (c.name === captureName)
|
|
13498
|
-
nodes.push(c.node.text);
|
|
13499
|
-
}
|
|
13500
|
-
let test = (text13, positive) => {
|
|
13501
|
-
return positive ? regex.test(text13) : !regex.test(text13);
|
|
13502
|
-
};
|
|
13503
|
-
if (nodes.length === 0)
|
|
13504
|
-
return !isPositive;
|
|
13505
|
-
return matchAll ? nodes.every((text13) => test(text13, isPositive)) : nodes.some((text13) => test(text13, isPositive));
|
|
13506
|
-
});
|
|
13507
|
-
break;
|
|
13508
|
-
case "set!":
|
|
13509
|
-
if (stepsLength < 2 || stepsLength > 3)
|
|
13510
|
-
throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${stepsLength - 1}.`);
|
|
13511
|
-
if (steps.some((s, i2) => i2 % 2 !== 1 && s !== PREDICATE_STEP_TYPE.STRING))
|
|
13512
|
-
throw new Error(`Arguments to \`#set!\` predicate must be a strings.".`);
|
|
13513
|
-
if (!setProperties[i])
|
|
13514
|
-
setProperties[i] = {};
|
|
13515
|
-
setProperties[i][steps[SECOND + 1]] = steps[THIRD] ? steps[THIRD + 1] : null;
|
|
13516
|
-
break;
|
|
13517
|
-
case "is?":
|
|
13518
|
-
case "is-not?":
|
|
13519
|
-
if (stepsLength < 2 || stepsLength > 3)
|
|
13520
|
-
throw new Error(`Wrong number of arguments to \`#${operator}\` predicate. Expected 1 or 2. Got ${stepsLength - 1}.`);
|
|
13521
|
-
if (steps.some((s, i2) => i2 % 2 !== 1 && s !== PREDICATE_STEP_TYPE.STRING))
|
|
13522
|
-
throw new Error(`Arguments to \`#${operator}\` predicate must be a strings.".`);
|
|
13523
|
-
const properties = operator === "is?" ? assertedProperties : refutedProperties;
|
|
13524
|
-
if (!properties[i])
|
|
13525
|
-
properties[i] = {};
|
|
13526
|
-
properties[i][steps[SECOND + 1]] = steps[THIRD] ? steps[THIRD + 1] : null;
|
|
13527
|
-
break;
|
|
13528
|
-
case "not-any-of?":
|
|
13529
|
-
isPositive = false;
|
|
13530
|
-
case "any-of?":
|
|
13531
|
-
if (stepsLength < 2)
|
|
13532
|
-
throw new Error(`Wrong number of arguments to \`#${operator}\` predicate. Expected at least 1. Got ${stepsLength - 1}.`);
|
|
13533
|
-
if (steps[SECOND] !== PREDICATE_STEP_TYPE.CAPTURE)
|
|
13534
|
-
throw new Error(`First argument of \`#${operator}\` predicate must be a capture. Got "${steps[1].value}".`);
|
|
13535
|
-
const stringValues = [];
|
|
13536
|
-
for (let k = THIRD;k < 2 * stepsLength; k += 2) {
|
|
13537
|
-
if (steps[k] !== PREDICATE_STEP_TYPE.STRING)
|
|
13538
|
-
throw new Error(`Arguments to \`#${operator}\` predicate must be a strings.".`);
|
|
13539
|
-
stringValues.push(steps[k + 1]);
|
|
13540
|
-
}
|
|
13541
|
-
captureName = steps[SECOND + 1];
|
|
13542
|
-
predicates[i].push(function(captures) {
|
|
13543
|
-
const nodes = [];
|
|
13544
|
-
for (const c of captures) {
|
|
13545
|
-
if (c.name === captureName)
|
|
13546
|
-
nodes.push(c.node.text);
|
|
13547
|
-
}
|
|
13548
|
-
if (nodes.length === 0)
|
|
13549
|
-
return !isPositive;
|
|
13550
|
-
return nodes.every((text13) => stringValues.includes(text13)) === isPositive;
|
|
13551
|
-
});
|
|
13552
|
-
break;
|
|
13553
|
-
default:
|
|
13554
|
-
throw new Error(`Unknown query predicate \`#${steps[FIRST + 1]}\``);
|
|
13555
|
-
}
|
|
13556
|
-
}
|
|
13557
|
-
}
|
|
13558
|
-
this.predicates = Object.freeze(predicates);
|
|
13559
|
-
this.setProperties = Object.freeze(setProperties);
|
|
13560
|
-
this.assertedProperties = Object.freeze(assertedProperties);
|
|
13561
|
-
this.refutedProperties = Object.freeze(refutedProperties);
|
|
13562
|
-
};
|
|
13563
|
-
Query.prototype.matches = function(node, {
|
|
13564
|
-
startPosition: startPosition2 = ZERO_POINT,
|
|
13565
|
-
endPosition: endPosition2 = ZERO_POINT,
|
|
13566
|
-
startIndex = 0,
|
|
13567
|
-
endIndex = 0,
|
|
13568
|
-
matchLimit = 4294967295,
|
|
13569
|
-
maxStartDepth = 4294967295,
|
|
13570
|
-
timeoutMicros = 0
|
|
13571
|
-
} = {}) {
|
|
13572
|
-
marshalNode(node);
|
|
13573
|
-
const [returnedMatches, returnedNodes] = _matches.call(this, node.tree, startPosition2.row, startPosition2.column, endPosition2.row, endPosition2.column, startIndex, endIndex, matchLimit, maxStartDepth, timeoutMicros);
|
|
13574
|
-
const nodes = unmarshalNodes(returnedNodes, node.tree);
|
|
13575
|
-
const results = [];
|
|
13576
|
-
let i = 0;
|
|
13577
|
-
let nodeIndex = 0;
|
|
13578
|
-
while (i < returnedMatches.length) {
|
|
13579
|
-
const patternIndex = returnedMatches[i++];
|
|
13580
|
-
const captures = [];
|
|
13581
|
-
while (i < returnedMatches.length && typeof returnedMatches[i] === "string") {
|
|
13582
|
-
const captureName = returnedMatches[i++];
|
|
13583
|
-
captures.push({
|
|
13584
|
-
name: captureName,
|
|
13585
|
-
node: nodes[nodeIndex++]
|
|
13586
|
-
});
|
|
13587
|
-
}
|
|
13588
|
-
if (this.predicates[patternIndex].every((p3) => p3(captures))) {
|
|
13589
|
-
const result = { pattern: patternIndex, captures };
|
|
13590
|
-
const setProperties = this.setProperties[patternIndex];
|
|
13591
|
-
const assertedProperties = this.assertedProperties[patternIndex];
|
|
13592
|
-
const refutedProperties = this.refutedProperties[patternIndex];
|
|
13593
|
-
if (setProperties)
|
|
13594
|
-
result.setProperties = setProperties;
|
|
13595
|
-
if (assertedProperties)
|
|
13596
|
-
result.assertedProperties = assertedProperties;
|
|
13597
|
-
if (refutedProperties)
|
|
13598
|
-
result.refutedProperties = refutedProperties;
|
|
13599
|
-
results.push(result);
|
|
13600
|
-
}
|
|
13601
|
-
}
|
|
13602
|
-
return results;
|
|
13603
|
-
};
|
|
13604
|
-
Query.prototype.captures = function(node, {
|
|
13605
|
-
startPosition: startPosition2 = ZERO_POINT,
|
|
13606
|
-
endPosition: endPosition2 = ZERO_POINT,
|
|
13607
|
-
startIndex = 0,
|
|
13608
|
-
endIndex = 0,
|
|
13609
|
-
matchLimit = 4294967295,
|
|
13610
|
-
maxStartDepth = 4294967295,
|
|
13611
|
-
timeoutMicros = 0
|
|
13612
|
-
} = {}) {
|
|
13613
|
-
marshalNode(node);
|
|
13614
|
-
const [returnedMatches, returnedNodes] = _captures.call(this, node.tree, startPosition2.row, startPosition2.column, endPosition2.row, endPosition2.column, startIndex, endIndex, matchLimit, maxStartDepth, timeoutMicros);
|
|
13615
|
-
const nodes = unmarshalNodes(returnedNodes, node.tree);
|
|
13616
|
-
const results = [];
|
|
13617
|
-
let i = 0;
|
|
13618
|
-
let nodeIndex = 0;
|
|
13619
|
-
while (i < returnedMatches.length) {
|
|
13620
|
-
const patternIndex = returnedMatches[i++];
|
|
13621
|
-
const captureIndex = returnedMatches[i++];
|
|
13622
|
-
const captures = [];
|
|
13623
|
-
while (i < returnedMatches.length && typeof returnedMatches[i] === "string") {
|
|
13624
|
-
const captureName = returnedMatches[i++];
|
|
13625
|
-
captures.push({
|
|
13626
|
-
name: captureName,
|
|
13627
|
-
node: nodes[nodeIndex++]
|
|
13628
|
-
});
|
|
13629
|
-
}
|
|
13630
|
-
if (this.predicates[patternIndex].every((p3) => p3(captures))) {
|
|
13631
|
-
const result = captures[captureIndex];
|
|
13632
|
-
const setProperties = this.setProperties[patternIndex];
|
|
13633
|
-
const assertedProperties = this.assertedProperties[patternIndex];
|
|
13634
|
-
const refutedProperties = this.refutedProperties[patternIndex];
|
|
13635
|
-
if (setProperties)
|
|
13636
|
-
result.setProperties = setProperties;
|
|
13637
|
-
if (assertedProperties)
|
|
13638
|
-
result.assertedProperties = assertedProperties;
|
|
13639
|
-
if (refutedProperties)
|
|
13640
|
-
result.refutedProperties = refutedProperties;
|
|
13641
|
-
results.push(result);
|
|
13642
|
-
}
|
|
13643
|
-
}
|
|
13644
|
-
return results;
|
|
13645
|
-
};
|
|
13646
|
-
LookaheadIterator.prototype[Symbol.iterator] = function() {
|
|
13647
|
-
const self2 = this;
|
|
13648
|
-
return {
|
|
13649
|
-
next() {
|
|
13650
|
-
if (self2._next()) {
|
|
13651
|
-
return { done: false, value: self2.currentType };
|
|
13652
|
-
}
|
|
13653
|
-
return { done: true, value: "" };
|
|
13654
|
-
}
|
|
13655
|
-
};
|
|
13656
|
-
};
|
|
13657
|
-
function getTextFromString(node) {
|
|
13658
|
-
return this.input.substring(node.startIndex, node.endIndex);
|
|
13659
|
-
}
|
|
13660
|
-
function getTextFromFunction({ startIndex, endIndex }) {
|
|
13661
|
-
const { input } = this;
|
|
13662
|
-
let result = "";
|
|
13663
|
-
const goalLength = endIndex - startIndex;
|
|
13664
|
-
while (result.length < goalLength) {
|
|
13665
|
-
const text13 = input(startIndex + result.length);
|
|
13666
|
-
result += text13;
|
|
13667
|
-
}
|
|
13668
|
-
return result.slice(0, goalLength);
|
|
13669
|
-
}
|
|
13670
|
-
var { pointTransferArray } = binding;
|
|
13671
|
-
var NODE_FIELD_COUNT = 6;
|
|
13672
|
-
var ERROR_TYPE_ID = 65535;
|
|
13673
|
-
function getID(buffer3, offset) {
|
|
13674
|
-
const low = BigInt(buffer3[offset]);
|
|
13675
|
-
const high = BigInt(buffer3[offset + 1]);
|
|
13676
|
-
return (high << 32n) + low;
|
|
13677
|
-
}
|
|
13678
|
-
function unmarshalNode(value6, tree, offset = 0, cache = null) {
|
|
13679
|
-
if (typeof value6 === "object") {
|
|
13680
|
-
const node = value6;
|
|
13681
|
-
return node;
|
|
13682
|
-
}
|
|
13683
|
-
const nodeTypeId = value6;
|
|
13684
|
-
const NodeClass = nodeTypeId === ERROR_TYPE_ID ? SyntaxNode : tree.language.nodeSubclasses[nodeTypeId];
|
|
13685
|
-
const { nodeTransferArray } = binding;
|
|
13686
|
-
const id3 = getID(nodeTransferArray, offset);
|
|
13687
|
-
if (id3 === 0n) {
|
|
13688
|
-
return null;
|
|
13689
|
-
}
|
|
13690
|
-
let cachedResult;
|
|
13691
|
-
if (cache && (cachedResult = cache.get(id3)))
|
|
13692
|
-
return cachedResult;
|
|
13693
|
-
const result = new NodeClass(tree);
|
|
13694
|
-
for (let i = 0;i < NODE_FIELD_COUNT; i++) {
|
|
13695
|
-
result[i] = nodeTransferArray[offset + i];
|
|
13696
|
-
}
|
|
13697
|
-
if (cache)
|
|
13698
|
-
cache.set(id3, result);
|
|
13699
|
-
else
|
|
13700
|
-
tree._cacheNode(result);
|
|
13701
|
-
return result;
|
|
13702
|
-
}
|
|
13703
|
-
function unmarshalNodes(nodes, tree) {
|
|
13704
|
-
const cache = new Map;
|
|
13705
|
-
let offset = 0;
|
|
13706
|
-
for (let i = 0, { length: length3 } = nodes;i < length3; i++) {
|
|
13707
|
-
const node = unmarshalNode(nodes[i], tree, offset, cache);
|
|
13708
|
-
if (node !== nodes[i]) {
|
|
13709
|
-
nodes[i] = node;
|
|
13710
|
-
offset += NODE_FIELD_COUNT;
|
|
13711
|
-
}
|
|
13712
|
-
}
|
|
13713
|
-
tree._cacheNodes(Array.from(cache.values()));
|
|
13714
|
-
return nodes;
|
|
13715
|
-
}
|
|
13716
|
-
function marshalNode(node, offset = 0) {
|
|
13717
|
-
if (!(node.tree instanceof Tree)) {
|
|
13718
|
-
throw new TypeError("SyntaxNode must belong to a Tree");
|
|
13719
|
-
}
|
|
13720
|
-
const { nodeTransferArray } = binding;
|
|
13721
|
-
for (let i = 0;i < NODE_FIELD_COUNT; i++) {
|
|
13722
|
-
nodeTransferArray[offset * NODE_FIELD_COUNT + i] = node[i];
|
|
13723
|
-
}
|
|
13724
|
-
}
|
|
13725
|
-
function marshalNodes(nodes) {
|
|
13726
|
-
for (let i = 0, { length: length3 } = nodes;i < length3; i++) {
|
|
13727
|
-
marshalNode(nodes[i], i);
|
|
13728
|
-
}
|
|
13729
|
-
}
|
|
13730
|
-
function unmarshalPoint() {
|
|
13731
|
-
return { row: pointTransferArray[0], column: pointTransferArray[1] };
|
|
13732
|
-
}
|
|
13733
|
-
function pointToString(point) {
|
|
13734
|
-
return `{row: ${point.row}, column: ${point.column}}`;
|
|
13735
|
-
}
|
|
13736
|
-
function initializeLanguageNodeClasses(language) {
|
|
13737
|
-
const nodeTypeNamesById = binding.getNodeTypeNamesById(language);
|
|
13738
|
-
const nodeFieldNamesById = binding.getNodeFieldNamesById(language);
|
|
13739
|
-
const nodeTypeInfo = language.nodeTypeInfo || [];
|
|
13740
|
-
const nodeSubclasses = [];
|
|
13741
|
-
for (let id = 0, n = nodeTypeNamesById.length;id < n; id++) {
|
|
13742
|
-
nodeSubclasses[id] = SyntaxNode;
|
|
13743
|
-
const typeName = nodeTypeNamesById[id];
|
|
13744
|
-
if (!typeName)
|
|
13745
|
-
continue;
|
|
13746
|
-
const typeInfo = nodeTypeInfo.find((info2) => info2.named && info2.type === typeName);
|
|
13747
|
-
if (!typeInfo)
|
|
13748
|
-
continue;
|
|
13749
|
-
const fieldNames = [];
|
|
13750
|
-
let classBody = `
|
|
13751
|
-
`;
|
|
13752
|
-
if (typeInfo.fields) {
|
|
13753
|
-
for (const fieldName in typeInfo.fields) {
|
|
13754
|
-
const fieldId = nodeFieldNamesById.indexOf(fieldName);
|
|
13755
|
-
if (fieldId === -1)
|
|
13756
|
-
continue;
|
|
13757
|
-
if (typeInfo.fields[fieldName].multiple) {
|
|
13758
|
-
const getterName = camelCase(fieldName) + "Nodes";
|
|
13759
|
-
fieldNames.push(getterName);
|
|
13760
|
-
classBody += `
|
|
13761
|
-
get ${getterName}() {
|
|
13762
|
-
marshalNode(this);
|
|
13763
|
-
return unmarshalNodes(NodeMethods.childNodesForFieldId(this.tree, ${fieldId}), this.tree);
|
|
13764
|
-
}
|
|
13765
|
-
`.replace(/\s+/g, " ") + `
|
|
13766
|
-
`;
|
|
13767
|
-
} else {
|
|
13768
|
-
const getterName = camelCase(fieldName, false) + "Node";
|
|
13769
|
-
fieldNames.push(getterName);
|
|
13770
|
-
classBody += `
|
|
13771
|
-
get ${getterName}() {
|
|
13772
|
-
marshalNode(this);
|
|
13773
|
-
return unmarshalNode(NodeMethods.childNodeForFieldId(this.tree, ${fieldId}), this.tree);
|
|
13774
|
-
}
|
|
13775
|
-
`.replace(/\s+/g, " ") + `
|
|
13776
|
-
`;
|
|
13777
|
-
}
|
|
13778
|
-
}
|
|
13779
|
-
}
|
|
13780
|
-
const className = camelCase(typeName, true) + "Node";
|
|
13781
|
-
const nodeSubclass = eval(`class ${className} extends SyntaxNode {${classBody}}; ${className}`);
|
|
13782
|
-
nodeSubclass.prototype.type = typeName;
|
|
13783
|
-
nodeSubclass.prototype.fields = Object.freeze(fieldNames.sort());
|
|
13784
|
-
nodeSubclasses[id] = nodeSubclass;
|
|
13785
|
-
}
|
|
13786
|
-
language.nodeSubclasses = nodeSubclasses;
|
|
13787
|
-
}
|
|
13788
|
-
function camelCase(name21, upperCase) {
|
|
13789
|
-
name21 = name21.replace(/_(\w)/g, (_match, letter) => letter.toUpperCase());
|
|
13790
|
-
if (upperCase)
|
|
13791
|
-
name21 = name21[0].toUpperCase() + name21.slice(1);
|
|
13792
|
-
return name21;
|
|
13793
|
-
}
|
|
13794
|
-
module.exports = Parser;
|
|
13795
|
-
module.exports.Query = Query;
|
|
13796
|
-
module.exports.Tree = Tree;
|
|
13797
|
-
module.exports.SyntaxNode = SyntaxNode;
|
|
13798
|
-
module.exports.TreeCursor = TreeCursor;
|
|
13799
|
-
module.exports.LookaheadIterator = LookaheadIterator;
|
|
13800
|
-
});
|
|
13801
|
-
|
|
13802
12876
|
// ../../node_modules/.bun/@neon-rs+load@0.0.4/node_modules/@neon-rs/load/dist/index.js
|
|
13803
12877
|
var require_dist2 = __commonJS((exports) => {
|
|
13804
12878
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
@@ -17793,9 +16867,9 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
17793
16867
|
function isRegFile(mode) {
|
|
17794
16868
|
return (mode & S_IFMT) == S_IFREG;
|
|
17795
16869
|
}
|
|
17796
|
-
var
|
|
17797
|
-
var nrOfFields =
|
|
17798
|
-
var passKey =
|
|
16870
|
+
var fieldNames = ["host", "port", "database", "user", "password"];
|
|
16871
|
+
var nrOfFields = fieldNames.length;
|
|
16872
|
+
var passKey = fieldNames[nrOfFields - 1];
|
|
17799
16873
|
function warn2() {
|
|
17800
16874
|
var isWritable = warnStream instanceof Stream2 && warnStream.writable === true;
|
|
17801
16875
|
if (isWritable) {
|
|
@@ -17841,7 +16915,7 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
17841
16915
|
return true;
|
|
17842
16916
|
};
|
|
17843
16917
|
var matcher = exports.match = function(connInfo, entry) {
|
|
17844
|
-
return
|
|
16918
|
+
return fieldNames.slice(0, -1).reduce(function(prev, field, idx) {
|
|
17845
16919
|
if (idx == 1) {
|
|
17846
16920
|
if (Number(connInfo[field] || defaultPort) === Number(entry[field])) {
|
|
17847
16921
|
return prev && true;
|
|
@@ -17888,7 +16962,7 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
17888
16962
|
if (!Object.hasOwnProperty.call(process.env, "PGPASS_NO_DEESCAPE")) {
|
|
17889
16963
|
field = field.replace(/\\([:\\])/g, "$1");
|
|
17890
16964
|
}
|
|
17891
|
-
obj[
|
|
16965
|
+
obj[fieldNames[idx]] = field;
|
|
17892
16966
|
};
|
|
17893
16967
|
for (var i = 0;i < line4.length - 1; i += 1) {
|
|
17894
16968
|
curChar = line4.charAt(i + 1);
|
|
@@ -17929,9 +17003,9 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
17929
17003
|
return x.length > 0;
|
|
17930
17004
|
}
|
|
17931
17005
|
};
|
|
17932
|
-
for (var idx = 0;idx <
|
|
17006
|
+
for (var idx = 0;idx < fieldNames.length; idx += 1) {
|
|
17933
17007
|
var rule = rules[idx];
|
|
17934
|
-
var value6 = entry[
|
|
17008
|
+
var value6 = entry[fieldNames[idx]] || "";
|
|
17935
17009
|
var res = rule(value6);
|
|
17936
17010
|
if (!res) {
|
|
17937
17011
|
return false;
|
|
@@ -22299,15 +21373,15 @@ var bind = (map, flatMap) => dual(3, (self2, name, f) => flatMap(self2, (a) => m
|
|
|
22299
21373
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/GlobalValue.js
|
|
22300
21374
|
var globalStoreId = `effect/GlobalValue`;
|
|
22301
21375
|
var globalStore;
|
|
22302
|
-
var globalValue = (
|
|
21376
|
+
var globalValue = (id, compute) => {
|
|
22303
21377
|
if (!globalStore) {
|
|
22304
21378
|
globalThis[globalStoreId] ??= new Map;
|
|
22305
21379
|
globalStore = globalThis[globalStoreId];
|
|
22306
21380
|
}
|
|
22307
|
-
if (!globalStore.has(
|
|
22308
|
-
globalStore.set(
|
|
21381
|
+
if (!globalStore.has(id)) {
|
|
21382
|
+
globalStore.set(id, compute());
|
|
22309
21383
|
}
|
|
22310
|
-
return globalStore.get(
|
|
21384
|
+
return globalStore.get(id);
|
|
22311
21385
|
};
|
|
22312
21386
|
|
|
22313
21387
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Predicate.js
|
|
@@ -22540,18 +21614,18 @@ var random = (self2) => {
|
|
|
22540
21614
|
return randomHashCache.get(self2);
|
|
22541
21615
|
};
|
|
22542
21616
|
var combine = (b) => (self2) => self2 * 53 ^ b;
|
|
22543
|
-
var optimize = (
|
|
21617
|
+
var optimize = (n) => n & 3221225471 | n >>> 1 & 1073741824;
|
|
22544
21618
|
var isHash = (u) => hasProperty(u, symbol);
|
|
22545
|
-
var number2 = (
|
|
22546
|
-
if (
|
|
21619
|
+
var number2 = (n) => {
|
|
21620
|
+
if (n !== n || n === Infinity) {
|
|
22547
21621
|
return 0;
|
|
22548
21622
|
}
|
|
22549
|
-
let h =
|
|
22550
|
-
if (h !==
|
|
22551
|
-
h ^=
|
|
21623
|
+
let h = n | 0;
|
|
21624
|
+
if (h !== n) {
|
|
21625
|
+
h ^= n * 4294967295;
|
|
22552
21626
|
}
|
|
22553
|
-
while (
|
|
22554
|
-
h ^=
|
|
21627
|
+
while (n > 4294967295) {
|
|
21628
|
+
h ^= n /= 4294967295;
|
|
22555
21629
|
}
|
|
22556
21630
|
return optimize(h);
|
|
22557
21631
|
};
|
|
@@ -23243,9 +22317,9 @@ var keys = (self2) => Object.keys(self2);
|
|
|
23243
22317
|
|
|
23244
22318
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Array.js
|
|
23245
22319
|
var make4 = (...elements) => elements;
|
|
23246
|
-
var allocate = (
|
|
23247
|
-
var makeBy = /* @__PURE__ */ dual(2, (
|
|
23248
|
-
const max = Math.max(1, Math.floor(
|
|
22320
|
+
var allocate = (n) => new Array(n);
|
|
22321
|
+
var makeBy = /* @__PURE__ */ dual(2, (n, f) => {
|
|
22322
|
+
const max = Math.max(1, Math.floor(n));
|
|
23249
22323
|
const out = new Array(max);
|
|
23250
22324
|
for (let i = 0;i < max; i++) {
|
|
23251
22325
|
out[i] = f(i);
|
|
@@ -23293,9 +22367,9 @@ var last = (self2) => isNonEmptyReadonlyArray(self2) ? some2(lastNonEmpty(self2)
|
|
|
23293
22367
|
var lastNonEmpty = (self2) => self2[self2.length - 1];
|
|
23294
22368
|
var tailNonEmpty = (self2) => self2.slice(1);
|
|
23295
22369
|
var initNonEmpty = (self2) => self2.slice(0, -1);
|
|
23296
|
-
var take = /* @__PURE__ */ dual(2, (self2,
|
|
22370
|
+
var take = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
23297
22371
|
const input = fromIterable(self2);
|
|
23298
|
-
return input.slice(0, clamp(
|
|
22372
|
+
return input.slice(0, clamp(n, input));
|
|
23299
22373
|
});
|
|
23300
22374
|
var spanIndex = (self2, predicate) => {
|
|
23301
22375
|
let i = 0;
|
|
@@ -23308,9 +22382,9 @@ var spanIndex = (self2, predicate) => {
|
|
|
23308
22382
|
return i;
|
|
23309
22383
|
};
|
|
23310
22384
|
var span = /* @__PURE__ */ dual(2, (self2, predicate) => splitAt(self2, spanIndex(self2, predicate)));
|
|
23311
|
-
var drop = /* @__PURE__ */ dual(2, (self2,
|
|
22385
|
+
var drop = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
23312
22386
|
const input = fromIterable(self2);
|
|
23313
|
-
return input.slice(clamp(
|
|
22387
|
+
return input.slice(clamp(n, input), input.length);
|
|
23314
22388
|
});
|
|
23315
22389
|
var findFirstIndex = /* @__PURE__ */ dual(2, (self2, predicate) => {
|
|
23316
22390
|
let i = 0;
|
|
@@ -23370,9 +22444,9 @@ var containsWith2 = (isEquivalent) => dual(2, (self2, a) => {
|
|
|
23370
22444
|
});
|
|
23371
22445
|
var _equivalence2 = /* @__PURE__ */ equivalence();
|
|
23372
22446
|
var contains2 = /* @__PURE__ */ containsWith2(_equivalence2);
|
|
23373
|
-
var splitAt = /* @__PURE__ */ dual(2, (self2,
|
|
22447
|
+
var splitAt = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
23374
22448
|
const input = Array.from(self2);
|
|
23375
|
-
const _n = Math.floor(
|
|
22449
|
+
const _n = Math.floor(n);
|
|
23376
22450
|
if (isNonEmptyReadonlyArray(input)) {
|
|
23377
22451
|
if (_n >= 1) {
|
|
23378
22452
|
return splitNonEmptyAt(input, _n);
|
|
@@ -23381,8 +22455,8 @@ var splitAt = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
|
23381
22455
|
}
|
|
23382
22456
|
return [input, []];
|
|
23383
22457
|
});
|
|
23384
|
-
var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self2,
|
|
23385
|
-
const _n = Math.max(1, Math.floor(
|
|
22458
|
+
var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
22459
|
+
const _n = Math.max(1, Math.floor(n));
|
|
23386
22460
|
return _n >= self2.length ? [copy(self2), []] : [prepend(self2.slice(1, _n), headNonEmpty(self2)), self2.slice(_n)];
|
|
23387
22461
|
});
|
|
23388
22462
|
var copy = (self2) => self2.slice();
|
|
@@ -23751,14 +22825,14 @@ var makeGenericTag = (key) => {
|
|
|
23751
22825
|
tag.key = key;
|
|
23752
22826
|
return tag;
|
|
23753
22827
|
};
|
|
23754
|
-
var Tag = (
|
|
22828
|
+
var Tag = (id) => () => {
|
|
23755
22829
|
const limit = Error.stackTraceLimit;
|
|
23756
22830
|
Error.stackTraceLimit = 2;
|
|
23757
22831
|
const creationError = new Error;
|
|
23758
22832
|
Error.stackTraceLimit = limit;
|
|
23759
22833
|
function TagClass() {}
|
|
23760
22834
|
Object.setPrototypeOf(TagClass, TagProto);
|
|
23761
|
-
TagClass.key =
|
|
22835
|
+
TagClass.key = id;
|
|
23762
22836
|
Object.defineProperty(TagClass, "stack", {
|
|
23763
22837
|
get() {
|
|
23764
22838
|
return creationError.stack;
|
|
@@ -23766,14 +22840,14 @@ var Tag = (id2) => () => {
|
|
|
23766
22840
|
});
|
|
23767
22841
|
return TagClass;
|
|
23768
22842
|
};
|
|
23769
|
-
var Reference = () => (
|
|
22843
|
+
var Reference = () => (id, options) => {
|
|
23770
22844
|
const limit = Error.stackTraceLimit;
|
|
23771
22845
|
Error.stackTraceLimit = 2;
|
|
23772
22846
|
const creationError = new Error;
|
|
23773
22847
|
Error.stackTraceLimit = limit;
|
|
23774
22848
|
function ReferenceClass() {}
|
|
23775
22849
|
Object.setPrototypeOf(ReferenceClass, ReferenceProto);
|
|
23776
|
-
ReferenceClass.key =
|
|
22850
|
+
ReferenceClass.key = id;
|
|
23777
22851
|
ReferenceClass.defaultValue = options.defaultValue;
|
|
23778
22852
|
Object.defineProperty(ReferenceClass, "stack", {
|
|
23779
22853
|
get() {
|
|
@@ -24134,10 +23208,10 @@ var unsafeGet4 = /* @__PURE__ */ dual(2, (self2, index) => {
|
|
|
24134
23208
|
});
|
|
24135
23209
|
var append2 = /* @__PURE__ */ dual(2, (self2, a) => appendAll2(self2, of2(a)));
|
|
24136
23210
|
var prepend2 = /* @__PURE__ */ dual(2, (self2, elem) => appendAll2(of2(elem), self2));
|
|
24137
|
-
var take2 = /* @__PURE__ */ dual(2, (self2,
|
|
24138
|
-
if (
|
|
23211
|
+
var take2 = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
23212
|
+
if (n <= 0) {
|
|
24139
23213
|
return _empty2;
|
|
24140
|
-
} else if (
|
|
23214
|
+
} else if (n >= self2.length) {
|
|
24141
23215
|
return self2;
|
|
24142
23216
|
} else {
|
|
24143
23217
|
switch (self2.backing._tag) {
|
|
@@ -24145,35 +23219,35 @@ var take2 = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
|
24145
23219
|
return makeChunk({
|
|
24146
23220
|
_tag: "ISlice",
|
|
24147
23221
|
chunk: self2.backing.chunk,
|
|
24148
|
-
length:
|
|
23222
|
+
length: n,
|
|
24149
23223
|
offset: self2.backing.offset
|
|
24150
23224
|
});
|
|
24151
23225
|
}
|
|
24152
23226
|
case "IConcat": {
|
|
24153
|
-
if (
|
|
23227
|
+
if (n > self2.left.length) {
|
|
24154
23228
|
return makeChunk({
|
|
24155
23229
|
_tag: "IConcat",
|
|
24156
23230
|
left: self2.left,
|
|
24157
|
-
right: take2(self2.right,
|
|
23231
|
+
right: take2(self2.right, n - self2.left.length)
|
|
24158
23232
|
});
|
|
24159
23233
|
}
|
|
24160
|
-
return take2(self2.left,
|
|
23234
|
+
return take2(self2.left, n);
|
|
24161
23235
|
}
|
|
24162
23236
|
default: {
|
|
24163
23237
|
return makeChunk({
|
|
24164
23238
|
_tag: "ISlice",
|
|
24165
23239
|
chunk: self2,
|
|
24166
23240
|
offset: 0,
|
|
24167
|
-
length:
|
|
23241
|
+
length: n
|
|
24168
23242
|
});
|
|
24169
23243
|
}
|
|
24170
23244
|
}
|
|
24171
23245
|
}
|
|
24172
23246
|
});
|
|
24173
|
-
var drop2 = /* @__PURE__ */ dual(2, (self2,
|
|
24174
|
-
if (
|
|
23247
|
+
var drop2 = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
23248
|
+
if (n <= 0) {
|
|
24175
23249
|
return self2;
|
|
24176
|
-
} else if (
|
|
23250
|
+
} else if (n >= self2.length) {
|
|
24177
23251
|
return _empty2;
|
|
24178
23252
|
} else {
|
|
24179
23253
|
switch (self2.backing._tag) {
|
|
@@ -24181,17 +23255,17 @@ var drop2 = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
|
24181
23255
|
return makeChunk({
|
|
24182
23256
|
_tag: "ISlice",
|
|
24183
23257
|
chunk: self2.backing.chunk,
|
|
24184
|
-
offset: self2.backing.offset +
|
|
24185
|
-
length: self2.backing.length -
|
|
23258
|
+
offset: self2.backing.offset + n,
|
|
23259
|
+
length: self2.backing.length - n
|
|
24186
23260
|
});
|
|
24187
23261
|
}
|
|
24188
23262
|
case "IConcat": {
|
|
24189
|
-
if (
|
|
24190
|
-
return drop2(self2.right,
|
|
23263
|
+
if (n > self2.left.length) {
|
|
23264
|
+
return drop2(self2.right, n - self2.left.length);
|
|
24191
23265
|
}
|
|
24192
23266
|
return makeChunk({
|
|
24193
23267
|
_tag: "IConcat",
|
|
24194
|
-
left: drop2(self2.left,
|
|
23268
|
+
left: drop2(self2.left, n),
|
|
24195
23269
|
right: self2.right
|
|
24196
23270
|
});
|
|
24197
23271
|
}
|
|
@@ -24199,8 +23273,8 @@ var drop2 = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
|
24199
23273
|
return makeChunk({
|
|
24200
23274
|
_tag: "ISlice",
|
|
24201
23275
|
chunk: self2,
|
|
24202
|
-
offset:
|
|
24203
|
-
length: self2.length -
|
|
23276
|
+
offset: n,
|
|
23277
|
+
length: self2.length - n
|
|
24204
23278
|
});
|
|
24205
23279
|
}
|
|
24206
23280
|
}
|
|
@@ -24298,7 +23372,7 @@ var unsafeHead = (self2) => unsafeGet4(self2, 0);
|
|
|
24298
23372
|
var headNonEmpty2 = unsafeHead;
|
|
24299
23373
|
var map5 = /* @__PURE__ */ dual(2, (self2, f) => self2.backing._tag === "ISingleton" ? of2(f(self2.backing.a, 0)) : unsafeFromArray(pipe(toReadonlyArray(self2), map4((a, i) => f(a, i)))));
|
|
24300
23374
|
var tailNonEmpty2 = (self2) => drop2(self2, 1);
|
|
24301
|
-
var takeRight = /* @__PURE__ */ dual(2, (self2,
|
|
23375
|
+
var takeRight = /* @__PURE__ */ dual(2, (self2, n) => drop2(self2, self2.length - n));
|
|
24302
23376
|
var reduce2 = reduce;
|
|
24303
23377
|
|
|
24304
23378
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Duration.js
|
|
@@ -25327,8 +24401,8 @@ class Runtime {
|
|
|
25327
24401
|
startTimeMillis;
|
|
25328
24402
|
[FiberIdTypeId] = FiberIdTypeId;
|
|
25329
24403
|
_tag = OP_RUNTIME;
|
|
25330
|
-
constructor(
|
|
25331
|
-
this.id =
|
|
24404
|
+
constructor(id, startTimeMillis) {
|
|
24405
|
+
this.id = id;
|
|
25332
24406
|
this.startTimeMillis = startTimeMillis;
|
|
25333
24407
|
}
|
|
25334
24408
|
[symbol]() {
|
|
@@ -25385,8 +24459,8 @@ class Composite {
|
|
|
25385
24459
|
}
|
|
25386
24460
|
}
|
|
25387
24461
|
var none3 = /* @__PURE__ */ new None;
|
|
25388
|
-
var runtime = (
|
|
25389
|
-
return new Runtime(
|
|
24462
|
+
var runtime = (id, startTimeMillis) => {
|
|
24463
|
+
return new Runtime(id, startTimeMillis);
|
|
25390
24464
|
};
|
|
25391
24465
|
var composite = (left3, right3) => {
|
|
25392
24466
|
return new Composite(left3, right3);
|
|
@@ -25418,17 +24492,17 @@ var ids = (self2) => {
|
|
|
25418
24492
|
}
|
|
25419
24493
|
};
|
|
25420
24494
|
var _fiberCounter = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Fiber/Id/_fiberCounter"), () => make13(0));
|
|
25421
|
-
var make14 = (
|
|
25422
|
-
return new Runtime(
|
|
24495
|
+
var make14 = (id, startTimeSeconds) => {
|
|
24496
|
+
return new Runtime(id, startTimeSeconds);
|
|
25423
24497
|
};
|
|
25424
24498
|
var threadName = (self2) => {
|
|
25425
|
-
const identifiers = Array.from(ids(self2)).map((
|
|
24499
|
+
const identifiers = Array.from(ids(self2)).map((n) => `#${n}`).join(",");
|
|
25426
24500
|
return identifiers;
|
|
25427
24501
|
};
|
|
25428
24502
|
var unsafeMake = () => {
|
|
25429
|
-
const
|
|
25430
|
-
pipe(_fiberCounter, set2(
|
|
25431
|
-
return new Runtime(
|
|
24503
|
+
const id = get6(_fiberCounter);
|
|
24504
|
+
pipe(_fiberCounter, set2(id + 1));
|
|
24505
|
+
return new Runtime(id, Date.now());
|
|
25432
24506
|
};
|
|
25433
24507
|
|
|
25434
24508
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/FiberId.js
|
|
@@ -26030,7 +25104,7 @@ var enable = (flag) => make18(flag, flag);
|
|
|
26030
25104
|
var disable = (flag) => make18(flag, 0);
|
|
26031
25105
|
var exclude = /* @__PURE__ */ dual(2, (self2, flag) => make18(active(self2) & ~flag, enabled(self2)));
|
|
26032
25106
|
var andThen = /* @__PURE__ */ dual(2, (self2, that) => self2 | that);
|
|
26033
|
-
var invert = (
|
|
25107
|
+
var invert = (n) => ~n >>> 0 & BIT_MASK;
|
|
26034
25108
|
|
|
26035
25109
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/internal/runtimeFlags.js
|
|
26036
25110
|
var None2 = 0;
|
|
@@ -27513,7 +26587,7 @@ var fiberRefUnsafeMakePatch = (initial, options) => {
|
|
|
27513
26587
|
combine: (first, second) => options.differ.combine(first, second),
|
|
27514
26588
|
patch: (patch5) => (oldValue) => options.differ.patch(patch5, oldValue),
|
|
27515
26589
|
fork: options.fork,
|
|
27516
|
-
join: options.join ?? ((_,
|
|
26590
|
+
join: options.join ?? ((_, n) => n)
|
|
27517
26591
|
};
|
|
27518
26592
|
return _fiberRef;
|
|
27519
26593
|
};
|
|
@@ -27560,7 +26634,7 @@ var causeSquashWith = /* @__PURE__ */ dual(2, (self2, f) => {
|
|
|
27560
26634
|
case "None": {
|
|
27561
26635
|
return pipe(defects(self2), head2, match2({
|
|
27562
26636
|
onNone: () => {
|
|
27563
|
-
const interrupts = fromIterable(interruptors(self2)).flatMap((fiberId2) => fromIterable(ids2(fiberId2)).map((
|
|
26637
|
+
const interrupts = fromIterable(interruptors(self2)).flatMap((fiberId2) => fromIterable(ids2(fiberId2)).map((id) => `#${id}`));
|
|
27564
26638
|
return new InterruptedException(interrupts ? `Interrupted by fibers: ${interrupts.join(", ")}` : undefined);
|
|
27565
26639
|
},
|
|
27566
26640
|
onSome: identity
|
|
@@ -27786,7 +26860,7 @@ var deferredUnsafeMake = (fiberId2) => {
|
|
|
27786
26860
|
};
|
|
27787
26861
|
return _deferred;
|
|
27788
26862
|
};
|
|
27789
|
-
var deferredMake = () => flatMap7(fiberId, (
|
|
26863
|
+
var deferredMake = () => flatMap7(fiberId, (id) => deferredMakeAs(id));
|
|
27790
26864
|
var deferredMakeAs = (fiberId2) => sync(() => deferredUnsafeMake(fiberId2));
|
|
27791
26865
|
var deferredAwait = (self2) => asyncInterrupt((resume) => {
|
|
27792
26866
|
const state = get6(self2.state);
|
|
@@ -27953,8 +27027,8 @@ var parse = (s) => {
|
|
|
27953
27027
|
if (s.trim() === "") {
|
|
27954
27028
|
return none;
|
|
27955
27029
|
}
|
|
27956
|
-
const
|
|
27957
|
-
return Number.isNaN(
|
|
27030
|
+
const n = Number(s);
|
|
27031
|
+
return Number.isNaN(n) ? none : some(n);
|
|
27958
27032
|
};
|
|
27959
27033
|
var round = /* @__PURE__ */ dual(2, (self2, precision) => {
|
|
27960
27034
|
const factor = Math.pow(10, precision);
|
|
@@ -28329,19 +27403,19 @@ class RandomImpl {
|
|
|
28329
27403
|
return sync(() => this.PRNG.number());
|
|
28330
27404
|
}
|
|
28331
27405
|
get nextBoolean() {
|
|
28332
|
-
return map11(this.next, (
|
|
27406
|
+
return map11(this.next, (n) => n > 0.5);
|
|
28333
27407
|
}
|
|
28334
27408
|
get nextInt() {
|
|
28335
27409
|
return sync(() => this.PRNG.integer(Number.MAX_SAFE_INTEGER));
|
|
28336
27410
|
}
|
|
28337
27411
|
nextRange(min2, max2) {
|
|
28338
|
-
return map11(this.next, (
|
|
27412
|
+
return map11(this.next, (n) => (max2 - min2) * n + min2);
|
|
28339
27413
|
}
|
|
28340
27414
|
nextIntBetween(min2, max2) {
|
|
28341
27415
|
return sync(() => this.PRNG.integer(max2 - min2) + min2);
|
|
28342
27416
|
}
|
|
28343
27417
|
shuffle(elements) {
|
|
28344
|
-
return shuffleWith(elements, (
|
|
27418
|
+
return shuffleWith(elements, (n) => this.nextIntBetween(0, n));
|
|
28345
27419
|
}
|
|
28346
27420
|
}
|
|
28347
27421
|
var shuffleWith = (elements, nextIntBounded) => {
|
|
@@ -28350,7 +27424,7 @@ var shuffleWith = (elements, nextIntBounded) => {
|
|
|
28350
27424
|
for (let i = buffer.length;i >= 2; i = i - 1) {
|
|
28351
27425
|
numbers.push(i);
|
|
28352
27426
|
}
|
|
28353
|
-
return pipe(numbers, forEachSequentialDiscard((
|
|
27427
|
+
return pipe(numbers, forEachSequentialDiscard((n) => pipe(nextIntBounded(n), map11((k) => swap(buffer, n - 1, k)))), as(fromIterable2(buffer)));
|
|
28354
27428
|
})));
|
|
28355
27429
|
};
|
|
28356
27430
|
var swap = (buffer, index1, index2) => {
|
|
@@ -29684,8 +28758,8 @@ var promise = (evaluate2) => evaluate2.length >= 1 ? async_((resolve, signal) =>
|
|
|
29684
28758
|
});
|
|
29685
28759
|
var provideService = /* @__PURE__ */ dual(3, (self2, tag, service) => contextWithEffect((env) => provideContext(self2, add2(env, tag, service))));
|
|
29686
28760
|
var provideServiceEffect = /* @__PURE__ */ dual(3, (self2, tag, effect) => contextWithEffect((env) => flatMap7(effect, (service) => provideContext(self2, pipe(env, add2(tag, service))))));
|
|
29687
|
-
var repeatN = /* @__PURE__ */ dual(2, (self2,
|
|
29688
|
-
var repeatNLoop = (self2,
|
|
28761
|
+
var repeatN = /* @__PURE__ */ dual(2, (self2, n) => suspend(() => repeatNLoop(self2, n)));
|
|
28762
|
+
var repeatNLoop = (self2, n) => flatMap7(self2, (a) => n <= 0 ? succeed(a) : zipRight(yieldNow(), repeatNLoop(self2, n - 1)));
|
|
29689
28763
|
var sleep3 = sleep2;
|
|
29690
28764
|
var succeedNone = /* @__PURE__ */ succeed(/* @__PURE__ */ none2());
|
|
29691
28765
|
var summarized = /* @__PURE__ */ dual(3, (self2, summary, f) => flatMap7(summary, (start) => flatMap7(self2, (value) => map11(summary, (end) => [f(start, end), value]))));
|
|
@@ -30645,8 +29719,8 @@ var histogram4 = (key) => {
|
|
|
30645
29719
|
let sum2 = 0;
|
|
30646
29720
|
let min2 = Number.MAX_VALUE;
|
|
30647
29721
|
let max2 = Number.MIN_VALUE;
|
|
30648
|
-
pipe(bounds, sort(Order), map4((
|
|
30649
|
-
boundaries[i] =
|
|
29722
|
+
pipe(bounds, sort(Order), map4((n, i) => {
|
|
29723
|
+
boundaries[i] = n;
|
|
30650
29724
|
}));
|
|
30651
29725
|
const update4 = (value) => {
|
|
30652
29726
|
let from = 0;
|
|
@@ -30799,7 +29873,7 @@ var resolveQuantile = (error, sampleCount, current, consumed, quantile, rest) =>
|
|
|
30799
29873
|
};
|
|
30800
29874
|
}
|
|
30801
29875
|
const headValue = headNonEmpty(rest_1);
|
|
30802
|
-
const sameHead = span(rest_1, (
|
|
29876
|
+
const sameHead = span(rest_1, (n) => n === headValue);
|
|
30803
29877
|
const desired = quantile_1 * sampleCount_1;
|
|
30804
29878
|
const allowedError = error_1 / 2 * desired;
|
|
30805
29879
|
const candConsumed = consumed_1 + sameHead[0].length;
|
|
@@ -32244,9 +31318,9 @@ var all3 = (arg, options) => {
|
|
|
32244
31318
|
var forEach4 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]), (self2, f, options) => withFiberRuntime((r) => {
|
|
32245
31319
|
const isRequestBatchingEnabled = options?.batching === true || options?.batching === "inherit" && r.getFiberRef(currentRequestBatching);
|
|
32246
31320
|
if (options?.discard) {
|
|
32247
|
-
return match7(options.concurrency, () => finalizersMaskInternal(sequential3, options?.concurrentFinalizers)((restore) => isRequestBatchingEnabled ? forEachConcurrentDiscard(self2, (a, i) => restore(f(a, i)), true, false, 1) : forEachSequentialDiscard(self2, (a, i) => restore(f(a, i)))), () => finalizersMaskInternal(parallel3, options?.concurrentFinalizers)((restore) => forEachConcurrentDiscard(self2, (a, i) => restore(f(a, i)), isRequestBatchingEnabled, false)), (
|
|
31321
|
+
return match7(options.concurrency, () => finalizersMaskInternal(sequential3, options?.concurrentFinalizers)((restore) => isRequestBatchingEnabled ? forEachConcurrentDiscard(self2, (a, i) => restore(f(a, i)), true, false, 1) : forEachSequentialDiscard(self2, (a, i) => restore(f(a, i)))), () => finalizersMaskInternal(parallel3, options?.concurrentFinalizers)((restore) => forEachConcurrentDiscard(self2, (a, i) => restore(f(a, i)), isRequestBatchingEnabled, false)), (n) => finalizersMaskInternal(parallelN2(n), options?.concurrentFinalizers)((restore) => forEachConcurrentDiscard(self2, (a, i) => restore(f(a, i)), isRequestBatchingEnabled, false, n)));
|
|
32248
31322
|
}
|
|
32249
|
-
return match7(options?.concurrency, () => finalizersMaskInternal(sequential3, options?.concurrentFinalizers)((restore) => isRequestBatchingEnabled ? forEachParN(self2, 1, (a, i) => restore(f(a, i)), true) : forEachSequential(self2, (a, i) => restore(f(a, i)))), () => finalizersMaskInternal(parallel3, options?.concurrentFinalizers)((restore) => forEachParUnbounded(self2, (a, i) => restore(f(a, i)), isRequestBatchingEnabled)), (
|
|
31323
|
+
return match7(options?.concurrency, () => finalizersMaskInternal(sequential3, options?.concurrentFinalizers)((restore) => isRequestBatchingEnabled ? forEachParN(self2, 1, (a, i) => restore(f(a, i)), true) : forEachSequential(self2, (a, i) => restore(f(a, i)))), () => finalizersMaskInternal(parallel3, options?.concurrentFinalizers)((restore) => forEachParUnbounded(self2, (a, i) => restore(f(a, i)), isRequestBatchingEnabled)), (n) => finalizersMaskInternal(parallelN2(n), options?.concurrentFinalizers)((restore) => forEachParN(self2, n, (a, i) => restore(f(a, i)), isRequestBatchingEnabled)));
|
|
32250
31324
|
}));
|
|
32251
31325
|
var forEachParUnbounded = (self2, f, batching) => suspend(() => {
|
|
32252
31326
|
const as2 = fromIterable(self2);
|
|
@@ -32254,7 +31328,7 @@ var forEachParUnbounded = (self2, f, batching) => suspend(() => {
|
|
|
32254
31328
|
const fn = (a, i) => flatMap7(f(a, i), (b) => sync(() => array3[i] = b));
|
|
32255
31329
|
return zipRight(forEachConcurrentDiscard(as2, fn, batching, false), succeed(array3));
|
|
32256
31330
|
});
|
|
32257
|
-
var forEachConcurrentDiscard = (self2, f, batching, processAll,
|
|
31331
|
+
var forEachConcurrentDiscard = (self2, f, batching, processAll, n) => uninterruptibleMask((restore) => transplant((graft) => withFiberRuntime((parent) => {
|
|
32258
31332
|
let todos = Array.from(self2).reverse();
|
|
32259
31333
|
let target = todos.length;
|
|
32260
31334
|
if (target === 0) {
|
|
@@ -32262,7 +31336,7 @@ var forEachConcurrentDiscard = (self2, f, batching, processAll, n2) => uninterru
|
|
|
32262
31336
|
}
|
|
32263
31337
|
let counter6 = 0;
|
|
32264
31338
|
let interrupted = false;
|
|
32265
|
-
const fibersCount =
|
|
31339
|
+
const fibersCount = n ? Math.min(todos.length, n) : todos.length;
|
|
32266
31340
|
const fibers = new Set;
|
|
32267
31341
|
const results = new Array;
|
|
32268
31342
|
const interruptAll = () => fibers.forEach((fiber) => {
|
|
@@ -32364,7 +31438,7 @@ var forEachConcurrentDiscard = (self2, f, batching, processAll, n2) => uninterru
|
|
|
32364
31438
|
const requests = residual.map((blocked2) => blocked2.effect_instruction_i0).reduce(par);
|
|
32365
31439
|
resume2(succeed(blocked(requests, forEachConcurrentDiscard([getOrElse(exitCollectAll(exits, {
|
|
32366
31440
|
parallel: true
|
|
32367
|
-
}), () => exitVoid), ...residual.map((blocked2) => blocked2.effect_instruction_i1)], (i) => i, batching, true,
|
|
31441
|
+
}), () => exitVoid), ...residual.map((blocked2) => blocked2.effect_instruction_i1)], (i) => i, batching, true, n))));
|
|
32368
31442
|
} else {
|
|
32369
31443
|
next();
|
|
32370
31444
|
}
|
|
@@ -32379,7 +31453,7 @@ var forEachConcurrentDiscard = (self2, f, batching, processAll, n2) => uninterru
|
|
|
32379
31453
|
onFailure: (cause) => {
|
|
32380
31454
|
onInterruptSignal();
|
|
32381
31455
|
const target2 = residual.length + 1;
|
|
32382
|
-
const concurrency = Math.min(typeof
|
|
31456
|
+
const concurrency = Math.min(typeof n === "number" ? n : residual.length, residual.length);
|
|
32383
31457
|
const toPop = Array.from(residual);
|
|
32384
31458
|
return async_((cb) => {
|
|
32385
31459
|
const exits = [];
|
|
@@ -32409,11 +31483,11 @@ var forEachConcurrentDiscard = (self2, f, batching, processAll, n2) => uninterru
|
|
|
32409
31483
|
onSuccess: () => forEachSequential(joinOrder, (f2) => f2.inheritAll)
|
|
32410
31484
|
})));
|
|
32411
31485
|
})));
|
|
32412
|
-
var forEachParN = (self2,
|
|
31486
|
+
var forEachParN = (self2, n, f, batching) => suspend(() => {
|
|
32413
31487
|
const as2 = fromIterable(self2);
|
|
32414
31488
|
const array3 = new Array(as2.length);
|
|
32415
31489
|
const fn = (a, i) => map11(f(a, i), (b) => array3[i] = b);
|
|
32416
|
-
return zipRight(forEachConcurrentDiscard(as2, fn, batching, false,
|
|
31490
|
+
return zipRight(forEachConcurrentDiscard(as2, fn, batching, false, n), succeed(array3));
|
|
32417
31491
|
});
|
|
32418
31492
|
var forkDaemon = (self2) => forkWithScopeOverride(self2, globalScope);
|
|
32419
31493
|
var unsafeFork = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {
|
|
@@ -32646,7 +31720,7 @@ var ensuring = /* @__PURE__ */ dual(2, (self2, finalizer) => uninterruptibleMask
|
|
|
32646
31720
|
}),
|
|
32647
31721
|
onSuccess: (a) => as(finalizer, a)
|
|
32648
31722
|
})));
|
|
32649
|
-
var invokeWithInterrupt = (self2, entries2, onInterrupt2) => fiberIdWith((
|
|
31723
|
+
var invokeWithInterrupt = (self2, entries2, onInterrupt2) => fiberIdWith((id) => flatMap7(flatMap7(forkDaemon(interruptible2(self2)), (processing) => async_((cb) => {
|
|
32650
31724
|
const counts = entries2.map((_) => _.listeners.count);
|
|
32651
31725
|
const checkDone = () => {
|
|
32652
31726
|
if (counts.every((count) => count === 0)) {
|
|
@@ -32688,7 +31762,7 @@ var invokeWithInterrupt = (self2, entries2, onInterrupt2) => fiberIdWith((id2) =
|
|
|
32688
31762
|
}
|
|
32689
31763
|
return [];
|
|
32690
31764
|
});
|
|
32691
|
-
return forEachSequentialDiscard(residual, (entry) => complete(entry.request, exitInterrupt(
|
|
31765
|
+
return forEachSequentialDiscard(residual, (entry) => complete(entry.request, exitInterrupt(id)));
|
|
32692
31766
|
})));
|
|
32693
31767
|
var makeSpanScoped = (name, options) => {
|
|
32694
31768
|
options = addSpanStackTrace(options);
|
|
@@ -32876,23 +31950,23 @@ class Semaphore {
|
|
|
32876
31950
|
get free() {
|
|
32877
31951
|
return this.permits - this.taken;
|
|
32878
31952
|
}
|
|
32879
|
-
take = (
|
|
32880
|
-
if (this.free <
|
|
31953
|
+
take = (n) => asyncInterrupt((resume2) => {
|
|
31954
|
+
if (this.free < n) {
|
|
32881
31955
|
const observer = () => {
|
|
32882
|
-
if (this.free <
|
|
31956
|
+
if (this.free < n) {
|
|
32883
31957
|
return;
|
|
32884
31958
|
}
|
|
32885
31959
|
this.waiters.delete(observer);
|
|
32886
|
-
this.taken +=
|
|
32887
|
-
resume2(succeed(
|
|
31960
|
+
this.taken += n;
|
|
31961
|
+
resume2(succeed(n));
|
|
32888
31962
|
};
|
|
32889
31963
|
this.waiters.add(observer);
|
|
32890
31964
|
return sync(() => {
|
|
32891
31965
|
this.waiters.delete(observer);
|
|
32892
31966
|
});
|
|
32893
31967
|
}
|
|
32894
|
-
this.taken +=
|
|
32895
|
-
return resume2(succeed(
|
|
31968
|
+
this.taken += n;
|
|
31969
|
+
return resume2(succeed(n));
|
|
32896
31970
|
});
|
|
32897
31971
|
updateTakenUnsafe(fiber, f) {
|
|
32898
31972
|
this.taken = f(this.taken);
|
|
@@ -32918,15 +31992,15 @@ class Semaphore {
|
|
|
32918
31992
|
}
|
|
32919
31993
|
return this.updateTakenUnsafe(fiber, (taken) => taken);
|
|
32920
31994
|
}));
|
|
32921
|
-
release = (
|
|
31995
|
+
release = (n) => this.updateTaken((taken) => taken - n);
|
|
32922
31996
|
releaseAll = /* @__PURE__ */ this.updateTaken((_) => 0);
|
|
32923
|
-
withPermits = (
|
|
32924
|
-
withPermitsIfAvailable = (
|
|
32925
|
-
if (this.free <
|
|
31997
|
+
withPermits = (n) => (self2) => uninterruptibleMask((restore) => flatMap7(restore(this.take(n)), (permits) => ensuring(restore(self2), this.release(permits))));
|
|
31998
|
+
withPermitsIfAvailable = (n) => (self2) => uninterruptibleMask((restore) => suspend(() => {
|
|
31999
|
+
if (this.free < n) {
|
|
32926
32000
|
return succeedNone;
|
|
32927
32001
|
}
|
|
32928
|
-
this.taken +=
|
|
32929
|
-
return ensuring(restore(asSome(self2)), this.release(
|
|
32002
|
+
this.taken += n;
|
|
32003
|
+
return ensuring(restore(asSome(self2)), this.release(n));
|
|
32930
32004
|
}));
|
|
32931
32005
|
}
|
|
32932
32006
|
var unsafeMakeSemaphore = (permits) => new Semaphore(permits);
|
|
@@ -33139,7 +32213,7 @@ var unsafeFork2 = /* @__PURE__ */ makeDual((runtime3, self2, options) => {
|
|
|
33139
32213
|
const fiberRuntime = new FiberRuntime(fiberId2, fiberRefs3, runtime3.runtimeFlags);
|
|
33140
32214
|
let effect = self2;
|
|
33141
32215
|
if (options?.scope) {
|
|
33142
|
-
effect = flatMap7(fork(options.scope, sequential2), (closeableScope) => zipRight(scopeAddFinalizer(closeableScope, fiberIdWith((
|
|
32216
|
+
effect = flatMap7(fork(options.scope, sequential2), (closeableScope) => zipRight(scopeAddFinalizer(closeableScope, fiberIdWith((id2) => equals(id2, fiberRuntime.id()) ? void_ : interruptAsFiber(fiberRuntime, id2))), onExit(self2, (exit2) => close(closeableScope, exit2))));
|
|
33143
32217
|
}
|
|
33144
32218
|
const supervisor = fiberRuntime.currentSupervisor;
|
|
33145
32219
|
if (supervisor !== none7) {
|
|
@@ -33370,13 +32444,13 @@ class MemoMapImpl {
|
|
|
33370
32444
|
return pipe(deferredFailCause(deferred, exit2.effect_instruction_i0), zipRight(scopeClose(innerScope, exit2)), zipRight(failCause(exit2.effect_instruction_i0)));
|
|
33371
32445
|
}
|
|
33372
32446
|
case OP_SUCCESS: {
|
|
33373
|
-
return pipe(set4(finalizerRef, (exit3) => pipe(scopeClose(innerScope, exit3), whenEffect(modify3(observers, (
|
|
32447
|
+
return pipe(set4(finalizerRef, (exit3) => pipe(scopeClose(innerScope, exit3), whenEffect(modify3(observers, (n) => [n === 1, n - 1])), asVoid)), zipRight(update2(observers, (n) => n + 1)), zipRight(scopeAddFinalizerExit(scope2, (exit3) => pipe(sync(() => map15.delete(layer)), zipRight(get10(finalizerRef)), flatMap7((finalizer) => finalizer(exit3))))), zipRight(deferredSucceed(deferred, exit2.effect_instruction_i0)), as(exit2.effect_instruction_i0[1]));
|
|
33374
32448
|
}
|
|
33375
32449
|
}
|
|
33376
32450
|
})))));
|
|
33377
32451
|
const memoized = [pipe(deferredAwait(deferred), onExit(exitMatchEffect({
|
|
33378
32452
|
onFailure: () => void_,
|
|
33379
|
-
onSuccess: () => update2(observers, (
|
|
32453
|
+
onSuccess: () => update2(observers, (n) => n + 1)
|
|
33380
32454
|
}))), (exit2) => pipe(get10(finalizerRef), flatMap7((finalizer) => finalizer(exit2)))];
|
|
33381
32455
|
return [resource, isFresh(layer) ? map15 : map15.set(layer, memoized)];
|
|
33382
32456
|
}))))));
|
|
@@ -33840,7 +32914,7 @@ var modifyDelayEffect = /* @__PURE__ */ dual(2, (self2, f) => makeWithState(self
|
|
|
33840
32914
|
});
|
|
33841
32915
|
})));
|
|
33842
32916
|
var passthrough = (self2) => makeWithState(self2.initial, (now, input, state) => pipe(self2.step(now, input, state), map11(([state2, _, decision]) => [state2, input, decision])));
|
|
33843
|
-
var recurs = (
|
|
32917
|
+
var recurs = (n) => whileOutput(forever2, (out) => out < n);
|
|
33844
32918
|
var spaced = (duration) => addDelay(forever2, () => duration);
|
|
33845
32919
|
var unfold2 = (initial, f) => makeWithState(initial, (now, _, state) => sync(() => [f(state), state, continueWith2(after2(now))]));
|
|
33846
32920
|
var untilInputEffect = /* @__PURE__ */ dual(2, (self2, f) => checkEffect(self2, (input, _) => negate(f(input))));
|
|
@@ -33929,7 +33003,7 @@ var retryOrElse_EffectLoop = (self2, driver2, orElse4) => {
|
|
|
33929
33003
|
onSuccess: () => retryOrElse_EffectLoop(self2, driver2, orElse4)
|
|
33930
33004
|
}));
|
|
33931
33005
|
};
|
|
33932
|
-
var forever2 = /* @__PURE__ */ unfold2(0, (
|
|
33006
|
+
var forever2 = /* @__PURE__ */ unfold2(0, (n) => n + 1);
|
|
33933
33007
|
|
|
33934
33008
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Deferred.js
|
|
33935
33009
|
var DeferredTypeId2 = DeferredTypeId;
|
|
@@ -34118,10 +33192,10 @@ var poll2 = /* @__PURE__ */ dual(2, (self2, def) => {
|
|
|
34118
33192
|
}
|
|
34119
33193
|
return shift(self2.queue);
|
|
34120
33194
|
});
|
|
34121
|
-
var pollUpTo = /* @__PURE__ */ dual(2, (self2,
|
|
33195
|
+
var pollUpTo = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
34122
33196
|
let result = empty6();
|
|
34123
33197
|
let count2 = 0;
|
|
34124
|
-
while (count2 <
|
|
33198
|
+
while (count2 < n) {
|
|
34125
33199
|
const element = poll2(EmptyMutableQueue)(self2);
|
|
34126
33200
|
if (element === EmptyMutableQueue) {
|
|
34127
33201
|
break;
|
|
@@ -34281,7 +33355,7 @@ var makeTagProxy = (TagClass) => {
|
|
|
34281
33355
|
};
|
|
34282
33356
|
var Service = function() {
|
|
34283
33357
|
return function() {
|
|
34284
|
-
const [
|
|
33358
|
+
const [id2, maker] = arguments;
|
|
34285
33359
|
const proxy = "accessors" in maker ? maker["accessors"] : false;
|
|
34286
33360
|
const limit = Error.stackTraceLimit;
|
|
34287
33361
|
Error.stackTraceLimit = 2;
|
|
@@ -34306,7 +33380,7 @@ var Service = function() {
|
|
|
34306
33380
|
return service;
|
|
34307
33381
|
}
|
|
34308
33382
|
};
|
|
34309
|
-
TagClass.prototype._tag =
|
|
33383
|
+
TagClass.prototype._tag = id2;
|
|
34310
33384
|
Object.defineProperty(TagClass, "make", {
|
|
34311
33385
|
get() {
|
|
34312
33386
|
return (service) => new this(service);
|
|
@@ -34317,7 +33391,7 @@ var Service = function() {
|
|
|
34317
33391
|
return (body) => andThen2(this, body);
|
|
34318
33392
|
}
|
|
34319
33393
|
});
|
|
34320
|
-
TagClass.key =
|
|
33394
|
+
TagClass.key = id2;
|
|
34321
33395
|
Object.assign(TagClass, TagProto);
|
|
34322
33396
|
Object.defineProperty(TagClass, "stack", {
|
|
34323
33397
|
get() {
|
|
@@ -35365,12 +34439,12 @@ var record = (key, value) => {
|
|
|
35365
34439
|
};
|
|
35366
34440
|
var pickAnnotations = (annotationIds) => (annotated) => {
|
|
35367
34441
|
let out = undefined;
|
|
35368
|
-
for (const
|
|
35369
|
-
if (Object.prototype.hasOwnProperty.call(annotated.annotations,
|
|
34442
|
+
for (const id2 of annotationIds) {
|
|
34443
|
+
if (Object.prototype.hasOwnProperty.call(annotated.annotations, id2)) {
|
|
35370
34444
|
if (out === undefined) {
|
|
35371
34445
|
out = {};
|
|
35372
34446
|
}
|
|
35373
|
-
out[
|
|
34447
|
+
out[id2] = annotated.annotations[id2];
|
|
35374
34448
|
}
|
|
35375
34449
|
}
|
|
35376
34450
|
return out;
|
|
@@ -35379,8 +34453,8 @@ var omitAnnotations = (annotationIds) => (annotated) => {
|
|
|
35379
34453
|
const out = {
|
|
35380
34454
|
...annotated.annotations
|
|
35381
34455
|
};
|
|
35382
|
-
for (const
|
|
35383
|
-
delete out[
|
|
34456
|
+
for (const id2 of annotationIds) {
|
|
34457
|
+
delete out[id2];
|
|
35384
34458
|
}
|
|
35385
34459
|
return out;
|
|
35386
34460
|
};
|
|
@@ -38035,7 +37109,7 @@ class ChannelExecutor {
|
|
|
38035
37109
|
const activeChild = subexecutor.activeChildExecutors[0];
|
|
38036
37110
|
const rest = subexecutor.activeChildExecutors.slice(1);
|
|
38037
37111
|
if (activeChild === undefined) {
|
|
38038
|
-
const [emitSeparator, remainingExecutors] = this.applyUpstreamPullStrategy(true, rest, subexecutor.onPull(NoUpstream(rest.reduce((
|
|
37112
|
+
const [emitSeparator, remainingExecutors] = this.applyUpstreamPullStrategy(true, rest, subexecutor.onPull(NoUpstream(rest.reduce((n, curr) => curr !== undefined ? n + 1 : n, 0))));
|
|
38039
37113
|
this.replaceSubexecutor(new DrainChildExecutors(subexecutor.upstreamExecutor, subexecutor.lastDone, remainingExecutors, subexecutor.upstreamDone, subexecutor.combineChildResults, subexecutor.combineWithChildResult, subexecutor.onPull));
|
|
38040
37114
|
if (isSome2(emitSeparator)) {
|
|
38041
37115
|
this._emitted = emitSeparator.value;
|
|
@@ -39152,7 +38226,7 @@ var fail13 = (error3) => fromEffectOption(fail8(some2(error3)));
|
|
|
39152
38226
|
var flatMap14 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self2, f, options) => {
|
|
39153
38227
|
const bufferSize = options?.bufferSize ?? 16;
|
|
39154
38228
|
if (options?.switch) {
|
|
39155
|
-
return matchConcurrency(options?.concurrency, () => flatMapParSwitchBuffer(self2, 1, bufferSize, f), (
|
|
38229
|
+
return matchConcurrency(options?.concurrency, () => flatMapParSwitchBuffer(self2, 1, bufferSize, f), (n) => flatMapParSwitchBuffer(self2, n, bufferSize, f));
|
|
39156
38230
|
}
|
|
39157
38231
|
return matchConcurrency(options?.concurrency, () => new StreamImpl(concatMap(toChannel2(self2), (as6) => pipe(as6, map5((a) => toChannel2(f(a))), reduce2(void_5, (left3, right3) => pipe(left3, zipRight4(right3)))))), (_) => new StreamImpl(pipe(toChannel2(self2), concatMap(writeChunk), mergeMap((out) => toChannel2(f(out)), options))));
|
|
39158
38232
|
});
|
|
@@ -39166,8 +38240,8 @@ var matchConcurrency = (concurrency, sequential5, bounded4) => {
|
|
|
39166
38240
|
return concurrency > 1 ? bounded4(concurrency) : sequential5();
|
|
39167
38241
|
}
|
|
39168
38242
|
};
|
|
39169
|
-
var flatMapParSwitchBuffer = /* @__PURE__ */ dual(4, (self2,
|
|
39170
|
-
concurrency:
|
|
38243
|
+
var flatMapParSwitchBuffer = /* @__PURE__ */ dual(4, (self2, n, bufferSize, f) => new StreamImpl(pipe(toChannel2(self2), concatMap(writeChunk), mergeMap((out) => toChannel2(f(out)), {
|
|
38244
|
+
concurrency: n,
|
|
39171
38245
|
mergeStrategy: BufferSliding(),
|
|
39172
38246
|
bufferSize
|
|
39173
38247
|
}))));
|
|
@@ -39571,8 +38645,8 @@ var toASTAnnotations = (annotations2) => {
|
|
|
39571
38645
|
};
|
|
39572
38646
|
for (const key in builtInAnnotations) {
|
|
39573
38647
|
if (key in annotations2) {
|
|
39574
|
-
const
|
|
39575
|
-
out[
|
|
38648
|
+
const id2 = builtInAnnotations[key];
|
|
38649
|
+
out[id2] = annotations2[key];
|
|
39576
38650
|
delete out[key];
|
|
39577
38651
|
}
|
|
39578
38652
|
}
|
|
@@ -40774,13 +39848,13 @@ class SystemError extends (/* @__PURE__ */ TaggedError2("@effect/platform/Error/
|
|
|
40774
39848
|
// ../../node_modules/.bun/@effect+platform@0.94.2+f436dcc95e9291b3/node_modules/@effect/platform/dist/esm/internal/fileSystem.js
|
|
40775
39849
|
var tag = /* @__PURE__ */ GenericTag("@effect/platform/FileSystem");
|
|
40776
39850
|
var Size = (bytes) => typeof bytes === "bigint" ? bytes : BigInt(bytes);
|
|
40777
|
-
var KiB = (
|
|
40778
|
-
var MiB = (
|
|
40779
|
-
var GiB = (
|
|
40780
|
-
var TiB = (
|
|
39851
|
+
var KiB = (n) => Size(n * 1024);
|
|
39852
|
+
var MiB = (n) => Size(n * 1024 * 1024);
|
|
39853
|
+
var GiB = (n) => Size(n * 1024 * 1024 * 1024);
|
|
39854
|
+
var TiB = (n) => Size(n * 1024 * 1024 * 1024 * 1024);
|
|
40781
39855
|
var bigint1024 = /* @__PURE__ */ BigInt(1024);
|
|
40782
39856
|
var bigintPiB = bigint1024 * bigint1024 * bigint1024 * bigint1024 * bigint1024;
|
|
40783
|
-
var PiB = (
|
|
39857
|
+
var PiB = (n) => Size(BigInt(n) * bigintPiB);
|
|
40784
39858
|
var make49 = (impl) => {
|
|
40785
39859
|
return tag.of({
|
|
40786
39860
|
...impl,
|
|
@@ -41040,8 +40114,8 @@ function reduce12(b, f) {
|
|
|
41040
40114
|
return iterable.reduce(f, b);
|
|
41041
40115
|
}
|
|
41042
40116
|
let result = b;
|
|
41043
|
-
for (const
|
|
41044
|
-
result = f(result,
|
|
40117
|
+
for (const n of iterable) {
|
|
40118
|
+
result = f(result, n);
|
|
41045
40119
|
}
|
|
41046
40120
|
return result;
|
|
41047
40121
|
};
|
|
@@ -41052,8 +40126,8 @@ function map23(f) {
|
|
|
41052
40126
|
return iterable.map(f);
|
|
41053
40127
|
}
|
|
41054
40128
|
return function* () {
|
|
41055
|
-
for (const
|
|
41056
|
-
yield f(
|
|
40129
|
+
for (const n of iterable) {
|
|
40130
|
+
yield f(n);
|
|
41057
40131
|
}
|
|
41058
40132
|
}();
|
|
41059
40133
|
};
|
|
@@ -41743,18 +40817,18 @@ var annotate = /* @__PURE__ */ dual(2, (self2, annotation) => {
|
|
|
41743
40817
|
op.annotation = annotation;
|
|
41744
40818
|
return op;
|
|
41745
40819
|
});
|
|
41746
|
-
var spaces = (
|
|
41747
|
-
if (
|
|
40820
|
+
var spaces = (n) => {
|
|
40821
|
+
if (n <= 0) {
|
|
41748
40822
|
return empty31;
|
|
41749
40823
|
}
|
|
41750
|
-
if (
|
|
40824
|
+
if (n === 1) {
|
|
41751
40825
|
return char(" ");
|
|
41752
40826
|
}
|
|
41753
|
-
return text(textSpaces(
|
|
40827
|
+
return text(textSpaces(n));
|
|
41754
40828
|
};
|
|
41755
|
-
var textSpaces = (
|
|
40829
|
+
var textSpaces = (n) => {
|
|
41756
40830
|
let s = "";
|
|
41757
|
-
for (let i = 0;i <
|
|
40831
|
+
for (let i = 0;i < n; i++) {
|
|
41758
40832
|
s = s += " ";
|
|
41759
40833
|
}
|
|
41760
40834
|
return s;
|
|
@@ -43484,10 +42558,10 @@ function fromFileUrl(url2) {
|
|
|
43484
42558
|
}));
|
|
43485
42559
|
}
|
|
43486
42560
|
const pathname = url2.pathname;
|
|
43487
|
-
for (let
|
|
43488
|
-
if (pathname[
|
|
43489
|
-
const third = pathname.codePointAt(
|
|
43490
|
-
if (pathname[
|
|
42561
|
+
for (let n = 0;n < pathname.length; n++) {
|
|
42562
|
+
if (pathname[n] === "%") {
|
|
42563
|
+
const third = pathname.codePointAt(n + 2) | 32;
|
|
42564
|
+
if (pathname[n + 1] === "2" && third === 102) {
|
|
43491
42565
|
return fail8(new BadArgument({
|
|
43492
42566
|
module: "Path",
|
|
43493
42567
|
method: "fromFileUrl",
|
|
@@ -44382,7 +43456,7 @@ function handleProcessInteger(options3) {
|
|
|
44382
43456
|
error: some2("Must provide an integer value")
|
|
44383
43457
|
}
|
|
44384
43458
|
})),
|
|
44385
|
-
onSuccess: (
|
|
43459
|
+
onSuccess: (n) => match12(options3.validate(n), {
|
|
44386
43460
|
onFailure: (error4) => Action.NextFrame({
|
|
44387
43461
|
state: {
|
|
44388
43462
|
...state,
|
|
@@ -44408,14 +43482,14 @@ var integer2 = (options3) => {
|
|
|
44408
43482
|
max: Number.POSITIVE_INFINITY,
|
|
44409
43483
|
incrementBy: 1,
|
|
44410
43484
|
decrementBy: 1,
|
|
44411
|
-
validate: (
|
|
44412
|
-
if (
|
|
44413
|
-
return fail8(`${
|
|
43485
|
+
validate: (n) => {
|
|
43486
|
+
if (n < opts.min) {
|
|
43487
|
+
return fail8(`${n} must be greater than or equal to ${opts.min}`);
|
|
44414
43488
|
}
|
|
44415
|
-
if (
|
|
44416
|
-
return fail8(`${
|
|
43489
|
+
if (n > opts.max) {
|
|
43490
|
+
return fail8(`${n} must be less than or equal to ${opts.max}`);
|
|
44417
43491
|
}
|
|
44418
|
-
return succeed7(
|
|
43492
|
+
return succeed7(n);
|
|
44419
43493
|
},
|
|
44420
43494
|
...options3
|
|
44421
43495
|
};
|
|
@@ -44471,7 +43545,7 @@ function handleProcessFloat(options3) {
|
|
|
44471
43545
|
error: some2("Must provide a floating point value")
|
|
44472
43546
|
}
|
|
44473
43547
|
})),
|
|
44474
|
-
onSuccess: (
|
|
43548
|
+
onSuccess: (n) => flatMap10(sync3(() => round(n, options3.precision)), (rounded) => match12(options3.validate(rounded), {
|
|
44475
43549
|
onFailure: (error4) => Action.NextFrame({
|
|
44476
43550
|
state: {
|
|
44477
43551
|
...state,
|
|
@@ -44498,14 +43572,14 @@ var float = (options3) => {
|
|
|
44498
43572
|
incrementBy: 1,
|
|
44499
43573
|
decrementBy: 1,
|
|
44500
43574
|
precision: 2,
|
|
44501
|
-
validate: (
|
|
44502
|
-
if (
|
|
44503
|
-
return fail8(`${
|
|
43575
|
+
validate: (n) => {
|
|
43576
|
+
if (n < opts.min) {
|
|
43577
|
+
return fail8(`${n} must be greater than or equal to ${opts.min}`);
|
|
44504
43578
|
}
|
|
44505
|
-
if (
|
|
44506
|
-
return fail8(`${
|
|
43579
|
+
if (n > opts.max) {
|
|
43580
|
+
return fail8(`${n} must be less than or equal to ${opts.max}`);
|
|
44507
43581
|
}
|
|
44508
|
-
return succeed7(
|
|
43582
|
+
return succeed7(n);
|
|
44509
43583
|
},
|
|
44510
43584
|
...options3
|
|
44511
43585
|
};
|
|
@@ -45334,7 +44408,7 @@ var validateInternal = (self2, value6, config2) => {
|
|
|
45334
44408
|
}
|
|
45335
44409
|
}
|
|
45336
44410
|
};
|
|
45337
|
-
var attempt = (option5,
|
|
44411
|
+
var attempt = (option5, typeName, parse5) => orElseFail2(option5, () => `${typeName} options do not have a default value`).pipe(flatMap10((value6) => orElseFail2(parse5(value6), () => `'${value6}' is not a ${typeName}`)));
|
|
45338
44412
|
var validatePathExistence = (path2, shouldPathExist, pathExists) => {
|
|
45339
44413
|
if (shouldPathExist === "no" && pathExists) {
|
|
45340
44414
|
return fail8(`Path '${path2}' must not exist`);
|
|
@@ -45627,13 +44701,13 @@ var render4 = (self2, config2) => {
|
|
|
45627
44701
|
return of(text4("<command>"));
|
|
45628
44702
|
}
|
|
45629
44703
|
case "Named": {
|
|
45630
|
-
const
|
|
44704
|
+
const typeInfo = config2.showTypes ? match2(self2.acceptedValues, {
|
|
45631
44705
|
onNone: () => empty34,
|
|
45632
44706
|
onSome: (s) => concat3(space3, text4(s))
|
|
45633
44707
|
}) : empty34;
|
|
45634
44708
|
const namesToShow = config2.showAllNames ? self2.names : self2.names.length > 1 ? pipe(filter3(self2.names, (name) => name.startsWith("--")), head, map2(of), getOrElse(() => self2.names)) : self2.names;
|
|
45635
44709
|
const nameInfo = text4(join(namesToShow, ", "));
|
|
45636
|
-
return config2.showAllNames && self2.names.length > 1 ? of(spans([text4("("), nameInfo,
|
|
44710
|
+
return config2.showAllNames && self2.names.length > 1 ? of(spans([text4("("), nameInfo, typeInfo, text4(")")])) : of(concat3(nameInfo, typeInfo));
|
|
45637
44711
|
}
|
|
45638
44712
|
case "Optional": {
|
|
45639
44713
|
return map4(render4(self2.usage, config2), (span2) => spans([text4("["), span2, text4("]")]));
|
|
@@ -46137,7 +45211,7 @@ var wizardInternal2 = (self2, config2) => {
|
|
|
46137
45211
|
message: toAnsiText(message).trimEnd(),
|
|
46138
45212
|
min: getMinSizeInternal(self2),
|
|
46139
45213
|
max: getMaxSizeInternal(self2)
|
|
46140
|
-
}).pipe(zipLeft2(log2()), flatMap10((
|
|
45214
|
+
}).pipe(zipLeft2(log2()), flatMap10((n) => n <= 0 ? succeed7(empty3()) : make25(empty3()).pipe(flatMap10((ref) => wizardInternal2(self2.args, config2).pipe(flatMap10((args2) => update3(ref, appendAll(args2))), repeatN2(n - 1), zipRight3(get11(ref)), tap2((args2) => validateInternal2(self2, args2, config2)))))));
|
|
46141
45215
|
}
|
|
46142
45216
|
case "WithDefault": {
|
|
46143
45217
|
const defaultHelp = p(`This argument is optional - use the default?`);
|
|
@@ -46992,7 +46066,7 @@ var wizardInternal3 = (self2, config2) => {
|
|
|
46992
46066
|
message: toAnsiText(message).trimEnd(),
|
|
46993
46067
|
min: getMinSizeInternal2(self2),
|
|
46994
46068
|
max: getMaxSizeInternal2(self2)
|
|
46995
|
-
}).pipe(flatMap10((
|
|
46069
|
+
}).pipe(flatMap10((n) => n <= 0 ? succeed7(empty3()) : make25(empty3()).pipe(flatMap10((ref) => wizardInternal3(self2.argumentOption, config2).pipe(flatMap10((args2) => update3(ref, appendAll(args2))), repeatN2(n - 1), zipRight3(get11(ref)))))));
|
|
46996
46070
|
}
|
|
46997
46071
|
case "WithDefault": {
|
|
46998
46072
|
if (isBoolInternal(self2.options)) {
|
|
@@ -47781,7 +46855,7 @@ var withSubcommands = /* @__PURE__ */ dual(2, (self2, subcommands) => {
|
|
|
47781
46855
|
const op = Object.create(proto23);
|
|
47782
46856
|
op._tag = "Subcommands";
|
|
47783
46857
|
op.parent = self2;
|
|
47784
|
-
op.children = map4(subcommands, ([
|
|
46858
|
+
op.children = map4(subcommands, ([id2, command]) => map33(command, (a) => [id2, a]));
|
|
47785
46859
|
return op;
|
|
47786
46860
|
});
|
|
47787
46861
|
var wizard6 = /* @__PURE__ */ dual(3, (self2, prefix, config2) => wizardInternal4(self2, prefix, config2));
|
|
@@ -50254,25 +49328,25 @@ class MailboxImpl extends Class2 {
|
|
|
50254
49328
|
}
|
|
50255
49329
|
return succeed([messages, this.releaseCapacity()]);
|
|
50256
49330
|
});
|
|
50257
|
-
takeN(
|
|
49331
|
+
takeN(n) {
|
|
50258
49332
|
return suspend(() => {
|
|
50259
49333
|
if (this.state._tag === "Done") {
|
|
50260
49334
|
return exitAs(this.state.exit, constDone);
|
|
50261
|
-
} else if (
|
|
49335
|
+
} else if (n <= 0) {
|
|
50262
49336
|
return succeed([empty41, false]);
|
|
50263
49337
|
}
|
|
50264
|
-
|
|
49338
|
+
n = Math.min(n, this.capacity);
|
|
50265
49339
|
let messages;
|
|
50266
|
-
if (
|
|
50267
|
-
messages = take2(this.messagesChunk,
|
|
50268
|
-
this.messagesChunk = drop2(this.messagesChunk,
|
|
50269
|
-
} else if (
|
|
49340
|
+
if (n <= this.messagesChunk.length) {
|
|
49341
|
+
messages = take2(this.messagesChunk, n);
|
|
49342
|
+
this.messagesChunk = drop2(this.messagesChunk, n);
|
|
49343
|
+
} else if (n <= this.messages.length + this.messagesChunk.length) {
|
|
50270
49344
|
this.messagesChunk = appendAll2(this.messagesChunk, unsafeFromArray(this.messages));
|
|
50271
49345
|
this.messages = [];
|
|
50272
|
-
messages = take2(this.messagesChunk,
|
|
50273
|
-
this.messagesChunk = drop2(this.messagesChunk,
|
|
49346
|
+
messages = take2(this.messagesChunk, n);
|
|
49347
|
+
this.messagesChunk = drop2(this.messagesChunk, n);
|
|
50274
49348
|
} else {
|
|
50275
|
-
return zipRight(this.awaitTake, this.takeN(
|
|
49349
|
+
return zipRight(this.awaitTake, this.takeN(n));
|
|
50276
49350
|
}
|
|
50277
49351
|
return succeed([messages, this.releaseCapacity()]);
|
|
50278
49352
|
});
|
|
@@ -50383,21 +49457,21 @@ class MailboxImpl extends Class2 {
|
|
|
50383
49457
|
}
|
|
50384
49458
|
return false;
|
|
50385
49459
|
}
|
|
50386
|
-
let
|
|
49460
|
+
let n = this.capacity - this.messages.length - this.messagesChunk.length;
|
|
50387
49461
|
for (const entry of this.state.offers) {
|
|
50388
|
-
if (
|
|
49462
|
+
if (n === 0)
|
|
50389
49463
|
return false;
|
|
50390
49464
|
else if (entry._tag === "Single") {
|
|
50391
49465
|
this.messages.push(entry.message);
|
|
50392
|
-
|
|
49466
|
+
n--;
|
|
50393
49467
|
entry.resume(exitTrue);
|
|
50394
49468
|
this.state.offers.delete(entry);
|
|
50395
49469
|
} else {
|
|
50396
49470
|
for (;entry.offset < entry.remaining.length; entry.offset++) {
|
|
50397
|
-
if (
|
|
49471
|
+
if (n === 0)
|
|
50398
49472
|
return false;
|
|
50399
49473
|
this.messages.push(entry.remaining[entry.offset]);
|
|
50400
|
-
|
|
49474
|
+
n--;
|
|
50401
49475
|
}
|
|
50402
49476
|
entry.resume(exitEmpty);
|
|
50403
49477
|
this.state.offers.delete(entry);
|
|
@@ -50638,13 +49712,13 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
50638
49712
|
initialMessage
|
|
50639
49713
|
}) {
|
|
50640
49714
|
return gen2(function* () {
|
|
50641
|
-
const
|
|
49715
|
+
const id2 = idCounter++;
|
|
50642
49716
|
let requestIdCounter = 0;
|
|
50643
49717
|
const requestMap = new Map;
|
|
50644
49718
|
const collector = unsafeMakeCollector();
|
|
50645
49719
|
const wrappedEncode = encode2 ? (message) => zipRight3(collector.clear, provideService2(encode2(message), Collector, collector)) : succeed7;
|
|
50646
49720
|
const readyLatch = yield* make37();
|
|
50647
|
-
const backing = yield* platform.spawn(
|
|
49721
|
+
const backing = yield* platform.spawn(id2);
|
|
50648
49722
|
yield* backing.run((message) => {
|
|
50649
49723
|
if (message[0] === 0) {
|
|
50650
49724
|
return complete2(readyLatch, _void);
|
|
@@ -50684,20 +49758,20 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
50684
49758
|
const executeAcquire = (request, makeMailbox) => withFiberRuntime2((fiber) => {
|
|
50685
49759
|
const context7 = fiber.getFiberRef(currentContext2);
|
|
50686
49760
|
const span2 = getOption2(context7, ParentSpan).pipe(filter((span3) => span3._tag === "Span"));
|
|
50687
|
-
const
|
|
49761
|
+
const id3 = requestIdCounter++;
|
|
50688
49762
|
return makeMailbox.pipe(tap2((mailbox) => {
|
|
50689
|
-
requestMap.set(
|
|
50690
|
-
return wrappedEncode(request).pipe(tap2((payload) => backing.send([
|
|
49763
|
+
requestMap.set(id3, mailbox);
|
|
49764
|
+
return wrappedEncode(request).pipe(tap2((payload) => backing.send([id3, 0, payload, span2._tag === "Some" ? [span2.value.traceId, span2.value.spanId, span2.value.sampled] : undefined], collector.unsafeRead())), catchAllCause2((cause2) => isMailbox(mailbox) ? mailbox.failCause(cause2) : failCause6(mailbox, cause2)));
|
|
50691
49765
|
}), map16((mailbox) => ({
|
|
50692
|
-
id:
|
|
49766
|
+
id: id3,
|
|
50693
49767
|
mailbox
|
|
50694
49768
|
})));
|
|
50695
49769
|
});
|
|
50696
49770
|
const executeRelease = ({
|
|
50697
|
-
id:
|
|
49771
|
+
id: id3
|
|
50698
49772
|
}, exit3) => {
|
|
50699
|
-
const release = sync3(() => requestMap.delete(
|
|
50700
|
-
return isFailure(exit3) ? zipRight3(orDie2(backing.send([
|
|
49773
|
+
const release = sync3(() => requestMap.delete(id3));
|
|
49774
|
+
return isFailure(exit3) ? zipRight3(orDie2(backing.send([id3, 1])), release) : release;
|
|
50701
49775
|
};
|
|
50702
49776
|
const execute4 = (request) => fromChannel4(acquireUseRelease4(executeAcquire(request, make64()), ({
|
|
50703
49777
|
mailbox
|
|
@@ -50713,7 +49787,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
50713
49787
|
})));
|
|
50714
49788
|
}
|
|
50715
49789
|
return {
|
|
50716
|
-
id:
|
|
49790
|
+
id: id2,
|
|
50717
49791
|
execute: execute4,
|
|
50718
49792
|
executeEffect
|
|
50719
49793
|
};
|
|
@@ -50724,7 +49798,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
50724
49798
|
var layerManager = /* @__PURE__ */ effect(WorkerManager, makeManager);
|
|
50725
49799
|
var makePlatform = () => (options7) => PlatformWorker.of({
|
|
50726
49800
|
[PlatformWorkerTypeId]: PlatformWorkerTypeId,
|
|
50727
|
-
spawn(
|
|
49801
|
+
spawn(id2) {
|
|
50728
49802
|
return gen2(function* () {
|
|
50729
49803
|
const spawn = yield* Spawner;
|
|
50730
49804
|
let currentPort;
|
|
@@ -50732,7 +49806,7 @@ var makePlatform = () => (options7) => PlatformWorker.of({
|
|
|
50732
49806
|
const run9 = (handler) => uninterruptibleMask3((restore) => gen2(function* () {
|
|
50733
49807
|
const scope4 = yield* scope2;
|
|
50734
49808
|
const port2 = yield* options7.setup({
|
|
50735
|
-
worker: spawn(
|
|
49809
|
+
worker: spawn(id2),
|
|
50736
49810
|
scope: scope4
|
|
50737
49811
|
});
|
|
50738
49812
|
currentPort = port2;
|
|
@@ -51670,8 +50744,8 @@ function make71({
|
|
|
51670
50744
|
compiler,
|
|
51671
50745
|
reactiveMailbox,
|
|
51672
50746
|
rollback = "ROLLBACK",
|
|
51673
|
-
rollbackSavepoint = (
|
|
51674
|
-
savepoint = (
|
|
50747
|
+
rollbackSavepoint = (id2) => `ROLLBACK TO SAVEPOINT ${id2}`,
|
|
50748
|
+
savepoint = (id2) => `SAVEPOINT ${id2}`,
|
|
51675
50749
|
spanAttributes,
|
|
51676
50750
|
transactionAcquirer,
|
|
51677
50751
|
transformRows
|
|
@@ -51687,10 +50761,10 @@ function make71({
|
|
|
51687
50761
|
spanAttributes,
|
|
51688
50762
|
acquireConnection: flatMap10(make35(), (scope4) => map16(extend2(transactionAcquirer, scope4), (conn) => [scope4, conn])),
|
|
51689
50763
|
begin: (conn) => conn.executeUnprepared(beginTransaction, [], undefined),
|
|
51690
|
-
savepoint: (conn,
|
|
50764
|
+
savepoint: (conn, id2) => conn.executeUnprepared(savepoint(`effect_sql_${id2}`), [], undefined),
|
|
51691
50765
|
commit: (conn) => conn.executeUnprepared(commit, [], undefined),
|
|
51692
50766
|
rollback: (conn) => conn.executeUnprepared(rollback, [], undefined),
|
|
51693
|
-
rollbackSavepoint: (conn,
|
|
50767
|
+
rollbackSavepoint: (conn, id2) => conn.executeUnprepared(rollbackSavepoint(`effect_sql_${id2}`), [], undefined)
|
|
51694
50768
|
});
|
|
51695
50769
|
const reactivity = yield* Reactivity;
|
|
51696
50770
|
const client = Object.assign(make70(getConnection, compiler, spanAttributes, transformRows), {
|
|
@@ -51729,11 +50803,11 @@ var makeWithTransaction = (options7) => (effect3) => uninterruptibleMask3((resto
|
|
|
51729
50803
|
const clock3 = get3(fiber.currentDefaultServices, Clock);
|
|
51730
50804
|
const connOption = getOption2(context7, options7.transactionTag);
|
|
51731
50805
|
const conn = connOption._tag === "Some" ? succeed7([undefined, connOption.value[0]]) : options7.acquireConnection;
|
|
51732
|
-
const
|
|
51733
|
-
return flatMap10(conn, ([scope4, conn2]) => (
|
|
50806
|
+
const id2 = connOption._tag === "Some" ? connOption.value[1] + 1 : 0;
|
|
50807
|
+
return flatMap10(conn, ([scope4, conn2]) => (id2 === 0 ? options7.begin(conn2) : options7.savepoint(conn2, id2)).pipe(zipRight3(locally(restore(effect3), currentContext2, add2(context7, options7.transactionTag, [conn2, id2]).pipe(add2(ParentSpan, span2)))), exit2, flatMap10((exit3) => {
|
|
51734
50808
|
let effect4;
|
|
51735
50809
|
if (isSuccess(exit3)) {
|
|
51736
|
-
if (
|
|
50810
|
+
if (id2 === 0) {
|
|
51737
50811
|
span2.event("db.transaction.commit", clock3.unsafeCurrentTimeNanos());
|
|
51738
50812
|
effect4 = orDie2(options7.commit(conn2));
|
|
51739
50813
|
} else {
|
|
@@ -51742,7 +50816,7 @@ var makeWithTransaction = (options7) => (effect3) => uninterruptibleMask3((resto
|
|
|
51742
50816
|
}
|
|
51743
50817
|
} else {
|
|
51744
50818
|
span2.event("db.transaction.rollback", clock3.unsafeCurrentTimeNanos());
|
|
51745
|
-
effect4 = orDie2(
|
|
50819
|
+
effect4 = orDie2(id2 > 0 ? options7.rollbackSavepoint(conn2, id2) : options7.rollback(conn2));
|
|
51746
50820
|
}
|
|
51747
50821
|
const withScope3 = scope4 !== undefined ? ensuring2(effect4, close(scope4, exit3)) : effect4;
|
|
51748
50822
|
return zipRight3(withScope3, exit3);
|
|
@@ -51809,22 +50883,22 @@ var make73 = ({
|
|
|
51809
50883
|
name,
|
|
51810
50884
|
createdAt: created_at
|
|
51811
50885
|
})));
|
|
51812
|
-
const loadMigration = ([
|
|
50886
|
+
const loadMigration = ([id2, name, load]) => catchAllDefect2(load, (_) => fail8(new MigrationError({
|
|
51813
50887
|
reason: "import-error",
|
|
51814
|
-
message: `Could not import migration "${
|
|
50888
|
+
message: `Could not import migration "${id2}_${name}"
|
|
51815
50889
|
|
|
51816
50890
|
${_}`
|
|
51817
50891
|
}))).pipe(flatMap10((_) => isEffect2(_) ? succeed7(_) : _.default ? succeed7(_.default?.default ?? _.default) : fail8(new MigrationError({
|
|
51818
50892
|
reason: "import-error",
|
|
51819
|
-
message: `Default export not found for migration "${
|
|
50893
|
+
message: `Default export not found for migration "${id2}_${name}"`
|
|
51820
50894
|
}))), filterOrFail2((_) => isEffect2(_), () => new MigrationError({
|
|
51821
50895
|
reason: "import-error",
|
|
51822
|
-
message: `Default export was not an Effect for migration "${
|
|
50896
|
+
message: `Default export was not an Effect for migration "${id2}_${name}"`
|
|
51823
50897
|
})));
|
|
51824
|
-
const runMigration = (
|
|
50898
|
+
const runMigration = (id2, name, effect3) => orDieWith2(effect3, (error4) => new MigrationError({
|
|
51825
50899
|
cause: error4,
|
|
51826
50900
|
reason: "failed",
|
|
51827
|
-
message: `Migration "${
|
|
50901
|
+
message: `Migration "${id2}_${name}" failed`
|
|
51828
50902
|
}));
|
|
51829
50903
|
const run9 = gen2(function* () {
|
|
51830
50904
|
yield* sql.onDialectOrElse({
|
|
@@ -51835,7 +50909,7 @@ ${_}`
|
|
|
51835
50909
|
onNone: () => 0,
|
|
51836
50910
|
onSome: (_) => _.id
|
|
51837
50911
|
})), loader]);
|
|
51838
|
-
if (new Set(current.map(([
|
|
50912
|
+
if (new Set(current.map(([id2]) => id2)).size !== current.length) {
|
|
51839
50913
|
return yield* new MigrationError({
|
|
51840
50914
|
reason: "duplicates",
|
|
51841
50915
|
message: "Found duplicate migration id's"
|
|
@@ -51850,19 +50924,19 @@ ${_}`
|
|
|
51850
50924
|
required2.push([currentId, currentName, yield* loadMigration(resolved)]);
|
|
51851
50925
|
}
|
|
51852
50926
|
if (required2.length > 0) {
|
|
51853
|
-
yield* pipe(insertMigrations(required2.map(([
|
|
50927
|
+
yield* pipe(insertMigrations(required2.map(([id2, name]) => [id2, name])), mapError2((_) => new MigrationError({
|
|
51854
50928
|
reason: "locked",
|
|
51855
50929
|
message: "Migrations already running"
|
|
51856
50930
|
})));
|
|
51857
50931
|
}
|
|
51858
|
-
yield* forEach5(required2, ([
|
|
50932
|
+
yield* forEach5(required2, ([id2, name, effect3]) => logDebug2(`Running migration`).pipe(zipRight3(runMigration(id2, name, effect3)), annotateLogs2("migration_id", String(id2)), annotateLogs2("migration_name", name)), {
|
|
51859
50933
|
discard: true
|
|
51860
50934
|
});
|
|
51861
50935
|
yield* pipe(latestMigration, flatMap10(match2({
|
|
51862
50936
|
onNone: () => logDebug2(`Migrations complete`),
|
|
51863
50937
|
onSome: (_) => logDebug2(`Migrations complete`).pipe(annotateLogs2("latest_migration_id", _.id.toString()), annotateLogs2("latest_migration_name", _.name))
|
|
51864
50938
|
})));
|
|
51865
|
-
return required2.map(([
|
|
50939
|
+
return required2.map(([id2, name]) => [id2, name]);
|
|
51866
50940
|
});
|
|
51867
50941
|
yield* ensureMigrationsTable;
|
|
51868
50942
|
const completed = yield* pipe(sql.withTransaction(run9), catchTag2("MigrationError", (_) => _.reason === "locked" ? as3(logDebug2(_.message), []) : fail8(_)));
|
|
@@ -51872,9 +50946,9 @@ ${_}`
|
|
|
51872
50946
|
return completed;
|
|
51873
50947
|
});
|
|
51874
50948
|
var migrationOrder = /* @__PURE__ */ make2(([a], [b]) => number3(a, b));
|
|
51875
|
-
var fromGlob = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^(?:.*\/)?(\d+)_([^.]+)\.(js|ts)$/))), map4(([key,
|
|
51876
|
-
var fromBabelGlob = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^_(\d+)_([^.]+?)(Js|Ts)?$/))), map4(([key,
|
|
51877
|
-
var fromRecord = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^(\d+)_(.+)$/))), map4(([key,
|
|
50949
|
+
var fromGlob = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^(?:.*\/)?(\d+)_([^.]+)\.(js|ts)$/))), map4(([key, id2, name]) => [Number(id2), name, promise2(() => migrations[key]())]), sort(migrationOrder), succeed7);
|
|
50950
|
+
var fromBabelGlob = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^_(\d+)_([^.]+?)(Js|Ts)?$/))), map4(([key, id2, name]) => [Number(id2), name, succeed7(migrations[key])]), sort(migrationOrder), succeed7);
|
|
50951
|
+
var fromRecord = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^(\d+)_(.+)$/))), map4(([key, id2, name]) => [Number(id2), name, succeed7(migrations[key])]), sort(migrationOrder), succeed7);
|
|
51878
50952
|
|
|
51879
50953
|
// ../../node_modules/.bun/@effect+platform@0.94.2+f436dcc95e9291b3/node_modules/@effect/platform/dist/esm/FetchHttpClient.js
|
|
51880
50954
|
var exports_FetchHttpClient = {};
|
|
@@ -56317,46 +55391,46 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
56317
55391
|
}
|
|
56318
55392
|
doc.write(`const newResult = {};`);
|
|
56319
55393
|
for (const key of normalized.keys) {
|
|
56320
|
-
const
|
|
55394
|
+
const id2 = ids3[key];
|
|
56321
55395
|
const k = esc(key);
|
|
56322
55396
|
const schema = shape[key];
|
|
56323
55397
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
56324
|
-
doc.write(`const ${
|
|
55398
|
+
doc.write(`const ${id2} = ${parseStr(key)};`);
|
|
56325
55399
|
if (isOptionalOut) {
|
|
56326
55400
|
doc.write(`
|
|
56327
|
-
if (${
|
|
55401
|
+
if (${id2}.issues.length) {
|
|
56328
55402
|
if (${k} in input) {
|
|
56329
|
-
payload.issues = payload.issues.concat(${
|
|
55403
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
56330
55404
|
...iss,
|
|
56331
55405
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
56332
55406
|
})));
|
|
56333
55407
|
}
|
|
56334
55408
|
}
|
|
56335
55409
|
|
|
56336
|
-
if (${
|
|
55410
|
+
if (${id2}.value === undefined) {
|
|
56337
55411
|
if (${k} in input) {
|
|
56338
55412
|
newResult[${k}] = undefined;
|
|
56339
55413
|
}
|
|
56340
55414
|
} else {
|
|
56341
|
-
newResult[${k}] = ${
|
|
55415
|
+
newResult[${k}] = ${id2}.value;
|
|
56342
55416
|
}
|
|
56343
55417
|
|
|
56344
55418
|
`);
|
|
56345
55419
|
} else {
|
|
56346
55420
|
doc.write(`
|
|
56347
|
-
if (${
|
|
56348
|
-
payload.issues = payload.issues.concat(${
|
|
55421
|
+
if (${id2}.issues.length) {
|
|
55422
|
+
payload.issues = payload.issues.concat(${id2}.issues.map(iss => ({
|
|
56349
55423
|
...iss,
|
|
56350
55424
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
56351
55425
|
})));
|
|
56352
55426
|
}
|
|
56353
55427
|
|
|
56354
|
-
if (${
|
|
55428
|
+
if (${id2}.value === undefined) {
|
|
56355
55429
|
if (${k} in input) {
|
|
56356
55430
|
newResult[${k}] = undefined;
|
|
56357
55431
|
}
|
|
56358
55432
|
} else {
|
|
56359
|
-
newResult[${k}] = ${
|
|
55433
|
+
newResult[${k}] = ${id2}.value;
|
|
56360
55434
|
}
|
|
56361
55435
|
|
|
56362
55436
|
`);
|
|
@@ -64072,26 +63146,26 @@ function extractDefs(ctx, schema) {
|
|
|
64072
63146
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
64073
63147
|
const idToSchema = new Map;
|
|
64074
63148
|
for (const entry of ctx.seen.entries()) {
|
|
64075
|
-
const
|
|
64076
|
-
if (
|
|
64077
|
-
const existing = idToSchema.get(
|
|
63149
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
63150
|
+
if (id2) {
|
|
63151
|
+
const existing = idToSchema.get(id2);
|
|
64078
63152
|
if (existing && existing !== entry[0]) {
|
|
64079
|
-
throw new Error(`Duplicate schema id "${
|
|
63153
|
+
throw new Error(`Duplicate schema id "${id2}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
64080
63154
|
}
|
|
64081
|
-
idToSchema.set(
|
|
63155
|
+
idToSchema.set(id2, entry[0]);
|
|
64082
63156
|
}
|
|
64083
63157
|
}
|
|
64084
63158
|
const makeURI = (entry) => {
|
|
64085
63159
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
64086
63160
|
if (ctx.external) {
|
|
64087
63161
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
64088
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
63162
|
+
const uriGenerator = ctx.external.uri ?? ((id3) => id3);
|
|
64089
63163
|
if (externalId) {
|
|
64090
63164
|
return { ref: uriGenerator(externalId) };
|
|
64091
63165
|
}
|
|
64092
|
-
const
|
|
64093
|
-
entry[1].defId =
|
|
64094
|
-
return { defId:
|
|
63166
|
+
const id2 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
63167
|
+
entry[1].defId = id2;
|
|
63168
|
+
return { defId: id2, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id2}` };
|
|
64095
63169
|
}
|
|
64096
63170
|
if (entry[1] === root) {
|
|
64097
63171
|
return { ref: "#" };
|
|
@@ -64137,8 +63211,8 @@ function extractDefs(ctx, schema) {
|
|
|
64137
63211
|
continue;
|
|
64138
63212
|
}
|
|
64139
63213
|
}
|
|
64140
|
-
const
|
|
64141
|
-
if (
|
|
63214
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
63215
|
+
if (id2) {
|
|
64142
63216
|
extractToDef(entry);
|
|
64143
63217
|
continue;
|
|
64144
63218
|
}
|
|
@@ -64232,10 +63306,10 @@ function finalize(ctx, schema) {
|
|
|
64232
63306
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
64233
63307
|
} else if (ctx.target === "openapi-3.0") {} else {}
|
|
64234
63308
|
if (ctx.external?.uri) {
|
|
64235
|
-
const
|
|
64236
|
-
if (!
|
|
63309
|
+
const id2 = ctx.external.registry.get(schema)?.id;
|
|
63310
|
+
if (!id2)
|
|
64237
63311
|
throw new Error("Schema is missing an `id` property");
|
|
64238
|
-
result.$id = ctx.external.uri(
|
|
63312
|
+
result.$id = ctx.external.uri(id2);
|
|
64239
63313
|
}
|
|
64240
63314
|
Object.assign(result, root.def ?? root.schema);
|
|
64241
63315
|
const defs = ctx.external?.defs ?? {};
|
|
@@ -70645,7 +69719,7 @@ function createParser(callbacks) {
|
|
|
70645
69719
|
if (typeof callbacks == "function")
|
|
70646
69720
|
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
70647
69721
|
const { onEvent = noop, onError: onError4 = noop, onRetry = noop, onComment } = callbacks;
|
|
70648
|
-
let incompleteLine = "", isFirstChunk = true,
|
|
69722
|
+
let incompleteLine = "", isFirstChunk = true, id2, data = "", eventType = "";
|
|
70649
69723
|
function feed2(newChunk) {
|
|
70650
69724
|
const chunk4 = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete3, incomplete] = splitLines4(`${incompleteLine}${chunk4}`);
|
|
70651
69725
|
for (const line4 of complete3)
|
|
@@ -70679,7 +69753,7 @@ function createParser(callbacks) {
|
|
|
70679
69753
|
`;
|
|
70680
69754
|
break;
|
|
70681
69755
|
case "id":
|
|
70682
|
-
|
|
69756
|
+
id2 = value6.includes("\x00") ? undefined : value6;
|
|
70683
69757
|
break;
|
|
70684
69758
|
case "retry":
|
|
70685
69759
|
/^\d+$/.test(value6) ? onRetry(parseInt(value6, 10)) : onError4(new ParseError2(`Invalid \`retry\` value: "${value6}"`, {
|
|
@@ -70695,14 +69769,14 @@ function createParser(callbacks) {
|
|
|
70695
69769
|
}
|
|
70696
69770
|
function dispatchEvent() {
|
|
70697
69771
|
data.length > 0 && onEvent({
|
|
70698
|
-
id:
|
|
69772
|
+
id: id2,
|
|
70699
69773
|
event: eventType || undefined,
|
|
70700
69774
|
data: data.endsWith(`
|
|
70701
69775
|
`) ? data.slice(0, -1) : data
|
|
70702
|
-
}),
|
|
69776
|
+
}), id2 = undefined, data = "", eventType = "";
|
|
70703
69777
|
}
|
|
70704
69778
|
function reset2(options7 = {}) {
|
|
70705
|
-
incompleteLine && options7.consume && parseLine(incompleteLine), isFirstChunk = true,
|
|
69779
|
+
incompleteLine && options7.consume && parseLine(incompleteLine), isFirstChunk = true, id2 = undefined, data = "", eventType = "", incompleteLine = "";
|
|
70706
69780
|
}
|
|
70707
69781
|
return { feed: feed2, reset: reset2 };
|
|
70708
69782
|
}
|
|
@@ -71969,8 +71043,8 @@ function parseUnknownDef() {
|
|
|
71969
71043
|
var parseReadonlyDef = (def, refs) => {
|
|
71970
71044
|
return parseDef(def.innerType._def, refs);
|
|
71971
71045
|
};
|
|
71972
|
-
var selectParser = (def,
|
|
71973
|
-
switch (
|
|
71046
|
+
var selectParser = (def, typeName, refs) => {
|
|
71047
|
+
switch (typeName) {
|
|
71974
71048
|
case ZodFirstPartyTypeKind2.ZodString:
|
|
71975
71049
|
return parseStringDef(def, refs);
|
|
71976
71050
|
case ZodFirstPartyTypeKind2.ZodNumber:
|
|
@@ -72042,7 +71116,7 @@ var selectParser = (def, typeName2, refs) => {
|
|
|
72042
71116
|
default:
|
|
72043
71117
|
return /* @__PURE__ */ ((_) => {
|
|
72044
71118
|
return;
|
|
72045
|
-
})(
|
|
71119
|
+
})(typeName);
|
|
72046
71120
|
}
|
|
72047
71121
|
};
|
|
72048
71122
|
var getRelativePath = (pathA, pathB) => {
|
|
@@ -72444,7 +71518,7 @@ function tool(tool2) {
|
|
|
72444
71518
|
return tool2;
|
|
72445
71519
|
}
|
|
72446
71520
|
function createProviderToolFactory({
|
|
72447
|
-
id:
|
|
71521
|
+
id: id2,
|
|
72448
71522
|
inputSchema
|
|
72449
71523
|
}) {
|
|
72450
71524
|
return ({
|
|
@@ -72458,7 +71532,7 @@ function createProviderToolFactory({
|
|
|
72458
71532
|
...args2
|
|
72459
71533
|
}) => tool({
|
|
72460
71534
|
type: "provider",
|
|
72461
|
-
id:
|
|
71535
|
+
id: id2,
|
|
72462
71536
|
args: args2,
|
|
72463
71537
|
inputSchema,
|
|
72464
71538
|
outputSchema,
|
|
@@ -72471,7 +71545,7 @@ function createProviderToolFactory({
|
|
|
72471
71545
|
});
|
|
72472
71546
|
}
|
|
72473
71547
|
function createProviderToolFactoryWithOutputSchema({
|
|
72474
|
-
id:
|
|
71548
|
+
id: id2,
|
|
72475
71549
|
inputSchema,
|
|
72476
71550
|
outputSchema,
|
|
72477
71551
|
supportsDeferredResults
|
|
@@ -72486,7 +71560,7 @@ function createProviderToolFactoryWithOutputSchema({
|
|
|
72486
71560
|
...args2
|
|
72487
71561
|
}) => tool({
|
|
72488
71562
|
type: "provider",
|
|
72489
|
-
id:
|
|
71563
|
+
id: id2,
|
|
72490
71564
|
args: args2,
|
|
72491
71565
|
inputSchema,
|
|
72492
71566
|
outputSchema,
|
|
@@ -73122,7 +72196,7 @@ function prepareTools({
|
|
|
73122
72196
|
"gemini-flash-latest",
|
|
73123
72197
|
"gemini-flash-lite-latest",
|
|
73124
72198
|
"gemini-pro-latest"
|
|
73125
|
-
].some((
|
|
72199
|
+
].some((id2) => id2 === modelId);
|
|
73126
72200
|
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
|
|
73127
72201
|
const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
|
|
73128
72202
|
const supportsFileSearch = modelId.includes("gemini-2.5") || modelId.includes("gemini-3");
|
|
@@ -74085,7 +73159,7 @@ var GoogleGenerativeAIImageModel = class {
|
|
|
74085
73159
|
var _a16, _b16, _c;
|
|
74086
73160
|
const {
|
|
74087
73161
|
prompt: prompt4,
|
|
74088
|
-
n
|
|
73162
|
+
n = 1,
|
|
74089
73163
|
size: size11,
|
|
74090
73164
|
aspectRatio = "1:1",
|
|
74091
73165
|
seed,
|
|
@@ -74123,7 +73197,7 @@ var GoogleGenerativeAIImageModel = class {
|
|
|
74123
73197
|
});
|
|
74124
73198
|
const currentDate = (_c = (_b16 = (_a16 = this.config._internal) == null ? undefined : _a16.currentDate) == null ? undefined : _b16.call(_a16)) != null ? _c : /* @__PURE__ */ new Date;
|
|
74125
73199
|
const parameters = {
|
|
74126
|
-
sampleCount:
|
|
73200
|
+
sampleCount: n
|
|
74127
73201
|
};
|
|
74128
73202
|
if (aspectRatio != null) {
|
|
74129
73203
|
parameters.aspectRatio = aspectRatio;
|
|
@@ -75072,7 +74146,7 @@ var GatewayImageModel = class {
|
|
|
75072
74146
|
}
|
|
75073
74147
|
async doGenerate({
|
|
75074
74148
|
prompt: prompt4,
|
|
75075
|
-
n
|
|
74149
|
+
n,
|
|
75076
74150
|
size: size11,
|
|
75077
74151
|
aspectRatio,
|
|
75078
74152
|
seed,
|
|
@@ -75094,7 +74168,7 @@ var GatewayImageModel = class {
|
|
|
75094
74168
|
headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve3(this.config.o11yHeaders)),
|
|
75095
74169
|
body: {
|
|
75096
74170
|
prompt: prompt4,
|
|
75097
|
-
n
|
|
74171
|
+
n,
|
|
75098
74172
|
...size11 && { size: size11 },
|
|
75099
74173
|
...aspectRatio && { aspectRatio },
|
|
75100
74174
|
...seed && { seed },
|
|
@@ -75194,7 +74268,7 @@ var GatewayVideoModel = class {
|
|
|
75194
74268
|
}
|
|
75195
74269
|
async doGenerate({
|
|
75196
74270
|
prompt: prompt4,
|
|
75197
|
-
n
|
|
74271
|
+
n,
|
|
75198
74272
|
aspectRatio,
|
|
75199
74273
|
resolution,
|
|
75200
74274
|
duration: duration5,
|
|
@@ -75217,7 +74291,7 @@ var GatewayVideoModel = class {
|
|
|
75217
74291
|
headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve3(this.config.o11yHeaders)),
|
|
75218
74292
|
body: {
|
|
75219
74293
|
prompt: prompt4,
|
|
75220
|
-
n
|
|
74294
|
+
n,
|
|
75221
74295
|
...aspectRatio && { aspectRatio },
|
|
75222
74296
|
...resolution && { resolution },
|
|
75223
74297
|
...duration5 && { duration: duration5 },
|
|
@@ -76286,8 +75360,8 @@ async function convertToLanguageModelPrompt({
|
|
|
76286
75360
|
}
|
|
76287
75361
|
case "user":
|
|
76288
75362
|
case "system":
|
|
76289
|
-
for (const
|
|
76290
|
-
toolCallIds.delete(
|
|
75363
|
+
for (const id2 of approvedToolCallIds) {
|
|
75364
|
+
toolCallIds.delete(id2);
|
|
76291
75365
|
}
|
|
76292
75366
|
if (toolCallIds.size > 0) {
|
|
76293
75367
|
throw new MissingToolResultsError({
|
|
@@ -76297,8 +75371,8 @@ async function convertToLanguageModelPrompt({
|
|
|
76297
75371
|
break;
|
|
76298
75372
|
}
|
|
76299
75373
|
}
|
|
76300
|
-
for (const
|
|
76301
|
-
toolCallIds.delete(
|
|
75374
|
+
for (const id2 of approvedToolCallIds) {
|
|
75375
|
+
toolCallIds.delete(id2);
|
|
76302
75376
|
}
|
|
76303
75377
|
if (toolCallIds.size > 0) {
|
|
76304
75378
|
throw new MissingToolResultsError({ toolCallIds: Array.from(toolCallIds) });
|
|
@@ -80324,17 +79398,17 @@ class TokenCounter extends Tag2("@grepai/core/domain/token-counter/TokenCounter"
|
|
|
80324
79398
|
}
|
|
80325
79399
|
|
|
80326
79400
|
// ../core/src/internal/services/chunker-ast/ast-parser.ts
|
|
80327
|
-
|
|
79401
|
+
import Parser from "tree-sitter";
|
|
80328
79402
|
import Typescript from "tree-sitter-typescript";
|
|
80329
79403
|
class AstParser extends Service()("@grepai/core/internal/services/chunker-ast/ast-parser/AstParser", {
|
|
80330
79404
|
sync: () => {
|
|
80331
79405
|
const parse12 = fnUntraced2(function* (input) {
|
|
80332
|
-
const { content, language
|
|
79406
|
+
const { content, language } = input;
|
|
80333
79407
|
return yield* try_3({
|
|
80334
79408
|
try: () => {
|
|
80335
|
-
const parser2 = new
|
|
79409
|
+
const parser2 = new Parser;
|
|
80336
79410
|
parser2.reset();
|
|
80337
|
-
parser2.setLanguage(languageMap[
|
|
79411
|
+
parser2.setLanguage(languageMap[language]);
|
|
80338
79412
|
const tree = parser2.parse(content);
|
|
80339
79413
|
return tree;
|
|
80340
79414
|
},
|
|
@@ -80592,13 +79666,13 @@ var ChunkerAst = effect(Chunker, gen2(function* () {
|
|
|
80592
79666
|
const tokenCounter = yield* TokenCounter;
|
|
80593
79667
|
const contextHeaderBuilder = yield* ContextHeaderBuilder;
|
|
80594
79668
|
const config3 = yield* Config;
|
|
80595
|
-
const split2 = fnUntraced2(function* (node,
|
|
79669
|
+
const split2 = fnUntraced2(function* (node, language, scopeStack) {
|
|
80596
79670
|
const {
|
|
80597
79671
|
wantedNodes,
|
|
80598
79672
|
scopeNodes,
|
|
80599
79673
|
importNodes,
|
|
80600
79674
|
extractNodeName: extractNodeName3
|
|
80601
|
-
} = languageConfig[
|
|
79675
|
+
} = languageConfig[language];
|
|
80602
79676
|
const tokenCount = yield* tokenCounter.count(node.text);
|
|
80603
79677
|
const isWanted = wantedNodes.has(node.type);
|
|
80604
79678
|
const isScope = scopeNodes.has(node.type);
|
|
@@ -80632,13 +79706,13 @@ var ChunkerAst = effect(Chunker, gen2(function* () {
|
|
|
80632
79706
|
}
|
|
80633
79707
|
];
|
|
80634
79708
|
}
|
|
80635
|
-
return yield* forEach5(node.children, (child) => split2(child,
|
|
79709
|
+
return yield* forEach5(node.children, (child) => split2(child, language, nextScope), {
|
|
80636
79710
|
concurrency: "unbounded"
|
|
80637
79711
|
}).pipe(map16(flatten));
|
|
80638
79712
|
});
|
|
80639
|
-
function reMerge(chunks2, content,
|
|
79713
|
+
function reMerge(chunks2, content, language) {
|
|
80640
79714
|
const sorted = [...chunks2].sort((a, b) => a.startIndex - b.startIndex || a.endIndex - b.endIndex);
|
|
80641
|
-
const { isClosingSyntax } = languageConfig[
|
|
79715
|
+
const { isClosingSyntax } = languageConfig[language];
|
|
80642
79716
|
const output = [];
|
|
80643
79717
|
let current;
|
|
80644
79718
|
let pendingGap;
|
|
@@ -80673,9 +79747,9 @@ var ChunkerAst = effect(Chunker, gen2(function* () {
|
|
|
80673
79747
|
return output;
|
|
80674
79748
|
}
|
|
80675
79749
|
return Chunker.of({
|
|
80676
|
-
chunk: fnUntraced2(function* ({ filePath, content, language
|
|
80677
|
-
const tree = yield* astParser.parse({ content, language
|
|
80678
|
-
return yield* split2(tree.rootNode,
|
|
79750
|
+
chunk: fnUntraced2(function* ({ filePath, content, language }) {
|
|
79751
|
+
const tree = yield* astParser.parse({ content, language });
|
|
79752
|
+
return yield* split2(tree.rootNode, language, []).pipe(map16((splitChunks) => reMerge(splitChunks, content, language)), map16(map4(({ startLine, endLine, startIndex, endIndex, scope: scope4 }, index) => {
|
|
80679
79753
|
const chunkContent = content.slice(startIndex, endIndex);
|
|
80680
79754
|
const contextHeader = contextHeaderBuilder.stringify({
|
|
80681
79755
|
filePath,
|
|
@@ -80784,9 +79858,9 @@ var CodebaseScannerFs = effect(CodebaseScanner, gen2(function* () {
|
|
|
80784
79858
|
})), when5("tsx", () => ({
|
|
80785
79859
|
filePath,
|
|
80786
79860
|
language: "tsx"
|
|
80787
|
-
})), option4))), flatMap10(forEach5(({ filePath, language
|
|
79861
|
+
})), option4))), flatMap10(forEach5(({ filePath, language }) => fs.readFileString(filePath).pipe(map16((content) => ({
|
|
80788
79862
|
filePath,
|
|
80789
|
-
language
|
|
79863
|
+
language,
|
|
80790
79864
|
hash: string(content).toString(),
|
|
80791
79865
|
content
|
|
80792
79866
|
}))))));
|
|
@@ -81000,11 +80074,11 @@ class FileIndexer extends Service()("@grepai/core/internal/services/file-indexer
|
|
|
81000
80074
|
SqlError: (cause2) => new IndexerError({ cause: cause2 })
|
|
81001
80075
|
}));
|
|
81002
80076
|
const index = fnUntraced2(function* (input) {
|
|
81003
|
-
const { filePath, content, hash: hash3, language
|
|
80077
|
+
const { filePath, content, hash: hash3, language } = input;
|
|
81004
80078
|
const chunks2 = yield* chunker.chunk({
|
|
81005
80079
|
filePath,
|
|
81006
80080
|
content,
|
|
81007
|
-
language
|
|
80081
|
+
language
|
|
81008
80082
|
});
|
|
81009
80083
|
if (!isNonEmptyReadonlyArray(chunks2)) {
|
|
81010
80084
|
return;
|
|
@@ -82353,13 +81427,13 @@ class IdAlloc {
|
|
|
82353
81427
|
this.#usedIds.add(freeId);
|
|
82354
81428
|
return freeId;
|
|
82355
81429
|
}
|
|
82356
|
-
free(
|
|
82357
|
-
if (!this.#usedIds.delete(
|
|
81430
|
+
free(id2) {
|
|
81431
|
+
if (!this.#usedIds.delete(id2)) {
|
|
82358
81432
|
throw new InternalError("Freeing an id that is not allocated");
|
|
82359
81433
|
}
|
|
82360
81434
|
this.#freeIds.delete(this.#usedIds.size);
|
|
82361
|
-
if (
|
|
82362
|
-
this.#freeIds.add(
|
|
81435
|
+
if (id2 < this.#usedIds.size) {
|
|
81436
|
+
this.#freeIds.add(id2);
|
|
82363
81437
|
}
|
|
82364
81438
|
}
|
|
82365
81439
|
}
|
|
@@ -85894,10 +84968,10 @@ var make78 = (options7) => gen2(function* () {
|
|
|
85894
84968
|
scope: scope4
|
|
85895
84969
|
}) => [scope4, conn]))),
|
|
85896
84970
|
begin: () => _void,
|
|
85897
|
-
savepoint: (conn,
|
|
84971
|
+
savepoint: (conn, id2) => conn.executeRaw(`SAVEPOINT effect_sql_${id2};`, []),
|
|
85898
84972
|
commit: (conn) => conn.commit,
|
|
85899
84973
|
rollback: (conn) => conn.rollback,
|
|
85900
|
-
rollbackSavepoint: (conn,
|
|
84974
|
+
rollbackSavepoint: (conn, id2) => conn.executeRaw(`ROLLBACK TO SAVEPOINT effect_sql_${id2};`, [])
|
|
85901
84975
|
});
|
|
85902
84976
|
const acquirer = flatMap10(serviceOption2(LibsqlTransaction), match2({
|
|
85903
84977
|
onNone: () => semaphore.withPermits(1)(succeed7(connection)),
|
|
@@ -85935,7 +85009,7 @@ var fromFileSystem = (directory5) => FileSystem.pipe(flatMap10((FS) => FS.readDi
|
|
|
85935
85009
|
message: error51.message
|
|
85936
85010
|
})), map16((files) => files.map((file8) => fromNullable(file8.match(/^(?:.*\/)?(\d+)_([^.]+)\.(js|ts)$/))).flatMap(match2({
|
|
85937
85011
|
onNone: () => [],
|
|
85938
|
-
onSome: ([basename,
|
|
85012
|
+
onSome: ([basename, id2, name21]) => [[Number(id2), name21, promise2(() => import(`${directory5}/${basename}`))]]
|
|
85939
85013
|
})).sort(([a], [b]) => a - b)));
|
|
85940
85014
|
|
|
85941
85015
|
// ../../node_modules/.bun/@effect+sql-libsql@0.39.0+d00fac6ed6378613/node_modules/@effect/sql-libsql/dist/esm/LibsqlMigrator.js
|
|
@@ -86651,8 +85725,8 @@ var L = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
|
86651
85725
|
var ct = /\p{M}+/gu;
|
|
86652
85726
|
var pt = { limit: 1 / 0, ellipsis: "" };
|
|
86653
85727
|
var X = (t, e = {}, s = {}) => {
|
|
86654
|
-
const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "",
|
|
86655
|
-
let h = 0, o = 0, f = t.length, v = 0, F = false, d = f, b = Math.max(0, i -
|
|
85728
|
+
const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X(r, pt, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V = s.wideWidth ?? 2;
|
|
85729
|
+
let h = 0, o = 0, f = t.length, v = 0, F = false, d = f, b = Math.max(0, i - n), C = 0, B = 0, c = 0, p3 = 0;
|
|
86656
85730
|
t:
|
|
86657
85731
|
for (;; ) {
|
|
86658
85732
|
if (B > C || o >= f && o > h) {
|
|
@@ -86712,7 +85786,7 @@ var X = (t, e = {}, s = {}) => {
|
|
|
86712
85786
|
}
|
|
86713
85787
|
o += 1;
|
|
86714
85788
|
}
|
|
86715
|
-
return { width: F ? b : c, index: F ? d : f, truncated: F, ellipsed: F && i >=
|
|
85789
|
+
return { width: F ? b : c, index: F ? d : f, truncated: F, ellipsed: F && i >= n };
|
|
86716
85790
|
};
|
|
86717
85791
|
var ft = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
|
|
86718
85792
|
var S = (t, e = {}) => X(t, ft, e).width;
|
|
@@ -86750,10 +85824,10 @@ var it = (t) => `${W}${U}${t}${j}`;
|
|
|
86750
85824
|
var gt = (t) => t.map((e) => S(e));
|
|
86751
85825
|
var G = (t, e, s) => {
|
|
86752
85826
|
const i = e[Symbol.iterator]();
|
|
86753
|
-
let r = false,
|
|
85827
|
+
let r = false, n = false, u = t.at(-1), a = u === undefined ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
|
|
86754
85828
|
for (;!l.done; ) {
|
|
86755
85829
|
const m = l.value, A = S(m);
|
|
86756
|
-
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === W || m === Z) && (r = true,
|
|
85830
|
+
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === W || m === Z) && (r = true, n = e.startsWith(U, g + 1)), r ? n ? m === j && (r = false, n = false) : m === tt && (r = false) : (a += A, a === s && !E.done && (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
|
|
86757
85831
|
}
|
|
86758
85832
|
u = t.at(-1), !a && u !== undefined && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
86759
85833
|
};
|
|
@@ -86767,7 +85841,7 @@ var vt = (t) => {
|
|
|
86767
85841
|
var Et = (t, e, s = {}) => {
|
|
86768
85842
|
if (s.trim !== false && t.trim() === "")
|
|
86769
85843
|
return "";
|
|
86770
|
-
let i = "", r,
|
|
85844
|
+
let i = "", r, n;
|
|
86771
85845
|
const u = t.split(" "), a = gt(u);
|
|
86772
85846
|
let l = [""];
|
|
86773
85847
|
for (const [h, o] of u.entries()) {
|
|
@@ -86804,12 +85878,12 @@ var Et = (t, e, s = {}) => {
|
|
|
86804
85878
|
const d = Number.parseFloat(F.code);
|
|
86805
85879
|
r = d === Ft ? undefined : d;
|
|
86806
85880
|
} else
|
|
86807
|
-
F?.uri !== undefined && (
|
|
85881
|
+
F?.uri !== undefined && (n = F.uri.length === 0 ? undefined : F.uri);
|
|
86808
85882
|
}
|
|
86809
85883
|
const f = r ? mt(r) : undefined;
|
|
86810
85884
|
o === `
|
|
86811
|
-
` ? (
|
|
86812
|
-
` && (r && f && (i += st(r)),
|
|
85885
|
+
` ? (n && (i += it("")), r && f && (i += st(f))) : h === `
|
|
85886
|
+
` && (r && f && (i += st(r)), n && (i += it(n))), V += h.length, m = A, A = g.next();
|
|
86813
85887
|
}
|
|
86814
85888
|
return i;
|
|
86815
85889
|
};
|
|
@@ -86851,10 +85925,10 @@ function _t(t, e) {
|
|
|
86851
85925
|
return;
|
|
86852
85926
|
const s = t.split(`
|
|
86853
85927
|
`), i = e.split(`
|
|
86854
|
-
`), r = Math.max(s.length, i.length),
|
|
85928
|
+
`), r = Math.max(s.length, i.length), n = [];
|
|
86855
85929
|
for (let u = 0;u < r; u++)
|
|
86856
|
-
s[u] !== i[u] &&
|
|
86857
|
-
return { lines:
|
|
85930
|
+
s[u] !== i[u] && n.push(u);
|
|
85931
|
+
return { lines: n, numLinesBefore: s.length, numLinesAfter: i.length, numLines: r };
|
|
86858
85932
|
}
|
|
86859
85933
|
var bt = globalThis.process.platform.startsWith("win");
|
|
86860
85934
|
var z2 = Symbol("clack:cancel");
|
|
@@ -86868,7 +85942,7 @@ function T(t, e) {
|
|
|
86868
85942
|
function xt({ input: t = q, output: e = R, overwrite: s = true, hideCursor: i = true } = {}) {
|
|
86869
85943
|
const r = k.createInterface({ input: t, output: e, prompt: "", tabSize: 1 });
|
|
86870
85944
|
k.emitKeypressEvents(t, r), t instanceof J && t.isTTY && t.setRawMode(true);
|
|
86871
|
-
const
|
|
85945
|
+
const n = (u, { name: a, sequence: l }) => {
|
|
86872
85946
|
const E = String(u);
|
|
86873
85947
|
if (H([E, a, l], "cancel")) {
|
|
86874
85948
|
i && e.write(import_sisteransi.cursor.show), process.exit(0);
|
|
@@ -86879,12 +85953,12 @@ function xt({ input: t = q, output: e = R, overwrite: s = true, hideCursor: i =
|
|
|
86879
85953
|
const g = a === "return" ? 0 : -1, m = a === "return" ? -1 : 0;
|
|
86880
85954
|
k.moveCursor(e, g, m, () => {
|
|
86881
85955
|
k.clearLine(e, 1, () => {
|
|
86882
|
-
t.once("keypress",
|
|
85956
|
+
t.once("keypress", n);
|
|
86883
85957
|
});
|
|
86884
85958
|
});
|
|
86885
85959
|
};
|
|
86886
|
-
return i && e.write(import_sisteransi.cursor.hide), t.once("keypress",
|
|
86887
|
-
t.off("keypress",
|
|
85960
|
+
return i && e.write(import_sisteransi.cursor.hide), t.once("keypress", n), () => {
|
|
85961
|
+
t.off("keypress", n), i && e.write(import_sisteransi.cursor.show), t instanceof J && t.isTTY && !bt && t.setRawMode(false), r.terminal = false, r.close();
|
|
86888
85962
|
};
|
|
86889
85963
|
}
|
|
86890
85964
|
var rt = (t) => ("columns" in t) && typeof t.columns == "number" ? t.columns : 80;
|
|
@@ -86892,7 +85966,7 @@ var nt = (t) => ("rows" in t) && typeof t.rows == "number" ? t.rows : 20;
|
|
|
86892
85966
|
function Bt(t, e, s, i = s) {
|
|
86893
85967
|
const r = rt(t ?? R);
|
|
86894
85968
|
return K(e, r - s.length, { hard: true, trim: false }).split(`
|
|
86895
|
-
`).map((
|
|
85969
|
+
`).map((n, u) => `${u === 0 ? i : s}${n}`).join(`
|
|
86896
85970
|
`);
|
|
86897
85971
|
}
|
|
86898
85972
|
|
|
@@ -86912,8 +85986,8 @@ class x {
|
|
|
86912
85986
|
value;
|
|
86913
85987
|
userInput = "";
|
|
86914
85988
|
constructor(e, s = true) {
|
|
86915
|
-
const { input: i = q, output: r = R, render:
|
|
86916
|
-
this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render =
|
|
85989
|
+
const { input: i = q, output: r = R, render: n, signal: u, ...a } = e;
|
|
85990
|
+
this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = u, this.input = i, this.output = r;
|
|
86917
85991
|
}
|
|
86918
85992
|
unsubscribe() {
|
|
86919
85993
|
this._subscribers.clear();
|
|
@@ -86930,10 +86004,10 @@ class x {
|
|
|
86930
86004
|
}
|
|
86931
86005
|
emit(e, ...s) {
|
|
86932
86006
|
const i = this._subscribers.get(e) ?? [], r = [];
|
|
86933
|
-
for (const
|
|
86934
|
-
|
|
86935
|
-
for (const
|
|
86936
|
-
|
|
86007
|
+
for (const n of i)
|
|
86008
|
+
n.cb(...s), n.once && r.push(() => i.splice(i.indexOf(n), 1));
|
|
86009
|
+
for (const n of r)
|
|
86010
|
+
n();
|
|
86937
86011
|
}
|
|
86938
86012
|
prompt() {
|
|
86939
86013
|
return new Promise((e) => {
|
|
@@ -86990,23 +86064,23 @@ class x {
|
|
|
86990
86064
|
else {
|
|
86991
86065
|
const s = _t(this._prevFrame, e), i = nt(this.output);
|
|
86992
86066
|
if (this.restoreCursor(), s) {
|
|
86993
|
-
const r = Math.max(0, s.numLinesAfter - i),
|
|
86067
|
+
const r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i);
|
|
86994
86068
|
let u = s.lines.find((a) => a >= r);
|
|
86995
86069
|
if (u === undefined) {
|
|
86996
86070
|
this._prevFrame = e;
|
|
86997
86071
|
return;
|
|
86998
86072
|
}
|
|
86999
86073
|
if (s.lines.length === 1) {
|
|
87000
|
-
this.output.write(import_sisteransi.cursor.move(0, u -
|
|
86074
|
+
this.output.write(import_sisteransi.cursor.move(0, u - n)), this.output.write(import_sisteransi.erase.lines(1));
|
|
87001
86075
|
const a = e.split(`
|
|
87002
86076
|
`);
|
|
87003
86077
|
this.output.write(a[u]), this._prevFrame = e, this.output.write(import_sisteransi.cursor.move(0, a.length - u - 1));
|
|
87004
86078
|
return;
|
|
87005
86079
|
} else if (s.lines.length > 1) {
|
|
87006
|
-
if (r <
|
|
86080
|
+
if (r < n)
|
|
87007
86081
|
u = r;
|
|
87008
86082
|
else {
|
|
87009
|
-
const l = u -
|
|
86083
|
+
const l = u - n;
|
|
87010
86084
|
l > 0 && this.output.write(import_sisteransi.cursor.move(0, l));
|
|
87011
86085
|
}
|
|
87012
86086
|
this.output.write(import_sisteransi.erase.down());
|
|
@@ -87068,17 +86142,17 @@ class Vt extends x {
|
|
|
87068
86142
|
let i;
|
|
87069
86143
|
if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i = e.initialValue : i = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i = [this.options[0].value]), i)
|
|
87070
86144
|
for (const r of i) {
|
|
87071
|
-
const
|
|
87072
|
-
|
|
86145
|
+
const n = s.findIndex((u) => u.value === r);
|
|
86146
|
+
n !== -1 && (this.toggleSelected(r), this.#t = n);
|
|
87073
86147
|
}
|
|
87074
|
-
this.focusedValue = this.options[this.#t]?.value, this.on("key", (r,
|
|
86148
|
+
this.focusedValue = this.options[this.#t]?.value, this.on("key", (r, n) => this.#r(r, n)), this.on("userInput", (r) => this.#n(r));
|
|
87075
86149
|
}
|
|
87076
86150
|
_isActionKey(e, s) {
|
|
87077
86151
|
return e === "\t" || this.multiple && this.isNavigating && s.name === "space" && e !== undefined && e !== "";
|
|
87078
86152
|
}
|
|
87079
86153
|
#r(e, s) {
|
|
87080
|
-
const i = s.name === "up", r = s.name === "down",
|
|
87081
|
-
i || r ? (this.#t = Math.max(0, Math.min(this.#t + (i ? -1 : 1), this.filteredOptions.length - 1)), this.focusedValue = this.filteredOptions[this.#t]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) :
|
|
86154
|
+
const i = s.name === "up", r = s.name === "down", n = s.name === "return";
|
|
86155
|
+
i || r ? (this.#t = Math.max(0, Math.min(this.#t + (i ? -1 : 1), this.filteredOptions.length - 1)), this.focusedValue = this.filteredOptions[this.#t]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = St(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
|
|
87082
86156
|
}
|
|
87083
86157
|
deselectAll() {
|
|
87084
86158
|
this.selectedValues = [];
|
|
@@ -87128,7 +86202,7 @@ class yt extends x {
|
|
|
87128
86202
|
const e = this.options[this.cursor];
|
|
87129
86203
|
if (this.value === undefined && (this.value = []), e.group === true) {
|
|
87130
86204
|
const s = e.value, i = this.getGroupItems(s);
|
|
87131
|
-
this.isGroupSelected(s) ? this.value = this.value.filter((r) => i.findIndex((
|
|
86205
|
+
this.isGroupSelected(s) ? this.value = this.value.filter((r) => i.findIndex((n) => n.value === r) === -1) : this.value = [...this.value, ...i.map((r) => r.value)], this.value = Array.from(new Set(this.value));
|
|
87132
86206
|
} else {
|
|
87133
86207
|
const s = this.value.includes(e.value);
|
|
87134
86208
|
this.value = s ? this.value.filter((i) => i !== e.value) : [...this.value, e.value];
|
|
@@ -87137,7 +86211,7 @@ class yt extends x {
|
|
|
87137
86211
|
constructor(e) {
|
|
87138
86212
|
super(e, false);
|
|
87139
86213
|
const { options: s } = e;
|
|
87140
|
-
this.#t = e.selectableGroups !== false, this.options = Object.entries(s).flatMap(([i, r]) => [{ value: i, group: true, label: i }, ...r.map((
|
|
86214
|
+
this.#t = e.selectableGroups !== false, this.options = Object.entries(s).flatMap(([i, r]) => [{ value: i, group: true, label: i }, ...r.map((n) => ({ ...n, group: i }))]), this.value = [...e.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), this.#t ? 0 : 1), this.on("cursor", (i) => {
|
|
87141
86215
|
switch (i) {
|
|
87142
86216
|
case "left":
|
|
87143
86217
|
case "up": {
|
|
@@ -87161,8 +86235,8 @@ class yt extends x {
|
|
|
87161
86235
|
}
|
|
87162
86236
|
}
|
|
87163
86237
|
function D(t, e, s) {
|
|
87164
|
-
const i = t + e, r = Math.max(s.length - 1, 0),
|
|
87165
|
-
return s[
|
|
86238
|
+
const i = t + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
|
|
86239
|
+
return s[n].disabled ? D(n, e < 0 ? -1 : 1, s) : n;
|
|
87166
86240
|
}
|
|
87167
86241
|
|
|
87168
86242
|
class Mt extends x {
|
|
@@ -87273,10 +86347,10 @@ class Tt extends x {
|
|
|
87273
86347
|
constructor(e) {
|
|
87274
86348
|
super(e, false), this.options = e.options;
|
|
87275
86349
|
const s = e.caseSensitive === true, i = this.options.map(({ value: [r] }) => s ? r : r?.toLowerCase());
|
|
87276
|
-
this.cursor = Math.max(i.indexOf(e.initialValue), 0), this.on("key", (r,
|
|
86350
|
+
this.cursor = Math.max(i.indexOf(e.initialValue), 0), this.on("key", (r, n) => {
|
|
87277
86351
|
if (!r)
|
|
87278
86352
|
return;
|
|
87279
|
-
const u = s &&
|
|
86353
|
+
const u = s && n.shift ? r.toUpperCase() : r;
|
|
87280
86354
|
if (!i.includes(u))
|
|
87281
86355
|
return;
|
|
87282
86356
|
const a = this.options.find(({ value: [l] }) => s ? l === u : l?.toLowerCase() === r);
|
|
@@ -87383,7 +86457,7 @@ var ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
|
87383
86457
|
var ft2 = /\p{M}+/gu;
|
|
87384
86458
|
var Ft2 = { limit: 1 / 0, ellipsis: "" };
|
|
87385
86459
|
var Le = (e, r = {}, s = {}) => {
|
|
87386
|
-
const i = r.limit ?? 1 / 0,
|
|
86460
|
+
const i = r.limit ?? 1 / 0, n = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (n ? Le(n, Ft2, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, a = s.tabWidth ?? 8, d = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, E = s.fullWidthWidth ?? 2, p3 = s.regularWidth ?? 1, y2 = s.wideWidth ?? 2;
|
|
87387
86461
|
let $ = 0, c = 0, m = e.length, f = 0, F = false, v = m, S2 = Math.max(0, i - o), B = 0, b = 0, A = 0, C = 0;
|
|
87388
86462
|
e:
|
|
87389
86463
|
for (;; ) {
|
|
@@ -87482,10 +86556,10 @@ var Ue = (e) => `${ae}${we}${e}${Ce}`;
|
|
|
87482
86556
|
var Ct2 = (e) => e.map((r) => M2(r));
|
|
87483
86557
|
var Se = (e, r, s) => {
|
|
87484
86558
|
const i = r[Symbol.iterator]();
|
|
87485
|
-
let
|
|
86559
|
+
let n = false, o = false, u = e.at(-1), l = u === undefined ? 0 : M2(u), a = i.next(), d = i.next(), g = 0;
|
|
87486
86560
|
for (;!a.done; ) {
|
|
87487
86561
|
const E = a.value, p3 = M2(E);
|
|
87488
|
-
l + p3 <= s ? e[e.length - 1] += E : (e.push(E), l = 0), (E === ae || E === je) && (
|
|
86562
|
+
l + p3 <= s ? e[e.length - 1] += E : (e.push(E), l = 0), (E === ae || E === je) && (n = true, o = r.startsWith(we, g + 1)), n ? o ? E === Ce && (n = false, o = false) : E === ke && (n = false) : (l += p3, l === s && !d.done && (e.push(""), l = 0)), a = d, d = i.next(), g += E.length;
|
|
87489
86563
|
}
|
|
87490
86564
|
u = e.at(-1), !l && u !== undefined && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
87491
86565
|
};
|
|
@@ -87499,7 +86573,7 @@ var wt2 = (e) => {
|
|
|
87499
86573
|
var St2 = (e, r, s = {}) => {
|
|
87500
86574
|
if (s.trim !== false && e.trim() === "")
|
|
87501
86575
|
return "";
|
|
87502
|
-
let i = "",
|
|
86576
|
+
let i = "", n, o;
|
|
87503
86577
|
const u = e.split(" "), l = Ct2(u);
|
|
87504
86578
|
let a = [""];
|
|
87505
86579
|
for (const [$, c] of u.entries()) {
|
|
@@ -87534,14 +86608,14 @@ var St2 = (e, r, s = {}) => {
|
|
|
87534
86608
|
const F = Ge.exec(d)?.groups;
|
|
87535
86609
|
if (F?.code !== undefined) {
|
|
87536
86610
|
const v = Number.parseFloat(F.code);
|
|
87537
|
-
|
|
86611
|
+
n = v === Et2 ? undefined : v;
|
|
87538
86612
|
} else
|
|
87539
86613
|
F?.uri !== undefined && (o = F.uri.length === 0 ? undefined : F.uri);
|
|
87540
86614
|
}
|
|
87541
|
-
const m =
|
|
86615
|
+
const m = n ? At2(n) : undefined;
|
|
87542
86616
|
c === `
|
|
87543
|
-
` ? (o && (i += Ue("")),
|
|
87544
|
-
` && (
|
|
86617
|
+
` ? (o && (i += Ue("")), n && m && (i += He(m))) : $ === `
|
|
86618
|
+
` && (n && m && (i += He(n)), o && (i += Ue(o))), y2 += $.length, E = p3, p3 = g.next();
|
|
87545
86619
|
}
|
|
87546
86620
|
return i;
|
|
87547
86621
|
};
|
|
@@ -87552,17 +86626,17 @@ function q2(e, r, s) {
|
|
|
87552
86626
|
`).map((i) => St2(i, r, s)).join(`
|
|
87553
86627
|
`);
|
|
87554
86628
|
}
|
|
87555
|
-
var It2 = (e, r, s, i,
|
|
86629
|
+
var It2 = (e, r, s, i, n) => {
|
|
87556
86630
|
let o = r, u = 0;
|
|
87557
86631
|
for (let l = s;l < i; l++) {
|
|
87558
86632
|
const a = e[l];
|
|
87559
|
-
if (o = o - a.length, u++, o <=
|
|
86633
|
+
if (o = o - a.length, u++, o <= n)
|
|
87560
86634
|
break;
|
|
87561
86635
|
}
|
|
87562
86636
|
return { lineCount: o, removals: u };
|
|
87563
86637
|
};
|
|
87564
86638
|
var J2 = (e) => {
|
|
87565
|
-
const { cursor: r, options: s, style: i } = e,
|
|
86639
|
+
const { cursor: r, options: s, style: i } = e, n = e.output ?? process.stdout, o = rt(n), u = e.columnPadding ?? 0, l = e.rowPadding ?? 4, a = o - u, d = nt(n), g = import_picocolors2.default.dim("..."), E = e.maxItems ?? Number.POSITIVE_INFINITY, p3 = Math.max(d - l, 0), y2 = Math.max(Math.min(E, p3), 5);
|
|
87566
86640
|
let $ = 0;
|
|
87567
86641
|
r >= y2 - 3 && ($ = Math.max(Math.min(r - y2 + 3, s.length - y2), 0));
|
|
87568
86642
|
let c = y2 < s.length && $ > 0, m = y2 < s.length && $ + y2 < s.length;
|
|
@@ -87593,8 +86667,8 @@ function Ke(e) {
|
|
|
87593
86667
|
function qe(e, r) {
|
|
87594
86668
|
if (!e)
|
|
87595
86669
|
return true;
|
|
87596
|
-
const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(),
|
|
87597
|
-
return s.includes(o) || i.includes(o) ||
|
|
86670
|
+
const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(), n = String(r.value).toLowerCase(), o = e.toLowerCase();
|
|
86671
|
+
return s.includes(o) || i.includes(o) || n.includes(o);
|
|
87598
86672
|
}
|
|
87599
86673
|
function Bt2(e, r) {
|
|
87600
86674
|
const s = [];
|
|
@@ -87603,7 +86677,7 @@ function Bt2(e, r) {
|
|
|
87603
86677
|
return s;
|
|
87604
86678
|
}
|
|
87605
86679
|
var Je = (e) => new Vt({ options: e.options, initialValue: e.initialValue ? [e.initialValue] : undefined, initialUserInput: e.initialUserInput, filter: e.filter ?? ((r, s) => qe(r, s)), signal: e.signal, input: e.input, output: e.output, validate: e.validate, render() {
|
|
87606
|
-
const r = [`${import_picocolors2.default.gray(h)}`, `${N2(this.state)} ${e.message}`], s = this.userInput, i = this.options,
|
|
86680
|
+
const r = [`${import_picocolors2.default.gray(h)}`, `${N2(this.state)} ${e.message}`], s = this.userInput, i = this.options, n = e.placeholder, o = s === "" && n !== undefined;
|
|
87607
86681
|
switch (this.state) {
|
|
87608
86682
|
case "submit": {
|
|
87609
86683
|
const u = Bt2(this.selectedValues, i), l = u.length > 0 ? ` ${import_picocolors2.default.dim(u.map(Ke).join(", "))}` : "";
|
|
@@ -87621,7 +86695,7 @@ ${import_picocolors2.default.gray(h)}${u}`;
|
|
|
87621
86695
|
const u = `${(this.state === "error" ? import_picocolors2.default.yellow : import_picocolors2.default.cyan)(h)} `, l = (this.state === "error" ? import_picocolors2.default.yellow : import_picocolors2.default.cyan)(x2);
|
|
87622
86696
|
let a = "";
|
|
87623
86697
|
if (this.isNavigating || o) {
|
|
87624
|
-
const c = o ?
|
|
86698
|
+
const c = o ? n : s;
|
|
87625
86699
|
a = c !== "" ? ` ${import_picocolors2.default.dim(c)}` : "";
|
|
87626
86700
|
} else
|
|
87627
86701
|
a = ` ${this.userInputWithCursor}`;
|
|
@@ -87637,23 +86711,23 @@ ${import_picocolors2.default.gray(h)}${u}`;
|
|
|
87637
86711
|
}
|
|
87638
86712
|
} }).prompt();
|
|
87639
86713
|
var bt2 = (e) => {
|
|
87640
|
-
const r = (i,
|
|
86714
|
+
const r = (i, n, o, u) => {
|
|
87641
86715
|
const l = o.includes(i.value), a = i.label ?? String(i.value ?? ""), d = i.hint && u !== undefined && i.value === u ? import_picocolors2.default.dim(` (${i.hint})`) : "", g = l ? import_picocolors2.default.green(G2) : import_picocolors2.default.dim(z3);
|
|
87642
|
-
return
|
|
87643
|
-
}, s = new Vt({ options: e.options, multiple: true, filter: e.filter ?? ((i,
|
|
86716
|
+
return n ? `${g} ${a}${d}` : `${g} ${import_picocolors2.default.dim(a)}`;
|
|
86717
|
+
}, s = new Vt({ options: e.options, multiple: true, filter: e.filter ?? ((i, n) => qe(i, n)), validate: () => {
|
|
87644
86718
|
if (e.required && s.selectedValues.length === 0)
|
|
87645
86719
|
return "Please select at least one item";
|
|
87646
86720
|
}, initialValue: e.initialValues, signal: e.signal, input: e.input, output: e.output, render() {
|
|
87647
86721
|
const i = `${import_picocolors2.default.gray(h)}
|
|
87648
86722
|
${N2(this.state)} ${e.message}
|
|
87649
|
-
`,
|
|
86723
|
+
`, n = this.userInput, o = e.placeholder, u = n === "" && o !== undefined, l = this.isNavigating || u ? import_picocolors2.default.dim(u ? o : n) : this.userInputWithCursor, a = this.options, d = this.filteredOptions.length !== a.length ? import_picocolors2.default.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "";
|
|
87650
86724
|
switch (this.state) {
|
|
87651
86725
|
case "submit":
|
|
87652
86726
|
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.dim(`${this.selectedValues.length} items selected`)}`;
|
|
87653
86727
|
case "cancel":
|
|
87654
|
-
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(
|
|
86728
|
+
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}`;
|
|
87655
86729
|
default: {
|
|
87656
|
-
const g = this.state === "error" ? import_picocolors2.default.yellow : import_picocolors2.default.cyan, E = [`${import_picocolors2.default.dim("\u2191/\u2193")} to navigate`, `${import_picocolors2.default.dim(this.isNavigating ? "Space/Tab:" : "Tab:")} select`, `${import_picocolors2.default.dim("Enter:")} confirm`, `${import_picocolors2.default.dim("Type:")} to search`], p3 = this.filteredOptions.length === 0 &&
|
|
86730
|
+
const g = this.state === "error" ? import_picocolors2.default.yellow : import_picocolors2.default.cyan, E = [`${import_picocolors2.default.dim("\u2191/\u2193")} to navigate`, `${import_picocolors2.default.dim(this.isNavigating ? "Space/Tab:" : "Tab:")} select`, `${import_picocolors2.default.dim("Enter:")} confirm`, `${import_picocolors2.default.dim("Type:")} to search`], p3 = this.filteredOptions.length === 0 && n ? [`${g(h)} ${import_picocolors2.default.yellow("No matches found")}`] : [], y2 = this.state === "error" ? [`${g(h)} ${import_picocolors2.default.yellow(this.error)}`] : [], $ = [...`${i}${g(h)}`.split(`
|
|
87657
86731
|
`), `${g(h)} ${import_picocolors2.default.dim("Search:")} ${l}${d}`, ...p3, ...y2], c = [`${g(h)} ${import_picocolors2.default.dim(E.join(" \u2022 "))}`, `${g(x2)}`], m = J2({ cursor: this.cursor, options: this.filteredOptions, style: (f, F) => r(f, F, this.selectedValues, this.focusedValue), maxItems: e.maxItems, output: e.output, rowPadding: $.length + c.length });
|
|
87658
86732
|
return [...$, ...m.map((f) => `${g(h)} ${f}`), ...c].join(`
|
|
87659
86733
|
`);
|
|
@@ -87665,13 +86739,13 @@ ${N2(this.state)} ${e.message}
|
|
|
87665
86739
|
var xt2 = [We, he, pe, me];
|
|
87666
86740
|
var _t2 = [$e, Re, x2, Oe];
|
|
87667
86741
|
function Xe(e, r, s, i) {
|
|
87668
|
-
let
|
|
87669
|
-
return i === "center" ?
|
|
86742
|
+
let n = s, o = s;
|
|
86743
|
+
return i === "center" ? n = Math.floor((r - e) / 2) : i === "right" && (n = r - e - s), o = r - n - e, [n, o];
|
|
87670
86744
|
}
|
|
87671
86745
|
var Dt2 = (e) => e;
|
|
87672
86746
|
var Tt2 = (e = "", r = "", s) => {
|
|
87673
|
-
const i = s?.output ?? process.stdout,
|
|
87674
|
-
let f = Math.floor(
|
|
86747
|
+
const i = s?.output ?? process.stdout, n = rt(i), o = 2, u = s?.titlePadding ?? 1, l = s?.contentPadding ?? 2, a = s?.width === undefined || s.width === "auto" ? 1 : Math.min(1, s.width), d = (s?.withGuide ?? _.withGuide) !== false ? `${h} ` : "", g = s?.formatBorder ?? Dt2, E = ((s?.rounded) ? xt2 : _t2).map(g), p3 = g(se), y2 = g(h), $ = M2(d), c = M2(r), m = n - $;
|
|
86748
|
+
let f = Math.floor(n * a) - $;
|
|
87675
86749
|
if (s?.width === "auto") {
|
|
87676
86750
|
const _2 = e.split(`
|
|
87677
86751
|
`);
|
|
@@ -87702,12 +86776,12 @@ var Mt2 = (e) => {
|
|
|
87702
86776
|
return new kt({ active: r, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
|
|
87703
86777
|
const i = `${import_picocolors2.default.gray(h)}
|
|
87704
86778
|
${N2(this.state)} ${e.message}
|
|
87705
|
-
`,
|
|
86779
|
+
`, n = this.value ? r : s;
|
|
87706
86780
|
switch (this.state) {
|
|
87707
86781
|
case "submit":
|
|
87708
|
-
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.dim(
|
|
86782
|
+
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.dim(n)}`;
|
|
87709
86783
|
case "cancel":
|
|
87710
|
-
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(
|
|
86784
|
+
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}
|
|
87711
86785
|
${import_picocolors2.default.gray(h)}`;
|
|
87712
86786
|
default:
|
|
87713
86787
|
return `${i}${import_picocolors2.default.cyan(h)} ${this.value ? `${import_picocolors2.default.green(Y)} ${r}` : `${import_picocolors2.default.dim(K2)} ${import_picocolors2.default.dim(r)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(K2)} ${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.green(Y)} ${s}`}
|
|
@@ -87718,15 +86792,15 @@ ${import_picocolors2.default.cyan(x2)}
|
|
|
87718
86792
|
};
|
|
87719
86793
|
var Rt = async (e, r) => {
|
|
87720
86794
|
const s = {}, i = Object.keys(e);
|
|
87721
|
-
for (const
|
|
87722
|
-
const o = e[
|
|
86795
|
+
for (const n of i) {
|
|
86796
|
+
const o = e[n], u = await o({ results: s })?.catch((l) => {
|
|
87723
86797
|
throw l;
|
|
87724
86798
|
});
|
|
87725
86799
|
if (typeof r?.onCancel == "function" && Ct(u)) {
|
|
87726
|
-
s[
|
|
86800
|
+
s[n] = "canceled", r.onCancel({ results: s });
|
|
87727
86801
|
continue;
|
|
87728
86802
|
}
|
|
87729
|
-
s[
|
|
86803
|
+
s[n] = u;
|
|
87730
86804
|
}
|
|
87731
86805
|
return s;
|
|
87732
86806
|
};
|
|
@@ -87757,9 +86831,9 @@ ${import_picocolors2.default.cyan(h)}`;
|
|
|
87757
86831
|
return `${import_picocolors2.default.dim(a)}`;
|
|
87758
86832
|
const $ = d || r ? import_picocolors2.default.dim(z3) : "";
|
|
87759
86833
|
return `${y2}${import_picocolors2.default.dim(p3)}${$} ${import_picocolors2.default.dim(a)}`;
|
|
87760
|
-
},
|
|
87761
|
-
return new yt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required:
|
|
87762
|
-
if (
|
|
86834
|
+
}, n = e.required ?? true;
|
|
86835
|
+
return new yt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: n, cursorAt: e.cursorAt, selectableGroups: r, validate(o) {
|
|
86836
|
+
if (n && (o === undefined || o.length === 0))
|
|
87763
86837
|
return `Please select at least one option.
|
|
87764
86838
|
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
87765
86839
|
}, render() {
|
|
@@ -87804,9 +86878,9 @@ ${import_picocolors2.default.cyan(x2)}
|
|
|
87804
86878
|
}
|
|
87805
86879
|
} }).prompt();
|
|
87806
86880
|
};
|
|
87807
|
-
var R2 = { message: (e = [], { symbol: r = import_picocolors2.default.gray(h), secondarySymbol: s = import_picocolors2.default.gray(h), output: i = process.stdout, spacing:
|
|
86881
|
+
var R2 = { message: (e = [], { symbol: r = import_picocolors2.default.gray(h), secondarySymbol: s = import_picocolors2.default.gray(h), output: i = process.stdout, spacing: n = 1, withGuide: o } = {}) => {
|
|
87808
86882
|
const u = [], l = (o ?? _.withGuide) !== false, a = l ? s : "", d = l ? `${r} ` : "", g = l ? `${s} ` : "";
|
|
87809
|
-
for (let p3 = 0;p3 <
|
|
86883
|
+
for (let p3 = 0;p3 < n; p3++)
|
|
87810
86884
|
u.push(a);
|
|
87811
86885
|
const E = Array.isArray(e) ? e : e.split(`
|
|
87812
86886
|
`);
|
|
@@ -87851,16 +86925,16 @@ var Q2 = (e, r) => e.split(`
|
|
|
87851
86925
|
`).map((s) => r(s)).join(`
|
|
87852
86926
|
`);
|
|
87853
86927
|
var Lt2 = (e) => {
|
|
87854
|
-
const r = (i,
|
|
86928
|
+
const r = (i, n) => {
|
|
87855
86929
|
const o = i.label ?? String(i.value);
|
|
87856
|
-
return
|
|
86930
|
+
return n === "disabled" ? `${import_picocolors2.default.gray(z3)} ${Q2(o, (u) => import_picocolors2.default.strikethrough(import_picocolors2.default.gray(u)))}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint ?? "disabled"})`)}` : ""}` : n === "active" ? `${import_picocolors2.default.cyan(te)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "selected" ? `${import_picocolors2.default.green(G2)} ${Q2(o, import_picocolors2.default.dim)}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "cancelled" ? `${Q2(o, (u) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(u)))}` : n === "active-selected" ? `${import_picocolors2.default.green(G2)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n === "submitted" ? `${Q2(o, import_picocolors2.default.dim)}` : `${import_picocolors2.default.dim(z3)} ${Q2(o, import_picocolors2.default.dim)}`;
|
|
87857
86931
|
}, s = e.required ?? true;
|
|
87858
86932
|
return new Mt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: s, cursorAt: e.cursorAt, validate(i) {
|
|
87859
86933
|
if (s && (i === undefined || i.length === 0))
|
|
87860
86934
|
return `Please select at least one option.
|
|
87861
86935
|
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
87862
86936
|
}, render() {
|
|
87863
|
-
const i = Bt(e.output, e.message, `${Ee(this.state)} `, `${N2(this.state)} `),
|
|
86937
|
+
const i = Bt(e.output, e.message, `${Ee(this.state)} `, `${N2(this.state)} `), n = `${import_picocolors2.default.gray(h)}
|
|
87864
86938
|
${i}
|
|
87865
86939
|
`, o = this.value ?? [], u = (l, a) => {
|
|
87866
86940
|
if (l.disabled)
|
|
@@ -87871,31 +86945,31 @@ ${i}
|
|
|
87871
86945
|
switch (this.state) {
|
|
87872
86946
|
case "submit": {
|
|
87873
86947
|
const l = this.options.filter(({ value: d }) => o.includes(d)).map((d) => r(d, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none"), a = Bt(e.output, l, `${import_picocolors2.default.gray(h)} `);
|
|
87874
|
-
return `${
|
|
86948
|
+
return `${n}${a}`;
|
|
87875
86949
|
}
|
|
87876
86950
|
case "cancel": {
|
|
87877
86951
|
const l = this.options.filter(({ value: d }) => o.includes(d)).map((d) => r(d, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
87878
86952
|
if (l.trim() === "")
|
|
87879
|
-
return `${
|
|
86953
|
+
return `${n}${import_picocolors2.default.gray(h)}`;
|
|
87880
86954
|
const a = Bt(e.output, l, `${import_picocolors2.default.gray(h)} `);
|
|
87881
|
-
return `${
|
|
86955
|
+
return `${n}${a}
|
|
87882
86956
|
${import_picocolors2.default.gray(h)}`;
|
|
87883
86957
|
}
|
|
87884
86958
|
case "error": {
|
|
87885
86959
|
const l = `${import_picocolors2.default.yellow(h)} `, a = this.error.split(`
|
|
87886
86960
|
`).map((E, p3) => p3 === 0 ? `${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow(E)}` : ` ${E}`).join(`
|
|
87887
|
-
`), d =
|
|
86961
|
+
`), d = n.split(`
|
|
87888
86962
|
`).length, g = a.split(`
|
|
87889
86963
|
`).length + 1;
|
|
87890
|
-
return `${
|
|
86964
|
+
return `${n}${l}${J2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, rowPadding: d + g, style: u }).join(`
|
|
87891
86965
|
${l}`)}
|
|
87892
86966
|
${a}
|
|
87893
86967
|
`;
|
|
87894
86968
|
}
|
|
87895
86969
|
default: {
|
|
87896
|
-
const l = `${import_picocolors2.default.cyan(h)} `, a =
|
|
86970
|
+
const l = `${import_picocolors2.default.cyan(h)} `, a = n.split(`
|
|
87897
86971
|
`).length;
|
|
87898
|
-
return `${
|
|
86972
|
+
return `${n}${l}${J2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, rowPadding: a + 2, style: u }).join(`
|
|
87899
86973
|
${l}`)}
|
|
87900
86974
|
${import_picocolors2.default.cyan(x2)}
|
|
87901
86975
|
`;
|
|
@@ -87905,18 +86979,18 @@ ${import_picocolors2.default.cyan(x2)}
|
|
|
87905
86979
|
};
|
|
87906
86980
|
var jt = (e) => import_picocolors2.default.dim(e);
|
|
87907
86981
|
var Vt2 = (e, r, s) => {
|
|
87908
|
-
const i = { hard: true, trim: false },
|
|
87909
|
-
`), o =
|
|
86982
|
+
const i = { hard: true, trim: false }, n = q2(e, r, i).split(`
|
|
86983
|
+
`), o = n.reduce((a, d) => Math.max(M2(d), a), 0), u = n.map(s).reduce((a, d) => Math.max(M2(d), a), 0), l = r - (u - o);
|
|
87910
86984
|
return q2(e, l, i);
|
|
87911
86985
|
};
|
|
87912
86986
|
var kt2 = (e = "", r = "", s) => {
|
|
87913
|
-
const i = s?.output ?? P2.stdout,
|
|
86987
|
+
const i = s?.output ?? P2.stdout, n = (s?.withGuide ?? _.withGuide) !== false, o = s?.format ?? jt, u = ["", ...Vt2(e, rt(i) - 6, o).split(`
|
|
87914
86988
|
`).map(o), ""], l = M2(r), a = Math.max(u.reduce((p3, y2) => {
|
|
87915
86989
|
const $ = M2(y2);
|
|
87916
86990
|
return $ > p3 ? $ : p3;
|
|
87917
86991
|
}, 0), l) + 2, d = u.map((p3) => `${import_picocolors2.default.gray(h)} ${p3}${" ".repeat(a - M2(p3))}${import_picocolors2.default.gray(h)}`).join(`
|
|
87918
|
-
`), g =
|
|
87919
|
-
` : "", E =
|
|
86992
|
+
`), g = n ? `${import_picocolors2.default.gray(h)}
|
|
86993
|
+
` : "", E = n ? Ne : pe;
|
|
87920
86994
|
i.write(`${g}${import_picocolors2.default.green(k2)} ${import_picocolors2.default.reset(r)} ${import_picocolors2.default.gray(se.repeat(Math.max(a - l - 1, 1)) + he)}
|
|
87921
86995
|
${d}
|
|
87922
86996
|
${import_picocolors2.default.gray(E + se.repeat(a + 2) + me)}
|
|
@@ -87928,19 +87002,19 @@ ${N2(this.state)} ${e.message}
|
|
|
87928
87002
|
`, s = this.userInputWithCursor, i = this.masked;
|
|
87929
87003
|
switch (this.state) {
|
|
87930
87004
|
case "error": {
|
|
87931
|
-
const
|
|
87005
|
+
const n = i ? ` ${i}` : "";
|
|
87932
87006
|
return e.clearOnError && this.clear(), `${r.trim()}
|
|
87933
|
-
${import_picocolors2.default.yellow(h)}${
|
|
87007
|
+
${import_picocolors2.default.yellow(h)}${n}
|
|
87934
87008
|
${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow(this.error)}
|
|
87935
87009
|
`;
|
|
87936
87010
|
}
|
|
87937
87011
|
case "submit": {
|
|
87938
|
-
const
|
|
87939
|
-
return `${r}${import_picocolors2.default.gray(h)}${
|
|
87012
|
+
const n = i ? ` ${import_picocolors2.default.dim(i)}` : "";
|
|
87013
|
+
return `${r}${import_picocolors2.default.gray(h)}${n}`;
|
|
87940
87014
|
}
|
|
87941
87015
|
case "cancel": {
|
|
87942
|
-
const
|
|
87943
|
-
return `${r}${import_picocolors2.default.gray(h)}${
|
|
87016
|
+
const n = i ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i))}` : "";
|
|
87017
|
+
return `${r}${import_picocolors2.default.gray(h)}${n}${i ? `
|
|
87944
87018
|
${import_picocolors2.default.gray(h)}` : ""}`;
|
|
87945
87019
|
}
|
|
87946
87020
|
default:
|
|
@@ -87964,21 +87038,21 @@ var Ht = (e) => {
|
|
|
87964
87038
|
return [];
|
|
87965
87039
|
try {
|
|
87966
87040
|
let i;
|
|
87967
|
-
return dt2(s) ? be(s).isDirectory() ? i = s : i = xe(s) : i = xe(s), ct2(i).map((
|
|
87968
|
-
const o = $t2(i,
|
|
87969
|
-
return { name:
|
|
87970
|
-
}).filter(({ path:
|
|
87041
|
+
return dt2(s) ? be(s).isDirectory() ? i = s : i = xe(s) : i = xe(s), ct2(i).map((n) => {
|
|
87042
|
+
const o = $t2(i, n), u = be(o);
|
|
87043
|
+
return { name: n, path: o, isDirectory: u.isDirectory() };
|
|
87044
|
+
}).filter(({ path: n, isDirectory: o }) => n.startsWith(s) && (e.directory || !o)).map((n) => ({ value: n.path }));
|
|
87971
87045
|
} catch {
|
|
87972
87046
|
return [];
|
|
87973
87047
|
}
|
|
87974
87048
|
} });
|
|
87975
87049
|
};
|
|
87976
87050
|
var Ut = import_picocolors2.default.magenta;
|
|
87977
|
-
var Ie = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage:
|
|
87051
|
+
var Ie = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: n, frames: o = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: u = ee ? 80 : 120, signal: l, ...a } = {}) => {
|
|
87978
87052
|
const d = ue();
|
|
87979
87053
|
let g, E, p3 = false, y2 = false, $ = "", c, m = performance.now();
|
|
87980
87054
|
const f = rt(s), F = a?.styleFrame ?? Ut, v = (I2) => {
|
|
87981
|
-
const O2 = I2 > 1 ?
|
|
87055
|
+
const O2 = I2 > 1 ? n ?? _.messages.error : i ?? _.messages.cancel;
|
|
87982
87056
|
y2 = I2 === 1, p3 && (W2(O2, I2), y2 && typeof r == "function" && r());
|
|
87983
87057
|
}, S2 = () => v(2), B = () => v(1), b = () => {
|
|
87984
87058
|
process.on("uncaughtExceptionMonitor", S2), process.on("unhandledRejection", S2), process.on("SIGINT", B), process.on("SIGTERM", B), process.on("exit", v), l && l.addEventListener("abort", B);
|
|
@@ -88033,7 +87107,7 @@ var Ie = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, canc
|
|
|
88033
87107
|
};
|
|
88034
87108
|
var Ye = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
|
|
88035
87109
|
function Kt({ style: e = "heavy", max: r = 100, size: s = 40, ...i } = {}) {
|
|
88036
|
-
const
|
|
87110
|
+
const n = Ie(i);
|
|
88037
87111
|
let o = 0, u = "";
|
|
88038
87112
|
const l = Math.max(1, r), a = Math.max(1, s), d = (y2) => {
|
|
88039
87113
|
switch (y2) {
|
|
@@ -88052,11 +87126,11 @@ function Kt({ style: e = "heavy", max: r = 100, size: s = 40, ...i } = {}) {
|
|
|
88052
87126
|
const c = Math.floor(o / l * a);
|
|
88053
87127
|
return `${d(y2)(Ye[e].repeat(c))}${import_picocolors2.default.dim(Ye[e].repeat(a - c))} ${$}`;
|
|
88054
87128
|
}, E = (y2 = "") => {
|
|
88055
|
-
u = y2,
|
|
87129
|
+
u = y2, n.start(g("initial", y2));
|
|
88056
87130
|
}, p3 = (y2 = 1, $) => {
|
|
88057
|
-
o = Math.min(l, y2 + o),
|
|
87131
|
+
o = Math.min(l, y2 + o), n.message(g("active", $ ?? u)), u = $ ?? u;
|
|
88058
87132
|
};
|
|
88059
|
-
return { start: E, stop:
|
|
87133
|
+
return { start: E, stop: n.stop, cancel: n.cancel, error: n.error, clear: n.clear, advance: p3, isCancelled: n.isCancelled, message: (y2) => p3(0, y2) };
|
|
88060
87134
|
}
|
|
88061
87135
|
var oe = (e, r) => e.includes(`
|
|
88062
87136
|
`) ? e.split(`
|
|
@@ -88064,23 +87138,23 @@ var oe = (e, r) => e.includes(`
|
|
|
88064
87138
|
`) : r(e);
|
|
88065
87139
|
var qt = (e) => {
|
|
88066
87140
|
const r = (s, i) => {
|
|
88067
|
-
const
|
|
87141
|
+
const n = s.label ?? String(s.value);
|
|
88068
87142
|
switch (i) {
|
|
88069
87143
|
case "disabled":
|
|
88070
|
-
return `${import_picocolors2.default.gray(K2)} ${oe(
|
|
87144
|
+
return `${import_picocolors2.default.gray(K2)} ${oe(n, import_picocolors2.default.gray)}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
88071
87145
|
case "selected":
|
|
88072
|
-
return `${oe(
|
|
87146
|
+
return `${oe(n, import_picocolors2.default.dim)}`;
|
|
88073
87147
|
case "active":
|
|
88074
|
-
return `${import_picocolors2.default.green(Y)} ${
|
|
87148
|
+
return `${import_picocolors2.default.green(Y)} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
|
|
88075
87149
|
case "cancelled":
|
|
88076
|
-
return `${oe(
|
|
87150
|
+
return `${oe(n, (o) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o)))}`;
|
|
88077
87151
|
default:
|
|
88078
|
-
return `${import_picocolors2.default.dim(K2)} ${oe(
|
|
87152
|
+
return `${import_picocolors2.default.dim(K2)} ${oe(n, import_picocolors2.default.dim)}`;
|
|
88079
87153
|
}
|
|
88080
87154
|
};
|
|
88081
87155
|
return new Wt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
|
|
88082
|
-
const s = `${N2(this.state)} `, i = `${Ee(this.state)} `,
|
|
88083
|
-
${
|
|
87156
|
+
const s = `${N2(this.state)} `, i = `${Ee(this.state)} `, n = Bt(e.output, e.message, i, s), o = `${import_picocolors2.default.gray(h)}
|
|
87157
|
+
${n}
|
|
88084
87158
|
`;
|
|
88085
87159
|
switch (this.state) {
|
|
88086
87160
|
case "submit": {
|
|
@@ -88105,8 +87179,8 @@ ${import_picocolors2.default.cyan(x2)}
|
|
|
88105
87179
|
};
|
|
88106
87180
|
var Jt = (e) => {
|
|
88107
87181
|
const r = (s, i = "inactive") => {
|
|
88108
|
-
const
|
|
88109
|
-
return i === "selected" ? `${import_picocolors2.default.dim(
|
|
87182
|
+
const n = s.label ?? String(s.value);
|
|
87183
|
+
return i === "selected" ? `${import_picocolors2.default.dim(n)}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n))}` : i === "active" ? `${import_picocolors2.default.bgCyan(import_picocolors2.default.gray(` ${s.value} `))} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}` : `${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(` ${s.value} `)))} ${n}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
|
|
88110
87184
|
};
|
|
88111
87185
|
return new Tt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, caseSensitive: e.caseSensitive, render() {
|
|
88112
87186
|
const s = `${import_picocolors2.default.gray(h)}
|
|
@@ -88114,18 +87188,18 @@ ${N2(this.state)} ${e.message}
|
|
|
88114
87188
|
`;
|
|
88115
87189
|
switch (this.state) {
|
|
88116
87190
|
case "submit": {
|
|
88117
|
-
const i = `${import_picocolors2.default.gray(h)} `,
|
|
87191
|
+
const i = `${import_picocolors2.default.gray(h)} `, n = this.options.find((u) => u.value === this.value) ?? e.options[0], o = Bt(e.output, r(n, "selected"), i);
|
|
88118
87192
|
return `${s}${o}`;
|
|
88119
87193
|
}
|
|
88120
87194
|
case "cancel": {
|
|
88121
|
-
const i = `${import_picocolors2.default.gray(h)} `,
|
|
88122
|
-
return `${s}${
|
|
87195
|
+
const i = `${import_picocolors2.default.gray(h)} `, n = Bt(e.output, r(this.options[0], "cancelled"), i);
|
|
87196
|
+
return `${s}${n}
|
|
88123
87197
|
${import_picocolors2.default.gray(h)}`;
|
|
88124
87198
|
}
|
|
88125
87199
|
default: {
|
|
88126
|
-
const i = `${import_picocolors2.default.cyan(h)} `,
|
|
87200
|
+
const i = `${import_picocolors2.default.cyan(h)} `, n = this.options.map((o, u) => Bt(e.output, r(o, u === this.cursor ? "active" : "inactive"), i)).join(`
|
|
88127
87201
|
`);
|
|
88128
|
-
return `${s}${
|
|
87202
|
+
return `${s}${n}
|
|
88129
87203
|
${import_picocolors2.default.cyan(x2)}
|
|
88130
87204
|
`;
|
|
88131
87205
|
}
|
|
@@ -88142,8 +87216,8 @@ ${r} `);
|
|
|
88142
87216
|
${ze}`), i.includes(`
|
|
88143
87217
|
`) && (s = 3 + le(i.slice(i.lastIndexOf(`
|
|
88144
87218
|
`))).length);
|
|
88145
|
-
const
|
|
88146
|
-
s +
|
|
87219
|
+
const n = le(i).length;
|
|
87220
|
+
s + n < process.stdout.columns ? (s += n, process.stdout.write(i)) : (process.stdout.write(`
|
|
88147
87221
|
${ze}${i.trimStart()}`), s = 3 + le(i.trimStart()).length);
|
|
88148
87222
|
}
|
|
88149
87223
|
process.stdout.write(`
|
|
@@ -88155,17 +87229,17 @@ var Xt = async (e, r) => {
|
|
|
88155
87229
|
continue;
|
|
88156
87230
|
const i = Ie(r);
|
|
88157
87231
|
i.start(s.title);
|
|
88158
|
-
const
|
|
88159
|
-
i.stop(
|
|
87232
|
+
const n = await s.task(i.message);
|
|
87233
|
+
i.stop(n || s.title);
|
|
88160
87234
|
}
|
|
88161
87235
|
};
|
|
88162
87236
|
var Yt = (e) => e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "");
|
|
88163
87237
|
var zt = (e) => {
|
|
88164
|
-
const r = e.output ?? process.stdout, s = rt(r), i = import_picocolors2.default.gray(h),
|
|
87238
|
+
const r = e.output ?? process.stdout, s = rt(r), i = import_picocolors2.default.gray(h), n = e.spacing ?? 1, o = 3, u = e.retainLog === true, l = !ue() && Te(r);
|
|
88165
87239
|
r.write(`${i}
|
|
88166
87240
|
`), r.write(`${import_picocolors2.default.green(k2)} ${e.title}
|
|
88167
87241
|
`);
|
|
88168
|
-
for (let m = 0;m <
|
|
87242
|
+
for (let m = 0;m < n; m++)
|
|
88169
87243
|
r.write(`${i}
|
|
88170
87244
|
`);
|
|
88171
87245
|
const a = [{ value: "", full: "" }];
|
|
@@ -88174,7 +87248,7 @@ var zt = (e) => {
|
|
|
88174
87248
|
if (a.length === 0)
|
|
88175
87249
|
return;
|
|
88176
87250
|
let f = 0;
|
|
88177
|
-
m && (f +=
|
|
87251
|
+
m && (f += n + 2);
|
|
88178
87252
|
for (const F of a) {
|
|
88179
87253
|
const { value: v, result: S2 } = F;
|
|
88180
87254
|
let B = S2?.message ?? v;
|
|
@@ -88192,7 +87266,7 @@ ${F.header}`);
|
|
|
88192
87266
|
${m.value}` : m.value;
|
|
88193
87267
|
m.header !== undefined && m.header !== "" && R2.message(m.header.split(`
|
|
88194
87268
|
`).map(import_picocolors2.default.bold), { output: r, secondarySymbol: i, symbol: i, spacing: 0 }), R2.message(v.split(`
|
|
88195
|
-
`).map(import_picocolors2.default.dim), { output: r, secondarySymbol: i, symbol: i, spacing: f ??
|
|
87269
|
+
`).map(import_picocolors2.default.dim), { output: r, secondarySymbol: i, symbol: i, spacing: f ?? n });
|
|
88196
87270
|
}, p3 = () => {
|
|
88197
87271
|
for (const m of a) {
|
|
88198
87272
|
const { header: f, value: F, full: v } = m;
|
|
@@ -88239,12 +87313,12 @@ ${m.value}` : m.value;
|
|
|
88239
87313
|
var Qt = (e) => new $t({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
|
|
88240
87314
|
const r = (e?.withGuide ?? _.withGuide) !== false, s = `${`${r ? `${import_picocolors2.default.gray(h)}
|
|
88241
87315
|
` : ""}${N2(this.state)} `}${e.message}
|
|
88242
|
-
`, i = e.placeholder ? import_picocolors2.default.inverse(e.placeholder[0]) + import_picocolors2.default.dim(e.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")),
|
|
87316
|
+
`, i = e.placeholder ? import_picocolors2.default.inverse(e.placeholder[0]) + import_picocolors2.default.dim(e.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), n = this.userInput ? this.userInputWithCursor : i, o = this.value ?? "";
|
|
88243
87317
|
switch (this.state) {
|
|
88244
87318
|
case "error": {
|
|
88245
87319
|
const u = this.error ? ` ${import_picocolors2.default.yellow(this.error)}` : "", l = r ? `${import_picocolors2.default.yellow(h)} ` : "", a = r ? import_picocolors2.default.yellow(x2) : "";
|
|
88246
87320
|
return `${s.trim()}
|
|
88247
|
-
${l}${
|
|
87321
|
+
${l}${n}
|
|
88248
87322
|
${a}${u}
|
|
88249
87323
|
`;
|
|
88250
87324
|
}
|
|
@@ -88259,7 +87333,7 @@ ${l}` : ""}`;
|
|
|
88259
87333
|
}
|
|
88260
87334
|
default: {
|
|
88261
87335
|
const u = r ? `${import_picocolors2.default.cyan(h)} ` : "", l = r ? import_picocolors2.default.cyan(x2) : "";
|
|
88262
|
-
return `${s}${u}${
|
|
87336
|
+
return `${s}${u}${n}
|
|
88263
87337
|
${l}
|
|
88264
87338
|
`;
|
|
88265
87339
|
}
|
|
@@ -88349,10 +87423,10 @@ var program = gen2(function* () {
|
|
|
88349
87423
|
].join(`
|
|
88350
87424
|
`), "Codebase scanned").pipe(zipRight3(clack.spinner.start("Starting"))),
|
|
88351
87425
|
onFileCleaned: ({ filePath, fileCount }) => {
|
|
88352
|
-
return updateAndGetEffect2(filesCleaned, (
|
|
87426
|
+
return updateAndGetEffect2(filesCleaned, (n) => succeed7(n + 1)).pipe(tap2((filesCleaned2) => clack.spinner.message(`Cleaning: ${filesCleaned2}/${fileCount} ${filePath}`)));
|
|
88353
87427
|
},
|
|
88354
87428
|
onFileIndexed: ({ filePath, fileCount }) => {
|
|
88355
|
-
return updateAndGetEffect2(filesIndexed, (
|
|
87429
|
+
return updateAndGetEffect2(filesIndexed, (n) => succeed7(n + 1)).pipe(tap2((filesIndexed2) => clack.spinner.message(`Indexing: ${filesIndexed2}/${fileCount} ${filePath}`)));
|
|
88356
87430
|
},
|
|
88357
87431
|
onFinished: () => clack.spinner.stop("Codebase indexed").pipe(zipRight3(clack.outro("DONE!")))
|
|
88358
87432
|
});
|
|
@@ -88389,5 +87463,5 @@ var program = gen2(function* () {
|
|
|
88389
87463
|
});
|
|
88390
87464
|
program.pipe(provide2(mergeAll5(GrepAi.Default).pipe(provideMerge2(Clack.Default), provideMerge2(exports_BunContext.layer))), exports_BunRuntime.runMain);
|
|
88391
87465
|
|
|
88392
|
-
//# debugId=
|
|
87466
|
+
//# debugId=455B5D498F2A4C9364756E2164756E21
|
|
88393
87467
|
//# sourceMappingURL=index.js.map
|