/** * Introspection Service * * Pure functions for extracting file metadata from paths and content. * No I/O operations - all functions operate on provided data. */ import type { FileIntrospection, Project, ProjectStructure, Scope } from "../entities/introspection"; /** * Options for introspecting a file. */ export interface IntrospectFileOptions { /** File content for framework detection */ fileContent?: string; /** * Function to check if a file exists. * Used for README discovery without I/O in the domain layer. */ fileExists?: (filepath: string) => boolean; } /** * Extract introspection metadata for a file. * * @param filepath - Relative file path * @param structure - Project structure (from detectProjectStructure) * @param options - Optional configuration including file content and file existence checker */ export declare function introspectFile(filepath: string, structure: ProjectStructure, options?: IntrospectFileOptions | string): FileIntrospection; /** * Find the nearest README file by traversing up the directory hierarchy. * * @param filepath - Relative file path (normalized with forward slashes) * @param fileExists - Function to check if a file exists * @returns Relative path to the nearest README, or undefined if none found */ export declare function findNearestReadme(filepath: string, fileExists: (filepath: string) => boolean): string | undefined; /** * Extract keywords from introspection for search boosting. */ export declare function introspectionToKeywords(intro: FileIntrospection): string[]; /** * Detect scope from project name. */ export declare function detectScopeFromName(name: string): Scope; /** * Find which project a file belongs to. */ export declare function findProjectForFile(filepath: string, structure: ProjectStructure): Project; /** * Calculate search boost based on introspection and query. */ export declare function calculateIntrospectionBoost(intro: FileIntrospection, query: string): number;