/**
 * Base Tool Abstract Class
 *
 * Provides a foundation for implementing tools with:
 * - ITool interface implementation
 * - Schema generation helpers
 * - Input validation
 * - Lifecycle management
 */
import type { ToolResult } from '../types/index.js';
import type { ITool, IToolMetadata, ToolSchema, IValidationResult, ToolCategoryType } from './registry/types.js';
import { Disposable } from '../utils/disposable.js';
/**
 * Parameter definition for building schemas
 */
export interface ParameterDefinition {
    type: 'string' | 'number' | 'boolean' | 'array' | 'object';
    description: string;
    required?: boolean;
    enum?: string[];
    default?: unknown;
    items?: ParameterDefinition;
    properties?: Record<string, ParameterDefinition>;
}
/**
 * Abstract base class for tools.
 *
 * Subclasses must implement:
 * - `name`: Unique tool identifier
 * - `description`: Human-readable description
 * - `execute`: Main execution logic
 *
 * Optional overrides:
 * - `getParameters`: Define parameter schema
 * - `validate`: Custom input validation
 * - `getMetadata`: Additional metadata
 * - `isAvailable`: Check if tool can be used
 * - `dispose`: Cleanup resources
 */
export declare abstract class BaseTool implements ITool, Disposable {
    /**
     * Unique tool name (must be valid identifier)
     */
    abstract readonly name: string;
    /**
     * Human-readable description
     */
    abstract readonly description: string;
    /**
     * Tool category for classification
     */
    protected category: ToolCategoryType;
    /**
     * Keywords for search/filtering
     */
    protected keywords: string[];
    /**
     * Priority for tool selection (higher = more likely)
     */
    protected priority: number;
    /**
     * Whether tool requires user confirmation
     */
    protected requiresConfirmation: boolean;
    /**
     * Whether tool modifies files
     */
    protected modifiesFiles: boolean;
    /**
     * Whether tool makes network requests
     */
    protected makesNetworkRequests: boolean;
    constructor();
    /**
     * Execute the tool with given input.
     *
     * @param input - Tool parameters as key-value pairs
     * @returns Promise resolving to ToolResult
     */
    abstract execute(input: Record<string, unknown>): Promise<ToolResult>;
    /**
     * Get parameter definitions for schema generation.
     *
     * Override this method to define tool parameters.
     *
     * @example
     * ```typescript
     * protected getParameters(): Record<string, ParameterDefinition> {
     *   return {
     *     path: {
     *       type: 'string',
     *       description: 'File path to read',
     *       required: true,
     *     },
     *     encoding: {
     *       type: 'string',
     *       description: 'File encoding',
     *       default: 'utf-8',
     *     },
     *   };
     * }
     * ```
     */
    protected getParameters(): Record<string, ParameterDefinition>;
    /**
     * Get the tool schema for LLM function calling.
     */
    getSchema(): ToolSchema;
    /**
     * Build a JSON schema property from parameter definition
     */
    private buildSchemaProperty;
    /**
     * Validate input before execution.
     *
     * Default implementation checks required parameters.
     * Override for custom validation.
     */
    validate(input: unknown): IValidationResult;
    /**
     * Validate a value's type
     */
    private validateType;
    /**
     * Get tool metadata.
     */
    getMetadata(): IToolMetadata;
    /**
     * Check if tool is currently available.
     *
     * Override to add custom availability checks (e.g., required binaries).
     */
    isAvailable(): boolean;
    /**
     * Dispose of tool resources.
     *
     * Override to clean up resources (e.g., connections, file handles).
     */
    dispose(): void;
    /**
     * Create a success result
     */
    protected success(output: string, data?: unknown): ToolResult;
    /**
     * Create an error result
     */
    protected error(message: string, data?: unknown): ToolResult;
    /**
     * Wrap execution with error handling
     */
    protected safeExecute(fn: () => Promise<ToolResult>): Promise<ToolResult>;
}
/**
 * Decorator to mark a tool as requiring confirmation
 */
export declare function RequiresConfirmation(): <T extends BaseTool>(target: new (...args: unknown[]) => T) => new (...args: unknown[]) => T;
/**
 * Decorator to set tool category
 */
export declare function ToolCategory(category: ToolCategoryType): <T extends BaseTool>(target: new (...args: unknown[]) => T) => new (...args: unknown[]) => T;
/**
 * Decorator to add keywords
 */
export declare function Keywords(...keywords: string[]): <T extends BaseTool>(target: new (...args: unknown[]) => T) => new (...args: unknown[]) => T;
