UNPKG

il2cpp-dump-analyzer-mcp

Version:

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

82 lines (81 loc) 3.08 kB
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 */ export declare class SupabaseIL2CPPVectorStore { private embeddings; supabaseClient: SupabaseClient; private tableName; private dimensions; /** * 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); /** * Initialize the Supabase table with the correct schema * This ensures the document_hash column exists for deduplication */ private initializeTable; /** * Create a new instance of the vector store from texts * @param texts Array of texts * @param metadatas Array of metadata objects * @param embeddings Embeddings instance * @param supabaseUrl Supabase URL * @param supabaseKey Supabase API key * @param tableName Table name * @returns New SupabaseIL2CPPVectorStore instance */ static fromTexts(texts: string[], metadatas: Record<string, any>[], embeddings: Embeddings, supabaseUrl: string, supabaseKey: string, tableName?: string): Promise<SupabaseIL2CPPVectorStore>; /** * Add documents to the vector store * @param documents Array of documents to add */ addDocuments(documents: Document[]): Promise<void>; /** * Add code chunks to the vector store * @param chunks Array of code chunks to add */ addCodeChunks(chunks: CodeChunk[]): Promise<void>; /** * Search for similar documents based on a query string * @param query Query string * @param k Number of results to return * @returns Array of documents with similarity scores */ similaritySearch(query: string, k?: number): Promise<Document[]>; /** * Search for similar documents with scores * @param query Query string * @param k Number of results to return * @returns Array of documents with similarity scores */ similaritySearchWithScore(query: string, k?: number): Promise<[Document, number][]>; /** * Get the total number of documents in the vector store * @returns Number of documents */ getDocumentCount(): Promise<number>; /** * Delete all documents from the vector store */ deleteAll(): Promise<void>; /** * Get the dimensionality of the embeddings * @returns The number of dimensions in the embedding vectors */ getDimension(): number; /** * Generate a unique hash for a document based on its content and metadata * @param document Document to generate hash for * @returns SHA-256 hash of the document content and metadata */ private generateDocumentHash; }