/** * @license * Copyright 2025 OSAgent OC * SPDX-License-Identifier: Apache-2.0 */ import type { RegisteredSkill, DetectedSkill } from './types.js'; import { EmbeddingService } from '../services/embeddings/index.js'; /** * Skill match result */ export interface SemanticSkillMatch { skill: RegisteredSkill; similarity: number; matchType: 'semantic' | 'keyword' | 'hybrid'; matchedPatterns: string[]; } /** * Semantic Skill Matcher * * Uses embeddings for semantic similarity matching in addition to * keyword matching. Provides more intelligent skill selection based * on user intent rather than exact keyword matches. */ export declare class SemanticSkillMatcher { private embeddingService; private skillCache; private initialized; private readonly similarityThreshold; private readonly keywordBoost; constructor(options?: { embeddingService?: EmbeddingService; similarityThreshold?: number; keywordBoost?: number; }); /** * Initialize by pre-computing skill embeddings */ initialize(skills: RegisteredSkill[]): Promise; /** * Cache embedding for a skill */ private cacheSkillEmbedding; /** * Find matching skills for a prompt using semantic + keyword matching */ findMatches(prompt: string, skills: RegisteredSkill[], limit?: number): Promise; /** * Find best matching skill */ findBestMatch(prompt: string, skills: RegisteredSkill[]): Promise; /** * Convert match to DetectedSkill format */ matchToDetectedSkill(match: SemanticSkillMatch): DetectedSkill; /** * Check if semantic matching is available */ isSemanticAvailable(): Promise; /** * Get cache statistics */ getCacheStats(): { skillCount: number; initialized: boolean; }; /** * Clear cached embeddings */ clearCache(): void; /** * Refresh cache for specific skills */ refreshCache(skills: RegisteredSkill[]): Promise; } export declare function getDefaultSemanticMatcher(): SemanticSkillMatcher;