import { type TranscriptBlock } from "./transcript.js"; import type { TreeNode } from "./types.js"; export type SearchKind = "user" | "call" | "tool" | "hosted" | "error"; /** The search kind each searched block kind reports. A kind not listed is * not searched: thread dividers, turns, pauses, and rewrite headings. */ export declare const SEARCHED_BLOCKS: Partial>; export declare const SEARCH_KINDS: SearchKind[]; export type Found = { count: number; first: number; length: number; }; export type Matcher = { test(text: string): Found | undefined; }; /** A matcher for a plain pattern or, with `regex`, a JavaScript regular * expression. Case is ignored unless `caseSensitive`. A match of no * characters does not count. */ export declare function matcherFor(pattern: string, options: { regex: boolean; caseSensitive: boolean; }): Matcher | { error: string; }; export type RowHit = { rowId: string; kind: SearchKind; header: string; matches: number; snippet: string; }; /** The story rows whose own text matches, in transcript order. Blocks that * name the same row (a system prompt and its call) are one hit, with * their matches added and the first block's snippet. */ export declare function searchTrace(trace: TreeNode, matcher: Matcher, options: { context: number; kinds: SearchKind[] | undefined; }): RowHit[]; /** One line: `context` characters each side of the match, runs of * whitespace collapsed, and an ellipsis where text was cut. A match longer * than twice the context is cut too, so a greedy regex cannot print a * whole tool result. */ export declare function snippetAround(text: string, at: number, length: number, context: number): string;