/** Stable-anchor paging and folding. The operation supplies the full-response budget check. */ import { Type, type Static } from "typebox"; import { type Outcome } from "../tools/result.js"; import { type HistoryEvent, type HistoryFilter, type HistoryPageItem, type HistoryProjection } from "./history.js"; type Candidate = { event: HistoryEvent; matchOffset?: number; preview?: HistoryPageItem; }; type AnchorParams = { before?: number; after?: number; limit?: number; max_chars_per_item?: number; }; export declare const HistoryPageSchema: Type.TObject<{ items: Type.TArray, Type.TLiteral<"assistant">, Type.TLiteral<"tool">, Type.TLiteral<"context">]>; created_at: Type.TUnion<[Type.TString, Type.TNull]>; tool: Type.TOptional; tool_name_omitted: Type.TOptional; tool_status: Type.TOptional, Type.TLiteral<"error">, Type.TLiteral<"unfinished">]>>; output_truncated: Type.TOptional; full_output_path: Type.TOptional>; nested_calls: Type.TOptional>; truncated: Type.TBoolean; total_chars: Type.TInteger; content: Type.TString; offset_chars: Type.TOptional; }>, Type.TObject<{ folded: Type.TLiteral; first_seq: Type.TInteger; last_seq: Type.TInteger; count: Type.TInteger; tools: Type.TRecord<"^.*$", Type.TInteger>; omitted_tools: Type.TOptional; }>]>>; older_before: Type.TUnion<[Type.TInteger, Type.TNull]>; newer_after: Type.TUnion<[Type.TInteger, Type.TNull]>; }>; /** One whole page payload, before it becomes an outcome. */ export type HistoryPage = Static; export declare function isConversationView(params: HistoryFilter): boolean; /** Grow the page in query order; shorten the first preview only when no full row fits. */ export declare function selectPage(projection: HistoryProjection, params: HistoryFilter & AnchorParams, vis: Candidate[], folds: boolean, fits: (page: HistoryPage) => boolean, maxChars: number): Outcome; export {};