@google/gemini-cli 0.42.0 → 0.43.0-preview.1

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 (80) hide show
  1. package/bundle/{chunk-3IS7GD6D.js → chunk-3BNJIKEP.js} +3 -3
  2. package/bundle/{chunk-EDKX67D6.js → chunk-4G3X2H3F.js} +34 -16
  3. package/bundle/{chunk-FCAODPNO.js → chunk-4SLX6GS6.js} +486 -381
  4. package/bundle/{chunk-COKAF5GM.js → chunk-4ZT3EIBI.js} +2 -2
  5. package/bundle/{chunk-NTOPH4WG.js → chunk-6YMGRLOQ.js} +2 -2
  6. package/bundle/{chunk-QOZSZYL7.js → chunk-CKPZGEE3.js} +3 -3
  7. package/bundle/{chunk-G2VTSEZ6.js → chunk-CZPVSLJF.js} +1 -1
  8. package/bundle/{chunk-PUDLNWHE.js → chunk-DJCG6GWZ.js} +3 -3
  9. package/bundle/{chunk-I7AME6VC.js → chunk-ERQUIEOO.js} +9 -8
  10. package/bundle/{chunk-XUMRUXOT.js → chunk-EWAAFVBK.js} +41 -20
  11. package/bundle/{chunk-LATVEETM.js → chunk-F7PEGIBA.js} +2 -2
  12. package/bundle/{chunk-KVEAHIIV.js → chunk-ICOPZSVB.js} +3 -3
  13. package/bundle/{chunk-BCYBA52D.js → chunk-IF5BAOVJ.js} +34 -16
  14. package/bundle/chunk-KILFUY3Y.js +512 -0
  15. package/bundle/{chunk-CYEIWMZJ.js → chunk-L4LBKMR6.js} +1 -1
  16. package/bundle/{chunk-4SLGT6YD.js → chunk-LTFEPQ67.js} +1 -1
  17. package/bundle/{chunk-7C6GGDK6.js → chunk-LTSFEC7U.js} +3 -3
  18. package/bundle/{chunk-7VVHSNDQ.js → chunk-MRVZNBXY.js} +1907 -716
  19. package/bundle/{chunk-COQP2M4D.js → chunk-N3MLU4IQ.js} +546 -428
  20. package/bundle/{chunk-ECNYAST2.js → chunk-N6QYTC2T.js} +5417 -5376
  21. package/bundle/{chunk-DN4XSYRG.js → chunk-NDSJWRFE.js} +8640 -13347
  22. package/bundle/{chunk-DMWX7UP6.js → chunk-NG2WIKH5.js} +2170 -791
  23. package/bundle/chunk-PLEERNRJ.js +156 -0
  24. package/bundle/{chunk-ZNMQA242.js → chunk-QAQT56LH.js} +3 -3
  25. package/bundle/{chunk-WIXUKOZA.js → chunk-S36EONMM.js} +1 -1
  26. package/bundle/chunk-UB4AWMZC.js +391 -0
  27. package/bundle/{chunk-CHERUG6W.js → chunk-UBCHSKF2.js} +486 -381
  28. package/bundle/{chunk-JEW7ZIWE.js → chunk-UJ26GAE5.js} +5326 -5290
  29. package/bundle/chunk-ULCEBJMK.js +17248 -0
  30. package/bundle/chunk-UUHMEKLA.js +357199 -0
  31. package/bundle/chunk-UW3H4T6A.js +1571 -0
  32. package/bundle/{chunk-GA527JB7.js → chunk-VSTO23O2.js} +1 -1
  33. package/bundle/chunk-XKIM3BNI.js +118 -0
  34. package/bundle/chunk-YIHNW7CC.js +81649 -0
  35. package/bundle/{cleanup-3RILFNVM.js → cleanup-BMLCC7SO.js} +3 -3
  36. package/bundle/{cleanup-SVRKYBR6.js → cleanup-LMJA4J5S.js} +3 -3
  37. package/bundle/{cleanup-XFVHHDVO.js → cleanup-M7RSLDBR.js} +3 -3
  38. package/bundle/cleanup-NMUMRIEF.js +33 -0
  39. package/bundle/{core-FRVSDP2C.js → core-WXTAU5UX.js} +30 -2
  40. package/bundle/{devtoolsService-RUEO5PGP.js → devtoolsService-2L5U47ZQ.js} +3 -3
  41. package/bundle/{devtoolsService-VM2WTHBX.js → devtoolsService-6THA6GNX.js} +3 -3
  42. package/bundle/{devtoolsService-TRDGMQLJ.js → devtoolsService-J2AC6YXM.js} +5 -4
  43. package/bundle/devtoolsService-SRWIME2Q.js +857 -0
  44. package/bundle/{dist-6BN2CJPN.js → dist-DIIMIT2U.js} +30 -2
  45. package/bundle/{core-B5S6HZJT.js → dist-MXL7ZG46.js} +30 -2
  46. package/bundle/dist-POIHCQVM.js +2124 -0
  47. package/bundle/docs/changelogs/index.md +14 -0
  48. package/bundle/docs/changelogs/latest.md +108 -166
  49. package/bundle/docs/changelogs/preview.md +227 -103
  50. package/bundle/docs/cli/auto-memory.md +60 -38
  51. package/bundle/docs/cli/settings.md +1 -1
  52. package/bundle/docs/cli/tutorials/memory-management.md +1 -1
  53. package/bundle/docs/extensions/releasing.md +58 -24
  54. package/bundle/docs/reference/configuration.md +14 -1
  55. package/bundle/docs/reference/keyboard-shortcuts.md +23 -0
  56. package/bundle/{gemini-GHUELHBF.js → gemini-D32FDZXN.js} +160 -60
  57. package/bundle/{gemini-QSTQ2DBG.js → gemini-DLZ2R4X7.js} +160 -60
  58. package/bundle/{gemini-NQPVX5JC.js → gemini-HYQU2RK2.js} +345 -231
  59. package/bundle/gemini-JJG7ZGWB.js +16356 -0
  60. package/bundle/gemini.js +8 -8
  61. package/bundle/{interactiveCli-AG2YWL2O.js → interactiveCli-DHMPW4RS.js} +1704 -1457
  62. package/bundle/{interactiveCli-MZFG35NB.js → interactiveCli-K7ETWJMN.js} +1986 -1721
  63. package/bundle/{interactiveCli-453M2IVE.js → interactiveCli-NR7OUF3G.js} +1703 -1457
  64. package/bundle/interactiveCli-X4AUP7T7.js +34752 -0
  65. package/bundle/{liteRtServerManager-G4Q7OVBX.js → liteRtServerManager-L7C3D5RL.js} +5 -5
  66. package/bundle/{liteRtServerManager-S7WL25VD.js → liteRtServerManager-PKRLUK2P.js} +5 -5
  67. package/bundle/{liteRtServerManager-BXQ6VVWP.js → liteRtServerManager-TEBDIGEN.js} +5 -5
  68. package/bundle/liteRtServerManager-UPCAT7Z2.js +66 -0
  69. package/bundle/{memoryDiscovery-KSYZVCWF.js → memoryDiscovery-LLSKN6HL.js} +1 -1
  70. package/bundle/{memoryDiscovery-FB7MMKTA.js → memoryDiscovery-SJ7P6RCN.js} +1 -1
  71. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  72. package/bundle/{oauth2-provider-H7G6RSFW.js → oauth2-provider-52IJKUJI.js} +2 -2
  73. package/bundle/{oauth2-provider-VR4DL6AL.js → oauth2-provider-OPOTTZ5C.js} +2 -2
  74. package/bundle/{oauth2-provider-5UF5WEE2.js → oauth2-provider-TOAKXOL7.js} +39 -73
  75. package/bundle/oauth2-provider-WN4YIDA4.js +237 -0
  76. package/bundle/{start-CQBSKFYB.js → start-6KIIUSAH.js} +7 -7
  77. package/bundle/{start-NIMXQJYB.js → start-7ZNSGJD6.js} +7 -7
  78. package/bundle/{start-2SKRN43X.js → start-EPIILWLN.js} +7 -7
  79. package/bundle/start-TMFPUYEL.js +19 -0
  80. package/package.json +1 -1
@@ -4,10 +4,10 @@ import {
4
4
  isTelemetrySdkInitialized,
5
5
  resetBrowserSession,
6
6
  shutdownTelemetry
7
- } from "./chunk-7VVHSNDQ.js";
7
+ } from "./chunk-NG2WIKH5.js";
8
8
  import {
9
9
  Storage
10
- } from "./chunk-JEW7ZIWE.js";
10
+ } from "./chunk-N6QYTC2T.js";
11
11
 
12
12
  // packages/cli/src/utils/cleanup.ts
13
13
  import { promises as fs } from "node:fs";
@@ -4,10 +4,10 @@ import {
4
4
  isTelemetrySdkInitialized,
5
5
  resetBrowserSession,
6
6
  shutdownTelemetry
7
- } from "./chunk-DMWX7UP6.js";
7
+ } from "./chunk-NDSJWRFE.js";
8
8
  import {
9
9
  Storage
10
- } from "./chunk-ECNYAST2.js";
10
+ } from "./chunk-UJ26GAE5.js";
11
11
 
12
12
  // packages/cli/src/utils/cleanup.ts
13
13
  import { promises as fs } from "node:fs";
@@ -1,15 +1,15 @@
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-COKAF5GM.js";
4
+ } from "./chunk-4ZT3EIBI.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  getChannelFromVersion,
8
8
  isGitRepository
9
- } from "./chunk-7VVHSNDQ.js";
9
+ } from "./chunk-NG2WIKH5.js";
10
10
  import {
11
11
  debugLogger
12
- } from "./chunk-JEW7ZIWE.js";
12
+ } from "./chunk-N6QYTC2T.js";
13
13
 
14
14
  // packages/cli/src/utils/installationInfo.ts
15
15
  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
  CoreToolCallStatus,
4
4
  checkExhaustive
5
- } from "./chunk-7VVHSNDQ.js";
5
+ } from "./chunk-NDSJWRFE.js";
6
6
  import {
7
7
  __commonJS,
8
8
  __toESM
@@ -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-4SLGT6YD.js";
5
+ } from "./chunk-L4LBKMR6.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-EDKX67D6.js";
17
+ } from "./chunk-ULCEBJMK.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-JEW7ZIWE.js";
20
+ } from "./chunk-UJ26GAE5.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -1,7 +1,8 @@
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
+ CoreToolCallStatus,
3
4
  checkExhaustive
4
- } from "./chunk-DMWX7UP6.js";
5
+ } from "./chunk-UUHMEKLA.js";
5
6
  import {
6
7
  __commonJS,
7
8
  __toESM
@@ -464,19 +465,19 @@ var require_react = __commonJS({
464
465
  var import_react = __toESM(require_react(), 1);
465
466
  function mapCoreStatusToDisplayStatus(coreStatus) {
466
467
  switch (coreStatus) {
467
- case "validating" /* Validating */:
468
+ case CoreToolCallStatus.Validating:
468
469
  return "Pending" /* Pending */;
469
- case "awaiting_approval" /* AwaitingApproval */:
470
+ case CoreToolCallStatus.AwaitingApproval:
470
471
  return "Confirming" /* Confirming */;
471
- case "executing" /* Executing */:
472
+ case CoreToolCallStatus.Executing:
472
473
  return "Executing" /* Executing */;
473
- case "success" /* Success */:
474
+ case CoreToolCallStatus.Success:
474
475
  return "Success" /* Success */;
475
- case "cancelled" /* Cancelled */:
476
+ case CoreToolCallStatus.Cancelled:
476
477
  return "Canceled" /* Canceled */;
477
- case "error" /* Error */:
478
+ case CoreToolCallStatus.Error:
478
479
  return "Error" /* Error */;
479
- case "scheduled" /* Scheduled */:
480
+ case CoreToolCallStatus.Scheduled:
480
481
  return "Pending" /* Pending */;
481
482
  default:
482
483
  return checkExhaustive(coreStatus);
@@ -1,6 +1,8 @@
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
  AuthProviderType,
4
+ AuthType,
5
+ CoreToolCallStatus,
4
6
  DEFAULT_MODEL_CONFIGS,
5
7
  DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
6
8
  SESSION_FILE_PREFIX,
@@ -20,8 +22,9 @@ import {
20
22
  require_strip_json_comments,
21
23
  sanitizeFilenamePart,
22
24
  stripAnsi
23
- } from "./chunk-DN4XSYRG.js";
25
+ } from "./chunk-NDSJWRFE.js";
24
26
  import {
27
+ CoreEvent,
25
28
  FatalConfigError,
26
29
  GEMINI_DIR,
27
30
  Storage,
@@ -30,7 +33,7 @@ import {
30
33
  external_exports,
31
34
  getErrorMessage,
32
35
  homedir
33
- } from "./chunk-ECNYAST2.js";
36
+ } from "./chunk-UJ26GAE5.js";
34
37
  import {
35
38
  __commonJS,
36
39
  __require,
@@ -9959,9 +9962,13 @@ var getAllSessionFiles = async (chatsDir, currentSessionId, options = {}) => {
9959
9962
  if (!content) {
9960
9963
  return { fileName: file, sessionInfo: null };
9961
9964
  }
9962
- if (!content.sessionId || !content.startTime || !content.lastUpdated) {
9965
+ if (!content.sessionId) {
9963
9966
  return { fileName: file, sessionInfo: null };
9964
9967
  }
9968
+ const fileTimestamp = !content.startTime || !content.lastUpdated ? (await fs.stat(filePath).catch(() => void 0))?.mtime.toISOString() : void 0;
9969
+ const fallbackTimestamp = fileTimestamp ?? (/* @__PURE__ */ new Date()).toISOString();
9970
+ const startTime = content.startTime || content.lastUpdated || fallbackTimestamp;
9971
+ const lastUpdated = content.lastUpdated || content.startTime || fallbackTimestamp;
9965
9972
  if (!content.hasUserOrAssistantMessage) {
9966
9973
  return { fileName: file, sessionInfo: null };
9967
9974
  }
@@ -9983,8 +9990,8 @@ var getAllSessionFiles = async (chatsDir, currentSessionId, options = {}) => {
9983
9990
  id: content.sessionId,
9984
9991
  file: file.replace(/\.jsonl?$/, ""),
9985
9992
  fileName: file,
9986
- startTime: content.startTime,
9987
- lastUpdated: content.lastUpdated,
9993
+ startTime,
9994
+ lastUpdated,
9988
9995
  messageCount: content.messageCount ?? content.messages.length,
9989
9996
  displayName: content.summary ? stripUnsafeCharacters(content.summary) : firstUserMessage,
9990
9997
  firstUserMessage,
@@ -10138,10 +10145,15 @@ var SessionSelector = class {
10138
10145
  if (!sessionData) {
10139
10146
  throw new Error("Failed to load session data");
10140
10147
  }
10148
+ const normalizedSessionData = {
10149
+ ...sessionData,
10150
+ startTime: sessionData.startTime || sessionInfo.startTime,
10151
+ lastUpdated: sessionData.lastUpdated || sessionInfo.lastUpdated
10152
+ };
10141
10153
  const displayInfo = `Session ${sessionInfo.index}: ${sessionInfo.firstUserMessage} (${sessionInfo.messageCount} messages, ${formatRelativeTime(sessionInfo.lastUpdated)})`;
10142
10154
  return {
10143
10155
  sessionPath,
10144
- sessionData,
10156
+ sessionData: normalizedSessionData,
10145
10157
  displayInfo
10146
10158
  };
10147
10159
  } catch (error) {
@@ -10205,7 +10217,7 @@ function convertSessionToHistoryFormats(messages) {
10205
10217
  args: tool.args,
10206
10218
  description: tool.description || "",
10207
10219
  renderOutputAsMarkdown: tool.renderOutputAsMarkdown ?? true,
10208
- status: tool.status === "success" ? "success" /* Success */ : "error" /* Error */,
10220
+ status: tool.status === "success" ? CoreToolCallStatus.Success : CoreToolCallStatus.Error,
10209
10221
  resultDisplay: tool.resultDisplay,
10210
10222
  confirmationDetails: void 0
10211
10223
  }))
@@ -10528,8 +10540,8 @@ async function cleanupToolOutputFiles(settings, debugMode = false, projectTempDi
10528
10540
  files.map(async (file) => {
10529
10541
  try {
10530
10542
  const filePath = path2.join(toolOutputDir, file.name);
10531
- const stat2 = await fs2.stat(filePath);
10532
- return { name: file.name, mtime: stat2.mtime };
10543
+ const stat3 = await fs2.stat(filePath);
10544
+ return { name: file.name, mtime: stat3.mtime };
10533
10545
  } catch (error) {
10534
10546
  debugLogger.debug(
10535
10547
  `Failed to stat file ${file.name}: ${error instanceof Error ? error.message : "Unknown error"}`
@@ -10582,12 +10594,12 @@ async function cleanupToolOutputFiles(settings, debugMode = false, projectTempDi
10582
10594
  continue;
10583
10595
  }
10584
10596
  const subdirPath = path2.join(toolOutputDir, subdir.name);
10585
- const stat2 = await fs2.stat(subdirPath);
10597
+ const stat3 = await fs2.stat(subdirPath);
10586
10598
  let shouldDelete = false;
10587
10599
  if (retentionConfig.maxAge) {
10588
10600
  const maxAgeMs = parseRetentionPeriod(retentionConfig.maxAge);
10589
10601
  const cutoffDate = new Date(now.getTime() - maxAgeMs);
10590
- if (stat2.mtime < cutoffDate) {
10602
+ if (stat3.mtime < cutoffDate) {
10591
10603
  shouldDelete = true;
10592
10604
  }
10593
10605
  }
@@ -14265,7 +14277,7 @@ var SETTINGS_SCHEMA = {
14265
14277
  label: "Voice Stop Grace Period (ms)",
14266
14278
  category: "Experimental",
14267
14279
  requiresRestart: false,
14268
- default: 1e3,
14280
+ default: 4e3,
14269
14281
  description: "How long to wait for final transcription after stopping recording.",
14270
14282
  showInDialog: true
14271
14283
  }
@@ -16172,6 +16184,14 @@ var LoadedSettings = class {
16172
16184
  get merged() {
16173
16185
  return this._merged;
16174
16186
  }
16187
+ /**
16188
+ * Returns a merged settings object as if the folder were trusted.
16189
+ * This is useful for commands like 'mcp list' that want to show
16190
+ * what's configured even if it's currently disabled for security reasons.
16191
+ */
16192
+ getMergedSettingsAsIfTrusted() {
16193
+ return this.computeMergedSettings(true);
16194
+ }
16175
16195
  setTrusted(isTrusted) {
16176
16196
  if (this.isTrusted === isTrusted) {
16177
16197
  return;
@@ -16188,13 +16208,15 @@ var LoadedSettings = class {
16188
16208
  originalSettings: {}
16189
16209
  };
16190
16210
  }
16191
- computeMergedSettings() {
16211
+ computeMergedSettings(forceTrusted = false) {
16212
+ const isTrusted = forceTrusted || this.isTrusted;
16213
+ const workspace = forceTrusted ? this._workspaceFile : this.workspace;
16192
16214
  const merged = mergeSettings(
16193
16215
  this.system.settings,
16194
16216
  this.systemDefaults.settings,
16195
16217
  this.user.settings,
16196
- this.workspace.settings,
16197
- this.isTrusted
16218
+ workspace.settings,
16219
+ isTrusted
16198
16220
  );
16199
16221
  const adminSettingSchema = getSettingsSchema().admin;
16200
16222
  if (adminSettingSchema?.properties) {
@@ -16210,8 +16232,7 @@ var LoadedSettings = class {
16210
16232
  }
16211
16233
  computeSnapshot() {
16212
16234
  const cloneSettingsFile = (file) => ({
16213
- path: file.path,
16214
- rawJson: file.rawJson,
16235
+ ...file,
16215
16236
  settings: structuredClone(file.settings),
16216
16237
  originalSettings: structuredClone(file.originalSettings)
16217
16238
  });
@@ -16229,8 +16250,8 @@ var LoadedSettings = class {
16229
16250
  // React will pass a listener fn into this subscribe fn
16230
16251
  // that listener fn will perform an object identity check on the snapshot and trigger a React re render if the snapshot has changed
16231
16252
  subscribe(listener) {
16232
- coreEvents.on("settings-changed" /* SettingsChanged */, listener);
16233
- return () => coreEvents.off("settings-changed" /* SettingsChanged */, listener);
16253
+ coreEvents.on(CoreEvent.SettingsChanged, listener);
16254
+ return () => coreEvents.off(CoreEvent.SettingsChanged, listener);
16234
16255
  }
16235
16256
  getSnapshot() {
16236
16257
  return this._snapshot;
@@ -16333,7 +16354,7 @@ function setUpCloudShellEnvironment(envFilePath, isTrusted, isSandboxed, selecte
16333
16354
  }
16334
16355
  }
16335
16356
  let value = "cloudshell-gca";
16336
- if (selectedAuthType === "vertex-ai" /* USE_VERTEX_AI */) {
16357
+ if (selectedAuthType === AuthType.USE_VERTEX_AI) {
16337
16358
  value = process2.env[USER_GCP_PROJECT];
16338
16359
  }
16339
16360
  if (envFilePath && fs4.existsSync(envFilePath)) {
@@ -4,10 +4,10 @@ import {
4
4
  isTelemetrySdkInitialized,
5
5
  resetBrowserSession,
6
6
  shutdownTelemetry
7
- } from "./chunk-DN4XSYRG.js";
7
+ } from "./chunk-MRVZNBXY.js";
8
8
  import {
9
9
  Storage
10
- } from "./chunk-ECNYAST2.js";
10
+ } from "./chunk-UJ26GAE5.js";
11
11
 
12
12
  // packages/cli/src/utils/cleanup.ts
13
13
  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-CYEIWMZJ.js";
5
+ } from "./chunk-LTFEPQ67.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-BCYBA52D.js";
17
+ } from "./chunk-EWAAFVBK.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-ECNYAST2.js";
20
+ } from "./chunk-UJ26GAE5.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -20,7 +20,7 @@ import {
20
20
  require_strip_json_comments,
21
21
  sanitizeFilenamePart,
22
22
  stripAnsi
23
- } from "./chunk-DMWX7UP6.js";
23
+ } from "./chunk-NG2WIKH5.js";
24
24
  import {
25
25
  FatalConfigError,
26
26
  GEMINI_DIR,
@@ -30,7 +30,7 @@ import {
30
30
  external_exports,
31
31
  getErrorMessage,
32
32
  homedir
33
- } from "./chunk-ECNYAST2.js";
33
+ } from "./chunk-N6QYTC2T.js";
34
34
  import {
35
35
  __commonJS,
36
36
  __require,
@@ -9959,9 +9959,13 @@ var getAllSessionFiles = async (chatsDir, currentSessionId, options = {}) => {
9959
9959
  if (!content) {
9960
9960
  return { fileName: file, sessionInfo: null };
9961
9961
  }
9962
- if (!content.sessionId || !content.startTime || !content.lastUpdated) {
9962
+ if (!content.sessionId) {
9963
9963
  return { fileName: file, sessionInfo: null };
9964
9964
  }
9965
+ const fileTimestamp = !content.startTime || !content.lastUpdated ? (await fs.stat(filePath).catch(() => void 0))?.mtime.toISOString() : void 0;
9966
+ const fallbackTimestamp = fileTimestamp ?? (/* @__PURE__ */ new Date()).toISOString();
9967
+ const startTime = content.startTime || content.lastUpdated || fallbackTimestamp;
9968
+ const lastUpdated = content.lastUpdated || content.startTime || fallbackTimestamp;
9965
9969
  if (!content.hasUserOrAssistantMessage) {
9966
9970
  return { fileName: file, sessionInfo: null };
9967
9971
  }
@@ -9983,8 +9987,8 @@ var getAllSessionFiles = async (chatsDir, currentSessionId, options = {}) => {
9983
9987
  id: content.sessionId,
9984
9988
  file: file.replace(/\.jsonl?$/, ""),
9985
9989
  fileName: file,
9986
- startTime: content.startTime,
9987
- lastUpdated: content.lastUpdated,
9990
+ startTime,
9991
+ lastUpdated,
9988
9992
  messageCount: content.messageCount ?? content.messages.length,
9989
9993
  displayName: content.summary ? stripUnsafeCharacters(content.summary) : firstUserMessage,
9990
9994
  firstUserMessage,
@@ -10138,10 +10142,15 @@ var SessionSelector = class {
10138
10142
  if (!sessionData) {
10139
10143
  throw new Error("Failed to load session data");
10140
10144
  }
10145
+ const normalizedSessionData = {
10146
+ ...sessionData,
10147
+ startTime: sessionData.startTime || sessionInfo.startTime,
10148
+ lastUpdated: sessionData.lastUpdated || sessionInfo.lastUpdated
10149
+ };
10141
10150
  const displayInfo = `Session ${sessionInfo.index}: ${sessionInfo.firstUserMessage} (${sessionInfo.messageCount} messages, ${formatRelativeTime(sessionInfo.lastUpdated)})`;
10142
10151
  return {
10143
10152
  sessionPath,
10144
- sessionData,
10153
+ sessionData: normalizedSessionData,
10145
10154
  displayInfo
10146
10155
  };
10147
10156
  } catch (error) {
@@ -10528,8 +10537,8 @@ async function cleanupToolOutputFiles(settings, debugMode = false, projectTempDi
10528
10537
  files.map(async (file) => {
10529
10538
  try {
10530
10539
  const filePath = path2.join(toolOutputDir, file.name);
10531
- const stat2 = await fs2.stat(filePath);
10532
- return { name: file.name, mtime: stat2.mtime };
10540
+ const stat3 = await fs2.stat(filePath);
10541
+ return { name: file.name, mtime: stat3.mtime };
10533
10542
  } catch (error) {
10534
10543
  debugLogger.debug(
10535
10544
  `Failed to stat file ${file.name}: ${error instanceof Error ? error.message : "Unknown error"}`
@@ -10582,12 +10591,12 @@ async function cleanupToolOutputFiles(settings, debugMode = false, projectTempDi
10582
10591
  continue;
10583
10592
  }
10584
10593
  const subdirPath = path2.join(toolOutputDir, subdir.name);
10585
- const stat2 = await fs2.stat(subdirPath);
10594
+ const stat3 = await fs2.stat(subdirPath);
10586
10595
  let shouldDelete = false;
10587
10596
  if (retentionConfig.maxAge) {
10588
10597
  const maxAgeMs = parseRetentionPeriod(retentionConfig.maxAge);
10589
10598
  const cutoffDate = new Date(now.getTime() - maxAgeMs);
10590
- if (stat2.mtime < cutoffDate) {
10599
+ if (stat3.mtime < cutoffDate) {
10591
10600
  shouldDelete = true;
10592
10601
  }
10593
10602
  }
@@ -14265,7 +14274,7 @@ var SETTINGS_SCHEMA = {
14265
14274
  label: "Voice Stop Grace Period (ms)",
14266
14275
  category: "Experimental",
14267
14276
  requiresRestart: false,
14268
- default: 1e3,
14277
+ default: 4e3,
14269
14278
  description: "How long to wait for final transcription after stopping recording.",
14270
14279
  showInDialog: true
14271
14280
  }
@@ -16172,6 +16181,14 @@ var LoadedSettings = class {
16172
16181
  get merged() {
16173
16182
  return this._merged;
16174
16183
  }
16184
+ /**
16185
+ * Returns a merged settings object as if the folder were trusted.
16186
+ * This is useful for commands like 'mcp list' that want to show
16187
+ * what's configured even if it's currently disabled for security reasons.
16188
+ */
16189
+ getMergedSettingsAsIfTrusted() {
16190
+ return this.computeMergedSettings(true);
16191
+ }
16175
16192
  setTrusted(isTrusted) {
16176
16193
  if (this.isTrusted === isTrusted) {
16177
16194
  return;
@@ -16188,13 +16205,15 @@ var LoadedSettings = class {
16188
16205
  originalSettings: {}
16189
16206
  };
16190
16207
  }
16191
- computeMergedSettings() {
16208
+ computeMergedSettings(forceTrusted = false) {
16209
+ const isTrusted = forceTrusted || this.isTrusted;
16210
+ const workspace = forceTrusted ? this._workspaceFile : this.workspace;
16192
16211
  const merged = mergeSettings(
16193
16212
  this.system.settings,
16194
16213
  this.systemDefaults.settings,
16195
16214
  this.user.settings,
16196
- this.workspace.settings,
16197
- this.isTrusted
16215
+ workspace.settings,
16216
+ isTrusted
16198
16217
  );
16199
16218
  const adminSettingSchema = getSettingsSchema().admin;
16200
16219
  if (adminSettingSchema?.properties) {
@@ -16210,8 +16229,7 @@ var LoadedSettings = class {
16210
16229
  }
16211
16230
  computeSnapshot() {
16212
16231
  const cloneSettingsFile = (file) => ({
16213
- path: file.path,
16214
- rawJson: file.rawJson,
16232
+ ...file,
16215
16233
  settings: structuredClone(file.settings),
16216
16234
  originalSettings: structuredClone(file.originalSettings)
16217
16235
  });