@google/gemini-cli 0.39.0-preview.2 → 0.39.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 (46) hide show
  1. package/bundle/{chunk-RTX4LTWK.js → chunk-APBWRLCM.js} +1590 -6638
  2. package/bundle/{chunk-3R2FLB3Z.js → chunk-BEUOMVKF.js} +1587 -6636
  3. package/bundle/{chunk-67TFD6HC.js → chunk-FNPZLVJU.js} +16 -0
  4. package/bundle/{chunk-OXCH4FS3.js → chunk-GDRLBWZL.js} +3885 -2280
  5. package/bundle/{chunk-AZ7QQWNX.js → chunk-GRNHS2XR.js} +2 -2
  6. package/bundle/{chunk-45GIY5RT.js → chunk-N6R5LJKJ.js} +2 -2
  7. package/bundle/{chunk-GX4YOB7T.js → chunk-QPDKVNK5.js} +1590 -6638
  8. package/bundle/{chunk-QM5IP3NK.js → chunk-R32ABRMT.js} +16 -0
  9. package/bundle/{chunk-N3GUGFOL.js → chunk-RNWNACRD.js} +1590 -6638
  10. package/bundle/{chunk-QC6EGBZW.js → chunk-RVSGPQMZ.js} +2 -2
  11. package/bundle/{chunk-4UUOHXDW.js → chunk-UGFPG7AM.js} +3885 -2280
  12. package/bundle/{chunk-5J5LWISO.js → chunk-UIBQS45C.js} +3885 -2280
  13. package/bundle/{chunk-TKGFTY3B.js → chunk-WFCK2Z32.js} +3916 -2286
  14. package/bundle/{chunk-SS4CWRZ5.js → chunk-ZIXTYG56.js} +2 -2
  15. package/bundle/{cleanup-3EICKDDN.js → cleanup-DORKD3KW.js} +3 -3
  16. package/bundle/{cleanup-4SLYOL44.js → cleanup-ROCPAQIR.js} +3 -3
  17. package/bundle/{cleanup-6N6E742H.js → cleanup-RV4C23S4.js} +3 -3
  18. package/bundle/{cleanup-OG2MXKZ7.js → cleanup-VFR4VRPU.js} +3 -3
  19. package/bundle/{core-KLYK3V6Z.js → core-NHADWRAT.js} +28 -2
  20. package/bundle/{devtoolsService-FS7WXGBF.js → devtoolsService-65SKYXJR.js} +3 -3
  21. package/bundle/{devtoolsService-X4577PYZ.js → devtoolsService-6GKOMHGW.js} +3 -3
  22. package/bundle/{devtoolsService-K4DENTYF.js → devtoolsService-OIMHTGLW.js} +3 -3
  23. package/bundle/{devtoolsService-RLXZWLDT.js → devtoolsService-XJQQUBHU.js} +3 -3
  24. package/bundle/{dist-5ET5G5PC.js → dist-2DBCGLDI.js} +28 -2
  25. package/bundle/{dist-DQVXGLSO.js → dist-7UL5MZ3N.js} +28 -2
  26. package/bundle/{dist-P4XAO4SC.js → dist-FMEYWTZB.js} +28 -2
  27. package/bundle/docs/cli/cli-reference.md +1 -0
  28. package/bundle/docs/cli/trusted-folders.md +28 -0
  29. package/bundle/docs/reference/configuration.md +14 -0
  30. package/bundle/{gemini-6GWCDHXK.js → gemini-APY42TPN.js} +63 -19
  31. package/bundle/{gemini-FLGPH5GJ.js → gemini-ASA6UVNB.js} +61 -18
  32. package/bundle/{gemini-NBKLSVA3.js → gemini-JN2NUSDI.js} +63 -19
  33. package/bundle/{gemini-YOFQ5KF4.js → gemini-ZVQNZBQE.js} +63 -19
  34. package/bundle/gemini.js +3 -3
  35. package/bundle/{interactiveCli-AGSLCKNH.js → interactiveCli-7OEI5K4E.js} +15 -165
  36. package/bundle/{interactiveCli-NAPN3E2K.js → interactiveCli-F6YUYJT5.js} +28 -177
  37. package/bundle/{interactiveCli-TCZBSTKU.js → interactiveCli-MSV2JUI2.js} +28 -177
  38. package/bundle/{interactiveCli-H3NLGP7Z.js → interactiveCli-WY7NQZAW.js} +28 -177
  39. package/bundle/{memoryDiscovery-MYQ3ZWKM.js → memoryDiscovery-OGUXPAKW.js} +1 -1
  40. package/bundle/{memoryDiscovery-U3XUU4QY.js → memoryDiscovery-OJZ52WPE.js} +1 -1
  41. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  42. package/bundle/{oauth2-provider-CWUR5RGE.js → oauth2-provider-5GKHTO3W.js} +2 -2
  43. package/bundle/{oauth2-provider-YKYTKUWD.js → oauth2-provider-J42P6NQU.js} +2 -2
  44. package/bundle/{oauth2-provider-EA452S4C.js → oauth2-provider-MJYS4GHA.js} +2 -2
  45. package/bundle/{oauth2-provider-LV6VPYTU.js → oauth2-provider-UI5C6WYR.js} +2 -2
  46. package/package.json +1 -1
@@ -25,7 +25,6 @@ import {
25
25
  configureSpecificSetting,
26
26
  disableSkill,
27
27
  enableSkill,
28
- execa,
29
28
  formatRelativeTime,
30
29
  getExtensionManager,
31
30
  getThemeTypeFromBackgroundColor,
@@ -35,6 +34,7 @@ import {
35
34
  installSkill,
36
35
  isAlternateBufferEnabled,
37
36
  isFolderTrustEnabled,
37
+ isRecord,
38
38
  isSlashCommand,
39
39
  isWorkspaceTrusted,
40
40
  isWorktreeEnabled,
@@ -58,7 +58,7 @@ import {
58
58
  updateAllUpdatableExtensions,
59
59
  updateExtension,
60
60
  validateAuthMethod
61
- } from "./chunk-N3GUGFOL.js";
61
+ } from "./chunk-APBWRLCM.js";
62
62
  import {
63
63
  appEvents
64
64
  } from "./chunk-5PS3AYFU.js";
@@ -70,7 +70,7 @@ import {
70
70
  runExitCleanup,
71
71
  runSyncCleanup,
72
72
  setupSignalHandlers
73
- } from "./chunk-SS4CWRZ5.js";
73
+ } from "./chunk-N6R5LJKJ.js";
74
74
  import {
75
75
  AuthType,
76
76
  ChatRecordingService,
@@ -102,6 +102,7 @@ import {
102
102
  StreamEventType,
103
103
  StreamJsonFormatter,
104
104
  ToolCallEvent,
105
+ TrustLevel,
105
106
  UserAccountManager,
106
107
  UserPromptEvent,
107
108
  ValidationCancelledError,
@@ -121,6 +122,7 @@ import {
121
122
  createWorktreeService,
122
123
  detectIdeFromEnv,
123
124
  displayContentToString,
125
+ execa,
124
126
  external_exports as external_exports2,
125
127
  geminiPartsToContentParts,
126
128
  generalistProfile,
@@ -167,7 +169,7 @@ import {
167
169
  updatePolicy,
168
170
  writeToStderr,
169
171
  writeToStdout
170
- } from "./chunk-5J5LWISO.js";
172
+ } from "./chunk-UIBQS45C.js";
171
173
  import {
172
174
  ASK_USER_TOOL_NAME,
173
175
  ApprovalMode,
@@ -188,6 +190,7 @@ import {
188
190
  FatalSandboxError,
189
191
  FatalToolExecutionError,
190
192
  FatalTurnLimitedError,
193
+ FatalUntrustedWorkspaceError,
191
194
  GEMINI_DIR,
192
195
  GEMINI_MODEL_ALIAS_AUTO,
193
196
  Kind,
@@ -214,7 +217,7 @@ import {
214
217
  loadServerHierarchicalMemory,
215
218
  resolveToRealPath,
216
219
  setGeminiMdFilename
217
- } from "./chunk-67TFD6HC.js";
220
+ } from "./chunk-FNPZLVJU.js";
218
221
  import "./chunk-664ZODQF.js";
219
222
  import "./chunk-RJTRUG2J.js";
220
223
  import "./chunk-IUUIT4SU.js";
@@ -5901,7 +5904,7 @@ async function handleInstall(args) {
5901
5904
  );
5902
5905
  if (confirmed) {
5903
5906
  const trustedFolders = loadTrustedFolders();
5904
- await trustedFolders.setValue(realPath, "TRUST_FOLDER" /* TRUST_FOLDER */);
5907
+ await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
5905
5908
  } else {
5906
5909
  throw new Error(
5907
5910
  `Installation aborted: Folder "${absolutePath}" is not trusted.`
@@ -7265,7 +7268,7 @@ async function loadSandboxConfig(settings, argv) {
7265
7268
  }
7266
7269
  const command2 = getSandboxCommand(sandboxValue);
7267
7270
  const packageJson = await getPackageJson(__dirname3);
7268
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.39.0-preview.2" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7271
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.39.1" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7269
7272
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7270
7273
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7271
7274
  }
@@ -7475,6 +7478,10 @@ async function parseArguments(settings) {
7475
7478
  type: "string",
7476
7479
  nargs: 1,
7477
7480
  description: "Execute the provided prompt and continue in interactive mode"
7481
+ }).option("skip-trust", {
7482
+ type: "boolean",
7483
+ description: "Trust the current workspace for this session.",
7484
+ default: false
7478
7485
  }).option("worktree", {
7479
7486
  alias: "w",
7480
7487
  type: "string",
@@ -7596,9 +7603,16 @@ async function parseArguments(settings) {
7596
7603
  yargsInstance.wrap(yargsInstance.terminalWidth());
7597
7604
  let result;
7598
7605
  try {
7599
- result = await yargsInstance.parse();
7606
+ const parsed = await yargsInstance.parse();
7607
+ if (!isRecord(parsed)) {
7608
+ throw new Error("Failed to parse arguments");
7609
+ }
7610
+ result = parsed;
7611
+ if (result["skip-trust"]) {
7612
+ process3.env["GEMINI_CLI_TRUST_WORKSPACE"] = "true";
7613
+ }
7600
7614
  } catch (e) {
7601
- const msg = e instanceof Error ? e.message : String(e);
7615
+ const msg = getErrorMessage(e);
7602
7616
  debugLogger.error(msg);
7603
7617
  yargsInstance.showHelp();
7604
7618
  await runExitCleanup();
@@ -7608,8 +7622,13 @@ async function parseArguments(settings) {
7608
7622
  await runExitCleanup();
7609
7623
  process3.exit(0);
7610
7624
  }
7611
- const queryArg = result.query;
7612
- const q = Array.isArray(queryArg) ? queryArg.join(" ") : queryArg;
7625
+ const queryArg = result["query"];
7626
+ let q;
7627
+ if (Array.isArray(queryArg)) {
7628
+ q = queryArg.join(" ");
7629
+ } else if (typeof queryArg === "string") {
7630
+ q = queryArg;
7631
+ }
7613
7632
  if (q && !result["prompt"]) {
7614
7633
  if (!isHeadlessMode()) {
7615
7634
  startupMessages.push(
@@ -7640,7 +7659,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
7640
7659
  const includeDirectoryTree = settings.context?.includeDirectoryTree ?? true;
7641
7660
  const ideMode = settings.ide?.enabled ?? false;
7642
7661
  const folderTrust = process3.env["GEMINI_CLI_INTEGRATION_TEST"] === "true" || process3.env["VITEST"] === "true" ? false : settings.security?.folderTrust?.enabled ?? false;
7643
- const trustedFolder = isWorkspaceTrusted(settings, cwd, void 0, {
7662
+ const trustedFolder = isWorkspaceTrusted(settings, cwd, {
7644
7663
  prompt: argv.prompt,
7645
7664
  query: argv.query
7646
7665
  })?.isTrusted ?? false;
@@ -7669,7 +7688,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
7669
7688
  return resolveToRealPath(trimmedPath) !== realCwd;
7670
7689
  } catch (e) {
7671
7690
  debugLogger.debug(
7672
- `[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${e instanceof Error ? e.message : String(e)})`
7691
+ `[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${getErrorMessage(e)})`
7673
7692
  );
7674
7693
  return false;
7675
7694
  }
@@ -8060,7 +8079,7 @@ async function resolveWorktreeSettings(cwd) {
8060
8079
  worktreeBaseSha = stdout.trim();
8061
8080
  } catch (e) {
8062
8081
  debugLogger.debug(
8063
- `Failed to resolve worktree base SHA at ${worktreePath}: ${e instanceof Error ? e.message : String(e)}`
8082
+ `Failed to resolve worktree base SHA at ${worktreePath}: ${getErrorMessage(e)}`
8064
8083
  );
8065
8084
  }
8066
8085
  if (!worktreeBaseSha) {
@@ -9195,9 +9214,29 @@ var rootDirectoryCheck = {
9195
9214
  }
9196
9215
  }
9197
9216
  };
9217
+ var folderTrustCheck = {
9218
+ id: "folder-trust",
9219
+ priority: WarningPriority.High,
9220
+ check: async (workspaceRoot, settings) => {
9221
+ if (!isFolderTrustEnabled(settings)) {
9222
+ return null;
9223
+ }
9224
+ const { isTrusted } = isWorkspaceTrusted(settings, workspaceRoot);
9225
+ if (isTrusted === true) {
9226
+ return null;
9227
+ }
9228
+ if (isHeadlessMode()) {
9229
+ throw new FatalUntrustedWorkspaceError(
9230
+ "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"
9231
+ );
9232
+ }
9233
+ return null;
9234
+ }
9235
+ };
9198
9236
  var WARNING_CHECKS = [
9199
9237
  homeDirectoryCheck,
9200
- rootDirectoryCheck
9238
+ rootDirectoryCheck,
9239
+ folderTrustCheck
9201
9240
  ];
9202
9241
  async function getUserStartupWarnings(settings, workspaceRoot = process4.cwd(), options) {
9203
9242
  const results = await Promise.all(
@@ -9562,7 +9601,7 @@ async function runNonInteractive({
9562
9601
  }
9563
9602
  });
9564
9603
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
9565
- const { setupInitialActivityLogger } = await import("./devtoolsService-X4577PYZ.js");
9604
+ const { setupInitialActivityLogger } = await import("./devtoolsService-6GKOMHGW.js");
9566
9605
  await setupInitialActivityLogger(config);
9567
9606
  }
9568
9607
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10013,7 +10052,7 @@ async function runNonInteractive2(params) {
10013
10052
  }
10014
10053
  });
10015
10054
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10016
- const { setupInitialActivityLogger } = await import("./devtoolsService-X4577PYZ.js");
10055
+ const { setupInitialActivityLogger } = await import("./devtoolsService-6GKOMHGW.js");
10017
10056
  await setupInitialActivityLogger(config);
10018
10057
  }
10019
10058
  const { stdout: workingStdout } = createWorkingStdio();
@@ -14860,7 +14899,7 @@ async function resolveSessionId(resumeArg) {
14860
14899
  }
14861
14900
  }
14862
14901
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
14863
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-H3NLGP7Z.js");
14902
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-F6YUYJT5.js");
14864
14903
  await doStartUI(
14865
14904
  config,
14866
14905
  settings,
@@ -15062,7 +15101,7 @@ ${finalArgs[promptIndex + 1]}`;
15062
15101
  await config.storage.initialize();
15063
15102
  adminControlsListner.setConfig(config);
15064
15103
  if (config.isInteractive() && settings.merged.general.devtools) {
15065
- const { setupInitialActivityLogger } = await import("./devtoolsService-X4577PYZ.js");
15104
+ const { setupInitialActivityLogger } = await import("./devtoolsService-6GKOMHGW.js");
15066
15105
  await setupInitialActivityLogger(config);
15067
15106
  }
15068
15107
  registerTelemetryConfig(config);
@@ -15141,6 +15180,11 @@ ${finalArgs[promptIndex + 1]}`;
15141
15180
  })
15142
15181
  ];
15143
15182
  cliStartupHandle?.end();
15183
+ if (!config.isInteractive()) {
15184
+ for (const warning of startupWarnings) {
15185
+ writeToStderr(warning.message + "\n");
15186
+ }
15187
+ }
15144
15188
  if (config.isInteractive()) {
15145
15189
  if (process.stdin.isTTY) {
15146
15190
  process.stdin.resume();
@@ -25,7 +25,6 @@ import {
25
25
  configureSpecificSetting,
26
26
  disableSkill,
27
27
  enableSkill,
28
- execa,
29
28
  formatRelativeTime,
30
29
  getExtensionManager,
31
30
  getThemeTypeFromBackgroundColor,
@@ -35,6 +34,7 @@ import {
35
34
  installSkill,
36
35
  isAlternateBufferEnabled,
37
36
  isFolderTrustEnabled,
37
+ isRecord,
38
38
  isSlashCommand,
39
39
  isWorkspaceTrusted,
40
40
  isWorktreeEnabled,
@@ -58,7 +58,7 @@ import {
58
58
  updateAllUpdatableExtensions,
59
59
  updateExtension,
60
60
  validateAuthMethod
61
- } from "./chunk-GX4YOB7T.js";
61
+ } from "./chunk-RNWNACRD.js";
62
62
  import {
63
63
  appEvents
64
64
  } from "./chunk-5PS3AYFU.js";
@@ -70,7 +70,7 @@ import {
70
70
  runExitCleanup,
71
71
  runSyncCleanup,
72
72
  setupSignalHandlers
73
- } from "./chunk-45GIY5RT.js";
73
+ } from "./chunk-ZIXTYG56.js";
74
74
  import {
75
75
  AuthType,
76
76
  ChatRecordingService,
@@ -102,6 +102,7 @@ import {
102
102
  StreamEventType,
103
103
  StreamJsonFormatter,
104
104
  ToolCallEvent,
105
+ TrustLevel,
105
106
  UserAccountManager,
106
107
  UserPromptEvent,
107
108
  ValidationCancelledError,
@@ -121,6 +122,7 @@ import {
121
122
  createWorktreeService,
122
123
  detectIdeFromEnv,
123
124
  displayContentToString,
125
+ execa,
124
126
  external_exports as external_exports2,
125
127
  geminiPartsToContentParts,
126
128
  generalistProfile,
@@ -167,7 +169,7 @@ import {
167
169
  updatePolicy,
168
170
  writeToStderr,
169
171
  writeToStdout
170
- } from "./chunk-OXCH4FS3.js";
172
+ } from "./chunk-GDRLBWZL.js";
171
173
  import {
172
174
  ASK_USER_TOOL_NAME,
173
175
  ApprovalMode,
@@ -188,6 +190,7 @@ import {
188
190
  FatalSandboxError,
189
191
  FatalToolExecutionError,
190
192
  FatalTurnLimitedError,
193
+ FatalUntrustedWorkspaceError,
191
194
  GEMINI_DIR,
192
195
  GEMINI_MODEL_ALIAS_AUTO,
193
196
  Kind,
@@ -214,7 +217,7 @@ import {
214
217
  loadServerHierarchicalMemory,
215
218
  resolveToRealPath,
216
219
  setGeminiMdFilename
217
- } from "./chunk-67TFD6HC.js";
220
+ } from "./chunk-FNPZLVJU.js";
218
221
  import "./chunk-664ZODQF.js";
219
222
  import "./chunk-RJTRUG2J.js";
220
223
  import "./chunk-IUUIT4SU.js";
@@ -5901,7 +5904,7 @@ async function handleInstall(args) {
5901
5904
  );
5902
5905
  if (confirmed) {
5903
5906
  const trustedFolders = loadTrustedFolders();
5904
- await trustedFolders.setValue(realPath, "TRUST_FOLDER" /* TRUST_FOLDER */);
5907
+ await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
5905
5908
  } else {
5906
5909
  throw new Error(
5907
5910
  `Installation aborted: Folder "${absolutePath}" is not trusted.`
@@ -7265,7 +7268,7 @@ async function loadSandboxConfig(settings, argv) {
7265
7268
  }
7266
7269
  const command2 = getSandboxCommand(sandboxValue);
7267
7270
  const packageJson = await getPackageJson(__dirname3);
7268
- const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.39.0-preview.2" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7271
+ const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.39.1" ?? customImage ?? packageJson?.config?.sandboxImageUri;
7269
7272
  const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
7270
7273
  return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
7271
7274
  }
@@ -7475,6 +7478,10 @@ async function parseArguments(settings) {
7475
7478
  type: "string",
7476
7479
  nargs: 1,
7477
7480
  description: "Execute the provided prompt and continue in interactive mode"
7481
+ }).option("skip-trust", {
7482
+ type: "boolean",
7483
+ description: "Trust the current workspace for this session.",
7484
+ default: false
7478
7485
  }).option("worktree", {
7479
7486
  alias: "w",
7480
7487
  type: "string",
@@ -7596,9 +7603,16 @@ async function parseArguments(settings) {
7596
7603
  yargsInstance.wrap(yargsInstance.terminalWidth());
7597
7604
  let result;
7598
7605
  try {
7599
- result = await yargsInstance.parse();
7606
+ const parsed = await yargsInstance.parse();
7607
+ if (!isRecord(parsed)) {
7608
+ throw new Error("Failed to parse arguments");
7609
+ }
7610
+ result = parsed;
7611
+ if (result["skip-trust"]) {
7612
+ process3.env["GEMINI_CLI_TRUST_WORKSPACE"] = "true";
7613
+ }
7600
7614
  } catch (e) {
7601
- const msg = e instanceof Error ? e.message : String(e);
7615
+ const msg = getErrorMessage(e);
7602
7616
  debugLogger.error(msg);
7603
7617
  yargsInstance.showHelp();
7604
7618
  await runExitCleanup();
@@ -7608,8 +7622,13 @@ async function parseArguments(settings) {
7608
7622
  await runExitCleanup();
7609
7623
  process3.exit(0);
7610
7624
  }
7611
- const queryArg = result.query;
7612
- const q = Array.isArray(queryArg) ? queryArg.join(" ") : queryArg;
7625
+ const queryArg = result["query"];
7626
+ let q;
7627
+ if (Array.isArray(queryArg)) {
7628
+ q = queryArg.join(" ");
7629
+ } else if (typeof queryArg === "string") {
7630
+ q = queryArg;
7631
+ }
7613
7632
  if (q && !result["prompt"]) {
7614
7633
  if (!isHeadlessMode()) {
7615
7634
  startupMessages.push(
@@ -7640,7 +7659,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
7640
7659
  const includeDirectoryTree = settings.context?.includeDirectoryTree ?? true;
7641
7660
  const ideMode = settings.ide?.enabled ?? false;
7642
7661
  const folderTrust = process3.env["GEMINI_CLI_INTEGRATION_TEST"] === "true" || process3.env["VITEST"] === "true" ? false : settings.security?.folderTrust?.enabled ?? false;
7643
- const trustedFolder = isWorkspaceTrusted(settings, cwd, void 0, {
7662
+ const trustedFolder = isWorkspaceTrusted(settings, cwd, {
7644
7663
  prompt: argv.prompt,
7645
7664
  query: argv.query
7646
7665
  })?.isTrusted ?? false;
@@ -7669,7 +7688,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
7669
7688
  return resolveToRealPath(trimmedPath) !== realCwd;
7670
7689
  } catch (e) {
7671
7690
  debugLogger.debug(
7672
- `[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${e instanceof Error ? e.message : String(e)})`
7691
+ `[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${getErrorMessage(e)})`
7673
7692
  );
7674
7693
  return false;
7675
7694
  }
@@ -8060,7 +8079,7 @@ async function resolveWorktreeSettings(cwd) {
8060
8079
  worktreeBaseSha = stdout.trim();
8061
8080
  } catch (e) {
8062
8081
  debugLogger.debug(
8063
- `Failed to resolve worktree base SHA at ${worktreePath}: ${e instanceof Error ? e.message : String(e)}`
8082
+ `Failed to resolve worktree base SHA at ${worktreePath}: ${getErrorMessage(e)}`
8064
8083
  );
8065
8084
  }
8066
8085
  if (!worktreeBaseSha) {
@@ -9195,9 +9214,29 @@ var rootDirectoryCheck = {
9195
9214
  }
9196
9215
  }
9197
9216
  };
9217
+ var folderTrustCheck = {
9218
+ id: "folder-trust",
9219
+ priority: WarningPriority.High,
9220
+ check: async (workspaceRoot, settings) => {
9221
+ if (!isFolderTrustEnabled(settings)) {
9222
+ return null;
9223
+ }
9224
+ const { isTrusted } = isWorkspaceTrusted(settings, workspaceRoot);
9225
+ if (isTrusted === true) {
9226
+ return null;
9227
+ }
9228
+ if (isHeadlessMode()) {
9229
+ throw new FatalUntrustedWorkspaceError(
9230
+ "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"
9231
+ );
9232
+ }
9233
+ return null;
9234
+ }
9235
+ };
9198
9236
  var WARNING_CHECKS = [
9199
9237
  homeDirectoryCheck,
9200
- rootDirectoryCheck
9238
+ rootDirectoryCheck,
9239
+ folderTrustCheck
9201
9240
  ];
9202
9241
  async function getUserStartupWarnings(settings, workspaceRoot = process4.cwd(), options) {
9203
9242
  const results = await Promise.all(
@@ -9562,7 +9601,7 @@ async function runNonInteractive({
9562
9601
  }
9563
9602
  });
9564
9603
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
9565
- const { setupInitialActivityLogger } = await import("./devtoolsService-K4DENTYF.js");
9604
+ const { setupInitialActivityLogger } = await import("./devtoolsService-XJQQUBHU.js");
9566
9605
  await setupInitialActivityLogger(config);
9567
9606
  }
9568
9607
  const { stdout: workingStdout } = createWorkingStdio();
@@ -10013,7 +10052,7 @@ async function runNonInteractive2(params) {
10013
10052
  }
10014
10053
  });
10015
10054
  if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
10016
- const { setupInitialActivityLogger } = await import("./devtoolsService-K4DENTYF.js");
10055
+ const { setupInitialActivityLogger } = await import("./devtoolsService-XJQQUBHU.js");
10017
10056
  await setupInitialActivityLogger(config);
10018
10057
  }
10019
10058
  const { stdout: workingStdout } = createWorkingStdio();
@@ -14860,7 +14899,7 @@ async function resolveSessionId(resumeArg) {
14860
14899
  }
14861
14900
  }
14862
14901
  async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
14863
- const { startInteractiveUI: doStartUI } = await import("./interactiveCli-TCZBSTKU.js");
14902
+ const { startInteractiveUI: doStartUI } = await import("./interactiveCli-WY7NQZAW.js");
14864
14903
  await doStartUI(
14865
14904
  config,
14866
14905
  settings,
@@ -15062,7 +15101,7 @@ ${finalArgs[promptIndex + 1]}`;
15062
15101
  await config.storage.initialize();
15063
15102
  adminControlsListner.setConfig(config);
15064
15103
  if (config.isInteractive() && settings.merged.general.devtools) {
15065
- const { setupInitialActivityLogger } = await import("./devtoolsService-K4DENTYF.js");
15104
+ const { setupInitialActivityLogger } = await import("./devtoolsService-XJQQUBHU.js");
15066
15105
  await setupInitialActivityLogger(config);
15067
15106
  }
15068
15107
  registerTelemetryConfig(config);
@@ -15141,6 +15180,11 @@ ${finalArgs[promptIndex + 1]}`;
15141
15180
  })
15142
15181
  ];
15143
15182
  cliStartupHandle?.end();
15183
+ if (!config.isInteractive()) {
15184
+ for (const warning of startupWarnings) {
15185
+ writeToStderr(warning.message + "\n");
15186
+ }
15187
+ }
15144
15188
  if (config.isInteractive()) {
15145
15189
  if (process.stdin.isTTY) {
15146
15190
  process.stdin.resume();
package/bundle/gemini.js CHANGED
@@ -103,9 +103,9 @@ ${error instanceof Error ? error.stack ?? error.message : String(error)}
103
103
  }
104
104
  }
105
105
  } else {
106
- const { main } = await import("./gemini-YOFQ5KF4.js");
107
- const { FatalError, writeToStderr } = await import("./dist-5ET5G5PC.js");
108
- const { runExitCleanup } = await import("./cleanup-OG2MXKZ7.js");
106
+ const { main } = await import("./gemini-JN2NUSDI.js");
107
+ const { FatalError, writeToStderr } = await import("./dist-7UL5MZ3N.js");
108
+ const { runExitCleanup } = await import("./cleanup-ROCPAQIR.js");
109
109
  main().catch(async (error) => {
110
110
  const cleanupTimeout = setTimeout(() => {
111
111
  writeToStderr("Cleanup timed out, forcing exit...\n");