mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 14:23:02 -07:00
fix: resolve build errors in cli and sdk due to tool constructor changes
This commit is contained in:
@@ -1197,10 +1197,7 @@ export class Session {
|
||||
const ignoredPaths: string[] = [];
|
||||
|
||||
const toolRegistry = this.context.toolRegistry;
|
||||
const readManyFilesTool = new ReadManyFilesTool(
|
||||
this.context.config,
|
||||
this.context.messageBus,
|
||||
);
|
||||
const readManyFilesTool = new ReadManyFilesTool(this.context);
|
||||
const globTool = toolRegistry.getTool('glob');
|
||||
|
||||
if (!readManyFilesTool) {
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
CoreToolCallStatus,
|
||||
type Config,
|
||||
type DiscoveredMCPResource,
|
||||
type AgentLoopContext,
|
||||
} from '@google/gemini-cli-core';
|
||||
import * as core from '@google/gemini-cli-core';
|
||||
import * as os from 'node:os';
|
||||
@@ -149,8 +150,18 @@ describe('handleAtCommand', () => {
|
||||
} as unknown as Config;
|
||||
|
||||
const registry = new ToolRegistry(mockConfig, mockMessageBus);
|
||||
registry.registerTool(new ReadManyFilesTool(mockConfig, mockMessageBus));
|
||||
registry.registerTool(new GlobTool(mockConfig, mockMessageBus));
|
||||
registry.registerTool(
|
||||
new ReadManyFilesTool({
|
||||
config: mockConfig,
|
||||
messageBus: mockMessageBus,
|
||||
} as unknown as AgentLoopContext),
|
||||
);
|
||||
registry.registerTool(
|
||||
new GlobTool({
|
||||
config: mockConfig,
|
||||
messageBus: mockMessageBus,
|
||||
} as unknown as AgentLoopContext),
|
||||
);
|
||||
getToolRegistry.mockReturnValue(registry);
|
||||
});
|
||||
|
||||
|
||||
@@ -513,10 +513,7 @@ async function readLocalFiles(
|
||||
return { parts: [] };
|
||||
}
|
||||
|
||||
const readManyFilesTool = new ReadManyFilesTool(
|
||||
config,
|
||||
config.getMessageBus(),
|
||||
);
|
||||
const readManyFilesTool = new ReadManyFilesTool(config);
|
||||
|
||||
const pathSpecsToRead = resolvedFiles.map((rf) => rf.pathSpec);
|
||||
const fileLabelsForDisplay = resolvedFiles.map((rf) => rf.displayLabel);
|
||||
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
Config,
|
||||
AgentDefinition,
|
||||
MessageBus,
|
||||
AgentLoopContext,
|
||||
} from '@google/gemini-cli-core';
|
||||
import {
|
||||
FileDiscoveryService,
|
||||
@@ -139,8 +140,18 @@ describe('handleAtCommand with Agents', () => {
|
||||
} as unknown as Config;
|
||||
|
||||
const registry = new ToolRegistry(mockConfig, mockMessageBus);
|
||||
registry.registerTool(new ReadManyFilesTool(mockConfig, mockMessageBus));
|
||||
registry.registerTool(new GlobTool(mockConfig, mockMessageBus));
|
||||
registry.registerTool(
|
||||
new ReadManyFilesTool({
|
||||
config: mockConfig,
|
||||
messageBus: mockMessageBus,
|
||||
} as unknown as AgentLoopContext),
|
||||
);
|
||||
registry.registerTool(
|
||||
new GlobTool({
|
||||
config: mockConfig,
|
||||
messageBus: mockMessageBus,
|
||||
} as unknown as AgentLoopContext),
|
||||
);
|
||||
getToolRegistry.mockReturnValue(registry);
|
||||
});
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
import * as path from 'node:path';
|
||||
import { getFolderStructure } from '../utils/getFolderStructure.js';
|
||||
import type {
|
||||
ToolConfirmationOutcome,
|
||||
import {
|
||||
BaseDeclarativeTool,
|
||||
BaseToolInvocation,
|
||||
Kind,
|
||||
type ToolInvocation,
|
||||
type ToolResult,
|
||||
type ToolCallConfirmationDetails
|
||||
type ToolCallConfirmationDetails,
|
||||
type ToolConfirmationOutcome,
|
||||
} from './tools.js';
|
||||
import type { MessageBus } from '../confirmation-bus/message-bus.js';
|
||||
import type { AgentLoopContext } from '../config/agent-loop-context.js';
|
||||
|
||||
@@ -131,9 +131,7 @@ export class GeminiCliSession {
|
||||
if (registry.getTool(toolName)) {
|
||||
registry.unregisterTool(toolName);
|
||||
}
|
||||
registry.registerTool(
|
||||
new ActivateSkillTool(this.config, loopContext.messageBus),
|
||||
);
|
||||
registry.registerTool(new ActivateSkillTool(loopContext));
|
||||
}
|
||||
|
||||
// Register tools
|
||||
|
||||
@@ -28,7 +28,7 @@ export class SdkAgentShell implements AgentShell {
|
||||
|
||||
// Use ShellTool to check policy
|
||||
const loopContext: AgentLoopContext = this.config;
|
||||
const shellTool = new ShellTool(this.config, loopContext.messageBus);
|
||||
const shellTool = new ShellTool(loopContext);
|
||||
try {
|
||||
const invocation = shellTool.build({
|
||||
command,
|
||||
|
||||
Reference in New Issue
Block a user