@google/gemini-cli 0.59.0-preview.0 → 0.60.0-nightly.20260905.g85aca163f

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.
Files changed (74) hide show
  1. package/bundle/bundled/chrome-devtools-mcp.mjs +1 -1
  2. package/bundle/bundled/third_party/index.js +1 -1
  3. package/bundle/{chunk-NQC3UDKG.js → chunk-3CDPEGVA.js} +1 -1
  4. package/bundle/{chunk-THPIH2AE.js → chunk-3MT62KJ7.js} +1 -1
  5. package/bundle/{chunk-23C4TBLH.js → chunk-3SPYWTAG.js} +2 -2
  6. package/bundle/{chunk-UGT6DHAE.js → chunk-AL25HEEO.js} +210 -46
  7. package/bundle/{chunk-52JU4ECF.js → chunk-AXAX7FSE.js} +3845 -2735
  8. package/bundle/{chunk-KDHW7PJD.js → chunk-B7XEMEN5.js} +3 -3
  9. package/bundle/{chunk-UZXNPI5Z.js → chunk-DFOZHS4G.js} +270 -93
  10. package/bundle/{chunk-UA5K3TB5.js → chunk-FIESYQDV.js} +3967 -2757
  11. package/bundle/{chunk-YI5PKR5L.js → chunk-FPVYQTVA.js} +11349 -16975
  12. package/bundle/{chunk-D6XI6WNG.js → chunk-FX53IMQ4.js} +1 -1
  13. package/bundle/{chunk-IJPZK2CD.js → chunk-FYCX7S2H.js} +1 -1
  14. package/bundle/{chunk-VCQFRV5A.js → chunk-G4V32KTT.js} +1 -1
  15. package/bundle/{chunk-M6UTVOUK.js → chunk-IK5LG3S5.js} +1 -1
  16. package/bundle/{chunk-YLSAASP5.js → chunk-JE7V5AAP.js} +3 -3
  17. package/bundle/{chunk-LXBSPQEH.js → chunk-JIXDRDKL.js} +25 -4
  18. package/bundle/{chunk-DH76W27O.js → chunk-KI4HA3RK.js} +2 -2
  19. package/bundle/{chunk-FXZRZ2YL.js → chunk-L5DTYBPR.js} +210 -46
  20. package/bundle/chunk-M2YOG367.js +398992 -0
  21. package/bundle/{chunk-ILPBRVSF.js → chunk-M4VSTX4X.js} +1 -1
  22. package/bundle/{chunk-55V2C3NE.js → chunk-N7PUYZ2C.js} +3 -3
  23. package/bundle/{chunk-HSRFT2PV.js → chunk-OI5WY42W.js} +2 -2
  24. package/bundle/{chunk-7QCPYRGC.js → chunk-OSSPFBB5.js} +1 -1
  25. package/bundle/{chunk-GPE57TQ5.js → chunk-PHCDH4SW.js} +32 -8
  26. package/bundle/{chunk-GOBGZY54.js → chunk-Q5CIEKL6.js} +9 -8
  27. package/bundle/chunk-QCBXPS5K.js +154 -0
  28. package/bundle/chunk-TVCSMCKT.js +512 -0
  29. package/bundle/chunk-VEXKBYW3.js +1571 -0
  30. package/bundle/{chunk-F45BTUYK.js → chunk-VIXOL23X.js} +25 -4
  31. package/bundle/chunk-VKWL57SN.js +102670 -0
  32. package/bundle/chunk-W7R7PC32.js +17353 -0
  33. package/bundle/chunk-XTLORUWQ.js +398 -0
  34. package/bundle/chunk-ZIQEES26.js +118 -0
  35. package/bundle/{cleanup-IGZ72X72.js → cleanup-3YWFIXB3.js} +2 -2
  36. package/bundle/{cleanup-OHSG4ABA.js → cleanup-NQDXOU2K.js} +2 -2
  37. package/bundle/{cleanup-VTATI2S7.js → cleanup-SXOQFKSA.js} +2 -2
  38. package/bundle/cleanup-XSTC4XRT.js +32 -0
  39. package/bundle/{core-XJO3GR5B.js → core-T6ZA3RPN.js} +25 -1
  40. package/bundle/{devtoolsService-OSXWGLT3.js → devtoolsService-AYPMPUPD.js} +2 -2
  41. package/bundle/{devtoolsService-VQJ4XEED.js → devtoolsService-FPEN37GX.js} +4 -3
  42. package/bundle/{devtoolsService-TJCP6X22.js → devtoolsService-J5IMHON6.js} +2 -2
  43. package/bundle/devtoolsService-UV75F4RP.js +4359 -0
  44. package/bundle/{dist-KC5GXNU5.js → dist-CUTV6FXO.js} +25 -1
  45. package/bundle/{core-Q2DBVF5E.js → dist-QOCIGEB4.js} +25 -1
  46. package/bundle/dist-ZTPNJYCX.js +2212 -0
  47. package/bundle/docs/changelogs/index.md +20 -0
  48. package/bundle/docs/changelogs/latest.md +32 -281
  49. package/bundle/docs/changelogs/preview.md +18 -31
  50. package/bundle/docs/reference/tools.md +4 -4
  51. package/bundle/docs/tools/mcp-server.md +53 -0
  52. package/bundle/docs/tools/web-fetch.md +7 -3
  53. package/bundle/{gemini-FMVYHQ4P.js → gemini-DM7UHG5I.js} +56 -23
  54. package/bundle/{gemini-G4U2XJ5N.js → gemini-JANWUJ6X.js} +56 -23
  55. package/bundle/{gemini-G3Y4ZBUW.js → gemini-UBKFBQUZ.js} +256 -207
  56. package/bundle/gemini-ZT27CSNJ.js +17370 -0
  57. package/bundle/gemini.js +7 -7
  58. package/bundle/{interactiveCli-ODBGO5ZB.js → interactiveCli-AGRRFZQX.js} +8 -8
  59. package/bundle/{interactiveCli-J7RHUM6Y.js → interactiveCli-NC7ZBX74.js} +8 -8
  60. package/bundle/{interactiveCli-DFQDNRQR.js → interactiveCli-Q2LPGB6L.js} +315 -296
  61. package/bundle/interactiveCli-WG2TABNS.js +34983 -0
  62. package/bundle/{liteRtServerManager-FYXZXFSP.js → liteRtServerManager-6DPVBVVU.js} +4 -4
  63. package/bundle/{liteRtServerManager-H3DCLTFE.js → liteRtServerManager-HE2FE4FH.js} +4 -4
  64. package/bundle/{liteRtServerManager-BEQPNIUI.js → liteRtServerManager-JSW26OPJ.js} +4 -4
  65. package/bundle/liteRtServerManager-PJ223Y36.js +65 -0
  66. package/bundle/{oauth2-provider-2DCMBS2D.js → oauth2-provider-BR53NDPU.js} +1 -1
  67. package/bundle/{oauth2-provider-3RBG2E74.js → oauth2-provider-I665TJQN.js} +1 -1
  68. package/bundle/{oauth2-provider-DX42O6UX.js → oauth2-provider-UBZT242N.js} +38 -72
  69. package/bundle/oauth2-provider-WUYROQ6O.js +235 -0
  70. package/bundle/{start-MJKXAIFL.js → start-AA23VJDL.js} +6 -6
  71. package/bundle/{start-R4LT7TW6.js → start-U6VMEF32.js} +6 -6
  72. package/bundle/{start-MIKPZTJ4.js → start-WLQTESZU.js} +6 -6
  73. package/bundle/start-YX32XE72.js +18 -0
  74. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-7QCPYRGC.js";
4
+ } from "./chunk-3CDPEGVA.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -1,7 +1,7 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-NQC3UDKG.js";
4
+ } from "./chunk-OSSPFBB5.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -1,7 +1,7 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  checkExhaustive
4
- } from "./chunk-YI5PKR5L.js";
4
+ } from "./chunk-FIESYQDV.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __toESM
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-UA5K3TB5.js";
8
+ } from "./chunk-FPVYQTVA.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  exitCli,
4
4
  require_source
5
- } from "./chunk-D6XI6WNG.js";
5
+ } from "./chunk-FX53IMQ4.js";
6
6
  import {
7
7
  DEFAULT_PORT,
8
8
  SERVER_START_WAIT_MS,
@@ -14,10 +14,10 @@ import {
14
14
  isServerRunning,
15
15
  resolveGemmaConfig,
16
16
  writeServerProcessInfo
17
- } from "./chunk-LXBSPQEH.js";
17
+ } from "./chunk-VIXOL23X.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-52JU4ECF.js";
20
+ } from "./chunk-FIESYQDV.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -17,6 +17,7 @@ import {
17
17
  checkPathTrust,
18
18
  coreEvents,
19
19
  createCache,
20
+ createPathSecurityCache,
20
21
  debugLogger,
21
22
  deleteSessionArtifactsAsync,
22
23
  deleteSubagentSessionDirAndArtifactsAsync,
@@ -25,13 +26,14 @@ import {
25
26
  getFsErrorMessage,
26
27
  homedir,
27
28
  import_lru_cache,
29
+ isFileAndDirectorySecureSync,
28
30
  isHeadlessMode,
29
31
  loadConversationRecord,
30
32
  loadTrustedFolders,
31
33
  partListUnionToString,
32
34
  require_strip_json_comments,
33
35
  sanitizeFilenamePart
34
- } from "./chunk-52JU4ECF.js";
36
+ } from "./chunk-AXAX7FSE.js";
35
37
  import {
36
38
  __commonJS,
37
39
  __require,
@@ -16578,8 +16580,27 @@ function _doLoadSettings(workspaceDir) {
16578
16580
  }
16579
16581
  return { settings: {}, rawSettings: {} };
16580
16582
  };
16581
- const systemResult = load(systemSettingsPath);
16582
- const systemDefaultsResult = load(systemDefaultsPath);
16583
+ const securityCache = createPathSecurityCache();
16584
+ const loadSystemFile = (filePath, fileLabel) => {
16585
+ if (!fs4.existsSync(filePath)) {
16586
+ return { settings: {}, rawSettings: {} };
16587
+ }
16588
+ const check = isFileAndDirectorySecureSync(filePath, securityCache);
16589
+ if (!check.secure) {
16590
+ settingsErrors.push({
16591
+ message: `Security Warning: Skipping ${fileLabel} file '${filePath}': ${check.reason}`,
16592
+ path: filePath,
16593
+ severity: "warning"
16594
+ });
16595
+ return { settings: {}, rawSettings: {} };
16596
+ }
16597
+ return load(filePath);
16598
+ };
16599
+ const systemResult = loadSystemFile(systemSettingsPath, "system settings");
16600
+ const systemDefaultsResult = loadSystemFile(
16601
+ systemDefaultsPath,
16602
+ "system defaults"
16603
+ );
16583
16604
  const userResult = load(USER_SETTINGS_PATH);
16584
16605
  let workspaceResult = {
16585
16606
  settings: {},
@@ -16618,7 +16639,7 @@ function _doLoadSettings(workspaceDir) {
16618
16639
  userSettings,
16619
16640
  systemSettings
16620
16641
  );
16621
- const isTrusted = isWorkspaceTrusted(initialTrustCheckSettings, workspaceDir).isTrusted ?? false;
16642
+ const isTrusted = isWorkspaceTrusted(initialTrustCheckSettings, workspaceDir)?.isTrusted ?? false;
16622
16643
  const tempMergedSettings = mergeSettings(
16623
16644
  systemSettings,
16624
16645
  systemDefaultSettings,
@@ -1,13 +1,13 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-NQC3UDKG.js";
4
+ } from "./chunk-IK5LG3S5.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  debugLogger,
8
8
  getChannelFromVersion,
9
9
  isGitRepository
10
- } from "./chunk-YI5PKR5L.js";
10
+ } from "./chunk-FPVYQTVA.js";
11
11
 
12
12
  // packages/cli/src/utils/installationInfo.ts
13
13
  import * as fs from "node:fs";
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  exitCli,
4
4
  require_source
5
- } from "./chunk-ILPBRVSF.js";
5
+ } from "./chunk-FX53IMQ4.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -59,14 +59,14 @@ import {
59
59
  stripUnsafeCharacters,
60
60
  toCodePoints,
61
61
  validateCustomTheme
62
- } from "./chunk-GPE57TQ5.js";
62
+ } from "./chunk-VIXOL23X.js";
63
63
  import {
64
64
  isDevelopment
65
- } from "./chunk-HSRFT2PV.js";
65
+ } from "./chunk-XTLORUWQ.js";
66
66
  import {
67
67
  emptyIcon,
68
68
  require_react
69
- } from "./chunk-GOBGZY54.js";
69
+ } from "./chunk-G4V32KTT.js";
70
70
  import {
71
71
  ALL_EDITORS,
72
72
  ApprovalMode,
@@ -231,7 +231,7 @@ import {
231
231
  tokenLimit,
232
232
  uiTelemetryService,
233
233
  unescapePath
234
- } from "./chunk-UA5K3TB5.js";
234
+ } from "./chunk-FIESYQDV.js";
235
235
  import {
236
236
  require_src
237
237
  } from "./chunk-TUDYL3X4.js";
@@ -25721,11 +25721,11 @@ var require_util4 = __commonJS({
25721
25721
  var { isUint8Array } = __require("node:util/types");
25722
25722
  var { webidl } = require_webidl();
25723
25723
  var supportedHashes = [];
25724
- var crypto2;
25724
+ var crypto3;
25725
25725
  try {
25726
- crypto2 = __require("node:crypto");
25726
+ crypto3 = __require("node:crypto");
25727
25727
  const possibleRelevantHashes = ["sha256", "sha384", "sha512"];
25728
- supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
25728
+ supportedHashes = crypto3.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
25729
25729
  } catch {
25730
25730
  }
25731
25731
  function responseURL(response) {
@@ -26028,7 +26028,7 @@ var require_util4 = __commonJS({
26028
26028
  return isOriginPotentiallyTrustworthy(url.origin);
26029
26029
  }
26030
26030
  function bytesMatch(bytes, metadataList) {
26031
- if (crypto2 === void 0) {
26031
+ if (crypto3 === void 0) {
26032
26032
  return true;
26033
26033
  }
26034
26034
  const parsedMetadata = parseMetadata(metadataList);
@@ -26043,7 +26043,7 @@ var require_util4 = __commonJS({
26043
26043
  for (const item of metadata) {
26044
26044
  const algorithm = item.algo;
26045
26045
  const expectedValue = item.hash;
26046
- let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64");
26046
+ let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64");
26047
26047
  if (actualValue[actualValue.length - 1] === "=") {
26048
26048
  if (actualValue[actualValue.length - 2] === "=") {
26049
26049
  actualValue = actualValue.slice(0, -2);
@@ -27061,8 +27061,8 @@ var require_body = __commonJS({
27061
27061
  var { multipartFormDataParser } = require_formdata_parser();
27062
27062
  var random;
27063
27063
  try {
27064
- const crypto2 = __require("node:crypto");
27065
- random = (max) => crypto2.randomInt(0, max);
27064
+ const crypto3 = __require("node:crypto");
27065
+ random = (max) => crypto3.randomInt(0, max);
27066
27066
  } catch {
27067
27067
  random = (max) => Math.floor(Math.random() * max);
27068
27068
  }
@@ -39979,13 +39979,13 @@ var require_frame = __commonJS({
39979
39979
  "use strict";
39980
39980
  var { maxUnsigned16Bit, opcodes } = require_constants7();
39981
39981
  var BUFFER_SIZE = 8 * 1024;
39982
- var crypto2;
39982
+ var crypto3;
39983
39983
  var buffer = null;
39984
39984
  var bufIdx = BUFFER_SIZE;
39985
39985
  try {
39986
- crypto2 = __require("node:crypto");
39986
+ crypto3 = __require("node:crypto");
39987
39987
  } catch {
39988
- crypto2 = {
39988
+ crypto3 = {
39989
39989
  // not full compatibility, but minimum.
39990
39990
  randomFillSync: function randomFillSync(buffer2, _offset, _size) {
39991
39991
  for (let i = 0; i < buffer2.length; ++i) {
@@ -39998,7 +39998,7 @@ var require_frame = __commonJS({
39998
39998
  function generateMask() {
39999
39999
  if (bufIdx === BUFFER_SIZE) {
40000
40000
  bufIdx = 0;
40001
- crypto2.randomFillSync(buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE), 0, BUFFER_SIZE);
40001
+ crypto3.randomFillSync(buffer ??= Buffer.allocUnsafeSlow(BUFFER_SIZE), 0, BUFFER_SIZE);
40002
40002
  }
40003
40003
  return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]];
40004
40004
  }
@@ -40096,9 +40096,9 @@ var require_connection = __commonJS({
40096
40096
  var { getDecodeSplit } = require_util4();
40097
40097
  var { WebsocketFrameSend } = require_frame();
40098
40098
  var assert = __require("node:assert");
40099
- var crypto2;
40099
+ var crypto3;
40100
40100
  try {
40101
- crypto2 = __require("node:crypto");
40101
+ crypto3 = __require("node:crypto");
40102
40102
  } catch {
40103
40103
  }
40104
40104
  function establishWebSocketConnection(url, protocols, client, handler2, options) {
@@ -40118,7 +40118,7 @@ var require_connection = __commonJS({
40118
40118
  const headersList = getHeadersList(new Headers(options.headers));
40119
40119
  request.headersList = headersList;
40120
40120
  }
40121
- const keyValue = crypto2.randomBytes(16).toString("base64");
40121
+ const keyValue = crypto3.randomBytes(16).toString("base64");
40122
40122
  request.headersList.append("sec-websocket-key", keyValue, true);
40123
40123
  request.headersList.append("sec-websocket-version", "13", true);
40124
40124
  for (const protocol of protocols) {
@@ -40151,7 +40151,7 @@ var require_connection = __commonJS({
40151
40151
  return;
40152
40152
  }
40153
40153
  const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");
40154
- const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64");
40154
+ const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64");
40155
40155
  if (secWSAccept !== digest) {
40156
40156
  failWebsocketConnection(handler2, 1002, "Incorrect hash received in Sec-WebSocket-Accept header.");
40157
40157
  return;
@@ -60852,6 +60852,7 @@ async function validateAuthMethod(authMethod) {
60852
60852
  }
60853
60853
 
60854
60854
  // packages/cli/src/config/extensions/consent.ts
60855
+ import * as crypto from "node:crypto";
60855
60856
  import * as fs9 from "node:fs/promises";
60856
60857
  import * as path3 from "node:path";
60857
60858
  var import_chalk4 = __toESM(require_source(), 1);
@@ -60921,6 +60922,27 @@ async function promptForConsentInteractive(prompt, addExtensionUpdateConfirmatio
60921
60922
  });
60922
60923
  });
60923
60924
  }
60925
+ function isRecord(value) {
60926
+ return typeof value === "object" && value !== null && !Array.isArray(value);
60927
+ }
60928
+ function getMcpServerConfigHash(mcpServer) {
60929
+ const plainMcpServer = isRecord(mcpServer) ? mcpServer : {};
60930
+ const copy = { ...plainMcpServer };
60931
+ delete copy["extension"];
60932
+ const canonicalString = JSON.stringify(copy, (key, value) => {
60933
+ if (value instanceof RegExp) {
60934
+ return value.toString();
60935
+ }
60936
+ if (isRecord(value)) {
60937
+ return Object.keys(value).sort().reduce((result, k2) => {
60938
+ result[k2] = value[k2];
60939
+ return result;
60940
+ }, {});
60941
+ }
60942
+ return value;
60943
+ });
60944
+ return crypto.createHash("sha256").update(canonicalString).digest("hex");
60945
+ }
60924
60946
  async function extensionConsentString(extensionConfig, hasHooks, skills = [], previousName, wasMigrated) {
60925
60947
  const sanitizedConfig = escapeAnsiCtrlCodes(extensionConfig);
60926
60948
  const output = [];
@@ -60948,6 +60970,83 @@ async function extensionConsentString(extensionConfig, hasHooks, skills = [], pr
60948
60970
  const isLocal = !!mcpServer.command;
60949
60971
  const source2 = mcpServer.httpUrl ?? `${mcpServer.command || ""}${mcpServer.args ? " " + mcpServer.args.join(" ") : ""}`;
60950
60972
  output.push(` * ${key} (${isLocal ? "local" : "remote"}): ${source2}`);
60973
+ if (mcpServer.cwd) {
60974
+ output.push(` Working directory: ${mcpServer.cwd}`);
60975
+ }
60976
+ if (mcpServer.env && Object.keys(mcpServer.env).length > 0) {
60977
+ output.push(" Environment variables:");
60978
+ const sortedEnv = Object.entries(mcpServer.env).sort(
60979
+ ([a], [b2]) => a.localeCompare(b2)
60980
+ );
60981
+ for (const [envKey, envValue] of sortedEnv) {
60982
+ const isSensitive = /token|secret|password|passwd|key|auth|credential|creds|private|cert/i.test(
60983
+ envKey
60984
+ );
60985
+ const displayValue = isSensitive && envValue ? "********" : envValue ?? "";
60986
+ output.push(` - ${envKey}: ${displayValue}`);
60987
+ }
60988
+ }
60989
+ if (mcpServer.headers && Object.keys(mcpServer.headers).length > 0) {
60990
+ output.push(" Headers:");
60991
+ const sortedHeaders = Object.entries(mcpServer.headers).sort(
60992
+ ([a], [b2]) => a.localeCompare(b2)
60993
+ );
60994
+ for (const [headerKey, headerValue] of sortedHeaders) {
60995
+ const isSensitive = /authorization|key|cookie|token|secret/i.test(
60996
+ headerKey
60997
+ );
60998
+ const displayValue = isSensitive && headerValue ? "********" : headerValue ?? "";
60999
+ output.push(` - ${headerKey}: ${displayValue}`);
61000
+ }
61001
+ }
61002
+ if (mcpServer.url) {
61003
+ output.push(` URL: ${mcpServer.url}`);
61004
+ }
61005
+ if (mcpServer.tcp) {
61006
+ output.push(` TCP: ${mcpServer.tcp}`);
61007
+ }
61008
+ if (mcpServer.type) {
61009
+ output.push(` Type: ${mcpServer.type}`);
61010
+ }
61011
+ if (mcpServer.timeout !== void 0) {
61012
+ output.push(` Timeout: ${mcpServer.timeout}`);
61013
+ }
61014
+ if (mcpServer.trust !== void 0) {
61015
+ output.push(` Trust: ${mcpServer.trust}`);
61016
+ }
61017
+ if (mcpServer.description) {
61018
+ output.push(` Description: ${mcpServer.description}`);
61019
+ }
61020
+ if (mcpServer.includeTools && mcpServer.includeTools.length > 0) {
61021
+ output.push(` Include tools: ${mcpServer.includeTools.join(", ")}`);
61022
+ }
61023
+ if (mcpServer.excludeTools && mcpServer.excludeTools.length > 0) {
61024
+ output.push(` Exclude tools: ${mcpServer.excludeTools.join(", ")}`);
61025
+ }
61026
+ if (mcpServer.authProviderType) {
61027
+ output.push(` Auth Provider Type: ${mcpServer.authProviderType}`);
61028
+ }
61029
+ if (mcpServer.targetAudience) {
61030
+ output.push(` Target Audience: ${mcpServer.targetAudience}`);
61031
+ }
61032
+ if (mcpServer.targetServiceAccount) {
61033
+ output.push(
61034
+ ` Target Service Account: ${mcpServer.targetServiceAccount}`
61035
+ );
61036
+ }
61037
+ if (mcpServer.oauth) {
61038
+ output.push(" OAuth Configuration:");
61039
+ const sortedOauth = Object.entries(mcpServer.oauth).sort(
61040
+ ([a], [b2]) => a.localeCompare(b2)
61041
+ );
61042
+ for (const [oKey, oValue] of sortedOauth) {
61043
+ const isSensitive = /secret|token|password/i.test(oKey);
61044
+ const valStr = Array.isArray(oValue) ? oValue.join(", ") : String(oValue ?? "");
61045
+ const displayValue = isSensitive && valStr ? "********" : valStr;
61046
+ output.push(` - ${oKey}: ${displayValue}`);
61047
+ }
61048
+ }
61049
+ output.push(` Config signature: ${getMcpServerConfigHash(mcpServer)}`);
60951
61050
  }
60952
61051
  }
60953
61052
  if (sanitizedConfig.contextFileName) {
@@ -61563,7 +61662,7 @@ var ExtensionEnablementManager = class {
61563
61662
  };
61564
61663
 
61565
61664
  // packages/cli/src/config/extension-manager.ts
61566
- import { createHash, randomUUID } from "node:crypto";
61665
+ import { createHash as createHash2, randomUUID } from "node:crypto";
61567
61666
 
61568
61667
  // packages/cli/src/config/extension.ts
61569
61668
  import * as fs13 from "node:fs";
@@ -65782,18 +65881,10 @@ Would you like to attempt to install via "git clone" instead?`
65782
65881
  }
65783
65882
  }
65784
65883
  }
65785
- const contextFiles = getContextFileNames(config).map((contextFileName) => {
65786
- const contextFilePath = path10.join(
65787
- effectiveExtensionPath,
65788
- contextFileName
65789
- );
65790
- if (!isSubpath(effectiveExtensionPath, contextFilePath)) {
65791
- throw new Error(
65792
- `Invalid context file path: "${contextFileName}". Context files must be within the extension directory.`
65793
- );
65794
- }
65795
- return contextFilePath;
65796
- }).filter((contextFilePath) => fs16.existsSync(contextFilePath));
65884
+ const contextFiles = resolveContextFilePaths(
65885
+ config,
65886
+ effectiveExtensionPath
65887
+ );
65797
65888
  const hydrationContext = {
65798
65889
  extensionPath: effectiveExtensionPath,
65799
65890
  workspacePath: this.workspaceDir,
@@ -65866,6 +65957,15 @@ Details: ${error.details}` : ""}`
65866
65957
  `[ExtensionManager] Error loading agent from ${config.name}: ${error.message}`
65867
65958
  );
65868
65959
  }
65960
+ let plan = config.plan;
65961
+ if (plan?.directory) {
65962
+ if (typeof plan.directory !== "string" || path10.isAbsolute(plan.directory) || path10.win32.isAbsolute(plan.directory) || plan.directory.includes("..")) {
65963
+ debugLogger.warn(
65964
+ `[ExtensionManager] Invalid plan.directory in extension "${config.name}": "${plan.directory}". Relative parent navigation and absolute paths are not allowed.`
65965
+ );
65966
+ plan = void 0;
65967
+ }
65968
+ }
65869
65969
  return {
65870
65970
  name: config.name,
65871
65971
  version: config.version,
@@ -65888,7 +65988,7 @@ Details: ${error.details}` : ""}`
65888
65988
  themes: config.themes,
65889
65989
  rules,
65890
65990
  checkers,
65891
- plan: config.plan
65991
+ plan
65892
65992
  };
65893
65993
  } catch (e) {
65894
65994
  debugLogger.error(
@@ -66143,6 +66243,69 @@ function getContextFileNames(config) {
66143
66243
  }
66144
66244
  return config.contextFileName;
66145
66245
  }
66246
+ function validateContextFilePath(contextFileName, effectiveExtensionPath) {
66247
+ if (typeof contextFileName !== "string" || !contextFileName.trim()) {
66248
+ return {
66249
+ isValid: false,
66250
+ errorMessage: "expected a non-empty string."
66251
+ };
66252
+ }
66253
+ if (contextFileName.includes("\0")) {
66254
+ return {
66255
+ isValid: false,
66256
+ errorMessage: "null bytes are not allowed."
66257
+ };
66258
+ }
66259
+ if (path10.isAbsolute(contextFileName) || path10.win32.isAbsolute(contextFileName)) {
66260
+ return {
66261
+ isValid: false,
66262
+ errorMessage: "Absolute paths are not allowed."
66263
+ };
66264
+ }
66265
+ let decodedFileName = contextFileName;
66266
+ try {
66267
+ decodedFileName = decodeURIComponent(contextFileName);
66268
+ } catch {
66269
+ debugLogger.debug(
66270
+ `[ExtensionManager] Could not decode URI component in contextFileName: "${contextFileName}". Proceeding with undecoded name.`
66271
+ );
66272
+ }
66273
+ if (contextFileName.includes("..") || decodedFileName.includes("..")) {
66274
+ return {
66275
+ isValid: false,
66276
+ errorMessage: 'Relative parent directory references ("..") are not allowed.'
66277
+ };
66278
+ }
66279
+ const resolvedExtensionRoot = path10.resolve(effectiveExtensionPath);
66280
+ const contextFilePath = path10.resolve(resolvedExtensionRoot, contextFileName);
66281
+ if (!isSubpath(resolvedExtensionRoot, contextFilePath)) {
66282
+ return {
66283
+ isValid: false,
66284
+ errorMessage: `escapes the extension directory boundary ("${resolvedExtensionRoot}").`
66285
+ };
66286
+ }
66287
+ return {
66288
+ isValid: true,
66289
+ resolvedPath: contextFilePath
66290
+ };
66291
+ }
66292
+ function resolveContextFilePaths(config, effectiveExtensionPath) {
66293
+ return getContextFileNames(config).map((contextFileName) => {
66294
+ const validation = validateContextFilePath(
66295
+ contextFileName,
66296
+ effectiveExtensionPath
66297
+ );
66298
+ if (!validation.isValid) {
66299
+ debugLogger.warn(
66300
+ `[ExtensionManager] Invalid contextFileName: "${contextFileName}" in extension "${config.name}". ${validation.errorMessage}`
66301
+ );
66302
+ return null;
66303
+ }
66304
+ return validation.resolvedPath;
66305
+ }).filter(
66306
+ (contextFilePath) => contextFilePath !== null && fs16.existsSync(contextFilePath)
66307
+ );
66308
+ }
66146
66309
  function validateName(name) {
66147
66310
  if (!/^[a-zA-Z0-9-]+$/.test(name)) {
66148
66311
  throw new Error(
@@ -66187,7 +66350,7 @@ function getExtensionId(config, installMetadata) {
66187
66350
  return hashValue(idValue);
66188
66351
  }
66189
66352
  function hashValue(value) {
66190
- return createHash("sha256").update(value).digest("hex");
66353
+ return createHash2("sha256").update(value).digest("hex");
66191
66354
  }
66192
66355
 
66193
66356
  // packages/cli/src/config/mcp/mcpServerEnablement.ts
@@ -66464,7 +66627,7 @@ function getDialogRestartRequiredSettings() {
66464
66627
  (definition) => definition.requiresRestart && definition.showInDialog !== false
66465
66628
  ).map((definition) => definition.key);
66466
66629
  }
66467
- function isRecord(value) {
66630
+ function isRecord2(value) {
66468
66631
  return typeof value === "object" && value !== null;
66469
66632
  }
66470
66633
  function isSettingsValue(value) {
@@ -66476,7 +66639,7 @@ function isSettingsValue(value) {
66476
66639
  function getNestedValue(obj, path38) {
66477
66640
  let current = obj;
66478
66641
  for (const key of path38) {
66479
- if (!isRecord(current) || !(key in current)) {
66642
+ if (!isRecord2(current) || !(key in current)) {
66480
66643
  return void 0;
66481
66644
  }
66482
66645
  current = current[key];
@@ -66543,7 +66706,7 @@ function tryParseJsonStringArray(input) {
66543
66706
  function tryParseJsonObject(input) {
66544
66707
  try {
66545
66708
  const parsed = JSON.parse(input);
66546
- if (isRecord(parsed) && !Array.isArray(parsed)) {
66709
+ if (isRecord2(parsed) && !Array.isArray(parsed)) {
66547
66710
  return parsed;
66548
66711
  }
66549
66712
  return null;
@@ -67144,8 +67307,8 @@ var import_execa = __toESM(require_execa(), 1);
67144
67307
 
67145
67308
  // node_modules/crypto-random-string/index.js
67146
67309
  import { promisify } from "util";
67147
- import crypto from "crypto";
67148
- var randomBytesAsync = promisify(crypto.randomBytes);
67310
+ import crypto2 from "crypto";
67311
+ var randomBytesAsync = promisify(crypto2.randomBytes);
67149
67312
  var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split("");
67150
67313
  var numericCharacters = "0123456789".split("");
67151
67314
  var distinguishableCharacters = "CDEHKMPRTUWXY012458".split("");
@@ -67158,7 +67321,7 @@ var generateForCustomCharacters = (length, characters) => {
67158
67321
  let string = "";
67159
67322
  let stringLength = 0;
67160
67323
  while (stringLength < length) {
67161
- const entropy = crypto.randomBytes(entropyLength);
67324
+ const entropy = crypto2.randomBytes(entropyLength);
67162
67325
  let entropyPosition = 0;
67163
67326
  while (entropyPosition < entropyLength && stringLength < length) {
67164
67327
  const entropyValue = entropy.readUInt16LE(entropyPosition);
@@ -67193,7 +67356,7 @@ var generateForCustomCharactersAsync = async (length, characters) => {
67193
67356
  }
67194
67357
  return string;
67195
67358
  };
67196
- var generateRandomBytes = (byteLength, type, length) => crypto.randomBytes(byteLength).toString(type).slice(0, length);
67359
+ var generateRandomBytes = (byteLength, type, length) => crypto2.randomBytes(byteLength).toString(type).slice(0, length);
67197
67360
  var generateRandomBytesAsync = async (byteLength, type, length) => {
67198
67361
  const buffer = await randomBytesAsync(byteLength);
67199
67362
  return buffer.toString(type).slice(0, length);
@@ -77164,7 +77327,7 @@ var authCommand = {
77164
77327
  import process29 from "node:process";
77165
77328
 
77166
77329
  // packages/cli/src/generated/git-commit.ts
77167
- var GIT_COMMIT_INFO = "0bd1d4397";
77330
+ var GIT_COMMIT_INFO = "85aca163f";
77168
77331
 
77169
77332
  // packages/cli/src/ui/utils/historyExportUtils.ts
77170
77333
  import * as fsPromises from "node:fs/promises";
@@ -78977,7 +79140,7 @@ var ExtensionRegistryClient = class _ExtensionRegistryClient {
78977
79140
  _ExtensionRegistryClient.fetchPromise = (async () => {
78978
79141
  try {
78979
79142
  if (uri.startsWith("http")) {
78980
- if (isPrivateIp(uri)) {
79143
+ if (await isPrivateIp(uri)) {
78981
79144
  throw new Error(
78982
79145
  "Private IP addresses are not allowed for the extension registry."
78983
79146
  );
@@ -82945,7 +83108,7 @@ Use /mcp auth <server-name> to authenticate.`
82945
83108
  type: "info",
82946
83109
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
82947
83110
  });
82948
- const { MCPOAuthProvider } = await import("./core-XJO3GR5B.js");
83111
+ const { MCPOAuthProvider } = await import("./core-T6ZA3RPN.js");
82949
83112
  let oauthConfig = server.oauth;
82950
83113
  if (!oauthConfig) {
82951
83114
  oauthConfig = { enabled: false };
@@ -102129,6 +102292,7 @@ export {
102129
102292
  configureAllExtensions,
102130
102293
  getFormattedSettingValue,
102131
102294
  ExtensionManager,
102295
+ validateContextFilePath,
102132
102296
  inferInstallMetadata,
102133
102297
  normalizeServerId,
102134
102298
  canLoadServer,
@@ -102146,7 +102310,7 @@ export {
102146
102310
  statusCommand,
102147
102311
  getSettingDefinition,
102148
102312
  getDialogRestartRequiredSettings,
102149
- isRecord,
102313
+ isRecord2 as isRecord,
102150
102314
  getNestedValue,
102151
102315
  getEffectiveValue,
102152
102316
  getDialogSettingKeys,