@google/gemini-cli 0.40.0-preview.2 → 0.40.0-preview.4

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 (66) hide show
  1. package/bundle/{chunk-3GU3LF3I.js → chunk-4XVBQQNJ.js} +181 -16
  2. package/bundle/{chunk-PLUWJHZZ.js → chunk-547AWTTH.js} +238 -61
  3. package/bundle/{chunk-EFCQXWIF.js → chunk-63PTTRTA.js} +3 -3
  4. package/bundle/{chunk-IMEC72NS.js → chunk-ATGIEBEB.js} +1 -1
  5. package/bundle/{chunk-WL5MCPV2.js → chunk-BV2W6YE6.js} +2 -2
  6. package/bundle/{chunk-QK7UWGBN.js → chunk-CIO3GUGQ.js} +1382 -1083
  7. package/bundle/{chunk-HV36F4CL.js → chunk-CJQVVQSH.js} +134 -354
  8. package/bundle/{chunk-VCGILCZV.js → chunk-F73F75XM.js} +16 -0
  9. package/bundle/{chunk-TDW6FM3A.js → chunk-G356GKHH.js} +1 -1
  10. package/bundle/{chunk-4IJPDKI6.js → chunk-H4NQBTXN.js} +146 -364
  11. package/bundle/{chunk-GXRQOXQF.js → chunk-H7F2VOIJ.js} +178 -14
  12. package/bundle/chunk-HF7X35D3.js +80012 -0
  13. package/bundle/{chunk-WHIWQCI5.js → chunk-HGFADN5A.js} +1 -1
  14. package/bundle/{chunk-NO7STVVM.js → chunk-KG7ZFMJL.js} +1413 -1089
  15. package/bundle/{chunk-33ANPP4S.js → chunk-LMVZLINC.js} +3 -3
  16. package/bundle/chunk-LODNDE3S.js +17505 -0
  17. package/bundle/{chunk-IUVLJUOL.js → chunk-LVHUYMBU.js} +2 -2
  18. package/bundle/{chunk-NIVCRM5L.js → chunk-M76FWZ5L.js} +134 -354
  19. package/bundle/{chunk-RM43GNQQ.js → chunk-NV6UCR4K.js} +7711 -12909
  20. package/bundle/{chunk-MUGUV6RZ.js → chunk-PRZIW6SM.js} +2 -2
  21. package/bundle/chunk-RENFZ63F.js +351149 -0
  22. package/bundle/chunk-SYPUOR3U.js +156 -0
  23. package/bundle/{chunk-2RHFUIH4.js → chunk-UHHRGNIO.js} +16 -0
  24. package/bundle/chunk-VQ7N6NVX.js +1571 -0
  25. package/bundle/{chunk-UBXB5AEJ.js → chunk-WSTHO4WR.js} +3 -3
  26. package/bundle/chunk-ZQNX6OWU.js +118 -0
  27. package/bundle/{cleanup-A7WXWAMI.js → cleanup-4EFDM2N7.js} +3 -3
  28. package/bundle/{cleanup-EWPIME2M.js → cleanup-4RRVO4GO.js} +3 -3
  29. package/bundle/{cleanup-IPLJJT5S.js → cleanup-DNS7PXYC.js} +3 -3
  30. package/bundle/cleanup-DXHNV2J6.js +33 -0
  31. package/bundle/{core-VCDK23ZC.js → core-WQSFCPEO.js} +28 -2
  32. package/bundle/{devtoolsService-6Y6YER6T.js → devtoolsService-JWET4G6G.js} +3 -3
  33. package/bundle/{devtoolsService-B5VVZ752.js → devtoolsService-LPEBYJVD.js} +3 -3
  34. package/bundle/{devtoolsService-2JXSALRU.js → devtoolsService-S2LBUUZU.js} +5 -4
  35. package/bundle/devtoolsService-YCRNWWXE.js +852 -0
  36. package/bundle/{dist-UIXQETMC.js → dist-ANTOB3YW.js} +28 -2
  37. package/bundle/{core-BQT6T3CH.js → dist-RIVCP5ZD.js} +28 -2
  38. package/bundle/dist-UH565MTG.js +2046 -0
  39. package/bundle/docs/cli/cli-reference.md +1 -0
  40. package/bundle/docs/cli/trusted-folders.md +28 -0
  41. package/bundle/docs/reference/configuration.md +14 -0
  42. package/bundle/{gemini-ID44Z5SV.js → gemini-27FQ5BI4.js} +66 -22
  43. package/bundle/{gemini-54LH6RUH.js → gemini-57EC2ZF7.js} +241 -182
  44. package/bundle/{gemini-44W2QEZI.js → gemini-JAZVYRDD.js} +64 -21
  45. package/bundle/gemini-TQZRS37Q.js +16087 -0
  46. package/bundle/gemini.js +3 -3
  47. package/bundle/{interactiveCli-5MTJDFYC.js → interactiveCli-E35R6QQC.js} +17 -167
  48. package/bundle/{interactiveCli-JFBPGMNM.js → interactiveCli-FPHSBRV3.js} +30 -179
  49. package/bundle/{interactiveCli-5B3X6RNB.js → interactiveCli-L3EK4XEX.js} +300 -432
  50. package/bundle/interactiveCli-MVHR4VV7.js +34448 -0
  51. package/bundle/{liteRtServerManager-76V63PRJ.js → liteRtServerManager-LXEAYAUP.js} +4 -4
  52. package/bundle/{liteRtServerManager-WQMDPACQ.js → liteRtServerManager-ORSW3R4F.js} +4 -4
  53. package/bundle/{liteRtServerManager-6GJWEP5W.js → liteRtServerManager-PI4ZNFB5.js} +4 -4
  54. package/bundle/liteRtServerManager-YYXO5Q3I.js +65 -0
  55. package/bundle/{memoryDiscovery-RYHYLAPJ.js → memoryDiscovery-CZURD35O.js} +1 -1
  56. package/bundle/{memoryDiscovery-HWEYBJE7.js → memoryDiscovery-GZLXKRGB.js} +1 -1
  57. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  58. package/bundle/{oauth2-provider-EX6SQEZP.js → oauth2-provider-B3NTBNAM.js} +2 -2
  59. package/bundle/{oauth2-provider-ZF52AWQY.js → oauth2-provider-ENF2D4Q7.js} +39 -73
  60. package/bundle/{oauth2-provider-JCKLNKRV.js → oauth2-provider-I3G773GE.js} +2 -2
  61. package/bundle/oauth2-provider-WTF7AHQ2.js +237 -0
  62. package/bundle/{start-CYDJTOAP.js → start-CRIFZ3SW.js} +6 -6
  63. package/bundle/{start-SHOUHW3Y.js → start-KVFKS3IT.js} +6 -6
  64. package/bundle/{start-B6EMQCH5.js → start-OTLGMCNH.js} +6 -6
  65. package/bundle/start-S3REI3X2.js +18 -0
  66. package/package.json +1 -1
@@ -24,6 +24,7 @@ import {
24
24
  initializeApp,
25
25
  installSkill,
26
26
  isAlternateBufferEnabled,
27
+ isRecord,
27
28
  isSlashCommand,
28
29
  linkSkill,
29
30
  normalizeServerId,
@@ -42,18 +43,18 @@ import {
42
43
  updateAllUpdatableExtensions,
43
44
  updateExtension,
44
45
  validateAuthMethod
45
- } from "./chunk-GXRQOXQF.js";
46
+ } from "./chunk-H7F2VOIJ.js";
46
47
  import {
47
48
  appEvents
48
49
  } from "./chunk-5PS3AYFU.js";
49
50
  import {
50
51
  startCommand,
51
52
  startServer
52
- } from "./chunk-33ANPP4S.js";
53
+ } from "./chunk-63PTTRTA.js";
53
54
  import {
54
55
  exitCli,
55
56
  require_source
56
- } from "./chunk-WHIWQCI5.js";
57
+ } from "./chunk-VQ7N6NVX.js";
57
58
  import {
58
59
  DEFAULT_PORT,
59
60
  GEMMA_MODEL_NAME,
@@ -87,7 +88,7 @@ import {
87
88
  readServerProcessInfo,
88
89
  resolveGemmaConfig,
89
90
  saveModelChange
90
- } from "./chunk-4IJPDKI6.js";
91
+ } from "./chunk-M76FWZ5L.js";
91
92
  import {
92
93
  cleanupCheckpoints,
93
94
  registerCleanup,
@@ -96,7 +97,7 @@ import {
96
97
  runExitCleanup,
97
98
  runSyncCleanup,
98
99
  setupSignalHandlers
99
- } from "./chunk-MUGUV6RZ.js";
100
+ } from "./chunk-PRZIW6SM.js";
100
101
  import {
101
102
  AuthType,
102
103
  ChatRecordingService,
@@ -183,7 +184,7 @@ import {
183
184
  updatePolicy,
184
185
  writeToStderr,
185
186
  writeToStdout
186
- } from "./chunk-RM43GNQQ.js";
187
+ } from "./chunk-KG7ZFMJL.js";
187
188
  import {
188
189
  ASK_USER_TOOL_NAME,
189
190
  DEFAULT_FILE_FILTERING_OPTIONS,
@@ -202,6 +203,7 @@ import {
202
203
  FatalSandboxError,
203
204
  FatalToolExecutionError,
204
205
  FatalTurnLimitedError,
206
+ FatalUntrustedWorkspaceError,
205
207
  GEMINI_DIR,
206
208
  GEMINI_MODEL_ALIAS_AUTO,
207
209
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
@@ -226,7 +228,7 @@ import {
226
228
  loadServerHierarchicalMemory,
227
229
  resolveToRealPath,
228
230
  setGeminiMdFilename
229
- } from "./chunk-2RHFUIH4.js";
231
+ } from "./chunk-UHHRGNIO.js";
230
232
  import "./chunk-664ZODQF.js";
231
233
  import "./chunk-RJTRUG2J.js";
232
234
  import "./chunk-IUUIT4SU.js";
@@ -7952,7 +7954,7 @@ async function loadSandboxConfig(settings, argv) {
7952
7954
  }
7953
7955
  const command2 = getSandboxCommand(sandboxValue);
7954
7956
  const packageJson = await getPackageJson(__dirname3);
7955
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.40.0-preview.2" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7957
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.40.0-preview.3" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7956
7958
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7957
7959
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7958
7960
  }
@@ -8164,6 +8166,10 @@ async function parseArguments(settings) {
8164
8166
  type: "string",
8165
8167
  nargs: 1,
8166
8168
  description: "Execute the provided prompt and continue in interactive mode"
8169
+ }).option("skip-trust", {
8170
+ type: "boolean",
8171
+ description: "Trust the current workspace for this session.",
8172
+ default: false
8167
8173
  }).option("worktree", {
8168
8174
  alias: "w",
8169
8175
  type: "string",
@@ -8285,9 +8291,16 @@ async function parseArguments(settings) {
8285
8291
  yargsInstance.wrap(yargsInstance.terminalWidth());
8286
8292
  let result;
8287
8293
  try {
8288
- result = await yargsInstance.parse();
8294
+ const parsed = await yargsInstance.parse();
8295
+ if (!isRecord(parsed)) {
8296
+ throw new Error("Failed to parse arguments");
8297
+ }
8298
+ result = parsed;
8299
+ if (result["skip-trust"]) {
8300
+ process3.env["GEMINI_CLI_TRUST_WORKSPACE"] = "true";
8301
+ }
8289
8302
  } catch (e) {
8290
- const msg = e instanceof Error ? e.message : String(e);
8303
+ const msg = getErrorMessage(e);
8291
8304
  debugLogger.error(msg);
8292
8305
  yargsInstance.showHelp();
8293
8306
  await runExitCleanup();
@@ -8297,8 +8310,13 @@ async function parseArguments(settings) {
8297
8310
  await runExitCleanup();
8298
8311
  process3.exit(0);
8299
8312
  }
8300
- const queryArg = result.query;
8301
- const q = Array.isArray(queryArg) ? queryArg.join(" ") : queryArg;
8313
+ const queryArg = result["query"];
8314
+ let q;
8315
+ if (Array.isArray(queryArg)) {
8316
+ q = queryArg.join(" ");
8317
+ } else if (typeof queryArg === "string") {
8318
+ q = queryArg;
8319
+ }
8302
8320
  if (q && !result["prompt"]) {
8303
8321
  if (!isHeadlessMode()) {
8304
8322
  startupMessages.push(
@@ -8329,7 +8347,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8329
8347
  const includeDirectoryTree = settings.context?.includeDirectoryTree ?? true;
8330
8348
  const ideMode = settings.ide?.enabled ?? false;
8331
8349
  const folderTrust = process3.env["GEMINI_CLI_INTEGRATION_TEST"] === "true" || process3.env["VITEST"] === "true" ? false : settings.security?.folderTrust?.enabled ?? false;
8332
- const trustedFolder = isWorkspaceTrusted(settings, cwd, void 0, {
8350
+ const trustedFolder = isWorkspaceTrusted(settings, cwd, {
8333
8351
  prompt: argv.prompt,
8334
8352
  query: argv.query
8335
8353
  })?.isTrusted ?? false;
@@ -8358,7 +8376,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
8358
8376
  return resolveToRealPath(trimmedPath) !== realCwd;
8359
8377
  } catch (e) {
8360
8378
  debugLogger.debug(
8361
- `[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${e instanceof Error ? e.message : String(e)})`
8379
+ `[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${getErrorMessage(e)})`
8362
8380
  );
8363
8381
  return false;
8364
8382
  }
@@ -8751,7 +8769,7 @@ async function resolveWorktreeSettings(cwd) {
8751
8769
  worktreeBaseSha = stdout.trim();
8752
8770
  } catch (e) {
8753
8771
  debugLogger.debug(
8754
- `Failed to resolve worktree base SHA at ${worktreePath}: ${e instanceof Error ? e.message : String(e)}`
8772
+ `Failed to resolve worktree base SHA at ${worktreePath}: ${getErrorMessage(e)}`
8755
8773
  );
8756
8774
  }
8757
8775
  if (!worktreeBaseSha) {
@@ -9890,9 +9908,29 @@ var rootDirectoryCheck = {
9890
9908
  }
9891
9909
  }
9892
9910
  };
9911
+ var folderTrustCheck = {
9912
+ id: "folder-trust",
9913
+ priority: "high" /* High */,
9914
+ check: async (workspaceRoot, settings) => {
9915
+ if (!isFolderTrustEnabled(settings)) {
9916
+ return null;
9917
+ }
9918
+ const { isTrusted } = isWorkspaceTrusted(settings, workspaceRoot);
9919
+ if (isTrusted === true) {
9920
+ return null;
9921
+ }
9922
+ if (isHeadlessMode()) {
9923
+ throw new FatalUntrustedWorkspaceError(
9924
+ "Gemini CLI is not running in a trusted directory. To proceed, either use `--skip-trust`, set the `GEMINI_CLI_TRUST_WORKSPACE=true` environment variable, or trust this directory in interactive mode. For more details, see https://geminicli.com/docs/cli/trusted-folders/#headless-and-automated-environments"
9925
+ );
9926
+ }
9927
+ return null;
9928
+ }
9929
+ };
9893
9930
  var WARNING_CHECKS = [
9894
9931
  homeDirectoryCheck,
9895
- rootDirectoryCheck
9932
+ rootDirectoryCheck,
9933
+ folderTrustCheck
9896
9934
  ];
9897
9935
  async function getUserStartupWarnings(settings, workspaceRoot = process4.cwd(), options) {
9898
9936
  const results = await Promise.all(
@@ -10257,7 +10295,7 @@ async function runNonInteractive({
10257
10295
  }
10258
10296
  });
10259
10297
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10260
- const { setupInitialActivityLogger } = await import("./devtoolsService-6Y6YER6T.js");
10298
+ const { setupInitialActivityLogger } = await import("./devtoolsService-JWET4G6G.js");
10261
10299
  setupInitialActivityLogger(config);
10262
10300
  }
10263
10301
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10708,7 +10746,7 @@ async function runNonInteractive2(params) {
10708
10746
  }
10709
10747
  });
10710
10748
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10711
- const { setupInitialActivityLogger } = await import("./devtoolsService-6Y6YER6T.js");
10749
+ const { setupInitialActivityLogger } = await import("./devtoolsService-JWET4G6G.js");
10712
10750
  setupInitialActivityLogger(config);
10713
10751
  }
10714
10752
  const { stdout: workingStdout } = createWorkingStdio();
@@ -15557,7 +15595,7 @@ async function resolveSessionId(resumeArg) {
15557
15595
  }
15558
15596
  }
15559
15597
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
15560
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-5B3X6RNB.js");
15598
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-E35R6QQC.js");
15561
15599
  await doStartUI(
15562
15600
  config,
15563
15601
  settings,
@@ -15759,7 +15797,7 @@ ${finalArgs[promptIndex + 1]}`;
15759
15797
  await config.storage.initialize();
15760
15798
  adminControlsListner.setConfig(config);
15761
15799
  if (config.isInteractive() && settings.merged.general.devtools) {
15762
- const { setupInitialActivityLogger } = await import("./devtoolsService-6Y6YER6T.js");
15800
+ const { setupInitialActivityLogger } = await import("./devtoolsService-JWET4G6G.js");
15763
15801
  setupInitialActivityLogger(config);
15764
15802
  }
15765
15803
  registerTelemetryConfig(config);
@@ -15815,7 +15853,7 @@ ${finalArgs[promptIndex + 1]}`;
15815
15853
  const initAppHandle = startupProfiler.start("initialize_app");
15816
15854
  const initializationResult = await initializeApp(config, settings);
15817
15855
  initAppHandle?.end();
15818
- import("./liteRtServerManager-WQMDPACQ.js").then(({ LiteRtServerManager }) => {
15856
+ import("./liteRtServerManager-LXEAYAUP.js").then(({ LiteRtServerManager }) => {
15819
15857
  const mergedGemma = settings.merged.experimental?.gemmaModelRouter;
15820
15858
  if (!mergedGemma) return;
15821
15859
  const userGemma = settings.forScope("User" /* User */).settings.experimental?.gemmaModelRouter;
@@ -15848,6 +15886,11 @@ ${finalArgs[promptIndex + 1]}`;
15848
15886
  })
15849
15887
  ];
15850
15888
  cliStartupHandle?.end();
15889
+ if (!config.isInteractive()) {
15890
+ for (const warning of startupWarnings) {
15891
+ writeToStderr(warning.message + "\n");
15892
+ }
15893
+ }
15851
15894
  if (config.isInteractive()) {
15852
15895
  if (process.stdin.isTTY) {
15853
15896
  process.stdin.resume();