@google/gemini-cli 0.67.0-preview.0 → 0.68.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 (58) hide show
  1. package/README.md +18 -24
  2. package/bundle/{chunk-4HG5TEPY.js → chunk-44PCK4QK.js} +1 -1
  3. package/bundle/{chunk-QVUC4J7B.js → chunk-6A5BTTNC.js} +9 -11
  4. package/bundle/{chunk-BFZQO5OI.js → chunk-B2FKXXUH.js} +327 -106
  5. package/bundle/{chunk-GTLUHCZL.js → chunk-BKVNBJ5C.js} +327 -106
  6. package/bundle/{chunk-IQFMOPBP.js → chunk-CXMHAFLN.js} +2 -2
  7. package/bundle/{chunk-76P7AV5J.js → chunk-G7EMTV2Q.js} +327 -106
  8. package/bundle/{chunk-VIWQUHCM.js → chunk-HRM7UWGB.js} +9 -11
  9. package/bundle/{chunk-WTMW35TZ.js → chunk-JMHCFAD6.js} +1 -1
  10. package/bundle/{chunk-WANMK7VA.js → chunk-KKKD4FID.js} +2 -2
  11. package/bundle/{chunk-5FYAQBC3.js → chunk-L57AYV6U.js} +1558 -996
  12. package/bundle/{chunk-6HF2HP2S.js → chunk-LQDISFTJ.js} +2 -2
  13. package/bundle/{chunk-R6BM7NWC.js → chunk-ODU7Z2RJ.js} +1 -1
  14. package/bundle/{chunk-THOV46FY.js → chunk-OZOUOK43.js} +1 -1
  15. package/bundle/{chunk-FPCAOQBY.js → chunk-Q76ZDILI.js} +3 -3
  16. package/bundle/{chunk-EAO5GUJT.js → chunk-RCF66HCI.js} +1625 -1006
  17. package/bundle/{chunk-FYX6LSG6.js → chunk-RD2EMHV2.js} +1 -1
  18. package/bundle/{chunk-QPO46AOD.js → chunk-VBHMFLBY.js} +1 -1
  19. package/bundle/{chunk-2BG2OMW3.js → chunk-VCO4TMD6.js} +9 -11
  20. package/bundle/{chunk-GI2BMP6K.js → chunk-WEP47ZZU.js} +1 -1
  21. package/bundle/{chunk-RNBD6XQX.js → chunk-XPTXBYQQ.js} +3 -3
  22. package/bundle/{chunk-SJ64DOGM.js → chunk-XVNEFQR3.js} +1 -1
  23. package/bundle/{chunk-JLA2J5MI.js → chunk-YPPJDFYP.js} +3 -3
  24. package/bundle/{chunk-SAQV5Q3G.js → chunk-ZEK4UYYW.js} +1 -1
  25. package/bundle/{chunk-HWPQINPO.js → chunk-ZZOOHVBL.js} +1627 -1008
  26. package/bundle/{cleanup-QXMGRCCJ.js → cleanup-CCR2EOHA.js} +2 -2
  27. package/bundle/{cleanup-R3QZGL6L.js → cleanup-OQV2G5Y3.js} +2 -2
  28. package/bundle/{cleanup-S6DWGSDA.js → cleanup-T24OFMOA.js} +2 -2
  29. package/bundle/{core-NQRYED5S.js → core-NQRKBS47.js} +3 -1
  30. package/bundle/{dist-XT4ZXTSC.js → core-UIPNZ5VU.js} +3 -1
  31. package/bundle/{devtoolsService-GPRO4RRU.js → devtoolsService-3G5ZA3JV.js} +2 -2
  32. package/bundle/{devtoolsService-WR3IFLZC.js → devtoolsService-EWNQDTC7.js} +2 -2
  33. package/bundle/{devtoolsService-ALST4BXH.js → devtoolsService-V3OEHE5V.js} +2 -2
  34. package/bundle/{core-3N7UGMI2.js → dist-OYZDNSTI.js} +3 -1
  35. package/bundle/docs/changelogs/index.md +24 -0
  36. package/bundle/docs/changelogs/latest.md +83 -90
  37. package/bundle/docs/changelogs/preview.md +89 -87
  38. package/bundle/docs/cli/sandbox.md +8 -2
  39. package/bundle/docs/cli/themes.md +6 -3
  40. package/bundle/docs/extensions/releasing.md +32 -0
  41. package/bundle/docs/reference/configuration.md +2 -10
  42. package/bundle/{gemini-K3EMSEQ5.js → gemini-2P73372G.js} +122 -24
  43. package/bundle/{gemini-MWKDIT7M.js → gemini-FSHMUCSM.js} +122 -24
  44. package/bundle/{gemini-5DCBUXWG.js → gemini-YFCTZ76S.js} +121 -23
  45. package/bundle/gemini.js +7 -7
  46. package/bundle/{interactiveCli-3B2SSFOJ.js → interactiveCli-F5RRE2VJ.js} +1350 -1145
  47. package/bundle/{interactiveCli-63JD5B2Z.js → interactiveCli-I75IWUIA.js} +1350 -1145
  48. package/bundle/{interactiveCli-QUIZ4FA2.js → interactiveCli-X54KN2EM.js} +1350 -1145
  49. package/bundle/{liteRtServerManager-M6NTFF5C.js → liteRtServerManager-FLPMMDNM.js} +4 -4
  50. package/bundle/{liteRtServerManager-QHOOPEJV.js → liteRtServerManager-JTOIS4KU.js} +4 -4
  51. package/bundle/{liteRtServerManager-AQUTLRTC.js → liteRtServerManager-UVQ2I6NL.js} +4 -4
  52. package/bundle/{oauth2-provider-3JCCMSND.js → oauth2-provider-AYO4BU7A.js} +1 -1
  53. package/bundle/{oauth2-provider-X55SWENY.js → oauth2-provider-NCQY7TJE.js} +1 -1
  54. package/bundle/{oauth2-provider-GCJTOYXK.js → oauth2-provider-VMBYZOC7.js} +1 -1
  55. package/bundle/{start-VKITAPOP.js → start-DFHM4HI4.js} +6 -6
  56. package/bundle/{start-X73XUSSH.js → start-IXQ2E7L6.js} +6 -6
  57. package/bundle/{start-4QIXXTMW.js → start-YEKGRZVH.js} +6 -6
  58. package/package.json +1 -1
@@ -97,7 +97,6 @@ nested configuration objects. For example:
97
97
  - `diff.removed`: Background for removed lines in diffs.
98
98
  - **`border`**: Defines border colors.
99
99
  - `default`: The standard border color.
100
- - `focused`: Border color when an element is focused.
101
100
  - **`status`**: Colors for status indicators.
102
101
  - `success`: Used for successful operations.
103
102
  - `warning`: Used for warnings.
@@ -105,6 +104,9 @@ nested configuration objects. For example:
105
104
  - **`ui`**: Other UI elements.
106
105
  - `comment`: Color for code comments.
107
106
  - `symbol`: Color for code symbols and operators.
107
+ - `active`: Border and text color for active or running elements.
108
+ - `focus`: Color for focused elements, such as selected menu items and focused
109
+ borders.
108
110
  - `gradient`: An array of colors used for gradient effects.
109
111
 
110
112
  **Required properties:**
@@ -166,8 +168,7 @@ custom theme defined in `settings.json`.
166
168
  "accent": "#d3869b"
167
169
  },
168
170
  "border": {
169
- "default": "#3c3836",
170
- "focused": "#458588"
171
+ "default": "#3c3836"
171
172
  },
172
173
  "status": {
173
174
  "success": "#b8bb26",
@@ -177,6 +178,8 @@ custom theme defined in `settings.json`.
177
178
  "ui": {
178
179
  "comment": "#928374",
179
180
  "symbol": "#8ec07c",
181
+ "active": "#83a598",
182
+ "focus": "#b8bb26",
180
183
  "gradient": ["#cc241d", "#d65d0e", "#d79921"]
181
184
  }
182
185
  }
@@ -29,6 +29,38 @@ To have your extension automatically discovered and listed:
29
29
  Our system crawls tagged repositories daily. Once you tag your repository, your
30
30
  extension will appear in the gallery if it passes validation.
31
31
 
32
+ ### Troubleshooting gallery indexing
33
+
34
+ If your extension doesn't appear in the gallery after 24 to 48 hours despite
35
+ meeting the listing requirements, GitHub Code Search may not have indexed your
36
+ repository's manifest file yet.
37
+
38
+ The gallery crawler relies on GitHub Code Search to discover
39
+ `gemini-extension.json` files across public repositories. Newly created or
40
+ recently pushed repositories are often indexed lazily by GitHub.
41
+
42
+ To check whether GitHub has indexed your repository's manifest, run the
43
+ following command using the GitHub CLI:
44
+
45
+ ```bash
46
+ gh api 'search/code?q=repo:<owner>/<repo>+filename:gemini-extension.json' --jq .total_count
47
+ ```
48
+
49
+ If the count is `0`, or if you don't use the GitHub CLI, trigger indexing
50
+ manually in your web browser:
51
+
52
+ 1. Sign in to GitHub.
53
+ 2. Navigate to
54
+ `https://github.com/search?q=repo%3A<owner>%2F<repo>+gemini-extension.json&type=code`
55
+ (replace `<owner>/<repo>` with your repository path).
56
+ 3. If GitHub displays "This repository's code is being indexed right now", wait
57
+ 15 to 30 minutes for indexing to finish.
58
+ 4. Re-run the search until `gemini-extension.json` appears in the search
59
+ results.
60
+
61
+ Once GitHub indexes the manifest file, the crawler will discover and index your
62
+ extension during its next scheduled cycle.
63
+
32
64
  ## Release through a Git repository
33
65
 
34
66
  Releasing through Git is the most flexible option. Create a public Git
@@ -1056,7 +1056,7 @@ their corresponding top-level category object in your `settings.json` file.
1056
1056
  "auto": {
1057
1057
  "displayName": "Auto",
1058
1058
  "tier": "auto",
1059
- "isPreview": true,
1059
+ "isPreview": false,
1060
1060
  "isVisible": true,
1061
1061
  "features": {
1062
1062
  "thinking": true,
@@ -1191,15 +1191,7 @@ their corresponding top-level category object in your `settings.json` file.
1191
1191
  ]
1192
1192
  },
1193
1193
  "gemini-2.5-flash": {
1194
- "default": "gemini-2.5-flash",
1195
- "contexts": [
1196
- {
1197
- "condition": {
1198
- "useLatestFlash": true
1199
- },
1200
- "target": "gemini-3.8-flash"
1201
- }
1202
- ]
1194
+ "default": "gemini-2.5-flash"
1203
1195
  },
1204
1196
  "gemini-3-pro-preview": {
1205
1197
  "default": "gemini-3-pro-preview",
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  startCommand,
4
4
  startServer
5
- } from "./chunk-RNBD6XQX.js";
5
+ } from "./chunk-YPPJDFYP.js";
6
6
  import {
7
7
  BuiltinCommandLoader,
8
8
  CommandService,
@@ -45,11 +45,11 @@ import {
45
45
  updateExtension,
46
46
  validateAuthMethod,
47
47
  validateContextFilePath
48
- } from "./chunk-76P7AV5J.js";
48
+ } from "./chunk-G7EMTV2Q.js";
49
49
  import {
50
50
  exitCli,
51
51
  require_source
52
- } from "./chunk-SJ64DOGM.js";
52
+ } from "./chunk-ODU7Z2RJ.js";
53
53
  import {
54
54
  appEvents
55
55
  } from "./chunk-5PS3AYFU.js";
@@ -89,12 +89,12 @@ import {
89
89
  saveModelChange,
90
90
  setAmbiguousCharactersWide,
91
91
  stripAnsi
92
- } from "./chunk-2BG2OMW3.js";
92
+ } from "./chunk-VCO4TMD6.js";
93
93
  import {
94
94
  RELAUNCH_EXIT_CODE,
95
95
  require_semver
96
- } from "./chunk-6HF2HP2S.js";
97
- import "./chunk-4HG5TEPY.js";
96
+ } from "./chunk-KKKD4FID.js";
97
+ import "./chunk-44PCK4QK.js";
98
98
  import {
99
99
  cleanupCheckpoints,
100
100
  registerCleanup,
@@ -103,7 +103,7 @@ import {
103
103
  runExitCleanup,
104
104
  runSyncCleanup,
105
105
  setupSignalHandlers
106
- } from "./chunk-THOV46FY.js";
106
+ } from "./chunk-WEP47ZZU.js";
107
107
  import {
108
108
  ASK_USER_TOOL_NAME,
109
109
  AjvJsonSchemaValidator,
@@ -289,7 +289,7 @@ import {
289
289
  updatePolicy,
290
290
  writeToStderr,
291
291
  writeToStdout
292
- } from "./chunk-5FYAQBC3.js";
292
+ } from "./chunk-L57AYV6U.js";
293
293
  import "./chunk-664ZODQF.js";
294
294
  import "./chunk-IUUIT4SU.js";
295
295
  import "./chunk-L6PII3GR.js";
@@ -6512,6 +6512,57 @@ async function validateExtension(args) {
6512
6512
  `Warning: Version '${extensionConfig.version}' does not appear to be standard semver (e.g., 1.0.0).`
6513
6513
  );
6514
6514
  }
6515
+ if (extensionConfig.mcpServers) {
6516
+ if (typeof extensionConfig.mcpServers !== "object" || extensionConfig.mcpServers === null || Array.isArray(extensionConfig.mcpServers)) {
6517
+ errors.push('The "mcpServers" field must be an object.');
6518
+ } else {
6519
+ for (const [serverName, serverConfig] of Object.entries(
6520
+ extensionConfig.mcpServers
6521
+ )) {
6522
+ if (typeof serverConfig !== "object" || serverConfig === null || Array.isArray(serverConfig)) {
6523
+ errors.push(
6524
+ `MCP server configuration for "${serverName}" must be an object.`
6525
+ );
6526
+ continue;
6527
+ }
6528
+ const hasCommand = typeof serverConfig.command === "string" && serverConfig.command.trim().length > 0;
6529
+ const hasUrl = typeof serverConfig.url === "string" && serverConfig.url.trim().length > 0;
6530
+ const hasHttpUrl = typeof serverConfig.httpUrl === "string" && serverConfig.httpUrl.trim().length > 0;
6531
+ const hasTcp = typeof serverConfig.tcp === "string" && serverConfig.tcp.trim().length > 0 || typeof serverConfig.tcp === "number";
6532
+ if (!hasCommand && !hasUrl && !hasHttpUrl && !hasTcp) {
6533
+ errors.push(
6534
+ `MCP server "${serverName}" must specify a transport (e.g., "command", "url", or "httpUrl").`
6535
+ );
6536
+ }
6537
+ if (hasHttpUrl) {
6538
+ warnings.push(
6539
+ `MCP server "${serverName}" uses deprecated "httpUrl". Consider using "url" with "type": "http" instead.`
6540
+ );
6541
+ }
6542
+ const errorPrefix = `MCP server "${serverName}" specifies an invalid `;
6543
+ if (hasUrl && serverConfig.url) {
6544
+ const hasPlaceholder = serverConfig.url.includes("$");
6545
+ if (!hasPlaceholder) {
6546
+ try {
6547
+ new URL(serverConfig.url);
6548
+ } catch {
6549
+ errors.push(`${errorPrefix}URL: "${serverConfig.url}".`);
6550
+ }
6551
+ }
6552
+ }
6553
+ if (hasHttpUrl && serverConfig.httpUrl) {
6554
+ const hasPlaceholder = serverConfig.httpUrl.includes("$");
6555
+ if (!hasPlaceholder) {
6556
+ try {
6557
+ new URL(serverConfig.httpUrl);
6558
+ } catch {
6559
+ errors.push(`${errorPrefix}httpUrl: "${serverConfig.httpUrl}".`);
6560
+ }
6561
+ }
6562
+ }
6563
+ }
6564
+ }
6565
+ }
6515
6566
  if (warnings.length > 0) {
6516
6567
  debugLogger.warn("Validation warnings:");
6517
6568
  for (const warning of warnings) {
@@ -6956,8 +7007,10 @@ var EVENT_MAPPING = {
6956
7007
  PostToolUse: "AfterTool",
6957
7008
  UserPromptSubmit: "BeforeAgent",
6958
7009
  Stop: "AfterAgent",
6959
- SubAgentStop: "AfterAgent",
7010
+ SubagentStop: "AfterAgent",
6960
7011
  // Gemini doesn't have sub-agents, map to AfterAgent
7012
+ SubAgentStop: "AfterAgent",
7013
+ // Fallback for alternate casing
6961
7014
  SessionStart: "SessionStart",
6962
7015
  SessionEnd: "SessionEnd",
6963
7016
  PreCompact: "PreCompress",
@@ -7045,7 +7098,10 @@ function migrateClaudeHooks(claudeConfig) {
7045
7098
  }
7046
7099
  return migratedDef;
7047
7100
  });
7048
- geminiHooks[geminiEventName] = migratedDefinitions;
7101
+ geminiHooks[geminiEventName] = [
7102
+ ...geminiHooks[geminiEventName] || [],
7103
+ ...migratedDefinitions
7104
+ ];
7049
7105
  }
7050
7106
  return geminiHooks;
7051
7107
  }
@@ -8324,7 +8380,7 @@ async function loadSandboxConfig(settings, argv) {
8324
8380
  }
8325
8381
  const command2 = getSandboxCommand(sandboxValue);
8326
8382
  const packageJson = await getPackageJson(__dirname3);
8327
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.67.0-preview.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
8383
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.68.0-preview.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
8328
8384
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
8329
8385
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
8330
8386
  }
@@ -11392,6 +11448,45 @@ function isRecord3(value) {
11392
11448
  }
11393
11449
  var execAsync = promisify(exec);
11394
11450
  var execFileAsync = promisify(execFile);
11451
+ var PODMAN_INFO_TIMEOUT_MS = 5e3;
11452
+ async function isPodmanRootless() {
11453
+ const formats = [
11454
+ "{{.Host.Security.Rootless}}",
11455
+ "{{.Host.ServiceIsRootless}}"
11456
+ ];
11457
+ for (const format3 of formats) {
11458
+ try {
11459
+ const { stdout } = await execFileAsync(
11460
+ "podman",
11461
+ ["info", "--format", format3],
11462
+ {
11463
+ encoding: "utf-8",
11464
+ timeout: PODMAN_INFO_TIMEOUT_MS,
11465
+ killSignal: "SIGKILL"
11466
+ }
11467
+ );
11468
+ const trimmed = String(stdout ?? "").trim().toLowerCase();
11469
+ if (trimmed === "true") {
11470
+ return true;
11471
+ }
11472
+ if (trimmed === "false") {
11473
+ return false;
11474
+ }
11475
+ } catch (err) {
11476
+ const isMissingBinary = isNodeError(err) && err.code === "ENOENT";
11477
+ const timedOut = isRecord3(err) && err["killed"] === true;
11478
+ if (isMissingBinary || timedOut) {
11479
+ break;
11480
+ }
11481
+ }
11482
+ }
11483
+ return false;
11484
+ }
11485
+ function hasUsernsFlag(flags) {
11486
+ return flags.some(
11487
+ (flag) => flag === "--userns" || flag.startsWith("--userns=")
11488
+ );
11489
+ }
11395
11490
  async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
11396
11491
  const patcher = new ConsolePatcher({
11397
11492
  debugMode: cliConfig?.getDebugMode() || !!process.env["DEBUG"],
@@ -11730,12 +11825,10 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
11730
11825
  if (config.command === "runsc") {
11731
11826
  args.push("--runtime=runsc");
11732
11827
  }
11733
- if (process.env["SANDBOX_FLAGS"]) {
11734
- const flags = (0, import_shell_quote2.parse)(process.env["SANDBOX_FLAGS"], process.env).filter(
11735
- (f) => typeof f === "string"
11736
- );
11737
- args.push(...flags);
11738
- }
11828
+ const customFlags = process.env["SANDBOX_FLAGS"] ? (0, import_shell_quote2.parse)(process.env["SANDBOX_FLAGS"], process.env).filter(
11829
+ (f) => typeof f === "string"
11830
+ ) : [];
11831
+ args.push(...customFlags);
11739
11832
  if (process.stdin.isTTY) {
11740
11833
  args.push("-t");
11741
11834
  }
@@ -12048,6 +12141,9 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
12048
12141
  userFlag = "--user root";
12049
12142
  } else if (await shouldUseCurrentUserInSandbox()) {
12050
12143
  args.push("--user", "root");
12144
+ if (command2 === "podman" && !hasUsernsFlag(customFlags) && await isPodmanRootless()) {
12145
+ args.push("--userns=keep-id");
12146
+ }
12051
12147
  const uid = (await execAsync("id -u")).stdout.trim();
12052
12148
  const gid = (await execAsync("id -g")).stdout.trim();
12053
12149
  const username = "gemini";
@@ -12952,7 +13048,7 @@ async function runNonInteractive({
12952
13048
  }
12953
13049
  });
12954
13050
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
12955
- const { setupInitialActivityLogger } = await import("./devtoolsService-ALST4BXH.js");
13051
+ const { setupInitialActivityLogger } = await import("./devtoolsService-V3OEHE5V.js");
12956
13052
  setupInitialActivityLogger(config);
12957
13053
  }
12958
13054
  const { stdout: workingStdout } = createWorkingStdio();
@@ -13480,7 +13576,7 @@ async function runNonInteractive2(params) {
13480
13576
  }
13481
13577
  });
13482
13578
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
13483
- const { setupInitialActivityLogger } = await import("./devtoolsService-ALST4BXH.js");
13579
+ const { setupInitialActivityLogger } = await import("./devtoolsService-V3OEHE5V.js");
13484
13580
  setupInitialActivityLogger(config);
13485
13581
  }
13486
13582
  const { stdout: workingStdout } = createWorkingStdio();
@@ -17730,9 +17826,11 @@ var AcpSessionManager = class {
17730
17826
  currentModelId
17731
17827
  }
17732
17828
  };
17733
- session.streamHistory(messages).catch((err) => {
17829
+ try {
17830
+ await session.streamHistory(messages);
17831
+ } catch (err) {
17734
17832
  debugLogger.error(`Error streaming history: ${err}`);
17735
- });
17833
+ }
17736
17834
  setTimeout(() => {
17737
17835
  session?.sendAvailableCommands().catch((err) => {
17738
17836
  debugLogger.error(`Error sending available commands: ${err}`);
@@ -18641,7 +18739,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
18641
18739
  }
18642
18740
  }
18643
18741
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
18644
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-3B2SSFOJ.js");
18742
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-F5RRE2VJ.js");
18645
18743
  await doStartUI(
18646
18744
  config,
18647
18745
  settings,
@@ -18866,7 +18964,7 @@ ${finalArgs[promptIndex + 1]}`;
18866
18964
  await config.storage.initialize();
18867
18965
  adminControlsListner.setConfig(config);
18868
18966
  if (config.isInteractive() && settings.merged.general.devtools) {
18869
- const { setupInitialActivityLogger } = await import("./devtoolsService-ALST4BXH.js");
18967
+ const { setupInitialActivityLogger } = await import("./devtoolsService-V3OEHE5V.js");
18870
18968
  setupInitialActivityLogger(config);
18871
18969
  }
18872
18970
  registerTelemetryConfig(config);
@@ -18925,7 +19023,7 @@ ${finalArgs[promptIndex + 1]}`;
18925
19023
  const initAppHandle = startupProfiler.start("initialize_app");
18926
19024
  const initializationResult = await initializeApp(config, settings);
18927
19025
  initAppHandle?.end();
18928
- import("./liteRtServerManager-M6NTFF5C.js").then(({ LiteRtServerManager }) => {
19026
+ import("./liteRtServerManager-JTOIS4KU.js").then(({ LiteRtServerManager }) => {
18929
19027
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
18930
19028
  if (!mergedGemma) return;
18931
19029
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  startCommand,
4
4
  startServer
5
- } from "./chunk-FPCAOQBY.js";
5
+ } from "./chunk-XPTXBYQQ.js";
6
6
  import {
7
7
  BuiltinCommandLoader,
8
8
  CommandService,
@@ -45,11 +45,11 @@ import {
45
45
  updateExtension,
46
46
  validateAuthMethod,
47
47
  validateContextFilePath
48
- } from "./chunk-BFZQO5OI.js";
48
+ } from "./chunk-BKVNBJ5C.js";
49
49
  import {
50
50
  exitCli,
51
51
  require_source
52
- } from "./chunk-WTMW35TZ.js";
52
+ } from "./chunk-XVNEFQR3.js";
53
53
  import {
54
54
  appEvents
55
55
  } from "./chunk-5PS3AYFU.js";
@@ -89,12 +89,12 @@ import {
89
89
  saveModelChange,
90
90
  setAmbiguousCharactersWide,
91
91
  stripAnsi
92
- } from "./chunk-QVUC4J7B.js";
92
+ } from "./chunk-6A5BTTNC.js";
93
93
  import {
94
94
  RELAUNCH_EXIT_CODE,
95
95
  require_semver
96
- } from "./chunk-WANMK7VA.js";
97
- import "./chunk-SAQV5Q3G.js";
96
+ } from "./chunk-LQDISFTJ.js";
97
+ import "./chunk-ZEK4UYYW.js";
98
98
  import {
99
99
  cleanupCheckpoints,
100
100
  registerCleanup,
@@ -103,7 +103,7 @@ import {
103
103
  runExitCleanup,
104
104
  runSyncCleanup,
105
105
  setupSignalHandlers
106
- } from "./chunk-FYX6LSG6.js";
106
+ } from "./chunk-OZOUOK43.js";
107
107
  import {
108
108
  ASK_USER_TOOL_NAME,
109
109
  AjvJsonSchemaValidator,
@@ -273,7 +273,7 @@ import {
273
273
  updatePolicy,
274
274
  writeToStderr,
275
275
  writeToStdout
276
- } from "./chunk-HWPQINPO.js";
276
+ } from "./chunk-ZZOOHVBL.js";
277
277
  import "./chunk-664ZODQF.js";
278
278
  import "./chunk-IUUIT4SU.js";
279
279
  import "./chunk-L6PII3GR.js";
@@ -6496,6 +6496,57 @@ async function validateExtension(args) {
6496
6496
  `Warning: Version '${extensionConfig.version}' does not appear to be standard semver (e.g., 1.0.0).`
6497
6497
  );
6498
6498
  }
6499
+ if (extensionConfig.mcpServers) {
6500
+ if (typeof extensionConfig.mcpServers !== "object" || extensionConfig.mcpServers === null || Array.isArray(extensionConfig.mcpServers)) {
6501
+ errors.push('The "mcpServers" field must be an object.');
6502
+ } else {
6503
+ for (const [serverName, serverConfig] of Object.entries(
6504
+ extensionConfig.mcpServers
6505
+ )) {
6506
+ if (typeof serverConfig !== "object" || serverConfig === null || Array.isArray(serverConfig)) {
6507
+ errors.push(
6508
+ `MCP server configuration for "${serverName}" must be an object.`
6509
+ );
6510
+ continue;
6511
+ }
6512
+ const hasCommand = typeof serverConfig.command === "string" && serverConfig.command.trim().length > 0;
6513
+ const hasUrl = typeof serverConfig.url === "string" && serverConfig.url.trim().length > 0;
6514
+ const hasHttpUrl = typeof serverConfig.httpUrl === "string" && serverConfig.httpUrl.trim().length > 0;
6515
+ const hasTcp = typeof serverConfig.tcp === "string" && serverConfig.tcp.trim().length > 0 || typeof serverConfig.tcp === "number";
6516
+ if (!hasCommand && !hasUrl && !hasHttpUrl && !hasTcp) {
6517
+ errors.push(
6518
+ `MCP server "${serverName}" must specify a transport (e.g., "command", "url", or "httpUrl").`
6519
+ );
6520
+ }
6521
+ if (hasHttpUrl) {
6522
+ warnings.push(
6523
+ `MCP server "${serverName}" uses deprecated "httpUrl". Consider using "url" with "type": "http" instead.`
6524
+ );
6525
+ }
6526
+ const errorPrefix = `MCP server "${serverName}" specifies an invalid `;
6527
+ if (hasUrl && serverConfig.url) {
6528
+ const hasPlaceholder = serverConfig.url.includes("$");
6529
+ if (!hasPlaceholder) {
6530
+ try {
6531
+ new URL(serverConfig.url);
6532
+ } catch {
6533
+ errors.push(`${errorPrefix}URL: "${serverConfig.url}".`);
6534
+ }
6535
+ }
6536
+ }
6537
+ if (hasHttpUrl && serverConfig.httpUrl) {
6538
+ const hasPlaceholder = serverConfig.httpUrl.includes("$");
6539
+ if (!hasPlaceholder) {
6540
+ try {
6541
+ new URL(serverConfig.httpUrl);
6542
+ } catch {
6543
+ errors.push(`${errorPrefix}httpUrl: "${serverConfig.httpUrl}".`);
6544
+ }
6545
+ }
6546
+ }
6547
+ }
6548
+ }
6549
+ }
6499
6550
  if (warnings.length > 0) {
6500
6551
  debugLogger.warn("Validation warnings:");
6501
6552
  for (const warning of warnings) {
@@ -6940,8 +6991,10 @@ var EVENT_MAPPING = {
6940
6991
  PostToolUse: "AfterTool",
6941
6992
  UserPromptSubmit: "BeforeAgent",
6942
6993
  Stop: "AfterAgent",
6943
- SubAgentStop: "AfterAgent",
6994
+ SubagentStop: "AfterAgent",
6944
6995
  // Gemini doesn't have sub-agents, map to AfterAgent
6996
+ SubAgentStop: "AfterAgent",
6997
+ // Fallback for alternate casing
6945
6998
  SessionStart: "SessionStart",
6946
6999
  SessionEnd: "SessionEnd",
6947
7000
  PreCompact: "PreCompress",
@@ -7029,7 +7082,10 @@ function migrateClaudeHooks(claudeConfig) {
7029
7082
  }
7030
7083
  return migratedDef;
7031
7084
  });
7032
- geminiHooks[geminiEventName] = migratedDefinitions;
7085
+ geminiHooks[geminiEventName] = [
7086
+ ...geminiHooks[geminiEventName] || [],
7087
+ ...migratedDefinitions
7088
+ ];
7033
7089
  }
7034
7090
  return geminiHooks;
7035
7091
  }
@@ -8308,7 +8364,7 @@ async function loadSandboxConfig(settings, argv) {
8308
8364
  }
8309
8365
  const command2 = getSandboxCommand(sandboxValue);
8310
8366
  const packageJson = await getPackageJson(__dirname3);
8311
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.67.0-preview.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
8367
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.68.0-preview.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
8312
8368
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
8313
8369
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
8314
8370
  }
@@ -11376,6 +11432,45 @@ function isRecord3(value) {
11376
11432
  }
11377
11433
  var execAsync = promisify(exec);
11378
11434
  var execFileAsync = promisify(execFile);
11435
+ var PODMAN_INFO_TIMEOUT_MS = 5e3;
11436
+ async function isPodmanRootless() {
11437
+ const formats = [
11438
+ "{{.Host.Security.Rootless}}",
11439
+ "{{.Host.ServiceIsRootless}}"
11440
+ ];
11441
+ for (const format3 of formats) {
11442
+ try {
11443
+ const { stdout } = await execFileAsync(
11444
+ "podman",
11445
+ ["info", "--format", format3],
11446
+ {
11447
+ encoding: "utf-8",
11448
+ timeout: PODMAN_INFO_TIMEOUT_MS,
11449
+ killSignal: "SIGKILL"
11450
+ }
11451
+ );
11452
+ const trimmed = String(stdout ?? "").trim().toLowerCase();
11453
+ if (trimmed === "true") {
11454
+ return true;
11455
+ }
11456
+ if (trimmed === "false") {
11457
+ return false;
11458
+ }
11459
+ } catch (err) {
11460
+ const isMissingBinary = isNodeError(err) && err.code === "ENOENT";
11461
+ const timedOut = isRecord3(err) && err["killed"] === true;
11462
+ if (isMissingBinary || timedOut) {
11463
+ break;
11464
+ }
11465
+ }
11466
+ }
11467
+ return false;
11468
+ }
11469
+ function hasUsernsFlag(flags) {
11470
+ return flags.some(
11471
+ (flag) => flag === "--userns" || flag.startsWith("--userns=")
11472
+ );
11473
+ }
11379
11474
  async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
11380
11475
  const patcher = new ConsolePatcher({
11381
11476
  debugMode: cliConfig?.getDebugMode() || !!process.env["DEBUG"],
@@ -11714,12 +11809,10 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
11714
11809
  if (config.command === "runsc") {
11715
11810
  args.push("--runtime=runsc");
11716
11811
  }
11717
- if (process.env["SANDBOX_FLAGS"]) {
11718
- const flags = (0, import_shell_quote2.parse)(process.env["SANDBOX_FLAGS"], process.env).filter(
11719
- (f) => typeof f === "string"
11720
- );
11721
- args.push(...flags);
11722
- }
11812
+ const customFlags = process.env["SANDBOX_FLAGS"] ? (0, import_shell_quote2.parse)(process.env["SANDBOX_FLAGS"], process.env).filter(
11813
+ (f) => typeof f === "string"
11814
+ ) : [];
11815
+ args.push(...customFlags);
11723
11816
  if (process.stdin.isTTY) {
11724
11817
  args.push("-t");
11725
11818
  }
@@ -12032,6 +12125,9 @@ async function start_sandbox(config, nodeArgs = [], cliConfig, cliArgs = []) {
12032
12125
  userFlag = "--user root";
12033
12126
  } else if (await shouldUseCurrentUserInSandbox()) {
12034
12127
  args.push("--user", "root");
12128
+ if (command2 === "podman" && !hasUsernsFlag(customFlags) && await isPodmanRootless()) {
12129
+ args.push("--userns=keep-id");
12130
+ }
12035
12131
  const uid = (await execAsync("id -u")).stdout.trim();
12036
12132
  const gid = (await execAsync("id -g")).stdout.trim();
12037
12133
  const username = "gemini";
@@ -12936,7 +13032,7 @@ async function runNonInteractive({
12936
13032
  }
12937
13033
  });
12938
13034
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
12939
- const { setupInitialActivityLogger } = await import("./devtoolsService-GPRO4RRU.js");
13035
+ const { setupInitialActivityLogger } = await import("./devtoolsService-3G5ZA3JV.js");
12940
13036
  setupInitialActivityLogger(config);
12941
13037
  }
12942
13038
  const { stdout: workingStdout } = createWorkingStdio();
@@ -13464,7 +13560,7 @@ async function runNonInteractive2(params) {
13464
13560
  }
13465
13561
  });
13466
13562
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
13467
- const { setupInitialActivityLogger } = await import("./devtoolsService-GPRO4RRU.js");
13563
+ const { setupInitialActivityLogger } = await import("./devtoolsService-3G5ZA3JV.js");
13468
13564
  setupInitialActivityLogger(config);
13469
13565
  }
13470
13566
  const { stdout: workingStdout } = createWorkingStdio();
@@ -17714,9 +17810,11 @@ var AcpSessionManager = class {
17714
17810
  currentModelId
17715
17811
  }
17716
17812
  };
17717
- session.streamHistory(messages).catch((err) => {
17813
+ try {
17814
+ await session.streamHistory(messages);
17815
+ } catch (err) {
17718
17816
  debugLogger.error(`Error streaming history: ${err}`);
17719
- });
17817
+ }
17720
17818
  setTimeout(() => {
17721
17819
  session?.sendAvailableCommands().catch((err) => {
17722
17820
  debugLogger.error(`Error sending available commands: ${err}`);
@@ -18625,7 +18723,7 @@ async function resolveSessionId(resumeArg, sessionIdArg, sessionFileArg) {
18625
18723
  }
18626
18724
  }
18627
18725
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
18628
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-QUIZ4FA2.js");
18726
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-I75IWUIA.js");
18629
18727
  await doStartUI(
18630
18728
  config,
18631
18729
  settings,
@@ -18850,7 +18948,7 @@ ${finalArgs[promptIndex + 1]}`;
18850
18948
  await config.storage.initialize();
18851
18949
  adminControlsListner.setConfig(config);
18852
18950
  if (config.isInteractive() && settings.merged.general.devtools) {
18853
- const { setupInitialActivityLogger } = await import("./devtoolsService-GPRO4RRU.js");
18951
+ const { setupInitialActivityLogger } = await import("./devtoolsService-3G5ZA3JV.js");
18854
18952
  setupInitialActivityLogger(config);
18855
18953
  }
18856
18954
  registerTelemetryConfig(config);
@@ -18909,7 +19007,7 @@ ${finalArgs[promptIndex + 1]}`;
18909
19007
  const initAppHandle = startupProfiler.start("initialize_app");
18910
19008
  const initializationResult = await initializeApp(config, settings);
18911
19009
  initAppHandle?.end();
18912
- import("./liteRtServerManager-AQUTLRTC.js").then(({ LiteRtServerManager }) => {
19010
+ import("./liteRtServerManager-UVQ2I6NL.js").then(({ LiteRtServerManager }) => {
18913
19011
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
18914
19012
  if (!mergedGemma) return;
18915
19013
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;