UNPKG

claude-flow

Version:

Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration

61 lines 2.05 kB
/** * Graph Edge Writer — ADR-130 Phase 1 * * Provides a minimal interface for inserting rows into the graph_edges * sql.js table defined by MEMORY_SCHEMA_V3. * * This module is intentionally thin: it opens the shared sql.js SQLite db * (the same file used by memory-initializer storeEntry), ensures the * graph_edges table exists, and returns a better-sqlite3-compatible * prepared-statement interface. * * The module is designed for fire-and-forget callers — every public function * suppresses errors internally so callers never need try/catch. * * @module v3/cli/memory/graph-edge-writer */ /** * Return the sql.js Database instance for graph_edges writes. * Creates the graph_edges table if it is absent (idempotent). * Returns null if sql.js is not available or db cannot be opened. */ export declare function getBridgeDb(customDbPath?: string): Promise<any | null>; export interface GraphEdgeInput { sourceId: string; targetId: string; relation: string; weight?: number; confidence?: number; decayRate?: number; lastReinforced?: string; witnessId?: string; embedding?: number[]; metadata?: Record<string, unknown>; dbPath?: string; } /** * Insert a single edge into graph_edges. * Fire-and-forget — errors are suppressed. * Returns true if the write succeeded, false otherwise. */ export declare function insertGraphEdge(input: GraphEdgeInput): Promise<boolean>; /** * Query graph_edges by source_id. * Returns rows or empty array on error. */ export declare function queryEdgesBySource(sourceId: string, relation?: string, dbPath?: string): Promise<Array<{ id: string; source_id: string; target_id: string; relation: string; weight: number; }>>; /** * Count rows in graph_edges (for test assertions). */ export declare function countGraphEdges(dbPath?: string): Promise<number>; /** * Reset the cached db handle (for tests that need a fresh DB). */ export declare function _resetBridgeDb(): void; //# sourceMappingURL=graph-edge-writer.d.ts.map