Skip to main content

render_json

Function render_json 

Source
pub fn render_json(
    graph: &RepoGraph,
    max_files: usize,
    focus: Option<usize>,
    include_metadata: bool,
) -> GetRepoMapResponse
Expand description

Render a PageRank-sorted JSON map of the repository (4.0.0 compatibility shim).

This function wraps render_json_budgeted with a synthetic token budget derived from max_files * 2000 (a generous per-file allowance). It exists to keep the existing D1/D2 unit tests compiling without change; the MCP layer calls render_json_budgeted directly in 4.0.1.

The capped field in the response reflects whether the budget was exhausted before all eligible files were included, which is equivalent to the previous total_files > max_files check.

When include_metadata is false (default), files whose extension classifies as ContentKind::Meta are excluded before ranking.