import type { MindContext } from "./types.js"; /** One stored experience pair, as bytes. */ export interface CorpusPair { context: Uint8Array; continuation: Uint8Array; contextId: number; continuationId: number; /** Bytes of the query this pair was matched on — 0 when browsing. */ matchedBytes: number; /** True when the stored bytes ran past the declared preview capacity. */ contextTruncated: boolean; continuationTruncated: boolean; } /** Why a search produced no pairs. A STATE, so a caller's own layer can say it * in its own words — the byte layer does not speak. */ export type CorpusMiss = "matched" | "nothing-resolved" | "no-continuations"; export interface CorpusResult { pairs: CorpusPair[]; /** Query subtrees that content-addressed to a real stored node. */ resolved: number; /** Distinct edge-bearing contexts the climb reached. */ reached: number; /** Distinct contexts that carry a learnt continuation, store-wide. */ totalContexts: number; /** True when these are browse samples rather than search results. */ browsed: boolean; miss: CorpusMiss; } /** Which stored notes does this query reach? BYTES in, BYTES out. * * Exact content addressing through the machinery that already exists: the * query's recognised sites are the resolved subtrees, the climb goes up from * the biggest first, and a pair is a context that carries a continuation. */ export declare function searchCorpus(ctx: MindContext, queryBytes: Uint8Array, limit?: number): CorpusResult; /** Browse real pairs, striding the id space so the sample is spread rather than * one local cluster. DETERMINISTIC: `from` is the caller's own offset, so * browsing twice with different offsets shows different notes without a random * draw (the demo drew `Math.random()`, which the engine cannot do — same seed, * same order, same query must mean the same answer). */ export declare function sampleCorpus(ctx: MindContext, limit?: number, from?: number): CorpusResult;