(md: string, query: string | undefined, cap: number)
| 24 | * window. Returns the chosen mode so the caller can record the semantic-vs-positional hit rate. PURE. |
| 25 | */ |
| 26 | export function capMarkdown(md: string, query: string | undefined, cap: number): { snippet: string; mode: ExtractMode } { |
| 27 | const sel = selectRelevantPassages(stripBase64Images(md), { query, budget: cap }); |
| 28 | return { snippet: sel.content, mode: sel.mode }; |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Map a Firecrawl /search payload to our uniform result shape. When markdown is present |
no test coverage detected