il2cpp-dump-analyzer-mcp
Version:
Agentic RAG system for analyzing IL2CPP dump.cs files from Unity games
100 lines (99 loc) • 3.2 kB
TypeScript
import { SupabaseClient } from '@supabase/supabase-js';
import { Document } from '@langchain/core/documents';
import { Embeddings } from '@langchain/core/embeddings';
import { CodeChunk } from './chunker';
/**
* Vector store for IL2CPP code chunks using Supabase
* Fixed version with improved error handling and consistency
*/
export declare class SupabaseIL2CPPVectorStore {
private embeddings;
supabaseClient: SupabaseClient;
private tableName;
private dimensions;
private isInitialized;
private initializationPromise;
/**
* Initialize the Supabase vector store
* @param embeddings Embeddings instance to use
* @param supabaseUrl Supabase URL
* @param supabaseKey Supabase API key
* @param tableName Table name for vector storage
*/
constructor(embeddings: Embeddings, supabaseUrl: string, supabaseKey: string, tableName?: string);
/**
* Get dimensions from embeddings instance with proper fallback
*/
private getDimensionsFromEmbeddings;
/**
* Ensure the vector store is properly initialized
*/
private ensureInitialized;
/**
* Initialize the Supabase table with the correct schema
*/
private initializeTable;
/**
* Create a new instance of the vector store from texts
*/
static fromTexts(texts: string[], metadatas: Record<string, any>[], embeddings: Embeddings, supabaseUrl: string, supabaseKey: string, tableName?: string): Promise<SupabaseIL2CPPVectorStore>;
/**
* Add documents to the vector store with improved error handling
*/
addDocuments(documents: Document[]): Promise<void>;
/**
* Filter out documents that already exist in the database
*/
private filterExistingDocuments;
/**
* Generate embeddings for documents with proper validation
*/
private generateEmbeddings;
/**
* Validate and normalize a single embedding
*/
private validateEmbedding;
/**
* Insert documents in batches with proper error handling
*/
private insertDocumentsBatch;
/**
* Insert a single batch of documents
*/
private insertSingleBatch;
/**
* Add code chunks to the vector store
*/
addCodeChunks(chunks: CodeChunk[]): Promise<void>;
/**
* Search for similar documents based on a query string
*/
similaritySearch(query: string, k?: number): Promise<Document[]>;
/**
* Search for similar documents with scores
*/
similaritySearchWithScore(query: string, k?: number): Promise<[Document, number][]>;
/**
* Get the total number of documents in the vector store
*/
getDocumentCount(): Promise<number>;
/**
* Delete all documents from the vector store
*/
deleteAll(): Promise<void>;
/**
* Get the dimensionality of the embeddings
*/
getDimension(): number;
/**
* Generate a unique hash for a document based on its content and metadata
*/
private generateDocumentHash;
/**
* Check if the vector store is properly configured and accessible
*/
healthCheck(): Promise<{
healthy: boolean;
message: string;
}>;
}