amql-engine
Core domain logic for AQL: parse, index, query, and validate code annotations
Role
- All domain logic lives here
- Surface crates (CLI, MCP, LSP, WASM) are thin shims into this crate
- No surface crate contains domain logic —
D ⊂ amql-engine
Features
default=["resolver", "fs"]resolver— tree-sitter code resolution (Rust, TypeScript, Go)fs— filesystem access (globbing, caching, file I/O)wasm— WASM bindings viawasm_bindgen(excludesresolver+fs)ts— TypeScript type generation viats-rs
Key Modules
store— load, index, query.aqmannotation sidecarsselector— CSS-like selector parsing and matchingnavigate— tree-sitter AST navigation and source mutationsync— incremental sidecar sync (source change → minimal XML edits)extractor— built-in framework extractors (Express, React, Go, Rust, tests)query— unified annotation + code element queriestransact— atomic multi-step source mutations with rollback
Getting Started
use ;
use Path;
// Load annotations
let mut store = new;
let errors = store.load_all_from_locator;
// Query by selector
let results = store.select?;
// Incremental sidecar sync
use ;
let edits = sync_sidecar;
let updated_xml = apply_edits;
npm
- Package:
@aql/engine - Build:
bun run build(via turborepo → wasm-pack + codegen) - All TypeScript types generated from Rust via
ts-rs - All JS wrappers generated from embedded Rust consts