@google/gemini-cli 0.42.0-preview.1 → 0.43.0-preview.0

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-AS4E6DX7.js → chunk-43AGRA7S.js} +3 -3
  2. package/bundle/{chunk-UZZVXATH.js → chunk-46T44JOY.js} +1 -1
  3. package/bundle/{chunk-BI5ZICGL.js → chunk-4TLQKGTR.js} +1 -1
  4. package/bundle/{chunk-BZZHETT5.js → chunk-6XOSIMPZ.js} +8 -9
  5. package/bundle/{chunk-6K3EFSDX.js → chunk-HQXINMBL.js} +2 -2
  6. package/bundle/{chunk-I5JMJ2LU.js → chunk-JENIU3E3.js} +1 -1
  7. package/bundle/{chunk-LK7LIPO6.js → chunk-LBQFRHYD.js} +1 -1
  8. package/bundle/{chunk-5AFGMGVT.js → chunk-LFGJVOVZ.js} +486 -381
  9. package/bundle/{chunk-UVBJHP26.js → chunk-MRHFLHPJ.js} +2 -2
  10. package/bundle/{chunk-7LOMS5HP.js → chunk-MXKXLNQD.js} +3 -3
  11. package/bundle/{chunk-ECNYAST2.js → chunk-N6QYTC2T.js} +5417 -5376
  12. package/bundle/{chunk-QZ2JZRLK.js → chunk-NBRZ4A3S.js} +2170 -791
  13. package/bundle/{chunk-L7GACEVA.js → chunk-P4UQCQUB.js} +3 -3
  14. package/bundle/{chunk-NHDN46IK.js → chunk-PGJUNQPO.js} +34 -16
  15. package/bundle/{chunk-GZ4FSF4B.js → chunk-PSWUV2OO.js} +3 -3
  16. package/bundle/{chunk-UKCYYERR.js → chunk-PYLHDAUK.js} +3 -3
  17. package/bundle/{chunk-47QC6PWE.js → chunk-Q23X5R4A.js} +486 -381
  18. package/bundle/{chunk-VERP26KN.js → chunk-QYUN3J2L.js} +533 -441
  19. package/bundle/{chunk-A564QXJJ.js → chunk-SAISHGWW.js} +1907 -716
  20. package/bundle/{chunk-IBIKJW2L.js → chunk-SYD5SJFT.js} +38 -23
  21. package/bundle/{chunk-WX6CHISQ.js → chunk-T3SUXLQQ.js} +2 -2
  22. package/bundle/{chunk-BUJZOWQ7.js → chunk-UIG2IVPJ.js} +34 -16
  23. package/bundle/{chunk-JEW7ZIWE.js → chunk-UJ26GAE5.js} +5326 -5290
  24. package/bundle/{chunk-ARLWCFGI.js → chunk-UNAVBUTP.js} +14729 -7452
  25. package/bundle/{chunk-7H3CQGS6.js → chunk-WQOLTO3C.js} +1 -1
  26. package/bundle/{chunk-KSNNZBTV.js → chunk-X26T73X6.js} +3 -3
  27. package/bundle/{cleanup-6PVHIK4C.js → cleanup-EIZJH2E3.js} +3 -3
  28. package/bundle/{cleanup-FRS7FPOS.js → cleanup-MI76P55B.js} +3 -3
  29. package/bundle/{cleanup-NDTUQVOW.js → cleanup-NZBQYB7U.js} +3 -3
  30. package/bundle/{core-RZFMBCSX.js → core-ERSGIOMQ.js} +30 -2
  31. package/bundle/{dist-7BJPFNU7.js → core-T2TBFAYG.js} +30 -2
  32. package/bundle/{devtoolsService-WER5PRLG.js → devtoolsService-7KZDSYEF.js} +3 -3
  33. package/bundle/{devtoolsService-6D355RSX.js → devtoolsService-FYTOIC37.js} +3 -3
  34. package/bundle/{devtoolsService-7SBW23VD.js → devtoolsService-LV5NJ2BT.js} +4 -5
  35. package/bundle/{dist-DTPIOJ3P.js → dist-ETX67B7P.js} +30 -2
  36. package/bundle/docs/changelogs/index.md +14 -0
  37. package/bundle/docs/changelogs/latest.md +108 -166
  38. package/bundle/docs/changelogs/preview.md +227 -103
  39. package/bundle/docs/cli/auto-memory.md +60 -38
  40. package/bundle/docs/cli/settings.md +1 -1
  41. package/bundle/docs/cli/tutorials/memory-management.md +1 -1
  42. package/bundle/docs/extensions/releasing.md +58 -24
  43. package/bundle/docs/reference/configuration.md +14 -1
  44. package/bundle/docs/reference/keyboard-shortcuts.md +23 -0
  45. package/bundle/{gemini-KMMF6AK3.js → gemini-IVKBXHDT.js} +160 -60
  46. package/bundle/{gemini-GLORNPU2.js → gemini-JKWQQTKP.js} +160 -60
  47. package/bundle/{gemini-HCJBP42A.js → gemini-Z77GAAR6.js} +331 -245
  48. package/bundle/gemini.js +8 -8
  49. package/bundle/{interactiveCli-5UVCH7FM.js → interactiveCli-36WZS6KT.js} +1704 -1457
  50. package/bundle/{interactiveCli-HBRMSAIT.js → interactiveCli-BQ36B66Z.js} +1703 -1457
  51. package/bundle/{interactiveCli-TWDP2H52.js → interactiveCli-SME5QTEN.js} +1967 -1739
  52. package/bundle/{liteRtServerManager-3YA2HL46.js → liteRtServerManager-2QD4R3A3.js} +5 -5
  53. package/bundle/{liteRtServerManager-BYQVAM6Y.js → liteRtServerManager-ISYDOBNC.js} +5 -5
  54. package/bundle/{liteRtServerManager-IQHHDTUM.js → liteRtServerManager-N6OMT6W5.js} +5 -5
  55. package/bundle/{memoryDiscovery-FB7MMKTA.js → memoryDiscovery-LLSKN6HL.js} +1 -1
  56. package/bundle/{memoryDiscovery-KSYZVCWF.js → memoryDiscovery-SJ7P6RCN.js} +1 -1
  57. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  58. package/bundle/{oauth2-provider-C66JRVDQ.js → oauth2-provider-DOSIH6VE.js} +2 -2
  59. package/bundle/{oauth2-provider-TUVQXNLY.js → oauth2-provider-TZF6EZRX.js} +2 -2
  60. package/bundle/{oauth2-provider-OAXWX3Z3.js → oauth2-provider-VFOABWBW.js} +73 -39
  61. package/bundle/{start-ELTWFVNO.js → start-3GPIRK3E.js} +7 -7
  62. package/bundle/{start-HHZI73VV.js → start-6NONW677.js} +7 -7
  63. package/bundle/{start-NCMR7HOQ.js → start-M6MUPEJS.js} +7 -7
  64. package/package.json +1 -1
  65. package/bundle/chunk-5MQ5VMQK.js +0 -17230
  66. package/bundle/chunk-66C7JVNE.js +0 -391
  67. package/bundle/chunk-A3GDBSEI.js +0 -512
  68. package/bundle/chunk-L6GBKGQX.js +0 -118
  69. package/bundle/chunk-LCB7VVYS.js +0 -356008
  70. package/bundle/chunk-OGZGOFAJ.js +0 -1571
  71. package/bundle/chunk-PBD26LJQ.js +0 -81544
  72. package/bundle/chunk-YDSDSLSO.js +0 -156
  73. package/bundle/cleanup-O4IDJYU2.js +0 -33
  74. package/bundle/devtoolsService-SPV43SGI.js +0 -857
  75. package/bundle/dist-ZZ5HEQGP.js +0 -2096
  76. package/bundle/gemini-3NXWUDHV.js +0 -16256
  77. package/bundle/interactiveCli-BNDKNCVJ.js +0 -34505
  78. package/bundle/liteRtServerManager-RTBP2SLV.js +0 -66
  79. package/bundle/oauth2-provider-ZPJOR5SG.js +0 -237
  80. package/bundle/start-S3TEO5BN.js +0 -19
@@ -1,391 +0,0 @@
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-UVBJHP26.js";
5
- import {
6
- RELEASE_CHANNEL_STABILITY,
7
- getChannelFromVersion,
8
- isGitRepository
9
- } from "./chunk-ARLWCFGI.js";
10
- import {
11
- debugLogger
12
- } from "./chunk-JEW7ZIWE.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
- */