UNPKG

octocode-mcp

Version:

Model Context Protocol (MCP) server for advanced GitHub repository analysis and code discovery. Provides AI assistants with powerful tools to search, analyze, and understand codebases across GitHub.

33 lines (32 loc) 1.05 kB
import type { CacheStats } from '../types.js'; export declare const CACHE_TTL_CONFIG: { readonly 'gh-api-code': 3600; readonly 'gh-api-repos': 7200; readonly 'gh-api-prs': 1800; readonly 'gh-api-file-content': 3600; readonly 'gh-repo-structure-api': 7200; readonly 'github-user': 900; readonly default: 86400; }; export type CachePrefix = keyof typeof CACHE_TTL_CONFIG | string; export declare function generateCacheKey(prefix: string, params: unknown, sessionId?: string): string; /** * Generic typed cache wrapper for raw data (avoids JSON round-trips) */ export declare function withDataCache<T>(cacheKey: string, operation: () => Promise<T>, options?: { ttl?: number; skipCache?: boolean; forceRefresh?: boolean; shouldCache?: (value: T) => boolean; }): Promise<T>; /** * Clear all cache entries and reset statistics */ export declare function clearAllCache(): void; /** * Get cache statistics */ export declare function getCacheStats(): CacheStats & { hitRate: number; cacheSize: number; };