From dc2ac144b7059ec2d66f1e90316df40d3822c8b5 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 21 Jul 2025 17:54:44 -0400 Subject: [PATCH] Various spelling improvements (#3497) Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Sandy Tao --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/pull_request_template.md | 2 +- .github/scripts/pr-triage.sh | 2 +- CONTRIBUTING.md | 8 +++---- README.md | 2 +- docs/cli/authentication.md | 2 +- docs/core/tools-api.md | 2 +- docs/tools/file-system.md | 2 +- docs/troubleshooting.md | 2 +- packages/cli/src/nonInteractiveCli.test.ts | 12 +++++----- packages/cli/src/ui/App.tsx | 2 +- packages/cli/src/ui/components/Footer.tsx | 2 +- .../cli/src/ui/components/InputPrompt.tsx | 2 +- .../cli/src/ui/components/ThemeDialog.tsx | 22 +++++++++---------- .../cli/src/ui/hooks/shellCommandProcessor.ts | 2 +- .../src/ui/hooks/useHistoryManager.test.ts | 4 ++-- .../cli/src/ui/hooks/useShellHistory.test.ts | 2 +- .../cli/src/ui/hooks/useToolScheduler.test.ts | 4 ++-- .../cli/src/ui/themes/shades-of-purple.ts | 2 +- .../cli/src/ui/themes/theme-manager.test.ts | 2 +- packages/cli/src/ui/themes/theme-manager.ts | 2 +- packages/cli/src/ui/themes/theme.ts | 2 +- packages/cli/src/ui/utils/CodeColorizer.tsx | 6 ++--- .../cli/src/ui/utils/commandUtils.test.ts | 2 +- .../cli/src/ui/utils/markdownUtilities.ts | 2 +- packages/cli/src/utils/sandbox.ts | 6 ++--- packages/core/src/code_assist/server.ts | 6 ++--- packages/core/src/code_assist/types.ts | 4 ++-- .../core/src/config/flashFallback.test.ts | 2 +- .../core/__snapshots__/prompts.test.ts.snap | 4 ++-- packages/core/src/core/client.ts | 4 ++-- packages/core/src/core/contentGenerator.ts | 2 +- packages/core/src/core/geminiChat.ts | 4 ++-- packages/core/src/core/logger.test.ts | 2 +- .../core/nonInteractiveToolExecutor.test.ts | 10 ++++----- packages/core/src/core/prompts.test.ts | 6 ++--- packages/core/src/core/prompts.ts | 4 ++-- packages/core/src/services/ideContext.ts | 2 +- packages/core/src/tools/edit.ts | 8 +++---- packages/core/src/tools/grep.test.ts | 2 +- .../core/src/tools/read-many-files.test.ts | 2 +- packages/core/src/utils/editCorrector.test.ts | 2 +- packages/core/src/utils/editor.test.ts | 4 ++-- packages/core/src/utils/fileUtils.test.ts | 6 ++--- packages/core/src/utils/fileUtils.ts | 2 +- .../core/src/utils/getFolderStructure.test.ts | 2 +- packages/core/src/utils/paths.ts | 2 +- packages/core/src/utils/retry.ts | 2 +- 48 files changed, 91 insertions(+), 91 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 12bf4663e9..9f78e2fedd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -29,7 +29,7 @@ body: id: info attributes: label: Client information - description: Please paste the full text from the `/about` command run from Gemini CLI. Also include which platform (MacOS, Windows, Linux). + description: Please paste the full text from the `/about` command run from Gemini CLI. Also include which platform (macOS, Windows, Linux). value: |
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 560eec2508..773e4cc871 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,7 +4,7 @@ ## Dive Deeper - + ## Reviewer Test Plan diff --git a/.github/scripts/pr-triage.sh b/.github/scripts/pr-triage.sh index be86e393dd..6b60432bc4 100755 --- a/.github/scripts/pr-triage.sh +++ b/.github/scripts/pr-triage.sh @@ -24,7 +24,7 @@ process_pr() { ISSUE_NUMBER=$(echo "$PR_BODY" | grep -oE '#[0-9]+' | head -1 | sed 's/#//' 2>/dev/null || echo "") fi - # Pattern 2: Closes/Fixes/Resolves patterns (case insensitive) + # Pattern 2: Closes/Fixes/Resolves patterns (case-insensitive) if [ -z "$ISSUE_NUMBER" ]; then ISSUE_NUMBER=$(echo "$PR_BODY" | grep -iE '(closes?|fixes?|resolves?) #[0-9]+' | grep -oE '#[0-9]+' | head -1 | sed 's/#//' 2>/dev/null || echo "") fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d8659599b..54af935a15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -272,19 +272,19 @@ To debug the CLI's React-based UI, you can use React DevTools. Ink, the library ## Sandboxing -### MacOS Seatbelt +### macOS Seatbelt -On MacOS, `gemini` uses Seatbelt (`sandbox-exec`) under a `permissive-open` profile (see `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) that restricts writes to the project folder but otherwise allows all other operations and outbound network traffic ("open") by default. You can switch to a `restrictive-closed` profile (see `packages/cli/src/utils/sandbox-macos-restrictive-closed.sb`) that declines all operations and outbound network traffic ("closed") by default by setting `SEATBELT_PROFILE=restrictive-closed` in your environment or `.env` file. Available built-in profiles are `{permissive,restrictive}-{open,closed,proxied}` (see below for proxied networking). You can also switch to a custom profile `SEATBELT_PROFILE=` if you also create a file `.gemini/sandbox-macos-.sb` under your project settings directory `.gemini`. +On macOS, `gemini` uses Seatbelt (`sandbox-exec`) under a `permissive-open` profile (see `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) that restricts writes to the project folder but otherwise allows all other operations and outbound network traffic ("open") by default. You can switch to a `restrictive-closed` profile (see `packages/cli/src/utils/sandbox-macos-restrictive-closed.sb`) that declines all operations and outbound network traffic ("closed") by default by setting `SEATBELT_PROFILE=restrictive-closed` in your environment or `.env` file. Available built-in profiles are `{permissive,restrictive}-{open,closed,proxied}` (see below for proxied networking). You can also switch to a custom profile `SEATBELT_PROFILE=` if you also create a file `.gemini/sandbox-macos-.sb` under your project settings directory `.gemini`. ### Container-based Sandboxing (All Platforms) -For stronger container-based sandboxing on MacOS or other platforms, you can set `GEMINI_SANDBOX=true|docker|podman|` in your environment or `.env` file. The specified command (or if `true` then either `docker` or `podman`) must be installed on the host machine. Once enabled, `npm run build:all` will build a minimal container ("sandbox") image and `npm start` will launch inside a fresh instance of that container. The first build can take 20-30s (mostly due to downloading of the base image) but after that both build and start overhead should be minimal. Default builds (`npm run build`) will not rebuild the sandbox. +For stronger container-based sandboxing on macOS or other platforms, you can set `GEMINI_SANDBOX=true|docker|podman|` in your environment or `.env` file. The specified command (or if `true` then either `docker` or `podman`) must be installed on the host machine. Once enabled, `npm run build:all` will build a minimal container ("sandbox") image and `npm start` will launch inside a fresh instance of that container. The first build can take 20-30s (mostly due to downloading of the base image) but after that both build and start overhead should be minimal. Default builds (`npm run build`) will not rebuild the sandbox. Container-based sandboxing mounts the project directory (and system temp directory) with read-write access and is started/stopped/removed automatically as you start/stop Gemini CLI. Files created within the sandbox should be automatically mapped to your user/group on host machine. You can easily specify additional mounts, ports, or environment variables by setting `SANDBOX_{MOUNTS,PORTS,ENV}` as needed. You can also fully customize the sandbox for your projects by creating the files `.gemini/sandbox.Dockerfile` and/or `.gemini/sandbox.bashrc` under your project settings directory (`.gemini`) and running `gemini` with `BUILD_SANDBOX=1` to trigger building of your custom sandbox. #### Proxied Networking -All sandboxing methods, including MacOS Seatbelt using `*-proxied` profiles, support restricting outbound network traffic through a custom proxy server that can be specified as `GEMINI_SANDBOX_PROXY_COMMAND=`, where `` must start a proxy server that listens on `:::8877` for relevant requests. See `docs/examples/proxy-script.md` for a minimal proxy that only allows `HTTPS` connections to `example.com:443` (e.g. `curl https://example.com`) and declines all other requests. The proxy is started and stopped automatically alongside the sandbox. +All sandboxing methods, including macOS Seatbelt using `*-proxied` profiles, support restricting outbound network traffic through a custom proxy server that can be specified as `GEMINI_SANDBOX_PROXY_COMMAND=`, where `` must start a proxy server that listens on `:::8877` for relevant requests. See `docs/examples/proxy-script.md` for a minimal proxy that only allows `HTTPS` connections to `example.com:443` (e.g. `curl https://example.com`) and declines all other requests. The proxy is started and stopped automatically alongside the sandbox. ## Manual Publish diff --git a/README.md b/README.md index 8a477c332f..0c72251220 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ With the Gemini CLI you can: - Use tools and MCP servers to connect new capabilities, including [media generation with Imagen, Veo or Lyria](https://github.com/GoogleCloudPlatform/vertex-ai-creative-studio/tree/main/experiments/mcp-genmedia) - Ground your queries with the [Google Search](https://ai.google.dev/gemini-api/docs/grounding) - tool, built in to Gemini. + tool, built into Gemini. ## Quickstart diff --git a/docs/cli/authentication.md b/docs/cli/authentication.md index 6fce342b77..3b452a8fbe 100644 --- a/docs/cli/authentication.md +++ b/docs/cli/authentication.md @@ -12,7 +12,7 @@ The Gemini CLI requires you to authenticate with Google's AI services. On initia 1. You have been assigned a license to a current Gemini Code Assist standard or enterprise subscription. 1. You are using the product outside the [supported regions](https://developers.google.com/gemini-code-assist/resources/available-locations) for free individual usage. 1. You are a Google account holder under the age of 18 - - If you fall into one of these categories, you must first configure a Google Cloud Project Id to use, [enable the Gemini for Cloud API](https://cloud.google.com/gemini/docs/discover/set-up-gemini#enable-api) and [configure access permissions](https://cloud.google.com/gemini/docs/discover/set-up-gemini#grant-iam). + - If you fall into one of these categories, you must first configure a Google Cloud Project ID to use, [enable the Gemini for Cloud API](https://cloud.google.com/gemini/docs/discover/set-up-gemini#enable-api) and [configure access permissions](https://cloud.google.com/gemini/docs/discover/set-up-gemini#grant-iam). You can temporarily set the environment variable in your current shell session using the following command: diff --git a/docs/core/tools-api.md b/docs/core/tools-api.md index 9a9021290a..e10333d24e 100644 --- a/docs/core/tools-api.md +++ b/docs/core/tools-api.md @@ -8,7 +8,7 @@ The Gemini CLI core (`packages/core`) features a robust system for defining, reg - `name`: A unique internal name (used in API calls to Gemini). - `displayName`: A user-friendly name. - `description`: A clear explanation of what the tool does, which is provided to the Gemini model. - - `parameterSchema`: A JSON schema defining the parameters the tool accepts. This is crucial for the Gemini model to understand how to call the tool correctly. + - `parameterSchema`: A JSON schema defining the parameters that the tool accepts. This is crucial for the Gemini model to understand how to call the tool correctly. - `validateToolParams()`: A method to validate incoming parameters. - `getDescription()`: A method to provide a human-readable description of what the tool will do with specific parameters before execution. - `shouldConfirmExecute()`: A method to determine if user confirmation is required before execution (e.g., for potentially destructive operations). diff --git a/docs/tools/file-system.md b/docs/tools/file-system.md index 05a8f512b0..ec741096a6 100644 --- a/docs/tools/file-system.md +++ b/docs/tools/file-system.md @@ -90,7 +90,7 @@ The Gemini CLI provides a comprehensive suite of tools for interacting with the - `path` (string, optional): The absolute path to the directory to search within. Defaults to the current working directory. - `include` (string, optional): A glob pattern to filter which files are searched (e.g., `"*.js"`, `"src/**/*.{ts,tsx}"`). If omitted, searches most files (respecting common ignores). - **Behavior:** - - Uses `git grep` if available in a Git repository for speed, otherwise falls back to system `grep` or a JavaScript-based search. + - Uses `git grep` if available in a Git repository for speed; otherwise, falls back to system `grep` or a JavaScript-based search. - Returns a list of matching lines, each prefixed with its file path (relative to the search directory) and line number. - **Output (`llmContent`):** A formatted string of matches, e.g.: ``` diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 2fd80d4532..fa88e26e9f 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -27,7 +27,7 @@ This guide provides solutions to common issues and debugging tips. ## Common error messages and solutions - **Error: `EADDRINUSE` (Address already in use) when starting an MCP server.** - - **Cause:** Another process is already using the port the MCP server is trying to bind to. + - **Cause:** Another process is already using the port that the MCP server is trying to bind to. - **Solution:** Either stop the other process that is using the port or configure the MCP server to use a different port. diff --git a/packages/cli/src/nonInteractiveCli.test.ts b/packages/cli/src/nonInteractiveCli.test.ts index 6cbb630dc6..8b0419f1e6 100644 --- a/packages/cli/src/nonInteractiveCli.test.ts +++ b/packages/cli/src/nonInteractiveCli.test.ts @@ -229,14 +229,14 @@ describe('runNonInteractive', () => { it('should not exit if a tool is not found, and should send error back to model', async () => { const functionCall: FunctionCall = { id: 'fcNotFound', - name: 'nonExistentTool', + name: 'nonexistentTool', args: {}, }; const errorResponsePart: Part = { functionResponse: { - name: 'nonExistentTool', + name: 'nonexistentTool', id: 'fcNotFound', - response: { error: 'Tool "nonExistentTool" not found in registry.' }, + response: { error: 'Tool "nonexistentTool" not found in registry.' }, }, }; @@ -246,8 +246,8 @@ describe('runNonInteractive', () => { vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({ callId: 'fcNotFound', responseParts: [errorResponsePart], - resultDisplay: 'Tool "nonExistentTool" not found in registry.', - error: new Error('Tool "nonExistentTool" not found in registry.'), + resultDisplay: 'Tool "nonexistentTool" not found in registry.', + error: new Error('Tool "nonexistentTool" not found in registry.'), }); const stream1 = (async function* () { @@ -278,7 +278,7 @@ describe('runNonInteractive', () => { ); expect(consoleErrorSpy).toHaveBeenCalledWith( - 'Error executing tool nonExistentTool: Tool "nonExistentTool" not found in registry.', + 'Error executing tool nonexistentTool: Tool "nonexistentTool" not found in registry.', ); expect(mockProcessExit).not.toHaveBeenCalled(); diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index 128387107f..baf21395aa 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -298,7 +298,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { config.getContentGeneratorConfig().authType === AuthType.LOGIN_WITH_GOOGLE ) { - // Use actual user tier if available, otherwise default to FREE tier behavior (safe default) + // Use actual user tier if available; otherwise, default to FREE tier behavior (safe default) const isPaidTier = userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD; diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx index 95904cd9ab..3b54a989e6 100644 --- a/packages/cli/src/ui/components/Footer.tsx +++ b/packages/cli/src/ui/components/Footer.tsx @@ -79,7 +79,7 @@ export const Footer: React.FC = ({ ) : process.env.SANDBOX === 'sandbox-exec' ? ( - MacOS Seatbelt{' '} + macOS Seatbelt{' '} ({process.env.SEATBELT_PROFILE}) ) : ( diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx index a713c889ee..6192fb8c2c 100644 --- a/packages/cli/src/ui/components/InputPrompt.tsx +++ b/packages/cli/src/ui/components/InputPrompt.tsx @@ -448,7 +448,7 @@ export const InputPrompt: React.FC = ({ return; } - // Fallback to the text buffer's default input handling for all other keys + // Fall back to the text buffer's default input handling for all other keys buffer.handleInput(key); }, [ diff --git a/packages/cli/src/ui/components/ThemeDialog.tsx b/packages/cli/src/ui/components/ThemeDialog.tsx index 41c39b6344..a6a16b8c36 100644 --- a/packages/cli/src/ui/components/ThemeDialog.tsx +++ b/packages/cli/src/ui/components/ThemeDialog.tsx @@ -73,7 +73,7 @@ export function ThemeDialog({ const initialThemeIndex = themeItems.findIndex( (item) => item.value === selectedThemeName, ); - // If not found, fallback to the first theme + // If not found, fall back to the first theme const safeInitialThemeIndex = initialThemeIndex >= 0 ? initialThemeIndex : 0; const scopeItems = [ @@ -185,7 +185,7 @@ export function ThemeDialog({ } // Don't focus the scope selection if it is hidden due to height constraints. - const currenFocusedSection = !showScopeSelection ? 'theme' : focusedSection; + const currentFocusedSection = !showScopeSelection ? 'theme' : focusedSection; // Vertical space taken by elements other than the two code blocks in the preview pane. // Includes "Preview" title, borders, and margin between blocks. @@ -224,8 +224,8 @@ export function ThemeDialog({ {/* Left Column: Selection */} - - {currenFocusedSection === 'theme' ? '> ' : ' '}Select Theme{' '} + + {currentFocusedSection === 'theme' ? '> ' : ' '}Select Theme{' '} {otherScopeModifiedMessage} {/* Scope Selection */} {showScopeSelection && ( - - {currenFocusedSection === 'scope' ? '> ' : ' '}Apply To + + {currentFocusedSection === 'scope' ? '> ' : ' '}Apply To )} @@ -261,7 +261,7 @@ export function ThemeDialog({ {/* Right Column: Preview */} Preview - {/* Get the Theme object for the highlighted theme, fallback to default if not found */} + {/* Get the Theme object for the highlighted theme, fall back to default if not found */} {(() => { const previewTheme = themeManager.getTheme( diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.ts index 6f7aff2d63..e04c9f5429 100644 --- a/packages/cli/src/ui/hooks/shellCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/shellCommandProcessor.ts @@ -146,7 +146,7 @@ function executeShellCommand( process.kill(-child.pid, 'SIGKILL'); } } catch (_e) { - // Fallback to killing just the main process if group kill fails. + // Fall back to killing just the main process if group kill fails. if (!exited) child.kill('SIGKILL'); } } diff --git a/packages/cli/src/ui/hooks/useHistoryManager.test.ts b/packages/cli/src/ui/hooks/useHistoryManager.test.ts index c7f925e2c3..b3245eb00a 100644 --- a/packages/cli/src/ui/hooks/useHistoryManager.test.ts +++ b/packages/cli/src/ui/hooks/useHistoryManager.test.ts @@ -92,7 +92,7 @@ describe('useHistoryManager', () => { }); }); - it('should not change history if updateHistoryItem is called with a non-existent ID', () => { + it('should not change history if updateHistoryItem is called with a nonexistent ID', () => { const { result } = renderHook(() => useHistory()); const timestamp = Date.now(); const itemData: Omit = { @@ -107,7 +107,7 @@ describe('useHistoryManager', () => { const originalHistory = [...result.current.history]; // Clone before update attempt act(() => { - result.current.updateItem(99999, { text: 'Should not apply' }); // Non-existent ID + result.current.updateItem(99999, { text: 'Should not apply' }); // Nonexistent ID }); expect(result.current.history).toEqual(originalHistory); diff --git a/packages/cli/src/ui/hooks/useShellHistory.test.ts b/packages/cli/src/ui/hooks/useShellHistory.test.ts index 8d03049738..3e2c2dd83f 100644 --- a/packages/cli/src/ui/hooks/useShellHistory.test.ts +++ b/packages/cli/src/ui/hooks/useShellHistory.test.ts @@ -67,7 +67,7 @@ describe('useShellHistory', () => { expect(command).toBe('cmd2'); }); - it('should handle a non-existent history file gracefully', async () => { + it('should handle a nonexistent history file gracefully', async () => { const error = new Error('File not found') as NodeJS.ErrnoException; error.code = 'ENOENT'; mockedFs.readFile.mockRejectedValue(error); diff --git a/packages/cli/src/ui/hooks/useToolScheduler.test.ts b/packages/cli/src/ui/hooks/useToolScheduler.test.ts index 81ea1f77b4..5395d18a9d 100644 --- a/packages/cli/src/ui/hooks/useToolScheduler.test.ts +++ b/packages/cli/src/ui/hooks/useToolScheduler.test.ts @@ -341,7 +341,7 @@ describe('useReactToolScheduler', () => { const schedule = result.current[1]; const request: ToolCallRequestInfo = { callId: 'call1', - name: 'nonExistentTool', + name: 'nonexistentTool', args: {}, }; @@ -361,7 +361,7 @@ describe('useReactToolScheduler', () => { request, response: expect.objectContaining({ error: expect.objectContaining({ - message: 'Tool "nonExistentTool" not found in registry.', + message: 'Tool "nonexistentTool" not found in registry.', }), }), }), diff --git a/packages/cli/src/ui/themes/shades-of-purple.ts b/packages/cli/src/ui/themes/shades-of-purple.ts index 83eeb78632..8b467e75a6 100644 --- a/packages/cli/src/ui/themes/shades-of-purple.ts +++ b/packages/cli/src/ui/themes/shades-of-purple.ts @@ -5,7 +5,7 @@ */ /** - * Shades of Purple Theme — for Highlightjs. + * Shades of Purple Theme — for Highlight.js. * @author Ahmad Awais */ import { type ColorsTheme, Theme } from './theme.js'; diff --git a/packages/cli/src/ui/themes/theme-manager.test.ts b/packages/cli/src/ui/themes/theme-manager.test.ts index f218af4b07..5bb48167eb 100644 --- a/packages/cli/src/ui/themes/theme-manager.test.ts +++ b/packages/cli/src/ui/themes/theme-manager.test.ts @@ -85,7 +85,7 @@ describe('ThemeManager', () => { expect(themeManager.getTheme('MyCustomTheme')).toBeDefined(); }); - it('should fallback to default theme if active theme is invalid', () => { + it('should fall back to default theme if active theme is invalid', () => { (themeManager as unknown as { activeTheme: unknown }).activeTheme = { name: 'NonExistent', type: 'custom', diff --git a/packages/cli/src/ui/themes/theme-manager.ts b/packages/cli/src/ui/themes/theme-manager.ts index f121a9ec63..bc5949ade2 100644 --- a/packages/cli/src/ui/themes/theme-manager.ts +++ b/packages/cli/src/ui/themes/theme-manager.ts @@ -117,7 +117,7 @@ class ThemeManager { if (process.env.NO_COLOR) { return NoColorTheme; } - // Ensure the active theme is always valid (fallback to default if not) + // Ensure the active theme is always valid (fall back to default if not) if (!this.activeTheme || !this.findThemeByName(this.activeTheme.name)) { this.activeTheme = DEFAULT_THEME; } diff --git a/packages/cli/src/ui/themes/theme.ts b/packages/cli/src/ui/themes/theme.ts index b5b6e99345..9758357b2e 100644 --- a/packages/cli/src/ui/themes/theme.ts +++ b/packages/cli/src/ui/themes/theme.ts @@ -151,7 +151,7 @@ export class Theme { inkTheme[key] = resolvedColor; } // If color is not resolvable, it's omitted from the map, - // allowing fallback to the default foreground color. + // this enables falling back to the default foreground color. } // We currently only care about the 'color' property for Ink rendering. // Other properties like background, fontStyle, etc., are ignored. diff --git a/packages/cli/src/ui/utils/CodeColorizer.tsx b/packages/cli/src/ui/utils/CodeColorizer.tsx index 77de9add0f..38dc49d4a2 100644 --- a/packages/cli/src/ui/utils/CodeColorizer.tsx +++ b/packages/cli/src/ui/utils/CodeColorizer.tsx @@ -50,7 +50,7 @@ function renderHastNode( } // Determine the color to pass down: Use this element's specific color - // if found, otherwise, continue passing down the already inherited color. + // if found; otherwise, continue passing down the already inherited color. const colorToPassDown = elementColor || inheritedColor; // Recursively render children, passing the determined color down @@ -70,7 +70,7 @@ function renderHastNode( // Handle Root Node: Start recursion with initially inherited color if (node.type === 'root') { - // Check if children array is empty - this happens when lowlight can't detect language – fallback to plain text + // Check if children array is empty - this happens when lowlight can't detect language – fall back to plain text if (!node.children || node.children.length === 0) { return null; } @@ -161,7 +161,7 @@ export function colorizeCode( `[colorizeCode] Error highlighting code for language "${language}":`, error, ); - // Fallback to plain text with default color on error + // Fall back to plain text with default color on error // Also display line numbers in fallback const lines = codeToHighlight.split('\n'); const padWidth = String(lines.length).length; // Calculate padding width based on number of lines diff --git a/packages/cli/src/ui/utils/commandUtils.test.ts b/packages/cli/src/ui/utils/commandUtils.test.ts index 158a5f7a7e..4bd48ceef8 100644 --- a/packages/cli/src/ui/utils/commandUtils.test.ts +++ b/packages/cli/src/ui/utils/commandUtils.test.ts @@ -200,7 +200,7 @@ describe('commandUtils', () => { expect(mockChild.stdin.end).toHaveBeenCalled(); }); - it('should fallback to xsel when xclip fails', async () => { + it('should fall back to xsel when xclip fails', async () => { const testText = 'Hello, world!'; let callCount = 0; diff --git a/packages/cli/src/ui/utils/markdownUtilities.ts b/packages/cli/src/ui/utils/markdownUtilities.ts index c328c12a82..6a34f1387f 100644 --- a/packages/cli/src/ui/utils/markdownUtilities.ts +++ b/packages/cli/src/ui/utils/markdownUtilities.ts @@ -29,7 +29,7 @@ This function aims to find an *intelligent* or "safe" index within the provided * **Single Line Breaks:** If no double newline is found in a suitable range, it will look for a single newline (`\n`). * Any newline chosen as a split point must also not be inside a code block. -4. **Fallback to `idealMaxLength`:** +4. **Fall back to `idealMaxLength`:** * If no "safer" split point (respecting code blocks or finding suitable newlines) is identified before or at `idealMaxLength`, and `idealMaxLength` itself is not determined to be an unsafe split point (e.g., inside a code block), the function may return a length larger than `idealMaxLength`, again it CANNOT break markdown formatting. This could happen with very long lines of text without Markdown block structures or newlines. **In essence, `findSafeSplitPoint` tries to be a good Markdown citizen when forced to divide content, preferring structural boundaries over arbitrary character limits, with a strong emphasis on not corrupting code blocks.** diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts index 670d8930fa..1c2d7d08db 100644 --- a/packages/cli/src/utils/sandbox.ts +++ b/packages/cli/src/utils/sandbox.ts @@ -99,7 +99,7 @@ async function shouldUseCurrentUserInSandbox(): Promise { } // docker does not allow container names to contain ':' or '/', so we -// parse those out and make the name a little shorter +// parse those out to shorten the name function parseImageName(image: string): string { const [fullName, tag] = image.split(':'); const name = fullName.split('/').at(-1) ?? 'unknown-image'; @@ -187,7 +187,7 @@ export async function start_sandbox( if (config.command === 'sandbox-exec') { // disallow BUILD_SANDBOX if (process.env.BUILD_SANDBOX) { - console.error('ERROR: cannot BUILD_SANDBOX when using MacOS Seatbelt'); + console.error('ERROR: cannot BUILD_SANDBOX when using macOS Seatbelt'); process.exit(1); } const profile = (process.env.SEATBELT_PROFILE ??= 'permissive-open'); @@ -847,7 +847,7 @@ async function ensureSandboxImageIsPresent( console.info(`Sandbox image ${image} not found locally.`); if (image === LOCAL_DEV_SANDBOX_IMAGE_NAME) { - // user needs to build the image themself + // user needs to build the image themselves return false; } diff --git a/packages/core/src/code_assist/server.ts b/packages/core/src/code_assist/server.ts index a6cf6af7a9..7af643f7c0 100644 --- a/packages/core/src/code_assist/server.ts +++ b/packages/core/src/code_assist/server.ts @@ -9,7 +9,7 @@ import { CodeAssistGlobalUserSettingResponse, LoadCodeAssistRequest, LoadCodeAssistResponse, - LongrunningOperationResponse, + LongRunningOperationResponse, OnboardUserRequest, SetCodeAssistGlobalUserSettingRequest, } from './types.js'; @@ -79,8 +79,8 @@ export class CodeAssistServer implements ContentGenerator { async onboardUser( req: OnboardUserRequest, - ): Promise { - return await this.requestPost( + ): Promise { + return await this.requestPost( 'onboardUser', req, ); diff --git a/packages/core/src/code_assist/types.ts b/packages/core/src/code_assist/types.ts index 4c395e577c..367186857b 100644 --- a/packages/core/src/code_assist/types.ts +++ b/packages/core/src/code_assist/types.ts @@ -127,10 +127,10 @@ export interface OnboardUserRequest { } /** - * Represents LongrunningOperation proto + * Represents LongRunningOperation proto * http://google3/google/longrunning/operations.proto;rcl=698857719;l=107 */ -export interface LongrunningOperationResponse { +export interface LongRunningOperationResponse { name: string; done?: boolean; response?: OnboardUserResponse; diff --git a/packages/core/src/config/flashFallback.test.ts b/packages/core/src/config/flashFallback.test.ts index 325cc0647b..64f0f6fd57 100644 --- a/packages/core/src/config/flashFallback.test.ts +++ b/packages/core/src/config/flashFallback.test.ts @@ -72,7 +72,7 @@ describe('Flash Model Fallback Configuration', () => { expect(config.getModel()).toBe(DEFAULT_GEMINI_FLASH_MODEL); }); - it('should fallback to initial model if contentGeneratorConfig is not available', () => { + it('should fall back to initial model if contentGeneratorConfig is not available', () => { // Test with fresh config where contentGeneratorConfig might not be set const newConfig = new Config({ sessionId: 'test-session-2', diff --git a/packages/core/src/core/__snapshots__/prompts.test.ts.snap b/packages/core/src/core/__snapshots__/prompts.test.ts.snap index 07ec166a3e..a69911cc52 100644 --- a/packages/core/src/core/__snapshots__/prompts.test.ts.snap +++ b/packages/core/src/core/__snapshots__/prompts.test.ts.snap @@ -798,8 +798,8 @@ When requested to perform tasks like fixing bugs, adding features, refactoring, - **Feedback:** To report a bug or provide feedback, please use the /bug command. -# MacOS Seatbelt -You are running under macos seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to MacOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to MacOS Seatbelt, and how the user may need to adjust their Seatbelt profile. +# macOS Seatbelt +You are running under macos seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to macOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to macOS Seatbelt, and how the user may need to adjust their Seatbelt profile. diff --git a/packages/core/src/core/client.ts b/packages/core/src/core/client.ts index aadc446c6a..9a3acae3ac 100644 --- a/packages/core/src/core/client.ts +++ b/packages/core/src/core/client.ts @@ -665,8 +665,8 @@ export class GeminiClient { } /** - * Handles fallback to Flash model when persistent 429 errors occur for OAuth users. - * Uses a fallback handler if provided by the config, otherwise returns null. + * Handles falling back to Flash model when persistent 429 errors occur for OAuth users. + * Uses a fallback handler if provided by the config; otherwise, returns null. */ private async handleFlashFallback( authType?: string, diff --git a/packages/core/src/core/contentGenerator.ts b/packages/core/src/core/contentGenerator.ts index 721a16d791..44ed7beb7d 100644 --- a/packages/core/src/core/contentGenerator.ts +++ b/packages/core/src/core/contentGenerator.ts @@ -62,7 +62,7 @@ export function createContentGeneratorConfig( const googleCloudProject = process.env.GOOGLE_CLOUD_PROJECT || undefined; const googleCloudLocation = process.env.GOOGLE_CLOUD_LOCATION || undefined; - // Use runtime model from config if available, otherwise fallback to parameter or default + // Use runtime model from config if available; otherwise, fall back to parameter or default const effectiveModel = config.getModel() || DEFAULT_GEMINI_MODEL; const contentGeneratorConfig: ContentGeneratorConfig = { diff --git a/packages/core/src/core/geminiChat.ts b/packages/core/src/core/geminiChat.ts index f93470ddc9..e963b7815b 100644 --- a/packages/core/src/core/geminiChat.ts +++ b/packages/core/src/core/geminiChat.ts @@ -201,8 +201,8 @@ export class GeminiChat { } /** - * Handles fallback to Flash model when persistent 429 errors occur for OAuth users. - * Uses a fallback handler if provided by the config, otherwise returns null. + * Handles falling back to Flash model when persistent 429 errors occur for OAuth users. + * Uses a fallback handler if provided by the config; otherwise, returns null. */ private async handleFlashFallback( authType?: string, diff --git a/packages/core/src/core/logger.test.ts b/packages/core/src/core/logger.test.ts index 848a2ce170..84cc1a0fc0 100644 --- a/packages/core/src/core/logger.test.ts +++ b/packages/core/src/core/logger.test.ts @@ -453,7 +453,7 @@ describe('Logger', () => { }); it('should return an empty array if a tagged checkpoint file does not exist', async () => { - const loaded = await logger.loadCheckpoint('non-existent-tag'); + const loaded = await logger.loadCheckpoint('nonexistent-tag'); expect(loaded).toEqual([]); }); diff --git a/packages/core/src/core/nonInteractiveToolExecutor.test.ts b/packages/core/src/core/nonInteractiveToolExecutor.test.ts index d52efb0665..1bbb9209c0 100644 --- a/packages/core/src/core/nonInteractiveToolExecutor.test.ts +++ b/packages/core/src/core/nonInteractiveToolExecutor.test.ts @@ -106,7 +106,7 @@ describe('executeToolCall', () => { it('should return an error if tool is not found', async () => { const request: ToolCallRequestInfo = { callId: 'call2', - name: 'nonExistentTool', + name: 'nonexistentTool', args: {}, isClientInitiated: false, prompt_id: 'prompt-id-2', @@ -123,17 +123,17 @@ describe('executeToolCall', () => { expect(response.callId).toBe('call2'); expect(response.error).toBeInstanceOf(Error); expect(response.error?.message).toBe( - 'Tool "nonExistentTool" not found in registry.', + 'Tool "nonexistentTool" not found in registry.', ); expect(response.resultDisplay).toBe( - 'Tool "nonExistentTool" not found in registry.', + 'Tool "nonexistentTool" not found in registry.', ); expect(response.responseParts).toEqual([ { functionResponse: { - name: 'nonExistentTool', + name: 'nonexistentTool', id: 'call2', - response: { error: 'Tool "nonExistentTool" not found in registry.' }, + response: { error: 'Tool "nonexistentTool" not found in registry.' }, }, }, ]); diff --git a/packages/core/src/core/prompts.test.ts b/packages/core/src/core/prompts.test.ts index bb7b0b5252..b994de987a 100644 --- a/packages/core/src/core/prompts.test.ts +++ b/packages/core/src/core/prompts.test.ts @@ -67,7 +67,7 @@ describe('Core System Prompt (prompts.ts)', () => { vi.stubEnv('SANDBOX', 'true'); // Generic sandbox value const prompt = getCoreSystemPrompt(); expect(prompt).toContain('# Sandbox'); - expect(prompt).not.toContain('# MacOS Seatbelt'); + expect(prompt).not.toContain('# macOS Seatbelt'); expect(prompt).not.toContain('# Outside of Sandbox'); expect(prompt).toMatchSnapshot(); }); @@ -75,7 +75,7 @@ describe('Core System Prompt (prompts.ts)', () => { it('should include seatbelt-specific instructions when SANDBOX env var is "sandbox-exec"', () => { vi.stubEnv('SANDBOX', 'sandbox-exec'); const prompt = getCoreSystemPrompt(); - expect(prompt).toContain('# MacOS Seatbelt'); + expect(prompt).toContain('# macOS Seatbelt'); expect(prompt).not.toContain('# Sandbox'); expect(prompt).not.toContain('# Outside of Sandbox'); expect(prompt).toMatchSnapshot(); @@ -86,7 +86,7 @@ describe('Core System Prompt (prompts.ts)', () => { const prompt = getCoreSystemPrompt(); expect(prompt).toContain('# Outside of Sandbox'); expect(prompt).not.toContain('# Sandbox'); - expect(prompt).not.toContain('# MacOS Seatbelt'); + expect(prompt).not.toContain('# macOS Seatbelt'); expect(prompt).toMatchSnapshot(); }); diff --git a/packages/core/src/core/prompts.ts b/packages/core/src/core/prompts.ts index 3b23f73556..08df3ba21b 100644 --- a/packages/core/src/core/prompts.ts +++ b/packages/core/src/core/prompts.ts @@ -116,8 +116,8 @@ ${(function () { if (isSandboxExec) { return ` -# MacOS Seatbelt -You are running under macos seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to MacOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to MacOS Seatbelt, and how the user may need to adjust their Seatbelt profile. +# macOS Seatbelt +You are running under macos seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to macOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to macOS Seatbelt, and how the user may need to adjust their Seatbelt profile. `; } else if (isGenericSandbox) { return ` diff --git a/packages/core/src/services/ideContext.ts b/packages/core/src/services/ideContext.ts index 349bff5935..f8a50f125a 100644 --- a/packages/core/src/services/ideContext.ts +++ b/packages/core/src/services/ideContext.ts @@ -86,7 +86,7 @@ export function createIdeContextStore() { /** * Retrieves the current active file context. - * @returns The `OpenFiles` object if a file is active, otherwise `undefined`. + * @returns The `OpenFiles` object if a file is active; otherwise, `undefined`. */ function getOpenFilesContext(): OpenFiles | undefined { return openFilesContext; diff --git a/packages/core/src/tools/edit.ts b/packages/core/src/tools/edit.ts index 87a2ea44bd..fd936611ee 100644 --- a/packages/core/src/tools/edit.ts +++ b/packages/core/src/tools/edit.ts @@ -209,7 +209,7 @@ Expectation for required parameters: // Creating a new file isNewFile = true; } else if (!fileExists) { - // Trying to edit a non-existent file (and old_string is not empty) + // Trying to edit a nonexistent file (and old_string is not empty) error = { display: `File not found. Cannot apply edit. Use an empty old_string to create a new file.`, raw: `File not found: ${params.file_path}`, @@ -239,12 +239,12 @@ Expectation for required parameters: raw: `Failed to edit, 0 occurrences found for old_string in ${params.file_path}. No edits made. The exact text in old_string was not found. Ensure you're not escaping content incorrectly and check whitespace, indentation, and context. Use ${ReadFileTool.Name} tool to verify.`, }; } else if (occurrences !== expectedReplacements) { - const occurenceTerm = + const occurrenceTerm = expectedReplacements === 1 ? 'occurrence' : 'occurrences'; error = { - display: `Failed to edit, expected ${expectedReplacements} ${occurenceTerm} but found ${occurrences}.`, - raw: `Failed to edit, Expected ${expectedReplacements} ${occurenceTerm} but found ${occurrences} for old_string in file: ${params.file_path}`, + display: `Failed to edit, expected ${expectedReplacements} ${occurrenceTerm} but found ${occurrences}.`, + raw: `Failed to edit, Expected ${expectedReplacements} ${occurrenceTerm} but found ${occurrences} for old_string in file: ${params.file_path}`, }; } else if (finalOldString === finalNewString) { error = { diff --git a/packages/core/src/tools/grep.test.ts b/packages/core/src/tools/grep.test.ts index 2e018cce2d..09dec35f1a 100644 --- a/packages/core/src/tools/grep.test.ts +++ b/packages/core/src/tools/grep.test.ts @@ -17,7 +17,7 @@ vi.mock('child_process', () => ({ on: (event: string, cb: (...args: unknown[]) => void) => { if (event === 'error' || event === 'close') { // Simulate command not found or error for git grep and system grep - // to force fallback to JS implementation. + // to force it to fall back to JS implementation. setTimeout(() => cb(1), 0); // cb(1) for error/close } }, diff --git a/packages/core/src/tools/read-many-files.test.ts b/packages/core/src/tools/read-many-files.test.ts index adad6efc57..641aa70520 100644 --- a/packages/core/src/tools/read-many-files.test.ts +++ b/packages/core/src/tools/read-many-files.test.ts @@ -272,7 +272,7 @@ describe('ReadManyFilesTool', () => { ); }); - it('should handle non-existent specific files gracefully', async () => { + it('should handle nonexistent specific files gracefully', async () => { const params = { paths: ['nonexistent-file.txt'] }; const result = await tool.execute(params, new AbortController().signal); expect(result.llmContent).toEqual([ diff --git a/packages/core/src/utils/editCorrector.test.ts b/packages/core/src/utils/editCorrector.test.ts index cf9008ef81..cd5883125c 100644 --- a/packages/core/src/utils/editCorrector.test.ts +++ b/packages/core/src/utils/editCorrector.test.ts @@ -81,7 +81,7 @@ describe('editCorrector', () => { it('should correctly count occurrences when substring is longer', () => { expect(countOccurrences('abc', 'abcdef')).toBe(0); }); - it('should be case sensitive', () => { + it('should be case-sensitive', () => { expect(countOccurrences('abcABC', 'a')).toBe(1); expect(countOccurrences('abcABC', 'A')).toBe(1); }); diff --git a/packages/core/src/utils/editor.test.ts b/packages/core/src/utils/editor.test.ts index 86274be2da..a86d6f59de 100644 --- a/packages/core/src/utils/editor.test.ts +++ b/packages/core/src/utils/editor.test.ts @@ -202,7 +202,7 @@ describe('editor utils', () => { }); } - it(`should fallback to last command "${commands[commands.length - 1]}" when none exist on non-windows`, () => { + it(`should fall back to last command "${commands[commands.length - 1]}" when none exist on non-windows`, () => { Object.defineProperty(process, 'platform', { value: 'linux' }); (execSync as Mock).mockImplementation(() => { throw new Error(); // all commands not found @@ -247,7 +247,7 @@ describe('editor utils', () => { }); } - it(`should fallback to last command "${win32Commands[win32Commands.length - 1]}" when none exist on windows`, () => { + it(`should fall back to last command "${win32Commands[win32Commands.length - 1]}" when none exist on windows`, () => { Object.defineProperty(process, 'platform', { value: 'win32' }); (execSync as Mock).mockImplementation(() => { throw new Error(); // all commands not found diff --git a/packages/core/src/utils/fileUtils.test.ts b/packages/core/src/utils/fileUtils.test.ts index 34aff79b36..b8e75561d1 100644 --- a/packages/core/src/utils/fileUtils.test.ts +++ b/packages/core/src/utils/fileUtils.test.ts @@ -42,7 +42,7 @@ describe('fileUtils', () => { let testImageFilePath: string; let testPdfFilePath: string; let testBinaryFilePath: string; - let nonExistentFilePath: string; + let nonexistentFilePath: string; let directoryPath: string; beforeEach(() => { @@ -57,7 +57,7 @@ describe('fileUtils', () => { testImageFilePath = path.join(tempRootDir, 'image.png'); testPdfFilePath = path.join(tempRootDir, 'document.pdf'); testBinaryFilePath = path.join(tempRootDir, 'app.exe'); - nonExistentFilePath = path.join(tempRootDir, 'notfound.txt'); + nonexistentFilePath = path.join(tempRootDir, 'nonexistent.txt'); directoryPath = path.join(tempRootDir, 'subdir'); actualNodeFs.mkdirSync(directoryPath, { recursive: true }); // Ensure subdir exists @@ -284,7 +284,7 @@ describe('fileUtils', () => { it('should handle file not found', async () => { const result = await processSingleFileContent( - nonExistentFilePath, + nonexistentFilePath, tempRootDir, ); expect(result.error).toContain('File not found'); diff --git a/packages/core/src/utils/fileUtils.ts b/packages/core/src/utils/fileUtils.ts index 1489c4ee83..6b5ce42c1b 100644 --- a/packages/core/src/utils/fileUtils.ts +++ b/packages/core/src/utils/fileUtils.ts @@ -185,7 +185,7 @@ export async function detectFileType( return 'binary'; } - // Fallback to content-based check if mime type wasn't conclusive for image/pdf + // Fall back to content-based check if mime type wasn't conclusive for image/pdf // and it's not a known binary extension. if (await isBinaryFile(filePath)) { return 'binary'; diff --git a/packages/core/src/utils/getFolderStructure.test.ts b/packages/core/src/utils/getFolderStructure.test.ts index b635474533..b2da4aab7e 100644 --- a/packages/core/src/utils/getFolderStructure.test.ts +++ b/packages/core/src/utils/getFolderStructure.test.ts @@ -245,7 +245,7 @@ Showing up to 1 items (files + folders). Folders or files indicated with ... con expect(structure.trim()).toBe(expectedRevisedMax1); }); - it('should handle non-existent directory', async () => { + it('should handle nonexistent directory', async () => { // Temporarily make fsPromises.readdir throw ENOENT for this specific path const originalReaddir = fsPromises.readdir; (fsPromises.readdir as Mock).mockImplementation( diff --git a/packages/core/src/utils/paths.ts b/packages/core/src/utils/paths.ts index 16adbee4ef..3382c5889e 100644 --- a/packages/core/src/utils/paths.ts +++ b/packages/core/src/utils/paths.ts @@ -44,7 +44,7 @@ export function shortenPath(filePath: string, maxLen: number = 35): string { // Handle cases with no segments after root (e.g., "/", "C:\") or only one segment if (segments.length <= 1) { - // Fallback to simple start/end truncation for very short paths or single segments + // Fall back to simple start/end truncation for very short paths or single segments const keepLen = Math.floor((maxLen - 3) / 2); // Ensure keepLen is not negative if maxLen is very small if (keepLen <= 0) { diff --git a/packages/core/src/utils/retry.ts b/packages/core/src/utils/retry.ts index bf4532bc62..b29bf7dfaf 100644 --- a/packages/core/src/utils/retry.ts +++ b/packages/core/src/utils/retry.ts @@ -196,7 +196,7 @@ export async function retryWithBackoff( // Reset currentDelay for next potential non-429 error, or if Retry-After is not present next time currentDelay = initialDelayMs; } else { - // Fallback to exponential backoff with jitter + // Fall back to exponential backoff with jitter logRetryAttempt(attempt, error, errorStatus); // Add jitter: +/- 30% of currentDelay const jitter = currentDelay * 0.3 * (Math.random() * 2 - 1);