import { Client } from "./client.js"; import { Identity } from "./identity.js"; import type { KernelRecord } from "./types.js"; export interface GraphNodeConfig { id: string; url: string; did?: string; label?: string; isDefault?: boolean; } export interface GraphClientOptions { graphNode: string; identity?: Identity; apiKey?: string; namespace?: string; fetch?: typeof fetch; timeoutMs?: number; } export interface GraphSearchOptions { q: string; kinds?: string[]; trustMin?: number; domain?: string; limit?: number; attestationRequested?: boolean; } export interface GraphSearchHit { id: string; kind: string; source_instance_did?: string; trust?: number; snippet?: string; record?: KernelRecord; } export interface GraphSearchResult { hits: GraphSearchHit[]; graph_node_did?: string; graph_node_url: string; attestation_receipt?: Record; error?: string; } export interface GraphNodeQueryOptions { layer: string; startNode: string; traversal: { kind: "fold" | "bfs" | "dfs" | "shortest_path" | "components"; maxHops?: number; maxResults?: number; maxLatencySecs?: number; maxCostUsd?: number; projectionLevel?: "L0" | "L1" | "L2" | "L3"; }; predicate?: string; aggregator?: string; attestationRequested?: boolean; } export interface GraphNodeQueryResult { query_id: string; result_id?: string; result_shape?: "KEYED" | "MANY"; path?: { nodes: string[]; edges: unknown[]; }; aggregated_metric?: { type: string; value: unknown; }; traversal_metadata?: { hops_taken?: number; peers_queried?: string[]; peers_blocked?: string[]; blocked_reasons?: string[]; }; completion_codepath?: string; cost_usd?: number; latency_ms?: number; partial?: boolean; attestation_receipt?: Record; error?: string; } export declare class GraphClient { readonly graphNode: string; readonly client: Client; private readonly apiKey; private readonly fetchImpl; constructor(opts: GraphClientOptions); search(opts: GraphSearchOptions): Promise; query(opts: GraphNodeQueryOptions): Promise; discover>(category: "actors" | "instances" | "patterns" | "threads", filter?: Record): Promise<{ items: T[]; error?: string; }>; }