import type { z } from "zod";
import type { Bash } from "../Bash.js";
import type { PermissionResult, ValidationResult } from "./types.js";
/**
 * Metadata for a tool.
 */
export interface ToolMetadata {
    name: string;
    description: string;
    parameters: z.ZodType<any>;
    isReadOnly?: ((args: any) => boolean) | boolean;
    isDestructive?: ((args: any) => boolean) | boolean;
    isConcurrencySafe?: ((args: any) => boolean) | boolean;
    searchHint?: string;
    aliases?: string[];
    maxResultSizeChars?: number;
    /** Reasoning effort level applied as a context modifier for subsequent turns */
    effort?: "low" | "medium" | "high";
    /** Advanced composition hooks for the orchestration layer */
    composeHooks?: {
        before?: string[];
        after?: string[];
        parallel?: string[];
    };
    /** If true, only name + description are loaded initially; full schema is loaded on first use */
    deferred?: boolean;
    /** Callback to load the full Zod schema on demand (used with deferred: true) */
    loadSchema?: () => Promise<z.ZodType<any>>;
}
/**
 * Base interface for all agentic tools.
 */
export interface ToolboxTool extends ToolMetadata {
    checkPermissions: (bash: Bash, args: any) => Promise<PermissionResult>;
    validateInput: (args: any) => Promise<ValidationResult>;
    execute: (bash: Bash, args: any) => Promise<any>;
}
/**
 * Abstract base class for tools providing common functionality.
 */
export declare abstract class Tool implements ToolboxTool {
    abstract name: string;
    abstract description: string;
    abstract parameters: z.ZodObject<any>;
    isReadOnly: ((args: any) => boolean) | boolean;
    isDestructive: ((args: any) => boolean) | boolean;
    isConcurrencySafe: ((args: any) => boolean) | boolean;
    searchHint?: string;
    aliases?: string[];
    checkPermissions(bash: Bash, _args: any): Promise<PermissionResult>;
    validateInput(args: any): Promise<ValidationResult>;
    abstract execute(bash: Bash, args: any): Promise<any>;
    /**
     * Helper to truncate long results for token efficiency.
     */
    protected truncateResult(result: string, maxLength?: number): string;
}
/**
 * Factory function to build a tool from a plain object.
 * Breaks circular dependencies by living in the base Tool file.
 */
export declare function buildTool(tool: Partial<ToolboxTool> & Pick<ToolboxTool, "name" | "description" | "parameters" | "execute">): ToolboxTool;
