Skip to main content

asr/
lib.rs

1//! Agent Source Repository local context registry.
2//!
3//! The `asr` binary is the supported product surface. This library contains the
4//! indexing, ranking, graph, and ASR command services used by that CLI.
5mod bm25;
6mod chunk_lookup;
7mod chunking;
8mod encoder;
9mod exact;
10mod graph;
11mod index;
12mod language;
13mod model;
14mod path_lookup;
15mod ranking;
16mod search;
17mod source_files;
18mod source_tree;
19mod tokens;
20
21pub mod asr;
22
23use anyhow::Result;
24
25pub use crate::asr::*;
26pub use graph::{DependencyGraph, FileNode, OrphanFile, Symbol, UnusedSymbol};
27pub use index::{SemanticIndexBuildError, SourceIndex};
28pub use model::{Chunk, IndexStats, SearchResult};
29
30pub fn build_dependency_graph(source: &str, include_text_files: bool) -> Result<DependencyGraph> {
31    let source = source_tree::SourceTree::from_source(source, None)?;
32    index::build::create_graph_from_path(
33        source.root(),
34        None,
35        None,
36        include_text_files,
37        source.root(),
38    )
39}