@google/gemini-cli 0.49.0-nightly.20260625.gd845bc5d4 → 0.49.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 (66) hide show
  1. package/bundle/{chunk-DQARXBEA.js → chunk-2KPOY3PT.js} +1 -1
  2. package/bundle/{chunk-GP3HT3XA.js → chunk-5D76V46E.js} +1 -1
  3. package/bundle/{chunk-W4CY6ZAV.js → chunk-6SAPFKW2.js} +7 -7
  4. package/bundle/{chunk-KZTYIR7T.js → chunk-DG2DMXNL.js} +4 -4
  5. package/bundle/{chunk-M3LLLH4Q.js → chunk-DUXXYDOU.js} +14099 -7557
  6. package/bundle/{chunk-VFEUUHDP.js → chunk-GD7RCEFJ.js} +1 -1
  7. package/bundle/{chunk-Z7VJ5D2F.js → chunk-HHBELWTD.js} +1 -1
  8. package/bundle/{chunk-2H7H7LHE.js → chunk-KUPS66EC.js} +1 -1
  9. package/bundle/{chunk-ZUVD4OMS.js → chunk-KVKWITLW.js} +1 -1
  10. package/bundle/{chunk-CZXPXLF4.js → chunk-LJT2N46V.js} +2 -2
  11. package/bundle/{chunk-KEKQ7HNE.js → chunk-MT2PHBHF.js} +54 -67
  12. package/bundle/{chunk-6WLO7RJO.js → chunk-O3DZHA75.js} +3 -3
  13. package/bundle/{chunk-N6JHSW2E.js → chunk-QJ52LUEZ.js} +1 -1
  14. package/bundle/{chunk-PGI5U4RD.js → chunk-RWFC7SH2.js} +8 -9
  15. package/bundle/{chunk-LZSQIPID.js → chunk-SWRFLYQS.js} +3 -3
  16. package/bundle/{chunk-D7ASGNGV.js → chunk-THSPF7UM.js} +7 -7
  17. package/bundle/{chunk-JNWGPSWO.js → chunk-UTCNY4YR.js} +1 -1
  18. package/bundle/{chunk-4ZKDF6RJ.js → chunk-UXLDTYS5.js} +1 -1
  19. package/bundle/{chunk-LHQTFC5V.js → chunk-V33X6KEX.js} +2 -2
  20. package/bundle/{chunk-IH4N7SHL.js → chunk-VLV2BYPM.js} +4 -4
  21. package/bundle/{chunk-5VDCISGZ.js → chunk-VSVATFSS.js} +2 -2
  22. package/bundle/{chunk-NSCBFJB5.js → chunk-WDIGNHW2.js} +5 -8
  23. package/bundle/{chunk-DVXL5G45.js → chunk-YAWAHLTJ.js} +1 -1
  24. package/bundle/{chunk-SM66ZQJE.js → chunk-YP5PXUYC.js} +3 -3
  25. package/bundle/{cleanup-7ZAS2HJC.js → cleanup-J3QILUCY.js} +2 -2
  26. package/bundle/{cleanup-OWDILGDO.js → cleanup-UIXA2GEB.js} +2 -2
  27. package/bundle/{cleanup-UAXXCVMU.js → cleanup-YMPS4FUE.js} +2 -2
  28. package/bundle/{core-U7XFRGTW.js → core-64JIIVRX.js} +1 -1
  29. package/bundle/{dist-5MIUEMAQ.js → core-ELQDFBG3.js} +1 -1
  30. package/bundle/{devtoolsService-5OSGJYDS.js → devtoolsService-HCHZ2F6P.js} +2 -2
  31. package/bundle/{devtoolsService-6LH5MZBL.js → devtoolsService-HSYIYY4G.js} +3 -4
  32. package/bundle/{devtoolsService-6HAVTQZ5.js → devtoolsService-YX6EFIXG.js} +2 -2
  33. package/bundle/{dist-B6J3QDWI.js → dist-CLCQE7YY.js} +1 -1
  34. package/bundle/{gemini-H6TAAPCA.js → gemini-APNDCIQH.js} +196 -212
  35. package/bundle/{gemini-6SJTD2W4.js → gemini-FSMCKCVD.js} +14 -14
  36. package/bundle/{gemini-3BRU2HQK.js → gemini-MHDYPMBW.js} +13 -13
  37. package/bundle/gemini.js +7 -7
  38. package/bundle/{interactiveCli-B6MSN4C4.js → interactiveCli-4GI574PD.js} +8 -8
  39. package/bundle/{interactiveCli-KOS354WR.js → interactiveCli-PM57R35K.js} +295 -314
  40. package/bundle/{interactiveCli-BS2D2SBI.js → interactiveCli-PR7HIXJT.js} +8 -8
  41. package/bundle/{liteRtServerManager-FWHYC4A3.js → liteRtServerManager-IXIJTRUX.js} +4 -4
  42. package/bundle/{liteRtServerManager-HIIW3S66.js → liteRtServerManager-SRAMJKDM.js} +4 -4
  43. package/bundle/{liteRtServerManager-M7B3AIIU.js → liteRtServerManager-TYKWESZG.js} +4 -4
  44. package/bundle/{oauth2-provider-RILC6FBL.js → oauth2-provider-4UAT62TZ.js} +1 -1
  45. package/bundle/{oauth2-provider-G7I2PMHS.js → oauth2-provider-I7ZHNJPU.js} +72 -38
  46. package/bundle/{oauth2-provider-EA2VTAQO.js → oauth2-provider-UU4JM5RG.js} +1 -1
  47. package/bundle/{start-AVLVGFFA.js → start-C5MXXCE7.js} +6 -6
  48. package/bundle/{start-CCQWWAKJ.js → start-RIHKQGGY.js} +6 -6
  49. package/bundle/{start-FI6MCT26.js → start-W4HQTHNO.js} +6 -6
  50. package/package.json +1 -1
  51. package/bundle/chunk-6VICSAQD.js +0 -154
  52. package/bundle/chunk-EB5KWRK7.js +0 -512
  53. package/bundle/chunk-IP2NI6CQ.js +0 -398
  54. package/bundle/chunk-M43EUC7R.js +0 -1571
  55. package/bundle/chunk-P3C2ZDOD.js +0 -102505
  56. package/bundle/chunk-SSMJN6LA.js +0 -387674
  57. package/bundle/chunk-TNS2COLB.js +0 -17332
  58. package/bundle/chunk-YNU56L7B.js +0 -118
  59. package/bundle/cleanup-VF75F443.js +0 -32
  60. package/bundle/devtoolsService-OV63XS6S.js +0 -4359
  61. package/bundle/dist-GPCVSENP.js +0 -2150
  62. package/bundle/gemini-R6VOKNQ4.js +0 -29270
  63. package/bundle/interactiveCli-HSHPW4IB.js +0 -34767
  64. package/bundle/liteRtServerManager-ZMLRN3HQ.js +0 -65
  65. package/bundle/oauth2-provider-KED65L5Q.js +0 -235
  66. package/bundle/start-OOI6CRQA.js +0 -18
@@ -157,13 +157,13 @@ import {
157
157
  widestLineFromStyledChars,
158
158
  wordBreakStyledChars,
159
159
  wrapStyledChars
160
- } from "./chunk-KEKQ7HNE.js";
160
+ } from "./chunk-THSPF7UM.js";
161
161
  import {
162
162
  appEvents
163
163
  } from "./chunk-5PS3AYFU.js";
164
164
  import {
165
165
  require_source
166
- } from "./chunk-M43EUC7R.js";
166
+ } from "./chunk-KUPS66EC.js";
167
167
  import {
168
168
  ACTIVE_SHELL_MAX_LINES,
169
169
  COMPACT_TOOL_SUBVIEW_MAX_LINES,
@@ -214,24 +214,24 @@ import {
214
214
  stripAnsi,
215
215
  stripUnsafeCharacters,
216
216
  toCodePoints
217
- } from "./chunk-NSCBFJB5.js";
217
+ } from "./chunk-UTCNY4YR.js";
218
218
  import {
219
219
  handleAutoUpdate,
220
220
  isDevelopment,
221
221
  relaunchApp,
222
222
  setUpdateHandler
223
- } from "./chunk-CZXPXLF4.js";
223
+ } from "./chunk-V33X6KEX.js";
224
224
  import {
225
225
  isTodoList,
226
226
  mapCoreStatusToDisplayStatus,
227
227
  require_react
228
- } from "./chunk-DQARXBEA.js";
228
+ } from "./chunk-2KPOY3PT.js";
229
229
  import {
230
230
  registerCleanup,
231
231
  removeCleanup,
232
232
  runExitCleanup,
233
233
  setupTtyCheck
234
- } from "./chunk-6VICSAQD.js";
234
+ } from "./chunk-KVKWITLW.js";
235
235
  import {
236
236
  ACTIVATE_SKILL_TOOL_NAME,
237
237
  AGENT_TOOL_NAME,
@@ -431,7 +431,7 @@ import {
431
431
  validatePlanContent,
432
432
  validatePlanPath,
433
433
  writeToStdout
434
- } from "./chunk-M3LLLH4Q.js";
434
+ } from "./chunk-VLV2BYPM.js";
435
435
  import "./chunk-664ZODQF.js";
436
436
  import "./chunk-TUDYL3X4.js";
437
437
  import "./chunk-IUUIT4SU.js";
@@ -33748,7 +33748,7 @@ ${queuedText}` : queuedText;
33748
33748
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33749
33749
  if (settings.merged.general.devtools) {
33750
33750
  void (async () => {
33751
- const { toggleDevToolsPanel } = await import("./devtoolsService-6HAVTQZ5.js");
33751
+ const { toggleDevToolsPanel } = await import("./devtoolsService-YX6EFIXG.js");
33752
33752
  await toggleDevToolsPanel(
33753
33753
  config,
33754
33754
  showErrorDetails,
@@ -3,11 +3,11 @@ import {
3
3
  DEFAULT_PORT,
4
4
  getBinaryPath,
5
5
  isServerRunning
6
- } from "./chunk-NSCBFJB5.js";
7
- import "./chunk-DQARXBEA.js";
6
+ } from "./chunk-GD7RCEFJ.js";
7
+ import "./chunk-5D76V46E.js";
8
8
  import {
9
9
  debugLogger
10
- } from "./chunk-M3LLLH4Q.js";
10
+ } from "./chunk-DUXXYDOU.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-TUDYL3X4.js";
13
13
  import "./chunk-IUUIT4SU.js";
@@ -41,7 +41,7 @@ var LiteRtServerManager = class {
41
41
  `[LiteRtServerManager] Auto-starting LiteRT server on port ${port}...`
42
42
  );
43
43
  try {
44
- const { startServer } = await import("./start-OOI6CRQA.js");
44
+ const { startServer } = await import("./start-W4HQTHNO.js");
45
45
  const started = await startServer(binaryPath, port);
46
46
  if (started) {
47
47
  debugLogger.log(`[LiteRtServerManager] Server started on port ${port}`);
@@ -3,11 +3,11 @@ import {
3
3
  DEFAULT_PORT,
4
4
  getBinaryPath,
5
5
  isServerRunning
6
- } from "./chunk-TNS2COLB.js";
7
- import "./chunk-EB5KWRK7.js";
6
+ } from "./chunk-UTCNY4YR.js";
7
+ import "./chunk-2KPOY3PT.js";
8
8
  import {
9
9
  debugLogger
10
- } from "./chunk-IH4N7SHL.js";
10
+ } from "./chunk-VLV2BYPM.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-TUDYL3X4.js";
13
13
  import "./chunk-IUUIT4SU.js";
@@ -41,7 +41,7 @@ var LiteRtServerManager = class {
41
41
  `[LiteRtServerManager] Auto-starting LiteRT server on port ${port}...`
42
42
  );
43
43
  try {
44
- const { startServer } = await import("./start-AVLVGFFA.js");
44
+ const { startServer } = await import("./start-C5MXXCE7.js");
45
45
  const started = await startServer(binaryPath, port);
46
46
  if (started) {
47
47
  debugLogger.log(`[LiteRtServerManager] Server started on port ${port}`);
@@ -3,11 +3,11 @@ import {
3
3
  DEFAULT_PORT,
4
4
  getBinaryPath,
5
5
  isServerRunning
6
- } from "./chunk-VFEUUHDP.js";
7
- import "./chunk-GP3HT3XA.js";
6
+ } from "./chunk-WDIGNHW2.js";
7
+ import "./chunk-RWFC7SH2.js";
8
8
  import {
9
9
  debugLogger
10
- } from "./chunk-KZTYIR7T.js";
10
+ } from "./chunk-DG2DMXNL.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-TUDYL3X4.js";
13
13
  import "./chunk-IUUIT4SU.js";
@@ -41,7 +41,7 @@ var LiteRtServerManager = class {
41
41
  `[LiteRtServerManager] Auto-starting LiteRT server on port ${port}...`
42
42
  );
43
43
  try {
44
- const { startServer } = await import("./start-CCQWWAKJ.js");
44
+ const { startServer } = await import("./start-RIHKQGGY.js");
45
45
  const started = await startServer(binaryPath, port);
46
46
  if (started) {
47
47
  debugLogger.log(`[LiteRtServerManager] Server started on port ${port}`);
@@ -16,7 +16,7 @@ import {
16
16
  openBrowserSecurely,
17
17
  refreshAccessToken,
18
18
  startCallbackServer
19
- } from "./chunk-KZTYIR7T.js";
19
+ } from "./chunk-DG2DMXNL.js";
20
20
  import "./chunk-664ZODQF.js";
21
21
  import "./chunk-TUDYL3X4.js";
22
22
  import "./chunk-IUUIT4SU.js";
@@ -16,35 +16,35 @@ import {
16
16
  openBrowserSecurely,
17
17
  refreshAccessToken,
18
18
  startCallbackServer
19
- } from "./chunk-M3LLLH4Q.js";
19
+ } from "./chunk-DUXXYDOU.js";
20
20
  import "./chunk-664ZODQF.js";
21
21
  import "./chunk-TUDYL3X4.js";
22
22
  import "./chunk-IUUIT4SU.js";
23
23
  import "./chunk-34MYV7JD.js";
24
24
 
25
- // packages/core/dist/src/agents/auth-provider/oauth2-provider.js
25
+ // packages/core/src/agents/auth-provider/oauth2-provider.ts
26
26
  var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
27
- config;
28
- agentName;
29
- agentCardUrl;
30
- type = "oauth2";
31
- tokenStorage;
32
- cachedToken = null;
33
- /** Resolved OAuth URLs — may come from config or agent card. */
34
- authorizationUrl;
35
- tokenUrl;
36
- scopes;
37
27
  constructor(config, agentName, agentCard, agentCardUrl) {
38
28
  super();
39
29
  this.config = config;
40
30
  this.agentName = agentName;
41
31
  this.agentCardUrl = agentCardUrl;
42
- this.tokenStorage = new MCPOAuthTokenStorage(Storage.getA2AOAuthTokensPath(), "gemini-cli-a2a");
32
+ this.tokenStorage = new MCPOAuthTokenStorage(
33
+ Storage.getA2AOAuthTokensPath(),
34
+ "gemini-cli-a2a"
35
+ );
43
36
  this.authorizationUrl = config.authorization_url;
44
37
  this.tokenUrl = config.token_url;
45
38
  this.scopes = config.scopes;
46
39
  this.mergeAgentCardDefaults(agentCard);
47
40
  }
41
+ type = "oauth2";
42
+ tokenStorage;
43
+ cachedToken = null;
44
+ /** Resolved OAuth URLs — may come from config or agent card. */
45
+ authorizationUrl;
46
+ tokenUrl;
47
+ scopes;
48
48
  /**
49
49
  * Initialize the provider by loading any persisted token from storage.
50
50
  * Also discovers OAuth URLs from the agent card if not yet resolved.
@@ -56,7 +56,9 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
56
56
  const credentials = await this.tokenStorage.getCredentials(this.agentName);
57
57
  if (credentials && !this.tokenStorage.isTokenExpired(credentials.token)) {
58
58
  this.cachedToken = credentials.token;
59
- debugLogger.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`);
59
+ debugLogger.debug(
60
+ `[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`
61
+ );
60
62
  }
61
63
  }
62
64
  /**
@@ -69,16 +71,25 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
69
71
  }
70
72
  if (this.cachedToken?.refreshToken && this.tokenUrl && this.config.client_id) {
71
73
  try {
72
- const refreshed = await refreshAccessToken({
73
- clientId: this.config.client_id,
74
- clientSecret: this.config.client_secret,
75
- scopes: this.scopes
76
- }, this.cachedToken.refreshToken, this.tokenUrl);
77
- this.cachedToken = this.toOAuthToken(refreshed, this.cachedToken.refreshToken);
74
+ const refreshed = await refreshAccessToken(
75
+ {
76
+ clientId: this.config.client_id,
77
+ clientSecret: this.config.client_secret,
78
+ scopes: this.scopes
79
+ },
80
+ this.cachedToken.refreshToken,
81
+ this.tokenUrl
82
+ );
83
+ this.cachedToken = this.toOAuthToken(
84
+ refreshed,
85
+ this.cachedToken.refreshToken
86
+ );
78
87
  await this.persistToken();
79
88
  return { Authorization: `Bearer ${this.cachedToken.accessToken}` };
80
89
  } catch (error) {
81
- debugLogger.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${getErrorMessage(error)}`);
90
+ debugLogger.debug(
91
+ `[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${getErrorMessage(error)}`
92
+ );
82
93
  await this.tokenStorage.deleteCredentials(this.agentName);
83
94
  }
84
95
  }
@@ -97,7 +108,9 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
97
108
  return void 0;
98
109
  }
99
110
  this.authRetryCount++;
100
- debugLogger.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating");
111
+ debugLogger.debug(
112
+ "[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating"
113
+ );
101
114
  this.cachedToken = null;
102
115
  await this.tokenStorage.deleteCredentials(this.agentName);
103
116
  return this.headers();
@@ -110,8 +123,7 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
110
123
  * `securitySchemes` when not already provided via user config.
111
124
  */
112
125
  mergeAgentCardDefaults(agentCard) {
113
- if (!agentCard?.securitySchemes)
114
- return;
126
+ if (!agentCard?.securitySchemes) return;
115
127
  for (const scheme of Object.values(agentCard.securitySchemes)) {
116
128
  if (scheme.type === "oauth2" && scheme.flows.authorizationCode) {
117
129
  const flow = scheme.flows.authorizationCode;
@@ -127,15 +139,18 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
127
139
  * (which normalizes proto-format cards) and extract OAuth2 URLs.
128
140
  */
129
141
  async fetchAgentCardDefaults() {
130
- if (!this.agentCardUrl)
131
- return;
142
+ if (!this.agentCardUrl) return;
132
143
  try {
133
- debugLogger.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);
144
+ debugLogger.debug(
145
+ `[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`
146
+ );
134
147
  const resolver = new DefaultAgentCardResolver();
135
148
  const card = await resolver.resolve(this.agentCardUrl, "");
136
149
  this.mergeAgentCardDefaults(card);
137
150
  } catch (error) {
138
- debugLogger.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${getErrorMessage(error)}`);
151
+ debugLogger.warn(
152
+ `[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${getErrorMessage(error)}`
153
+ );
139
154
  }
140
155
  }
141
156
  /**
@@ -143,10 +158,14 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
143
158
  */
144
159
  async authenticateInteractively() {
145
160
  if (!this.config.client_id) {
146
- throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);
161
+ throw new Error(
162
+ `OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`
163
+ );
147
164
  }
148
165
  if (!this.authorizationUrl || !this.tokenUrl) {
149
- throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`);
166
+ throw new Error(
167
+ `OAuth2 authentication for agent "${this.agentName}" requires authorization_url and token_url. Provide them in the auth config or ensure the agent card exposes an oauth2 security scheme.`
168
+ );
150
169
  }
151
170
  const flowConfig = {
152
171
  clientId: this.config.client_id,
@@ -165,25 +184,36 @@ var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
165
184
  redirectPort,
166
185
  /* resource= */
167
186
  void 0
187
+ // No MCP resource parameter for A2A.
188
+ );
189
+ const consent = await getConsentForOauth(
190
+ `Authentication required for A2A agent: '${this.agentName}'.`
168
191
  );
169
- const consent = await getConsentForOauth(`Authentication required for A2A agent: '${this.agentName}'.`);
170
192
  if (!consent) {
171
193
  throw new FatalCancellationError("Authentication cancelled by user.");
172
194
  }
173
- coreEvents.emitFeedback("info", `\u2192 Opening your browser for OAuth sign-in...
195
+ coreEvents.emitFeedback(
196
+ "info",
197
+ `\u2192 Opening your browser for OAuth sign-in...
174
198
 
175
199
  If the browser does not open, copy and paste this URL into your browser:
176
200
  ${authUrl}
177
201
 
178
202
  \u{1F4A1} TIP: Triple-click to select the entire URL, then copy and paste it into your browser.
179
- \u26A0\uFE0F Make sure to copy the COMPLETE URL - it may wrap across multiple lines.`);
203
+ \u26A0\uFE0F Make sure to copy the COMPLETE URL - it may wrap across multiple lines.`
204
+ );
180
205
  try {
181
206
  await openBrowserSecurely(authUrl);
182
207
  } catch (error) {
183
- debugLogger.warn("Failed to open browser automatically:", getErrorMessage(error));
208
+ debugLogger.warn(
209
+ "Failed to open browser automatically:",
210
+ getErrorMessage(error)
211
+ );
184
212
  }
185
213
  const { code } = await callbackServer.response;
186
- debugLogger.debug("\u2713 Authorization code received, exchanging for tokens...");
214
+ debugLogger.debug(
215
+ "\u2713 Authorization code received, exchanging for tokens..."
216
+ );
187
217
  const tokenResponse = await exchangeCodeForToken(
188
218
  flowConfig,
189
219
  code,
@@ -220,9 +250,13 @@ ${authUrl}
220
250
  * Persist the current cached token to disk.
221
251
  */
222
252
  async persistToken() {
223
- if (!this.cachedToken)
224
- return;
225
- await this.tokenStorage.saveToken(this.agentName, this.cachedToken, this.config.client_id, this.tokenUrl);
253
+ if (!this.cachedToken) return;
254
+ await this.tokenStorage.saveToken(
255
+ this.agentName,
256
+ this.cachedToken,
257
+ this.config.client_id,
258
+ this.tokenUrl
259
+ );
226
260
  }
227
261
  };
228
262
  export {
@@ -16,7 +16,7 @@ import {
16
16
  openBrowserSecurely,
17
17
  refreshAccessToken,
18
18
  startCallbackServer
19
- } from "./chunk-IH4N7SHL.js";
19
+ } from "./chunk-VLV2BYPM.js";
20
20
  import "./chunk-664ZODQF.js";
21
21
  import "./chunk-TUDYL3X4.js";
22
22
  import "./chunk-IUUIT4SU.js";
@@ -2,12 +2,12 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  startCommand,
4
4
  startServer
5
- } from "./chunk-SM66ZQJE.js";
6
- import "./chunk-4ZKDF6RJ.js";
7
- import "./chunk-TNS2COLB.js";
8
- import "./chunk-EB5KWRK7.js";
9
- import "./chunk-Z7VJ5D2F.js";
10
- import "./chunk-IH4N7SHL.js";
5
+ } from "./chunk-O3DZHA75.js";
6
+ import "./chunk-KUPS66EC.js";
7
+ import "./chunk-UTCNY4YR.js";
8
+ import "./chunk-2KPOY3PT.js";
9
+ import "./chunk-KVKWITLW.js";
10
+ import "./chunk-VLV2BYPM.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-TUDYL3X4.js";
13
13
  import "./chunk-IUUIT4SU.js";
@@ -2,12 +2,12 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  startCommand,
4
4
  startServer
5
- } from "./chunk-YNU56L7B.js";
6
- import "./chunk-DVXL5G45.js";
7
- import "./chunk-VFEUUHDP.js";
8
- import "./chunk-GP3HT3XA.js";
9
- import "./chunk-ZUVD4OMS.js";
10
- import "./chunk-KZTYIR7T.js";
5
+ } from "./chunk-YP5PXUYC.js";
6
+ import "./chunk-YAWAHLTJ.js";
7
+ import "./chunk-WDIGNHW2.js";
8
+ import "./chunk-RWFC7SH2.js";
9
+ import "./chunk-HHBELWTD.js";
10
+ import "./chunk-DG2DMXNL.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-TUDYL3X4.js";
13
13
  import "./chunk-IUUIT4SU.js";
@@ -2,12 +2,12 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  startCommand,
4
4
  startServer
5
- } from "./chunk-6WLO7RJO.js";
6
- import "./chunk-2H7H7LHE.js";
7
- import "./chunk-JNWGPSWO.js";
8
- import "./chunk-PGI5U4RD.js";
9
- import "./chunk-N6JHSW2E.js";
10
- import "./chunk-SSMJN6LA.js";
5
+ } from "./chunk-SWRFLYQS.js";
6
+ import "./chunk-UXLDTYS5.js";
7
+ import "./chunk-GD7RCEFJ.js";
8
+ import "./chunk-5D76V46E.js";
9
+ import "./chunk-QJ52LUEZ.js";
10
+ import "./chunk-DUXXYDOU.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-TUDYL3X4.js";
13
13
  import "./chunk-IUUIT4SU.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/gemini-cli",
3
- "version": "0.49.0-nightly.20260625.gd845bc5d4",
3
+ "version": "0.49.0",
4
4
  "description": "Gemini CLI",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,154 +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
- ExitCodes,
4
- Storage,
5
- isTelemetrySdkInitialized,
6
- resetBrowserSession,
7
- shutdownTelemetry
8
- } from "./chunk-M3LLLH4Q.js";
9
-
10
- // packages/cli/src/utils/cleanup.ts
11
- import { promises as fs } from "node:fs";
12
- import { join } from "node:path";
13
- var cleanupFunctions = [];
14
- var syncCleanupFunctions = [];
15
- var configForTelemetry = null;
16
- var isShuttingDown = false;
17
- function registerCleanup(fn) {
18
- cleanupFunctions.push(fn);
19
- }
20
- function removeCleanup(fn) {
21
- const index = cleanupFunctions.indexOf(fn);
22
- if (index !== -1) {
23
- cleanupFunctions.splice(index, 1);
24
- }
25
- }
26
- function registerSyncCleanup(fn) {
27
- syncCleanupFunctions.push(fn);
28
- }
29
- function removeSyncCleanup(fn) {
30
- const index = syncCleanupFunctions.indexOf(fn);
31
- if (index !== -1) {
32
- syncCleanupFunctions.splice(index, 1);
33
- }
34
- }
35
- function resetCleanupForTesting() {
36
- cleanupFunctions.length = 0;
37
- syncCleanupFunctions.length = 0;
38
- configForTelemetry = null;
39
- isShuttingDown = false;
40
- }
41
- function runSyncCleanup() {
42
- for (const fn of syncCleanupFunctions) {
43
- try {
44
- fn();
45
- } catch {
46
- }
47
- }
48
- syncCleanupFunctions.length = 0;
49
- }
50
- function registerTelemetryConfig(config) {
51
- configForTelemetry = config;
52
- }
53
- async function runExitCleanup() {
54
- await drainStdin();
55
- runSyncCleanup();
56
- for (const fn of cleanupFunctions) {
57
- try {
58
- await fn();
59
- } catch {
60
- }
61
- }
62
- cleanupFunctions.length = 0;
63
- try {
64
- await resetBrowserSession();
65
- } catch {
66
- }
67
- if (configForTelemetry) {
68
- try {
69
- await configForTelemetry.dispose();
70
- } catch {
71
- }
72
- }
73
- if (configForTelemetry && isTelemetrySdkInitialized()) {
74
- try {
75
- await shutdownTelemetry(configForTelemetry);
76
- } catch {
77
- }
78
- }
79
- }
80
- async function drainStdin() {
81
- if (!process.stdin?.isTTY) return;
82
- process.stdin.resume().removeAllListeners("data").on("data", () => {
83
- });
84
- await new Promise((resolve) => setTimeout(resolve, 50));
85
- }
86
- async function gracefulShutdown(_reason) {
87
- if (isShuttingDown) {
88
- return;
89
- }
90
- isShuttingDown = true;
91
- await runExitCleanup();
92
- process.exit(ExitCodes.SUCCESS);
93
- }
94
- function setupSignalHandlers() {
95
- process.on("SIGHUP", () => gracefulShutdown("SIGHUP"));
96
- process.on("SIGTERM", () => gracefulShutdown("SIGTERM"));
97
- process.on("SIGINT", () => gracefulShutdown("SIGINT"));
98
- }
99
- function setupTtyCheck() {
100
- let intervalId = null;
101
- let isCheckingTty = false;
102
- intervalId = setInterval(async () => {
103
- if (isCheckingTty || isShuttingDown) {
104
- return;
105
- }
106
- if (process.env["SANDBOX"]) {
107
- return;
108
- }
109
- if (!process.stdin.isTTY && !process.stdout.isTTY) {
110
- isCheckingTty = true;
111
- if (intervalId) {
112
- clearInterval(intervalId);
113
- intervalId = null;
114
- }
115
- await gracefulShutdown("TTY loss");
116
- }
117
- }, 5e3);
118
- intervalId.unref();
119
- return () => {
120
- if (intervalId) {
121
- clearInterval(intervalId);
122
- intervalId = null;
123
- }
124
- };
125
- }
126
- async function cleanupCheckpoints() {
127
- const storage = new Storage(process.cwd());
128
- await storage.initialize();
129
- const tempDir = storage.getProjectTempDir();
130
- const checkpointsDir = join(tempDir, "checkpoints");
131
- try {
132
- await fs.rm(checkpointsDir, { recursive: true, force: true });
133
- } catch {
134
- }
135
- }
136
-
137
- export {
138
- registerCleanup,
139
- removeCleanup,
140
- registerSyncCleanup,
141
- removeSyncCleanup,
142
- resetCleanupForTesting,
143
- runSyncCleanup,
144
- registerTelemetryConfig,
145
- runExitCleanup,
146
- setupSignalHandlers,
147
- setupTtyCheck,
148
- cleanupCheckpoints
149
- };
150
- /**
151
- * @license
152
- * Copyright 2025 Google LLC
153
- * SPDX-License-Identifier: Apache-2.0
154
- */