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; isReadOnly?: ((args: TArgs) => boolean) | boolean; isDestructive?: ((args: TArgs) => boolean) | boolean; isConcurrencySafe?: ((args: TArgs) => 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>; } /** * Base interface for all agentic tools. */ export interface ToolboxTool extends ToolMetadata { checkPermissions: (bash: Bash, args: TArgs) => Promise>; validateInput: (args: unknown) => Promise; execute: (bash: Bash, args: TArgs) => Promise; } /** * 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> & Pick, "name" | "description" | "parameters" | "execute">): ToolboxTool;