import type { AgentToolResult } from "@oh-my-pi/pi-agent-core"; import type { HookUIContext } from "../../extensibility/hooks/types"; import type { LoadedCustomTool, ToolLoadError } from "./types"; /** Tool path with optional source metadata */ interface ToolPathWithSource { path: string; source?: { provider: string; providerName: string; level: "user" | "project"; }; } /** * Loads custom tools from paths with conflict detection and error handling. * * Manages a shared API instance passed to all tool factories, providing access to * execution context, UI, logger, and injected dependencies. The UI context can be * updated after loading via setUIContext(). */ export declare class CustomToolLoader { #private; tools: LoadedCustomTool[]; errors: ToolLoadError[]; constructor(pi: typeof import("@oh-my-pi/pi-coding-agent"), cwd: string, builtInToolNames: string[], pushPendingAction?: (action: { label: string; sourceToolName: string; apply(reason: string): Promise>; reject?(reason: string): Promise | undefined>; }) => void); load(pathsWithSources: ToolPathWithSource[]): Promise; setUIContext(uiContext: HookUIContext, hasUI: boolean): void; } /** * Load all tools from configuration. * @param pathsWithSources - Array of tool paths with optional source metadata * @param cwd - Current working directory for resolving relative paths * @param builtInToolNames - Names of built-in tools to check for conflicts */ export declare function loadCustomTools(pathsWithSources: ToolPathWithSource[], cwd: string, builtInToolNames: string[], pushPendingAction?: (action: { label: string; sourceToolName: string; apply(reason: string): Promise>; reject?(reason: string): Promise | undefined>; }) => void): Promise<{ tools: LoadedCustomTool[]; errors: ToolLoadError[]; setUIContext: (uiContext: HookUIContext, hasUI: boolean) => void; }>; /** * Discover and load tools from standard locations via capability system: * 1. User and project tools discovered by capability providers * 2. Installed plugins (~/.omp/plugins/node_modules/*) * 3. Explicitly configured paths from settings or CLI * * @param configuredPaths - Explicit paths from settings.json and CLI --tool flags * @param cwd - Current working directory * @param builtInToolNames - Names of built-in tools to check for conflicts */ export declare function discoverAndLoadCustomTools(configuredPaths: string[], cwd: string, builtInToolNames: string[], pushPendingAction?: (action: { label: string; sourceToolName: string; apply(reason: string): Promise>; reject?(reason: string): Promise | undefined>; }) => void): Promise<{ tools: LoadedCustomTool[]; errors: ToolLoadError[]; setUIContext: (uiContext: HookUIContext, hasUI: boolean) => void; }>; export {};