@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,66 +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
- DEFAULT_PORT,
4
- getBinaryPath,
5
- isServerRunning
6
- } from "./chunk-5MQ5VMQK.js";
7
- import "./chunk-7H3CQGS6.js";
8
- import "./chunk-A564QXJJ.js";
9
- import {
10
- debugLogger
11
- } from "./chunk-JEW7ZIWE.js";
12
- import "./chunk-664ZODQF.js";
13
- import "./chunk-RJTRUG2J.js";
14
- import "./chunk-IUUIT4SU.js";
15
- import "./chunk-34MYV7JD.js";
16
-
17
- // packages/cli/src/services/liteRtServerManager.ts
18
- import fs from "node:fs";
19
- var LiteRtServerManager = class {
20
- static async ensureRunning(gemmaSettings) {
21
- if (!gemmaSettings?.enabled) return;
22
- if (gemmaSettings.autoStartServer === false) return;
23
- const binaryPath = getBinaryPath();
24
- if (!binaryPath || !fs.existsSync(binaryPath)) {
25
- debugLogger.log(
26
- '[LiteRtServerManager] Binary not installed, skipping auto-start. Run "gemini gemma setup".'
27
- );
28
- return;
29
- }
30
- const port = parseInt(
31
- gemmaSettings.classifier?.host?.match(/:(\d+)/)?.[1] ?? "",
32
- 10
33
- ) || DEFAULT_PORT;
34
- const running = await isServerRunning(port);
35
- if (running) {
36
- debugLogger.log(
37
- `[LiteRtServerManager] Server already running on port ${port}`
38
- );
39
- return;
40
- }
41
- debugLogger.log(
42
- `[LiteRtServerManager] Auto-starting LiteRT server on port ${port}...`
43
- );
44
- try {
45
- const { startServer } = await import("./start-HHZI73VV.js");
46
- const started = await startServer(binaryPath, port);
47
- if (started) {
48
- debugLogger.log(`[LiteRtServerManager] Server started on port ${port}`);
49
- } else {
50
- debugLogger.warn(
51
- `[LiteRtServerManager] Server may not have started correctly on port ${port}`
52
- );
53
- }
54
- } catch (error) {
55
- debugLogger.warn("[LiteRtServerManager] Auto-start failed:", error);
56
- }
57
- }
58
- };
59
- export {
60
- LiteRtServerManager
61
- };
62
- /**
63
- * @license
64
- * Copyright 2026 Google LLC
65
- * SPDX-License-Identifier: Apache-2.0
66
- */
@@ -1,237 +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
- BaseA2AAuthProvider,
4
- DefaultAgentCardResolver,
5
- MCPOAuthTokenStorage,
6
- buildAuthorizationUrl,
7
- exchangeCodeForToken,
8
- generatePKCEParams,
9
- getConsentForOauth,
10
- getPortFromUrl,
11
- openBrowserSecurely,
12
- refreshAccessToken,
13
- startCallbackServer
14
- } from "./chunk-A564QXJJ.js";
15
- import {
16
- FatalCancellationError,
17
- Storage,
18
- coreEvents,
19
- debugLogger,
20
- getErrorMessage
21
- } from "./chunk-JEW7ZIWE.js";
22
- import "./chunk-664ZODQF.js";
23
- import "./chunk-RJTRUG2J.js";
24
- import "./chunk-IUUIT4SU.js";
25
- import "./chunk-34MYV7JD.js";
26
-
27
- // packages/core/dist/src/agents/auth-provider/oauth2-provider.js
28
- var OAuth2AuthProvider = class extends BaseA2AAuthProvider {
29
- config;
30
- agentName;
31
- agentCardUrl;
32
- type = "oauth2";
33
- tokenStorage;
34
- cachedToken = null;
35
- /** Resolved OAuth URLs — may come from config or agent card. */
36
- authorizationUrl;
37
- tokenUrl;
38
- scopes;
39
- constructor(config, agentName, agentCard, agentCardUrl) {
40
- super();
41
- this.config = config;
42
- this.agentName = agentName;
43
- this.agentCardUrl = agentCardUrl;
44
- this.tokenStorage = new MCPOAuthTokenStorage(Storage.getA2AOAuthTokensPath(), "gemini-cli-a2a");
45
- this.authorizationUrl = config.authorization_url;
46
- this.tokenUrl = config.token_url;
47
- this.scopes = config.scopes;
48
- this.mergeAgentCardDefaults(agentCard);
49
- }
50
- /**
51
- * Initialize the provider by loading any persisted token from storage.
52
- * Also discovers OAuth URLs from the agent card if not yet resolved.
53
- */
54
- async initialize() {
55
- if ((!this.authorizationUrl || !this.tokenUrl) && this.agentCardUrl) {
56
- await this.fetchAgentCardDefaults();
57
- }
58
- const credentials = await this.tokenStorage.getCredentials(this.agentName);
59
- if (credentials && !this.tokenStorage.isTokenExpired(credentials.token)) {
60
- this.cachedToken = credentials.token;
61
- debugLogger.debug(`[OAuth2AuthProvider] Loaded valid cached token for "${this.agentName}"`);
62
- }
63
- }
64
- /**
65
- * Return an Authorization header with a valid Bearer token.
66
- * Refreshes or triggers interactive auth as needed.
67
- */
68
- async headers() {
69
- if (this.cachedToken && !this.tokenStorage.isTokenExpired(this.cachedToken)) {
70
- return { Authorization: `Bearer ${this.cachedToken.accessToken}` };
71
- }
72
- if (this.cachedToken?.refreshToken && this.tokenUrl && this.config.client_id) {
73
- try {
74
- const refreshed = await refreshAccessToken({
75
- clientId: this.config.client_id,
76
- clientSecret: this.config.client_secret,
77
- scopes: this.scopes
78
- }, this.cachedToken.refreshToken, this.tokenUrl);
79
- this.cachedToken = this.toOAuthToken(refreshed, this.cachedToken.refreshToken);
80
- await this.persistToken();
81
- return { Authorization: `Bearer ${this.cachedToken.accessToken}` };
82
- } catch (error) {
83
- debugLogger.debug(`[OAuth2AuthProvider] Refresh failed, falling back to interactive flow: ${getErrorMessage(error)}`);
84
- await this.tokenStorage.deleteCredentials(this.agentName);
85
- }
86
- }
87
- this.cachedToken = await this.authenticateInteractively();
88
- return { Authorization: `Bearer ${this.cachedToken.accessToken}` };
89
- }
90
- /**
91
- * On 401/403, clear the cached token and re-authenticate (up to MAX_AUTH_RETRIES).
92
- */
93
- async shouldRetryWithHeaders(_req, res) {
94
- if (res.status !== 401 && res.status !== 403) {
95
- this.authRetryCount = 0;
96
- return void 0;
97
- }
98
- if (this.authRetryCount >= BaseA2AAuthProvider.MAX_AUTH_RETRIES) {
99
- return void 0;
100
- }
101
- this.authRetryCount++;
102
- debugLogger.debug("[OAuth2AuthProvider] Auth failure, clearing token and re-authenticating");
103
- this.cachedToken = null;
104
- await this.tokenStorage.deleteCredentials(this.agentName);
105
- return this.headers();
106
- }
107
- // ---------------------------------------------------------------------------
108
- // Private helpers
109
- // ---------------------------------------------------------------------------
110
- /**
111
- * Merge authorization_url, token_url, and scopes from the agent card's
112
- * `securitySchemes` when not already provided via user config.
113
- */
114
- mergeAgentCardDefaults(agentCard) {
115
- if (!agentCard?.securitySchemes)
116
- return;
117
- for (const scheme of Object.values(agentCard.securitySchemes)) {
118
- if (scheme.type === "oauth2" && scheme.flows.authorizationCode) {
119
- const flow = scheme.flows.authorizationCode;
120
- this.authorizationUrl ??= flow.authorizationUrl;
121
- this.tokenUrl ??= flow.tokenUrl;
122
- this.scopes ??= Object.keys(flow.scopes);
123
- break;
124
- }
125
- }
126
- }
127
- /**
128
- * Fetch the agent card from `agentCardUrl` using `DefaultAgentCardResolver`
129
- * (which normalizes proto-format cards) and extract OAuth2 URLs.
130
- */
131
- async fetchAgentCardDefaults() {
132
- if (!this.agentCardUrl)
133
- return;
134
- try {
135
- debugLogger.debug(`[OAuth2AuthProvider] Fetching agent card from ${this.agentCardUrl}`);
136
- const resolver = new DefaultAgentCardResolver();
137
- const card = await resolver.resolve(this.agentCardUrl, "");
138
- this.mergeAgentCardDefaults(card);
139
- } catch (error) {
140
- debugLogger.warn(`[OAuth2AuthProvider] Could not fetch agent card for OAuth URL discovery: ${getErrorMessage(error)}`);
141
- }
142
- }
143
- /**
144
- * Run a full OAuth 2.0 Authorization Code + PKCE flow through the browser.
145
- */
146
- async authenticateInteractively() {
147
- if (!this.config.client_id) {
148
- throw new Error(`OAuth2 authentication for agent "${this.agentName}" requires a client_id. Add client_id to the auth config in your agent definition.`);
149
- }
150
- if (!this.authorizationUrl || !this.tokenUrl) {
151
- 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.`);
152
- }
153
- const flowConfig = {
154
- clientId: this.config.client_id,
155
- clientSecret: this.config.client_secret,
156
- authorizationUrl: this.authorizationUrl,
157
- tokenUrl: this.tokenUrl,
158
- scopes: this.scopes
159
- };
160
- const pkceParams = generatePKCEParams();
161
- const preferredPort = getPortFromUrl(flowConfig.redirectUri);
162
- const callbackServer = startCallbackServer(pkceParams.state, preferredPort);
163
- const redirectPort = await callbackServer.port;
164
- const authUrl = buildAuthorizationUrl(
165
- flowConfig,
166
- pkceParams,
167
- redirectPort,
168
- /* resource= */
169
- void 0
170
- );
171
- const consent = await getConsentForOauth(`Authentication required for A2A agent: '${this.agentName}'.`);
172
- if (!consent) {
173
- throw new FatalCancellationError("Authentication cancelled by user.");
174
- }
175
- coreEvents.emitFeedback("info", `\u2192 Opening your browser for OAuth sign-in...
176
-
177
- If the browser does not open, copy and paste this URL into your browser:
178
- ${authUrl}
179
-
180
- \u{1F4A1} TIP: Triple-click to select the entire URL, then copy and paste it into your browser.
181
- \u26A0\uFE0F Make sure to copy the COMPLETE URL - it may wrap across multiple lines.`);
182
- try {
183
- await openBrowserSecurely(authUrl);
184
- } catch (error) {
185
- debugLogger.warn("Failed to open browser automatically:", getErrorMessage(error));
186
- }
187
- const { code } = await callbackServer.response;
188
- debugLogger.debug("\u2713 Authorization code received, exchanging for tokens...");
189
- const tokenResponse = await exchangeCodeForToken(
190
- flowConfig,
191
- code,
192
- pkceParams.codeVerifier,
193
- redirectPort,
194
- /* resource= */
195
- void 0
196
- );
197
- if (!tokenResponse.access_token) {
198
- throw new Error("No access token received from token endpoint");
199
- }
200
- const token = this.toOAuthToken(tokenResponse);
201
- this.cachedToken = token;
202
- await this.persistToken();
203
- debugLogger.debug("\u2713 OAuth2 authentication successful! Token saved.");
204
- return token;
205
- }
206
- /**
207
- * Convert an `OAuthTokenResponse` into the internal `OAuthToken` format.
208
- */
209
- toOAuthToken(response, fallbackRefreshToken) {
210
- const token = {
211
- accessToken: response.access_token,
212
- tokenType: response.token_type || "Bearer",
213
- refreshToken: response.refresh_token || fallbackRefreshToken,
214
- scope: response.scope
215
- };
216
- if (response.expires_in) {
217
- token.expiresAt = Date.now() + response.expires_in * 1e3;
218
- }
219
- return token;
220
- }
221
- /**
222
- * Persist the current cached token to disk.
223
- */
224
- async persistToken() {
225
- if (!this.cachedToken)
226
- return;
227
- await this.tokenStorage.saveToken(this.agentName, this.cachedToken, this.config.client_id, this.tokenUrl);
228
- }
229
- };
230
- export {
231
- OAuth2AuthProvider
232
- };
233
- /**
234
- * @license
235
- * Copyright 2026 Google LLC
236
- * SPDX-License-Identifier: Apache-2.0
237
- */
@@ -1,19 +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
- startCommand,
4
- startServer
5
- } from "./chunk-GZ4FSF4B.js";
6
- import "./chunk-I5JMJ2LU.js";
7
- import "./chunk-NHDN46IK.js";
8
- import "./chunk-UZZVXATH.js";
9
- import "./chunk-6K3EFSDX.js";
10
- import "./chunk-QZ2JZRLK.js";
11
- import "./chunk-ECNYAST2.js";
12
- import "./chunk-664ZODQF.js";
13
- import "./chunk-RJTRUG2J.js";
14
- import "./chunk-IUUIT4SU.js";
15
- import "./chunk-34MYV7JD.js";
16
- export {
17
- startCommand,
18
- startServer
19
- };