@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
@@ -0,0 +1,156 @@
1
+ const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
+ import {
3
+ ExitCodes,
4
+ isTelemetrySdkInitialized,
5
+ resetBrowserSession,
6
+ shutdownTelemetry
7
+ } from "./chunk-RENFZ63F.js";
8
+ import {
9
+ Storage
10
+ } from "./chunk-F73F75XM.js";
11
+
12
+ // packages/cli/src/utils/cleanup.ts
13
+ import { promises as fs } from "node:fs";
14
+ import { join } from "node:path";
15
+ var cleanupFunctions = [];
16
+ var syncCleanupFunctions = [];
17
+ var configForTelemetry = null;
18
+ var isShuttingDown = false;
19
+ function registerCleanup(fn) {
20
+ cleanupFunctions.push(fn);
21
+ }
22
+ function removeCleanup(fn) {
23
+ const index = cleanupFunctions.indexOf(fn);
24
+ if (index !== -1) {
25
+ cleanupFunctions.splice(index, 1);
26
+ }
27
+ }
28
+ function registerSyncCleanup(fn) {
29
+ syncCleanupFunctions.push(fn);
30
+ }
31
+ function removeSyncCleanup(fn) {
32
+ const index = syncCleanupFunctions.indexOf(fn);
33
+ if (index !== -1) {
34
+ syncCleanupFunctions.splice(index, 1);
35
+ }
36
+ }
37
+ function resetCleanupForTesting() {
38
+ cleanupFunctions.length = 0;
39
+ syncCleanupFunctions.length = 0;
40
+ configForTelemetry = null;
41
+ isShuttingDown = false;
42
+ }
43
+ function runSyncCleanup() {
44
+ for (const fn of syncCleanupFunctions) {
45
+ try {
46
+ fn();
47
+ } catch {
48
+ }
49
+ }
50
+ syncCleanupFunctions.length = 0;
51
+ }
52
+ function registerTelemetryConfig(config) {
53
+ configForTelemetry = config;
54
+ }
55
+ async function runExitCleanup() {
56
+ await drainStdin();
57
+ runSyncCleanup();
58
+ for (const fn of cleanupFunctions) {
59
+ try {
60
+ await fn();
61
+ } catch {
62
+ }
63
+ }
64
+ cleanupFunctions.length = 0;
65
+ try {
66
+ await resetBrowserSession();
67
+ } catch {
68
+ }
69
+ if (configForTelemetry) {
70
+ try {
71
+ await configForTelemetry.dispose();
72
+ } catch {
73
+ }
74
+ }
75
+ if (configForTelemetry && isTelemetrySdkInitialized()) {
76
+ try {
77
+ await shutdownTelemetry(configForTelemetry);
78
+ } catch {
79
+ }
80
+ }
81
+ }
82
+ async function drainStdin() {
83
+ if (!process.stdin?.isTTY) return;
84
+ process.stdin.resume().removeAllListeners("data").on("data", () => {
85
+ });
86
+ await new Promise((resolve) => setTimeout(resolve, 50));
87
+ }
88
+ async function gracefulShutdown(_reason) {
89
+ if (isShuttingDown) {
90
+ return;
91
+ }
92
+ isShuttingDown = true;
93
+ await runExitCleanup();
94
+ process.exit(ExitCodes.SUCCESS);
95
+ }
96
+ function setupSignalHandlers() {
97
+ process.on("SIGHUP", () => gracefulShutdown("SIGHUP"));
98
+ process.on("SIGTERM", () => gracefulShutdown("SIGTERM"));
99
+ process.on("SIGINT", () => gracefulShutdown("SIGINT"));
100
+ }
101
+ function setupTtyCheck() {
102
+ let intervalId = null;
103
+ let isCheckingTty = false;
104
+ intervalId = setInterval(async () => {
105
+ if (isCheckingTty || isShuttingDown) {
106
+ return;
107
+ }
108
+ if (process.env["SANDBOX"]) {
109
+ return;
110
+ }
111
+ if (!process.stdin.isTTY && !process.stdout.isTTY) {
112
+ isCheckingTty = true;
113
+ if (intervalId) {
114
+ clearInterval(intervalId);
115
+ intervalId = null;
116
+ }
117
+ await gracefulShutdown("TTY loss");
118
+ }
119
+ }, 5e3);
120
+ intervalId.unref();
121
+ return () => {
122
+ if (intervalId) {
123
+ clearInterval(intervalId);
124
+ intervalId = null;
125
+ }
126
+ };
127
+ }
128
+ async function cleanupCheckpoints() {
129
+ const storage = new Storage(process.cwd());
130
+ await storage.initialize();
131
+ const tempDir = storage.getProjectTempDir();
132
+ const checkpointsDir = join(tempDir, "checkpoints");
133
+ try {
134
+ await fs.rm(checkpointsDir, { recursive: true, force: true });
135
+ } catch {
136
+ }
137
+ }
138
+
139
+ export {
140
+ registerCleanup,
141
+ removeCleanup,
142
+ registerSyncCleanup,
143
+ removeSyncCleanup,
144
+ resetCleanupForTesting,
145
+ runSyncCleanup,
146
+ registerTelemetryConfig,
147
+ runExitCleanup,
148
+ setupSignalHandlers,
149
+ setupTtyCheck,
150
+ cleanupCheckpoints
151
+ };
152
+ /**
153
+ * @license
154
+ * Copyright 2025 Google LLC
155
+ * SPDX-License-Identifier: Apache-2.0
156
+ */
@@ -25749,6 +25749,12 @@ var FatalToolExecutionError = class extends FatalError {
25749
25749
  this.name = "FatalToolExecutionError";
25750
25750
  }
25751
25751
  };
25752
+ var FatalUntrustedWorkspaceError = class extends FatalError {
25753
+ constructor(message) {
25754
+ super(message, 55);
25755
+ this.name = "FatalUntrustedWorkspaceError";
25756
+ }
25757
+ };
25752
25758
  var FatalCancellationError = class extends FatalError {
25753
25759
  constructor(message) {
25754
25760
  super(message, 130);
@@ -41703,6 +41709,7 @@ import * as fs4 from "node:fs";
41703
41709
  import { fileURLToPath } from "node:url";
41704
41710
  var GEMINI_DIR = ".gemini";
41705
41711
  var GOOGLE_ACCOUNTS_FILENAME = "google_accounts.json";
41712
+ var TRUSTED_FOLDERS_FILENAME = "trustedFolders.json";
41706
41713
  function homedir() {
41707
41714
  const envHome = process.env["GEMINI_CLI_HOME"];
41708
41715
  if (envHome) {
@@ -42320,6 +42327,7 @@ var StorageMigration = class {
42320
42327
 
42321
42328
  // packages/core/src/config/storage.ts
42322
42329
  var OAUTH_FILE = "oauth_creds.json";
42330
+ var TRUSTED_FOLDERS_FILENAME2 = "trustedFolders.json";
42323
42331
  var TMP_DIR_NAME = "tmp";
42324
42332
  var BIN_DIR_NAME = "bin";
42325
42333
  var AGENTS_DIR_NAME = ".agents";
@@ -42372,6 +42380,12 @@ var Storage = class _Storage {
42372
42380
  static getGoogleAccountsPath() {
42373
42381
  return path6.join(_Storage.getGlobalGeminiDir(), GOOGLE_ACCOUNTS_FILENAME);
42374
42382
  }
42383
+ static getTrustedFoldersPath() {
42384
+ if (process.env["GEMINI_CLI_TRUSTED_FOLDERS_PATH"]) {
42385
+ return process.env["GEMINI_CLI_TRUSTED_FOLDERS_PATH"];
42386
+ }
42387
+ return path6.join(_Storage.getGlobalGeminiDir(), TRUSTED_FOLDERS_FILENAME2);
42388
+ }
42375
42389
  static getUserCommandsDir() {
42376
42390
  return path6.join(_Storage.getGlobalGeminiDir(), "commands");
42377
42391
  }
@@ -52572,6 +52586,7 @@ export {
52572
52586
  READ_ONLY_KINDS,
52573
52587
  GEMINI_DIR,
52574
52588
  GOOGLE_ACCOUNTS_FILENAME,
52589
+ TRUSTED_FOLDERS_FILENAME,
52575
52590
  homedir,
52576
52591
  tmpdir,
52577
52592
  tildeifyPath,
@@ -52600,6 +52615,7 @@ export {
52600
52615
  FatalConfigError,
52601
52616
  FatalTurnLimitedError,
52602
52617
  FatalToolExecutionError,
52618
+ FatalUntrustedWorkspaceError,
52603
52619
  FatalCancellationError,
52604
52620
  CanceledError,
52605
52621
  ForbiddenError,