@google/gemini-cli-a2a-server 0.33.0-preview.4 → 0.33.0-preview.6

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.
@@ -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 os24 = __require("os");
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 = os24.release().split(".");
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 os24 = __require("os");
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 : os24.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 os24 = __require("os");
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 : os24.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 os24 = __require("os");
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 : os24.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 os24 = __require("os");
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: os24.loadavg(),
9784
- uptime: os24.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 os24 = __require("os");
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: os24.loadavg(),
10024
- uptime: os24.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 os24 = __require("os");
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 = os24.release().split(".");
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 os24 = __require("os");
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 = os24.platform();
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 platform15 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
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 (platform15 === "win32") {
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 os24 = __require("os");
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 os24.platform().startsWith("win");
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 os24 = __require("os");
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 = os24.platform();
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 = (platform15) => {
94423
- platform15 = platform15.toLowerCase();
94424
- if (platform15.includes("ios"))
94422
+ normalizePlatform = (platform14) => {
94423
+ platform14 = platform14.toLowerCase();
94424
+ if (platform14.includes("ios"))
94425
94425
  return "iOS";
94426
- if (platform15 === "android")
94426
+ if (platform14 === "android")
94427
94427
  return "Android";
94428
- if (platform15 === "darwin")
94428
+ if (platform14 === "darwin")
94429
94429
  return "MacOS";
94430
- if (platform15 === "win32")
94430
+ if (platform14 === "win32")
94431
94431
  return "Windows";
94432
- if (platform15 === "freebsd")
94432
+ if (platform14 === "freebsd")
94433
94433
  return "FreeBSD";
94434
- if (platform15 === "openbsd")
94434
+ if (platform14 === "openbsd")
94435
94435
  return "OpenBSD";
94436
- if (platform15 === "linux")
94436
+ if (platform14 === "linux")
94437
94437
  return "Linux";
94438
- if (platform15)
94439
- return `Other:${platform15}`;
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 os24 = __require("os");
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 os24.platform().startsWith("win");
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 os24 = __require("os");
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 = os24.platform();
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;
@@ -106747,8 +106747,8 @@ function isSubpath(parentPath, childPath) {
106747
106747
  const relative6 = pathModule2.relative(parentPath, childPath);
106748
106748
  return !relative6.startsWith(`..${pathModule2.sep}`) && relative6 !== ".." && !pathModule2.isAbsolute(relative6);
106749
106749
  }
106750
- function resolveToRealPath(path90) {
106751
- let resolvedPath = path90;
106750
+ function resolveToRealPath(pathStr) {
106751
+ let resolvedPath = pathStr;
106752
106752
  try {
106753
106753
  if (resolvedPath.startsWith("file://")) {
106754
106754
  resolvedPath = fileURLToPath2(resolvedPath);
@@ -106756,10 +106756,28 @@ function resolveToRealPath(path90) {
106756
106756
  resolvedPath = decodeURIComponent(resolvedPath);
106757
106757
  } catch (_e) {
106758
106758
  }
106759
+ return robustRealpath(path11.resolve(resolvedPath));
106760
+ }
106761
+ function robustRealpath(p) {
106759
106762
  try {
106760
- return fs20.realpathSync(resolvedPath);
106761
- } catch (_e) {
106762
- return resolvedPath;
106763
+ return fs20.realpathSync(p);
106764
+ } catch (e3) {
106765
+ if (e3 && typeof e3 === "object" && "code" in e3 && e3.code === "ENOENT") {
106766
+ try {
106767
+ const stat4 = fs20.lstatSync(p);
106768
+ if (stat4.isSymbolicLink()) {
106769
+ const target = fs20.readlinkSync(p);
106770
+ const resolvedTarget = path11.resolve(path11.dirname(p), target);
106771
+ return robustRealpath(resolvedTarget);
106772
+ }
106773
+ } catch {
106774
+ }
106775
+ const parent = path11.dirname(p);
106776
+ if (parent === p)
106777
+ return p;
106778
+ return path11.join(robustRealpath(parent), path11.basename(p));
106779
+ }
106780
+ throw e3;
106763
106781
  }
106764
106782
  }
106765
106783
  var GEMINI_DIR, GOOGLE_ACCOUNTS_FILENAME;
@@ -122500,10 +122518,36 @@ var init_tools = __esm({
122500
122518
 
122501
122519
  // packages/core/dist/src/tools/mcp-tool.js
122502
122520
  function isMcpToolName(name4) {
122503
- if (!name4.includes(MCP_QUALIFIED_NAME_SEPARATOR))
122504
- return false;
122505
- const parts2 = name4.split(MCP_QUALIFIED_NAME_SEPARATOR);
122506
- return parts2.length === 2 && parts2[0].length > 0 && parts2[1].length > 0;
122521
+ return name4.startsWith(MCP_TOOL_PREFIX);
122522
+ }
122523
+ function parseMcpToolName(name4) {
122524
+ if (!isMcpToolName(name4)) {
122525
+ return {};
122526
+ }
122527
+ const withoutPrefix = name4.slice(MCP_TOOL_PREFIX.length);
122528
+ const match2 = withoutPrefix.match(/^([^_]+)_(.+)$/);
122529
+ if (match2) {
122530
+ return {
122531
+ serverName: match2[1],
122532
+ toolName: match2[2]
122533
+ };
122534
+ }
122535
+ return {};
122536
+ }
122537
+ function formatMcpToolName(serverName, toolName) {
122538
+ if (serverName === "*" && !toolName) {
122539
+ return `${MCP_TOOL_PREFIX}*`;
122540
+ } else if (serverName === "*") {
122541
+ return `${MCP_TOOL_PREFIX}*_${toolName}`;
122542
+ } else if (!toolName) {
122543
+ return `${MCP_TOOL_PREFIX}${serverName}_*`;
122544
+ } else {
122545
+ return `${MCP_TOOL_PREFIX}${serverName}_${toolName}`;
122546
+ }
122547
+ }
122548
+ function isMcpToolAnnotation(annotation) {
122549
+ return typeof annotation === "object" && annotation !== null && // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
122550
+ typeof annotation["_serverName"] === "string";
122507
122551
  }
122508
122552
  function transformTextBlock(block) {
122509
122553
  return { text: block.text };
@@ -122598,24 +122642,28 @@ function getStringifiedResultForDisplay(rawResponse) {
122598
122642
  return displayParts.join("\n");
122599
122643
  }
122600
122644
  function generateValidName(name4) {
122601
- let validToolname = name4.replace(/[^a-zA-Z0-9_.:-]/g, "_");
122645
+ let validToolname = name4.startsWith("mcp_") ? name4 : `mcp_${name4}`;
122646
+ validToolname = validToolname.replace(/[^a-zA-Z0-9_\-.:]/g, "_");
122602
122647
  if (/^[^a-zA-Z_]/.test(validToolname)) {
122603
122648
  validToolname = `_${validToolname}`;
122604
122649
  }
122605
122650
  const safeLimit = MAX_FUNCTION_NAME_LENGTH - 1;
122606
122651
  if (validToolname.length > safeLimit) {
122652
+ debugLogger.warn(`Truncating MCP tool name "${validToolname}" to fit within the 64 character limit. This tool may require user approval.`);
122607
122653
  validToolname = validToolname.slice(0, 30) + "..." + validToolname.slice(-30);
122608
122654
  }
122609
122655
  return validToolname;
122610
122656
  }
122611
- var MCP_QUALIFIED_NAME_SEPARATOR, DiscoveredMCPToolInvocation, DiscoveredMCPTool, MAX_FUNCTION_NAME_LENGTH;
122657
+ var MCP_QUALIFIED_NAME_SEPARATOR, MCP_TOOL_PREFIX, DiscoveredMCPToolInvocation, DiscoveredMCPTool, MAX_FUNCTION_NAME_LENGTH;
122612
122658
  var init_mcp_tool = __esm({
122613
122659
  "packages/core/dist/src/tools/mcp-tool.js"() {
122614
122660
  "use strict";
122615
122661
  init_safeJsonStringify();
122662
+ init_debugLogger();
122616
122663
  init_tools();
122617
122664
  init_tool_error();
122618
- MCP_QUALIFIED_NAME_SEPARATOR = "__";
122665
+ MCP_QUALIFIED_NAME_SEPARATOR = "_";
122666
+ MCP_TOOL_PREFIX = "mcp_";
122619
122667
  DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends BaseToolInvocation {
122620
122668
  mcpTool;
122621
122669
  serverName;
@@ -122757,7 +122805,7 @@ var init_mcp_tool = __esm({
122757
122805
  _toolAnnotations;
122758
122806
  constructor(mcpTool, serverName, serverToolName, description, parameterSchema, messageBus, trust, isReadOnly, nameOverride, cliConfig, extensionName, extensionId, _toolAnnotations) {
122759
122807
  super(
122760
- generateValidName(nameOverride ?? serverToolName),
122808
+ nameOverride ?? generateValidName(`${serverName}${MCP_QUALIFIED_NAME_SEPARATOR}${serverToolName}`),
122761
122809
  `${serverToolName} (${serverName} MCP Server)`,
122762
122810
  description,
122763
122811
  Kind.Other,
@@ -122792,7 +122840,7 @@ var init_mcp_tool = __esm({
122792
122840
  return this._toolAnnotations;
122793
122841
  }
122794
122842
  getFullyQualifiedPrefix() {
122795
- return `${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}`;
122843
+ return generateValidName(`${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}`);
122796
122844
  }
122797
122845
  getFullyQualifiedName() {
122798
122846
  return generateValidName(`${this.serverName}${MCP_QUALIFIED_NAME_SEPARATOR}${this.serverToolName}`);
@@ -137624,7 +137672,7 @@ var require_service_config = __commonJS({
137624
137672
  exports2.validateRetryThrottling = validateRetryThrottling;
137625
137673
  exports2.validateServiceConfig = validateServiceConfig;
137626
137674
  exports2.extractAndSelectServiceConfig = extractAndSelectServiceConfig;
137627
- var os24 = __require("os");
137675
+ var os23 = __require("os");
137628
137676
  var constants_1 = require_constants3();
137629
137677
  var DURATION_REGEX = /^\d+(\.\d{1,9})?s$/;
137630
137678
  var CLIENT_LANGUAGE_STRING = "node";
@@ -137923,7 +137971,7 @@ var require_service_config = __commonJS({
137923
137971
  if (Array.isArray(validatedConfig.clientHostname)) {
137924
137972
  let hostnameMatched = false;
137925
137973
  for (const hostname3 of validatedConfig.clientHostname) {
137926
- if (hostname3 === os24.hostname()) {
137974
+ if (hostname3 === os23.hostname()) {
137927
137975
  hostnameMatched = true;
137928
137976
  }
137929
137977
  }
@@ -151444,7 +151492,7 @@ var require_subchannel_call = __commonJS({
151444
151492
  Object.defineProperty(exports2, "__esModule", { value: true });
151445
151493
  exports2.Http2SubchannelCall = void 0;
151446
151494
  var http22 = __require("http2");
151447
- var os24 = __require("os");
151495
+ var os23 = __require("os");
151448
151496
  var constants_1 = require_constants3();
151449
151497
  var metadata_1 = require_metadata4();
151450
151498
  var stream_decoder_1 = require_stream_decoder();
@@ -151452,7 +151500,7 @@ var require_subchannel_call = __commonJS({
151452
151500
  var constants_2 = require_constants3();
151453
151501
  var TRACER_NAME2 = "subchannel_call";
151454
151502
  function getSystemErrorName(errno) {
151455
- for (const [name4, num] of Object.entries(os24.constants.errno)) {
151503
+ for (const [name4, num] of Object.entries(os23.constants.errno)) {
151456
151504
  if (num === errno) {
151457
151505
  return name4;
151458
151506
  }
@@ -171836,7 +171884,7 @@ var require_ProcessDetector = __commonJS({
171836
171884
  exports2.processDetector = void 0;
171837
171885
  var api_1 = (init_esm2(), __toCommonJS(esm_exports4));
171838
171886
  var semconv_1 = require_semconv2();
171839
- var os24 = __require("os");
171887
+ var os23 = __require("os");
171840
171888
  var ProcessDetector = class {
171841
171889
  detect(_config) {
171842
171890
  const attributes = {
@@ -171856,7 +171904,7 @@ var require_ProcessDetector = __commonJS({
171856
171904
  attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
171857
171905
  }
171858
171906
  try {
171859
- const userInfo2 = os24.userInfo();
171907
+ const userInfo2 = os23.userInfo();
171860
171908
  attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo2.username;
171861
171909
  } catch (e3) {
171862
171910
  api_1.diag.debug(`error obtaining process owner: ${e3}`);
@@ -191366,7 +191414,7 @@ var require_package10 = __commonJS({
191366
191414
  var require_util13 = __commonJS({
191367
191415
  "node_modules/systeminformation/lib/util.js"(exports2) {
191368
191416
  "use strict";
191369
- var os24 = __require("os");
191417
+ var os23 = __require("os");
191370
191418
  var fs75 = __require("fs");
191371
191419
  var path90 = __require("path");
191372
191420
  var spawn10 = __require("child_process").spawn;
@@ -191473,7 +191521,7 @@ var require_util13 = __commonJS({
191473
191521
  }
191474
191522
  function cores() {
191475
191523
  if (_cores === 0) {
191476
- _cores = os24.cpus().length;
191524
+ _cores = os23.cpus().length;
191477
191525
  }
191478
191526
  return _cores;
191479
191527
  }
@@ -191734,7 +191782,7 @@ var require_util13 = __commonJS({
191734
191782
  function powerShellRelease() {
191735
191783
  try {
191736
191784
  if (_psChild) {
191737
- _psChild.stdin.write("exit" + os24.EOL);
191785
+ _psChild.stdin.write("exit" + os23.EOL);
191738
191786
  _psChild.stdin.end();
191739
191787
  }
191740
191788
  } catch {
@@ -191761,7 +191809,7 @@ var require_util13 = __commonJS({
191761
191809
  });
191762
191810
  try {
191763
191811
  if (_psChild && _psChild.pid) {
191764
- _psChild.stdin.write(_psToUTF8 + "echo " + _psCmdStart + id + _psIdSeperator + "; " + os24.EOL + cmd + os24.EOL + "echo " + _psCmdSeperator + os24.EOL);
191812
+ _psChild.stdin.write(_psToUTF8 + "echo " + _psCmdStart + id + _psIdSeperator + "; " + os23.EOL + cmd + os23.EOL + "echo " + _psCmdSeperator + os23.EOL);
191765
191813
  }
191766
191814
  } catch {
191767
191815
  resolve20("");
@@ -191773,7 +191821,7 @@ var require_util13 = __commonJS({
191773
191821
  return new Promise((resolve20) => {
191774
191822
  process.nextTick(() => {
191775
191823
  try {
191776
- const osVersion = os24.release().split(".").map(Number);
191824
+ const osVersion = os23.release().split(".").map(Number);
191777
191825
  const spanOptions = osVersion[0] < 10 ? ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-ExecutionPolicy", "Unrestricted", "-Command", "-"] : ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-ExecutionPolicy", "Unrestricted", "-Command", _psToUTF8 + cmd];
191778
191826
  const child = spawn10(_powerShell, spanOptions, {
191779
191827
  stdio: "pipe",
@@ -191805,8 +191853,8 @@ var require_util13 = __commonJS({
191805
191853
  });
191806
191854
  if (osVersion[0] < 10) {
191807
191855
  try {
191808
- child.stdin.write(_psToUTF8 + cmd + os24.EOL);
191809
- child.stdin.write("exit" + os24.EOL);
191856
+ child.stdin.write(_psToUTF8 + cmd + os23.EOL);
191857
+ child.stdin.write("exit" + os23.EOL);
191810
191858
  child.stdin.end();
191811
191859
  } catch {
191812
191860
  child.kill();
@@ -192071,14 +192119,14 @@ var require_util13 = __commonJS({
192071
192119
  return ("00000000" + parseInt(hex, 16).toString(2)).substr(-8);
192072
192120
  }
192073
192121
  function getFilesInPath(source) {
192074
- const lstatSync2 = fs75.lstatSync;
192122
+ const lstatSync3 = fs75.lstatSync;
192075
192123
  const readdirSync4 = fs75.readdirSync;
192076
192124
  const join34 = path90.join;
192077
192125
  function isDirectory(source2) {
192078
- return lstatSync2(source2).isDirectory();
192126
+ return lstatSync3(source2).isDirectory();
192079
192127
  }
192080
192128
  function isFile3(source2) {
192081
- return lstatSync2(source2).isFile();
192129
+ return lstatSync3(source2).isFile();
192082
192130
  }
192083
192131
  function getDirectories(source2) {
192084
192132
  return readdirSync4(source2).map((name4) => {
@@ -193874,7 +193922,7 @@ var require_util13 = __commonJS({
193874
193922
  var require_osinfo = __commonJS({
193875
193923
  "node_modules/systeminformation/lib/osinfo.js"(exports2) {
193876
193924
  "use strict";
193877
- var os24 = __require("os");
193925
+ var os23 = __require("os");
193878
193926
  var fs75 = __require("fs");
193879
193927
  var util5 = require_util13();
193880
193928
  var exec3 = __require("child_process").exec;
@@ -193897,14 +193945,14 @@ var require_osinfo = __commonJS({
193897
193945
  }
193898
193946
  const result2 = {
193899
193947
  current: Date.now(),
193900
- uptime: os24.uptime(),
193948
+ uptime: os23.uptime(),
193901
193949
  timezone: t3.length >= 7 ? t3[5] : "",
193902
193950
  timezoneName
193903
193951
  };
193904
193952
  if (_darwin || _linux) {
193905
193953
  try {
193906
193954
  const stdout = execSync4("date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null", util5.execOptsLinux);
193907
- const lines = stdout.toString().split(os24.EOL);
193955
+ const lines = stdout.toString().split(os23.EOL);
193908
193956
  if (lines.length > 3 && !lines[0]) {
193909
193957
  lines.shift();
193910
193958
  }
@@ -193914,7 +193962,7 @@ var require_osinfo = __commonJS({
193914
193962
  }
193915
193963
  return {
193916
193964
  current: Date.now(),
193917
- uptime: os24.uptime(),
193965
+ uptime: os23.uptime(),
193918
193966
  timezone: lines[1] ? timezone + lines[1] : timezone,
193919
193967
  timezoneName: lines[2] && lines[2].indexOf("/zoneinfo/") > 0 ? lines[2].split("/zoneinfo/")[1] || "" : ""
193920
193968
  };
@@ -194033,11 +194081,11 @@ var require_osinfo = __commonJS({
194033
194081
  return "";
194034
194082
  }
194035
194083
  function getFQDN() {
194036
- let fqdn = os24.hostname;
194084
+ let fqdn = os23.hostname;
194037
194085
  if (_linux || _darwin) {
194038
194086
  try {
194039
194087
  const stdout = execSync4("hostname -f 2>/dev/null", util5.execOptsLinux);
194040
- fqdn = stdout.toString().split(os24.EOL)[0];
194088
+ fqdn = stdout.toString().split(os23.EOL)[0];
194041
194089
  } catch {
194042
194090
  util5.noop();
194043
194091
  }
@@ -194045,7 +194093,7 @@ var require_osinfo = __commonJS({
194045
194093
  if (_freebsd || _openbsd || _netbsd) {
194046
194094
  try {
194047
194095
  const stdout = execSync4("hostname 2>/dev/null");
194048
- fqdn = stdout.toString().split(os24.EOL)[0];
194096
+ fqdn = stdout.toString().split(os23.EOL)[0];
194049
194097
  } catch {
194050
194098
  util5.noop();
194051
194099
  }
@@ -194053,7 +194101,7 @@ var require_osinfo = __commonJS({
194053
194101
  if (_windows) {
194054
194102
  try {
194055
194103
  const stdout = execSync4("echo %COMPUTERNAME%.%USERDNSDOMAIN%", util5.execOptsWin);
194056
- fqdn = stdout.toString().replace(".%USERDNSDOMAIN%", "").split(os24.EOL)[0];
194104
+ fqdn = stdout.toString().replace(".%USERDNSDOMAIN%", "").split(os23.EOL)[0];
194057
194105
  } catch {
194058
194106
  util5.noop();
194059
194107
  }
@@ -194068,9 +194116,9 @@ var require_osinfo = __commonJS({
194068
194116
  distro: "unknown",
194069
194117
  release: "unknown",
194070
194118
  codename: "",
194071
- kernel: os24.release(),
194072
- arch: os24.arch(),
194073
- hostname: os24.hostname(),
194119
+ kernel: os23.release(),
194120
+ arch: os23.arch(),
194121
+ hostname: os23.hostname(),
194074
194122
  fqdn: getFQDN(),
194075
194123
  codepage: "",
194076
194124
  logofile: "",
@@ -194279,7 +194327,7 @@ var require_osinfo = __commonJS({
194279
194327
  }
194280
194328
  function versions(apps2, callback) {
194281
194329
  let versionObject = {
194282
- kernel: os24.release(),
194330
+ kernel: os23.release(),
194283
194331
  apache: "",
194284
194332
  bash: "",
194285
194333
  bun: "",
@@ -194989,7 +195037,7 @@ var require_osinfo = __commonJS({
194989
195037
  function getUniqueMacAdresses() {
194990
195038
  let macs = [];
194991
195039
  try {
194992
- const ifaces = os24.networkInterfaces();
195040
+ const ifaces = os23.networkInterfaces();
194993
195041
  for (let dev in ifaces) {
194994
195042
  if ({}.hasOwnProperty.call(ifaces, dev)) {
194995
195043
  ifaces[dev].forEach((details) => {
@@ -195111,7 +195159,7 @@ var require_system = __commonJS({
195111
195159
  "node_modules/systeminformation/lib/system.js"(exports2) {
195112
195160
  "use strict";
195113
195161
  var fs75 = __require("fs");
195114
- var os24 = __require("os");
195162
+ var os23 = __require("os");
195115
195163
  var util5 = require_util13();
195116
195164
  var { uuid: uuid2 } = require_osinfo();
195117
195165
  var exec3 = __require("child_process").exec;
@@ -195235,8 +195283,8 @@ var require_system = __commonJS({
195235
195283
  util5.noop();
195236
195284
  }
195237
195285
  }
195238
- if (!result2.virtual && (os24.release().toLowerCase().indexOf("microsoft") >= 0 || os24.release().toLowerCase().endsWith("wsl2"))) {
195239
- const kernelVersion = parseFloat(os24.release().toLowerCase());
195286
+ if (!result2.virtual && (os23.release().toLowerCase().indexOf("microsoft") >= 0 || os23.release().toLowerCase().endsWith("wsl2"))) {
195287
+ const kernelVersion = parseFloat(os23.release().toLowerCase());
195240
195288
  result2.virtual = true;
195241
195289
  result2.manufacturer = "Microsoft";
195242
195290
  result2.model = "WSL";
@@ -195646,7 +195694,7 @@ var require_system = __commonJS({
195646
195694
  result2.model = "Raspberry Pi";
195647
195695
  result2.serial = rpi.serial;
195648
195696
  result2.version = rpi.type + " - " + rpi.revision;
195649
- result2.memMax = os24.totalmem();
195697
+ result2.memMax = os23.totalmem();
195650
195698
  result2.memSlots = 0;
195651
195699
  }
195652
195700
  if (callback) {
@@ -195672,9 +195720,9 @@ var require_system = __commonJS({
195672
195720
  }
195673
195721
  devices.shift();
195674
195722
  result2.memSlots = devices.length;
195675
- if (os24.arch() === "arm64") {
195723
+ if (os23.arch() === "arm64") {
195676
195724
  result2.memSlots = 0;
195677
- result2.memMax = os24.totalmem();
195725
+ result2.memMax = os23.totalmem();
195678
195726
  }
195679
195727
  if (callback) {
195680
195728
  callback(result2);
@@ -195691,7 +195739,7 @@ var require_system = __commonJS({
195691
195739
  if (_windows) {
195692
195740
  try {
195693
195741
  const workload = [];
195694
- const win10plus = parseInt(os24.release()) >= 10;
195742
+ const win10plus = parseInt(os23.release()) >= 10;
195695
195743
  const maxCapacityAttribute = win10plus ? "MaxCapacityEx" : "MaxCapacity";
195696
195744
  workload.push(util5.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl"));
195697
195745
  workload.push(util5.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
@@ -195887,7 +195935,7 @@ var require_system = __commonJS({
195887
195935
  var require_cpu = __commonJS({
195888
195936
  "node_modules/systeminformation/lib/cpu.js"(exports2) {
195889
195937
  "use strict";
195890
- var os24 = __require("os");
195938
+ var os23 = __require("os");
195891
195939
  var exec3 = __require("child_process").exec;
195892
195940
  var execSync4 = __require("child_process").execSync;
195893
195941
  var fs75 = __require("fs");
@@ -196750,7 +196798,7 @@ var require_cpu = __commonJS({
196750
196798
  const countProcessors = util5.getValue(lines, "hw.packages");
196751
196799
  const countCores = util5.getValue(lines, "hw.physicalcpu_max");
196752
196800
  const countThreads = util5.getValue(lines, "hw.ncpu");
196753
- if (os24.arch() === "arm64") {
196801
+ if (os23.arch() === "arm64") {
196754
196802
  result2.socket = "SOC";
196755
196803
  try {
196756
196804
  const clusters = execSync4("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split("\n");
@@ -196778,8 +196826,8 @@ var require_cpu = __commonJS({
196778
196826
  if (_linux) {
196779
196827
  let modelline = "";
196780
196828
  let lines = [];
196781
- if (os24.cpus()[0] && os24.cpus()[0].model) {
196782
- modelline = os24.cpus()[0].model;
196829
+ if (os23.cpus()[0] && os23.cpus()[0].model) {
196830
+ modelline = os23.cpus()[0].model;
196783
196831
  }
196784
196832
  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
196833
  if (!error2) {
@@ -196868,8 +196916,8 @@ var require_cpu = __commonJS({
196868
196916
  if (_freebsd || _openbsd || _netbsd) {
196869
196917
  let modelline = "";
196870
196918
  let lines = [];
196871
- if (os24.cpus()[0] && os24.cpus()[0].model) {
196872
- modelline = os24.cpus()[0].model;
196919
+ if (os23.cpus()[0] && os23.cpus()[0].model) {
196920
+ modelline = os23.cpus()[0].model;
196873
196921
  }
196874
196922
  exec3("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL", (error2, stdout) => {
196875
196923
  let cache4 = [];
@@ -197029,7 +197077,7 @@ var require_cpu = __commonJS({
197029
197077
  }
197030
197078
  exports2.cpu = cpu;
197031
197079
  function getCpuCurrentSpeedSync() {
197032
- const cpus2 = os24.cpus();
197080
+ const cpus2 = os23.cpus();
197033
197081
  let minFreq = 999999999;
197034
197082
  let maxFreq = 0;
197035
197083
  let avgFreq = 0;
@@ -197724,7 +197772,7 @@ var require_cpu = __commonJS({
197724
197772
  function getLoad() {
197725
197773
  return new Promise((resolve20) => {
197726
197774
  process.nextTick(() => {
197727
- const loads = os24.loadavg().map((x3) => {
197775
+ const loads = os23.loadavg().map((x3) => {
197728
197776
  return x3 / util5.cores();
197729
197777
  });
197730
197778
  const avgLoad = parseFloat(Math.max.apply(Math, loads).toFixed(2));
@@ -197732,7 +197780,7 @@ var require_cpu = __commonJS({
197732
197780
  const now = Date.now() - _current_cpu.ms;
197733
197781
  if (now >= 200) {
197734
197782
  _current_cpu.ms = Date.now();
197735
- const cpus2 = os24.cpus().map((cpu2) => {
197783
+ const cpus2 = os23.cpus().map((cpu2) => {
197736
197784
  cpu2.times.steal = 0;
197737
197785
  cpu2.times.guest = 0;
197738
197786
  return cpu2;
@@ -197926,7 +197974,7 @@ var require_cpu = __commonJS({
197926
197974
  function getFullLoad() {
197927
197975
  return new Promise((resolve20) => {
197928
197976
  process.nextTick(() => {
197929
- const cpus2 = os24.cpus();
197977
+ const cpus2 = os23.cpus();
197930
197978
  let totalUser = 0;
197931
197979
  let totalSystem = 0;
197932
197980
  let totalNice = 0;
@@ -197969,7 +198017,7 @@ var require_cpu = __commonJS({
197969
198017
  var require_memory = __commonJS({
197970
198018
  "node_modules/systeminformation/lib/memory.js"(exports2) {
197971
198019
  "use strict";
197972
- var os24 = __require("os");
198020
+ var os23 = __require("os");
197973
198021
  var exec3 = __require("child_process").exec;
197974
198022
  var execSync4 = __require("child_process").execSync;
197975
198023
  var util5 = require_util13();
@@ -198015,12 +198063,12 @@ var require_memory = __commonJS({
198015
198063
  return new Promise((resolve20) => {
198016
198064
  process.nextTick(() => {
198017
198065
  let result2 = {
198018
- total: os24.totalmem(),
198019
- free: os24.freemem(),
198020
- used: os24.totalmem() - os24.freemem(),
198021
- active: os24.totalmem() - os24.freemem(),
198066
+ total: os23.totalmem(),
198067
+ free: os23.freemem(),
198068
+ used: os23.totalmem() - os23.freemem(),
198069
+ active: os23.totalmem() - os23.freemem(),
198022
198070
  // temporarily (fallback)
198023
- available: os24.freemem(),
198071
+ available: os23.freemem(),
198024
198072
  // temporarily (fallback)
198025
198073
  buffers: 0,
198026
198074
  cached: 0,
@@ -198039,9 +198087,9 @@ var require_memory = __commonJS({
198039
198087
  if (!error2) {
198040
198088
  const lines = stdout.toString().split("\n");
198041
198089
  result2.total = parseInt(util5.getValue(lines, "memtotal"), 10);
198042
- result2.total = result2.total ? result2.total * 1024 : os24.totalmem();
198090
+ result2.total = result2.total ? result2.total * 1024 : os23.totalmem();
198043
198091
  result2.free = parseInt(util5.getValue(lines, "memfree"), 10);
198044
- result2.free = result2.free ? result2.free * 1024 : os24.freemem();
198092
+ result2.free = result2.free ? result2.free * 1024 : os23.freemem();
198045
198093
  result2.used = result2.total - result2.free;
198046
198094
  result2.buffers = parseInt(util5.getValue(lines, "buffers"), 10);
198047
198095
  result2.buffers = result2.buffers ? result2.buffers * 1024 : 0;
@@ -198263,7 +198311,7 @@ var require_memory = __commonJS({
198263
198311
  }
198264
198312
  if (!result2.length) {
198265
198313
  result2.push({
198266
- size: os24.totalmem(),
198314
+ size: os23.totalmem(),
198267
198315
  bank: "",
198268
198316
  type: "",
198269
198317
  ecc: null,
@@ -201411,7 +201459,7 @@ ${BSDName}|"; diskutil info /dev/${BSDName} | grep SMART;`;
201411
201459
  var require_network = __commonJS({
201412
201460
  "node_modules/systeminformation/lib/network.js"(exports2) {
201413
201461
  "use strict";
201414
- var os24 = __require("os");
201462
+ var os23 = __require("os");
201415
201463
  var exec3 = __require("child_process").exec;
201416
201464
  var execSync4 = __require("child_process").execSync;
201417
201465
  var fs75 = __require("fs");
@@ -201435,7 +201483,7 @@ var require_network = __commonJS({
201435
201483
  let ifacename = "";
201436
201484
  let ifacenameFirst = "";
201437
201485
  try {
201438
- const ifaces = os24.networkInterfaces();
201486
+ const ifaces = os23.networkInterfaces();
201439
201487
  let scopeid = 9999;
201440
201488
  for (let dev in ifaces) {
201441
201489
  if ({}.hasOwnProperty.call(ifaces, dev)) {
@@ -201455,7 +201503,7 @@ var require_network = __commonJS({
201455
201503
  let defaultIp = "";
201456
201504
  const cmd = "netstat -r";
201457
201505
  const result2 = execSync4(cmd, util5.execOptsWin);
201458
- const lines = result2.toString().split(os24.EOL);
201506
+ const lines = result2.toString().split(os23.EOL);
201459
201507
  lines.forEach((line) => {
201460
201508
  line = line.replace(/\s+/g, " ").trim();
201461
201509
  if (line.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(line)) {
@@ -202088,7 +202136,7 @@ var require_network = __commonJS({
202088
202136
  defaultString = "" + defaultString;
202089
202137
  return new Promise((resolve20) => {
202090
202138
  process.nextTick(() => {
202091
- const ifaces = os24.networkInterfaces();
202139
+ const ifaces = os23.networkInterfaces();
202092
202140
  let result2 = [];
202093
202141
  let nics = [];
202094
202142
  let dnsSuffixes = [];
@@ -203158,7 +203206,7 @@ var require_network = __commonJS({
203158
203206
  if (_windows) {
203159
203207
  try {
203160
203208
  exec3("netstat -r", util5.execOptsWin, (error2, stdout) => {
203161
- const lines = stdout.toString().split(os24.EOL);
203209
+ const lines = stdout.toString().split(os23.EOL);
203162
203210
  lines.forEach((line) => {
203163
203211
  line = line.replace(/\s+/g, " ").trim();
203164
203212
  if (line.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(line)) {
@@ -203204,7 +203252,7 @@ var require_network = __commonJS({
203204
203252
  var require_wifi = __commonJS({
203205
203253
  "node_modules/systeminformation/lib/wifi.js"(exports2) {
203206
203254
  "use strict";
203207
- var os24 = __require("os");
203255
+ var os23 = __require("os");
203208
203256
  var exec3 = __require("child_process").exec;
203209
203257
  var execSync4 = __require("child_process").execSync;
203210
203258
  var util5 = require_util13();
@@ -203426,7 +203474,7 @@ var require_wifi = __commonJS({
203426
203474
  parts2.shift();
203427
203475
  parts2.forEach((part) => {
203428
203476
  part = "ACTIVE:" + part;
203429
- const lines = part.split(os24.EOL);
203477
+ const lines = part.split(os23.EOL);
203430
203478
  const channel = util5.getValue(lines, "CHAN");
203431
203479
  const frequency = util5.getValue(lines, "FREQ").toLowerCase().replace("mhz", "").trim();
203432
203480
  const security = util5.getValue(lines, "SECURITY").replace("(", "").replace(")", "");
@@ -203650,15 +203698,15 @@ var require_wifi = __commonJS({
203650
203698
  } else if (_windows) {
203651
203699
  const cmd = "netsh wlan show networks mode=Bssid";
203652
203700
  util5.powerShell(cmd).then((stdout) => {
203653
- const ssidParts = stdout.toString("utf8").split(os24.EOL + os24.EOL + "SSID ");
203701
+ const ssidParts = stdout.toString("utf8").split(os23.EOL + os23.EOL + "SSID ");
203654
203702
  ssidParts.shift();
203655
203703
  ssidParts.forEach((ssidPart) => {
203656
- const ssidLines = ssidPart.split(os24.EOL);
203704
+ const ssidLines = ssidPart.split(os23.EOL);
203657
203705
  if (ssidLines && ssidLines.length >= 8 && ssidLines[0].indexOf(":") >= 0) {
203658
203706
  const bssidsParts = ssidPart.split(" BSSID");
203659
203707
  bssidsParts.shift();
203660
203708
  bssidsParts.forEach((bssidPart) => {
203661
- const bssidLines = bssidPart.split(os24.EOL);
203709
+ const bssidLines = bssidPart.split(os23.EOL);
203662
203710
  const bssidLine = bssidLines[0].split(":");
203663
203711
  bssidLine.shift();
203664
203712
  const bssid = bssidLine.join(":").trim().toLowerCase();
@@ -203982,7 +204030,7 @@ var require_wifi = __commonJS({
203982
204030
  var require_processes = __commonJS({
203983
204031
  "node_modules/systeminformation/lib/processes.js"(exports2) {
203984
204032
  "use strict";
203985
- var os24 = __require("os");
204033
+ var os23 = __require("os");
203986
204034
  var fs75 = __require("fs");
203987
204035
  var path90 = __require("path");
203988
204036
  var exec3 = __require("child_process").exec;
@@ -204633,7 +204681,7 @@ var require_processes = __commonJS({
204633
204681
  line = line.trim().replace(/ +/g, " ").replace(/,+/g, ".");
204634
204682
  const parts2 = line.split(" ");
204635
204683
  const command = parts2.slice(9).join(" ");
204636
- const pmem = parseFloat((1 * parseInt(parts2[3]) * 1024 / os24.totalmem()).toFixed(1));
204684
+ const pmem = parseFloat((1 * parseInt(parts2[3]) * 1024 / os23.totalmem()).toFixed(1));
204637
204685
  const started = parseElapsed(parts2[5]);
204638
204686
  result2.push({
204639
204687
  pid: parseInt(parts2[0]),
@@ -204836,7 +204884,7 @@ var require_processes = __commonJS({
204836
204884
  cpu: 0,
204837
204885
  cpuu: 0,
204838
204886
  cpus: 0,
204839
- mem: memw / os24.totalmem() * 100,
204887
+ mem: memw / os23.totalmem() * 100,
204840
204888
  priority: element.Priority | null,
204841
204889
  memVsz: element.PageFileUsage || null,
204842
204890
  memRss: Math.floor((element.WorkingSetSize || 0) / 1024),
@@ -204990,7 +205038,7 @@ var require_processes = __commonJS({
204990
205038
  result2.forEach((item) => {
204991
205039
  if (item.proc.toLowerCase() === pname.toLowerCase()) {
204992
205040
  item.pids.push(pid);
204993
- item.mem += mem / os24.totalmem() * 100;
205041
+ item.mem += mem / os23.totalmem() * 100;
204994
205042
  processFound = true;
204995
205043
  }
204996
205044
  });
@@ -205000,7 +205048,7 @@ var require_processes = __commonJS({
205000
205048
  pid,
205001
205049
  pids: [pid],
205002
205050
  cpu: 0,
205003
- mem: mem / os24.totalmem() * 100
205051
+ mem: mem / os23.totalmem() * 100
205004
205052
  });
205005
205053
  }
205006
205054
  }
@@ -206741,7 +206789,7 @@ var require_docker = __commonJS({
206741
206789
  var require_virtualbox = __commonJS({
206742
206790
  "node_modules/systeminformation/lib/virtualbox.js"(exports2) {
206743
206791
  "use strict";
206744
- var os24 = __require("os");
206792
+ var os23 = __require("os");
206745
206793
  var exec3 = __require("child_process").exec;
206746
206794
  var util5 = require_util13();
206747
206795
  function vboxInfo(callback) {
@@ -206750,10 +206798,10 @@ var require_virtualbox = __commonJS({
206750
206798
  process.nextTick(() => {
206751
206799
  try {
206752
206800
  exec3(util5.getVboxmanage() + " list vms --long", (error2, stdout) => {
206753
- let parts2 = (os24.EOL + stdout.toString()).split(os24.EOL + "Name:");
206801
+ let parts2 = (os23.EOL + stdout.toString()).split(os23.EOL + "Name:");
206754
206802
  parts2.shift();
206755
206803
  parts2.forEach((part) => {
206756
- const lines = ("Name:" + part).split(os24.EOL);
206804
+ const lines = ("Name:" + part).split(os23.EOL);
206757
206805
  const state = util5.getValue(lines, "State");
206758
206806
  const running = state.startsWith("running");
206759
206807
  const runningSinceString = running ? state.replace("running (since ", "").replace(")", "").trim() : "";
@@ -214180,8 +214228,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
214180
214228
  var init_git_commit = __esm({
214181
214229
  "packages/core/dist/src/generated/git-commit.js"() {
214182
214230
  "use strict";
214183
- GIT_COMMIT_INFO = "7e6e40c81";
214184
- CLI_VERSION = "0.33.0-preview.4";
214231
+ GIT_COMMIT_INFO = "9912ea868";
214232
+ CLI_VERSION = "0.33.0-preview.6";
214185
214233
  }
214186
214234
  });
214187
214235
 
@@ -216572,13 +216620,13 @@ var require_src55 = __commonJS({
216572
216620
  };
216573
216621
  function mapOtelResourceToMonitoredResource(resource) {
216574
216622
  const attrs = resource.attributes;
216575
- const platform15 = attrs[semantic_conventions_1.SEMRESATTRS_CLOUD_PLATFORM];
216623
+ const platform14 = attrs[semantic_conventions_1.SEMRESATTRS_CLOUD_PLATFORM];
216576
216624
  let mr;
216577
- if (platform15 === semantic_conventions_1.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE) {
216625
+ if (platform14 === semantic_conventions_1.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE) {
216578
216626
  mr = createMonitoredResource(GCE_INSTANCE, attrs);
216579
- } else if (platform15 === semantic_conventions_1.CLOUDPLATFORMVALUES_GCP_APP_ENGINE) {
216627
+ } else if (platform14 === semantic_conventions_1.CLOUDPLATFORMVALUES_GCP_APP_ENGINE) {
216580
216628
  mr = createMonitoredResource(GAE_INSTANCE, attrs);
216581
- } else if (platform15 === semantic_conventions_1.CLOUDPLATFORMVALUES_AWS_EC2) {
216629
+ } else if (platform14 === semantic_conventions_1.CLOUDPLATFORMVALUES_AWS_EC2) {
216582
216630
  mr = createMonitoredResource(AWS_EC2_INSTANCE, attrs);
216583
216631
  } else if (semantic_conventions_1.SEMRESATTRS_K8S_CLUSTER_NAME in attrs) {
216584
216632
  if (semantic_conventions_1.SEMRESATTRS_K8S_CONTAINER_NAME in attrs) {
@@ -226449,7 +226497,7 @@ var require_grpc = __commonJS({
226449
226497
  var fs75 = __require("fs");
226450
226498
  var google_auth_library_1 = require_src8();
226451
226499
  var grpc = require_src28();
226452
- var os24 = __require("os");
226500
+ var os23 = __require("os");
226453
226501
  var path_1 = __require("path");
226454
226502
  var path90 = __require("path");
226455
226503
  var protobuf = require_protobufjs();
@@ -226754,7 +226802,7 @@ var require_grpc = __commonJS({
226754
226802
  if ((opts === null || opts === void 0 ? void 0 : opts.cert) && (opts === null || opts === void 0 ? void 0 : opts.key)) {
226755
226803
  return [opts.cert, opts.key];
226756
226804
  }
226757
- const metadataPath = (0, path_1.join)(os24.homedir(), ".secureConnect", "context_aware_metadata.json");
226805
+ const metadataPath = (0, path_1.join)(os23.homedir(), ".secureConnect", "context_aware_metadata.json");
226758
226806
  const metadata2 = JSON.parse(await readFileAsync(metadataPath));
226759
226807
  if (!metadata2.cert_provider_command) {
226760
226808
  throw Error("no cert_provider_command found");
@@ -291439,7 +291487,7 @@ function getVersion() {
291439
291487
  }
291440
291488
  versionPromise = (async () => {
291441
291489
  const pkgJson = await getPackageJson(__dirname3);
291442
- return "0.33.0-preview.4";
291490
+ return "0.33.0-preview.6";
291443
291491
  })();
291444
291492
  return versionPromise;
291445
291493
  }
@@ -291457,21 +291505,21 @@ var init_version5 = __esm({
291457
291505
  import { fileURLToPath as fileURLToPath6 } from "node:url";
291458
291506
  import path25 from "node:path";
291459
291507
  function getPlatform() {
291460
- const platform15 = process.platform;
291508
+ const platform14 = process.platform;
291461
291509
  const arch4 = process.arch;
291462
- if (platform15 === "darwin" && arch4 === "x64") {
291510
+ if (platform14 === "darwin" && arch4 === "x64") {
291463
291511
  return "DARWIN_AMD64";
291464
291512
  }
291465
- if (platform15 === "darwin" && arch4 === "arm64") {
291513
+ if (platform14 === "darwin" && arch4 === "arm64") {
291466
291514
  return "DARWIN_ARM64";
291467
291515
  }
291468
- if (platform15 === "linux" && arch4 === "x64") {
291516
+ if (platform14 === "linux" && arch4 === "x64") {
291469
291517
  return "LINUX_AMD64";
291470
291518
  }
291471
- if (platform15 === "linux" && arch4 === "arm64") {
291519
+ if (platform14 === "linux" && arch4 === "arm64") {
291472
291520
  return "LINUX_ARM64";
291473
291521
  }
291474
- if (platform15 === "win32" && arch4 === "x64") {
291522
+ if (platform14 === "win32" && arch4 === "x64") {
291475
291523
  return "WINDOWS_AMD64";
291476
291524
  }
291477
291525
  return "PLATFORM_UNSPECIFIED";
@@ -293618,11 +293666,11 @@ Signal: Signal number or \`(none)\` if no signal was received.
293618
293666
  buildToolMetadata() {
293619
293667
  const toolMetadata = /* @__PURE__ */ new Map();
293620
293668
  for (const [name4, tool] of this.allKnownTools) {
293621
- if (tool.toolAnnotations) {
293622
- const metadata2 = { ...tool.toolAnnotations };
293623
- if (tool instanceof DiscoveredMCPTool) {
293624
- metadata2["_serverName"] = tool.serverName;
293625
- }
293669
+ const metadata2 = tool.toolAnnotations ? { ...tool.toolAnnotations } : {};
293670
+ if (tool instanceof DiscoveredMCPTool) {
293671
+ metadata2["_serverName"] = tool.serverName;
293672
+ }
293673
+ if (Object.keys(metadata2).length > 0) {
293626
293674
  toolMetadata.set(name4, metadata2);
293627
293675
  }
293628
293676
  }
@@ -299003,7 +299051,7 @@ var init_index_min = __esm({
299003
299051
  // node_modules/path-scurry/dist/esm/index.js
299004
299052
  import { posix as posix2, win32 as win322 } from "node:path";
299005
299053
  import { fileURLToPath as fileURLToPath7 } from "node:url";
299006
- import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps } from "fs";
299054
+ import { lstatSync as lstatSync2, readdir as readdirCB, readdirSync, readlinkSync as readlinkSync2, realpathSync as rps } from "fs";
299007
299055
  import * as actualFS from "node:fs";
299008
299056
  import { lstat, readdir, readlink, realpath } from "node:fs/promises";
299009
299057
  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;
@@ -299013,10 +299061,10 @@ var init_esm9 = __esm({
299013
299061
  init_esm();
299014
299062
  realpathSync2 = rps.native;
299015
299063
  defaultFS = {
299016
- lstatSync,
299064
+ lstatSync: lstatSync2,
299017
299065
  readdir: readdirCB,
299018
299066
  readdirSync,
299019
- readlinkSync,
299067
+ readlinkSync: readlinkSync2,
299020
299068
  realpathSync: realpathSync2,
299021
299069
  promises: {
299022
299070
  lstat,
@@ -300759,7 +300807,7 @@ var init_pattern = __esm({
300759
300807
  #isUNC;
300760
300808
  #isAbsolute;
300761
300809
  #followGlobstar = true;
300762
- constructor(patternList, globList, index, platform15) {
300810
+ constructor(patternList, globList, index, platform14) {
300763
300811
  if (!isPatternList(patternList)) {
300764
300812
  throw new TypeError("empty pattern list");
300765
300813
  }
@@ -300776,7 +300824,7 @@ var init_pattern = __esm({
300776
300824
  this.#patternList = patternList;
300777
300825
  this.#globList = globList;
300778
300826
  this.#index = index;
300779
- this.#platform = platform15;
300827
+ this.#platform = platform14;
300780
300828
  if (this.#index === 0) {
300781
300829
  if (this.isUNC()) {
300782
300830
  const [p0, p1, p2, p3, ...prest] = this.#patternList;
@@ -300925,12 +300973,12 @@ var init_ignore = __esm({
300925
300973
  absoluteChildren;
300926
300974
  platform;
300927
300975
  mmopts;
300928
- constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform15 = defaultPlatform2 }) {
300976
+ constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform14 = defaultPlatform2 }) {
300929
300977
  this.relative = [];
300930
300978
  this.absolute = [];
300931
300979
  this.relativeChildren = [];
300932
300980
  this.absoluteChildren = [];
300933
- this.platform = platform15;
300981
+ this.platform = platform14;
300934
300982
  this.mmopts = {
300935
300983
  dot: true,
300936
300984
  nobrace,
@@ -300938,7 +300986,7 @@ var init_ignore = __esm({
300938
300986
  noext,
300939
300987
  noglobstar,
300940
300988
  optimizationLevel: 2,
300941
- platform: platform15,
300989
+ platform: platform14,
300942
300990
  nocomment: true,
300943
300991
  nonegate: true
300944
300992
  };
@@ -308228,8 +308276,8 @@ var require_path_key = __commonJS({
308228
308276
  "use strict";
308229
308277
  var pathKey2 = (options = {}) => {
308230
308278
  const environment = options.env || process.env;
308231
- const platform15 = options.platform || process.platform;
308232
- if (platform15 !== "win32") {
308279
+ const platform14 = options.platform || process.platform;
308280
+ if (platform14 !== "win32") {
308233
308281
  return "PATH";
308234
308282
  }
308235
308283
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
@@ -308499,9 +308547,9 @@ var require_cross_spawn = __commonJS({
308499
308547
  function pathKey(options = {}) {
308500
308548
  const {
308501
308549
  env: env2 = process.env,
308502
- platform: platform15 = process.platform
308550
+ platform: platform14 = process.platform
308503
308551
  } = options;
308504
- if (platform15 !== "win32") {
308552
+ if (platform14 !== "win32") {
308505
308553
  return "PATH";
308506
308554
  }
308507
308555
  return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
@@ -325965,8 +326013,8 @@ var init_downloadRipGrep = __esm({
325965
326013
  BIN_PATH = join11(__dirname5, "../bin");
325966
326014
  getTarget = () => {
325967
326015
  const arch4 = process.env.npm_config_arch || os12.arch();
325968
- const platform15 = process.env.platform || os12.platform();
325969
- switch (platform15) {
326016
+ const platform14 = process.env.platform || os12.platform();
326017
+ switch (platform14) {
325970
326018
  case "darwin":
325971
326019
  switch (arch4) {
325972
326020
  case "arm64":
@@ -326000,7 +326048,7 @@ var init_downloadRipGrep = __esm({
326000
326048
  return "i686-unknown-linux-musl.tar.gz";
326001
326049
  }
326002
326050
  default:
326003
- throw new VError("Unknown platform: " + platform15);
326051
+ throw new VError("Unknown platform: " + platform14);
326004
326052
  }
326005
326053
  };
326006
326054
  downloadFile2 = async (url5, outFile) => {
@@ -327668,11 +327716,11 @@ async function getIdeProcessInfoForWindows() {
327668
327716
  return { pid: myPid, command: myProc.command };
327669
327717
  }
327670
327718
  async function getIdeProcessInfo() {
327671
- const platform15 = os14.platform();
327719
+ const platform14 = os14.platform();
327672
327720
  if (process.env["GEMINI_CLI_IDE_PID"]) {
327673
327721
  const idePid = parseInt(process.env["GEMINI_CLI_IDE_PID"], 10);
327674
327722
  if (!isNaN(idePid) && idePid > 0) {
327675
- if (platform15 === "win32") {
327723
+ if (platform14 === "win32") {
327676
327724
  const processMap = await getProcessTableWindows();
327677
327725
  const proc2 = processMap.get(idePid);
327678
327726
  return { pid: idePid, command: proc2?.command || "" };
@@ -327681,7 +327729,7 @@ async function getIdeProcessInfo() {
327681
327729
  return { pid: idePid, command };
327682
327730
  }
327683
327731
  }
327684
- if (platform15 === "win32") {
327732
+ if (platform14 === "win32") {
327685
327733
  return getIdeProcessInfoForWindows();
327686
327734
  }
327687
327735
  return getIdeProcessInfoForUnix();
@@ -386771,7 +386819,7 @@ async function getEnvironmentContext(config3) {
386771
386819
  month: "long",
386772
386820
  day: "numeric"
386773
386821
  });
386774
- const platform15 = process.platform;
386822
+ const platform14 = process.platform;
386775
386823
  const directoryContext = config3.getIncludeDirectoryTree() ? await getDirectoryContextString(config3) : "";
386776
386824
  const tempDir = config3.storage.getProjectTempDir();
386777
386825
  const environmentMemory = config3.getEnvironmentMemory();
@@ -386779,7 +386827,7 @@ async function getEnvironmentContext(config3) {
386779
386827
  <session_context>
386780
386828
  This is the Gemini CLI. We are setting up the context for our chat.
386781
386829
  Today's date is ${today} (formatted according to the user's locale).
386782
- My operating system is: ${platform15}
386830
+ My operating system is: ${platform14}
386783
386831
  The project's temporary directory is: ${tempDir}
386784
386832
  ${directoryContext}
386785
386833
 
@@ -399906,8 +399954,8 @@ var WorkspaceContext;
399906
399954
  var init_workspaceContext = __esm({
399907
399955
  "packages/core/dist/src/utils/workspaceContext.js"() {
399908
399956
  "use strict";
399909
- init_errors();
399910
399957
  init_debugLogger();
399958
+ init_paths();
399911
399959
  WorkspaceContext = class {
399912
399960
  targetDir;
399913
399961
  directories = /* @__PURE__ */ new Set();
@@ -400077,16 +400125,7 @@ var init_workspaceContext = __esm({
400077
400125
  * if it did exist.
400078
400126
  */
400079
400127
  fullyResolvedPath(pathToCheck) {
400080
- try {
400081
- return fs57.realpathSync(path68.resolve(this.targetDir, pathToCheck));
400082
- } catch (e3) {
400083
- if (isNodeError(e3) && e3.code === "ENOENT" && e3.path && // realpathSync does not set e.path correctly for symlinks to
400084
- // non-existent files.
400085
- !this.isFileSymlink(e3.path)) {
400086
- return e3.path;
400087
- }
400088
- throw e3;
400089
- }
400128
+ return resolveToRealPath(path68.resolve(this.targetDir, pathToCheck));
400090
400129
  }
400091
400130
  /**
400092
400131
  * Checks if a path is within a given root directory.
@@ -400098,16 +400137,6 @@ var init_workspaceContext = __esm({
400098
400137
  const relative6 = path68.relative(rootDirectory, pathToCheck);
400099
400138
  return !relative6.startsWith(`..${path68.sep}`) && relative6 !== ".." && !path68.isAbsolute(relative6);
400100
400139
  }
400101
- /**
400102
- * Checks if a file path is a symbolic link that points to a file.
400103
- */
400104
- isFileSymlink(filePath) {
400105
- try {
400106
- return !fs57.readlinkSync(filePath).endsWith("/");
400107
- } catch (_error) {
400108
- return false;
400109
- }
400110
- }
400111
400140
  };
400112
400141
  }
400113
400142
  });
@@ -400313,34 +400342,17 @@ function matchesWildcard(pattern, toolName, serverName) {
400313
400342
  if (pattern === "*") {
400314
400343
  return true;
400315
400344
  }
400316
- if (pattern.includes("__")) {
400317
- return matchesCompositePattern(pattern, toolName, serverName);
400318
- }
400319
- return toolName === pattern;
400320
- }
400321
- function matchesCompositePattern(pattern, toolName, serverName) {
400322
- const parts2 = pattern.split("__");
400323
- if (parts2.length !== 2)
400324
- return false;
400325
- const [patternServer, patternTool] = parts2;
400326
- const { actualServer, actualTool } = getToolMetadata(toolName, serverName);
400327
- if (actualServer === void 0) {
400328
- return false;
400345
+ if (pattern === `${MCP_TOOL_PREFIX}*`) {
400346
+ return serverName !== void 0;
400329
400347
  }
400330
- if (serverName !== void 0 && !toolName.startsWith(serverName + "__")) {
400331
- return false;
400348
+ if (pattern.startsWith(MCP_TOOL_PREFIX) && pattern.endsWith("_*")) {
400349
+ const expectedServerName = pattern.slice(MCP_TOOL_PREFIX.length, -2);
400350
+ if (serverName === void 0 || serverName !== expectedServerName) {
400351
+ return false;
400352
+ }
400353
+ return toolName.startsWith(`${MCP_TOOL_PREFIX}${expectedServerName}_`);
400332
400354
  }
400333
- const serverMatch = patternServer === "*" || patternServer === actualServer;
400334
- const toolMatch = patternTool === "*" || patternTool === actualTool;
400335
- return serverMatch && toolMatch;
400336
- }
400337
- function getToolMetadata(toolName, serverName) {
400338
- const sepIndex = toolName.indexOf("__");
400339
- const isQualified = sepIndex !== -1;
400340
- return {
400341
- actualServer: serverName ?? (isQualified ? toolName.substring(0, sepIndex) : void 0),
400342
- actualTool: isQualified ? toolName.substring(sepIndex + 2) : toolName
400343
- };
400355
+ return toolName === pattern;
400344
400356
  }
400345
400357
  function ruleMatches(rule, toolCall, stringifiedArgs, serverName, currentApprovalMode, toolAnnotations) {
400346
400358
  if (rule.modes && rule.modes.length > 0) {
@@ -400348,6 +400360,15 @@ function ruleMatches(rule, toolCall, stringifiedArgs, serverName, currentApprova
400348
400360
  return false;
400349
400361
  }
400350
400362
  }
400363
+ if (rule.mcpName) {
400364
+ if (rule.mcpName === "*") {
400365
+ if (serverName === void 0)
400366
+ return false;
400367
+ } else {
400368
+ if (serverName !== rule.mcpName)
400369
+ return false;
400370
+ }
400371
+ }
400351
400372
  if (rule.toolName) {
400352
400373
  if (rule.toolName === "*") {
400353
400374
  } else if (isWildcardPattern(rule.toolName)) {
@@ -400389,6 +400410,7 @@ var init_policy_engine = __esm({
400389
400410
  init_protocol2();
400390
400411
  init_shell_utils();
400391
400412
  init_tool_names();
400413
+ init_mcp_tool();
400392
400414
  PolicyEngine = class {
400393
400415
  rules;
400394
400416
  checkers;
@@ -400517,6 +400539,15 @@ var init_policy_engine = __esm({
400517
400539
  * Returns the decision and the matching rule (if any).
400518
400540
  */
400519
400541
  async check(toolCall, serverName, toolAnnotations) {
400542
+ if (!serverName && isMcpToolAnnotation(toolAnnotations)) {
400543
+ serverName = toolAnnotations._serverName;
400544
+ }
400545
+ if (!serverName && toolCall.name) {
400546
+ const parsed = parseMcpToolName(toolCall.name);
400547
+ if (parsed.serverName) {
400548
+ serverName = parsed.serverName;
400549
+ }
400550
+ }
400520
400551
  let stringifiedArgs;
400521
400552
  if (toolCall.args && (this.rules.some((rule) => rule.argsPattern) || this.checkers.some((checker) => checker.argsPattern))) {
400522
400553
  stringifiedArgs = stableStringify(toolCall.args);
@@ -400538,12 +400569,6 @@ var init_policy_engine = __esm({
400538
400569
  const toolCallsToTry = [];
400539
400570
  for (const name4 of toolNamesToTry) {
400540
400571
  toolCallsToTry.push({ ...toolCall, name: name4 });
400541
- if (serverName && !name4.includes("__")) {
400542
- toolCallsToTry.push({
400543
- ...toolCall,
400544
- name: `${serverName}__${name4}`
400545
- });
400546
- }
400547
400572
  }
400548
400573
  for (const rule of this.rules) {
400549
400574
  const match2 = toolCallsToTry.some((tc) => ruleMatches(rule, tc, stringifiedArgs, serverName, this.approvalMode, toolAnnotations));
@@ -400689,107 +400714,52 @@ var init_policy_engine = __esm({
400689
400714
  */
400690
400715
  getExcludedTools(toolMetadata, allToolNames) {
400691
400716
  const excludedTools = /* @__PURE__ */ new Set();
400692
- const processedTools = /* @__PURE__ */ new Set();
400693
- let globalVerdict;
400694
- for (const rule of this.rules) {
400695
- if (rule.argsPattern) {
400696
- if (rule.toolName && rule.decision !== PolicyDecision.DENY) {
400697
- processedTools.add(rule.toolName);
400698
- }
400699
- continue;
400700
- }
400701
- if (rule.modes && rule.modes.length > 0) {
400702
- if (!rule.modes.includes(this.approvalMode)) {
400703
- continue;
400704
- }
400705
- }
400706
- if (rule.toolAnnotations) {
400707
- if (!toolMetadata) {
400708
- continue;
400709
- }
400710
- for (const [toolName2, annotations] of toolMetadata) {
400711
- if (processedTools.has(toolName2)) {
400712
- continue;
400713
- }
400714
- let annotationsMatch = true;
400715
- for (const [key, value] of Object.entries(rule.toolAnnotations)) {
400716
- if (annotations[key] !== value) {
400717
- annotationsMatch = false;
400717
+ if (!allToolNames) {
400718
+ return excludedTools;
400719
+ }
400720
+ for (const toolName of allToolNames) {
400721
+ const annotations = toolMetadata?.get(toolName);
400722
+ const serverName = isMcpToolAnnotation(annotations) ? annotations._serverName : void 0;
400723
+ let staticallyExcluded = false;
400724
+ let matchFound = false;
400725
+ for (const rule of this.rules) {
400726
+ const ruleWithoutArgs = { ...rule, argsPattern: void 0 };
400727
+ const toolCall = { name: toolName, args: {} };
400728
+ const appliesToTool = ruleMatches(
400729
+ ruleWithoutArgs,
400730
+ toolCall,
400731
+ void 0,
400732
+ // stringifiedArgs
400733
+ serverName,
400734
+ this.approvalMode,
400735
+ annotations
400736
+ );
400737
+ if (appliesToTool) {
400738
+ if (rule.argsPattern) {
400739
+ if (rule.decision !== PolicyDecision.DENY) {
400740
+ staticallyExcluded = false;
400741
+ matchFound = true;
400718
400742
  break;
400719
400743
  }
400720
- }
400721
- if (!annotationsMatch) {
400722
400744
  continue;
400723
- }
400724
- if (rule.toolName) {
400725
- if (isWildcardPattern(rule.toolName)) {
400726
- const rawServerName = annotations["_serverName"];
400727
- const serverName = typeof rawServerName === "string" ? rawServerName : void 0;
400728
- const qualifiedName = serverName && !toolName2.includes("__") ? `${serverName}__${toolName2}` : toolName2;
400729
- if (!matchesWildcard(rule.toolName, qualifiedName, void 0)) {
400730
- continue;
400731
- }
400732
- } else if (toolName2 !== rule.toolName) {
400733
- continue;
400734
- }
400735
- }
400736
- let decision2;
400737
- if (globalVerdict !== void 0) {
400738
- decision2 = globalVerdict;
400739
400745
  } else {
400740
- decision2 = rule.decision;
400741
- }
400742
- if (decision2 === PolicyDecision.DENY) {
400743
- excludedTools.add(toolName2);
400744
- }
400745
- processedTools.add(toolName2);
400746
- }
400747
- continue;
400748
- }
400749
- if (!rule.toolName) {
400750
- if (globalVerdict === void 0) {
400751
- globalVerdict = rule.decision;
400752
- if (globalVerdict !== PolicyDecision.DENY) {
400746
+ const decision = this.applyNonInteractiveMode(rule.decision);
400747
+ staticallyExcluded = decision === PolicyDecision.DENY;
400748
+ matchFound = true;
400753
400749
  break;
400754
400750
  }
400755
400751
  }
400756
- continue;
400757
400752
  }
400758
- const toolName = rule.toolName;
400759
- if (processedTools.has(toolName)) {
400760
- continue;
400761
- }
400762
- let coveredByWildcard = false;
400763
- for (const processed of processedTools) {
400764
- if (isWildcardPattern(processed) && matchesWildcard(processed, toolName, void 0)) {
400765
- if (excludedTools.has(processed)) {
400766
- excludedTools.add(toolName);
400767
- }
400768
- coveredByWildcard = true;
400769
- break;
400753
+ if (!matchFound) {
400754
+ const defaultDec = this.applyNonInteractiveMode(this.defaultDecision);
400755
+ if (defaultDec === PolicyDecision.DENY) {
400756
+ staticallyExcluded = true;
400770
400757
  }
400771
400758
  }
400772
- if (coveredByWildcard) {
400773
- continue;
400774
- }
400775
- processedTools.add(toolName);
400776
- let decision;
400777
- if (globalVerdict !== void 0) {
400778
- decision = globalVerdict;
400779
- } else {
400780
- decision = rule.decision;
400781
- }
400782
- if (decision === PolicyDecision.DENY) {
400759
+ if (staticallyExcluded) {
400783
400760
  excludedTools.add(toolName);
400784
400761
  }
400785
400762
  }
400786
- if (globalVerdict === PolicyDecision.DENY && allToolNames) {
400787
- for (const name4 of allToolNames) {
400788
- if (!processedTools.has(name4)) {
400789
- excludedTools.add(name4);
400790
- }
400791
- }
400792
- }
400793
400763
  return excludedTools;
400794
400764
  }
400795
400765
  applyNonInteractiveMode(decision) {
@@ -414054,7 +414024,10 @@ function validateShellCommandSyntax(rule, ruleIndex) {
414054
414024
  return null;
414055
414025
  }
414056
414026
  function validateToolName(name4, ruleIndex) {
414057
- if (isValidToolName(name4, { allowWildcards: true }) && !name4.includes("__")) {
414027
+ if (name4.includes("__")) {
414028
+ return `Rule #${ruleIndex + 1}: The "__" syntax for MCP tools is strictly deprecated. Please use the 'mcpName = "..."' property or the 'mcp_server_tool' format instead.`;
414029
+ }
414030
+ if (isValidToolName(name4, { allowWildcards: true })) {
414058
414031
  return null;
414059
414032
  }
414060
414033
  const allNames = [...ALL_BUILTIN_TOOL_NAMES];
@@ -414139,8 +414112,6 @@ async function loadPoliciesFromToml(policyPaths, getPolicyTier) {
414139
414112
  }
414140
414113
  for (let i4 = 0; i4 < tomlRules.length; i4++) {
414141
414114
  const rule = tomlRules[i4];
414142
- if (rule.mcpName)
414143
- continue;
414144
414115
  const toolNames = rule.toolName ? Array.isArray(rule.toolName) ? rule.toolName : [rule.toolName] : [];
414145
414116
  for (const name4 of toolNames) {
414146
414117
  const warning = validateToolName(name4, i4);
@@ -414163,16 +414134,14 @@ async function loadPoliciesFromToml(policyPaths, getPolicyTier) {
414163
414134
  return argsPatterns.flatMap((argsPattern) => {
414164
414135
  const toolNames = rule.toolName ? Array.isArray(rule.toolName) ? rule.toolName : [rule.toolName] : [void 0];
414165
414136
  return toolNames.map((toolName) => {
414166
- let effectiveToolName;
414167
- if (rule.mcpName && toolName) {
414168
- effectiveToolName = `${rule.mcpName}__${toolName}`;
414169
- } else if (rule.mcpName) {
414170
- effectiveToolName = `${rule.mcpName}__*`;
414171
- } else {
414172
- effectiveToolName = toolName;
414137
+ let effectiveToolName = toolName;
414138
+ const mcpName = rule.mcpName;
414139
+ if (mcpName) {
414140
+ effectiveToolName = formatMcpToolName(mcpName, effectiveToolName);
414173
414141
  }
414174
414142
  const policyRule = {
414175
414143
  toolName: effectiveToolName,
414144
+ mcpName: rule.mcpName,
414176
414145
  decision: rule.decision,
414177
414146
  priority: transformPriority(rule.priority, tier),
414178
414147
  modes: rule.modes,
@@ -414246,14 +414215,15 @@ Error: ${error2.message}`,
414246
414215
  return toolNames.map((toolName) => {
414247
414216
  let effectiveToolName;
414248
414217
  if (checker.mcpName && toolName) {
414249
- effectiveToolName = `${checker.mcpName}__${toolName}`;
414218
+ effectiveToolName = `${MCP_TOOL_PREFIX}${checker.mcpName}_${toolName}`;
414250
414219
  } else if (checker.mcpName) {
414251
- effectiveToolName = `${checker.mcpName}__*`;
414220
+ effectiveToolName = `${MCP_TOOL_PREFIX}${checker.mcpName}_*`;
414252
414221
  } else {
414253
414222
  effectiveToolName = toolName;
414254
414223
  }
414255
414224
  const safetyCheckerRule = {
414256
414225
  toolName: effectiveToolName,
414226
+ mcpName: checker.mcpName,
414257
414227
  priority: transformPriority(checker.priority, tier),
414258
414228
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
414259
414229
  checker: checker.checker,
@@ -414312,14 +414282,19 @@ Error: ${error2.message}`
414312
414282
  return { rules, checkers, errors };
414313
414283
  }
414314
414284
  function validateMcpPolicyToolNames(serverName, discoveredToolNames, policyRules) {
414315
- const prefix = `${serverName}__`;
414285
+ const prefix = `${MCP_TOOL_PREFIX}${serverName}_`;
414316
414286
  const warnings = [];
414317
414287
  for (const rule of policyRules) {
414318
414288
  if (!rule.toolName)
414319
414289
  continue;
414320
- if (!rule.toolName.startsWith(prefix))
414290
+ let toolPart;
414291
+ if (rule.mcpName === serverName && rule.toolName.startsWith(prefix)) {
414292
+ toolPart = rule.toolName.slice(prefix.length);
414293
+ } else if (rule.toolName.startsWith(prefix)) {
414294
+ toolPart = rule.toolName.slice(prefix.length);
414295
+ } else {
414321
414296
  continue;
414322
- const toolPart = rule.toolName.slice(prefix.length);
414297
+ }
414323
414298
  if (toolPart === "*")
414324
414299
  continue;
414325
414300
  if (discoveredToolNames.includes(toolPart))
@@ -414347,6 +414322,7 @@ var init_toml_loader = __esm({
414347
414322
  import_toml = __toESM(require_toml(), 1);
414348
414323
  init_zod();
414349
414324
  init_errors();
414325
+ init_mcp_tool();
414350
414326
  MAX_TYPO_DISTANCE = 3;
414351
414327
  PolicyRuleSchema = external_exports.object({
414352
414328
  toolName: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
@@ -414429,6 +414405,7 @@ var init_config3 = __esm({
414429
414405
  init_shell_utils();
414430
414406
  init_tool_names();
414431
414407
  init_errors();
414408
+ init_mcp_tool();
414432
414409
  init_security();
414433
414410
  __filename3 = fileURLToPath15(import.meta.url);
414434
414411
  __dirname7 = path77.dirname(__filename3);
@@ -418851,7 +418828,6 @@ ${clientInstructions}
418851
418828
  // packages/core/dist/src/config/config.js
418852
418829
  import * as fs68 from "node:fs";
418853
418830
  import * as path81 from "node:path";
418854
- import * as os23 from "node:os";
418855
418831
  import { inspect as inspect4 } from "node:util";
418856
418832
  import process24 from "node:process";
418857
418833
  var DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD, AuthProviderType, Config;
@@ -420180,22 +420156,13 @@ var init_config4 = __esm({
420180
420156
  * @returns true if the path is allowed, false otherwise.
420181
420157
  */
420182
420158
  isPathAllowed(absolutePath) {
420183
- const realpath3 = (p) => {
420184
- let resolved;
420185
- try {
420186
- resolved = fs68.realpathSync(p);
420187
- } catch {
420188
- resolved = path81.resolve(p);
420189
- }
420190
- return os23.platform() === "win32" ? resolved.toLowerCase() : resolved;
420191
- };
420192
- const resolvedPath = realpath3(absolutePath);
420159
+ const resolvedPath = resolveToRealPath(absolutePath);
420193
420160
  const workspaceContext = this.getWorkspaceContext();
420194
420161
  if (workspaceContext.isPathWithinWorkspace(resolvedPath)) {
420195
420162
  return true;
420196
420163
  }
420197
420164
  const projectTempDir = this.storage.getProjectTempDir();
420198
- const resolvedTempDir = realpath3(projectTempDir);
420165
+ const resolvedTempDir = resolveToRealPath(projectTempDir);
420199
420166
  return isSubpath(resolvedTempDir, resolvedPath);
420200
420167
  }
420201
420168
  /**
@@ -421250,8 +421217,8 @@ var require_utils22 = __commonJS({
421250
421217
  exports2.toPosixSlashes = (str2) => str2.replace(REGEX_BACKSLASH, "/");
421251
421218
  exports2.isWindows = () => {
421252
421219
  if (typeof navigator !== "undefined" && navigator.platform) {
421253
- const platform15 = navigator.platform.toLowerCase();
421254
- return platform15 === "win32" || platform15 === "windows";
421220
+ const platform14 = navigator.platform.toLowerCase();
421221
+ return platform14 === "win32" || platform14 === "windows";
421255
421222
  }
421256
421223
  if (typeof process !== "undefined" && process.platform) {
421257
421224
  return process.platform === "win32";
@@ -423130,7 +423097,7 @@ var require_main2 = __commonJS({
423130
423097
  "packages/a2a-server/node_modules/dotenv/lib/main.js"(exports2, module2) {
423131
423098
  var fs75 = __require("fs");
423132
423099
  var path90 = __require("path");
423133
- var os24 = __require("os");
423100
+ var os23 = __require("os");
423134
423101
  var crypto23 = __require("crypto");
423135
423102
  var packageJson4 = require_package15();
423136
423103
  var version4 = packageJson4.version;
@@ -423253,7 +423220,7 @@ var require_main2 = __commonJS({
423253
423220
  return null;
423254
423221
  }
423255
423222
  function _resolveHome(envPath) {
423256
- return envPath[0] === "~" ? path90.join(os24.homedir(), envPath.slice(1)) : envPath;
423223
+ return envPath[0] === "~" ? path90.join(os23.homedir(), envPath.slice(1)) : envPath;
423257
423224
  }
423258
423225
  function _configVault(options) {
423259
423226
  const debug2 = Boolean(options && options.debug);