@google/gemini-cli 0.48.0-nightly.20260613.g9e5599c32 → 0.48.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/bundle/{chunk-H4XKIOIJ.js → chunk-32OC6X7M.js} +2 -2
  2. package/bundle/{chunk-H3ZXB2VC.js → chunk-4D6ZATMR.js} +14 -7
  3. package/bundle/{chunk-PMYHHVD7.js → chunk-4JHCXKYF.js} +3 -3
  4. package/bundle/{chunk-FZ7CBMCM.js → chunk-76ONBIQT.js} +1 -1
  5. package/bundle/{chunk-LGHXO4JF.js → chunk-7BRNIWQY.js} +1 -1
  6. package/bundle/{chunk-XKHJ3UB3.js → chunk-BPCFUG3V.js} +66 -33
  7. package/bundle/{chunk-3ANNJGNC.js → chunk-C5HEG6L3.js} +1 -1
  8. package/bundle/{chunk-OXNVNKEV.js → chunk-F643LQAW.js} +2 -2
  9. package/bundle/{chunk-EBXCGR4V.js → chunk-F754PAF2.js} +1 -1
  10. package/bundle/{chunk-AYACUP3C.js → chunk-FKMHT24L.js} +1 -1
  11. package/bundle/{chunk-7DSGEVU5.js → chunk-FOP27KUG.js} +66 -33
  12. package/bundle/{chunk-3K4EYWSH.js → chunk-GOJGZJTT.js} +1 -1
  13. package/bundle/{chunk-ZOE7VNPK.js → chunk-JFJQ6J4C.js} +12 -5
  14. package/bundle/{chunk-BXEEDWH6.js → chunk-KRCY6JZY.js} +5 -8
  15. package/bundle/{chunk-ROQKSSYE.js → chunk-KXJA2W44.js} +113 -93
  16. package/bundle/{chunk-KZUWCS6V.js → chunk-LHJYE2I2.js} +1 -1
  17. package/bundle/{chunk-S45HA7JF.js → chunk-MGTB4OGF.js} +3 -3
  18. package/bundle/{chunk-KRG7Z454.js → chunk-NELP7HPM.js} +14112 -7560
  19. package/bundle/{chunk-ECBZWL2W.js → chunk-OAXLII52.js} +2 -2
  20. package/bundle/{chunk-B5I3CCOA.js → chunk-PIL3VMYY.js} +1 -1
  21. package/bundle/{chunk-AYZTVUY2.js → chunk-REQG2CDI.js} +1 -1
  22. package/bundle/{chunk-AVTA3FTC.js → chunk-WBAIIKUA.js} +3 -3
  23. package/bundle/{chunk-MDT4UJ3G.js → chunk-WLIX7UZL.js} +1 -1
  24. package/bundle/{chunk-CF3BBKHK.js → chunk-ZMBUTQOC.js} +8 -9
  25. package/bundle/{cleanup-AJZXSP46.js → cleanup-HQASY4ZZ.js} +2 -2
  26. package/bundle/{cleanup-E7ZNDNKL.js → cleanup-PIKPOR36.js} +2 -2
  27. package/bundle/{cleanup-HGGXJN2S.js → cleanup-TFU4O2QF.js} +2 -2
  28. package/bundle/{core-FQAKM62Z.js → core-2HID3ALL.js} +1 -1
  29. package/bundle/{dist-2POHEWMG.js → core-6YK2A6I7.js} +1 -1
  30. package/bundle/{devtoolsService-ODGS2QQG.js → devtoolsService-IJQN3MM5.js} +2 -2
  31. package/bundle/{devtoolsService-44BMHGAO.js → devtoolsService-UOC3OTQO.js} +3 -4
  32. package/bundle/{devtoolsService-2BWQPF3B.js → devtoolsService-VVO37S2U.js} +2 -2
  33. package/bundle/{dist-JXXKRKRH.js → dist-XJ5HWKG4.js} +1 -1
  34. package/bundle/docs/cli/enterprise.md +1 -1
  35. package/bundle/{gemini-FXOR76BN.js → gemini-FNT3QJRS.js} +15 -15
  36. package/bundle/{gemini-SF6V3ONT.js → gemini-K7TA557G.js} +197 -213
  37. package/bundle/{gemini-73PW23M3.js → gemini-KE6MEJUV.js} +14 -14
  38. package/bundle/gemini.js +7 -7
  39. package/bundle/{interactiveCli-QSH3444J.js → interactiveCli-42SRPV5K.js} +8 -8
  40. package/bundle/{interactiveCli-RZXB4HNH.js → interactiveCli-KHHF6YZS.js} +295 -314
  41. package/bundle/{interactiveCli-3E6VW57M.js → interactiveCli-LXYWEYTS.js} +8 -8
  42. package/bundle/{liteRtServerManager-72Q2BCXR.js → liteRtServerManager-4P66NNGG.js} +4 -4
  43. package/bundle/{liteRtServerManager-77TLRTQA.js → liteRtServerManager-MMZKQRWI.js} +4 -4
  44. package/bundle/{liteRtServerManager-JVDARMZG.js → liteRtServerManager-OBHUWV37.js} +4 -4
  45. package/bundle/{oauth2-provider-K56UERH2.js → oauth2-provider-OJZ3YJZH.js} +1 -1
  46. package/bundle/{oauth2-provider-EE4Q5V7V.js → oauth2-provider-TBT32VYL.js} +1 -1
  47. package/bundle/{oauth2-provider-SO5T5VJK.js → oauth2-provider-YIPV4CI4.js} +72 -38
  48. package/bundle/{start-4K4HQFJV.js → start-QX77TWOS.js} +6 -6
  49. package/bundle/{start-CLHV7ZFK.js → start-RF5733GP.js} +6 -6
  50. package/bundle/{start-HX2IY6MX.js → start-SYDDMBXA.js} +6 -6
  51. package/package.json +1 -1
  52. package/bundle/chunk-3TJFAAMG.js +0 -394713
  53. package/bundle/chunk-72QY3QJN.js +0 -154
  54. package/bundle/chunk-GAWEPPRJ.js +0 -512
  55. package/bundle/chunk-NNNOTG22.js +0 -398
  56. package/bundle/chunk-RLAGTHN3.js +0 -17320
  57. package/bundle/chunk-TLDDNDMX.js +0 -118
  58. package/bundle/chunk-WRZZAEO2.js +0 -81736
  59. package/bundle/chunk-YRCUUHST.js +0 -1571
  60. package/bundle/cleanup-KF6HYJYL.js +0 -32
  61. package/bundle/devtoolsService-WRDR4QTO.js +0 -856
  62. package/bundle/dist-VHOGKGQL.js +0 -2150
  63. package/bundle/gemini-TI2POZER.js +0 -16409
  64. package/bundle/interactiveCli-TE56MZWG.js +0 -34766
  65. package/bundle/liteRtServerManager-WTQW2MFN.js +0 -65
  66. package/bundle/oauth2-provider-W7MFZZSD.js +0 -235
  67. package/bundle/start-VIWV476W.js +0 -18
@@ -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-72QY3QJN.js";
4
+ } from "./chunk-C5HEG6L3.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  debugLogger,
8
8
  getChannelFromVersion,
9
9
  isGitRepository
10
- } from "./chunk-ZOE7VNPK.js";
10
+ } from "./chunk-4D6ZATMR.js";
11
11
 
12
12
  // packages/cli/src/utils/installationInfo.ts
13
13
  import * as fs from "node:fs";
@@ -279324,8 +279324,8 @@ function isValidToolName(name3, options = {}) {
279324
279324
  }
279325
279325
 
279326
279326
  // packages/core/dist/src/generated/git-commit.js
279327
- var GIT_COMMIT_INFO = "9e5599c32";
279328
- var CLI_VERSION = "0.48.0-nightly.20260613.g9e5599c32";
279327
+ var GIT_COMMIT_INFO = "4d3dcdce1";
279328
+ var CLI_VERSION = "0.48.0-preview.0";
279329
279329
 
279330
279330
  // packages/core/dist/src/ide/detect-ide.js
279331
279331
  var IDE_DEFINITIONS = {
@@ -303729,7 +303729,7 @@ function getVersion() {
303729
303729
  }
303730
303730
  versionPromise = (async () => {
303731
303731
  const pkgJson = await getPackageJson(__dirname4);
303732
- return "0.48.0-nightly.20260613.g9e5599c32";
303732
+ return "0.48.0-preview.0";
303733
303733
  })();
303734
303734
  return versionPromise;
303735
303735
  }
@@ -308658,15 +308658,22 @@ async function createContentGenerator(config2, gcConfig, sessionId) {
308658
308658
  }
308659
308659
  const proxyUrl = config2.proxy?.trim();
308660
308660
  const proxyAgent = proxyUrl ? baseUrl?.startsWith("http://") ? new import_dist2.HttpProxyAgent(proxyUrl) : new import_dist.HttpsProxyAgent(proxyUrl) : void 0;
308661
+ const useVertex = config2.vertexai ?? config2.authType === AuthType2.USE_VERTEX_AI;
308661
308662
  const googleGenAI = new GoogleGenAI({
308662
308663
  apiKey: config2.authType === AuthType2.GATEWAY ? config2.apiKey : config2.apiKey === "" ? void 0 : config2.apiKey,
308663
308664
  vertexai: config2.vertexai ?? config2.authType === AuthType2.USE_VERTEX_AI,
308664
308665
  httpOptions,
308665
308666
  ...apiVersionEnv && { apiVersion: apiVersionEnv },
308666
- ...proxyAgent && {
308667
+ // Merge proxy and GDCH endpoint into googleAuthOptions if either exists
308668
+ ...(proxyAgent || useVertex && baseUrl) && {
308667
308669
  googleAuthOptions: {
308668
308670
  clientOptions: {
308669
- transporterOptions: { agent: proxyAgent }
308671
+ ...proxyAgent && {
308672
+ transporterOptions: { agent: proxyAgent }
308673
+ },
308674
+ ...useVertex && baseUrl && {
308675
+ apiEndpoint: baseUrl
308676
+ }
308670
308677
  }
308671
308678
  }
308672
308679
  }
@@ -335940,7 +335947,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
335940
335947
  return provider;
335941
335948
  }
335942
335949
  case "oauth2": {
335943
- const { OAuth2AuthProvider } = await import("./oauth2-provider-SO5T5VJK.js");
335950
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-TBT32VYL.js");
335944
335951
  const provider = new OAuth2AuthProvider(authConfig, options.agentName ?? "unknown", agentCard, options.agentCardUrl);
335945
335952
  await provider.initialize();
335946
335953
  return provider;
@@ -343506,7 +343513,7 @@ var Scheduler = class {
343506
343513
  return false;
343507
343514
  }
343508
343515
  _isParallelizable(request) {
343509
- if (request.name === UPDATE_TOPIC_TOOL_NAME) {
343516
+ if (request.name === UPDATE_TOPIC_TOOL_NAME || EDIT_TOOL_NAMES.has(request.name)) {
343510
343517
  return false;
343511
343518
  }
343512
343519
  if (request.args) {
@@ -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-MDT4UJ3G.js";
5
+ } from "./chunk-F754PAF2.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-FZ7CBMCM.js";
17
+ } from "./chunk-FKMHT24L.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-ZOE7VNPK.js";
20
+ } from "./chunk-4D6ZATMR.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -29,7 +29,7 @@ import {
29
29
  require_strip_json_comments,
30
30
  sanitizeFilenamePart,
31
31
  stripAnsi
32
- } from "./chunk-ZOE7VNPK.js";
32
+ } from "./chunk-JFJQ6J4C.js";
33
33
  import {
34
34
  __commonJS,
35
35
  __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-ZOE7VNPK.js";
4
+ } from "./chunk-NELP7HPM.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __toESM
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  exitCli,
8
8
  require_source
9
- } from "./chunk-MDT4UJ3G.js";
9
+ } from "./chunk-LHJYE2I2.js";
10
10
  import {
11
11
  DEFAULT_BACKGROUND_OPACITY,
12
12
  DEFAULT_BORDER_OPACITY,
@@ -58,14 +58,14 @@ import {
58
58
  stripUnsafeCharacters,
59
59
  toCodePoints,
60
60
  validateCustomTheme
61
- } from "./chunk-FZ7CBMCM.js";
61
+ } from "./chunk-KRCY6JZY.js";
62
62
  import {
63
63
  isDevelopment
64
- } from "./chunk-H4XKIOIJ.js";
64
+ } from "./chunk-F643LQAW.js";
65
65
  import {
66
66
  emptyIcon,
67
67
  require_react
68
- } from "./chunk-LGHXO4JF.js";
68
+ } from "./chunk-7BRNIWQY.js";
69
69
  import {
70
70
  ALL_EDITORS,
71
71
  ApprovalMode,
@@ -230,7 +230,7 @@ import {
230
230
  tokenLimit,
231
231
  uiTelemetryService,
232
232
  unescapePath
233
- } from "./chunk-ZOE7VNPK.js";
233
+ } from "./chunk-NELP7HPM.js";
234
234
  import {
235
235
  require_src
236
236
  } from "./chunk-TUDYL3X4.js";
@@ -11695,9 +11695,9 @@ var require_prompts = __commonJS({
11695
11695
  $3.date = (args) => toPrompt("DatePrompt", args);
11696
11696
  $3.confirm = (args) => toPrompt("ConfirmPrompt", args);
11697
11697
  $3.list = (args) => {
11698
- const sep4 = args.separator || ",";
11698
+ const sep5 = args.separator || ",";
11699
11699
  return toPrompt("TextPrompt", args, {
11700
- onSubmit: (str) => str.split(sep4).map((s3) => s3.trim())
11700
+ onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
11701
11701
  });
11702
11702
  };
11703
11703
  $3.toggle = (args) => toPrompt("TogglePrompt", args);
@@ -13985,9 +13985,9 @@ var require_prompts2 = __commonJS({
13985
13985
  $3.date = (args) => toPrompt("DatePrompt", args);
13986
13986
  $3.confirm = (args) => toPrompt("ConfirmPrompt", args);
13987
13987
  $3.list = (args) => {
13988
- const sep4 = args.separator || ",";
13988
+ const sep5 = args.separator || ",";
13989
13989
  return toPrompt("TextPrompt", args, {
13990
- onSubmit: (str) => str.split(sep4).map((s3) => s3.trim())
13990
+ onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
13991
13991
  });
13992
13992
  };
13993
13993
  $3.toggle = (args) => toPrompt("TogglePrompt", args);
@@ -34585,9 +34585,16 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
34585
34585
  match[2],
34586
34586
  match[3]
34587
34587
  );
34588
- debugLogger.log(
34589
- `Detected terminal background color: ${this.terminalBackgroundColor}`
34590
- );
34588
+ if (this.terminalBackgroundColor === "#ffffff" && this.isTmux()) {
34589
+ debugLogger.log(
34590
+ "Ignored #ffffff background in tmux (common false positive over mosh)."
34591
+ );
34592
+ this.terminalBackgroundColor = void 0;
34593
+ } else {
34594
+ debugLogger.log(
34595
+ `Detected terminal background color: ${this.terminalBackgroundColor}`
34596
+ );
34597
+ }
34591
34598
  }
34592
34599
  }
34593
34600
  if (!kittyKeyboardReceived && _TerminalCapabilityManager.KITTY_REGEX.test(buffer)) {
@@ -40564,8 +40571,8 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
40564
40571
  }
40565
40572
  const envContent = formatEnvContent(nonSensitiveSettings);
40566
40573
  if (fsSync.existsSync(envFilePath)) {
40567
- const stat8 = fsSync.statSync(envFilePath);
40568
- if (stat8.isDirectory()) {
40574
+ const stat7 = fsSync.statSync(envFilePath);
40575
+ if (stat7.isDirectory()) {
40569
40576
  throw new Error(
40570
40577
  `Cannot write extension settings to ${envFilePath} because it is a directory.`
40571
40578
  );
@@ -40609,8 +40616,8 @@ async function getScopedEnvContents(extensionConfig, extensionId, scope, workspa
40609
40616
  const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
40610
40617
  let customEnv = {};
40611
40618
  if (fsSync.existsSync(envFilePath)) {
40612
- const stat8 = fsSync.statSync(envFilePath);
40613
- if (!stat8.isDirectory()) {
40619
+ const stat7 = fsSync.statSync(envFilePath);
40620
+ if (!stat7.isDirectory()) {
40614
40621
  const envFile = fsSync.readFileSync(envFilePath, "utf-8");
40615
40622
  customEnv = dotenv.parse(envFile);
40616
40623
  }
@@ -40678,8 +40685,8 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
40678
40685
  const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
40679
40686
  let envContent = "";
40680
40687
  if (fsSync.existsSync(envFilePath)) {
40681
- const stat8 = fsSync.statSync(envFilePath);
40682
- if (stat8.isDirectory()) {
40688
+ const stat7 = fsSync.statSync(envFilePath);
40689
+ if (stat7.isDirectory()) {
40683
40690
  throw new Error(
40684
40691
  `Cannot write extension settings to ${envFilePath} because it is a directory.`
40685
40692
  );
@@ -40727,8 +40734,8 @@ function getSettingsChanges(settings, oldSettings) {
40727
40734
  }
40728
40735
  async function clearSettings(envFilePath, keychain) {
40729
40736
  if (fsSync.existsSync(envFilePath)) {
40730
- const stat8 = fsSync.statSync(envFilePath);
40731
- if (!stat8.isDirectory()) {
40737
+ const stat7 = fsSync.statSync(envFilePath);
40738
+ if (!stat7.isDirectory()) {
40732
40739
  await fs11.writeFile(envFilePath, "");
40733
40740
  }
40734
40741
  }
@@ -56531,7 +56538,7 @@ var authCommand = {
56531
56538
  import process29 from "node:process";
56532
56539
 
56533
56540
  // packages/cli/src/generated/git-commit.ts
56534
- var GIT_COMMIT_INFO = "9e5599c32";
56541
+ var GIT_COMMIT_INFO = "4d3dcdce1";
56535
56542
 
56536
56543
  // packages/cli/src/ui/utils/historyExportUtils.ts
56537
56544
  import * as fsPromises from "node:fs/promises";
@@ -62312,7 +62319,7 @@ Use /mcp auth <server-name> to authenticate.`
62312
62319
  type: "info",
62313
62320
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
62314
62321
  });
62315
- const { MCPOAuthProvider } = await import("./core-FQAKM62Z.js");
62322
+ const { MCPOAuthProvider } = await import("./core-2HID3ALL.js");
62316
62323
  let oauthConfig = server.oauth;
62317
62324
  if (!oauthConfig) {
62318
62325
  oauthConfig = { enabled: false };
@@ -80153,6 +80160,12 @@ function renderSkillActionFeedback(result, formatScope) {
80153
80160
  const s3 = formatScopeItem(totalAffectedScopes[0]);
80154
80161
  return `Skill "${skillName}" ${actionVerb} ${preposition} ${s3} settings.`;
80155
80162
  }
80163
+ function isPathTraversal(relative3) {
80164
+ return relative3 === ".." || relative3.startsWith(".." + path36.sep) || path36.isAbsolute(relative3);
80165
+ }
80166
+ function isInvalidSubpath(relative3) {
80167
+ return relative3 === "" || isPathTraversal(relative3);
80168
+ }
80156
80169
  async function installSkill(source2, scope, subpath, onLog, requestConsent = () => Promise.resolve(true)) {
80157
80170
  let sourcePath = source2;
80158
80171
  let tempDirToClean = void 0;
@@ -80184,8 +80197,12 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
80184
80197
  sourcePath = path36.join(sourcePath, subpath);
80185
80198
  }
80186
80199
  sourcePath = path36.resolve(sourcePath);
80187
- if (tempDirToClean && !sourcePath.startsWith(path36.resolve(tempDirToClean))) {
80188
- throw new Error("Invalid path: Directory traversal not allowed.");
80200
+ if (tempDirToClean) {
80201
+ const resolvedTemp = path36.resolve(tempDirToClean);
80202
+ const relative3 = path36.relative(resolvedTemp, sourcePath);
80203
+ if (isPathTraversal(relative3)) {
80204
+ throw new Error("Invalid path: Directory traversal not allowed.");
80205
+ }
80189
80206
  }
80190
80207
  onLog(`Searching for skills in ${sourcePath}...`);
80191
80208
  const skills = await loadSkillsFromDir(sourcePath);
@@ -80200,13 +80217,18 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
80200
80217
  if (!await requestConsent(skills, targetDir)) {
80201
80218
  throw new Error("Skill installation cancelled by user.");
80202
80219
  }
80203
- await fs36.mkdir(targetDir, { recursive: true });
80220
+ const resolvedTarget = path36.resolve(targetDir);
80221
+ await fs36.mkdir(resolvedTarget, { recursive: true });
80204
80222
  const installedSkills = [];
80205
80223
  for (const skill of skills) {
80206
80224
  const skillName = skill.name;
80207
80225
  const skillDir = path36.dirname(skill.location);
80208
- const destPath = path36.join(targetDir, skillName);
80209
- const exists = await fs36.stat(destPath).catch(() => null);
80226
+ const destPath = path36.resolve(resolvedTarget, skillName);
80227
+ const relative3 = path36.relative(resolvedTarget, destPath);
80228
+ if (isInvalidSubpath(relative3)) {
80229
+ throw new Error("Invalid skill name: Path traversal detected.");
80230
+ }
80231
+ const exists = await fs36.lstat(destPath).catch(() => null);
80210
80232
  if (exists) {
80211
80233
  onLog(`Skill "${skillName}" already exists. Overwriting...`);
80212
80234
  await fs36.rm(destPath, { recursive: true, force: true });
@@ -80247,12 +80269,17 @@ async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.r
80247
80269
  if (!await requestConsent(skills, targetDir)) {
80248
80270
  throw new Error("Skill linking cancelled by user.");
80249
80271
  }
80250
- await fs36.mkdir(targetDir, { recursive: true });
80272
+ const resolvedTarget = path36.resolve(targetDir);
80273
+ await fs36.mkdir(resolvedTarget, { recursive: true });
80251
80274
  const linkedSkills = [];
80252
80275
  for (const skill of skills) {
80253
80276
  const skillName = skill.name;
80254
80277
  const skillSourceDir = path36.dirname(skill.location);
80255
- const destPath = path36.join(targetDir, skillName);
80278
+ const destPath = path36.resolve(resolvedTarget, skillName);
80279
+ const relative3 = path36.relative(resolvedTarget, destPath);
80280
+ if (isInvalidSubpath(relative3)) {
80281
+ throw new Error("Invalid skill name: Path traversal detected.");
80282
+ }
80256
80283
  const exists = await fs36.lstat(destPath).catch(() => null);
80257
80284
  if (exists) {
80258
80285
  onLog(
@@ -80273,11 +80300,13 @@ async function uninstallSkill(name, scope) {
80273
80300
  const workspaceDir = process.cwd();
80274
80301
  const storage = new Storage(workspaceDir);
80275
80302
  const targetDir = scope === "workspace" ? storage.getProjectSkillsDir() : Storage.getUserSkillsDir();
80276
- const discoveredSkills = await loadSkillsFromDir(targetDir);
80303
+ const resolvedTarget = path36.resolve(targetDir);
80304
+ const discoveredSkills = await loadSkillsFromDir(resolvedTarget);
80277
80305
  const skillToUninstall = discoveredSkills.find((s3) => s3.name === name);
80278
80306
  if (!skillToUninstall) {
80279
- const skillPath = path36.resolve(targetDir, name);
80280
- if (!skillPath.startsWith(path36.resolve(targetDir))) {
80307
+ const skillPath = path36.resolve(resolvedTarget, name);
80308
+ const relative4 = path36.relative(resolvedTarget, skillPath);
80309
+ if (isInvalidSubpath(relative4)) {
80281
80310
  return null;
80282
80311
  }
80283
80312
  const exists = await fs36.lstat(skillPath).catch(() => null);
@@ -80287,7 +80316,11 @@ async function uninstallSkill(name, scope) {
80287
80316
  await fs36.rm(skillPath, { recursive: true, force: true });
80288
80317
  return { location: skillPath };
80289
80318
  }
80290
- const skillDir = path36.dirname(skillToUninstall.location);
80319
+ const skillDir = path36.resolve(path36.dirname(skillToUninstall.location));
80320
+ const relative3 = path36.relative(resolvedTarget, skillDir);
80321
+ if (isInvalidSubpath(relative3)) {
80322
+ return null;
80323
+ }
80291
80324
  await fs36.rm(skillDir, { recursive: true, force: true });
80292
80325
  return { location: skillDir };
80293
80326
  }
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-3TJFAAMG.js";
8
+ } from "./chunk-4D6ZATMR.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";
@@ -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-AYZTVUY2.js";
4
+ } from "./chunk-GOJGZJTT.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  debugLogger,
8
8
  getChannelFromVersion,
9
9
  isGitRepository
10
- } from "./chunk-KRG7Z454.js";
10
+ } from "./chunk-NELP7HPM.js";
11
11
 
12
12
  // packages/cli/src/utils/installationInfo.ts
13
13
  import * as fs from "node:fs";
@@ -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-AYZTVUY2.js";
4
+ } from "./chunk-C5HEG6L3.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -32,7 +32,7 @@ import {
32
32
  require_strip_json_comments,
33
33
  sanitizeFilenamePart,
34
34
  stripAnsi
35
- } from "./chunk-KRG7Z454.js";
35
+ } from "./chunk-4D6ZATMR.js";
36
36
  import {
37
37
  __commonJS,
38
38
  __require,
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  exitCli,
8
8
  require_source
9
- } from "./chunk-EBXCGR4V.js";
9
+ } from "./chunk-F754PAF2.js";
10
10
  import {
11
11
  DEFAULT_BACKGROUND_OPACITY,
12
12
  DEFAULT_BORDER_OPACITY,
@@ -58,14 +58,14 @@ import {
58
58
  stripUnsafeCharacters,
59
59
  toCodePoints,
60
60
  validateCustomTheme
61
- } from "./chunk-AYACUP3C.js";
61
+ } from "./chunk-FKMHT24L.js";
62
62
  import {
63
63
  isDevelopment
64
- } from "./chunk-OXNVNKEV.js";
64
+ } from "./chunk-32OC6X7M.js";
65
65
  import {
66
66
  emptyIcon,
67
67
  require_react
68
- } from "./chunk-GAWEPPRJ.js";
68
+ } from "./chunk-PIL3VMYY.js";
69
69
  import {
70
70
  ALL_EDITORS,
71
71
  ApprovalMode,
@@ -243,7 +243,7 @@ import {
243
243
  tokenLimit,
244
244
  uiTelemetryService,
245
245
  unescapePath
246
- } from "./chunk-KRG7Z454.js";
246
+ } from "./chunk-4D6ZATMR.js";
247
247
  import {
248
248
  require_src
249
249
  } from "./chunk-TUDYL3X4.js";
@@ -11708,9 +11708,9 @@ var require_prompts = __commonJS({
11708
11708
  $3.date = (args) => toPrompt("DatePrompt", args);
11709
11709
  $3.confirm = (args) => toPrompt("ConfirmPrompt", args);
11710
11710
  $3.list = (args) => {
11711
- const sep4 = args.separator || ",";
11711
+ const sep5 = args.separator || ",";
11712
11712
  return toPrompt("TextPrompt", args, {
11713
- onSubmit: (str) => str.split(sep4).map((s3) => s3.trim())
11713
+ onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
11714
11714
  });
11715
11715
  };
11716
11716
  $3.toggle = (args) => toPrompt("TogglePrompt", args);
@@ -13998,9 +13998,9 @@ var require_prompts2 = __commonJS({
13998
13998
  $3.date = (args) => toPrompt("DatePrompt", args);
13999
13999
  $3.confirm = (args) => toPrompt("ConfirmPrompt", args);
14000
14000
  $3.list = (args) => {
14001
- const sep4 = args.separator || ",";
14001
+ const sep5 = args.separator || ",";
14002
14002
  return toPrompt("TextPrompt", args, {
14003
- onSubmit: (str) => str.split(sep4).map((s3) => s3.trim())
14003
+ onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
14004
14004
  });
14005
14005
  };
14006
14006
  $3.toggle = (args) => toPrompt("TogglePrompt", args);
@@ -34598,9 +34598,16 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
34598
34598
  match[2],
34599
34599
  match[3]
34600
34600
  );
34601
- debugLogger.log(
34602
- `Detected terminal background color: ${this.terminalBackgroundColor}`
34603
- );
34601
+ if (this.terminalBackgroundColor === "#ffffff" && this.isTmux()) {
34602
+ debugLogger.log(
34603
+ "Ignored #ffffff background in tmux (common false positive over mosh)."
34604
+ );
34605
+ this.terminalBackgroundColor = void 0;
34606
+ } else {
34607
+ debugLogger.log(
34608
+ `Detected terminal background color: ${this.terminalBackgroundColor}`
34609
+ );
34610
+ }
34604
34611
  }
34605
34612
  }
34606
34613
  if (!kittyKeyboardReceived && _TerminalCapabilityManager.KITTY_REGEX.test(buffer)) {
@@ -40577,8 +40584,8 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
40577
40584
  }
40578
40585
  const envContent = formatEnvContent(nonSensitiveSettings);
40579
40586
  if (fsSync.existsSync(envFilePath)) {
40580
- const stat8 = fsSync.statSync(envFilePath);
40581
- if (stat8.isDirectory()) {
40587
+ const stat7 = fsSync.statSync(envFilePath);
40588
+ if (stat7.isDirectory()) {
40582
40589
  throw new Error(
40583
40590
  `Cannot write extension settings to ${envFilePath} because it is a directory.`
40584
40591
  );
@@ -40622,8 +40629,8 @@ async function getScopedEnvContents(extensionConfig, extensionId, scope, workspa
40622
40629
  const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
40623
40630
  let customEnv = {};
40624
40631
  if (fsSync.existsSync(envFilePath)) {
40625
- const stat8 = fsSync.statSync(envFilePath);
40626
- if (!stat8.isDirectory()) {
40632
+ const stat7 = fsSync.statSync(envFilePath);
40633
+ if (!stat7.isDirectory()) {
40627
40634
  const envFile = fsSync.readFileSync(envFilePath, "utf-8");
40628
40635
  customEnv = dotenv.parse(envFile);
40629
40636
  }
@@ -40691,8 +40698,8 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
40691
40698
  const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
40692
40699
  let envContent = "";
40693
40700
  if (fsSync.existsSync(envFilePath)) {
40694
- const stat8 = fsSync.statSync(envFilePath);
40695
- if (stat8.isDirectory()) {
40701
+ const stat7 = fsSync.statSync(envFilePath);
40702
+ if (stat7.isDirectory()) {
40696
40703
  throw new Error(
40697
40704
  `Cannot write extension settings to ${envFilePath} because it is a directory.`
40698
40705
  );
@@ -40740,8 +40747,8 @@ function getSettingsChanges(settings, oldSettings) {
40740
40747
  }
40741
40748
  async function clearSettings(envFilePath, keychain) {
40742
40749
  if (fsSync.existsSync(envFilePath)) {
40743
- const stat8 = fsSync.statSync(envFilePath);
40744
- if (!stat8.isDirectory()) {
40750
+ const stat7 = fsSync.statSync(envFilePath);
40751
+ if (!stat7.isDirectory()) {
40745
40752
  await fs11.writeFile(envFilePath, "");
40746
40753
  }
40747
40754
  }
@@ -56544,7 +56551,7 @@ var authCommand = {
56544
56551
  import process29 from "node:process";
56545
56552
 
56546
56553
  // packages/cli/src/generated/git-commit.ts
56547
- var GIT_COMMIT_INFO = "9e5599c32";
56554
+ var GIT_COMMIT_INFO = "35b1f0211";
56548
56555
 
56549
56556
  // packages/cli/src/ui/utils/historyExportUtils.ts
56550
56557
  import * as fsPromises from "node:fs/promises";
@@ -62325,7 +62332,7 @@ Use /mcp auth <server-name> to authenticate.`
62325
62332
  type: "info",
62326
62333
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
62327
62334
  });
62328
- const { MCPOAuthProvider } = await import("./dist-2POHEWMG.js");
62335
+ const { MCPOAuthProvider } = await import("./dist-XJ5HWKG4.js");
62329
62336
  let oauthConfig = server.oauth;
62330
62337
  if (!oauthConfig) {
62331
62338
  oauthConfig = { enabled: false };
@@ -80166,6 +80173,12 @@ function renderSkillActionFeedback(result, formatScope) {
80166
80173
  const s3 = formatScopeItem(totalAffectedScopes[0]);
80167
80174
  return `Skill "${skillName}" ${actionVerb} ${preposition} ${s3} settings.`;
80168
80175
  }
80176
+ function isPathTraversal(relative3) {
80177
+ return relative3 === ".." || relative3.startsWith(".." + path36.sep) || path36.isAbsolute(relative3);
80178
+ }
80179
+ function isInvalidSubpath(relative3) {
80180
+ return relative3 === "" || isPathTraversal(relative3);
80181
+ }
80169
80182
  async function installSkill(source2, scope, subpath, onLog, requestConsent = () => Promise.resolve(true)) {
80170
80183
  let sourcePath = source2;
80171
80184
  let tempDirToClean = void 0;
@@ -80197,8 +80210,12 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
80197
80210
  sourcePath = path36.join(sourcePath, subpath);
80198
80211
  }
80199
80212
  sourcePath = path36.resolve(sourcePath);
80200
- if (tempDirToClean && !sourcePath.startsWith(path36.resolve(tempDirToClean))) {
80201
- throw new Error("Invalid path: Directory traversal not allowed.");
80213
+ if (tempDirToClean) {
80214
+ const resolvedTemp = path36.resolve(tempDirToClean);
80215
+ const relative3 = path36.relative(resolvedTemp, sourcePath);
80216
+ if (isPathTraversal(relative3)) {
80217
+ throw new Error("Invalid path: Directory traversal not allowed.");
80218
+ }
80202
80219
  }
80203
80220
  onLog(`Searching for skills in ${sourcePath}...`);
80204
80221
  const skills = await loadSkillsFromDir(sourcePath);
@@ -80213,13 +80230,18 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
80213
80230
  if (!await requestConsent(skills, targetDir)) {
80214
80231
  throw new Error("Skill installation cancelled by user.");
80215
80232
  }
80216
- await fs36.mkdir(targetDir, { recursive: true });
80233
+ const resolvedTarget = path36.resolve(targetDir);
80234
+ await fs36.mkdir(resolvedTarget, { recursive: true });
80217
80235
  const installedSkills = [];
80218
80236
  for (const skill of skills) {
80219
80237
  const skillName = skill.name;
80220
80238
  const skillDir = path36.dirname(skill.location);
80221
- const destPath = path36.join(targetDir, skillName);
80222
- const exists = await fs36.stat(destPath).catch(() => null);
80239
+ const destPath = path36.resolve(resolvedTarget, skillName);
80240
+ const relative3 = path36.relative(resolvedTarget, destPath);
80241
+ if (isInvalidSubpath(relative3)) {
80242
+ throw new Error("Invalid skill name: Path traversal detected.");
80243
+ }
80244
+ const exists = await fs36.lstat(destPath).catch(() => null);
80223
80245
  if (exists) {
80224
80246
  onLog(`Skill "${skillName}" already exists. Overwriting...`);
80225
80247
  await fs36.rm(destPath, { recursive: true, force: true });
@@ -80260,12 +80282,17 @@ async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.r
80260
80282
  if (!await requestConsent(skills, targetDir)) {
80261
80283
  throw new Error("Skill linking cancelled by user.");
80262
80284
  }
80263
- await fs36.mkdir(targetDir, { recursive: true });
80285
+ const resolvedTarget = path36.resolve(targetDir);
80286
+ await fs36.mkdir(resolvedTarget, { recursive: true });
80264
80287
  const linkedSkills = [];
80265
80288
  for (const skill of skills) {
80266
80289
  const skillName = skill.name;
80267
80290
  const skillSourceDir = path36.dirname(skill.location);
80268
- const destPath = path36.join(targetDir, skillName);
80291
+ const destPath = path36.resolve(resolvedTarget, skillName);
80292
+ const relative3 = path36.relative(resolvedTarget, destPath);
80293
+ if (isInvalidSubpath(relative3)) {
80294
+ throw new Error("Invalid skill name: Path traversal detected.");
80295
+ }
80269
80296
  const exists = await fs36.lstat(destPath).catch(() => null);
80270
80297
  if (exists) {
80271
80298
  onLog(
@@ -80286,11 +80313,13 @@ async function uninstallSkill(name, scope) {
80286
80313
  const workspaceDir = process.cwd();
80287
80314
  const storage = new Storage(workspaceDir);
80288
80315
  const targetDir = scope === "workspace" ? storage.getProjectSkillsDir() : Storage.getUserSkillsDir();
80289
- const discoveredSkills = await loadSkillsFromDir(targetDir);
80316
+ const resolvedTarget = path36.resolve(targetDir);
80317
+ const discoveredSkills = await loadSkillsFromDir(resolvedTarget);
80290
80318
  const skillToUninstall = discoveredSkills.find((s3) => s3.name === name);
80291
80319
  if (!skillToUninstall) {
80292
- const skillPath = path36.resolve(targetDir, name);
80293
- if (!skillPath.startsWith(path36.resolve(targetDir))) {
80320
+ const skillPath = path36.resolve(resolvedTarget, name);
80321
+ const relative4 = path36.relative(resolvedTarget, skillPath);
80322
+ if (isInvalidSubpath(relative4)) {
80294
80323
  return null;
80295
80324
  }
80296
80325
  const exists = await fs36.lstat(skillPath).catch(() => null);
@@ -80300,7 +80329,11 @@ async function uninstallSkill(name, scope) {
80300
80329
  await fs36.rm(skillPath, { recursive: true, force: true });
80301
80330
  return { location: skillPath };
80302
80331
  }
80303
- const skillDir = path36.dirname(skillToUninstall.location);
80332
+ const skillDir = path36.resolve(path36.dirname(skillToUninstall.location));
80333
+ const relative3 = path36.relative(resolvedTarget, skillDir);
80334
+ if (isInvalidSubpath(relative3)) {
80335
+ return null;
80336
+ }
80304
80337
  await fs36.rm(skillDir, { recursive: true, force: true });
80305
80338
  return { location: skillDir };
80306
80339
  }
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-H3ZXB2VC.js";
8
+ } from "./chunk-NELP7HPM.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";