@google/gemini-cli 0.1.10-dev.15 → 0.1.11-nightly.250713.4442e893
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/README.md +16 -2
- package/dist/google-gemini-cli-0.1.11.tgz +0 -0
- package/dist/package.json +7 -8
- package/dist/src/config/auth.js +6 -5
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +23 -2
- package/dist/src/config/config.js +78 -54
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +1 -0
- package/dist/src/config/extension.js +34 -6
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/sandboxConfig.d.ts +1 -1
- package/dist/src/config/sandboxConfig.js +1 -1
- package/dist/src/config/sandboxConfig.js.map +1 -1
- package/dist/src/config/settings.d.ts +8 -2
- package/dist/src/config/settings.js +101 -3
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.js +53 -29
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/nonInteractiveCli.d.ts +1 -1
- package/dist/src/nonInteractiveCli.js +12 -3
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/CommandService.d.ts +13 -0
- package/dist/src/services/CommandService.js +32 -0
- package/dist/src/services/CommandService.js.map +1 -0
- package/dist/src/ui/App.d.ts +1 -0
- package/dist/src/ui/App.js +138 -26
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/clearCommand.d.ts +7 -0
- package/dist/src/ui/commands/clearCommand.js +15 -0
- package/dist/src/ui/commands/clearCommand.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.d.ts +7 -0
- package/dist/src/ui/commands/helpCommand.js +18 -0
- package/dist/src/ui/commands/helpCommand.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
- package/dist/src/ui/commands/memoryCommand.js +81 -0
- package/dist/src/ui/commands/memoryCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.d.ts +7 -0
- package/dist/src/ui/commands/themeCommand.js +14 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +63 -0
- package/dist/src/{gemini.test.d.ts → ui/commands/types.js} +1 -0
- package/dist/src/ui/commands/types.js.map +1 -0
- package/dist/src/ui/components/AuthDialog.js +36 -8
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +1 -0
- package/dist/src/ui/components/Footer.js +3 -2
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Header.d.ts +2 -0
- package/dist/src/ui/components/Header.js +3 -3
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Help.d.ts +1 -1
- package/dist/src/ui/components/Help.js +3 -2
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +2 -1
- package/dist/src/ui/components/InputPrompt.js +153 -155
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +2 -1
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.js +18 -17
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.js +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +10 -7
- package/dist/src/ui/components/shared/RadioButtonSelect.js +57 -40
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +2 -1
- package/dist/src/ui/components/shared/text-buffer.js +3 -3
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +4 -1
- package/dist/src/ui/contexts/SessionContext.js +12 -2
- package/dist/src/ui/contexts/SessionContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +5 -7
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +6 -10
- package/dist/src/ui/hooks/slashCommandProcessor.js +221 -129
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.js +12 -2
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useCompletion.js +106 -56
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +3 -3
- package/dist/src/ui/hooks/useGeminiStream.js +54 -28
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useKeypress.js +74 -4
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/types.d.ts +10 -0
- package/dist/src/ui/utils/ConsolePatcher.d.ts +23 -0
- package/dist/src/ui/utils/ConsolePatcher.js +42 -0
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +16 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +104 -0
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
- package/dist/src/ui/utils/MarkdownDisplay.js +30 -101
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.js +50 -32
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/ui/utils/clipboardUtils.d.ts +22 -0
- package/dist/src/ui/utils/clipboardUtils.js +127 -0
- package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
- package/dist/src/ui/utils/errorParsing.d.ts +2 -10
- package/dist/src/ui/utils/errorParsing.js +34 -23
- package/dist/src/ui/utils/errorParsing.js.map +1 -1
- package/dist/src/utils/cleanup.d.ts +2 -0
- package/dist/src/utils/cleanup.js +15 -0
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/sandbox-macos-permissive-proxied.sb +1 -1
- package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +1 -1
- package/dist/src/utils/userStartupWarnings.d.ts +6 -0
- package/dist/src/utils/userStartupWarnings.js +33 -0
- package/dist/src/utils/userStartupWarnings.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -9
- package/dist/src/gemini.test.js +0 -122
- package/dist/src/gemini.test.js.map +0 -1
- package/dist/src/ui/App.test.d.ts +0 -6
- package/dist/src/ui/App.test.js +0 -299
- package/dist/src/ui/App.test.js.map +0 -1
- package/dist/src/ui/components/AuthDialog.test.d.ts +0 -6
- package/dist/src/ui/components/AuthDialog.test.js +0 -69
- package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
- package/dist/src/ui/components/ConsolePatcher.d.ts +0 -12
- package/dist/src/ui/components/ConsolePatcher.js +0 -40
- package/dist/src/ui/components/ConsolePatcher.js.map +0 -1
- package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -81
- package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
- package/dist/src/ui/components/InputPrompt.test.d.ts +0 -6
- package/dist/src/ui/components/InputPrompt.test.js +0 -154
- package/dist/src/ui/components/InputPrompt.test.js.map +0 -1
- package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
- package/dist/src/ui/components/LoadingIndicator.test.js +0 -141
- package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
- package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/ModelStatsDisplay.test.js +0 -217
- package/dist/src/ui/components/ModelStatsDisplay.test.js.map +0 -1
- package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/SessionSummaryDisplay.test.js +0 -60
- package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +0 -1
- package/dist/src/ui/components/StatsDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/StatsDisplay.test.js +0 -275
- package/dist/src/ui/components/StatsDisplay.test.js.map +0 -1
- package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +0 -6
- package/dist/src/ui/components/ToolStatsDisplay.test.js +0 -160
- package/dist/src/ui/components/ToolStatsDisplay.test.js.map +0 -1
- package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
- package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
- package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -37
- package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
- package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
- package/dist/src/ui/components/messages/ToolMessage.test.js +0 -116
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -134
- package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
- package/dist/src/ui/contexts/SessionContext.test.d.ts +0 -6
- package/dist/src/ui/contexts/SessionContext.test.js +0 -96
- package/dist/src/ui/contexts/SessionContext.test.js.map +0 -1
- package/dist/src/ui/hooks/useGeminiStream.test.d.ts +0 -6
- package/dist/src/ui/hooks/useGeminiStream.test.js +0 -775
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +0 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
- package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -176
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
|
@@ -3,41 +3,52 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { AuthType } from '@google/gemini-cli-core';
|
|
7
|
-
|
|
6
|
+
import { AuthType, UserTierId, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, isProQuotaExceededError, isGenericQuotaExceededError, isApiError, isStructuredError, } from '@google/gemini-cli-core';
|
|
7
|
+
// Free Tier message functions
|
|
8
|
+
const getRateLimitErrorMessageGoogleFree = (fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nPossible quota limitations in place or slow response times detected. Switching to the ${fallbackModel} model for the rest of this session.`;
|
|
9
|
+
const getRateLimitErrorMessageGoogleProQuotaFree = (currentModel = DEFAULT_GEMINI_MODEL, fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nYou have reached your daily ${currentModel} quota limit. You will be switched to the ${fallbackModel} model for the rest of this session. To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist, or use /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
|
|
10
|
+
const getRateLimitErrorMessageGoogleGenericQuotaFree = () => `\nYou have reached your daily quota limit. To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist, or use /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
|
|
11
|
+
// Legacy/Standard Tier message functions
|
|
12
|
+
const getRateLimitErrorMessageGooglePaid = (fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nPossible quota limitations in place or slow response times detected. Switching to the ${fallbackModel} model for the rest of this session. We appreciate you for choosing Gemini Code Assist and the Gemini CLI.`;
|
|
13
|
+
const getRateLimitErrorMessageGoogleProQuotaPaid = (currentModel = DEFAULT_GEMINI_MODEL, fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nYou have reached your daily ${currentModel} quota limit. You will be switched to the ${fallbackModel} model for the rest of this session. We appreciate you for choosing Gemini Code Assist and the Gemini CLI. To continue accessing the ${currentModel} model today, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
|
|
14
|
+
const getRateLimitErrorMessageGoogleGenericQuotaPaid = (currentModel = DEFAULT_GEMINI_MODEL) => `\nYou have reached your daily quota limit. We appreciate you for choosing Gemini Code Assist and the Gemini CLI. To continue accessing the ${currentModel} model today, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
|
|
8
15
|
const RATE_LIMIT_ERROR_MESSAGE_USE_GEMINI = '\nPlease wait and try again later. To increase your limits, request a quota increase through AI Studio, or switch to another /auth method';
|
|
9
16
|
const RATE_LIMIT_ERROR_MESSAGE_VERTEX = '\nPlease wait and try again later. To increase your limits, request a quota increase through Vertex, or switch to another /auth method';
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
return (typeof error === 'object' &&
|
|
13
|
-
error !== null &&
|
|
14
|
-
'error' in error &&
|
|
15
|
-
typeof error.error === 'object' &&
|
|
16
|
-
'message' in error.error);
|
|
17
|
-
}
|
|
18
|
-
function isStructuredError(error) {
|
|
19
|
-
return (typeof error === 'object' &&
|
|
20
|
-
error !== null &&
|
|
21
|
-
'message' in error &&
|
|
22
|
-
typeof error.message === 'string');
|
|
23
|
-
}
|
|
24
|
-
function getRateLimitMessage(authType) {
|
|
17
|
+
const getRateLimitErrorMessageDefault = (fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nPossible quota limitations in place or slow response times detected. Switching to the ${fallbackModel} model for the rest of this session.`;
|
|
18
|
+
function getRateLimitMessage(authType, error, userTier, currentModel, fallbackModel) {
|
|
25
19
|
switch (authType) {
|
|
26
|
-
case AuthType.LOGIN_WITH_GOOGLE:
|
|
27
|
-
|
|
20
|
+
case AuthType.LOGIN_WITH_GOOGLE: {
|
|
21
|
+
// Determine if user is on a paid tier (Legacy or Standard) - default to FREE if not specified
|
|
22
|
+
const isPaidTier = userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD;
|
|
23
|
+
if (isProQuotaExceededError(error)) {
|
|
24
|
+
return isPaidTier
|
|
25
|
+
? getRateLimitErrorMessageGoogleProQuotaPaid(currentModel || DEFAULT_GEMINI_MODEL, fallbackModel)
|
|
26
|
+
: getRateLimitErrorMessageGoogleProQuotaFree(currentModel || DEFAULT_GEMINI_MODEL, fallbackModel);
|
|
27
|
+
}
|
|
28
|
+
else if (isGenericQuotaExceededError(error)) {
|
|
29
|
+
return isPaidTier
|
|
30
|
+
? getRateLimitErrorMessageGoogleGenericQuotaPaid(currentModel || DEFAULT_GEMINI_MODEL)
|
|
31
|
+
: getRateLimitErrorMessageGoogleGenericQuotaFree();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return isPaidTier
|
|
35
|
+
? getRateLimitErrorMessageGooglePaid(fallbackModel)
|
|
36
|
+
: getRateLimitErrorMessageGoogleFree(fallbackModel);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
28
39
|
case AuthType.USE_GEMINI:
|
|
29
40
|
return RATE_LIMIT_ERROR_MESSAGE_USE_GEMINI;
|
|
30
41
|
case AuthType.USE_VERTEX_AI:
|
|
31
42
|
return RATE_LIMIT_ERROR_MESSAGE_VERTEX;
|
|
32
43
|
default:
|
|
33
|
-
return
|
|
44
|
+
return getRateLimitErrorMessageDefault(fallbackModel);
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
|
-
export function parseAndFormatApiError(error, authType) {
|
|
47
|
+
export function parseAndFormatApiError(error, authType, userTier, currentModel, fallbackModel) {
|
|
37
48
|
if (isStructuredError(error)) {
|
|
38
49
|
let text = `[API Error: ${error.message}]`;
|
|
39
50
|
if (error.status === 429) {
|
|
40
|
-
text += getRateLimitMessage(authType);
|
|
51
|
+
text += getRateLimitMessage(authType, error, userTier, currentModel, fallbackModel);
|
|
41
52
|
}
|
|
42
53
|
return text;
|
|
43
54
|
}
|
|
@@ -64,7 +75,7 @@ export function parseAndFormatApiError(error, authType) {
|
|
|
64
75
|
}
|
|
65
76
|
let text = `[API Error: ${finalMessage} (Status: ${parsedError.error.status})]`;
|
|
66
77
|
if (parsedError.error.code === 429) {
|
|
67
|
-
text += getRateLimitMessage(authType);
|
|
78
|
+
text += getRateLimitMessage(authType, parsedError, userTier, currentModel, fallbackModel);
|
|
68
79
|
}
|
|
69
80
|
return text;
|
|
70
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorParsing.js","sourceRoot":"","sources":["../../../../src/ui/utils/errorParsing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"errorParsing.js","sourceRoot":"","sources":["../../../../src/ui/utils/errorParsing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,QAAQ,EACR,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,UAAU,EACV,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC,8BAA8B;AAC9B,MAAM,kCAAkC,GAAG,CACzC,gBAAwB,0BAA0B,EAClD,EAAE,CACF,2FAA2F,aAAa,sCAAsC,CAAC;AAEjJ,MAAM,0CAA0C,GAAG,CACjD,eAAuB,oBAAoB,EAC3C,gBAAwB,0BAA0B,EAClD,EAAE,CACF,iCAAiC,YAAY,6CAA6C,aAAa,gSAAgS,CAAC;AAE1Y,MAAM,8CAA8C,GAAG,GAAG,EAAE,CAC1D,sSAAsS,CAAC;AAEzS,yCAAyC;AACzC,MAAM,kCAAkC,GAAG,CACzC,gBAAwB,0BAA0B,EAClD,EAAE,CACF,2FAA2F,aAAa,4GAA4G,CAAC;AAEvN,MAAM,0CAA0C,GAAG,CACjD,eAAuB,oBAAoB,EAC3C,gBAAwB,0BAA0B,EAClD,EAAE,CACF,iCAAiC,YAAY,6CAA6C,aAAa,wIAAwI,YAAY,2HAA2H,CAAC;AAEzX,MAAM,8CAA8C,GAAG,CACrD,e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E,CAAC;gBACD,IAAI,IAAI,GAAG,eAAe,YAAY,aAAa,WAAW,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC;gBAChF,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;oBACnC,IAAI,IAAI,mBAAmB,CACzB,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,aAAa,CACd,CAAC;gBACJ,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,kEAAkE;QACpE,CAAC;QACD,OAAO,eAAe,KAAK,GAAG,CAAC;IACjC,CAAC;IAED,OAAO,yCAAyC,CAAC;AACnD,CAAC"}
|
|
@@ -6,6 +6,21 @@
|
|
|
6
6
|
import { promises as fs } from 'fs';
|
|
7
7
|
import { join } from 'path';
|
|
8
8
|
import { getProjectTempDir } from '@google/gemini-cli-core';
|
|
9
|
+
const cleanupFunctions = [];
|
|
10
|
+
export function registerCleanup(fn) {
|
|
11
|
+
cleanupFunctions.push(fn);
|
|
12
|
+
}
|
|
13
|
+
export function runExitCleanup() {
|
|
14
|
+
for (const fn of cleanupFunctions) {
|
|
15
|
+
try {
|
|
16
|
+
fn();
|
|
17
|
+
}
|
|
18
|
+
catch (_) {
|
|
19
|
+
// Ignore errors during cleanup.
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
cleanupFunctions.length = 0; // Clear the array
|
|
23
|
+
}
|
|
9
24
|
export async function cleanupCheckpoints() {
|
|
10
25
|
const tempDir = getProjectTempDir(process.cwd());
|
|
11
26
|
const checkpointsDir = join(tempDir, 'checkpoints');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../src/utils/cleanup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,I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AC,CAAC;IACjD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACpD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;IACrE,CAAC;AACH,CAAC"}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
;; deny all outbound network traffic EXCEPT through proxy on localhost:8877
|
|
26
26
|
;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
|
|
27
|
-
;; proxy must listen on :::8877 (see
|
|
27
|
+
;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
|
|
28
28
|
(deny network-outbound)
|
|
29
29
|
(allow network-outbound (remote tcp "localhost:8877"))
|
|
30
30
|
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
|
|
89
89
|
;; allow outbound network traffic through proxy on localhost:8877
|
|
90
90
|
;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
|
|
91
|
-
;; proxy must listen on :::8877 (see
|
|
91
|
+
;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
|
|
92
92
|
(allow network-outbound (remote tcp "localhost:8877"))
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'fs/promises';
|
|
7
|
+
import * as os from 'os';
|
|
8
|
+
// Individual warning checks
|
|
9
|
+
const homeDirectoryCheck = {
|
|
10
|
+
id: 'home-directory',
|
|
11
|
+
check: async (workspaceRoot) => {
|
|
12
|
+
try {
|
|
13
|
+
const [workspaceRealPath, homeRealPath] = await Promise.all([
|
|
14
|
+
fs.realpath(workspaceRoot),
|
|
15
|
+
fs.realpath(os.homedir()),
|
|
16
|
+
]);
|
|
17
|
+
if (workspaceRealPath === homeRealPath) {
|
|
18
|
+
return 'You are running Gemini CLI in your home directory. It is recommended to run in a project-specific directory.';
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
catch (_err) {
|
|
23
|
+
return 'Could not verify the current directory due to a file system error.';
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
// All warning checks
|
|
28
|
+
const WARNING_CHECKS = [homeDirectoryCheck];
|
|
29
|
+
export async function getUserStartupWarnings(workspaceRoot) {
|
|
30
|
+
const results = await Promise.all(WARNING_CHECKS.map((check) => check.check(workspaceRoot)));
|
|
31
|
+
return results.filter((msg) => msg !== null);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=userStartupWarnings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userStartupWarnings.js","sourceRoot":"","sources":["../../../src/utils/userStartupWarnings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAOzB,4BAA4B;AAC5B,MAAM,kBAAkB,GAAiB;IACvC,EAAE,EAAE,gBAAgB;IACpB,KAAK,EAAE,KAAK,EAAE,aAAqB,EAAE,EAAE;QACrC,IAAI,CAAC;YACH,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC1D,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAC1B,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;aAC1B,CAAC,CAAC;YAEH,IAAI,iBAAiB,KAAK,YAAY,EAAE,CAAC;gBACvC,OAAO,8GAA8G,CAAC;YACxH,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,IAAa,EAAE,CAAC;YACvB,OAAO,oEAAoE,CAAC;QAC9E,CAAC;IACH,CAAC;CACF,CAAC;AAEF,qBAAqB;AACrB,MAAM,cAAc,GAA4B,CAAC,kBAAkB,CAAC,CAAC;AAErE,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,aAAqB;IAErB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAC1D,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;AAC/C,CAAC"}
|