@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
48 lines • 3.36 kB
TypeScript
import type { QdrantAccessor } from '../../accessor/qdrant.ts';
import type { PointTest, QdrantPoint, QdrantRow } from './types.ts';
export declare const SCROLL_BATCH = 256;
/**
* The non-string JSON scalar a rendered group segment also spells, or null.
*
* A group value renders through `valueText`, so a boolean or a number lists
* as its compact JSON and the segment alone cannot say which type the
* payload holds. Only a spelling `valueText` would produce counts: `007`,
* `-0` and `1.50` are strings and nothing else.
*/
export declare function jsonScalar(text: string): boolean | number | null;
/**
* What one rendered group segment matches in the payload: the string itself
* always, and when the segment also spells a JSON scalar, that typed value
* too, so descending into the `true` or `1.5` directory the listing
* advertised finds the boolean or float points behind it. A number matches
* as a closed range, which Qdrant applies to integer and float payloads
* alike where `match` does not.
*/
export declare function condition(key: string, text: string): Record<string, unknown>;
export declare function buildFilter(filters: Record<string, string>): Record<string, unknown> | undefined;
/** Keep points whose id starts with a literal name prefix. */
export declare function idPrefixTest(prefix: string): PointTest;
/** Keep points whose payload value starts with a literal prefix. */
export declare function valuePrefixTest(column: string, prefix: string, basename?: boolean): PointTest;
/** Keep the first point of every raw value that renders as one group name. */
export declare function exactNameTest(column: string, name: string, basename: boolean, seen: Set<string>): PointTest;
export declare function pointToRow(point: QdrantPoint, idField: string): QdrantRow;
export declare function candidateIds(rowId: string): (string | number)[];
export declare function listTables(accessor: QdrantAccessor): Promise<string[]>;
export declare function tableExists(accessor: QdrantAccessor, name: string): Promise<boolean>;
export declare function distinctValues(accessor: QdrantAccessor, table: string, column: string, filters: Record<string, string>, limit: number, prefix?: string, basename?: boolean): Promise<string[]>;
/**
* The raw payload values one rendered group segment stands for.
*
* A basename drops the value's parents, so two sources can render as the
* same directory. Telling them apart is a question about every point under
* the parent group, not about the first `maxRows`: the scroll runs until it
* is exhausted or a second distinct value has rendered as `name`, whichever
* comes first. One value is the answer; two is a collision for the caller
* to refuse.
*/
export declare function resolveGroup(accessor: QdrantAccessor, table: string, column: string, filters: Record<string, string>, name: string, basename?: boolean): Promise<string[]>;
export declare function rowsMatching(accessor: QdrantAccessor, table: string, filters: Record<string, string>, limit: number, prefix?: string): Promise<QdrantRow[]>;
export declare function rowRecord(accessor: QdrantAccessor, table: string, idField: string, rowId: string): Promise<QdrantRow | null>;
export declare function searchRows(accessor: QdrantAccessor, table: string, query: string, limit: number): Promise<QdrantRow[]>;
//# sourceMappingURL=query.d.ts.map