@google/gemini-cli-a2a-server 0.17.0-nightly.20251116.e650a4ee5 → 0.17.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2a-server.mjs +823 -537
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -442,8 +442,8 @@ var require_zalgo = __commonJS({
|
|
|
442
442
|
]
|
|
443
443
|
};
|
|
444
444
|
var all3 = [].concat(soul.up, soul.down, soul.mid);
|
|
445
|
-
function randomNumber(
|
|
446
|
-
var r2 = Math.floor(Math.random() *
|
|
445
|
+
function randomNumber(range2) {
|
|
446
|
+
var r2 = Math.floor(Math.random() * range2);
|
|
447
447
|
return r2;
|
|
448
448
|
}
|
|
449
449
|
function isChar(character) {
|
|
@@ -30184,20 +30184,20 @@ var require_proxy_addr = __commonJS({
|
|
|
30184
30184
|
ip = ip.toIPv4Address();
|
|
30185
30185
|
}
|
|
30186
30186
|
var max = ip.kind() === "ipv6" ? 128 : 32;
|
|
30187
|
-
var
|
|
30188
|
-
if (
|
|
30189
|
-
|
|
30190
|
-
} else if (DIGIT_REGEXP.test(
|
|
30191
|
-
|
|
30192
|
-
} else if (ip.kind() === "ipv4" && isip(
|
|
30193
|
-
|
|
30187
|
+
var range2 = pos2 !== -1 ? note.substring(pos2 + 1, note.length) : null;
|
|
30188
|
+
if (range2 === null) {
|
|
30189
|
+
range2 = max;
|
|
30190
|
+
} else if (DIGIT_REGEXP.test(range2)) {
|
|
30191
|
+
range2 = parseInt(range2, 10);
|
|
30192
|
+
} else if (ip.kind() === "ipv4" && isip(range2)) {
|
|
30193
|
+
range2 = parseNetmask(range2);
|
|
30194
30194
|
} else {
|
|
30195
|
-
|
|
30195
|
+
range2 = null;
|
|
30196
30196
|
}
|
|
30197
|
-
if (
|
|
30197
|
+
if (range2 <= 0 || range2 > max) {
|
|
30198
30198
|
throw new TypeError("invalid range on address: " + note);
|
|
30199
30199
|
}
|
|
30200
|
-
return [ip,
|
|
30200
|
+
return [ip, range2];
|
|
30201
30201
|
}
|
|
30202
30202
|
function parseNetmask(netmask) {
|
|
30203
30203
|
var ip = parseip(netmask);
|
|
@@ -32453,9 +32453,9 @@ var require_range_parser = __commonJS({
|
|
|
32453
32453
|
var ranges = [];
|
|
32454
32454
|
ranges.type = str.slice(0, index);
|
|
32455
32455
|
for (var i3 = 0; i3 < arr.length; i3++) {
|
|
32456
|
-
var
|
|
32457
|
-
var start2 = parseInt(
|
|
32458
|
-
var end = parseInt(
|
|
32456
|
+
var range2 = arr[i3].split("-");
|
|
32457
|
+
var start2 = parseInt(range2[0], 10);
|
|
32458
|
+
var end = parseInt(range2[1], 10);
|
|
32459
32459
|
if (isNaN(start2)) {
|
|
32460
32460
|
start2 = size - end;
|
|
32461
32461
|
end = size - 1;
|
|
@@ -32481,13 +32481,13 @@ var require_range_parser = __commonJS({
|
|
|
32481
32481
|
function combineRanges(ranges) {
|
|
32482
32482
|
var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart);
|
|
32483
32483
|
for (var j = 0, i3 = 1; i3 < ordered.length; i3++) {
|
|
32484
|
-
var
|
|
32484
|
+
var range2 = ordered[i3];
|
|
32485
32485
|
var current = ordered[j];
|
|
32486
|
-
if (
|
|
32487
|
-
ordered[++j] =
|
|
32488
|
-
} else if (
|
|
32489
|
-
current.end =
|
|
32490
|
-
current.index = Math.min(current.index,
|
|
32486
|
+
if (range2.start > current.end + 1) {
|
|
32487
|
+
ordered[++j] = range2;
|
|
32488
|
+
} else if (range2.end > current.end) {
|
|
32489
|
+
current.end = range2.end;
|
|
32490
|
+
current.index = Math.min(current.index, range2.index);
|
|
32491
32491
|
}
|
|
32492
32492
|
}
|
|
32493
32493
|
ordered.length = j + 1;
|
|
@@ -32495,17 +32495,17 @@ var require_range_parser = __commonJS({
|
|
|
32495
32495
|
combined.type = ranges.type;
|
|
32496
32496
|
return combined;
|
|
32497
32497
|
}
|
|
32498
|
-
function mapWithIndex(
|
|
32498
|
+
function mapWithIndex(range2, index) {
|
|
32499
32499
|
return {
|
|
32500
|
-
start:
|
|
32501
|
-
end:
|
|
32500
|
+
start: range2.start,
|
|
32501
|
+
end: range2.end,
|
|
32502
32502
|
index
|
|
32503
32503
|
};
|
|
32504
32504
|
}
|
|
32505
|
-
function mapWithoutIndex(
|
|
32505
|
+
function mapWithoutIndex(range2) {
|
|
32506
32506
|
return {
|
|
32507
|
-
start:
|
|
32508
|
-
end:
|
|
32507
|
+
start: range2.start,
|
|
32508
|
+
end: range2.end
|
|
32509
32509
|
};
|
|
32510
32510
|
}
|
|
32511
32511
|
function sortByRangeIndex(a2, b) {
|
|
@@ -32563,10 +32563,10 @@ var require_request = __commonJS({
|
|
|
32563
32563
|
var accept = accepts(this);
|
|
32564
32564
|
return accept.languages.apply(accept, arguments);
|
|
32565
32565
|
};
|
|
32566
|
-
req.range = function
|
|
32567
|
-
var
|
|
32568
|
-
if (!
|
|
32569
|
-
return parseRange(size,
|
|
32566
|
+
req.range = function range2(size, options2) {
|
|
32567
|
+
var range3 = this.get("Range");
|
|
32568
|
+
if (!range3) return;
|
|
32569
|
+
return parseRange(size, range3, options2);
|
|
32570
32570
|
};
|
|
32571
32571
|
defineGetter(req, "query", function query() {
|
|
32572
32572
|
var queryparse = this.app.get("query parser fn");
|
|
@@ -33424,8 +33424,8 @@ var require_send = __commonJS({
|
|
|
33424
33424
|
}
|
|
33425
33425
|
return false;
|
|
33426
33426
|
}
|
|
33427
|
-
function contentRange(type, size,
|
|
33428
|
-
return type + " " + (
|
|
33427
|
+
function contentRange(type, size, range2) {
|
|
33428
|
+
return type + " " + (range2 ? range2.start + "-" + range2.end : "*") + "/" + size;
|
|
33429
33429
|
}
|
|
33430
33430
|
function createHtmlDocument(title, body2) {
|
|
33431
33431
|
return '<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>' + title + "</title>\n</head>\n<body>\n<pre>" + body2 + "</pre>\n</body>\n</html>\n";
|
|
@@ -43276,8 +43276,8 @@ var require_send2 = __commonJS({
|
|
|
43276
43276
|
}
|
|
43277
43277
|
return false;
|
|
43278
43278
|
}
|
|
43279
|
-
function contentRange(type, size,
|
|
43280
|
-
return type + " " + (
|
|
43279
|
+
function contentRange(type, size, range2) {
|
|
43280
|
+
return type + " " + (range2 ? range2.start + "-" + range2.end : "*") + "/" + size;
|
|
43281
43281
|
}
|
|
43282
43282
|
function createHtmlDocument(title, body2) {
|
|
43283
43283
|
return '<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>' + title + "</title>\n</head>\n<body>\n<pre>" + body2 + "</pre>\n</body>\n</html>\n";
|
|
@@ -44495,10 +44495,10 @@ var require_request2 = __commonJS({
|
|
|
44495
44495
|
req.acceptsLanguages,
|
|
44496
44496
|
"req.acceptsLanguage: Use acceptsLanguages instead"
|
|
44497
44497
|
);
|
|
44498
|
-
req.range = function
|
|
44499
|
-
var
|
|
44500
|
-
if (!
|
|
44501
|
-
return parseRange(size,
|
|
44498
|
+
req.range = function range2(size, options2) {
|
|
44499
|
+
var range3 = this.get("Range");
|
|
44500
|
+
if (!range3) return;
|
|
44501
|
+
return parseRange(size, range3, options2);
|
|
44502
44502
|
};
|
|
44503
44503
|
req.param = function param(name4, defaultValue) {
|
|
44504
44504
|
var params = this.params || {};
|
|
@@ -59074,9 +59074,9 @@ var require_retry_request = __commonJS({
|
|
|
59074
59074
|
];
|
|
59075
59075
|
const statusCode = response.statusCode;
|
|
59076
59076
|
debug2(`Response status: ${statusCode}`);
|
|
59077
|
-
let
|
|
59078
|
-
while (
|
|
59079
|
-
if (statusCode >=
|
|
59077
|
+
let range2;
|
|
59078
|
+
while (range2 = retryRanges.shift()) {
|
|
59079
|
+
if (statusCode >= range2[0] && statusCode <= range2[1]) {
|
|
59080
59080
|
return true;
|
|
59081
59081
|
}
|
|
59082
59082
|
}
|
|
@@ -87420,8 +87420,8 @@ var require_time = __commonJS({
|
|
|
87420
87420
|
function getTimeOrigin() {
|
|
87421
87421
|
let timeOrigin = platform_1.otperformance.timeOrigin;
|
|
87422
87422
|
if (typeof timeOrigin !== "number") {
|
|
87423
|
-
const
|
|
87424
|
-
timeOrigin =
|
|
87423
|
+
const perf = platform_1.otperformance;
|
|
87424
|
+
timeOrigin = perf.timing && perf.timing.fetchStart;
|
|
87425
87425
|
}
|
|
87426
87426
|
return timeOrigin;
|
|
87427
87427
|
}
|
|
@@ -128274,21 +128274,21 @@ var require_semver = __commonJS({
|
|
|
128274
128274
|
"<": [-1],
|
|
128275
128275
|
"!=": [-1, 1]
|
|
128276
128276
|
};
|
|
128277
|
-
function satisfies(version3,
|
|
128277
|
+
function satisfies(version3, range2, options2) {
|
|
128278
128278
|
if (!_validateVersion(version3)) {
|
|
128279
128279
|
api_1.diag.error(`Invalid version: ${version3}`);
|
|
128280
128280
|
return false;
|
|
128281
128281
|
}
|
|
128282
|
-
if (!
|
|
128282
|
+
if (!range2) {
|
|
128283
128283
|
return true;
|
|
128284
128284
|
}
|
|
128285
|
-
|
|
128285
|
+
range2 = range2.replace(/([<>=~^]+)\s+/g, "$1");
|
|
128286
128286
|
const parsedVersion = _parseVersion(version3);
|
|
128287
128287
|
if (!parsedVersion) {
|
|
128288
128288
|
return false;
|
|
128289
128289
|
}
|
|
128290
128290
|
const allParsedRanges = [];
|
|
128291
|
-
const checkResult = _doSatisfies(parsedVersion,
|
|
128291
|
+
const checkResult = _doSatisfies(parsedVersion, range2, allParsedRanges, options2);
|
|
128292
128292
|
if (checkResult && !options2?.includePrerelease) {
|
|
128293
128293
|
return _doPreleaseCheck(parsedVersion, allParsedRanges);
|
|
128294
128294
|
}
|
|
@@ -128298,19 +128298,19 @@ var require_semver = __commonJS({
|
|
|
128298
128298
|
function _validateVersion(version3) {
|
|
128299
128299
|
return typeof version3 === "string" && VERSION_REGEXP.test(version3);
|
|
128300
128300
|
}
|
|
128301
|
-
function _doSatisfies(parsedVersion,
|
|
128302
|
-
if (
|
|
128303
|
-
const ranges =
|
|
128301
|
+
function _doSatisfies(parsedVersion, range2, allParsedRanges, options2) {
|
|
128302
|
+
if (range2.includes("||")) {
|
|
128303
|
+
const ranges = range2.trim().split("||");
|
|
128304
128304
|
for (const r2 of ranges) {
|
|
128305
128305
|
if (_checkRange(parsedVersion, r2, allParsedRanges, options2)) {
|
|
128306
128306
|
return true;
|
|
128307
128307
|
}
|
|
128308
128308
|
}
|
|
128309
128309
|
return false;
|
|
128310
|
-
} else if (
|
|
128311
|
-
|
|
128312
|
-
} else if (
|
|
128313
|
-
const ranges =
|
|
128310
|
+
} else if (range2.includes(" - ")) {
|
|
128311
|
+
range2 = replaceHyphen(range2, options2);
|
|
128312
|
+
} else if (range2.includes(" ")) {
|
|
128313
|
+
const ranges = range2.trim().replace(/\s{2,}/g, " ").split(" ");
|
|
128314
128314
|
for (const r2 of ranges) {
|
|
128315
128315
|
if (!_checkRange(parsedVersion, r2, allParsedRanges, options2)) {
|
|
128316
128316
|
return false;
|
|
@@ -128318,14 +128318,14 @@ var require_semver = __commonJS({
|
|
|
128318
128318
|
}
|
|
128319
128319
|
return true;
|
|
128320
128320
|
}
|
|
128321
|
-
return _checkRange(parsedVersion,
|
|
128321
|
+
return _checkRange(parsedVersion, range2, allParsedRanges, options2);
|
|
128322
128322
|
}
|
|
128323
|
-
function _checkRange(parsedVersion,
|
|
128324
|
-
|
|
128325
|
-
if (
|
|
128326
|
-
return _doSatisfies(parsedVersion,
|
|
128323
|
+
function _checkRange(parsedVersion, range2, allParsedRanges, options2) {
|
|
128324
|
+
range2 = _normalizeRange(range2, options2);
|
|
128325
|
+
if (range2.includes(" ")) {
|
|
128326
|
+
return _doSatisfies(parsedVersion, range2, allParsedRanges, options2);
|
|
128327
128327
|
} else {
|
|
128328
|
-
const parsedRange = _parseRange(
|
|
128328
|
+
const parsedRange = _parseRange(range2);
|
|
128329
128329
|
allParsedRanges.push(parsedRange);
|
|
128330
128330
|
return _satisfies(parsedVersion, parsedRange);
|
|
128331
128331
|
}
|
|
@@ -128359,13 +128359,13 @@ var require_semver = __commonJS({
|
|
|
128359
128359
|
}
|
|
128360
128360
|
return true;
|
|
128361
128361
|
}
|
|
128362
|
-
function _normalizeRange(
|
|
128363
|
-
|
|
128364
|
-
|
|
128365
|
-
|
|
128366
|
-
|
|
128367
|
-
|
|
128368
|
-
return
|
|
128362
|
+
function _normalizeRange(range2, options2) {
|
|
128363
|
+
range2 = range2.trim();
|
|
128364
|
+
range2 = replaceCaret(range2, options2);
|
|
128365
|
+
range2 = replaceTilde(range2);
|
|
128366
|
+
range2 = replaceXRange(range2, options2);
|
|
128367
|
+
range2 = range2.trim();
|
|
128368
|
+
return range2;
|
|
128369
128369
|
}
|
|
128370
128370
|
function isX(id) {
|
|
128371
128371
|
return !id || id.toLowerCase() === "x" || id === "*";
|
|
@@ -129250,8 +129250,8 @@ var require_is_core_module = __commonJS({
|
|
|
129250
129250
|
}
|
|
129251
129251
|
return op === ">=";
|
|
129252
129252
|
}
|
|
129253
|
-
function matchesRange(current,
|
|
129254
|
-
var specifiers =
|
|
129253
|
+
function matchesRange(current, range2) {
|
|
129254
|
+
var specifiers = range2.split(/ ?&& ?/);
|
|
129255
129255
|
if (specifiers.length === 0) {
|
|
129256
129256
|
return false;
|
|
129257
129257
|
}
|
|
@@ -144002,13 +144002,13 @@ var require_commonjs = __commonJS({
|
|
|
144002
144002
|
numeric: "decimal"
|
|
144003
144003
|
};
|
|
144004
144004
|
function encode3(text, _a3) {
|
|
144005
|
-
var _b = _a3 === void 0 ? defaultEncodeOptions : _a3, _c = _b.mode, mode = _c === void 0 ? "specialChars" : _c, _d = _b.numeric,
|
|
144005
|
+
var _b = _a3 === void 0 ? defaultEncodeOptions : _a3, _c = _b.mode, mode = _c === void 0 ? "specialChars" : _c, _d = _b.numeric, numeric2 = _d === void 0 ? "decimal" : _d, _e = _b.level, level = _e === void 0 ? "all" : _e;
|
|
144006
144006
|
if (!text) {
|
|
144007
144007
|
return "";
|
|
144008
144008
|
}
|
|
144009
144009
|
var encodeRegExp = encodeRegExps[mode];
|
|
144010
144010
|
var references = allNamedReferences2[level].characters;
|
|
144011
|
-
var isHex =
|
|
144011
|
+
var isHex = numeric2 === "hexadecimal";
|
|
144012
144012
|
return String.prototype.replace.call(text, encodeRegExp, function(input) {
|
|
144013
144013
|
var result = references[input];
|
|
144014
144014
|
if (!result) {
|
|
@@ -203955,214 +203955,6 @@ var require_shell_quote = __commonJS({
|
|
|
203955
203955
|
}
|
|
203956
203956
|
});
|
|
203957
203957
|
|
|
203958
|
-
// node_modules/balanced-match/index.js
|
|
203959
|
-
var require_balanced_match = __commonJS({
|
|
203960
|
-
"node_modules/balanced-match/index.js"(exports2, module2) {
|
|
203961
|
-
"use strict";
|
|
203962
|
-
module2.exports = balanced;
|
|
203963
|
-
function balanced(a2, b, str) {
|
|
203964
|
-
if (a2 instanceof RegExp) a2 = maybeMatch(a2, str);
|
|
203965
|
-
if (b instanceof RegExp) b = maybeMatch(b, str);
|
|
203966
|
-
var r2 = range(a2, b, str);
|
|
203967
|
-
return r2 && {
|
|
203968
|
-
start: r2[0],
|
|
203969
|
-
end: r2[1],
|
|
203970
|
-
pre: str.slice(0, r2[0]),
|
|
203971
|
-
body: str.slice(r2[0] + a2.length, r2[1]),
|
|
203972
|
-
post: str.slice(r2[1] + b.length)
|
|
203973
|
-
};
|
|
203974
|
-
}
|
|
203975
|
-
function maybeMatch(reg, str) {
|
|
203976
|
-
var m = str.match(reg);
|
|
203977
|
-
return m ? m[0] : null;
|
|
203978
|
-
}
|
|
203979
|
-
balanced.range = range;
|
|
203980
|
-
function range(a2, b, str) {
|
|
203981
|
-
var begs, beg, left2, right2, result;
|
|
203982
|
-
var ai = str.indexOf(a2);
|
|
203983
|
-
var bi = str.indexOf(b, ai + 1);
|
|
203984
|
-
var i3 = ai;
|
|
203985
|
-
if (ai >= 0 && bi > 0) {
|
|
203986
|
-
if (a2 === b) {
|
|
203987
|
-
return [ai, bi];
|
|
203988
|
-
}
|
|
203989
|
-
begs = [];
|
|
203990
|
-
left2 = str.length;
|
|
203991
|
-
while (i3 >= 0 && !result) {
|
|
203992
|
-
if (i3 == ai) {
|
|
203993
|
-
begs.push(i3);
|
|
203994
|
-
ai = str.indexOf(a2, i3 + 1);
|
|
203995
|
-
} else if (begs.length == 1) {
|
|
203996
|
-
result = [begs.pop(), bi];
|
|
203997
|
-
} else {
|
|
203998
|
-
beg = begs.pop();
|
|
203999
|
-
if (beg < left2) {
|
|
204000
|
-
left2 = beg;
|
|
204001
|
-
right2 = bi;
|
|
204002
|
-
}
|
|
204003
|
-
bi = str.indexOf(b, i3 + 1);
|
|
204004
|
-
}
|
|
204005
|
-
i3 = ai < bi && ai >= 0 ? ai : bi;
|
|
204006
|
-
}
|
|
204007
|
-
if (begs.length) {
|
|
204008
|
-
result = [left2, right2];
|
|
204009
|
-
}
|
|
204010
|
-
}
|
|
204011
|
-
return result;
|
|
204012
|
-
}
|
|
204013
|
-
}
|
|
204014
|
-
});
|
|
204015
|
-
|
|
204016
|
-
// node_modules/glob/node_modules/brace-expansion/index.js
|
|
204017
|
-
var require_brace_expansion = __commonJS({
|
|
204018
|
-
"node_modules/glob/node_modules/brace-expansion/index.js"(exports2, module2) {
|
|
204019
|
-
var balanced = require_balanced_match();
|
|
204020
|
-
module2.exports = expandTop;
|
|
204021
|
-
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
204022
|
-
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
204023
|
-
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
204024
|
-
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
204025
|
-
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
204026
|
-
function numeric(str) {
|
|
204027
|
-
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
204028
|
-
}
|
|
204029
|
-
function escapeBraces(str) {
|
|
204030
|
-
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
204031
|
-
}
|
|
204032
|
-
function unescapeBraces(str) {
|
|
204033
|
-
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
204034
|
-
}
|
|
204035
|
-
function parseCommaParts(str) {
|
|
204036
|
-
if (!str)
|
|
204037
|
-
return [""];
|
|
204038
|
-
var parts2 = [];
|
|
204039
|
-
var m = balanced("{", "}", str);
|
|
204040
|
-
if (!m)
|
|
204041
|
-
return str.split(",");
|
|
204042
|
-
var pre = m.pre;
|
|
204043
|
-
var body2 = m.body;
|
|
204044
|
-
var post = m.post;
|
|
204045
|
-
var p = pre.split(",");
|
|
204046
|
-
p[p.length - 1] += "{" + body2 + "}";
|
|
204047
|
-
var postParts = parseCommaParts(post);
|
|
204048
|
-
if (post.length) {
|
|
204049
|
-
p[p.length - 1] += postParts.shift();
|
|
204050
|
-
p.push.apply(p, postParts);
|
|
204051
|
-
}
|
|
204052
|
-
parts2.push.apply(parts2, p);
|
|
204053
|
-
return parts2;
|
|
204054
|
-
}
|
|
204055
|
-
function expandTop(str) {
|
|
204056
|
-
if (!str)
|
|
204057
|
-
return [];
|
|
204058
|
-
if (str.substr(0, 2) === "{}") {
|
|
204059
|
-
str = "\\{\\}" + str.substr(2);
|
|
204060
|
-
}
|
|
204061
|
-
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
204062
|
-
}
|
|
204063
|
-
function embrace(str) {
|
|
204064
|
-
return "{" + str + "}";
|
|
204065
|
-
}
|
|
204066
|
-
function isPadded(el) {
|
|
204067
|
-
return /^-?0\d/.test(el);
|
|
204068
|
-
}
|
|
204069
|
-
function lte(i3, y) {
|
|
204070
|
-
return i3 <= y;
|
|
204071
|
-
}
|
|
204072
|
-
function gte(i3, y) {
|
|
204073
|
-
return i3 >= y;
|
|
204074
|
-
}
|
|
204075
|
-
function expand2(str, isTop) {
|
|
204076
|
-
var expansions = [];
|
|
204077
|
-
var m = balanced("{", "}", str);
|
|
204078
|
-
if (!m) return [str];
|
|
204079
|
-
var pre = m.pre;
|
|
204080
|
-
var post = m.post.length ? expand2(m.post, false) : [""];
|
|
204081
|
-
if (/\$$/.test(m.pre)) {
|
|
204082
|
-
for (var k = 0; k < post.length; k++) {
|
|
204083
|
-
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
204084
|
-
expansions.push(expansion);
|
|
204085
|
-
}
|
|
204086
|
-
} else {
|
|
204087
|
-
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
204088
|
-
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
204089
|
-
var isSequence = isNumericSequence || isAlphaSequence;
|
|
204090
|
-
var isOptions = m.body.indexOf(",") >= 0;
|
|
204091
|
-
if (!isSequence && !isOptions) {
|
|
204092
|
-
if (m.post.match(/,(?!,).*\}/)) {
|
|
204093
|
-
str = m.pre + "{" + m.body + escClose + m.post;
|
|
204094
|
-
return expand2(str);
|
|
204095
|
-
}
|
|
204096
|
-
return [str];
|
|
204097
|
-
}
|
|
204098
|
-
var n3;
|
|
204099
|
-
if (isSequence) {
|
|
204100
|
-
n3 = m.body.split(/\.\./);
|
|
204101
|
-
} else {
|
|
204102
|
-
n3 = parseCommaParts(m.body);
|
|
204103
|
-
if (n3.length === 1) {
|
|
204104
|
-
n3 = expand2(n3[0], false).map(embrace);
|
|
204105
|
-
if (n3.length === 1) {
|
|
204106
|
-
return post.map(function(p) {
|
|
204107
|
-
return m.pre + n3[0] + p;
|
|
204108
|
-
});
|
|
204109
|
-
}
|
|
204110
|
-
}
|
|
204111
|
-
}
|
|
204112
|
-
var N;
|
|
204113
|
-
if (isSequence) {
|
|
204114
|
-
var x = numeric(n3[0]);
|
|
204115
|
-
var y = numeric(n3[1]);
|
|
204116
|
-
var width = Math.max(n3[0].length, n3[1].length);
|
|
204117
|
-
var incr = n3.length == 3 ? Math.abs(numeric(n3[2])) : 1;
|
|
204118
|
-
var test = lte;
|
|
204119
|
-
var reverse = y < x;
|
|
204120
|
-
if (reverse) {
|
|
204121
|
-
incr *= -1;
|
|
204122
|
-
test = gte;
|
|
204123
|
-
}
|
|
204124
|
-
var pad = n3.some(isPadded);
|
|
204125
|
-
N = [];
|
|
204126
|
-
for (var i3 = x; test(i3, y); i3 += incr) {
|
|
204127
|
-
var c4;
|
|
204128
|
-
if (isAlphaSequence) {
|
|
204129
|
-
c4 = String.fromCharCode(i3);
|
|
204130
|
-
if (c4 === "\\")
|
|
204131
|
-
c4 = "";
|
|
204132
|
-
} else {
|
|
204133
|
-
c4 = String(i3);
|
|
204134
|
-
if (pad) {
|
|
204135
|
-
var need = width - c4.length;
|
|
204136
|
-
if (need > 0) {
|
|
204137
|
-
var z = new Array(need + 1).join("0");
|
|
204138
|
-
if (i3 < 0)
|
|
204139
|
-
c4 = "-" + z + c4.slice(1);
|
|
204140
|
-
else
|
|
204141
|
-
c4 = z + c4;
|
|
204142
|
-
}
|
|
204143
|
-
}
|
|
204144
|
-
}
|
|
204145
|
-
N.push(c4);
|
|
204146
|
-
}
|
|
204147
|
-
} else {
|
|
204148
|
-
N = [];
|
|
204149
|
-
for (var j = 0; j < n3.length; j++) {
|
|
204150
|
-
N.push.apply(N, expand2(n3[j], false));
|
|
204151
|
-
}
|
|
204152
|
-
}
|
|
204153
|
-
for (var j = 0; j < N.length; j++) {
|
|
204154
|
-
for (var k = 0; k < post.length; k++) {
|
|
204155
|
-
var expansion = pre + N[j] + post[k];
|
|
204156
|
-
if (!isTop || isSequence || expansion)
|
|
204157
|
-
expansions.push(expansion);
|
|
204158
|
-
}
|
|
204159
|
-
}
|
|
204160
|
-
}
|
|
204161
|
-
return expansions;
|
|
204162
|
-
}
|
|
204163
|
-
}
|
|
204164
|
-
});
|
|
204165
|
-
|
|
204166
203958
|
// node_modules/isexe/windows.js
|
|
204167
203959
|
var require_windows = __commonJS({
|
|
204168
203960
|
"node_modules/isexe/windows.js"(exports2, module2) {
|
|
@@ -216436,9 +216228,9 @@ var require_util15 = __commonJS({
|
|
|
216436
216228
|
return !headerCharRegex.test(characters);
|
|
216437
216229
|
}
|
|
216438
216230
|
var rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+)?$/;
|
|
216439
|
-
function parseRangeHeader(
|
|
216440
|
-
if (
|
|
216441
|
-
const m =
|
|
216231
|
+
function parseRangeHeader(range2) {
|
|
216232
|
+
if (range2 == null || range2 === "") return { start: 0, end: null, size: null };
|
|
216233
|
+
const m = range2 ? range2.match(rangeHeaderRegex) : null;
|
|
216442
216234
|
return m ? {
|
|
216443
216235
|
start: parseInt(m[1]),
|
|
216444
216236
|
end: m[2] ? parseInt(m[2]) : null,
|
|
@@ -224261,8 +224053,8 @@ var require_retry_handler = __commonJS({
|
|
|
224261
224053
|
}
|
|
224262
224054
|
if (this.end == null) {
|
|
224263
224055
|
if (statusCode === 206) {
|
|
224264
|
-
const
|
|
224265
|
-
if (
|
|
224056
|
+
const range2 = parseRangeHeader(headers["content-range"]);
|
|
224057
|
+
if (range2 == null) {
|
|
224266
224058
|
this.headersSent = true;
|
|
224267
224059
|
this.handler.onResponseStart?.(
|
|
224268
224060
|
controller,
|
|
@@ -224272,7 +224064,7 @@ var require_retry_handler = __commonJS({
|
|
|
224272
224064
|
);
|
|
224273
224065
|
return;
|
|
224274
224066
|
}
|
|
224275
|
-
const { start: start2, size, end = size ? size - 1 : null } =
|
|
224067
|
+
const { start: start2, size, end = size ? size - 1 : null } = range2;
|
|
224276
224068
|
assert5(
|
|
224277
224069
|
start2 != null && Number.isFinite(start2),
|
|
224278
224070
|
"content-range mismatch"
|
|
@@ -246200,7 +245992,7 @@ var require_ignore = __commonJS({
|
|
|
246200
245992
|
};
|
|
246201
245993
|
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
|
|
246202
245994
|
var RETURN_FALSE = () => false;
|
|
246203
|
-
var sanitizeRange = (
|
|
245995
|
+
var sanitizeRange = (range2) => range2.replace(
|
|
246204
245996
|
REGEX_REGEXP_RANGE,
|
|
246205
245997
|
(match2, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match2 : EMPTY
|
|
246206
245998
|
);
|
|
@@ -246336,7 +246128,7 @@ var require_ignore = __commonJS({
|
|
|
246336
246128
|
// > can be used to match one of the characters in a range.
|
|
246337
246129
|
// `\` is escaped by step 3
|
|
246338
246130
|
/(\\)?\[([^\]/]*?)(\\*)($|\])/g,
|
|
246339
|
-
(match2, leadEscape,
|
|
246131
|
+
(match2, leadEscape, range2, endEscape, close) => leadEscape === ESCAPE ? `\\[${range2}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range2)}${endEscape}]` : "[]" : "[]"
|
|
246340
246132
|
],
|
|
246341
246133
|
// ending
|
|
246342
246134
|
[
|
|
@@ -246830,13 +246622,13 @@ var require_identifier = __commonJS({
|
|
|
246830
246622
|
exports2.isIdentifierChar = isIdentifierChar;
|
|
246831
246623
|
exports2.isIdentifierName = isIdentifierName;
|
|
246832
246624
|
exports2.isIdentifierStart = isIdentifierStart;
|
|
246833
|
-
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\
|
|
246834
|
-
var nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\
|
|
246625
|
+
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
246626
|
+
var nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
|
|
246835
246627
|
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
246836
246628
|
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
246837
246629
|
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
246838
|
-
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25,
|
|
246839
|
-
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1,
|
|
246630
|
+
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
|
|
246631
|
+
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
246840
246632
|
function isInAstralSet(code2, set) {
|
|
246841
246633
|
let pos2 = 65536;
|
|
246842
246634
|
for (let i3 = 0, length = set.length; i3 < length; i3 += 2) {
|
|
@@ -247359,10 +247151,10 @@ var require_parse_options = __commonJS({
|
|
|
247359
247151
|
var require_identifiers = __commonJS({
|
|
247360
247152
|
"node_modules/semver/internal/identifiers.js"(exports2, module2) {
|
|
247361
247153
|
"use strict";
|
|
247362
|
-
var
|
|
247154
|
+
var numeric2 = /^[0-9]+$/;
|
|
247363
247155
|
var compareIdentifiers = (a2, b) => {
|
|
247364
|
-
const anum =
|
|
247365
|
-
const bnum =
|
|
247156
|
+
const anum = numeric2.test(a2);
|
|
247157
|
+
const bnum = numeric2.test(b);
|
|
247366
247158
|
if (anum && bnum) {
|
|
247367
247159
|
a2 = +a2;
|
|
247368
247160
|
b = +b;
|
|
@@ -249090,7 +248882,7 @@ var require_commonjs2 = __commonJS({
|
|
|
249090
248882
|
"use strict";
|
|
249091
248883
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
249092
248884
|
exports2.LRUCache = void 0;
|
|
249093
|
-
var
|
|
248885
|
+
var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
249094
248886
|
var warned2 = /* @__PURE__ */ new Set();
|
|
249095
248887
|
var PROCESS4 = typeof process === "object" && !!process ? process : {};
|
|
249096
248888
|
var emitWarning2 = (msg, type, code2, fn) => {
|
|
@@ -249444,7 +249236,7 @@ var require_commonjs2 = __commonJS({
|
|
|
249444
249236
|
const starts = new ZeroArray2(this.#max);
|
|
249445
249237
|
this.#ttls = ttls;
|
|
249446
249238
|
this.#starts = starts;
|
|
249447
|
-
this.#setItemTTL = (index, ttl2, start2 =
|
|
249239
|
+
this.#setItemTTL = (index, ttl2, start2 = perf.now()) => {
|
|
249448
249240
|
starts[index] = ttl2 !== 0 ? start2 : 0;
|
|
249449
249241
|
ttls[index] = ttl2;
|
|
249450
249242
|
if (ttl2 !== 0 && this.ttlAutopurge) {
|
|
@@ -249459,7 +249251,7 @@ var require_commonjs2 = __commonJS({
|
|
|
249459
249251
|
}
|
|
249460
249252
|
};
|
|
249461
249253
|
this.#updateItemAge = (index) => {
|
|
249462
|
-
starts[index] = ttls[index] !== 0 ?
|
|
249254
|
+
starts[index] = ttls[index] !== 0 ? perf.now() : 0;
|
|
249463
249255
|
};
|
|
249464
249256
|
this.#statusTTL = (status, index) => {
|
|
249465
249257
|
if (ttls[index]) {
|
|
@@ -249476,7 +249268,7 @@ var require_commonjs2 = __commonJS({
|
|
|
249476
249268
|
};
|
|
249477
249269
|
let cachedNow = 0;
|
|
249478
249270
|
const getNow = () => {
|
|
249479
|
-
const n3 =
|
|
249271
|
+
const n3 = perf.now();
|
|
249480
249272
|
if (this.ttlResolution > 0) {
|
|
249481
249273
|
cachedNow = n3;
|
|
249482
249274
|
const t2 = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
|
@@ -249779,7 +249571,7 @@ var require_commonjs2 = __commonJS({
|
|
|
249779
249571
|
const ttl2 = this.#ttls[i3];
|
|
249780
249572
|
const start2 = this.#starts[i3];
|
|
249781
249573
|
if (ttl2 && start2) {
|
|
249782
|
-
const remain = ttl2 - (
|
|
249574
|
+
const remain = ttl2 - (perf.now() - start2);
|
|
249783
249575
|
entry.ttl = remain;
|
|
249784
249576
|
entry.start = Date.now();
|
|
249785
249577
|
}
|
|
@@ -249813,7 +249605,7 @@ var require_commonjs2 = __commonJS({
|
|
|
249813
249605
|
const entry = { value };
|
|
249814
249606
|
if (this.#ttls && this.#starts) {
|
|
249815
249607
|
entry.ttl = this.#ttls[i3];
|
|
249816
|
-
const age =
|
|
249608
|
+
const age = perf.now() - this.#starts[i3];
|
|
249817
249609
|
entry.start = Math.floor(Date.now() - age);
|
|
249818
249610
|
}
|
|
249819
249611
|
if (this.#sizes) {
|
|
@@ -249837,7 +249629,7 @@ var require_commonjs2 = __commonJS({
|
|
|
249837
249629
|
for (const [key, entry] of arr) {
|
|
249838
249630
|
if (entry.start) {
|
|
249839
249631
|
const age = Date.now() - entry.start;
|
|
249840
|
-
entry.start =
|
|
249632
|
+
entry.start = perf.now() - age;
|
|
249841
249633
|
}
|
|
249842
249634
|
this.set(key, entry.value, entry);
|
|
249843
249635
|
}
|
|
@@ -254514,17 +254306,17 @@ var require_parse11 = __commonJS({
|
|
|
254514
254306
|
let output = ")";
|
|
254515
254307
|
if (brace.dots === true) {
|
|
254516
254308
|
const arr = tokens.slice();
|
|
254517
|
-
const
|
|
254309
|
+
const range2 = [];
|
|
254518
254310
|
for (let i3 = arr.length - 1; i3 >= 0; i3--) {
|
|
254519
254311
|
tokens.pop();
|
|
254520
254312
|
if (arr[i3].type === "brace") {
|
|
254521
254313
|
break;
|
|
254522
254314
|
}
|
|
254523
254315
|
if (arr[i3].type !== "dots") {
|
|
254524
|
-
|
|
254316
|
+
range2.unshift(arr[i3].value);
|
|
254525
254317
|
}
|
|
254526
254318
|
}
|
|
254527
|
-
output = expandRange(
|
|
254319
|
+
output = expandRange(range2, opts);
|
|
254528
254320
|
state.backtrack = true;
|
|
254529
254321
|
}
|
|
254530
254322
|
if (brace.comma !== true && brace.dots !== true) {
|
|
@@ -259200,8 +258992,8 @@ var Upload = class extends Writable {
|
|
|
259200
258992
|
const shouldContinueWithNextMultiChunkRequest = this.chunkSize && resp.status === RESUMABLE_INCOMPLETE_STATUS_CODE && resp.headers.range && moreDataToUpload;
|
|
259201
258993
|
const shouldContinueUploadInAnotherRequest = this.isPartialUpload && resp.status === RESUMABLE_INCOMPLETE_STATUS_CODE && !moreDataToUpload;
|
|
259202
258994
|
if (shouldContinueWithNextMultiChunkRequest) {
|
|
259203
|
-
const
|
|
259204
|
-
this.offset = Number(
|
|
258995
|
+
const range2 = resp.headers.range;
|
|
258996
|
+
this.offset = Number(range2.split("-")[1]) + 1;
|
|
259205
258997
|
const missingBytes = this.numBytesWritten - this.offset;
|
|
259206
258998
|
if (missingBytes) {
|
|
259207
258999
|
this.prependLocalBufferToUpstream(missingBytes);
|
|
@@ -286945,20 +286737,6 @@ var McpCallableTool = class _McpCallableTool {
|
|
|
286945
286737
|
return functionCallResponseParts;
|
|
286946
286738
|
}
|
|
286947
286739
|
};
|
|
286948
|
-
function isMcpClient(client) {
|
|
286949
|
-
return client !== null && typeof client === "object" && "listTools" in client && typeof client.listTools === "function";
|
|
286950
|
-
}
|
|
286951
|
-
function mcpToTool(...args2) {
|
|
286952
|
-
hasMcpToolUsageFromMcpToTool = true;
|
|
286953
|
-
if (args2.length === 0) {
|
|
286954
|
-
throw new Error("No MCP clients provided");
|
|
286955
|
-
}
|
|
286956
|
-
const maybeConfig = args2[args2.length - 1];
|
|
286957
|
-
if (isMcpClient(maybeConfig)) {
|
|
286958
|
-
return McpCallableTool.create(args2, {});
|
|
286959
|
-
}
|
|
286960
|
-
return McpCallableTool.create(args2.slice(0, args2.length - 1), maybeConfig);
|
|
286961
|
-
}
|
|
286962
286740
|
async function handleWebSocketMessage$1(apiClient, onmessage, event) {
|
|
286963
286741
|
const serverMessage = new LiveMusicServerMessage();
|
|
286964
286742
|
let data;
|
|
@@ -295938,8 +295716,8 @@ var Float64Vector = import_vector.default.Float64Vector;
|
|
|
295938
295716
|
var PointerVector = import_vector.default.PointerVector;
|
|
295939
295717
|
|
|
295940
295718
|
// packages/core/dist/src/generated/git-commit.js
|
|
295941
|
-
var GIT_COMMIT_INFO = "
|
|
295942
|
-
var CLI_VERSION = "0.17.0-
|
|
295719
|
+
var GIT_COMMIT_INFO = "86828bb56";
|
|
295720
|
+
var CLI_VERSION = "0.17.0-preview.0";
|
|
295943
295721
|
|
|
295944
295722
|
// packages/core/dist/src/ide/detect-ide.js
|
|
295945
295723
|
var IDE_DEFINITIONS = {
|
|
@@ -295951,12 +295729,16 @@ var IDE_DEFINITIONS = {
|
|
|
295951
295729
|
firebasestudio: { name: "firebasestudio", displayName: "Firebase Studio" },
|
|
295952
295730
|
trae: { name: "trae", displayName: "Trae" },
|
|
295953
295731
|
vscode: { name: "vscode", displayName: "VS Code" },
|
|
295954
|
-
vscodefork: { name: "vscodefork", displayName: "IDE" }
|
|
295732
|
+
vscodefork: { name: "vscodefork", displayName: "IDE" },
|
|
295733
|
+
antigravity: { name: "antigravity", displayName: "Antigravity" }
|
|
295955
295734
|
};
|
|
295956
295735
|
function isCloudShell() {
|
|
295957
295736
|
return !!(process.env["EDITOR_IN_CLOUD_SHELL"] || process.env["CLOUD_SHELL"]);
|
|
295958
295737
|
}
|
|
295959
295738
|
function detectIdeFromEnv() {
|
|
295739
|
+
if (process.env["ANTIGRAVITY_CLI_ALIAS"]) {
|
|
295740
|
+
return IDE_DEFINITIONS.antigravity;
|
|
295741
|
+
}
|
|
295960
295742
|
if (process.env["__COG_BASHRC_SOURCED"]) {
|
|
295961
295743
|
return IDE_DEFINITIONS.devin;
|
|
295962
295744
|
}
|
|
@@ -298785,7 +298567,7 @@ async function createContentGenerator(config2, gcConfig, sessionId2) {
|
|
|
298785
298567
|
if (gcConfig.fakeResponses) {
|
|
298786
298568
|
return FakeContentGenerator.fromFile(gcConfig.fakeResponses);
|
|
298787
298569
|
}
|
|
298788
|
-
const version3 = "0.17.0-
|
|
298570
|
+
const version3 = "0.17.0-preview.0";
|
|
298789
298571
|
const userAgent = `GeminiCLI/${version3} (${process.platform}; ${process.arch})`;
|
|
298790
298572
|
const baseHeaders = {
|
|
298791
298573
|
"User-Agent": userAgent
|
|
@@ -301716,8 +301498,216 @@ import path25 from "node:path";
|
|
|
301716
301498
|
import { EOL } from "node:os";
|
|
301717
301499
|
import { spawn as spawn2 } from "node:child_process";
|
|
301718
301500
|
|
|
301719
|
-
// node_modules/
|
|
301720
|
-
var
|
|
301501
|
+
// node_modules/@isaacs/balanced-match/dist/esm/index.js
|
|
301502
|
+
var balanced = (a2, b, str) => {
|
|
301503
|
+
const ma = a2 instanceof RegExp ? maybeMatch(a2, str) : a2;
|
|
301504
|
+
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
|
301505
|
+
const r2 = ma !== null && mb != null && range(ma, mb, str);
|
|
301506
|
+
return r2 && {
|
|
301507
|
+
start: r2[0],
|
|
301508
|
+
end: r2[1],
|
|
301509
|
+
pre: str.slice(0, r2[0]),
|
|
301510
|
+
body: str.slice(r2[0] + ma.length, r2[1]),
|
|
301511
|
+
post: str.slice(r2[1] + mb.length)
|
|
301512
|
+
};
|
|
301513
|
+
};
|
|
301514
|
+
var maybeMatch = (reg, str) => {
|
|
301515
|
+
const m = str.match(reg);
|
|
301516
|
+
return m ? m[0] : null;
|
|
301517
|
+
};
|
|
301518
|
+
var range = (a2, b, str) => {
|
|
301519
|
+
let begs, beg, left2, right2 = void 0, result;
|
|
301520
|
+
let ai = str.indexOf(a2);
|
|
301521
|
+
let bi = str.indexOf(b, ai + 1);
|
|
301522
|
+
let i3 = ai;
|
|
301523
|
+
if (ai >= 0 && bi > 0) {
|
|
301524
|
+
if (a2 === b) {
|
|
301525
|
+
return [ai, bi];
|
|
301526
|
+
}
|
|
301527
|
+
begs = [];
|
|
301528
|
+
left2 = str.length;
|
|
301529
|
+
while (i3 >= 0 && !result) {
|
|
301530
|
+
if (i3 === ai) {
|
|
301531
|
+
begs.push(i3);
|
|
301532
|
+
ai = str.indexOf(a2, i3 + 1);
|
|
301533
|
+
} else if (begs.length === 1) {
|
|
301534
|
+
const r2 = begs.pop();
|
|
301535
|
+
if (r2 !== void 0)
|
|
301536
|
+
result = [r2, bi];
|
|
301537
|
+
} else {
|
|
301538
|
+
beg = begs.pop();
|
|
301539
|
+
if (beg !== void 0 && beg < left2) {
|
|
301540
|
+
left2 = beg;
|
|
301541
|
+
right2 = bi;
|
|
301542
|
+
}
|
|
301543
|
+
bi = str.indexOf(b, i3 + 1);
|
|
301544
|
+
}
|
|
301545
|
+
i3 = ai < bi && ai >= 0 ? ai : bi;
|
|
301546
|
+
}
|
|
301547
|
+
if (begs.length && right2 !== void 0) {
|
|
301548
|
+
result = [left2, right2];
|
|
301549
|
+
}
|
|
301550
|
+
}
|
|
301551
|
+
return result;
|
|
301552
|
+
};
|
|
301553
|
+
|
|
301554
|
+
// node_modules/@isaacs/brace-expansion/dist/esm/index.js
|
|
301555
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
301556
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
301557
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
301558
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
301559
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
301560
|
+
var escSlashPattern = new RegExp(escSlash, "g");
|
|
301561
|
+
var escOpenPattern = new RegExp(escOpen, "g");
|
|
301562
|
+
var escClosePattern = new RegExp(escClose, "g");
|
|
301563
|
+
var escCommaPattern = new RegExp(escComma, "g");
|
|
301564
|
+
var escPeriodPattern = new RegExp(escPeriod, "g");
|
|
301565
|
+
var slashPattern = /\\\\/g;
|
|
301566
|
+
var openPattern = /\\{/g;
|
|
301567
|
+
var closePattern = /\\}/g;
|
|
301568
|
+
var commaPattern = /\\,/g;
|
|
301569
|
+
var periodPattern = /\\./g;
|
|
301570
|
+
function numeric(str) {
|
|
301571
|
+
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
301572
|
+
}
|
|
301573
|
+
function escapeBraces(str) {
|
|
301574
|
+
return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
|
|
301575
|
+
}
|
|
301576
|
+
function unescapeBraces(str) {
|
|
301577
|
+
return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
|
|
301578
|
+
}
|
|
301579
|
+
function parseCommaParts(str) {
|
|
301580
|
+
if (!str) {
|
|
301581
|
+
return [""];
|
|
301582
|
+
}
|
|
301583
|
+
const parts2 = [];
|
|
301584
|
+
const m = balanced("{", "}", str);
|
|
301585
|
+
if (!m) {
|
|
301586
|
+
return str.split(",");
|
|
301587
|
+
}
|
|
301588
|
+
const { pre, body: body2, post } = m;
|
|
301589
|
+
const p = pre.split(",");
|
|
301590
|
+
p[p.length - 1] += "{" + body2 + "}";
|
|
301591
|
+
const postParts = parseCommaParts(post);
|
|
301592
|
+
if (post.length) {
|
|
301593
|
+
;
|
|
301594
|
+
p[p.length - 1] += postParts.shift();
|
|
301595
|
+
p.push.apply(p, postParts);
|
|
301596
|
+
}
|
|
301597
|
+
parts2.push.apply(parts2, p);
|
|
301598
|
+
return parts2;
|
|
301599
|
+
}
|
|
301600
|
+
function expand(str) {
|
|
301601
|
+
if (!str) {
|
|
301602
|
+
return [];
|
|
301603
|
+
}
|
|
301604
|
+
if (str.slice(0, 2) === "{}") {
|
|
301605
|
+
str = "\\{\\}" + str.slice(2);
|
|
301606
|
+
}
|
|
301607
|
+
return expand_(escapeBraces(str), true).map(unescapeBraces);
|
|
301608
|
+
}
|
|
301609
|
+
function embrace(str) {
|
|
301610
|
+
return "{" + str + "}";
|
|
301611
|
+
}
|
|
301612
|
+
function isPadded(el) {
|
|
301613
|
+
return /^-?0\d/.test(el);
|
|
301614
|
+
}
|
|
301615
|
+
function lte(i3, y) {
|
|
301616
|
+
return i3 <= y;
|
|
301617
|
+
}
|
|
301618
|
+
function gte(i3, y) {
|
|
301619
|
+
return i3 >= y;
|
|
301620
|
+
}
|
|
301621
|
+
function expand_(str, isTop) {
|
|
301622
|
+
const expansions = [];
|
|
301623
|
+
const m = balanced("{", "}", str);
|
|
301624
|
+
if (!m)
|
|
301625
|
+
return [str];
|
|
301626
|
+
const pre = m.pre;
|
|
301627
|
+
const post = m.post.length ? expand_(m.post, false) : [""];
|
|
301628
|
+
if (/\$$/.test(m.pre)) {
|
|
301629
|
+
for (let k = 0; k < post.length; k++) {
|
|
301630
|
+
const expansion = pre + "{" + m.body + "}" + post[k];
|
|
301631
|
+
expansions.push(expansion);
|
|
301632
|
+
}
|
|
301633
|
+
} else {
|
|
301634
|
+
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
301635
|
+
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
301636
|
+
const isSequence = isNumericSequence || isAlphaSequence;
|
|
301637
|
+
const isOptions = m.body.indexOf(",") >= 0;
|
|
301638
|
+
if (!isSequence && !isOptions) {
|
|
301639
|
+
if (m.post.match(/,(?!,).*\}/)) {
|
|
301640
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
301641
|
+
return expand_(str);
|
|
301642
|
+
}
|
|
301643
|
+
return [str];
|
|
301644
|
+
}
|
|
301645
|
+
let n3;
|
|
301646
|
+
if (isSequence) {
|
|
301647
|
+
n3 = m.body.split(/\.\./);
|
|
301648
|
+
} else {
|
|
301649
|
+
n3 = parseCommaParts(m.body);
|
|
301650
|
+
if (n3.length === 1 && n3[0] !== void 0) {
|
|
301651
|
+
n3 = expand_(n3[0], false).map(embrace);
|
|
301652
|
+
if (n3.length === 1) {
|
|
301653
|
+
return post.map((p) => m.pre + n3[0] + p);
|
|
301654
|
+
}
|
|
301655
|
+
}
|
|
301656
|
+
}
|
|
301657
|
+
let N;
|
|
301658
|
+
if (isSequence && n3[0] !== void 0 && n3[1] !== void 0) {
|
|
301659
|
+
const x = numeric(n3[0]);
|
|
301660
|
+
const y = numeric(n3[1]);
|
|
301661
|
+
const width = Math.max(n3[0].length, n3[1].length);
|
|
301662
|
+
let incr = n3.length === 3 && n3[2] !== void 0 ? Math.abs(numeric(n3[2])) : 1;
|
|
301663
|
+
let test = lte;
|
|
301664
|
+
const reverse = y < x;
|
|
301665
|
+
if (reverse) {
|
|
301666
|
+
incr *= -1;
|
|
301667
|
+
test = gte;
|
|
301668
|
+
}
|
|
301669
|
+
const pad = n3.some(isPadded);
|
|
301670
|
+
N = [];
|
|
301671
|
+
for (let i3 = x; test(i3, y); i3 += incr) {
|
|
301672
|
+
let c4;
|
|
301673
|
+
if (isAlphaSequence) {
|
|
301674
|
+
c4 = String.fromCharCode(i3);
|
|
301675
|
+
if (c4 === "\\") {
|
|
301676
|
+
c4 = "";
|
|
301677
|
+
}
|
|
301678
|
+
} else {
|
|
301679
|
+
c4 = String(i3);
|
|
301680
|
+
if (pad) {
|
|
301681
|
+
const need = width - c4.length;
|
|
301682
|
+
if (need > 0) {
|
|
301683
|
+
const z = new Array(need + 1).join("0");
|
|
301684
|
+
if (i3 < 0) {
|
|
301685
|
+
c4 = "-" + z + c4.slice(1);
|
|
301686
|
+
} else {
|
|
301687
|
+
c4 = z + c4;
|
|
301688
|
+
}
|
|
301689
|
+
}
|
|
301690
|
+
}
|
|
301691
|
+
}
|
|
301692
|
+
N.push(c4);
|
|
301693
|
+
}
|
|
301694
|
+
} else {
|
|
301695
|
+
N = [];
|
|
301696
|
+
for (let j = 0; j < n3.length; j++) {
|
|
301697
|
+
N.push.apply(N, expand_(n3[j], false));
|
|
301698
|
+
}
|
|
301699
|
+
}
|
|
301700
|
+
for (let j = 0; j < N.length; j++) {
|
|
301701
|
+
for (let k = 0; k < post.length; k++) {
|
|
301702
|
+
const expansion = pre + N[j] + post[k];
|
|
301703
|
+
if (!isTop || isSequence || expansion) {
|
|
301704
|
+
expansions.push(expansion);
|
|
301705
|
+
}
|
|
301706
|
+
}
|
|
301707
|
+
}
|
|
301708
|
+
}
|
|
301709
|
+
return expansions;
|
|
301710
|
+
}
|
|
301721
301711
|
|
|
301722
301712
|
// node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
301723
301713
|
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
@@ -301840,8 +301830,11 @@ var parseClass = (glob2, position) => {
|
|
|
301840
301830
|
};
|
|
301841
301831
|
|
|
301842
301832
|
// node_modules/glob/node_modules/minimatch/dist/esm/unescape.js
|
|
301843
|
-
var unescape2 = (s2, { windowsPathsNoEscape = false } = {}) => {
|
|
301844
|
-
|
|
301833
|
+
var unescape2 = (s2, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
|
|
301834
|
+
if (magicalBraces) {
|
|
301835
|
+
return windowsPathsNoEscape ? s2.replace(/\[([^\/\\])\]/g, "$1") : s2.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
301836
|
+
}
|
|
301837
|
+
return windowsPathsNoEscape ? s2.replace(/\[([^\/\\{}])\]/g, "$1") : s2.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
301845
301838
|
};
|
|
301846
301839
|
|
|
301847
301840
|
// node_modules/glob/node_modules/minimatch/dist/esm/ast.js
|
|
@@ -302195,7 +302188,7 @@ var AST = class _AST {
|
|
|
302195
302188
|
if (this.#root === this)
|
|
302196
302189
|
this.#fillNegs();
|
|
302197
302190
|
if (!this.type) {
|
|
302198
|
-
const noEmpty = this.isStart() && this.isEnd();
|
|
302191
|
+
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s2) => typeof s2 !== "string");
|
|
302199
302192
|
const src = this.#parts.map((p) => {
|
|
302200
302193
|
const [re2, _, hasMagic2, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
|
302201
302194
|
this.#hasMagic = this.#hasMagic || hasMagic2;
|
|
@@ -302305,10 +302298,7 @@ var AST = class _AST {
|
|
|
302305
302298
|
}
|
|
302306
302299
|
}
|
|
302307
302300
|
if (c4 === "*") {
|
|
302308
|
-
|
|
302309
|
-
re2 += starNoEmpty;
|
|
302310
|
-
else
|
|
302311
|
-
re2 += star;
|
|
302301
|
+
re2 += noEmpty && glob2 === "*" ? starNoEmpty : star;
|
|
302312
302302
|
hasMagic2 = true;
|
|
302313
302303
|
continue;
|
|
302314
302304
|
}
|
|
@@ -302324,7 +302314,10 @@ var AST = class _AST {
|
|
|
302324
302314
|
};
|
|
302325
302315
|
|
|
302326
302316
|
// node_modules/glob/node_modules/minimatch/dist/esm/escape.js
|
|
302327
|
-
var escape2 = (s2, { windowsPathsNoEscape = false } = {}) => {
|
|
302317
|
+
var escape2 = (s2, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
|
|
302318
|
+
if (magicalBraces) {
|
|
302319
|
+
return windowsPathsNoEscape ? s2.replace(/[?*()[\]{}]/g, "[$&]") : s2.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
302320
|
+
}
|
|
302328
302321
|
return windowsPathsNoEscape ? s2.replace(/[?*()[\]]/g, "[$&]") : s2.replace(/[?*()[\]\\]/g, "\\$&");
|
|
302329
302322
|
};
|
|
302330
302323
|
|
|
@@ -302444,7 +302437,7 @@ var braceExpand = (pattern, options2 = {}) => {
|
|
|
302444
302437
|
if (options2.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
302445
302438
|
return [pattern];
|
|
302446
302439
|
}
|
|
302447
|
-
return (
|
|
302440
|
+
return expand(pattern);
|
|
302448
302441
|
};
|
|
302449
302442
|
minimatch.braceExpand = braceExpand;
|
|
302450
302443
|
var makeRe = (pattern, options2 = {}) => new Minimatch(pattern, options2).makeRe();
|
|
@@ -302965,16 +302958,27 @@ var Minimatch = class {
|
|
|
302965
302958
|
pp[i3] = twoStar;
|
|
302966
302959
|
}
|
|
302967
302960
|
} else if (next === void 0) {
|
|
302968
|
-
pp[i3 - 1] = prev + "(
|
|
302961
|
+
pp[i3 - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
|
|
302969
302962
|
} else if (next !== GLOBSTAR) {
|
|
302970
302963
|
pp[i3 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
302971
302964
|
pp[i3 + 1] = GLOBSTAR;
|
|
302972
302965
|
}
|
|
302973
302966
|
});
|
|
302974
|
-
|
|
302967
|
+
const filtered = pp.filter((p) => p !== GLOBSTAR);
|
|
302968
|
+
if (this.partial && filtered.length >= 1) {
|
|
302969
|
+
const prefixes = [];
|
|
302970
|
+
for (let i3 = 1; i3 <= filtered.length; i3++) {
|
|
302971
|
+
prefixes.push(filtered.slice(0, i3).join("/"));
|
|
302972
|
+
}
|
|
302973
|
+
return "(?:" + prefixes.join("|") + ")";
|
|
302974
|
+
}
|
|
302975
|
+
return filtered.join("/");
|
|
302975
302976
|
}).join("|");
|
|
302976
302977
|
const [open3, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
302977
302978
|
re2 = "^" + open3 + re2 + close + "$";
|
|
302979
|
+
if (this.partial) {
|
|
302980
|
+
re2 = "^(?:\\/|" + open3 + re2.slice(1, -1) + close + ")$";
|
|
302981
|
+
}
|
|
302978
302982
|
if (this.negate)
|
|
302979
302983
|
re2 = "^(?!" + re2 + ").+$";
|
|
302980
302984
|
try {
|
|
@@ -303049,8 +303053,8 @@ minimatch.unescape = unescape2;
|
|
|
303049
303053
|
// node_modules/glob/dist/esm/glob.js
|
|
303050
303054
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
303051
303055
|
|
|
303052
|
-
// node_modules/lru-cache/dist/esm/index.js
|
|
303053
|
-
var
|
|
303056
|
+
// node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js
|
|
303057
|
+
var defaultPerf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
303054
303058
|
var warned = /* @__PURE__ */ new Set();
|
|
303055
303059
|
var PROCESS3 = typeof process === "object" && !!process ? process : {};
|
|
303056
303060
|
var emitWarning = (msg, type, code2, fn) => {
|
|
@@ -303135,9 +303139,17 @@ var LRUCache = class _LRUCache {
|
|
|
303135
303139
|
#max;
|
|
303136
303140
|
#maxSize;
|
|
303137
303141
|
#dispose;
|
|
303142
|
+
#onInsert;
|
|
303138
303143
|
#disposeAfter;
|
|
303139
303144
|
#fetchMethod;
|
|
303140
303145
|
#memoMethod;
|
|
303146
|
+
#perf;
|
|
303147
|
+
/**
|
|
303148
|
+
* {@link LRUCache.OptionsBase.perf}
|
|
303149
|
+
*/
|
|
303150
|
+
get perf() {
|
|
303151
|
+
return this.#perf;
|
|
303152
|
+
}
|
|
303141
303153
|
/**
|
|
303142
303154
|
* {@link LRUCache.OptionsBase.ttl}
|
|
303143
303155
|
*/
|
|
@@ -303216,6 +303228,7 @@ var LRUCache = class _LRUCache {
|
|
|
303216
303228
|
#hasDispose;
|
|
303217
303229
|
#hasFetchMethod;
|
|
303218
303230
|
#hasDisposeAfter;
|
|
303231
|
+
#hasOnInsert;
|
|
303219
303232
|
/**
|
|
303220
303233
|
* Do not call this method unless you need to inspect the
|
|
303221
303234
|
* inner workings of the cache. If anything returned by this
|
|
@@ -303292,6 +303305,12 @@ var LRUCache = class _LRUCache {
|
|
|
303292
303305
|
get dispose() {
|
|
303293
303306
|
return this.#dispose;
|
|
303294
303307
|
}
|
|
303308
|
+
/**
|
|
303309
|
+
* {@link LRUCache.OptionsBase.onInsert} (read-only)
|
|
303310
|
+
*/
|
|
303311
|
+
get onInsert() {
|
|
303312
|
+
return this.#onInsert;
|
|
303313
|
+
}
|
|
303295
303314
|
/**
|
|
303296
303315
|
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
|
|
303297
303316
|
*/
|
|
@@ -303299,7 +303318,13 @@ var LRUCache = class _LRUCache {
|
|
|
303299
303318
|
return this.#disposeAfter;
|
|
303300
303319
|
}
|
|
303301
303320
|
constructor(options2) {
|
|
303302
|
-
const { max = 0, ttl: ttl2, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options2;
|
|
303321
|
+
const { max = 0, ttl: ttl2, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, perf } = options2;
|
|
303322
|
+
if (perf !== void 0) {
|
|
303323
|
+
if (typeof perf?.now !== "function") {
|
|
303324
|
+
throw new TypeError("perf option must have a now() method if specified");
|
|
303325
|
+
}
|
|
303326
|
+
}
|
|
303327
|
+
this.#perf = perf ?? defaultPerf;
|
|
303303
303328
|
if (max !== 0 && !isPosInt(max)) {
|
|
303304
303329
|
throw new TypeError("max option must be a nonnegative integer");
|
|
303305
303330
|
}
|
|
@@ -303341,6 +303366,9 @@ var LRUCache = class _LRUCache {
|
|
|
303341
303366
|
if (typeof dispose === "function") {
|
|
303342
303367
|
this.#dispose = dispose;
|
|
303343
303368
|
}
|
|
303369
|
+
if (typeof onInsert === "function") {
|
|
303370
|
+
this.#onInsert = onInsert;
|
|
303371
|
+
}
|
|
303344
303372
|
if (typeof disposeAfter === "function") {
|
|
303345
303373
|
this.#disposeAfter = disposeAfter;
|
|
303346
303374
|
this.#disposed = [];
|
|
@@ -303349,6 +303377,7 @@ var LRUCache = class _LRUCache {
|
|
|
303349
303377
|
this.#disposed = void 0;
|
|
303350
303378
|
}
|
|
303351
303379
|
this.#hasDispose = !!this.#dispose;
|
|
303380
|
+
this.#hasOnInsert = !!this.#onInsert;
|
|
303352
303381
|
this.#hasDisposeAfter = !!this.#disposeAfter;
|
|
303353
303382
|
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
303354
303383
|
this.noUpdateTTL = !!noUpdateTTL;
|
|
@@ -303404,7 +303433,7 @@ var LRUCache = class _LRUCache {
|
|
|
303404
303433
|
const starts = new ZeroArray(this.#max);
|
|
303405
303434
|
this.#ttls = ttls;
|
|
303406
303435
|
this.#starts = starts;
|
|
303407
|
-
this.#setItemTTL = (index, ttl2, start2 = perf.now()) => {
|
|
303436
|
+
this.#setItemTTL = (index, ttl2, start2 = this.#perf.now()) => {
|
|
303408
303437
|
starts[index] = ttl2 !== 0 ? start2 : 0;
|
|
303409
303438
|
ttls[index] = ttl2;
|
|
303410
303439
|
if (ttl2 !== 0 && this.ttlAutopurge) {
|
|
@@ -303419,7 +303448,7 @@ var LRUCache = class _LRUCache {
|
|
|
303419
303448
|
}
|
|
303420
303449
|
};
|
|
303421
303450
|
this.#updateItemAge = (index) => {
|
|
303422
|
-
starts[index] = ttls[index] !== 0 ? perf.now() : 0;
|
|
303451
|
+
starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0;
|
|
303423
303452
|
};
|
|
303424
303453
|
this.#statusTTL = (status, index) => {
|
|
303425
303454
|
if (ttls[index]) {
|
|
@@ -303436,7 +303465,7 @@ var LRUCache = class _LRUCache {
|
|
|
303436
303465
|
};
|
|
303437
303466
|
let cachedNow = 0;
|
|
303438
303467
|
const getNow = () => {
|
|
303439
|
-
const n3 = perf.now();
|
|
303468
|
+
const n3 = this.#perf.now();
|
|
303440
303469
|
if (this.ttlResolution > 0) {
|
|
303441
303470
|
cachedNow = n3;
|
|
303442
303471
|
const t2 = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
|
@@ -303739,7 +303768,7 @@ var LRUCache = class _LRUCache {
|
|
|
303739
303768
|
const ttl2 = this.#ttls[i3];
|
|
303740
303769
|
const start2 = this.#starts[i3];
|
|
303741
303770
|
if (ttl2 && start2) {
|
|
303742
|
-
const remain = ttl2 - (perf.now() - start2);
|
|
303771
|
+
const remain = ttl2 - (this.#perf.now() - start2);
|
|
303743
303772
|
entry.ttl = remain;
|
|
303744
303773
|
entry.start = Date.now();
|
|
303745
303774
|
}
|
|
@@ -303751,7 +303780,7 @@ var LRUCache = class _LRUCache {
|
|
|
303751
303780
|
}
|
|
303752
303781
|
/**
|
|
303753
303782
|
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
303754
|
-
* passed to {@link
|
|
303783
|
+
* passed to {@link LRUCache#load}.
|
|
303755
303784
|
*
|
|
303756
303785
|
* The `start` fields are calculated relative to a portable `Date.now()`
|
|
303757
303786
|
* timestamp, even if `performance.now()` is available.
|
|
@@ -303773,7 +303802,7 @@ var LRUCache = class _LRUCache {
|
|
|
303773
303802
|
const entry = { value };
|
|
303774
303803
|
if (this.#ttls && this.#starts) {
|
|
303775
303804
|
entry.ttl = this.#ttls[i3];
|
|
303776
|
-
const age = perf.now() - this.#starts[i3];
|
|
303805
|
+
const age = this.#perf.now() - this.#starts[i3];
|
|
303777
303806
|
entry.start = Math.floor(Date.now() - age);
|
|
303778
303807
|
}
|
|
303779
303808
|
if (this.#sizes) {
|
|
@@ -303797,7 +303826,7 @@ var LRUCache = class _LRUCache {
|
|
|
303797
303826
|
for (const [key, entry] of arr) {
|
|
303798
303827
|
if (entry.start) {
|
|
303799
303828
|
const age = Date.now() - entry.start;
|
|
303800
|
-
entry.start = perf.now() - age;
|
|
303829
|
+
entry.start = this.#perf.now() - age;
|
|
303801
303830
|
}
|
|
303802
303831
|
this.set(key, entry.value, entry);
|
|
303803
303832
|
}
|
|
@@ -303862,6 +303891,9 @@ var LRUCache = class _LRUCache {
|
|
|
303862
303891
|
if (status)
|
|
303863
303892
|
status.set = "add";
|
|
303864
303893
|
noUpdateTTL = false;
|
|
303894
|
+
if (this.#hasOnInsert) {
|
|
303895
|
+
this.#onInsert?.(v, k, "add");
|
|
303896
|
+
}
|
|
303865
303897
|
} else {
|
|
303866
303898
|
this.#moveToTail(index);
|
|
303867
303899
|
const oldVal = this.#valList[index];
|
|
@@ -303897,6 +303929,9 @@ var LRUCache = class _LRUCache {
|
|
|
303897
303929
|
} else if (status) {
|
|
303898
303930
|
status.set = "update";
|
|
303899
303931
|
}
|
|
303932
|
+
if (this.#hasOnInsert) {
|
|
303933
|
+
this.onInsert?.(v, k, v === oldVal ? "update" : "replace");
|
|
303934
|
+
}
|
|
303900
303935
|
}
|
|
303901
303936
|
if (ttl2 !== 0 && !this.#ttls) {
|
|
303902
303937
|
this.#initializeTTLTracking();
|
|
@@ -304064,9 +304099,10 @@ var LRUCache = class _LRUCache {
|
|
|
304064
304099
|
return fetchFail(ac.signal.reason);
|
|
304065
304100
|
}
|
|
304066
304101
|
const bf2 = p;
|
|
304067
|
-
|
|
304102
|
+
const vl = this.#valList[index];
|
|
304103
|
+
if (vl === p || ignoreAbort && updateCache && vl === void 0) {
|
|
304068
304104
|
if (v2 === void 0) {
|
|
304069
|
-
if (bf2.__staleWhileFetching) {
|
|
304105
|
+
if (bf2.__staleWhileFetching !== void 0) {
|
|
304070
304106
|
this.#valList[index] = bf2.__staleWhileFetching;
|
|
304071
304107
|
} else {
|
|
304072
304108
|
this.#delete(k, "fetch");
|
|
@@ -304468,7 +304504,7 @@ var ENOREALPATH = 512;
|
|
|
304468
304504
|
var ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
|
|
304469
304505
|
var TYPEMASK = 1023;
|
|
304470
304506
|
var entToType = (s2) => s2.isFile() ? IFREG : s2.isDirectory() ? IFDIR : s2.isSymbolicLink() ? IFLNK : s2.isCharacterDevice() ? IFCHR : s2.isBlockDevice() ? IFBLK : s2.isSocket() ? IFSOCK : s2.isFIFO() ? IFIFO : UNKNOWN;
|
|
304471
|
-
var normalizeCache2 =
|
|
304507
|
+
var normalizeCache2 = new LRUCache({ max: 2 ** 12 });
|
|
304472
304508
|
var normalize2 = (s2) => {
|
|
304473
304509
|
const c4 = normalizeCache2.get(s2);
|
|
304474
304510
|
if (c4)
|
|
@@ -304477,7 +304513,7 @@ var normalize2 = (s2) => {
|
|
|
304477
304513
|
normalizeCache2.set(s2, n3);
|
|
304478
304514
|
return n3;
|
|
304479
304515
|
};
|
|
304480
|
-
var normalizeNocaseCache =
|
|
304516
|
+
var normalizeNocaseCache = new LRUCache({ max: 2 ** 12 });
|
|
304481
304517
|
var normalizeNocase = (s2) => {
|
|
304482
304518
|
const c4 = normalizeNocaseCache.get(s2);
|
|
304483
304519
|
if (c4)
|
|
@@ -304634,13 +304670,17 @@ var PathBase = class {
|
|
|
304634
304670
|
get parentPath() {
|
|
304635
304671
|
return (this.parent || this).fullpath();
|
|
304636
304672
|
}
|
|
304673
|
+
/* c8 ignore start */
|
|
304637
304674
|
/**
|
|
304638
304675
|
* Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
|
|
304639
304676
|
* this property refers to the *parent* path, not the path object itself.
|
|
304677
|
+
*
|
|
304678
|
+
* @deprecated
|
|
304640
304679
|
*/
|
|
304641
304680
|
get path() {
|
|
304642
304681
|
return this.parentPath;
|
|
304643
304682
|
}
|
|
304683
|
+
/* c8 ignore stop */
|
|
304644
304684
|
/**
|
|
304645
304685
|
* Do not create new Path objects directly. They should always be accessed
|
|
304646
304686
|
* via the PathScurry class or other methods on the Path class.
|
|
@@ -314954,14 +314994,14 @@ function isHtmlElement(value) {
|
|
|
314954
314994
|
function isInfinite(value) {
|
|
314955
314995
|
return value === Number.POSITIVE_INFINITY || value === Number.NEGATIVE_INFINITY;
|
|
314956
314996
|
}
|
|
314957
|
-
function isInRange(value,
|
|
314958
|
-
if (isNumber(
|
|
314959
|
-
return value >= Math.min(0,
|
|
314997
|
+
function isInRange(value, range2) {
|
|
314998
|
+
if (isNumber(range2)) {
|
|
314999
|
+
return value >= Math.min(0, range2) && value <= Math.max(range2, 0);
|
|
314960
315000
|
}
|
|
314961
|
-
if (isArray(
|
|
314962
|
-
return value >= Math.min(...
|
|
315001
|
+
if (isArray(range2) && range2.length === 2) {
|
|
315002
|
+
return value >= Math.min(...range2) && value <= Math.max(...range2);
|
|
314963
315003
|
}
|
|
314964
|
-
throw new TypeError(`Invalid range: ${JSON.stringify(
|
|
315004
|
+
throw new TypeError(`Invalid range: ${JSON.stringify(range2)}`);
|
|
314965
315005
|
}
|
|
314966
315006
|
function isInt16Array(value) {
|
|
314967
315007
|
return getObjectType(value) === "Int16Array";
|
|
@@ -315549,8 +315589,8 @@ function assertInfinite(value, message) {
|
|
|
315549
315589
|
throw new TypeError(message ?? typeErrorMessage("infinite number", value));
|
|
315550
315590
|
}
|
|
315551
315591
|
}
|
|
315552
|
-
function assertInRange(value,
|
|
315553
|
-
if (!isInRange(value,
|
|
315592
|
+
function assertInRange(value, range2, message) {
|
|
315593
|
+
if (!isInRange(value, range2)) {
|
|
315554
315594
|
throw new TypeError(message ?? typeErrorMessage("in range", value));
|
|
315555
315595
|
}
|
|
315556
315596
|
}
|
|
@@ -328897,9 +328937,10 @@ var IdeClient = class _IdeClient {
|
|
|
328897
328937
|
removeTrustChangeListener(listener) {
|
|
328898
328938
|
this.trustChangeListeners.delete(listener);
|
|
328899
328939
|
}
|
|
328900
|
-
async connect() {
|
|
328940
|
+
async connect(options2 = {}) {
|
|
328941
|
+
const logError2 = options2.logToConsole ?? true;
|
|
328901
328942
|
if (!this.currentIde) {
|
|
328902
|
-
this.setState(IDEConnectionStatus.Disconnected, `IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: VS Code or VS Code forks
|
|
328943
|
+
this.setState(IDEConnectionStatus.Disconnected, `IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: Antigravity, VS Code, or VS Code forks.`, false);
|
|
328903
328944
|
return;
|
|
328904
328945
|
}
|
|
328905
328946
|
this.setState(IDEConnectionStatus.Connecting);
|
|
@@ -328910,7 +328951,7 @@ var IdeClient = class _IdeClient {
|
|
|
328910
328951
|
const workspacePath = this.connectionConfig?.workspacePath ?? process.env["GEMINI_CLI_IDE_WORKSPACE_PATH"];
|
|
328911
328952
|
const { isValid: isValid2, error } = _IdeClient.validateWorkspacePath(workspacePath, process.cwd());
|
|
328912
328953
|
if (!isValid2) {
|
|
328913
|
-
this.setState(IDEConnectionStatus.Disconnected, error,
|
|
328954
|
+
this.setState(IDEConnectionStatus.Disconnected, error, logError2);
|
|
328914
328955
|
return;
|
|
328915
328956
|
}
|
|
328916
328957
|
if (this.connectionConfig) {
|
|
@@ -328941,7 +328982,7 @@ var IdeClient = class _IdeClient {
|
|
|
328941
328982
|
return;
|
|
328942
328983
|
}
|
|
328943
328984
|
}
|
|
328944
|
-
this.setState(IDEConnectionStatus.Disconnected, `Failed to connect to IDE companion extension in ${this.currentIde.displayName}. Please ensure the extension is running. To install the extension, run /ide install.`,
|
|
328985
|
+
this.setState(IDEConnectionStatus.Disconnected, `Failed to connect to IDE companion extension in ${this.currentIde.displayName}. Please ensure the extension is running. To install the extension, run /ide install.`, logError2);
|
|
328945
328986
|
}
|
|
328946
328987
|
/**
|
|
328947
328988
|
* Opens a diff view in the IDE, allowing the user to review and accept or
|
|
@@ -329812,7 +329853,8 @@ function isValidEditorType(editor) {
|
|
|
329812
329853
|
"vim",
|
|
329813
329854
|
"neovim",
|
|
329814
329855
|
"zed",
|
|
329815
|
-
"emacs"
|
|
329856
|
+
"emacs",
|
|
329857
|
+
"antigravity"
|
|
329816
329858
|
].includes(editor);
|
|
329817
329859
|
}
|
|
329818
329860
|
function commandExists(cmd) {
|
|
@@ -329831,7 +329873,8 @@ var editorCommands = {
|
|
|
329831
329873
|
vim: { win32: ["vim"], default: ["vim"] },
|
|
329832
329874
|
neovim: { win32: ["nvim"], default: ["nvim"] },
|
|
329833
329875
|
zed: { win32: ["zed"], default: ["zed", "zeditor"] },
|
|
329834
|
-
emacs: { win32: ["emacs.exe"], default: ["emacs"] }
|
|
329876
|
+
emacs: { win32: ["emacs.exe"], default: ["emacs"] },
|
|
329877
|
+
antigravity: { win32: ["agy.cmd"], default: ["agy"] }
|
|
329835
329878
|
};
|
|
329836
329879
|
function getDiffCommand(oldPath, newPath, editor) {
|
|
329837
329880
|
if (!isValidEditorType(editor)) {
|
|
@@ -329846,6 +329889,7 @@ function getDiffCommand(oldPath, newPath, editor) {
|
|
|
329846
329889
|
case "windsurf":
|
|
329847
329890
|
case "cursor":
|
|
329848
329891
|
case "zed":
|
|
329892
|
+
case "antigravity":
|
|
329849
329893
|
return { command, args: ["--wait", "--diff", oldPath, newPath] };
|
|
329850
329894
|
case "vim":
|
|
329851
329895
|
case "neovim":
|
|
@@ -330241,13 +330285,39 @@ function fromApiError(errorObj) {
|
|
|
330241
330285
|
return outerError;
|
|
330242
330286
|
}
|
|
330243
330287
|
|
|
330288
|
+
// packages/core/dist/src/utils/httpErrors.js
|
|
330289
|
+
function getErrorStatus(error) {
|
|
330290
|
+
if (typeof error === "object" && error !== null) {
|
|
330291
|
+
if ("status" in error && typeof error.status === "number") {
|
|
330292
|
+
return error.status;
|
|
330293
|
+
}
|
|
330294
|
+
if ("response" in error && typeof error.response === "object" && error.response !== null) {
|
|
330295
|
+
const response = error.response;
|
|
330296
|
+
if ("status" in response && typeof response.status === "number") {
|
|
330297
|
+
return response.status;
|
|
330298
|
+
}
|
|
330299
|
+
}
|
|
330300
|
+
}
|
|
330301
|
+
return void 0;
|
|
330302
|
+
}
|
|
330303
|
+
var ModelNotFoundError = class extends Error {
|
|
330304
|
+
code;
|
|
330305
|
+
constructor(message, code2) {
|
|
330306
|
+
super(message);
|
|
330307
|
+
this.name = "ModelNotFoundError";
|
|
330308
|
+
this.code = code2 ? code2 : 404;
|
|
330309
|
+
}
|
|
330310
|
+
};
|
|
330311
|
+
|
|
330244
330312
|
// packages/core/dist/src/utils/googleQuotaErrors.js
|
|
330245
330313
|
var TerminalQuotaError = class extends Error {
|
|
330246
330314
|
cause;
|
|
330247
|
-
|
|
330315
|
+
retryDelayMs;
|
|
330316
|
+
constructor(message, cause, retryDelayMs) {
|
|
330248
330317
|
super(message);
|
|
330249
330318
|
this.cause = cause;
|
|
330250
330319
|
this.name = "TerminalQuotaError";
|
|
330320
|
+
this.retryDelayMs = retryDelayMs ? retryDelayMs * 1e3 : void 0;
|
|
330251
330321
|
}
|
|
330252
330322
|
};
|
|
330253
330323
|
var RetryableQuotaError = class extends Error {
|
|
@@ -330273,6 +330343,11 @@ function parseDurationInSeconds(duration) {
|
|
|
330273
330343
|
}
|
|
330274
330344
|
function classifyGoogleError(error) {
|
|
330275
330345
|
const googleApiError = parseGoogleApiError(error);
|
|
330346
|
+
const status = googleApiError?.code ?? getErrorStatus(error);
|
|
330347
|
+
if (status === 404) {
|
|
330348
|
+
const message = googleApiError?.message || (error instanceof Error ? error.message : "Model not found");
|
|
330349
|
+
return new ModelNotFoundError(message, status);
|
|
330350
|
+
}
|
|
330276
330351
|
if (!googleApiError || googleApiError.code !== 429) {
|
|
330277
330352
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
330278
330353
|
const match2 = errorMessage.match(/Please retry in ([0-9.]+(?:ms|s))/);
|
|
@@ -330299,6 +330374,13 @@ function classifyGoogleError(error) {
|
|
|
330299
330374
|
}
|
|
330300
330375
|
}
|
|
330301
330376
|
}
|
|
330377
|
+
let delaySeconds;
|
|
330378
|
+
if (retryInfo?.retryDelay) {
|
|
330379
|
+
const parsedDelay = parseDurationInSeconds(retryInfo.retryDelay);
|
|
330380
|
+
if (parsedDelay) {
|
|
330381
|
+
delaySeconds = parsedDelay;
|
|
330382
|
+
}
|
|
330383
|
+
}
|
|
330302
330384
|
if (errorInfo) {
|
|
330303
330385
|
if (errorInfo.domain) {
|
|
330304
330386
|
const validDomains = [
|
|
@@ -330308,17 +330390,10 @@ function classifyGoogleError(error) {
|
|
|
330308
330390
|
];
|
|
330309
330391
|
if (validDomains.includes(errorInfo.domain)) {
|
|
330310
330392
|
if (errorInfo.reason === "RATE_LIMIT_EXCEEDED") {
|
|
330311
|
-
|
|
330312
|
-
if (retryInfo?.retryDelay) {
|
|
330313
|
-
const parsedDelay = parseDurationInSeconds(retryInfo.retryDelay);
|
|
330314
|
-
if (parsedDelay) {
|
|
330315
|
-
delaySeconds = parsedDelay;
|
|
330316
|
-
}
|
|
330317
|
-
}
|
|
330318
|
-
return new RetryableQuotaError(`${googleApiError.message}`, googleApiError, delaySeconds);
|
|
330393
|
+
return new RetryableQuotaError(`${googleApiError.message}`, googleApiError, delaySeconds ?? 10);
|
|
330319
330394
|
}
|
|
330320
330395
|
if (errorInfo.reason === "QUOTA_EXHAUSTED") {
|
|
330321
|
-
return new TerminalQuotaError(`${googleApiError.message}`, googleApiError);
|
|
330396
|
+
return new TerminalQuotaError(`${googleApiError.message}`, googleApiError, delaySeconds);
|
|
330322
330397
|
}
|
|
330323
330398
|
}
|
|
330324
330399
|
}
|
|
@@ -330328,11 +330403,10 @@ function classifyGoogleError(error) {
|
|
|
330328
330403
|
}
|
|
330329
330404
|
}
|
|
330330
330405
|
if (retryInfo?.retryDelay) {
|
|
330331
|
-
const delaySeconds = parseDurationInSeconds(retryInfo.retryDelay);
|
|
330332
330406
|
if (delaySeconds) {
|
|
330333
330407
|
if (delaySeconds > 120) {
|
|
330334
330408
|
return new TerminalQuotaError(`${googleApiError.message}
|
|
330335
|
-
Suggested retry after ${retryInfo.retryDelay}.`, googleApiError);
|
|
330409
|
+
Suggested retry after ${retryInfo.retryDelay}.`, googleApiError, delaySeconds);
|
|
330336
330410
|
}
|
|
330337
330411
|
return new RetryableQuotaError(`${googleApiError.message}
|
|
330338
330412
|
Suggested retry after ${retryInfo.retryDelay}.`, googleApiError, delaySeconds);
|
|
@@ -330442,7 +330516,8 @@ async function retryWithBackoff(fn, options2) {
|
|
|
330442
330516
|
throw error;
|
|
330443
330517
|
}
|
|
330444
330518
|
const classifiedError = classifyGoogleError(error);
|
|
330445
|
-
|
|
330519
|
+
const errorCode = getErrorStatus(error);
|
|
330520
|
+
if (classifiedError instanceof TerminalQuotaError || classifiedError instanceof ModelNotFoundError) {
|
|
330446
330521
|
if (onPersistent429 && authType === AuthType2.LOGIN_WITH_GOOGLE) {
|
|
330447
330522
|
try {
|
|
330448
330523
|
const fallbackModel = await onPersistent429(authType, classifiedError);
|
|
@@ -330457,7 +330532,8 @@ async function retryWithBackoff(fn, options2) {
|
|
|
330457
330532
|
}
|
|
330458
330533
|
throw classifiedError;
|
|
330459
330534
|
}
|
|
330460
|
-
|
|
330535
|
+
const is500 = errorCode !== void 0 && errorCode >= 500 && errorCode < 600;
|
|
330536
|
+
if (classifiedError instanceof RetryableQuotaError || is500) {
|
|
330461
330537
|
if (attempt >= maxAttempts) {
|
|
330462
330538
|
if (onPersistent429 && authType === AuthType2.LOGIN_WITH_GOOGLE) {
|
|
330463
330539
|
try {
|
|
@@ -330471,11 +330547,21 @@ async function retryWithBackoff(fn, options2) {
|
|
|
330471
330547
|
console.warn("Model fallback failed:", fallbackError);
|
|
330472
330548
|
}
|
|
330473
330549
|
}
|
|
330474
|
-
throw classifiedError;
|
|
330550
|
+
throw classifiedError instanceof RetryableQuotaError ? classifiedError : error;
|
|
330551
|
+
}
|
|
330552
|
+
if (classifiedError instanceof RetryableQuotaError) {
|
|
330553
|
+
console.warn(`Attempt ${attempt} failed: ${classifiedError.message}. Retrying after ${classifiedError.retryDelayMs}ms...`);
|
|
330554
|
+
await delay2(classifiedError.retryDelayMs, signal);
|
|
330555
|
+
continue;
|
|
330556
|
+
} else {
|
|
330557
|
+
const errorStatus2 = getErrorStatus(error);
|
|
330558
|
+
logRetryAttempt(attempt, error, errorStatus2);
|
|
330559
|
+
const jitter2 = currentDelay * 0.3 * (Math.random() * 2 - 1);
|
|
330560
|
+
const delayWithJitter2 = Math.max(0, currentDelay + jitter2);
|
|
330561
|
+
await delay2(delayWithJitter2, signal);
|
|
330562
|
+
currentDelay = Math.min(maxDelayMs, currentDelay * 2);
|
|
330563
|
+
continue;
|
|
330475
330564
|
}
|
|
330476
|
-
console.warn(`Attempt ${attempt} failed: ${classifiedError.message}. Retrying after ${classifiedError.retryDelayMs}ms...`);
|
|
330477
|
-
await delay2(classifiedError.retryDelayMs, signal);
|
|
330478
|
-
continue;
|
|
330479
330565
|
}
|
|
330480
330566
|
if (attempt >= maxAttempts || !shouldRetryOnError(error, retryFetchErrors)) {
|
|
330481
330567
|
throw error;
|
|
@@ -330490,20 +330576,6 @@ async function retryWithBackoff(fn, options2) {
|
|
|
330490
330576
|
}
|
|
330491
330577
|
throw new Error("Retry attempts exhausted");
|
|
330492
330578
|
}
|
|
330493
|
-
function getErrorStatus(error) {
|
|
330494
|
-
if (typeof error === "object" && error !== null) {
|
|
330495
|
-
if ("status" in error && typeof error.status === "number") {
|
|
330496
|
-
return error.status;
|
|
330497
|
-
}
|
|
330498
|
-
if ("response" in error && typeof error.response === "object" && error.response !== null) {
|
|
330499
|
-
const response = error.response;
|
|
330500
|
-
if ("status" in response && typeof response.status === "number") {
|
|
330501
|
-
return response.status;
|
|
330502
|
-
}
|
|
330503
|
-
}
|
|
330504
|
-
}
|
|
330505
|
-
return void 0;
|
|
330506
|
-
}
|
|
330507
330579
|
function logRetryAttempt(attempt, error, errorStatus) {
|
|
330508
330580
|
let message = `Attempt ${attempt} failed. Retrying with backoff...`;
|
|
330509
330581
|
if (errorStatus) {
|
|
@@ -332744,14 +332816,14 @@ function unmarshalPoint(address) {
|
|
|
332744
332816
|
return result;
|
|
332745
332817
|
}
|
|
332746
332818
|
__name(unmarshalPoint, "unmarshalPoint");
|
|
332747
|
-
function marshalRange(address,
|
|
332748
|
-
marshalPoint(address,
|
|
332819
|
+
function marshalRange(address, range2) {
|
|
332820
|
+
marshalPoint(address, range2.startPosition);
|
|
332749
332821
|
address += SIZE_OF_POINT;
|
|
332750
|
-
marshalPoint(address,
|
|
332822
|
+
marshalPoint(address, range2.endPosition);
|
|
332751
332823
|
address += SIZE_OF_POINT;
|
|
332752
|
-
C.setValue(address,
|
|
332824
|
+
C.setValue(address, range2.startIndex, "i32");
|
|
332753
332825
|
address += SIZE_OF_INT;
|
|
332754
|
-
C.setValue(address,
|
|
332826
|
+
C.setValue(address, range2.endIndex, "i32");
|
|
332755
332827
|
address += SIZE_OF_INT;
|
|
332756
332828
|
}
|
|
332757
332829
|
__name(marshalRange, "marshalRange");
|
|
@@ -337588,7 +337660,7 @@ var FetchError = class extends Error {
|
|
|
337588
337660
|
function isPrivateIp(url4) {
|
|
337589
337661
|
try {
|
|
337590
337662
|
const hostname2 = new URL6(url4).hostname;
|
|
337591
|
-
return PRIVATE_IP_RANGES.some((
|
|
337663
|
+
return PRIVATE_IP_RANGES.some((range2) => range2.test(hostname2));
|
|
337592
337664
|
} catch (_e) {
|
|
337593
337665
|
return false;
|
|
337594
337666
|
}
|
|
@@ -343169,20 +343241,46 @@ My setup is complete. I will provide my first command in the next turn.
|
|
|
343169
343241
|
}
|
|
343170
343242
|
|
|
343171
343243
|
// packages/core/dist/src/config/models.js
|
|
343244
|
+
var PREVIEW_GEMINI_MODEL = "gemini-3-pro-preview";
|
|
343172
343245
|
var DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
|
|
343173
343246
|
var DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
|
|
343247
|
+
var DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-2.5-flash-lite";
|
|
343174
343248
|
var DEFAULT_GEMINI_MODEL_AUTO = "auto";
|
|
343249
|
+
var GEMINI_MODEL_ALIAS_PRO = "pro";
|
|
343250
|
+
var GEMINI_MODEL_ALIAS_FLASH = "flash";
|
|
343251
|
+
var GEMINI_MODEL_ALIAS_FLASH_LITE = "flash-lite";
|
|
343175
343252
|
var DEFAULT_GEMINI_EMBEDDING_MODEL = "gemini-embedding-001";
|
|
343176
343253
|
var DEFAULT_THINKING_MODE = 8192;
|
|
343177
|
-
function
|
|
343254
|
+
function resolveModel(requestedModel, previewFeaturesEnabled) {
|
|
343255
|
+
switch (requestedModel) {
|
|
343256
|
+
case DEFAULT_GEMINI_MODEL_AUTO:
|
|
343257
|
+
case GEMINI_MODEL_ALIAS_PRO: {
|
|
343258
|
+
return previewFeaturesEnabled ? PREVIEW_GEMINI_MODEL : DEFAULT_GEMINI_MODEL;
|
|
343259
|
+
}
|
|
343260
|
+
case GEMINI_MODEL_ALIAS_FLASH: {
|
|
343261
|
+
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
343262
|
+
}
|
|
343263
|
+
case GEMINI_MODEL_ALIAS_FLASH_LITE: {
|
|
343264
|
+
return DEFAULT_GEMINI_FLASH_LITE_MODEL;
|
|
343265
|
+
}
|
|
343266
|
+
default: {
|
|
343267
|
+
return requestedModel;
|
|
343268
|
+
}
|
|
343269
|
+
}
|
|
343270
|
+
}
|
|
343271
|
+
function getEffectiveModel(isInFallbackMode, requestedModel, previewFeaturesEnabled) {
|
|
343272
|
+
const resolvedModel = resolveModel(requestedModel, previewFeaturesEnabled);
|
|
343178
343273
|
if (!isInFallbackMode) {
|
|
343179
|
-
return
|
|
343274
|
+
return resolvedModel;
|
|
343180
343275
|
}
|
|
343181
|
-
if (
|
|
343182
|
-
return
|
|
343276
|
+
if (resolvedModel.includes("lite")) {
|
|
343277
|
+
return resolvedModel;
|
|
343183
343278
|
}
|
|
343184
343279
|
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
343185
343280
|
}
|
|
343281
|
+
function isGemini2Model(model) {
|
|
343282
|
+
return /^gemini-2(\.|$)/.test(model);
|
|
343283
|
+
}
|
|
343186
343284
|
|
|
343187
343285
|
// packages/core/dist/src/utils/generateContentResponseUtilities.js
|
|
343188
343286
|
function getResponseTextFromParts(parts2) {
|
|
@@ -344232,25 +344330,131 @@ var ChatRecordingService = class {
|
|
|
344232
344330
|
|
|
344233
344331
|
// packages/core/dist/src/fallback/handler.js
|
|
344234
344332
|
init_events();
|
|
344333
|
+
|
|
344334
|
+
// packages/core/dist/src/utils/secure-browser-launcher.js
|
|
344335
|
+
import { execFile as execFile6 } from "node:child_process";
|
|
344336
|
+
import { promisify as promisify12 } from "node:util";
|
|
344337
|
+
import { platform as platform9 } from "node:os";
|
|
344338
|
+
import { URL as URL7 } from "node:url";
|
|
344339
|
+
var execFileAsync5 = promisify12(execFile6);
|
|
344340
|
+
function validateUrl(url4) {
|
|
344341
|
+
let parsedUrl;
|
|
344342
|
+
try {
|
|
344343
|
+
parsedUrl = new URL7(url4);
|
|
344344
|
+
} catch (_error) {
|
|
344345
|
+
throw new Error(`Invalid URL: ${url4}`);
|
|
344346
|
+
}
|
|
344347
|
+
if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
|
|
344348
|
+
throw new Error(`Unsafe protocol: ${parsedUrl.protocol}. Only HTTP and HTTPS are allowed.`);
|
|
344349
|
+
}
|
|
344350
|
+
if (/[\r\n\x00-\x1f]/.test(url4)) {
|
|
344351
|
+
throw new Error("URL contains invalid characters");
|
|
344352
|
+
}
|
|
344353
|
+
}
|
|
344354
|
+
async function openBrowserSecurely(url4) {
|
|
344355
|
+
validateUrl(url4);
|
|
344356
|
+
const platformName = platform9();
|
|
344357
|
+
let command;
|
|
344358
|
+
let args2;
|
|
344359
|
+
switch (platformName) {
|
|
344360
|
+
case "darwin":
|
|
344361
|
+
command = "open";
|
|
344362
|
+
args2 = [url4];
|
|
344363
|
+
break;
|
|
344364
|
+
case "win32":
|
|
344365
|
+
command = "powershell.exe";
|
|
344366
|
+
args2 = [
|
|
344367
|
+
"-NoProfile",
|
|
344368
|
+
"-NonInteractive",
|
|
344369
|
+
"-WindowStyle",
|
|
344370
|
+
"Hidden",
|
|
344371
|
+
"-Command",
|
|
344372
|
+
`Start-Process '${url4.replace(/'/g, "''")}'`
|
|
344373
|
+
];
|
|
344374
|
+
break;
|
|
344375
|
+
case "linux":
|
|
344376
|
+
case "freebsd":
|
|
344377
|
+
case "openbsd":
|
|
344378
|
+
command = "xdg-open";
|
|
344379
|
+
args2 = [url4];
|
|
344380
|
+
break;
|
|
344381
|
+
default:
|
|
344382
|
+
throw new Error(`Unsupported platform: ${platformName}`);
|
|
344383
|
+
}
|
|
344384
|
+
const options2 = {
|
|
344385
|
+
// Don't inherit parent's environment to avoid potential issues
|
|
344386
|
+
env: {
|
|
344387
|
+
...process.env,
|
|
344388
|
+
// Ensure we're not in a shell that might interpret special characters
|
|
344389
|
+
SHELL: void 0
|
|
344390
|
+
},
|
|
344391
|
+
// Detach the browser process so it doesn't block
|
|
344392
|
+
detached: true,
|
|
344393
|
+
stdio: "ignore"
|
|
344394
|
+
};
|
|
344395
|
+
try {
|
|
344396
|
+
await execFileAsync5(command, args2, options2);
|
|
344397
|
+
} catch (error) {
|
|
344398
|
+
if ((platformName === "linux" || platformName === "freebsd" || platformName === "openbsd") && command === "xdg-open") {
|
|
344399
|
+
const fallbackCommands = [
|
|
344400
|
+
"gnome-open",
|
|
344401
|
+
"kde-open",
|
|
344402
|
+
"firefox",
|
|
344403
|
+
"chromium",
|
|
344404
|
+
"google-chrome"
|
|
344405
|
+
];
|
|
344406
|
+
for (const fallbackCommand of fallbackCommands) {
|
|
344407
|
+
try {
|
|
344408
|
+
await execFileAsync5(fallbackCommand, [url4], options2);
|
|
344409
|
+
return;
|
|
344410
|
+
} catch {
|
|
344411
|
+
continue;
|
|
344412
|
+
}
|
|
344413
|
+
}
|
|
344414
|
+
}
|
|
344415
|
+
throw new Error(`Failed to open browser: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
344416
|
+
}
|
|
344417
|
+
}
|
|
344418
|
+
|
|
344419
|
+
// packages/core/dist/src/fallback/handler.js
|
|
344420
|
+
var UPGRADE_URL_PAGE = "https://goo.gle/set-up-gemini-code-assist";
|
|
344235
344421
|
async function handleFallback(config2, failedModel, authType, error) {
|
|
344236
344422
|
if (authType !== AuthType2.LOGIN_WITH_GOOGLE)
|
|
344237
344423
|
return null;
|
|
344238
|
-
|
|
344424
|
+
if (error instanceof ModelNotFoundError && failedModel !== PREVIEW_GEMINI_MODEL) {
|
|
344425
|
+
return null;
|
|
344426
|
+
}
|
|
344427
|
+
if (failedModel === PREVIEW_GEMINI_MODEL) {
|
|
344428
|
+
config2.setPreviewModelBypassMode(true);
|
|
344429
|
+
if (config2.isPreviewModelFallbackMode()) {
|
|
344430
|
+
return true;
|
|
344431
|
+
}
|
|
344432
|
+
}
|
|
344433
|
+
const fallbackModel = failedModel === PREVIEW_GEMINI_MODEL ? DEFAULT_GEMINI_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
|
|
344239
344434
|
const fallbackModelHandler = config2.fallbackModelHandler;
|
|
344240
344435
|
if (typeof fallbackModelHandler !== "function")
|
|
344241
344436
|
return null;
|
|
344242
344437
|
try {
|
|
344243
344438
|
const intent = await fallbackModelHandler(failedModel, fallbackModel, error);
|
|
344244
344439
|
switch (intent) {
|
|
344245
|
-
case "
|
|
344246
|
-
|
|
344440
|
+
case "retry_always":
|
|
344441
|
+
if (failedModel === PREVIEW_GEMINI_MODEL) {
|
|
344442
|
+
activatePreviewModelFallbackMode(config2);
|
|
344443
|
+
} else {
|
|
344444
|
+
activateFallbackMode(config2, authType);
|
|
344445
|
+
}
|
|
344247
344446
|
return true;
|
|
344248
344447
|
// Signal retryWithBackoff to continue.
|
|
344448
|
+
case "retry_once":
|
|
344449
|
+
return true;
|
|
344249
344450
|
case "stop":
|
|
344250
344451
|
activateFallbackMode(config2, authType);
|
|
344251
344452
|
return false;
|
|
344252
344453
|
case "retry_later":
|
|
344253
344454
|
return false;
|
|
344455
|
+
case "upgrade":
|
|
344456
|
+
await handleUpgrade();
|
|
344457
|
+
return false;
|
|
344254
344458
|
default:
|
|
344255
344459
|
throw new Error(`Unexpected fallback intent received from fallbackModelHandler: "${intent}"`);
|
|
344256
344460
|
}
|
|
@@ -344259,6 +344463,13 @@ async function handleFallback(config2, failedModel, authType, error) {
|
|
|
344259
344463
|
return null;
|
|
344260
344464
|
}
|
|
344261
344465
|
}
|
|
344466
|
+
async function handleUpgrade() {
|
|
344467
|
+
try {
|
|
344468
|
+
await openBrowserSecurely(UPGRADE_URL_PAGE);
|
|
344469
|
+
} catch (error) {
|
|
344470
|
+
debugLogger.warn("Failed to open browser automatically:", getErrorMessage(error));
|
|
344471
|
+
}
|
|
344472
|
+
}
|
|
344262
344473
|
function activateFallbackMode(config2, authType) {
|
|
344263
344474
|
if (!config2.isInFallbackMode()) {
|
|
344264
344475
|
config2.setFallbackMode(true);
|
|
@@ -344268,6 +344479,11 @@ function activateFallbackMode(config2, authType) {
|
|
|
344268
344479
|
}
|
|
344269
344480
|
}
|
|
344270
344481
|
}
|
|
344482
|
+
function activatePreviewModelFallbackMode(config2) {
|
|
344483
|
+
if (!config2.isPreviewModelFallbackMode()) {
|
|
344484
|
+
config2.setPreviewModelFallbackMode(true);
|
|
344485
|
+
}
|
|
344486
|
+
}
|
|
344271
344487
|
|
|
344272
344488
|
// packages/core/dist/src/core/geminiRequest.js
|
|
344273
344489
|
function partListUnionToString(value) {
|
|
@@ -344285,6 +344501,7 @@ var INVALID_CONTENT_RETRY_OPTIONS = {
|
|
|
344285
344501
|
// 1 initial call + 1 retry
|
|
344286
344502
|
initialDelayMs: 500
|
|
344287
344503
|
};
|
|
344504
|
+
var SYNTHETIC_THOUGHT_SIGNATURE = "skip_thought_signature_validator";
|
|
344288
344505
|
function isValidResponse2(response) {
|
|
344289
344506
|
if (response.candidates === void 0 || response.candidates.length === 0) {
|
|
344290
344507
|
return false;
|
|
@@ -344402,6 +344619,7 @@ var GeminiChat = class {
|
|
|
344402
344619
|
*/
|
|
344403
344620
|
async sendMessageStream(model, params, prompt_id) {
|
|
344404
344621
|
await this.sendPromise;
|
|
344622
|
+
this.config.setPreviewModelBypassMode(false);
|
|
344405
344623
|
let streamDoneResolver;
|
|
344406
344624
|
const streamDonePromise = new Promise((resolve14) => {
|
|
344407
344625
|
streamDoneResolver = resolve14;
|
|
@@ -344423,7 +344641,11 @@ var GeminiChat = class {
|
|
|
344423
344641
|
return async function* () {
|
|
344424
344642
|
try {
|
|
344425
344643
|
let lastError = new Error("Request failed after all retries.");
|
|
344426
|
-
|
|
344644
|
+
let maxAttempts = INVALID_CONTENT_RETRY_OPTIONS.maxAttempts;
|
|
344645
|
+
if (self2.config.isPreviewModelFallbackMode() && model === PREVIEW_GEMINI_MODEL) {
|
|
344646
|
+
maxAttempts = 1;
|
|
344647
|
+
}
|
|
344648
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
344427
344649
|
try {
|
|
344428
344650
|
if (attempt > 0) {
|
|
344429
344651
|
yield { type: StreamEventType.RETRY };
|
|
@@ -344444,8 +344666,8 @@ var GeminiChat = class {
|
|
|
344444
344666
|
} catch (error) {
|
|
344445
344667
|
lastError = error;
|
|
344446
344668
|
const isContentError = error instanceof InvalidStreamError;
|
|
344447
|
-
if (isContentError) {
|
|
344448
|
-
if (attempt <
|
|
344669
|
+
if (isContentError && isGemini2Model(model)) {
|
|
344670
|
+
if (attempt < maxAttempts - 1) {
|
|
344449
344671
|
logContentRetry(self2.config, new ContentRetryEvent(attempt, error.type, INVALID_CONTENT_RETRY_OPTIONS.initialDelayMs, model));
|
|
344450
344672
|
await new Promise((res) => setTimeout(res, INVALID_CONTENT_RETRY_OPTIONS.initialDelayMs * (attempt + 1)));
|
|
344451
344673
|
continue;
|
|
@@ -344455,10 +344677,14 @@ var GeminiChat = class {
|
|
|
344455
344677
|
}
|
|
344456
344678
|
}
|
|
344457
344679
|
if (lastError) {
|
|
344458
|
-
if (lastError instanceof InvalidStreamError) {
|
|
344459
|
-
logContentRetryFailure(self2.config, new ContentRetryFailureEvent(
|
|
344680
|
+
if (lastError instanceof InvalidStreamError && isGemini2Model(model)) {
|
|
344681
|
+
logContentRetryFailure(self2.config, new ContentRetryFailureEvent(maxAttempts, lastError.type, model));
|
|
344460
344682
|
}
|
|
344461
344683
|
throw lastError;
|
|
344684
|
+
} else {
|
|
344685
|
+
if (model === PREVIEW_GEMINI_MODEL && !self2.config.isPreviewModelBypassMode()) {
|
|
344686
|
+
self2.config.setPreviewModelFallbackMode(false);
|
|
344687
|
+
}
|
|
344462
344688
|
}
|
|
344463
344689
|
} finally {
|
|
344464
344690
|
streamDoneResolver();
|
|
@@ -344466,23 +344692,27 @@ var GeminiChat = class {
|
|
|
344466
344692
|
}();
|
|
344467
344693
|
}
|
|
344468
344694
|
async makeApiCallAndProcessStream(model, requestContents, params, prompt_id) {
|
|
344695
|
+
let effectiveModel = model;
|
|
344696
|
+
const contentsForPreviewModel = this.ensureActiveLoopHasThoughtSignatures(requestContents);
|
|
344469
344697
|
const apiCall = () => {
|
|
344470
|
-
|
|
344471
|
-
if (this.config.
|
|
344472
|
-
|
|
344698
|
+
let modelToUse = getEffectiveModel(this.config.isInFallbackMode(), model, this.config.getPreviewFeatures());
|
|
344699
|
+
if (this.config.isPreviewModelBypassMode() && modelToUse === PREVIEW_GEMINI_MODEL) {
|
|
344700
|
+
modelToUse = DEFAULT_GEMINI_MODEL;
|
|
344473
344701
|
}
|
|
344702
|
+
effectiveModel = modelToUse;
|
|
344474
344703
|
return this.config.getContentGenerator().generateContentStream({
|
|
344475
344704
|
model: modelToUse,
|
|
344476
|
-
contents: requestContents,
|
|
344705
|
+
contents: modelToUse === PREVIEW_GEMINI_MODEL ? contentsForPreviewModel : requestContents,
|
|
344477
344706
|
config: { ...this.generationConfig, ...params.config }
|
|
344478
344707
|
}, prompt_id);
|
|
344479
344708
|
};
|
|
344480
|
-
const onPersistent429Callback = async (authType, error) => await handleFallback(this.config,
|
|
344709
|
+
const onPersistent429Callback = async (authType, error) => await handleFallback(this.config, effectiveModel, authType, error);
|
|
344481
344710
|
const streamResponse = await retryWithBackoff(apiCall, {
|
|
344482
344711
|
onPersistent429: onPersistent429Callback,
|
|
344483
344712
|
authType: this.config.getContentGeneratorConfig()?.authType,
|
|
344484
344713
|
retryFetchErrors: this.config.getRetryFetchErrors(),
|
|
344485
|
-
signal: params.config?.abortSignal
|
|
344714
|
+
signal: params.config?.abortSignal,
|
|
344715
|
+
maxAttempts: this.config.isPreviewModelFallbackMode() && model === PREVIEW_GEMINI_MODEL ? 1 : void 0
|
|
344486
344716
|
});
|
|
344487
344717
|
return this.processStreamResponse(model, streamResponse);
|
|
344488
344718
|
}
|
|
@@ -344544,6 +344774,46 @@ var GeminiChat = class {
|
|
|
344544
344774
|
return newContent;
|
|
344545
344775
|
});
|
|
344546
344776
|
}
|
|
344777
|
+
// To ensure our requests validate, the first function call in every model
|
|
344778
|
+
// turn within the active loop must have a `thoughtSignature` property.
|
|
344779
|
+
// If we do not do this, we will get back 400 errors from the API.
|
|
344780
|
+
ensureActiveLoopHasThoughtSignatures(requestContents) {
|
|
344781
|
+
let activeLoopStartIndex = -1;
|
|
344782
|
+
for (let i3 = requestContents.length - 1; i3 >= 0; i3--) {
|
|
344783
|
+
const content = requestContents[i3];
|
|
344784
|
+
if (content.role === "user" && content.parts?.some((part) => part.text)) {
|
|
344785
|
+
activeLoopStartIndex = i3;
|
|
344786
|
+
break;
|
|
344787
|
+
}
|
|
344788
|
+
}
|
|
344789
|
+
if (activeLoopStartIndex === -1) {
|
|
344790
|
+
return requestContents;
|
|
344791
|
+
}
|
|
344792
|
+
const newContents = requestContents.slice();
|
|
344793
|
+
for (let i3 = activeLoopStartIndex; i3 < newContents.length; i3++) {
|
|
344794
|
+
const content = newContents[i3];
|
|
344795
|
+
if (content.role === "model" && content.parts) {
|
|
344796
|
+
const newParts = content.parts.slice();
|
|
344797
|
+
for (let j = 0; j < newParts.length; j++) {
|
|
344798
|
+
const part = newParts[j];
|
|
344799
|
+
if (part.functionCall) {
|
|
344800
|
+
if (!part.thoughtSignature) {
|
|
344801
|
+
newParts[j] = {
|
|
344802
|
+
...part,
|
|
344803
|
+
thoughtSignature: SYNTHETIC_THOUGHT_SIGNATURE
|
|
344804
|
+
};
|
|
344805
|
+
newContents[i3] = {
|
|
344806
|
+
...content,
|
|
344807
|
+
parts: newParts
|
|
344808
|
+
};
|
|
344809
|
+
}
|
|
344810
|
+
break;
|
|
344811
|
+
}
|
|
344812
|
+
}
|
|
344813
|
+
}
|
|
344814
|
+
}
|
|
344815
|
+
return newContents;
|
|
344816
|
+
}
|
|
344547
344817
|
setTools(tools) {
|
|
344548
344818
|
this.generationConfig.tools = tools;
|
|
344549
344819
|
}
|
|
@@ -346033,7 +346303,7 @@ var ChatCompressionService = class {
|
|
|
346033
346303
|
|
|
346034
346304
|
// packages/core/dist/src/core/client.js
|
|
346035
346305
|
function isThinkingSupported(model) {
|
|
346036
|
-
return model.startsWith("gemini-2.5") || model === DEFAULT_GEMINI_MODEL_AUTO;
|
|
346306
|
+
return model.startsWith("gemini-2.5") || model.startsWith("gemini-3") || model === DEFAULT_GEMINI_MODEL_AUTO;
|
|
346037
346307
|
}
|
|
346038
346308
|
var MAX_TURNS = 100;
|
|
346039
346309
|
var GeminiClient = class {
|
|
@@ -346288,8 +346558,7 @@ var GeminiClient = class {
|
|
|
346288
346558
|
return this.currentSequenceModel;
|
|
346289
346559
|
}
|
|
346290
346560
|
const configModel = this.config.getModel();
|
|
346291
|
-
|
|
346292
|
-
return getEffectiveModel(this.config.isInFallbackMode(), model);
|
|
346561
|
+
return getEffectiveModel(this.config.isInFallbackMode(), configModel, this.config.getPreviewFeatures());
|
|
346293
346562
|
}
|
|
346294
346563
|
async *sendMessageStream(request3, signal, prompt_id, turns = MAX_TURNS, isInvalidStreamRetry = false) {
|
|
346295
346564
|
if (this.lastPromptId !== prompt_id) {
|
|
@@ -351479,7 +351748,7 @@ var ClassifierResponseSchema = external_exports.object({
|
|
|
351479
351748
|
});
|
|
351480
351749
|
var ClassifierStrategy = class {
|
|
351481
351750
|
name = "classifier";
|
|
351482
|
-
async route(context2,
|
|
351751
|
+
async route(context2, config2, baseLlmClient) {
|
|
351483
351752
|
const startTime = Date.now();
|
|
351484
351753
|
try {
|
|
351485
351754
|
let promptId = promptIdContext.getStore();
|
|
@@ -351503,7 +351772,7 @@ var ClassifierStrategy = class {
|
|
|
351503
351772
|
const latencyMs = Date.now() - startTime;
|
|
351504
351773
|
if (routerResponse.model_choice === FLASH_MODEL) {
|
|
351505
351774
|
return {
|
|
351506
|
-
model:
|
|
351775
|
+
model: resolveModel(GEMINI_MODEL_ALIAS_FLASH, config2.getPreviewFeatures()),
|
|
351507
351776
|
metadata: {
|
|
351508
351777
|
source: "Classifier",
|
|
351509
351778
|
latencyMs,
|
|
@@ -351512,7 +351781,7 @@ var ClassifierStrategy = class {
|
|
|
351512
351781
|
};
|
|
351513
351782
|
} else {
|
|
351514
351783
|
return {
|
|
351515
|
-
model:
|
|
351784
|
+
model: resolveModel(GEMINI_MODEL_ALIAS_PRO, config2.getPreviewFeatures()),
|
|
351516
351785
|
metadata: {
|
|
351517
351786
|
source: "Classifier",
|
|
351518
351787
|
reasoning,
|
|
@@ -351589,7 +351858,7 @@ var FallbackStrategy = class {
|
|
|
351589
351858
|
if (!isInFallbackMode) {
|
|
351590
351859
|
return null;
|
|
351591
351860
|
}
|
|
351592
|
-
const effectiveModel = getEffectiveModel(isInFallbackMode, config2.getModel());
|
|
351861
|
+
const effectiveModel = getEffectiveModel(isInFallbackMode, config2.getModel(), config2.getPreviewFeatures());
|
|
351593
351862
|
return {
|
|
351594
351863
|
model: effectiveModel,
|
|
351595
351864
|
metadata: {
|
|
@@ -351609,7 +351878,7 @@ var OverrideStrategy = class {
|
|
|
351609
351878
|
if (overrideModel === DEFAULT_GEMINI_MODEL_AUTO)
|
|
351610
351879
|
return null;
|
|
351611
351880
|
return {
|
|
351612
|
-
model: overrideModel,
|
|
351881
|
+
model: resolveModel(overrideModel, config2.getPreviewFeatures()),
|
|
351613
351882
|
metadata: {
|
|
351614
351883
|
source: this.name,
|
|
351615
351884
|
latencyMs: 0,
|
|
@@ -351646,6 +351915,11 @@ var ModelRouterService = class {
|
|
|
351646
351915
|
let decision;
|
|
351647
351916
|
try {
|
|
351648
351917
|
decision = await this.strategy.route(context2, this.config, this.config.getBaseLlmClient());
|
|
351918
|
+
if (decision.model === DEFAULT_GEMINI_MODEL && this.config.getPreviewFeatures() && decision.metadata.source !== "override") {
|
|
351919
|
+
decision.model = PREVIEW_GEMINI_MODEL;
|
|
351920
|
+
decision.metadata.source += " (Preview Model)";
|
|
351921
|
+
decision.metadata.reasoning += " (Upgraded to Preview Model)";
|
|
351922
|
+
}
|
|
351649
351923
|
const event = new ModelRoutingEvent(
|
|
351650
351924
|
decision.model,
|
|
351651
351925
|
decision.metadata.source,
|
|
@@ -354861,7 +355135,7 @@ async function getClientMetadata() {
|
|
|
354861
355135
|
clientMetadataPromise = (async () => ({
|
|
354862
355136
|
ideName: "IDE_UNSPECIFIED",
|
|
354863
355137
|
pluginType: "GEMINI",
|
|
354864
|
-
ideVersion: "0.17.0-
|
|
355138
|
+
ideVersion: "0.17.0-preview.0",
|
|
354865
355139
|
platform: getPlatform(),
|
|
354866
355140
|
updateChannel: await getReleaseChannel(__dirname5)
|
|
354867
355141
|
}))();
|
|
@@ -354898,7 +355172,10 @@ function parseExperiments(response) {
|
|
|
354898
355172
|
// packages/core/dist/src/code_assist/experiments/flagNames.js
|
|
354899
355173
|
var ExperimentFlags = {
|
|
354900
355174
|
CONTEXT_COMPRESSION_THRESHOLD: 45740197,
|
|
354901
|
-
USER_CACHING: 45740198
|
|
355175
|
+
USER_CACHING: 45740198,
|
|
355176
|
+
BANNER_TEXT_NO_CAPACITY_ISSUES: 45740199,
|
|
355177
|
+
BANNER_TEXT_CAPACITY_ISSUES: 45740200,
|
|
355178
|
+
ENABLE_PREVIEW: 45740196
|
|
354902
355179
|
};
|
|
354903
355180
|
|
|
354904
355181
|
// packages/core/dist/src/utils/memoryDiscovery.js
|
|
@@ -358612,91 +358889,6 @@ import * as http5 from "node:http";
|
|
|
358612
358889
|
import * as crypto21 from "node:crypto";
|
|
358613
358890
|
import { URL as URL8 } from "node:url";
|
|
358614
358891
|
|
|
358615
|
-
// packages/core/dist/src/utils/secure-browser-launcher.js
|
|
358616
|
-
import { execFile as execFile6 } from "node:child_process";
|
|
358617
|
-
import { promisify as promisify12 } from "node:util";
|
|
358618
|
-
import { platform as platform9 } from "node:os";
|
|
358619
|
-
import { URL as URL7 } from "node:url";
|
|
358620
|
-
var execFileAsync5 = promisify12(execFile6);
|
|
358621
|
-
function validateUrl(url4) {
|
|
358622
|
-
let parsedUrl;
|
|
358623
|
-
try {
|
|
358624
|
-
parsedUrl = new URL7(url4);
|
|
358625
|
-
} catch (_error) {
|
|
358626
|
-
throw new Error(`Invalid URL: ${url4}`);
|
|
358627
|
-
}
|
|
358628
|
-
if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
|
|
358629
|
-
throw new Error(`Unsafe protocol: ${parsedUrl.protocol}. Only HTTP and HTTPS are allowed.`);
|
|
358630
|
-
}
|
|
358631
|
-
if (/[\r\n\x00-\x1f]/.test(url4)) {
|
|
358632
|
-
throw new Error("URL contains invalid characters");
|
|
358633
|
-
}
|
|
358634
|
-
}
|
|
358635
|
-
async function openBrowserSecurely(url4) {
|
|
358636
|
-
validateUrl(url4);
|
|
358637
|
-
const platformName = platform9();
|
|
358638
|
-
let command;
|
|
358639
|
-
let args2;
|
|
358640
|
-
switch (platformName) {
|
|
358641
|
-
case "darwin":
|
|
358642
|
-
command = "open";
|
|
358643
|
-
args2 = [url4];
|
|
358644
|
-
break;
|
|
358645
|
-
case "win32":
|
|
358646
|
-
command = "powershell.exe";
|
|
358647
|
-
args2 = [
|
|
358648
|
-
"-NoProfile",
|
|
358649
|
-
"-NonInteractive",
|
|
358650
|
-
"-WindowStyle",
|
|
358651
|
-
"Hidden",
|
|
358652
|
-
"-Command",
|
|
358653
|
-
`Start-Process '${url4.replace(/'/g, "''")}'`
|
|
358654
|
-
];
|
|
358655
|
-
break;
|
|
358656
|
-
case "linux":
|
|
358657
|
-
case "freebsd":
|
|
358658
|
-
case "openbsd":
|
|
358659
|
-
command = "xdg-open";
|
|
358660
|
-
args2 = [url4];
|
|
358661
|
-
break;
|
|
358662
|
-
default:
|
|
358663
|
-
throw new Error(`Unsupported platform: ${platformName}`);
|
|
358664
|
-
}
|
|
358665
|
-
const options2 = {
|
|
358666
|
-
// Don't inherit parent's environment to avoid potential issues
|
|
358667
|
-
env: {
|
|
358668
|
-
...process.env,
|
|
358669
|
-
// Ensure we're not in a shell that might interpret special characters
|
|
358670
|
-
SHELL: void 0
|
|
358671
|
-
},
|
|
358672
|
-
// Detach the browser process so it doesn't block
|
|
358673
|
-
detached: true,
|
|
358674
|
-
stdio: "ignore"
|
|
358675
|
-
};
|
|
358676
|
-
try {
|
|
358677
|
-
await execFileAsync5(command, args2, options2);
|
|
358678
|
-
} catch (error) {
|
|
358679
|
-
if ((platformName === "linux" || platformName === "freebsd" || platformName === "openbsd") && command === "xdg-open") {
|
|
358680
|
-
const fallbackCommands = [
|
|
358681
|
-
"gnome-open",
|
|
358682
|
-
"kde-open",
|
|
358683
|
-
"firefox",
|
|
358684
|
-
"chromium",
|
|
358685
|
-
"google-chrome"
|
|
358686
|
-
];
|
|
358687
|
-
for (const fallbackCommand of fallbackCommands) {
|
|
358688
|
-
try {
|
|
358689
|
-
await execFileAsync5(fallbackCommand, [url4], options2);
|
|
358690
|
-
return;
|
|
358691
|
-
} catch {
|
|
358692
|
-
continue;
|
|
358693
|
-
}
|
|
358694
|
-
}
|
|
358695
|
-
}
|
|
358696
|
-
throw new Error(`Failed to open browser: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
358697
|
-
}
|
|
358698
|
-
}
|
|
358699
|
-
|
|
358700
358892
|
// packages/core/dist/src/mcp/oauth-token-storage.js
|
|
358701
358893
|
init_events();
|
|
358702
358894
|
import { promises as fs54 } from "node:fs";
|
|
@@ -359684,23 +359876,18 @@ async function discoverTools(mcpServerName, mcpServerConfig, mcpClient, cliConfi
|
|
|
359684
359876
|
try {
|
|
359685
359877
|
if (mcpClient.getServerCapabilities()?.tools == null)
|
|
359686
359878
|
return [];
|
|
359687
|
-
const
|
|
359688
|
-
timeout: mcpServerConfig.timeout ?? MCP_DEFAULT_TIMEOUT_MSEC
|
|
359689
|
-
});
|
|
359690
|
-
const tool = await mcpCallableTool.tool();
|
|
359691
|
-
if (!Array.isArray(tool.functionDeclarations)) {
|
|
359692
|
-
return [];
|
|
359693
|
-
}
|
|
359879
|
+
const response = await mcpClient.listTools({});
|
|
359694
359880
|
const discoveredTools = [];
|
|
359695
|
-
for (const
|
|
359881
|
+
for (const toolDef of response.tools) {
|
|
359696
359882
|
try {
|
|
359697
|
-
if (!isEnabled(
|
|
359883
|
+
if (!isEnabled(toolDef, mcpServerName, mcpServerConfig)) {
|
|
359698
359884
|
continue;
|
|
359699
359885
|
}
|
|
359700
|
-
const
|
|
359701
|
-
|
|
359886
|
+
const mcpCallableTool = new McpCallableTool2(mcpClient, toolDef, mcpServerConfig.timeout ?? MCP_DEFAULT_TIMEOUT_MSEC);
|
|
359887
|
+
const tool = new DiscoveredMCPTool(mcpCallableTool, mcpServerName, toolDef.name, toolDef.description ?? "", toolDef.inputSchema ?? { type: "object", properties: {} }, mcpServerConfig.trust, void 0, cliConfig, mcpServerConfig.extension?.name, mcpServerConfig.extension?.id, messageBus);
|
|
359888
|
+
discoveredTools.push(tool);
|
|
359702
359889
|
} catch (error) {
|
|
359703
|
-
coreEvents.emitFeedback("error", `Error discovering tool: '${
|
|
359890
|
+
coreEvents.emitFeedback("error", `Error discovering tool: '${toolDef.name}' from MCP server '${mcpServerName}': ${error.message}`, error);
|
|
359704
359891
|
}
|
|
359705
359892
|
}
|
|
359706
359893
|
return discoveredTools;
|
|
@@ -359711,11 +359898,66 @@ async function discoverTools(mcpServerName, mcpServerConfig, mcpClient, cliConfi
|
|
|
359711
359898
|
return [];
|
|
359712
359899
|
}
|
|
359713
359900
|
}
|
|
359901
|
+
var McpCallableTool2 = class {
|
|
359902
|
+
client;
|
|
359903
|
+
toolDef;
|
|
359904
|
+
timeout;
|
|
359905
|
+
constructor(client, toolDef, timeout) {
|
|
359906
|
+
this.client = client;
|
|
359907
|
+
this.toolDef = toolDef;
|
|
359908
|
+
this.timeout = timeout;
|
|
359909
|
+
}
|
|
359910
|
+
async tool() {
|
|
359911
|
+
return {
|
|
359912
|
+
functionDeclarations: [
|
|
359913
|
+
{
|
|
359914
|
+
name: this.toolDef.name,
|
|
359915
|
+
description: this.toolDef.description,
|
|
359916
|
+
parametersJsonSchema: this.toolDef.inputSchema
|
|
359917
|
+
}
|
|
359918
|
+
]
|
|
359919
|
+
};
|
|
359920
|
+
}
|
|
359921
|
+
async callTool(functionCalls) {
|
|
359922
|
+
if (functionCalls.length !== 1) {
|
|
359923
|
+
throw new Error("McpCallableTool only supports single function call");
|
|
359924
|
+
}
|
|
359925
|
+
const call = functionCalls[0];
|
|
359926
|
+
try {
|
|
359927
|
+
const result = await this.client.callTool({
|
|
359928
|
+
name: call.name,
|
|
359929
|
+
arguments: call.args
|
|
359930
|
+
}, void 0, { timeout: this.timeout });
|
|
359931
|
+
return [
|
|
359932
|
+
{
|
|
359933
|
+
functionResponse: {
|
|
359934
|
+
name: call.name,
|
|
359935
|
+
response: result
|
|
359936
|
+
}
|
|
359937
|
+
}
|
|
359938
|
+
];
|
|
359939
|
+
} catch (error) {
|
|
359940
|
+
return [
|
|
359941
|
+
{
|
|
359942
|
+
functionResponse: {
|
|
359943
|
+
name: call.name,
|
|
359944
|
+
response: {
|
|
359945
|
+
error: {
|
|
359946
|
+
message: error instanceof Error ? error.message : String(error),
|
|
359947
|
+
isError: true
|
|
359948
|
+
}
|
|
359949
|
+
}
|
|
359950
|
+
}
|
|
359951
|
+
}
|
|
359952
|
+
];
|
|
359953
|
+
}
|
|
359954
|
+
}
|
|
359955
|
+
};
|
|
359714
359956
|
async function discoverPrompts(mcpServerName, mcpClient, promptRegistry) {
|
|
359715
359957
|
try {
|
|
359716
359958
|
if (mcpClient.getServerCapabilities()?.prompts == null)
|
|
359717
359959
|
return [];
|
|
359718
|
-
const response = await mcpClient.
|
|
359960
|
+
const response = await mcpClient.listPrompts({});
|
|
359719
359961
|
for (const prompt of response.prompts) {
|
|
359720
359962
|
promptRegistry.registerPrompt({
|
|
359721
359963
|
...prompt,
|
|
@@ -359733,13 +359975,16 @@ async function discoverPrompts(mcpServerName, mcpClient, promptRegistry) {
|
|
|
359733
359975
|
}
|
|
359734
359976
|
async function invokeMcpPrompt(mcpServerName, mcpClient, promptName, promptParams) {
|
|
359735
359977
|
try {
|
|
359736
|
-
const
|
|
359737
|
-
|
|
359738
|
-
|
|
359739
|
-
|
|
359740
|
-
arguments: promptParams
|
|
359978
|
+
const sanitizedParams = {};
|
|
359979
|
+
for (const [key, value] of Object.entries(promptParams)) {
|
|
359980
|
+
if (value !== void 0 && value !== null) {
|
|
359981
|
+
sanitizedParams[key] = String(value);
|
|
359741
359982
|
}
|
|
359742
|
-
}
|
|
359983
|
+
}
|
|
359984
|
+
const response = await mcpClient.getPrompt({
|
|
359985
|
+
name: promptName,
|
|
359986
|
+
arguments: sanitizedParams
|
|
359987
|
+
});
|
|
359743
359988
|
return response;
|
|
359744
359989
|
} catch (error) {
|
|
359745
359990
|
if (error instanceof Error && !error.message?.includes("Method not found")) {
|
|
@@ -360338,6 +360583,7 @@ var Config = class {
|
|
|
360338
360583
|
cwd;
|
|
360339
360584
|
bugCommand;
|
|
360340
360585
|
model;
|
|
360586
|
+
previewFeatures;
|
|
360341
360587
|
noBrowser;
|
|
360342
360588
|
folderTrust;
|
|
360343
360589
|
ideMode;
|
|
@@ -360394,6 +360640,8 @@ var Config = class {
|
|
|
360394
360640
|
hooks;
|
|
360395
360641
|
experiments;
|
|
360396
360642
|
experimentsPromise;
|
|
360643
|
+
previewModelFallbackMode = false;
|
|
360644
|
+
previewModelBypassMode = false;
|
|
360397
360645
|
constructor(params) {
|
|
360398
360646
|
this.sessionId = params.sessionId;
|
|
360399
360647
|
this.embeddingModel = params.embeddingModel ?? DEFAULT_GEMINI_EMBEDDING_MODEL;
|
|
@@ -360442,6 +360690,7 @@ var Config = class {
|
|
|
360442
360690
|
this.fileDiscoveryService = params.fileDiscoveryService ?? null;
|
|
360443
360691
|
this.bugCommand = params.bugCommand;
|
|
360444
360692
|
this.model = params.model;
|
|
360693
|
+
this.previewFeatures = params.previewFeatures ?? void 0;
|
|
360445
360694
|
this.maxSessionTurns = params.maxSessionTurns ?? -1;
|
|
360446
360695
|
this.experimentalZedIntegration = params.experimentalZedIntegration ?? false;
|
|
360447
360696
|
this.listSessions = params.listSessions ?? false;
|
|
@@ -360566,17 +360815,24 @@ var Config = class {
|
|
|
360566
360815
|
this.model = DEFAULT_GEMINI_MODEL;
|
|
360567
360816
|
}
|
|
360568
360817
|
}
|
|
360569
|
-
if (this.contentGeneratorConfig?.authType === AuthType2.USE_GEMINI && authMethod
|
|
360818
|
+
if (this.contentGeneratorConfig?.authType === AuthType2.USE_GEMINI && authMethod !== AuthType2.USE_GEMINI) {
|
|
360570
360819
|
this.geminiClient.stripThoughtsFromHistory();
|
|
360571
360820
|
}
|
|
360572
360821
|
const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod);
|
|
360573
360822
|
this.contentGenerator = await createContentGenerator(newContentGeneratorConfig, this, this.getSessionId());
|
|
360574
360823
|
this.contentGeneratorConfig = newContentGeneratorConfig;
|
|
360575
360824
|
this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this);
|
|
360825
|
+
const previewFeatures = this.getPreviewFeatures();
|
|
360576
360826
|
const codeAssistServer = getCodeAssistServer(this);
|
|
360577
360827
|
if (codeAssistServer) {
|
|
360578
360828
|
this.experimentsPromise = getExperiments(codeAssistServer).then((experiments) => {
|
|
360579
360829
|
this.setExperiments(experiments);
|
|
360830
|
+
if (previewFeatures === void 0) {
|
|
360831
|
+
const remotePreviewFeatures = experiments.flags[ExperimentFlags.ENABLE_PREVIEW]?.boolValue;
|
|
360832
|
+
if (remotePreviewFeatures === true) {
|
|
360833
|
+
this.setPreviewFeatures(remotePreviewFeatures);
|
|
360834
|
+
}
|
|
360835
|
+
}
|
|
360580
360836
|
}).catch((e2) => {
|
|
360581
360837
|
debugLogger.error("Failed to fetch experiments", e2);
|
|
360582
360838
|
});
|
|
@@ -360639,6 +360895,21 @@ var Config = class {
|
|
|
360639
360895
|
setFallbackModelHandler(handler) {
|
|
360640
360896
|
this.fallbackModelHandler = handler;
|
|
360641
360897
|
}
|
|
360898
|
+
getFallbackModelHandler() {
|
|
360899
|
+
return this.fallbackModelHandler;
|
|
360900
|
+
}
|
|
360901
|
+
isPreviewModelFallbackMode() {
|
|
360902
|
+
return this.previewModelFallbackMode;
|
|
360903
|
+
}
|
|
360904
|
+
setPreviewModelFallbackMode(active) {
|
|
360905
|
+
this.previewModelFallbackMode = active;
|
|
360906
|
+
}
|
|
360907
|
+
isPreviewModelBypassMode() {
|
|
360908
|
+
return this.previewModelBypassMode;
|
|
360909
|
+
}
|
|
360910
|
+
setPreviewModelBypassMode(active) {
|
|
360911
|
+
this.previewModelBypassMode = active;
|
|
360912
|
+
}
|
|
360642
360913
|
getMaxSessionTurns() {
|
|
360643
360914
|
return this.maxSessionTurns;
|
|
360644
360915
|
}
|
|
@@ -360683,6 +360954,12 @@ var Config = class {
|
|
|
360683
360954
|
getQuestion() {
|
|
360684
360955
|
return this.question;
|
|
360685
360956
|
}
|
|
360957
|
+
getPreviewFeatures() {
|
|
360958
|
+
return this.previewFeatures;
|
|
360959
|
+
}
|
|
360960
|
+
setPreviewFeatures(previewFeatures) {
|
|
360961
|
+
this.previewFeatures = previewFeatures;
|
|
360962
|
+
}
|
|
360686
360963
|
getCoreTools() {
|
|
360687
360964
|
return this.coreTools;
|
|
360688
360965
|
}
|
|
@@ -360940,6 +361217,14 @@ var Config = class {
|
|
|
360940
361217
|
await this.ensureExperimentsLoaded();
|
|
360941
361218
|
return this.experiments?.flags[ExperimentFlags.USER_CACHING]?.boolValue;
|
|
360942
361219
|
}
|
|
361220
|
+
async getBannerTextNoCapacityIssues() {
|
|
361221
|
+
await this.ensureExperimentsLoaded();
|
|
361222
|
+
return this.experiments?.flags[ExperimentFlags.BANNER_TEXT_NO_CAPACITY_ISSUES]?.stringValue ?? "";
|
|
361223
|
+
}
|
|
361224
|
+
async getBannerTextCapacityIssues() {
|
|
361225
|
+
await this.ensureExperimentsLoaded();
|
|
361226
|
+
return this.experiments?.flags[ExperimentFlags.BANNER_TEXT_CAPACITY_ISSUES]?.stringValue ?? "";
|
|
361227
|
+
}
|
|
360943
361228
|
async ensureExperimentsLoaded() {
|
|
360944
361229
|
if (!this.experimentsPromise) {
|
|
360945
361230
|
return;
|
|
@@ -364431,6 +364716,7 @@ undici/lib/web/websocket/frame.js:
|
|
|
364431
364716
|
@google/genai/dist/node/index.mjs:
|
|
364432
364717
|
@google/genai/dist/node/index.mjs:
|
|
364433
364718
|
@google/genai/dist/node/index.mjs:
|
|
364719
|
+
@google/genai/dist/node/index.mjs:
|
|
364434
364720
|
@google/genai/dist/node/index.mjs:
|
|
364435
364721
|
(**
|
|
364436
364722
|
* @license
|