import type { Symbol as IndexSymbol, Ref } from './schema.js'; export declare function escapeLike(value: string): string; /** * Split `total` into chunk sizes drawn from a powers-of-two ladder (each ≤ * `max`), largest first. Example: total=1000, max=450 → [256, 256, 256, 128, * 64, 32, 8]. Distinct sizes ≤ log2(max)+1, so the same INSERT statement * re-prepares at most ~9 times ever — after that every chunk size is a cache * hit. INSERT VALUES rows cannot be padded (padding would insert garbage * rows), so variable-size chunks are the only option there — this makes the * variability bounded and tiny. */ export declare function ladderChunkSizes(total: number, max: number): number[]; /** * Pad `values` up to the next power-of-two length by repeating `values[0]`, * for single-statement IN-lists whose size is caller-determined (not chunked * by us). Safe because IN is set semantics: `x IN (a, a, b)` ≡ `x IN (a, b)`. * The bind overhead is at most ~2×, and every list length maps to one of * ~10 SQL strings instead of one per distinct count. */ export declare function padToInBucket(values: readonly T[]): T[]; /** Placeholder string with `count` bind markers — `count` should be a bucket. */ export declare function placeholders(count: number): string; /** * Chunk plan for IN-list sites (the pad-able counterpart to * {@link ladderChunkSizes}). When the whole list fits under `max`, it is ONE * chunk — a single statement, exactly like the pre-P4.12 code — and SQL-string * stability comes from {@link padToInBucket} instead. Only a list that exceeds * `max` is ladder-split, with the ladder capped at the largest power of two ≤ * max so chunks are already bucket sizes (padding is a no-op on them) and * can never pad past the variable budget. */ export declare function inListChunks(total: number, max: number): number[]; /** Normalize an indexed or user-supplied file path for comparison. */ export declare function posixIndexPath(file: string): string; /** * SQL predicate that matches a stored `file` column against a user-supplied * path. Agents pass project-relative paths (`src/calc.ts`); the index stores * absolute OS paths. Exact, slash-normalized, and suffix matches are accepted. */ export declare function indexedFileMatchSql(column?: string): string; /** Bind values for {@link indexedFileMatchSql}: exact, posix, suffix-LIKE. */ export declare function indexedFileMatchArgs(file: string): [string, string, string]; /** True when a stored file path belongs to a package name or path fragment. */ export declare function matchesIndexedPackageFilter(storedFile: string, packageLabel: string, filter: string): boolean; export declare function assignRefsToSymbols(refs: Ref[], symbols: IndexSymbol[]): Ref[]; /** * Resolve the per-project index directory. By default it lives under the * global project dir (`~/.wrongstack/projects//codebase-index`). */ export declare function resolveIndexDir(projectRoot: string, override?: string): string; /** * Optional index-directory override carried on the run context's `meta` bag. */ export declare function codebaseIndexDirOverride(ctx: { meta?: Record; }): string | undefined; //# sourceMappingURL=writer-helpers.d.ts.map