/** * ProjectMemoryLoader - Loads project-level instructions from markdown files * * Supports various LLM-specific naming conventions: * - CLAUDE.md, .claude.md, .claude/instructions.md (Claude/Anthropic) * - GEMINI.md, .gemini.md, .gemini/instructions.md (Google Gemini) * - COPILOT.md, .github/copilot-instructions.md (GitHub Copilot) * - GPT.md, OPENAI.md (OpenAI) * - CURSOR.md, .cursor/rules (Cursor) * - CODEIUM.md (Codeium) * * Also supports generic names: * - PROJECT.md, INSTRUCTIONS.md, AI.md, CONTEXT.md * * @example * ```typescript * const loader = new ProjectMemoryLoader({ * providers: ['claude', 'gemini'], * includeGeneric: true, * }); * * const memory = await loader.load('/path/to/project'); * console.log(memory.content); // Combined instructions * ``` */ import type { LLMProviderName, ProjectMemory, FilePattern, ProjectMemoryOptions, ProjectMemoryEventHandler, MemoryDiscoveryResult, ProviderPatterns } from './types.js'; /** * Built-in patterns for various LLM providers */ declare const PROVIDER_PATTERNS: ProviderPatterns[]; /** * Generic patterns that apply to any LLM */ declare const GENERIC_PATTERNS: FilePattern[]; /** * ProjectMemoryLoader discovers and loads project-specific instructions */ export declare class ProjectMemoryLoader { private readonly options; private readonly patterns; private readonly eventHandlers; constructor(options?: ProjectMemoryOptions); /** * Build the list of patterns to search for */ private buildPatterns; /** * Load project memory from a directory * * @param rootDir - Starting directory for search * @returns Loaded project memory */ load(rootDir: string): Promise; /** * Discover memory files without loading content * * @param rootDir - Starting directory for search * @returns Discovery result with paths */ discover(rootDir: string): Promise; /** * Get the list of directories to search */ private getSearchDirectories; /** * Combine content from multiple files */ private combineContent; /** * Format the header for a file */ private formatHeader; /** * Register an event handler */ onEvent(handler: ProjectMemoryEventHandler): () => void; /** * Emit an event */ private emit; /** * Get the patterns being used */ getPatterns(): FilePattern[]; /** * Get the configured options */ getOptions(): Required; } /** * Create a ProjectMemoryLoader with default options */ export declare function createProjectMemoryLoader(options?: ProjectMemoryOptions): ProjectMemoryLoader; /** * Quick utility to load project memory */ export declare function loadProjectMemory(rootDir: string, options?: ProjectMemoryOptions): Promise; /** * Quick utility to check if a directory has project memory files */ export declare function hasProjectMemory(rootDir: string, options?: ProjectMemoryOptions): Promise; /** * Get built-in patterns for a provider */ export declare function getProviderPatterns(provider: LLMProviderName): FilePattern[]; /** * Get all supported provider names */ export declare function getSupportedProviders(): LLMProviderName[]; /** * Get generic patterns */ export declare function getGenericPatterns(): FilePattern[]; export { PROVIDER_PATTERNS, GENERIC_PATTERNS };