mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-16 17:11:04 -07:00
feat: Add enableSubagents configuration and wire up subagent registration (#9988)
This commit is contained in:
@@ -13,6 +13,7 @@ import { shortenPath, makeRelative } from '../utils/paths.js';
|
||||
import { type Config } from '../config/config.js';
|
||||
import { DEFAULT_FILE_FILTERING_OPTIONS } from '../config/constants.js';
|
||||
import { ToolErrorType } from './tool-error.js';
|
||||
import { GLOB_TOOL_NAME } from './tool-names.js';
|
||||
|
||||
// Subset of 'Path' interface provided by 'glob' that we can implement for testing
|
||||
export interface GlobPath {
|
||||
@@ -259,7 +260,7 @@ class GlobToolInvocation extends BaseToolInvocation<
|
||||
* Implementation of the Glob tool logic
|
||||
*/
|
||||
export class GlobTool extends BaseDeclarativeTool<GlobToolParams, ToolResult> {
|
||||
static readonly Name = 'glob';
|
||||
static readonly Name = GLOB_TOOL_NAME;
|
||||
|
||||
constructor(private config: Config) {
|
||||
super(
|
||||
|
||||
17
packages/core/src/tools/tool-names.ts
Normal file
17
packages/core/src/tools/tool-names.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
// Centralized constants for tool names.
|
||||
// This prevents circular dependencies that can occur when other modules (like agents)
|
||||
// need to reference a tool's name without importing the tool's implementation.
|
||||
|
||||
export const GLOB_TOOL_NAME = 'glob';
|
||||
|
||||
// TODO: Migrate other tool names here to follow this pattern and prevent future circular dependencies.
|
||||
// Candidates for migration:
|
||||
// - LSTool ('list_directory')
|
||||
// - ReadFileTool ('read_file')
|
||||
// - GrepTool ('search_file_content')
|
||||
Reference in New Issue
Block a user