@google/gemini-cli 0.63.0-preview.0 → 0.64.0-nightly.20261001.gc6bccb7ec
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.
- package/bundle/{chunk-EIMVJG2V.js → chunk-2AWGKUBT.js} +1 -1
- package/bundle/{chunk-GRSO6OI3.js → chunk-33M6KTJD.js} +11 -9
- package/bundle/{chunk-2J6RC447.js → chunk-3V7PFNJW.js} +3 -3
- package/bundle/{chunk-NWSCUKK3.js → chunk-5Q2IR4AT.js} +1512 -1317
- package/bundle/{chunk-RXHIISMM.js → chunk-5S3XVXG6.js} +1 -1
- package/bundle/{chunk-R6Q6D3UA.js → chunk-A7EL6FWX.js} +1 -1
- package/bundle/{chunk-UEOEM4H5.js → chunk-AMALQQ3Z.js} +3 -3
- package/bundle/{chunk-EWEUWTBB.js → chunk-CBYMGCHX.js} +75 -60
- package/bundle/{chunk-2NCBQURB.js → chunk-CFKLEVXK.js} +1 -1
- package/bundle/{chunk-RC6VJ6FT.js → chunk-DGM2IXGQ.js} +1 -1
- package/bundle/{chunk-NTWFJ2RF.js → chunk-EUQCH4QF.js} +2 -2
- package/bundle/{chunk-KCB54UJ5.js → chunk-FLYR6TVJ.js} +9279 -16064
- package/bundle/{chunk-H4WLRV6U.js → chunk-FQCPUDNE.js} +2 -2
- package/bundle/{chunk-BVDTRESW.js → chunk-FSELSFI5.js} +1 -1
- package/bundle/{chunk-5VYF5TVF.js → chunk-G4FAHQEH.js} +2 -2
- package/bundle/{chunk-Z5RCAIV5.js → chunk-I5GYMICM.js} +7 -5
- package/bundle/{chunk-JEUVKR2X.js → chunk-IGVQSZBB.js} +3 -3
- package/bundle/{chunk-HBZBBLAV.js → chunk-JMQIN5UZ.js} +1521 -1323
- package/bundle/{chunk-KPPDDNGJ.js → chunk-JW5YA5WN.js} +9 -8
- package/bundle/chunk-KTIX6VY2.js +17446 -0
- package/bundle/{chunk-SNGNFODQ.js → chunk-KUSXLIPR.js} +1 -1
- package/bundle/{chunk-ZDQYLJYN.js → chunk-KVZWFEJY.js} +1 -1
- package/bundle/{chunk-2P4ETAEG.js → chunk-LTM347XQ.js} +1 -1
- package/bundle/chunk-LXT3NLFW.js +118 -0
- package/bundle/chunk-PAWJR2VY.js +1571 -0
- package/bundle/chunk-RVS5CHWO.js +425 -0
- package/bundle/{chunk-B2C7BQ4Z.js → chunk-RW6IRAFG.js} +11 -9
- package/bundle/{chunk-CTL6DZSY.js → chunk-U4667HKR.js} +1 -1
- package/bundle/chunk-WTO5SKFR.js +400730 -0
- package/bundle/chunk-WXSWGEUJ.js +512 -0
- package/bundle/chunk-XKSEOGBW.js +154 -0
- package/bundle/chunk-ZG5IQP2R.js +102953 -0
- package/bundle/{cleanup-EX2L3L3E.js → cleanup-I7CTORMX.js} +2 -2
- package/bundle/{cleanup-IT7XR7KS.js → cleanup-MOFJ6BES.js} +2 -2
- package/bundle/{cleanup-WWLYKZIX.js → cleanup-OAR3IBTA.js} +2 -2
- package/bundle/cleanup-WFLHSVPH.js +32 -0
- package/bundle/{core-GAJB2LOX.js → core-VXMTLS6K.js} +1 -1
- package/bundle/{devtoolsService-TJPENQSW.js → devtoolsService-4QAJJ6WJ.js} +2 -2
- package/bundle/{devtoolsService-S4ZTRGJL.js → devtoolsService-54XKSYYW.js} +4 -3
- package/bundle/{devtoolsService-4YTFHHPN.js → devtoolsService-L6BPP3IA.js} +2 -2
- package/bundle/devtoolsService-LSDQLZ62.js +4359 -0
- package/bundle/{dist-MTMOCTIW.js → dist-BNMP57Q5.js} +1 -1
- package/bundle/{core-D5D4MF5H.js → dist-FJ7DKGAM.js} +1 -1
- package/bundle/dist-U5DFAJ4Y.js +2250 -0
- package/bundle/docs/changelogs/preview.md +54 -65
- package/bundle/{gemini-5T5BS7L7.js → gemini-L553JD26.js} +66 -95
- package/bundle/{gemini-FHORRYHM.js → gemini-LN35PXGR.js} +66 -95
- package/bundle/gemini-VZOPAMKQ.js +17834 -0
- package/bundle/{gemini-UQRS6TBE.js → gemini-W63I3AHM.js} +266 -279
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-WOM6QZHM.js → interactiveCli-2JCDVYVC.js} +26 -23
- package/bundle/{interactiveCli-I5K7O5Z6.js → interactiveCli-KN6ETEWY.js} +26 -23
- package/bundle/{interactiveCli-5YNYZTMK.js → interactiveCli-N7HBJ434.js} +329 -307
- package/bundle/interactiveCli-TX7INBPE.js +34918 -0
- package/bundle/{liteRtServerManager-EH2L2UVH.js → liteRtServerManager-GIDPQRR4.js} +4 -4
- package/bundle/{liteRtServerManager-ZLIHBLZP.js → liteRtServerManager-NK3OA5CI.js} +4 -4
- package/bundle/{liteRtServerManager-3N5KI6YS.js → liteRtServerManager-NSDSBW7B.js} +4 -4
- package/bundle/liteRtServerManager-PKOODTU4.js +65 -0
- package/bundle/{oauth2-provider-TA2KRXWQ.js → oauth2-provider-DE3RVHTQ.js} +1 -1
- package/bundle/{oauth2-provider-5GFYTXFU.js → oauth2-provider-FDRYB63N.js} +38 -72
- package/bundle/{oauth2-provider-NGSH2JQK.js → oauth2-provider-KMACQ2PX.js} +1 -1
- package/bundle/oauth2-provider-UAZAD3AF.js +235 -0
- package/bundle/{start-M3IUNCYH.js → start-5X2H6QGN.js} +6 -6
- package/bundle/{start-MWDNIQUY.js → start-AMYT67DW.js} +6 -6
- package/bundle/{start-CWI6OP6N.js → start-QYGGE4KC.js} +6 -6
- package/bundle/start-WWUBZPNX.js +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,425 @@
|
|
|
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-XKSEOGBW.js";
|
|
5
|
+
import {
|
|
6
|
+
RELEASE_CHANNEL_STABILITY,
|
|
7
|
+
debugLogger,
|
|
8
|
+
getChannelFromVersion,
|
|
9
|
+
isGitRepository
|
|
10
|
+
} from "./chunk-WTO5SKFR.js";
|
|
11
|
+
|
|
12
|
+
// packages/cli/src/utils/installationInfo.ts
|
|
13
|
+
import * as fs from "node:fs";
|
|
14
|
+
import * as path from "node:path";
|
|
15
|
+
import * as childProcess from "node:child_process";
|
|
16
|
+
import process2 from "node:process";
|
|
17
|
+
var isDevelopment = process2.env["NODE_ENV"] === "development";
|
|
18
|
+
function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
|
|
19
|
+
const cliPath = process2.argv[1];
|
|
20
|
+
if (!cliPath) {
|
|
21
|
+
return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
if (process2.env["IS_BINARY"] === "true") {
|
|
25
|
+
return {
|
|
26
|
+
packageManager: "binary" /* BINARY */,
|
|
27
|
+
isGlobal: true,
|
|
28
|
+
updateMessage: "Running as a standalone binary. Please update by downloading the latest version from GitHub."
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const realPath = fs.realpathSync(cliPath).replace(/\\/g, "/");
|
|
32
|
+
const normalizedProjectRoot = projectRoot?.replace(/\\/g, "/");
|
|
33
|
+
const isGit = isGitRepository(process2.cwd());
|
|
34
|
+
if (isGit && normalizedProjectRoot && realPath.startsWith(normalizedProjectRoot) && !realPath.includes("/node_modules/")) {
|
|
35
|
+
return {
|
|
36
|
+
packageManager: "unknown" /* UNKNOWN */,
|
|
37
|
+
// Not managed by a package manager in this sense
|
|
38
|
+
isGlobal: false,
|
|
39
|
+
updateMessage: 'Running from a local git clone. Please update with "git pull".'
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (realPath.includes("/.npm/_npx") || realPath.includes("/npm/_npx")) {
|
|
43
|
+
return {
|
|
44
|
+
packageManager: "npx" /* NPX */,
|
|
45
|
+
isGlobal: false,
|
|
46
|
+
updateMessage: "Running via npx, update not applicable."
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (realPath.includes("/.pnpm/_pnpx") || realPath.includes("/.cache/pnpm/dlx")) {
|
|
50
|
+
return {
|
|
51
|
+
packageManager: "pnpx" /* PNPX */,
|
|
52
|
+
isGlobal: false,
|
|
53
|
+
updateMessage: "Running via pnpx, update not applicable."
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (process2.platform === "darwin") {
|
|
57
|
+
try {
|
|
58
|
+
const brewPrefix = childProcess.execSync("brew --prefix gemini-cli", {
|
|
59
|
+
encoding: "utf8",
|
|
60
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
61
|
+
}).trim();
|
|
62
|
+
const brewRealPath = fs.realpathSync(brewPrefix);
|
|
63
|
+
if (realPath.startsWith(brewRealPath)) {
|
|
64
|
+
return {
|
|
65
|
+
packageManager: "homebrew" /* HOMEBREW */,
|
|
66
|
+
isGlobal: true,
|
|
67
|
+
updateMessage: 'Installed via Homebrew. Please update with "brew upgrade gemini-cli".'
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (realPath.includes("/.volta/") || realPath.includes("/Volta/")) {
|
|
74
|
+
const updateCommand2 = "volta install @google/gemini-cli@latest";
|
|
75
|
+
return {
|
|
76
|
+
packageManager: "volta" /* VOLTA */,
|
|
77
|
+
isGlobal: true,
|
|
78
|
+
updateCommand: updateCommand2,
|
|
79
|
+
updateMessage: isAutoUpdateEnabled ? "Installed with Volta. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (realPath.includes("/.pnpm/global") || realPath.includes("/.local/share/pnpm") || realPath.includes("/Library/pnpm/global/") || realPath.includes("/AppData/Local/pnpm/global/")) {
|
|
83
|
+
const updateCommand2 = "pnpm add -g @google/gemini-cli@latest";
|
|
84
|
+
return {
|
|
85
|
+
packageManager: "pnpm" /* PNPM */,
|
|
86
|
+
isGlobal: true,
|
|
87
|
+
updateCommand: updateCommand2,
|
|
88
|
+
updateMessage: isAutoUpdateEnabled ? "Installed with pnpm. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (realPath.includes("/.yarn/global")) {
|
|
92
|
+
const updateCommand2 = "yarn global add @google/gemini-cli@latest";
|
|
93
|
+
return {
|
|
94
|
+
packageManager: "yarn" /* YARN */,
|
|
95
|
+
isGlobal: true,
|
|
96
|
+
updateCommand: updateCommand2,
|
|
97
|
+
updateMessage: isAutoUpdateEnabled ? "Installed with yarn. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (realPath.includes("/.bun/install/cache")) {
|
|
101
|
+
return {
|
|
102
|
+
packageManager: "bunx" /* BUNX */,
|
|
103
|
+
isGlobal: false,
|
|
104
|
+
updateMessage: "Running via bunx, update not applicable."
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (realPath.includes("/.bun/install/global")) {
|
|
108
|
+
const updateCommand2 = "bun add -g @google/gemini-cli@latest";
|
|
109
|
+
return {
|
|
110
|
+
packageManager: "bun" /* BUN */,
|
|
111
|
+
isGlobal: true,
|
|
112
|
+
updateCommand: updateCommand2,
|
|
113
|
+
updateMessage: isAutoUpdateEnabled ? "Installed with bun. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
if (normalizedProjectRoot && realPath.startsWith(`${normalizedProjectRoot}/node_modules`)) {
|
|
117
|
+
let pm = "npm" /* NPM */;
|
|
118
|
+
if (fs.existsSync(path.join(projectRoot, "yarn.lock"))) {
|
|
119
|
+
pm = "yarn" /* YARN */;
|
|
120
|
+
} else if (fs.existsSync(path.join(projectRoot, "pnpm-lock.yaml"))) {
|
|
121
|
+
pm = "pnpm" /* PNPM */;
|
|
122
|
+
} else if (fs.existsSync(path.join(projectRoot, "bun.lockb"))) {
|
|
123
|
+
pm = "bun" /* BUN */;
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
packageManager: pm,
|
|
127
|
+
isGlobal: false,
|
|
128
|
+
updateMessage: "Locally installed. Please update via your project's package.json."
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const updateCommand = "npm install -g @google/gemini-cli@latest";
|
|
132
|
+
return {
|
|
133
|
+
packageManager: "npm" /* NPM */,
|
|
134
|
+
isGlobal: true,
|
|
135
|
+
updateCommand,
|
|
136
|
+
updateMessage: isAutoUpdateEnabled ? "Installed with npm. Attempting to automatically update now..." : `Please run ${updateCommand} to update`
|
|
137
|
+
};
|
|
138
|
+
} catch (error) {
|
|
139
|
+
debugLogger.log(error);
|
|
140
|
+
return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// packages/cli/src/utils/updateEventEmitter.ts
|
|
145
|
+
import { EventEmitter } from "node:events";
|
|
146
|
+
var updateEventEmitter = new EventEmitter();
|
|
147
|
+
|
|
148
|
+
// packages/cli/src/utils/spawnWrapper.ts
|
|
149
|
+
import { spawn } from "node:child_process";
|
|
150
|
+
var spawnWrapper = spawn;
|
|
151
|
+
|
|
152
|
+
// packages/cli/src/utils/handleAutoUpdate.ts
|
|
153
|
+
var _updateInProgress = false;
|
|
154
|
+
async function waitForUpdateCompletion(timeoutMs = 3e4) {
|
|
155
|
+
if (!_updateInProgress) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
debugLogger.log(
|
|
159
|
+
"\nGemini CLI is waiting for a background update to complete before restarting..."
|
|
160
|
+
);
|
|
161
|
+
return new Promise((resolve) => {
|
|
162
|
+
if (!_updateInProgress) {
|
|
163
|
+
resolve();
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const timer = setTimeout(cleanup, timeoutMs);
|
|
167
|
+
function cleanup() {
|
|
168
|
+
clearTimeout(timer);
|
|
169
|
+
updateEventEmitter.off("update-success", cleanup);
|
|
170
|
+
updateEventEmitter.off("update-failed", cleanup);
|
|
171
|
+
resolve();
|
|
172
|
+
}
|
|
173
|
+
updateEventEmitter.once("update-success", cleanup);
|
|
174
|
+
updateEventEmitter.once("update-failed", cleanup);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function handleAutoUpdate(info, settings, projectRoot, isSandboxEnabled, spawnFn = spawnWrapper) {
|
|
178
|
+
if (!info) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (isSandboxEnabled) {
|
|
182
|
+
updateEventEmitter.emit("update-info", {
|
|
183
|
+
message: `${info.message}
|
|
184
|
+
Automatic update is not available in sandbox mode.`
|
|
185
|
+
});
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (!settings.merged.general.enableAutoUpdateNotification) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const installationInfo = getInstallationInfo(
|
|
192
|
+
projectRoot,
|
|
193
|
+
settings.merged.general.enableAutoUpdate
|
|
194
|
+
);
|
|
195
|
+
if ([
|
|
196
|
+
"npx" /* NPX */,
|
|
197
|
+
"pnpx" /* PNPX */,
|
|
198
|
+
"bunx" /* BUNX */,
|
|
199
|
+
"binary" /* BINARY */
|
|
200
|
+
].includes(installationInfo.packageManager)) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
let combinedMessage = info.message;
|
|
204
|
+
if (installationInfo.updateMessage) {
|
|
205
|
+
combinedMessage += `
|
|
206
|
+
${installationInfo.updateMessage}`;
|
|
207
|
+
}
|
|
208
|
+
if (!installationInfo.updateCommand || !settings.merged.general.enableAutoUpdate) {
|
|
209
|
+
updateEventEmitter.emit("update-received", {
|
|
210
|
+
...info,
|
|
211
|
+
message: combinedMessage,
|
|
212
|
+
isUpdating: false
|
|
213
|
+
});
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
updateEventEmitter.emit("update-received", {
|
|
217
|
+
...info,
|
|
218
|
+
message: combinedMessage,
|
|
219
|
+
isUpdating: true
|
|
220
|
+
});
|
|
221
|
+
if (_updateInProgress) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const currentVersion = info.update.current;
|
|
225
|
+
if (!currentVersion) {
|
|
226
|
+
debugLogger.warn(
|
|
227
|
+
"Update check: current version is missing. Skipping automatic update for safety."
|
|
228
|
+
);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const currentChannel = getChannelFromVersion(currentVersion);
|
|
232
|
+
const targetChannel = getChannelFromVersion(info.update.latest);
|
|
233
|
+
if (RELEASE_CHANNEL_STABILITY[targetChannel] < RELEASE_CHANNEL_STABILITY[currentChannel]) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const isNightly = info.update.latest.includes("nightly");
|
|
237
|
+
const updateCommand = installationInfo.updateCommand.replace(
|
|
238
|
+
"@latest",
|
|
239
|
+
isNightly ? "@nightly" : `@${info.update.latest}`
|
|
240
|
+
);
|
|
241
|
+
const updateProcess = spawnFn(updateCommand, {
|
|
242
|
+
stdio: "ignore",
|
|
243
|
+
shell: true,
|
|
244
|
+
detached: true
|
|
245
|
+
});
|
|
246
|
+
_updateInProgress = true;
|
|
247
|
+
updateProcess.unref();
|
|
248
|
+
updateProcess.on("close", (code) => {
|
|
249
|
+
_updateInProgress = false;
|
|
250
|
+
if (code === 0) {
|
|
251
|
+
updateEventEmitter.emit("update-success", {
|
|
252
|
+
message: "Update successful! The new version will be used on your next run."
|
|
253
|
+
});
|
|
254
|
+
} else {
|
|
255
|
+
updateEventEmitter.emit("update-failed", {
|
|
256
|
+
message: `Automatic update failed. Please try updating manually:
|
|
257
|
+
|
|
258
|
+
${updateCommand}`
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
updateProcess.on("error", (err) => {
|
|
263
|
+
_updateInProgress = false;
|
|
264
|
+
updateEventEmitter.emit("update-failed", {
|
|
265
|
+
message: `Automatic update failed. Please try updating manually. (error: ${err.message})
|
|
266
|
+
|
|
267
|
+
${updateCommand}`
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
return updateProcess;
|
|
271
|
+
}
|
|
272
|
+
function setUpdateHandler(addItem, setUpdateInfo) {
|
|
273
|
+
let successfullyInstalled = false;
|
|
274
|
+
const handleUpdateReceived = (info) => {
|
|
275
|
+
setUpdateInfo(info);
|
|
276
|
+
const savedMessage = info.message;
|
|
277
|
+
setTimeout(() => {
|
|
278
|
+
if (!successfullyInstalled) {
|
|
279
|
+
addItem(
|
|
280
|
+
{
|
|
281
|
+
type: "info" /* INFO */,
|
|
282
|
+
text: savedMessage
|
|
283
|
+
},
|
|
284
|
+
Date.now()
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
setUpdateInfo(null);
|
|
288
|
+
}, 6e4);
|
|
289
|
+
};
|
|
290
|
+
const handleUpdateFailed = (data) => {
|
|
291
|
+
setUpdateInfo(null);
|
|
292
|
+
addItem(
|
|
293
|
+
{
|
|
294
|
+
type: "error" /* ERROR */,
|
|
295
|
+
text: data?.message || `Automatic update failed. Please try updating manually`
|
|
296
|
+
},
|
|
297
|
+
Date.now()
|
|
298
|
+
);
|
|
299
|
+
};
|
|
300
|
+
const handleUpdateSuccess = () => {
|
|
301
|
+
successfullyInstalled = true;
|
|
302
|
+
setUpdateInfo(null);
|
|
303
|
+
addItem(
|
|
304
|
+
{
|
|
305
|
+
type: "info" /* INFO */,
|
|
306
|
+
text: `Update successful! The new version will be used on your next run.`
|
|
307
|
+
},
|
|
308
|
+
Date.now()
|
|
309
|
+
);
|
|
310
|
+
};
|
|
311
|
+
const handleUpdateInfo = (data) => {
|
|
312
|
+
addItem(
|
|
313
|
+
{
|
|
314
|
+
type: "info" /* INFO */,
|
|
315
|
+
text: data.message
|
|
316
|
+
},
|
|
317
|
+
Date.now()
|
|
318
|
+
);
|
|
319
|
+
};
|
|
320
|
+
updateEventEmitter.on("update-received", handleUpdateReceived);
|
|
321
|
+
updateEventEmitter.on("update-failed", handleUpdateFailed);
|
|
322
|
+
updateEventEmitter.on("update-success", handleUpdateSuccess);
|
|
323
|
+
updateEventEmitter.on("update-info", handleUpdateInfo);
|
|
324
|
+
return () => {
|
|
325
|
+
updateEventEmitter.off("update-received", handleUpdateReceived);
|
|
326
|
+
updateEventEmitter.off("update-failed", handleUpdateFailed);
|
|
327
|
+
updateEventEmitter.off("update-success", handleUpdateSuccess);
|
|
328
|
+
updateEventEmitter.off("update-info", handleUpdateInfo);
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// packages/cli/src/utils/processUtils.ts
|
|
333
|
+
var RELAUNCH_EXIT_CODE = 199;
|
|
334
|
+
var isRelaunching = false;
|
|
335
|
+
async function relaunchApp(options) {
|
|
336
|
+
if (isRelaunching) return;
|
|
337
|
+
isRelaunching = true;
|
|
338
|
+
await waitForUpdateCompletion();
|
|
339
|
+
if (process.send && !process.env["VITEST"] && options?.overrideAuthType) {
|
|
340
|
+
await new Promise((resolve) => {
|
|
341
|
+
let resolved = false;
|
|
342
|
+
const done = () => {
|
|
343
|
+
if (!resolved) {
|
|
344
|
+
resolved = true;
|
|
345
|
+
resolve();
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
const timeout = setTimeout(done, 500);
|
|
349
|
+
try {
|
|
350
|
+
process.send(
|
|
351
|
+
{
|
|
352
|
+
type: "auth-selected-type",
|
|
353
|
+
authType: options.overrideAuthType
|
|
354
|
+
},
|
|
355
|
+
() => {
|
|
356
|
+
clearTimeout(timeout);
|
|
357
|
+
done();
|
|
358
|
+
}
|
|
359
|
+
);
|
|
360
|
+
} catch {
|
|
361
|
+
clearTimeout(timeout);
|
|
362
|
+
done();
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
await runExitCleanup();
|
|
367
|
+
process.exit(RELAUNCH_EXIT_CODE);
|
|
368
|
+
}
|
|
369
|
+
function isStandardSea() {
|
|
370
|
+
return process.argv[0] !== process.argv[1] && (process.env["IS_BINARY"] === "true" || process.isSea?.() === true);
|
|
371
|
+
}
|
|
372
|
+
function getScriptArgs() {
|
|
373
|
+
return process.argv.slice(isStandardSea() ? 1 : 2);
|
|
374
|
+
}
|
|
375
|
+
function isSeaEnvironment() {
|
|
376
|
+
return process.env["IS_BINARY"] === "true" || process.isSea?.() === true || process.argv[0] === process.argv[1];
|
|
377
|
+
}
|
|
378
|
+
function getSpawnConfig(nodeArgs, scriptArgs) {
|
|
379
|
+
const isBinary = isSeaEnvironment();
|
|
380
|
+
const newEnv = {
|
|
381
|
+
...process.env,
|
|
382
|
+
GEMINI_CLI_NO_RELAUNCH: "true"
|
|
383
|
+
};
|
|
384
|
+
const finalSpawnArgs = [];
|
|
385
|
+
if (isBinary) {
|
|
386
|
+
if (nodeArgs.length > 0) {
|
|
387
|
+
for (const arg of nodeArgs) {
|
|
388
|
+
if (/[\s"'\\]/.test(arg)) {
|
|
389
|
+
throw new Error(
|
|
390
|
+
`Unsupported node argument for SEA relaunch: ${arg}. Complex escaping is not supported.`
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
const existingNodeOptions = process.env["NODE_OPTIONS"] || "";
|
|
395
|
+
newEnv["NODE_OPTIONS"] = `${existingNodeOptions} ${nodeArgs.join(" ")}`.trim();
|
|
396
|
+
}
|
|
397
|
+
finalSpawnArgs.push(process.execPath, ...scriptArgs);
|
|
398
|
+
} else {
|
|
399
|
+
finalSpawnArgs.push(
|
|
400
|
+
...process.execArgv,
|
|
401
|
+
...nodeArgs,
|
|
402
|
+
process.argv[1],
|
|
403
|
+
...scriptArgs
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
return {
|
|
407
|
+
spawnArgs: finalSpawnArgs,
|
|
408
|
+
env: newEnv
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export {
|
|
413
|
+
isDevelopment,
|
|
414
|
+
handleAutoUpdate,
|
|
415
|
+
setUpdateHandler,
|
|
416
|
+
RELAUNCH_EXIT_CODE,
|
|
417
|
+
relaunchApp,
|
|
418
|
+
getScriptArgs,
|
|
419
|
+
getSpawnConfig
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* @license
|
|
423
|
+
* Copyright 2025 Google LLC
|
|
424
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
425
|
+
*/
|
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
exitCli,
|
|
4
4
|
require_source
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PAWJR2VY.js";
|
|
6
6
|
import {
|
|
7
7
|
AppEvent,
|
|
8
8
|
appEvents
|
|
@@ -63,15 +63,15 @@ import {
|
|
|
63
63
|
stripUnsafeCharacters,
|
|
64
64
|
toCodePoints,
|
|
65
65
|
validateCustomTheme
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-DGM2IXGQ.js";
|
|
67
67
|
import {
|
|
68
68
|
isDevelopment
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-FQCPUDNE.js";
|
|
70
70
|
import {
|
|
71
71
|
emptyIcon,
|
|
72
72
|
mapCoreStatusToDisplayStatus,
|
|
73
73
|
require_react
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-KVZWFEJY.js";
|
|
75
75
|
import {
|
|
76
76
|
ALL_EDITORS,
|
|
77
77
|
ApprovalMode,
|
|
@@ -238,7 +238,7 @@ import {
|
|
|
238
238
|
tokenLimit,
|
|
239
239
|
uiTelemetryService,
|
|
240
240
|
unescapePath
|
|
241
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-JMQIN5UZ.js";
|
|
242
242
|
import {
|
|
243
243
|
require_src
|
|
244
244
|
} from "./chunk-L6PII3GR.js";
|
|
@@ -66818,7 +66818,7 @@ function unescapeLiteralAt(text) {
|
|
|
66818
66818
|
return backslashCount % 2 === 0 ? "@" : "\\@";
|
|
66819
66819
|
});
|
|
66820
66820
|
}
|
|
66821
|
-
var AT_COMMAND_PATH_REGEX_SOURCE = '(?:(?:"
|
|
66821
|
+
var AT_COMMAND_PATH_REGEX_SOURCE = '(?:(?:"[^"\\n\\r]*")|(?:\\\\.|[^ \\t\\n\\r,;!?()\\[\\]{}."\'`]|\\.(?!$|[ \\t\\n\\r]))+)';
|
|
66822
66822
|
function parseAllAtCommands(query, escapePastedAtSymbols = false) {
|
|
66823
66823
|
const parts = [];
|
|
66824
66824
|
let lastIndex = 0;
|
|
@@ -66948,7 +66948,9 @@ async function resolveFilePaths(fileParts, config, onDebugMessage, signal) {
|
|
|
66948
66948
|
);
|
|
66949
66949
|
}
|
|
66950
66950
|
} else if (result.status === "not_found" || result.status === "unauthorized") {
|
|
66951
|
-
|
|
66951
|
+
const MAX_GLOB_SEARCH_PATH_LENGTH = 255;
|
|
66952
|
+
const isPathSuitableForGlob = pathName.length > 0 && pathName.length <= MAX_GLOB_SEARCH_PATH_LENGTH && !path12.isAbsolute(pathName) && !pathName.includes("..") && !/[\r\n\t\0{}*?[\]]/.test(pathName);
|
|
66953
|
+
if (config.getEnableRecursiveFileSearch() && globTool && isPathSuitableForGlob) {
|
|
66952
66954
|
onDebugMessage(
|
|
66953
66955
|
`Path ${pathName} not found directly, attempting glob search.`
|
|
66954
66956
|
);
|
|
@@ -77581,7 +77583,7 @@ var authCommand = {
|
|
|
77581
77583
|
import process29 from "node:process";
|
|
77582
77584
|
|
|
77583
77585
|
// packages/cli/src/generated/git-commit.ts
|
|
77584
|
-
var GIT_COMMIT_INFO = "
|
|
77586
|
+
var GIT_COMMIT_INFO = "c6bccb7ec";
|
|
77585
77587
|
|
|
77586
77588
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
77587
77589
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -83362,7 +83364,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
83362
83364
|
type: "info",
|
|
83363
83365
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
83364
83366
|
});
|
|
83365
|
-
const { MCPOAuthProvider } = await import("./core-
|
|
83367
|
+
const { MCPOAuthProvider } = await import("./core-VXMTLS6K.js");
|
|
83366
83368
|
let oauthConfig = server.oauth;
|
|
83367
83369
|
if (!oauthConfig) {
|
|
83368
83370
|
oauthConfig = { enabled: false };
|