@grepai/cli 0.4.9 → 0.4.11
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 +1402 -476
- package/index.js.map +6 -3
- package/package.json +6 -2
- package/patches/tree-sitter@0.25.0.patch +26 -0
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 n2 = node.value;
|
|
4798
|
+
return n2 == null || allowScalar && identity3.isScalar(n2) && n2.value == null && !n2.commentBefore && !n2.comment && !n2.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 n2 = Object.is(value3, -0) ? "-0" : JSON.stringify(value3);
|
|
6172
|
+
if (!format5 && minFractionDigits && (!tag2 || tag2 === "tag:yaml.org,2002:float") && /^\d/.test(n2)) {
|
|
6173
|
+
let i = n2.indexOf(".");
|
|
6174
6174
|
if (i < 0) {
|
|
6175
|
-
i =
|
|
6176
|
-
|
|
6175
|
+
i = n2.length;
|
|
6176
|
+
n2 += ".";
|
|
6177
6177
|
}
|
|
6178
|
-
let d = minFractionDigits - (
|
|
6178
|
+
let d = minFractionDigits - (n2.length - i - 1);
|
|
6179
6179
|
while (d-- > 0)
|
|
6180
|
-
|
|
6180
|
+
n2 += "0";
|
|
6181
6181
|
}
|
|
6182
|
-
return
|
|
6182
|
+
return n2;
|
|
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 n2 = Math.ceil(str.length / lineWidth);
|
|
6403
|
+
const lines = new Array(n2);
|
|
6404
|
+
for (let i = 0, o = 0;i < n2; ++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 n3 = BigInt(str);
|
|
6660
|
+
return sign === "-" ? BigInt(-1) * n3 : n3;
|
|
6661
6661
|
}
|
|
6662
|
-
const
|
|
6663
|
-
return sign === "-" ? -1 *
|
|
6662
|
+
const n2 = parseInt(str, radix);
|
|
6663
|
+
return sign === "-" ? -1 * n2 : n2;
|
|
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 = (n2) => asBigInt ? BigInt(n2) : Number(n2);
|
|
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 = (n2) => n2;
|
|
6810
6810
|
if (typeof value3 === "bigint")
|
|
6811
|
-
num = (
|
|
6811
|
+
num = (n2) => BigInt(n2);
|
|
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((n2) => String(n2).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 n2 = Number(ch);
|
|
8205
|
+
if (!indent && n2)
|
|
8206
|
+
indent = n2;
|
|
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(n2) {
|
|
9379
|
+
return this.buffer[this.pos + n2];
|
|
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(n2) {
|
|
9417
|
+
return this.pos + n2 <= 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(n2) {
|
|
9427
|
+
return this.buffer.substr(this.pos, n2);
|
|
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 n2 = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
|
|
9477
|
+
yield* this.pushCount(line.length - n2);
|
|
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 n2 = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
9516
9516
|
this.indentNext = this.indentValue + 1;
|
|
9517
|
-
this.indentValue +=
|
|
9517
|
+
this.indentValue += n2;
|
|
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 n2 = yield* this.pushIndicators();
|
|
9528
|
+
switch (line[n2]) {
|
|
9529
9529
|
case "#":
|
|
9530
|
-
yield* this.pushCount(line.length -
|
|
9530
|
+
yield* this.pushCount(line.length - n2);
|
|
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
|
+
n2 += yield* this.parseBlockScalarHeader();
|
|
9553
|
+
n2 += yield* this.pushSpaces(true);
|
|
9554
|
+
yield* this.pushCount(line.length - n2);
|
|
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 n2 = 0;
|
|
9586
|
+
while (line[n2] === ",") {
|
|
9587
|
+
n2 += yield* this.pushCount(1);
|
|
9588
|
+
n2 += yield* this.pushSpaces(true);
|
|
9589
9589
|
this.flowKey = false;
|
|
9590
9590
|
}
|
|
9591
|
-
|
|
9592
|
-
switch (line[
|
|
9591
|
+
n2 += yield* this.pushIndicators();
|
|
9592
|
+
switch (line[n2]) {
|
|
9593
9593
|
case undefined:
|
|
9594
9594
|
return "flow";
|
|
9595
9595
|
case "#":
|
|
9596
|
-
yield* this.pushCount(line.length -
|
|
9596
|
+
yield* this.pushCount(line.length - n2);
|
|
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 n2 = 0;
|
|
9640
|
+
while (this.buffer[end5 - 1 - n2] === "\\")
|
|
9641
|
+
n2 += 1;
|
|
9642
|
+
if (n2 % 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(n2) {
|
|
9807
|
+
if (n2 > 0) {
|
|
9808
|
+
yield this.buffer.substr(this.pos, n2);
|
|
9809
|
+
this.pos += n2;
|
|
9810
|
+
return n2;
|
|
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 n2 = i - this.pos;
|
|
9885
|
+
if (n2 > 0) {
|
|
9886
|
+
yield this.buffer.substr(this.pos, n2);
|
|
9887
9887
|
this.pos = i;
|
|
9888
9888
|
}
|
|
9889
|
-
return
|
|
9889
|
+
return n2;
|
|
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(n2) {
|
|
10136
|
+
return this.stack[this.stack.length - n2];
|
|
10137
10137
|
}
|
|
10138
10138
|
*pop(error3) {
|
|
10139
10139
|
const token = error3 ?? this.stack.pop();
|
|
@@ -12873,6 +12873,932 @@ 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
|
+
|
|
12876
13802
|
// ../../node_modules/.bun/@neon-rs+load@0.0.4/node_modules/@neon-rs/load/dist/index.js
|
|
12877
13803
|
var require_dist2 = __commonJS((exports) => {
|
|
12878
13804
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
@@ -16867,9 +17793,9 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
16867
17793
|
function isRegFile(mode) {
|
|
16868
17794
|
return (mode & S_IFMT) == S_IFREG;
|
|
16869
17795
|
}
|
|
16870
|
-
var
|
|
16871
|
-
var nrOfFields =
|
|
16872
|
-
var passKey =
|
|
17796
|
+
var fieldNames2 = ["host", "port", "database", "user", "password"];
|
|
17797
|
+
var nrOfFields = fieldNames2.length;
|
|
17798
|
+
var passKey = fieldNames2[nrOfFields - 1];
|
|
16873
17799
|
function warn2() {
|
|
16874
17800
|
var isWritable = warnStream instanceof Stream2 && warnStream.writable === true;
|
|
16875
17801
|
if (isWritable) {
|
|
@@ -16915,7 +17841,7 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
16915
17841
|
return true;
|
|
16916
17842
|
};
|
|
16917
17843
|
var matcher = exports.match = function(connInfo, entry) {
|
|
16918
|
-
return
|
|
17844
|
+
return fieldNames2.slice(0, -1).reduce(function(prev, field, idx) {
|
|
16919
17845
|
if (idx == 1) {
|
|
16920
17846
|
if (Number(connInfo[field] || defaultPort) === Number(entry[field])) {
|
|
16921
17847
|
return prev && true;
|
|
@@ -16962,7 +17888,7 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
16962
17888
|
if (!Object.hasOwnProperty.call(process.env, "PGPASS_NO_DEESCAPE")) {
|
|
16963
17889
|
field = field.replace(/\\([:\\])/g, "$1");
|
|
16964
17890
|
}
|
|
16965
|
-
obj[
|
|
17891
|
+
obj[fieldNames2[idx]] = field;
|
|
16966
17892
|
};
|
|
16967
17893
|
for (var i = 0;i < line4.length - 1; i += 1) {
|
|
16968
17894
|
curChar = line4.charAt(i + 1);
|
|
@@ -17003,9 +17929,9 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
17003
17929
|
return x.length > 0;
|
|
17004
17930
|
}
|
|
17005
17931
|
};
|
|
17006
|
-
for (var idx = 0;idx <
|
|
17932
|
+
for (var idx = 0;idx < fieldNames2.length; idx += 1) {
|
|
17007
17933
|
var rule = rules[idx];
|
|
17008
|
-
var value6 = entry[
|
|
17934
|
+
var value6 = entry[fieldNames2[idx]] || "";
|
|
17009
17935
|
var res = rule(value6);
|
|
17010
17936
|
if (!res) {
|
|
17011
17937
|
return false;
|
|
@@ -21373,15 +22299,15 @@ var bind = (map, flatMap) => dual(3, (self2, name, f) => flatMap(self2, (a) => m
|
|
|
21373
22299
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/GlobalValue.js
|
|
21374
22300
|
var globalStoreId = `effect/GlobalValue`;
|
|
21375
22301
|
var globalStore;
|
|
21376
|
-
var globalValue = (
|
|
22302
|
+
var globalValue = (id2, compute) => {
|
|
21377
22303
|
if (!globalStore) {
|
|
21378
22304
|
globalThis[globalStoreId] ??= new Map;
|
|
21379
22305
|
globalStore = globalThis[globalStoreId];
|
|
21380
22306
|
}
|
|
21381
|
-
if (!globalStore.has(
|
|
21382
|
-
globalStore.set(
|
|
22307
|
+
if (!globalStore.has(id2)) {
|
|
22308
|
+
globalStore.set(id2, compute());
|
|
21383
22309
|
}
|
|
21384
|
-
return globalStore.get(
|
|
22310
|
+
return globalStore.get(id2);
|
|
21385
22311
|
};
|
|
21386
22312
|
|
|
21387
22313
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Predicate.js
|
|
@@ -21614,18 +22540,18 @@ var random = (self2) => {
|
|
|
21614
22540
|
return randomHashCache.get(self2);
|
|
21615
22541
|
};
|
|
21616
22542
|
var combine = (b) => (self2) => self2 * 53 ^ b;
|
|
21617
|
-
var optimize = (
|
|
22543
|
+
var optimize = (n2) => n2 & 3221225471 | n2 >>> 1 & 1073741824;
|
|
21618
22544
|
var isHash = (u) => hasProperty(u, symbol);
|
|
21619
|
-
var number2 = (
|
|
21620
|
-
if (
|
|
22545
|
+
var number2 = (n2) => {
|
|
22546
|
+
if (n2 !== n2 || n2 === Infinity) {
|
|
21621
22547
|
return 0;
|
|
21622
22548
|
}
|
|
21623
|
-
let h =
|
|
21624
|
-
if (h !==
|
|
21625
|
-
h ^=
|
|
22549
|
+
let h = n2 | 0;
|
|
22550
|
+
if (h !== n2) {
|
|
22551
|
+
h ^= n2 * 4294967295;
|
|
21626
22552
|
}
|
|
21627
|
-
while (
|
|
21628
|
-
h ^=
|
|
22553
|
+
while (n2 > 4294967295) {
|
|
22554
|
+
h ^= n2 /= 4294967295;
|
|
21629
22555
|
}
|
|
21630
22556
|
return optimize(h);
|
|
21631
22557
|
};
|
|
@@ -22317,9 +23243,9 @@ var keys = (self2) => Object.keys(self2);
|
|
|
22317
23243
|
|
|
22318
23244
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Array.js
|
|
22319
23245
|
var make4 = (...elements) => elements;
|
|
22320
|
-
var allocate = (
|
|
22321
|
-
var makeBy = /* @__PURE__ */ dual(2, (
|
|
22322
|
-
const max = Math.max(1, Math.floor(
|
|
23246
|
+
var allocate = (n2) => new Array(n2);
|
|
23247
|
+
var makeBy = /* @__PURE__ */ dual(2, (n2, f) => {
|
|
23248
|
+
const max = Math.max(1, Math.floor(n2));
|
|
22323
23249
|
const out = new Array(max);
|
|
22324
23250
|
for (let i = 0;i < max; i++) {
|
|
22325
23251
|
out[i] = f(i);
|
|
@@ -22367,9 +23293,9 @@ var last = (self2) => isNonEmptyReadonlyArray(self2) ? some2(lastNonEmpty(self2)
|
|
|
22367
23293
|
var lastNonEmpty = (self2) => self2[self2.length - 1];
|
|
22368
23294
|
var tailNonEmpty = (self2) => self2.slice(1);
|
|
22369
23295
|
var initNonEmpty = (self2) => self2.slice(0, -1);
|
|
22370
|
-
var take = /* @__PURE__ */ dual(2, (self2,
|
|
23296
|
+
var take = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
22371
23297
|
const input = fromIterable(self2);
|
|
22372
|
-
return input.slice(0, clamp(
|
|
23298
|
+
return input.slice(0, clamp(n2, input));
|
|
22373
23299
|
});
|
|
22374
23300
|
var spanIndex = (self2, predicate) => {
|
|
22375
23301
|
let i = 0;
|
|
@@ -22382,9 +23308,9 @@ var spanIndex = (self2, predicate) => {
|
|
|
22382
23308
|
return i;
|
|
22383
23309
|
};
|
|
22384
23310
|
var span = /* @__PURE__ */ dual(2, (self2, predicate) => splitAt(self2, spanIndex(self2, predicate)));
|
|
22385
|
-
var drop = /* @__PURE__ */ dual(2, (self2,
|
|
23311
|
+
var drop = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
22386
23312
|
const input = fromIterable(self2);
|
|
22387
|
-
return input.slice(clamp(
|
|
23313
|
+
return input.slice(clamp(n2, input), input.length);
|
|
22388
23314
|
});
|
|
22389
23315
|
var findFirstIndex = /* @__PURE__ */ dual(2, (self2, predicate) => {
|
|
22390
23316
|
let i = 0;
|
|
@@ -22444,9 +23370,9 @@ var containsWith2 = (isEquivalent) => dual(2, (self2, a) => {
|
|
|
22444
23370
|
});
|
|
22445
23371
|
var _equivalence2 = /* @__PURE__ */ equivalence();
|
|
22446
23372
|
var contains2 = /* @__PURE__ */ containsWith2(_equivalence2);
|
|
22447
|
-
var splitAt = /* @__PURE__ */ dual(2, (self2,
|
|
23373
|
+
var splitAt = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
22448
23374
|
const input = Array.from(self2);
|
|
22449
|
-
const _n = Math.floor(
|
|
23375
|
+
const _n = Math.floor(n2);
|
|
22450
23376
|
if (isNonEmptyReadonlyArray(input)) {
|
|
22451
23377
|
if (_n >= 1) {
|
|
22452
23378
|
return splitNonEmptyAt(input, _n);
|
|
@@ -22455,8 +23381,8 @@ var splitAt = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
|
22455
23381
|
}
|
|
22456
23382
|
return [input, []];
|
|
22457
23383
|
});
|
|
22458
|
-
var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self2,
|
|
22459
|
-
const _n = Math.max(1, Math.floor(
|
|
23384
|
+
var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
23385
|
+
const _n = Math.max(1, Math.floor(n2));
|
|
22460
23386
|
return _n >= self2.length ? [copy(self2), []] : [prepend(self2.slice(1, _n), headNonEmpty(self2)), self2.slice(_n)];
|
|
22461
23387
|
});
|
|
22462
23388
|
var copy = (self2) => self2.slice();
|
|
@@ -22825,14 +23751,14 @@ var makeGenericTag = (key) => {
|
|
|
22825
23751
|
tag.key = key;
|
|
22826
23752
|
return tag;
|
|
22827
23753
|
};
|
|
22828
|
-
var Tag = (
|
|
23754
|
+
var Tag = (id2) => () => {
|
|
22829
23755
|
const limit = Error.stackTraceLimit;
|
|
22830
23756
|
Error.stackTraceLimit = 2;
|
|
22831
23757
|
const creationError = new Error;
|
|
22832
23758
|
Error.stackTraceLimit = limit;
|
|
22833
23759
|
function TagClass() {}
|
|
22834
23760
|
Object.setPrototypeOf(TagClass, TagProto);
|
|
22835
|
-
TagClass.key =
|
|
23761
|
+
TagClass.key = id2;
|
|
22836
23762
|
Object.defineProperty(TagClass, "stack", {
|
|
22837
23763
|
get() {
|
|
22838
23764
|
return creationError.stack;
|
|
@@ -22840,14 +23766,14 @@ var Tag = (id) => () => {
|
|
|
22840
23766
|
});
|
|
22841
23767
|
return TagClass;
|
|
22842
23768
|
};
|
|
22843
|
-
var Reference = () => (
|
|
23769
|
+
var Reference = () => (id2, options) => {
|
|
22844
23770
|
const limit = Error.stackTraceLimit;
|
|
22845
23771
|
Error.stackTraceLimit = 2;
|
|
22846
23772
|
const creationError = new Error;
|
|
22847
23773
|
Error.stackTraceLimit = limit;
|
|
22848
23774
|
function ReferenceClass() {}
|
|
22849
23775
|
Object.setPrototypeOf(ReferenceClass, ReferenceProto);
|
|
22850
|
-
ReferenceClass.key =
|
|
23776
|
+
ReferenceClass.key = id2;
|
|
22851
23777
|
ReferenceClass.defaultValue = options.defaultValue;
|
|
22852
23778
|
Object.defineProperty(ReferenceClass, "stack", {
|
|
22853
23779
|
get() {
|
|
@@ -23208,10 +24134,10 @@ var unsafeGet4 = /* @__PURE__ */ dual(2, (self2, index) => {
|
|
|
23208
24134
|
});
|
|
23209
24135
|
var append2 = /* @__PURE__ */ dual(2, (self2, a) => appendAll2(self2, of2(a)));
|
|
23210
24136
|
var prepend2 = /* @__PURE__ */ dual(2, (self2, elem) => appendAll2(of2(elem), self2));
|
|
23211
|
-
var take2 = /* @__PURE__ */ dual(2, (self2,
|
|
23212
|
-
if (
|
|
24137
|
+
var take2 = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
24138
|
+
if (n2 <= 0) {
|
|
23213
24139
|
return _empty2;
|
|
23214
|
-
} else if (
|
|
24140
|
+
} else if (n2 >= self2.length) {
|
|
23215
24141
|
return self2;
|
|
23216
24142
|
} else {
|
|
23217
24143
|
switch (self2.backing._tag) {
|
|
@@ -23219,35 +24145,35 @@ var take2 = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
|
23219
24145
|
return makeChunk({
|
|
23220
24146
|
_tag: "ISlice",
|
|
23221
24147
|
chunk: self2.backing.chunk,
|
|
23222
|
-
length:
|
|
24148
|
+
length: n2,
|
|
23223
24149
|
offset: self2.backing.offset
|
|
23224
24150
|
});
|
|
23225
24151
|
}
|
|
23226
24152
|
case "IConcat": {
|
|
23227
|
-
if (
|
|
24153
|
+
if (n2 > self2.left.length) {
|
|
23228
24154
|
return makeChunk({
|
|
23229
24155
|
_tag: "IConcat",
|
|
23230
24156
|
left: self2.left,
|
|
23231
|
-
right: take2(self2.right,
|
|
24157
|
+
right: take2(self2.right, n2 - self2.left.length)
|
|
23232
24158
|
});
|
|
23233
24159
|
}
|
|
23234
|
-
return take2(self2.left,
|
|
24160
|
+
return take2(self2.left, n2);
|
|
23235
24161
|
}
|
|
23236
24162
|
default: {
|
|
23237
24163
|
return makeChunk({
|
|
23238
24164
|
_tag: "ISlice",
|
|
23239
24165
|
chunk: self2,
|
|
23240
24166
|
offset: 0,
|
|
23241
|
-
length:
|
|
24167
|
+
length: n2
|
|
23242
24168
|
});
|
|
23243
24169
|
}
|
|
23244
24170
|
}
|
|
23245
24171
|
}
|
|
23246
24172
|
});
|
|
23247
|
-
var drop2 = /* @__PURE__ */ dual(2, (self2,
|
|
23248
|
-
if (
|
|
24173
|
+
var drop2 = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
24174
|
+
if (n2 <= 0) {
|
|
23249
24175
|
return self2;
|
|
23250
|
-
} else if (
|
|
24176
|
+
} else if (n2 >= self2.length) {
|
|
23251
24177
|
return _empty2;
|
|
23252
24178
|
} else {
|
|
23253
24179
|
switch (self2.backing._tag) {
|
|
@@ -23255,17 +24181,17 @@ var drop2 = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
|
23255
24181
|
return makeChunk({
|
|
23256
24182
|
_tag: "ISlice",
|
|
23257
24183
|
chunk: self2.backing.chunk,
|
|
23258
|
-
offset: self2.backing.offset +
|
|
23259
|
-
length: self2.backing.length -
|
|
24184
|
+
offset: self2.backing.offset + n2,
|
|
24185
|
+
length: self2.backing.length - n2
|
|
23260
24186
|
});
|
|
23261
24187
|
}
|
|
23262
24188
|
case "IConcat": {
|
|
23263
|
-
if (
|
|
23264
|
-
return drop2(self2.right,
|
|
24189
|
+
if (n2 > self2.left.length) {
|
|
24190
|
+
return drop2(self2.right, n2 - self2.left.length);
|
|
23265
24191
|
}
|
|
23266
24192
|
return makeChunk({
|
|
23267
24193
|
_tag: "IConcat",
|
|
23268
|
-
left: drop2(self2.left,
|
|
24194
|
+
left: drop2(self2.left, n2),
|
|
23269
24195
|
right: self2.right
|
|
23270
24196
|
});
|
|
23271
24197
|
}
|
|
@@ -23273,8 +24199,8 @@ var drop2 = /* @__PURE__ */ dual(2, (self2, n) => {
|
|
|
23273
24199
|
return makeChunk({
|
|
23274
24200
|
_tag: "ISlice",
|
|
23275
24201
|
chunk: self2,
|
|
23276
|
-
offset:
|
|
23277
|
-
length: self2.length -
|
|
24202
|
+
offset: n2,
|
|
24203
|
+
length: self2.length - n2
|
|
23278
24204
|
});
|
|
23279
24205
|
}
|
|
23280
24206
|
}
|
|
@@ -23372,7 +24298,7 @@ var unsafeHead = (self2) => unsafeGet4(self2, 0);
|
|
|
23372
24298
|
var headNonEmpty2 = unsafeHead;
|
|
23373
24299
|
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)))));
|
|
23374
24300
|
var tailNonEmpty2 = (self2) => drop2(self2, 1);
|
|
23375
|
-
var takeRight = /* @__PURE__ */ dual(2, (self2,
|
|
24301
|
+
var takeRight = /* @__PURE__ */ dual(2, (self2, n2) => drop2(self2, self2.length - n2));
|
|
23376
24302
|
var reduce2 = reduce;
|
|
23377
24303
|
|
|
23378
24304
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Duration.js
|
|
@@ -24401,8 +25327,8 @@ class Runtime {
|
|
|
24401
25327
|
startTimeMillis;
|
|
24402
25328
|
[FiberIdTypeId] = FiberIdTypeId;
|
|
24403
25329
|
_tag = OP_RUNTIME;
|
|
24404
|
-
constructor(
|
|
24405
|
-
this.id =
|
|
25330
|
+
constructor(id2, startTimeMillis) {
|
|
25331
|
+
this.id = id2;
|
|
24406
25332
|
this.startTimeMillis = startTimeMillis;
|
|
24407
25333
|
}
|
|
24408
25334
|
[symbol]() {
|
|
@@ -24459,8 +25385,8 @@ class Composite {
|
|
|
24459
25385
|
}
|
|
24460
25386
|
}
|
|
24461
25387
|
var none3 = /* @__PURE__ */ new None;
|
|
24462
|
-
var runtime = (
|
|
24463
|
-
return new Runtime(
|
|
25388
|
+
var runtime = (id2, startTimeMillis) => {
|
|
25389
|
+
return new Runtime(id2, startTimeMillis);
|
|
24464
25390
|
};
|
|
24465
25391
|
var composite = (left3, right3) => {
|
|
24466
25392
|
return new Composite(left3, right3);
|
|
@@ -24492,17 +25418,17 @@ var ids = (self2) => {
|
|
|
24492
25418
|
}
|
|
24493
25419
|
};
|
|
24494
25420
|
var _fiberCounter = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Fiber/Id/_fiberCounter"), () => make13(0));
|
|
24495
|
-
var make14 = (
|
|
24496
|
-
return new Runtime(
|
|
25421
|
+
var make14 = (id2, startTimeSeconds) => {
|
|
25422
|
+
return new Runtime(id2, startTimeSeconds);
|
|
24497
25423
|
};
|
|
24498
25424
|
var threadName = (self2) => {
|
|
24499
|
-
const identifiers = Array.from(ids(self2)).map((
|
|
25425
|
+
const identifiers = Array.from(ids(self2)).map((n2) => `#${n2}`).join(",");
|
|
24500
25426
|
return identifiers;
|
|
24501
25427
|
};
|
|
24502
25428
|
var unsafeMake = () => {
|
|
24503
|
-
const
|
|
24504
|
-
pipe(_fiberCounter, set2(
|
|
24505
|
-
return new Runtime(
|
|
25429
|
+
const id2 = get6(_fiberCounter);
|
|
25430
|
+
pipe(_fiberCounter, set2(id2 + 1));
|
|
25431
|
+
return new Runtime(id2, Date.now());
|
|
24506
25432
|
};
|
|
24507
25433
|
|
|
24508
25434
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/FiberId.js
|
|
@@ -25104,7 +26030,7 @@ var enable = (flag) => make18(flag, flag);
|
|
|
25104
26030
|
var disable = (flag) => make18(flag, 0);
|
|
25105
26031
|
var exclude = /* @__PURE__ */ dual(2, (self2, flag) => make18(active(self2) & ~flag, enabled(self2)));
|
|
25106
26032
|
var andThen = /* @__PURE__ */ dual(2, (self2, that) => self2 | that);
|
|
25107
|
-
var invert = (
|
|
26033
|
+
var invert = (n2) => ~n2 >>> 0 & BIT_MASK;
|
|
25108
26034
|
|
|
25109
26035
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/internal/runtimeFlags.js
|
|
25110
26036
|
var None2 = 0;
|
|
@@ -26587,7 +27513,7 @@ var fiberRefUnsafeMakePatch = (initial, options) => {
|
|
|
26587
27513
|
combine: (first, second) => options.differ.combine(first, second),
|
|
26588
27514
|
patch: (patch5) => (oldValue) => options.differ.patch(patch5, oldValue),
|
|
26589
27515
|
fork: options.fork,
|
|
26590
|
-
join: options.join ?? ((_,
|
|
27516
|
+
join: options.join ?? ((_, n2) => n2)
|
|
26591
27517
|
};
|
|
26592
27518
|
return _fiberRef;
|
|
26593
27519
|
};
|
|
@@ -26634,7 +27560,7 @@ var causeSquashWith = /* @__PURE__ */ dual(2, (self2, f) => {
|
|
|
26634
27560
|
case "None": {
|
|
26635
27561
|
return pipe(defects(self2), head2, match2({
|
|
26636
27562
|
onNone: () => {
|
|
26637
|
-
const interrupts = fromIterable(interruptors(self2)).flatMap((fiberId2) => fromIterable(ids2(fiberId2)).map((
|
|
27563
|
+
const interrupts = fromIterable(interruptors(self2)).flatMap((fiberId2) => fromIterable(ids2(fiberId2)).map((id2) => `#${id2}`));
|
|
26638
27564
|
return new InterruptedException(interrupts ? `Interrupted by fibers: ${interrupts.join(", ")}` : undefined);
|
|
26639
27565
|
},
|
|
26640
27566
|
onSome: identity
|
|
@@ -26860,7 +27786,7 @@ var deferredUnsafeMake = (fiberId2) => {
|
|
|
26860
27786
|
};
|
|
26861
27787
|
return _deferred;
|
|
26862
27788
|
};
|
|
26863
|
-
var deferredMake = () => flatMap7(fiberId, (
|
|
27789
|
+
var deferredMake = () => flatMap7(fiberId, (id2) => deferredMakeAs(id2));
|
|
26864
27790
|
var deferredMakeAs = (fiberId2) => sync(() => deferredUnsafeMake(fiberId2));
|
|
26865
27791
|
var deferredAwait = (self2) => asyncInterrupt((resume) => {
|
|
26866
27792
|
const state = get6(self2.state);
|
|
@@ -27027,8 +27953,8 @@ var parse = (s) => {
|
|
|
27027
27953
|
if (s.trim() === "") {
|
|
27028
27954
|
return none;
|
|
27029
27955
|
}
|
|
27030
|
-
const
|
|
27031
|
-
return Number.isNaN(
|
|
27956
|
+
const n2 = Number(s);
|
|
27957
|
+
return Number.isNaN(n2) ? none : some(n2);
|
|
27032
27958
|
};
|
|
27033
27959
|
var round = /* @__PURE__ */ dual(2, (self2, precision) => {
|
|
27034
27960
|
const factor = Math.pow(10, precision);
|
|
@@ -27403,19 +28329,19 @@ class RandomImpl {
|
|
|
27403
28329
|
return sync(() => this.PRNG.number());
|
|
27404
28330
|
}
|
|
27405
28331
|
get nextBoolean() {
|
|
27406
|
-
return map11(this.next, (
|
|
28332
|
+
return map11(this.next, (n2) => n2 > 0.5);
|
|
27407
28333
|
}
|
|
27408
28334
|
get nextInt() {
|
|
27409
28335
|
return sync(() => this.PRNG.integer(Number.MAX_SAFE_INTEGER));
|
|
27410
28336
|
}
|
|
27411
28337
|
nextRange(min2, max2) {
|
|
27412
|
-
return map11(this.next, (
|
|
28338
|
+
return map11(this.next, (n2) => (max2 - min2) * n2 + min2);
|
|
27413
28339
|
}
|
|
27414
28340
|
nextIntBetween(min2, max2) {
|
|
27415
28341
|
return sync(() => this.PRNG.integer(max2 - min2) + min2);
|
|
27416
28342
|
}
|
|
27417
28343
|
shuffle(elements) {
|
|
27418
|
-
return shuffleWith(elements, (
|
|
28344
|
+
return shuffleWith(elements, (n2) => this.nextIntBetween(0, n2));
|
|
27419
28345
|
}
|
|
27420
28346
|
}
|
|
27421
28347
|
var shuffleWith = (elements, nextIntBounded) => {
|
|
@@ -27424,7 +28350,7 @@ var shuffleWith = (elements, nextIntBounded) => {
|
|
|
27424
28350
|
for (let i = buffer.length;i >= 2; i = i - 1) {
|
|
27425
28351
|
numbers.push(i);
|
|
27426
28352
|
}
|
|
27427
|
-
return pipe(numbers, forEachSequentialDiscard((
|
|
28353
|
+
return pipe(numbers, forEachSequentialDiscard((n2) => pipe(nextIntBounded(n2), map11((k) => swap(buffer, n2 - 1, k)))), as(fromIterable2(buffer)));
|
|
27428
28354
|
})));
|
|
27429
28355
|
};
|
|
27430
28356
|
var swap = (buffer, index1, index2) => {
|
|
@@ -28758,8 +29684,8 @@ var promise = (evaluate2) => evaluate2.length >= 1 ? async_((resolve, signal) =>
|
|
|
28758
29684
|
});
|
|
28759
29685
|
var provideService = /* @__PURE__ */ dual(3, (self2, tag, service) => contextWithEffect((env) => provideContext(self2, add2(env, tag, service))));
|
|
28760
29686
|
var provideServiceEffect = /* @__PURE__ */ dual(3, (self2, tag, effect) => contextWithEffect((env) => flatMap7(effect, (service) => provideContext(self2, pipe(env, add2(tag, service))))));
|
|
28761
|
-
var repeatN = /* @__PURE__ */ dual(2, (self2,
|
|
28762
|
-
var repeatNLoop = (self2,
|
|
29687
|
+
var repeatN = /* @__PURE__ */ dual(2, (self2, n2) => suspend(() => repeatNLoop(self2, n2)));
|
|
29688
|
+
var repeatNLoop = (self2, n2) => flatMap7(self2, (a) => n2 <= 0 ? succeed(a) : zipRight(yieldNow(), repeatNLoop(self2, n2 - 1)));
|
|
28763
29689
|
var sleep3 = sleep2;
|
|
28764
29690
|
var succeedNone = /* @__PURE__ */ succeed(/* @__PURE__ */ none2());
|
|
28765
29691
|
var summarized = /* @__PURE__ */ dual(3, (self2, summary, f) => flatMap7(summary, (start) => flatMap7(self2, (value) => map11(summary, (end) => [f(start, end), value]))));
|
|
@@ -29719,8 +30645,8 @@ var histogram4 = (key) => {
|
|
|
29719
30645
|
let sum2 = 0;
|
|
29720
30646
|
let min2 = Number.MAX_VALUE;
|
|
29721
30647
|
let max2 = Number.MIN_VALUE;
|
|
29722
|
-
pipe(bounds, sort(Order), map4((
|
|
29723
|
-
boundaries[i] =
|
|
30648
|
+
pipe(bounds, sort(Order), map4((n2, i) => {
|
|
30649
|
+
boundaries[i] = n2;
|
|
29724
30650
|
}));
|
|
29725
30651
|
const update4 = (value) => {
|
|
29726
30652
|
let from = 0;
|
|
@@ -29873,7 +30799,7 @@ var resolveQuantile = (error, sampleCount, current, consumed, quantile, rest) =>
|
|
|
29873
30799
|
};
|
|
29874
30800
|
}
|
|
29875
30801
|
const headValue = headNonEmpty(rest_1);
|
|
29876
|
-
const sameHead = span(rest_1, (
|
|
30802
|
+
const sameHead = span(rest_1, (n2) => n2 === headValue);
|
|
29877
30803
|
const desired = quantile_1 * sampleCount_1;
|
|
29878
30804
|
const allowedError = error_1 / 2 * desired;
|
|
29879
30805
|
const candConsumed = consumed_1 + sameHead[0].length;
|
|
@@ -31318,9 +32244,9 @@ var all3 = (arg, options) => {
|
|
|
31318
32244
|
var forEach4 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]), (self2, f, options) => withFiberRuntime((r) => {
|
|
31319
32245
|
const isRequestBatchingEnabled = options?.batching === true || options?.batching === "inherit" && r.getFiberRef(currentRequestBatching);
|
|
31320
32246
|
if (options?.discard) {
|
|
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)), (
|
|
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)), (n2) => finalizersMaskInternal(parallelN2(n2), options?.concurrentFinalizers)((restore) => forEachConcurrentDiscard(self2, (a, i) => restore(f(a, i)), isRequestBatchingEnabled, false, n2)));
|
|
31322
32248
|
}
|
|
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)), (
|
|
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)), (n2) => finalizersMaskInternal(parallelN2(n2), options?.concurrentFinalizers)((restore) => forEachParN(self2, n2, (a, i) => restore(f(a, i)), isRequestBatchingEnabled)));
|
|
31324
32250
|
}));
|
|
31325
32251
|
var forEachParUnbounded = (self2, f, batching) => suspend(() => {
|
|
31326
32252
|
const as2 = fromIterable(self2);
|
|
@@ -31328,7 +32254,7 @@ var forEachParUnbounded = (self2, f, batching) => suspend(() => {
|
|
|
31328
32254
|
const fn = (a, i) => flatMap7(f(a, i), (b) => sync(() => array3[i] = b));
|
|
31329
32255
|
return zipRight(forEachConcurrentDiscard(as2, fn, batching, false), succeed(array3));
|
|
31330
32256
|
});
|
|
31331
|
-
var forEachConcurrentDiscard = (self2, f, batching, processAll,
|
|
32257
|
+
var forEachConcurrentDiscard = (self2, f, batching, processAll, n2) => uninterruptibleMask((restore) => transplant((graft) => withFiberRuntime((parent) => {
|
|
31332
32258
|
let todos = Array.from(self2).reverse();
|
|
31333
32259
|
let target = todos.length;
|
|
31334
32260
|
if (target === 0) {
|
|
@@ -31336,7 +32262,7 @@ var forEachConcurrentDiscard = (self2, f, batching, processAll, n) => uninterrup
|
|
|
31336
32262
|
}
|
|
31337
32263
|
let counter6 = 0;
|
|
31338
32264
|
let interrupted = false;
|
|
31339
|
-
const fibersCount =
|
|
32265
|
+
const fibersCount = n2 ? Math.min(todos.length, n2) : todos.length;
|
|
31340
32266
|
const fibers = new Set;
|
|
31341
32267
|
const results = new Array;
|
|
31342
32268
|
const interruptAll = () => fibers.forEach((fiber) => {
|
|
@@ -31438,7 +32364,7 @@ var forEachConcurrentDiscard = (self2, f, batching, processAll, n) => uninterrup
|
|
|
31438
32364
|
const requests = residual.map((blocked2) => blocked2.effect_instruction_i0).reduce(par);
|
|
31439
32365
|
resume2(succeed(blocked(requests, forEachConcurrentDiscard([getOrElse(exitCollectAll(exits, {
|
|
31440
32366
|
parallel: true
|
|
31441
|
-
}), () => exitVoid), ...residual.map((blocked2) => blocked2.effect_instruction_i1)], (i) => i, batching, true,
|
|
32367
|
+
}), () => exitVoid), ...residual.map((blocked2) => blocked2.effect_instruction_i1)], (i) => i, batching, true, n2))));
|
|
31442
32368
|
} else {
|
|
31443
32369
|
next();
|
|
31444
32370
|
}
|
|
@@ -31453,7 +32379,7 @@ var forEachConcurrentDiscard = (self2, f, batching, processAll, n) => uninterrup
|
|
|
31453
32379
|
onFailure: (cause) => {
|
|
31454
32380
|
onInterruptSignal();
|
|
31455
32381
|
const target2 = residual.length + 1;
|
|
31456
|
-
const concurrency = Math.min(typeof
|
|
32382
|
+
const concurrency = Math.min(typeof n2 === "number" ? n2 : residual.length, residual.length);
|
|
31457
32383
|
const toPop = Array.from(residual);
|
|
31458
32384
|
return async_((cb) => {
|
|
31459
32385
|
const exits = [];
|
|
@@ -31483,11 +32409,11 @@ var forEachConcurrentDiscard = (self2, f, batching, processAll, n) => uninterrup
|
|
|
31483
32409
|
onSuccess: () => forEachSequential(joinOrder, (f2) => f2.inheritAll)
|
|
31484
32410
|
})));
|
|
31485
32411
|
})));
|
|
31486
|
-
var forEachParN = (self2,
|
|
32412
|
+
var forEachParN = (self2, n2, f, batching) => suspend(() => {
|
|
31487
32413
|
const as2 = fromIterable(self2);
|
|
31488
32414
|
const array3 = new Array(as2.length);
|
|
31489
32415
|
const fn = (a, i) => map11(f(a, i), (b) => array3[i] = b);
|
|
31490
|
-
return zipRight(forEachConcurrentDiscard(as2, fn, batching, false,
|
|
32416
|
+
return zipRight(forEachConcurrentDiscard(as2, fn, batching, false, n2), succeed(array3));
|
|
31491
32417
|
});
|
|
31492
32418
|
var forkDaemon = (self2) => forkWithScopeOverride(self2, globalScope);
|
|
31493
32419
|
var unsafeFork = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {
|
|
@@ -31720,7 +32646,7 @@ var ensuring = /* @__PURE__ */ dual(2, (self2, finalizer) => uninterruptibleMask
|
|
|
31720
32646
|
}),
|
|
31721
32647
|
onSuccess: (a) => as(finalizer, a)
|
|
31722
32648
|
})));
|
|
31723
|
-
var invokeWithInterrupt = (self2, entries2, onInterrupt2) => fiberIdWith((
|
|
32649
|
+
var invokeWithInterrupt = (self2, entries2, onInterrupt2) => fiberIdWith((id2) => flatMap7(flatMap7(forkDaemon(interruptible2(self2)), (processing) => async_((cb) => {
|
|
31724
32650
|
const counts = entries2.map((_) => _.listeners.count);
|
|
31725
32651
|
const checkDone = () => {
|
|
31726
32652
|
if (counts.every((count) => count === 0)) {
|
|
@@ -31762,7 +32688,7 @@ var invokeWithInterrupt = (self2, entries2, onInterrupt2) => fiberIdWith((id) =>
|
|
|
31762
32688
|
}
|
|
31763
32689
|
return [];
|
|
31764
32690
|
});
|
|
31765
|
-
return forEachSequentialDiscard(residual, (entry) => complete(entry.request, exitInterrupt(
|
|
32691
|
+
return forEachSequentialDiscard(residual, (entry) => complete(entry.request, exitInterrupt(id2)));
|
|
31766
32692
|
})));
|
|
31767
32693
|
var makeSpanScoped = (name, options) => {
|
|
31768
32694
|
options = addSpanStackTrace(options);
|
|
@@ -31950,23 +32876,23 @@ class Semaphore {
|
|
|
31950
32876
|
get free() {
|
|
31951
32877
|
return this.permits - this.taken;
|
|
31952
32878
|
}
|
|
31953
|
-
take = (
|
|
31954
|
-
if (this.free <
|
|
32879
|
+
take = (n2) => asyncInterrupt((resume2) => {
|
|
32880
|
+
if (this.free < n2) {
|
|
31955
32881
|
const observer = () => {
|
|
31956
|
-
if (this.free <
|
|
32882
|
+
if (this.free < n2) {
|
|
31957
32883
|
return;
|
|
31958
32884
|
}
|
|
31959
32885
|
this.waiters.delete(observer);
|
|
31960
|
-
this.taken +=
|
|
31961
|
-
resume2(succeed(
|
|
32886
|
+
this.taken += n2;
|
|
32887
|
+
resume2(succeed(n2));
|
|
31962
32888
|
};
|
|
31963
32889
|
this.waiters.add(observer);
|
|
31964
32890
|
return sync(() => {
|
|
31965
32891
|
this.waiters.delete(observer);
|
|
31966
32892
|
});
|
|
31967
32893
|
}
|
|
31968
|
-
this.taken +=
|
|
31969
|
-
return resume2(succeed(
|
|
32894
|
+
this.taken += n2;
|
|
32895
|
+
return resume2(succeed(n2));
|
|
31970
32896
|
});
|
|
31971
32897
|
updateTakenUnsafe(fiber, f) {
|
|
31972
32898
|
this.taken = f(this.taken);
|
|
@@ -31992,15 +32918,15 @@ class Semaphore {
|
|
|
31992
32918
|
}
|
|
31993
32919
|
return this.updateTakenUnsafe(fiber, (taken) => taken);
|
|
31994
32920
|
}));
|
|
31995
|
-
release = (
|
|
32921
|
+
release = (n2) => this.updateTaken((taken) => taken - n2);
|
|
31996
32922
|
releaseAll = /* @__PURE__ */ this.updateTaken((_) => 0);
|
|
31997
|
-
withPermits = (
|
|
31998
|
-
withPermitsIfAvailable = (
|
|
31999
|
-
if (this.free <
|
|
32923
|
+
withPermits = (n2) => (self2) => uninterruptibleMask((restore) => flatMap7(restore(this.take(n2)), (permits) => ensuring(restore(self2), this.release(permits))));
|
|
32924
|
+
withPermitsIfAvailable = (n2) => (self2) => uninterruptibleMask((restore) => suspend(() => {
|
|
32925
|
+
if (this.free < n2) {
|
|
32000
32926
|
return succeedNone;
|
|
32001
32927
|
}
|
|
32002
|
-
this.taken +=
|
|
32003
|
-
return ensuring(restore(asSome(self2)), this.release(
|
|
32928
|
+
this.taken += n2;
|
|
32929
|
+
return ensuring(restore(asSome(self2)), this.release(n2));
|
|
32004
32930
|
}));
|
|
32005
32931
|
}
|
|
32006
32932
|
var unsafeMakeSemaphore = (permits) => new Semaphore(permits);
|
|
@@ -32213,7 +33139,7 @@ var unsafeFork2 = /* @__PURE__ */ makeDual((runtime3, self2, options) => {
|
|
|
32213
33139
|
const fiberRuntime = new FiberRuntime(fiberId2, fiberRefs3, runtime3.runtimeFlags);
|
|
32214
33140
|
let effect = self2;
|
|
32215
33141
|
if (options?.scope) {
|
|
32216
|
-
effect = flatMap7(fork(options.scope, sequential2), (closeableScope) => zipRight(scopeAddFinalizer(closeableScope, fiberIdWith((
|
|
33142
|
+
effect = flatMap7(fork(options.scope, sequential2), (closeableScope) => zipRight(scopeAddFinalizer(closeableScope, fiberIdWith((id3) => equals(id3, fiberRuntime.id()) ? void_ : interruptAsFiber(fiberRuntime, id3))), onExit(self2, (exit2) => close(closeableScope, exit2))));
|
|
32217
33143
|
}
|
|
32218
33144
|
const supervisor = fiberRuntime.currentSupervisor;
|
|
32219
33145
|
if (supervisor !== none7) {
|
|
@@ -32444,13 +33370,13 @@ class MemoMapImpl {
|
|
|
32444
33370
|
return pipe(deferredFailCause(deferred, exit2.effect_instruction_i0), zipRight(scopeClose(innerScope, exit2)), zipRight(failCause(exit2.effect_instruction_i0)));
|
|
32445
33371
|
}
|
|
32446
33372
|
case OP_SUCCESS: {
|
|
32447
|
-
return pipe(set4(finalizerRef, (exit3) => pipe(scopeClose(innerScope, exit3), whenEffect(modify3(observers, (
|
|
33373
|
+
return pipe(set4(finalizerRef, (exit3) => pipe(scopeClose(innerScope, exit3), whenEffect(modify3(observers, (n2) => [n2 === 1, n2 - 1])), asVoid)), zipRight(update2(observers, (n2) => n2 + 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]));
|
|
32448
33374
|
}
|
|
32449
33375
|
}
|
|
32450
33376
|
})))));
|
|
32451
33377
|
const memoized = [pipe(deferredAwait(deferred), onExit(exitMatchEffect({
|
|
32452
33378
|
onFailure: () => void_,
|
|
32453
|
-
onSuccess: () => update2(observers, (
|
|
33379
|
+
onSuccess: () => update2(observers, (n2) => n2 + 1)
|
|
32454
33380
|
}))), (exit2) => pipe(get10(finalizerRef), flatMap7((finalizer) => finalizer(exit2)))];
|
|
32455
33381
|
return [resource, isFresh(layer) ? map15 : map15.set(layer, memoized)];
|
|
32456
33382
|
}))))));
|
|
@@ -32914,7 +33840,7 @@ var modifyDelayEffect = /* @__PURE__ */ dual(2, (self2, f) => makeWithState(self
|
|
|
32914
33840
|
});
|
|
32915
33841
|
})));
|
|
32916
33842
|
var passthrough = (self2) => makeWithState(self2.initial, (now, input, state) => pipe(self2.step(now, input, state), map11(([state2, _, decision]) => [state2, input, decision])));
|
|
32917
|
-
var recurs = (
|
|
33843
|
+
var recurs = (n2) => whileOutput(forever2, (out) => out < n2);
|
|
32918
33844
|
var spaced = (duration) => addDelay(forever2, () => duration);
|
|
32919
33845
|
var unfold2 = (initial, f) => makeWithState(initial, (now, _, state) => sync(() => [f(state), state, continueWith2(after2(now))]));
|
|
32920
33846
|
var untilInputEffect = /* @__PURE__ */ dual(2, (self2, f) => checkEffect(self2, (input, _) => negate(f(input))));
|
|
@@ -33003,7 +33929,7 @@ var retryOrElse_EffectLoop = (self2, driver2, orElse4) => {
|
|
|
33003
33929
|
onSuccess: () => retryOrElse_EffectLoop(self2, driver2, orElse4)
|
|
33004
33930
|
}));
|
|
33005
33931
|
};
|
|
33006
|
-
var forever2 = /* @__PURE__ */ unfold2(0, (
|
|
33932
|
+
var forever2 = /* @__PURE__ */ unfold2(0, (n2) => n2 + 1);
|
|
33007
33933
|
|
|
33008
33934
|
// ../../node_modules/.bun/effect@3.19.15/node_modules/effect/dist/esm/Deferred.js
|
|
33009
33935
|
var DeferredTypeId2 = DeferredTypeId;
|
|
@@ -33192,10 +34118,10 @@ var poll2 = /* @__PURE__ */ dual(2, (self2, def) => {
|
|
|
33192
34118
|
}
|
|
33193
34119
|
return shift(self2.queue);
|
|
33194
34120
|
});
|
|
33195
|
-
var pollUpTo = /* @__PURE__ */ dual(2, (self2,
|
|
34121
|
+
var pollUpTo = /* @__PURE__ */ dual(2, (self2, n2) => {
|
|
33196
34122
|
let result = empty6();
|
|
33197
34123
|
let count2 = 0;
|
|
33198
|
-
while (count2 <
|
|
34124
|
+
while (count2 < n2) {
|
|
33199
34125
|
const element = poll2(EmptyMutableQueue)(self2);
|
|
33200
34126
|
if (element === EmptyMutableQueue) {
|
|
33201
34127
|
break;
|
|
@@ -33355,7 +34281,7 @@ var makeTagProxy = (TagClass) => {
|
|
|
33355
34281
|
};
|
|
33356
34282
|
var Service = function() {
|
|
33357
34283
|
return function() {
|
|
33358
|
-
const [
|
|
34284
|
+
const [id3, maker] = arguments;
|
|
33359
34285
|
const proxy = "accessors" in maker ? maker["accessors"] : false;
|
|
33360
34286
|
const limit = Error.stackTraceLimit;
|
|
33361
34287
|
Error.stackTraceLimit = 2;
|
|
@@ -33380,7 +34306,7 @@ var Service = function() {
|
|
|
33380
34306
|
return service;
|
|
33381
34307
|
}
|
|
33382
34308
|
};
|
|
33383
|
-
TagClass.prototype._tag =
|
|
34309
|
+
TagClass.prototype._tag = id3;
|
|
33384
34310
|
Object.defineProperty(TagClass, "make", {
|
|
33385
34311
|
get() {
|
|
33386
34312
|
return (service) => new this(service);
|
|
@@ -33391,7 +34317,7 @@ var Service = function() {
|
|
|
33391
34317
|
return (body) => andThen2(this, body);
|
|
33392
34318
|
}
|
|
33393
34319
|
});
|
|
33394
|
-
TagClass.key =
|
|
34320
|
+
TagClass.key = id3;
|
|
33395
34321
|
Object.assign(TagClass, TagProto);
|
|
33396
34322
|
Object.defineProperty(TagClass, "stack", {
|
|
33397
34323
|
get() {
|
|
@@ -34439,12 +35365,12 @@ var record = (key, value) => {
|
|
|
34439
35365
|
};
|
|
34440
35366
|
var pickAnnotations = (annotationIds) => (annotated) => {
|
|
34441
35367
|
let out = undefined;
|
|
34442
|
-
for (const
|
|
34443
|
-
if (Object.prototype.hasOwnProperty.call(annotated.annotations,
|
|
35368
|
+
for (const id3 of annotationIds) {
|
|
35369
|
+
if (Object.prototype.hasOwnProperty.call(annotated.annotations, id3)) {
|
|
34444
35370
|
if (out === undefined) {
|
|
34445
35371
|
out = {};
|
|
34446
35372
|
}
|
|
34447
|
-
out[
|
|
35373
|
+
out[id3] = annotated.annotations[id3];
|
|
34448
35374
|
}
|
|
34449
35375
|
}
|
|
34450
35376
|
return out;
|
|
@@ -34453,8 +35379,8 @@ var omitAnnotations = (annotationIds) => (annotated) => {
|
|
|
34453
35379
|
const out = {
|
|
34454
35380
|
...annotated.annotations
|
|
34455
35381
|
};
|
|
34456
|
-
for (const
|
|
34457
|
-
delete out[
|
|
35382
|
+
for (const id3 of annotationIds) {
|
|
35383
|
+
delete out[id3];
|
|
34458
35384
|
}
|
|
34459
35385
|
return out;
|
|
34460
35386
|
};
|
|
@@ -37109,7 +38035,7 @@ class ChannelExecutor {
|
|
|
37109
38035
|
const activeChild = subexecutor.activeChildExecutors[0];
|
|
37110
38036
|
const rest = subexecutor.activeChildExecutors.slice(1);
|
|
37111
38037
|
if (activeChild === undefined) {
|
|
37112
|
-
const [emitSeparator, remainingExecutors] = this.applyUpstreamPullStrategy(true, rest, subexecutor.onPull(NoUpstream(rest.reduce((
|
|
38038
|
+
const [emitSeparator, remainingExecutors] = this.applyUpstreamPullStrategy(true, rest, subexecutor.onPull(NoUpstream(rest.reduce((n2, curr) => curr !== undefined ? n2 + 1 : n2, 0))));
|
|
37113
38039
|
this.replaceSubexecutor(new DrainChildExecutors(subexecutor.upstreamExecutor, subexecutor.lastDone, remainingExecutors, subexecutor.upstreamDone, subexecutor.combineChildResults, subexecutor.combineWithChildResult, subexecutor.onPull));
|
|
37114
38040
|
if (isSome2(emitSeparator)) {
|
|
37115
38041
|
this._emitted = emitSeparator.value;
|
|
@@ -38226,7 +39152,7 @@ var fail13 = (error3) => fromEffectOption(fail8(some2(error3)));
|
|
|
38226
39152
|
var flatMap14 = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self2, f, options) => {
|
|
38227
39153
|
const bufferSize = options?.bufferSize ?? 16;
|
|
38228
39154
|
if (options?.switch) {
|
|
38229
|
-
return matchConcurrency(options?.concurrency, () => flatMapParSwitchBuffer(self2, 1, bufferSize, f), (
|
|
39155
|
+
return matchConcurrency(options?.concurrency, () => flatMapParSwitchBuffer(self2, 1, bufferSize, f), (n2) => flatMapParSwitchBuffer(self2, n2, bufferSize, f));
|
|
38230
39156
|
}
|
|
38231
39157
|
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))));
|
|
38232
39158
|
});
|
|
@@ -38240,8 +39166,8 @@ var matchConcurrency = (concurrency, sequential5, bounded4) => {
|
|
|
38240
39166
|
return concurrency > 1 ? bounded4(concurrency) : sequential5();
|
|
38241
39167
|
}
|
|
38242
39168
|
};
|
|
38243
|
-
var flatMapParSwitchBuffer = /* @__PURE__ */ dual(4, (self2,
|
|
38244
|
-
concurrency:
|
|
39169
|
+
var flatMapParSwitchBuffer = /* @__PURE__ */ dual(4, (self2, n2, bufferSize, f) => new StreamImpl(pipe(toChannel2(self2), concatMap(writeChunk), mergeMap((out) => toChannel2(f(out)), {
|
|
39170
|
+
concurrency: n2,
|
|
38245
39171
|
mergeStrategy: BufferSliding(),
|
|
38246
39172
|
bufferSize
|
|
38247
39173
|
}))));
|
|
@@ -38645,8 +39571,8 @@ var toASTAnnotations = (annotations2) => {
|
|
|
38645
39571
|
};
|
|
38646
39572
|
for (const key in builtInAnnotations) {
|
|
38647
39573
|
if (key in annotations2) {
|
|
38648
|
-
const
|
|
38649
|
-
out[
|
|
39574
|
+
const id3 = builtInAnnotations[key];
|
|
39575
|
+
out[id3] = annotations2[key];
|
|
38650
39576
|
delete out[key];
|
|
38651
39577
|
}
|
|
38652
39578
|
}
|
|
@@ -39848,13 +40774,13 @@ class SystemError extends (/* @__PURE__ */ TaggedError2("@effect/platform/Error/
|
|
|
39848
40774
|
// ../../node_modules/.bun/@effect+platform@0.94.2+f436dcc95e9291b3/node_modules/@effect/platform/dist/esm/internal/fileSystem.js
|
|
39849
40775
|
var tag = /* @__PURE__ */ GenericTag("@effect/platform/FileSystem");
|
|
39850
40776
|
var Size = (bytes) => typeof bytes === "bigint" ? bytes : BigInt(bytes);
|
|
39851
|
-
var KiB = (
|
|
39852
|
-
var MiB = (
|
|
39853
|
-
var GiB = (
|
|
39854
|
-
var TiB = (
|
|
40777
|
+
var KiB = (n2) => Size(n2 * 1024);
|
|
40778
|
+
var MiB = (n2) => Size(n2 * 1024 * 1024);
|
|
40779
|
+
var GiB = (n2) => Size(n2 * 1024 * 1024 * 1024);
|
|
40780
|
+
var TiB = (n2) => Size(n2 * 1024 * 1024 * 1024 * 1024);
|
|
39855
40781
|
var bigint1024 = /* @__PURE__ */ BigInt(1024);
|
|
39856
40782
|
var bigintPiB = bigint1024 * bigint1024 * bigint1024 * bigint1024 * bigint1024;
|
|
39857
|
-
var PiB = (
|
|
40783
|
+
var PiB = (n2) => Size(BigInt(n2) * bigintPiB);
|
|
39858
40784
|
var make49 = (impl) => {
|
|
39859
40785
|
return tag.of({
|
|
39860
40786
|
...impl,
|
|
@@ -40114,8 +41040,8 @@ function reduce12(b, f) {
|
|
|
40114
41040
|
return iterable.reduce(f, b);
|
|
40115
41041
|
}
|
|
40116
41042
|
let result = b;
|
|
40117
|
-
for (const
|
|
40118
|
-
result = f(result,
|
|
41043
|
+
for (const n2 of iterable) {
|
|
41044
|
+
result = f(result, n2);
|
|
40119
41045
|
}
|
|
40120
41046
|
return result;
|
|
40121
41047
|
};
|
|
@@ -40126,8 +41052,8 @@ function map23(f) {
|
|
|
40126
41052
|
return iterable.map(f);
|
|
40127
41053
|
}
|
|
40128
41054
|
return function* () {
|
|
40129
|
-
for (const
|
|
40130
|
-
yield f(
|
|
41055
|
+
for (const n2 of iterable) {
|
|
41056
|
+
yield f(n2);
|
|
40131
41057
|
}
|
|
40132
41058
|
}();
|
|
40133
41059
|
};
|
|
@@ -40817,18 +41743,18 @@ var annotate = /* @__PURE__ */ dual(2, (self2, annotation) => {
|
|
|
40817
41743
|
op.annotation = annotation;
|
|
40818
41744
|
return op;
|
|
40819
41745
|
});
|
|
40820
|
-
var spaces = (
|
|
40821
|
-
if (
|
|
41746
|
+
var spaces = (n2) => {
|
|
41747
|
+
if (n2 <= 0) {
|
|
40822
41748
|
return empty31;
|
|
40823
41749
|
}
|
|
40824
|
-
if (
|
|
41750
|
+
if (n2 === 1) {
|
|
40825
41751
|
return char(" ");
|
|
40826
41752
|
}
|
|
40827
|
-
return text(textSpaces(
|
|
41753
|
+
return text(textSpaces(n2));
|
|
40828
41754
|
};
|
|
40829
|
-
var textSpaces = (
|
|
41755
|
+
var textSpaces = (n2) => {
|
|
40830
41756
|
let s = "";
|
|
40831
|
-
for (let i = 0;i <
|
|
41757
|
+
for (let i = 0;i < n2; i++) {
|
|
40832
41758
|
s = s += " ";
|
|
40833
41759
|
}
|
|
40834
41760
|
return s;
|
|
@@ -42558,10 +43484,10 @@ function fromFileUrl(url2) {
|
|
|
42558
43484
|
}));
|
|
42559
43485
|
}
|
|
42560
43486
|
const pathname = url2.pathname;
|
|
42561
|
-
for (let
|
|
42562
|
-
if (pathname[
|
|
42563
|
-
const third = pathname.codePointAt(
|
|
42564
|
-
if (pathname[
|
|
43487
|
+
for (let n2 = 0;n2 < pathname.length; n2++) {
|
|
43488
|
+
if (pathname[n2] === "%") {
|
|
43489
|
+
const third = pathname.codePointAt(n2 + 2) | 32;
|
|
43490
|
+
if (pathname[n2 + 1] === "2" && third === 102) {
|
|
42565
43491
|
return fail8(new BadArgument({
|
|
42566
43492
|
module: "Path",
|
|
42567
43493
|
method: "fromFileUrl",
|
|
@@ -43456,7 +44382,7 @@ function handleProcessInteger(options3) {
|
|
|
43456
44382
|
error: some2("Must provide an integer value")
|
|
43457
44383
|
}
|
|
43458
44384
|
})),
|
|
43459
|
-
onSuccess: (
|
|
44385
|
+
onSuccess: (n2) => match12(options3.validate(n2), {
|
|
43460
44386
|
onFailure: (error4) => Action.NextFrame({
|
|
43461
44387
|
state: {
|
|
43462
44388
|
...state,
|
|
@@ -43482,14 +44408,14 @@ var integer2 = (options3) => {
|
|
|
43482
44408
|
max: Number.POSITIVE_INFINITY,
|
|
43483
44409
|
incrementBy: 1,
|
|
43484
44410
|
decrementBy: 1,
|
|
43485
|
-
validate: (
|
|
43486
|
-
if (
|
|
43487
|
-
return fail8(`${
|
|
44411
|
+
validate: (n2) => {
|
|
44412
|
+
if (n2 < opts.min) {
|
|
44413
|
+
return fail8(`${n2} must be greater than or equal to ${opts.min}`);
|
|
43488
44414
|
}
|
|
43489
|
-
if (
|
|
43490
|
-
return fail8(`${
|
|
44415
|
+
if (n2 > opts.max) {
|
|
44416
|
+
return fail8(`${n2} must be less than or equal to ${opts.max}`);
|
|
43491
44417
|
}
|
|
43492
|
-
return succeed7(
|
|
44418
|
+
return succeed7(n2);
|
|
43493
44419
|
},
|
|
43494
44420
|
...options3
|
|
43495
44421
|
};
|
|
@@ -43545,7 +44471,7 @@ function handleProcessFloat(options3) {
|
|
|
43545
44471
|
error: some2("Must provide a floating point value")
|
|
43546
44472
|
}
|
|
43547
44473
|
})),
|
|
43548
|
-
onSuccess: (
|
|
44474
|
+
onSuccess: (n2) => flatMap10(sync3(() => round(n2, options3.precision)), (rounded) => match12(options3.validate(rounded), {
|
|
43549
44475
|
onFailure: (error4) => Action.NextFrame({
|
|
43550
44476
|
state: {
|
|
43551
44477
|
...state,
|
|
@@ -43572,14 +44498,14 @@ var float = (options3) => {
|
|
|
43572
44498
|
incrementBy: 1,
|
|
43573
44499
|
decrementBy: 1,
|
|
43574
44500
|
precision: 2,
|
|
43575
|
-
validate: (
|
|
43576
|
-
if (
|
|
43577
|
-
return fail8(`${
|
|
44501
|
+
validate: (n2) => {
|
|
44502
|
+
if (n2 < opts.min) {
|
|
44503
|
+
return fail8(`${n2} must be greater than or equal to ${opts.min}`);
|
|
43578
44504
|
}
|
|
43579
|
-
if (
|
|
43580
|
-
return fail8(`${
|
|
44505
|
+
if (n2 > opts.max) {
|
|
44506
|
+
return fail8(`${n2} must be less than or equal to ${opts.max}`);
|
|
43581
44507
|
}
|
|
43582
|
-
return succeed7(
|
|
44508
|
+
return succeed7(n2);
|
|
43583
44509
|
},
|
|
43584
44510
|
...options3
|
|
43585
44511
|
};
|
|
@@ -44408,7 +45334,7 @@ var validateInternal = (self2, value6, config2) => {
|
|
|
44408
45334
|
}
|
|
44409
45335
|
}
|
|
44410
45336
|
};
|
|
44411
|
-
var attempt = (option5,
|
|
45337
|
+
var attempt = (option5, typeName2, parse5) => orElseFail2(option5, () => `${typeName2} options do not have a default value`).pipe(flatMap10((value6) => orElseFail2(parse5(value6), () => `'${value6}' is not a ${typeName2}`)));
|
|
44412
45338
|
var validatePathExistence = (path2, shouldPathExist, pathExists) => {
|
|
44413
45339
|
if (shouldPathExist === "no" && pathExists) {
|
|
44414
45340
|
return fail8(`Path '${path2}' must not exist`);
|
|
@@ -44701,13 +45627,13 @@ var render4 = (self2, config2) => {
|
|
|
44701
45627
|
return of(text4("<command>"));
|
|
44702
45628
|
}
|
|
44703
45629
|
case "Named": {
|
|
44704
|
-
const
|
|
45630
|
+
const typeInfo2 = config2.showTypes ? match2(self2.acceptedValues, {
|
|
44705
45631
|
onNone: () => empty34,
|
|
44706
45632
|
onSome: (s) => concat3(space3, text4(s))
|
|
44707
45633
|
}) : empty34;
|
|
44708
45634
|
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;
|
|
44709
45635
|
const nameInfo = text4(join(namesToShow, ", "));
|
|
44710
|
-
return config2.showAllNames && self2.names.length > 1 ? of(spans([text4("("), nameInfo,
|
|
45636
|
+
return config2.showAllNames && self2.names.length > 1 ? of(spans([text4("("), nameInfo, typeInfo2, text4(")")])) : of(concat3(nameInfo, typeInfo2));
|
|
44711
45637
|
}
|
|
44712
45638
|
case "Optional": {
|
|
44713
45639
|
return map4(render4(self2.usage, config2), (span2) => spans([text4("["), span2, text4("]")]));
|
|
@@ -45211,7 +46137,7 @@ var wizardInternal2 = (self2, config2) => {
|
|
|
45211
46137
|
message: toAnsiText(message).trimEnd(),
|
|
45212
46138
|
min: getMinSizeInternal(self2),
|
|
45213
46139
|
max: getMaxSizeInternal(self2)
|
|
45214
|
-
}).pipe(zipLeft2(log2()), flatMap10((
|
|
46140
|
+
}).pipe(zipLeft2(log2()), flatMap10((n2) => n2 <= 0 ? succeed7(empty3()) : make25(empty3()).pipe(flatMap10((ref) => wizardInternal2(self2.args, config2).pipe(flatMap10((args2) => update3(ref, appendAll(args2))), repeatN2(n2 - 1), zipRight3(get11(ref)), tap2((args2) => validateInternal2(self2, args2, config2)))))));
|
|
45215
46141
|
}
|
|
45216
46142
|
case "WithDefault": {
|
|
45217
46143
|
const defaultHelp = p(`This argument is optional - use the default?`);
|
|
@@ -46066,7 +46992,7 @@ var wizardInternal3 = (self2, config2) => {
|
|
|
46066
46992
|
message: toAnsiText(message).trimEnd(),
|
|
46067
46993
|
min: getMinSizeInternal2(self2),
|
|
46068
46994
|
max: getMaxSizeInternal2(self2)
|
|
46069
|
-
}).pipe(flatMap10((
|
|
46995
|
+
}).pipe(flatMap10((n2) => n2 <= 0 ? succeed7(empty3()) : make25(empty3()).pipe(flatMap10((ref) => wizardInternal3(self2.argumentOption, config2).pipe(flatMap10((args2) => update3(ref, appendAll(args2))), repeatN2(n2 - 1), zipRight3(get11(ref)))))));
|
|
46070
46996
|
}
|
|
46071
46997
|
case "WithDefault": {
|
|
46072
46998
|
if (isBoolInternal(self2.options)) {
|
|
@@ -46855,7 +47781,7 @@ var withSubcommands = /* @__PURE__ */ dual(2, (self2, subcommands) => {
|
|
|
46855
47781
|
const op = Object.create(proto23);
|
|
46856
47782
|
op._tag = "Subcommands";
|
|
46857
47783
|
op.parent = self2;
|
|
46858
|
-
op.children = map4(subcommands, ([
|
|
47784
|
+
op.children = map4(subcommands, ([id3, command]) => map33(command, (a) => [id3, a]));
|
|
46859
47785
|
return op;
|
|
46860
47786
|
});
|
|
46861
47787
|
var wizard6 = /* @__PURE__ */ dual(3, (self2, prefix, config2) => wizardInternal4(self2, prefix, config2));
|
|
@@ -49328,25 +50254,25 @@ class MailboxImpl extends Class2 {
|
|
|
49328
50254
|
}
|
|
49329
50255
|
return succeed([messages, this.releaseCapacity()]);
|
|
49330
50256
|
});
|
|
49331
|
-
takeN(
|
|
50257
|
+
takeN(n2) {
|
|
49332
50258
|
return suspend(() => {
|
|
49333
50259
|
if (this.state._tag === "Done") {
|
|
49334
50260
|
return exitAs(this.state.exit, constDone);
|
|
49335
|
-
} else if (
|
|
50261
|
+
} else if (n2 <= 0) {
|
|
49336
50262
|
return succeed([empty41, false]);
|
|
49337
50263
|
}
|
|
49338
|
-
|
|
50264
|
+
n2 = Math.min(n2, this.capacity);
|
|
49339
50265
|
let messages;
|
|
49340
|
-
if (
|
|
49341
|
-
messages = take2(this.messagesChunk,
|
|
49342
|
-
this.messagesChunk = drop2(this.messagesChunk,
|
|
49343
|
-
} else if (
|
|
50266
|
+
if (n2 <= this.messagesChunk.length) {
|
|
50267
|
+
messages = take2(this.messagesChunk, n2);
|
|
50268
|
+
this.messagesChunk = drop2(this.messagesChunk, n2);
|
|
50269
|
+
} else if (n2 <= this.messages.length + this.messagesChunk.length) {
|
|
49344
50270
|
this.messagesChunk = appendAll2(this.messagesChunk, unsafeFromArray(this.messages));
|
|
49345
50271
|
this.messages = [];
|
|
49346
|
-
messages = take2(this.messagesChunk,
|
|
49347
|
-
this.messagesChunk = drop2(this.messagesChunk,
|
|
50272
|
+
messages = take2(this.messagesChunk, n2);
|
|
50273
|
+
this.messagesChunk = drop2(this.messagesChunk, n2);
|
|
49348
50274
|
} else {
|
|
49349
|
-
return zipRight(this.awaitTake, this.takeN(
|
|
50275
|
+
return zipRight(this.awaitTake, this.takeN(n2));
|
|
49350
50276
|
}
|
|
49351
50277
|
return succeed([messages, this.releaseCapacity()]);
|
|
49352
50278
|
});
|
|
@@ -49457,21 +50383,21 @@ class MailboxImpl extends Class2 {
|
|
|
49457
50383
|
}
|
|
49458
50384
|
return false;
|
|
49459
50385
|
}
|
|
49460
|
-
let
|
|
50386
|
+
let n2 = this.capacity - this.messages.length - this.messagesChunk.length;
|
|
49461
50387
|
for (const entry of this.state.offers) {
|
|
49462
|
-
if (
|
|
50388
|
+
if (n2 === 0)
|
|
49463
50389
|
return false;
|
|
49464
50390
|
else if (entry._tag === "Single") {
|
|
49465
50391
|
this.messages.push(entry.message);
|
|
49466
|
-
|
|
50392
|
+
n2--;
|
|
49467
50393
|
entry.resume(exitTrue);
|
|
49468
50394
|
this.state.offers.delete(entry);
|
|
49469
50395
|
} else {
|
|
49470
50396
|
for (;entry.offset < entry.remaining.length; entry.offset++) {
|
|
49471
|
-
if (
|
|
50397
|
+
if (n2 === 0)
|
|
49472
50398
|
return false;
|
|
49473
50399
|
this.messages.push(entry.remaining[entry.offset]);
|
|
49474
|
-
|
|
50400
|
+
n2--;
|
|
49475
50401
|
}
|
|
49476
50402
|
entry.resume(exitEmpty);
|
|
49477
50403
|
this.state.offers.delete(entry);
|
|
@@ -49712,13 +50638,13 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
49712
50638
|
initialMessage
|
|
49713
50639
|
}) {
|
|
49714
50640
|
return gen2(function* () {
|
|
49715
|
-
const
|
|
50641
|
+
const id3 = idCounter++;
|
|
49716
50642
|
let requestIdCounter = 0;
|
|
49717
50643
|
const requestMap = new Map;
|
|
49718
50644
|
const collector = unsafeMakeCollector();
|
|
49719
50645
|
const wrappedEncode = encode2 ? (message) => zipRight3(collector.clear, provideService2(encode2(message), Collector, collector)) : succeed7;
|
|
49720
50646
|
const readyLatch = yield* make37();
|
|
49721
|
-
const backing = yield* platform.spawn(
|
|
50647
|
+
const backing = yield* platform.spawn(id3);
|
|
49722
50648
|
yield* backing.run((message) => {
|
|
49723
50649
|
if (message[0] === 0) {
|
|
49724
50650
|
return complete2(readyLatch, _void);
|
|
@@ -49758,20 +50684,20 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
49758
50684
|
const executeAcquire = (request, makeMailbox) => withFiberRuntime2((fiber) => {
|
|
49759
50685
|
const context7 = fiber.getFiberRef(currentContext2);
|
|
49760
50686
|
const span2 = getOption2(context7, ParentSpan).pipe(filter((span3) => span3._tag === "Span"));
|
|
49761
|
-
const
|
|
50687
|
+
const id4 = requestIdCounter++;
|
|
49762
50688
|
return makeMailbox.pipe(tap2((mailbox) => {
|
|
49763
|
-
requestMap.set(
|
|
49764
|
-
return wrappedEncode(request).pipe(tap2((payload) => backing.send([
|
|
50689
|
+
requestMap.set(id4, mailbox);
|
|
50690
|
+
return wrappedEncode(request).pipe(tap2((payload) => backing.send([id4, 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)));
|
|
49765
50691
|
}), map16((mailbox) => ({
|
|
49766
|
-
id:
|
|
50692
|
+
id: id4,
|
|
49767
50693
|
mailbox
|
|
49768
50694
|
})));
|
|
49769
50695
|
});
|
|
49770
50696
|
const executeRelease = ({
|
|
49771
|
-
id:
|
|
50697
|
+
id: id4
|
|
49772
50698
|
}, exit3) => {
|
|
49773
|
-
const release = sync3(() => requestMap.delete(
|
|
49774
|
-
return isFailure(exit3) ? zipRight3(orDie2(backing.send([
|
|
50699
|
+
const release = sync3(() => requestMap.delete(id4));
|
|
50700
|
+
return isFailure(exit3) ? zipRight3(orDie2(backing.send([id4, 1])), release) : release;
|
|
49775
50701
|
};
|
|
49776
50702
|
const execute4 = (request) => fromChannel4(acquireUseRelease4(executeAcquire(request, make64()), ({
|
|
49777
50703
|
mailbox
|
|
@@ -49787,7 +50713,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
49787
50713
|
})));
|
|
49788
50714
|
}
|
|
49789
50715
|
return {
|
|
49790
|
-
id:
|
|
50716
|
+
id: id3,
|
|
49791
50717
|
execute: execute4,
|
|
49792
50718
|
executeEffect
|
|
49793
50719
|
};
|
|
@@ -49798,7 +50724,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
49798
50724
|
var layerManager = /* @__PURE__ */ effect(WorkerManager, makeManager);
|
|
49799
50725
|
var makePlatform = () => (options7) => PlatformWorker.of({
|
|
49800
50726
|
[PlatformWorkerTypeId]: PlatformWorkerTypeId,
|
|
49801
|
-
spawn(
|
|
50727
|
+
spawn(id3) {
|
|
49802
50728
|
return gen2(function* () {
|
|
49803
50729
|
const spawn = yield* Spawner;
|
|
49804
50730
|
let currentPort;
|
|
@@ -49806,7 +50732,7 @@ var makePlatform = () => (options7) => PlatformWorker.of({
|
|
|
49806
50732
|
const run9 = (handler) => uninterruptibleMask3((restore) => gen2(function* () {
|
|
49807
50733
|
const scope4 = yield* scope2;
|
|
49808
50734
|
const port2 = yield* options7.setup({
|
|
49809
|
-
worker: spawn(
|
|
50735
|
+
worker: spawn(id3),
|
|
49810
50736
|
scope: scope4
|
|
49811
50737
|
});
|
|
49812
50738
|
currentPort = port2;
|
|
@@ -50744,8 +51670,8 @@ function make71({
|
|
|
50744
51670
|
compiler,
|
|
50745
51671
|
reactiveMailbox,
|
|
50746
51672
|
rollback = "ROLLBACK",
|
|
50747
|
-
rollbackSavepoint = (
|
|
50748
|
-
savepoint = (
|
|
51673
|
+
rollbackSavepoint = (id3) => `ROLLBACK TO SAVEPOINT ${id3}`,
|
|
51674
|
+
savepoint = (id3) => `SAVEPOINT ${id3}`,
|
|
50749
51675
|
spanAttributes,
|
|
50750
51676
|
transactionAcquirer,
|
|
50751
51677
|
transformRows
|
|
@@ -50761,10 +51687,10 @@ function make71({
|
|
|
50761
51687
|
spanAttributes,
|
|
50762
51688
|
acquireConnection: flatMap10(make35(), (scope4) => map16(extend2(transactionAcquirer, scope4), (conn) => [scope4, conn])),
|
|
50763
51689
|
begin: (conn) => conn.executeUnprepared(beginTransaction, [], undefined),
|
|
50764
|
-
savepoint: (conn,
|
|
51690
|
+
savepoint: (conn, id3) => conn.executeUnprepared(savepoint(`effect_sql_${id3}`), [], undefined),
|
|
50765
51691
|
commit: (conn) => conn.executeUnprepared(commit, [], undefined),
|
|
50766
51692
|
rollback: (conn) => conn.executeUnprepared(rollback, [], undefined),
|
|
50767
|
-
rollbackSavepoint: (conn,
|
|
51693
|
+
rollbackSavepoint: (conn, id3) => conn.executeUnprepared(rollbackSavepoint(`effect_sql_${id3}`), [], undefined)
|
|
50768
51694
|
});
|
|
50769
51695
|
const reactivity = yield* Reactivity;
|
|
50770
51696
|
const client = Object.assign(make70(getConnection, compiler, spanAttributes, transformRows), {
|
|
@@ -50803,11 +51729,11 @@ var makeWithTransaction = (options7) => (effect3) => uninterruptibleMask3((resto
|
|
|
50803
51729
|
const clock3 = get3(fiber.currentDefaultServices, Clock);
|
|
50804
51730
|
const connOption = getOption2(context7, options7.transactionTag);
|
|
50805
51731
|
const conn = connOption._tag === "Some" ? succeed7([undefined, connOption.value[0]]) : options7.acquireConnection;
|
|
50806
|
-
const
|
|
50807
|
-
return flatMap10(conn, ([scope4, conn2]) => (
|
|
51732
|
+
const id3 = connOption._tag === "Some" ? connOption.value[1] + 1 : 0;
|
|
51733
|
+
return flatMap10(conn, ([scope4, conn2]) => (id3 === 0 ? options7.begin(conn2) : options7.savepoint(conn2, id3)).pipe(zipRight3(locally(restore(effect3), currentContext2, add2(context7, options7.transactionTag, [conn2, id3]).pipe(add2(ParentSpan, span2)))), exit2, flatMap10((exit3) => {
|
|
50808
51734
|
let effect4;
|
|
50809
51735
|
if (isSuccess(exit3)) {
|
|
50810
|
-
if (
|
|
51736
|
+
if (id3 === 0) {
|
|
50811
51737
|
span2.event("db.transaction.commit", clock3.unsafeCurrentTimeNanos());
|
|
50812
51738
|
effect4 = orDie2(options7.commit(conn2));
|
|
50813
51739
|
} else {
|
|
@@ -50816,7 +51742,7 @@ var makeWithTransaction = (options7) => (effect3) => uninterruptibleMask3((resto
|
|
|
50816
51742
|
}
|
|
50817
51743
|
} else {
|
|
50818
51744
|
span2.event("db.transaction.rollback", clock3.unsafeCurrentTimeNanos());
|
|
50819
|
-
effect4 = orDie2(
|
|
51745
|
+
effect4 = orDie2(id3 > 0 ? options7.rollbackSavepoint(conn2, id3) : options7.rollback(conn2));
|
|
50820
51746
|
}
|
|
50821
51747
|
const withScope3 = scope4 !== undefined ? ensuring2(effect4, close(scope4, exit3)) : effect4;
|
|
50822
51748
|
return zipRight3(withScope3, exit3);
|
|
@@ -50883,22 +51809,22 @@ var make73 = ({
|
|
|
50883
51809
|
name,
|
|
50884
51810
|
createdAt: created_at
|
|
50885
51811
|
})));
|
|
50886
|
-
const loadMigration = ([
|
|
51812
|
+
const loadMigration = ([id3, name, load]) => catchAllDefect2(load, (_) => fail8(new MigrationError({
|
|
50887
51813
|
reason: "import-error",
|
|
50888
|
-
message: `Could not import migration "${
|
|
51814
|
+
message: `Could not import migration "${id3}_${name}"
|
|
50889
51815
|
|
|
50890
51816
|
${_}`
|
|
50891
51817
|
}))).pipe(flatMap10((_) => isEffect2(_) ? succeed7(_) : _.default ? succeed7(_.default?.default ?? _.default) : fail8(new MigrationError({
|
|
50892
51818
|
reason: "import-error",
|
|
50893
|
-
message: `Default export not found for migration "${
|
|
51819
|
+
message: `Default export not found for migration "${id3}_${name}"`
|
|
50894
51820
|
}))), filterOrFail2((_) => isEffect2(_), () => new MigrationError({
|
|
50895
51821
|
reason: "import-error",
|
|
50896
|
-
message: `Default export was not an Effect for migration "${
|
|
51822
|
+
message: `Default export was not an Effect for migration "${id3}_${name}"`
|
|
50897
51823
|
})));
|
|
50898
|
-
const runMigration = (
|
|
51824
|
+
const runMigration = (id3, name, effect3) => orDieWith2(effect3, (error4) => new MigrationError({
|
|
50899
51825
|
cause: error4,
|
|
50900
51826
|
reason: "failed",
|
|
50901
|
-
message: `Migration "${
|
|
51827
|
+
message: `Migration "${id3}_${name}" failed`
|
|
50902
51828
|
}));
|
|
50903
51829
|
const run9 = gen2(function* () {
|
|
50904
51830
|
yield* sql.onDialectOrElse({
|
|
@@ -50909,7 +51835,7 @@ ${_}`
|
|
|
50909
51835
|
onNone: () => 0,
|
|
50910
51836
|
onSome: (_) => _.id
|
|
50911
51837
|
})), loader]);
|
|
50912
|
-
if (new Set(current.map(([
|
|
51838
|
+
if (new Set(current.map(([id3]) => id3)).size !== current.length) {
|
|
50913
51839
|
return yield* new MigrationError({
|
|
50914
51840
|
reason: "duplicates",
|
|
50915
51841
|
message: "Found duplicate migration id's"
|
|
@@ -50924,19 +51850,19 @@ ${_}`
|
|
|
50924
51850
|
required2.push([currentId, currentName, yield* loadMigration(resolved)]);
|
|
50925
51851
|
}
|
|
50926
51852
|
if (required2.length > 0) {
|
|
50927
|
-
yield* pipe(insertMigrations(required2.map(([
|
|
51853
|
+
yield* pipe(insertMigrations(required2.map(([id3, name]) => [id3, name])), mapError2((_) => new MigrationError({
|
|
50928
51854
|
reason: "locked",
|
|
50929
51855
|
message: "Migrations already running"
|
|
50930
51856
|
})));
|
|
50931
51857
|
}
|
|
50932
|
-
yield* forEach5(required2, ([
|
|
51858
|
+
yield* forEach5(required2, ([id3, name, effect3]) => logDebug2(`Running migration`).pipe(zipRight3(runMigration(id3, name, effect3)), annotateLogs2("migration_id", String(id3)), annotateLogs2("migration_name", name)), {
|
|
50933
51859
|
discard: true
|
|
50934
51860
|
});
|
|
50935
51861
|
yield* pipe(latestMigration, flatMap10(match2({
|
|
50936
51862
|
onNone: () => logDebug2(`Migrations complete`),
|
|
50937
51863
|
onSome: (_) => logDebug2(`Migrations complete`).pipe(annotateLogs2("latest_migration_id", _.id.toString()), annotateLogs2("latest_migration_name", _.name))
|
|
50938
51864
|
})));
|
|
50939
|
-
return required2.map(([
|
|
51865
|
+
return required2.map(([id3, name]) => [id3, name]);
|
|
50940
51866
|
});
|
|
50941
51867
|
yield* ensureMigrationsTable;
|
|
50942
51868
|
const completed = yield* pipe(sql.withTransaction(run9), catchTag2("MigrationError", (_) => _.reason === "locked" ? as3(logDebug2(_.message), []) : fail8(_)));
|
|
@@ -50946,9 +51872,9 @@ ${_}`
|
|
|
50946
51872
|
return completed;
|
|
50947
51873
|
});
|
|
50948
51874
|
var migrationOrder = /* @__PURE__ */ make2(([a], [b]) => number3(a, b));
|
|
50949
|
-
var fromGlob = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^(?:.*\/)?(\d+)_([^.]+)\.(js|ts)$/))), map4(([key,
|
|
50950
|
-
var fromBabelGlob = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^_(\d+)_([^.]+?)(Js|Ts)?$/))), map4(([key,
|
|
50951
|
-
var fromRecord = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^(\d+)_(.+)$/))), map4(([key,
|
|
51875
|
+
var fromGlob = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^(?:.*\/)?(\d+)_([^.]+)\.(js|ts)$/))), map4(([key, id3, name]) => [Number(id3), name, promise2(() => migrations[key]())]), sort(migrationOrder), succeed7);
|
|
51876
|
+
var fromBabelGlob = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^_(\d+)_([^.]+?)(Js|Ts)?$/))), map4(([key, id3, name]) => [Number(id3), name, succeed7(migrations[key])]), sort(migrationOrder), succeed7);
|
|
51877
|
+
var fromRecord = (migrations) => pipe(Object.keys(migrations), filterMap2((_) => fromNullable(_.match(/^(\d+)_(.+)$/))), map4(([key, id3, name]) => [Number(id3), name, succeed7(migrations[key])]), sort(migrationOrder), succeed7);
|
|
50952
51878
|
|
|
50953
51879
|
// ../../node_modules/.bun/@effect+platform@0.94.2+f436dcc95e9291b3/node_modules/@effect/platform/dist/esm/FetchHttpClient.js
|
|
50954
51880
|
var exports_FetchHttpClient = {};
|
|
@@ -55391,46 +56317,46 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
55391
56317
|
}
|
|
55392
56318
|
doc.write(`const newResult = {};`);
|
|
55393
56319
|
for (const key of normalized.keys) {
|
|
55394
|
-
const
|
|
56320
|
+
const id3 = ids3[key];
|
|
55395
56321
|
const k = esc(key);
|
|
55396
56322
|
const schema = shape[key];
|
|
55397
56323
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
55398
|
-
doc.write(`const ${
|
|
56324
|
+
doc.write(`const ${id3} = ${parseStr(key)};`);
|
|
55399
56325
|
if (isOptionalOut) {
|
|
55400
56326
|
doc.write(`
|
|
55401
|
-
if (${
|
|
56327
|
+
if (${id3}.issues.length) {
|
|
55402
56328
|
if (${k} in input) {
|
|
55403
|
-
payload.issues = payload.issues.concat(${
|
|
56329
|
+
payload.issues = payload.issues.concat(${id3}.issues.map(iss => ({
|
|
55404
56330
|
...iss,
|
|
55405
56331
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
55406
56332
|
})));
|
|
55407
56333
|
}
|
|
55408
56334
|
}
|
|
55409
56335
|
|
|
55410
|
-
if (${
|
|
56336
|
+
if (${id3}.value === undefined) {
|
|
55411
56337
|
if (${k} in input) {
|
|
55412
56338
|
newResult[${k}] = undefined;
|
|
55413
56339
|
}
|
|
55414
56340
|
} else {
|
|
55415
|
-
newResult[${k}] = ${
|
|
56341
|
+
newResult[${k}] = ${id3}.value;
|
|
55416
56342
|
}
|
|
55417
56343
|
|
|
55418
56344
|
`);
|
|
55419
56345
|
} else {
|
|
55420
56346
|
doc.write(`
|
|
55421
|
-
if (${
|
|
55422
|
-
payload.issues = payload.issues.concat(${
|
|
56347
|
+
if (${id3}.issues.length) {
|
|
56348
|
+
payload.issues = payload.issues.concat(${id3}.issues.map(iss => ({
|
|
55423
56349
|
...iss,
|
|
55424
56350
|
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
55425
56351
|
})));
|
|
55426
56352
|
}
|
|
55427
56353
|
|
|
55428
|
-
if (${
|
|
56354
|
+
if (${id3}.value === undefined) {
|
|
55429
56355
|
if (${k} in input) {
|
|
55430
56356
|
newResult[${k}] = undefined;
|
|
55431
56357
|
}
|
|
55432
56358
|
} else {
|
|
55433
|
-
newResult[${k}] = ${
|
|
56359
|
+
newResult[${k}] = ${id3}.value;
|
|
55434
56360
|
}
|
|
55435
56361
|
|
|
55436
56362
|
`);
|
|
@@ -63146,26 +64072,26 @@ function extractDefs(ctx, schema) {
|
|
|
63146
64072
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
63147
64073
|
const idToSchema = new Map;
|
|
63148
64074
|
for (const entry of ctx.seen.entries()) {
|
|
63149
|
-
const
|
|
63150
|
-
if (
|
|
63151
|
-
const existing = idToSchema.get(
|
|
64075
|
+
const id3 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
64076
|
+
if (id3) {
|
|
64077
|
+
const existing = idToSchema.get(id3);
|
|
63152
64078
|
if (existing && existing !== entry[0]) {
|
|
63153
|
-
throw new Error(`Duplicate schema id "${
|
|
64079
|
+
throw new Error(`Duplicate schema id "${id3}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
63154
64080
|
}
|
|
63155
|
-
idToSchema.set(
|
|
64081
|
+
idToSchema.set(id3, entry[0]);
|
|
63156
64082
|
}
|
|
63157
64083
|
}
|
|
63158
64084
|
const makeURI = (entry) => {
|
|
63159
64085
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
63160
64086
|
if (ctx.external) {
|
|
63161
64087
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
63162
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
64088
|
+
const uriGenerator = ctx.external.uri ?? ((id4) => id4);
|
|
63163
64089
|
if (externalId) {
|
|
63164
64090
|
return { ref: uriGenerator(externalId) };
|
|
63165
64091
|
}
|
|
63166
|
-
const
|
|
63167
|
-
entry[1].defId =
|
|
63168
|
-
return { defId:
|
|
64092
|
+
const id3 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
64093
|
+
entry[1].defId = id3;
|
|
64094
|
+
return { defId: id3, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id3}` };
|
|
63169
64095
|
}
|
|
63170
64096
|
if (entry[1] === root) {
|
|
63171
64097
|
return { ref: "#" };
|
|
@@ -63211,8 +64137,8 @@ function extractDefs(ctx, schema) {
|
|
|
63211
64137
|
continue;
|
|
63212
64138
|
}
|
|
63213
64139
|
}
|
|
63214
|
-
const
|
|
63215
|
-
if (
|
|
64140
|
+
const id3 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
64141
|
+
if (id3) {
|
|
63216
64142
|
extractToDef(entry);
|
|
63217
64143
|
continue;
|
|
63218
64144
|
}
|
|
@@ -63306,10 +64232,10 @@ function finalize(ctx, schema) {
|
|
|
63306
64232
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
63307
64233
|
} else if (ctx.target === "openapi-3.0") {} else {}
|
|
63308
64234
|
if (ctx.external?.uri) {
|
|
63309
|
-
const
|
|
63310
|
-
if (!
|
|
64235
|
+
const id3 = ctx.external.registry.get(schema)?.id;
|
|
64236
|
+
if (!id3)
|
|
63311
64237
|
throw new Error("Schema is missing an `id` property");
|
|
63312
|
-
result.$id = ctx.external.uri(
|
|
64238
|
+
result.$id = ctx.external.uri(id3);
|
|
63313
64239
|
}
|
|
63314
64240
|
Object.assign(result, root.def ?? root.schema);
|
|
63315
64241
|
const defs = ctx.external?.defs ?? {};
|
|
@@ -69719,7 +70645,7 @@ function createParser(callbacks) {
|
|
|
69719
70645
|
if (typeof callbacks == "function")
|
|
69720
70646
|
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
69721
70647
|
const { onEvent = noop, onError: onError4 = noop, onRetry = noop, onComment } = callbacks;
|
|
69722
|
-
let incompleteLine = "", isFirstChunk = true,
|
|
70648
|
+
let incompleteLine = "", isFirstChunk = true, id3, data = "", eventType = "";
|
|
69723
70649
|
function feed2(newChunk) {
|
|
69724
70650
|
const chunk4 = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete3, incomplete] = splitLines4(`${incompleteLine}${chunk4}`);
|
|
69725
70651
|
for (const line4 of complete3)
|
|
@@ -69753,7 +70679,7 @@ function createParser(callbacks) {
|
|
|
69753
70679
|
`;
|
|
69754
70680
|
break;
|
|
69755
70681
|
case "id":
|
|
69756
|
-
|
|
70682
|
+
id3 = value6.includes("\x00") ? undefined : value6;
|
|
69757
70683
|
break;
|
|
69758
70684
|
case "retry":
|
|
69759
70685
|
/^\d+$/.test(value6) ? onRetry(parseInt(value6, 10)) : onError4(new ParseError2(`Invalid \`retry\` value: "${value6}"`, {
|
|
@@ -69769,14 +70695,14 @@ function createParser(callbacks) {
|
|
|
69769
70695
|
}
|
|
69770
70696
|
function dispatchEvent() {
|
|
69771
70697
|
data.length > 0 && onEvent({
|
|
69772
|
-
id:
|
|
70698
|
+
id: id3,
|
|
69773
70699
|
event: eventType || undefined,
|
|
69774
70700
|
data: data.endsWith(`
|
|
69775
70701
|
`) ? data.slice(0, -1) : data
|
|
69776
|
-
}),
|
|
70702
|
+
}), id3 = undefined, data = "", eventType = "";
|
|
69777
70703
|
}
|
|
69778
70704
|
function reset2(options7 = {}) {
|
|
69779
|
-
incompleteLine && options7.consume && parseLine(incompleteLine), isFirstChunk = true,
|
|
70705
|
+
incompleteLine && options7.consume && parseLine(incompleteLine), isFirstChunk = true, id3 = undefined, data = "", eventType = "", incompleteLine = "";
|
|
69780
70706
|
}
|
|
69781
70707
|
return { feed: feed2, reset: reset2 };
|
|
69782
70708
|
}
|
|
@@ -71043,8 +71969,8 @@ function parseUnknownDef() {
|
|
|
71043
71969
|
var parseReadonlyDef = (def, refs) => {
|
|
71044
71970
|
return parseDef(def.innerType._def, refs);
|
|
71045
71971
|
};
|
|
71046
|
-
var selectParser = (def,
|
|
71047
|
-
switch (
|
|
71972
|
+
var selectParser = (def, typeName2, refs) => {
|
|
71973
|
+
switch (typeName2) {
|
|
71048
71974
|
case ZodFirstPartyTypeKind2.ZodString:
|
|
71049
71975
|
return parseStringDef(def, refs);
|
|
71050
71976
|
case ZodFirstPartyTypeKind2.ZodNumber:
|
|
@@ -71116,7 +72042,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
71116
72042
|
default:
|
|
71117
72043
|
return /* @__PURE__ */ ((_) => {
|
|
71118
72044
|
return;
|
|
71119
|
-
})(
|
|
72045
|
+
})(typeName2);
|
|
71120
72046
|
}
|
|
71121
72047
|
};
|
|
71122
72048
|
var getRelativePath = (pathA, pathB) => {
|
|
@@ -71518,7 +72444,7 @@ function tool(tool2) {
|
|
|
71518
72444
|
return tool2;
|
|
71519
72445
|
}
|
|
71520
72446
|
function createProviderToolFactory({
|
|
71521
|
-
id:
|
|
72447
|
+
id: id3,
|
|
71522
72448
|
inputSchema
|
|
71523
72449
|
}) {
|
|
71524
72450
|
return ({
|
|
@@ -71532,7 +72458,7 @@ function createProviderToolFactory({
|
|
|
71532
72458
|
...args2
|
|
71533
72459
|
}) => tool({
|
|
71534
72460
|
type: "provider",
|
|
71535
|
-
id:
|
|
72461
|
+
id: id3,
|
|
71536
72462
|
args: args2,
|
|
71537
72463
|
inputSchema,
|
|
71538
72464
|
outputSchema,
|
|
@@ -71545,7 +72471,7 @@ function createProviderToolFactory({
|
|
|
71545
72471
|
});
|
|
71546
72472
|
}
|
|
71547
72473
|
function createProviderToolFactoryWithOutputSchema({
|
|
71548
|
-
id:
|
|
72474
|
+
id: id3,
|
|
71549
72475
|
inputSchema,
|
|
71550
72476
|
outputSchema,
|
|
71551
72477
|
supportsDeferredResults
|
|
@@ -71560,7 +72486,7 @@ function createProviderToolFactoryWithOutputSchema({
|
|
|
71560
72486
|
...args2
|
|
71561
72487
|
}) => tool({
|
|
71562
72488
|
type: "provider",
|
|
71563
|
-
id:
|
|
72489
|
+
id: id3,
|
|
71564
72490
|
args: args2,
|
|
71565
72491
|
inputSchema,
|
|
71566
72492
|
outputSchema,
|
|
@@ -72196,7 +73122,7 @@ function prepareTools({
|
|
|
72196
73122
|
"gemini-flash-latest",
|
|
72197
73123
|
"gemini-flash-lite-latest",
|
|
72198
73124
|
"gemini-pro-latest"
|
|
72199
|
-
].some((
|
|
73125
|
+
].some((id3) => id3 === modelId);
|
|
72200
73126
|
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
|
|
72201
73127
|
const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
|
|
72202
73128
|
const supportsFileSearch = modelId.includes("gemini-2.5") || modelId.includes("gemini-3");
|
|
@@ -73159,7 +74085,7 @@ var GoogleGenerativeAIImageModel = class {
|
|
|
73159
74085
|
var _a16, _b16, _c;
|
|
73160
74086
|
const {
|
|
73161
74087
|
prompt: prompt4,
|
|
73162
|
-
n = 1,
|
|
74088
|
+
n: n2 = 1,
|
|
73163
74089
|
size: size11,
|
|
73164
74090
|
aspectRatio = "1:1",
|
|
73165
74091
|
seed,
|
|
@@ -73197,7 +74123,7 @@ var GoogleGenerativeAIImageModel = class {
|
|
|
73197
74123
|
});
|
|
73198
74124
|
const currentDate = (_c = (_b16 = (_a16 = this.config._internal) == null ? undefined : _a16.currentDate) == null ? undefined : _b16.call(_a16)) != null ? _c : /* @__PURE__ */ new Date;
|
|
73199
74125
|
const parameters = {
|
|
73200
|
-
sampleCount:
|
|
74126
|
+
sampleCount: n2
|
|
73201
74127
|
};
|
|
73202
74128
|
if (aspectRatio != null) {
|
|
73203
74129
|
parameters.aspectRatio = aspectRatio;
|
|
@@ -74146,7 +75072,7 @@ var GatewayImageModel = class {
|
|
|
74146
75072
|
}
|
|
74147
75073
|
async doGenerate({
|
|
74148
75074
|
prompt: prompt4,
|
|
74149
|
-
n,
|
|
75075
|
+
n: n2,
|
|
74150
75076
|
size: size11,
|
|
74151
75077
|
aspectRatio,
|
|
74152
75078
|
seed,
|
|
@@ -74168,7 +75094,7 @@ var GatewayImageModel = class {
|
|
|
74168
75094
|
headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve3(this.config.o11yHeaders)),
|
|
74169
75095
|
body: {
|
|
74170
75096
|
prompt: prompt4,
|
|
74171
|
-
n,
|
|
75097
|
+
n: n2,
|
|
74172
75098
|
...size11 && { size: size11 },
|
|
74173
75099
|
...aspectRatio && { aspectRatio },
|
|
74174
75100
|
...seed && { seed },
|
|
@@ -74268,7 +75194,7 @@ var GatewayVideoModel = class {
|
|
|
74268
75194
|
}
|
|
74269
75195
|
async doGenerate({
|
|
74270
75196
|
prompt: prompt4,
|
|
74271
|
-
n,
|
|
75197
|
+
n: n2,
|
|
74272
75198
|
aspectRatio,
|
|
74273
75199
|
resolution,
|
|
74274
75200
|
duration: duration5,
|
|
@@ -74291,7 +75217,7 @@ var GatewayVideoModel = class {
|
|
|
74291
75217
|
headers: combineHeaders(resolvedHeaders, headers != null ? headers : {}, this.getModelConfigHeaders(), await resolve3(this.config.o11yHeaders)),
|
|
74292
75218
|
body: {
|
|
74293
75219
|
prompt: prompt4,
|
|
74294
|
-
n,
|
|
75220
|
+
n: n2,
|
|
74295
75221
|
...aspectRatio && { aspectRatio },
|
|
74296
75222
|
...resolution && { resolution },
|
|
74297
75223
|
...duration5 && { duration: duration5 },
|
|
@@ -75360,8 +76286,8 @@ async function convertToLanguageModelPrompt({
|
|
|
75360
76286
|
}
|
|
75361
76287
|
case "user":
|
|
75362
76288
|
case "system":
|
|
75363
|
-
for (const
|
|
75364
|
-
toolCallIds.delete(
|
|
76289
|
+
for (const id3 of approvedToolCallIds) {
|
|
76290
|
+
toolCallIds.delete(id3);
|
|
75365
76291
|
}
|
|
75366
76292
|
if (toolCallIds.size > 0) {
|
|
75367
76293
|
throw new MissingToolResultsError({
|
|
@@ -75371,8 +76297,8 @@ async function convertToLanguageModelPrompt({
|
|
|
75371
76297
|
break;
|
|
75372
76298
|
}
|
|
75373
76299
|
}
|
|
75374
|
-
for (const
|
|
75375
|
-
toolCallIds.delete(
|
|
76300
|
+
for (const id3 of approvedToolCallIds) {
|
|
76301
|
+
toolCallIds.delete(id3);
|
|
75376
76302
|
}
|
|
75377
76303
|
if (toolCallIds.size > 0) {
|
|
75378
76304
|
throw new MissingToolResultsError({ toolCallIds: Array.from(toolCallIds) });
|
|
@@ -79398,17 +80324,17 @@ class TokenCounter extends Tag2("@grepai/core/domain/token-counter/TokenCounter"
|
|
|
79398
80324
|
}
|
|
79399
80325
|
|
|
79400
80326
|
// ../core/src/internal/services/chunker-ast/ast-parser.ts
|
|
79401
|
-
|
|
80327
|
+
var import_tree_sitter = __toESM(require_tree_sitter(), 1);
|
|
79402
80328
|
import Typescript from "tree-sitter-typescript";
|
|
79403
80329
|
class AstParser extends Service()("@grepai/core/internal/services/chunker-ast/ast-parser/AstParser", {
|
|
79404
80330
|
sync: () => {
|
|
79405
80331
|
const parse12 = fnUntraced2(function* (input) {
|
|
79406
|
-
const { content, language } = input;
|
|
80332
|
+
const { content, language: language2 } = input;
|
|
79407
80333
|
return yield* try_3({
|
|
79408
80334
|
try: () => {
|
|
79409
|
-
const parser2 = new
|
|
80335
|
+
const parser2 = new import_tree_sitter.default;
|
|
79410
80336
|
parser2.reset();
|
|
79411
|
-
parser2.setLanguage(languageMap[
|
|
80337
|
+
parser2.setLanguage(languageMap[language2]);
|
|
79412
80338
|
const tree = parser2.parse(content);
|
|
79413
80339
|
return tree;
|
|
79414
80340
|
},
|
|
@@ -79666,13 +80592,13 @@ var ChunkerAst = effect(Chunker, gen2(function* () {
|
|
|
79666
80592
|
const tokenCounter = yield* TokenCounter;
|
|
79667
80593
|
const contextHeaderBuilder = yield* ContextHeaderBuilder;
|
|
79668
80594
|
const config3 = yield* Config;
|
|
79669
|
-
const split2 = fnUntraced2(function* (node,
|
|
80595
|
+
const split2 = fnUntraced2(function* (node, language2, scopeStack) {
|
|
79670
80596
|
const {
|
|
79671
80597
|
wantedNodes,
|
|
79672
80598
|
scopeNodes,
|
|
79673
80599
|
importNodes,
|
|
79674
80600
|
extractNodeName: extractNodeName3
|
|
79675
|
-
} = languageConfig[
|
|
80601
|
+
} = languageConfig[language2];
|
|
79676
80602
|
const tokenCount = yield* tokenCounter.count(node.text);
|
|
79677
80603
|
const isWanted = wantedNodes.has(node.type);
|
|
79678
80604
|
const isScope = scopeNodes.has(node.type);
|
|
@@ -79706,13 +80632,13 @@ var ChunkerAst = effect(Chunker, gen2(function* () {
|
|
|
79706
80632
|
}
|
|
79707
80633
|
];
|
|
79708
80634
|
}
|
|
79709
|
-
return yield* forEach5(node.children, (child) => split2(child,
|
|
80635
|
+
return yield* forEach5(node.children, (child) => split2(child, language2, nextScope), {
|
|
79710
80636
|
concurrency: "unbounded"
|
|
79711
80637
|
}).pipe(map16(flatten));
|
|
79712
80638
|
});
|
|
79713
|
-
function reMerge(chunks2, content,
|
|
80639
|
+
function reMerge(chunks2, content, language2) {
|
|
79714
80640
|
const sorted = [...chunks2].sort((a, b) => a.startIndex - b.startIndex || a.endIndex - b.endIndex);
|
|
79715
|
-
const { isClosingSyntax } = languageConfig[
|
|
80641
|
+
const { isClosingSyntax } = languageConfig[language2];
|
|
79716
80642
|
const output = [];
|
|
79717
80643
|
let current;
|
|
79718
80644
|
let pendingGap;
|
|
@@ -79747,9 +80673,9 @@ var ChunkerAst = effect(Chunker, gen2(function* () {
|
|
|
79747
80673
|
return output;
|
|
79748
80674
|
}
|
|
79749
80675
|
return Chunker.of({
|
|
79750
|
-
chunk: fnUntraced2(function* ({ filePath, content, language }) {
|
|
79751
|
-
const tree = yield* astParser.parse({ content, language });
|
|
79752
|
-
return yield* split2(tree.rootNode,
|
|
80676
|
+
chunk: fnUntraced2(function* ({ filePath, content, language: language2 }) {
|
|
80677
|
+
const tree = yield* astParser.parse({ content, language: language2 });
|
|
80678
|
+
return yield* split2(tree.rootNode, language2, []).pipe(map16((splitChunks) => reMerge(splitChunks, content, language2)), map16(map4(({ startLine, endLine, startIndex, endIndex, scope: scope4 }, index) => {
|
|
79753
80679
|
const chunkContent = content.slice(startIndex, endIndex);
|
|
79754
80680
|
const contextHeader = contextHeaderBuilder.stringify({
|
|
79755
80681
|
filePath,
|
|
@@ -79858,9 +80784,9 @@ var CodebaseScannerFs = effect(CodebaseScanner, gen2(function* () {
|
|
|
79858
80784
|
})), when5("tsx", () => ({
|
|
79859
80785
|
filePath,
|
|
79860
80786
|
language: "tsx"
|
|
79861
|
-
})), option4))), flatMap10(forEach5(({ filePath, language }) => fs.readFileString(filePath).pipe(map16((content) => ({
|
|
80787
|
+
})), option4))), flatMap10(forEach5(({ filePath, language: language2 }) => fs.readFileString(filePath).pipe(map16((content) => ({
|
|
79862
80788
|
filePath,
|
|
79863
|
-
language,
|
|
80789
|
+
language: language2,
|
|
79864
80790
|
hash: string(content).toString(),
|
|
79865
80791
|
content
|
|
79866
80792
|
}))))));
|
|
@@ -80074,11 +81000,11 @@ class FileIndexer extends Service()("@grepai/core/internal/services/file-indexer
|
|
|
80074
81000
|
SqlError: (cause2) => new IndexerError({ cause: cause2 })
|
|
80075
81001
|
}));
|
|
80076
81002
|
const index = fnUntraced2(function* (input) {
|
|
80077
|
-
const { filePath, content, hash: hash3, language } = input;
|
|
81003
|
+
const { filePath, content, hash: hash3, language: language2 } = input;
|
|
80078
81004
|
const chunks2 = yield* chunker.chunk({
|
|
80079
81005
|
filePath,
|
|
80080
81006
|
content,
|
|
80081
|
-
language
|
|
81007
|
+
language: language2
|
|
80082
81008
|
});
|
|
80083
81009
|
if (!isNonEmptyReadonlyArray(chunks2)) {
|
|
80084
81010
|
return;
|
|
@@ -81427,13 +82353,13 @@ class IdAlloc {
|
|
|
81427
82353
|
this.#usedIds.add(freeId);
|
|
81428
82354
|
return freeId;
|
|
81429
82355
|
}
|
|
81430
|
-
free(
|
|
81431
|
-
if (!this.#usedIds.delete(
|
|
82356
|
+
free(id3) {
|
|
82357
|
+
if (!this.#usedIds.delete(id3)) {
|
|
81432
82358
|
throw new InternalError("Freeing an id that is not allocated");
|
|
81433
82359
|
}
|
|
81434
82360
|
this.#freeIds.delete(this.#usedIds.size);
|
|
81435
|
-
if (
|
|
81436
|
-
this.#freeIds.add(
|
|
82361
|
+
if (id3 < this.#usedIds.size) {
|
|
82362
|
+
this.#freeIds.add(id3);
|
|
81437
82363
|
}
|
|
81438
82364
|
}
|
|
81439
82365
|
}
|
|
@@ -84968,10 +85894,10 @@ var make78 = (options7) => gen2(function* () {
|
|
|
84968
85894
|
scope: scope4
|
|
84969
85895
|
}) => [scope4, conn]))),
|
|
84970
85896
|
begin: () => _void,
|
|
84971
|
-
savepoint: (conn,
|
|
85897
|
+
savepoint: (conn, id3) => conn.executeRaw(`SAVEPOINT effect_sql_${id3};`, []),
|
|
84972
85898
|
commit: (conn) => conn.commit,
|
|
84973
85899
|
rollback: (conn) => conn.rollback,
|
|
84974
|
-
rollbackSavepoint: (conn,
|
|
85900
|
+
rollbackSavepoint: (conn, id3) => conn.executeRaw(`ROLLBACK TO SAVEPOINT effect_sql_${id3};`, [])
|
|
84975
85901
|
});
|
|
84976
85902
|
const acquirer = flatMap10(serviceOption2(LibsqlTransaction), match2({
|
|
84977
85903
|
onNone: () => semaphore.withPermits(1)(succeed7(connection)),
|
|
@@ -85009,7 +85935,7 @@ var fromFileSystem = (directory5) => FileSystem.pipe(flatMap10((FS) => FS.readDi
|
|
|
85009
85935
|
message: error51.message
|
|
85010
85936
|
})), map16((files) => files.map((file8) => fromNullable(file8.match(/^(?:.*\/)?(\d+)_([^.]+)\.(js|ts)$/))).flatMap(match2({
|
|
85011
85937
|
onNone: () => [],
|
|
85012
|
-
onSome: ([basename,
|
|
85938
|
+
onSome: ([basename, id3, name21]) => [[Number(id3), name21, promise2(() => import(`${directory5}/${basename}`))]]
|
|
85013
85939
|
})).sort(([a], [b]) => a - b)));
|
|
85014
85940
|
|
|
85015
85941
|
// ../../node_modules/.bun/@effect+sql-libsql@0.39.0+d00fac6ed6378613/node_modules/@effect/sql-libsql/dist/esm/LibsqlMigrator.js
|
|
@@ -85725,8 +86651,8 @@ var L = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
|
85725
86651
|
var ct = /\p{M}+/gu;
|
|
85726
86652
|
var pt = { limit: 1 / 0, ellipsis: "" };
|
|
85727
86653
|
var X = (t, e = {}, s = {}) => {
|
|
85728
|
-
const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "",
|
|
85729
|
-
let h = 0, o = 0, f = t.length, v = 0, F = false, d = f, b = Math.max(0, i -
|
|
86654
|
+
const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n2 = 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;
|
|
86655
|
+
let h = 0, o = 0, f = t.length, v = 0, F = false, d = f, b = Math.max(0, i - n2), C = 0, B = 0, c = 0, p3 = 0;
|
|
85730
86656
|
t:
|
|
85731
86657
|
for (;; ) {
|
|
85732
86658
|
if (B > C || o >= f && o > h) {
|
|
@@ -85786,7 +86712,7 @@ var X = (t, e = {}, s = {}) => {
|
|
|
85786
86712
|
}
|
|
85787
86713
|
o += 1;
|
|
85788
86714
|
}
|
|
85789
|
-
return { width: F ? b : c, index: F ? d : f, truncated: F, ellipsed: F && i >=
|
|
86715
|
+
return { width: F ? b : c, index: F ? d : f, truncated: F, ellipsed: F && i >= n2 };
|
|
85790
86716
|
};
|
|
85791
86717
|
var ft = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
|
|
85792
86718
|
var S = (t, e = {}) => X(t, ft, e).width;
|
|
@@ -85824,10 +86750,10 @@ var it = (t) => `${W}${U}${t}${j}`;
|
|
|
85824
86750
|
var gt = (t) => t.map((e) => S(e));
|
|
85825
86751
|
var G = (t, e, s) => {
|
|
85826
86752
|
const i = e[Symbol.iterator]();
|
|
85827
|
-
let r = false,
|
|
86753
|
+
let r = false, n2 = false, u = t.at(-1), a = u === undefined ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
|
|
85828
86754
|
for (;!l.done; ) {
|
|
85829
86755
|
const m = l.value, A = S(m);
|
|
85830
|
-
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === W || m === Z) && (r = true,
|
|
86756
|
+
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === W || m === Z) && (r = true, n2 = e.startsWith(U, g + 1)), r ? n2 ? m === j && (r = false, n2 = false) : m === tt && (r = false) : (a += A, a === s && !E.done && (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
|
|
85831
86757
|
}
|
|
85832
86758
|
u = t.at(-1), !a && u !== undefined && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
85833
86759
|
};
|
|
@@ -85841,7 +86767,7 @@ var vt = (t) => {
|
|
|
85841
86767
|
var Et = (t, e, s = {}) => {
|
|
85842
86768
|
if (s.trim !== false && t.trim() === "")
|
|
85843
86769
|
return "";
|
|
85844
|
-
let i = "", r,
|
|
86770
|
+
let i = "", r, n2;
|
|
85845
86771
|
const u = t.split(" "), a = gt(u);
|
|
85846
86772
|
let l = [""];
|
|
85847
86773
|
for (const [h, o] of u.entries()) {
|
|
@@ -85878,12 +86804,12 @@ var Et = (t, e, s = {}) => {
|
|
|
85878
86804
|
const d = Number.parseFloat(F.code);
|
|
85879
86805
|
r = d === Ft ? undefined : d;
|
|
85880
86806
|
} else
|
|
85881
|
-
F?.uri !== undefined && (
|
|
86807
|
+
F?.uri !== undefined && (n2 = F.uri.length === 0 ? undefined : F.uri);
|
|
85882
86808
|
}
|
|
85883
86809
|
const f = r ? mt(r) : undefined;
|
|
85884
86810
|
o === `
|
|
85885
|
-
` ? (
|
|
85886
|
-
` && (r && f && (i += st(r)),
|
|
86811
|
+
` ? (n2 && (i += it("")), r && f && (i += st(f))) : h === `
|
|
86812
|
+
` && (r && f && (i += st(r)), n2 && (i += it(n2))), V += h.length, m = A, A = g.next();
|
|
85887
86813
|
}
|
|
85888
86814
|
return i;
|
|
85889
86815
|
};
|
|
@@ -85925,10 +86851,10 @@ function _t(t, e) {
|
|
|
85925
86851
|
return;
|
|
85926
86852
|
const s = t.split(`
|
|
85927
86853
|
`), i = e.split(`
|
|
85928
|
-
`), r = Math.max(s.length, i.length),
|
|
86854
|
+
`), r = Math.max(s.length, i.length), n2 = [];
|
|
85929
86855
|
for (let u = 0;u < r; u++)
|
|
85930
|
-
s[u] !== i[u] &&
|
|
85931
|
-
return { lines:
|
|
86856
|
+
s[u] !== i[u] && n2.push(u);
|
|
86857
|
+
return { lines: n2, numLinesBefore: s.length, numLinesAfter: i.length, numLines: r };
|
|
85932
86858
|
}
|
|
85933
86859
|
var bt = globalThis.process.platform.startsWith("win");
|
|
85934
86860
|
var z2 = Symbol("clack:cancel");
|
|
@@ -85942,7 +86868,7 @@ function T(t, e) {
|
|
|
85942
86868
|
function xt({ input: t = q, output: e = R, overwrite: s = true, hideCursor: i = true } = {}) {
|
|
85943
86869
|
const r = k.createInterface({ input: t, output: e, prompt: "", tabSize: 1 });
|
|
85944
86870
|
k.emitKeypressEvents(t, r), t instanceof J && t.isTTY && t.setRawMode(true);
|
|
85945
|
-
const
|
|
86871
|
+
const n2 = (u, { name: a, sequence: l }) => {
|
|
85946
86872
|
const E = String(u);
|
|
85947
86873
|
if (H([E, a, l], "cancel")) {
|
|
85948
86874
|
i && e.write(import_sisteransi.cursor.show), process.exit(0);
|
|
@@ -85953,12 +86879,12 @@ function xt({ input: t = q, output: e = R, overwrite: s = true, hideCursor: i =
|
|
|
85953
86879
|
const g = a === "return" ? 0 : -1, m = a === "return" ? -1 : 0;
|
|
85954
86880
|
k.moveCursor(e, g, m, () => {
|
|
85955
86881
|
k.clearLine(e, 1, () => {
|
|
85956
|
-
t.once("keypress",
|
|
86882
|
+
t.once("keypress", n2);
|
|
85957
86883
|
});
|
|
85958
86884
|
});
|
|
85959
86885
|
};
|
|
85960
|
-
return i && e.write(import_sisteransi.cursor.hide), t.once("keypress",
|
|
85961
|
-
t.off("keypress",
|
|
86886
|
+
return i && e.write(import_sisteransi.cursor.hide), t.once("keypress", n2), () => {
|
|
86887
|
+
t.off("keypress", n2), i && e.write(import_sisteransi.cursor.show), t instanceof J && t.isTTY && !bt && t.setRawMode(false), r.terminal = false, r.close();
|
|
85962
86888
|
};
|
|
85963
86889
|
}
|
|
85964
86890
|
var rt = (t) => ("columns" in t) && typeof t.columns == "number" ? t.columns : 80;
|
|
@@ -85966,7 +86892,7 @@ var nt = (t) => ("rows" in t) && typeof t.rows == "number" ? t.rows : 20;
|
|
|
85966
86892
|
function Bt(t, e, s, i = s) {
|
|
85967
86893
|
const r = rt(t ?? R);
|
|
85968
86894
|
return K(e, r - s.length, { hard: true, trim: false }).split(`
|
|
85969
|
-
`).map((
|
|
86895
|
+
`).map((n2, u) => `${u === 0 ? i : s}${n2}`).join(`
|
|
85970
86896
|
`);
|
|
85971
86897
|
}
|
|
85972
86898
|
|
|
@@ -85986,8 +86912,8 @@ class x {
|
|
|
85986
86912
|
value;
|
|
85987
86913
|
userInput = "";
|
|
85988
86914
|
constructor(e, s = true) {
|
|
85989
|
-
const { input: i = q, output: r = R, render:
|
|
85990
|
-
this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render =
|
|
86915
|
+
const { input: i = q, output: r = R, render: n2, signal: u, ...a } = e;
|
|
86916
|
+
this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n2.bind(this), this._track = s, this._abortSignal = u, this.input = i, this.output = r;
|
|
85991
86917
|
}
|
|
85992
86918
|
unsubscribe() {
|
|
85993
86919
|
this._subscribers.clear();
|
|
@@ -86004,10 +86930,10 @@ class x {
|
|
|
86004
86930
|
}
|
|
86005
86931
|
emit(e, ...s) {
|
|
86006
86932
|
const i = this._subscribers.get(e) ?? [], r = [];
|
|
86007
|
-
for (const
|
|
86008
|
-
|
|
86009
|
-
for (const
|
|
86010
|
-
|
|
86933
|
+
for (const n2 of i)
|
|
86934
|
+
n2.cb(...s), n2.once && r.push(() => i.splice(i.indexOf(n2), 1));
|
|
86935
|
+
for (const n2 of r)
|
|
86936
|
+
n2();
|
|
86011
86937
|
}
|
|
86012
86938
|
prompt() {
|
|
86013
86939
|
return new Promise((e) => {
|
|
@@ -86064,23 +86990,23 @@ class x {
|
|
|
86064
86990
|
else {
|
|
86065
86991
|
const s = _t(this._prevFrame, e), i = nt(this.output);
|
|
86066
86992
|
if (this.restoreCursor(), s) {
|
|
86067
|
-
const r = Math.max(0, s.numLinesAfter - i),
|
|
86993
|
+
const r = Math.max(0, s.numLinesAfter - i), n2 = Math.max(0, s.numLinesBefore - i);
|
|
86068
86994
|
let u = s.lines.find((a) => a >= r);
|
|
86069
86995
|
if (u === undefined) {
|
|
86070
86996
|
this._prevFrame = e;
|
|
86071
86997
|
return;
|
|
86072
86998
|
}
|
|
86073
86999
|
if (s.lines.length === 1) {
|
|
86074
|
-
this.output.write(import_sisteransi.cursor.move(0, u -
|
|
87000
|
+
this.output.write(import_sisteransi.cursor.move(0, u - n2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
86075
87001
|
const a = e.split(`
|
|
86076
87002
|
`);
|
|
86077
87003
|
this.output.write(a[u]), this._prevFrame = e, this.output.write(import_sisteransi.cursor.move(0, a.length - u - 1));
|
|
86078
87004
|
return;
|
|
86079
87005
|
} else if (s.lines.length > 1) {
|
|
86080
|
-
if (r <
|
|
87006
|
+
if (r < n2)
|
|
86081
87007
|
u = r;
|
|
86082
87008
|
else {
|
|
86083
|
-
const l = u -
|
|
87009
|
+
const l = u - n2;
|
|
86084
87010
|
l > 0 && this.output.write(import_sisteransi.cursor.move(0, l));
|
|
86085
87011
|
}
|
|
86086
87012
|
this.output.write(import_sisteransi.erase.down());
|
|
@@ -86142,17 +87068,17 @@ class Vt extends x {
|
|
|
86142
87068
|
let i;
|
|
86143
87069
|
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)
|
|
86144
87070
|
for (const r of i) {
|
|
86145
|
-
const
|
|
86146
|
-
|
|
87071
|
+
const n2 = s.findIndex((u) => u.value === r);
|
|
87072
|
+
n2 !== -1 && (this.toggleSelected(r), this.#t = n2);
|
|
86147
87073
|
}
|
|
86148
|
-
this.focusedValue = this.options[this.#t]?.value, this.on("key", (r,
|
|
87074
|
+
this.focusedValue = this.options[this.#t]?.value, this.on("key", (r, n2) => this.#r(r, n2)), this.on("userInput", (r) => this.#n(r));
|
|
86149
87075
|
}
|
|
86150
87076
|
_isActionKey(e, s) {
|
|
86151
87077
|
return e === "\t" || this.multiple && this.isNavigating && s.name === "space" && e !== undefined && e !== "";
|
|
86152
87078
|
}
|
|
86153
87079
|
#r(e, s) {
|
|
86154
|
-
const i = s.name === "up", r = s.name === "down",
|
|
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) :
|
|
87080
|
+
const i = s.name === "up", r = s.name === "down", n2 = s.name === "return";
|
|
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) : n2 ? 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);
|
|
86156
87082
|
}
|
|
86157
87083
|
deselectAll() {
|
|
86158
87084
|
this.selectedValues = [];
|
|
@@ -86202,7 +87128,7 @@ class yt extends x {
|
|
|
86202
87128
|
const e = this.options[this.cursor];
|
|
86203
87129
|
if (this.value === undefined && (this.value = []), e.group === true) {
|
|
86204
87130
|
const s = e.value, i = this.getGroupItems(s);
|
|
86205
|
-
this.isGroupSelected(s) ? this.value = this.value.filter((r) => i.findIndex((
|
|
87131
|
+
this.isGroupSelected(s) ? this.value = this.value.filter((r) => i.findIndex((n2) => n2.value === r) === -1) : this.value = [...this.value, ...i.map((r) => r.value)], this.value = Array.from(new Set(this.value));
|
|
86206
87132
|
} else {
|
|
86207
87133
|
const s = this.value.includes(e.value);
|
|
86208
87134
|
this.value = s ? this.value.filter((i) => i !== e.value) : [...this.value, e.value];
|
|
@@ -86211,7 +87137,7 @@ class yt extends x {
|
|
|
86211
87137
|
constructor(e) {
|
|
86212
87138
|
super(e, false);
|
|
86213
87139
|
const { options: s } = e;
|
|
86214
|
-
this.#t = e.selectableGroups !== false, this.options = Object.entries(s).flatMap(([i, r]) => [{ value: i, group: true, label: i }, ...r.map((
|
|
87140
|
+
this.#t = e.selectableGroups !== false, this.options = Object.entries(s).flatMap(([i, r]) => [{ value: i, group: true, label: i }, ...r.map((n2) => ({ ...n2, 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) => {
|
|
86215
87141
|
switch (i) {
|
|
86216
87142
|
case "left":
|
|
86217
87143
|
case "up": {
|
|
@@ -86235,8 +87161,8 @@ class yt extends x {
|
|
|
86235
87161
|
}
|
|
86236
87162
|
}
|
|
86237
87163
|
function D(t, e, s) {
|
|
86238
|
-
const i = t + e, r = Math.max(s.length - 1, 0),
|
|
86239
|
-
return s[
|
|
87164
|
+
const i = t + e, r = Math.max(s.length - 1, 0), n2 = i < 0 ? r : i > r ? 0 : i;
|
|
87165
|
+
return s[n2].disabled ? D(n2, e < 0 ? -1 : 1, s) : n2;
|
|
86240
87166
|
}
|
|
86241
87167
|
|
|
86242
87168
|
class Mt extends x {
|
|
@@ -86347,10 +87273,10 @@ class Tt extends x {
|
|
|
86347
87273
|
constructor(e) {
|
|
86348
87274
|
super(e, false), this.options = e.options;
|
|
86349
87275
|
const s = e.caseSensitive === true, i = this.options.map(({ value: [r] }) => s ? r : r?.toLowerCase());
|
|
86350
|
-
this.cursor = Math.max(i.indexOf(e.initialValue), 0), this.on("key", (r,
|
|
87276
|
+
this.cursor = Math.max(i.indexOf(e.initialValue), 0), this.on("key", (r, n2) => {
|
|
86351
87277
|
if (!r)
|
|
86352
87278
|
return;
|
|
86353
|
-
const u = s &&
|
|
87279
|
+
const u = s && n2.shift ? r.toUpperCase() : r;
|
|
86354
87280
|
if (!i.includes(u))
|
|
86355
87281
|
return;
|
|
86356
87282
|
const a = this.options.find(({ value: [l] }) => s ? l === u : l?.toLowerCase() === r);
|
|
@@ -86457,7 +87383,7 @@ var ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
|
86457
87383
|
var ft2 = /\p{M}+/gu;
|
|
86458
87384
|
var Ft2 = { limit: 1 / 0, ellipsis: "" };
|
|
86459
87385
|
var Le = (e, r = {}, s = {}) => {
|
|
86460
|
-
const i = r.limit ?? 1 / 0,
|
|
87386
|
+
const i = r.limit ?? 1 / 0, n2 = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (n2 ? Le(n2, 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;
|
|
86461
87387
|
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;
|
|
86462
87388
|
e:
|
|
86463
87389
|
for (;; ) {
|
|
@@ -86556,10 +87482,10 @@ var Ue = (e) => `${ae}${we}${e}${Ce}`;
|
|
|
86556
87482
|
var Ct2 = (e) => e.map((r) => M2(r));
|
|
86557
87483
|
var Se = (e, r, s) => {
|
|
86558
87484
|
const i = r[Symbol.iterator]();
|
|
86559
|
-
let
|
|
87485
|
+
let n2 = false, o = false, u = e.at(-1), l = u === undefined ? 0 : M2(u), a = i.next(), d = i.next(), g = 0;
|
|
86560
87486
|
for (;!a.done; ) {
|
|
86561
87487
|
const E = a.value, p3 = M2(E);
|
|
86562
|
-
l + p3 <= s ? e[e.length - 1] += E : (e.push(E), l = 0), (E === ae || E === je) && (
|
|
87488
|
+
l + p3 <= s ? e[e.length - 1] += E : (e.push(E), l = 0), (E === ae || E === je) && (n2 = true, o = r.startsWith(we, g + 1)), n2 ? o ? E === Ce && (n2 = false, o = false) : E === ke && (n2 = false) : (l += p3, l === s && !d.done && (e.push(""), l = 0)), a = d, d = i.next(), g += E.length;
|
|
86563
87489
|
}
|
|
86564
87490
|
u = e.at(-1), !l && u !== undefined && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
86565
87491
|
};
|
|
@@ -86573,7 +87499,7 @@ var wt2 = (e) => {
|
|
|
86573
87499
|
var St2 = (e, r, s = {}) => {
|
|
86574
87500
|
if (s.trim !== false && e.trim() === "")
|
|
86575
87501
|
return "";
|
|
86576
|
-
let i = "",
|
|
87502
|
+
let i = "", n2, o;
|
|
86577
87503
|
const u = e.split(" "), l = Ct2(u);
|
|
86578
87504
|
let a = [""];
|
|
86579
87505
|
for (const [$, c] of u.entries()) {
|
|
@@ -86608,14 +87534,14 @@ var St2 = (e, r, s = {}) => {
|
|
|
86608
87534
|
const F = Ge.exec(d)?.groups;
|
|
86609
87535
|
if (F?.code !== undefined) {
|
|
86610
87536
|
const v = Number.parseFloat(F.code);
|
|
86611
|
-
|
|
87537
|
+
n2 = v === Et2 ? undefined : v;
|
|
86612
87538
|
} else
|
|
86613
87539
|
F?.uri !== undefined && (o = F.uri.length === 0 ? undefined : F.uri);
|
|
86614
87540
|
}
|
|
86615
|
-
const m =
|
|
87541
|
+
const m = n2 ? At2(n2) : undefined;
|
|
86616
87542
|
c === `
|
|
86617
|
-
` ? (o && (i += Ue("")),
|
|
86618
|
-
` && (
|
|
87543
|
+
` ? (o && (i += Ue("")), n2 && m && (i += He(m))) : $ === `
|
|
87544
|
+
` && (n2 && m && (i += He(n2)), o && (i += Ue(o))), y2 += $.length, E = p3, p3 = g.next();
|
|
86619
87545
|
}
|
|
86620
87546
|
return i;
|
|
86621
87547
|
};
|
|
@@ -86626,17 +87552,17 @@ function q2(e, r, s) {
|
|
|
86626
87552
|
`).map((i) => St2(i, r, s)).join(`
|
|
86627
87553
|
`);
|
|
86628
87554
|
}
|
|
86629
|
-
var It2 = (e, r, s, i,
|
|
87555
|
+
var It2 = (e, r, s, i, n2) => {
|
|
86630
87556
|
let o = r, u = 0;
|
|
86631
87557
|
for (let l = s;l < i; l++) {
|
|
86632
87558
|
const a = e[l];
|
|
86633
|
-
if (o = o - a.length, u++, o <=
|
|
87559
|
+
if (o = o - a.length, u++, o <= n2)
|
|
86634
87560
|
break;
|
|
86635
87561
|
}
|
|
86636
87562
|
return { lineCount: o, removals: u };
|
|
86637
87563
|
};
|
|
86638
87564
|
var J2 = (e) => {
|
|
86639
|
-
const { cursor: r, options: s, style: i } = e,
|
|
87565
|
+
const { cursor: r, options: s, style: i } = e, n2 = e.output ?? process.stdout, o = rt(n2), u = e.columnPadding ?? 0, l = e.rowPadding ?? 4, a = o - u, d = nt(n2), 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);
|
|
86640
87566
|
let $ = 0;
|
|
86641
87567
|
r >= y2 - 3 && ($ = Math.max(Math.min(r - y2 + 3, s.length - y2), 0));
|
|
86642
87568
|
let c = y2 < s.length && $ > 0, m = y2 < s.length && $ + y2 < s.length;
|
|
@@ -86667,8 +87593,8 @@ function Ke(e) {
|
|
|
86667
87593
|
function qe(e, r) {
|
|
86668
87594
|
if (!e)
|
|
86669
87595
|
return true;
|
|
86670
|
-
const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(),
|
|
86671
|
-
return s.includes(o) || i.includes(o) ||
|
|
87596
|
+
const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(), n2 = String(r.value).toLowerCase(), o = e.toLowerCase();
|
|
87597
|
+
return s.includes(o) || i.includes(o) || n2.includes(o);
|
|
86672
87598
|
}
|
|
86673
87599
|
function Bt2(e, r) {
|
|
86674
87600
|
const s = [];
|
|
@@ -86677,7 +87603,7 @@ function Bt2(e, r) {
|
|
|
86677
87603
|
return s;
|
|
86678
87604
|
}
|
|
86679
87605
|
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() {
|
|
86680
|
-
const r = [`${import_picocolors2.default.gray(h)}`, `${N2(this.state)} ${e.message}`], s = this.userInput, i = this.options,
|
|
87606
|
+
const r = [`${import_picocolors2.default.gray(h)}`, `${N2(this.state)} ${e.message}`], s = this.userInput, i = this.options, n2 = e.placeholder, o = s === "" && n2 !== undefined;
|
|
86681
87607
|
switch (this.state) {
|
|
86682
87608
|
case "submit": {
|
|
86683
87609
|
const u = Bt2(this.selectedValues, i), l = u.length > 0 ? ` ${import_picocolors2.default.dim(u.map(Ke).join(", "))}` : "";
|
|
@@ -86695,7 +87621,7 @@ ${import_picocolors2.default.gray(h)}${u}`;
|
|
|
86695
87621
|
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);
|
|
86696
87622
|
let a = "";
|
|
86697
87623
|
if (this.isNavigating || o) {
|
|
86698
|
-
const c = o ?
|
|
87624
|
+
const c = o ? n2 : s;
|
|
86699
87625
|
a = c !== "" ? ` ${import_picocolors2.default.dim(c)}` : "";
|
|
86700
87626
|
} else
|
|
86701
87627
|
a = ` ${this.userInputWithCursor}`;
|
|
@@ -86711,23 +87637,23 @@ ${import_picocolors2.default.gray(h)}${u}`;
|
|
|
86711
87637
|
}
|
|
86712
87638
|
} }).prompt();
|
|
86713
87639
|
var bt2 = (e) => {
|
|
86714
|
-
const r = (i,
|
|
87640
|
+
const r = (i, n2, o, u) => {
|
|
86715
87641
|
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);
|
|
86716
|
-
return
|
|
86717
|
-
}, s = new Vt({ options: e.options, multiple: true, filter: e.filter ?? ((i,
|
|
87642
|
+
return n2 ? `${g} ${a}${d}` : `${g} ${import_picocolors2.default.dim(a)}`;
|
|
87643
|
+
}, s = new Vt({ options: e.options, multiple: true, filter: e.filter ?? ((i, n2) => qe(i, n2)), validate: () => {
|
|
86718
87644
|
if (e.required && s.selectedValues.length === 0)
|
|
86719
87645
|
return "Please select at least one item";
|
|
86720
87646
|
}, initialValue: e.initialValues, signal: e.signal, input: e.input, output: e.output, render() {
|
|
86721
87647
|
const i = `${import_picocolors2.default.gray(h)}
|
|
86722
87648
|
${N2(this.state)} ${e.message}
|
|
86723
|
-
`,
|
|
87649
|
+
`, n2 = this.userInput, o = e.placeholder, u = n2 === "" && o !== undefined, l = this.isNavigating || u ? import_picocolors2.default.dim(u ? o : n2) : this.userInputWithCursor, a = this.options, d = this.filteredOptions.length !== a.length ? import_picocolors2.default.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "";
|
|
86724
87650
|
switch (this.state) {
|
|
86725
87651
|
case "submit":
|
|
86726
87652
|
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.dim(`${this.selectedValues.length} items selected`)}`;
|
|
86727
87653
|
case "cancel":
|
|
86728
|
-
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(
|
|
87654
|
+
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n2))}`;
|
|
86729
87655
|
default: {
|
|
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 &&
|
|
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 && n2 ? [`${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(`
|
|
86731
87657
|
`), `${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 });
|
|
86732
87658
|
return [...$, ...m.map((f) => `${g(h)} ${f}`), ...c].join(`
|
|
86733
87659
|
`);
|
|
@@ -86739,13 +87665,13 @@ ${N2(this.state)} ${e.message}
|
|
|
86739
87665
|
var xt2 = [We, he, pe, me];
|
|
86740
87666
|
var _t2 = [$e, Re, x2, Oe];
|
|
86741
87667
|
function Xe(e, r, s, i) {
|
|
86742
|
-
let
|
|
86743
|
-
return i === "center" ?
|
|
87668
|
+
let n2 = s, o = s;
|
|
87669
|
+
return i === "center" ? n2 = Math.floor((r - e) / 2) : i === "right" && (n2 = r - e - s), o = r - n2 - e, [n2, o];
|
|
86744
87670
|
}
|
|
86745
87671
|
var Dt2 = (e) => e;
|
|
86746
87672
|
var Tt2 = (e = "", r = "", s) => {
|
|
86747
|
-
const i = s?.output ?? process.stdout,
|
|
86748
|
-
let f = Math.floor(
|
|
87673
|
+
const i = s?.output ?? process.stdout, n2 = 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 = n2 - $;
|
|
87674
|
+
let f = Math.floor(n2 * a) - $;
|
|
86749
87675
|
if (s?.width === "auto") {
|
|
86750
87676
|
const _2 = e.split(`
|
|
86751
87677
|
`);
|
|
@@ -86776,12 +87702,12 @@ var Mt2 = (e) => {
|
|
|
86776
87702
|
return new kt({ active: r, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
|
|
86777
87703
|
const i = `${import_picocolors2.default.gray(h)}
|
|
86778
87704
|
${N2(this.state)} ${e.message}
|
|
86779
|
-
`,
|
|
87705
|
+
`, n2 = this.value ? r : s;
|
|
86780
87706
|
switch (this.state) {
|
|
86781
87707
|
case "submit":
|
|
86782
|
-
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.dim(
|
|
87708
|
+
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.dim(n2)}`;
|
|
86783
87709
|
case "cancel":
|
|
86784
|
-
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(
|
|
87710
|
+
return `${i}${import_picocolors2.default.gray(h)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n2))}
|
|
86785
87711
|
${import_picocolors2.default.gray(h)}`;
|
|
86786
87712
|
default:
|
|
86787
87713
|
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}`}
|
|
@@ -86792,15 +87718,15 @@ ${import_picocolors2.default.cyan(x2)}
|
|
|
86792
87718
|
};
|
|
86793
87719
|
var Rt = async (e, r) => {
|
|
86794
87720
|
const s = {}, i = Object.keys(e);
|
|
86795
|
-
for (const
|
|
86796
|
-
const o = e[
|
|
87721
|
+
for (const n2 of i) {
|
|
87722
|
+
const o = e[n2], u = await o({ results: s })?.catch((l) => {
|
|
86797
87723
|
throw l;
|
|
86798
87724
|
});
|
|
86799
87725
|
if (typeof r?.onCancel == "function" && Ct(u)) {
|
|
86800
|
-
s[
|
|
87726
|
+
s[n2] = "canceled", r.onCancel({ results: s });
|
|
86801
87727
|
continue;
|
|
86802
87728
|
}
|
|
86803
|
-
s[
|
|
87729
|
+
s[n2] = u;
|
|
86804
87730
|
}
|
|
86805
87731
|
return s;
|
|
86806
87732
|
};
|
|
@@ -86831,9 +87757,9 @@ ${import_picocolors2.default.cyan(h)}`;
|
|
|
86831
87757
|
return `${import_picocolors2.default.dim(a)}`;
|
|
86832
87758
|
const $ = d || r ? import_picocolors2.default.dim(z3) : "";
|
|
86833
87759
|
return `${y2}${import_picocolors2.default.dim(p3)}${$} ${import_picocolors2.default.dim(a)}`;
|
|
86834
|
-
},
|
|
86835
|
-
return new yt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required:
|
|
86836
|
-
if (
|
|
87760
|
+
}, n2 = e.required ?? true;
|
|
87761
|
+
return new yt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValues: e.initialValues, required: n2, cursorAt: e.cursorAt, selectableGroups: r, validate(o) {
|
|
87762
|
+
if (n2 && (o === undefined || o.length === 0))
|
|
86837
87763
|
return `Please select at least one option.
|
|
86838
87764
|
${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`))}`;
|
|
86839
87765
|
}, render() {
|
|
@@ -86878,9 +87804,9 @@ ${import_picocolors2.default.cyan(x2)}
|
|
|
86878
87804
|
}
|
|
86879
87805
|
} }).prompt();
|
|
86880
87806
|
};
|
|
86881
|
-
var R2 = { message: (e = [], { symbol: r = import_picocolors2.default.gray(h), secondarySymbol: s = import_picocolors2.default.gray(h), output: i = process.stdout, spacing:
|
|
87807
|
+
var R2 = { message: (e = [], { symbol: r = import_picocolors2.default.gray(h), secondarySymbol: s = import_picocolors2.default.gray(h), output: i = process.stdout, spacing: n2 = 1, withGuide: o } = {}) => {
|
|
86882
87808
|
const u = [], l = (o ?? _.withGuide) !== false, a = l ? s : "", d = l ? `${r} ` : "", g = l ? `${s} ` : "";
|
|
86883
|
-
for (let p3 = 0;p3 <
|
|
87809
|
+
for (let p3 = 0;p3 < n2; p3++)
|
|
86884
87810
|
u.push(a);
|
|
86885
87811
|
const E = Array.isArray(e) ? e : e.split(`
|
|
86886
87812
|
`);
|
|
@@ -86925,16 +87851,16 @@ var Q2 = (e, r) => e.split(`
|
|
|
86925
87851
|
`).map((s) => r(s)).join(`
|
|
86926
87852
|
`);
|
|
86927
87853
|
var Lt2 = (e) => {
|
|
86928
|
-
const r = (i,
|
|
87854
|
+
const r = (i, n2) => {
|
|
86929
87855
|
const o = i.label ?? String(i.value);
|
|
86930
|
-
return
|
|
87856
|
+
return n2 === "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"})`)}` : ""}` : n2 === "active" ? `${import_picocolors2.default.cyan(te)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n2 === "selected" ? `${import_picocolors2.default.green(G2)} ${Q2(o, import_picocolors2.default.dim)}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n2 === "cancelled" ? `${Q2(o, (u) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(u)))}` : n2 === "active-selected" ? `${import_picocolors2.default.green(G2)} ${o}${i.hint ? ` ${import_picocolors2.default.dim(`(${i.hint})`)}` : ""}` : n2 === "submitted" ? `${Q2(o, import_picocolors2.default.dim)}` : `${import_picocolors2.default.dim(z3)} ${Q2(o, import_picocolors2.default.dim)}`;
|
|
86931
87857
|
}, s = e.required ?? true;
|
|
86932
87858
|
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) {
|
|
86933
87859
|
if (s && (i === undefined || i.length === 0))
|
|
86934
87860
|
return `Please select at least one option.
|
|
86935
87861
|
${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`))}`;
|
|
86936
87862
|
}, render() {
|
|
86937
|
-
const i = Bt(e.output, e.message, `${Ee(this.state)} `, `${N2(this.state)} `),
|
|
87863
|
+
const i = Bt(e.output, e.message, `${Ee(this.state)} `, `${N2(this.state)} `), n2 = `${import_picocolors2.default.gray(h)}
|
|
86938
87864
|
${i}
|
|
86939
87865
|
`, o = this.value ?? [], u = (l, a) => {
|
|
86940
87866
|
if (l.disabled)
|
|
@@ -86945,31 +87871,31 @@ ${i}
|
|
|
86945
87871
|
switch (this.state) {
|
|
86946
87872
|
case "submit": {
|
|
86947
87873
|
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)} `);
|
|
86948
|
-
return `${
|
|
87874
|
+
return `${n2}${a}`;
|
|
86949
87875
|
}
|
|
86950
87876
|
case "cancel": {
|
|
86951
87877
|
const l = this.options.filter(({ value: d }) => o.includes(d)).map((d) => r(d, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
86952
87878
|
if (l.trim() === "")
|
|
86953
|
-
return `${
|
|
87879
|
+
return `${n2}${import_picocolors2.default.gray(h)}`;
|
|
86954
87880
|
const a = Bt(e.output, l, `${import_picocolors2.default.gray(h)} `);
|
|
86955
|
-
return `${
|
|
87881
|
+
return `${n2}${a}
|
|
86956
87882
|
${import_picocolors2.default.gray(h)}`;
|
|
86957
87883
|
}
|
|
86958
87884
|
case "error": {
|
|
86959
87885
|
const l = `${import_picocolors2.default.yellow(h)} `, a = this.error.split(`
|
|
86960
87886
|
`).map((E, p3) => p3 === 0 ? `${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow(E)}` : ` ${E}`).join(`
|
|
86961
|
-
`), d =
|
|
87887
|
+
`), d = n2.split(`
|
|
86962
87888
|
`).length, g = a.split(`
|
|
86963
87889
|
`).length + 1;
|
|
86964
|
-
return `${
|
|
87890
|
+
return `${n2}${l}${J2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, rowPadding: d + g, style: u }).join(`
|
|
86965
87891
|
${l}`)}
|
|
86966
87892
|
${a}
|
|
86967
87893
|
`;
|
|
86968
87894
|
}
|
|
86969
87895
|
default: {
|
|
86970
|
-
const l = `${import_picocolors2.default.cyan(h)} `, a =
|
|
87896
|
+
const l = `${import_picocolors2.default.cyan(h)} `, a = n2.split(`
|
|
86971
87897
|
`).length;
|
|
86972
|
-
return `${
|
|
87898
|
+
return `${n2}${l}${J2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: l.length, rowPadding: a + 2, style: u }).join(`
|
|
86973
87899
|
${l}`)}
|
|
86974
87900
|
${import_picocolors2.default.cyan(x2)}
|
|
86975
87901
|
`;
|
|
@@ -86979,18 +87905,18 @@ ${import_picocolors2.default.cyan(x2)}
|
|
|
86979
87905
|
};
|
|
86980
87906
|
var jt = (e) => import_picocolors2.default.dim(e);
|
|
86981
87907
|
var Vt2 = (e, r, s) => {
|
|
86982
|
-
const i = { hard: true, trim: false },
|
|
86983
|
-
`), o =
|
|
87908
|
+
const i = { hard: true, trim: false }, n2 = q2(e, r, i).split(`
|
|
87909
|
+
`), o = n2.reduce((a, d) => Math.max(M2(d), a), 0), u = n2.map(s).reduce((a, d) => Math.max(M2(d), a), 0), l = r - (u - o);
|
|
86984
87910
|
return q2(e, l, i);
|
|
86985
87911
|
};
|
|
86986
87912
|
var kt2 = (e = "", r = "", s) => {
|
|
86987
|
-
const i = s?.output ?? P2.stdout,
|
|
87913
|
+
const i = s?.output ?? P2.stdout, n2 = (s?.withGuide ?? _.withGuide) !== false, o = s?.format ?? jt, u = ["", ...Vt2(e, rt(i) - 6, o).split(`
|
|
86988
87914
|
`).map(o), ""], l = M2(r), a = Math.max(u.reduce((p3, y2) => {
|
|
86989
87915
|
const $ = M2(y2);
|
|
86990
87916
|
return $ > p3 ? $ : p3;
|
|
86991
87917
|
}, 0), l) + 2, d = u.map((p3) => `${import_picocolors2.default.gray(h)} ${p3}${" ".repeat(a - M2(p3))}${import_picocolors2.default.gray(h)}`).join(`
|
|
86992
|
-
`), g =
|
|
86993
|
-
` : "", E =
|
|
87918
|
+
`), g = n2 ? `${import_picocolors2.default.gray(h)}
|
|
87919
|
+
` : "", E = n2 ? Ne : pe;
|
|
86994
87920
|
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)}
|
|
86995
87921
|
${d}
|
|
86996
87922
|
${import_picocolors2.default.gray(E + se.repeat(a + 2) + me)}
|
|
@@ -87002,19 +87928,19 @@ ${N2(this.state)} ${e.message}
|
|
|
87002
87928
|
`, s = this.userInputWithCursor, i = this.masked;
|
|
87003
87929
|
switch (this.state) {
|
|
87004
87930
|
case "error": {
|
|
87005
|
-
const
|
|
87931
|
+
const n2 = i ? ` ${i}` : "";
|
|
87006
87932
|
return e.clearOnError && this.clear(), `${r.trim()}
|
|
87007
|
-
${import_picocolors2.default.yellow(h)}${
|
|
87933
|
+
${import_picocolors2.default.yellow(h)}${n2}
|
|
87008
87934
|
${import_picocolors2.default.yellow(x2)} ${import_picocolors2.default.yellow(this.error)}
|
|
87009
87935
|
`;
|
|
87010
87936
|
}
|
|
87011
87937
|
case "submit": {
|
|
87012
|
-
const
|
|
87013
|
-
return `${r}${import_picocolors2.default.gray(h)}${
|
|
87938
|
+
const n2 = i ? ` ${import_picocolors2.default.dim(i)}` : "";
|
|
87939
|
+
return `${r}${import_picocolors2.default.gray(h)}${n2}`;
|
|
87014
87940
|
}
|
|
87015
87941
|
case "cancel": {
|
|
87016
|
-
const
|
|
87017
|
-
return `${r}${import_picocolors2.default.gray(h)}${
|
|
87942
|
+
const n2 = i ? ` ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i))}` : "";
|
|
87943
|
+
return `${r}${import_picocolors2.default.gray(h)}${n2}${i ? `
|
|
87018
87944
|
${import_picocolors2.default.gray(h)}` : ""}`;
|
|
87019
87945
|
}
|
|
87020
87946
|
default:
|
|
@@ -87038,21 +87964,21 @@ var Ht = (e) => {
|
|
|
87038
87964
|
return [];
|
|
87039
87965
|
try {
|
|
87040
87966
|
let i;
|
|
87041
|
-
return dt2(s) ? be(s).isDirectory() ? i = s : i = xe(s) : i = xe(s), ct2(i).map((
|
|
87042
|
-
const o = $t2(i,
|
|
87043
|
-
return { name:
|
|
87044
|
-
}).filter(({ path:
|
|
87967
|
+
return dt2(s) ? be(s).isDirectory() ? i = s : i = xe(s) : i = xe(s), ct2(i).map((n2) => {
|
|
87968
|
+
const o = $t2(i, n2), u = be(o);
|
|
87969
|
+
return { name: n2, path: o, isDirectory: u.isDirectory() };
|
|
87970
|
+
}).filter(({ path: n2, isDirectory: o }) => n2.startsWith(s) && (e.directory || !o)).map((n2) => ({ value: n2.path }));
|
|
87045
87971
|
} catch {
|
|
87046
87972
|
return [];
|
|
87047
87973
|
}
|
|
87048
87974
|
} });
|
|
87049
87975
|
};
|
|
87050
87976
|
var Ut = import_picocolors2.default.magenta;
|
|
87051
|
-
var Ie = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage:
|
|
87977
|
+
var Ie = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: n2, frames: o = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: u = ee ? 80 : 120, signal: l, ...a } = {}) => {
|
|
87052
87978
|
const d = ue();
|
|
87053
87979
|
let g, E, p3 = false, y2 = false, $ = "", c, m = performance.now();
|
|
87054
87980
|
const f = rt(s), F = a?.styleFrame ?? Ut, v = (I2) => {
|
|
87055
|
-
const O2 = I2 > 1 ?
|
|
87981
|
+
const O2 = I2 > 1 ? n2 ?? _.messages.error : i ?? _.messages.cancel;
|
|
87056
87982
|
y2 = I2 === 1, p3 && (W2(O2, I2), y2 && typeof r == "function" && r());
|
|
87057
87983
|
}, S2 = () => v(2), B = () => v(1), b = () => {
|
|
87058
87984
|
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);
|
|
@@ -87107,7 +88033,7 @@ var Ie = ({ indicator: e = "dots", onCancel: r, output: s = process.stdout, canc
|
|
|
87107
88033
|
};
|
|
87108
88034
|
var Ye = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
|
|
87109
88035
|
function Kt({ style: e = "heavy", max: r = 100, size: s = 40, ...i } = {}) {
|
|
87110
|
-
const
|
|
88036
|
+
const n2 = Ie(i);
|
|
87111
88037
|
let o = 0, u = "";
|
|
87112
88038
|
const l = Math.max(1, r), a = Math.max(1, s), d = (y2) => {
|
|
87113
88039
|
switch (y2) {
|
|
@@ -87126,11 +88052,11 @@ function Kt({ style: e = "heavy", max: r = 100, size: s = 40, ...i } = {}) {
|
|
|
87126
88052
|
const c = Math.floor(o / l * a);
|
|
87127
88053
|
return `${d(y2)(Ye[e].repeat(c))}${import_picocolors2.default.dim(Ye[e].repeat(a - c))} ${$}`;
|
|
87128
88054
|
}, E = (y2 = "") => {
|
|
87129
|
-
u = y2,
|
|
88055
|
+
u = y2, n2.start(g("initial", y2));
|
|
87130
88056
|
}, p3 = (y2 = 1, $) => {
|
|
87131
|
-
o = Math.min(l, y2 + o),
|
|
88057
|
+
o = Math.min(l, y2 + o), n2.message(g("active", $ ?? u)), u = $ ?? u;
|
|
87132
88058
|
};
|
|
87133
|
-
return { start: E, stop:
|
|
88059
|
+
return { start: E, stop: n2.stop, cancel: n2.cancel, error: n2.error, clear: n2.clear, advance: p3, isCancelled: n2.isCancelled, message: (y2) => p3(0, y2) };
|
|
87134
88060
|
}
|
|
87135
88061
|
var oe = (e, r) => e.includes(`
|
|
87136
88062
|
`) ? e.split(`
|
|
@@ -87138,23 +88064,23 @@ var oe = (e, r) => e.includes(`
|
|
|
87138
88064
|
`) : r(e);
|
|
87139
88065
|
var qt = (e) => {
|
|
87140
88066
|
const r = (s, i) => {
|
|
87141
|
-
const
|
|
88067
|
+
const n2 = s.label ?? String(s.value);
|
|
87142
88068
|
switch (i) {
|
|
87143
88069
|
case "disabled":
|
|
87144
|
-
return `${import_picocolors2.default.gray(K2)} ${oe(
|
|
88070
|
+
return `${import_picocolors2.default.gray(K2)} ${oe(n2, import_picocolors2.default.gray)}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
87145
88071
|
case "selected":
|
|
87146
|
-
return `${oe(
|
|
88072
|
+
return `${oe(n2, import_picocolors2.default.dim)}`;
|
|
87147
88073
|
case "active":
|
|
87148
|
-
return `${import_picocolors2.default.green(Y)} ${
|
|
88074
|
+
return `${import_picocolors2.default.green(Y)} ${n2}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
|
|
87149
88075
|
case "cancelled":
|
|
87150
|
-
return `${oe(
|
|
88076
|
+
return `${oe(n2, (o) => import_picocolors2.default.strikethrough(import_picocolors2.default.dim(o)))}`;
|
|
87151
88077
|
default:
|
|
87152
|
-
return `${import_picocolors2.default.dim(K2)} ${oe(
|
|
88078
|
+
return `${import_picocolors2.default.dim(K2)} ${oe(n2, import_picocolors2.default.dim)}`;
|
|
87153
88079
|
}
|
|
87154
88080
|
};
|
|
87155
88081
|
return new Wt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
|
|
87156
|
-
const s = `${N2(this.state)} `, i = `${Ee(this.state)} `,
|
|
87157
|
-
${
|
|
88082
|
+
const s = `${N2(this.state)} `, i = `${Ee(this.state)} `, n2 = Bt(e.output, e.message, i, s), o = `${import_picocolors2.default.gray(h)}
|
|
88083
|
+
${n2}
|
|
87158
88084
|
`;
|
|
87159
88085
|
switch (this.state) {
|
|
87160
88086
|
case "submit": {
|
|
@@ -87179,8 +88105,8 @@ ${import_picocolors2.default.cyan(x2)}
|
|
|
87179
88105
|
};
|
|
87180
88106
|
var Jt = (e) => {
|
|
87181
88107
|
const r = (s, i = "inactive") => {
|
|
87182
|
-
const
|
|
87183
|
-
return i === "selected" ? `${import_picocolors2.default.dim(
|
|
88108
|
+
const n2 = s.label ?? String(s.value);
|
|
88109
|
+
return i === "selected" ? `${import_picocolors2.default.dim(n2)}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(n2))}` : i === "active" ? `${import_picocolors2.default.bgCyan(import_picocolors2.default.gray(` ${s.value} `))} ${n2}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}` : `${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(` ${s.value} `)))} ${n2}${s.hint ? ` ${import_picocolors2.default.dim(`(${s.hint})`)}` : ""}`;
|
|
87184
88110
|
};
|
|
87185
88111
|
return new Tt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, caseSensitive: e.caseSensitive, render() {
|
|
87186
88112
|
const s = `${import_picocolors2.default.gray(h)}
|
|
@@ -87188,18 +88114,18 @@ ${N2(this.state)} ${e.message}
|
|
|
87188
88114
|
`;
|
|
87189
88115
|
switch (this.state) {
|
|
87190
88116
|
case "submit": {
|
|
87191
|
-
const i = `${import_picocolors2.default.gray(h)} `,
|
|
88117
|
+
const i = `${import_picocolors2.default.gray(h)} `, n2 = this.options.find((u) => u.value === this.value) ?? e.options[0], o = Bt(e.output, r(n2, "selected"), i);
|
|
87192
88118
|
return `${s}${o}`;
|
|
87193
88119
|
}
|
|
87194
88120
|
case "cancel": {
|
|
87195
|
-
const i = `${import_picocolors2.default.gray(h)} `,
|
|
87196
|
-
return `${s}${
|
|
88121
|
+
const i = `${import_picocolors2.default.gray(h)} `, n2 = Bt(e.output, r(this.options[0], "cancelled"), i);
|
|
88122
|
+
return `${s}${n2}
|
|
87197
88123
|
${import_picocolors2.default.gray(h)}`;
|
|
87198
88124
|
}
|
|
87199
88125
|
default: {
|
|
87200
|
-
const i = `${import_picocolors2.default.cyan(h)} `,
|
|
88126
|
+
const i = `${import_picocolors2.default.cyan(h)} `, n2 = this.options.map((o, u) => Bt(e.output, r(o, u === this.cursor ? "active" : "inactive"), i)).join(`
|
|
87201
88127
|
`);
|
|
87202
|
-
return `${s}${
|
|
88128
|
+
return `${s}${n2}
|
|
87203
88129
|
${import_picocolors2.default.cyan(x2)}
|
|
87204
88130
|
`;
|
|
87205
88131
|
}
|
|
@@ -87216,8 +88142,8 @@ ${r} `);
|
|
|
87216
88142
|
${ze}`), i.includes(`
|
|
87217
88143
|
`) && (s = 3 + le(i.slice(i.lastIndexOf(`
|
|
87218
88144
|
`))).length);
|
|
87219
|
-
const
|
|
87220
|
-
s +
|
|
88145
|
+
const n2 = le(i).length;
|
|
88146
|
+
s + n2 < process.stdout.columns ? (s += n2, process.stdout.write(i)) : (process.stdout.write(`
|
|
87221
88147
|
${ze}${i.trimStart()}`), s = 3 + le(i.trimStart()).length);
|
|
87222
88148
|
}
|
|
87223
88149
|
process.stdout.write(`
|
|
@@ -87229,17 +88155,17 @@ var Xt = async (e, r) => {
|
|
|
87229
88155
|
continue;
|
|
87230
88156
|
const i = Ie(r);
|
|
87231
88157
|
i.start(s.title);
|
|
87232
|
-
const
|
|
87233
|
-
i.stop(
|
|
88158
|
+
const n2 = await s.task(i.message);
|
|
88159
|
+
i.stop(n2 || s.title);
|
|
87234
88160
|
}
|
|
87235
88161
|
};
|
|
87236
88162
|
var Yt = (e) => e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "");
|
|
87237
88163
|
var zt = (e) => {
|
|
87238
|
-
const r = e.output ?? process.stdout, s = rt(r), i = import_picocolors2.default.gray(h),
|
|
88164
|
+
const r = e.output ?? process.stdout, s = rt(r), i = import_picocolors2.default.gray(h), n2 = e.spacing ?? 1, o = 3, u = e.retainLog === true, l = !ue() && Te(r);
|
|
87239
88165
|
r.write(`${i}
|
|
87240
88166
|
`), r.write(`${import_picocolors2.default.green(k2)} ${e.title}
|
|
87241
88167
|
`);
|
|
87242
|
-
for (let m = 0;m <
|
|
88168
|
+
for (let m = 0;m < n2; m++)
|
|
87243
88169
|
r.write(`${i}
|
|
87244
88170
|
`);
|
|
87245
88171
|
const a = [{ value: "", full: "" }];
|
|
@@ -87248,7 +88174,7 @@ var zt = (e) => {
|
|
|
87248
88174
|
if (a.length === 0)
|
|
87249
88175
|
return;
|
|
87250
88176
|
let f = 0;
|
|
87251
|
-
m && (f +=
|
|
88177
|
+
m && (f += n2 + 2);
|
|
87252
88178
|
for (const F of a) {
|
|
87253
88179
|
const { value: v, result: S2 } = F;
|
|
87254
88180
|
let B = S2?.message ?? v;
|
|
@@ -87266,7 +88192,7 @@ ${F.header}`);
|
|
|
87266
88192
|
${m.value}` : m.value;
|
|
87267
88193
|
m.header !== undefined && m.header !== "" && R2.message(m.header.split(`
|
|
87268
88194
|
`).map(import_picocolors2.default.bold), { output: r, secondarySymbol: i, symbol: i, spacing: 0 }), R2.message(v.split(`
|
|
87269
|
-
`).map(import_picocolors2.default.dim), { output: r, secondarySymbol: i, symbol: i, spacing: f ??
|
|
88195
|
+
`).map(import_picocolors2.default.dim), { output: r, secondarySymbol: i, symbol: i, spacing: f ?? n2 });
|
|
87270
88196
|
}, p3 = () => {
|
|
87271
88197
|
for (const m of a) {
|
|
87272
88198
|
const { header: f, value: F, full: v } = m;
|
|
@@ -87313,12 +88239,12 @@ ${m.value}` : m.value;
|
|
|
87313
88239
|
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() {
|
|
87314
88240
|
const r = (e?.withGuide ?? _.withGuide) !== false, s = `${`${r ? `${import_picocolors2.default.gray(h)}
|
|
87315
88241
|
` : ""}${N2(this.state)} `}${e.message}
|
|
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("_")),
|
|
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("_")), n2 = this.userInput ? this.userInputWithCursor : i, o = this.value ?? "";
|
|
87317
88243
|
switch (this.state) {
|
|
87318
88244
|
case "error": {
|
|
87319
88245
|
const u = this.error ? ` ${import_picocolors2.default.yellow(this.error)}` : "", l = r ? `${import_picocolors2.default.yellow(h)} ` : "", a = r ? import_picocolors2.default.yellow(x2) : "";
|
|
87320
88246
|
return `${s.trim()}
|
|
87321
|
-
${l}${
|
|
88247
|
+
${l}${n2}
|
|
87322
88248
|
${a}${u}
|
|
87323
88249
|
`;
|
|
87324
88250
|
}
|
|
@@ -87333,7 +88259,7 @@ ${l}` : ""}`;
|
|
|
87333
88259
|
}
|
|
87334
88260
|
default: {
|
|
87335
88261
|
const u = r ? `${import_picocolors2.default.cyan(h)} ` : "", l = r ? import_picocolors2.default.cyan(x2) : "";
|
|
87336
|
-
return `${s}${u}${
|
|
88262
|
+
return `${s}${u}${n2}
|
|
87337
88263
|
${l}
|
|
87338
88264
|
`;
|
|
87339
88265
|
}
|
|
@@ -87423,10 +88349,10 @@ var program = gen2(function* () {
|
|
|
87423
88349
|
].join(`
|
|
87424
88350
|
`), "Codebase scanned").pipe(zipRight3(clack.spinner.start("Starting"))),
|
|
87425
88351
|
onFileCleaned: ({ filePath, fileCount }) => {
|
|
87426
|
-
return updateAndGetEffect2(filesCleaned, (
|
|
88352
|
+
return updateAndGetEffect2(filesCleaned, (n2) => succeed7(n2 + 1)).pipe(tap2((filesCleaned2) => clack.spinner.message(`Cleaning: ${filesCleaned2}/${fileCount} ${filePath}`)));
|
|
87427
88353
|
},
|
|
87428
88354
|
onFileIndexed: ({ filePath, fileCount }) => {
|
|
87429
|
-
return updateAndGetEffect2(filesIndexed, (
|
|
88355
|
+
return updateAndGetEffect2(filesIndexed, (n2) => succeed7(n2 + 1)).pipe(tap2((filesIndexed2) => clack.spinner.message(`Indexing: ${filesIndexed2}/${fileCount} ${filePath}`)));
|
|
87430
88356
|
},
|
|
87431
88357
|
onFinished: () => clack.spinner.stop("Codebase indexed").pipe(zipRight3(clack.outro("DONE!")))
|
|
87432
88358
|
});
|
|
@@ -87463,5 +88389,5 @@ var program = gen2(function* () {
|
|
|
87463
88389
|
});
|
|
87464
88390
|
program.pipe(provide2(mergeAll5(GrepAi.Default).pipe(provideMerge2(Clack.Default), provideMerge2(exports_BunContext.layer))), exports_BunRuntime.runMain);
|
|
87465
88391
|
|
|
87466
|
-
//# debugId=
|
|
88392
|
+
//# debugId=7DC91FFA73730FD164756E2164756E21
|
|
87467
88393
|
//# sourceMappingURL=index.js.map
|