@google/gemini-cli 0.41.0-preview.0 → 0.41.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.
Files changed (59) hide show
  1. package/bundle/{chunk-NQUBPNAU.js → chunk-36LZQV4W.js} +6 -6
  2. package/bundle/{chunk-EOA2HX63.js → chunk-45OGXTFK.js} +2 -2
  3. package/bundle/{chunk-HR7I3HEY.js → chunk-5QI3ZXQB.js} +1 -1
  4. package/bundle/{chunk-WYBLOXVK.js → chunk-5Z2T77EB.js} +1 -1
  5. package/bundle/{chunk-WSDOIL74.js → chunk-6NFVEILC.js} +73 -38
  6. package/bundle/{chunk-MJJLAQ6U.js → chunk-C5CRFFTY.js} +1 -1
  7. package/bundle/{chunk-IEYJEBJX.js → chunk-DAEE6Y5T.js} +67 -54
  8. package/bundle/{chunk-JC6VKC3C.js → chunk-DCHOW6BK.js} +1 -1
  9. package/bundle/{chunk-FZCJQ7YB.js → chunk-DOHALVIP.js} +6 -6
  10. package/bundle/{chunk-PXLG652S.js → chunk-EQSLZT5Z.js} +95 -47
  11. package/bundle/chunk-FFVUMIL3.js +80034 -0
  12. package/bundle/{chunk-MVAX27IS.js → chunk-KCDF3RDO.js} +3 -3
  13. package/bundle/{chunk-YBG43HPA.js → chunk-KJ4M7JXR.js} +1 -1
  14. package/bundle/{chunk-X2LHBPEJ.js → chunk-NGB7ZVQL.js} +14 -12
  15. package/bundle/{chunk-42DYHGPE.js → chunk-QRSHDIRX.js} +1 -1
  16. package/bundle/{chunk-WROAWEH3.js → chunk-QY23ZEK3.js} +6728 -12460
  17. package/bundle/{chunk-BKZ2ONXI.js → chunk-R4LSW45D.js} +1 -1
  18. package/bundle/chunk-T5I4M6M4.js +118 -0
  19. package/bundle/{chunk-3ANRVMZF.js → chunk-TBBDQEFQ.js} +2 -2
  20. package/bundle/{chunk-LAT5YFL4.js → chunk-U6WUS35U.js} +2 -2
  21. package/bundle/chunk-VJ6K3S57.js +156 -0
  22. package/bundle/chunk-VLSVN2FJ.js +1571 -0
  23. package/bundle/chunk-VWYB6GSK.js +17656 -0
  24. package/bundle/chunk-XO6NKGWV.js +354496 -0
  25. package/bundle/{cleanup-KLFDN77S.js → cleanup-3COTQVPP.js} +2 -2
  26. package/bundle/{cleanup-UES5UWIG.js → cleanup-FIE6MCAE.js} +2 -2
  27. package/bundle/{cleanup-Z4RYESBA.js → cleanup-PREOBLFK.js} +3 -3
  28. package/bundle/cleanup-YY2EUT56.js +33 -0
  29. package/bundle/{core-Q32MZ3QF.js → core-GZOFEER4.js} +1 -1
  30. package/bundle/{devtoolsService-ZDMUH5GA.js → devtoolsService-DV36S632.js} +2 -2
  31. package/bundle/{devtoolsService-N3SEUDJ7.js → devtoolsService-JPBL5I7F.js} +5 -4
  32. package/bundle/devtoolsService-M4LZEBZD.js +857 -0
  33. package/bundle/{devtoolsService-P5BXPJX5.js → devtoolsService-QXOHXSMJ.js} +2 -2
  34. package/bundle/{dist-UL5N47TA.js → dist-HASTHPE3.js} +1 -1
  35. package/bundle/{core-3W43VO4W.js → dist-JVRDP7SO.js} +2 -2
  36. package/bundle/dist-NSJ6AA4L.js +2068 -0
  37. package/bundle/{gemini-K6LJN552.js → gemini-FTUVOUHP.js} +11 -11
  38. package/bundle/{gemini-PL45Y473.js → gemini-IGRTXHCM.js} +11 -11
  39. package/bundle/{gemini-DGVTFOIS.js → gemini-KIM7O55W.js} +191 -175
  40. package/bundle/gemini-SFFHSCEY.js +15988 -0
  41. package/bundle/gemini.js +3 -3
  42. package/bundle/{interactiveCli-O7Y36MPM.js → interactiveCli-7HPLINVC.js} +6 -6
  43. package/bundle/{interactiveCli-ZJGQKU2Z.js → interactiveCli-JOX7MFFH.js} +6 -6
  44. package/bundle/{interactiveCli-JL5IXH2I.js → interactiveCli-K4FIT7TA.js} +290 -272
  45. package/bundle/interactiveCli-LTPR447O.js +35052 -0
  46. package/bundle/{liteRtServerManager-QGTT3QOY.js → liteRtServerManager-BENLLSF2.js} +3 -3
  47. package/bundle/{liteRtServerManager-2LAXDWUG.js → liteRtServerManager-KDO6UAQ5.js} +4 -4
  48. package/bundle/liteRtServerManager-MQIQXXZQ.js +65 -0
  49. package/bundle/{liteRtServerManager-YCLQ2VZR.js → liteRtServerManager-VGYEHFUE.js} +3 -3
  50. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  51. package/bundle/{oauth2-provider-ZUEDS4RO.js → oauth2-provider-EWMNT6D6.js} +1 -1
  52. package/bundle/{oauth2-provider-Q5QVFX4W.js → oauth2-provider-JPCBTTS2.js} +1 -1
  53. package/bundle/{oauth2-provider-RR3PO6KR.js → oauth2-provider-M3WV4GJM.js} +39 -73
  54. package/bundle/oauth2-provider-UVXCM7G3.js +237 -0
  55. package/bundle/{start-P6O7G2IY.js → start-4MSISK2E.js} +5 -5
  56. package/bundle/{start-6ZXD64J4.js → start-ATOE57Z4.js} +6 -6
  57. package/bundle/start-AVEON6UU.js +18 -0
  58. package/bundle/{start-V4W5V2EL.js → start-KBB2UTE5.js} +5 -5
  59. package/package.json +1 -1
@@ -1,7 +1,7 @@
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
3
  runExitCleanup
4
- } from "./chunk-LAT5YFL4.js";
4
+ } from "./chunk-KJ4M7JXR.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -0,0 +1,118 @@
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-R4LSW45D.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-5QI3ZXQB.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
+ */
@@ -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-BKZ2ONXI.js";
5
+ } from "./chunk-VLSVN2FJ.js";
6
6
  import {
7
7
  DEFAULT_PORT,
8
8
  SERVER_START_WAIT_MS,
@@ -14,7 +14,7 @@ import {
14
14
  isServerRunning,
15
15
  resolveGemmaConfig,
16
16
  writeServerProcessInfo
17
- } from "./chunk-X2LHBPEJ.js";
17
+ } from "./chunk-5Z2T77EB.js";
18
18
  import {
19
19
  debugLogger
20
20
  } from "./chunk-XRLFHCHC.js";
@@ -4,10 +4,10 @@ import {
4
4
  isTelemetrySdkInitialized,
5
5
  resetBrowserSession,
6
6
  shutdownTelemetry
7
- } from "./chunk-WROAWEH3.js";
7
+ } from "./chunk-6NFVEILC.js";
8
8
  import {
9
9
  Storage
10
- } from "./chunk-XRLFHCHC.js";
10
+ } from "./chunk-SAJ72M2G.js";
11
11
 
12
12
  // packages/cli/src/utils/cleanup.ts
13
13
  import { promises as fs } from "node:fs";
@@ -0,0 +1,156 @@
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-QY23ZEK3.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
+ */