/** * [WHO]: ToolSourceType, ToolSource, SourceTool * [FROM]: Depends on extensions/types * [TO]: Consumed by core/tools/index.ts (not directly imported) * [HERE]: core/tools/source.ts - tool source abstraction (builtin, MCP, extension) */ import type { ToolDefinition } from "../extensions-host/types.js"; export type ToolSourceType = "builtin" | "mcp" | "extension"; /** * Tool source interface * Implement this to add new tool sources (MCP, custom protocols, etc.) */ export interface ToolSource { /** Unique identifier for this tool source */ id: string; /** Type of tool source */ type: ToolSourceType; /** Human-readable name */ name: string; /** Description of what this source provides */ description?: string; /** Load tools from this source */ load(): Promise; /** Unload tools from this source */ unload(): Promise; /** Check if this source is enabled */ isEnabled(): boolean; } /** * Tool source registry * Manages multiple tool sources */ export declare class ToolSourceRegistry { private sources; /** * Register a tool source */ register(source: ToolSource): void; /** * Unregister a tool source */ unregister(id: string): void; /** * Get a tool source by ID */ get(id: string): ToolSource | undefined; /** * Get all registered tool sources */ getAll(): ToolSource[]; /** * Get tool sources by type */ getByType(type: ToolSourceType): ToolSource[]; /** * Load all enabled tool sources */ loadAll(): Promise; /** * Unload all tool sources */ unloadAll(): Promise; } /** * Builtin tool source * Wraps built-in tools as a ToolSource */ export declare class BuiltinToolSource implements ToolSource { readonly id = "builtin"; readonly type: ToolSourceType; readonly name = "Built-in Tools"; readonly description = "Core editing and file operation tools"; private tools; constructor(tools?: ToolDefinition[]); isEnabled(): boolean; load(): Promise; unload(): Promise; }