@google/gemini-cli-a2a-server 0.33.0-preview.0 → 0.33.0-preview.10
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 +371 -362
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/a2a-server.mjs
CHANGED
|
@@ -155,7 +155,7 @@ var require_has_flag = __commonJS({
|
|
|
155
155
|
var require_supports_colors = __commonJS({
|
|
156
156
|
"node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
|
|
157
157
|
"use strict";
|
|
158
|
-
var
|
|
158
|
+
var os23 = __require("os");
|
|
159
159
|
var hasFlag = require_has_flag();
|
|
160
160
|
var env2 = process.env;
|
|
161
161
|
var forceColor = void 0;
|
|
@@ -193,7 +193,7 @@ var require_supports_colors = __commonJS({
|
|
|
193
193
|
}
|
|
194
194
|
var min = forceColor ? 1 : 0;
|
|
195
195
|
if (process.platform === "win32") {
|
|
196
|
-
var osRelease =
|
|
196
|
+
var osRelease = os23.release().split(".");
|
|
197
197
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
198
198
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
199
199
|
}
|
|
@@ -5439,7 +5439,7 @@ var require_winston_transport = __commonJS({
|
|
|
5439
5439
|
var require_console = __commonJS({
|
|
5440
5440
|
"node_modules/winston/lib/winston/transports/console.js"(exports2, module2) {
|
|
5441
5441
|
"use strict";
|
|
5442
|
-
var
|
|
5442
|
+
var os23 = __require("os");
|
|
5443
5443
|
var { LEVEL, MESSAGE } = require_triple_beam();
|
|
5444
5444
|
var TransportStream = require_winston_transport();
|
|
5445
5445
|
module2.exports = class Console extends TransportStream {
|
|
@@ -5453,7 +5453,7 @@ var require_console = __commonJS({
|
|
|
5453
5453
|
this.name = options.name || "console";
|
|
5454
5454
|
this.stderrLevels = this._stringArrayToSet(options.stderrLevels);
|
|
5455
5455
|
this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
|
|
5456
|
-
this.eol = typeof options.eol === "string" ? options.eol :
|
|
5456
|
+
this.eol = typeof options.eol === "string" ? options.eol : os23.EOL;
|
|
5457
5457
|
this.forceConsole = options.forceConsole || false;
|
|
5458
5458
|
this._consoleLog = console.log.bind(console);
|
|
5459
5459
|
this._consoleWarn = console.warn.bind(console);
|
|
@@ -8467,7 +8467,7 @@ var require_file = __commonJS({
|
|
|
8467
8467
|
var { Stream: Stream7, PassThrough: PassThrough8 } = require_readable();
|
|
8468
8468
|
var TransportStream = require_winston_transport();
|
|
8469
8469
|
var debug2 = require_node2()("winston:file");
|
|
8470
|
-
var
|
|
8470
|
+
var os23 = __require("os");
|
|
8471
8471
|
var tailFile = require_tail_file();
|
|
8472
8472
|
module2.exports = class File extends TransportStream {
|
|
8473
8473
|
/**
|
|
@@ -8505,7 +8505,7 @@ var require_file = __commonJS({
|
|
|
8505
8505
|
this.rotationFormat = options.rotationFormat || false;
|
|
8506
8506
|
this.zippedArchive = options.zippedArchive || false;
|
|
8507
8507
|
this.maxFiles = options.maxFiles || null;
|
|
8508
|
-
this.eol = typeof options.eol === "string" ? options.eol :
|
|
8508
|
+
this.eol = typeof options.eol === "string" ? options.eol : os23.EOL;
|
|
8509
8509
|
this.tailable = options.tailable || false;
|
|
8510
8510
|
this.lazy = options.lazy || false;
|
|
8511
8511
|
this._size = 0;
|
|
@@ -9286,7 +9286,7 @@ var require_stream2 = __commonJS({
|
|
|
9286
9286
|
"use strict";
|
|
9287
9287
|
var isStream4 = require_is_stream();
|
|
9288
9288
|
var { MESSAGE } = require_triple_beam();
|
|
9289
|
-
var
|
|
9289
|
+
var os23 = __require("os");
|
|
9290
9290
|
var TransportStream = require_winston_transport();
|
|
9291
9291
|
module2.exports = class Stream extends TransportStream {
|
|
9292
9292
|
/**
|
|
@@ -9302,7 +9302,7 @@ var require_stream2 = __commonJS({
|
|
|
9302
9302
|
this._stream = options.stream;
|
|
9303
9303
|
this._stream.setMaxListeners(Infinity);
|
|
9304
9304
|
this.isObjectMode = options.stream._writableState.objectMode;
|
|
9305
|
-
this.eol = typeof options.eol === "string" ? options.eol :
|
|
9305
|
+
this.eol = typeof options.eol === "string" ? options.eol : os23.EOL;
|
|
9306
9306
|
}
|
|
9307
9307
|
/**
|
|
9308
9308
|
* Core logging method exposed to Winston.
|
|
@@ -9685,7 +9685,7 @@ var require_exception_stream = __commonJS({
|
|
|
9685
9685
|
var require_exception_handler = __commonJS({
|
|
9686
9686
|
"node_modules/winston/lib/winston/exception-handler.js"(exports2, module2) {
|
|
9687
9687
|
"use strict";
|
|
9688
|
-
var
|
|
9688
|
+
var os23 = __require("os");
|
|
9689
9689
|
var asyncForEach = require_forEach();
|
|
9690
9690
|
var debug2 = require_node2()("winston:exception");
|
|
9691
9691
|
var once10 = require_one_time();
|
|
@@ -9780,8 +9780,8 @@ var require_exception_handler = __commonJS({
|
|
|
9780
9780
|
*/
|
|
9781
9781
|
getOsInfo() {
|
|
9782
9782
|
return {
|
|
9783
|
-
loadavg:
|
|
9784
|
-
uptime:
|
|
9783
|
+
loadavg: os23.loadavg(),
|
|
9784
|
+
uptime: os23.uptime()
|
|
9785
9785
|
};
|
|
9786
9786
|
}
|
|
9787
9787
|
/**
|
|
@@ -9923,7 +9923,7 @@ var require_rejection_stream = __commonJS({
|
|
|
9923
9923
|
var require_rejection_handler = __commonJS({
|
|
9924
9924
|
"node_modules/winston/lib/winston/rejection-handler.js"(exports2, module2) {
|
|
9925
9925
|
"use strict";
|
|
9926
|
-
var
|
|
9926
|
+
var os23 = __require("os");
|
|
9927
9927
|
var asyncForEach = require_forEach();
|
|
9928
9928
|
var debug2 = require_node2()("winston:rejection");
|
|
9929
9929
|
var once10 = require_one_time();
|
|
@@ -10020,8 +10020,8 @@ var require_rejection_handler = __commonJS({
|
|
|
10020
10020
|
*/
|
|
10021
10021
|
getOsInfo() {
|
|
10022
10022
|
return {
|
|
10023
|
-
loadavg:
|
|
10024
|
-
uptime:
|
|
10023
|
+
loadavg: os23.loadavg(),
|
|
10024
|
+
uptime: os23.uptime()
|
|
10025
10025
|
};
|
|
10026
10026
|
}
|
|
10027
10027
|
/**
|
|
@@ -11289,7 +11289,7 @@ var require_has_flag2 = __commonJS({
|
|
|
11289
11289
|
var require_supports_color = __commonJS({
|
|
11290
11290
|
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
11291
11291
|
"use strict";
|
|
11292
|
-
var
|
|
11292
|
+
var os23 = __require("os");
|
|
11293
11293
|
var hasFlag = require_has_flag2();
|
|
11294
11294
|
var env2 = process.env;
|
|
11295
11295
|
var forceColor;
|
|
@@ -11327,7 +11327,7 @@ var require_supports_color = __commonJS({
|
|
|
11327
11327
|
}
|
|
11328
11328
|
const min = forceColor ? 1 : 0;
|
|
11329
11329
|
if (process.platform === "win32") {
|
|
11330
|
-
const osRelease =
|
|
11330
|
+
const osRelease = os23.release().split(".");
|
|
11331
11331
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
11332
11332
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
11333
11333
|
}
|
|
@@ -53565,7 +53565,7 @@ var require_googleauth = __commonJS({
|
|
|
53565
53565
|
var child_process_1 = __require("child_process");
|
|
53566
53566
|
var fs75 = __require("fs");
|
|
53567
53567
|
var gcpMetadata = require_src6();
|
|
53568
|
-
var
|
|
53568
|
+
var os23 = __require("os");
|
|
53569
53569
|
var path90 = __require("path");
|
|
53570
53570
|
var crypto_1 = require_crypto3();
|
|
53571
53571
|
var transporters_1 = require_transporters();
|
|
@@ -54006,7 +54006,7 @@ var require_googleauth = __commonJS({
|
|
|
54006
54006
|
* @api private
|
|
54007
54007
|
*/
|
|
54008
54008
|
_isWindows() {
|
|
54009
|
-
const sys =
|
|
54009
|
+
const sys = os23.platform();
|
|
54010
54010
|
if (sys && sys.length >= 3) {
|
|
54011
54011
|
if (sys.substring(0, 3).toLowerCase() === "win") {
|
|
54012
54012
|
return true;
|
|
@@ -58813,7 +58813,7 @@ var require_polyfills = __commonJS({
|
|
|
58813
58813
|
var constants6 = __require("constants");
|
|
58814
58814
|
var origCwd = process.cwd;
|
|
58815
58815
|
var cwd = null;
|
|
58816
|
-
var
|
|
58816
|
+
var platform14 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
58817
58817
|
process.cwd = function() {
|
|
58818
58818
|
if (!cwd)
|
|
58819
58819
|
cwd = origCwd.call(process);
|
|
@@ -58872,7 +58872,7 @@ var require_polyfills = __commonJS({
|
|
|
58872
58872
|
fs75.lchownSync = function() {
|
|
58873
58873
|
};
|
|
58874
58874
|
}
|
|
58875
|
-
if (
|
|
58875
|
+
if (platform14 === "win32") {
|
|
58876
58876
|
fs75.rename = typeof fs75.rename !== "function" ? fs75.rename : function(fs$rename) {
|
|
58877
58877
|
function rename(from, to, cb) {
|
|
58878
58878
|
var start2 = Date.now();
|
|
@@ -69541,7 +69541,7 @@ var require_util4 = __commonJS({
|
|
|
69541
69541
|
exports2.isValidFile = isValidFile;
|
|
69542
69542
|
exports2.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
|
|
69543
69543
|
var fs75 = __require("fs");
|
|
69544
|
-
var
|
|
69544
|
+
var os23 = __require("os");
|
|
69545
69545
|
var path90 = __require("path");
|
|
69546
69546
|
var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
|
|
69547
69547
|
var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
|
|
@@ -69639,7 +69639,7 @@ var require_util4 = __commonJS({
|
|
|
69639
69639
|
return path90.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
|
|
69640
69640
|
}
|
|
69641
69641
|
function _isWindows() {
|
|
69642
|
-
return
|
|
69642
|
+
return os23.platform().startsWith("win");
|
|
69643
69643
|
}
|
|
69644
69644
|
}
|
|
69645
69645
|
});
|
|
@@ -74411,7 +74411,7 @@ var require_googleauth2 = __commonJS({
|
|
|
74411
74411
|
var fs75 = __require("fs");
|
|
74412
74412
|
var gaxios_1 = require_src14();
|
|
74413
74413
|
var gcpMetadata = require_src16();
|
|
74414
|
-
var
|
|
74414
|
+
var os23 = __require("os");
|
|
74415
74415
|
var path90 = __require("path");
|
|
74416
74416
|
var crypto_1 = require_crypto6();
|
|
74417
74417
|
var computeclient_1 = require_computeclient2();
|
|
@@ -74914,7 +74914,7 @@ var require_googleauth2 = __commonJS({
|
|
|
74914
74914
|
* @api private
|
|
74915
74915
|
*/
|
|
74916
74916
|
_isWindows() {
|
|
74917
|
-
const sys =
|
|
74917
|
+
const sys = os23.platform();
|
|
74918
74918
|
if (sys && sys.length >= 3) {
|
|
74919
74919
|
if (sys.substring(0, 3).toLowerCase() === "win") {
|
|
74920
74920
|
return true;
|
|
@@ -94419,24 +94419,24 @@ var init_node = __esm({
|
|
|
94419
94419
|
return `other:${arch4}`;
|
|
94420
94420
|
return "unknown";
|
|
94421
94421
|
};
|
|
94422
|
-
normalizePlatform = (
|
|
94423
|
-
|
|
94424
|
-
if (
|
|
94422
|
+
normalizePlatform = (platform14) => {
|
|
94423
|
+
platform14 = platform14.toLowerCase();
|
|
94424
|
+
if (platform14.includes("ios"))
|
|
94425
94425
|
return "iOS";
|
|
94426
|
-
if (
|
|
94426
|
+
if (platform14 === "android")
|
|
94427
94427
|
return "Android";
|
|
94428
|
-
if (
|
|
94428
|
+
if (platform14 === "darwin")
|
|
94429
94429
|
return "MacOS";
|
|
94430
|
-
if (
|
|
94430
|
+
if (platform14 === "win32")
|
|
94431
94431
|
return "Windows";
|
|
94432
|
-
if (
|
|
94432
|
+
if (platform14 === "freebsd")
|
|
94433
94433
|
return "FreeBSD";
|
|
94434
|
-
if (
|
|
94434
|
+
if (platform14 === "openbsd")
|
|
94435
94435
|
return "OpenBSD";
|
|
94436
|
-
if (
|
|
94436
|
+
if (platform14 === "linux")
|
|
94437
94437
|
return "Linux";
|
|
94438
|
-
if (
|
|
94439
|
-
return `Other:${
|
|
94438
|
+
if (platform14)
|
|
94439
|
+
return `Other:${platform14}`;
|
|
94440
94440
|
return "Unknown";
|
|
94441
94441
|
};
|
|
94442
94442
|
getPlatformHeaders = () => {
|
|
@@ -99717,7 +99717,7 @@ var require_util6 = __commonJS({
|
|
|
99717
99717
|
exports2.isValidFile = isValidFile;
|
|
99718
99718
|
exports2.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
|
|
99719
99719
|
var fs75 = __require("fs");
|
|
99720
|
-
var
|
|
99720
|
+
var os23 = __require("os");
|
|
99721
99721
|
var path90 = __require("path");
|
|
99722
99722
|
var WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
|
|
99723
99723
|
var CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
|
|
@@ -99815,7 +99815,7 @@ var require_util6 = __commonJS({
|
|
|
99815
99815
|
return path90.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
|
|
99816
99816
|
}
|
|
99817
99817
|
function _isWindows() {
|
|
99818
|
-
return
|
|
99818
|
+
return os23.platform().startsWith("win");
|
|
99819
99819
|
}
|
|
99820
99820
|
}
|
|
99821
99821
|
});
|
|
@@ -104587,7 +104587,7 @@ var require_googleauth3 = __commonJS({
|
|
|
104587
104587
|
var fs75 = __require("fs");
|
|
104588
104588
|
var gaxios_1 = require_src19();
|
|
104589
104589
|
var gcpMetadata = require_src21();
|
|
104590
|
-
var
|
|
104590
|
+
var os23 = __require("os");
|
|
104591
104591
|
var path90 = __require("path");
|
|
104592
104592
|
var crypto_1 = require_crypto9();
|
|
104593
104593
|
var computeclient_1 = require_computeclient3();
|
|
@@ -105090,7 +105090,7 @@ var require_googleauth3 = __commonJS({
|
|
|
105090
105090
|
* @api private
|
|
105091
105091
|
*/
|
|
105092
105092
|
_isWindows() {
|
|
105093
|
-
const sys =
|
|
105093
|
+
const sys = os23.platform();
|
|
105094
105094
|
if (sys && sys.length >= 3) {
|
|
105095
105095
|
if (sys.substring(0, 3).toLowerCase() === "win") {
|
|
105096
105096
|
return true;
|
|
@@ -106263,6 +106263,14 @@ var init_open = __esm({
|
|
|
106263
106263
|
});
|
|
106264
106264
|
|
|
106265
106265
|
// packages/core/dist/src/utils/googleErrors.js
|
|
106266
|
+
function sanitizeJsonString(jsonStr) {
|
|
106267
|
+
let prev;
|
|
106268
|
+
do {
|
|
106269
|
+
prev = jsonStr;
|
|
106270
|
+
jsonStr = jsonStr.replace(/,(\s*),/g, ",$1");
|
|
106271
|
+
} while (jsonStr !== prev);
|
|
106272
|
+
return jsonStr;
|
|
106273
|
+
}
|
|
106266
106274
|
function parseGoogleApiError(error2) {
|
|
106267
106275
|
if (!error2) {
|
|
106268
106276
|
return null;
|
|
@@ -106270,7 +106278,7 @@ function parseGoogleApiError(error2) {
|
|
|
106270
106278
|
let errorObj = error2;
|
|
106271
106279
|
if (typeof errorObj === "string") {
|
|
106272
106280
|
try {
|
|
106273
|
-
errorObj = JSON.parse(errorObj);
|
|
106281
|
+
errorObj = JSON.parse(sanitizeJsonString(errorObj));
|
|
106274
106282
|
} catch (_) {
|
|
106275
106283
|
return null;
|
|
106276
106284
|
}
|
|
@@ -106286,7 +106294,7 @@ function parseGoogleApiError(error2) {
|
|
|
106286
106294
|
const maxDepth = 10;
|
|
106287
106295
|
while (currentError && typeof currentError.message === "string" && depth < maxDepth) {
|
|
106288
106296
|
try {
|
|
106289
|
-
const parsedMessage = JSON.parse(currentError.message.replace(/\u00A0/g, "").replace(/\n/g, " "));
|
|
106297
|
+
const parsedMessage = JSON.parse(sanitizeJsonString(currentError.message.replace(/\u00A0/g, "").replace(/\n/g, " ")));
|
|
106290
106298
|
if (parsedMessage.error) {
|
|
106291
106299
|
currentError = parsedMessage.error;
|
|
106292
106300
|
depth++;
|
|
@@ -106340,7 +106348,7 @@ function fromGaxiosError(errorObj) {
|
|
|
106340
106348
|
let data = gaxiosError.response.data;
|
|
106341
106349
|
if (typeof data === "string") {
|
|
106342
106350
|
try {
|
|
106343
|
-
data = JSON.parse(data);
|
|
106351
|
+
data = JSON.parse(sanitizeJsonString(data));
|
|
106344
106352
|
} catch (_) {
|
|
106345
106353
|
}
|
|
106346
106354
|
}
|
|
@@ -106372,14 +106380,14 @@ function fromApiError(errorObj) {
|
|
|
106372
106380
|
let data = apiError.message;
|
|
106373
106381
|
if (typeof data === "string") {
|
|
106374
106382
|
try {
|
|
106375
|
-
data = JSON.parse(data);
|
|
106383
|
+
data = JSON.parse(sanitizeJsonString(data));
|
|
106376
106384
|
} catch (_) {
|
|
106377
106385
|
if (typeof data === "string") {
|
|
106378
106386
|
const firstBrace = data.indexOf("{");
|
|
106379
106387
|
const lastBrace = data.lastIndexOf("}");
|
|
106380
106388
|
if (firstBrace !== -1 && lastBrace !== -1 && lastBrace > firstBrace) {
|
|
106381
106389
|
try {
|
|
106382
|
-
data = JSON.parse(data.substring(firstBrace, lastBrace + 1));
|
|
106390
|
+
data = JSON.parse(sanitizeJsonString(data.substring(firstBrace, lastBrace + 1)));
|
|
106383
106391
|
} catch (__) {
|
|
106384
106392
|
}
|
|
106385
106393
|
}
|
|
@@ -106747,8 +106755,8 @@ function isSubpath(parentPath, childPath) {
|
|
|
106747
106755
|
const relative6 = pathModule2.relative(parentPath, childPath);
|
|
106748
106756
|
return !relative6.startsWith(`..${pathModule2.sep}`) && relative6 !== ".." && !pathModule2.isAbsolute(relative6);
|
|
106749
106757
|
}
|
|
106750
|
-
function resolveToRealPath(
|
|
106751
|
-
let resolvedPath =
|
|
106758
|
+
function resolveToRealPath(pathStr) {
|
|
106759
|
+
let resolvedPath = pathStr;
|
|
106752
106760
|
try {
|
|
106753
106761
|
if (resolvedPath.startsWith("file://")) {
|
|
106754
106762
|
resolvedPath = fileURLToPath2(resolvedPath);
|
|
@@ -106756,10 +106764,36 @@ function resolveToRealPath(path90) {
|
|
|
106756
106764
|
resolvedPath = decodeURIComponent(resolvedPath);
|
|
106757
106765
|
} catch (_e) {
|
|
106758
106766
|
}
|
|
106767
|
+
return robustRealpath(path11.resolve(resolvedPath));
|
|
106768
|
+
}
|
|
106769
|
+
function robustRealpath(p, visited = /* @__PURE__ */ new Set()) {
|
|
106770
|
+
const key = process.platform === "win32" ? p.toLowerCase() : p;
|
|
106771
|
+
if (visited.has(key)) {
|
|
106772
|
+
throw new Error(`Infinite recursion detected in robustRealpath: ${p}`);
|
|
106773
|
+
}
|
|
106774
|
+
visited.add(key);
|
|
106759
106775
|
try {
|
|
106760
|
-
return fs20.realpathSync(
|
|
106761
|
-
} catch (
|
|
106762
|
-
|
|
106776
|
+
return fs20.realpathSync(p);
|
|
106777
|
+
} catch (e3) {
|
|
106778
|
+
if (e3 && typeof e3 === "object" && "code" in e3 && e3.code === "ENOENT") {
|
|
106779
|
+
try {
|
|
106780
|
+
const stat4 = fs20.lstatSync(p);
|
|
106781
|
+
if (stat4.isSymbolicLink()) {
|
|
106782
|
+
const target = fs20.readlinkSync(p);
|
|
106783
|
+
const resolvedTarget = path11.resolve(path11.dirname(p), target);
|
|
106784
|
+
return robustRealpath(resolvedTarget, visited);
|
|
106785
|
+
}
|
|
106786
|
+
} catch (lstatError) {
|
|
106787
|
+
if (!(lstatError && typeof lstatError === "object" && "code" in lstatError && lstatError.code === "ENOENT")) {
|
|
106788
|
+
throw lstatError;
|
|
106789
|
+
}
|
|
106790
|
+
}
|
|
106791
|
+
const parent = path11.dirname(p);
|
|
106792
|
+
if (parent === p)
|
|
106793
|
+
return p;
|
|
106794
|
+
return path11.join(robustRealpath(parent, visited), path11.basename(p));
|
|
106795
|
+
}
|
|
106796
|
+
throw e3;
|
|
106763
106797
|
}
|
|
106764
106798
|
}
|
|
106765
106799
|
var GEMINI_DIR, GOOGLE_ACCOUNTS_FILENAME;
|
|
@@ -122500,10 +122534,36 @@ var init_tools = __esm({
|
|
|
122500
122534
|
|
|
122501
122535
|
// packages/core/dist/src/tools/mcp-tool.js
|
|
122502
122536
|
function isMcpToolName(name4) {
|
|
122503
|
-
|
|
122504
|
-
|
|
122505
|
-
|
|
122506
|
-
|
|
122537
|
+
return name4.startsWith(MCP_TOOL_PREFIX);
|
|
122538
|
+
}
|
|
122539
|
+
function parseMcpToolName(name4) {
|
|
122540
|
+
if (!isMcpToolName(name4)) {
|
|
122541
|
+
return {};
|
|
122542
|
+
}
|
|
122543
|
+
const withoutPrefix = name4.slice(MCP_TOOL_PREFIX.length);
|
|
122544
|
+
const match2 = withoutPrefix.match(/^([^_]+)_(.+)$/);
|
|
122545
|
+
if (match2) {
|
|
122546
|
+
return {
|
|
122547
|
+
serverName: match2[1],
|
|
122548
|
+
toolName: match2[2]
|
|
122549
|
+
};
|
|
122550
|
+
}
|
|
122551
|
+
return {};
|
|
122552
|
+
}
|
|
122553
|
+
function formatMcpToolName(serverName, toolName) {
|
|
122554
|
+
if (serverName === "*" && !toolName) {
|
|
122555
|
+
return `${MCP_TOOL_PREFIX}*`;
|
|
122556
|
+
} else if (serverName === "*") {
|
|
122557
|
+
return `${MCP_TOOL_PREFIX}*_${toolName}`;
|
|
122558
|
+
} else if (!toolName) {
|
|
122559
|
+
return `${MCP_TOOL_PREFIX}${serverName}_*`;
|
|
122560
|
+
} else {
|
|
122561
|
+
return `${MCP_TOOL_PREFIX}${serverName}_${toolName}`;
|
|
122562
|
+
}
|
|
122563
|
+
}
|
|
122564
|
+
function isMcpToolAnnotation(annotation) {
|
|
122565
|
+
return typeof annotation === "object" && annotation !== null && // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
122566
|
+
typeof annotation["_serverName"] === "string";
|
|
122507
122567
|
}
|
|
122508
122568
|
function transformTextBlock(block) {
|
|
122509
122569
|
return { text: block.text };
|
|
@@ -122598,24 +122658,28 @@ function getStringifiedResultForDisplay(rawResponse) {
|
|
|
122598
122658
|
return displayParts.join("\n");
|
|
122599
122659
|
}
|
|
122600
122660
|
function generateValidName(name4) {
|
|
122601
|
-
let validToolname = name4.
|
|
122661
|
+
let validToolname = name4.startsWith("mcp_") ? name4 : `mcp_${name4}`;
|
|
122662
|
+
validToolname = validToolname.replace(/[^a-zA-Z0-9_\-.:]/g, "_");
|
|
122602
122663
|
if (/^[^a-zA-Z_]/.test(validToolname)) {
|
|
122603
122664
|
validToolname = `_${validToolname}`;
|
|
122604
122665
|
}
|
|
122605
122666
|
const safeLimit = MAX_FUNCTION_NAME_LENGTH - 1;
|
|
122606
122667
|
if (validToolname.length > safeLimit) {
|
|
122668
|
+
debugLogger.warn(`Truncating MCP tool name "${validToolname}" to fit within the 64 character limit. This tool may require user approval.`);
|
|
122607
122669
|
validToolname = validToolname.slice(0, 30) + "..." + validToolname.slice(-30);
|
|
122608
122670
|
}
|
|
122609
122671
|
return validToolname;
|
|
122610
122672
|
}
|
|
122611
|
-
var MCP_QUALIFIED_NAME_SEPARATOR, DiscoveredMCPToolInvocation, DiscoveredMCPTool, MAX_FUNCTION_NAME_LENGTH;
|
|
122673
|
+
var MCP_QUALIFIED_NAME_SEPARATOR, MCP_TOOL_PREFIX, DiscoveredMCPToolInvocation, DiscoveredMCPTool, MAX_FUNCTION_NAME_LENGTH;
|
|
122612
122674
|
var init_mcp_tool = __esm({
|
|
122613
122675
|
"packages/core/dist/src/tools/mcp-tool.js"() {
|
|
122614
122676
|
"use strict";
|
|
122615
122677
|
init_safeJsonStringify();
|
|
122678
|
+
init_debugLogger();
|
|
122616
122679
|
init_tools();
|
|
122617
122680
|
init_tool_error();
|
|
122618
|
-
MCP_QUALIFIED_NAME_SEPARATOR = "
|
|
122681
|
+
MCP_QUALIFIED_NAME_SEPARATOR = "_";
|
|
122682
|
+
MCP_TOOL_PREFIX = "mcp_";
|
|
122619
122683
|
DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends BaseToolInvocation {
|
|
122620
122684
|
mcpTool;
|
|
122621
122685
|
serverName;
|
|
@@ -122757,7 +122821,7 @@ var init_mcp_tool = __esm({
|
|
|
122757
122821
|
_toolAnnotations;
|
|
122758
122822
|
constructor(mcpTool, serverName, serverToolName, description, parameterSchema, messageBus, trust, isReadOnly, nameOverride, cliConfig, extensionName, extensionId, _toolAnnotations) {
|
|
122759
122823
|
super(
|
|
122760
|
-
|
|
122824
|
+
nameOverride ?? generateValidName(`${serverName}${MCP_QUALIFIED_NAME_SEPARATOR}${serverToolName}`),
|
|
122761
122825
|
`${serverToolName} (${serverName} MCP Server)`,
|
|
122762
122826
|
description,
|
|
122763
122827
|
Kind.Other,
|
|
@@ -122792,7 +122856,7 @@ var init_mcp_tool = __esm({
|
|
|
122792
122856
|
return this._toolAnnotations;
|
|
122793
122857
|
}
|
|
122794
122858
|
getFullyQualifiedPrefix() {
|
|
122795
|
-
return `${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}
|
|
122859
|
+
return generateValidName(`${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}`);
|
|
122796
122860
|
}
|
|
122797
122861
|
getFullyQualifiedName() {
|
|
122798
122862
|
return generateValidName(`${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}${this.serverToolName}`);
|
|
@@ -129762,7 +129826,7 @@ async function initOauthClient(authType, config3) {
|
|
|
129762
129826
|
}
|
|
129763
129827
|
await triggerPostAuthCallbacks(client.credentials);
|
|
129764
129828
|
} else {
|
|
129765
|
-
if (!config3.
|
|
129829
|
+
if (!config3.getAcpMode()) {
|
|
129766
129830
|
const userConsent = await getConsentForOauth("");
|
|
129767
129831
|
if (!userConsent) {
|
|
129768
129832
|
throw new FatalCancellationError("Authentication cancelled by user.");
|
|
@@ -134399,7 +134463,8 @@ var init_billing = __esm({
|
|
|
134399
134463
|
G1_CREDIT_TYPE = "GOOGLE_ONE_AI";
|
|
134400
134464
|
OVERAGE_ELIGIBLE_MODELS = /* @__PURE__ */ new Set([
|
|
134401
134465
|
PREVIEW_GEMINI_MODEL,
|
|
134402
|
-
PREVIEW_GEMINI_3_1_MODEL
|
|
134466
|
+
PREVIEW_GEMINI_3_1_MODEL,
|
|
134467
|
+
PREVIEW_GEMINI_FLASH_MODEL
|
|
134403
134468
|
]);
|
|
134404
134469
|
MIN_CREDIT_BALANCE = 50;
|
|
134405
134470
|
}
|
|
@@ -137624,7 +137689,7 @@ var require_service_config = __commonJS({
|
|
|
137624
137689
|
exports2.validateRetryThrottling = validateRetryThrottling;
|
|
137625
137690
|
exports2.validateServiceConfig = validateServiceConfig;
|
|
137626
137691
|
exports2.extractAndSelectServiceConfig = extractAndSelectServiceConfig;
|
|
137627
|
-
var
|
|
137692
|
+
var os23 = __require("os");
|
|
137628
137693
|
var constants_1 = require_constants3();
|
|
137629
137694
|
var DURATION_REGEX = /^\d+(\.\d{1,9})?s$/;
|
|
137630
137695
|
var CLIENT_LANGUAGE_STRING = "node";
|
|
@@ -137923,7 +137988,7 @@ var require_service_config = __commonJS({
|
|
|
137923
137988
|
if (Array.isArray(validatedConfig.clientHostname)) {
|
|
137924
137989
|
let hostnameMatched = false;
|
|
137925
137990
|
for (const hostname3 of validatedConfig.clientHostname) {
|
|
137926
|
-
if (hostname3 ===
|
|
137991
|
+
if (hostname3 === os23.hostname()) {
|
|
137927
137992
|
hostnameMatched = true;
|
|
137928
137993
|
}
|
|
137929
137994
|
}
|
|
@@ -151444,7 +151509,7 @@ var require_subchannel_call = __commonJS({
|
|
|
151444
151509
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
151445
151510
|
exports2.Http2SubchannelCall = void 0;
|
|
151446
151511
|
var http22 = __require("http2");
|
|
151447
|
-
var
|
|
151512
|
+
var os23 = __require("os");
|
|
151448
151513
|
var constants_1 = require_constants3();
|
|
151449
151514
|
var metadata_1 = require_metadata4();
|
|
151450
151515
|
var stream_decoder_1 = require_stream_decoder();
|
|
@@ -151452,7 +151517,7 @@ var require_subchannel_call = __commonJS({
|
|
|
151452
151517
|
var constants_2 = require_constants3();
|
|
151453
151518
|
var TRACER_NAME2 = "subchannel_call";
|
|
151454
151519
|
function getSystemErrorName(errno) {
|
|
151455
|
-
for (const [name4, num] of Object.entries(
|
|
151520
|
+
for (const [name4, num] of Object.entries(os23.constants.errno)) {
|
|
151456
151521
|
if (num === errno) {
|
|
151457
151522
|
return name4;
|
|
151458
151523
|
}
|
|
@@ -171836,7 +171901,7 @@ var require_ProcessDetector = __commonJS({
|
|
|
171836
171901
|
exports2.processDetector = void 0;
|
|
171837
171902
|
var api_1 = (init_esm2(), __toCommonJS(esm_exports4));
|
|
171838
171903
|
var semconv_1 = require_semconv2();
|
|
171839
|
-
var
|
|
171904
|
+
var os23 = __require("os");
|
|
171840
171905
|
var ProcessDetector = class {
|
|
171841
171906
|
detect(_config) {
|
|
171842
171907
|
const attributes = {
|
|
@@ -171856,7 +171921,7 @@ var require_ProcessDetector = __commonJS({
|
|
|
171856
171921
|
attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
|
|
171857
171922
|
}
|
|
171858
171923
|
try {
|
|
171859
|
-
const userInfo2 =
|
|
171924
|
+
const userInfo2 = os23.userInfo();
|
|
171860
171925
|
attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo2.username;
|
|
171861
171926
|
} catch (e3) {
|
|
171862
171927
|
api_1.diag.debug(`error obtaining process owner: ${e3}`);
|
|
@@ -191366,7 +191431,7 @@ var require_package10 = __commonJS({
|
|
|
191366
191431
|
var require_util13 = __commonJS({
|
|
191367
191432
|
"node_modules/systeminformation/lib/util.js"(exports2) {
|
|
191368
191433
|
"use strict";
|
|
191369
|
-
var
|
|
191434
|
+
var os23 = __require("os");
|
|
191370
191435
|
var fs75 = __require("fs");
|
|
191371
191436
|
var path90 = __require("path");
|
|
191372
191437
|
var spawn10 = __require("child_process").spawn;
|
|
@@ -191473,7 +191538,7 @@ var require_util13 = __commonJS({
|
|
|
191473
191538
|
}
|
|
191474
191539
|
function cores() {
|
|
191475
191540
|
if (_cores === 0) {
|
|
191476
|
-
_cores =
|
|
191541
|
+
_cores = os23.cpus().length;
|
|
191477
191542
|
}
|
|
191478
191543
|
return _cores;
|
|
191479
191544
|
}
|
|
@@ -191734,7 +191799,7 @@ var require_util13 = __commonJS({
|
|
|
191734
191799
|
function powerShellRelease() {
|
|
191735
191800
|
try {
|
|
191736
191801
|
if (_psChild) {
|
|
191737
|
-
_psChild.stdin.write("exit" +
|
|
191802
|
+
_psChild.stdin.write("exit" + os23.EOL);
|
|
191738
191803
|
_psChild.stdin.end();
|
|
191739
191804
|
}
|
|
191740
191805
|
} catch {
|
|
@@ -191761,7 +191826,7 @@ var require_util13 = __commonJS({
|
|
|
191761
191826
|
});
|
|
191762
191827
|
try {
|
|
191763
191828
|
if (_psChild && _psChild.pid) {
|
|
191764
|
-
_psChild.stdin.write(_psToUTF8 + "echo " + _psCmdStart + id + _psIdSeperator + "; " +
|
|
191829
|
+
_psChild.stdin.write(_psToUTF8 + "echo " + _psCmdStart + id + _psIdSeperator + "; " + os23.EOL + cmd + os23.EOL + "echo " + _psCmdSeperator + os23.EOL);
|
|
191765
191830
|
}
|
|
191766
191831
|
} catch {
|
|
191767
191832
|
resolve20("");
|
|
@@ -191773,7 +191838,7 @@ var require_util13 = __commonJS({
|
|
|
191773
191838
|
return new Promise((resolve20) => {
|
|
191774
191839
|
process.nextTick(() => {
|
|
191775
191840
|
try {
|
|
191776
|
-
const osVersion =
|
|
191841
|
+
const osVersion = os23.release().split(".").map(Number);
|
|
191777
191842
|
const spanOptions = osVersion[0] < 10 ? ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-ExecutionPolicy", "Unrestricted", "-Command", "-"] : ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-ExecutionPolicy", "Unrestricted", "-Command", _psToUTF8 + cmd];
|
|
191778
191843
|
const child = spawn10(_powerShell, spanOptions, {
|
|
191779
191844
|
stdio: "pipe",
|
|
@@ -191805,8 +191870,8 @@ var require_util13 = __commonJS({
|
|
|
191805
191870
|
});
|
|
191806
191871
|
if (osVersion[0] < 10) {
|
|
191807
191872
|
try {
|
|
191808
|
-
child.stdin.write(_psToUTF8 + cmd +
|
|
191809
|
-
child.stdin.write("exit" +
|
|
191873
|
+
child.stdin.write(_psToUTF8 + cmd + os23.EOL);
|
|
191874
|
+
child.stdin.write("exit" + os23.EOL);
|
|
191810
191875
|
child.stdin.end();
|
|
191811
191876
|
} catch {
|
|
191812
191877
|
child.kill();
|
|
@@ -192071,14 +192136,14 @@ var require_util13 = __commonJS({
|
|
|
192071
192136
|
return ("00000000" + parseInt(hex, 16).toString(2)).substr(-8);
|
|
192072
192137
|
}
|
|
192073
192138
|
function getFilesInPath(source) {
|
|
192074
|
-
const
|
|
192139
|
+
const lstatSync3 = fs75.lstatSync;
|
|
192075
192140
|
const readdirSync4 = fs75.readdirSync;
|
|
192076
192141
|
const join34 = path90.join;
|
|
192077
192142
|
function isDirectory(source2) {
|
|
192078
|
-
return
|
|
192143
|
+
return lstatSync3(source2).isDirectory();
|
|
192079
192144
|
}
|
|
192080
192145
|
function isFile3(source2) {
|
|
192081
|
-
return
|
|
192146
|
+
return lstatSync3(source2).isFile();
|
|
192082
192147
|
}
|
|
192083
192148
|
function getDirectories(source2) {
|
|
192084
192149
|
return readdirSync4(source2).map((name4) => {
|
|
@@ -193874,7 +193939,7 @@ var require_util13 = __commonJS({
|
|
|
193874
193939
|
var require_osinfo = __commonJS({
|
|
193875
193940
|
"node_modules/systeminformation/lib/osinfo.js"(exports2) {
|
|
193876
193941
|
"use strict";
|
|
193877
|
-
var
|
|
193942
|
+
var os23 = __require("os");
|
|
193878
193943
|
var fs75 = __require("fs");
|
|
193879
193944
|
var util5 = require_util13();
|
|
193880
193945
|
var exec3 = __require("child_process").exec;
|
|
@@ -193897,14 +193962,14 @@ var require_osinfo = __commonJS({
|
|
|
193897
193962
|
}
|
|
193898
193963
|
const result2 = {
|
|
193899
193964
|
current: Date.now(),
|
|
193900
|
-
uptime:
|
|
193965
|
+
uptime: os23.uptime(),
|
|
193901
193966
|
timezone: t3.length >= 7 ? t3[5] : "",
|
|
193902
193967
|
timezoneName
|
|
193903
193968
|
};
|
|
193904
193969
|
if (_darwin || _linux) {
|
|
193905
193970
|
try {
|
|
193906
193971
|
const stdout = execSync4("date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null", util5.execOptsLinux);
|
|
193907
|
-
const lines = stdout.toString().split(
|
|
193972
|
+
const lines = stdout.toString().split(os23.EOL);
|
|
193908
193973
|
if (lines.length > 3 && !lines[0]) {
|
|
193909
193974
|
lines.shift();
|
|
193910
193975
|
}
|
|
@@ -193914,7 +193979,7 @@ var require_osinfo = __commonJS({
|
|
|
193914
193979
|
}
|
|
193915
193980
|
return {
|
|
193916
193981
|
current: Date.now(),
|
|
193917
|
-
uptime:
|
|
193982
|
+
uptime: os23.uptime(),
|
|
193918
193983
|
timezone: lines[1] ? timezone + lines[1] : timezone,
|
|
193919
193984
|
timezoneName: lines[2] && lines[2].indexOf("/zoneinfo/") > 0 ? lines[2].split("/zoneinfo/")[1] || "" : ""
|
|
193920
193985
|
};
|
|
@@ -194033,11 +194098,11 @@ var require_osinfo = __commonJS({
|
|
|
194033
194098
|
return "";
|
|
194034
194099
|
}
|
|
194035
194100
|
function getFQDN() {
|
|
194036
|
-
let fqdn =
|
|
194101
|
+
let fqdn = os23.hostname;
|
|
194037
194102
|
if (_linux || _darwin) {
|
|
194038
194103
|
try {
|
|
194039
194104
|
const stdout = execSync4("hostname -f 2>/dev/null", util5.execOptsLinux);
|
|
194040
|
-
fqdn = stdout.toString().split(
|
|
194105
|
+
fqdn = stdout.toString().split(os23.EOL)[0];
|
|
194041
194106
|
} catch {
|
|
194042
194107
|
util5.noop();
|
|
194043
194108
|
}
|
|
@@ -194045,7 +194110,7 @@ var require_osinfo = __commonJS({
|
|
|
194045
194110
|
if (_freebsd || _openbsd || _netbsd) {
|
|
194046
194111
|
try {
|
|
194047
194112
|
const stdout = execSync4("hostname 2>/dev/null");
|
|
194048
|
-
fqdn = stdout.toString().split(
|
|
194113
|
+
fqdn = stdout.toString().split(os23.EOL)[0];
|
|
194049
194114
|
} catch {
|
|
194050
194115
|
util5.noop();
|
|
194051
194116
|
}
|
|
@@ -194053,7 +194118,7 @@ var require_osinfo = __commonJS({
|
|
|
194053
194118
|
if (_windows) {
|
|
194054
194119
|
try {
|
|
194055
194120
|
const stdout = execSync4("echo %COMPUTERNAME%.%USERDNSDOMAIN%", util5.execOptsWin);
|
|
194056
|
-
fqdn = stdout.toString().replace(".%USERDNSDOMAIN%", "").split(
|
|
194121
|
+
fqdn = stdout.toString().replace(".%USERDNSDOMAIN%", "").split(os23.EOL)[0];
|
|
194057
194122
|
} catch {
|
|
194058
194123
|
util5.noop();
|
|
194059
194124
|
}
|
|
@@ -194068,9 +194133,9 @@ var require_osinfo = __commonJS({
|
|
|
194068
194133
|
distro: "unknown",
|
|
194069
194134
|
release: "unknown",
|
|
194070
194135
|
codename: "",
|
|
194071
|
-
kernel:
|
|
194072
|
-
arch:
|
|
194073
|
-
hostname:
|
|
194136
|
+
kernel: os23.release(),
|
|
194137
|
+
arch: os23.arch(),
|
|
194138
|
+
hostname: os23.hostname(),
|
|
194074
194139
|
fqdn: getFQDN(),
|
|
194075
194140
|
codepage: "",
|
|
194076
194141
|
logofile: "",
|
|
@@ -194279,7 +194344,7 @@ var require_osinfo = __commonJS({
|
|
|
194279
194344
|
}
|
|
194280
194345
|
function versions(apps2, callback) {
|
|
194281
194346
|
let versionObject = {
|
|
194282
|
-
kernel:
|
|
194347
|
+
kernel: os23.release(),
|
|
194283
194348
|
apache: "",
|
|
194284
194349
|
bash: "",
|
|
194285
194350
|
bun: "",
|
|
@@ -194989,7 +195054,7 @@ var require_osinfo = __commonJS({
|
|
|
194989
195054
|
function getUniqueMacAdresses() {
|
|
194990
195055
|
let macs = [];
|
|
194991
195056
|
try {
|
|
194992
|
-
const ifaces =
|
|
195057
|
+
const ifaces = os23.networkInterfaces();
|
|
194993
195058
|
for (let dev in ifaces) {
|
|
194994
195059
|
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
|
194995
195060
|
ifaces[dev].forEach((details) => {
|
|
@@ -195111,7 +195176,7 @@ var require_system = __commonJS({
|
|
|
195111
195176
|
"node_modules/systeminformation/lib/system.js"(exports2) {
|
|
195112
195177
|
"use strict";
|
|
195113
195178
|
var fs75 = __require("fs");
|
|
195114
|
-
var
|
|
195179
|
+
var os23 = __require("os");
|
|
195115
195180
|
var util5 = require_util13();
|
|
195116
195181
|
var { uuid: uuid2 } = require_osinfo();
|
|
195117
195182
|
var exec3 = __require("child_process").exec;
|
|
@@ -195235,8 +195300,8 @@ var require_system = __commonJS({
|
|
|
195235
195300
|
util5.noop();
|
|
195236
195301
|
}
|
|
195237
195302
|
}
|
|
195238
|
-
if (!result2.virtual && (
|
|
195239
|
-
const kernelVersion = parseFloat(
|
|
195303
|
+
if (!result2.virtual && (os23.release().toLowerCase().indexOf("microsoft") >= 0 || os23.release().toLowerCase().endsWith("wsl2"))) {
|
|
195304
|
+
const kernelVersion = parseFloat(os23.release().toLowerCase());
|
|
195240
195305
|
result2.virtual = true;
|
|
195241
195306
|
result2.manufacturer = "Microsoft";
|
|
195242
195307
|
result2.model = "WSL";
|
|
@@ -195646,7 +195711,7 @@ var require_system = __commonJS({
|
|
|
195646
195711
|
result2.model = "Raspberry Pi";
|
|
195647
195712
|
result2.serial = rpi.serial;
|
|
195648
195713
|
result2.version = rpi.type + " - " + rpi.revision;
|
|
195649
|
-
result2.memMax =
|
|
195714
|
+
result2.memMax = os23.totalmem();
|
|
195650
195715
|
result2.memSlots = 0;
|
|
195651
195716
|
}
|
|
195652
195717
|
if (callback) {
|
|
@@ -195672,9 +195737,9 @@ var require_system = __commonJS({
|
|
|
195672
195737
|
}
|
|
195673
195738
|
devices.shift();
|
|
195674
195739
|
result2.memSlots = devices.length;
|
|
195675
|
-
if (
|
|
195740
|
+
if (os23.arch() === "arm64") {
|
|
195676
195741
|
result2.memSlots = 0;
|
|
195677
|
-
result2.memMax =
|
|
195742
|
+
result2.memMax = os23.totalmem();
|
|
195678
195743
|
}
|
|
195679
195744
|
if (callback) {
|
|
195680
195745
|
callback(result2);
|
|
@@ -195691,7 +195756,7 @@ var require_system = __commonJS({
|
|
|
195691
195756
|
if (_windows) {
|
|
195692
195757
|
try {
|
|
195693
195758
|
const workload = [];
|
|
195694
|
-
const win10plus = parseInt(
|
|
195759
|
+
const win10plus = parseInt(os23.release()) >= 10;
|
|
195695
195760
|
const maxCapacityAttribute = win10plus ? "MaxCapacityEx" : "MaxCapacity";
|
|
195696
195761
|
workload.push(util5.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl"));
|
|
195697
195762
|
workload.push(util5.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
|
|
@@ -195887,7 +195952,7 @@ var require_system = __commonJS({
|
|
|
195887
195952
|
var require_cpu = __commonJS({
|
|
195888
195953
|
"node_modules/systeminformation/lib/cpu.js"(exports2) {
|
|
195889
195954
|
"use strict";
|
|
195890
|
-
var
|
|
195955
|
+
var os23 = __require("os");
|
|
195891
195956
|
var exec3 = __require("child_process").exec;
|
|
195892
195957
|
var execSync4 = __require("child_process").execSync;
|
|
195893
195958
|
var fs75 = __require("fs");
|
|
@@ -196750,7 +196815,7 @@ var require_cpu = __commonJS({
|
|
|
196750
196815
|
const countProcessors = util5.getValue(lines, "hw.packages");
|
|
196751
196816
|
const countCores = util5.getValue(lines, "hw.physicalcpu_max");
|
|
196752
196817
|
const countThreads = util5.getValue(lines, "hw.ncpu");
|
|
196753
|
-
if (
|
|
196818
|
+
if (os23.arch() === "arm64") {
|
|
196754
196819
|
result2.socket = "SOC";
|
|
196755
196820
|
try {
|
|
196756
196821
|
const clusters = execSync4("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split("\n");
|
|
@@ -196778,8 +196843,8 @@ var require_cpu = __commonJS({
|
|
|
196778
196843
|
if (_linux) {
|
|
196779
196844
|
let modelline = "";
|
|
196780
196845
|
let lines = [];
|
|
196781
|
-
if (
|
|
196782
|
-
modelline =
|
|
196846
|
+
if (os23.cpus()[0] && os23.cpus()[0].model) {
|
|
196847
|
+
modelline = os23.cpus()[0].model;
|
|
196783
196848
|
}
|
|
196784
196849
|
exec3('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL', (error2, stdout) => {
|
|
196785
196850
|
if (!error2) {
|
|
@@ -196868,8 +196933,8 @@ var require_cpu = __commonJS({
|
|
|
196868
196933
|
if (_freebsd || _openbsd || _netbsd) {
|
|
196869
196934
|
let modelline = "";
|
|
196870
196935
|
let lines = [];
|
|
196871
|
-
if (
|
|
196872
|
-
modelline =
|
|
196936
|
+
if (os23.cpus()[0] && os23.cpus()[0].model) {
|
|
196937
|
+
modelline = os23.cpus()[0].model;
|
|
196873
196938
|
}
|
|
196874
196939
|
exec3("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL", (error2, stdout) => {
|
|
196875
196940
|
let cache4 = [];
|
|
@@ -197029,7 +197094,7 @@ var require_cpu = __commonJS({
|
|
|
197029
197094
|
}
|
|
197030
197095
|
exports2.cpu = cpu;
|
|
197031
197096
|
function getCpuCurrentSpeedSync() {
|
|
197032
|
-
const cpus2 =
|
|
197097
|
+
const cpus2 = os23.cpus();
|
|
197033
197098
|
let minFreq = 999999999;
|
|
197034
197099
|
let maxFreq = 0;
|
|
197035
197100
|
let avgFreq = 0;
|
|
@@ -197724,7 +197789,7 @@ var require_cpu = __commonJS({
|
|
|
197724
197789
|
function getLoad() {
|
|
197725
197790
|
return new Promise((resolve20) => {
|
|
197726
197791
|
process.nextTick(() => {
|
|
197727
|
-
const loads =
|
|
197792
|
+
const loads = os23.loadavg().map((x3) => {
|
|
197728
197793
|
return x3 / util5.cores();
|
|
197729
197794
|
});
|
|
197730
197795
|
const avgLoad = parseFloat(Math.max.apply(Math, loads).toFixed(2));
|
|
@@ -197732,7 +197797,7 @@ var require_cpu = __commonJS({
|
|
|
197732
197797
|
const now = Date.now() - _current_cpu.ms;
|
|
197733
197798
|
if (now >= 200) {
|
|
197734
197799
|
_current_cpu.ms = Date.now();
|
|
197735
|
-
const cpus2 =
|
|
197800
|
+
const cpus2 = os23.cpus().map((cpu2) => {
|
|
197736
197801
|
cpu2.times.steal = 0;
|
|
197737
197802
|
cpu2.times.guest = 0;
|
|
197738
197803
|
return cpu2;
|
|
@@ -197926,7 +197991,7 @@ var require_cpu = __commonJS({
|
|
|
197926
197991
|
function getFullLoad() {
|
|
197927
197992
|
return new Promise((resolve20) => {
|
|
197928
197993
|
process.nextTick(() => {
|
|
197929
|
-
const cpus2 =
|
|
197994
|
+
const cpus2 = os23.cpus();
|
|
197930
197995
|
let totalUser = 0;
|
|
197931
197996
|
let totalSystem = 0;
|
|
197932
197997
|
let totalNice = 0;
|
|
@@ -197969,7 +198034,7 @@ var require_cpu = __commonJS({
|
|
|
197969
198034
|
var require_memory = __commonJS({
|
|
197970
198035
|
"node_modules/systeminformation/lib/memory.js"(exports2) {
|
|
197971
198036
|
"use strict";
|
|
197972
|
-
var
|
|
198037
|
+
var os23 = __require("os");
|
|
197973
198038
|
var exec3 = __require("child_process").exec;
|
|
197974
198039
|
var execSync4 = __require("child_process").execSync;
|
|
197975
198040
|
var util5 = require_util13();
|
|
@@ -198015,12 +198080,12 @@ var require_memory = __commonJS({
|
|
|
198015
198080
|
return new Promise((resolve20) => {
|
|
198016
198081
|
process.nextTick(() => {
|
|
198017
198082
|
let result2 = {
|
|
198018
|
-
total:
|
|
198019
|
-
free:
|
|
198020
|
-
used:
|
|
198021
|
-
active:
|
|
198083
|
+
total: os23.totalmem(),
|
|
198084
|
+
free: os23.freemem(),
|
|
198085
|
+
used: os23.totalmem() - os23.freemem(),
|
|
198086
|
+
active: os23.totalmem() - os23.freemem(),
|
|
198022
198087
|
// temporarily (fallback)
|
|
198023
|
-
available:
|
|
198088
|
+
available: os23.freemem(),
|
|
198024
198089
|
// temporarily (fallback)
|
|
198025
198090
|
buffers: 0,
|
|
198026
198091
|
cached: 0,
|
|
@@ -198039,9 +198104,9 @@ var require_memory = __commonJS({
|
|
|
198039
198104
|
if (!error2) {
|
|
198040
198105
|
const lines = stdout.toString().split("\n");
|
|
198041
198106
|
result2.total = parseInt(util5.getValue(lines, "memtotal"), 10);
|
|
198042
|
-
result2.total = result2.total ? result2.total * 1024 :
|
|
198107
|
+
result2.total = result2.total ? result2.total * 1024 : os23.totalmem();
|
|
198043
198108
|
result2.free = parseInt(util5.getValue(lines, "memfree"), 10);
|
|
198044
|
-
result2.free = result2.free ? result2.free * 1024 :
|
|
198109
|
+
result2.free = result2.free ? result2.free * 1024 : os23.freemem();
|
|
198045
198110
|
result2.used = result2.total - result2.free;
|
|
198046
198111
|
result2.buffers = parseInt(util5.getValue(lines, "buffers"), 10);
|
|
198047
198112
|
result2.buffers = result2.buffers ? result2.buffers * 1024 : 0;
|
|
@@ -198263,7 +198328,7 @@ var require_memory = __commonJS({
|
|
|
198263
198328
|
}
|
|
198264
198329
|
if (!result2.length) {
|
|
198265
198330
|
result2.push({
|
|
198266
|
-
size:
|
|
198331
|
+
size: os23.totalmem(),
|
|
198267
198332
|
bank: "",
|
|
198268
198333
|
type: "",
|
|
198269
198334
|
ecc: null,
|
|
@@ -201411,7 +201476,7 @@ ${BSDName}|"; diskutil info /dev/${BSDName} | grep SMART;`;
|
|
|
201411
201476
|
var require_network = __commonJS({
|
|
201412
201477
|
"node_modules/systeminformation/lib/network.js"(exports2) {
|
|
201413
201478
|
"use strict";
|
|
201414
|
-
var
|
|
201479
|
+
var os23 = __require("os");
|
|
201415
201480
|
var exec3 = __require("child_process").exec;
|
|
201416
201481
|
var execSync4 = __require("child_process").execSync;
|
|
201417
201482
|
var fs75 = __require("fs");
|
|
@@ -201435,7 +201500,7 @@ var require_network = __commonJS({
|
|
|
201435
201500
|
let ifacename = "";
|
|
201436
201501
|
let ifacenameFirst = "";
|
|
201437
201502
|
try {
|
|
201438
|
-
const ifaces =
|
|
201503
|
+
const ifaces = os23.networkInterfaces();
|
|
201439
201504
|
let scopeid = 9999;
|
|
201440
201505
|
for (let dev in ifaces) {
|
|
201441
201506
|
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
|
@@ -201455,7 +201520,7 @@ var require_network = __commonJS({
|
|
|
201455
201520
|
let defaultIp = "";
|
|
201456
201521
|
const cmd = "netstat -r";
|
|
201457
201522
|
const result2 = execSync4(cmd, util5.execOptsWin);
|
|
201458
|
-
const lines = result2.toString().split(
|
|
201523
|
+
const lines = result2.toString().split(os23.EOL);
|
|
201459
201524
|
lines.forEach((line) => {
|
|
201460
201525
|
line = line.replace(/\s+/g, " ").trim();
|
|
201461
201526
|
if (line.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(line)) {
|
|
@@ -202088,7 +202153,7 @@ var require_network = __commonJS({
|
|
|
202088
202153
|
defaultString = "" + defaultString;
|
|
202089
202154
|
return new Promise((resolve20) => {
|
|
202090
202155
|
process.nextTick(() => {
|
|
202091
|
-
const ifaces =
|
|
202156
|
+
const ifaces = os23.networkInterfaces();
|
|
202092
202157
|
let result2 = [];
|
|
202093
202158
|
let nics = [];
|
|
202094
202159
|
let dnsSuffixes = [];
|
|
@@ -203158,7 +203223,7 @@ var require_network = __commonJS({
|
|
|
203158
203223
|
if (_windows) {
|
|
203159
203224
|
try {
|
|
203160
203225
|
exec3("netstat -r", util5.execOptsWin, (error2, stdout) => {
|
|
203161
|
-
const lines = stdout.toString().split(
|
|
203226
|
+
const lines = stdout.toString().split(os23.EOL);
|
|
203162
203227
|
lines.forEach((line) => {
|
|
203163
203228
|
line = line.replace(/\s+/g, " ").trim();
|
|
203164
203229
|
if (line.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(line)) {
|
|
@@ -203204,7 +203269,7 @@ var require_network = __commonJS({
|
|
|
203204
203269
|
var require_wifi = __commonJS({
|
|
203205
203270
|
"node_modules/systeminformation/lib/wifi.js"(exports2) {
|
|
203206
203271
|
"use strict";
|
|
203207
|
-
var
|
|
203272
|
+
var os23 = __require("os");
|
|
203208
203273
|
var exec3 = __require("child_process").exec;
|
|
203209
203274
|
var execSync4 = __require("child_process").execSync;
|
|
203210
203275
|
var util5 = require_util13();
|
|
@@ -203426,7 +203491,7 @@ var require_wifi = __commonJS({
|
|
|
203426
203491
|
parts2.shift();
|
|
203427
203492
|
parts2.forEach((part) => {
|
|
203428
203493
|
part = "ACTIVE:" + part;
|
|
203429
|
-
const lines = part.split(
|
|
203494
|
+
const lines = part.split(os23.EOL);
|
|
203430
203495
|
const channel = util5.getValue(lines, "CHAN");
|
|
203431
203496
|
const frequency = util5.getValue(lines, "FREQ").toLowerCase().replace("mhz", "").trim();
|
|
203432
203497
|
const security = util5.getValue(lines, "SECURITY").replace("(", "").replace(")", "");
|
|
@@ -203650,15 +203715,15 @@ var require_wifi = __commonJS({
|
|
|
203650
203715
|
} else if (_windows) {
|
|
203651
203716
|
const cmd = "netsh wlan show networks mode=Bssid";
|
|
203652
203717
|
util5.powerShell(cmd).then((stdout) => {
|
|
203653
|
-
const ssidParts = stdout.toString("utf8").split(
|
|
203718
|
+
const ssidParts = stdout.toString("utf8").split(os23.EOL + os23.EOL + "SSID ");
|
|
203654
203719
|
ssidParts.shift();
|
|
203655
203720
|
ssidParts.forEach((ssidPart) => {
|
|
203656
|
-
const ssidLines = ssidPart.split(
|
|
203721
|
+
const ssidLines = ssidPart.split(os23.EOL);
|
|
203657
203722
|
if (ssidLines && ssidLines.length >= 8 && ssidLines[0].indexOf(":") >= 0) {
|
|
203658
203723
|
const bssidsParts = ssidPart.split(" BSSID");
|
|
203659
203724
|
bssidsParts.shift();
|
|
203660
203725
|
bssidsParts.forEach((bssidPart) => {
|
|
203661
|
-
const bssidLines = bssidPart.split(
|
|
203726
|
+
const bssidLines = bssidPart.split(os23.EOL);
|
|
203662
203727
|
const bssidLine = bssidLines[0].split(":");
|
|
203663
203728
|
bssidLine.shift();
|
|
203664
203729
|
const bssid = bssidLine.join(":").trim().toLowerCase();
|
|
@@ -203982,7 +204047,7 @@ var require_wifi = __commonJS({
|
|
|
203982
204047
|
var require_processes = __commonJS({
|
|
203983
204048
|
"node_modules/systeminformation/lib/processes.js"(exports2) {
|
|
203984
204049
|
"use strict";
|
|
203985
|
-
var
|
|
204050
|
+
var os23 = __require("os");
|
|
203986
204051
|
var fs75 = __require("fs");
|
|
203987
204052
|
var path90 = __require("path");
|
|
203988
204053
|
var exec3 = __require("child_process").exec;
|
|
@@ -204633,7 +204698,7 @@ var require_processes = __commonJS({
|
|
|
204633
204698
|
line = line.trim().replace(/ +/g, " ").replace(/,+/g, ".");
|
|
204634
204699
|
const parts2 = line.split(" ");
|
|
204635
204700
|
const command = parts2.slice(9).join(" ");
|
|
204636
|
-
const pmem = parseFloat((1 * parseInt(parts2[3]) * 1024 /
|
|
204701
|
+
const pmem = parseFloat((1 * parseInt(parts2[3]) * 1024 / os23.totalmem()).toFixed(1));
|
|
204637
204702
|
const started = parseElapsed(parts2[5]);
|
|
204638
204703
|
result2.push({
|
|
204639
204704
|
pid: parseInt(parts2[0]),
|
|
@@ -204836,7 +204901,7 @@ var require_processes = __commonJS({
|
|
|
204836
204901
|
cpu: 0,
|
|
204837
204902
|
cpuu: 0,
|
|
204838
204903
|
cpus: 0,
|
|
204839
|
-
mem: memw /
|
|
204904
|
+
mem: memw / os23.totalmem() * 100,
|
|
204840
204905
|
priority: element.Priority | null,
|
|
204841
204906
|
memVsz: element.PageFileUsage || null,
|
|
204842
204907
|
memRss: Math.floor((element.WorkingSetSize || 0) / 1024),
|
|
@@ -204990,7 +205055,7 @@ var require_processes = __commonJS({
|
|
|
204990
205055
|
result2.forEach((item) => {
|
|
204991
205056
|
if (item.proc.toLowerCase() === pname.toLowerCase()) {
|
|
204992
205057
|
item.pids.push(pid);
|
|
204993
|
-
item.mem += mem /
|
|
205058
|
+
item.mem += mem / os23.totalmem() * 100;
|
|
204994
205059
|
processFound = true;
|
|
204995
205060
|
}
|
|
204996
205061
|
});
|
|
@@ -205000,7 +205065,7 @@ var require_processes = __commonJS({
|
|
|
205000
205065
|
pid,
|
|
205001
205066
|
pids: [pid],
|
|
205002
205067
|
cpu: 0,
|
|
205003
|
-
mem: mem /
|
|
205068
|
+
mem: mem / os23.totalmem() * 100
|
|
205004
205069
|
});
|
|
205005
205070
|
}
|
|
205006
205071
|
}
|
|
@@ -206741,7 +206806,7 @@ var require_docker = __commonJS({
|
|
|
206741
206806
|
var require_virtualbox = __commonJS({
|
|
206742
206807
|
"node_modules/systeminformation/lib/virtualbox.js"(exports2) {
|
|
206743
206808
|
"use strict";
|
|
206744
|
-
var
|
|
206809
|
+
var os23 = __require("os");
|
|
206745
206810
|
var exec3 = __require("child_process").exec;
|
|
206746
206811
|
var util5 = require_util13();
|
|
206747
206812
|
function vboxInfo(callback) {
|
|
@@ -206750,10 +206815,10 @@ var require_virtualbox = __commonJS({
|
|
|
206750
206815
|
process.nextTick(() => {
|
|
206751
206816
|
try {
|
|
206752
206817
|
exec3(util5.getVboxmanage() + " list vms --long", (error2, stdout) => {
|
|
206753
|
-
let parts2 = (
|
|
206818
|
+
let parts2 = (os23.EOL + stdout.toString()).split(os23.EOL + "Name:");
|
|
206754
206819
|
parts2.shift();
|
|
206755
206820
|
parts2.forEach((part) => {
|
|
206756
|
-
const lines = ("Name:" + part).split(
|
|
206821
|
+
const lines = ("Name:" + part).split(os23.EOL);
|
|
206757
206822
|
const state = util5.getValue(lines, "State");
|
|
206758
206823
|
const running = state.startsWith("running");
|
|
206759
206824
|
const runningSinceString = running ? state.replace("running (since ", "").replace(")", "").trim() : "";
|
|
@@ -214180,8 +214245,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
214180
214245
|
var init_git_commit = __esm({
|
|
214181
214246
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
214182
214247
|
"use strict";
|
|
214183
|
-
GIT_COMMIT_INFO = "
|
|
214184
|
-
CLI_VERSION = "0.33.0-preview.
|
|
214248
|
+
GIT_COMMIT_INFO = "c18aae398";
|
|
214249
|
+
CLI_VERSION = "0.33.0-preview.10";
|
|
214185
214250
|
}
|
|
214186
214251
|
});
|
|
214187
214252
|
|
|
@@ -216572,13 +216637,13 @@ var require_src55 = __commonJS({
|
|
|
216572
216637
|
};
|
|
216573
216638
|
function mapOtelResourceToMonitoredResource(resource) {
|
|
216574
216639
|
const attrs = resource.attributes;
|
|
216575
|
-
const
|
|
216640
|
+
const platform14 = attrs[semantic_conventions_1.SEMRESATTRS_CLOUD_PLATFORM];
|
|
216576
216641
|
let mr;
|
|
216577
|
-
if (
|
|
216642
|
+
if (platform14 === semantic_conventions_1.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE) {
|
|
216578
216643
|
mr = createMonitoredResource(GCE_INSTANCE, attrs);
|
|
216579
|
-
} else if (
|
|
216644
|
+
} else if (platform14 === semantic_conventions_1.CLOUDPLATFORMVALUES_GCP_APP_ENGINE) {
|
|
216580
216645
|
mr = createMonitoredResource(GAE_INSTANCE, attrs);
|
|
216581
|
-
} else if (
|
|
216646
|
+
} else if (platform14 === semantic_conventions_1.CLOUDPLATFORMVALUES_AWS_EC2) {
|
|
216582
216647
|
mr = createMonitoredResource(AWS_EC2_INSTANCE, attrs);
|
|
216583
216648
|
} else if (semantic_conventions_1.SEMRESATTRS_K8S_CLUSTER_NAME in attrs) {
|
|
216584
216649
|
if (semantic_conventions_1.SEMRESATTRS_K8S_CONTAINER_NAME in attrs) {
|
|
@@ -226449,7 +226514,7 @@ var require_grpc = __commonJS({
|
|
|
226449
226514
|
var fs75 = __require("fs");
|
|
226450
226515
|
var google_auth_library_1 = require_src8();
|
|
226451
226516
|
var grpc = require_src28();
|
|
226452
|
-
var
|
|
226517
|
+
var os23 = __require("os");
|
|
226453
226518
|
var path_1 = __require("path");
|
|
226454
226519
|
var path90 = __require("path");
|
|
226455
226520
|
var protobuf = require_protobufjs();
|
|
@@ -226754,7 +226819,7 @@ var require_grpc = __commonJS({
|
|
|
226754
226819
|
if ((opts === null || opts === void 0 ? void 0 : opts.cert) && (opts === null || opts === void 0 ? void 0 : opts.key)) {
|
|
226755
226820
|
return [opts.cert, opts.key];
|
|
226756
226821
|
}
|
|
226757
|
-
const metadataPath = (0, path_1.join)(
|
|
226822
|
+
const metadataPath = (0, path_1.join)(os23.homedir(), ".secureConnect", "context_aware_metadata.json");
|
|
226758
226823
|
const metadata2 = JSON.parse(await readFileAsync(metadataPath));
|
|
226759
226824
|
if (!metadata2.cert_provider_command) {
|
|
226760
226825
|
throw Error("no cert_provider_command found");
|
|
@@ -291439,7 +291504,7 @@ function getVersion() {
|
|
|
291439
291504
|
}
|
|
291440
291505
|
versionPromise = (async () => {
|
|
291441
291506
|
const pkgJson = await getPackageJson(__dirname3);
|
|
291442
|
-
return "0.33.0-preview.
|
|
291507
|
+
return "0.33.0-preview.10";
|
|
291443
291508
|
})();
|
|
291444
291509
|
return versionPromise;
|
|
291445
291510
|
}
|
|
@@ -291457,21 +291522,21 @@ var init_version5 = __esm({
|
|
|
291457
291522
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
291458
291523
|
import path25 from "node:path";
|
|
291459
291524
|
function getPlatform() {
|
|
291460
|
-
const
|
|
291525
|
+
const platform14 = process.platform;
|
|
291461
291526
|
const arch4 = process.arch;
|
|
291462
|
-
if (
|
|
291527
|
+
if (platform14 === "darwin" && arch4 === "x64") {
|
|
291463
291528
|
return "DARWIN_AMD64";
|
|
291464
291529
|
}
|
|
291465
|
-
if (
|
|
291530
|
+
if (platform14 === "darwin" && arch4 === "arm64") {
|
|
291466
291531
|
return "DARWIN_ARM64";
|
|
291467
291532
|
}
|
|
291468
|
-
if (
|
|
291533
|
+
if (platform14 === "linux" && arch4 === "x64") {
|
|
291469
291534
|
return "LINUX_AMD64";
|
|
291470
291535
|
}
|
|
291471
|
-
if (
|
|
291536
|
+
if (platform14 === "linux" && arch4 === "arm64") {
|
|
291472
291537
|
return "LINUX_ARM64";
|
|
291473
291538
|
}
|
|
291474
|
-
if (
|
|
291539
|
+
if (platform14 === "win32" && arch4 === "x64") {
|
|
291475
291540
|
return "WINDOWS_AMD64";
|
|
291476
291541
|
}
|
|
291477
291542
|
return "PLATFORM_UNSPECIFIED";
|
|
@@ -291518,6 +291583,7 @@ var init_server = __esm({
|
|
|
291518
291583
|
init_types8();
|
|
291519
291584
|
init_billing();
|
|
291520
291585
|
init_loggers();
|
|
291586
|
+
init_events();
|
|
291521
291587
|
init_billingEvents();
|
|
291522
291588
|
init_converter();
|
|
291523
291589
|
init_telemetry2();
|
|
@@ -291548,6 +291614,10 @@ var init_server = __esm({
|
|
|
291548
291614
|
const autoUse = this.config ? shouldAutoUseCredits(this.config.getBillingSettings().overageStrategy, getG1CreditBalance(this.paidTier)) : false;
|
|
291549
291615
|
const modelIsEligible = isOverageEligibleModel(req.model);
|
|
291550
291616
|
const shouldEnableCredits = modelIsEligible && autoUse;
|
|
291617
|
+
if (shouldEnableCredits && !this.config?.getCreditsNotificationShown()) {
|
|
291618
|
+
this.config?.setCreditsNotificationShown(true);
|
|
291619
|
+
coreEvents.emitFeedback("info", "Using AI Credits for this request.");
|
|
291620
|
+
}
|
|
291551
291621
|
const enabledCreditTypes = shouldEnableCredits ? [G1_CREDIT_TYPE] : void 0;
|
|
291552
291622
|
const responses = await this.requestStreamingPost("streamGenerateContent", toGenerateContentRequest(req, userPromptId, this.projectId, this.sessionId, enabledCreditTypes), req.config?.abortSignal);
|
|
291553
291623
|
const streamingLatency = {};
|
|
@@ -291844,12 +291914,16 @@ function parseDurationInSeconds(duration3) {
|
|
|
291844
291914
|
}
|
|
291845
291915
|
return null;
|
|
291846
291916
|
}
|
|
291917
|
+
function isCloudCodeDomain(domain) {
|
|
291918
|
+
const sanitized = domain.replace(/[^a-zA-Z0-9.-]/g, "");
|
|
291919
|
+
return CLOUDCODE_DOMAINS.includes(sanitized);
|
|
291920
|
+
}
|
|
291847
291921
|
function classifyValidationRequiredError(googleApiError) {
|
|
291848
291922
|
const errorInfo = googleApiError.details.find((d) => d["@type"] === "type.googleapis.com/google.rpc.ErrorInfo");
|
|
291849
291923
|
if (!errorInfo) {
|
|
291850
291924
|
return null;
|
|
291851
291925
|
}
|
|
291852
|
-
if (!errorInfo.domain || !
|
|
291926
|
+
if (!errorInfo.domain || !isCloudCodeDomain(errorInfo.domain) || errorInfo.reason !== "VALIDATION_REQUIRED") {
|
|
291853
291927
|
return null;
|
|
291854
291928
|
}
|
|
291855
291929
|
const helpDetail = googleApiError.details.find((d) => d["@type"] === "type.googleapis.com/google.rpc.Help");
|
|
@@ -291940,12 +292014,7 @@ function classifyGoogleError(error2) {
|
|
|
291940
292014
|
return new TerminalQuotaError(`${googleApiError.message}`, googleApiError, delaySeconds, errorInfo.reason);
|
|
291941
292015
|
}
|
|
291942
292016
|
if (errorInfo.domain) {
|
|
291943
|
-
|
|
291944
|
-
"cloudcode-pa.googleapis.com",
|
|
291945
|
-
"staging-cloudcode-pa.googleapis.com",
|
|
291946
|
-
"autopush-cloudcode-pa.googleapis.com"
|
|
291947
|
-
];
|
|
291948
|
-
if (validDomains.includes(errorInfo.domain)) {
|
|
292017
|
+
if (isCloudCodeDomain(errorInfo.domain)) {
|
|
291949
292018
|
if (errorInfo.reason === "RATE_LIMIT_EXCEEDED") {
|
|
291950
292019
|
return new RetryableQuotaError(`${googleApiError.message}`, googleApiError, delaySeconds ?? 10);
|
|
291951
292020
|
}
|
|
@@ -292834,14 +292903,16 @@ var init_recordingContentGenerator = __esm({
|
|
|
292834
292903
|
});
|
|
292835
292904
|
|
|
292836
292905
|
// packages/core/dist/src/core/contentGenerator.js
|
|
292837
|
-
async function createContentGeneratorConfig(config3, authType, apiKey) {
|
|
292906
|
+
async function createContentGeneratorConfig(config3, authType, apiKey, baseUrl, customHeaders) {
|
|
292838
292907
|
const geminiApiKey = apiKey || process.env["GEMINI_API_KEY"] || await loadApiKey() || void 0;
|
|
292839
292908
|
const googleApiKey = process.env["GOOGLE_API_KEY"] || void 0;
|
|
292840
292909
|
const googleCloudProject = process.env["GOOGLE_CLOUD_PROJECT"] || process.env["GOOGLE_CLOUD_PROJECT_ID"] || void 0;
|
|
292841
292910
|
const googleCloudLocation = process.env["GOOGLE_CLOUD_LOCATION"] || void 0;
|
|
292842
292911
|
const contentGeneratorConfig = {
|
|
292843
292912
|
authType,
|
|
292844
|
-
proxy: config3?.getProxy()
|
|
292913
|
+
proxy: config3?.getProxy(),
|
|
292914
|
+
baseUrl,
|
|
292915
|
+
customHeaders
|
|
292845
292916
|
};
|
|
292846
292917
|
if (authType === AuthType2.LOGIN_WITH_GOOGLE || authType === AuthType2.COMPUTE_ADC) {
|
|
292847
292918
|
return contentGeneratorConfig;
|
|
@@ -292882,8 +292953,11 @@ async function createContentGenerator(config3, gcConfig, sessionId2) {
|
|
|
292882
292953
|
const httpOptions = { headers: baseHeaders };
|
|
292883
292954
|
return new LoggingContentGenerator(await createCodeAssistContentGenerator(httpOptions, config3.authType, gcConfig, sessionId2), gcConfig);
|
|
292884
292955
|
}
|
|
292885
|
-
if (config3.authType === AuthType2.USE_GEMINI || config3.authType === AuthType2.USE_VERTEX_AI) {
|
|
292956
|
+
if (config3.authType === AuthType2.USE_GEMINI || config3.authType === AuthType2.USE_VERTEX_AI || config3.authType === AuthType2.GATEWAY) {
|
|
292886
292957
|
let headers = { ...baseHeaders };
|
|
292958
|
+
if (config3.customHeaders) {
|
|
292959
|
+
headers = { ...headers, ...config3.customHeaders };
|
|
292960
|
+
}
|
|
292887
292961
|
if (gcConfig?.getUsageStatisticsEnabled()) {
|
|
292888
292962
|
const installationManager2 = new InstallationManager();
|
|
292889
292963
|
const installationId = installationManager2.getInstallationId();
|
|
@@ -292893,6 +292967,9 @@ async function createContentGenerator(config3, gcConfig, sessionId2) {
|
|
|
292893
292967
|
};
|
|
292894
292968
|
}
|
|
292895
292969
|
const httpOptions = { headers };
|
|
292970
|
+
if (config3.baseUrl) {
|
|
292971
|
+
httpOptions.baseUrl = config3.baseUrl;
|
|
292972
|
+
}
|
|
292896
292973
|
const googleGenAI = new GoogleGenAI({
|
|
292897
292974
|
apiKey: config3.apiKey === "" ? void 0 : config3.apiKey,
|
|
292898
292975
|
vertexai: config3.vertexai,
|
|
@@ -292927,6 +293004,7 @@ var init_contentGenerator = __esm({
|
|
|
292927
293004
|
AuthType3["USE_VERTEX_AI"] = "vertex-ai";
|
|
292928
293005
|
AuthType3["LEGACY_CLOUD_SHELL"] = "cloud-shell";
|
|
292929
293006
|
AuthType3["COMPUTE_ADC"] = "compute-default-credentials";
|
|
293007
|
+
AuthType3["GATEWAY"] = "gateway";
|
|
292930
293008
|
})(AuthType2 || (AuthType2 = {}));
|
|
292931
293009
|
}
|
|
292932
293010
|
});
|
|
@@ -293609,11 +293687,11 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
|
|
293609
293687
|
buildToolMetadata() {
|
|
293610
293688
|
const toolMetadata = /* @__PURE__ */ new Map();
|
|
293611
293689
|
for (const [name4, tool] of this.allKnownTools) {
|
|
293612
|
-
|
|
293613
|
-
|
|
293614
|
-
|
|
293615
|
-
|
|
293616
|
-
|
|
293690
|
+
const metadata2 = tool.toolAnnotations ? { ...tool.toolAnnotations } : {};
|
|
293691
|
+
if (tool instanceof DiscoveredMCPTool) {
|
|
293692
|
+
metadata2["_serverName"] = tool.serverName;
|
|
293693
|
+
}
|
|
293694
|
+
if (Object.keys(metadata2).length > 0) {
|
|
293617
293695
|
toolMetadata.set(name4, metadata2);
|
|
293618
293696
|
}
|
|
293619
293697
|
}
|
|
@@ -298994,7 +299072,7 @@ var init_index_min = __esm({
|
|
|
298994
299072
|
// node_modules/path-scurry/dist/esm/index.js
|
|
298995
299073
|
import { posix as posix2, win32 as win322 } from "node:path";
|
|
298996
299074
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
298997
|
-
import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps } from "fs";
|
|
299075
|
+
import { lstatSync as lstatSync2, readdir as readdirCB, readdirSync, readlinkSync as readlinkSync2, realpathSync as rps } from "fs";
|
|
298998
299076
|
import * as actualFS from "node:fs";
|
|
298999
299077
|
import { lstat, readdir, readlink, realpath } from "node:fs/promises";
|
|
299000
299078
|
var realpathSync2, defaultFS, fsFromOption, uncDriveRegexp, uncToDrive, eitherSep, UNKNOWN, IFIFO, IFCHR, IFDIR, IFBLK, IFREG, IFLNK, IFSOCK, IFMT, IFMT_UNKNOWN, READDIR_CALLED, LSTAT_CALLED, ENOTDIR, ENOENT, ENOREADLINK, ENOREALPATH, ENOCHILD, TYPEMASK, entToType, normalizeCache2, normalize2, normalizeNocaseCache, normalizeNocase, ResolveCache, ChildrenCache, setAsCwd, PathBase, PathWin32, PathPosix, PathScurryBase, PathScurryWin32, PathScurryPosix, PathScurryDarwin, Path, PathScurry;
|
|
@@ -299004,10 +299082,10 @@ var init_esm9 = __esm({
|
|
|
299004
299082
|
init_esm();
|
|
299005
299083
|
realpathSync2 = rps.native;
|
|
299006
299084
|
defaultFS = {
|
|
299007
|
-
lstatSync,
|
|
299085
|
+
lstatSync: lstatSync2,
|
|
299008
299086
|
readdir: readdirCB,
|
|
299009
299087
|
readdirSync,
|
|
299010
|
-
readlinkSync,
|
|
299088
|
+
readlinkSync: readlinkSync2,
|
|
299011
299089
|
realpathSync: realpathSync2,
|
|
299012
299090
|
promises: {
|
|
299013
299091
|
lstat,
|
|
@@ -300750,7 +300828,7 @@ var init_pattern = __esm({
|
|
|
300750
300828
|
#isUNC;
|
|
300751
300829
|
#isAbsolute;
|
|
300752
300830
|
#followGlobstar = true;
|
|
300753
|
-
constructor(patternList, globList, index,
|
|
300831
|
+
constructor(patternList, globList, index, platform14) {
|
|
300754
300832
|
if (!isPatternList(patternList)) {
|
|
300755
300833
|
throw new TypeError("empty pattern list");
|
|
300756
300834
|
}
|
|
@@ -300767,7 +300845,7 @@ var init_pattern = __esm({
|
|
|
300767
300845
|
this.#patternList = patternList;
|
|
300768
300846
|
this.#globList = globList;
|
|
300769
300847
|
this.#index = index;
|
|
300770
|
-
this.#platform =
|
|
300848
|
+
this.#platform = platform14;
|
|
300771
300849
|
if (this.#index === 0) {
|
|
300772
300850
|
if (this.isUNC()) {
|
|
300773
300851
|
const [p0, p1, p2, p3, ...prest] = this.#patternList;
|
|
@@ -300916,12 +300994,12 @@ var init_ignore = __esm({
|
|
|
300916
300994
|
absoluteChildren;
|
|
300917
300995
|
platform;
|
|
300918
300996
|
mmopts;
|
|
300919
|
-
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform:
|
|
300997
|
+
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform14 = defaultPlatform2 }) {
|
|
300920
300998
|
this.relative = [];
|
|
300921
300999
|
this.absolute = [];
|
|
300922
301000
|
this.relativeChildren = [];
|
|
300923
301001
|
this.absoluteChildren = [];
|
|
300924
|
-
this.platform =
|
|
301002
|
+
this.platform = platform14;
|
|
300925
301003
|
this.mmopts = {
|
|
300926
301004
|
dot: true,
|
|
300927
301005
|
nobrace,
|
|
@@ -300929,7 +301007,7 @@ var init_ignore = __esm({
|
|
|
300929
301007
|
noext,
|
|
300930
301008
|
noglobstar,
|
|
300931
301009
|
optimizationLevel: 2,
|
|
300932
|
-
platform:
|
|
301010
|
+
platform: platform14,
|
|
300933
301011
|
nocomment: true,
|
|
300934
301012
|
nonegate: true
|
|
300935
301013
|
};
|
|
@@ -308219,8 +308297,8 @@ var require_path_key = __commonJS({
|
|
|
308219
308297
|
"use strict";
|
|
308220
308298
|
var pathKey2 = (options = {}) => {
|
|
308221
308299
|
const environment = options.env || process.env;
|
|
308222
|
-
const
|
|
308223
|
-
if (
|
|
308300
|
+
const platform14 = options.platform || process.platform;
|
|
308301
|
+
if (platform14 !== "win32") {
|
|
308224
308302
|
return "PATH";
|
|
308225
308303
|
}
|
|
308226
308304
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
@@ -308490,9 +308568,9 @@ var require_cross_spawn = __commonJS({
|
|
|
308490
308568
|
function pathKey(options = {}) {
|
|
308491
308569
|
const {
|
|
308492
308570
|
env: env2 = process.env,
|
|
308493
|
-
platform:
|
|
308571
|
+
platform: platform14 = process.platform
|
|
308494
308572
|
} = options;
|
|
308495
|
-
if (
|
|
308573
|
+
if (platform14 !== "win32") {
|
|
308496
308574
|
return "PATH";
|
|
308497
308575
|
}
|
|
308498
308576
|
return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
@@ -325956,8 +326034,8 @@ var init_downloadRipGrep = __esm({
|
|
|
325956
326034
|
BIN_PATH = join11(__dirname5, "../bin");
|
|
325957
326035
|
getTarget = () => {
|
|
325958
326036
|
const arch4 = process.env.npm_config_arch || os12.arch();
|
|
325959
|
-
const
|
|
325960
|
-
switch (
|
|
326037
|
+
const platform14 = process.env.platform || os12.platform();
|
|
326038
|
+
switch (platform14) {
|
|
325961
326039
|
case "darwin":
|
|
325962
326040
|
switch (arch4) {
|
|
325963
326041
|
case "arm64":
|
|
@@ -325991,7 +326069,7 @@ var init_downloadRipGrep = __esm({
|
|
|
325991
326069
|
return "i686-unknown-linux-musl.tar.gz";
|
|
325992
326070
|
}
|
|
325993
326071
|
default:
|
|
325994
|
-
throw new VError("Unknown platform: " +
|
|
326072
|
+
throw new VError("Unknown platform: " + platform14);
|
|
325995
326073
|
}
|
|
325996
326074
|
};
|
|
325997
326075
|
downloadFile2 = async (url5, outFile) => {
|
|
@@ -327659,11 +327737,11 @@ async function getIdeProcessInfoForWindows() {
|
|
|
327659
327737
|
return { pid: myPid, command: myProc.command };
|
|
327660
327738
|
}
|
|
327661
327739
|
async function getIdeProcessInfo() {
|
|
327662
|
-
const
|
|
327740
|
+
const platform14 = os14.platform();
|
|
327663
327741
|
if (process.env["GEMINI_CLI_IDE_PID"]) {
|
|
327664
327742
|
const idePid = parseInt(process.env["GEMINI_CLI_IDE_PID"], 10);
|
|
327665
327743
|
if (!isNaN(idePid) && idePid > 0) {
|
|
327666
|
-
if (
|
|
327744
|
+
if (platform14 === "win32") {
|
|
327667
327745
|
const processMap = await getProcessTableWindows();
|
|
327668
327746
|
const proc2 = processMap.get(idePid);
|
|
327669
327747
|
return { pid: idePid, command: proc2?.command || "" };
|
|
@@ -327672,7 +327750,7 @@ async function getIdeProcessInfo() {
|
|
|
327672
327750
|
return { pid: idePid, command };
|
|
327673
327751
|
}
|
|
327674
327752
|
}
|
|
327675
|
-
if (
|
|
327753
|
+
if (platform14 === "win32") {
|
|
327676
327754
|
return getIdeProcessInfoForWindows();
|
|
327677
327755
|
}
|
|
327678
327756
|
return getIdeProcessInfoForUnix();
|
|
@@ -386762,7 +386840,7 @@ async function getEnvironmentContext(config3) {
|
|
|
386762
386840
|
month: "long",
|
|
386763
386841
|
day: "numeric"
|
|
386764
386842
|
});
|
|
386765
|
-
const
|
|
386843
|
+
const platform14 = process.platform;
|
|
386766
386844
|
const directoryContext = config3.getIncludeDirectoryTree() ? await getDirectoryContextString(config3) : "";
|
|
386767
386845
|
const tempDir = config3.storage.getProjectTempDir();
|
|
386768
386846
|
const environmentMemory = config3.getEnvironmentMemory();
|
|
@@ -386770,7 +386848,7 @@ async function getEnvironmentContext(config3) {
|
|
|
386770
386848
|
<session_context>
|
|
386771
386849
|
This is the Gemini CLI. We are setting up the context for our chat.
|
|
386772
386850
|
Today's date is ${today} (formatted according to the user's locale).
|
|
386773
|
-
My operating system is: ${
|
|
386851
|
+
My operating system is: ${platform14}
|
|
386774
386852
|
The project's temporary directory is: ${tempDir}
|
|
386775
386853
|
${directoryContext}
|
|
386776
386854
|
|
|
@@ -399897,8 +399975,8 @@ var WorkspaceContext;
|
|
|
399897
399975
|
var init_workspaceContext = __esm({
|
|
399898
399976
|
"packages/core/dist/src/utils/workspaceContext.js"() {
|
|
399899
399977
|
"use strict";
|
|
399900
|
-
init_errors();
|
|
399901
399978
|
init_debugLogger();
|
|
399979
|
+
init_paths();
|
|
399902
399980
|
WorkspaceContext = class {
|
|
399903
399981
|
targetDir;
|
|
399904
399982
|
directories = /* @__PURE__ */ new Set();
|
|
@@ -400068,16 +400146,7 @@ var init_workspaceContext = __esm({
|
|
|
400068
400146
|
* if it did exist.
|
|
400069
400147
|
*/
|
|
400070
400148
|
fullyResolvedPath(pathToCheck) {
|
|
400071
|
-
|
|
400072
|
-
return fs57.realpathSync(path68.resolve(this.targetDir, pathToCheck));
|
|
400073
|
-
} catch (e3) {
|
|
400074
|
-
if (isNodeError(e3) && e3.code === "ENOENT" && e3.path && // realpathSync does not set e.path correctly for symlinks to
|
|
400075
|
-
// non-existent files.
|
|
400076
|
-
!this.isFileSymlink(e3.path)) {
|
|
400077
|
-
return e3.path;
|
|
400078
|
-
}
|
|
400079
|
-
throw e3;
|
|
400080
|
-
}
|
|
400149
|
+
return resolveToRealPath(path68.resolve(this.targetDir, pathToCheck));
|
|
400081
400150
|
}
|
|
400082
400151
|
/**
|
|
400083
400152
|
* Checks if a path is within a given root directory.
|
|
@@ -400089,16 +400158,6 @@ var init_workspaceContext = __esm({
|
|
|
400089
400158
|
const relative6 = path68.relative(rootDirectory, pathToCheck);
|
|
400090
400159
|
return !relative6.startsWith(`..${path68.sep}`) && relative6 !== ".." && !path68.isAbsolute(relative6);
|
|
400091
400160
|
}
|
|
400092
|
-
/**
|
|
400093
|
-
* Checks if a file path is a symbolic link that points to a file.
|
|
400094
|
-
*/
|
|
400095
|
-
isFileSymlink(filePath) {
|
|
400096
|
-
try {
|
|
400097
|
-
return !fs57.readlinkSync(filePath).endsWith("/");
|
|
400098
|
-
} catch (_error) {
|
|
400099
|
-
return false;
|
|
400100
|
-
}
|
|
400101
|
-
}
|
|
400102
400161
|
};
|
|
400103
400162
|
}
|
|
400104
400163
|
});
|
|
@@ -400304,34 +400363,17 @@ function matchesWildcard(pattern, toolName, serverName) {
|
|
|
400304
400363
|
if (pattern === "*") {
|
|
400305
400364
|
return true;
|
|
400306
400365
|
}
|
|
400307
|
-
if (pattern
|
|
400308
|
-
return
|
|
400309
|
-
}
|
|
400310
|
-
return toolName === pattern;
|
|
400311
|
-
}
|
|
400312
|
-
function matchesCompositePattern(pattern, toolName, serverName) {
|
|
400313
|
-
const parts2 = pattern.split("__");
|
|
400314
|
-
if (parts2.length !== 2)
|
|
400315
|
-
return false;
|
|
400316
|
-
const [patternServer, patternTool] = parts2;
|
|
400317
|
-
const { actualServer, actualTool } = getToolMetadata(toolName, serverName);
|
|
400318
|
-
if (actualServer === void 0) {
|
|
400319
|
-
return false;
|
|
400366
|
+
if (pattern === `${MCP_TOOL_PREFIX}*`) {
|
|
400367
|
+
return serverName !== void 0;
|
|
400320
400368
|
}
|
|
400321
|
-
if (
|
|
400322
|
-
|
|
400369
|
+
if (pattern.startsWith(MCP_TOOL_PREFIX) && pattern.endsWith("_*")) {
|
|
400370
|
+
const expectedServerName = pattern.slice(MCP_TOOL_PREFIX.length, -2);
|
|
400371
|
+
if (serverName === void 0 || serverName !== expectedServerName) {
|
|
400372
|
+
return false;
|
|
400373
|
+
}
|
|
400374
|
+
return toolName.startsWith(`${MCP_TOOL_PREFIX}${expectedServerName}_`);
|
|
400323
400375
|
}
|
|
400324
|
-
|
|
400325
|
-
const toolMatch = patternTool === "*" || patternTool === actualTool;
|
|
400326
|
-
return serverMatch && toolMatch;
|
|
400327
|
-
}
|
|
400328
|
-
function getToolMetadata(toolName, serverName) {
|
|
400329
|
-
const sepIndex = toolName.indexOf("__");
|
|
400330
|
-
const isQualified = sepIndex !== -1;
|
|
400331
|
-
return {
|
|
400332
|
-
actualServer: serverName ?? (isQualified ? toolName.substring(0, sepIndex) : void 0),
|
|
400333
|
-
actualTool: isQualified ? toolName.substring(sepIndex + 2) : toolName
|
|
400334
|
-
};
|
|
400376
|
+
return toolName === pattern;
|
|
400335
400377
|
}
|
|
400336
400378
|
function ruleMatches(rule, toolCall, stringifiedArgs, serverName, currentApprovalMode, toolAnnotations) {
|
|
400337
400379
|
if (rule.modes && rule.modes.length > 0) {
|
|
@@ -400339,6 +400381,15 @@ function ruleMatches(rule, toolCall, stringifiedArgs, serverName, currentApprova
|
|
|
400339
400381
|
return false;
|
|
400340
400382
|
}
|
|
400341
400383
|
}
|
|
400384
|
+
if (rule.mcpName) {
|
|
400385
|
+
if (rule.mcpName === "*") {
|
|
400386
|
+
if (serverName === void 0)
|
|
400387
|
+
return false;
|
|
400388
|
+
} else {
|
|
400389
|
+
if (serverName !== rule.mcpName)
|
|
400390
|
+
return false;
|
|
400391
|
+
}
|
|
400392
|
+
}
|
|
400342
400393
|
if (rule.toolName) {
|
|
400343
400394
|
if (rule.toolName === "*") {
|
|
400344
400395
|
} else if (isWildcardPattern(rule.toolName)) {
|
|
@@ -400380,6 +400431,7 @@ var init_policy_engine = __esm({
|
|
|
400380
400431
|
init_protocol2();
|
|
400381
400432
|
init_shell_utils();
|
|
400382
400433
|
init_tool_names();
|
|
400434
|
+
init_mcp_tool();
|
|
400383
400435
|
PolicyEngine = class {
|
|
400384
400436
|
rules;
|
|
400385
400437
|
checkers;
|
|
@@ -400508,6 +400560,15 @@ var init_policy_engine = __esm({
|
|
|
400508
400560
|
* Returns the decision and the matching rule (if any).
|
|
400509
400561
|
*/
|
|
400510
400562
|
async check(toolCall, serverName, toolAnnotations) {
|
|
400563
|
+
if (!serverName && isMcpToolAnnotation(toolAnnotations)) {
|
|
400564
|
+
serverName = toolAnnotations._serverName;
|
|
400565
|
+
}
|
|
400566
|
+
if (!serverName && toolCall.name) {
|
|
400567
|
+
const parsed = parseMcpToolName(toolCall.name);
|
|
400568
|
+
if (parsed.serverName) {
|
|
400569
|
+
serverName = parsed.serverName;
|
|
400570
|
+
}
|
|
400571
|
+
}
|
|
400511
400572
|
let stringifiedArgs;
|
|
400512
400573
|
if (toolCall.args && (this.rules.some((rule) => rule.argsPattern) || this.checkers.some((checker) => checker.argsPattern))) {
|
|
400513
400574
|
stringifiedArgs = stableStringify(toolCall.args);
|
|
@@ -400529,12 +400590,6 @@ var init_policy_engine = __esm({
|
|
|
400529
400590
|
const toolCallsToTry = [];
|
|
400530
400591
|
for (const name4 of toolNamesToTry) {
|
|
400531
400592
|
toolCallsToTry.push({ ...toolCall, name: name4 });
|
|
400532
|
-
if (serverName && !name4.includes("__")) {
|
|
400533
|
-
toolCallsToTry.push({
|
|
400534
|
-
...toolCall,
|
|
400535
|
-
name: `${serverName}__${name4}`
|
|
400536
|
-
});
|
|
400537
|
-
}
|
|
400538
400593
|
}
|
|
400539
400594
|
for (const rule of this.rules) {
|
|
400540
400595
|
const match2 = toolCallsToTry.some((tc) => ruleMatches(rule, tc, stringifiedArgs, serverName, this.approvalMode, toolAnnotations));
|
|
@@ -400680,107 +400735,52 @@ var init_policy_engine = __esm({
|
|
|
400680
400735
|
*/
|
|
400681
400736
|
getExcludedTools(toolMetadata, allToolNames) {
|
|
400682
400737
|
const excludedTools = /* @__PURE__ */ new Set();
|
|
400683
|
-
|
|
400684
|
-
|
|
400685
|
-
|
|
400686
|
-
|
|
400687
|
-
|
|
400688
|
-
|
|
400689
|
-
|
|
400690
|
-
|
|
400691
|
-
|
|
400692
|
-
|
|
400693
|
-
|
|
400694
|
-
|
|
400695
|
-
|
|
400696
|
-
|
|
400697
|
-
|
|
400698
|
-
|
|
400699
|
-
|
|
400700
|
-
|
|
400701
|
-
|
|
400702
|
-
|
|
400703
|
-
|
|
400704
|
-
|
|
400705
|
-
|
|
400706
|
-
|
|
400707
|
-
|
|
400708
|
-
annotationsMatch = false;
|
|
400738
|
+
if (!allToolNames) {
|
|
400739
|
+
return excludedTools;
|
|
400740
|
+
}
|
|
400741
|
+
for (const toolName of allToolNames) {
|
|
400742
|
+
const annotations = toolMetadata?.get(toolName);
|
|
400743
|
+
const serverName = isMcpToolAnnotation(annotations) ? annotations._serverName : void 0;
|
|
400744
|
+
let staticallyExcluded = false;
|
|
400745
|
+
let matchFound = false;
|
|
400746
|
+
for (const rule of this.rules) {
|
|
400747
|
+
const ruleWithoutArgs = { ...rule, argsPattern: void 0 };
|
|
400748
|
+
const toolCall = { name: toolName, args: {} };
|
|
400749
|
+
const appliesToTool = ruleMatches(
|
|
400750
|
+
ruleWithoutArgs,
|
|
400751
|
+
toolCall,
|
|
400752
|
+
void 0,
|
|
400753
|
+
// stringifiedArgs
|
|
400754
|
+
serverName,
|
|
400755
|
+
this.approvalMode,
|
|
400756
|
+
annotations
|
|
400757
|
+
);
|
|
400758
|
+
if (appliesToTool) {
|
|
400759
|
+
if (rule.argsPattern) {
|
|
400760
|
+
if (rule.decision !== PolicyDecision.DENY) {
|
|
400761
|
+
staticallyExcluded = false;
|
|
400762
|
+
matchFound = true;
|
|
400709
400763
|
break;
|
|
400710
400764
|
}
|
|
400711
|
-
}
|
|
400712
|
-
if (!annotationsMatch) {
|
|
400713
400765
|
continue;
|
|
400714
|
-
}
|
|
400715
|
-
if (rule.toolName) {
|
|
400716
|
-
if (isWildcardPattern(rule.toolName)) {
|
|
400717
|
-
const rawServerName = annotations["_serverName"];
|
|
400718
|
-
const serverName = typeof rawServerName === "string" ? rawServerName : void 0;
|
|
400719
|
-
const qualifiedName = serverName && !toolName2.includes("__") ? `${serverName}__${toolName2}` : toolName2;
|
|
400720
|
-
if (!matchesWildcard(rule.toolName, qualifiedName, void 0)) {
|
|
400721
|
-
continue;
|
|
400722
|
-
}
|
|
400723
|
-
} else if (toolName2 !== rule.toolName) {
|
|
400724
|
-
continue;
|
|
400725
|
-
}
|
|
400726
|
-
}
|
|
400727
|
-
let decision2;
|
|
400728
|
-
if (globalVerdict !== void 0) {
|
|
400729
|
-
decision2 = globalVerdict;
|
|
400730
400766
|
} else {
|
|
400731
|
-
|
|
400732
|
-
|
|
400733
|
-
|
|
400734
|
-
excludedTools.add(toolName2);
|
|
400735
|
-
}
|
|
400736
|
-
processedTools.add(toolName2);
|
|
400737
|
-
}
|
|
400738
|
-
continue;
|
|
400739
|
-
}
|
|
400740
|
-
if (!rule.toolName) {
|
|
400741
|
-
if (globalVerdict === void 0) {
|
|
400742
|
-
globalVerdict = rule.decision;
|
|
400743
|
-
if (globalVerdict !== PolicyDecision.DENY) {
|
|
400767
|
+
const decision = this.applyNonInteractiveMode(rule.decision);
|
|
400768
|
+
staticallyExcluded = decision === PolicyDecision.DENY;
|
|
400769
|
+
matchFound = true;
|
|
400744
400770
|
break;
|
|
400745
400771
|
}
|
|
400746
400772
|
}
|
|
400747
|
-
continue;
|
|
400748
400773
|
}
|
|
400749
|
-
|
|
400750
|
-
|
|
400751
|
-
|
|
400752
|
-
|
|
400753
|
-
let coveredByWildcard = false;
|
|
400754
|
-
for (const processed of processedTools) {
|
|
400755
|
-
if (isWildcardPattern(processed) && matchesWildcard(processed, toolName, void 0)) {
|
|
400756
|
-
if (excludedTools.has(processed)) {
|
|
400757
|
-
excludedTools.add(toolName);
|
|
400758
|
-
}
|
|
400759
|
-
coveredByWildcard = true;
|
|
400760
|
-
break;
|
|
400774
|
+
if (!matchFound) {
|
|
400775
|
+
const defaultDec = this.applyNonInteractiveMode(this.defaultDecision);
|
|
400776
|
+
if (defaultDec === PolicyDecision.DENY) {
|
|
400777
|
+
staticallyExcluded = true;
|
|
400761
400778
|
}
|
|
400762
400779
|
}
|
|
400763
|
-
if (
|
|
400764
|
-
continue;
|
|
400765
|
-
}
|
|
400766
|
-
processedTools.add(toolName);
|
|
400767
|
-
let decision;
|
|
400768
|
-
if (globalVerdict !== void 0) {
|
|
400769
|
-
decision = globalVerdict;
|
|
400770
|
-
} else {
|
|
400771
|
-
decision = rule.decision;
|
|
400772
|
-
}
|
|
400773
|
-
if (decision === PolicyDecision.DENY) {
|
|
400780
|
+
if (staticallyExcluded) {
|
|
400774
400781
|
excludedTools.add(toolName);
|
|
400775
400782
|
}
|
|
400776
400783
|
}
|
|
400777
|
-
if (globalVerdict === PolicyDecision.DENY && allToolNames) {
|
|
400778
|
-
for (const name4 of allToolNames) {
|
|
400779
|
-
if (!processedTools.has(name4)) {
|
|
400780
|
-
excludedTools.add(name4);
|
|
400781
|
-
}
|
|
400782
|
-
}
|
|
400783
|
-
}
|
|
400784
400784
|
return excludedTools;
|
|
400785
400785
|
}
|
|
400786
400786
|
applyNonInteractiveMode(decision) {
|
|
@@ -414045,7 +414045,10 @@ function validateShellCommandSyntax(rule, ruleIndex) {
|
|
|
414045
414045
|
return null;
|
|
414046
414046
|
}
|
|
414047
414047
|
function validateToolName(name4, ruleIndex) {
|
|
414048
|
-
if (
|
|
414048
|
+
if (name4.includes("__")) {
|
|
414049
|
+
return `Rule #${ruleIndex + 1}: The "__" syntax for MCP tools is strictly deprecated. Please use the 'mcpName = "..."' property or the 'mcp_server_tool' format instead.`;
|
|
414050
|
+
}
|
|
414051
|
+
if (isValidToolName(name4, { allowWildcards: true })) {
|
|
414049
414052
|
return null;
|
|
414050
414053
|
}
|
|
414051
414054
|
const allNames = [...ALL_BUILTIN_TOOL_NAMES];
|
|
@@ -414130,8 +414133,6 @@ async function loadPoliciesFromToml(policyPaths, getPolicyTier) {
|
|
|
414130
414133
|
}
|
|
414131
414134
|
for (let i4 = 0; i4 < tomlRules.length; i4++) {
|
|
414132
414135
|
const rule = tomlRules[i4];
|
|
414133
|
-
if (rule.mcpName)
|
|
414134
|
-
continue;
|
|
414135
414136
|
const toolNames = rule.toolName ? Array.isArray(rule.toolName) ? rule.toolName : [rule.toolName] : [];
|
|
414136
414137
|
for (const name4 of toolNames) {
|
|
414137
414138
|
const warning = validateToolName(name4, i4);
|
|
@@ -414154,16 +414155,14 @@ async function loadPoliciesFromToml(policyPaths, getPolicyTier) {
|
|
|
414154
414155
|
return argsPatterns.flatMap((argsPattern) => {
|
|
414155
414156
|
const toolNames = rule.toolName ? Array.isArray(rule.toolName) ? rule.toolName : [rule.toolName] : [void 0];
|
|
414156
414157
|
return toolNames.map((toolName) => {
|
|
414157
|
-
let effectiveToolName;
|
|
414158
|
-
|
|
414159
|
-
|
|
414160
|
-
|
|
414161
|
-
effectiveToolName = `${rule.mcpName}__*`;
|
|
414162
|
-
} else {
|
|
414163
|
-
effectiveToolName = toolName;
|
|
414158
|
+
let effectiveToolName = toolName;
|
|
414159
|
+
const mcpName = rule.mcpName;
|
|
414160
|
+
if (mcpName) {
|
|
414161
|
+
effectiveToolName = formatMcpToolName(mcpName, effectiveToolName);
|
|
414164
414162
|
}
|
|
414165
414163
|
const policyRule = {
|
|
414166
414164
|
toolName: effectiveToolName,
|
|
414165
|
+
mcpName: rule.mcpName,
|
|
414167
414166
|
decision: rule.decision,
|
|
414168
414167
|
priority: transformPriority(rule.priority, tier),
|
|
414169
414168
|
modes: rule.modes,
|
|
@@ -414237,14 +414236,15 @@ Error: ${error2.message}`,
|
|
|
414237
414236
|
return toolNames.map((toolName) => {
|
|
414238
414237
|
let effectiveToolName;
|
|
414239
414238
|
if (checker.mcpName && toolName) {
|
|
414240
|
-
effectiveToolName = `${checker.mcpName}
|
|
414239
|
+
effectiveToolName = `${MCP_TOOL_PREFIX}${checker.mcpName}_${toolName}`;
|
|
414241
414240
|
} else if (checker.mcpName) {
|
|
414242
|
-
effectiveToolName = `${checker.mcpName}
|
|
414241
|
+
effectiveToolName = `${MCP_TOOL_PREFIX}${checker.mcpName}_*`;
|
|
414243
414242
|
} else {
|
|
414244
414243
|
effectiveToolName = toolName;
|
|
414245
414244
|
}
|
|
414246
414245
|
const safetyCheckerRule = {
|
|
414247
414246
|
toolName: effectiveToolName,
|
|
414247
|
+
mcpName: checker.mcpName,
|
|
414248
414248
|
priority: transformPriority(checker.priority, tier),
|
|
414249
414249
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
414250
414250
|
checker: checker.checker,
|
|
@@ -414303,14 +414303,19 @@ Error: ${error2.message}`
|
|
|
414303
414303
|
return { rules, checkers, errors };
|
|
414304
414304
|
}
|
|
414305
414305
|
function validateMcpPolicyToolNames(serverName, discoveredToolNames, policyRules) {
|
|
414306
|
-
const prefix = `${serverName}
|
|
414306
|
+
const prefix = `${MCP_TOOL_PREFIX}${serverName}_`;
|
|
414307
414307
|
const warnings = [];
|
|
414308
414308
|
for (const rule of policyRules) {
|
|
414309
414309
|
if (!rule.toolName)
|
|
414310
414310
|
continue;
|
|
414311
|
-
|
|
414311
|
+
let toolPart;
|
|
414312
|
+
if (rule.mcpName === serverName && rule.toolName.startsWith(prefix)) {
|
|
414313
|
+
toolPart = rule.toolName.slice(prefix.length);
|
|
414314
|
+
} else if (rule.toolName.startsWith(prefix)) {
|
|
414315
|
+
toolPart = rule.toolName.slice(prefix.length);
|
|
414316
|
+
} else {
|
|
414312
414317
|
continue;
|
|
414313
|
-
|
|
414318
|
+
}
|
|
414314
414319
|
if (toolPart === "*")
|
|
414315
414320
|
continue;
|
|
414316
414321
|
if (discoveredToolNames.includes(toolPart))
|
|
@@ -414338,6 +414343,7 @@ var init_toml_loader = __esm({
|
|
|
414338
414343
|
import_toml = __toESM(require_toml(), 1);
|
|
414339
414344
|
init_zod();
|
|
414340
414345
|
init_errors();
|
|
414346
|
+
init_mcp_tool();
|
|
414341
414347
|
MAX_TYPO_DISTANCE = 3;
|
|
414342
414348
|
PolicyRuleSchema = external_exports.object({
|
|
414343
414349
|
toolName: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
@@ -414420,6 +414426,7 @@ var init_config3 = __esm({
|
|
|
414420
414426
|
init_shell_utils();
|
|
414421
414427
|
init_tool_names();
|
|
414422
414428
|
init_errors();
|
|
414429
|
+
init_mcp_tool();
|
|
414423
414430
|
init_security();
|
|
414424
414431
|
__filename3 = fileURLToPath15(import.meta.url);
|
|
414425
414432
|
__dirname7 = path77.dirname(__filename3);
|
|
@@ -418842,7 +418849,6 @@ ${clientInstructions}
|
|
|
418842
418849
|
// packages/core/dist/src/config/config.js
|
|
418843
418850
|
import * as fs68 from "node:fs";
|
|
418844
418851
|
import * as path81 from "node:path";
|
|
418845
|
-
import * as os23 from "node:os";
|
|
418846
418852
|
import { inspect as inspect4 } from "node:util";
|
|
418847
418853
|
import process24 from "node:process";
|
|
418848
418854
|
var DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD, AuthProviderType, Config;
|
|
@@ -419003,6 +419009,7 @@ var init_config4 = __esm({
|
|
|
419003
419009
|
fallbackModelHandler;
|
|
419004
419010
|
validationHandler;
|
|
419005
419011
|
quotaErrorOccurred = false;
|
|
419012
|
+
creditsNotificationShown = false;
|
|
419006
419013
|
modelQuotas = /* @__PURE__ */ new Map();
|
|
419007
419014
|
lastRetrievedQuota;
|
|
419008
419015
|
lastQuotaFetchTime = 0;
|
|
@@ -419017,7 +419024,7 @@ var init_config4 = __esm({
|
|
|
419017
419024
|
}
|
|
419018
419025
|
}
|
|
419019
419026
|
summarizeToolOutput;
|
|
419020
|
-
|
|
419027
|
+
acpMode = false;
|
|
419021
419028
|
loadMemoryFromIncludeDirectories = false;
|
|
419022
419029
|
includeDirectoryTree = true;
|
|
419023
419030
|
importFormat;
|
|
@@ -419171,7 +419178,7 @@ var init_config4 = __esm({
|
|
|
419171
419178
|
protectLatestTurn: params.toolOutputMasking?.protectLatestTurn ?? DEFAULT_PROTECT_LATEST_TURN
|
|
419172
419179
|
};
|
|
419173
419180
|
this.maxSessionTurns = params.maxSessionTurns ?? -1;
|
|
419174
|
-
this.
|
|
419181
|
+
this.acpMode = params.acpMode ?? false;
|
|
419175
419182
|
this.listSessions = params.listSessions ?? false;
|
|
419176
419183
|
this.deleteSession = params.deleteSession;
|
|
419177
419184
|
this.listExtensions = params.listExtensions ?? false;
|
|
@@ -419349,7 +419356,7 @@ var init_config4 = __esm({
|
|
|
419349
419356
|
}
|
|
419350
419357
|
}
|
|
419351
419358
|
});
|
|
419352
|
-
if (!this.interactive || this.
|
|
419359
|
+
if (!this.interactive || this.acpMode) {
|
|
419353
419360
|
await this.mcpInitializationPromise;
|
|
419354
419361
|
}
|
|
419355
419362
|
if (this.skillsSupport) {
|
|
@@ -419377,7 +419384,7 @@ var init_config4 = __esm({
|
|
|
419377
419384
|
getContentGenerator() {
|
|
419378
419385
|
return this.contentGenerator;
|
|
419379
419386
|
}
|
|
419380
|
-
async refreshAuth(authMethod, apiKey) {
|
|
419387
|
+
async refreshAuth(authMethod, apiKey, baseUrl, customHeaders) {
|
|
419381
419388
|
this.modelAvailabilityService.reset();
|
|
419382
419389
|
if (this.contentGeneratorConfig?.authType === AuthType2.USE_GEMINI && authMethod !== AuthType2.USE_GEMINI) {
|
|
419383
419390
|
this.geminiClient.stripThoughtsFromHistory();
|
|
@@ -419386,7 +419393,7 @@ var init_config4 = __esm({
|
|
|
419386
419393
|
if (this.contentGeneratorConfig) {
|
|
419387
419394
|
this.contentGeneratorConfig.authType = void 0;
|
|
419388
419395
|
}
|
|
419389
|
-
const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod, apiKey);
|
|
419396
|
+
const newContentGeneratorConfig = await createContentGeneratorConfig(this, authMethod, apiKey, baseUrl, customHeaders);
|
|
419390
419397
|
this.contentGenerator = await createContentGenerator(newContentGeneratorConfig, this, this.getSessionId());
|
|
419391
419398
|
this.contentGeneratorConfig = newContentGeneratorConfig;
|
|
419392
419399
|
this.baseLlmClient = new BaseLlmClient(this.contentGenerator, this);
|
|
@@ -419535,6 +419542,11 @@ var init_config4 = __esm({
|
|
|
419535
419542
|
resetTurn() {
|
|
419536
419543
|
this.modelAvailabilityService.resetTurn();
|
|
419537
419544
|
}
|
|
419545
|
+
/** Resets billing state (overageStrategy, creditsNotificationShown) once per user prompt. */
|
|
419546
|
+
resetBillingTurnState(overageStrategy) {
|
|
419547
|
+
this.creditsNotificationShown = false;
|
|
419548
|
+
this.billing.overageStrategy = overageStrategy ?? "ask";
|
|
419549
|
+
}
|
|
419538
419550
|
getMaxSessionTurns() {
|
|
419539
419551
|
return this.maxSessionTurns;
|
|
419540
419552
|
}
|
|
@@ -419544,6 +419556,12 @@ var init_config4 = __esm({
|
|
|
419544
419556
|
getQuotaErrorOccurred() {
|
|
419545
419557
|
return this.quotaErrorOccurred;
|
|
419546
419558
|
}
|
|
419559
|
+
setCreditsNotificationShown(value) {
|
|
419560
|
+
this.creditsNotificationShown = value;
|
|
419561
|
+
}
|
|
419562
|
+
getCreditsNotificationShown() {
|
|
419563
|
+
return this.creditsNotificationShown;
|
|
419564
|
+
}
|
|
419547
419565
|
setQuota(remaining, limit, modelId) {
|
|
419548
419566
|
const activeModel = modelId ?? this.getActiveModel();
|
|
419549
419567
|
if (remaining !== void 0 && limit !== void 0) {
|
|
@@ -420067,8 +420085,8 @@ var init_config4 = __esm({
|
|
|
420067
420085
|
getUsageStatisticsEnabled() {
|
|
420068
420086
|
return this.usageStatisticsEnabled;
|
|
420069
420087
|
}
|
|
420070
|
-
|
|
420071
|
-
return this.
|
|
420088
|
+
getAcpMode() {
|
|
420089
|
+
return this.acpMode;
|
|
420072
420090
|
}
|
|
420073
420091
|
async waitForMcpInit() {
|
|
420074
420092
|
if (this.mcpInitializationPromise) {
|
|
@@ -420171,22 +420189,13 @@ var init_config4 = __esm({
|
|
|
420171
420189
|
* @returns true if the path is allowed, false otherwise.
|
|
420172
420190
|
*/
|
|
420173
420191
|
isPathAllowed(absolutePath) {
|
|
420174
|
-
const
|
|
420175
|
-
let resolved;
|
|
420176
|
-
try {
|
|
420177
|
-
resolved = fs68.realpathSync(p);
|
|
420178
|
-
} catch {
|
|
420179
|
-
resolved = path81.resolve(p);
|
|
420180
|
-
}
|
|
420181
|
-
return os23.platform() === "win32" ? resolved.toLowerCase() : resolved;
|
|
420182
|
-
};
|
|
420183
|
-
const resolvedPath = realpath3(absolutePath);
|
|
420192
|
+
const resolvedPath = resolveToRealPath(absolutePath);
|
|
420184
420193
|
const workspaceContext = this.getWorkspaceContext();
|
|
420185
420194
|
if (workspaceContext.isPathWithinWorkspace(resolvedPath)) {
|
|
420186
420195
|
return true;
|
|
420187
420196
|
}
|
|
420188
420197
|
const projectTempDir = this.storage.getProjectTempDir();
|
|
420189
|
-
const resolvedTempDir =
|
|
420198
|
+
const resolvedTempDir = resolveToRealPath(projectTempDir);
|
|
420190
420199
|
return isSubpath(resolvedTempDir, resolvedPath);
|
|
420191
420200
|
}
|
|
420192
420201
|
/**
|
|
@@ -421241,8 +421250,8 @@ var require_utils22 = __commonJS({
|
|
|
421241
421250
|
exports2.toPosixSlashes = (str2) => str2.replace(REGEX_BACKSLASH, "/");
|
|
421242
421251
|
exports2.isWindows = () => {
|
|
421243
421252
|
if (typeof navigator !== "undefined" && navigator.platform) {
|
|
421244
|
-
const
|
|
421245
|
-
return
|
|
421253
|
+
const platform14 = navigator.platform.toLowerCase();
|
|
421254
|
+
return platform14 === "win32" || platform14 === "windows";
|
|
421246
421255
|
}
|
|
421247
421256
|
if (typeof process !== "undefined" && process.platform) {
|
|
421248
421257
|
return process.platform === "win32";
|
|
@@ -423121,7 +423130,7 @@ var require_main2 = __commonJS({
|
|
|
423121
423130
|
"packages/a2a-server/node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
423122
423131
|
var fs75 = __require("fs");
|
|
423123
423132
|
var path90 = __require("path");
|
|
423124
|
-
var
|
|
423133
|
+
var os23 = __require("os");
|
|
423125
423134
|
var crypto23 = __require("crypto");
|
|
423126
423135
|
var packageJson4 = require_package15();
|
|
423127
423136
|
var version4 = packageJson4.version;
|
|
@@ -423244,7 +423253,7 @@ var require_main2 = __commonJS({
|
|
|
423244
423253
|
return null;
|
|
423245
423254
|
}
|
|
423246
423255
|
function _resolveHome(envPath) {
|
|
423247
|
-
return envPath[0] === "~" ? path90.join(
|
|
423256
|
+
return envPath[0] === "~" ? path90.join(os23.homedir(), envPath.slice(1)) : envPath;
|
|
423248
423257
|
}
|
|
423249
423258
|
function _configVault(options) {
|
|
423250
423259
|
const debug2 = Boolean(options && options.debug);
|