From 44a09cf227971d94aafe1ae9f9dabb79a417b2bb Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 10 Feb 2026 03:23:12 +0000 Subject: [PATCH 1/6] test: add model-specific snapshots for coreTools --- .../coreToolsModelSnapshots.test.ts.snap | 399 ++++++++++++++++++ .../coreToolsModelSnapshots.test.ts | 42 ++ 2 files changed, 441 insertions(+) create mode 100644 packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap create mode 100644 packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts diff --git a/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap new file mode 100644 index 00000000000..3420f3a6bff --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap @@ -0,0 +1,399 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: glob 1`] = ` +{ + "description": "Efficiently finds files matching specific glob patterns (e.g., \`src/**/*.ts\`, \`**/*.md\`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", + "name": "glob", + "parametersJsonSchema": { + "properties": { + "case_sensitive": { + "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", + "type": "boolean", + }, + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", + "type": "string", + }, + "pattern": { + "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", + "type": "string", + }, + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", + "type": "boolean", + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", + "type": "boolean", + }, + }, + "required": [ + "pattern", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: grep_search 1`] = ` +{ + "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", + "name": "grep_search", + "parametersJsonSchema": { + "properties": { + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", + "type": "string", + }, + "include": { + "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", + "type": "string", + }, + "pattern": { + "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", + "type": "string", + }, + }, + "required": [ + "pattern", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: list_directory 1`] = ` +{ + "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", + "name": "list_directory", + "parametersJsonSchema": { + "properties": { + "dir_path": { + "description": "The path to the directory to list", + "type": "string", + }, + "file_filtering_options": { + "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", + "properties": { + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", + "type": "boolean", + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", + "type": "boolean", + }, + }, + "type": "object", + }, + "ignore": { + "description": "List of glob patterns to ignore", + "items": { + "type": "string", + }, + "type": "array", + }, + }, + "required": [ + "dir_path", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: read_file 1`] = ` +{ + "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", + "name": "read_file", + "parametersJsonSchema": { + "properties": { + "file_path": { + "description": "The path to the file to read.", + "type": "string", + }, + "limit": { + "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", + "type": "number", + }, + "offset": { + "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", + "type": "number", + }, + }, + "required": [ + "file_path", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: run_shell_command 1`] = ` +{ + "description": "This tool executes a given shell command as \`bash -c \`. To run a command in the background, set the \`is_background\` parameter to true. Do NOT use \`&\` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`. + + Efficiency Guidelines: + - Quiet Flags: Always prefer silent or quiet flags (e.g., \`npm install --silent\`, \`git --no-pager\`) to reduce output volume while still capturing necessary information. + - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use \`git --no-pager\`, \`systemctl --no-pager\`, or set \`PAGER=cat\`). + + The following information is returned: + + Output: Combined stdout/stderr. Can be \`(empty)\` or partial on error and for any unwaited background processes. + Exit Code: Only included if non-zero (command failed). + Error: Only included if a process-level error occurred (e.g., spawn failure). + Signal: Only included if process was terminated by a signal. + Background PIDs: Only included if background processes were started. + Process Group PGID: Only included if available.", + "name": "run_shell_command", + "parametersJsonSchema": { + "properties": { + "command": { + "description": "Exact bash command to execute as \`bash -c \`", + "type": "string", + }, + "description": { + "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.", + "type": "string", + }, + "dir_path": { + "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.", + "type": "string", + }, + "is_background": { + "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background.", + "type": "boolean", + }, + }, + "required": [ + "command", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: write_file 1`] = ` +{ + "description": "Writes content to a specified file in the local filesystem. + + The user has the ability to modify \`content\`. If modified, this will be stated in the response.", + "name": "write_file", + "parametersJsonSchema": { + "properties": { + "content": { + "description": "The content to write to the file.", + "type": "string", + }, + "file_path": { + "description": "The path to the file to write to.", + "type": "string", + }, + }, + "required": [ + "file_path", + "content", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: glob 1`] = ` +{ + "description": "Efficiently finds files matching specific glob patterns (e.g., \`src/**/*.ts\`, \`**/*.md\`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", + "name": "glob", + "parametersJsonSchema": { + "properties": { + "case_sensitive": { + "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", + "type": "boolean", + }, + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", + "type": "string", + }, + "pattern": { + "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", + "type": "string", + }, + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", + "type": "boolean", + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", + "type": "boolean", + }, + }, + "required": [ + "pattern", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: grep_search 1`] = ` +{ + "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", + "name": "grep_search", + "parametersJsonSchema": { + "properties": { + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", + "type": "string", + }, + "include": { + "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", + "type": "string", + }, + "pattern": { + "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", + "type": "string", + }, + }, + "required": [ + "pattern", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: list_directory 1`] = ` +{ + "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", + "name": "list_directory", + "parametersJsonSchema": { + "properties": { + "dir_path": { + "description": "The path to the directory to list", + "type": "string", + }, + "file_filtering_options": { + "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", + "properties": { + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", + "type": "boolean", + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", + "type": "boolean", + }, + }, + "type": "object", + }, + "ignore": { + "description": "List of glob patterns to ignore", + "items": { + "type": "string", + }, + "type": "array", + }, + }, + "required": [ + "dir_path", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: read_file 1`] = ` +{ + "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", + "name": "read_file", + "parametersJsonSchema": { + "properties": { + "file_path": { + "description": "The path to the file to read.", + "type": "string", + }, + "limit": { + "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", + "type": "number", + }, + "offset": { + "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", + "type": "number", + }, + }, + "required": [ + "file_path", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: run_shell_command 1`] = ` +{ + "description": "This tool executes a given shell command as \`bash -c \`. To run a command in the background, set the \`is_background\` parameter to true. Do NOT use \`&\` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`. + + Efficiency Guidelines: + - Quiet Flags: Always prefer silent or quiet flags (e.g., \`npm install --silent\`, \`git --no-pager\`) to reduce output volume while still capturing necessary information. + - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use \`git --no-pager\`, \`systemctl --no-pager\`, or set \`PAGER=cat\`). + + The following information is returned: + + Output: Combined stdout/stderr. Can be \`(empty)\` or partial on error and for any unwaited background processes. + Exit Code: Only included if non-zero (command failed). + Error: Only included if a process-level error occurred (e.g., spawn failure). + Signal: Only included if process was terminated by a signal. + Background PIDs: Only included if background processes were started. + Process Group PGID: Only included if available.", + "name": "run_shell_command", + "parametersJsonSchema": { + "properties": { + "command": { + "description": "Exact bash command to execute as \`bash -c \`", + "type": "string", + }, + "description": { + "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.", + "type": "string", + }, + "dir_path": { + "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.", + "type": "string", + }, + "is_background": { + "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background.", + "type": "boolean", + }, + }, + "required": [ + "command", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: write_file 1`] = ` +{ + "description": "Writes content to a specified file in the local filesystem. + + The user has the ability to modify \`content\`. If modified, this will be stated in the response.", + "name": "write_file", + "parametersJsonSchema": { + "properties": { + "content": { + "description": "The content to write to the file.", + "type": "string", + }, + "file_path": { + "description": "The path to the file to write to.", + "type": "string", + }, + }, + "required": [ + "file_path", + "content", + ], + "type": "object", + }, +} +`; diff --git a/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts b/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts new file mode 100644 index 00000000000..f0b7c39aedd --- /dev/null +++ b/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { describe, it, expect } from 'vitest'; +import { resolveToolDeclaration } from './resolver.js'; +import { + READ_FILE_DEFINITION, + WRITE_FILE_DEFINITION, + GREP_DEFINITION, + GLOB_DEFINITION, + LS_DEFINITION, + getShellDefinition, +} from './coreTools.js'; + +describe('coreTools snapshots for specific models', () => { + const modelIds = ['gemini-2.5-pro', 'gemini-3-pro-preview']; + const tools = [ + { name: 'read_file', definition: READ_FILE_DEFINITION }, + { name: 'write_file', definition: WRITE_FILE_DEFINITION }, + { name: 'grep_search', definition: GREP_DEFINITION }, + { name: 'glob', definition: GLOB_DEFINITION }, + { name: 'list_directory', definition: LS_DEFINITION }, + { + name: 'run_shell_command', + definition: getShellDefinition(true, true), + }, + ]; + + for (const modelId of modelIds) { + describe(`Model: ${modelId}`, () => { + for (const tool of tools) { + it(`snapshot for tool: ${tool.name}`, () => { + const resolved = resolveToolDeclaration(tool.definition, modelId); + expect(resolved).toMatchSnapshot(); + }); + } + }); + } +}); From 20dd8320f793c93ed9de85077a50e105d62985b4 Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 10 Feb 2026 03:30:17 +0000 Subject: [PATCH 2/6] test: reorganize coreTools snapshots into directory structure by model --- .../coreToolsModelSnapshots.test.ts.snap | 399 ------------------ .../__snapshots__/gemini-2.5-pro/glob.json | 30 ++ .../gemini-2.5-pro/grep_search.json | 22 + .../gemini-2.5-pro/list_directory.json | 35 ++ .../gemini-2.5-pro/read_file.json | 22 + .../gemini-2.5-pro/run_shell_command.json | 26 ++ .../gemini-2.5-pro/write_file.json | 18 + .../gemini-3-pro-preview/glob.json | 30 ++ .../gemini-3-pro-preview/grep_search.json | 22 + .../gemini-3-pro-preview/list_directory.json | 35 ++ .../gemini-3-pro-preview/read_file.json | 22 + .../run_shell_command.json | 26 ++ .../gemini-3-pro-preview/write_file.json | 18 + .../coreToolsModelSnapshots.test.ts | 13 +- 14 files changed, 317 insertions(+), 401 deletions(-) delete mode 100644 packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json create mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json diff --git a/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap deleted file mode 100644 index 3420f3a6bff..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap +++ /dev/null @@ -1,399 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: glob 1`] = ` -{ - "description": "Efficiently finds files matching specific glob patterns (e.g., \`src/**/*.ts\`, \`**/*.md\`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", - "name": "glob", - "parametersJsonSchema": { - "properties": { - "case_sensitive": { - "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", - "type": "boolean", - }, - "dir_path": { - "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", - "type": "string", - }, - "pattern": { - "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", - "type": "string", - }, - "respect_gemini_ignore": { - "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", - "type": "boolean", - }, - "respect_git_ignore": { - "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", - "type": "boolean", - }, - }, - "required": [ - "pattern", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: grep_search 1`] = ` -{ - "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", - "name": "grep_search", - "parametersJsonSchema": { - "properties": { - "dir_path": { - "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", - "type": "string", - }, - "include": { - "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", - "type": "string", - }, - "pattern": { - "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", - "type": "string", - }, - }, - "required": [ - "pattern", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: list_directory 1`] = ` -{ - "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", - "name": "list_directory", - "parametersJsonSchema": { - "properties": { - "dir_path": { - "description": "The path to the directory to list", - "type": "string", - }, - "file_filtering_options": { - "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", - "properties": { - "respect_gemini_ignore": { - "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", - "type": "boolean", - }, - "respect_git_ignore": { - "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", - "type": "boolean", - }, - }, - "type": "object", - }, - "ignore": { - "description": "List of glob patterns to ignore", - "items": { - "type": "string", - }, - "type": "array", - }, - }, - "required": [ - "dir_path", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: read_file 1`] = ` -{ - "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", - "name": "read_file", - "parametersJsonSchema": { - "properties": { - "file_path": { - "description": "The path to the file to read.", - "type": "string", - }, - "limit": { - "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", - "type": "number", - }, - "offset": { - "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", - "type": "number", - }, - }, - "required": [ - "file_path", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: run_shell_command 1`] = ` -{ - "description": "This tool executes a given shell command as \`bash -c \`. To run a command in the background, set the \`is_background\` parameter to true. Do NOT use \`&\` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`. - - Efficiency Guidelines: - - Quiet Flags: Always prefer silent or quiet flags (e.g., \`npm install --silent\`, \`git --no-pager\`) to reduce output volume while still capturing necessary information. - - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use \`git --no-pager\`, \`systemctl --no-pager\`, or set \`PAGER=cat\`). - - The following information is returned: - - Output: Combined stdout/stderr. Can be \`(empty)\` or partial on error and for any unwaited background processes. - Exit Code: Only included if non-zero (command failed). - Error: Only included if a process-level error occurred (e.g., spawn failure). - Signal: Only included if process was terminated by a signal. - Background PIDs: Only included if background processes were started. - Process Group PGID: Only included if available.", - "name": "run_shell_command", - "parametersJsonSchema": { - "properties": { - "command": { - "description": "Exact bash command to execute as \`bash -c \`", - "type": "string", - }, - "description": { - "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.", - "type": "string", - }, - "dir_path": { - "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.", - "type": "string", - }, - "is_background": { - "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background.", - "type": "boolean", - }, - }, - "required": [ - "command", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: write_file 1`] = ` -{ - "description": "Writes content to a specified file in the local filesystem. - - The user has the ability to modify \`content\`. If modified, this will be stated in the response.", - "name": "write_file", - "parametersJsonSchema": { - "properties": { - "content": { - "description": "The content to write to the file.", - "type": "string", - }, - "file_path": { - "description": "The path to the file to write to.", - "type": "string", - }, - }, - "required": [ - "file_path", - "content", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: glob 1`] = ` -{ - "description": "Efficiently finds files matching specific glob patterns (e.g., \`src/**/*.ts\`, \`**/*.md\`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", - "name": "glob", - "parametersJsonSchema": { - "properties": { - "case_sensitive": { - "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", - "type": "boolean", - }, - "dir_path": { - "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", - "type": "string", - }, - "pattern": { - "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", - "type": "string", - }, - "respect_gemini_ignore": { - "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", - "type": "boolean", - }, - "respect_git_ignore": { - "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", - "type": "boolean", - }, - }, - "required": [ - "pattern", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: grep_search 1`] = ` -{ - "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", - "name": "grep_search", - "parametersJsonSchema": { - "properties": { - "dir_path": { - "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", - "type": "string", - }, - "include": { - "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", - "type": "string", - }, - "pattern": { - "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", - "type": "string", - }, - }, - "required": [ - "pattern", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: list_directory 1`] = ` -{ - "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", - "name": "list_directory", - "parametersJsonSchema": { - "properties": { - "dir_path": { - "description": "The path to the directory to list", - "type": "string", - }, - "file_filtering_options": { - "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", - "properties": { - "respect_gemini_ignore": { - "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", - "type": "boolean", - }, - "respect_git_ignore": { - "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", - "type": "boolean", - }, - }, - "type": "object", - }, - "ignore": { - "description": "List of glob patterns to ignore", - "items": { - "type": "string", - }, - "type": "array", - }, - }, - "required": [ - "dir_path", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: read_file 1`] = ` -{ - "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", - "name": "read_file", - "parametersJsonSchema": { - "properties": { - "file_path": { - "description": "The path to the file to read.", - "type": "string", - }, - "limit": { - "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", - "type": "number", - }, - "offset": { - "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", - "type": "number", - }, - }, - "required": [ - "file_path", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: run_shell_command 1`] = ` -{ - "description": "This tool executes a given shell command as \`bash -c \`. To run a command in the background, set the \`is_background\` parameter to true. Do NOT use \`&\` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`. - - Efficiency Guidelines: - - Quiet Flags: Always prefer silent or quiet flags (e.g., \`npm install --silent\`, \`git --no-pager\`) to reduce output volume while still capturing necessary information. - - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use \`git --no-pager\`, \`systemctl --no-pager\`, or set \`PAGER=cat\`). - - The following information is returned: - - Output: Combined stdout/stderr. Can be \`(empty)\` or partial on error and for any unwaited background processes. - Exit Code: Only included if non-zero (command failed). - Error: Only included if a process-level error occurred (e.g., spawn failure). - Signal: Only included if process was terminated by a signal. - Background PIDs: Only included if background processes were started. - Process Group PGID: Only included if available.", - "name": "run_shell_command", - "parametersJsonSchema": { - "properties": { - "command": { - "description": "Exact bash command to execute as \`bash -c \`", - "type": "string", - }, - "description": { - "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.", - "type": "string", - }, - "dir_path": { - "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.", - "type": "string", - }, - "is_background": { - "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background.", - "type": "boolean", - }, - }, - "required": [ - "command", - ], - "type": "object", - }, -} -`; - -exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: write_file 1`] = ` -{ - "description": "Writes content to a specified file in the local filesystem. - - The user has the ability to modify \`content\`. If modified, this will be stated in the response.", - "name": "write_file", - "parametersJsonSchema": { - "properties": { - "content": { - "description": "The content to write to the file.", - "type": "string", - }, - "file_path": { - "description": "The path to the file to write to.", - "type": "string", - }, - }, - "required": [ - "file_path", - "content", - ], - "type": "object", - }, -} -`; diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json new file mode 100644 index 00000000000..abc2acd4783 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json @@ -0,0 +1,30 @@ +{ + "name": "glob", + "description": "Efficiently finds files matching specific glob patterns (e.g., `src/**/*.ts`, `**/*.md`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "pattern": { + "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", + "type": "string" + }, + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", + "type": "string" + }, + "case_sensitive": { + "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", + "type": "boolean" + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", + "type": "boolean" + }, + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", + "type": "boolean" + } + }, + "required": ["pattern"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json new file mode 100644 index 00000000000..13b318df308 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json @@ -0,0 +1,22 @@ +{ + "name": "grep_search", + "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "pattern": { + "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", + "type": "string" + }, + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", + "type": "string" + }, + "include": { + "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", + "type": "string" + } + }, + "required": ["pattern"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json new file mode 100644 index 00000000000..27585e380af --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json @@ -0,0 +1,35 @@ +{ + "name": "list_directory", + "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "dir_path": { + "description": "The path to the directory to list", + "type": "string" + }, + "ignore": { + "description": "List of glob patterns to ignore", + "items": { + "type": "string" + }, + "type": "array" + }, + "file_filtering_options": { + "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", + "type": "object", + "properties": { + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", + "type": "boolean" + }, + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", + "type": "boolean" + } + } + } + }, + "required": ["dir_path"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json new file mode 100644 index 00000000000..d47baf824c0 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json @@ -0,0 +1,22 @@ +{ + "name": "read_file", + "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "file_path": { + "description": "The path to the file to read.", + "type": "string" + }, + "offset": { + "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", + "type": "number" + }, + "limit": { + "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", + "type": "number" + } + }, + "required": ["file_path"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json new file mode 100644 index 00000000000..1e0b6f279a2 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json @@ -0,0 +1,26 @@ +{ + "name": "run_shell_command", + "description": "This tool executes a given shell command as `bash -c `. To run a command in the background, set the `is_background` parameter to true. Do NOT use `&` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as `kill -- -PGID` or signaled as `kill -s SIGNAL -- -PGID`.\n\n Efficiency Guidelines:\n - Quiet Flags: Always prefer silent or quiet flags (e.g., `npm install --silent`, `git --no-pager`) to reduce output volume while still capturing necessary information.\n - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use `git --no-pager`, `systemctl --no-pager`, or set `PAGER=cat`).\n\n The following information is returned:\n\n Output: Combined stdout/stderr. Can be `(empty)` or partial on error and for any unwaited background processes.\n Exit Code: Only included if non-zero (command failed).\n Error: Only included if a process-level error occurred (e.g., spawn failure).\n Signal: Only included if process was terminated by a signal.\n Background PIDs: Only included if background processes were started.\n Process Group PGID: Only included if available.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "Exact bash command to execute as `bash -c `" + }, + "description": { + "type": "string", + "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks." + }, + "dir_path": { + "type": "string", + "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist." + }, + "is_background": { + "type": "boolean", + "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background." + } + }, + "required": ["command"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json new file mode 100644 index 00000000000..3cff410edd2 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json @@ -0,0 +1,18 @@ +{ + "name": "write_file", + "description": "Writes content to a specified file in the local filesystem.\n\n The user has the ability to modify `content`. If modified, this will be stated in the response.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "file_path": { + "description": "The path to the file to write to.", + "type": "string" + }, + "content": { + "description": "The content to write to the file.", + "type": "string" + } + }, + "required": ["file_path", "content"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json new file mode 100644 index 00000000000..abc2acd4783 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json @@ -0,0 +1,30 @@ +{ + "name": "glob", + "description": "Efficiently finds files matching specific glob patterns (e.g., `src/**/*.ts`, `**/*.md`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "pattern": { + "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", + "type": "string" + }, + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", + "type": "string" + }, + "case_sensitive": { + "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", + "type": "boolean" + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", + "type": "boolean" + }, + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", + "type": "boolean" + } + }, + "required": ["pattern"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json new file mode 100644 index 00000000000..13b318df308 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json @@ -0,0 +1,22 @@ +{ + "name": "grep_search", + "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "pattern": { + "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", + "type": "string" + }, + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", + "type": "string" + }, + "include": { + "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", + "type": "string" + } + }, + "required": ["pattern"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json new file mode 100644 index 00000000000..27585e380af --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json @@ -0,0 +1,35 @@ +{ + "name": "list_directory", + "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "dir_path": { + "description": "The path to the directory to list", + "type": "string" + }, + "ignore": { + "description": "List of glob patterns to ignore", + "items": { + "type": "string" + }, + "type": "array" + }, + "file_filtering_options": { + "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", + "type": "object", + "properties": { + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", + "type": "boolean" + }, + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", + "type": "boolean" + } + } + } + }, + "required": ["dir_path"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json new file mode 100644 index 00000000000..d47baf824c0 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json @@ -0,0 +1,22 @@ +{ + "name": "read_file", + "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "file_path": { + "description": "The path to the file to read.", + "type": "string" + }, + "offset": { + "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", + "type": "number" + }, + "limit": { + "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", + "type": "number" + } + }, + "required": ["file_path"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json new file mode 100644 index 00000000000..1e0b6f279a2 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json @@ -0,0 +1,26 @@ +{ + "name": "run_shell_command", + "description": "This tool executes a given shell command as `bash -c `. To run a command in the background, set the `is_background` parameter to true. Do NOT use `&` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as `kill -- -PGID` or signaled as `kill -s SIGNAL -- -PGID`.\n\n Efficiency Guidelines:\n - Quiet Flags: Always prefer silent or quiet flags (e.g., `npm install --silent`, `git --no-pager`) to reduce output volume while still capturing necessary information.\n - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use `git --no-pager`, `systemctl --no-pager`, or set `PAGER=cat`).\n\n The following information is returned:\n\n Output: Combined stdout/stderr. Can be `(empty)` or partial on error and for any unwaited background processes.\n Exit Code: Only included if non-zero (command failed).\n Error: Only included if a process-level error occurred (e.g., spawn failure).\n Signal: Only included if process was terminated by a signal.\n Background PIDs: Only included if background processes were started.\n Process Group PGID: Only included if available.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "Exact bash command to execute as `bash -c `" + }, + "description": { + "type": "string", + "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks." + }, + "dir_path": { + "type": "string", + "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist." + }, + "is_background": { + "type": "boolean", + "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background." + } + }, + "required": ["command"] + } +} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json new file mode 100644 index 00000000000..3cff410edd2 --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json @@ -0,0 +1,18 @@ +{ + "name": "write_file", + "description": "Writes content to a specified file in the local filesystem.\n\n The user has the ability to modify `content`. If modified, this will be stated in the response.", + "parametersJsonSchema": { + "type": "object", + "properties": { + "file_path": { + "description": "The path to the file to write to.", + "type": "string" + }, + "content": { + "description": "The content to write to the file.", + "type": "string" + } + }, + "required": ["file_path", "content"] + } +} diff --git a/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts b/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts index f0b7c39aedd..b3b7d5efc16 100644 --- a/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts +++ b/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts @@ -5,6 +5,7 @@ */ import { describe, it, expect } from 'vitest'; +import path from 'node:path'; import { resolveToolDeclaration } from './resolver.js'; import { READ_FILE_DEFINITION, @@ -32,9 +33,17 @@ describe('coreTools snapshots for specific models', () => { for (const modelId of modelIds) { describe(`Model: ${modelId}`, () => { for (const tool of tools) { - it(`snapshot for tool: ${tool.name}`, () => { + it(`snapshot for tool: ${tool.name}`, async () => { const resolved = resolveToolDeclaration(tool.definition, modelId); - expect(resolved).toMatchSnapshot(); + // Create a directory structure: __snapshots__//.json + const snapshotPath = path.join( + '__snapshots__', + modelId, + `${tool.name}.json`, + ); + await expect(JSON.stringify(resolved, null, 2)).toMatchFileSnapshot( + snapshotPath, + ); }); } }); From 6c783391201833b518399db23c22e9fc20e078b7 Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 10 Feb 2026 03:47:27 +0000 Subject: [PATCH 3/6] test: mock os.platform for deterministic coreTools snapshots --- .../definitions/coreToolsModelSnapshots.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts b/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts index b3b7d5efc16..f2ecd2e11cc 100644 --- a/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts +++ b/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts @@ -4,9 +4,19 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { describe, it, expect } from 'vitest'; +import { describe, it, expect, vi } from 'vitest'; import path from 'node:path'; import { resolveToolDeclaration } from './resolver.js'; + +// Mock node:os BEFORE importing coreTools to ensure it uses the mock +vi.mock('node:os', async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + platform: () => 'linux', + }; +}); + import { READ_FILE_DEFINITION, WRITE_FILE_DEFINITION, From 88d5f10deb1d0602763636428bacec31fa5eeae3 Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 10 Feb 2026 13:57:25 +0000 Subject: [PATCH 4/6] test: multi-line required arrays in coreTools snapshots --- .../tools/definitions/__snapshots__/gemini-2.5-pro/glob.json | 4 +++- .../__snapshots__/gemini-2.5-pro/grep_search.json | 4 +++- .../__snapshots__/gemini-2.5-pro/list_directory.json | 4 +++- .../definitions/__snapshots__/gemini-2.5-pro/read_file.json | 4 +++- .../__snapshots__/gemini-2.5-pro/run_shell_command.json | 4 +++- .../definitions/__snapshots__/gemini-2.5-pro/write_file.json | 5 ++++- .../definitions/__snapshots__/gemini-3-pro-preview/glob.json | 4 +++- .../__snapshots__/gemini-3-pro-preview/grep_search.json | 4 +++- .../__snapshots__/gemini-3-pro-preview/list_directory.json | 4 +++- .../__snapshots__/gemini-3-pro-preview/read_file.json | 4 +++- .../gemini-3-pro-preview/run_shell_command.json | 4 +++- .../__snapshots__/gemini-3-pro-preview/write_file.json | 5 ++++- 12 files changed, 38 insertions(+), 12 deletions(-) diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json index abc2acd4783..4c5e47bed86 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json @@ -25,6 +25,8 @@ "type": "boolean" } }, - "required": ["pattern"] + "required": [ + "pattern" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json index 13b318df308..d5a2a1d1165 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json @@ -17,6 +17,8 @@ "type": "string" } }, - "required": ["pattern"] + "required": [ + "pattern" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json index 27585e380af..1b0f9393559 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json @@ -30,6 +30,8 @@ } } }, - "required": ["dir_path"] + "required": [ + "dir_path" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json index d47baf824c0..7404b21835c 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json @@ -17,6 +17,8 @@ "type": "number" } }, - "required": ["file_path"] + "required": [ + "file_path" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json index 1e0b6f279a2..f532cdfab81 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json @@ -21,6 +21,8 @@ "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background." } }, - "required": ["command"] + "required": [ + "command" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json index 3cff410edd2..aad254a0719 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json @@ -13,6 +13,9 @@ "type": "string" } }, - "required": ["file_path", "content"] + "required": [ + "file_path", + "content" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json index abc2acd4783..4c5e47bed86 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json @@ -25,6 +25,8 @@ "type": "boolean" } }, - "required": ["pattern"] + "required": [ + "pattern" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json index 13b318df308..d5a2a1d1165 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json @@ -17,6 +17,8 @@ "type": "string" } }, - "required": ["pattern"] + "required": [ + "pattern" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json index 27585e380af..1b0f9393559 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json @@ -30,6 +30,8 @@ } } }, - "required": ["dir_path"] + "required": [ + "dir_path" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json index d47baf824c0..7404b21835c 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json @@ -17,6 +17,8 @@ "type": "number" } }, - "required": ["file_path"] + "required": [ + "file_path" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json index 1e0b6f279a2..f532cdfab81 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json @@ -21,6 +21,8 @@ "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background." } }, - "required": ["command"] + "required": [ + "command" + ] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json index 3cff410edd2..aad254a0719 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json @@ -13,6 +13,9 @@ "type": "string" } }, - "required": ["file_path", "content"] + "required": [ + "file_path", + "content" + ] } } From c9c71ef1a171a4fb2f281670c05736a087fc2192 Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 10 Feb 2026 14:01:06 +0000 Subject: [PATCH 5/6] test: update coreTools snapshots with multi-line required arrays --- .../tools/definitions/__snapshots__/gemini-2.5-pro/glob.json | 4 +--- .../__snapshots__/gemini-2.5-pro/grep_search.json | 4 +--- .../__snapshots__/gemini-2.5-pro/list_directory.json | 4 +--- .../definitions/__snapshots__/gemini-2.5-pro/read_file.json | 4 +--- .../__snapshots__/gemini-2.5-pro/run_shell_command.json | 4 +--- .../definitions/__snapshots__/gemini-2.5-pro/write_file.json | 5 +---- .../definitions/__snapshots__/gemini-3-pro-preview/glob.json | 4 +--- .../__snapshots__/gemini-3-pro-preview/grep_search.json | 4 +--- .../__snapshots__/gemini-3-pro-preview/list_directory.json | 4 +--- .../__snapshots__/gemini-3-pro-preview/read_file.json | 4 +--- .../gemini-3-pro-preview/run_shell_command.json | 4 +--- .../__snapshots__/gemini-3-pro-preview/write_file.json | 5 +---- 12 files changed, 12 insertions(+), 38 deletions(-) diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json index 4c5e47bed86..abc2acd4783 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json @@ -25,8 +25,6 @@ "type": "boolean" } }, - "required": [ - "pattern" - ] + "required": ["pattern"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json index d5a2a1d1165..13b318df308 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json @@ -17,8 +17,6 @@ "type": "string" } }, - "required": [ - "pattern" - ] + "required": ["pattern"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json index 1b0f9393559..27585e380af 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json @@ -30,8 +30,6 @@ } } }, - "required": [ - "dir_path" - ] + "required": ["dir_path"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json index 7404b21835c..d47baf824c0 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json @@ -17,8 +17,6 @@ "type": "number" } }, - "required": [ - "file_path" - ] + "required": ["file_path"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json index f532cdfab81..1e0b6f279a2 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json @@ -21,8 +21,6 @@ "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background." } }, - "required": [ - "command" - ] + "required": ["command"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json index aad254a0719..3cff410edd2 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json @@ -13,9 +13,6 @@ "type": "string" } }, - "required": [ - "file_path", - "content" - ] + "required": ["file_path", "content"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json index 4c5e47bed86..abc2acd4783 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json @@ -25,8 +25,6 @@ "type": "boolean" } }, - "required": [ - "pattern" - ] + "required": ["pattern"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json index d5a2a1d1165..13b318df308 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json @@ -17,8 +17,6 @@ "type": "string" } }, - "required": [ - "pattern" - ] + "required": ["pattern"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json index 1b0f9393559..27585e380af 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json @@ -30,8 +30,6 @@ } } }, - "required": [ - "dir_path" - ] + "required": ["dir_path"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json index 7404b21835c..d47baf824c0 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json @@ -17,8 +17,6 @@ "type": "number" } }, - "required": [ - "file_path" - ] + "required": ["file_path"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json index f532cdfab81..1e0b6f279a2 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json @@ -21,8 +21,6 @@ "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background." } }, - "required": [ - "command" - ] + "required": ["command"] } } diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json index aad254a0719..3cff410edd2 100644 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json +++ b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json @@ -13,9 +13,6 @@ "type": "string" } }, - "required": [ - "file_path", - "content" - ] + "required": ["file_path", "content"] } } From ce8721bc8bc27e2a93c04d1dad77eed7cf6d73e9 Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 10 Feb 2026 14:19:31 +0000 Subject: [PATCH 6/6] test: migrate to standard Vitest snapshots for coreTools --- .../coreToolsModelSnapshots.test.ts.snap | 399 ++++++++++++++++++ .../__snapshots__/gemini-2.5-pro/glob.json | 30 -- .../gemini-2.5-pro/grep_search.json | 22 - .../gemini-2.5-pro/list_directory.json | 35 -- .../gemini-2.5-pro/read_file.json | 22 - .../gemini-2.5-pro/run_shell_command.json | 26 -- .../gemini-2.5-pro/write_file.json | 18 - .../gemini-3-pro-preview/glob.json | 30 -- .../gemini-3-pro-preview/grep_search.json | 22 - .../gemini-3-pro-preview/list_directory.json | 35 -- .../gemini-3-pro-preview/read_file.json | 22 - .../run_shell_command.json | 26 -- .../gemini-3-pro-preview/write_file.json | 18 - .../coreToolsModelSnapshots.test.ts | 38 +- 14 files changed, 424 insertions(+), 319 deletions(-) create mode 100644 packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json delete mode 100644 packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json diff --git a/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap new file mode 100644 index 00000000000..3420f3a6bff --- /dev/null +++ b/packages/core/src/tools/definitions/__snapshots__/coreToolsModelSnapshots.test.ts.snap @@ -0,0 +1,399 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: glob 1`] = ` +{ + "description": "Efficiently finds files matching specific glob patterns (e.g., \`src/**/*.ts\`, \`**/*.md\`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", + "name": "glob", + "parametersJsonSchema": { + "properties": { + "case_sensitive": { + "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", + "type": "boolean", + }, + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", + "type": "string", + }, + "pattern": { + "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", + "type": "string", + }, + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", + "type": "boolean", + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", + "type": "boolean", + }, + }, + "required": [ + "pattern", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: grep_search 1`] = ` +{ + "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", + "name": "grep_search", + "parametersJsonSchema": { + "properties": { + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", + "type": "string", + }, + "include": { + "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", + "type": "string", + }, + "pattern": { + "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", + "type": "string", + }, + }, + "required": [ + "pattern", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: list_directory 1`] = ` +{ + "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", + "name": "list_directory", + "parametersJsonSchema": { + "properties": { + "dir_path": { + "description": "The path to the directory to list", + "type": "string", + }, + "file_filtering_options": { + "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", + "properties": { + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", + "type": "boolean", + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", + "type": "boolean", + }, + }, + "type": "object", + }, + "ignore": { + "description": "List of glob patterns to ignore", + "items": { + "type": "string", + }, + "type": "array", + }, + }, + "required": [ + "dir_path", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: read_file 1`] = ` +{ + "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", + "name": "read_file", + "parametersJsonSchema": { + "properties": { + "file_path": { + "description": "The path to the file to read.", + "type": "string", + }, + "limit": { + "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", + "type": "number", + }, + "offset": { + "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", + "type": "number", + }, + }, + "required": [ + "file_path", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: run_shell_command 1`] = ` +{ + "description": "This tool executes a given shell command as \`bash -c \`. To run a command in the background, set the \`is_background\` parameter to true. Do NOT use \`&\` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`. + + Efficiency Guidelines: + - Quiet Flags: Always prefer silent or quiet flags (e.g., \`npm install --silent\`, \`git --no-pager\`) to reduce output volume while still capturing necessary information. + - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use \`git --no-pager\`, \`systemctl --no-pager\`, or set \`PAGER=cat\`). + + The following information is returned: + + Output: Combined stdout/stderr. Can be \`(empty)\` or partial on error and for any unwaited background processes. + Exit Code: Only included if non-zero (command failed). + Error: Only included if a process-level error occurred (e.g., spawn failure). + Signal: Only included if process was terminated by a signal. + Background PIDs: Only included if background processes were started. + Process Group PGID: Only included if available.", + "name": "run_shell_command", + "parametersJsonSchema": { + "properties": { + "command": { + "description": "Exact bash command to execute as \`bash -c \`", + "type": "string", + }, + "description": { + "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.", + "type": "string", + }, + "dir_path": { + "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.", + "type": "string", + }, + "is_background": { + "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background.", + "type": "boolean", + }, + }, + "required": [ + "command", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-2.5-pro > snapshot for tool: write_file 1`] = ` +{ + "description": "Writes content to a specified file in the local filesystem. + + The user has the ability to modify \`content\`. If modified, this will be stated in the response.", + "name": "write_file", + "parametersJsonSchema": { + "properties": { + "content": { + "description": "The content to write to the file.", + "type": "string", + }, + "file_path": { + "description": "The path to the file to write to.", + "type": "string", + }, + }, + "required": [ + "file_path", + "content", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: glob 1`] = ` +{ + "description": "Efficiently finds files matching specific glob patterns (e.g., \`src/**/*.ts\`, \`**/*.md\`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", + "name": "glob", + "parametersJsonSchema": { + "properties": { + "case_sensitive": { + "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", + "type": "boolean", + }, + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", + "type": "string", + }, + "pattern": { + "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", + "type": "string", + }, + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", + "type": "boolean", + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", + "type": "boolean", + }, + }, + "required": [ + "pattern", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: grep_search 1`] = ` +{ + "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", + "name": "grep_search", + "parametersJsonSchema": { + "properties": { + "dir_path": { + "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", + "type": "string", + }, + "include": { + "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", + "type": "string", + }, + "pattern": { + "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", + "type": "string", + }, + }, + "required": [ + "pattern", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: list_directory 1`] = ` +{ + "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", + "name": "list_directory", + "parametersJsonSchema": { + "properties": { + "dir_path": { + "description": "The path to the directory to list", + "type": "string", + }, + "file_filtering_options": { + "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", + "properties": { + "respect_gemini_ignore": { + "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", + "type": "boolean", + }, + "respect_git_ignore": { + "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", + "type": "boolean", + }, + }, + "type": "object", + }, + "ignore": { + "description": "List of glob patterns to ignore", + "items": { + "type": "string", + }, + "type": "array", + }, + }, + "required": [ + "dir_path", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: read_file 1`] = ` +{ + "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", + "name": "read_file", + "parametersJsonSchema": { + "properties": { + "file_path": { + "description": "The path to the file to read.", + "type": "string", + }, + "limit": { + "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", + "type": "number", + }, + "offset": { + "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", + "type": "number", + }, + }, + "required": [ + "file_path", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: run_shell_command 1`] = ` +{ + "description": "This tool executes a given shell command as \`bash -c \`. To run a command in the background, set the \`is_background\` parameter to true. Do NOT use \`&\` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`. + + Efficiency Guidelines: + - Quiet Flags: Always prefer silent or quiet flags (e.g., \`npm install --silent\`, \`git --no-pager\`) to reduce output volume while still capturing necessary information. + - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use \`git --no-pager\`, \`systemctl --no-pager\`, or set \`PAGER=cat\`). + + The following information is returned: + + Output: Combined stdout/stderr. Can be \`(empty)\` or partial on error and for any unwaited background processes. + Exit Code: Only included if non-zero (command failed). + Error: Only included if a process-level error occurred (e.g., spawn failure). + Signal: Only included if process was terminated by a signal. + Background PIDs: Only included if background processes were started. + Process Group PGID: Only included if available.", + "name": "run_shell_command", + "parametersJsonSchema": { + "properties": { + "command": { + "description": "Exact bash command to execute as \`bash -c \`", + "type": "string", + }, + "description": { + "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.", + "type": "string", + }, + "dir_path": { + "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist.", + "type": "string", + }, + "is_background": { + "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background.", + "type": "boolean", + }, + }, + "required": [ + "command", + ], + "type": "object", + }, +} +`; + +exports[`coreTools snapshots for specific models > Model: gemini-3-pro-preview > snapshot for tool: write_file 1`] = ` +{ + "description": "Writes content to a specified file in the local filesystem. + + The user has the ability to modify \`content\`. If modified, this will be stated in the response.", + "name": "write_file", + "parametersJsonSchema": { + "properties": { + "content": { + "description": "The content to write to the file.", + "type": "string", + }, + "file_path": { + "description": "The path to the file to write to.", + "type": "string", + }, + }, + "required": [ + "file_path", + "content", + ], + "type": "object", + }, +} +`; diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json deleted file mode 100644 index abc2acd4783..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/glob.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "glob", - "description": "Efficiently finds files matching specific glob patterns (e.g., `src/**/*.ts`, `**/*.md`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "pattern": { - "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", - "type": "string" - }, - "dir_path": { - "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", - "type": "string" - }, - "case_sensitive": { - "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", - "type": "boolean" - }, - "respect_git_ignore": { - "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", - "type": "boolean" - }, - "respect_gemini_ignore": { - "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", - "type": "boolean" - } - }, - "required": ["pattern"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json deleted file mode 100644 index 13b318df308..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/grep_search.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "grep_search", - "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "pattern": { - "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", - "type": "string" - }, - "dir_path": { - "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", - "type": "string" - }, - "include": { - "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", - "type": "string" - } - }, - "required": ["pattern"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json deleted file mode 100644 index 27585e380af..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/list_directory.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "list_directory", - "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "dir_path": { - "description": "The path to the directory to list", - "type": "string" - }, - "ignore": { - "description": "List of glob patterns to ignore", - "items": { - "type": "string" - }, - "type": "array" - }, - "file_filtering_options": { - "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", - "type": "object", - "properties": { - "respect_git_ignore": { - "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", - "type": "boolean" - }, - "respect_gemini_ignore": { - "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", - "type": "boolean" - } - } - } - }, - "required": ["dir_path"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json deleted file mode 100644 index d47baf824c0..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/read_file.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "read_file", - "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "file_path": { - "description": "The path to the file to read.", - "type": "string" - }, - "offset": { - "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", - "type": "number" - }, - "limit": { - "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", - "type": "number" - } - }, - "required": ["file_path"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json deleted file mode 100644 index 1e0b6f279a2..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/run_shell_command.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "run_shell_command", - "description": "This tool executes a given shell command as `bash -c `. To run a command in the background, set the `is_background` parameter to true. Do NOT use `&` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as `kill -- -PGID` or signaled as `kill -s SIGNAL -- -PGID`.\n\n Efficiency Guidelines:\n - Quiet Flags: Always prefer silent or quiet flags (e.g., `npm install --silent`, `git --no-pager`) to reduce output volume while still capturing necessary information.\n - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use `git --no-pager`, `systemctl --no-pager`, or set `PAGER=cat`).\n\n The following information is returned:\n\n Output: Combined stdout/stderr. Can be `(empty)` or partial on error and for any unwaited background processes.\n Exit Code: Only included if non-zero (command failed).\n Error: Only included if a process-level error occurred (e.g., spawn failure).\n Signal: Only included if process was terminated by a signal.\n Background PIDs: Only included if background processes were started.\n Process Group PGID: Only included if available.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "command": { - "type": "string", - "description": "Exact bash command to execute as `bash -c `" - }, - "description": { - "type": "string", - "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks." - }, - "dir_path": { - "type": "string", - "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist." - }, - "is_background": { - "type": "boolean", - "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background." - } - }, - "required": ["command"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json deleted file mode 100644 index 3cff410edd2..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-2.5-pro/write_file.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "write_file", - "description": "Writes content to a specified file in the local filesystem.\n\n The user has the ability to modify `content`. If modified, this will be stated in the response.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "file_path": { - "description": "The path to the file to write to.", - "type": "string" - }, - "content": { - "description": "The content to write to the file.", - "type": "string" - } - }, - "required": ["file_path", "content"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json deleted file mode 100644 index abc2acd4783..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/glob.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "glob", - "description": "Efficiently finds files matching specific glob patterns (e.g., `src/**/*.ts`, `**/*.md`), returning absolute paths sorted by modification time (newest first). Ideal for quickly locating files based on their name or path structure, especially in large codebases.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "pattern": { - "description": "The glob pattern to match against (e.g., '**/*.py', 'docs/*.md').", - "type": "string" - }, - "dir_path": { - "description": "Optional: The absolute path to the directory to search within. If omitted, searches the root directory.", - "type": "string" - }, - "case_sensitive": { - "description": "Optional: Whether the search should be case-sensitive. Defaults to false.", - "type": "boolean" - }, - "respect_git_ignore": { - "description": "Optional: Whether to respect .gitignore patterns when finding files. Only available in git repositories. Defaults to true.", - "type": "boolean" - }, - "respect_gemini_ignore": { - "description": "Optional: Whether to respect .geminiignore patterns when finding files. Defaults to true.", - "type": "boolean" - } - }, - "required": ["pattern"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json deleted file mode 100644 index 13b318df308..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/grep_search.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "grep_search", - "description": "Searches for a regular expression pattern within file contents. Max 100 matches.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "pattern": { - "description": "The regular expression (regex) pattern to search for within file contents (e.g., 'function\\s+myFunction', 'import\\s+\\{.*\\}\\s+from\\s+.*').", - "type": "string" - }, - "dir_path": { - "description": "Optional: The absolute path to the directory to search within. If omitted, searches the current working directory.", - "type": "string" - }, - "include": { - "description": "Optional: A glob pattern to filter which files are searched (e.g., '*.js', '*.{ts,tsx}', 'src/**'). If omitted, searches all files (respecting potential global ignores).", - "type": "string" - } - }, - "required": ["pattern"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json deleted file mode 100644 index 27585e380af..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/list_directory.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "list_directory", - "description": "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "dir_path": { - "description": "The path to the directory to list", - "type": "string" - }, - "ignore": { - "description": "List of glob patterns to ignore", - "items": { - "type": "string" - }, - "type": "array" - }, - "file_filtering_options": { - "description": "Optional: Whether to respect ignore patterns from .gitignore or .geminiignore", - "type": "object", - "properties": { - "respect_git_ignore": { - "description": "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.", - "type": "boolean" - }, - "respect_gemini_ignore": { - "description": "Optional: Whether to respect .geminiignore patterns when listing files. Defaults to true.", - "type": "boolean" - } - } - } - }, - "required": ["dir_path"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json deleted file mode 100644 index d47baf824c0..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/read_file.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "read_file", - "description": "Reads and returns the content of a specified file. If the file is large, the content will be truncated. The tool's response will clearly indicate if truncation has occurred and will provide details on how to read more of the file using the 'offset' and 'limit' parameters. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), audio files (MP3, WAV, AIFF, AAC, OGG, FLAC), and PDF files. For text files, it can read specific line ranges.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "file_path": { - "description": "The path to the file to read.", - "type": "string" - }, - "offset": { - "description": "Optional: For text files, the 0-based line number to start reading from. Requires 'limit' to be set. Use for paginating through large files.", - "type": "number" - }, - "limit": { - "description": "Optional: For text files, maximum number of lines to read. Use with 'offset' to paginate through large files. If omitted, reads the entire file (if feasible, up to a default limit).", - "type": "number" - } - }, - "required": ["file_path"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json deleted file mode 100644 index 1e0b6f279a2..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/run_shell_command.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "run_shell_command", - "description": "This tool executes a given shell command as `bash -c `. To run a command in the background, set the `is_background` parameter to true. Do NOT use `&` to background commands. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as `kill -- -PGID` or signaled as `kill -s SIGNAL -- -PGID`.\n\n Efficiency Guidelines:\n - Quiet Flags: Always prefer silent or quiet flags (e.g., `npm install --silent`, `git --no-pager`) to reduce output volume while still capturing necessary information.\n - Pagination: Always disable terminal pagination to ensure commands terminate (e.g., use `git --no-pager`, `systemctl --no-pager`, or set `PAGER=cat`).\n\n The following information is returned:\n\n Output: Combined stdout/stderr. Can be `(empty)` or partial on error and for any unwaited background processes.\n Exit Code: Only included if non-zero (command failed).\n Error: Only included if a process-level error occurred (e.g., spawn failure).\n Signal: Only included if process was terminated by a signal.\n Background PIDs: Only included if background processes were started.\n Process Group PGID: Only included if available.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "command": { - "type": "string", - "description": "Exact bash command to execute as `bash -c `" - }, - "description": { - "type": "string", - "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks." - }, - "dir_path": { - "type": "string", - "description": "(OPTIONAL) The path of the directory to run the command in. If not provided, the project root directory is used. Must be a directory within the workspace and must already exist." - }, - "is_background": { - "type": "boolean", - "description": "Set to true if this command should be run in the background (e.g. for long-running servers or watchers). The command will be started, allowed to run for a brief moment to check for immediate errors, and then moved to the background." - } - }, - "required": ["command"] - } -} diff --git a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json b/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json deleted file mode 100644 index 3cff410edd2..00000000000 --- a/packages/core/src/tools/definitions/__snapshots__/gemini-3-pro-preview/write_file.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "write_file", - "description": "Writes content to a specified file in the local filesystem.\n\n The user has the ability to modify `content`. If modified, this will be stated in the response.", - "parametersJsonSchema": { - "type": "object", - "properties": { - "file_path": { - "description": "The path to the file to write to.", - "type": "string" - }, - "content": { - "description": "The content to write to the file.", - "type": "string" - } - }, - "required": ["file_path", "content"] - } -} diff --git a/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts b/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts index f2ecd2e11cc..c723f700711 100644 --- a/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts +++ b/packages/core/src/tools/definitions/coreToolsModelSnapshots.test.ts @@ -4,9 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { describe, it, expect, vi } from 'vitest'; -import path from 'node:path'; -import { resolveToolDeclaration } from './resolver.js'; +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; // Mock node:os BEFORE importing coreTools to ensure it uses the mock vi.mock('node:os', async (importOriginal) => { @@ -17,6 +15,7 @@ vi.mock('node:os', async (importOriginal) => { }; }); +import { resolveToolDeclaration } from './resolver.js'; import { READ_FILE_DEFINITION, WRITE_FILE_DEFINITION, @@ -27,6 +26,27 @@ import { } from './coreTools.js'; describe('coreTools snapshots for specific models', () => { + const mockPlatform = (platform: string) => { + vi.stubGlobal( + 'process', + Object.create(process, { + platform: { + get: () => platform, + }, + }), + ); + }; + + beforeEach(() => { + vi.resetAllMocks(); + // Stub process.platform to 'linux' by default for deterministic snapshots across OSes + mockPlatform('linux'); + }); + + afterEach(() => { + vi.unstubAllGlobals(); + }); + const modelIds = ['gemini-2.5-pro', 'gemini-3-pro-preview']; const tools = [ { name: 'read_file', definition: READ_FILE_DEFINITION }, @@ -43,17 +63,9 @@ describe('coreTools snapshots for specific models', () => { for (const modelId of modelIds) { describe(`Model: ${modelId}`, () => { for (const tool of tools) { - it(`snapshot for tool: ${tool.name}`, async () => { + it(`snapshot for tool: ${tool.name}`, () => { const resolved = resolveToolDeclaration(tool.definition, modelId); - // Create a directory structure: __snapshots__//.json - const snapshotPath = path.join( - '__snapshots__', - modelId, - `${tool.name}.json`, - ); - await expect(JSON.stringify(resolved, null, 2)).toMatchFileSnapshot( - snapshotPath, - ); + expect(resolved).toMatchSnapshot(); }); } });