/** * RuVector Hooks Storage Layer * * Supports PostgreSQL (preferred) with JSON fallback * Uses ruvector extension for vector operations and pgvector-compatible storage */ export interface QPattern { state: string; action: string; q_value: number; visits: number; last_update: number; } export interface MemoryEntry { id: string; memory_type: string; content: string; embedding: number[]; metadata: Record; timestamp: number; } export interface Trajectory { id: string; state: string; action: string; outcome: string; reward: number; timestamp: number; } export interface ErrorPattern { code: string; error_type: string; message: string; fixes: string[]; occurrences: number; } export interface SwarmAgent { id: string; agent_type: string; capabilities: string[]; success_rate: number; task_count: number; status: string; } export interface SwarmEdge { source: string; target: string; weight: number; coordination_count: number; } export interface IntelligenceStats { total_patterns: number; total_memories: number; total_trajectories: number; total_errors: number; session_count: number; last_session: number; } export interface StorageBackend { connect(): Promise; disconnect(): Promise; isConnected(): boolean; updateQ(state: string, action: string, reward: number): Promise; getQ(state: string, action: string): Promise; getBestAction(state: string, actions: string[]): Promise<{ action: string; confidence: number; }>; remember(type: string, content: string, embedding: number[], metadata: Record): Promise; recall(queryEmbedding: number[], topK: number): Promise; recordTrajectory(state: string, action: string, outcome: string, reward: number): Promise; recordError(code: string, errorType: string, message: string): Promise; getErrorFixes(code: string): Promise; recordSequence(fromFile: string, toFile: string): Promise; getNextFiles(file: string, limit: number): Promise>; registerAgent(id: string, type: string, capabilities: string[]): Promise; coordinateAgents(source: string, target: string, weight: number): Promise; getSwarmStats(): Promise<{ agents: number; edges: number; avgSuccess: number; }>; sessionStart(): Promise; getStats(): Promise; } export declare class JsonStorage implements StorageBackend { private data; private alpha; constructor(); private load; private save; private now; connect(): Promise; disconnect(): Promise; isConnected(): boolean; updateQ(state: string, action: string, reward: number): Promise; getQ(state: string, action: string): Promise; getBestAction(state: string, actions: string[]): Promise<{ action: string; confidence: number; }>; remember(type: string, content: string, embedding: number[], metadata: Record): Promise; recall(queryEmbedding: number[], topK: number): Promise; recordTrajectory(state: string, action: string, outcome: string, reward: number): Promise; recordError(code: string, errorType: string, message: string): Promise; getErrorFixes(code: string): Promise; recordSequence(fromFile: string, toFile: string): Promise; getNextFiles(file: string, limit: number): Promise>; registerAgent(id: string, type: string, capabilities: string[]): Promise; coordinateAgents(source: string, target: string, weight: number): Promise; getSwarmStats(): Promise<{ agents: number; edges: number; avgSuccess: number; }>; sessionStart(): Promise; getStats(): Promise; } export declare class PostgresStorage implements StorageBackend { private pool; private connectionString; private connected; constructor(connectionString?: string); connect(): Promise; disconnect(): Promise; isConnected(): boolean; private query; private initSchema; updateQ(state: string, action: string, reward: number): Promise; getQ(state: string, action: string): Promise; getBestAction(state: string, actions: string[]): Promise<{ action: string; confidence: number; }>; remember(type: string, content: string, embedding: number[], metadata: Record): Promise; recall(queryEmbedding: number[], topK: number): Promise; recordTrajectory(state: string, action: string, outcome: string, reward: number): Promise; recordError(code: string, errorType: string, message: string): Promise; getErrorFixes(code: string): Promise; recordSequence(fromFile: string, toFile: string): Promise; getNextFiles(file: string, limit: number): Promise>; registerAgent(id: string, type: string, capabilities: string[]): Promise; coordinateAgents(source: string, target: string, weight: number): Promise; getSwarmStats(): Promise<{ agents: number; edges: number; avgSuccess: number; }>; sessionStart(): Promise; getStats(): Promise; } export declare function createStorage(): Promise; export declare function createStorageSync(): StorageBackend; //# sourceMappingURL=storage.d.ts.map