@google/gemini-cli 0.43.0-preview.0 → 0.43.0-preview.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 (67) hide show
  1. package/bundle/{chunk-MXKXLNQD.js → chunk-3BNJIKEP.js} +2 -2
  2. package/bundle/{chunk-UIG2IVPJ.js → chunk-4G3X2H3F.js} +1 -1
  3. package/bundle/{chunk-LFGJVOVZ.js → chunk-4SLX6GS6.js} +7 -7
  4. package/bundle/{chunk-MRHFLHPJ.js → chunk-4ZT3EIBI.js} +1 -1
  5. package/bundle/{chunk-HQXINMBL.js → chunk-6YMGRLOQ.js} +1 -1
  6. package/bundle/{chunk-43AGRA7S.js → chunk-CKPZGEE3.js} +2 -2
  7. package/bundle/{chunk-WQOLTO3C.js → chunk-CZPVSLJF.js} +1 -1
  8. package/bundle/{chunk-PSWUV2OO.js → chunk-DJCG6GWZ.js} +2 -2
  9. package/bundle/{chunk-6XOSIMPZ.js → chunk-ERQUIEOO.js} +9 -8
  10. package/bundle/{chunk-SYD5SJFT.js → chunk-EWAAFVBK.js} +9 -6
  11. package/bundle/{chunk-T3SUXLQQ.js → chunk-F7PEGIBA.js} +2 -2
  12. package/bundle/{chunk-P4UQCQUB.js → chunk-ICOPZSVB.js} +3 -3
  13. package/bundle/{chunk-PGJUNQPO.js → chunk-IF5BAOVJ.js} +1 -1
  14. package/bundle/chunk-KILFUY3Y.js +512 -0
  15. package/bundle/{chunk-JENIU3E3.js → chunk-L4LBKMR6.js} +1 -1
  16. package/bundle/{chunk-LBQFRHYD.js → chunk-LTFEPQ67.js} +1 -1
  17. package/bundle/{chunk-X26T73X6.js → chunk-LTSFEC7U.js} +2 -2
  18. package/bundle/{chunk-SAISHGWW.js → chunk-MRVZNBXY.js} +4 -4
  19. package/bundle/{chunk-QYUN3J2L.js → chunk-N3MLU4IQ.js} +68 -55
  20. package/bundle/{chunk-UNAVBUTP.js → chunk-NDSJWRFE.js} +6974 -13060
  21. package/bundle/{chunk-NBRZ4A3S.js → chunk-NG2WIKH5.js} +2 -2
  22. package/bundle/chunk-PLEERNRJ.js +156 -0
  23. package/bundle/{chunk-PYLHDAUK.js → chunk-QAQT56LH.js} +3 -3
  24. package/bundle/{chunk-4TLQKGTR.js → chunk-S36EONMM.js} +1 -1
  25. package/bundle/chunk-UB4AWMZC.js +391 -0
  26. package/bundle/{chunk-Q23X5R4A.js → chunk-UBCHSKF2.js} +7 -7
  27. package/bundle/chunk-ULCEBJMK.js +17248 -0
  28. package/bundle/chunk-UUHMEKLA.js +357199 -0
  29. package/bundle/chunk-UW3H4T6A.js +1571 -0
  30. package/bundle/{chunk-46T44JOY.js → chunk-VSTO23O2.js} +1 -1
  31. package/bundle/chunk-XKIM3BNI.js +118 -0
  32. package/bundle/chunk-YIHNW7CC.js +81649 -0
  33. package/bundle/{cleanup-MI76P55B.js → cleanup-BMLCC7SO.js} +2 -2
  34. package/bundle/{cleanup-NZBQYB7U.js → cleanup-LMJA4J5S.js} +3 -3
  35. package/bundle/cleanup-M7RSLDBR.js +33 -0
  36. package/bundle/{cleanup-EIZJH2E3.js → cleanup-NMUMRIEF.js} +2 -2
  37. package/bundle/{core-T2TBFAYG.js → core-WXTAU5UX.js} +1 -1
  38. package/bundle/{devtoolsService-LV5NJ2BT.js → devtoolsService-2L5U47ZQ.js} +2 -2
  39. package/bundle/{devtoolsService-FYTOIC37.js → devtoolsService-6THA6GNX.js} +2 -2
  40. package/bundle/{devtoolsService-7KZDSYEF.js → devtoolsService-J2AC6YXM.js} +5 -4
  41. package/bundle/devtoolsService-SRWIME2Q.js +857 -0
  42. package/bundle/{dist-ETX67B7P.js → dist-DIIMIT2U.js} +1 -1
  43. package/bundle/{core-ERSGIOMQ.js → dist-MXL7ZG46.js} +2 -2
  44. package/bundle/dist-POIHCQVM.js +2124 -0
  45. package/bundle/{gemini-IVKBXHDT.js → gemini-D32FDZXN.js} +13 -13
  46. package/bundle/{gemini-Z77GAAR6.js → gemini-DLZ2R4X7.js} +202 -188
  47. package/bundle/{gemini-JKWQQTKP.js → gemini-HYQU2RK2.js} +13 -13
  48. package/bundle/gemini-JJG7ZGWB.js +16356 -0
  49. package/bundle/gemini.js +7 -7
  50. package/bundle/{interactiveCli-36WZS6KT.js → interactiveCli-DHMPW4RS.js} +8 -8
  51. package/bundle/{interactiveCli-SME5QTEN.js → interactiveCli-K7ETWJMN.js} +315 -296
  52. package/bundle/{interactiveCli-BQ36B66Z.js → interactiveCli-NR7OUF3G.js} +8 -8
  53. package/bundle/interactiveCli-X4AUP7T7.js +34752 -0
  54. package/bundle/{liteRtServerManager-2QD4R3A3.js → liteRtServerManager-L7C3D5RL.js} +4 -4
  55. package/bundle/{liteRtServerManager-N6OMT6W5.js → liteRtServerManager-PKRLUK2P.js} +4 -4
  56. package/bundle/{liteRtServerManager-ISYDOBNC.js → liteRtServerManager-TEBDIGEN.js} +5 -5
  57. package/bundle/liteRtServerManager-UPCAT7Z2.js +66 -0
  58. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  59. package/bundle/{oauth2-provider-DOSIH6VE.js → oauth2-provider-52IJKUJI.js} +1 -1
  60. package/bundle/{oauth2-provider-VFOABWBW.js → oauth2-provider-OPOTTZ5C.js} +1 -1
  61. package/bundle/{oauth2-provider-TZF6EZRX.js → oauth2-provider-TOAKXOL7.js} +39 -73
  62. package/bundle/oauth2-provider-WN4YIDA4.js +237 -0
  63. package/bundle/{start-3GPIRK3E.js → start-6KIIUSAH.js} +6 -6
  64. package/bundle/{start-6NONW677.js → start-7ZNSGJD6.js} +7 -7
  65. package/bundle/start-EPIILWLN.js +19 -0
  66. package/bundle/{start-M6MUPEJS.js → start-TMFPUYEL.js} +6 -6
  67. package/package.json +1 -1
@@ -246422,7 +246422,7 @@ import { createHash } from "node:crypto";
246422
246422
  import * as os12 from "node:os";
246423
246423
 
246424
246424
  // packages/core/src/generated/git-commit.ts
246425
- var GIT_COMMIT_INFO = "022e8baef";
246425
+ var GIT_COMMIT_INFO = "31ea2a85b";
246426
246426
  var CLI_VERSION = "0.43.0-preview.0";
246427
246427
 
246428
246428
  // packages/core/src/ide/detect-ide.ts
@@ -303619,7 +303619,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
303619
303619
  return provider;
303620
303620
  }
303621
303621
  case "oauth2": {
303622
- const { OAuth2AuthProvider } = await import("./oauth2-provider-TZF6EZRX.js");
303622
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-OPOTTZ5C.js");
303623
303623
  const provider = new OAuth2AuthProvider(
303624
303624
  authConfig,
303625
303625
  options.agentName ?? "unknown",
@@ -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-UUHMEKLA.js";
8
+ import {
9
+ Storage
10
+ } from "./chunk-UJ26GAE5.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
+ */
@@ -1,15 +1,15 @@
1
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
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-MRHFLHPJ.js";
4
+ } from "./chunk-6YMGRLOQ.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  getChannelFromVersion,
8
8
  isGitRepository
9
- } from "./chunk-NBRZ4A3S.js";
9
+ } from "./chunk-NDSJWRFE.js";
10
10
  import {
11
11
  debugLogger
12
- } from "./chunk-N6QYTC2T.js";
12
+ } from "./chunk-UJ26GAE5.js";
13
13
 
14
14
  // packages/cli/src/utils/installationInfo.ts
15
15
  import * as fs from "node:fs";
@@ -1,7 +1,7 @@
1
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
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-MRHFLHPJ.js";
4
+ } from "./chunk-F7PEGIBA.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -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-PLEERNRJ.js";
5
+ import {
6
+ RELEASE_CHANNEL_STABILITY,
7
+ getChannelFromVersion,
8
+ isGitRepository
9
+ } from "./chunk-UUHMEKLA.js";
10
+ import {
11
+ debugLogger
12
+ } from "./chunk-UJ26GAE5.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
+ */
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  exitCli,
8
8
  require_source
9
- } from "./chunk-4TLQKGTR.js";
9
+ } from "./chunk-UW3H4T6A.js";
10
10
  import {
11
11
  DEFAULT_BACKGROUND_OPACITY,
12
12
  DEFAULT_BORDER_OPACITY,
@@ -58,14 +58,14 @@ import {
58
58
  stripUnsafeCharacters,
59
59
  toCodePoints,
60
60
  validateCustomTheme
61
- } from "./chunk-PGJUNQPO.js";
61
+ } from "./chunk-IF5BAOVJ.js";
62
62
  import {
63
63
  isDevelopment
64
- } from "./chunk-PYLHDAUK.js";
64
+ } from "./chunk-CKPZGEE3.js";
65
65
  import {
66
66
  emptyIcon,
67
67
  require_react
68
- } from "./chunk-6XOSIMPZ.js";
68
+ } from "./chunk-VSTO23O2.js";
69
69
  import {
70
70
  AsyncFzf,
71
71
  Config,
@@ -201,7 +201,7 @@ import {
201
201
  stripAnsi,
202
202
  tokenLimit,
203
203
  uiTelemetryService
204
- } from "./chunk-NBRZ4A3S.js";
204
+ } from "./chunk-NG2WIKH5.js";
205
205
  import {
206
206
  ApprovalMode,
207
207
  CoreEvent,
@@ -56443,7 +56443,7 @@ var authCommand = {
56443
56443
  import process28 from "node:process";
56444
56444
 
56445
56445
  // packages/cli/src/generated/git-commit.ts
56446
- var GIT_COMMIT_INFO = "022e8baef";
56446
+ var GIT_COMMIT_INFO = "31ea2a85b";
56447
56447
 
56448
56448
  // packages/cli/src/ui/utils/historyExportUtils.ts
56449
56449
  import * as fsPromises from "node:fs/promises";
@@ -62204,7 +62204,7 @@ Use /mcp auth <server-name> to authenticate.`
62204
62204
  type: "info",
62205
62205
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
62206
62206
  });
62207
- const { MCPOAuthProvider } = await import("./core-T2TBFAYG.js");
62207
+ const { MCPOAuthProvider } = await import("./core-WXTAU5UX.js");
62208
62208
  let oauthConfig = server.oauth;
62209
62209
  if (!oauthConfig) {
62210
62210
  oauthConfig = { enabled: false };