/** * Progressive-disclosure helpers (Spec 25 Phase C / P2–P5). * * OpenLore's answer to headroom's reversible compression: return the smallest * sufficient structural fact plus an *exact* expansion handle, and let a caller * fit the result to a token budget deterministically. Because our IDs are * deterministic, expansion is exact (call `get_function_body(directory, * filePath, name)`), never a fuzzy re-search. */ /** * Uniform expansion handle attached to every disclosable item: `name::filePath`. * An agent expands exactly one body with `get_function_body` only if it needs * the implementation — turning a would-be follow-up read into a cheap, optional, * one-shot call instead of a blind re-search (the P2 contract). */ export declare function expandHandle(name: string, filePath: string): string; export interface BudgetOutcome { kept: T[]; /** How many items were dropped to fit the budget (0 when none / no budget). */ omitted: number; } /** * Greedily keep score-ordered items until `budget` tokens are exhausted (P4). * Items are assumed already importance-ranked by the caller; at least one item * is always kept so a tiny budget still yields a usable answer. Deterministic: * same items + budget → same output (uses the char-based `estimateTokens`). */ export declare function applyTokenBudget(items: T[], budget: number | undefined): BudgetOutcome; /** * Collapse *exact* duplicates — same name AND signature AND docstring — to one * exemplar that lists the other locations in `duplicateOf` (P3, conservative). * Requiring an exact triple match means two genuinely different functions that * merely share a name are never merged; only true copies (generated code, * vendored duplicates, re-exports) collapse. Order is preserved. */ export declare function collapseExactDuplicates(items: T[]): Array; /** The omission note appended when a token budget drops items (P4). */ export declare function omissionNote(omitted: number, expandHint: string): string; /** Output verbosity for a tool that supports a concise summary vs. the full payload. */ export type ResponseFormat = 'concise' | 'detailed'; /** * Normalize an untrusted `responseFormat` argument to the concise-by-default * contract. Anything other than the exact string `'detailed'` resolves to * `'concise'` (the safe, cheap default), so a typo or a missing value never * silently returns the large payload. */ export declare function normalizeResponseFormat(value: unknown): ResponseFormat; /** A truncation receipt: how many items were withheld and how to get them. */ export interface TruncationReceipt { omitted: number; detail: string; } /** * Build a truncation receipt when a bounded result withholds items, or `null` * when nothing was dropped (so callers can spread it conditionally). The `detail` * names the exact narrower/fuller call to retrieve the rest. */ export declare function truncationReceipt(omitted: number, detail: string): TruncationReceipt | null; /** How many items a concise list-inventory summary keeps before truncating. */ export declare const CONCISE_INVENTORY_SAMPLE = 20; /** * Summarize a uniform `{ cached, total, : [...] }` inventory result for the * concise/detailed contract. `detailed` returns the result unchanged; `concise` * keeps `total` + the first `sampleSize` items + a truncation receipt naming the * `detail` call for the rest. Fail-soft: a result whose `listKey` is not an array * is returned unchanged (never drops an unexpected shape). */ export declare function summarizeListInventory(result: Record, listKey: string, format: ResponseFormat, detail: string, sampleSize?: number): Record; //# sourceMappingURL=progressive.d.ts.map