import { o as GQPSchema$1, n as GQPNode, g as GQPCapability, k as GQPEdge, i as GQPCursor, q as NeighborhoodView, l as GQPEngine, h as GQPConfig, z as ToolCallResult, G as GQPAdapter, a as GQPPlugin, A as Validator, x as SecurityManager } from './types-CqJN-Ev5.js'; /** * GQP Schema Manager * Manages the virtual schema representing all data sources */ declare class GQPSchema implements GQPSchema$1 { private nodes; private rootNodeNames; private edgeIndex; /** * Add a node to the schema */ addNode(node: GQPNode, isRoot?: boolean): void; /** * Get a node by name */ getNode(name: string): GQPNode | undefined; /** * Get all root nodes (entry points for exploration) */ getRootNodes(): GQPNode[]; /** * Get neighboring nodes (connected via edges) */ getNeighbors(nodeName: string, limit?: number): GQPNode[]; /** * Get all nodes in the schema */ getAllNodes(): GQPNode[]; /** * Get total node count */ getNodeCount(): number; /** * Get all unique capabilities across the schema */ getAllCapabilities(): GQPCapability[]; /** * Find shortest path between two nodes */ findPath(from: string, to: string, maxDepth?: number): string[] | null; /** * Get edge information between two nodes */ getEdge(from: string, to: string): GQPEdge | undefined; /** * Search nodes by name or description */ searchNodes(query: string, limit?: number): GQPNode[]; /** * Clear all nodes */ clear(): void; /** * Export schema as JSON-serializable object */ toJSON(): { nodes: GQPNode[]; rootNodes: string[]; capabilities: GQPCapability[]; }; /** * Create schema from JSON */ static fromJSON(data: { nodes: GQPNode[]; rootNodes: string[]; }): GQPSchema; } /** * GQP Graph Cursor * Manages navigation state through the data graph */ declare class GQPGraphCursor { private schema; private cursor; private maxPathLength; constructor(schema: GQPSchema, startNode?: string, maxPathLength?: number); /** * Get the cursor ID */ getId(): string; /** * Get the current cursor state */ getState(): GQPCursor; /** * Get current node name */ getCurrentNode(): string | null; /** * Get cursor creation time */ getCreatedAt(): number; /** * Navigate to a specific node */ navigateTo(nodeName: string): NeighborhoodView; /** * Go back to previous node */ goBack(): NeighborhoodView | null; /** * Reset cursor to initial state */ reset(): void; /** * Get current neighborhood view (limited context for agents) */ getNeighborhood(size?: number): NeighborhoodView; /** * Check if a node is reachable from current position */ canReach(nodeName: string, maxDepth?: number): boolean; /** * Get suggested next nodes based on traversal patterns */ getSuggestedNodes(limit?: number): string[]; /** * Update neighbors list based on current position */ private updateNeighbors; /** * Serialize cursor for storage/transport */ toJSON(): GQPCursor; /** * Restore cursor from serialized state */ static fromJSON(schema: GQPSchema, state: GQPCursor, maxPathLength?: number): GQPGraphCursor; } /** * Cursor manager for handling multiple cursors (multi-session support) */ declare class CursorManager { private cursors; private schema; private maxCursors; private cursorTTL; private maxPathLength; constructor(schema: GQPSchema, maxCursors?: number, cursorTTL?: number, maxPathLength?: number); /** * Create a new cursor */ create(startNode?: string): GQPGraphCursor; /** * Get cursor by ID */ get(id: string): GQPGraphCursor | undefined; /** * Delete a cursor */ delete(id: string): boolean; /** * Get or create cursor */ getOrCreate(id?: string, startNode?: string): GQPGraphCursor; /** * Clear all cursors */ clear(): void; /** * Get cursor count */ size(): number; /** * Check if cursor is expired */ private isExpired; /** * Evict expired cursors */ private evictExpired; /** * Evict oldest cursor */ private evictOldest; } /** * GQP Engine * The main GQP class - consolidates 50+ tools into ONE dynamic navigable tool */ /** * GQP - The Universal Agent Data Layer * * Transforms messy databases and APIs into an intelligent, traversable graph * optimized for LLM agents. * * @example * ```typescript * import { GQP } from '@mzhub/gqp'; * import { fromPrisma } from '@mzhub/gqp/prisma'; * * const graph = new GQP({ * sources: { * database: fromPrisma(prisma) * } * }); * * // Agent calls this ONE tool instead of 50+ separate tools * const result = await graph.handleToolCall({ * action: 'explore' * }); * ``` */ declare class GQP implements GQPEngine { private schema; private adapters; private plugins; private cursorManager; private executor; private validator; private security; private config; private initialized; private schemaRefreshTimer?; constructor(config: GQPConfig); /** * Initialize the engine - introspects all sources and builds schema */ initialize(): Promise; /** * Refresh the schema (useful for detecting database changes) */ refreshSchema(): Promise; /** * Cleanup and destroy the engine */ destroy(): Promise; /** * Ensure engine is initialized before operations */ private ensureInitialized; /** * Handle a tool call from an agent * This is the SINGLE entry point that replaces 50+ individual tools */ handleToolCall(params: unknown): Promise; /** * Explore - discover available data nodes * This is the entry point for agents to understand what data is available */ private explore; /** * Navigate - focus on a specific node to see its fields and relations */ private navigate; /** * Query - execute filtered search on a node */ private query; /** * Introspect - get full schema information */ private introspect; /** * Find similar strings (for "did you mean" suggestions) */ private findSimilar; /** * Simple string similarity (Dice coefficient) */ private similarity; /** * Get available operations for a node */ private getNodeOperations; /** * Get capabilities for a field */ private getFieldCapabilities; getSchema(): GQPSchema$1; getAdapter(name: string): GQPAdapter | undefined; getPlugins(): GQPPlugin[]; /** * Create a new cursor */ createCursor(startNode?: string): GQPGraphCursor; /** * Get cursor by ID */ getCursor(id: string): GQPGraphCursor | undefined; /** * Get validator for external use */ getValidator(): Validator; /** * Get security manager for external use */ getSecurityManager(): SecurityManager; /** * Generate tool definition for MCP/OpenAI/LangChain * This is the single tool that replaces 50+ tools */ getToolDefinition(): { name: string; description: string; inputSchema: object; }; } export { CursorManager as C, GQPSchema as G, GQP as a, GQPGraphCursor as b };