import type { PortableTool } from "../portable-tool.js";
import type { HookRegistry } from "../../contracts/hooks.js";
import type { WorkspaceSkill } from "../skill-system/skill-types.js";
import { type LoadedPlugin } from "./plugin-api.js";
interface PluginToolRegistry {
    addTool(tool: PortableTool): void;
    removeTool(name: string): boolean;
}
export interface PluginLoaderConfig {
    /** Directories to scan for plugins (order = priority) */
    pluginDirs: string[];
    /** HookRegistry to wire plugin hooks into */
    hookRegistry: HookRegistry;
    /** Logger */
    log?: {
        info(msg: string): void;
        warn(msg: string): void;
    };
    /** Runtime-owned tool catalog used for plugin tool registration. */
    toolCatalog?: PluginToolRegistry;
}
export declare class PluginLoader {
    private config;
    private loaded;
    private pluginSkills;
    private activations;
    private log;
    constructor(config: PluginLoaderConfig);
    /**
     * Discover and load all plugins from configured directories.
     * Returns the list of successfully loaded plugins.
     */
    loadAll(): Promise<LoadedPlugin[]>;
    /**
     * Get all skills registered by plugins.
     */
    getPluginSkills(): WorkspaceSkill[];
    /**
     * Get list of all loaded plugins.
     */
    getLoaded(): LoadedPlugin[];
    /**
     * Discover and load NEW plugins that weren't present during initial loadAll().
     * Call per-turn to pick up newly-created skill directories (铁律 #16).
     */
    discoverNew(): Promise<number>;
    /**
     * Re-check activation for plugins whose TTL has expired.
     * Call this before tool resolution or periodically in the agent loop.
     * Only re-runs check functions when the cache has expired.
     */
    refreshActivations(): Promise<void>;
    private loadPlugin;
    private addRegisteredTool;
    private removeRegisteredTool;
}
export {};
