@google/gemini-cli 0.70.0 → 0.71.0-nightly.20261120.gd4cb1713f

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 (77) hide show
  1. package/bundle/{chunk-VHXUWMGE.js → chunk-22NLCXU3.js} +2 -2
  2. package/bundle/{chunk-SPAMAY26.js → chunk-3DBVNRC7.js} +1 -1
  3. package/bundle/{chunk-FXAACYC3.js → chunk-3VKSDKQA.js} +1 -1
  4. package/bundle/{chunk-YOEWNBDC.js → chunk-43QQPZRQ.js} +2 -2
  5. package/bundle/{chunk-5VFAWK3F.js → chunk-4FKCNBUM.js} +1 -1
  6. package/bundle/{chunk-BOIBJEIO.js → chunk-4SEHQOPY.js} +3 -3
  7. package/bundle/{chunk-6IKD2NB3.js → chunk-4V6FXIV7.js} +1 -1
  8. package/bundle/{chunk-FHK4RNCX.js → chunk-4YWPS6WG.js} +7 -7
  9. package/bundle/{chunk-4BWP3TDK.js → chunk-6VJSIYX5.js} +9 -8
  10. package/bundle/{chunk-LMNAB62M.js → chunk-7CGFKAQQ.js} +2 -2
  11. package/bundle/{chunk-3VGGGCOZ.js → chunk-7WRW57EW.js} +2 -2
  12. package/bundle/{chunk-37D3S3FZ.js → chunk-AQR7HAVC.js} +878 -371
  13. package/bundle/{chunk-V4HIE5G5.js → chunk-AWAS7A4U.js} +1 -1
  14. package/bundle/{chunk-GFBMTAPD.js → chunk-BFYOZTEC.js} +8 -6
  15. package/bundle/{chunk-WRWAVEME.js → chunk-CVDUPOPD.js} +1 -1
  16. package/bundle/{chunk-JLKRLYZG.js → chunk-EV4MLSRK.js} +2 -2
  17. package/bundle/{chunk-KV6XIC2Z.js → chunk-H35O2XC7.js} +1 -1
  18. package/bundle/{chunk-7JS2T75Z.js → chunk-HBX5SUG6.js} +1 -1
  19. package/bundle/chunk-ID6HT5PN.js +512 -0
  20. package/bundle/chunk-JUDLPWWJ.js +1962 -0
  21. package/bundle/{chunk-CB37EK5Y.js → chunk-JVBEESQE.js} +3 -3
  22. package/bundle/{chunk-EG2BSKPF.js → chunk-L7GW5P2N.js} +1 -1
  23. package/bundle/{chunk-UF44X63P.js → chunk-MFOWRKY4.js} +782 -323
  24. package/bundle/chunk-MPPDWK6R.js +40024 -0
  25. package/bundle/{chunk-G6SC5BOV.js → chunk-NF46UAZ5.js} +1 -1
  26. package/bundle/chunk-P3QKD7NI.js +190 -0
  27. package/bundle/chunk-P5SMSWOI.js +65 -0
  28. package/bundle/{chunk-QYKA4YD7.js → chunk-Q3MSDTUZ.js} +3 -3
  29. package/bundle/{chunk-AMHNNZY2.js → chunk-QYILFI2Q.js} +7 -7
  30. package/bundle/{chunk-RFQXG324.js → chunk-R5O4JOJ7.js} +1 -1
  31. package/bundle/chunk-T5ERFODG.js +118 -0
  32. package/bundle/{chunk-LMBUPWFC.js → chunk-TKCJYF6S.js} +8765 -15613
  33. package/bundle/{chunk-CMKRWIX6.js → chunk-WEQEDCCJ.js} +71 -58
  34. package/bundle/chunk-YGBB6EOP.js +1571 -0
  35. package/bundle/chunk-ZL2NEMMB.js +420386 -0
  36. package/bundle/chunk-ZM7BCSH5.js +60338 -0
  37. package/bundle/{cleanup-BMYAIPAL.js → cleanup-2V4YG4JU.js} +2 -2
  38. package/bundle/{cleanup-CWOSCK57.js → cleanup-577T3DEI.js} +2 -2
  39. package/bundle/{cleanup-JTPRPYIQ.js → cleanup-A7BQ5O2C.js} +2 -2
  40. package/bundle/cleanup-BER5KF3M.js +34 -0
  41. package/bundle/{core-XZECNCR2.js → core-J5GAQUTA.js} +31 -1
  42. package/bundle/{devtoolsService-ER22TM2Y.js → devtoolsService-5ICQIIYF.js} +2 -2
  43. package/bundle/{devtoolsService-WNJOZ7ZT.js → devtoolsService-7E2XLRN6.js} +2 -2
  44. package/bundle/{devtoolsService-O5VD5YWD.js → devtoolsService-B2G4MIWC.js} +4 -3
  45. package/bundle/devtoolsService-HFMB7OZU.js +919 -0
  46. package/bundle/{core-HYVGBZPP.js → dist-63TFONDS.js} +31 -1
  47. package/bundle/{dist-75NDR3EX.js → dist-J4SRUOE6.js} +31 -1
  48. package/bundle/dist-J54GSUG2.js +2372 -0
  49. package/bundle/docs/changelogs/index.md +46 -0
  50. package/bundle/docs/changelogs/latest.md +82 -100
  51. package/bundle/docs/changelogs/preview.md +82 -115
  52. package/bundle/{formatError-M4GLDFGE.js → formatError-ISWUYAZB.js} +2 -2
  53. package/bundle/{formatError-QOZLAZ32.js → formatError-IX7HHO6M.js} +2 -2
  54. package/bundle/{formatError-FYLLVZDF.js → formatError-MZRXOV55.js} +2 -2
  55. package/bundle/formatError-U2ZQLJHB.js +14 -0
  56. package/bundle/{gemini-AYDYW6NZ.js → gemini-FRGLIXP7.js} +15 -15
  57. package/bundle/{gemini-PG2FEK5D.js → gemini-GSQARDB2.js} +224 -208
  58. package/bundle/gemini-KZFVMGY3.js +20020 -0
  59. package/bundle/{gemini-FRSP6LA3.js → gemini-ZZBTL6TA.js} +15 -15
  60. package/bundle/gemini.js +8 -8
  61. package/bundle/{interactiveCli-76LAQB3B.js → interactiveCli-AHDFCTRR.js} +157 -32
  62. package/bundle/{interactiveCli-BYWR7IEK.js → interactiveCli-MVGIIVAP.js} +157 -32
  63. package/bundle/{interactiveCli-6TVFB4R5.js → interactiveCli-UN4BNLK2.js} +468 -324
  64. package/bundle/interactiveCli-XW2S7MKZ.js +36447 -0
  65. package/bundle/{liteRtServerManager-GIRVSE6M.js → liteRtServerManager-3MOGK3XY.js} +4 -4
  66. package/bundle/{liteRtServerManager-KZ62KJW3.js → liteRtServerManager-O727KCKA.js} +4 -4
  67. package/bundle/{liteRtServerManager-BYJWS5BO.js → liteRtServerManager-TSG2V5XN.js} +4 -4
  68. package/bundle/liteRtServerManager-YLE7JTV7.js +65 -0
  69. package/bundle/{oauth2-provider-ZBFFAIQE.js → oauth2-provider-3EEFSHG4.js} +1 -1
  70. package/bundle/{oauth2-provider-SFFQQ6OE.js → oauth2-provider-DWO2KVCY.js} +1 -1
  71. package/bundle/{oauth2-provider-SRH6I6G7.js → oauth2-provider-G25ZRGDY.js} +41 -79
  72. package/bundle/oauth2-provider-RHT5OSMO.js +273 -0
  73. package/bundle/{start-PLK5XHJC.js → start-4XOSRN5A.js} +6 -6
  74. package/bundle/{start-Q66LTS3Y.js → start-7JXWL6XR.js} +6 -6
  75. package/bundle/{start-OLEVDFQS.js → start-CAA6RQBK.js} +6 -6
  76. package/bundle/start-I3RUABAZ.js +18 -0
  77. package/package.json +1 -1
@@ -149,10 +149,10 @@ import {
149
149
  useUIState,
150
150
  useVimMode,
151
151
  validateAuthMethod
152
- } from "./chunk-AMHNNZY2.js";
152
+ } from "./chunk-QYILFI2Q.js";
153
153
  import {
154
154
  require_source
155
- } from "./chunk-KV6XIC2Z.js";
155
+ } from "./chunk-YGBB6EOP.js";
156
156
  import {
157
157
  appEvents
158
158
  } from "./chunk-5PS3AYFU.js";
@@ -226,25 +226,25 @@ import {
226
226
  widestLineFromStyledChars,
227
227
  wordBreakStyledChars,
228
228
  wrapStyledChars
229
- } from "./chunk-YOEWNBDC.js";
229
+ } from "./chunk-43QQPZRQ.js";
230
230
  import {
231
231
  handleAutoUpdate,
232
232
  isDevelopment,
233
233
  relaunchApp,
234
234
  require_semver,
235
235
  setUpdateHandler
236
- } from "./chunk-VHXUWMGE.js";
236
+ } from "./chunk-7WRW57EW.js";
237
237
  import {
238
238
  isTodoList,
239
239
  mapCoreStatusToDisplayStatus,
240
240
  require_react
241
- } from "./chunk-RFQXG324.js";
241
+ } from "./chunk-R5O4JOJ7.js";
242
242
  import {
243
243
  registerCleanup,
244
244
  removeCleanup,
245
245
  runExitCleanup,
246
246
  setupTtyCheck
247
- } from "./chunk-EG2BSKPF.js";
247
+ } from "./chunk-L7GW5P2N.js";
248
248
  import {
249
249
  ACTIVATE_SKILL_TOOL_NAME,
250
250
  AGENT_TOOL_NAME,
@@ -368,8 +368,10 @@ import {
368
368
  getPackageJson,
369
369
  getPlanModeExitMessage,
370
370
  getResponseText,
371
+ getShellConfiguration,
371
372
  getVersion,
372
373
  hasRedirection,
374
+ hasRedirectionAsync,
373
375
  hasSummary,
374
376
  hasValidEditorCommand,
375
377
  homedir,
@@ -381,11 +383,15 @@ import {
381
383
  isBackgroundExecutionData,
382
384
  isBinary,
383
385
  isBinaryAvailable,
386
+ isDefaultHasRedirection,
387
+ isDefaultIsInteractiveGeminiCommand,
384
388
  isEditorAvailable,
385
389
  isFileDiff,
386
390
  isGrepResult,
387
391
  isHeadlessMode,
388
392
  isInteractiveGeminiCommand,
393
+ isInteractiveGeminiCommandAsync,
394
+ isKnownInteractiveGeminiCommandSync,
389
395
  isListResult,
390
396
  isNodeError,
391
397
  isOverageEligibleModel,
@@ -441,7 +447,7 @@ import {
441
447
  validatePlanContent,
442
448
  validatePlanPath,
443
449
  writeToStdout
444
- } from "./chunk-LMBUPWFC.js";
450
+ } from "./chunk-AQR7HAVC.js";
445
451
  import "./chunk-W2AJR23G.js";
446
452
  import "./chunk-N7J54YNL.js";
447
453
  import "./chunk-L6PII3GR.js";
@@ -12622,9 +12628,7 @@ ${deceptiveUrlWarnings.map(
12622
12628
  } else if (confirmationDetails.type === "exec") {
12623
12629
  const executionProps = confirmationDetails;
12624
12630
  const commandsToDisplay = executionProps.commands && executionProps.commands.length > 0 ? executionProps.commands : [executionProps.command];
12625
- const containsRedirection = commandsToDisplay.some(
12626
- (cmd) => hasRedirection(cmd)
12627
- );
12631
+ const containsRedirection = typeof executionProps.hasRedirection === "boolean" ? executionProps.hasRedirection : commandsToDisplay.some((cmd) => hasRedirection(cmd));
12628
12632
  const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12629
12633
  if (containsRedirection && !isAutoEdit) {
12630
12634
  extraInfoLines = 1;
@@ -12851,9 +12855,7 @@ Ensure you trust all modifications made to build files before approving executio
12851
12855
  const executionProps = confirmationDetails;
12852
12856
  const isShell = isShellTool(toolName);
12853
12857
  const commandsToDisplay = executionProps.commands && executionProps.commands.length > 1 ? executionProps.commands : [executionProps.command];
12854
- const containsRedirection = commandsToDisplay.some(
12855
- (cmd) => hasRedirection(cmd)
12856
- );
12858
+ const containsRedirection = typeof executionProps.hasRedirection === "boolean" ? executionProps.hasRedirection : commandsToDisplay.some((cmd) => hasRedirection(cmd));
12857
12859
  const isAutoEdit = config.getApprovalMode() === "yolo" /* YOLO */ || config.getApprovalMode() === "autoEdit" /* AUTO_EDIT */;
12858
12860
  let warnings = null;
12859
12861
  if (containsRedirection && !isAutoEdit) {
@@ -25022,7 +25024,9 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
25022
25024
  { type: "user_shell", text: rawQuery },
25023
25025
  userMessageTimestamp
25024
25026
  );
25025
- if (isInteractiveGeminiCommand(rawQuery)) {
25027
+ const useAsyncPowerShellGeminiCheck = typeof isDefaultIsInteractiveGeminiCommand === "function" && isDefaultIsInteractiveGeminiCommand(isInteractiveGeminiCommand) && typeof isInteractiveGeminiCommandAsync === "function" && typeof isKnownInteractiveGeminiCommandSync === "function" && typeof getShellConfiguration === "function" && getShellConfiguration().shell === "powershell";
25028
+ const syncInteractiveGeminiCheck = useAsyncPowerShellGeminiCheck ? isKnownInteractiveGeminiCommandSync(rawQuery) : isInteractiveGeminiCommand(rawQuery);
25029
+ if (syncInteractiveGeminiCheck === true) {
25026
25030
  addItemToHistory(
25027
25031
  { type: "error", text: INTERACTIVE_GEMINI_SHELL_ERROR },
25028
25032
  userMessageTimestamp
@@ -25034,6 +25038,22 @@ var useExecutionLifecycle = (addItemToHistory, setPendingHistoryItem, onExec, on
25034
25038
  let commandToExecute = rawQuery;
25035
25039
  let pwdFilePath;
25036
25040
  const executeCommand = async () => {
25041
+ if (syncInteractiveGeminiCheck === void 0 && await isInteractiveGeminiCommandAsync(
25042
+ rawQuery,
25043
+ void 0,
25044
+ abortSignal
25045
+ )) {
25046
+ addItemToHistory(
25047
+ { type: "error", text: INTERACTIVE_GEMINI_SHELL_ERROR },
25048
+ userMessageTimestamp
25049
+ );
25050
+ return;
25051
+ }
25052
+ if (abortSignal.aborted) {
25053
+ setPendingHistoryItem(null);
25054
+ setShellInputFocused(false);
25055
+ return;
25056
+ }
25037
25057
  let cumulativeStdout = "";
25038
25058
  let isBinaryStream = false;
25039
25059
  let binaryBytesReceived = 0;
@@ -27741,8 +27761,48 @@ var import_react101 = __toESM(require_react(), 1);
27741
27761
 
27742
27762
  // packages/cli/src/ui/hooks/useTurnActivityMonitor.ts
27743
27763
  var import_react100 = __toESM(require_react(), 1);
27764
+ var EMPTY_REDIRECTION_MAP = /* @__PURE__ */ new Map();
27765
+ function redirectionCacheReducer(state, action) {
27766
+ switch (action.type) {
27767
+ case "set": {
27768
+ if (state.get(action.command) === action.hasRedirection) {
27769
+ return state;
27770
+ }
27771
+ const next = new Map(state);
27772
+ next.set(action.command, action.hasRedirection);
27773
+ return next;
27774
+ }
27775
+ case "reset":
27776
+ return state.size === 0 ? state : EMPTY_REDIRECTION_MAP;
27777
+ default:
27778
+ return state;
27779
+ }
27780
+ }
27781
+ function shouldUseAsyncPowerShellRedirection() {
27782
+ return typeof isDefaultHasRedirection === "function" && isDefaultHasRedirection(hasRedirection) && typeof hasRedirectionAsync === "function" && typeof getShellConfiguration === "function" && getShellConfiguration().shell === "powershell";
27783
+ }
27784
+ function extractShellCommand(tc) {
27785
+ const rawCommand = tc.request.args?.["command"];
27786
+ return typeof rawCommand === "string" ? rawCommand : "";
27787
+ }
27744
27788
  var useTurnActivityMonitor = (streamingState, activePtyId, pendingToolCalls = []) => {
27745
27789
  const [operationStartTime, setOperationStartTime] = (0, import_react100.useState)(0);
27790
+ const [resolvedRedirections, dispatchRedirection] = (0, import_react100.useReducer)(
27791
+ redirectionCacheReducer,
27792
+ EMPTY_REDIRECTION_MAP
27793
+ );
27794
+ const inFlightCommandsRef = (0, import_react100.useRef)(/* @__PURE__ */ new Set());
27795
+ const turnEpochRef = (0, import_react100.useRef)(0);
27796
+ const turnAbortControllerRef = (0, import_react100.useRef)(null);
27797
+ const isMountedRef = (0, import_react100.useRef)(true);
27798
+ (0, import_react100.useEffect)(() => {
27799
+ isMountedRef.current = true;
27800
+ return () => {
27801
+ isMountedRef.current = false;
27802
+ turnAbortControllerRef.current?.abort();
27803
+ turnAbortControllerRef.current = null;
27804
+ };
27805
+ }, []);
27746
27806
  const prevPtyIdRef = (0, import_react100.useRef)(void 0);
27747
27807
  const prevStreamingStateRef = (0, import_react100.useRef)(void 0);
27748
27808
  (0, import_react100.useEffect)(() => {
@@ -27757,17 +27817,69 @@ var useTurnActivityMonitor = (streamingState, activePtyId, pendingToolCalls = []
27757
27817
  prevPtyIdRef.current = activePtyId;
27758
27818
  prevStreamingStateRef.current = streamingState;
27759
27819
  }, [streamingState, activePtyId]);
27760
- const isRedirectionActive = (0, import_react100.useMemo)(
27761
- () => (
27762
- // Check active tool calls for run_shell_command
27763
- pendingToolCalls.some((tc) => {
27764
- if (tc.request.name !== "run_shell_command") return false;
27765
- const command = tc.request.args?.command || "";
27820
+ (0, import_react100.useEffect)(() => {
27821
+ if (streamingState === "idle" /* Idle */ && pendingToolCalls.length === 0) {
27822
+ turnEpochRef.current += 1;
27823
+ turnAbortControllerRef.current?.abort();
27824
+ turnAbortControllerRef.current = null;
27825
+ inFlightCommandsRef.current.clear();
27826
+ dispatchRedirection({ type: "reset" });
27827
+ return;
27828
+ }
27829
+ if (!shouldUseAsyncPowerShellRedirection()) {
27830
+ return;
27831
+ }
27832
+ if (!turnAbortControllerRef.current || turnAbortControllerRef.current.signal.aborted) {
27833
+ turnAbortControllerRef.current = new AbortController();
27834
+ }
27835
+ const turnSignal = turnAbortControllerRef.current.signal;
27836
+ const epoch = turnEpochRef.current;
27837
+ for (const tc of pendingToolCalls) {
27838
+ if (tc.request.name !== "run_shell_command") {
27839
+ continue;
27840
+ }
27841
+ if (tc.confirmationDetails?.type === "exec" && typeof tc.confirmationDetails.hasRedirection === "boolean") {
27842
+ continue;
27843
+ }
27844
+ const command = extractShellCommand(tc);
27845
+ if (!command || !/[><]/.test(command) || resolvedRedirections.has(command) || inFlightCommandsRef.current.has(command)) {
27846
+ continue;
27847
+ }
27848
+ inFlightCommandsRef.current.add(command);
27849
+ void hasRedirectionAsync(command, void 0, turnSignal).then((redirected) => {
27850
+ inFlightCommandsRef.current.delete(command);
27851
+ if (isMountedRef.current && turnEpochRef.current === epoch && !turnSignal.aborted) {
27852
+ dispatchRedirection({
27853
+ type: "set",
27854
+ command,
27855
+ hasRedirection: redirected
27856
+ });
27857
+ }
27858
+ }).catch(() => {
27859
+ inFlightCommandsRef.current.delete(command);
27860
+ });
27861
+ }
27862
+ }, [streamingState, pendingToolCalls, resolvedRedirections]);
27863
+ const isRedirectionActive = (0, import_react100.useMemo)(() => {
27864
+ const useAsyncPowerShell = shouldUseAsyncPowerShellRedirection();
27865
+ return pendingToolCalls.some((tc) => {
27866
+ if (tc.request.name !== "run_shell_command") return false;
27867
+ if (tc.confirmationDetails?.type === "exec" && typeof tc.confirmationDetails.hasRedirection === "boolean") {
27868
+ return tc.confirmationDetails.hasRedirection;
27869
+ }
27870
+ const command = extractShellCommand(tc);
27871
+ if (!command) {
27872
+ return false;
27873
+ }
27874
+ if (!useAsyncPowerShell) {
27766
27875
  return hasRedirection(command);
27767
- })
27768
- ),
27769
- [pendingToolCalls]
27770
- );
27876
+ }
27877
+ if (!/[><]/.test(command)) {
27878
+ return false;
27879
+ }
27880
+ return resolvedRedirections.get(command) ?? false;
27881
+ });
27882
+ }, [pendingToolCalls, resolvedRedirections]);
27771
27883
  return {
27772
27884
  operationStartTime,
27773
27885
  isRedirectionActive
@@ -27859,7 +27971,8 @@ var useAgentStream = ({
27859
27971
  isClientInitiated: t.isClientInitiated ?? false,
27860
27972
  prompt_id: ""
27861
27973
  },
27862
- status: t.status
27974
+ status: t.status,
27975
+ confirmationDetails: t.confirmationDetails
27863
27976
  })),
27864
27977
  [trackedTools]
27865
27978
  );
@@ -29835,16 +29948,28 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29835
29948
  (call) => call.status === "awaiting_approval" && !call.request.forcedAsk
29836
29949
  );
29837
29950
  if (newApprovalMode === "autoEdit" /* AUTO_EDIT */) {
29838
- awaitingApprovalCalls = awaitingApprovalCalls.filter((call) => {
29951
+ const filteredCalls = [];
29952
+ for (const call of awaitingApprovalCalls) {
29839
29953
  if (EDIT_TOOL_NAMES.has(call.request.name)) {
29840
- return true;
29954
+ filteredCalls.push(call);
29955
+ continue;
29841
29956
  }
29842
29957
  if (call.request.name === SHELL_TOOL_NAME) {
29843
- const command = call.request.args.command;
29844
- return command && hasRedirection(command);
29958
+ if (call.confirmationDetails?.type === "exec" && typeof call.confirmationDetails.hasRedirection === "boolean") {
29959
+ if (call.confirmationDetails.hasRedirection) {
29960
+ filteredCalls.push(call);
29961
+ }
29962
+ continue;
29963
+ }
29964
+ const rawCommand = call.request.args["command"];
29965
+ const command = typeof rawCommand === "string" ? rawCommand : void 0;
29966
+ const redirected = command ? typeof isDefaultHasRedirection === "function" && isDefaultHasRedirection(hasRedirection) && typeof hasRedirectionAsync === "function" ? await hasRedirectionAsync(command) : hasRedirection(command) : false;
29967
+ if (redirected) {
29968
+ filteredCalls.push(call);
29969
+ }
29845
29970
  }
29846
- return false;
29847
- });
29971
+ }
29972
+ awaitingApprovalCalls = filteredCalls;
29848
29973
  }
29849
29974
  for (const call of awaitingApprovalCalls) {
29850
29975
  if (call.correlationId) {
@@ -35266,7 +35391,7 @@ ${queuedText}` : queuedText;
35266
35391
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
35267
35392
  if (settings.merged.general.devtools) {
35268
35393
  void (async () => {
35269
- const { toggleDevToolsPanel } = await import("./devtoolsService-O5VD5YWD.js");
35394
+ const { toggleDevToolsPanel } = await import("./devtoolsService-7E2XLRN6.js");
35270
35395
  await toggleDevToolsPanel(
35271
35396
  config,
35272
35397
  showErrorDetails,