/** * RSS search backend — supplements keyless web search with structured feeds. * * The keyless search chain (Bing → Baidu → DuckDuckGo) returns unstructured * HTML results — titles + snippets + URLs. RSS feeds return structured * entries with **title, link, publication date, and full or summary content**, * which gives the LLM: * * 1. **Timeliness**: every entry has a pubDate — the LLM can filter by * recency without relying on search-engine time filters (which are often * unreliable for keyless backends). * 2. **Accuracy**: RSS content comes directly from the source (no search-engine * snippet truncation or anti-bot interference). The LLM sees the actual * article summary, not a scraped fragment. * 3. **Source authority**: RSS feeds are curated by the publisher — no SEO * spam, no content farms. Results are from named sources (blogs, news * sites, project release feeds). * * Design: * - Pluggable into the existing `WebSearchBackend` interface (same signature). * - No external dependency beyond global `fetch` (Node 18+). * - Supports a built-in catalog of tech/robotics news feeds + user-configurable * feeds via `MOSS_RSS_FEEDS` env var. * - Filters by recency (day/week/month) using pubDate. * - Falls back gracefully on parse errors (malformed XML, network failures). * * @public */ import type { WebSearchBackend } from './web-search.js'; export interface RssFeed { url: string; category?: string; lang?: 'en' | 'zh'; } export interface RssSearchOptions { /** Custom feeds to search (in addition to or instead of built-ins). */ feeds?: RssFeed[]; /** Whether to include built-in feeds. Default true. */ includeBuiltin?: boolean; /** Per-feed timeout in ms. Default 10_000. */ timeoutMs?: number; /** * Override the SSRF private-host check. Production leaves this undefined so * the real `isPrivateHost` (DNS-based) guards every feed fetch. Tests inject * a stub so mock feed hosts (e.g. `rss-mock.test`) don't get rejected by * DNS resolution failure. * * @internal */ isPrivateHostCheck?: (hostname: string) => Promise; } export declare function normalizeFreshNewsQuery(query: string): string; export declare function buildGoogleNewsRssUrl(query: string, recency?: 'day' | 'week' | 'month' | 'year'): string; export declare function createGoogleNewsRssBackend(options?: Omit): WebSearchBackend; /** * Create an RSS search backend that fits the `WebSearchBackend` interface. * * The backend fetches configured RSS feeds in parallel, filters entries by * the query (case-insensitive substring match on title + content), filters * by recency if specified, and returns `WebSearchResult[]`. */ export declare function createRssSearchBackend(options?: RssSearchOptions): WebSearchBackend; /** Get the built-in feed list (for testing / configuration). */ export declare function getBuiltinFeeds(): RssFeed[]; /** Parse user-configured feeds from MOSS_RSS_FEEDS env var (comma-separated URLs). */ export declare function parseUserFeeds(env?: NodeJS.ProcessEnv): RssFeed[]; //# sourceMappingURL=rss-search.d.ts.map