@google/gemini-cli 0.36.0-preview.0 → 0.36.0-preview.2
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-K2M7OTIP.js → chunk-25V3TYNR.js} +9 -10
- package/bundle/{chunk-N7MAJ3JD.js → chunk-6F64DR53.js} +6 -6
- package/bundle/{chunk-6UAL5KXG.js → chunk-EUXACAGL.js} +9 -12
- package/bundle/{chunk-BE2CAP4N.js → chunk-HLML5SVJ.js} +29 -27
- package/bundle/{chunk-3HNPGRRW.js → chunk-IOJJTEIC.js} +2 -2
- package/bundle/{chunk-S36ET7IB.js → chunk-KGPUJGU6.js} +6 -6
- package/bundle/{chunk-3XQWOVPH.js → chunk-MRJRXC63.js} +2 -2
- package/bundle/{chunk-HXZPARYO.js → chunk-MXNIJ4RK.js} +2 -2
- package/bundle/{chunk-4NIOHPQN.js → chunk-NKTSTYJO.js} +72 -60
- package/bundle/chunk-NT4MG3B6.js +93175 -0
- package/bundle/chunk-OOZG4FMQ.js +137 -0
- package/bundle/{chunk-PVQN7ZVP.js → chunk-PXG3YTLU.js} +42 -27
- package/bundle/{chunk-CDXJ3P4V.js → chunk-SV2TJWFU.js} +5596 -10443
- package/bundle/chunk-WHT3ZS7S.js +354051 -0
- package/bundle/{cleanup-6R6IEU7T.js → cleanup-2WKEMFXG.js} +3 -3
- package/bundle/{cleanup-I7KFQ3LC.js → cleanup-B67M5WAO.js} +3 -3
- package/bundle/{cleanup-R6KR4XCS.js → cleanup-PJ323T24.js} +3 -3
- package/bundle/cleanup-PKVUY3XO.js +29 -0
- package/bundle/{core-IZK42CWE.js → core-7GUY3XKQ.js} +2 -2
- package/bundle/{devtoolsService-HLM6BC5R.js → devtoolsService-B7OD724C.js} +3 -3
- package/bundle/{devtoolsService-GIESJD2E.js → devtoolsService-JGPJ2GN4.js} +5 -4
- package/bundle/{devtoolsService-PGDD2J4F.js → devtoolsService-LU3DLIVB.js} +3 -3
- package/bundle/devtoolsService-RGAOIVMN.js +854 -0
- package/bundle/{core-J3CTNETR.js → dist-DTCLJTHN.js} +2 -2
- package/bundle/{dist-6WEZWPRQ.js → dist-X3ESBKEG.js} +2 -2
- package/bundle/dist-YQXQRQYA.js +1882 -0
- package/bundle/docs/reference/configuration.md +1 -1
- package/bundle/{gemini-AI362DTR.js → gemini-7BPDTLSV.js} +7 -7
- package/bundle/{gemini-GZFHIDDH.js → gemini-CJ5HU32O.js} +155 -140
- package/bundle/{gemini-5ARDVELJ.js → gemini-GA5SXGI6.js} +7 -7
- package/bundle/gemini-RFUB3W5S.js +14455 -0
- package/bundle/gemini.js +4 -4
- package/bundle/{interactiveCli-OYO74BPW.js → interactiveCli-2EVI7UVZ.js} +5 -5
- package/bundle/{interactiveCli-LGOLNK44.js → interactiveCli-2OAVBJCC.js} +253 -236
- package/bundle/{interactiveCli-PXX77G77.js → interactiveCli-CRDA6GQ7.js} +5 -5
- package/bundle/interactiveCli-SHFDAMKC.js +49314 -0
- package/bundle/{memoryDiscovery-WPGC7DAZ.js → memoryDiscovery-JXHCZBWK.js} +1 -1
- package/bundle/{memoryDiscovery-FNLUOGLO.js → memoryDiscovery-VQKOP6YW.js} +1 -1
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-X3F7PSVB.js → oauth2-provider-D6HJJAVX.js} +2 -2
- package/bundle/{oauth2-provider-I6AYNUSI.js → oauth2-provider-KEZJCOYM.js} +39 -73
- package/bundle/oauth2-provider-TSEQG63I.js +237 -0
- package/bundle/{oauth2-provider-G7GIGUQF.js → oauth2-provider-ZT3CIEZO.js} +2 -2
- package/bundle/policies/plan.toml +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
shutdownTelemetry
|
|
6
|
+
} from "./chunk-25V3TYNR.js";
|
|
7
|
+
import {
|
|
8
|
+
Storage
|
|
9
|
+
} from "./chunk-PXG3YTLU.js";
|
|
10
|
+
|
|
11
|
+
// packages/cli/src/utils/cleanup.ts
|
|
12
|
+
import { promises as fs } from "node:fs";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
var cleanupFunctions = [];
|
|
15
|
+
var syncCleanupFunctions = [];
|
|
16
|
+
var configForTelemetry = null;
|
|
17
|
+
var isShuttingDown = false;
|
|
18
|
+
function registerCleanup(fn) {
|
|
19
|
+
cleanupFunctions.push(fn);
|
|
20
|
+
}
|
|
21
|
+
function registerSyncCleanup(fn) {
|
|
22
|
+
syncCleanupFunctions.push(fn);
|
|
23
|
+
}
|
|
24
|
+
function resetCleanupForTesting() {
|
|
25
|
+
cleanupFunctions.length = 0;
|
|
26
|
+
syncCleanupFunctions.length = 0;
|
|
27
|
+
configForTelemetry = null;
|
|
28
|
+
isShuttingDown = false;
|
|
29
|
+
}
|
|
30
|
+
function runSyncCleanup() {
|
|
31
|
+
for (const fn of syncCleanupFunctions) {
|
|
32
|
+
try {
|
|
33
|
+
fn();
|
|
34
|
+
} catch (_) {
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
syncCleanupFunctions.length = 0;
|
|
38
|
+
}
|
|
39
|
+
function registerTelemetryConfig(config) {
|
|
40
|
+
configForTelemetry = config;
|
|
41
|
+
}
|
|
42
|
+
async function runExitCleanup() {
|
|
43
|
+
await drainStdin();
|
|
44
|
+
runSyncCleanup();
|
|
45
|
+
for (const fn of cleanupFunctions) {
|
|
46
|
+
try {
|
|
47
|
+
await fn();
|
|
48
|
+
} catch (_) {
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
cleanupFunctions.length = 0;
|
|
52
|
+
if (configForTelemetry) {
|
|
53
|
+
try {
|
|
54
|
+
await configForTelemetry.dispose();
|
|
55
|
+
} catch (_) {
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (configForTelemetry && isTelemetrySdkInitialized()) {
|
|
59
|
+
try {
|
|
60
|
+
await shutdownTelemetry(configForTelemetry);
|
|
61
|
+
} catch (_) {
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function drainStdin() {
|
|
66
|
+
if (!process.stdin?.isTTY) return;
|
|
67
|
+
process.stdin.resume().removeAllListeners("data").on("data", () => {
|
|
68
|
+
});
|
|
69
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
70
|
+
}
|
|
71
|
+
async function gracefulShutdown(_reason) {
|
|
72
|
+
if (isShuttingDown) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
isShuttingDown = true;
|
|
76
|
+
await runExitCleanup();
|
|
77
|
+
process.exit(ExitCodes.SUCCESS);
|
|
78
|
+
}
|
|
79
|
+
function setupSignalHandlers() {
|
|
80
|
+
process.on("SIGHUP", () => gracefulShutdown("SIGHUP"));
|
|
81
|
+
process.on("SIGTERM", () => gracefulShutdown("SIGTERM"));
|
|
82
|
+
process.on("SIGINT", () => gracefulShutdown("SIGINT"));
|
|
83
|
+
}
|
|
84
|
+
function setupTtyCheck() {
|
|
85
|
+
let intervalId = null;
|
|
86
|
+
let isCheckingTty = false;
|
|
87
|
+
intervalId = setInterval(async () => {
|
|
88
|
+
if (isCheckingTty || isShuttingDown) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (process.env["SANDBOX"]) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (!process.stdin.isTTY && !process.stdout.isTTY) {
|
|
95
|
+
isCheckingTty = true;
|
|
96
|
+
if (intervalId) {
|
|
97
|
+
clearInterval(intervalId);
|
|
98
|
+
intervalId = null;
|
|
99
|
+
}
|
|
100
|
+
await gracefulShutdown("TTY loss");
|
|
101
|
+
}
|
|
102
|
+
}, 5e3);
|
|
103
|
+
intervalId.unref();
|
|
104
|
+
return () => {
|
|
105
|
+
if (intervalId) {
|
|
106
|
+
clearInterval(intervalId);
|
|
107
|
+
intervalId = null;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
async function cleanupCheckpoints() {
|
|
112
|
+
const storage = new Storage(process.cwd());
|
|
113
|
+
await storage.initialize();
|
|
114
|
+
const tempDir = storage.getProjectTempDir();
|
|
115
|
+
const checkpointsDir = join(tempDir, "checkpoints");
|
|
116
|
+
try {
|
|
117
|
+
await fs.rm(checkpointsDir, { recursive: true, force: true });
|
|
118
|
+
} catch {
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export {
|
|
123
|
+
registerCleanup,
|
|
124
|
+
registerSyncCleanup,
|
|
125
|
+
resetCleanupForTesting,
|
|
126
|
+
runSyncCleanup,
|
|
127
|
+
registerTelemetryConfig,
|
|
128
|
+
runExitCleanup,
|
|
129
|
+
setupSignalHandlers,
|
|
130
|
+
setupTtyCheck,
|
|
131
|
+
cleanupCheckpoints
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* @license
|
|
135
|
+
* Copyright 2025 Google LLC
|
|
136
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
137
|
+
*/
|
|
@@ -48612,7 +48612,7 @@ function getCommandDescription() {
|
|
|
48612
48612
|
}
|
|
48613
48613
|
return "Exact bash command to execute as `bash -c <command>`";
|
|
48614
48614
|
}
|
|
48615
|
-
function getShellDeclaration(enableInteractiveShell, enableEfficiency) {
|
|
48615
|
+
function getShellDeclaration(enableInteractiveShell, enableEfficiency, enableToolSandboxing = false) {
|
|
48616
48616
|
return {
|
|
48617
48617
|
name: SHELL_TOOL_NAME,
|
|
48618
48618
|
description: getShellToolDescription(
|
|
@@ -48638,31 +48638,33 @@ function getShellDeclaration(enableInteractiveShell, enableEfficiency) {
|
|
|
48638
48638
|
type: "boolean",
|
|
48639
48639
|
description: "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background."
|
|
48640
48640
|
},
|
|
48641
|
-
|
|
48642
|
-
|
|
48643
|
-
|
|
48644
|
-
|
|
48645
|
-
|
|
48646
|
-
|
|
48647
|
-
|
|
48648
|
-
|
|
48649
|
-
|
|
48650
|
-
|
|
48651
|
-
|
|
48652
|
-
|
|
48653
|
-
|
|
48654
|
-
|
|
48655
|
-
|
|
48656
|
-
|
|
48657
|
-
|
|
48658
|
-
|
|
48659
|
-
|
|
48660
|
-
|
|
48641
|
+
...enableToolSandboxing ? {
|
|
48642
|
+
[PARAM_ADDITIONAL_PERMISSIONS]: {
|
|
48643
|
+
type: "object",
|
|
48644
|
+
description: 'Sandbox permissions for the command. Use this to request additional sandboxed filesystem or network permissions if a previous command failed with "Operation not permitted".',
|
|
48645
|
+
properties: {
|
|
48646
|
+
network: {
|
|
48647
|
+
type: "boolean",
|
|
48648
|
+
description: "Set to true to enable network access for this command."
|
|
48649
|
+
},
|
|
48650
|
+
fileSystem: {
|
|
48651
|
+
type: "object",
|
|
48652
|
+
properties: {
|
|
48653
|
+
read: {
|
|
48654
|
+
type: "array",
|
|
48655
|
+
items: { type: "string" },
|
|
48656
|
+
description: "List of additional absolute paths to allow reading."
|
|
48657
|
+
},
|
|
48658
|
+
write: {
|
|
48659
|
+
type: "array",
|
|
48660
|
+
items: { type: "string" },
|
|
48661
|
+
description: "List of additional absolute paths to allow writing."
|
|
48662
|
+
}
|
|
48661
48663
|
}
|
|
48662
48664
|
}
|
|
48663
48665
|
}
|
|
48664
48666
|
}
|
|
48665
|
-
}
|
|
48667
|
+
} : {}
|
|
48666
48668
|
},
|
|
48667
48669
|
required: [SHELL_PARAM_COMMAND]
|
|
48668
48670
|
}
|
|
@@ -48918,7 +48920,11 @@ var DEFAULT_LEGACY_SET = {
|
|
|
48918
48920
|
required: [PARAM_DIR_PATH]
|
|
48919
48921
|
}
|
|
48920
48922
|
},
|
|
48921
|
-
run_shell_command: (enableInteractiveShell, enableEfficiency) => getShellDeclaration(
|
|
48923
|
+
run_shell_command: (enableInteractiveShell, enableEfficiency, enableToolSandboxing) => getShellDeclaration(
|
|
48924
|
+
enableInteractiveShell,
|
|
48925
|
+
enableEfficiency,
|
|
48926
|
+
enableToolSandboxing
|
|
48927
|
+
),
|
|
48922
48928
|
replace: {
|
|
48923
48929
|
name: EDIT_TOOL_NAME,
|
|
48924
48930
|
description: `Replaces text within a file. By default, the tool expects to find and replace exactly ONE occurrence of \`old_string\`. If you want to replace multiple occurrences of the exact same string, set \`allow_multiple\` to true. This tool requires providing significant context around the change to ensure precise targeting. Always use the ${READ_FILE_TOOL_NAME} tool to examine the file's current content before attempting a text replacement.
|
|
@@ -49509,7 +49515,11 @@ var GEMINI_3_SET = {
|
|
|
49509
49515
|
required: [PARAM_DIR_PATH]
|
|
49510
49516
|
}
|
|
49511
49517
|
},
|
|
49512
|
-
run_shell_command: (enableInteractiveShell, enableEfficiency) => getShellDeclaration(
|
|
49518
|
+
run_shell_command: (enableInteractiveShell, enableEfficiency, enableToolSandboxing) => getShellDeclaration(
|
|
49519
|
+
enableInteractiveShell,
|
|
49520
|
+
enableEfficiency,
|
|
49521
|
+
enableToolSandboxing
|
|
49522
|
+
),
|
|
49513
49523
|
replace: {
|
|
49514
49524
|
name: EDIT_TOOL_NAME,
|
|
49515
49525
|
description: `Replaces text within a file. By default, the tool expects to find and replace exactly ONE occurrence of \`old_string\`. If you want to replace multiple occurrences of the exact same string, set \`allow_multiple\` to true. This tool requires providing significant context around the change to ensure precise targeting.
|
|
@@ -49950,12 +49960,17 @@ var ENTER_PLAN_MODE_DEFINITION = {
|
|
|
49950
49960
|
},
|
|
49951
49961
|
overrides: (modelId) => getToolSet(modelId).enter_plan_mode
|
|
49952
49962
|
};
|
|
49953
|
-
function getShellDefinition(enableInteractiveShell, enableEfficiency) {
|
|
49963
|
+
function getShellDefinition(enableInteractiveShell, enableEfficiency, enableToolSandboxing = false) {
|
|
49954
49964
|
return {
|
|
49955
|
-
base: getShellDeclaration(
|
|
49965
|
+
base: getShellDeclaration(
|
|
49966
|
+
enableInteractiveShell,
|
|
49967
|
+
enableEfficiency,
|
|
49968
|
+
enableToolSandboxing
|
|
49969
|
+
),
|
|
49956
49970
|
overrides: (modelId) => getToolSet(modelId).run_shell_command(
|
|
49957
49971
|
enableInteractiveShell,
|
|
49958
|
-
enableEfficiency
|
|
49972
|
+
enableEfficiency,
|
|
49973
|
+
enableToolSandboxing
|
|
49959
49974
|
)
|
|
49960
49975
|
};
|
|
49961
49976
|
}
|