agent-source-repository 0.1.0

Agent Source Repository local context registry for coding agents
Documentation
//! Agent Source Repository local context registry.
//!
//! The `asr` binary is the supported product surface. This library contains the
//! indexing, ranking, graph, and ASR command services used by that CLI.
mod bm25;
mod chunk_lookup;
mod chunking;
mod encoder;
mod exact;
mod graph;
mod index;
mod language;
mod model;
mod path_lookup;
mod ranking;
mod search;
mod source_files;
mod source_tree;
mod tokens;

pub mod asr;

use anyhow::Result;

pub use crate::asr::*;
pub use graph::{DependencyGraph, FileNode, OrphanFile, Symbol, UnusedSymbol};
pub use index::{SemanticIndexBuildError, SourceIndex};
pub use model::{Chunk, IndexStats, SearchResult};

pub fn build_dependency_graph(source: &str, include_text_files: bool) -> Result<DependencyGraph> {
    let source = source_tree::SourceTree::from_source(source, None)?;
    index::build::create_graph_from_path(
        source.root(),
        None,
        None,
        include_text_files,
        source.root(),
    )
}