import { type SQL } from "drizzle-orm"; import { type Database } from "./database.js"; /** * Router items in a session's history. This must stay textually identical to * the predicate of session_history_items_tool_router_idx (migration 0806): * PostgreSQL only uses a partial index whose predicate the query implies, and * without it the probe parses every history item of a session that never used * the router. */ export declare const toolRouterHistoryItemPredicate: SQL; export declare function toolRouterHistoryProbe(db: Pick, input: { workspaceId: string; sessionId: string | SQL; }): Omit; }, "partial", Record<"session_history_items", "not-null">, false, "limit" | "where", { present: number; }[], { present: import("drizzle-orm").DrizzleTypeError<"You cannot reference this field without assigning it an alias first - use `.as()`">; }>, "limit" | "where">; /** Historical router exposure is a protocol fact, not renewed tool authority. */ export declare function sessionHasToolRouterHistory(db: Database, input: { accountId: string; workspaceId: string; sessionId: string; }): Promise; /** The same indexed history fact for a response page, with one scoped transaction. */ export declare function sessionsWithToolRouterHistory(db: Database, input: { accountId: string; workspaceId: string; sessionIds: readonly string[]; }): Promise>;