import { type EngineListPage, type EngineListQuery, type RecordStore, type VendoRecord, type Watermark } from "@vendoai/core"; import type { Db } from "./db.js"; import type { ThreadRow } from "./helpers/types.js"; export declare const RESERVED_COLLECTIONS: readonly ["vendo_grants", "vendo_approvals", "vendo_audit", "vendo_threads", "vendo_automations", "vendo_runs", "vendo_apps", "vendo_effects", "vendo_app_grants"]; export declare const DEDICATED_RECORD_COLLECTIONS: readonly ["vendo_mcp_clients", "vendo_mcp_grants", "vendo_knowledge_docs", "vendo_knowledge_chunks"]; /** The routed collections whose table carries a revision counter, so their door * offers guarded writes (01 §12). A LITERAL because `atomic` is defined inline * per case in `configFor` below and there is nothing to read it off of without * a Db; the hosted client mirrors it for feature detection, and * tests/hosted-store.atomic-parity.test.ts holds both to the real doors. */ export declare const ATOMIC_RESERVED_COLLECTIONS: readonly ["vendo_threads", "vendo_automations", "vendo_apps", "vendo_effects"]; export type ReservedCollection = typeof RESERVED_COLLECTIONS[number]; /** The column each routed collection carries its own AGE in, and the keyset a * page walks. A map rather than a literal per case: this router is mirrored * door-for-door by Vendo Cloud's own typed doors, and a value copied across * that seam is a retention sweep and a reader disagreeing about which column * "older" is measured on — silently, in one deployment only. Exported so the * mirror reads it instead of restating it. */ export declare const RESERVED_CURSOR_COLUMNS: { readonly vendo_grants: "granted_at"; readonly vendo_approvals: "created_at"; readonly vendo_audit: "at"; readonly vendo_threads: "created_at"; readonly vendo_automations: "created_at"; readonly vendo_runs: "started_at"; readonly vendo_apps: "created_at"; readonly vendo_effects: "at"; readonly vendo_app_grants: "created_at"; }; export declare function threadRecord(row: ThreadRow): VendoRecord; export declare function createReservedRecordStore(db: Db, collection: string): RecordStore | undefined; /** * `engine.list`'s FORWARD walk (01 §12 `Watermark`): oldest-first from a strict * lower bound on an indexed field, for the meter that has to resume where its * last pass stopped. The ordinary door pages newest-first and cannot express it. * * The gates live HERE, not at the call site, so no direct caller can bypass * them, and `configFor`'s `select`/`fromDb` are what make a walked record * indistinguishable from a listed one. * * PRECISION IS THE WHOLE POINT. The bound is compared at the column's FULL * precision (never `cursorMs`, which truncates to milliseconds) and the value * inside the echoed token is Postgres' own text rendering, so it round-trips * through `$1::timestamptz` unchanged. Do not route it through a JS `Date`: a * microsecond timestamp truncated to ms moves the bound BACKWARDS, and the * console lost a window of runs to exactly that — re-read and double-counted. * `Watermark.after` is contractually opaque precisely so this can stay a * database-native value. */ export declare function watermarkPage(db: Db, collection: string, query: EngineListQuery & { watermark: Watermark; }): Promise; //# sourceMappingURL=routing.d.ts.map