@google/gemini-cli 0.56.0 → 0.57.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.
- package/bundle/builtin/antigravity-support/SKILL.md +55 -18
- package/bundle/builtin/skill-creator/SKILL.md +221 -84
- package/bundle/{chunk-3KYPKZPU.js → chunk-3BVBON3V.js} +1 -1
- package/bundle/{chunk-DGFXNTHD.js → chunk-3NPMAHLX.js} +1 -1
- package/bundle/{chunk-IG5K7R25.js → chunk-4ALCU2HQ.js} +1 -1
- package/bundle/{chunk-ISEPPPFO.js → chunk-4SNEOO5E.js} +2 -2
- package/bundle/{chunk-CNSLGANE.js → chunk-65C235NM.js} +10 -9
- package/bundle/{chunk-R34LMPUE.js → chunk-AKCYXG7C.js} +10 -9
- package/bundle/{chunk-C5FHWCAU.js → chunk-ALVDOQNA.js} +1 -1
- package/bundle/{chunk-3YGHKCB7.js → chunk-EAK33LFP.js} +1 -1
- package/bundle/{chunk-7IXYIWSX.js → chunk-FHDRG5U4.js} +70 -56
- package/bundle/{chunk-LZUWGCRJ.js → chunk-G65GW52B.js} +1708 -1352
- package/bundle/{chunk-KUIZDCN6.js → chunk-GK7NUJ35.js} +8 -5
- package/bundle/{chunk-VBIDFL63.js → chunk-GMQ6QNZB.js} +1 -1
- package/bundle/chunk-LNXGFWGZ.js +17332 -0
- package/bundle/{chunk-TV27OEQP.js → chunk-MBWROXYM.js} +2 -2
- package/bundle/{chunk-M6D6BI7B.js → chunk-NMMXRZ53.js} +2 -2
- package/bundle/{chunk-NUVMJEWM.js → chunk-NPOI4K6X.js} +9291 -15583
- package/bundle/{chunk-435NYDJB.js → chunk-NQ4RH42O.js} +9 -8
- package/bundle/{chunk-MYCBWRZE.js → chunk-O7SBKM7M.js} +1770 -1378
- package/bundle/{chunk-HAZMOWRC.js → chunk-Q73BPF7A.js} +1 -1
- package/bundle/{chunk-Y3KSGWY2.js → chunk-QJP6CMLN.js} +3 -3
- package/bundle/{chunk-BIPFNROE.js → chunk-RLDNUS35.js} +1 -1
- package/bundle/{chunk-ZXYNNAXR.js → chunk-S5UX3QS5.js} +3 -3
- package/bundle/{chunk-Y734TK7O.js → chunk-SCBVGZXH.js} +1 -1
- package/bundle/chunk-SWQAIZEQ.js +102506 -0
- package/bundle/{chunk-MKKOABMJ.js → chunk-UMQE7UC6.js} +3 -3
- package/bundle/{chunk-JFVPVDW6.js → chunk-VBK54QCZ.js} +1 -1
- package/bundle/chunk-VGGWKRAC.js +154 -0
- package/bundle/chunk-W23OOD2C.js +118 -0
- package/bundle/chunk-WDFSF5L4.js +397601 -0
- package/bundle/chunk-XESAM7IL.js +512 -0
- package/bundle/chunk-Y3APL4PE.js +1571 -0
- package/bundle/chunk-ZMPGHLGO.js +398 -0
- package/bundle/{cleanup-IZHI7N6V.js → cleanup-2W5DPMY3.js} +2 -2
- package/bundle/{cleanup-JZLQPF2L.js → cleanup-OTHE7RNU.js} +2 -2
- package/bundle/{cleanup-LJAAR5DT.js → cleanup-SM67K64R.js} +2 -2
- package/bundle/cleanup-XAUT5CMD.js +32 -0
- package/bundle/{core-TJ2XBV6Y.js → core-US34OW5M.js} +9 -1
- package/bundle/{devtoolsService-KFURCXJN.js → devtoolsService-5J53UK6Z.js} +2 -2
- package/bundle/{devtoolsService-BFW3BN3D.js → devtoolsService-GU2GQSOF.js} +2 -2
- package/bundle/{devtoolsService-NWA77XKC.js → devtoolsService-JBFUXTCT.js} +4 -3
- package/bundle/devtoolsService-V46GUHRF.js +4359 -0
- package/bundle/{dist-7KO3HJ4C.js → dist-5TYMQVIZ.js} +9 -1
- package/bundle/{core-BQJQAXVF.js → dist-OWKHVWTR.js} +9 -1
- package/bundle/dist-V5VJYW6J.js +2180 -0
- package/bundle/docs/changelogs/latest.md +224 -3
- package/bundle/docs/get-started/authentication.mdx +1 -1
- package/bundle/docs/reference/commands.md +7 -5
- package/bundle/{gemini-54R2PJOR.js → gemini-3M22N2C3.js} +19 -16
- package/bundle/{gemini-KK7AERSF.js → gemini-LSMTDETS.js} +19 -16
- package/bundle/{gemini-2RHAL2LS.js → gemini-OZOYJF22.js} +219 -200
- package/bundle/gemini-W2B6CLJC.js +17091 -0
- package/bundle/gemini.js +7 -7
- package/bundle/{interactiveCli-QBZRIN4M.js → interactiveCli-D6H37PJQ.js} +60 -30
- package/bundle/{interactiveCli-BAGEJ4VO.js → interactiveCli-L3ZXOVEV.js} +367 -318
- package/bundle/{interactiveCli-F5YXG24U.js → interactiveCli-LQJM6LRE.js} +60 -30
- package/bundle/interactiveCli-RGOYDSMH.js +34984 -0
- package/bundle/{liteRtServerManager-CYBHL4LH.js → liteRtServerManager-3BY6TBHG.js} +4 -4
- package/bundle/{liteRtServerManager-DMTHAOJH.js → liteRtServerManager-C5WZRQUF.js} +4 -4
- package/bundle/{liteRtServerManager-7LTDMYKI.js → liteRtServerManager-IGKUGGP4.js} +4 -4
- package/bundle/liteRtServerManager-IJ4I2PZA.js +65 -0
- package/bundle/{oauth2-provider-NOSS4GIR.js → oauth2-provider-KSRLPOK3.js} +1 -1
- package/bundle/{oauth2-provider-S2564L6K.js → oauth2-provider-RWKTMYJF.js} +1 -1
- package/bundle/{oauth2-provider-HNMIIJDH.js → oauth2-provider-VHNLCU4Y.js} +38 -72
- package/bundle/oauth2-provider-ZT4OFVMK.js +235 -0
- package/bundle/{start-L2WLGVI3.js → start-EXAQFM4Y.js} +6 -6
- package/bundle/{start-UGLCJG5Y.js → start-IPZF32E3.js} +6 -6
- package/bundle/{start-5F3JQ7EX.js → start-SVNTSNHV.js} +6 -6
- package/bundle/start-ZXU5BFZY.js +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,398 @@
|
|
|
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-VGGWKRAC.js";
|
|
5
|
+
import {
|
|
6
|
+
RELEASE_CHANNEL_STABILITY,
|
|
7
|
+
debugLogger,
|
|
8
|
+
getChannelFromVersion,
|
|
9
|
+
isGitRepository
|
|
10
|
+
} from "./chunk-NPOI4K6X.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() {
|
|
336
|
+
if (isRelaunching) return;
|
|
337
|
+
isRelaunching = true;
|
|
338
|
+
await waitForUpdateCompletion();
|
|
339
|
+
await runExitCleanup();
|
|
340
|
+
process.exit(RELAUNCH_EXIT_CODE);
|
|
341
|
+
}
|
|
342
|
+
function isStandardSea() {
|
|
343
|
+
return process.argv[0] !== process.argv[1] && (process.env["IS_BINARY"] === "true" || process.isSea?.() === true);
|
|
344
|
+
}
|
|
345
|
+
function getScriptArgs() {
|
|
346
|
+
return process.argv.slice(isStandardSea() ? 1 : 2);
|
|
347
|
+
}
|
|
348
|
+
function isSeaEnvironment() {
|
|
349
|
+
return process.env["IS_BINARY"] === "true" || process.isSea?.() === true || process.argv[0] === process.argv[1];
|
|
350
|
+
}
|
|
351
|
+
function getSpawnConfig(nodeArgs, scriptArgs) {
|
|
352
|
+
const isBinary = isSeaEnvironment();
|
|
353
|
+
const newEnv = {
|
|
354
|
+
...process.env,
|
|
355
|
+
GEMINI_CLI_NO_RELAUNCH: "true"
|
|
356
|
+
};
|
|
357
|
+
const finalSpawnArgs = [];
|
|
358
|
+
if (isBinary) {
|
|
359
|
+
if (nodeArgs.length > 0) {
|
|
360
|
+
for (const arg of nodeArgs) {
|
|
361
|
+
if (/[\s"'\\]/.test(arg)) {
|
|
362
|
+
throw new Error(
|
|
363
|
+
`Unsupported node argument for SEA relaunch: ${arg}. Complex escaping is not supported.`
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const existingNodeOptions = process.env["NODE_OPTIONS"] || "";
|
|
368
|
+
newEnv["NODE_OPTIONS"] = `${existingNodeOptions} ${nodeArgs.join(" ")}`.trim();
|
|
369
|
+
}
|
|
370
|
+
finalSpawnArgs.push(process.execPath, ...scriptArgs);
|
|
371
|
+
} else {
|
|
372
|
+
finalSpawnArgs.push(
|
|
373
|
+
...process.execArgv,
|
|
374
|
+
...nodeArgs,
|
|
375
|
+
process.argv[1],
|
|
376
|
+
...scriptArgs
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
return {
|
|
380
|
+
spawnArgs: finalSpawnArgs,
|
|
381
|
+
env: newEnv
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export {
|
|
386
|
+
isDevelopment,
|
|
387
|
+
handleAutoUpdate,
|
|
388
|
+
setUpdateHandler,
|
|
389
|
+
RELAUNCH_EXIT_CODE,
|
|
390
|
+
relaunchApp,
|
|
391
|
+
getScriptArgs,
|
|
392
|
+
getSpawnConfig
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* @license
|
|
396
|
+
* Copyright 2025 Google LLC
|
|
397
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
398
|
+
*/
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
runSyncCleanup,
|
|
12
12
|
setupSignalHandlers,
|
|
13
13
|
setupTtyCheck
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-Q73BPF7A.js";
|
|
15
|
+
import "./chunk-O7SBKM7M.js";
|
|
16
16
|
import "./chunk-664ZODQF.js";
|
|
17
17
|
import "./chunk-IUUIT4SU.js";
|
|
18
18
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
runSyncCleanup,
|
|
12
12
|
setupSignalHandlers,
|
|
13
13
|
setupTtyCheck
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-3NPMAHLX.js";
|
|
15
|
+
import "./chunk-G65GW52B.js";
|
|
16
16
|
import "./chunk-664ZODQF.js";
|
|
17
17
|
import "./chunk-IUUIT4SU.js";
|
|
18
18
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
runSyncCleanup,
|
|
12
12
|
setupSignalHandlers,
|
|
13
13
|
setupTtyCheck
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-VGGWKRAC.js";
|
|
15
|
+
import "./chunk-NPOI4K6X.js";
|
|
16
16
|
import "./chunk-664ZODQF.js";
|
|
17
17
|
import "./chunk-IUUIT4SU.js";
|
|
18
18
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
cleanupCheckpoints,
|
|
4
|
+
registerCleanup,
|
|
5
|
+
registerSyncCleanup,
|
|
6
|
+
registerTelemetryConfig,
|
|
7
|
+
removeCleanup,
|
|
8
|
+
removeSyncCleanup,
|
|
9
|
+
resetCleanupForTesting,
|
|
10
|
+
runExitCleanup,
|
|
11
|
+
runSyncCleanup,
|
|
12
|
+
setupSignalHandlers,
|
|
13
|
+
setupTtyCheck
|
|
14
|
+
} from "./chunk-EAK33LFP.js";
|
|
15
|
+
import "./chunk-WDFSF5L4.js";
|
|
16
|
+
import "./chunk-664ZODQF.js";
|
|
17
|
+
import "./chunk-IUUIT4SU.js";
|
|
18
|
+
import "./chunk-TUDYL3X4.js";
|
|
19
|
+
import "./chunk-34MYV7JD.js";
|
|
20
|
+
export {
|
|
21
|
+
cleanupCheckpoints,
|
|
22
|
+
registerCleanup,
|
|
23
|
+
registerSyncCleanup,
|
|
24
|
+
registerTelemetryConfig,
|
|
25
|
+
removeCleanup,
|
|
26
|
+
removeSyncCleanup,
|
|
27
|
+
resetCleanupForTesting,
|
|
28
|
+
runExitCleanup,
|
|
29
|
+
runSyncCleanup,
|
|
30
|
+
setupSignalHandlers,
|
|
31
|
+
setupTtyCheck
|
|
32
|
+
};
|
|
@@ -337,6 +337,7 @@ import {
|
|
|
337
337
|
ModelRouterService,
|
|
338
338
|
ModelSlashCommandEvent,
|
|
339
339
|
NO_EDITOR_AVAILABLE_ERROR,
|
|
340
|
+
NO_RESPONSE_TEXT_NUDGE_MESSAGE,
|
|
340
341
|
NetworkRetryAttemptEvent,
|
|
341
342
|
NodeType,
|
|
342
343
|
NoopSandboxManager,
|
|
@@ -452,6 +453,7 @@ import {
|
|
|
452
453
|
SubagentState,
|
|
453
454
|
TASK_TYPE_LABELS,
|
|
454
455
|
THINKING_ONLY_COMPRESS_SUGGESTION,
|
|
456
|
+
THINKING_ONLY_NUDGE_MESSAGE,
|
|
455
457
|
TODOS_ITEM_PARAM_DESCRIPTION,
|
|
456
458
|
TODOS_ITEM_PARAM_STATUS,
|
|
457
459
|
TODOS_PARAM_TODOS,
|
|
@@ -539,6 +541,7 @@ import {
|
|
|
539
541
|
applyInboxPatch,
|
|
540
542
|
applyReplacement,
|
|
541
543
|
applyRequiredServers,
|
|
544
|
+
applyRetryNudge,
|
|
542
545
|
assertValidPathString,
|
|
543
546
|
assumeExhaustive,
|
|
544
547
|
authEvents,
|
|
@@ -746,6 +749,7 @@ import {
|
|
|
746
749
|
getResponseText,
|
|
747
750
|
getResponseTextFromParts,
|
|
748
751
|
getRetryErrorType,
|
|
752
|
+
getSafeGitEnv,
|
|
749
753
|
getSecretFileFindArgs,
|
|
750
754
|
getShellConfiguration,
|
|
751
755
|
getSpecificMimeType,
|
|
@@ -1079,7 +1083,7 @@ import {
|
|
|
1079
1083
|
wrapUntrusted,
|
|
1080
1084
|
writeToStderr,
|
|
1081
1085
|
writeToStdout
|
|
1082
|
-
} from "./chunk-
|
|
1086
|
+
} from "./chunk-O7SBKM7M.js";
|
|
1083
1087
|
import "./chunk-664ZODQF.js";
|
|
1084
1088
|
import {
|
|
1085
1089
|
SpanStatusCode,
|
|
@@ -1425,6 +1429,7 @@ export {
|
|
|
1425
1429
|
ModelRouterService,
|
|
1426
1430
|
ModelSlashCommandEvent,
|
|
1427
1431
|
NO_EDITOR_AVAILABLE_ERROR,
|
|
1432
|
+
NO_RESPONSE_TEXT_NUDGE_MESSAGE,
|
|
1428
1433
|
NetworkRetryAttemptEvent,
|
|
1429
1434
|
NodeType,
|
|
1430
1435
|
NoopSandboxManager,
|
|
@@ -1541,6 +1546,7 @@ export {
|
|
|
1541
1546
|
SubagentState,
|
|
1542
1547
|
TASK_TYPE_LABELS,
|
|
1543
1548
|
THINKING_ONLY_COMPRESS_SUGGESTION,
|
|
1549
|
+
THINKING_ONLY_NUDGE_MESSAGE,
|
|
1544
1550
|
TODOS_ITEM_PARAM_DESCRIPTION,
|
|
1545
1551
|
TODOS_ITEM_PARAM_STATUS,
|
|
1546
1552
|
TODOS_PARAM_TODOS,
|
|
@@ -1629,6 +1635,7 @@ export {
|
|
|
1629
1635
|
applyInboxPatch,
|
|
1630
1636
|
applyReplacement,
|
|
1631
1637
|
applyRequiredServers,
|
|
1638
|
+
applyRetryNudge,
|
|
1632
1639
|
assertValidPathString,
|
|
1633
1640
|
assumeExhaustive,
|
|
1634
1641
|
authEvents,
|
|
@@ -1835,6 +1842,7 @@ export {
|
|
|
1835
1842
|
getResponseText,
|
|
1836
1843
|
getResponseTextFromParts,
|
|
1837
1844
|
getRetryErrorType,
|
|
1845
|
+
getSafeGitEnv,
|
|
1838
1846
|
getSecretFileFindArgs,
|
|
1839
1847
|
getShellConfiguration,
|
|
1840
1848
|
getSpecificMimeType,
|
|
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
|
|
|
2
2
|
import {
|
|
3
3
|
coreEvents,
|
|
4
4
|
debugLogger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-O7SBKM7M.js";
|
|
6
6
|
import "./chunk-664ZODQF.js";
|
|
7
7
|
import "./chunk-IUUIT4SU.js";
|
|
8
8
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -4324,7 +4324,7 @@ async function toggleDevToolsPanel(config, isOpen, toggle, setOpen) {
|
|
|
4324
4324
|
return;
|
|
4325
4325
|
}
|
|
4326
4326
|
try {
|
|
4327
|
-
const { openBrowserSecurely, shouldLaunchBrowser } = await import("./core-
|
|
4327
|
+
const { openBrowserSecurely, shouldLaunchBrowser } = await import("./core-US34OW5M.js");
|
|
4328
4328
|
const url = await startDevToolsServer(config);
|
|
4329
4329
|
if (shouldLaunchBrowser()) {
|
|
4330
4330
|
try {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
CoreEvent,
|
|
4
4
|
coreEvents,
|
|
5
5
|
debugLogger
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WDFSF5L4.js";
|
|
7
7
|
import "./chunk-664ZODQF.js";
|
|
8
8
|
import "./chunk-IUUIT4SU.js";
|
|
9
9
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -4325,7 +4325,7 @@ async function toggleDevToolsPanel(config, isOpen, toggle, setOpen) {
|
|
|
4325
4325
|
return;
|
|
4326
4326
|
}
|
|
4327
4327
|
try {
|
|
4328
|
-
const { openBrowserSecurely, shouldLaunchBrowser } = await import("./dist-
|
|
4328
|
+
const { openBrowserSecurely, shouldLaunchBrowser } = await import("./dist-5TYMQVIZ.js");
|
|
4329
4329
|
const url = await startDevToolsServer(config);
|
|
4330
4330
|
if (shouldLaunchBrowser()) {
|
|
4331
4331
|
try {
|
|
@@ -1,8 +1,9 @@
|
|
|
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
|
+
CoreEvent,
|
|
3
4
|
coreEvents,
|
|
4
5
|
debugLogger
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-G65GW52B.js";
|
|
6
7
|
import "./chunk-664ZODQF.js";
|
|
7
8
|
import "./chunk-IUUIT4SU.js";
|
|
8
9
|
import "./chunk-TUDYL3X4.js";
|
|
@@ -4173,7 +4174,7 @@ var bridgeAttached = false;
|
|
|
4173
4174
|
function bridgeCoreEvents(capture) {
|
|
4174
4175
|
if (bridgeAttached) return;
|
|
4175
4176
|
bridgeAttached = true;
|
|
4176
|
-
coreEvents.on(
|
|
4177
|
+
coreEvents.on(CoreEvent.ConsoleLog, (payload) => {
|
|
4177
4178
|
capture.logConsole(payload);
|
|
4178
4179
|
});
|
|
4179
4180
|
}
|
|
@@ -4324,7 +4325,7 @@ async function toggleDevToolsPanel(config, isOpen, toggle, setOpen) {
|
|
|
4324
4325
|
return;
|
|
4325
4326
|
}
|
|
4326
4327
|
try {
|
|
4327
|
-
const { openBrowserSecurely, shouldLaunchBrowser } = await import("./
|
|
4328
|
+
const { openBrowserSecurely, shouldLaunchBrowser } = await import("./dist-V5VJYW6J.js");
|
|
4328
4329
|
const url = await startDevToolsServer(config);
|
|
4329
4330
|
if (shouldLaunchBrowser()) {
|
|
4330
4331
|
try {
|