aindreyway-mcp-codex-keeper
Version:
An intelligent MCP server that serves as a guardian of development knowledge, providing AI assistants with curated access to latest documentation and best practices
87 lines (86 loc) • 2.73 kB
TypeScript
import { DocSource } from '../types/index.js';
/**
* Error thrown when file system operations fail
*/
export declare class FileSystemError extends Error {
readonly cause?: unknown | undefined;
constructor(message: string, cause?: unknown | undefined);
}
/**
* Manages file system operations for documentation storage
*/
export declare class FileSystemManager {
private docsPath;
private sourcesFile;
private cacheDir;
/**
* Creates a new FileSystemManager instance
* @param basePath - Base path for storing documentation
*/
constructor(basePath: string);
/**
* Ensures required directories exist
* @throws {FileSystemError} If directory creation fails
*/
ensureDirectories(): Promise<void>;
/**
* Saves documentation content to cache
* @param name - Documentation name
* @param content - Content to save
* @throws {FileSystemError} If save operation fails
*/
saveDocumentation(name: string, content: string): Promise<void>;
/**
* Saves documentation sources metadata
* @param docs - Array of documentation sources
* @throws {FileSystemError} If save operation fails
*/
saveSources(docs: DocSource[]): Promise<void>;
/**
* Loads documentation sources metadata
* @returns Array of documentation sources
* @throws {FileSystemError} If load operation fails
*/
loadSources(): Promise<DocSource[]>;
/**
* Searches for text in cached documentation
* @param name - Documentation name
* @param searchQuery - Text to search for
* @returns Whether the text was found
*/
searchInDocumentation(name: string, searchQuery: string): Promise<boolean>;
/**
* Lists all cached documentation files
* @returns Array of filenames
* @throws {FileSystemError} If directory reading fails
*/
listDocumentationFiles(): Promise<string[]>;
/**
* Gets documentation file path
* @param name - Documentation name
* @returns Path to documentation file
*/
getDocumentationPath(name: string): string;
/**
* Checks if documentation exists in cache
* @param name - Documentation name
* @returns Whether documentation exists
*/
hasDocumentation(name: string): Promise<boolean>;
/**
* Gets documentation file name
* @param name - Documentation name
* @returns Sanitized file name
*/
private getDocumentationFileName;
/**
* Gets base documentation path
* @returns Base path for documentation storage
*/
getDocsPath(): string;
/**
* Gets cache directory path
* @returns Path to cache directory
*/
getCachePath(): string;
}