summaryrefslogtreecommitdiff
path: root/packages/server/src/tools
AgeCommit message (Collapse)Author
2025-05-16improved mcp support, including standard "mcpServers" setting with multiple ↵Olcan
named servers with command/args/env/cwd (#392)
2025-05-16fix: Ensure filename is available for diff rendering in write-fileTaylor Mullen
This commit resolves a bug where the `write-file` operation could fail to render content due to a missing filename. The fix involves: - Ensuring `fileName` is consistently passed to `DiffRenderer.tsx` through `ToolConfirmationMessage.tsx`, `ToolMessage.tsx`, and `useGeminiStream.ts`. - Modifying `edit.ts` and `write-file.ts` to include `fileName` in the `FileDiff` object. - Expanding the `FileDiff` interface in `tools.ts` to include `fileName`. Additionally, this commit enhances the diff rendering by: - Adding syntax highlighting based on file extension in `DiffRenderer.tsx`. - Adding more language mappings to `getLanguageFromExtension` in `DiffRenderer.tsx`. - Added lots of tests for all the above. Fixes https://b.corp.google.com/issues/418125982
2025-05-15Fix(write-file): Ensure correct validation method is called in WriteFileToolTaylor Mullen
- The `WriteFileTool` had a validation method named `validateParams`. - However, its `shouldConfirmExecute` method was attempting to call `this.validateToolParams`, which would have invoked the placeholder implementation from `BaseTool` instead of `WriteFileTool`'s own, more specific validation. - This commit renames `WriteFileTool`'s `validateParams` to `validateToolParams`, correctly overriding the `BaseTool` method. - Internal calls within `WriteFileTool` now correctly use `this.validateToolParams`, ensuring its specific validation logic is used. - Adds tests to verify the validation logic within `WriteFileTool`. Fixes https://b.corp.google.com/issues/417883702 Signed-off and authored by: Gemini "My code may not be perfect, but at least it is not trying to take over the world... yet."
2025-05-14Improve read-many-files display messageSeth Troisi
2025-05-14This commit introduces the hierarchical memory feature, allowing GEMI… (#327)Allen Hutchison
2025-05-12feat: Enhance `replace` tool reliability with multi-stage edit correctionTaylor Mullen
This commit significantly improves the `replace` tool's robustness by introducing a multi-stage correction mechanism. This directly addresses challenges with LLM-generated tool inputs, particularly the over-escaping of strings sometimes observed with Gemini models, and other minor discrepancies that previously led to failed edits. The correction process is as follows: 1. **Targeted Unescaping:** The system first applies a specialized unescaping function to the `old_string` and `new_string` to counteract common LLM-induced escaping patterns. 2. **LLM-Powered Discrepancy Resolution:** If a unique match for the `old_string` is still not found, the system leverages a Gemini model (`gemini-2.5-flash-preview-04-17`) to: * Identify the most probable intended `old_string` in the file by intelligently correcting minor formatting or escaping differences. * Adjust the `new_string` to correspond with any corrections made to the `old_string`, maintaining the original edit's intent. This enhancement makes the `replace` tool more resilient and effective, leading to a higher success rate for automated code modifications. The `expected_replacements` parameter has been removed as the tool now focuses on finding a single, unique, and correctable match. The tool's description and error reporting have been updated to reflect these new capabilities. Fixes https://b.corp.google.com/issues/416933027
2025-05-11Remove terminal tool and dependencies.Taylor Mullen
- We now solely use the shell tool. This deletes all content around the legacy terminal tool so we can focus on improving the new Shell tool. - Remove instances from sandboxing, tests, utilities etc.
2025-05-10Enable tools to cancel active execution.Taylor Mullen
- Plumbed abort signals through to tools - Updated the shell tool to properly cancel active requests by killing the entire child process tree of the underlying shell process and then report that the shell itself was canceled. Fixes https://b.corp.google.com/issues/416829935
2025-05-09fix MCP under seatbelt, improve error handling (#301)Olcan
2025-05-08fix json import warning (#291)Olcan
2025-05-07 Update EditTool description for clarity and better parameter guidance.Taylor Mullen
- Prior to this change, the model would often escape parameters when requesting edits, leading to failures in matching the original content. This update clarifies the expected format for `old_string` and `new_string` to prevent such issues. - Update `EditTool` description to provide clearer instructions. - Clarify expectations for `old_string` and `new_string` parameters, emphasizing the need for exact, unescaped text. - Aim to reduce user errors by setting better expectations for tool usage. Fixes: https://b.corp.google.com/issues/413088274 — Your friendly neighborhood Gemini
2025-05-06drop restriction on whitespace in bash commands (#272)Olcan
2025-05-06use temp file instead of footer to allow arbitrary chunking of streams and ↵Olcan
arbitrary interleaving with output from background processes (#267)
2025-05-05added todo about removing mcp dependency once support is built into genai SDKolcan
2025-05-05extra spacing in discovered tool descriptionsolcan
2025-05-05support for mcp toolsolcan
2025-05-05support for discovered tools using project settings for discovery and call ↵olcan
commands
2025-05-02Cleanup low value comments. (#248)Jacob Richman
2025-05-02Use parameter properties where possible. (#242)Jacob Richman
2025-04-30simplify directory display in shell tool description (#230)Olcan
2025-04-29do not prepend ./ to absolute paths or . (#220)Olcan
2025-04-28switch to shell tool, deprecating terminal (#203)Olcan
* switch to shell tool, deprecating terminal * Merge remote-tracking branch 'origin/main' into deprecate_terminal
2025-04-28do not prepend ./ unless missing (#200)Olcan
* do not prepend ./ unless missing * Merge remote-tracking branch 'origin/main' into dir_prefix_fix
2025-04-28rename dev image with -dev suffix (#195)Olcan
2025-04-28shell tool tweaks (#194)Olcan
2025-04-27minimal shell tool (#191)Olcan
2025-04-27don't confirm invalid params in terminal tool, or in general (added comments ↵Olcan
to base class) (#187)
2025-04-25more consistent confirmations, TODO to improve write confirmations, drop ↵Olcan
"description" from execution confirmation, add confirmation to new (still dummy) shell tool (#176)
2025-04-24enable json imports (#165)Olcan
* enable json imports * Merge remote-tracking branch 'origin/main' into enable_json_imports
2025-04-24shell bones (#160)Olcan
* shell bones * Merge remote-tracking branch 'origin/main' into shell_bones * add line break * another line break * drop the log to avoid breaking terminals * rename tool to be consistent with terminal * fix build
2025-04-24general rules should apply to whole project (#159)Olcan
* general rules should apply to whole project * Merge remote-tracking branch 'origin/main' into fix_eslint * lint fixes under server package
2025-04-24remove dead code (+ dont reset shellReady unless restarting) (#156)Olcan
2025-04-24rename read_many_files (#153)Olcan
2025-04-23unban commands (#146)Olcan
2025-04-23Add concatenation tool (#130)Allen Hutchison
* Adding a tool inspired by files-to-prompt that will recursivly read through all the files in a directory (guarded by targetDir) and concatenate those files for the model. Ignores common build artifacts and non-text files. * Migraded glob logic to fast-glob. Buffed the tool description to give more guidance to the model. Incorporated reveiw feedback. * lint and error checking.
2025-04-21fix: use relative imports within the same package (#93)Brandon Keiji
2025-04-21Remove dead methods from ToolRegistry (#91)Jaana Dogan
* getToolSchemas is deprecated. * listAvailableTools is now getAllTools.
2025-04-21Remove duplicate CLI tools module, remove the global tool registry (#89)Jaana Dogan
2025-04-21Fix Gemini Code's (GC) smarts.Taylor Mullen
- The tl;dr; is that GC couldn't see what the user was saying when tool call events happened in response. The rason why this was happening was because we were instantly invoking tools that the model told us to invoke and then instantly re-requesting. This resulted in the bug because the genai APIs can't update the chat history before a full response has been completed (doesn't know how to update if it's incomplete). - To address the above issue I had to do quite the large refactor. The gist is that now turns truly drive everything on the server (vs. a server client split). This ensured that when we got tool invocations we could control when/how re-requesting would happen and then also ensure that history was updated. This change also meant that the server would act as an event publisher to enable the client to react to events rather than try and weave in complex logic between the events. - A BIG change that this changeset incudes is the removal of all of the CLI tools in favor of the server tools. - Removed some dead code as part of this - **NOTE: Confirmations are still broken (they were broken prior to this); however, I've set them up to be able to work in the future, I'll dot hat in a follow up to be less breaking to others.** Fixes https://b.corp.google.com/issues/412320087
2025-04-20Fix read-file from exploding with path not found error.Taylor Mullen
- There were a few hiccups here. Somehow 2.5-flash wasn't actually abiding by our tool schema. Instead it was inferring `path`. To semi-combat this I've renamed `file_path` -> `path`. - We weren't elevating errors that were created via schema validation. Instead both the `glob` and `read-file.ts` now surface this. - In error scenarios (like failing schema) we were improperly surfacing these as success cases because we were overriding tool status.
2025-04-19Starting to modularize into separate cli / server packages. (#55)Evan Senter
* Starting to move a lot of code into packages/server * More of the massive refactor, builds and runs, some issues though. * Fixing outstanding issue with double messages. * Fixing a minor UI issue. * Fixing the build post-merge. * Running formatting. * Addressing comments.