/** * MCP tool handlers for semantic search and feature insertion: * search_code, suggest_insertion_points, search_specs. */ export type InsertionRole = 'entry_point' | 'orchestrator' | 'hub' | 'utility' | 'internal'; export type InsertionStrategy = 'extend_entry_point' | 'add_orchestration_step' | 'cross_cutting_hook' | 'extract_shared_logic' | 'call_alongside'; export interface InsertionCandidate { rank: number; score: number; semanticScore: number; name: string; filePath: string; className?: string; language: string; signature?: string; docstring?: string; role: InsertionRole; insertionStrategy: InsertionStrategy; reason: string; fanIn: number; fanOut: number; isHub: boolean; isEntryPoint: boolean; } export declare function classifyRole(fanIn: number, fanOut: number, isHub: boolean, isEntryPoint: boolean): InsertionRole; export declare function deriveStrategy(role: InsertionRole): InsertionStrategy; export declare function buildReason(name: string, role: InsertionRole, strategy: InsertionStrategy, fanIn: number, fanOut: number): string; /** * Composite score = semanticRelevance * INSERTION_SEMANTIC_WEIGHT + structuralBonus * INSERTION_STRUCTURAL_WEIGHT. * * `semanticRelevance` must be in the 0-1 range (higher = more relevant). * Callers using VectorIndex.search (hybrid/RRF or BM25) should normalise scores * into [0, 1] before calling this function. */ export declare function compositeScore(semanticRelevance: number, role: InsertionRole): number; /** * MCP retrieval strategy: semantic search → graph neighborhood enrichment. * * Returns the top-k semantic results, each enriched with: * - callers / callees from the call graph (graph-first context) * - linkedSpecs from mapping.json (bidirectional code↔spec linking) */ export declare function handleSearchCode(directory: string, query: string, limit?: number, language?: string, minFanIn?: number, tokenBudget?: number): Promise; /** * Find the best places in the codebase to implement a new feature. */ export declare function handleSuggestInsertionPoints(directory: string, description: string, limit?: number, language?: string): Promise; /** * Return the full content of a spec domain's spec.md plus its mapping entries. */ export declare function handleGetSpec(directory: string, domain: string): Promise; /** * List all spec domains available in the project (reads openspec/specs/ directory). * Useful for the agent to discover what domains exist before doing a targeted search. */ export declare function handleListSpecDomains(directory: string): Promise; /** * Semantic search over the spec index built by "openlore analyze --embed" * or "openlore analyze --reindex-specs". */ export declare function handleSearchSpecs(directory: string, query: string, limit?: number, domain?: string, section?: string): Promise; /** * Unified search that combines code and spec indexes with cross-scoring */ export declare function handleUnifiedSearch(directory: string, query: string, limit?: number, language?: string, domain?: string, section?: string): Promise; //# sourceMappingURL=semantic.d.ts.map