import { SkillDefinition, ModuleLayer, DialogueCapability } from './types';
import { DisplayContractIssue } from './displayContractValidator';
export interface VendorOverrideSignature {
    pattern: string;
    confidence: 'high' | 'medium' | 'low';
}
export interface VendorOverride {
    vendor: string;
    extends: string;
    displayName?: string;
    description?: string;
    detection: {
        signatures: VendorOverrideSignature[];
    };
    additionalSteps: any[];
    overrideParams?: Record<string, any>;
}
export declare class SkillRegistry {
    private skills;
    private moduleSkills;
    private fragmentCache;
    /** Vendor overrides keyed by base skill ID (from `extends` field) */
    private vendorOverrides;
    private displayContractIssues;
    private displayContractIssueKeys;
    private initialized;
    /**
     * 加载所有 skills
     */
    loadSkills(skillsDir: string): Promise<void>;
    /**
     * Load SQL fragments from skills/fragments/ directory.
     * Fragments are reusable CTE definitions that can be injected into step SQL.
     */
    private loadFragments;
    /** Get a loaded SQL fragment by its path key (e.g., 'fragments/target_threads.sql') */
    getFragment(fragmentPath: string): string | undefined;
    /** Get all loaded fragment path keys */
    getFragmentPaths(): Set<string>;
    /** Get the full fragment cache (for passing to SkillExecutor) */
    getFragmentCache(): Map<string, string>;
    /**
     * Run all load-time validations on a skill and log warnings.
     */
    private validateAndLogWarnings;
    /**
     * Run only the display contract validator. Vendor overrides are fragments of a
     * base skill, so condition/fragment validation would produce false positives.
     */
    private validateAndLogDisplayWarnings;
    private recordDisplayContractIssues;
    private logDisplayContractSummary;
    /**
     * 递归加载 modules 目录下的 skills
     * modules/
     *   ├── app/
     *   ├── framework/
     *   ├── kernel/
     *   └── hardware/
     */
    private loadModuleSkillsRecursively;
    /**
     * 加载 pipeline skills
     * Pipeline skills are a special type that define rendering pipeline configurations
     */
    private loadPipelineSkills;
    /**
     * 加载 vendor overrides
     * vendors/ 下每个厂商子目录包含 *.override.yaml 文件
     * 每个 override 声明 `extends: <base_skill_id>` 和 `additional_steps`
     */
    private loadVendorOverrides;
    /**
     * 获取指定 skill 的特定厂商覆盖
     * @param skillId 基础 skill ID (e.g. "startup_analysis")
     * @param vendor 厂商标识 (e.g. "xiaomi", "pixel")
     * @returns 匹配的 VendorOverride，不存在则返回 undefined
     */
    getVendorOverride(skillId: string, vendor: string): VendorOverride | undefined;
    /**
     * 获取指定 skill 的所有厂商覆盖
     * @param skillId 基础 skill ID
     * @returns 所有匹配的 VendorOverride 列表
     */
    getVendorOverridesForSkill(skillId: string): VendorOverride[];
    /**
     * 获取所有已加载的 vendor override 数量
     */
    getVendorOverrideCount(): number;
    /**
     * 从目录加载 skills
     */
    private loadSkillsFromDir;
    /**
     * 获取 skill
     */
    getSkill(name: string): SkillDefinition | undefined;
    /**
     * 获取所有 skills
     */
    getAllSkills(): SkillDefinition[];
    /**
     * Programmatically insert/override a skill definition.
     * Used for runtime-generated skills where YAML should be the single source of truth.
     */
    upsertSkill(skill: SkillDefinition): void;
    /**
     * 获取所有模块专家 skills
     */
    getAllModuleSkills(): SkillDefinition[];
    /**
     * 根据模块层级查找 skills
     */
    findSkillsByLayer(layer: ModuleLayer): SkillDefinition[];
    /**
     * 根据组件名查找 skill
     */
    findSkillByComponent(component: string): SkillDefinition | undefined;
    /**
     * 根据层级和组件查找 skill
     */
    findModuleSkill(layer: ModuleLayer, component: string): SkillDefinition | undefined;
    /**
     * 根据对话能力查找 skill
     * 查找能够回答特定问题类型的模块
     */
    findSkillByCapability(capabilityId: string): SkillDefinition | undefined;
    /**
     * 获取所有可用的对话能力
     */
    getAllCapabilities(): Array<{
        skillName: string;
        capability: DialogueCapability;
    }>;
    /**
     * 检查 skill 是否为模块专家
     */
    isModuleSkill(skillName: string): boolean;
    /**
     * 根据关键词匹配 skill
     */
    findMatchingSkill(question: string): SkillDefinition | undefined;
    /**
     * 检查是否已初始化
     */
    isInitialized(): boolean;
    /**
     * 重新加载所有 skills
     */
    reload(): Promise<void>;
    getDisplayContractIssues(): DisplayContractIssue[];
}
export declare const skillRegistry: SkillRegistry;
/**
 * 确保 skill registry 已初始化
 * NOTE: This function is safe to call concurrently - it will only initialize once
 */
export declare function ensureSkillRegistryInitialized(): Promise<void>;
/**
 * 获取默认的 skills 目录
 */
export declare function getSkillsDir(): string;
//# sourceMappingURL=skillLoader.d.ts.map