@google/gemini-cli 0.42.0 → 0.44.0-nightly.20260513.g5ee05c775

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 (80) hide show
  1. package/bundle/{chunk-COQP2M4D.js → chunk-27SPXGT2.js} +562 -437
  2. package/bundle/{chunk-EDKX67D6.js → chunk-2VH3SA6M.js} +43 -23
  3. package/bundle/{chunk-PUDLNWHE.js → chunk-3KOQHVJU.js} +3 -3
  4. package/bundle/{chunk-COKAF5GM.js → chunk-4QQ5AHZP.js} +2 -2
  5. package/bundle/{chunk-KVEAHIIV.js → chunk-5EEEHNEE.js} +3 -3
  6. package/bundle/{chunk-G2VTSEZ6.js → chunk-5SMSFUPB.js} +1 -1
  7. package/bundle/{chunk-7VVHSNDQ.js → chunk-AC2EWTF7.js} +1970 -731
  8. package/bundle/{chunk-GA527JB7.js → chunk-ATSNFRDF.js} +1 -1
  9. package/bundle/{chunk-3IS7GD6D.js → chunk-BA752AEU.js} +3 -3
  10. package/bundle/{chunk-CYEIWMZJ.js → chunk-FGYOOMPI.js} +1 -1
  11. package/bundle/{chunk-QOZSZYL7.js → chunk-FK45PHSI.js} +3 -3
  12. package/bundle/{chunk-I7AME6VC.js → chunk-FTY6BJEY.js} +9 -8
  13. package/bundle/{chunk-NTOPH4WG.js → chunk-GCWBZXBS.js} +2 -2
  14. package/bundle/chunk-I2JHD4D3.js +512 -0
  15. package/bundle/{chunk-7C6GGDK6.js → chunk-IZJOLGNO.js} +3 -3
  16. package/bundle/{chunk-4SLGT6YD.js → chunk-J4YAW3P3.js} +1 -1
  17. package/bundle/chunk-KADNKBXT.js +118 -0
  18. package/bundle/{chunk-DN4XSYRG.js → chunk-LF33N5QM.js} +8696 -13355
  19. package/bundle/{chunk-CHERUG6W.js → chunk-LO22NRY4.js} +502 -390
  20. package/bundle/{chunk-JEW7ZIWE.js → chunk-M7OUJJZ2.js} +5270 -5234
  21. package/bundle/{chunk-WIXUKOZA.js → chunk-MFNKZZOB.js} +1 -1
  22. package/bundle/chunk-MLPM54XD.js +357247 -0
  23. package/bundle/{chunk-ECNYAST2.js → chunk-N22WUHJE.js} +5419 -5378
  24. package/bundle/chunk-OC7XGTLV.js +81656 -0
  25. package/bundle/{chunk-ZNMQA242.js → chunk-QDEK3TQ6.js} +3 -3
  26. package/bundle/{chunk-BCYBA52D.js → chunk-QMXQUBC4.js} +43 -23
  27. package/bundle/chunk-TBHMNRI3.js +1571 -0
  28. package/bundle/{chunk-LATVEETM.js → chunk-TOOOS4HD.js} +2 -2
  29. package/bundle/{chunk-XUMRUXOT.js → chunk-UHSQLPNG.js} +50 -27
  30. package/bundle/chunk-USS2A6NQ.js +156 -0
  31. package/bundle/chunk-WMTLLWRC.js +391 -0
  32. package/bundle/chunk-XDWZDV7C.js +17250 -0
  33. package/bundle/{chunk-DMWX7UP6.js → chunk-YBYQH75I.js} +2252 -829
  34. package/bundle/{chunk-FCAODPNO.js → chunk-ZZN56QZ3.js} +502 -390
  35. package/bundle/{cleanup-3RILFNVM.js → cleanup-2H3SANYB.js} +3 -3
  36. package/bundle/{cleanup-SVRKYBR6.js → cleanup-7GY7BVC6.js} +3 -3
  37. package/bundle/{cleanup-XFVHHDVO.js → cleanup-FERREFU6.js} +3 -3
  38. package/bundle/cleanup-VIITMMDH.js +33 -0
  39. package/bundle/{core-FRVSDP2C.js → core-GS6NXK7Y.js} +30 -2
  40. package/bundle/{devtoolsService-VM2WTHBX.js → devtoolsService-FKC6Y4OE.js} +3 -3
  41. package/bundle/{devtoolsService-TRDGMQLJ.js → devtoolsService-K2DRCZEY.js} +5 -4
  42. package/bundle/{devtoolsService-RUEO5PGP.js → devtoolsService-PS6RYICL.js} +3 -3
  43. package/bundle/devtoolsService-ZDXC2NPD.js +857 -0
  44. package/bundle/{dist-6BN2CJPN.js → dist-S3YUNQKP.js} +30 -2
  45. package/bundle/{core-B5S6HZJT.js → dist-TBGNMYU2.js} +30 -2
  46. package/bundle/dist-ZEW43MLQ.js +2124 -0
  47. package/bundle/docs/changelogs/index.md +30 -0
  48. package/bundle/docs/changelogs/latest.md +261 -166
  49. package/bundle/docs/changelogs/preview.md +178 -103
  50. package/bundle/docs/cli/auto-memory.md +60 -38
  51. package/bundle/docs/cli/settings.md +1 -1
  52. package/bundle/docs/cli/tutorials/memory-management.md +1 -1
  53. package/bundle/docs/extensions/releasing.md +58 -24
  54. package/bundle/docs/reference/configuration.md +14 -1
  55. package/bundle/docs/reference/keyboard-shortcuts.md +23 -0
  56. package/bundle/{gemini-QSTQ2DBG.js → gemini-6YGVETF3.js} +165 -61
  57. package/bundle/{gemini-GHUELHBF.js → gemini-7FCGNXOV.js} +350 -232
  58. package/bundle/gemini-IXZUGRVP.js +16360 -0
  59. package/bundle/{gemini-NQPVX5JC.js → gemini-WYTY4CD5.js} +165 -61
  60. package/bundle/gemini.js +8 -8
  61. package/bundle/{interactiveCli-AG2YWL2O.js → interactiveCli-A2FV6NYD.js} +1721 -1472
  62. package/bundle/{interactiveCli-MZFG35NB.js → interactiveCli-DWNRHVIB.js} +2003 -1736
  63. package/bundle/{interactiveCli-453M2IVE.js → interactiveCli-H7N4UXVQ.js} +1720 -1472
  64. package/bundle/interactiveCli-XRZEELCX.js +34754 -0
  65. package/bundle/{liteRtServerManager-G4Q7OVBX.js → liteRtServerManager-5C5EONBK.js} +5 -5
  66. package/bundle/{liteRtServerManager-S7WL25VD.js → liteRtServerManager-NQKPNCLR.js} +5 -5
  67. package/bundle/{liteRtServerManager-BXQ6VVWP.js → liteRtServerManager-UJBPII3P.js} +5 -5
  68. package/bundle/liteRtServerManager-UZCAJJCS.js +66 -0
  69. package/bundle/{memoryDiscovery-KSYZVCWF.js → memoryDiscovery-ALKMYAPP.js} +1 -1
  70. package/bundle/{memoryDiscovery-FB7MMKTA.js → memoryDiscovery-XFCKEF3F.js} +1 -1
  71. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  72. package/bundle/{oauth2-provider-VR4DL6AL.js → oauth2-provider-JNOY6NUI.js} +2 -2
  73. package/bundle/{oauth2-provider-H7G6RSFW.js → oauth2-provider-O6OA5EMU.js} +2 -2
  74. package/bundle/{oauth2-provider-5UF5WEE2.js → oauth2-provider-QYCLASEA.js} +39 -73
  75. package/bundle/oauth2-provider-VWLTUFO7.js +237 -0
  76. package/bundle/{start-CQBSKFYB.js → start-6FV3VPPH.js} +7 -7
  77. package/bundle/{start-NIMXQJYB.js → start-IWAUTCYF.js} +7 -7
  78. package/bundle/{start-2SKRN43X.js → start-L4DAQUQM.js} +7 -7
  79. package/bundle/start-XTXUKP77.js +19 -0
  80. package/package.json +1 -1
@@ -0,0 +1,391 @@
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
+ runExitCleanup
4
+ } from "./chunk-TOOOS4HD.js";
5
+ import {
6
+ RELEASE_CHANNEL_STABILITY,
7
+ getChannelFromVersion,
8
+ isGitRepository
9
+ } from "./chunk-MLPM54XD.js";
10
+ import {
11
+ debugLogger
12
+ } from "./chunk-M7OUJJZ2.js";
13
+
14
+ // packages/cli/src/utils/installationInfo.ts
15
+ import * as fs from "node:fs";
16
+ import * as path from "node:path";
17
+ import * as childProcess from "node:child_process";
18
+ import process2 from "node:process";
19
+ var isDevelopment = process2.env["NODE_ENV"] === "development";
20
+ function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
21
+ const cliPath = process2.argv[1];
22
+ if (!cliPath) {
23
+ return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
24
+ }
25
+ try {
26
+ if (process2.env["IS_BINARY"] === "true") {
27
+ return {
28
+ packageManager: "binary" /* BINARY */,
29
+ isGlobal: true,
30
+ updateMessage: "Running as a standalone binary. Please update by downloading the latest version from GitHub."
31
+ };
32
+ }
33
+ const realPath = fs.realpathSync(cliPath).replace(/\\/g, "/");
34
+ const normalizedProjectRoot = projectRoot?.replace(/\\/g, "/");
35
+ const isGit = isGitRepository(process2.cwd());
36
+ if (isGit && normalizedProjectRoot && realPath.startsWith(normalizedProjectRoot) && !realPath.includes("/node_modules/")) {
37
+ return {
38
+ packageManager: "unknown" /* UNKNOWN */,
39
+ // Not managed by a package manager in this sense
40
+ isGlobal: false,
41
+ updateMessage: 'Running from a local git clone. Please update with "git pull".'
42
+ };
43
+ }
44
+ if (realPath.includes("/.npm/_npx") || realPath.includes("/npm/_npx")) {
45
+ return {
46
+ packageManager: "npx" /* NPX */,
47
+ isGlobal: false,
48
+ updateMessage: "Running via npx, update not applicable."
49
+ };
50
+ }
51
+ if (realPath.includes("/.pnpm/_pnpx") || realPath.includes("/.cache/pnpm/dlx")) {
52
+ return {
53
+ packageManager: "pnpx" /* PNPX */,
54
+ isGlobal: false,
55
+ updateMessage: "Running via pnpx, update not applicable."
56
+ };
57
+ }
58
+ if (process2.platform === "darwin") {
59
+ try {
60
+ const brewPrefix = childProcess.execSync("brew --prefix gemini-cli", {
61
+ encoding: "utf8",
62
+ stdio: ["ignore", "pipe", "ignore"]
63
+ }).trim();
64
+ const brewRealPath = fs.realpathSync(brewPrefix);
65
+ if (realPath.startsWith(brewRealPath)) {
66
+ return {
67
+ packageManager: "homebrew" /* HOMEBREW */,
68
+ isGlobal: true,
69
+ updateMessage: 'Installed via Homebrew. Please update with "brew upgrade gemini-cli".'
70
+ };
71
+ }
72
+ } catch {
73
+ }
74
+ }
75
+ if (realPath.includes("/.pnpm/global") || realPath.includes("/.local/share/pnpm")) {
76
+ const updateCommand2 = "pnpm add -g @google/gemini-cli@latest";
77
+ return {
78
+ packageManager: "pnpm" /* PNPM */,
79
+ isGlobal: true,
80
+ updateCommand: updateCommand2,
81
+ updateMessage: isAutoUpdateEnabled ? "Installed with pnpm. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
82
+ };
83
+ }
84
+ if (realPath.includes("/.yarn/global")) {
85
+ const updateCommand2 = "yarn global add @google/gemini-cli@latest";
86
+ return {
87
+ packageManager: "yarn" /* YARN */,
88
+ isGlobal: true,
89
+ updateCommand: updateCommand2,
90
+ updateMessage: isAutoUpdateEnabled ? "Installed with yarn. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
91
+ };
92
+ }
93
+ if (realPath.includes("/.bun/install/cache")) {
94
+ return {
95
+ packageManager: "bunx" /* BUNX */,
96
+ isGlobal: false,
97
+ updateMessage: "Running via bunx, update not applicable."
98
+ };
99
+ }
100
+ if (realPath.includes("/.bun/install/global")) {
101
+ const updateCommand2 = "bun add -g @google/gemini-cli@latest";
102
+ return {
103
+ packageManager: "bun" /* BUN */,
104
+ isGlobal: true,
105
+ updateCommand: updateCommand2,
106
+ updateMessage: isAutoUpdateEnabled ? "Installed with bun. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
107
+ };
108
+ }
109
+ if (normalizedProjectRoot && realPath.startsWith(`${normalizedProjectRoot}/node_modules`)) {
110
+ let pm = "npm" /* NPM */;
111
+ if (fs.existsSync(path.join(projectRoot, "yarn.lock"))) {
112
+ pm = "yarn" /* YARN */;
113
+ } else if (fs.existsSync(path.join(projectRoot, "pnpm-lock.yaml"))) {
114
+ pm = "pnpm" /* PNPM */;
115
+ } else if (fs.existsSync(path.join(projectRoot, "bun.lockb"))) {
116
+ pm = "bun" /* BUN */;
117
+ }
118
+ return {
119
+ packageManager: pm,
120
+ isGlobal: false,
121
+ updateMessage: "Locally installed. Please update via your project's package.json."
122
+ };
123
+ }
124
+ const updateCommand = "npm install -g @google/gemini-cli@latest";
125
+ return {
126
+ packageManager: "npm" /* NPM */,
127
+ isGlobal: true,
128
+ updateCommand,
129
+ updateMessage: isAutoUpdateEnabled ? "Installed with npm. Attempting to automatically update now..." : `Please run ${updateCommand} to update`
130
+ };
131
+ } catch (error) {
132
+ debugLogger.log(error);
133
+ return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
134
+ }
135
+ }
136
+
137
+ // packages/cli/src/utils/updateEventEmitter.ts
138
+ import { EventEmitter } from "node:events";
139
+ var updateEventEmitter = new EventEmitter();
140
+
141
+ // packages/cli/src/utils/spawnWrapper.ts
142
+ import { spawn } from "node:child_process";
143
+ var spawnWrapper = spawn;
144
+
145
+ // packages/cli/src/utils/handleAutoUpdate.ts
146
+ var _updateInProgress = false;
147
+ async function waitForUpdateCompletion(timeoutMs = 3e4) {
148
+ if (!_updateInProgress) {
149
+ return;
150
+ }
151
+ debugLogger.log(
152
+ "\nGemini CLI is waiting for a background update to complete before restarting..."
153
+ );
154
+ return new Promise((resolve) => {
155
+ if (!_updateInProgress) {
156
+ resolve();
157
+ return;
158
+ }
159
+ const timer = setTimeout(cleanup, timeoutMs);
160
+ function cleanup() {
161
+ clearTimeout(timer);
162
+ updateEventEmitter.off("update-success", cleanup);
163
+ updateEventEmitter.off("update-failed", cleanup);
164
+ resolve();
165
+ }
166
+ updateEventEmitter.once("update-success", cleanup);
167
+ updateEventEmitter.once("update-failed", cleanup);
168
+ });
169
+ }
170
+ function handleAutoUpdate(info, settings, projectRoot, isSandboxEnabled, spawnFn = spawnWrapper) {
171
+ if (!info) {
172
+ return;
173
+ }
174
+ if (isSandboxEnabled) {
175
+ updateEventEmitter.emit("update-info", {
176
+ message: `${info.message}
177
+ Automatic update is not available in sandbox mode.`
178
+ });
179
+ return;
180
+ }
181
+ if (!settings.merged.general.enableAutoUpdateNotification) {
182
+ return;
183
+ }
184
+ const installationInfo = getInstallationInfo(
185
+ projectRoot,
186
+ settings.merged.general.enableAutoUpdate
187
+ );
188
+ if ([
189
+ "npx" /* NPX */,
190
+ "pnpx" /* PNPX */,
191
+ "bunx" /* BUNX */,
192
+ "binary" /* BINARY */
193
+ ].includes(installationInfo.packageManager)) {
194
+ return;
195
+ }
196
+ let combinedMessage = info.message;
197
+ if (installationInfo.updateMessage) {
198
+ combinedMessage += `
199
+ ${installationInfo.updateMessage}`;
200
+ }
201
+ if (!installationInfo.updateCommand || !settings.merged.general.enableAutoUpdate) {
202
+ updateEventEmitter.emit("update-received", {
203
+ ...info,
204
+ message: combinedMessage,
205
+ isUpdating: false
206
+ });
207
+ return;
208
+ }
209
+ updateEventEmitter.emit("update-received", {
210
+ ...info,
211
+ message: combinedMessage,
212
+ isUpdating: true
213
+ });
214
+ if (_updateInProgress) {
215
+ return;
216
+ }
217
+ const currentVersion = info.update.current;
218
+ if (!currentVersion) {
219
+ debugLogger.warn(
220
+ "Update check: current version is missing. Skipping automatic update for safety."
221
+ );
222
+ return;
223
+ }
224
+ const currentChannel = getChannelFromVersion(currentVersion);
225
+ const targetChannel = getChannelFromVersion(info.update.latest);
226
+ if (RELEASE_CHANNEL_STABILITY[targetChannel] < RELEASE_CHANNEL_STABILITY[currentChannel]) {
227
+ return;
228
+ }
229
+ const isNightly = info.update.latest.includes("nightly");
230
+ const updateCommand = installationInfo.updateCommand.replace(
231
+ "@latest",
232
+ isNightly ? "@nightly" : `@${info.update.latest}`
233
+ );
234
+ const updateProcess = spawnFn(updateCommand, {
235
+ stdio: "ignore",
236
+ shell: true,
237
+ detached: true
238
+ });
239
+ _updateInProgress = true;
240
+ updateProcess.unref();
241
+ updateProcess.on("close", (code) => {
242
+ _updateInProgress = false;
243
+ if (code === 0) {
244
+ updateEventEmitter.emit("update-success", {
245
+ message: "Update successful! The new version will be used on your next run."
246
+ });
247
+ } else {
248
+ updateEventEmitter.emit("update-failed", {
249
+ message: `Automatic update failed. Please try updating manually:
250
+
251
+ ${updateCommand}`
252
+ });
253
+ }
254
+ });
255
+ updateProcess.on("error", (err) => {
256
+ _updateInProgress = false;
257
+ updateEventEmitter.emit("update-failed", {
258
+ message: `Automatic update failed. Please try updating manually. (error: ${err.message})
259
+
260
+ ${updateCommand}`
261
+ });
262
+ });
263
+ return updateProcess;
264
+ }
265
+ function setUpdateHandler(addItem, setUpdateInfo) {
266
+ let successfullyInstalled = false;
267
+ const handleUpdateReceived = (info) => {
268
+ setUpdateInfo(info);
269
+ const savedMessage = info.message;
270
+ setTimeout(() => {
271
+ if (!successfullyInstalled) {
272
+ addItem(
273
+ {
274
+ type: "info" /* INFO */,
275
+ text: savedMessage
276
+ },
277
+ Date.now()
278
+ );
279
+ }
280
+ setUpdateInfo(null);
281
+ }, 6e4);
282
+ };
283
+ const handleUpdateFailed = (data) => {
284
+ setUpdateInfo(null);
285
+ addItem(
286
+ {
287
+ type: "error" /* ERROR */,
288
+ text: data?.message || `Automatic update failed. Please try updating manually`
289
+ },
290
+ Date.now()
291
+ );
292
+ };
293
+ const handleUpdateSuccess = () => {
294
+ successfullyInstalled = true;
295
+ setUpdateInfo(null);
296
+ addItem(
297
+ {
298
+ type: "info" /* INFO */,
299
+ text: `Update successful! The new version will be used on your next run.`
300
+ },
301
+ Date.now()
302
+ );
303
+ };
304
+ const handleUpdateInfo = (data) => {
305
+ addItem(
306
+ {
307
+ type: "info" /* INFO */,
308
+ text: data.message
309
+ },
310
+ Date.now()
311
+ );
312
+ };
313
+ updateEventEmitter.on("update-received", handleUpdateReceived);
314
+ updateEventEmitter.on("update-failed", handleUpdateFailed);
315
+ updateEventEmitter.on("update-success", handleUpdateSuccess);
316
+ updateEventEmitter.on("update-info", handleUpdateInfo);
317
+ return () => {
318
+ updateEventEmitter.off("update-received", handleUpdateReceived);
319
+ updateEventEmitter.off("update-failed", handleUpdateFailed);
320
+ updateEventEmitter.off("update-success", handleUpdateSuccess);
321
+ updateEventEmitter.off("update-info", handleUpdateInfo);
322
+ };
323
+ }
324
+
325
+ // packages/cli/src/utils/processUtils.ts
326
+ var RELAUNCH_EXIT_CODE = 199;
327
+ var isRelaunching = false;
328
+ async function relaunchApp() {
329
+ if (isRelaunching) return;
330
+ isRelaunching = true;
331
+ await waitForUpdateCompletion();
332
+ await runExitCleanup();
333
+ process.exit(RELAUNCH_EXIT_CODE);
334
+ }
335
+ function isStandardSea() {
336
+ return process.argv[0] !== process.argv[1] && (process.env["IS_BINARY"] === "true" || process.isSea?.() === true);
337
+ }
338
+ function getScriptArgs() {
339
+ return process.argv.slice(isStandardSea() ? 1 : 2);
340
+ }
341
+ function isSeaEnvironment() {
342
+ return process.env["IS_BINARY"] === "true" || process.isSea?.() === true || process.argv[0] === process.argv[1];
343
+ }
344
+ function getSpawnConfig(nodeArgs, scriptArgs) {
345
+ const isBinary = isSeaEnvironment();
346
+ const newEnv = {
347
+ ...process.env,
348
+ GEMINI_CLI_NO_RELAUNCH: "true"
349
+ };
350
+ const finalSpawnArgs = [];
351
+ if (isBinary) {
352
+ if (nodeArgs.length > 0) {
353
+ for (const arg of nodeArgs) {
354
+ if (/[\s"'\\]/.test(arg)) {
355
+ throw new Error(
356
+ `Unsupported node argument for SEA relaunch: ${arg}. Complex escaping is not supported.`
357
+ );
358
+ }
359
+ }
360
+ const existingNodeOptions = process.env["NODE_OPTIONS"] || "";
361
+ newEnv["NODE_OPTIONS"] = `${existingNodeOptions} ${nodeArgs.join(" ")}`.trim();
362
+ }
363
+ finalSpawnArgs.push(process.execPath, ...scriptArgs);
364
+ } else {
365
+ finalSpawnArgs.push(
366
+ ...process.execArgv,
367
+ ...nodeArgs,
368
+ process.argv[1],
369
+ ...scriptArgs
370
+ );
371
+ }
372
+ return {
373
+ spawnArgs: finalSpawnArgs,
374
+ env: newEnv
375
+ };
376
+ }
377
+
378
+ export {
379
+ isDevelopment,
380
+ handleAutoUpdate,
381
+ setUpdateHandler,
382
+ RELAUNCH_EXIT_CODE,
383
+ relaunchApp,
384
+ getScriptArgs,
385
+ getSpawnConfig
386
+ };
387
+ /**
388
+ * @license
389
+ * Copyright 2025 Google LLC
390
+ * SPDX-License-Identifier: Apache-2.0
391
+ */