@google/gemini-cli 0.41.0-preview.2 → 0.41.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.
- package/bundle/{chunk-LBPROGQS.js → chunk-4CB5QYON.js} +1 -1
- package/bundle/{chunk-4GYMEM7F.js → chunk-5ECQHX5C.js} +2 -2
- package/bundle/{chunk-ODPEYGXR.js → chunk-5ZVQP4WN.js} +1 -1
- package/bundle/{chunk-FQGCL5I2.js → chunk-7LNZOOC7.js} +6 -6
- package/bundle/{chunk-ANBD6P4M.js → chunk-B2LNN6KY.js} +4 -4
- package/bundle/{chunk-BDZNOCWJ.js → chunk-CSDNDSTO.js} +4 -4
- package/bundle/{chunk-BYSXGJG3.js → chunk-CWJ5KY34.js} +1 -1
- package/bundle/{chunk-OR5JBPQX.js → chunk-CZW4D4RQ.js} +1 -1
- package/bundle/{chunk-ZHHJJC4N.js → chunk-F6MNV4SZ.js} +6 -6
- package/bundle/{chunk-2YV27CKR.js → chunk-G2G5UOIR.js} +2 -2
- package/bundle/{chunk-L35AXZHM.js → chunk-GLO32GZ3.js} +12456 -6676
- package/bundle/{chunk-2E4E2OEF.js → chunk-J7E7PI4S.js} +2 -2
- package/bundle/{chunk-V2QQW5SA.js → chunk-KHDD5ZQT.js} +1 -1
- package/bundle/{chunk-7CD6GCRT.js → chunk-KMY2ICHB.js} +1 -1
- package/bundle/{chunk-3GHJ5HPF.js → chunk-KYES7RJ6.js} +54 -67
- package/bundle/{chunk-RYFTYJ75.js → chunk-RVECIZP6.js} +1 -1
- package/bundle/{chunk-HOQYVHXU.js → chunk-TOU7GDCS.js} +3 -3
- package/bundle/{chunk-S4SLTOZU.js → chunk-V7GQYOIO.js} +12 -14
- package/bundle/{cleanup-HRWHMMWM.js → cleanup-KMEBTV6K.js} +2 -2
- package/bundle/{cleanup-2BMR4MMJ.js → cleanup-OJM7LXCH.js} +2 -2
- package/bundle/{cleanup-FHOD65Y6.js → cleanup-PMJYRELA.js} +3 -3
- package/bundle/{core-TKDA7N4G.js → core-4PBU56P6.js} +1 -1
- package/bundle/{dist-PGH3GHGN.js → core-MMHOAGLI.js} +2 -2
- package/bundle/{devtoolsService-V2NU6TJG.js → devtoolsService-ARI22QWG.js} +2 -2
- package/bundle/{devtoolsService-7LCCYOTU.js → devtoolsService-BDOWEGHR.js} +4 -5
- package/bundle/{devtoolsService-6EOO2BQ7.js → devtoolsService-YPN2GRY7.js} +2 -2
- package/bundle/{dist-KFV2ASJV.js → dist-V6XXY2AS.js} +1 -1
- package/bundle/{gemini-YG4MES4L.js → gemini-GSCVWK7Y.js} +175 -191
- package/bundle/{gemini-FLUMXCL4.js → gemini-LDARUG77.js} +12 -12
- package/bundle/{gemini-GNABGJLN.js → gemini-RGSMPB6F.js} +12 -12
- package/bundle/gemini.js +3 -3
- package/bundle/{interactiveCli-JNHY7R4J.js → interactiveCli-5JCJD3F5.js} +7 -7
- package/bundle/{interactiveCli-VP7SGM2Z.js → interactiveCli-KSSJ4M5C.js} +7 -7
- package/bundle/{interactiveCli-ZWNNSDPF.js → interactiveCli-ZNAMZNEE.js} +273 -291
- package/bundle/{liteRtServerManager-D3KQXYD2.js → liteRtServerManager-I6PXKOCJ.js} +3 -3
- package/bundle/{liteRtServerManager-OYB4D65F.js → liteRtServerManager-PG57YSDR.js} +3 -3
- package/bundle/{liteRtServerManager-4OYQKJDU.js → liteRtServerManager-QZCLWSIV.js} +4 -4
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-BT67SZ33.js → oauth2-provider-356MTA5N.js} +1 -1
- package/bundle/{oauth2-provider-LDPCE34C.js → oauth2-provider-MV6Q65XJ.js} +1 -1
- package/bundle/{oauth2-provider-KNDXPBH3.js → oauth2-provider-SWABWSBH.js} +73 -39
- package/bundle/{start-3OOWLPJZ.js → start-FWXRAXKY.js} +5 -5
- package/bundle/{start-U3FP4KVT.js → start-MWJKRZPA.js} +6 -6
- package/bundle/{start-6T3XMMID.js → start-S2GPZKGW.js} +5 -5
- package/package.json +1 -1
- package/bundle/chunk-3Q7BP33C.js +0 -80034
- package/bundle/chunk-6P6WKPYI.js +0 -156
- package/bundle/chunk-FZXNSS2J.js +0 -118
- package/bundle/chunk-SR4PMLVP.js +0 -354496
- package/bundle/chunk-VHJM22NK.js +0 -1571
- package/bundle/chunk-XBNSSOYA.js +0 -17656
- package/bundle/cleanup-TCNEYDWT.js +0 -33
- package/bundle/devtoolsService-EFVBXKEX.js +0 -857
- package/bundle/dist-VXU5NT6O.js +0 -2068
- package/bundle/gemini-V7YPSW3T.js +0 -15988
- package/bundle/interactiveCli-MD3WNLOS.js +0 -35052
- package/bundle/liteRtServerManager-ONE7YJHO.js +0 -65
- package/bundle/oauth2-provider-RGOB2KSE.js +0 -237
- package/bundle/start-LNWEO65C.js +0 -18
package/bundle/chunk-6P6WKPYI.js
DELETED
|
@@ -1,156 +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
|
-
isTelemetrySdkInitialized,
|
|
5
|
-
resetBrowserSession,
|
|
6
|
-
shutdownTelemetry
|
|
7
|
-
} from "./chunk-BDZNOCWJ.js";
|
|
8
|
-
import {
|
|
9
|
-
Storage
|
|
10
|
-
} from "./chunk-SAJ72M2G.js";
|
|
11
|
-
|
|
12
|
-
// packages/cli/src/utils/cleanup.ts
|
|
13
|
-
import { promises as fs } from "node:fs";
|
|
14
|
-
import { join } from "node:path";
|
|
15
|
-
var cleanupFunctions = [];
|
|
16
|
-
var syncCleanupFunctions = [];
|
|
17
|
-
var configForTelemetry = null;
|
|
18
|
-
var isShuttingDown = false;
|
|
19
|
-
function registerCleanup(fn) {
|
|
20
|
-
cleanupFunctions.push(fn);
|
|
21
|
-
}
|
|
22
|
-
function removeCleanup(fn) {
|
|
23
|
-
const index = cleanupFunctions.indexOf(fn);
|
|
24
|
-
if (index !== -1) {
|
|
25
|
-
cleanupFunctions.splice(index, 1);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function registerSyncCleanup(fn) {
|
|
29
|
-
syncCleanupFunctions.push(fn);
|
|
30
|
-
}
|
|
31
|
-
function removeSyncCleanup(fn) {
|
|
32
|
-
const index = syncCleanupFunctions.indexOf(fn);
|
|
33
|
-
if (index !== -1) {
|
|
34
|
-
syncCleanupFunctions.splice(index, 1);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function resetCleanupForTesting() {
|
|
38
|
-
cleanupFunctions.length = 0;
|
|
39
|
-
syncCleanupFunctions.length = 0;
|
|
40
|
-
configForTelemetry = null;
|
|
41
|
-
isShuttingDown = false;
|
|
42
|
-
}
|
|
43
|
-
function runSyncCleanup() {
|
|
44
|
-
for (const fn of syncCleanupFunctions) {
|
|
45
|
-
try {
|
|
46
|
-
fn();
|
|
47
|
-
} catch {
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
syncCleanupFunctions.length = 0;
|
|
51
|
-
}
|
|
52
|
-
function registerTelemetryConfig(config) {
|
|
53
|
-
configForTelemetry = config;
|
|
54
|
-
}
|
|
55
|
-
async function runExitCleanup() {
|
|
56
|
-
await drainStdin();
|
|
57
|
-
runSyncCleanup();
|
|
58
|
-
for (const fn of cleanupFunctions) {
|
|
59
|
-
try {
|
|
60
|
-
await fn();
|
|
61
|
-
} catch {
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
cleanupFunctions.length = 0;
|
|
65
|
-
try {
|
|
66
|
-
await resetBrowserSession();
|
|
67
|
-
} catch {
|
|
68
|
-
}
|
|
69
|
-
if (configForTelemetry) {
|
|
70
|
-
try {
|
|
71
|
-
await configForTelemetry.dispose();
|
|
72
|
-
} catch {
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (configForTelemetry && isTelemetrySdkInitialized()) {
|
|
76
|
-
try {
|
|
77
|
-
await shutdownTelemetry(configForTelemetry);
|
|
78
|
-
} catch {
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async function drainStdin() {
|
|
83
|
-
if (!process.stdin?.isTTY) return;
|
|
84
|
-
process.stdin.resume().removeAllListeners("data").on("data", () => {
|
|
85
|
-
});
|
|
86
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
87
|
-
}
|
|
88
|
-
async function gracefulShutdown(_reason) {
|
|
89
|
-
if (isShuttingDown) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
isShuttingDown = true;
|
|
93
|
-
await runExitCleanup();
|
|
94
|
-
process.exit(ExitCodes.SUCCESS);
|
|
95
|
-
}
|
|
96
|
-
function setupSignalHandlers() {
|
|
97
|
-
process.on("SIGHUP", () => gracefulShutdown("SIGHUP"));
|
|
98
|
-
process.on("SIGTERM", () => gracefulShutdown("SIGTERM"));
|
|
99
|
-
process.on("SIGINT", () => gracefulShutdown("SIGINT"));
|
|
100
|
-
}
|
|
101
|
-
function setupTtyCheck() {
|
|
102
|
-
let intervalId = null;
|
|
103
|
-
let isCheckingTty = false;
|
|
104
|
-
intervalId = setInterval(async () => {
|
|
105
|
-
if (isCheckingTty || isShuttingDown) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (process.env["SANDBOX"]) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (!process.stdin.isTTY && !process.stdout.isTTY) {
|
|
112
|
-
isCheckingTty = true;
|
|
113
|
-
if (intervalId) {
|
|
114
|
-
clearInterval(intervalId);
|
|
115
|
-
intervalId = null;
|
|
116
|
-
}
|
|
117
|
-
await gracefulShutdown("TTY loss");
|
|
118
|
-
}
|
|
119
|
-
}, 5e3);
|
|
120
|
-
intervalId.unref();
|
|
121
|
-
return () => {
|
|
122
|
-
if (intervalId) {
|
|
123
|
-
clearInterval(intervalId);
|
|
124
|
-
intervalId = null;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
async function cleanupCheckpoints() {
|
|
129
|
-
const storage = new Storage(process.cwd());
|
|
130
|
-
await storage.initialize();
|
|
131
|
-
const tempDir = storage.getProjectTempDir();
|
|
132
|
-
const checkpointsDir = join(tempDir, "checkpoints");
|
|
133
|
-
try {
|
|
134
|
-
await fs.rm(checkpointsDir, { recursive: true, force: true });
|
|
135
|
-
} catch {
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export {
|
|
140
|
-
registerCleanup,
|
|
141
|
-
removeCleanup,
|
|
142
|
-
registerSyncCleanup,
|
|
143
|
-
removeSyncCleanup,
|
|
144
|
-
resetCleanupForTesting,
|
|
145
|
-
runSyncCleanup,
|
|
146
|
-
registerTelemetryConfig,
|
|
147
|
-
runExitCleanup,
|
|
148
|
-
setupSignalHandlers,
|
|
149
|
-
setupTtyCheck,
|
|
150
|
-
cleanupCheckpoints
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* @license
|
|
154
|
-
* Copyright 2025 Google LLC
|
|
155
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
156
|
-
*/
|
package/bundle/chunk-FZXNSS2J.js
DELETED
|
@@ -1,118 +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
|
-
exitCli,
|
|
4
|
-
require_source
|
|
5
|
-
} from "./chunk-VHJM22NK.js";
|
|
6
|
-
import {
|
|
7
|
-
DEFAULT_PORT,
|
|
8
|
-
SERVER_START_WAIT_MS,
|
|
9
|
-
getBinaryPath,
|
|
10
|
-
getLiteRtBinDir,
|
|
11
|
-
getLogFilePath,
|
|
12
|
-
getPidFilePath,
|
|
13
|
-
isBinaryInstalled,
|
|
14
|
-
isServerRunning,
|
|
15
|
-
resolveGemmaConfig,
|
|
16
|
-
writeServerProcessInfo
|
|
17
|
-
} from "./chunk-7CD6GCRT.js";
|
|
18
|
-
import {
|
|
19
|
-
debugLogger
|
|
20
|
-
} from "./chunk-SAJ72M2G.js";
|
|
21
|
-
import {
|
|
22
|
-
__toESM
|
|
23
|
-
} from "./chunk-34MYV7JD.js";
|
|
24
|
-
|
|
25
|
-
// packages/cli/src/commands/gemma/start.ts
|
|
26
|
-
var import_chalk = __toESM(require_source(), 1);
|
|
27
|
-
import fs from "node:fs";
|
|
28
|
-
import path from "node:path";
|
|
29
|
-
import { spawn } from "node:child_process";
|
|
30
|
-
async function startServer(binaryPath, port) {
|
|
31
|
-
const alreadyRunning = await isServerRunning(port);
|
|
32
|
-
if (alreadyRunning) {
|
|
33
|
-
debugLogger.log(`LiteRT server already running on port ${port}`);
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
const logPath = getLogFilePath();
|
|
37
|
-
fs.mkdirSync(getLiteRtBinDir(), { recursive: true });
|
|
38
|
-
const tmpDir = path.dirname(getPidFilePath());
|
|
39
|
-
fs.mkdirSync(tmpDir, { recursive: true });
|
|
40
|
-
const logFd = fs.openSync(logPath, "a");
|
|
41
|
-
try {
|
|
42
|
-
const child = spawn(binaryPath, ["serve", `--port=${port}`, "--verbose"], {
|
|
43
|
-
detached: true,
|
|
44
|
-
stdio: ["ignore", logFd, logFd]
|
|
45
|
-
});
|
|
46
|
-
if (child.pid) {
|
|
47
|
-
writeServerProcessInfo({
|
|
48
|
-
pid: child.pid,
|
|
49
|
-
binaryPath,
|
|
50
|
-
port
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
child.unref();
|
|
54
|
-
} finally {
|
|
55
|
-
fs.closeSync(logFd);
|
|
56
|
-
}
|
|
57
|
-
await new Promise((resolve) => setTimeout(resolve, SERVER_START_WAIT_MS));
|
|
58
|
-
return isServerRunning(port);
|
|
59
|
-
}
|
|
60
|
-
var startCommand = {
|
|
61
|
-
command: "start",
|
|
62
|
-
describe: "Start the LiteRT-LM server",
|
|
63
|
-
builder: (yargs) => yargs.option("port", {
|
|
64
|
-
type: "number",
|
|
65
|
-
description: "Port for the LiteRT server"
|
|
66
|
-
}),
|
|
67
|
-
handler: async (argv) => {
|
|
68
|
-
let port;
|
|
69
|
-
if (argv["port"] !== void 0) {
|
|
70
|
-
port = Number(argv["port"]);
|
|
71
|
-
}
|
|
72
|
-
if (!port) {
|
|
73
|
-
const { configuredPort } = resolveGemmaConfig(DEFAULT_PORT);
|
|
74
|
-
port = configuredPort;
|
|
75
|
-
}
|
|
76
|
-
const binaryPath = getBinaryPath();
|
|
77
|
-
if (!binaryPath || !isBinaryInstalled(binaryPath)) {
|
|
78
|
-
debugLogger.error(
|
|
79
|
-
import_chalk.default.red(
|
|
80
|
-
'LiteRT-LM binary not found. Run "gemini gemma setup" first.'
|
|
81
|
-
)
|
|
82
|
-
);
|
|
83
|
-
await exitCli(1);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const alreadyRunning = await isServerRunning(port);
|
|
87
|
-
if (alreadyRunning) {
|
|
88
|
-
debugLogger.log(
|
|
89
|
-
import_chalk.default.green(`LiteRT server is already running on port ${port}.`)
|
|
90
|
-
);
|
|
91
|
-
await exitCli(0);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
debugLogger.log(`Starting LiteRT server on port ${port}...`);
|
|
95
|
-
const started = await startServer(binaryPath, port);
|
|
96
|
-
if (started) {
|
|
97
|
-
debugLogger.log(import_chalk.default.green(`LiteRT server started on port ${port}.`));
|
|
98
|
-
debugLogger.log(import_chalk.default.dim(`Logs: ${getLogFilePath()}`));
|
|
99
|
-
await exitCli(0);
|
|
100
|
-
} else {
|
|
101
|
-
debugLogger.error(
|
|
102
|
-
import_chalk.default.red("Server may not have started correctly. Check logs:")
|
|
103
|
-
);
|
|
104
|
-
debugLogger.error(import_chalk.default.dim(` ${getLogFilePath()}`));
|
|
105
|
-
await exitCli(1);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export {
|
|
111
|
-
startServer,
|
|
112
|
-
startCommand
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* @license
|
|
116
|
-
* Copyright 2026 Google LLC
|
|
117
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
118
|
-
*/
|