@google/gemini-cli 0.42.0 → 0.44.0-nightly.20260513.g5ee05c775

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-COQP2M4D.js → chunk-27SPXGT2.js} +562 -437
  2. package/bundle/{chunk-EDKX67D6.js → chunk-2VH3SA6M.js} +43 -23
  3. package/bundle/{chunk-PUDLNWHE.js → chunk-3KOQHVJU.js} +3 -3
  4. package/bundle/{chunk-COKAF5GM.js → chunk-4QQ5AHZP.js} +2 -2
  5. package/bundle/{chunk-KVEAHIIV.js → chunk-5EEEHNEE.js} +3 -3
  6. package/bundle/{chunk-G2VTSEZ6.js → chunk-5SMSFUPB.js} +1 -1
  7. package/bundle/{chunk-7VVHSNDQ.js → chunk-AC2EWTF7.js} +1970 -731
  8. package/bundle/{chunk-GA527JB7.js → chunk-ATSNFRDF.js} +1 -1
  9. package/bundle/{chunk-3IS7GD6D.js → chunk-BA752AEU.js} +3 -3
  10. package/bundle/{chunk-CYEIWMZJ.js → chunk-FGYOOMPI.js} +1 -1
  11. package/bundle/{chunk-QOZSZYL7.js → chunk-FK45PHSI.js} +3 -3
  12. package/bundle/{chunk-I7AME6VC.js → chunk-FTY6BJEY.js} +9 -8
  13. package/bundle/{chunk-NTOPH4WG.js → chunk-GCWBZXBS.js} +2 -2
  14. package/bundle/chunk-I2JHD4D3.js +512 -0
  15. package/bundle/{chunk-7C6GGDK6.js → chunk-IZJOLGNO.js} +3 -3
  16. package/bundle/{chunk-4SLGT6YD.js → chunk-J4YAW3P3.js} +1 -1
  17. package/bundle/chunk-KADNKBXT.js +118 -0
  18. package/bundle/{chunk-DN4XSYRG.js → chunk-LF33N5QM.js} +8696 -13355
  19. package/bundle/{chunk-CHERUG6W.js → chunk-LO22NRY4.js} +502 -390
  20. package/bundle/{chunk-JEW7ZIWE.js → chunk-M7OUJJZ2.js} +5270 -5234
  21. package/bundle/{chunk-WIXUKOZA.js → chunk-MFNKZZOB.js} +1 -1
  22. package/bundle/chunk-MLPM54XD.js +357247 -0
  23. package/bundle/{chunk-ECNYAST2.js → chunk-N22WUHJE.js} +5419 -5378
  24. package/bundle/chunk-OC7XGTLV.js +81656 -0
  25. package/bundle/{chunk-ZNMQA242.js → chunk-QDEK3TQ6.js} +3 -3
  26. package/bundle/{chunk-BCYBA52D.js → chunk-QMXQUBC4.js} +43 -23
  27. package/bundle/chunk-TBHMNRI3.js +1571 -0
  28. package/bundle/{chunk-LATVEETM.js → chunk-TOOOS4HD.js} +2 -2
  29. package/bundle/{chunk-XUMRUXOT.js → chunk-UHSQLPNG.js} +50 -27
  30. package/bundle/chunk-USS2A6NQ.js +156 -0
  31. package/bundle/chunk-WMTLLWRC.js +391 -0
  32. package/bundle/chunk-XDWZDV7C.js +17250 -0
  33. package/bundle/{chunk-DMWX7UP6.js → chunk-YBYQH75I.js} +2252 -829
  34. package/bundle/{chunk-FCAODPNO.js → chunk-ZZN56QZ3.js} +502 -390
  35. package/bundle/{cleanup-3RILFNVM.js → cleanup-2H3SANYB.js} +3 -3
  36. package/bundle/{cleanup-SVRKYBR6.js → cleanup-7GY7BVC6.js} +3 -3
  37. package/bundle/{cleanup-XFVHHDVO.js → cleanup-FERREFU6.js} +3 -3
  38. package/bundle/cleanup-VIITMMDH.js +33 -0
  39. package/bundle/{core-FRVSDP2C.js → core-GS6NXK7Y.js} +30 -2
  40. package/bundle/{devtoolsService-VM2WTHBX.js → devtoolsService-FKC6Y4OE.js} +3 -3
  41. package/bundle/{devtoolsService-TRDGMQLJ.js → devtoolsService-K2DRCZEY.js} +5 -4
  42. package/bundle/{devtoolsService-RUEO5PGP.js → devtoolsService-PS6RYICL.js} +3 -3
  43. package/bundle/devtoolsService-ZDXC2NPD.js +857 -0
  44. package/bundle/{dist-6BN2CJPN.js → dist-S3YUNQKP.js} +30 -2
  45. package/bundle/{core-B5S6HZJT.js → dist-TBGNMYU2.js} +30 -2
  46. package/bundle/dist-ZEW43MLQ.js +2124 -0
  47. package/bundle/docs/changelogs/index.md +30 -0
  48. package/bundle/docs/changelogs/latest.md +261 -166
  49. package/bundle/docs/changelogs/preview.md +178 -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-QSTQ2DBG.js → gemini-6YGVETF3.js} +165 -61
  57. package/bundle/{gemini-GHUELHBF.js → gemini-7FCGNXOV.js} +350 -232
  58. package/bundle/gemini-IXZUGRVP.js +16360 -0
  59. package/bundle/{gemini-NQPVX5JC.js → gemini-WYTY4CD5.js} +165 -61
  60. package/bundle/gemini.js +8 -8
  61. package/bundle/{interactiveCli-AG2YWL2O.js → interactiveCli-A2FV6NYD.js} +1721 -1472
  62. package/bundle/{interactiveCli-MZFG35NB.js → interactiveCli-DWNRHVIB.js} +2003 -1736
  63. package/bundle/{interactiveCli-453M2IVE.js → interactiveCli-H7N4UXVQ.js} +1720 -1472
  64. package/bundle/interactiveCli-XRZEELCX.js +34754 -0
  65. package/bundle/{liteRtServerManager-G4Q7OVBX.js → liteRtServerManager-5C5EONBK.js} +5 -5
  66. package/bundle/{liteRtServerManager-S7WL25VD.js → liteRtServerManager-NQKPNCLR.js} +5 -5
  67. package/bundle/{liteRtServerManager-BXQ6VVWP.js → liteRtServerManager-UJBPII3P.js} +5 -5
  68. package/bundle/liteRtServerManager-UZCAJJCS.js +66 -0
  69. package/bundle/{memoryDiscovery-KSYZVCWF.js → memoryDiscovery-ALKMYAPP.js} +1 -1
  70. package/bundle/{memoryDiscovery-FB7MMKTA.js → memoryDiscovery-XFCKEF3F.js} +1 -1
  71. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  72. package/bundle/{oauth2-provider-VR4DL6AL.js → oauth2-provider-JNOY6NUI.js} +2 -2
  73. package/bundle/{oauth2-provider-H7G6RSFW.js → oauth2-provider-O6OA5EMU.js} +2 -2
  74. package/bundle/{oauth2-provider-5UF5WEE2.js → oauth2-provider-QYCLASEA.js} +39 -73
  75. package/bundle/oauth2-provider-VWLTUFO7.js +237 -0
  76. package/bundle/{start-CQBSKFYB.js → start-6FV3VPPH.js} +7 -7
  77. package/bundle/{start-NIMXQJYB.js → start-IWAUTCYF.js} +7 -7
  78. package/bundle/{start-2SKRN43X.js → start-L4DAQUQM.js} +7 -7
  79. package/bundle/start-XTXUKP77.js +19 -0
  80. package/package.json +1 -1
@@ -700,6 +700,19 @@ their corresponding top-level category object in your `settings.json` file.
700
700
  "extends": "gemini-3-flash-base",
701
701
  "modelConfig": {}
702
702
  },
703
+ "context-snapshotter": {
704
+ "extends": "gemini-3-flash-base",
705
+ "modelConfig": {
706
+ "generateContentConfig": {
707
+ "thinkingConfig": {
708
+ "thinkingLevel": "HIGH"
709
+ },
710
+ "temperature": 1,
711
+ "topP": 0.95,
712
+ "topK": 64
713
+ }
714
+ }
715
+ },
703
716
  "chat-compression-3-pro": {
704
717
  "modelConfig": {
705
718
  "model": "gemini-3-pro-preview"
@@ -1795,7 +1808,7 @@ their corresponding top-level category object in your `settings.json` file.
1795
1808
  - **`experimental.voice.stopGracePeriodMs`** (number):
1796
1809
  - **Description:** How long to wait for final transcription after stopping
1797
1810
  recording.
1798
- - **Default:** `1000`
1811
+ - **Default:** `4000`
1799
1812
 
1800
1813
  - **`experimental.adk.agentSessionNoninteractiveEnabled`** (boolean):
1801
1814
  - **Description:** Enable non-interactive agent sessions.
@@ -326,6 +326,29 @@ lines and `3w` moves forward three words.
326
326
  Counts are also supported for editing commands. For example, `3dd` deletes three
327
327
  lines and `2cw` changes two words.
328
328
 
329
+ ### Find, replace, yank, and paste in NORMAL mode
330
+
331
+ | Action | Keys |
332
+ | ----------------------------------------- | ----------- |
333
+ | Find next matching character | `f{char}` |
334
+ | Find previous matching character | `F{char}` |
335
+ | Move until before next matching character | `t{char}` |
336
+ | Move until after previous matching char | `T{char}` |
337
+ | Repeat latest character find | `;` |
338
+ | Repeat latest character find in reverse | `,` |
339
+ | Delete character before cursor | `X` |
340
+ | Toggle case under cursor | `~` |
341
+ | Replace character under cursor | `r{char}` |
342
+ | Yank line | `yy` |
343
+ | Yank to end of line | `Y` or `y$` |
344
+ | Yank word / WORD | `yw`, `yW` |
345
+ | Yank to end of word / WORD | `ye`, `yE` |
346
+ | Paste after cursor | `p` |
347
+ | Paste before cursor | `P` |
348
+
349
+ Delete and change operators also compose with character-find motions, so
350
+ commands such as `dfx`, `dtx`, `cFx`, and `cTx` are supported.
351
+
329
352
  ## Limitations
330
353
 
331
354
  - On [Windows Terminal](https://en.wikipedia.org/wiki/Windows_Terminal):
@@ -41,18 +41,18 @@ import {
41
41
  updateAllUpdatableExtensions,
42
42
  updateExtension,
43
43
  validateAuthMethod
44
- } from "./chunk-FCAODPNO.js";
44
+ } from "./chunk-27SPXGT2.js";
45
45
  import {
46
46
  appEvents
47
47
  } from "./chunk-5PS3AYFU.js";
48
48
  import {
49
49
  startCommand,
50
50
  startServer
51
- } from "./chunk-PUDLNWHE.js";
51
+ } from "./chunk-5EEEHNEE.js";
52
52
  import {
53
53
  exitCli,
54
54
  require_source
55
- } from "./chunk-4SLGT6YD.js";
55
+ } from "./chunk-FGYOOMPI.js";
56
56
  import {
57
57
  DEFAULT_PORT,
58
58
  GEMMA_MODEL_NAME,
@@ -86,11 +86,11 @@ import {
86
86
  readServerProcessInfo,
87
87
  resolveGemmaConfig,
88
88
  saveModelChange
89
- } from "./chunk-EDKX67D6.js";
89
+ } from "./chunk-UHSQLPNG.js";
90
90
  import {
91
91
  RELAUNCH_EXIT_CODE
92
- } from "./chunk-QOZSZYL7.js";
93
- import "./chunk-G2VTSEZ6.js";
92
+ } from "./chunk-BA752AEU.js";
93
+ import "./chunk-I2JHD4D3.js";
94
94
  import {
95
95
  cleanupCheckpoints,
96
96
  registerCleanup,
@@ -99,7 +99,7 @@ import {
99
99
  runExitCleanup,
100
100
  runSyncCleanup,
101
101
  setupSignalHandlers
102
- } from "./chunk-COKAF5GM.js";
102
+ } from "./chunk-GCWBZXBS.js";
103
103
  import {
104
104
  AuthType,
105
105
  ChatRecordingService,
@@ -176,6 +176,7 @@ import {
176
176
  listInboxPatches,
177
177
  listInboxSkills,
178
178
  listMemoryFiles,
179
+ loadConversationRecord,
179
180
  logToolCall,
180
181
  logUserPrompt,
181
182
  parseAndFormatApiError,
@@ -199,7 +200,7 @@ import {
199
200
  updatePolicy,
200
201
  writeToStderr,
201
202
  writeToStdout
202
- } from "./chunk-7VVHSNDQ.js";
203
+ } from "./chunk-AC2EWTF7.js";
203
204
  import {
204
205
  ASK_USER_TOOL_NAME,
205
206
  ApprovalMode,
@@ -241,13 +242,14 @@ import {
241
242
  getDisplayString,
242
243
  getErrorMessage,
243
244
  getErrorType,
245
+ getProjectHash,
244
246
  homedir,
245
247
  isFatalToolError,
246
248
  isNodeError,
247
249
  loadServerHierarchicalMemory,
248
250
  resolveToRealPath,
249
251
  setGeminiMdFilename
250
- } from "./chunk-JEW7ZIWE.js";
252
+ } from "./chunk-M7OUJJZ2.js";
251
253
  import "./chunk-664ZODQF.js";
252
254
  import "./chunk-RJTRUG2J.js";
253
255
  import "./chunk-IUUIT4SU.js";
@@ -1532,11 +1534,11 @@ var parser = new YargsParser({
1532
1534
  resolve: resolve2,
1533
1535
  // TODO: figure out a way to combine ESM and CJS coverage, such that
1534
1536
  // we can exercise all the lines below:
1535
- require: (path15) => {
1537
+ require: (path16) => {
1536
1538
  if (typeof __require !== "undefined") {
1537
- return __require(path15);
1538
- } else if (path15.match(/\.json$/)) {
1539
- return JSON.parse(readFileSync(path15, "utf8"));
1539
+ return __require(path16);
1540
+ } else if (path16.match(/\.json$/)) {
1541
+ return JSON.parse(readFileSync(path16, "utf8"));
1540
1542
  } else {
1541
1543
  throw Error("only .json config files are supported in ESM");
1542
1544
  }
@@ -5447,12 +5449,16 @@ async function getServerStatus(serverName, server, isTrusted, activeSettings) {
5447
5449
  }
5448
5450
  return MCPServerStatus.DISABLED;
5449
5451
  }
5452
+ if (!isTrusted) {
5453
+ return MCPServerStatus.DISABLED;
5454
+ }
5450
5455
  return testMCPConnection(serverName, server, isTrusted, activeSettings);
5451
5456
  }
5452
5457
  async function listMcpServers(loadedSettingsArg) {
5453
5458
  const loadedSettings = loadedSettingsArg ?? loadSettings();
5454
5459
  const activeSettings = loadedSettings.merged;
5455
- const { mcpServers, blockedServerNames } = await getMcpServersFromConfig(activeSettings);
5460
+ const allSettings = !loadedSettings.isTrusted ? loadedSettings.getMergedSettingsAsIfTrusted() : activeSettings;
5461
+ const { mcpServers, blockedServerNames } = await getMcpServersFromConfig(allSettings);
5456
5462
  const serverNames = Object.keys(mcpServers);
5457
5463
  if (blockedServerNames.length > 0) {
5458
5464
  const message = getAdminBlockedMcpServersMessage(
@@ -5467,6 +5473,13 @@ async function listMcpServers(loadedSettingsArg) {
5467
5473
  }
5468
5474
  return;
5469
5475
  }
5476
+ if (!loadedSettings.isTrusted) {
5477
+ debugLogger.log(
5478
+ import_chalk.default.yellow(
5479
+ "Warning: MCP servers are configured but disabled because this folder is untrusted.\nUser-level servers are also suppressed in untrusted folders to prevent accidental side-effects.\n"
5480
+ )
5481
+ );
5482
+ }
5470
5483
  debugLogger.log("Configured MCP servers:\n");
5471
5484
  for (const serverName of serverNames) {
5472
5485
  const server = mcpServers[serverName];
@@ -6306,27 +6319,27 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
6306
6319
  var __filename = fileURLToPath2(import.meta.url);
6307
6320
  var __dirname2 = dirname3(__filename);
6308
6321
  var EXAMPLES_PATH = join(__dirname2, "examples");
6309
- async function pathExists(path15) {
6322
+ async function pathExists(path16) {
6310
6323
  try {
6311
- await access(path15);
6324
+ await access(path16);
6312
6325
  return true;
6313
6326
  } catch {
6314
6327
  return false;
6315
6328
  }
6316
6329
  }
6317
- async function createDirectory(path15) {
6318
- if (await pathExists(path15)) {
6319
- throw new Error(`Path already exists: ${path15}`);
6330
+ async function createDirectory(path16) {
6331
+ if (await pathExists(path16)) {
6332
+ throw new Error(`Path already exists: ${path16}`);
6320
6333
  }
6321
- await mkdir(path15, { recursive: true });
6334
+ await mkdir(path16, { recursive: true });
6322
6335
  }
6323
- async function copyDirectory(template, path15) {
6324
- await createDirectory(path15);
6336
+ async function copyDirectory(template, path16) {
6337
+ await createDirectory(path16);
6325
6338
  const examplePath = join(EXAMPLES_PATH, template);
6326
6339
  const entries = await readdir(examplePath, { withFileTypes: true });
6327
6340
  for (const entry of entries) {
6328
6341
  const srcPath = join(examplePath, entry.name);
6329
- const destPath = join(path15, entry.name);
6342
+ const destPath = join(path16, entry.name);
6330
6343
  await cp(srcPath, destPath, { recursive: true });
6331
6344
  }
6332
6345
  }
@@ -6601,7 +6614,7 @@ async function handleEnable3(args) {
6601
6614
  const result = enableSkill(settings, name);
6602
6615
  const feedback = renderSkillActionFeedback(
6603
6616
  result,
6604
- (label, path15) => `${import_chalk5.default.bold(label)} (${import_chalk5.default.dim(path15)})`
6617
+ (label, path16) => `${import_chalk5.default.bold(label)} (${import_chalk5.default.dim(path16)})`
6605
6618
  );
6606
6619
  debugLogger.log(feedback);
6607
6620
  }
@@ -6631,7 +6644,7 @@ async function handleDisable3(args) {
6631
6644
  const result = disableSkill(settings, name, scope);
6632
6645
  const feedback = renderSkillActionFeedback(
6633
6646
  result,
6634
- (label, path15) => `${import_chalk6.default.bold(label)} (${import_chalk6.default.dim(path15)})`
6647
+ (label, path16) => `${import_chalk6.default.bold(label)} (${import_chalk6.default.dim(path16)})`
6635
6648
  );
6636
6649
  debugLogger.log(feedback);
6637
6650
  }
@@ -7826,7 +7839,7 @@ async function loadSandboxConfig(settings, argv) {
7826
7839
  }
7827
7840
  const command2 = getSandboxCommand(sandboxValue);
7828
7841
  const packageJson = await getPackageJson(__dirname3);
7829
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.42.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7842
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.44.0-nightly.20260512.g022e8baef" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7830
7843
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7831
7844
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7832
7845
  }
@@ -7994,8 +8007,13 @@ async function parseArguments(settings) {
7994
8007
  const queryArg2 = argv["query"];
7995
8008
  const query = typeof queryArg2 === "string" || Array.isArray(queryArg2) ? queryArg2 : void 0;
7996
8009
  const hasPositionalQuery = Array.isArray(query) ? query.length > 0 : !!query;
7997
- if (argv["resume"] !== void 0 && argv["session-id"] !== void 0) {
7998
- return "Cannot use both --resume (-r) and --session-id together";
8010
+ const sessionFlags = [
8011
+ argv["resume"] !== void 0,
8012
+ argv["session-id"] !== void 0,
8013
+ argv["session-file"] !== void 0
8014
+ ].filter(Boolean).length;
8015
+ if (sessionFlags > 1) {
8016
+ return "The flags --resume, --session-id, and --session-file are mutually exclusive. Please provide only one.";
7999
8017
  }
8000
8018
  if (argv["prompt"] && hasPositionalQuery) {
8001
8019
  return "Cannot use both a positional prompt and the --prompt (-p) flag together";
@@ -8126,6 +8144,10 @@ async function parseArguments(settings) {
8126
8144
  }
8127
8145
  return trimmed;
8128
8146
  }
8147
+ }).option("session-file", {
8148
+ type: "string",
8149
+ nargs: 1,
8150
+ description: "Load a session from a JSON file"
8129
8151
  }).option("session-id", {
8130
8152
  type: "string",
8131
8153
  nargs: 1,
@@ -8610,7 +8632,11 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8610
8632
  shellBackgroundCompletionBehavior: settings.tools?.shell?.backgroundCompletionBehavior,
8611
8633
  shellToolInactivityTimeout: settings.tools?.shell?.inactivityTimeout,
8612
8634
  enableShellOutputEfficiency: settings.tools?.shell?.enableShellOutputEfficiency ?? true,
8613
- skipNextSpeakerCheck: settings.model?.skipNextSpeakerCheck,
8635
+ // In ACP mode, always skip the next-speaker check. This check triggers
8636
+ // recursive continuation turns inside GeminiClient.processTurn() that
8637
+ // conflict with ACP's explicit turn management via session/prompt,
8638
+ // causing infinite agent_thought_chunk loops.
8639
+ skipNextSpeakerCheck: isAcpMode || settings.model?.skipNextSpeakerCheck,
8614
8640
  truncateToolOutputThreshold: settings.tools?.truncateToolOutputThreshold,
8615
8641
  eventEmitter: coreEvents,
8616
8642
  useWriteTodos: argv.useWriteTodos ?? settings.useWriteTodos,
@@ -8769,6 +8795,8 @@ import { createHash as createHash2 } from "node:crypto";
8769
8795
  import v8 from "node:v8";
8770
8796
  import os6 from "node:os";
8771
8797
  import dns from "node:dns";
8798
+ import * as path15 from "node:path";
8799
+ import * as fsPromises from "node:fs/promises";
8772
8800
 
8773
8801
  // packages/cli/src/utils/sandbox.ts
8774
8802
  var import_shell_quote2 = __toESM(require_shell_quote(), 1);
@@ -9229,21 +9257,11 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
9229
9257
  }
9230
9258
  const imageName = parseImageName(image);
9231
9259
  const isIntegrationTest = process.env["GEMINI_CLI_INTEGRATION_TEST"] === "true";
9232
- let containerName;
9233
- if (isIntegrationTest) {
9234
- containerName = `gemini-cli-integration-test-${randomBytes(4).toString(
9235
- "hex"
9236
- )}`;
9237
- debugLogger.log(`ContainerName: ${containerName}`);
9238
- } else {
9239
- let index = 0;
9240
- const containerNameCheck = (await execAsync(`${command2} ps -a --format "{{.Names}}"`)).stdout.trim();
9241
- while (containerNameCheck.includes(`${imageName}-${index}`)) {
9242
- index++;
9243
- }
9244
- containerName = `${imageName}-${index}`;
9245
- debugLogger.log(`ContainerName (regular): ${containerName}`);
9246
- }
9260
+ const containerNamePrefix = isIntegrationTest ? "gemini-cli-integration-test" : imageName;
9261
+ const containerName = `${containerNamePrefix}-${randomBytes(6).toString(
9262
+ "hex"
9263
+ )}`;
9264
+ debugLogger.log(`ContainerName: ${containerName}`);
9247
9265
  args.push("--name", containerName, "--hostname", containerName);
9248
9266
  if (process.env["GEMINI_CLI_TEST_VAR"]) {
9249
9267
  args.push(
@@ -10229,7 +10247,7 @@ async function runNonInteractive({
10229
10247
  }
10230
10248
  });
10231
10249
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10232
- const { setupInitialActivityLogger } = await import("./devtoolsService-VM2WTHBX.js");
10250
+ const { setupInitialActivityLogger } = await import("./devtoolsService-FKC6Y4OE.js");
10233
10251
  setupInitialActivityLogger(config);
10234
10252
  }
10235
10253
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10684,6 +10702,9 @@ async function runNonInteractive({
10684
10702
  async function runNonInteractive2(params) {
10685
10703
  const useAgentSession = params.config.getAgentSessionNoninteractiveEnabled();
10686
10704
  if (useAgentSession) {
10705
+ debugLogger.debug(
10706
+ "[ADK] Running non-interactive mode with ADK agent session"
10707
+ );
10687
10708
  return runNonInteractive(params);
10688
10709
  }
10689
10710
  const { config, settings, input, prompt_id, resumedSessionData } = params;
@@ -10697,7 +10718,7 @@ async function runNonInteractive2(params) {
10697
10718
  }
10698
10719
  });
10699
10720
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10700
- const { setupInitialActivityLogger } = await import("./devtoolsService-VM2WTHBX.js");
10721
+ const { setupInitialActivityLogger } = await import("./devtoolsService-FKC6Y4OE.js");
10701
10722
  setupInitialActivityLogger(config);
10702
10723
  }
10703
10724
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10931,6 +10952,20 @@ async function runNonInteractive2(params) {
10931
10952
  durationMs
10932
10953
  )
10933
10954
  });
10955
+ } else if (config.getOutputFormat() === OutputFormat.JSON) {
10956
+ const formatter = new JsonFormatter();
10957
+ const stats = uiTelemetryService.getMetrics();
10958
+ textOutput.write(
10959
+ formatter.format(
10960
+ config.getSessionId(),
10961
+ responseText,
10962
+ stats,
10963
+ void 0,
10964
+ [...warnings, stopMessage]
10965
+ )
10966
+ );
10967
+ } else {
10968
+ textOutput.ensureTrailingNewline();
10934
10969
  }
10935
10970
  return;
10936
10971
  } else if (event.type === GeminiEventType.AgentExecutionBlocked) {
@@ -14193,12 +14228,6 @@ ${event.value.description}`;
14193
14228
  const invocation = tool.build(args);
14194
14229
  const displayTitle = typeof invocation.getDisplayTitle === "function" ? invocation.getDisplayTitle() : invocation.getDescription();
14195
14230
  const explanation = typeof invocation.getExplanation === "function" ? invocation.getExplanation() : "";
14196
- if (explanation) {
14197
- await this.sendUpdate({
14198
- sessionUpdate: "agent_thought_chunk",
14199
- content: { type: "text", text: explanation }
14200
- });
14201
- }
14202
14231
  const confirmationDetails = await invocation.shouldConfirmExecute(abortSignal);
14203
14232
  if (confirmationDetails) {
14204
14233
  const content2 = [];
@@ -14213,6 +14242,12 @@ ${event.value.description}`;
14213
14242
  }
14214
14243
  });
14215
14244
  }
14245
+ if (content2.length === 0 && explanation) {
14246
+ content2.push({
14247
+ type: "content",
14248
+ content: { type: "text", text: explanation }
14249
+ });
14250
+ }
14216
14251
  const params = {
14217
14252
  sessionId: this.id,
14218
14253
  options: toPermissionOptions(
@@ -14261,6 +14296,12 @@ ${event.value.description}`;
14261
14296
  }
14262
14297
  } else {
14263
14298
  const content2 = [];
14299
+ if (explanation) {
14300
+ content2.push({
14301
+ type: "content",
14302
+ content: { type: "text", text: explanation }
14303
+ });
14304
+ }
14264
14305
  await this.sendUpdate({
14265
14306
  sessionUpdate: "tool_call",
14266
14307
  toolCallId: callId,
@@ -14872,7 +14913,11 @@ var AcpFileSystemService = class {
14872
14913
  path: filePath,
14873
14914
  sessionId: this.sessionId
14874
14915
  });
14875
- return response.content;
14916
+ const content = response.content;
14917
+ if (typeof content !== "string") {
14918
+ throw new Error("content must be a string");
14919
+ }
14920
+ return content;
14876
14921
  } catch (err) {
14877
14922
  this.normalizeFileSystemError(err);
14878
14923
  }
@@ -15720,13 +15765,69 @@ ${reason.stack}` : ""}`;
15720
15765
  }
15721
15766
  });
15722
15767
  }
15723
- async function resolveSessionId(resumeArg, sessionIdArg) {
15724
- if (!resumeArg && !sessionIdArg) {
15768
+ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
15769
+ if (!resumeArg && !sessionIdArg && !sessionFileArg) {
15725
15770
  return { sessionId: createSessionId() };
15726
15771
  }
15727
15772
  const storage = new Storage(process.cwd());
15728
15773
  await storage.initialize();
15729
15774
  const sessionSelector = new SessionSelector(storage);
15775
+ if (sessionFileArg) {
15776
+ try {
15777
+ const sessionData = await loadConversationRecord(sessionFileArg);
15778
+ if (!sessionData) {
15779
+ throw new Error(`File not found or invalid format: ${sessionFileArg}`);
15780
+ }
15781
+ const now = Date.now();
15782
+ const isoNow = new Date(now).toISOString();
15783
+ sessionData.messages = (sessionData.messages || []).filter(
15784
+ (m) => typeof m === "object" && m !== null && (m.type === "user" || m.type === "gemini") && m.content !== void 0
15785
+ );
15786
+ sessionData.messages.unshift({
15787
+ id: `import-${now}`,
15788
+ type: "info",
15789
+ content: `Imported session from ${sessionFileArg}`,
15790
+ timestamp: isoNow
15791
+ });
15792
+ const newSessionId = createSessionId();
15793
+ sessionData.sessionId = newSessionId;
15794
+ sessionData.projectHash = getProjectHash(storage.getProjectRoot());
15795
+ sessionData.startTime = isoNow;
15796
+ sessionData.lastUpdated = isoNow;
15797
+ const chatsDir = path15.join(storage.getProjectTempDir(), "chats");
15798
+ const newSessionPath = path15.join(
15799
+ chatsDir,
15800
+ `session-${now}-${newSessionId.slice(0, 8)}.jsonl`
15801
+ );
15802
+ const { messages: _messages, ...initialMetadata } = sessionData;
15803
+ const lines = [JSON.stringify(initialMetadata)];
15804
+ if (sessionData.messages) {
15805
+ for (const msg of sessionData.messages) {
15806
+ lines.push(JSON.stringify(msg));
15807
+ }
15808
+ }
15809
+ await fsPromises.mkdir(chatsDir, { recursive: true });
15810
+ await fsPromises.writeFile(
15811
+ newSessionPath,
15812
+ lines.join("\n") + "\n",
15813
+ "utf-8"
15814
+ );
15815
+ return {
15816
+ sessionId: newSessionId,
15817
+ resumedSessionData: {
15818
+ conversation: sessionData,
15819
+ filePath: newSessionPath
15820
+ }
15821
+ };
15822
+ } catch (error) {
15823
+ coreEvents.emitFeedback(
15824
+ "error",
15825
+ `Error importing session from file: ${error instanceof Error ? error.message : "Unknown error"}`
15826
+ );
15827
+ await runExitCleanup();
15828
+ process.exit(ExitCodes.FATAL_INPUT_ERROR);
15829
+ }
15830
+ }
15730
15831
  if (sessionIdArg) {
15731
15832
  if (await sessionSelector.sessionExists(sessionIdArg)) {
15732
15833
  coreEvents.emitFeedback(
@@ -15748,8 +15849,10 @@ async function resolveSessionId(resumeArg, sessionIdArg) {
15748
15849
  };
15749
15850
  } catch (error) {
15750
15851
  if (error instanceof SessionError && error.code === "NO_SESSIONS_FOUND") {
15751
- coreEvents.emitFeedback("warning", error.message);
15752
- return { sessionId: createSessionId() };
15852
+ if (resumeArg === RESUME_LATEST) {
15853
+ coreEvents.emitFeedback("warning", error.message);
15854
+ return { sessionId: createSessionId() };
15855
+ }
15753
15856
  }
15754
15857
  coreEvents.emitFeedback(
15755
15858
  "error",
@@ -15760,7 +15863,7 @@ async function resolveSessionId(resumeArg, sessionIdArg) {
15760
15863
  }
15761
15864
  }
15762
15865
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
15763
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-AG2YWL2O.js");
15866
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-DWNRHVIB.js");
15764
15867
  await doStartUI(
15765
15868
  config,
15766
15869
  settings,
@@ -15823,7 +15926,8 @@ async function main() {
15823
15926
  const argv = await argvPromise;
15824
15927
  const { sessionId, resumedSessionData } = await resolveSessionId(
15825
15928
  argv.resume,
15826
- argv.sessionId
15929
+ argv.sessionId,
15930
+ argv.sessionFile
15827
15931
  );
15828
15932
  if (argv.allowedTools && argv.allowedTools.length > 0 || settings.merged.tools?.allowed && settings.merged.tools.allowed.length > 0) {
15829
15933
  coreEvents.emitFeedback(
@@ -15967,7 +16071,7 @@ ${finalArgs[promptIndex + 1]}`;
15967
16071
  await config.storage.initialize();
15968
16072
  adminControlsListner.setConfig(config);
15969
16073
  if (config.isInteractive() && settings.merged.general.devtools) {
15970
- const { setupInitialActivityLogger } = await import("./devtoolsService-VM2WTHBX.js");
16074
+ const { setupInitialActivityLogger } = await import("./devtoolsService-FKC6Y4OE.js");
15971
16075
  setupInitialActivityLogger(config);
15972
16076
  }
15973
16077
  registerTelemetryConfig(config);
@@ -16026,7 +16130,7 @@ ${finalArgs[promptIndex + 1]}`;
16026
16130
  const initAppHandle = startupProfiler.start("initialize_app");
16027
16131
  const initializationResult = await initializeApp(config, settings);
16028
16132
  initAppHandle?.end();
16029
- import("./liteRtServerManager-BXQ6VVWP.js").then(({ LiteRtServerManager }) => {
16133
+ import("./liteRtServerManager-UJBPII3P.js").then(({ LiteRtServerManager }) => {
16030
16134
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
16031
16135
  if (!mergedGemma) return;
16032
16136
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;