mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 02:24:09 -07:00
Refactor EditTool.Name to use centralized EDIT_TOOL_NAME (#11343)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
import type { Mock } from 'vitest';
|
||||
import { vi, describe, it, expect, beforeEach, type Mocked } from 'vitest';
|
||||
import * as fs from 'node:fs';
|
||||
import { EditTool } from '../tools/edit.js';
|
||||
import { EDIT_TOOL_NAME } from '../tools/tool-names.js';
|
||||
import type { BaseLlmClient } from '../core/baseLlmClient.js';
|
||||
|
||||
// MOCKS
|
||||
@@ -582,8 +582,8 @@ describe('editCorrector', () => {
|
||||
parts: [
|
||||
{
|
||||
functionResponse: {
|
||||
name: EditTool.Name,
|
||||
id: `${EditTool.Name}-${lastEditTime}-123`,
|
||||
name: EDIT_TOOL_NAME,
|
||||
id: `${EDIT_TOOL_NAME}-${lastEditTime}-123`,
|
||||
response: {
|
||||
output: {
|
||||
llmContent: `Successfully modified file: ${filePath}`,
|
||||
|
||||
@@ -8,8 +8,7 @@ import type { Content, GenerateContentConfig } from '@google/genai';
|
||||
import type { GeminiClient } from '../core/client.js';
|
||||
import type { BaseLlmClient } from '../core/baseLlmClient.js';
|
||||
import type { EditToolParams } from '../tools/edit.js';
|
||||
import { EditTool } from '../tools/edit.js';
|
||||
import { WRITE_FILE_TOOL_NAME } from '../tools/tool-names.js';
|
||||
import { EDIT_TOOL_NAME, WRITE_FILE_TOOL_NAME } from '../tools/tool-names.js';
|
||||
import { ReadFileTool } from '../tools/read-file.js';
|
||||
import { ReadManyFilesTool } from '../tools/read-many-files.js';
|
||||
import { GrepTool } from '../tools/grep.js';
|
||||
@@ -101,7 +100,7 @@ async function findLastEditTimestamp(
|
||||
// Tools that may reference the file path in their FunctionResponse `output`.
|
||||
const toolsInResp = new Set([
|
||||
WRITE_FILE_TOOL_NAME,
|
||||
EditTool.Name,
|
||||
EDIT_TOOL_NAME,
|
||||
ReadManyFilesTool.Name,
|
||||
GrepTool.Name,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user