import type { AccessContext, GraphEdgeHit, GraphEdgeInput, GraphEdgeQuery, GraphNodeHit, GraphNodeInput, GraphNodeQuery, GraphNodeRef, GraphEdgeRef, GraphEvidenceRemovalResult, SubGraph } from "./types.js"; /** * Load the AGE shared library for this session. On managed Postgres where age * is preloaded via shared_preload_libraries, an explicit LOAD is rejected with * `access to library "age" is not allowed` — tolerated, since preloaded means * there is nothing to do. */ export declare function prepareAgeSession(client: any): Promise; /** Parse a scalar agtype column value into a JS value. */ export declare function ag(v: any): any; /** Parse an agtype array column into string[]. */ export declare function agArr(v: any): string[]; /** * Typed Cypher layer (AGE). Provides the GraphStore READ/WRITE method bodies; * `HorizonDBGraphStore` wraps this with the lifecycle (initialize/close) to form * the full `GraphStore` provider (07 D2). This inner class deliberately does NOT * implement the lifecycle, so it is not itself a `GraphStore`. */ export declare class GraphQueries { private readonly pool; private readonly graphName; private readonly prepared; constructor(pool: any, graphName: string); private withAge; private cypher; searchGraphNodes(q: GraphNodeQuery, access?: AccessContext): Promise; /** * Idempotent, duplicate-anchor-proof evidence linking. A naive * `MERGE (f:Fact {scope_key}) MERGE (e)-[:EVIDENCED_BY]->(f)` is NOT safe * here: AGE has no unique constraints, so concurrent upserts can race the * anchor MERGE into duplicate :Fact nodes — after which a later MERGE * binds EVERY duplicate and mints extra edges. Instead: skip when any * edge already exists; bind exactly ONE anchor (WITH … LIMIT 1) or create * it when none exists. */ private linkEvidenceAnchor; /** EVIDENCED_BY scopeKeys per node, ACL-filtered (01 §6.1a), deduped * (duplicate anchors must never surface as duplicate evidence keys). */ private evidenceFor; searchGraphEdges(q: GraphEdgeQuery, access?: AccessContext): Promise; graphNeighbourhood(nodeKey: string, depth: number, _access?: AccessContext, opts?: { namespace?: string; }): Promise; /** * Cheap whole-graph counts for `graph_stats` (enhancedfactstore 07 P5): * a single `count()` Cypher per axis instead of a client-side fan-out. * AGE has no edge-only catalog, so edges are counted via a directed match. */ graphStats(opts?: { namespace?: string; }): Promise<{ nodeCount: number; edgeCount: number; }>; upsertGraphNode(n: GraphNodeInput): Promise; upsertGraphEdge(e: GraphEdgeInput): Promise; mergeGraphNodes(fromKey: string, intoKey: string, reason: string, opts?: { namespace?: string; }): Promise; deleteGraphNode(nodeKey: string, opts?: { namespace?: string; }): Promise; deleteGraphEdge(fromKey: string, toKey: string, predicateKey: string, opts?: { namespace?: string; }): Promise; removeGraphEvidence(scopeKey: string, opts?: { namespace?: string; }): Promise; /** * Drop graph data for an EXACT namespace (graph-fact-search enhancements, * `deleteGraphNamespace`). NOT subtree: only records whose own namespace * equals `namespace` are removed — child namespaces are deleted explicitly. * Edges with this namespace are removed first; then nodes with this * namespace are DETACH DELETEd (which also clears their remaining edges and * EVIDENCED_BY anchors). Idempotent / re-runnable. Refuses the reserved * `default` token / empty (the NULL partition is never bulk-deleted). */ deleteNamespaceData(namespace: string): Promise<{ nodesDeleted: number; edgesDeleted: number; }>; } //# sourceMappingURL=graph-queries.d.ts.map