/**
 * Subagent Loader
 *
 * Handles loading and discovery of subagent definitions from various sources:
 * - Built-in definitions (explore, plan)
 * - User-level configuration (~/.config/nanocoder/agents/)
 * - Project-level configuration (.nanocoder/agents/)
 */
import type { SubagentConfigWithSource } from './types.js';
/**
 * SubagentLoader manages loading subagent definitions from multiple sources.
 * Sources are loaded in priority order (project > user > built-in).
 */
export interface SubagentLoadError {
    filePath: string;
    message: string;
}
export declare class SubagentLoader {
    /** Cache of loaded subagent configs */
    private cache;
    /** Whether the cache has been initialized */
    private initialized;
    /**
     * Per-file parse / load errors collected during initialize(). Drained by
     * bootstrap so the daemon can surface them in its log (the message-queue
     * `logError` path only reaches the TUI's chat queue).
     */
    private loadErrors;
    /** Project root directory */
    private projectRoot;
    /**
     * Create a new SubagentLoader.
     * @param projectRoot - The project root directory
     */
    constructor(projectRoot?: string);
    /**
     * Initialize the loader by loading all available subagents.
     */
    initialize(): Promise<void>;
    /**
     * Register a subagent config produced outside this loader (e.g. by the
     * skill registrar). Returns true on success, false if the name is
     * already cached - the caller treats that as a hard collision.
     */
    registerExternal(config: SubagentConfigWithSource): boolean;
    /**
     * Remove a previously-registered subagent by name. Returns true if found.
     */
    unregisterExternal(name: string): boolean;
    /**
     * Get a specific subagent by name.
     * @param name - The subagent name
     * @returns The subagent config or null if not found
     */
    getSubagent(name: string): Promise<SubagentConfigWithSource | null>;
    /**
     * List all available subagents.
     * @returns Array of all available subagent configs
     */
    listSubagents(): Promise<SubagentConfigWithSource[]>;
    /**
     * Check if a subagent exists.
     * @param name - The subagent name
     * @returns True if the subagent exists
     */
    hasSubagent(name: string): Promise<boolean>;
    /**
     * Reload all subagent definitions.
     * Useful for picking up changes to custom agents.
     */
    reload(): Promise<void>;
    /**
     * Drain per-file load errors accumulated during initialize(). The caller
     * (typically the boot pipeline) surfaces them through its own error
     * channel. Subsequent calls return an empty array until reload().
     */
    drainLoadErrors(): SubagentLoadError[];
    /**
     * Get the user-level agents directory path.
     */
    private getUserAgentsPath;
    /**
     * Get the project-level agents directory path.
     */
    private getProjectAgentsPath;
    /**
     * Get the project root directory.
     * @returns The project root path
     */
    getProjectRoot(): string;
    /**
     * Load subagent definitions from a directory.
     * @param dirPath - Directory path to load from
     * @param priority - Priority level for loaded configs
     * @returns Array of subagent configs with source info
     */
    private loadFromDirectory;
}
/**
 * Get the global SubagentLoader instance.
 * @param projectRoot - Optional project root (uses cwd if not provided)
 * @returns The singleton SubagentLoader instance
 */
export declare function getSubagentLoader(projectRoot?: string): SubagentLoader;
//# sourceMappingURL=subagent-loader.d.ts.map