UNPKG

il2cpp-dump-analyzer-mcp

Version:

Agentic RAG system for analyzing IL2CPP dump.cs files from Unity games

103 lines (102 loc) 3.24 kB
/** * Interface for hash managers to ensure compatibility */ export interface IHashManager { calculateFileHash(filePath: string): string; isFileProcessed(filePath: string): boolean; markFileAsProcessed(filePath: string): string; getFileHash(filePath: string): string; removeFileHash(filePath: string): boolean; clearAllHashes(): void; getAllHashes(): string[]; getProcessedCount(): number; getInfo(): { hashFilePath?: string; processedCount: number; }; initialize?(): Promise<void>; isFileProcessedAsync?(filePath: string): Promise<boolean>; } /** * Manages file hashes in Supabase to prevent duplicate processing of dump.cs files */ export declare class SupabaseHashManager implements IHashManager { private supabaseClient; private tableName; private processedHashes; private isInitialized; constructor(supabaseUrl: string, supabaseKey: string, tableName?: string); /** * Initialize the hash manager by loading existing hashes from Supabase */ initialize(): Promise<void>; /** * Calculate SHA-256 hash of a file * @param filePath Path to the file * @returns SHA-256 hash as hex string */ calculateFileHash(filePath: string): string; /** * Check if a file has already been processed * @param filePath Path to the dump.cs file * @returns true if file was already processed, false otherwise * @deprecated Use isFileProcessedAsync for proper async handling */ isFileProcessed(filePath: string): boolean; /** * Async version that checks both cache and database */ isFileProcessedAsync(filePath: string): Promise<boolean>; /** * Mark a file as processed by storing its hash * @param filePath Path to the dump.cs file * @returns The hash that was stored */ markFileAsProcessed(filePath: string): string; /** * Async version of markFileAsProcessed */ markFileAsProcessedAsync(filePath: string): Promise<string>; /** * Get the hash of a file without marking it as processed * @param filePath Path to the dump.cs file * @returns The SHA-256 hash of the file */ getFileHash(filePath: string): string; /** * Remove a hash from the processed list (useful for reprocessing) * @param filePath Path to the dump.cs file * @returns true if hash was removed, false if it wasn't found */ removeFileHash(filePath: string): boolean; /** * Async version of removeFileHash */ removeFileHashAsync(filePath: string): Promise<boolean>; /** * Clear all processed hashes */ clearAllHashes(): void; /** * Async version of clearAllHashes */ clearAllHashesAsync(): Promise<void>; /** * Get all processed hashes * @returns Array of all stored hashes */ getAllHashes(): string[]; /** * Get the number of processed files * @returns Count of processed files */ getProcessedCount(): number; /** * Get information about the hash storage * @returns Object with table name and count */ getInfo(): { hashFilePath?: string; processedCount: number; }; }