@google/gemini-cli-a2a-server 0.59.0-preview.0 → 0.60.0-nightly.20260904.g87a9c71d5
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 +331 -115
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -891,15 +891,15 @@ var require_colorize = __commonJS({
|
|
|
891
891
|
* function colorize (lookup, level, message)
|
|
892
892
|
* Performs multi-step colorization using @colors/colors/safe
|
|
893
893
|
*/
|
|
894
|
-
colorize(
|
|
894
|
+
colorize(lookup3, level, message) {
|
|
895
895
|
if (typeof message === "undefined") {
|
|
896
896
|
message = level;
|
|
897
897
|
}
|
|
898
|
-
if (!Array.isArray(_Colorizer.allColors[
|
|
899
|
-
return colors[_Colorizer.allColors[
|
|
898
|
+
if (!Array.isArray(_Colorizer.allColors[lookup3])) {
|
|
899
|
+
return colors[_Colorizer.allColors[lookup3]](message);
|
|
900
900
|
}
|
|
901
|
-
for (let i3 = 0, len = _Colorizer.allColors[
|
|
902
|
-
message = colors[_Colorizer.allColors[
|
|
901
|
+
for (let i3 = 0, len = _Colorizer.allColors[lookup3].length; i3 < len; i3++) {
|
|
902
|
+
message = colors[_Colorizer.allColors[lookup3][i3]](message);
|
|
903
903
|
}
|
|
904
904
|
return message;
|
|
905
905
|
}
|
|
@@ -27762,7 +27762,7 @@ var require_mime_types = __commonJS({
|
|
|
27762
27762
|
exports2.contentType = contentType;
|
|
27763
27763
|
exports2.extension = extension;
|
|
27764
27764
|
exports2.extensions = /* @__PURE__ */ Object.create(null);
|
|
27765
|
-
exports2.lookup =
|
|
27765
|
+
exports2.lookup = lookup3;
|
|
27766
27766
|
exports2.types = /* @__PURE__ */ Object.create(null);
|
|
27767
27767
|
exports2._extensionConflicts = [];
|
|
27768
27768
|
populateMaps(exports2.extensions, exports2.types);
|
|
@@ -27805,7 +27805,7 @@ var require_mime_types = __commonJS({
|
|
|
27805
27805
|
}
|
|
27806
27806
|
return exts[0];
|
|
27807
27807
|
}
|
|
27808
|
-
function
|
|
27808
|
+
function lookup3(path99) {
|
|
27809
27809
|
if (!path99 || typeof path99 !== "string") {
|
|
27810
27810
|
return false;
|
|
27811
27811
|
}
|
|
@@ -31311,7 +31311,7 @@ var require_view = __commonJS({
|
|
|
31311
31311
|
this.engine = opts.engines[this.ext];
|
|
31312
31312
|
this.path = this.lookup(fileName);
|
|
31313
31313
|
}
|
|
31314
|
-
View.prototype.lookup = function
|
|
31314
|
+
View.prototype.lookup = function lookup3(name3) {
|
|
31315
31315
|
var path100;
|
|
31316
31316
|
var roots = [].concat(this.root);
|
|
31317
31317
|
debug2('lookup "%s"', name3);
|
|
@@ -34497,7 +34497,7 @@ var require_request = __commonJS({
|
|
|
34497
34497
|
"node_modules/express/lib/request.js"(exports2, module2) {
|
|
34498
34498
|
"use strict";
|
|
34499
34499
|
var accepts = require_accepts();
|
|
34500
|
-
var
|
|
34500
|
+
var isIP4 = __require("node:net").isIP;
|
|
34501
34501
|
var typeis = require_type_is();
|
|
34502
34502
|
var http7 = __require("node:http");
|
|
34503
34503
|
var fresh = require_fresh();
|
|
@@ -34588,7 +34588,7 @@ var require_request = __commonJS({
|
|
|
34588
34588
|
var hostname3 = this.hostname;
|
|
34589
34589
|
if (!hostname3) return [];
|
|
34590
34590
|
var offset = this.app.get("subdomain offset");
|
|
34591
|
-
var subdomains2 = !
|
|
34591
|
+
var subdomains2 = !isIP4(hostname3) ? hostname3.split(".").reverse() : [hostname3];
|
|
34592
34592
|
return subdomains2.slice(offset);
|
|
34593
34593
|
});
|
|
34594
34594
|
defineGetter(req, "path", function path99() {
|
|
@@ -40321,7 +40321,7 @@ var require_dist2 = __commonJS({
|
|
|
40321
40321
|
};
|
|
40322
40322
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
40323
40323
|
exports2.Agent = void 0;
|
|
40324
|
-
var
|
|
40324
|
+
var net3 = __importStar(__require("net"));
|
|
40325
40325
|
var http7 = __importStar(__require("http"));
|
|
40326
40326
|
var https_1 = __require("https");
|
|
40327
40327
|
__exportStar(require_helpers(), exports2);
|
|
@@ -40361,7 +40361,7 @@ var require_dist2 = __commonJS({
|
|
|
40361
40361
|
if (!this.sockets[name3]) {
|
|
40362
40362
|
this.sockets[name3] = [];
|
|
40363
40363
|
}
|
|
40364
|
-
const fakeSocket = new
|
|
40364
|
+
const fakeSocket = new net3.Socket({ writable: false });
|
|
40365
40365
|
this.sockets[name3].push(fakeSocket);
|
|
40366
40366
|
this.totalSocketCount++;
|
|
40367
40367
|
return fakeSocket;
|
|
@@ -40573,7 +40573,7 @@ var require_dist3 = __commonJS({
|
|
|
40573
40573
|
};
|
|
40574
40574
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
40575
40575
|
exports2.HttpsProxyAgent = void 0;
|
|
40576
|
-
var
|
|
40576
|
+
var net3 = __importStar(__require("net"));
|
|
40577
40577
|
var tls = __importStar(__require("tls"));
|
|
40578
40578
|
var assert_1 = __importDefault(__require("assert"));
|
|
40579
40579
|
var debug_1 = __importDefault(require_src());
|
|
@@ -40582,7 +40582,7 @@ var require_dist3 = __commonJS({
|
|
|
40582
40582
|
var parse_proxy_response_1 = require_parse_proxy_response();
|
|
40583
40583
|
var debug2 = (0, debug_1.default)("https-proxy-agent");
|
|
40584
40584
|
var setServernameFromNonIpHost = (options) => {
|
|
40585
|
-
if (options.servername === void 0 && options.host && !
|
|
40585
|
+
if (options.servername === void 0 && options.host && !net3.isIP(options.host)) {
|
|
40586
40586
|
return {
|
|
40587
40587
|
...options,
|
|
40588
40588
|
servername: options.host
|
|
@@ -40622,10 +40622,10 @@ var require_dist3 = __commonJS({
|
|
|
40622
40622
|
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
40623
40623
|
} else {
|
|
40624
40624
|
debug2("Creating `net.Socket`: %o", this.connectOpts);
|
|
40625
|
-
socket =
|
|
40625
|
+
socket = net3.connect(this.connectOpts);
|
|
40626
40626
|
}
|
|
40627
40627
|
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
40628
|
-
const host =
|
|
40628
|
+
const host = net3.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
40629
40629
|
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
|
|
40630
40630
|
`;
|
|
40631
40631
|
if (proxy2.username || proxy2.password) {
|
|
@@ -40658,7 +40658,7 @@ var require_dist3 = __commonJS({
|
|
|
40658
40658
|
return socket;
|
|
40659
40659
|
}
|
|
40660
40660
|
socket.destroy();
|
|
40661
|
-
const fakeSocket = new
|
|
40661
|
+
const fakeSocket = new net3.Socket({ writable: false });
|
|
40662
40662
|
fakeSocket.readable = true;
|
|
40663
40663
|
req.once("socket", (s6) => {
|
|
40664
40664
|
debug2("Replaying proxy buffer for failed request");
|
|
@@ -43576,12 +43576,12 @@ var require_base64_js = __commonJS({
|
|
|
43576
43576
|
exports2.byteLength = byteLength;
|
|
43577
43577
|
exports2.toByteArray = toByteArray;
|
|
43578
43578
|
exports2.fromByteArray = fromByteArray;
|
|
43579
|
-
var
|
|
43579
|
+
var lookup3 = [];
|
|
43580
43580
|
var revLookup = [];
|
|
43581
43581
|
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
43582
43582
|
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
43583
43583
|
for (i3 = 0, len = code.length; i3 < len; ++i3) {
|
|
43584
|
-
|
|
43584
|
+
lookup3[i3] = code[i3];
|
|
43585
43585
|
revLookup[code.charCodeAt(i3)] = i3;
|
|
43586
43586
|
}
|
|
43587
43587
|
var i3;
|
|
@@ -43634,7 +43634,7 @@ var require_base64_js = __commonJS({
|
|
|
43634
43634
|
return arr;
|
|
43635
43635
|
}
|
|
43636
43636
|
function tripletToBase64(num) {
|
|
43637
|
-
return
|
|
43637
|
+
return lookup3[num >> 18 & 63] + lookup3[num >> 12 & 63] + lookup3[num >> 6 & 63] + lookup3[num & 63];
|
|
43638
43638
|
}
|
|
43639
43639
|
function encodeChunk(uint8, start2, end) {
|
|
43640
43640
|
var tmp;
|
|
@@ -43657,12 +43657,12 @@ var require_base64_js = __commonJS({
|
|
|
43657
43657
|
if (extraBytes === 1) {
|
|
43658
43658
|
tmp = uint8[len2 - 1];
|
|
43659
43659
|
parts2.push(
|
|
43660
|
-
|
|
43660
|
+
lookup3[tmp >> 2] + lookup3[tmp << 4 & 63] + "=="
|
|
43661
43661
|
);
|
|
43662
43662
|
} else if (extraBytes === 2) {
|
|
43663
43663
|
tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];
|
|
43664
43664
|
parts2.push(
|
|
43665
|
-
|
|
43665
|
+
lookup3[tmp >> 10] + lookup3[tmp >> 4 & 63] + lookup3[tmp << 2 & 63] + "="
|
|
43666
43666
|
);
|
|
43667
43667
|
}
|
|
43668
43668
|
return parts2.join("");
|
|
@@ -71326,11 +71326,11 @@ var require_suffix_array = __commonJS({
|
|
|
71326
71326
|
}
|
|
71327
71327
|
}
|
|
71328
71328
|
}
|
|
71329
|
-
function compare(string3,
|
|
71330
|
-
return string3[m3] - string3[n2] || (m3 % 3 === 2 ? string3[m3 + 1] - string3[n2 + 1] ||
|
|
71329
|
+
function compare(string3, lookup3, m3, n2) {
|
|
71330
|
+
return string3[m3] - string3[n2] || (m3 % 3 === 2 ? string3[m3 + 1] - string3[n2 + 1] || lookup3[m3 + 2] - lookup3[n2 + 2] : lookup3[m3 + 1] - lookup3[n2 + 1]);
|
|
71331
71331
|
}
|
|
71332
71332
|
function build(string3, l2) {
|
|
71333
|
-
var a = [], b2 = [], al = 2 * l2 / 3 | 0, bl = l2 - al, r3 = al + 1 >> 1, i3 = al, j2 = 0, k2,
|
|
71333
|
+
var a = [], b2 = [], al = 2 * l2 / 3 | 0, bl = l2 - al, r3 = al + 1 >> 1, i3 = al, j2 = 0, k2, lookup3 = [], result2 = [];
|
|
71334
71334
|
if (l2 === 1)
|
|
71335
71335
|
return [0];
|
|
71336
71336
|
while (i3--)
|
|
@@ -71349,9 +71349,9 @@ var require_suffix_array = __commonJS({
|
|
|
71349
71349
|
a[i3] = b2[i3] < r3 ? b2[i3] * 3 + 1 : (b2[i3] - r3) * 3 + 2;
|
|
71350
71350
|
}
|
|
71351
71351
|
for (i3 = al; i3--; )
|
|
71352
|
-
|
|
71353
|
-
|
|
71354
|
-
|
|
71352
|
+
lookup3[a[i3]] = i3;
|
|
71353
|
+
lookup3[l2] = -1;
|
|
71354
|
+
lookup3[l2 + 1] = -2;
|
|
71355
71355
|
b2 = l2 % 3 === 1 ? [l2 - 1] : [];
|
|
71356
71356
|
for (i3 = 0; i3 < al; i3++) {
|
|
71357
71357
|
if (a[i3] % 3 === 1)
|
|
@@ -71359,7 +71359,7 @@ var require_suffix_array = __commonJS({
|
|
|
71359
71359
|
}
|
|
71360
71360
|
sort(string3, b2, 0);
|
|
71361
71361
|
for (i3 = 0, j2 = 0, k2 = 0; i3 < al && j2 < bl; )
|
|
71362
|
-
result2[k2++] = compare(string3,
|
|
71362
|
+
result2[k2++] = compare(string3, lookup3, a[i3], b2[j2]) < 0 ? a[i3++] : b2[j2++];
|
|
71363
71363
|
while (i3 < al)
|
|
71364
71364
|
result2[k2++] = a[i3++];
|
|
71365
71365
|
while (j2 < bl)
|
|
@@ -90652,7 +90652,7 @@ var require_websocket = __commonJS({
|
|
|
90652
90652
|
var EventEmitter11 = __require("events");
|
|
90653
90653
|
var https3 = __require("https");
|
|
90654
90654
|
var http7 = __require("http");
|
|
90655
|
-
var
|
|
90655
|
+
var net3 = __require("net");
|
|
90656
90656
|
var tls = __require("tls");
|
|
90657
90657
|
var { randomBytes: randomBytes5, createHash: createHash18 } = __require("crypto");
|
|
90658
90658
|
var { Duplex, Readable: Readable7 } = __require("stream");
|
|
@@ -91383,12 +91383,12 @@ var require_websocket = __commonJS({
|
|
|
91383
91383
|
}
|
|
91384
91384
|
function netConnect(options) {
|
|
91385
91385
|
options.path = options.socketPath;
|
|
91386
|
-
return
|
|
91386
|
+
return net3.connect(options);
|
|
91387
91387
|
}
|
|
91388
91388
|
function tlsConnect(options) {
|
|
91389
91389
|
options.path = void 0;
|
|
91390
91390
|
if (!options.servername && options.servername !== "") {
|
|
91391
|
-
options.servername =
|
|
91391
|
+
options.servername = net3.isIP(options.host) ? "" : options.host;
|
|
91392
91392
|
}
|
|
91393
91393
|
return tls.connect(options);
|
|
91394
91394
|
}
|
|
@@ -106976,7 +106976,7 @@ var require_dist7 = __commonJS({
|
|
|
106976
106976
|
};
|
|
106977
106977
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
106978
106978
|
exports2.HttpProxyAgent = void 0;
|
|
106979
|
-
var
|
|
106979
|
+
var net3 = __importStar(__require("net"));
|
|
106980
106980
|
var tls = __importStar(__require("tls"));
|
|
106981
106981
|
var debug_1 = __importDefault(require_src());
|
|
106982
106982
|
var events_1 = __require("events");
|
|
@@ -107049,7 +107049,7 @@ var require_dist7 = __commonJS({
|
|
|
107049
107049
|
socket = tls.connect(this.connectOpts);
|
|
107050
107050
|
} else {
|
|
107051
107051
|
debug2("Creating `net.Socket`: %o", this.connectOpts);
|
|
107052
|
-
socket =
|
|
107052
|
+
socket = net3.connect(this.connectOpts);
|
|
107053
107053
|
}
|
|
107054
107054
|
await (0, events_1.once)(socket, "connect");
|
|
107055
107055
|
return socket;
|
|
@@ -121050,8 +121050,8 @@ var require_utils7 = __commonJS({
|
|
|
121050
121050
|
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
121051
121051
|
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
121052
121052
|
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
121053
|
-
function reescapeHostDelimiters(host,
|
|
121054
|
-
const re3 =
|
|
121053
|
+
function reescapeHostDelimiters(host, isIP4) {
|
|
121054
|
+
const re3 = isIP4 ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
|
|
121055
121055
|
re3.lastIndex = 0;
|
|
121056
121056
|
return host.replace(re3, (ch) => HOST_DELIMS[ch]);
|
|
121057
121057
|
}
|
|
@@ -121533,7 +121533,7 @@ var require_fast_uri = __commonJS({
|
|
|
121533
121533
|
fragment: void 0
|
|
121534
121534
|
};
|
|
121535
121535
|
let malformedAuthorityOrPort = false;
|
|
121536
|
-
let
|
|
121536
|
+
let isIP4 = false;
|
|
121537
121537
|
if (options.reference === "suffix") {
|
|
121538
121538
|
if (options.scheme) {
|
|
121539
121539
|
uri = options.scheme + ":" + uri;
|
|
@@ -121563,9 +121563,9 @@ var require_fast_uri = __commonJS({
|
|
|
121563
121563
|
if (ipv4result === false) {
|
|
121564
121564
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
121565
121565
|
parsed.host = ipv6result.host.toLowerCase();
|
|
121566
|
-
|
|
121566
|
+
isIP4 = ipv6result.isIPV6;
|
|
121567
121567
|
} else {
|
|
121568
|
-
|
|
121568
|
+
isIP4 = true;
|
|
121569
121569
|
}
|
|
121570
121570
|
}
|
|
121571
121571
|
if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) {
|
|
@@ -121582,7 +121582,7 @@ var require_fast_uri = __commonJS({
|
|
|
121582
121582
|
}
|
|
121583
121583
|
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
121584
121584
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
121585
|
-
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) &&
|
|
121585
|
+
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP4 === false && nonSimpleDomain(parsed.host)) {
|
|
121586
121586
|
try {
|
|
121587
121587
|
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
121588
121588
|
} catch (e3) {
|
|
@@ -121596,7 +121596,7 @@ var require_fast_uri = __commonJS({
|
|
|
121596
121596
|
parsed.scheme = unescape(parsed.scheme);
|
|
121597
121597
|
}
|
|
121598
121598
|
if (parsed.host !== void 0) {
|
|
121599
|
-
parsed.host = reescapeHostDelimiters(unescape(parsed.host),
|
|
121599
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP4);
|
|
121600
121600
|
}
|
|
121601
121601
|
}
|
|
121602
121602
|
if (parsed.path) {
|
|
@@ -149010,7 +149010,7 @@ var require_namespace = __commonJS({
|
|
|
149010
149010
|
});
|
|
149011
149011
|
return this;
|
|
149012
149012
|
};
|
|
149013
|
-
Namespace.prototype.lookup = function
|
|
149013
|
+
Namespace.prototype.lookup = function lookup3(path99, filterTypes, parentAlreadyChecked) {
|
|
149014
149014
|
if (typeof filterTypes === "boolean") {
|
|
149015
149015
|
parentAlreadyChecked = filterTypes;
|
|
149016
149016
|
filterTypes = void 0;
|
|
@@ -149045,7 +149045,7 @@ var require_namespace = __commonJS({
|
|
|
149045
149045
|
}
|
|
149046
149046
|
return null;
|
|
149047
149047
|
};
|
|
149048
|
-
Namespace.prototype._lookupImpl = function
|
|
149048
|
+
Namespace.prototype._lookupImpl = function lookup3(path99, flatPath) {
|
|
149049
149049
|
if (Object.prototype.hasOwnProperty.call(this._lookupCache, flatPath)) {
|
|
149050
149050
|
return this._lookupCache[flatPath];
|
|
149051
149051
|
}
|
|
@@ -158948,7 +158948,7 @@ var require_transport = __commonJS({
|
|
|
158948
158948
|
var resolver_1 = require_resolver();
|
|
158949
158949
|
var subchannel_address_1 = require_subchannel_address();
|
|
158950
158950
|
var uri_parser_1 = require_uri_parser();
|
|
158951
|
-
var
|
|
158951
|
+
var net3 = __require("net");
|
|
158952
158952
|
var subchannel_call_1 = require_subchannel_call();
|
|
158953
158953
|
var call_number_1 = require_call_number();
|
|
158954
158954
|
var TRACER_NAME2 = "transport";
|
|
@@ -159415,7 +159415,7 @@ var require_transport = __commonJS({
|
|
|
159415
159415
|
const errorCallback = (error2) => {
|
|
159416
159416
|
reject(error2);
|
|
159417
159417
|
};
|
|
159418
|
-
const socket =
|
|
159418
|
+
const socket = net3.connect(address, () => {
|
|
159419
159419
|
socket.removeListener("close", closeCallback);
|
|
159420
159420
|
socket.removeListener("error", errorCallback);
|
|
159421
159421
|
resolve23(socket);
|
|
@@ -214054,13 +214054,13 @@ var require_internet = __commonJS({
|
|
|
214054
214054
|
var require_dockerSocket = __commonJS({
|
|
214055
214055
|
"packages/core/node_modules/systeminformation/lib/dockerSocket.js"(exports2, module2) {
|
|
214056
214056
|
"use strict";
|
|
214057
|
-
var
|
|
214057
|
+
var net3 = __require("net");
|
|
214058
214058
|
var isWin = __require("os").type() === "Windows_NT";
|
|
214059
214059
|
var socketPath = isWin ? "//./pipe/docker_engine" : "/var/run/docker.sock";
|
|
214060
214060
|
var DockerSocket = class {
|
|
214061
214061
|
getInfo(callback) {
|
|
214062
214062
|
try {
|
|
214063
|
-
let socket =
|
|
214063
|
+
let socket = net3.createConnection({ path: socketPath });
|
|
214064
214064
|
let alldata = "";
|
|
214065
214065
|
let data;
|
|
214066
214066
|
socket.on("connect", () => {
|
|
@@ -214090,7 +214090,7 @@ var require_dockerSocket = __commonJS({
|
|
|
214090
214090
|
}
|
|
214091
214091
|
listImages(all2, callback) {
|
|
214092
214092
|
try {
|
|
214093
|
-
let socket =
|
|
214093
|
+
let socket = net3.createConnection({ path: socketPath });
|
|
214094
214094
|
let alldata = "";
|
|
214095
214095
|
let data;
|
|
214096
214096
|
socket.on("connect", () => {
|
|
@@ -214122,7 +214122,7 @@ var require_dockerSocket = __commonJS({
|
|
|
214122
214122
|
id = id || "";
|
|
214123
214123
|
if (id) {
|
|
214124
214124
|
try {
|
|
214125
|
-
let socket =
|
|
214125
|
+
let socket = net3.createConnection({ path: socketPath });
|
|
214126
214126
|
let alldata = "";
|
|
214127
214127
|
let data;
|
|
214128
214128
|
socket.on("connect", () => {
|
|
@@ -214155,7 +214155,7 @@ var require_dockerSocket = __commonJS({
|
|
|
214155
214155
|
}
|
|
214156
214156
|
listContainers(all2, callback) {
|
|
214157
214157
|
try {
|
|
214158
|
-
let socket =
|
|
214158
|
+
let socket = net3.createConnection({ path: socketPath });
|
|
214159
214159
|
let alldata = "";
|
|
214160
214160
|
let data;
|
|
214161
214161
|
socket.on("connect", () => {
|
|
@@ -214187,7 +214187,7 @@ var require_dockerSocket = __commonJS({
|
|
|
214187
214187
|
id = id || "";
|
|
214188
214188
|
if (id) {
|
|
214189
214189
|
try {
|
|
214190
|
-
let socket =
|
|
214190
|
+
let socket = net3.createConnection({ path: socketPath });
|
|
214191
214191
|
let alldata = "";
|
|
214192
214192
|
let data;
|
|
214193
214193
|
socket.on("connect", () => {
|
|
@@ -214222,7 +214222,7 @@ var require_dockerSocket = __commonJS({
|
|
|
214222
214222
|
id = id || "";
|
|
214223
214223
|
if (id) {
|
|
214224
214224
|
try {
|
|
214225
|
-
let socket =
|
|
214225
|
+
let socket = net3.createConnection({ path: socketPath });
|
|
214226
214226
|
let alldata = "";
|
|
214227
214227
|
let data;
|
|
214228
214228
|
socket.on("connect", () => {
|
|
@@ -214257,7 +214257,7 @@ var require_dockerSocket = __commonJS({
|
|
|
214257
214257
|
id = id || "";
|
|
214258
214258
|
if (id) {
|
|
214259
214259
|
try {
|
|
214260
|
-
let socket =
|
|
214260
|
+
let socket = net3.createConnection({ path: socketPath });
|
|
214261
214261
|
let alldata = "";
|
|
214262
214262
|
let data;
|
|
214263
214263
|
socket.on("connect", () => {
|
|
@@ -214290,7 +214290,7 @@ var require_dockerSocket = __commonJS({
|
|
|
214290
214290
|
}
|
|
214291
214291
|
listVolumes(callback) {
|
|
214292
214292
|
try {
|
|
214293
|
-
let socket =
|
|
214293
|
+
let socket = net3.createConnection({ path: socketPath });
|
|
214294
214294
|
let alldata = "";
|
|
214295
214295
|
let data;
|
|
214296
214296
|
socket.on("connect", () => {
|
|
@@ -221064,8 +221064,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
221064
221064
|
var init_git_commit = __esm({
|
|
221065
221065
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
221066
221066
|
"use strict";
|
|
221067
|
-
GIT_COMMIT_INFO = "
|
|
221068
|
-
CLI_VERSION = "0.
|
|
221067
|
+
GIT_COMMIT_INFO = "87a9c71d5";
|
|
221068
|
+
CLI_VERSION = "0.60.0-nightly.20260904.g87a9c71d5";
|
|
221069
221069
|
}
|
|
221070
221070
|
});
|
|
221071
221071
|
|
|
@@ -311667,7 +311667,7 @@ var require_util20 = __commonJS({
|
|
|
311667
311667
|
var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
|
|
311668
311668
|
var { IncomingMessage } = __require("node:http");
|
|
311669
311669
|
var stream2 = __require("node:stream");
|
|
311670
|
-
var
|
|
311670
|
+
var net3 = __require("node:net");
|
|
311671
311671
|
var { Blob: Blob4 } = __require("node:buffer");
|
|
311672
311672
|
var nodeUtil = __require("node:util");
|
|
311673
311673
|
var { stringify: stringify5 } = __require("node:querystring");
|
|
@@ -311813,7 +311813,7 @@ var require_util20 = __commonJS({
|
|
|
311813
311813
|
}
|
|
311814
311814
|
assert3(typeof host === "string");
|
|
311815
311815
|
const servername = getHostname(host);
|
|
311816
|
-
if (
|
|
311816
|
+
if (net3.isIP(servername)) {
|
|
311817
311817
|
return "";
|
|
311818
311818
|
}
|
|
311819
311819
|
return servername;
|
|
@@ -313125,7 +313125,7 @@ var require_dispatcher_base = __commonJS({
|
|
|
313125
313125
|
var require_connect = __commonJS({
|
|
313126
313126
|
"packages/core/node_modules/undici/lib/core/connect.js"(exports2, module2) {
|
|
313127
313127
|
"use strict";
|
|
313128
|
-
var
|
|
313128
|
+
var net3 = __require("node:net");
|
|
313129
313129
|
var assert3 = __require("node:assert");
|
|
313130
313130
|
var util5 = require_util20();
|
|
313131
313131
|
var { InvalidArgumentError } = require_errors7();
|
|
@@ -313179,7 +313179,7 @@ var require_connect = __commonJS({
|
|
|
313179
313179
|
}
|
|
313180
313180
|
};
|
|
313181
313181
|
}
|
|
313182
|
-
function
|
|
313182
|
+
function buildConnector2({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
|
|
313183
313183
|
if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
|
|
313184
313184
|
throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero");
|
|
313185
313185
|
}
|
|
@@ -313217,7 +313217,7 @@ var require_connect = __commonJS({
|
|
|
313217
313217
|
} else {
|
|
313218
313218
|
assert3(!httpSocket, "httpSocket can only be sent on TLS update");
|
|
313219
313219
|
port = port || 80;
|
|
313220
|
-
socket =
|
|
313220
|
+
socket = net3.connect({
|
|
313221
313221
|
highWaterMark: 64 * 1024,
|
|
313222
313222
|
// Same as nodejs fs streams.
|
|
313223
313223
|
...options,
|
|
@@ -313249,7 +313249,7 @@ var require_connect = __commonJS({
|
|
|
313249
313249
|
return socket;
|
|
313250
313250
|
};
|
|
313251
313251
|
}
|
|
313252
|
-
module2.exports =
|
|
313252
|
+
module2.exports = buildConnector2;
|
|
313253
313253
|
}
|
|
313254
313254
|
});
|
|
313255
313255
|
|
|
@@ -318363,7 +318363,7 @@ var require_client2 = __commonJS({
|
|
|
318363
318363
|
"packages/core/node_modules/undici/lib/dispatcher/client.js"(exports2, module2) {
|
|
318364
318364
|
"use strict";
|
|
318365
318365
|
var assert3 = __require("node:assert");
|
|
318366
|
-
var
|
|
318366
|
+
var net3 = __require("node:net");
|
|
318367
318367
|
var http7 = __require("node:http");
|
|
318368
318368
|
var util5 = require_util20();
|
|
318369
318369
|
var { ClientStats } = require_stats();
|
|
@@ -318375,7 +318375,7 @@ var require_client2 = __commonJS({
|
|
|
318375
318375
|
InformationalError,
|
|
318376
318376
|
ClientDestroyedError
|
|
318377
318377
|
} = require_errors7();
|
|
318378
|
-
var
|
|
318378
|
+
var buildConnector2 = require_connect();
|
|
318379
318379
|
var {
|
|
318380
318380
|
kUrl,
|
|
318381
318381
|
kServerName,
|
|
@@ -318510,7 +318510,7 @@ var require_client2 = __commonJS({
|
|
|
318510
318510
|
if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
|
|
318511
318511
|
throw new InvalidArgumentError("maxRequestsPerClient must be a positive number");
|
|
318512
318512
|
}
|
|
318513
|
-
if (localAddress != null && (typeof localAddress !== "string" ||
|
|
318513
|
+
if (localAddress != null && (typeof localAddress !== "string" || net3.isIP(localAddress) === 0)) {
|
|
318514
318514
|
throw new InvalidArgumentError("localAddress must be valid string IP address");
|
|
318515
318515
|
}
|
|
318516
318516
|
if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
|
|
@@ -318527,7 +318527,7 @@ var require_client2 = __commonJS({
|
|
|
318527
318527
|
}
|
|
318528
318528
|
super();
|
|
318529
318529
|
if (typeof connect2 !== "function") {
|
|
318530
|
-
connect2 =
|
|
318530
|
+
connect2 = buildConnector2({
|
|
318531
318531
|
...tls,
|
|
318532
318532
|
maxCachedSessions,
|
|
318533
318533
|
allowH2,
|
|
@@ -318665,7 +318665,7 @@ var require_client2 = __commonJS({
|
|
|
318665
318665
|
const idx = hostname3.indexOf("]");
|
|
318666
318666
|
assert3(idx !== -1);
|
|
318667
318667
|
const ip = hostname3.substring(1, idx);
|
|
318668
|
-
assert3(
|
|
318668
|
+
assert3(net3.isIPv6(ip));
|
|
318669
318669
|
hostname3 = ip;
|
|
318670
318670
|
}
|
|
318671
318671
|
client[kConnecting] = true;
|
|
@@ -319100,7 +319100,7 @@ var require_pool2 = __commonJS({
|
|
|
319100
319100
|
} = require_errors7();
|
|
319101
319101
|
var util5 = require_util20();
|
|
319102
319102
|
var { kUrl } = require_symbols();
|
|
319103
|
-
var
|
|
319103
|
+
var buildConnector2 = require_connect();
|
|
319104
319104
|
var kOptions = Symbol("options");
|
|
319105
319105
|
var kConnections = Symbol("connections");
|
|
319106
319106
|
var kFactory = Symbol("factory");
|
|
@@ -319133,7 +319133,7 @@ var require_pool2 = __commonJS({
|
|
|
319133
319133
|
}
|
|
319134
319134
|
super();
|
|
319135
319135
|
if (typeof connect !== "function") {
|
|
319136
|
-
connect =
|
|
319136
|
+
connect = buildConnector2({
|
|
319137
319137
|
...tls,
|
|
319138
319138
|
maxCachedSessions,
|
|
319139
319139
|
allowH2,
|
|
@@ -319448,7 +319448,7 @@ var require_proxy_agent = __commonJS({
|
|
|
319448
319448
|
var Pool = require_pool2();
|
|
319449
319449
|
var DispatcherBase = require_dispatcher_base();
|
|
319450
319450
|
var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors7();
|
|
319451
|
-
var
|
|
319451
|
+
var buildConnector2 = require_connect();
|
|
319452
319452
|
var Client3 = require_client2();
|
|
319453
319453
|
var kAgent = Symbol("proxy agent");
|
|
319454
319454
|
var kClient = Symbol("proxy client");
|
|
@@ -319546,8 +319546,8 @@ var require_proxy_agent = __commonJS({
|
|
|
319546
319546
|
}
|
|
319547
319547
|
return new Client3(origin2, options);
|
|
319548
319548
|
} : void 0;
|
|
319549
|
-
const connect =
|
|
319550
|
-
this[kConnectEndpoint] =
|
|
319549
|
+
const connect = buildConnector2({ ...opts.proxyTls });
|
|
319550
|
+
this[kConnectEndpoint] = buildConnector2({ ...opts.requestTls });
|
|
319551
319551
|
this[kClient] = clientFactory(url5, { connect, factory });
|
|
319552
319552
|
this[kTunnelProxy] = proxyTunnel;
|
|
319553
319553
|
this[kAgent] = new Agent2({
|
|
@@ -322928,8 +322928,8 @@ var require_dump = __commonJS({
|
|
|
322928
322928
|
var require_dns = __commonJS({
|
|
322929
322929
|
"packages/core/node_modules/undici/lib/interceptor/dns.js"(exports2, module2) {
|
|
322930
322930
|
"use strict";
|
|
322931
|
-
var { isIP:
|
|
322932
|
-
var { lookup:
|
|
322931
|
+
var { isIP: isIP4 } = __require("node:net");
|
|
322932
|
+
var { lookup: lookup3 } = __require("node:dns");
|
|
322933
322933
|
var DecoratorHandler = require_decorator_handler();
|
|
322934
322934
|
var { InvalidArgumentError, InformationalError } = require_errors7();
|
|
322935
322935
|
var maxInt = Math.pow(2, 31) - 1;
|
|
@@ -323019,7 +323019,7 @@ var require_dns = __commonJS({
|
|
|
323019
323019
|
}
|
|
323020
323020
|
}
|
|
323021
323021
|
#defaultLookup(origin, opts, cb) {
|
|
323022
|
-
|
|
323022
|
+
lookup3(
|
|
323023
323023
|
origin.hostname,
|
|
323024
323024
|
{
|
|
323025
323025
|
all: true,
|
|
@@ -323227,7 +323227,7 @@ var require_dns = __commonJS({
|
|
|
323227
323227
|
return (dispatch) => {
|
|
323228
323228
|
return function dnsInterceptor(origDispatchOpts, handler) {
|
|
323229
323229
|
const origin = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin);
|
|
323230
|
-
if (
|
|
323230
|
+
if (isIP4(origin.hostname) !== 0) {
|
|
323231
323231
|
return dispatch(origDispatchOpts, handler);
|
|
323232
323232
|
}
|
|
323233
323233
|
instance2.runLookup(origin, origDispatchOpts, (err2, newOrigin) => {
|
|
@@ -331337,7 +331337,7 @@ var require_undici = __commonJS({
|
|
|
331337
331337
|
var util5 = require_util20();
|
|
331338
331338
|
var { InvalidArgumentError } = errors;
|
|
331339
331339
|
var api = require_api2();
|
|
331340
|
-
var
|
|
331340
|
+
var buildConnector2 = require_connect();
|
|
331341
331341
|
var MockClient = require_mock_client();
|
|
331342
331342
|
var { MockCallHistory, MockCallHistoryLog } = require_mock_call_history();
|
|
331343
331343
|
var MockAgent = require_mock_agent();
|
|
@@ -331373,7 +331373,7 @@ var require_undici = __commonJS({
|
|
|
331373
331373
|
};
|
|
331374
331374
|
var SqliteCacheStore = require_sqlite_cache_store();
|
|
331375
331375
|
module2.exports.cacheStores.SqliteCacheStore = SqliteCacheStore;
|
|
331376
|
-
module2.exports.buildConnector =
|
|
331376
|
+
module2.exports.buildConnector = buildConnector2;
|
|
331377
331377
|
module2.exports.errors = errors;
|
|
331378
331378
|
module2.exports.util = {
|
|
331379
331379
|
parseHeaders: util5.parseHeaders,
|
|
@@ -336796,7 +336796,7 @@ function getVersion() {
|
|
|
336796
336796
|
}
|
|
336797
336797
|
versionPromise = (async () => {
|
|
336798
336798
|
const pkgJson = await getPackageJson(__dirname4);
|
|
336799
|
-
return "0.
|
|
336799
|
+
return "0.60.0-nightly.20260904.g87a9c71d5";
|
|
336800
336800
|
})();
|
|
336801
336801
|
return versionPromise;
|
|
336802
336802
|
}
|
|
@@ -359644,15 +359644,106 @@ ${result2.output}`;
|
|
|
359644
359644
|
|
|
359645
359645
|
// packages/core/dist/src/utils/fetch.js
|
|
359646
359646
|
import { URL as URL7 } from "node:url";
|
|
359647
|
+
import * as net2 from "node:net";
|
|
359648
|
+
import { lookup } from "node:dns/promises";
|
|
359649
|
+
function getBuildConnector() {
|
|
359650
|
+
try {
|
|
359651
|
+
const fn2 = undici.buildConnector;
|
|
359652
|
+
return typeof fn2 === "function" ? fn2 : void 0;
|
|
359653
|
+
} catch {
|
|
359654
|
+
return void 0;
|
|
359655
|
+
}
|
|
359656
|
+
}
|
|
359657
|
+
function safeLookup(hostname3, options, callback) {
|
|
359658
|
+
const sanitized = sanitizeHostname(hostname3);
|
|
359659
|
+
if (sanitized === "localhost" || sanitized.endsWith(".localhost") || sanitized.endsWith(".local") || sanitized.endsWith(".internal")) {
|
|
359660
|
+
callback(new PrivateIpError(`Access to internal host ${sanitized} is blocked`), "");
|
|
359661
|
+
return;
|
|
359662
|
+
}
|
|
359663
|
+
if (net2.isIP(sanitized)) {
|
|
359664
|
+
if (isAddressPrivate(sanitized)) {
|
|
359665
|
+
callback(new PrivateIpError(`Access to private IP ${sanitized} is blocked`), "");
|
|
359666
|
+
return;
|
|
359667
|
+
}
|
|
359668
|
+
if (options?.all) {
|
|
359669
|
+
callback(null, [{ address: sanitized, family: net2.isIP(sanitized) }]);
|
|
359670
|
+
} else {
|
|
359671
|
+
callback(null, sanitized, net2.isIP(sanitized));
|
|
359672
|
+
}
|
|
359673
|
+
return;
|
|
359674
|
+
}
|
|
359675
|
+
lookup(sanitized, { all: true }).then((addresses) => {
|
|
359676
|
+
if (!addresses || addresses.length === 0) {
|
|
359677
|
+
callback(new Error(`getaddrinfo ENOTFOUND ${sanitized}`), "");
|
|
359678
|
+
return;
|
|
359679
|
+
}
|
|
359680
|
+
for (const addr2 of addresses) {
|
|
359681
|
+
if (isAddressPrivate(addr2.address)) {
|
|
359682
|
+
callback(new PrivateIpError(`Access to private IP ${addr2.address} (resolved from ${sanitized}) is blocked`), "");
|
|
359683
|
+
return;
|
|
359684
|
+
}
|
|
359685
|
+
}
|
|
359686
|
+
if (options?.all) {
|
|
359687
|
+
callback(null, addresses);
|
|
359688
|
+
} else {
|
|
359689
|
+
const family = options?.family;
|
|
359690
|
+
const match2 = family ? addresses.find((a) => a.family === family) || addresses[0] : addresses[0];
|
|
359691
|
+
callback(null, match2.address, match2.family);
|
|
359692
|
+
}
|
|
359693
|
+
}).catch((err2) => {
|
|
359694
|
+
callback(err2 instanceof Error ? err2 : new Error(String(err2)), "");
|
|
359695
|
+
});
|
|
359696
|
+
}
|
|
359697
|
+
function createSafeConnector(connectorOpts, customDefaultConnector) {
|
|
359698
|
+
const buildConnectorFn = getBuildConnector();
|
|
359699
|
+
const safeConnectorOpts = {
|
|
359700
|
+
...connectorOpts,
|
|
359701
|
+
lookup: safeLookup
|
|
359702
|
+
};
|
|
359703
|
+
const defaultConnector = customDefaultConnector ?? (buildConnectorFn ? buildConnectorFn(safeConnectorOpts) : void 0);
|
|
359704
|
+
return function safeConnect(opts, callback) {
|
|
359705
|
+
if (!defaultConnector) {
|
|
359706
|
+
callback(new Error("Connector is unavailable"), null);
|
|
359707
|
+
return;
|
|
359708
|
+
}
|
|
359709
|
+
const rawHostname = opts.hostname;
|
|
359710
|
+
const sanitized = sanitizeHostname(rawHostname);
|
|
359711
|
+
if (sanitized === "localhost" || sanitized.endsWith(".localhost") || sanitized.endsWith(".local") || sanitized.endsWith(".internal")) {
|
|
359712
|
+
callback(new PrivateIpError(`Access to internal host ${sanitized} is blocked`), null);
|
|
359713
|
+
return;
|
|
359714
|
+
}
|
|
359715
|
+
if (net2.isIP(sanitized) && isAddressPrivate(sanitized)) {
|
|
359716
|
+
callback(new PrivateIpError(`Access to private IP ${sanitized} is blocked`), null);
|
|
359717
|
+
return;
|
|
359718
|
+
}
|
|
359719
|
+
defaultConnector(opts, callback);
|
|
359720
|
+
};
|
|
359721
|
+
}
|
|
359722
|
+
function createSafeAgent(options) {
|
|
359723
|
+
const buildConnectorFn = getBuildConnector();
|
|
359724
|
+
if (!buildConnectorFn) {
|
|
359725
|
+
throw new Error("Security initialization failed: undici.buildConnector is not available.");
|
|
359726
|
+
}
|
|
359727
|
+
const connect = createSafeConnector();
|
|
359728
|
+
return new undici.Agent({
|
|
359729
|
+
headersTimeout: options?.headersTimeout ?? defaultHeadersTimeout,
|
|
359730
|
+
bodyTimeout: options?.bodyTimeout ?? defaultBodyTimeout,
|
|
359731
|
+
connect
|
|
359732
|
+
});
|
|
359733
|
+
}
|
|
359647
359734
|
function updateGlobalFetchTimeouts(timeoutMs) {
|
|
359648
359735
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
359649
359736
|
throw new RangeError(`Invalid timeout value: ${timeoutMs}. Must be a positive finite number.`);
|
|
359650
359737
|
}
|
|
359651
359738
|
defaultHeadersTimeout = timeoutMs;
|
|
359739
|
+
defaultSafeAgent = createSafeAgent({
|
|
359740
|
+
headersTimeout: defaultHeadersTimeout,
|
|
359741
|
+
bodyTimeout: defaultBodyTimeout
|
|
359742
|
+
});
|
|
359652
359743
|
if (currentProxy) {
|
|
359653
359744
|
setGlobalProxy(currentProxy);
|
|
359654
359745
|
} else {
|
|
359655
|
-
|
|
359746
|
+
undici.setGlobalDispatcher(new undici.Agent({
|
|
359656
359747
|
headersTimeout: defaultHeadersTimeout,
|
|
359657
359748
|
bodyTimeout: defaultBodyTimeout
|
|
359658
359749
|
}));
|
|
@@ -359665,21 +359756,13 @@ function isLoopbackHost(hostname3) {
|
|
|
359665
359756
|
const sanitized = sanitizeHostname(hostname3);
|
|
359666
359757
|
return sanitized === "localhost" || sanitized === "127.0.0.1" || sanitized === "::1";
|
|
359667
359758
|
}
|
|
359668
|
-
function isPrivateIp(url5) {
|
|
359669
|
-
try {
|
|
359670
|
-
const hostname3 = new URL7(url5).hostname;
|
|
359671
|
-
return isAddressPrivate(hostname3);
|
|
359672
|
-
} catch {
|
|
359673
|
-
return false;
|
|
359674
|
-
}
|
|
359675
|
-
}
|
|
359676
359759
|
function isBenchmarkAddress(addr2) {
|
|
359677
359760
|
const [rangeAddr, rangeMask] = IANA_BENCHMARK_RANGE;
|
|
359678
359761
|
return addr2 instanceof import_ipaddr.default.IPv4 && rangeAddr instanceof import_ipaddr.default.IPv4 && addr2.match(rangeAddr, rangeMask);
|
|
359679
359762
|
}
|
|
359680
359763
|
function isAddressPrivate(address) {
|
|
359681
359764
|
const sanitized = sanitizeHostname(address);
|
|
359682
|
-
if (sanitized === "localhost") {
|
|
359765
|
+
if (sanitized === "localhost" || sanitized.endsWith(".localhost") || sanitized.endsWith(".local") || sanitized.endsWith(".internal")) {
|
|
359683
359766
|
return true;
|
|
359684
359767
|
}
|
|
359685
359768
|
try {
|
|
@@ -359698,7 +359781,57 @@ function isAddressPrivate(address) {
|
|
|
359698
359781
|
return true;
|
|
359699
359782
|
}
|
|
359700
359783
|
}
|
|
359784
|
+
async function isPrivateIpAsync(url5) {
|
|
359785
|
+
let parsedUrl;
|
|
359786
|
+
try {
|
|
359787
|
+
parsedUrl = new URL7(url5);
|
|
359788
|
+
} catch (error2) {
|
|
359789
|
+
if (error2 instanceof TypeError) {
|
|
359790
|
+
return false;
|
|
359791
|
+
}
|
|
359792
|
+
throw error2;
|
|
359793
|
+
}
|
|
359794
|
+
const hostname3 = sanitizeHostname(parsedUrl.hostname);
|
|
359795
|
+
if (hostname3 === "localhost" || hostname3.endsWith(".localhost") || hostname3.endsWith(".local") || hostname3.endsWith(".internal")) {
|
|
359796
|
+
return true;
|
|
359797
|
+
}
|
|
359798
|
+
if (net2.isIP(hostname3)) {
|
|
359799
|
+
return isAddressPrivate(hostname3);
|
|
359800
|
+
}
|
|
359801
|
+
try {
|
|
359802
|
+
const addresses = await lookup(hostname3, { all: true });
|
|
359803
|
+
if (!addresses || addresses.length === 0) {
|
|
359804
|
+
return true;
|
|
359805
|
+
}
|
|
359806
|
+
return addresses.some((addr2) => isAddressPrivate(addr2.address));
|
|
359807
|
+
} catch (error2) {
|
|
359808
|
+
throw new Error("Failed to verify if URL resolves to private IP", {
|
|
359809
|
+
cause: error2
|
|
359810
|
+
});
|
|
359811
|
+
}
|
|
359812
|
+
}
|
|
359813
|
+
async function isPrivateIp(url5) {
|
|
359814
|
+
try {
|
|
359815
|
+
return await isPrivateIpAsync(url5);
|
|
359816
|
+
} catch {
|
|
359817
|
+
return true;
|
|
359818
|
+
}
|
|
359819
|
+
}
|
|
359820
|
+
function createSafeProxyAgent(proxyUrl) {
|
|
359821
|
+
const trimmedProxy = proxyUrl.trim();
|
|
359822
|
+
const noProxy = (process.env["NO_PROXY"] ?? process.env["no_proxy"] ?? "")?.trim();
|
|
359823
|
+
return new undici.EnvHttpProxyAgent({
|
|
359824
|
+
httpProxy: trimmedProxy,
|
|
359825
|
+
httpsProxy: trimmedProxy,
|
|
359826
|
+
noProxy,
|
|
359827
|
+
headersTimeout: defaultHeadersTimeout,
|
|
359828
|
+
bodyTimeout: defaultBodyTimeout
|
|
359829
|
+
});
|
|
359830
|
+
}
|
|
359701
359831
|
async function fetchWithTimeout(url5, timeout, options) {
|
|
359832
|
+
if (await isPrivateIp(url5)) {
|
|
359833
|
+
throw new PrivateIpError(`Access to blocked or private host ${url5} is not allowed.`);
|
|
359834
|
+
}
|
|
359702
359835
|
const controller = new AbortController();
|
|
359703
359836
|
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
359704
359837
|
if (options?.signal) {
|
|
@@ -359711,10 +359844,14 @@ async function fetchWithTimeout(url5, timeout, options) {
|
|
|
359711
359844
|
}
|
|
359712
359845
|
}
|
|
359713
359846
|
try {
|
|
359714
|
-
const
|
|
359847
|
+
const fetchOptions = {
|
|
359715
359848
|
...options,
|
|
359716
359849
|
signal: controller.signal
|
|
359717
|
-
}
|
|
359850
|
+
};
|
|
359851
|
+
if (!fetchOptions.dispatcher) {
|
|
359852
|
+
fetchOptions.dispatcher = currentProxy ? createSafeProxyAgent(currentProxy) : defaultSafeAgent;
|
|
359853
|
+
}
|
|
359854
|
+
const response = await fetch(url5, fetchOptions);
|
|
359718
359855
|
return response;
|
|
359719
359856
|
} catch (error2) {
|
|
359720
359857
|
if (isAbortError(error2)) {
|
|
@@ -359723,6 +359860,14 @@ async function fetchWithTimeout(url5, timeout, options) {
|
|
|
359723
359860
|
}
|
|
359724
359861
|
throw new FetchError3(`Request timed out after ${timeout}ms`, "ETIMEDOUT");
|
|
359725
359862
|
}
|
|
359863
|
+
if (error2 instanceof PrivateIpError) {
|
|
359864
|
+
throw error2;
|
|
359865
|
+
}
|
|
359866
|
+
if (error2 && typeof error2 === "object" && "cause" in error2) {
|
|
359867
|
+
if (error2.cause instanceof PrivateIpError) {
|
|
359868
|
+
throw error2.cause;
|
|
359869
|
+
}
|
|
359870
|
+
}
|
|
359726
359871
|
throw new FetchError3(getErrorMessage(error2), void 0, { cause: error2 });
|
|
359727
359872
|
} finally {
|
|
359728
359873
|
clearTimeout(timeoutId);
|
|
@@ -359732,7 +359877,7 @@ function setGlobalProxy(proxy2) {
|
|
|
359732
359877
|
const trimmedProxy = proxy2.trim();
|
|
359733
359878
|
currentProxy = trimmedProxy;
|
|
359734
359879
|
const noProxy = (process.env["NO_PROXY"] ?? process.env["no_proxy"] ?? "")?.trim();
|
|
359735
|
-
|
|
359880
|
+
undici.setGlobalDispatcher(new undici.EnvHttpProxyAgent({
|
|
359736
359881
|
httpProxy: trimmedProxy,
|
|
359737
359882
|
httpsProxy: trimmedProxy,
|
|
359738
359883
|
noProxy,
|
|
@@ -359740,12 +359885,12 @@ function setGlobalProxy(proxy2) {
|
|
|
359740
359885
|
bodyTimeout: defaultBodyTimeout
|
|
359741
359886
|
}));
|
|
359742
359887
|
}
|
|
359743
|
-
var
|
|
359888
|
+
var undici, import_ipaddr, FetchError3, PrivateIpError, defaultHeadersTimeout, defaultBodyTimeout, currentProxy, defaultSafeAgent, IANA_BENCHMARK_RANGE;
|
|
359744
359889
|
var init_fetch = __esm({
|
|
359745
359890
|
"packages/core/dist/src/utils/fetch.js"() {
|
|
359746
359891
|
"use strict";
|
|
359747
359892
|
init_errors2();
|
|
359748
|
-
|
|
359893
|
+
undici = __toESM(require_undici(), 1);
|
|
359749
359894
|
import_ipaddr = __toESM(require_ipaddr(), 1);
|
|
359750
359895
|
FetchError3 = class extends Error {
|
|
359751
359896
|
code;
|
|
@@ -359755,10 +359900,17 @@ var init_fetch = __esm({
|
|
|
359755
359900
|
this.name = "FetchError";
|
|
359756
359901
|
}
|
|
359757
359902
|
};
|
|
359903
|
+
PrivateIpError = class extends Error {
|
|
359904
|
+
constructor(message = "Access to private network is blocked") {
|
|
359905
|
+
super(message);
|
|
359906
|
+
this.name = "PrivateIpError";
|
|
359907
|
+
}
|
|
359908
|
+
};
|
|
359758
359909
|
defaultHeadersTimeout = 6e4;
|
|
359759
359910
|
defaultBodyTimeout = 3e5;
|
|
359760
359911
|
currentProxy = void 0;
|
|
359761
|
-
|
|
359912
|
+
defaultSafeAgent = createSafeAgent();
|
|
359913
|
+
undici.setGlobalDispatcher(new undici.Agent({
|
|
359762
359914
|
headersTimeout: defaultHeadersTimeout,
|
|
359763
359915
|
bodyTimeout: defaultBodyTimeout
|
|
359764
359916
|
}));
|
|
@@ -365132,21 +365284,21 @@ var init_web_fetch = __esm({
|
|
|
365132
365284
|
});
|
|
365133
365285
|
logNetworkRetryAttempt(this.context.config, new NetworkRetryAttemptEvent(attempt, maxAttempts, errorType, delayMs, modelName));
|
|
365134
365286
|
}
|
|
365135
|
-
isBlockedHost(urlStr) {
|
|
365287
|
+
async isBlockedHost(urlStr) {
|
|
365136
365288
|
try {
|
|
365137
365289
|
const url5 = new URL(urlStr);
|
|
365138
365290
|
const hostname3 = url5.hostname.toLowerCase();
|
|
365139
|
-
if (hostname3 === "localhost" || hostname3 === "127.0.0.1") {
|
|
365291
|
+
if (hostname3 === "localhost" || hostname3 === "127.0.0.1" || hostname3.endsWith(".localhost") || hostname3.endsWith(".local") || hostname3.endsWith(".internal")) {
|
|
365140
365292
|
return true;
|
|
365141
365293
|
}
|
|
365142
|
-
return isPrivateIp(urlStr);
|
|
365294
|
+
return await isPrivateIp(urlStr);
|
|
365143
365295
|
} catch {
|
|
365144
365296
|
return true;
|
|
365145
365297
|
}
|
|
365146
365298
|
}
|
|
365147
365299
|
async executeFallbackForUrl(urlStr, signal) {
|
|
365148
365300
|
const url5 = convertGithubUrlToRaw(urlStr);
|
|
365149
|
-
if (this.isBlockedHost(url5)) {
|
|
365301
|
+
if (await this.isBlockedHost(url5)) {
|
|
365150
365302
|
debugLogger.warn(`[WebFetchTool] Blocked access to host: ${url5}`);
|
|
365151
365303
|
throw new Error(`Access to blocked or private host ${url5} is not allowed.`);
|
|
365152
365304
|
}
|
|
@@ -365188,12 +365340,12 @@ var init_web_fetch = __esm({
|
|
|
365188
365340
|
}
|
|
365189
365341
|
return textContent2;
|
|
365190
365342
|
}
|
|
365191
|
-
filterAndValidateUrls(urls) {
|
|
365343
|
+
async filterAndValidateUrls(urls) {
|
|
365192
365344
|
const uniqueUrls = [...new Set(urls.map(normalizeUrl))];
|
|
365193
365345
|
const toFetch = [];
|
|
365194
365346
|
const skipped = [];
|
|
365195
365347
|
for (const url5 of uniqueUrls) {
|
|
365196
|
-
if (this.isBlockedHost(url5)) {
|
|
365348
|
+
if (await this.isBlockedHost(url5)) {
|
|
365197
365349
|
debugLogger.warn(`[WebFetchTool] Skipped private or local host: ${url5}`);
|
|
365198
365350
|
logWebFetchFallbackAttempt(this.context.config, new WebFetchFallbackAttemptEvent("private_ip_skipped"));
|
|
365199
365351
|
skipped.push(`[Blocked Host] ${url5}`);
|
|
@@ -365383,7 +365535,7 @@ ${aggregatedContent}
|
|
|
365383
365535
|
};
|
|
365384
365536
|
}
|
|
365385
365537
|
url5 = convertGithubUrlToRaw(url5);
|
|
365386
|
-
if (this.isBlockedHost(url5)) {
|
|
365538
|
+
if (await this.isBlockedHost(url5)) {
|
|
365387
365539
|
const errorMessage = `Access to blocked or private host ${url5} is not allowed.`;
|
|
365388
365540
|
debugLogger.warn(`[WebFetchTool] Blocked experimental fetch to host: ${url5}`);
|
|
365389
365541
|
return {
|
|
@@ -365497,7 +365649,7 @@ Response: ${rawResponseText}`;
|
|
|
365497
365649
|
}
|
|
365498
365650
|
const userPrompt = this.params.prompt;
|
|
365499
365651
|
const { validUrls } = parsePrompt(userPrompt);
|
|
365500
|
-
const { toFetch, skipped } = this.filterAndValidateUrls(validUrls);
|
|
365652
|
+
const { toFetch, skipped } = await this.filterAndValidateUrls(validUrls);
|
|
365501
365653
|
if (toFetch.length === 0 && skipped.length > 0) {
|
|
365502
365654
|
const errorMessage = `All requested URLs were skipped: ${skipped.join(", ")}`;
|
|
365503
365655
|
debugLogger.error(`[WebFetchTool] ${errorMessage}`);
|
|
@@ -374546,7 +374698,7 @@ var init_http_provider = __esm({
|
|
|
374546
374698
|
});
|
|
374547
374699
|
|
|
374548
374700
|
// packages/core/dist/src/mcp/oauth-utils.js
|
|
374549
|
-
import { lookup } from "node:dns/promises";
|
|
374701
|
+
import { lookup as lookup2 } from "node:dns/promises";
|
|
374550
374702
|
function isLoopbackUrl(urlStr) {
|
|
374551
374703
|
try {
|
|
374552
374704
|
const url5 = new URL(urlStr);
|
|
@@ -374601,7 +374753,7 @@ async function validateOAuthEndpointUrl(urlStr, options) {
|
|
|
374601
374753
|
throw new OAuthSecurityError(`OAuth endpoint "${resolvedUrl}" points to private or reserved IP address which is blocked.`);
|
|
374602
374754
|
}
|
|
374603
374755
|
try {
|
|
374604
|
-
const addresses = await
|
|
374756
|
+
const addresses = await lookup2(hostname3, { all: true });
|
|
374605
374757
|
if (!addresses || addresses.length === 0) {
|
|
374606
374758
|
throw new OAuthSecurityError(`Failed to resolve hostname "${hostname3}" for OAuth endpoint "${resolvedUrl}".`);
|
|
374607
374759
|
}
|
|
@@ -378502,7 +378654,29 @@ function generatePKCEParams() {
|
|
|
378502
378654
|
const state = crypto20.randomBytes(16).toString("base64url");
|
|
378503
378655
|
return { codeVerifier, codeChallenge, state };
|
|
378504
378656
|
}
|
|
378505
|
-
function
|
|
378657
|
+
function areIssuersEqual(issuerA, issuerB) {
|
|
378658
|
+
if (issuerA === issuerB && !issuerA.includes("@"))
|
|
378659
|
+
return true;
|
|
378660
|
+
const normalize6 = (iss) => {
|
|
378661
|
+
try {
|
|
378662
|
+
const u2 = new URL8(iss);
|
|
378663
|
+
if (u2.username || u2.password) {
|
|
378664
|
+
return null;
|
|
378665
|
+
}
|
|
378666
|
+
const normalizedPath = u2.pathname.replace(/\/+$/, "");
|
|
378667
|
+
return `${u2.protocol}//${u2.host}${normalizedPath}${u2.search}${u2.hash}`;
|
|
378668
|
+
} catch {
|
|
378669
|
+
return iss.replace(/\/+$/, "");
|
|
378670
|
+
}
|
|
378671
|
+
};
|
|
378672
|
+
const normA = normalize6(issuerA);
|
|
378673
|
+
const normB = normalize6(issuerB);
|
|
378674
|
+
if (normA === null || normB === null) {
|
|
378675
|
+
return false;
|
|
378676
|
+
}
|
|
378677
|
+
return normA === normB;
|
|
378678
|
+
}
|
|
378679
|
+
function startCallbackServer(expectedState, port, expectedIssuer) {
|
|
378506
378680
|
let portResolve;
|
|
378507
378681
|
let portReject;
|
|
378508
378682
|
const portPromise = new Promise((resolve23, reject) => {
|
|
@@ -378523,7 +378697,9 @@ function startCallbackServer(expectedState, port) {
|
|
|
378523
378697
|
const code = url5.searchParams.get("code");
|
|
378524
378698
|
const state = url5.searchParams.get("state");
|
|
378525
378699
|
const error2 = url5.searchParams.get("error");
|
|
378700
|
+
const iss = url5.searchParams.get("iss") || void 0;
|
|
378526
378701
|
if (error2) {
|
|
378702
|
+
debugLogger.warn(`OAuth callback received error: ${error2}`);
|
|
378527
378703
|
res.writeHead(HTTP_OK, { "Content-Type": "text/html" });
|
|
378528
378704
|
res.end(`
|
|
378529
378705
|
<html>
|
|
@@ -378540,17 +378716,56 @@ function startCallbackServer(expectedState, port) {
|
|
|
378540
378716
|
return;
|
|
378541
378717
|
}
|
|
378542
378718
|
if (!code || !state) {
|
|
378719
|
+
debugLogger.warn("OAuth callback rejected: Missing code or state parameter.");
|
|
378543
378720
|
res.writeHead(400);
|
|
378544
378721
|
res.end("Missing code or state parameter");
|
|
378545
378722
|
return;
|
|
378546
378723
|
}
|
|
378547
378724
|
if (state !== expectedState) {
|
|
378725
|
+
debugLogger.error(`OAuth callback state mismatch: received state "${state}", expected "${expectedState}". Possible CSRF attack.`);
|
|
378548
378726
|
res.writeHead(400);
|
|
378549
378727
|
res.end("Invalid state parameter");
|
|
378550
378728
|
server.close();
|
|
378551
378729
|
reject(new Error("State mismatch - possible CSRF attack"));
|
|
378552
378730
|
return;
|
|
378553
378731
|
}
|
|
378732
|
+
if (expectedIssuer) {
|
|
378733
|
+
if (!iss) {
|
|
378734
|
+
debugLogger.error('OAuth callback rejected: Missing required "iss" parameter when an expected issuer is configured. Possible IdP mix-up attack (RFC 9207).');
|
|
378735
|
+
res.writeHead(400, { "Content-Type": "text/html" });
|
|
378736
|
+
res.end(`
|
|
378737
|
+
<html>
|
|
378738
|
+
<body>
|
|
378739
|
+
<h1>Authentication Failed</h1>
|
|
378740
|
+
<p>Error: Missing issuer parameter in response.</p>
|
|
378741
|
+
<p>You can close this window.</p>
|
|
378742
|
+
</body>
|
|
378743
|
+
</html>
|
|
378744
|
+
`);
|
|
378745
|
+
server.close();
|
|
378746
|
+
reject(new Error('Missing "iss" parameter in authorization response per RFC 9207'));
|
|
378747
|
+
return;
|
|
378748
|
+
}
|
|
378749
|
+
if (!areIssuersEqual(iss, expectedIssuer)) {
|
|
378750
|
+
debugLogger.error("OAuth callback rejected: Issuer mismatch between authorization response and expected authorization server. Possible IdP mix-up attack (RFC 9207).");
|
|
378751
|
+
res.writeHead(400, { "Content-Type": "text/html" });
|
|
378752
|
+
res.end(`
|
|
378753
|
+
<html>
|
|
378754
|
+
<body>
|
|
378755
|
+
<h1>Authentication Failed</h1>
|
|
378756
|
+
<p>Error: Issuer mismatch - possible OAuth mix-up attack.</p>
|
|
378757
|
+
<p>You can close this window.</p>
|
|
378758
|
+
</body>
|
|
378759
|
+
</html>
|
|
378760
|
+
`);
|
|
378761
|
+
server.close();
|
|
378762
|
+
reject(new Error("Issuer mismatch in authorization response - possible OAuth mix-up attack"));
|
|
378763
|
+
return;
|
|
378764
|
+
}
|
|
378765
|
+
debugLogger.debug("\u2713 OAuth callback issuer validated successfully.");
|
|
378766
|
+
} else if (iss) {
|
|
378767
|
+
debugLogger.debug('OAuth callback received "iss" parameter (no expected issuer was configured).');
|
|
378768
|
+
}
|
|
378554
378769
|
res.writeHead(HTTP_OK, { "Content-Type": "text/html" });
|
|
378555
378770
|
res.end(`
|
|
378556
378771
|
<html>
|
|
@@ -378562,7 +378777,7 @@ function startCallbackServer(expectedState, port) {
|
|
|
378562
378777
|
</html>
|
|
378563
378778
|
`);
|
|
378564
378779
|
server.close();
|
|
378565
|
-
resolve23({ code, state });
|
|
378780
|
+
resolve23({ code, state, iss });
|
|
378566
378781
|
} catch (error2) {
|
|
378567
378782
|
server.close();
|
|
378568
378783
|
reject(error2);
|
|
@@ -407781,7 +407996,8 @@ var init_oauth_provider = __esm({
|
|
|
407781
407996
|
}
|
|
407782
407997
|
const pkceParams = generatePKCEParams();
|
|
407783
407998
|
const preferredPort = getPortFromUrl(config2.redirectUri);
|
|
407784
|
-
|
|
407999
|
+
debugLogger.debug(`Starting callback server for "${serverName}" (expected issuer: ${config2.issuer || "none"})...`);
|
|
408000
|
+
const callbackServer = startCallbackServer(pkceParams.state, preferredPort, config2.issuer);
|
|
407785
408001
|
const redirectPort = await callbackServer.port;
|
|
407786
408002
|
debugLogger.debug(`Callback server listening on port ${redirectPort}`);
|
|
407787
408003
|
if (!config2.clientId) {
|
|
@@ -408626,7 +408842,7 @@ async function connectToMcpServer(clientVersion, mcpServerName, mcpServerConfig,
|
|
|
408626
408842
|
}
|
|
408627
408843
|
function createUrlTransport(mcpServerName, mcpServerConfig, transportOptions) {
|
|
408628
408844
|
const noProxy = process.env["NO_PROXY"] || process.env["no_proxy"];
|
|
408629
|
-
const agent = new
|
|
408845
|
+
const agent = new import_undici2.EnvHttpProxyAgent({ noProxy });
|
|
408630
408846
|
const baseFetch = transportOptions.fetch ?? globalThis.fetch;
|
|
408631
408847
|
const httpOptions = {
|
|
408632
408848
|
...transportOptions,
|
|
@@ -408753,7 +408969,7 @@ function isEnabled(funcDecl, mcpServerName, mcpServerConfig) {
|
|
|
408753
408969
|
}
|
|
408754
408970
|
return !includeTools || includeTools.some((tool) => tool === funcDecl.name || tool.startsWith(`${funcDecl.name}(`));
|
|
408755
408971
|
}
|
|
408756
|
-
var
|
|
408972
|
+
var import_undici2, import_shell_quote7, MCP_DEFAULT_TIMEOUT_MSEC, MCPServerStatus, MCPDiscoveryState, McpClient, serverStatuses, mcpDiscoveryState, mcpServerRequiresOAuth, statusChangeListeners, LenientJsonSchemaValidator, McpCallableTool2;
|
|
408757
408973
|
var init_mcp_client = __esm({
|
|
408758
408974
|
"packages/core/dist/src/tools/mcp-client.js"() {
|
|
408759
408975
|
"use strict";
|
|
@@ -408762,7 +408978,7 @@ var init_mcp_client = __esm({
|
|
|
408762
408978
|
init_sse();
|
|
408763
408979
|
init_stdio3();
|
|
408764
408980
|
init_streamableHttp();
|
|
408765
|
-
|
|
408981
|
+
import_undici2 = __toESM(require_undici(), 1);
|
|
408766
408982
|
init_types12();
|
|
408767
408983
|
import_shell_quote7 = __toESM(require_shell_quote(), 1);
|
|
408768
408984
|
init_config4();
|
|
@@ -414251,7 +414467,7 @@ var init_dist_node = __esm({
|
|
|
414251
414467
|
});
|
|
414252
414468
|
|
|
414253
414469
|
// packages/core/dist/src/agents/a2a-client-manager.js
|
|
414254
|
-
var grpc2,
|
|
414470
|
+
var grpc2, import_undici3, A2A_TIMEOUT, A2AClientManager;
|
|
414255
414471
|
var init_a2a_client_manager = __esm({
|
|
414256
414472
|
"packages/core/dist/src/agents/a2a-client-manager.js"() {
|
|
414257
414473
|
"use strict";
|
|
@@ -414259,7 +414475,7 @@ var init_a2a_client_manager = __esm({
|
|
|
414259
414475
|
init_grpc();
|
|
414260
414476
|
grpc2 = __toESM(require_src25(), 1);
|
|
414261
414477
|
init_dist_node();
|
|
414262
|
-
|
|
414478
|
+
import_undici3 = __toESM(require_undici(), 1);
|
|
414263
414479
|
init_a2aUtils();
|
|
414264
414480
|
init_debugLogger();
|
|
414265
414481
|
init_a2a_errors();
|
|
@@ -414279,12 +414495,12 @@ var init_a2a_client_manager = __esm({
|
|
|
414279
414495
|
bodyTimeout: A2A_TIMEOUT
|
|
414280
414496
|
};
|
|
414281
414497
|
if (proxyUrl) {
|
|
414282
|
-
this.a2aDispatcher = new
|
|
414498
|
+
this.a2aDispatcher = new import_undici3.ProxyAgent({
|
|
414283
414499
|
uri: proxyUrl,
|
|
414284
414500
|
...agentOptions
|
|
414285
414501
|
});
|
|
414286
414502
|
} else {
|
|
414287
|
-
this.a2aDispatcher = new
|
|
414503
|
+
this.a2aDispatcher = new import_undici3.Agent(agentOptions);
|
|
414288
414504
|
}
|
|
414289
414505
|
this.a2aFetch = (input, init2) => fetch(input, { ...init2, dispatcher: this.a2aDispatcher });
|
|
414290
414506
|
}
|