/** * Intent-driven progressive disclosure for execution output. * * When `execute` / `execute_file` output exceeds a threshold, returning it * verbatim floods the agent's context window. Instead, when the caller passes * an `intent` query, we: * 1. chunk the output into sections (reuse the existing smart-chunker), * 2. build a tiny IN-MEMORY keyword index (TF + title boost) over those * sections, * 3. return ONLY the sections matching the intent query + a vocabulary-hint * list (top distinctive terms). * * This mirrors context-mode `intentSearch` (server.ts:1982) in shape but is * self-contained — it does NOT touch the persistent FTS5/PG keyword store, so * it can never OOM the shared e2e index or trigger a full-repo index. If * `intent` is absent or output is below threshold, the output is returned * verbatim (no indexing at all). */ /** Output ≥ this many bytes triggers intent search (when intent is set). */ export declare const INTENT_SEARCH_THRESHOLD = 5000; export interface IntentSection { label: string; lineStart: number; lineEnd: number; preview: string; } export interface IntentSearchResult { /** Whether intent search actually ran (output large enough + intent set). */ searched: boolean; /** Total output size (bytes). */ totalBytes: number; /** Total output lines. */ totalLines: number; /** Sections that matched the intent (only meaningful when searched). */ matchedSections: IntentSection[]; /** Distinctive vocabulary terms extracted from the output. */ vocabularyHints: string[]; } /** * Run intent search on `output` for `intent`. Returns the structured result; * the caller decides how to render it. * * Returns `searched: false` (and empty arrays) when the output is too small * or no intent was provided — in that case the caller returns output verbatim. */ export declare function intentSearch(output: string, intent: string | undefined, maxResults?: number): IntentSearchResult; /** * Render an IntentSearchResult as a human-readable summary string (the shape * agents consume when intent search fires). Mirrors the context-mode layout. */ export declare function renderIntentResult(result: IntentSearchResult, intent: string): string; //# sourceMappingURL=intent-search.d.ts.map