@google/gemini-cli 0.48.0-nightly.20260612.g4e10a34be → 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-ZT5PXPGC.js → chunk-32OC6X7M.js} +2 -2
  2. package/bundle/{chunk-GWB6WHVI.js → chunk-4D6ZATMR.js} +125 -83
  3. package/bundle/{chunk-RWG2IKXK.js → chunk-4JHCXKYF.js} +3 -3
  4. package/bundle/{chunk-4FWMMTHD.js → chunk-76ONBIQT.js} +1 -1
  5. package/bundle/{chunk-25ZW2ZOF.js → chunk-7BRNIWQY.js} +1 -1
  6. package/bundle/{chunk-FFKNXGOH.js → chunk-BPCFUG3V.js} +66 -33
  7. package/bundle/{chunk-DV5H7HVO.js → chunk-C5HEG6L3.js} +1 -1
  8. package/bundle/{chunk-DR6M2CVX.js → chunk-F643LQAW.js} +2 -2
  9. package/bundle/{chunk-BG23KJOF.js → chunk-F754PAF2.js} +1 -1
  10. package/bundle/{chunk-57QJRHS6.js → chunk-FKMHT24L.js} +1 -1
  11. package/bundle/{chunk-5TAF74A7.js → chunk-FOP27KUG.js} +66 -33
  12. package/bundle/{chunk-HEBKVYVW.js → chunk-GOJGZJTT.js} +1 -1
  13. package/bundle/{chunk-GSKH763B.js → chunk-JFJQ6J4C.js} +123 -81
  14. package/bundle/{chunk-5OGSMQN5.js → chunk-KRCY6JZY.js} +5 -8
  15. package/bundle/{chunk-3P56CQDW.js → chunk-KXJA2W44.js} +113 -93
  16. package/bundle/{chunk-3BHPNRR5.js → chunk-LHJYE2I2.js} +1 -1
  17. package/bundle/{chunk-TRKBNK3S.js → chunk-MGTB4OGF.js} +3 -3
  18. package/bundle/{chunk-PD2ER6QH.js → chunk-NELP7HPM.js} +14221 -7634
  19. package/bundle/{chunk-FSFSH7N4.js → chunk-OAXLII52.js} +2 -2
  20. package/bundle/{chunk-NWC2JNOB.js → chunk-PIL3VMYY.js} +1 -1
  21. package/bundle/{chunk-RJVA7TEL.js → chunk-REQG2CDI.js} +1 -1
  22. package/bundle/{chunk-JQBYCLEO.js → chunk-WBAIIKUA.js} +3 -3
  23. package/bundle/{chunk-ERRTQLZ3.js → chunk-WLIX7UZL.js} +1 -1
  24. package/bundle/{chunk-ZACXIEK6.js → chunk-ZMBUTQOC.js} +8 -9
  25. package/bundle/{cleanup-EMSFFQXH.js → cleanup-HQASY4ZZ.js} +2 -2
  26. package/bundle/{cleanup-JUEQXYLN.js → cleanup-PIKPOR36.js} +2 -2
  27. package/bundle/{cleanup-OQN4S6N7.js → cleanup-TFU4O2QF.js} +2 -2
  28. package/bundle/{core-SBDR7NMV.js → core-2HID3ALL.js} +1 -1
  29. package/bundle/{dist-C77MM5UI.js → core-6YK2A6I7.js} +1 -1
  30. package/bundle/{devtoolsService-Q6RR5ONV.js → devtoolsService-IJQN3MM5.js} +2 -2
  31. package/bundle/{devtoolsService-6XIZFA3V.js → devtoolsService-UOC3OTQO.js} +3 -4
  32. package/bundle/{devtoolsService-4K4TUJGT.js → devtoolsService-VVO37S2U.js} +2 -2
  33. package/bundle/{dist-IZL4IUFR.js → dist-XJ5HWKG4.js} +1 -1
  34. package/bundle/docs/cli/enterprise.md +1 -1
  35. package/bundle/{gemini-22IJYAAK.js → gemini-FNT3QJRS.js} +15 -15
  36. package/bundle/{gemini-BU4XIO7C.js → gemini-K7TA557G.js} +197 -213
  37. package/bundle/{gemini-EXF7WM5I.js → gemini-KE6MEJUV.js} +14 -14
  38. package/bundle/gemini.js +7 -7
  39. package/bundle/{interactiveCli-WP4PF4B4.js → interactiveCli-42SRPV5K.js} +8 -8
  40. package/bundle/{interactiveCli-AYRCP2YE.js → interactiveCli-KHHF6YZS.js} +295 -314
  41. package/bundle/{interactiveCli-3XP7ZWTR.js → interactiveCli-LXYWEYTS.js} +8 -8
  42. package/bundle/{liteRtServerManager-BKMP23GM.js → liteRtServerManager-4P66NNGG.js} +4 -4
  43. package/bundle/{liteRtServerManager-BRKTTSTY.js → liteRtServerManager-MMZKQRWI.js} +4 -4
  44. package/bundle/{liteRtServerManager-EXA5HOJY.js → liteRtServerManager-OBHUWV37.js} +4 -4
  45. package/bundle/{oauth2-provider-R3XNUJCY.js → oauth2-provider-OJZ3YJZH.js} +1 -1
  46. package/bundle/{oauth2-provider-AOLL6E73.js → oauth2-provider-TBT32VYL.js} +1 -1
  47. package/bundle/{oauth2-provider-J7GSQ3D3.js → oauth2-provider-YIPV4CI4.js} +72 -38
  48. package/bundle/{start-FAIQQIZB.js → start-QX77TWOS.js} +6 -6
  49. package/bundle/{start-T37M4GQC.js → start-RF5733GP.js} +6 -6
  50. package/bundle/{start-UEM457EB.js → start-SYDDMBXA.js} +6 -6
  51. package/package.json +1 -1
  52. package/bundle/chunk-47O5POZQ.js +0 -394678
  53. package/bundle/chunk-GUFPYIHD.js +0 -512
  54. package/bundle/chunk-I4UV4KA4.js +0 -398
  55. package/bundle/chunk-JNJOXQYJ.js +0 -1571
  56. package/bundle/chunk-M54YU4D6.js +0 -118
  57. package/bundle/chunk-OZYTM77K.js +0 -81736
  58. package/bundle/chunk-TMB2KDVR.js +0 -154
  59. package/bundle/chunk-WEPCSQ47.js +0 -17320
  60. package/bundle/cleanup-VI4MGW6W.js +0 -32
  61. package/bundle/devtoolsService-P7V47Y6U.js +0 -856
  62. package/bundle/dist-PNS3BBFZ.js +0 -2150
  63. package/bundle/gemini-GA3BOQUA.js +0 -16409
  64. package/bundle/interactiveCli-IK5ZIGXI.js +0 -34766
  65. package/bundle/liteRtServerManager-NPAIRQRP.js +0 -65
  66. package/bundle/oauth2-provider-O3JJBAIN.js +0 -235
  67. package/bundle/start-VUNII4BV.js +0 -18
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  exitCli,
8
8
  require_source
9
- } from "./chunk-3BHPNRR5.js";
9
+ } from "./chunk-WLIX7UZL.js";
10
10
  import {
11
11
  DEFAULT_BACKGROUND_OPACITY,
12
12
  DEFAULT_BORDER_OPACITY,
@@ -58,22 +58,20 @@ import {
58
58
  stripUnsafeCharacters,
59
59
  toCodePoints,
60
60
  validateCustomTheme
61
- } from "./chunk-57QJRHS6.js";
61
+ } from "./chunk-76ONBIQT.js";
62
62
  import {
63
63
  isDevelopment
64
- } from "./chunk-DR6M2CVX.js";
64
+ } from "./chunk-OAXLII52.js";
65
65
  import {
66
66
  emptyIcon,
67
67
  require_react
68
- } from "./chunk-GUFPYIHD.js";
68
+ } from "./chunk-ZMBUTQOC.js";
69
69
  import {
70
70
  ALL_EDITORS,
71
71
  ApprovalMode,
72
72
  AsyncFzf,
73
- AuthType,
74
73
  Config,
75
74
  CoreEvent,
76
- CoreToolCallStatus,
77
75
  DiscoveredMCPTool,
78
76
  ExtensionDisableEvent,
79
77
  ExtensionEnableEvent,
@@ -84,31 +82,20 @@ import {
84
82
  ExtensionUpdateEvent,
85
83
  GEMINI_CLI_COMPANION_EXTENSION_NAME,
86
84
  GEMINI_DIR,
87
- HookType,
88
- IDEConnectionStatus,
89
85
  INITIAL_HISTORY_LENGTH,
90
86
  IdeClient,
91
87
  IdeConnectionEvent,
92
- IdeConnectionType,
93
- IntegrityDataStatus,
94
88
  KeychainTokenStorage,
95
- LlmRole,
96
- MCPDiscoveryState,
97
89
  MCPOAuthTokenStorage,
98
- MCPServerStatus,
99
90
  ModelSlashCommandEvent,
100
- PolicyDecision,
101
91
  ProjectIdRequiredError,
102
92
  REFERENCE_CONTENT_END,
103
93
  REFERENCE_CONTENT_START,
104
94
  ReadManyFilesTool,
105
95
  RewindEvent,
106
- SessionEndReason,
107
- SessionStartSource,
108
96
  ShellExecutionService,
109
97
  StartSessionEvent,
110
98
  Storage,
111
- TrustLevel,
112
99
  UPGRADE_URL_PAGE,
113
100
  UserAccountManager,
114
101
  ValidationRequiredError,
@@ -243,7 +230,7 @@ import {
243
230
  tokenLimit,
244
231
  uiTelemetryService,
245
232
  unescapePath
246
- } from "./chunk-47O5POZQ.js";
233
+ } from "./chunk-JFJQ6J4C.js";
247
234
  import {
248
235
  require_src
249
236
  } from "./chunk-TUDYL3X4.js";
@@ -11708,9 +11695,9 @@ var require_prompts = __commonJS({
11708
11695
  $3.date = (args) => toPrompt("DatePrompt", args);
11709
11696
  $3.confirm = (args) => toPrompt("ConfirmPrompt", args);
11710
11697
  $3.list = (args) => {
11711
- const sep4 = args.separator || ",";
11698
+ const sep5 = args.separator || ",";
11712
11699
  return toPrompt("TextPrompt", args, {
11713
- onSubmit: (str) => str.split(sep4).map((s3) => s3.trim())
11700
+ onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
11714
11701
  });
11715
11702
  };
11716
11703
  $3.toggle = (args) => toPrompt("TogglePrompt", args);
@@ -13998,9 +13985,9 @@ var require_prompts2 = __commonJS({
13998
13985
  $3.date = (args) => toPrompt("DatePrompt", args);
13999
13986
  $3.confirm = (args) => toPrompt("ConfirmPrompt", args);
14000
13987
  $3.list = (args) => {
14001
- const sep4 = args.separator || ",";
13988
+ const sep5 = args.separator || ",";
14002
13989
  return toPrompt("TextPrompt", args, {
14003
- onSubmit: (str) => str.split(sep4).map((s3) => s3.trim())
13990
+ onSubmit: (str) => str.split(sep5).map((s3) => s3.trim())
14004
13991
  });
14005
13992
  };
14006
13993
  $3.toggle = (args) => toPrompt("TogglePrompt", args);
@@ -34598,9 +34585,16 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
34598
34585
  match[2],
34599
34586
  match[3]
34600
34587
  );
34601
- debugLogger.log(
34602
- `Detected terminal background color: ${this.terminalBackgroundColor}`
34603
- );
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
+ }
34604
34598
  }
34605
34599
  }
34606
34600
  if (!kittyKeyboardReceived && _TerminalCapabilityManager.KITTY_REGEX.test(buffer)) {
@@ -39460,7 +39454,7 @@ var import_react34 = __toESM(require_react(), 1);
39460
39454
  function useIdeTrustListener() {
39461
39455
  const settings = useSettings();
39462
39456
  const [connectionStatus, setConnectionStatus] = (0, import_react34.useState)(
39463
- IDEConnectionStatus.Disconnected
39457
+ "disconnected" /* Disconnected */
39464
39458
  );
39465
39459
  const previousTrust = (0, import_react34.useRef)(void 0);
39466
39460
  const [restartReason, setRestartReason] = (0, import_react34.useState)("NONE");
@@ -39490,7 +39484,7 @@ function useIdeTrustListener() {
39490
39484
  };
39491
39485
  }, []);
39492
39486
  const getSnapshot = () => {
39493
- if (connectionStatus !== IDEConnectionStatus.Connected) {
39487
+ if (connectionStatus !== "connected" /* Connected */) {
39494
39488
  return void 0;
39495
39489
  }
39496
39490
  return ideContextStore.get()?.workspaceState?.isTrusted;
@@ -40195,7 +40189,7 @@ async function initializeApp(config, settings) {
40195
40189
  await ideClient.connect();
40196
40190
  logIdeConnection(
40197
40191
  config,
40198
- new IdeConnectionEvent(IdeConnectionType.START)
40192
+ new IdeConnectionEvent("start" /* START */)
40199
40193
  );
40200
40194
  }).catch((e) => {
40201
40195
  debugLogger.error("Failed to initialize IDE client:", e);
@@ -40213,17 +40207,17 @@ async function initializeApp(config, settings) {
40213
40207
  // packages/cli/src/config/auth.ts
40214
40208
  async function validateAuthMethod(authMethod) {
40215
40209
  loadEnvironment(loadSettings().merged, process.cwd());
40216
- if (authMethod === AuthType.LOGIN_WITH_GOOGLE || authMethod === AuthType.COMPUTE_ADC) {
40210
+ if (authMethod === "oauth-personal" /* LOGIN_WITH_GOOGLE */ || authMethod === "compute-default-credentials" /* COMPUTE_ADC */) {
40217
40211
  return null;
40218
40212
  }
40219
- if (authMethod === AuthType.USE_GEMINI) {
40213
+ if (authMethod === "gemini-api-key" /* USE_GEMINI */) {
40220
40214
  const key = process.env["GEMINI_API_KEY"] || await loadApiKey();
40221
40215
  if (!key) {
40222
40216
  return "When using Gemini API, you must specify the GEMINI_API_KEY environment variable.\nUpdate your environment and try again (no reload needed if using .env)!";
40223
40217
  }
40224
40218
  return null;
40225
40219
  }
40226
- if (authMethod === AuthType.USE_VERTEX_AI) {
40220
+ if (authMethod === "vertex-ai" /* USE_VERTEX_AI */) {
40227
40221
  const hasVertexProjectLocationConfig = !!process.env["GOOGLE_CLOUD_PROJECT"] && !!process.env["GOOGLE_CLOUD_LOCATION"];
40228
40222
  const hasGoogleApiKey = !!process.env["GOOGLE_API_KEY"];
40229
40223
  if (!hasVertexProjectLocationConfig && !hasGoogleApiKey) {
@@ -40577,8 +40571,8 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
40577
40571
  }
40578
40572
  const envContent = formatEnvContent(nonSensitiveSettings);
40579
40573
  if (fsSync.existsSync(envFilePath)) {
40580
- const stat8 = fsSync.statSync(envFilePath);
40581
- if (stat8.isDirectory()) {
40574
+ const stat7 = fsSync.statSync(envFilePath);
40575
+ if (stat7.isDirectory()) {
40582
40576
  throw new Error(
40583
40577
  `Cannot write extension settings to ${envFilePath} because it is a directory.`
40584
40578
  );
@@ -40622,8 +40616,8 @@ async function getScopedEnvContents(extensionConfig, extensionId, scope, workspa
40622
40616
  const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
40623
40617
  let customEnv = {};
40624
40618
  if (fsSync.existsSync(envFilePath)) {
40625
- const stat8 = fsSync.statSync(envFilePath);
40626
- if (!stat8.isDirectory()) {
40619
+ const stat7 = fsSync.statSync(envFilePath);
40620
+ if (!stat7.isDirectory()) {
40627
40621
  const envFile = fsSync.readFileSync(envFilePath, "utf-8");
40628
40622
  customEnv = dotenv.parse(envFile);
40629
40623
  }
@@ -40691,8 +40685,8 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
40691
40685
  const envFilePath = getEnvFilePath(extensionName, scope, workspaceDir);
40692
40686
  let envContent = "";
40693
40687
  if (fsSync.existsSync(envFilePath)) {
40694
- const stat8 = fsSync.statSync(envFilePath);
40695
- if (stat8.isDirectory()) {
40688
+ const stat7 = fsSync.statSync(envFilePath);
40689
+ if (stat7.isDirectory()) {
40696
40690
  throw new Error(
40697
40691
  `Cannot write extension settings to ${envFilePath} because it is a directory.`
40698
40692
  );
@@ -40740,8 +40734,8 @@ function getSettingsChanges(settings, oldSettings) {
40740
40734
  }
40741
40735
  async function clearSettings(envFilePath, keychain) {
40742
40736
  if (fsSync.existsSync(envFilePath)) {
40743
- const stat8 = fsSync.statSync(envFilePath);
40744
- if (!stat8.isDirectory()) {
40737
+ const stat7 = fsSync.statSync(envFilePath);
40738
+ if (!stat7.isDirectory()) {
40745
40739
  await fs11.writeFile(envFilePath, "");
40746
40740
  }
40747
40741
  }
@@ -44650,7 +44644,7 @@ var ExtensionManager = class extends ExtensionLoader {
44650
44644
  const trustedFolders = loadTrustedFolders();
44651
44645
  await trustedFolders.setValue(
44652
44646
  this.workspaceDir,
44653
- TrustLevel.TRUST_FOLDER
44647
+ "TRUST_FOLDER" /* TRUST_FOLDER */
44654
44648
  );
44655
44649
  } else {
44656
44650
  throw new Error(
@@ -44836,7 +44830,7 @@ Would you like to attempt to install via "git clone" instead?`
44836
44830
  newExtensionConfig.version,
44837
44831
  previousExtensionConfig.version,
44838
44832
  installMetadata.type,
44839
- CoreToolCallStatus.Success
44833
+ "success" /* Success */
44840
44834
  )
44841
44835
  );
44842
44836
  if (newExtensionName !== previousName) {
@@ -44859,7 +44853,7 @@ Would you like to attempt to install via "git clone" instead?`
44859
44853
  getExtensionId(newExtensionConfig, installMetadata),
44860
44854
  newExtensionConfig.version,
44861
44855
  installMetadata.type,
44862
- CoreToolCallStatus.Success
44856
+ "success" /* Success */
44863
44857
  )
44864
44858
  );
44865
44859
  await this.enableExtension(
@@ -44892,7 +44886,7 @@ Would you like to attempt to install via "git clone" instead?`
44892
44886
  newExtensionConfig?.version ?? "",
44893
44887
  previousExtensionConfig.version,
44894
44888
  installMetadata.type,
44895
- CoreToolCallStatus.Error
44889
+ "error" /* Error */
44896
44890
  )
44897
44891
  );
44898
44892
  } else {
@@ -44904,7 +44898,7 @@ Would you like to attempt to install via "git clone" instead?`
44904
44898
  extensionId ?? "",
44905
44899
  newExtensionConfig?.version ?? "",
44906
44900
  installMetadata.type,
44907
- CoreToolCallStatus.Error
44901
+ "error" /* Error */
44908
44902
  )
44909
44903
  );
44910
44904
  }
@@ -44935,7 +44929,7 @@ Would you like to attempt to install via "git clone" instead?`
44935
44929
  extension.name,
44936
44930
  hashValue(extension.name),
44937
44931
  extension.id,
44938
- CoreToolCallStatus.Success
44932
+ "success" /* Success */
44939
44933
  )
44940
44934
  );
44941
44935
  }
@@ -45205,7 +45199,7 @@ Would you like to attempt to install via "git clone" instead?`
45205
45199
  if (eventHooks) {
45206
45200
  for (const definition of eventHooks) {
45207
45201
  for (const hook of definition.hooks) {
45208
- if (hook.type === HookType.Command) {
45202
+ if (hook.type === "command" /* Command */) {
45209
45203
  hook.env = { ...hook.env, ...hookEnv };
45210
45204
  }
45211
45205
  }
@@ -46236,7 +46230,7 @@ async function readMcpResources(resourceParts, config, signal) {
46236
46230
  callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
46237
46231
  name: `resources/read (${resource.serverName})`,
46238
46232
  description: resource.uri,
46239
- status: CoreToolCallStatus.Success,
46233
+ status: "success" /* Success */,
46240
46234
  isClientInitiated: true,
46241
46235
  resultDisplay: `Successfully read resource ${resource.uri}`,
46242
46236
  confirmationDetails: void 0
@@ -46251,7 +46245,7 @@ async function readMcpResources(resourceParts, config, signal) {
46251
46245
  callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
46252
46246
  name: `resources/read (${resource.serverName})`,
46253
46247
  description: resource.uri,
46254
- status: CoreToolCallStatus.Error,
46248
+ status: "error" /* Error */,
46255
46249
  isClientInitiated: true,
46256
46250
  resultDisplay: `Error reading resource ${resource.uri}: ${getErrorMessage(error)}`,
46257
46251
  confirmationDetails: void 0
@@ -46276,7 +46270,7 @@ Content from @${result.uri}:
46276
46270
  }
46277
46271
  if (hasError) {
46278
46272
  const firstError = displays.find(
46279
- (d) => d.status === CoreToolCallStatus.Error
46273
+ (d) => d.status === "error" /* Error */
46280
46274
  );
46281
46275
  return {
46282
46276
  parts: [],
@@ -46317,7 +46311,7 @@ async function readLocalFiles(resolvedFiles, config, signal, userMessageTimestam
46317
46311
  callId: `client-read-${userMessageTimestamp}`,
46318
46312
  name: readManyFilesTool.displayName,
46319
46313
  description: invocation.getDescription(),
46320
- status: CoreToolCallStatus.Success,
46314
+ status: "success" /* Success */,
46321
46315
  isClientInitiated: true,
46322
46316
  resultDisplay: result.returnDisplay || `Successfully read: ${fileLabelsForDisplay.join(", ")}`,
46323
46317
  confirmationDetails: void 0
@@ -46364,7 +46358,7 @@ Content from @${displayPath}:
46364
46358
  callId: `client-read-${userMessageTimestamp}`,
46365
46359
  name: readManyFilesTool.displayName,
46366
46360
  description: invocation?.getDescription() ?? "Error attempting to execute tool to read files",
46367
- status: CoreToolCallStatus.Error,
46361
+ status: "error" /* Error */,
46368
46362
  isClientInitiated: true,
46369
46363
  resultDisplay: `Error reading files (${fileLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,
46370
46364
  confirmationDetails: void 0
@@ -49631,7 +49625,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
49631
49625
  if (wasRaw) {
49632
49626
  setRawMode?.(true);
49633
49627
  }
49634
- coreEvents.emit(CoreEvent.ExternalEditorClosed);
49628
+ coreEvents.emit("external-editor-closed" /* ExternalEditorClosed */);
49635
49629
  }
49636
49630
  }
49637
49631
 
@@ -52326,7 +52320,7 @@ async function updateExtension(extension, extensionManager, currentState, dispat
52326
52320
  extension.name,
52327
52321
  installMetadata
52328
52322
  );
52329
- if (status === IntegrityDataStatus.INVALID) {
52323
+ if (status === "invalid" /* INVALID */) {
52330
52324
  throw new Error("Extension integrity cannot be verified");
52331
52325
  }
52332
52326
  } catch (e) {
@@ -53744,11 +53738,11 @@ var ShellProcessor = class {
53744
53738
  },
53745
53739
  void 0
53746
53740
  );
53747
- if (decision === PolicyDecision.DENY) {
53741
+ if (decision === "deny" /* DENY */) {
53748
53742
  throw new Error(
53749
53743
  `${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
53750
53744
  );
53751
- } else if (decision === PolicyDecision.ASK_USER) {
53745
+ } else if (decision === "ask_user" /* ASK_USER */) {
53752
53746
  commandsToConfirm.add(command);
53753
53747
  }
53754
53748
  }
@@ -54866,7 +54860,7 @@ var MultiFolderTrustDialog = ({
54866
54860
  if (choice === 1 /* YES_AND_REMEMBER */) {
54867
54861
  await trustedFolders.setValue(
54868
54862
  expandedPath,
54869
- TrustLevel.TRUST_FOLDER
54863
+ "TRUST_FOLDER" /* TRUST_FOLDER */
54870
54864
  );
54871
54865
  }
54872
54866
  workspaceContext.addDirectory(expandedPath);
@@ -56544,7 +56538,7 @@ var authCommand = {
56544
56538
  import process29 from "node:process";
56545
56539
 
56546
56540
  // packages/cli/src/generated/git-commit.ts
56547
- var GIT_COMMIT_INFO = "2404548cc";
56541
+ var GIT_COMMIT_INFO = "4d3dcdce1";
56548
56542
 
56549
56543
  // packages/cli/src/ui/utils/historyExportUtils.ts
56550
56544
  import * as fsPromises from "node:fs/promises";
@@ -57190,7 +57184,7 @@ var clearCommand = {
57190
57184
  const config = context.services.agentContext?.config;
57191
57185
  const hookSystem = config?.getHookSystem();
57192
57186
  if (hookSystem) {
57193
- await hookSystem.fireSessionEndEvent(SessionEndReason.Clear);
57187
+ await hookSystem.fireSessionEndEvent("clear" /* Clear */);
57194
57188
  }
57195
57189
  config?.injectionService.clear();
57196
57190
  let newSessionId;
@@ -57207,7 +57201,7 @@ var clearCommand = {
57207
57201
  }
57208
57202
  let result;
57209
57203
  if (hookSystem) {
57210
- result = await hookSystem.fireSessionStartEvent(SessionStartSource.Clear);
57204
+ result = await hookSystem.fireSessionStartEvent("clear" /* Clear */);
57211
57205
  }
57212
57206
  await new Promise((resolve9) => setImmediate(resolve9));
57213
57207
  if (config) {
@@ -60206,7 +60200,7 @@ var Footer = () => {
60206
60200
  case "auth": {
60207
60201
  if (!settings.merged.ui.showUserIdentity) break;
60208
60202
  if (!authType) break;
60209
- const displayStr = authType === AuthType.LOGIN_WITH_GOOGLE ? email ?? "google" : authType;
60203
+ const displayStr = authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? email ?? "google" : authType;
60210
60204
  addCol(
60211
60205
  id,
60212
60206
  header,
@@ -61974,12 +61968,12 @@ import path29 from "node:path";
61974
61968
  function getIdeStatusMessage(ideClient) {
61975
61969
  const connection = ideClient.getConnectionStatus();
61976
61970
  switch (connection.status) {
61977
- case IDEConnectionStatus.Connected:
61971
+ case "connected" /* Connected */:
61978
61972
  return {
61979
61973
  messageType: "info",
61980
61974
  content: `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`
61981
61975
  };
61982
- case IDEConnectionStatus.Connecting:
61976
+ case "connecting" /* Connecting */:
61983
61977
  return {
61984
61978
  messageType: "info",
61985
61979
  content: `\u{1F7E1} Connecting...`
@@ -62020,7 +62014,7 @@ ${infoMessage}`;
62020
62014
  async function getIdeStatusMessageWithFiles(ideClient) {
62021
62015
  const connection = ideClient.getConnectionStatus();
62022
62016
  switch (connection.status) {
62023
- case IDEConnectionStatus.Connected: {
62017
+ case "connected" /* Connected */: {
62024
62018
  let content = `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`;
62025
62019
  const context = ideContextStore.get();
62026
62020
  const openFiles = context?.workspaceState?.openFiles;
@@ -62032,7 +62026,7 @@ async function getIdeStatusMessageWithFiles(ideClient) {
62032
62026
  content
62033
62027
  };
62034
62028
  }
62035
- case IDEConnectionStatus.Connecting:
62029
+ case "connecting" /* Connecting */:
62036
62030
  return {
62037
62031
  messageType: "info",
62038
62032
  content: `\u{1F7E1} Connecting...`
@@ -62054,7 +62048,7 @@ async function setIdeModeAndSyncConnection(config, value, options = {}) {
62054
62048
  const ideClient = await IdeClient.getInstance();
62055
62049
  if (value) {
62056
62050
  await ideClient.connect(options);
62057
- logIdeConnection(config, new IdeConnectionEvent(IdeConnectionType.SESSION));
62051
+ logIdeConnection(config, new IdeConnectionEvent("session" /* SESSION */));
62058
62052
  } else {
62059
62053
  await ideClient.disconnect();
62060
62054
  }
@@ -62142,7 +62136,7 @@ var ideCommand = async () => {
62142
62136
  logToConsole: false
62143
62137
  }
62144
62138
  );
62145
- if (ideClient.getConnectionStatus().status === IDEConnectionStatus.Connected) {
62139
+ if (ideClient.getConnectionStatus().status === "connected" /* Connected */) {
62146
62140
  break;
62147
62141
  }
62148
62142
  await new Promise((resolve9) => setTimeout(resolve9, 500));
@@ -62219,7 +62213,7 @@ var ideCommand = async () => {
62219
62213
  }
62220
62214
  };
62221
62215
  const { status } = ideClient.getConnectionStatus();
62222
- const isConnected = status === IDEConnectionStatus.Connected;
62216
+ const isConnected = status === "connected" /* Connected */;
62223
62217
  if (isConnected) {
62224
62218
  ideSlashCommand.subCommands = [statusCommand2, disableCommand5];
62225
62219
  } else {
@@ -62319,13 +62313,13 @@ Use /mcp auth <server-name> to authenticate.`
62319
62313
  const displayListener = (message) => {
62320
62314
  context.ui.addItem({ type: "info", text: message });
62321
62315
  };
62322
- coreEvents.on(CoreEvent.OauthDisplayMessage, displayListener);
62316
+ coreEvents.on("oauth-display-message" /* OauthDisplayMessage */, displayListener);
62323
62317
  try {
62324
62318
  context.ui.addItem({
62325
62319
  type: "info",
62326
62320
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
62327
62321
  });
62328
- const { MCPOAuthProvider } = await import("./dist-PNS3BBFZ.js");
62322
+ const { MCPOAuthProvider } = await import("./core-6YK2A6I7.js");
62329
62323
  let oauthConfig = server.oauth;
62330
62324
  if (!oauthConfig) {
62331
62325
  oauthConfig = { enabled: false };
@@ -62362,7 +62356,7 @@ Use /mcp auth <server-name> to authenticate.`
62362
62356
  content: `Failed to authenticate with MCP server '${serverName}': ${getErrorMessage(error)}`
62363
62357
  };
62364
62358
  } finally {
62365
- coreEvents.removeListener(CoreEvent.OauthDisplayMessage, displayListener);
62359
+ coreEvents.removeListener("oauth-display-message" /* OauthDisplayMessage */, displayListener);
62366
62360
  }
62367
62361
  },
62368
62362
  completion: async (context, partialArg) => {
@@ -62408,10 +62402,10 @@ var listAction2 = async (context, showDescriptions = false, showSchema = false,
62408
62402
  }
62409
62403
  const serverNames = Object.keys(mcpServers);
62410
62404
  const connectingServers = serverNames.filter(
62411
- (name) => getMCPServerStatus(name) === MCPServerStatus.CONNECTING
62405
+ (name) => getMCPServerStatus(name) === "connecting" /* CONNECTING */
62412
62406
  );
62413
62407
  const discoveryState = getMCPDiscoveryState();
62414
- const discoveryInProgress = discoveryState === MCPDiscoveryState.IN_PROGRESS || connectingServers.length > 0;
62408
+ const discoveryInProgress = discoveryState === "in_progress" /* IN_PROGRESS */ || connectingServers.length > 0;
62415
62409
  const allTools = toolRegistry.getAllTools();
62416
62410
  const mcpTools = allTools.filter((tool) => tool instanceof DiscoveredMCPTool);
62417
62411
  const promptRegistry = config.getPromptRegistry();
@@ -78169,7 +78163,7 @@ Return a JSON object with:
78169
78163
  },
78170
78164
  abortSignal: new AbortController().signal,
78171
78165
  promptId: "triage-duplicates",
78172
- role: LlmRole.UTILITY_TOOL
78166
+ role: "utility_tool" /* UTILITY_TOOL */
78173
78167
  });
78174
78168
  const rec = response;
78175
78169
  let canonical;
@@ -79003,7 +78997,7 @@ Return a JSON object with:
79003
78997
  },
79004
78998
  abortSignal: abortControllerRef.current.signal,
79005
78999
  promptId: "triage-issues",
79006
- role: LlmRole.UTILITY_TOOL
79000
+ role: "utility_tool" /* UTILITY_TOOL */
79007
79001
  });
79008
79002
  return response;
79009
79003
  },
@@ -79577,8 +79571,8 @@ var planCommand = {
79577
79571
  return;
79578
79572
  }
79579
79573
  const previousApprovalMode = config.getApprovalMode();
79580
- config.setApprovalMode(ApprovalMode.PLAN);
79581
- if (previousApprovalMode !== ApprovalMode.PLAN) {
79574
+ config.setApprovalMode("plan" /* PLAN */);
79575
+ if (previousApprovalMode !== "plan" /* PLAN */) {
79582
79576
  coreEvents.emitFeedback("info", "Switched to Plan Mode.");
79583
79577
  }
79584
79578
  if (context.invocation?.args) {
@@ -79637,10 +79631,10 @@ var categorizeRulesByMode = (rules) => {
79637
79631
  rules.forEach((rule) => {
79638
79632
  const modes = rule.modes?.length ? rule.modes : ALL_MODES;
79639
79633
  const modeSet = new Set(modes);
79640
- if (modeSet.has(ApprovalMode.DEFAULT)) result.normal.push(rule);
79641
- if (modeSet.has(ApprovalMode.AUTO_EDIT)) result.autoEdit.push(rule);
79642
- if (modeSet.has(ApprovalMode.YOLO)) result.yolo.push(rule);
79643
- if (modeSet.has(ApprovalMode.PLAN)) result.plan.push(rule);
79634
+ if (modeSet.has("default" /* DEFAULT */)) result.normal.push(rule);
79635
+ if (modeSet.has("autoEdit" /* AUTO_EDIT */)) result.autoEdit.push(rule);
79636
+ if (modeSet.has("yolo" /* YOLO */)) result.yolo.push(rule);
79637
+ if (modeSet.has("plan" /* PLAN */)) result.plan.push(rule);
79644
79638
  });
79645
79639
  return result;
79646
79640
  };
@@ -80166,6 +80160,12 @@ function renderSkillActionFeedback(result, formatScope) {
80166
80160
  const s3 = formatScopeItem(totalAffectedScopes[0]);
80167
80161
  return `Skill "${skillName}" ${actionVerb} ${preposition} ${s3} settings.`;
80168
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
+ }
80169
80169
  async function installSkill(source2, scope, subpath, onLog, requestConsent = () => Promise.resolve(true)) {
80170
80170
  let sourcePath = source2;
80171
80171
  let tempDirToClean = void 0;
@@ -80197,8 +80197,12 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
80197
80197
  sourcePath = path36.join(sourcePath, subpath);
80198
80198
  }
80199
80199
  sourcePath = path36.resolve(sourcePath);
80200
- if (tempDirToClean && !sourcePath.startsWith(path36.resolve(tempDirToClean))) {
80201
- 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
+ }
80202
80206
  }
80203
80207
  onLog(`Searching for skills in ${sourcePath}...`);
80204
80208
  const skills = await loadSkillsFromDir(sourcePath);
@@ -80213,13 +80217,18 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
80213
80217
  if (!await requestConsent(skills, targetDir)) {
80214
80218
  throw new Error("Skill installation cancelled by user.");
80215
80219
  }
80216
- await fs36.mkdir(targetDir, { recursive: true });
80220
+ const resolvedTarget = path36.resolve(targetDir);
80221
+ await fs36.mkdir(resolvedTarget, { recursive: true });
80217
80222
  const installedSkills = [];
80218
80223
  for (const skill of skills) {
80219
80224
  const skillName = skill.name;
80220
80225
  const skillDir = path36.dirname(skill.location);
80221
- const destPath = path36.join(targetDir, skillName);
80222
- 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);
80223
80232
  if (exists) {
80224
80233
  onLog(`Skill "${skillName}" already exists. Overwriting...`);
80225
80234
  await fs36.rm(destPath, { recursive: true, force: true });
@@ -80260,12 +80269,17 @@ async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.r
80260
80269
  if (!await requestConsent(skills, targetDir)) {
80261
80270
  throw new Error("Skill linking cancelled by user.");
80262
80271
  }
80263
- await fs36.mkdir(targetDir, { recursive: true });
80272
+ const resolvedTarget = path36.resolve(targetDir);
80273
+ await fs36.mkdir(resolvedTarget, { recursive: true });
80264
80274
  const linkedSkills = [];
80265
80275
  for (const skill of skills) {
80266
80276
  const skillName = skill.name;
80267
80277
  const skillSourceDir = path36.dirname(skill.location);
80268
- 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
+ }
80269
80283
  const exists = await fs36.lstat(destPath).catch(() => null);
80270
80284
  if (exists) {
80271
80285
  onLog(
@@ -80286,11 +80300,13 @@ async function uninstallSkill(name, scope) {
80286
80300
  const workspaceDir = process.cwd();
80287
80301
  const storage = new Storage(workspaceDir);
80288
80302
  const targetDir = scope === "workspace" ? storage.getProjectSkillsDir() : Storage.getUserSkillsDir();
80289
- const discoveredSkills = await loadSkillsFromDir(targetDir);
80303
+ const resolvedTarget = path36.resolve(targetDir);
80304
+ const discoveredSkills = await loadSkillsFromDir(resolvedTarget);
80290
80305
  const skillToUninstall = discoveredSkills.find((s3) => s3.name === name);
80291
80306
  if (!skillToUninstall) {
80292
- const skillPath = path36.resolve(targetDir, name);
80293
- if (!skillPath.startsWith(path36.resolve(targetDir))) {
80307
+ const skillPath = path36.resolve(resolvedTarget, name);
80308
+ const relative4 = path36.relative(resolvedTarget, skillPath);
80309
+ if (isInvalidSubpath(relative4)) {
80294
80310
  return null;
80295
80311
  }
80296
80312
  const exists = await fs36.lstat(skillPath).catch(() => null);
@@ -80300,7 +80316,11 @@ async function uninstallSkill(name, scope) {
80300
80316
  await fs36.rm(skillPath, { recursive: true, force: true });
80301
80317
  return { location: skillPath };
80302
80318
  }
80303
- 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
+ }
80304
80324
  await fs36.rm(skillDir, { recursive: true, force: true });
80305
80325
  return { location: skillDir };
80306
80326
  }
@@ -80992,7 +81012,7 @@ var upgradeCommand = {
80992
81012
  action: async (context) => {
80993
81013
  const config = context.services.agentContext?.config;
80994
81014
  const authType = config?.getContentGeneratorConfig()?.authType;
80995
- if (authType !== AuthType.LOGIN_WITH_GOOGLE) {
81015
+ if (authType !== "oauth-personal" /* LOGIN_WITH_GOOGLE */) {
80996
81016
  return {
80997
81017
  type: "message",
80998
81018
  messageType: "error",
@@ -81221,7 +81241,7 @@ var BuiltinCommandLoader = class {
81221
81241
  setupGithubCommand,
81222
81242
  terminalSetupCommand,
81223
81243
  ...this.config?.isVoiceModeEnabled() ? [voiceCommand] : [],
81224
- ...this.config?.getContentGeneratorConfig()?.authType === AuthType.LOGIN_WITH_GOOGLE ? [upgradeCommand] : []
81244
+ ...this.config?.getContentGeneratorConfig()?.authType === "oauth-personal" /* LOGIN_WITH_GOOGLE */ ? [upgradeCommand] : []
81225
81245
  ];
81226
81246
  handle?.end();
81227
81247
  return allDefinitions.filter((cmd) => cmd !== null);
@@ -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-DV5H7HVO.js";
4
+ } from "./chunk-GOJGZJTT.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -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-ERRTQLZ3.js";
5
+ } from "./chunk-LHJYE2I2.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-4FWMMTHD.js";
17
+ } from "./chunk-KRCY6JZY.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-GSKH763B.js";
20
+ } from "./chunk-NELP7HPM.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";