Skip to main content

Crate grove_core

Crate grove_core 

Source
Expand description

grove-core — the structural code-intelligence library behind the grove CLI and MCP server.

This crate hosts the tree-sitter AST engine, the grammar registry, grammar fetching, and source ingest. It is clap-free: command-line concerns live in the grove binary crate, which consumes this library via grove_core::.

§Overview

The consumer-facing surface is the ops module — a small set of structural queries that work for any registered language (grammars load from the registry as wasm, so nothing is compiled in):

init::provision_project is the grammar-provisioning entry point used by grove init. The lower-level engine, fetch, and ingest modules are public for hosts that need deeper access.

§Example

use std::path::Path;
use grove_core::ops;

// Every definition under `src/`, gitignore-aware.
let symbols = ops::symbols(Path::new("src"), None, None, false, false)?;
for s in &symbols {
    println!("{} {} — {}:{}", s.kind, s.name, s.file, s.line);
}

Re-exports§

pub use engine::Defect;
pub use engine::Symbol;
pub use ops::CallSite;
pub use ops::FileMap;
pub use ops::MapEntry;
pub use ops::SourceResult;
pub use init::provision_project;
pub use config::active_mode;
pub use config::GroveConfig;
pub use config::Mode;
pub use config::ModeChoice;
pub use registry::LockVerifyEntry;
pub use registry::LockVerifyStatus;

Modules§

config
Grove project configuration — .grove/config.json.
doctor
core::doctor — project health diagnostics.
engine
The structural engine: parse + tag extraction + syntax check, over grammars loaded from the registry as wasm.
fetch
grove fetch — pull grammars from the hosted registry into the OS cache.
harness
Harness shape constants and per-mode query functions.
ingest
grove ingest — build registry artifacts from curated source specs.
init
Grammar provisioning for grove init — the clap-free half.
ops
The operations, as a library — the single engine both faces call.
proxy
Shared proxy resolution for grove’s ureq HTTP clients — used by fetch here and by the grove-explore-core crate’s chat/health clients. Shared proxy configuration for grove’s ureq-based HTTP clients.
registry
The grammar registry — Phase 2 spine.
render
Human text rendering for the read-only structural verbs, shared by the CLI (cli/src/main.rs) and the explore inner toolset (core::explore::toolset) so both faces emit identical output. See ADR 0003.