acp/
lib.rs

1#![forbid(unsafe_code)]
2
3//! @acp:module "ACP Library"
4//! @acp:summary "Token-efficient code documentation and indexing for AI systems"
5//! @acp:domain cli
6//! @acp:layer api
7//! @acp:stability stable
8//!
9//! # ACP - AI Context Protocol
10//!
11//! Token-efficient code documentation and indexing for AI systems.
12//!
13//! ## Features
14//!
15//! - **Fast Parsing**: Uses tree-sitter for accurate AST parsing
16//! - **JSON Output**: Queryable with jq for O(1) lookups
17//! - **Variable System**: Token-efficient macros with inheritance
18//! - **Multi-language**: TypeScript, JavaScript, Rust, Python, Go, Java
19//!
20//! ## Example
21//!
22//! ```rust,no_run
23//! use acp::{Indexer, Config};
24//!
25//! #[tokio::main]
26//! async fn main() -> anyhow::Result<()> {
27//!     let config = Config::default();
28//!     let indexer = Indexer::new(config)?;
29//!
30//!     // Index codebase
31//!     let cache = indexer.index(".").await?;
32//!
33//!     // Write JSON output
34//!     cache.write_json(".acp.cache.json")?;
35//!
36//!     Ok(())
37//! }
38//! ```
39
40pub mod annotate;
41pub mod ast;
42pub mod attempts;
43pub mod bridge;
44pub mod cache;
45pub mod commands;
46pub mod config;
47pub mod constraints;
48pub mod error;
49pub mod expand;
50pub mod git;
51pub mod index;
52pub mod parse;
53pub mod primer;
54pub mod query;
55pub mod scan;
56pub mod schema;
57pub mod sync;
58pub mod vars;
59pub mod watch;
60
61// Re-exports
62pub use annotate::{
63    AnalysisResult, Analyzer as AnnotationAnalyzer, AnnotateLevel, ConversionSource, FileChange,
64    OutputFormat, Suggester as AnnotationSuggester, Suggestion, Writer as AnnotationWriter,
65};
66pub use ast::{AstParser, ExtractedSymbol, FunctionCall, Import, SymbolKind, Visibility};
67pub use attempts::AttemptTracker;
68pub use bridge::{BridgeConfig, BridgeMerger, BridgeResult, FormatDetector};
69pub use cache::{Cache, CacheBuilder, Language};
70pub use config::Config;
71pub use constraints::{
72    BehaviorModifier, ConstraintIndex, Constraints, DebugAttempt, DebugResult, DebugSession,
73    DebugStatus, FileGuardrails, GuardrailEnforcer, GuardrailParser, HackMarker, LockLevel,
74    MutationConstraint, QualityGate, StyleConstraint,
75};
76pub use error::{AcpError, Result};
77pub use git::{BlameInfo, FileHistory, GitFileInfo, GitRepository, GitSymbolInfo};
78pub use index::Indexer;
79pub use parse::Parser;
80pub use query::Query;
81pub use scan::{scan_project, ProjectScan};
82pub use sync::{BootstrapAction, BootstrapResult, SyncExecutor, Tool as SyncTool};
83pub use vars::{VarExpander, VarResolver};
84
85/// Library version
86pub const VERSION: &str = env!("CARGO_PKG_VERSION");