@google/gemini-cli 0.39.0-preview.2 → 0.39.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/{chunk-RTX4LTWK.js → chunk-APBWRLCM.js} +1590 -6638
- package/bundle/{chunk-3R2FLB3Z.js → chunk-BEUOMVKF.js} +1587 -6636
- package/bundle/{chunk-67TFD6HC.js → chunk-FNPZLVJU.js} +16 -0
- package/bundle/{chunk-OXCH4FS3.js → chunk-GDRLBWZL.js} +3885 -2280
- package/bundle/{chunk-AZ7QQWNX.js → chunk-GRNHS2XR.js} +2 -2
- package/bundle/{chunk-45GIY5RT.js → chunk-N6R5LJKJ.js} +2 -2
- package/bundle/{chunk-GX4YOB7T.js → chunk-QPDKVNK5.js} +1590 -6638
- package/bundle/{chunk-QM5IP3NK.js → chunk-R32ABRMT.js} +16 -0
- package/bundle/{chunk-N3GUGFOL.js → chunk-RNWNACRD.js} +1590 -6638
- package/bundle/{chunk-QC6EGBZW.js → chunk-RVSGPQMZ.js} +2 -2
- package/bundle/{chunk-4UUOHXDW.js → chunk-UGFPG7AM.js} +3885 -2280
- package/bundle/{chunk-5J5LWISO.js → chunk-UIBQS45C.js} +3885 -2280
- package/bundle/{chunk-TKGFTY3B.js → chunk-WFCK2Z32.js} +3916 -2286
- package/bundle/{chunk-SS4CWRZ5.js → chunk-ZIXTYG56.js} +2 -2
- package/bundle/{cleanup-3EICKDDN.js → cleanup-DORKD3KW.js} +3 -3
- package/bundle/{cleanup-4SLYOL44.js → cleanup-ROCPAQIR.js} +3 -3
- package/bundle/{cleanup-6N6E742H.js → cleanup-RV4C23S4.js} +3 -3
- package/bundle/{cleanup-OG2MXKZ7.js → cleanup-VFR4VRPU.js} +3 -3
- package/bundle/{core-KLYK3V6Z.js → core-NHADWRAT.js} +28 -2
- package/bundle/{devtoolsService-FS7WXGBF.js → devtoolsService-65SKYXJR.js} +3 -3
- package/bundle/{devtoolsService-X4577PYZ.js → devtoolsService-6GKOMHGW.js} +3 -3
- package/bundle/{devtoolsService-K4DENTYF.js → devtoolsService-OIMHTGLW.js} +3 -3
- package/bundle/{devtoolsService-RLXZWLDT.js → devtoolsService-XJQQUBHU.js} +3 -3
- package/bundle/{dist-5ET5G5PC.js → dist-2DBCGLDI.js} +28 -2
- package/bundle/{dist-DQVXGLSO.js → dist-7UL5MZ3N.js} +28 -2
- package/bundle/{dist-P4XAO4SC.js → dist-FMEYWTZB.js} +28 -2
- package/bundle/docs/cli/cli-reference.md +1 -0
- package/bundle/docs/cli/trusted-folders.md +28 -0
- package/bundle/docs/reference/configuration.md +14 -0
- package/bundle/{gemini-6GWCDHXK.js → gemini-APY42TPN.js} +63 -19
- package/bundle/{gemini-FLGPH5GJ.js → gemini-ASA6UVNB.js} +61 -18
- package/bundle/{gemini-NBKLSVA3.js → gemini-JN2NUSDI.js} +63 -19
- package/bundle/{gemini-YOFQ5KF4.js → gemini-ZVQNZBQE.js} +63 -19
- package/bundle/gemini.js +3 -3
- package/bundle/{interactiveCli-AGSLCKNH.js → interactiveCli-7OEI5K4E.js} +15 -165
- package/bundle/{interactiveCli-NAPN3E2K.js → interactiveCli-F6YUYJT5.js} +28 -177
- package/bundle/{interactiveCli-TCZBSTKU.js → interactiveCli-MSV2JUI2.js} +28 -177
- package/bundle/{interactiveCli-H3NLGP7Z.js → interactiveCli-WY7NQZAW.js} +28 -177
- package/bundle/{memoryDiscovery-MYQ3ZWKM.js → memoryDiscovery-OGUXPAKW.js} +1 -1
- package/bundle/{memoryDiscovery-U3XUU4QY.js → memoryDiscovery-OJZ52WPE.js} +1 -1
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-CWUR5RGE.js → oauth2-provider-5GKHTO3W.js} +2 -2
- package/bundle/{oauth2-provider-YKYTKUWD.js → oauth2-provider-J42P6NQU.js} +2 -2
- package/bundle/{oauth2-provider-EA452S4C.js → oauth2-provider-MJYS4GHA.js} +2 -2
- package/bundle/{oauth2-provider-LV6VPYTU.js → oauth2-provider-UI5C6WYR.js} +2 -2
- package/package.json +1 -1
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
configureSpecificSetting,
|
|
26
26
|
disableSkill,
|
|
27
27
|
enableSkill,
|
|
28
|
-
execa,
|
|
29
28
|
formatRelativeTime,
|
|
30
29
|
getExtensionManager,
|
|
31
30
|
getThemeTypeFromBackgroundColor,
|
|
@@ -35,6 +34,7 @@ import {
|
|
|
35
34
|
installSkill,
|
|
36
35
|
isAlternateBufferEnabled,
|
|
37
36
|
isFolderTrustEnabled,
|
|
37
|
+
isRecord,
|
|
38
38
|
isSlashCommand,
|
|
39
39
|
isWorkspaceTrusted,
|
|
40
40
|
isWorktreeEnabled,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
updateAllUpdatableExtensions,
|
|
59
59
|
updateExtension,
|
|
60
60
|
validateAuthMethod
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-QPDKVNK5.js";
|
|
62
62
|
import {
|
|
63
63
|
appEvents
|
|
64
64
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
runExitCleanup,
|
|
71
71
|
runSyncCleanup,
|
|
72
72
|
setupSignalHandlers
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-RVSGPQMZ.js";
|
|
74
74
|
import {
|
|
75
75
|
AuthType,
|
|
76
76
|
ChatRecordingService,
|
|
@@ -102,6 +102,7 @@ import {
|
|
|
102
102
|
StreamEventType,
|
|
103
103
|
StreamJsonFormatter,
|
|
104
104
|
ToolCallEvent,
|
|
105
|
+
TrustLevel,
|
|
105
106
|
UserAccountManager,
|
|
106
107
|
UserPromptEvent,
|
|
107
108
|
ValidationCancelledError,
|
|
@@ -121,6 +122,7 @@ import {
|
|
|
121
122
|
createWorktreeService,
|
|
122
123
|
detectIdeFromEnv,
|
|
123
124
|
displayContentToString,
|
|
125
|
+
execa,
|
|
124
126
|
external_exports as external_exports2,
|
|
125
127
|
geminiPartsToContentParts,
|
|
126
128
|
generalistProfile,
|
|
@@ -167,7 +169,7 @@ import {
|
|
|
167
169
|
updatePolicy,
|
|
168
170
|
writeToStderr,
|
|
169
171
|
writeToStdout
|
|
170
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-UGFPG7AM.js";
|
|
171
173
|
import {
|
|
172
174
|
ASK_USER_TOOL_NAME,
|
|
173
175
|
ApprovalMode,
|
|
@@ -188,6 +190,7 @@ import {
|
|
|
188
190
|
FatalSandboxError,
|
|
189
191
|
FatalToolExecutionError,
|
|
190
192
|
FatalTurnLimitedError,
|
|
193
|
+
FatalUntrustedWorkspaceError,
|
|
191
194
|
GEMINI_DIR,
|
|
192
195
|
GEMINI_MODEL_ALIAS_AUTO,
|
|
193
196
|
Kind,
|
|
@@ -214,7 +217,7 @@ import {
|
|
|
214
217
|
loadServerHierarchicalMemory,
|
|
215
218
|
resolveToRealPath,
|
|
216
219
|
setGeminiMdFilename
|
|
217
|
-
} from "./chunk-
|
|
220
|
+
} from "./chunk-FNPZLVJU.js";
|
|
218
221
|
import "./chunk-664ZODQF.js";
|
|
219
222
|
import "./chunk-RJTRUG2J.js";
|
|
220
223
|
import "./chunk-IUUIT4SU.js";
|
|
@@ -5901,7 +5904,7 @@ async function handleInstall(args) {
|
|
|
5901
5904
|
);
|
|
5902
5905
|
if (confirmed) {
|
|
5903
5906
|
const trustedFolders = loadTrustedFolders();
|
|
5904
|
-
await trustedFolders.setValue(realPath,
|
|
5907
|
+
await trustedFolders.setValue(realPath, TrustLevel.TRUST_FOLDER);
|
|
5905
5908
|
} else {
|
|
5906
5909
|
throw new Error(
|
|
5907
5910
|
`Installation aborted: Folder "${absolutePath}" is not trusted.`
|
|
@@ -7265,7 +7268,7 @@ async function loadSandboxConfig(settings, argv) {
|
|
|
7265
7268
|
}
|
|
7266
7269
|
const command2 = getSandboxCommand(sandboxValue);
|
|
7267
7270
|
const packageJson = await getPackageJson(__dirname3);
|
|
7268
|
-
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.39.0
|
|
7271
|
+
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.39.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
|
|
7269
7272
|
const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
|
|
7270
7273
|
return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
|
|
7271
7274
|
}
|
|
@@ -7475,6 +7478,10 @@ async function parseArguments(settings) {
|
|
|
7475
7478
|
type: "string",
|
|
7476
7479
|
nargs: 1,
|
|
7477
7480
|
description: "Execute the provided prompt and continue in interactive mode"
|
|
7481
|
+
}).option("skip-trust", {
|
|
7482
|
+
type: "boolean",
|
|
7483
|
+
description: "Trust the current workspace for this session.",
|
|
7484
|
+
default: false
|
|
7478
7485
|
}).option("worktree", {
|
|
7479
7486
|
alias: "w",
|
|
7480
7487
|
type: "string",
|
|
@@ -7596,9 +7603,16 @@ async function parseArguments(settings) {
|
|
|
7596
7603
|
yargsInstance.wrap(yargsInstance.terminalWidth());
|
|
7597
7604
|
let result;
|
|
7598
7605
|
try {
|
|
7599
|
-
|
|
7606
|
+
const parsed = await yargsInstance.parse();
|
|
7607
|
+
if (!isRecord(parsed)) {
|
|
7608
|
+
throw new Error("Failed to parse arguments");
|
|
7609
|
+
}
|
|
7610
|
+
result = parsed;
|
|
7611
|
+
if (result["skip-trust"]) {
|
|
7612
|
+
process3.env["GEMINI_CLI_TRUST_WORKSPACE"] = "true";
|
|
7613
|
+
}
|
|
7600
7614
|
} catch (e) {
|
|
7601
|
-
const msg =
|
|
7615
|
+
const msg = getErrorMessage(e);
|
|
7602
7616
|
debugLogger.error(msg);
|
|
7603
7617
|
yargsInstance.showHelp();
|
|
7604
7618
|
await runExitCleanup();
|
|
@@ -7608,8 +7622,13 @@ async function parseArguments(settings) {
|
|
|
7608
7622
|
await runExitCleanup();
|
|
7609
7623
|
process3.exit(0);
|
|
7610
7624
|
}
|
|
7611
|
-
const queryArg = result
|
|
7612
|
-
|
|
7625
|
+
const queryArg = result["query"];
|
|
7626
|
+
let q;
|
|
7627
|
+
if (Array.isArray(queryArg)) {
|
|
7628
|
+
q = queryArg.join(" ");
|
|
7629
|
+
} else if (typeof queryArg === "string") {
|
|
7630
|
+
q = queryArg;
|
|
7631
|
+
}
|
|
7613
7632
|
if (q && !result["prompt"]) {
|
|
7614
7633
|
if (!isHeadlessMode()) {
|
|
7615
7634
|
startupMessages.push(
|
|
@@ -7640,7 +7659,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
|
|
|
7640
7659
|
const includeDirectoryTree = settings.context?.includeDirectoryTree ?? true;
|
|
7641
7660
|
const ideMode = settings.ide?.enabled ?? false;
|
|
7642
7661
|
const folderTrust = process3.env["GEMINI_CLI_INTEGRATION_TEST"] === "true" || process3.env["VITEST"] === "true" ? false : settings.security?.folderTrust?.enabled ?? false;
|
|
7643
|
-
const trustedFolder = isWorkspaceTrusted(settings, cwd,
|
|
7662
|
+
const trustedFolder = isWorkspaceTrusted(settings, cwd, {
|
|
7644
7663
|
prompt: argv.prompt,
|
|
7645
7664
|
query: argv.query
|
|
7646
7665
|
})?.isTrusted ?? false;
|
|
@@ -7669,7 +7688,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
|
|
|
7669
7688
|
return resolveToRealPath(trimmedPath) !== realCwd;
|
|
7670
7689
|
} catch (e) {
|
|
7671
7690
|
debugLogger.debug(
|
|
7672
|
-
`[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${
|
|
7691
|
+
`[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${getErrorMessage(e)})`
|
|
7673
7692
|
);
|
|
7674
7693
|
return false;
|
|
7675
7694
|
}
|
|
@@ -8060,7 +8079,7 @@ async function resolveWorktreeSettings(cwd) {
|
|
|
8060
8079
|
worktreeBaseSha = stdout.trim();
|
|
8061
8080
|
} catch (e) {
|
|
8062
8081
|
debugLogger.debug(
|
|
8063
|
-
`Failed to resolve worktree base SHA at ${worktreePath}: ${
|
|
8082
|
+
`Failed to resolve worktree base SHA at ${worktreePath}: ${getErrorMessage(e)}`
|
|
8064
8083
|
);
|
|
8065
8084
|
}
|
|
8066
8085
|
if (!worktreeBaseSha) {
|
|
@@ -9195,9 +9214,29 @@ var rootDirectoryCheck = {
|
|
|
9195
9214
|
}
|
|
9196
9215
|
}
|
|
9197
9216
|
};
|
|
9217
|
+
var folderTrustCheck = {
|
|
9218
|
+
id: "folder-trust",
|
|
9219
|
+
priority: WarningPriority.High,
|
|
9220
|
+
check: async (workspaceRoot, settings) => {
|
|
9221
|
+
if (!isFolderTrustEnabled(settings)) {
|
|
9222
|
+
return null;
|
|
9223
|
+
}
|
|
9224
|
+
const { isTrusted } = isWorkspaceTrusted(settings, workspaceRoot);
|
|
9225
|
+
if (isTrusted === true) {
|
|
9226
|
+
return null;
|
|
9227
|
+
}
|
|
9228
|
+
if (isHeadlessMode()) {
|
|
9229
|
+
throw new FatalUntrustedWorkspaceError(
|
|
9230
|
+
"Gemini CLI is not running in a trusted directory. To proceed, either use `--skip-trust`, set the `GEMINI_CLI_TRUST_WORKSPACE=true` environment variable, or trust this directory in interactive mode. For more details, see https://geminicli.com/docs/cli/trusted-folders/#headless-and-automated-environments"
|
|
9231
|
+
);
|
|
9232
|
+
}
|
|
9233
|
+
return null;
|
|
9234
|
+
}
|
|
9235
|
+
};
|
|
9198
9236
|
var WARNING_CHECKS = [
|
|
9199
9237
|
homeDirectoryCheck,
|
|
9200
|
-
rootDirectoryCheck
|
|
9238
|
+
rootDirectoryCheck,
|
|
9239
|
+
folderTrustCheck
|
|
9201
9240
|
];
|
|
9202
9241
|
async function getUserStartupWarnings(settings, workspaceRoot = process4.cwd(), options) {
|
|
9203
9242
|
const results = await Promise.all(
|
|
@@ -9562,7 +9601,7 @@ async function runNonInteractive({
|
|
|
9562
9601
|
}
|
|
9563
9602
|
});
|
|
9564
9603
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
9565
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
9604
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-OIMHTGLW.js");
|
|
9566
9605
|
await setupInitialActivityLogger(config);
|
|
9567
9606
|
}
|
|
9568
9607
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -10013,7 +10052,7 @@ async function runNonInteractive2(params) {
|
|
|
10013
10052
|
}
|
|
10014
10053
|
});
|
|
10015
10054
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
10016
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
10055
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-OIMHTGLW.js");
|
|
10017
10056
|
await setupInitialActivityLogger(config);
|
|
10018
10057
|
}
|
|
10019
10058
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -14860,7 +14899,7 @@ async function resolveSessionId(resumeArg) {
|
|
|
14860
14899
|
}
|
|
14861
14900
|
}
|
|
14862
14901
|
async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
|
|
14863
|
-
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-
|
|
14902
|
+
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-MSV2JUI2.js");
|
|
14864
14903
|
await doStartUI(
|
|
14865
14904
|
config,
|
|
14866
14905
|
settings,
|
|
@@ -15062,7 +15101,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
15062
15101
|
await config.storage.initialize();
|
|
15063
15102
|
adminControlsListner.setConfig(config);
|
|
15064
15103
|
if (config.isInteractive() && settings.merged.general.devtools) {
|
|
15065
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
15104
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-OIMHTGLW.js");
|
|
15066
15105
|
await setupInitialActivityLogger(config);
|
|
15067
15106
|
}
|
|
15068
15107
|
registerTelemetryConfig(config);
|
|
@@ -15141,6 +15180,11 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
15141
15180
|
})
|
|
15142
15181
|
];
|
|
15143
15182
|
cliStartupHandle?.end();
|
|
15183
|
+
if (!config.isInteractive()) {
|
|
15184
|
+
for (const warning of startupWarnings) {
|
|
15185
|
+
writeToStderr(warning.message + "\n");
|
|
15186
|
+
}
|
|
15187
|
+
}
|
|
15144
15188
|
if (config.isInteractive()) {
|
|
15145
15189
|
if (process.stdin.isTTY) {
|
|
15146
15190
|
process.stdin.resume();
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
configureSpecificSetting,
|
|
26
26
|
disableSkill,
|
|
27
27
|
enableSkill,
|
|
28
|
-
execa,
|
|
29
28
|
formatRelativeTime,
|
|
30
29
|
getExtensionManager,
|
|
31
30
|
getThemeTypeFromBackgroundColor,
|
|
@@ -35,6 +34,7 @@ import {
|
|
|
35
34
|
installSkill,
|
|
36
35
|
isAlternateBufferEnabled,
|
|
37
36
|
isFolderTrustEnabled,
|
|
37
|
+
isRecord,
|
|
38
38
|
isSlashCommand,
|
|
39
39
|
isWorkspaceTrusted,
|
|
40
40
|
isWorktreeEnabled,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
updateAllUpdatableExtensions,
|
|
59
59
|
updateExtension,
|
|
60
60
|
validateAuthMethod
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-BEUOMVKF.js";
|
|
62
62
|
import {
|
|
63
63
|
appEvents
|
|
64
64
|
} from "./chunk-5PS3AYFU.js";
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
runExitCleanup,
|
|
71
71
|
runSyncCleanup,
|
|
72
72
|
setupSignalHandlers
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-GRNHS2XR.js";
|
|
74
74
|
import {
|
|
75
75
|
AuthType,
|
|
76
76
|
ChatRecordingService,
|
|
@@ -110,6 +110,7 @@ import {
|
|
|
110
110
|
createWorktreeService,
|
|
111
111
|
detectIdeFromEnv,
|
|
112
112
|
displayContentToString,
|
|
113
|
+
execa,
|
|
113
114
|
external_exports as external_exports2,
|
|
114
115
|
geminiPartsToContentParts,
|
|
115
116
|
generalistProfile,
|
|
@@ -156,7 +157,7 @@ import {
|
|
|
156
157
|
updatePolicy,
|
|
157
158
|
writeToStderr,
|
|
158
159
|
writeToStdout
|
|
159
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-WFCK2Z32.js";
|
|
160
161
|
import {
|
|
161
162
|
ASK_USER_TOOL_NAME,
|
|
162
163
|
DEFAULT_FILE_FILTERING_OPTIONS,
|
|
@@ -175,6 +176,7 @@ import {
|
|
|
175
176
|
FatalSandboxError,
|
|
176
177
|
FatalToolExecutionError,
|
|
177
178
|
FatalTurnLimitedError,
|
|
179
|
+
FatalUntrustedWorkspaceError,
|
|
178
180
|
GEMINI_DIR,
|
|
179
181
|
GEMINI_MODEL_ALIAS_AUTO,
|
|
180
182
|
PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
|
|
@@ -199,7 +201,7 @@ import {
|
|
|
199
201
|
loadServerHierarchicalMemory,
|
|
200
202
|
resolveToRealPath,
|
|
201
203
|
setGeminiMdFilename
|
|
202
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-R32ABRMT.js";
|
|
203
205
|
import "./chunk-664ZODQF.js";
|
|
204
206
|
import "./chunk-RJTRUG2J.js";
|
|
205
207
|
import "./chunk-IUUIT4SU.js";
|
|
@@ -7250,7 +7252,7 @@ async function loadSandboxConfig(settings, argv) {
|
|
|
7250
7252
|
}
|
|
7251
7253
|
const command2 = getSandboxCommand(sandboxValue);
|
|
7252
7254
|
const packageJson = await getPackageJson(__dirname3);
|
|
7253
|
-
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.39.0
|
|
7255
|
+
const image = process.env["GEMINI_SANDBOX_IMAGE"] ?? "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.39.0" ?? customImage ?? packageJson?.config?.sandboxImageUri;
|
|
7254
7256
|
const isNative = command2 === "windows-native" || command2 === "sandbox-exec" || command2 === "lxc";
|
|
7255
7257
|
return command2 && (image || isNative) ? { enabled: true, allowedPaths, networkAccess, command: command2, image } : void 0;
|
|
7256
7258
|
}
|
|
@@ -7460,6 +7462,10 @@ async function parseArguments(settings) {
|
|
|
7460
7462
|
type: "string",
|
|
7461
7463
|
nargs: 1,
|
|
7462
7464
|
description: "Execute the provided prompt and continue in interactive mode"
|
|
7465
|
+
}).option("skip-trust", {
|
|
7466
|
+
type: "boolean",
|
|
7467
|
+
description: "Trust the current workspace for this session.",
|
|
7468
|
+
default: false
|
|
7463
7469
|
}).option("worktree", {
|
|
7464
7470
|
alias: "w",
|
|
7465
7471
|
type: "string",
|
|
@@ -7581,9 +7587,16 @@ async function parseArguments(settings) {
|
|
|
7581
7587
|
yargsInstance.wrap(yargsInstance.terminalWidth());
|
|
7582
7588
|
let result;
|
|
7583
7589
|
try {
|
|
7584
|
-
|
|
7590
|
+
const parsed = await yargsInstance.parse();
|
|
7591
|
+
if (!isRecord(parsed)) {
|
|
7592
|
+
throw new Error("Failed to parse arguments");
|
|
7593
|
+
}
|
|
7594
|
+
result = parsed;
|
|
7595
|
+
if (result["skip-trust"]) {
|
|
7596
|
+
process3.env["GEMINI_CLI_TRUST_WORKSPACE"] = "true";
|
|
7597
|
+
}
|
|
7585
7598
|
} catch (e) {
|
|
7586
|
-
const msg =
|
|
7599
|
+
const msg = getErrorMessage(e);
|
|
7587
7600
|
debugLogger.error(msg);
|
|
7588
7601
|
yargsInstance.showHelp();
|
|
7589
7602
|
await runExitCleanup();
|
|
@@ -7593,8 +7606,13 @@ async function parseArguments(settings) {
|
|
|
7593
7606
|
await runExitCleanup();
|
|
7594
7607
|
process3.exit(0);
|
|
7595
7608
|
}
|
|
7596
|
-
const queryArg = result
|
|
7597
|
-
|
|
7609
|
+
const queryArg = result["query"];
|
|
7610
|
+
let q;
|
|
7611
|
+
if (Array.isArray(queryArg)) {
|
|
7612
|
+
q = queryArg.join(" ");
|
|
7613
|
+
} else if (typeof queryArg === "string") {
|
|
7614
|
+
q = queryArg;
|
|
7615
|
+
}
|
|
7598
7616
|
if (q && !result["prompt"]) {
|
|
7599
7617
|
if (!isHeadlessMode()) {
|
|
7600
7618
|
startupMessages.push(
|
|
@@ -7625,7 +7643,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
|
|
|
7625
7643
|
const includeDirectoryTree = settings.context?.includeDirectoryTree ?? true;
|
|
7626
7644
|
const ideMode = settings.ide?.enabled ?? false;
|
|
7627
7645
|
const folderTrust = process3.env["GEMINI_CLI_INTEGRATION_TEST"] === "true" || process3.env["VITEST"] === "true" ? false : settings.security?.folderTrust?.enabled ?? false;
|
|
7628
|
-
const trustedFolder = isWorkspaceTrusted(settings, cwd,
|
|
7646
|
+
const trustedFolder = isWorkspaceTrusted(settings, cwd, {
|
|
7629
7647
|
prompt: argv.prompt,
|
|
7630
7648
|
query: argv.query
|
|
7631
7649
|
})?.isTrusted ?? false;
|
|
@@ -7654,7 +7672,7 @@ async function loadCliConfig(settings, sessionId, argv, options = {}) {
|
|
|
7654
7672
|
return resolveToRealPath(trimmedPath) !== realCwd;
|
|
7655
7673
|
} catch (e) {
|
|
7656
7674
|
debugLogger.debug(
|
|
7657
|
-
`[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${
|
|
7675
|
+
`[IDE] Skipping inaccessible workspace folder: ${trimmedPath} (${getErrorMessage(e)})`
|
|
7658
7676
|
);
|
|
7659
7677
|
return false;
|
|
7660
7678
|
}
|
|
@@ -8045,7 +8063,7 @@ async function resolveWorktreeSettings(cwd) {
|
|
|
8045
8063
|
worktreeBaseSha = stdout.trim();
|
|
8046
8064
|
} catch (e) {
|
|
8047
8065
|
debugLogger.debug(
|
|
8048
|
-
`Failed to resolve worktree base SHA at ${worktreePath}: ${
|
|
8066
|
+
`Failed to resolve worktree base SHA at ${worktreePath}: ${getErrorMessage(e)}`
|
|
8049
8067
|
);
|
|
8050
8068
|
}
|
|
8051
8069
|
if (!worktreeBaseSha) {
|
|
@@ -9180,9 +9198,29 @@ var rootDirectoryCheck = {
|
|
|
9180
9198
|
}
|
|
9181
9199
|
}
|
|
9182
9200
|
};
|
|
9201
|
+
var folderTrustCheck = {
|
|
9202
|
+
id: "folder-trust",
|
|
9203
|
+
priority: "high" /* High */,
|
|
9204
|
+
check: async (workspaceRoot, settings) => {
|
|
9205
|
+
if (!isFolderTrustEnabled(settings)) {
|
|
9206
|
+
return null;
|
|
9207
|
+
}
|
|
9208
|
+
const { isTrusted } = isWorkspaceTrusted(settings, workspaceRoot);
|
|
9209
|
+
if (isTrusted === true) {
|
|
9210
|
+
return null;
|
|
9211
|
+
}
|
|
9212
|
+
if (isHeadlessMode()) {
|
|
9213
|
+
throw new FatalUntrustedWorkspaceError(
|
|
9214
|
+
"Gemini CLI is not running in a trusted directory. To proceed, either use `--skip-trust`, set the `GEMINI_CLI_TRUST_WORKSPACE=true` environment variable, or trust this directory in interactive mode. For more details, see https://geminicli.com/docs/cli/trusted-folders/#headless-and-automated-environments"
|
|
9215
|
+
);
|
|
9216
|
+
}
|
|
9217
|
+
return null;
|
|
9218
|
+
}
|
|
9219
|
+
};
|
|
9183
9220
|
var WARNING_CHECKS = [
|
|
9184
9221
|
homeDirectoryCheck,
|
|
9185
|
-
rootDirectoryCheck
|
|
9222
|
+
rootDirectoryCheck,
|
|
9223
|
+
folderTrustCheck
|
|
9186
9224
|
];
|
|
9187
9225
|
async function getUserStartupWarnings(settings, workspaceRoot = process4.cwd(), options) {
|
|
9188
9226
|
const results = await Promise.all(
|
|
@@ -9547,7 +9585,7 @@ async function runNonInteractive({
|
|
|
9547
9585
|
}
|
|
9548
9586
|
});
|
|
9549
9587
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
9550
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
9588
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-65SKYXJR.js");
|
|
9551
9589
|
await setupInitialActivityLogger(config);
|
|
9552
9590
|
}
|
|
9553
9591
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -9998,7 +10036,7 @@ async function runNonInteractive2(params) {
|
|
|
9998
10036
|
}
|
|
9999
10037
|
});
|
|
10000
10038
|
if (process.env["GEMINI_CLI_ACTIVITY_LOG_TARGET"]) {
|
|
10001
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
10039
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-65SKYXJR.js");
|
|
10002
10040
|
await setupInitialActivityLogger(config);
|
|
10003
10041
|
}
|
|
10004
10042
|
const { stdout: workingStdout } = createWorkingStdio();
|
|
@@ -14845,7 +14883,7 @@ async function resolveSessionId(resumeArg) {
|
|
|
14845
14883
|
}
|
|
14846
14884
|
}
|
|
14847
14885
|
async function startInteractiveUI(config, settings, startupWarnings, workspaceRoot = process.cwd(), resumedSessionData, initializationResult) {
|
|
14848
|
-
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-
|
|
14886
|
+
const { startInteractiveUI: doStartUI } = await import("./interactiveCli-7OEI5K4E.js");
|
|
14849
14887
|
await doStartUI(
|
|
14850
14888
|
config,
|
|
14851
14889
|
settings,
|
|
@@ -15047,7 +15085,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
15047
15085
|
await config.storage.initialize();
|
|
15048
15086
|
adminControlsListner.setConfig(config);
|
|
15049
15087
|
if (config.isInteractive() && settings.merged.general.devtools) {
|
|
15050
|
-
const { setupInitialActivityLogger } = await import("./devtoolsService-
|
|
15088
|
+
const { setupInitialActivityLogger } = await import("./devtoolsService-65SKYXJR.js");
|
|
15051
15089
|
await setupInitialActivityLogger(config);
|
|
15052
15090
|
}
|
|
15053
15091
|
registerTelemetryConfig(config);
|
|
@@ -15126,6 +15164,11 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
15126
15164
|
})
|
|
15127
15165
|
];
|
|
15128
15166
|
cliStartupHandle?.end();
|
|
15167
|
+
if (!config.isInteractive()) {
|
|
15168
|
+
for (const warning of startupWarnings) {
|
|
15169
|
+
writeToStderr(warning.message + "\n");
|
|
15170
|
+
}
|
|
15171
|
+
}
|
|
15129
15172
|
if (config.isInteractive()) {
|
|
15130
15173
|
if (process.stdin.isTTY) {
|
|
15131
15174
|
process.stdin.resume();
|