Skip to main content

Module core

Module core 

Source
Expand description

Orchestration shared by the CLI and the MCP server.

This wiring is intentionally implemented up front against the frozen signatures of crate::fetch and crate::parse. It compiles before those modules are filled in and runs unchanged once they are, so there is no integration step for the seam itself.

Functions§

discover_feeds
Discover feeds advertised on a website homepage.
enforce_response_budget
Check output against a token budget, returning the estimate on success.
estimate_response_tokens
Rough token estimate of the serialized output — i.e. of the payload an MCP client actually receives (pretty JSON, matching crate::mcp’s emission). Uses the same ceil(chars / 4) heuristic as per-item content estimates.
exit_code_for
Determine the appropriate process exit code from a FetchOutput.
fetch_feeds
Fetch and parse many feeds concurrently, returning the full structured output.
fetch_one
Fetch and parse a single feed, returning the FeedResult plus any non-fatal Warnings the parse surfaced (e.g. a content-extraction fallback). Callers aggregate the warnings into FetchOutput::warnings.
item_count
Total number of items across every feed in output.
show_item
Fetch a feed (cache-first) and return the single item whose id, raw guid, or resolved url equals key, if present.
truncation_marker
Build the TruncationInfo marker for output, or None when nothing was actually cut.