mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 00:21:09 -07:00
refactor(core): Centralize 'write_file' tool name (#10694)
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
FileDiscoveryService,
|
||||
ShellTool,
|
||||
EditTool,
|
||||
WriteFileTool,
|
||||
WRITE_FILE_TOOL_NAME,
|
||||
SHELL_TOOL_NAMES,
|
||||
resolveTelemetrySettings,
|
||||
FatalConfigError,
|
||||
@@ -605,7 +605,11 @@ export async function loadCliConfig(
|
||||
// In non-interactive mode, exclude tools that require a prompt.
|
||||
const extraExcludes: string[] = [];
|
||||
if (!interactive && !argv.experimentalAcp) {
|
||||
const defaultExcludes = [ShellTool.Name, EditTool.Name, WriteFileTool.Name];
|
||||
const defaultExcludes = [
|
||||
ShellTool.Name,
|
||||
EditTool.Name,
|
||||
WRITE_FILE_TOOL_NAME,
|
||||
];
|
||||
const autoEditExcludes = [ShellTool.Name];
|
||||
|
||||
const toolExclusionFilter = createToolExclusionFilter(
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
EditTool,
|
||||
MemoryTool,
|
||||
ShellTool,
|
||||
WriteFileTool,
|
||||
WRITE_FILE_TOOL_NAME,
|
||||
WebFetchTool,
|
||||
WebSearchTool,
|
||||
} from '@google/gemini-cli-core';
|
||||
@@ -48,7 +48,7 @@ const WRITE_TOOLS = new Set([
|
||||
EditTool.Name,
|
||||
MemoryTool.Name,
|
||||
ShellTool.Name,
|
||||
WriteFileTool.Name,
|
||||
WRITE_FILE_TOOL_NAME,
|
||||
WebFetchTool.Name,
|
||||
]);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
parseAndFormatApiError,
|
||||
ToolConfirmationOutcome,
|
||||
promptIdContext,
|
||||
WRITE_FILE_TOOL_NAME,
|
||||
} from '@google/gemini-cli-core';
|
||||
import { type Part, type PartListUnion, FinishReason } from '@google/genai';
|
||||
import type {
|
||||
@@ -69,7 +70,7 @@ enum StreamProcessingStatus {
|
||||
Error,
|
||||
}
|
||||
|
||||
const EDIT_TOOL_NAMES = new Set(['replace', 'write_file']);
|
||||
const EDIT_TOOL_NAMES = new Set(['replace', WRITE_FILE_TOOL_NAME]);
|
||||
|
||||
function showCitations(settings: LoadedSettings): boolean {
|
||||
const enabled = settings?.merged?.ui?.showCitations;
|
||||
|
||||
Reference in New Issue
Block a user