terraphim_grep 1.21.2

Intelligent hybrid grep with RLM fallback and KG curation
Documentation
[package]
name = "terraphim_grep"
version = "1.21.2"
edition.workspace = true
authors = ["Terraphim AI Team <team@terraphim.ai>"]
description = "Intelligent hybrid grep with RLM fallback and KG curation"
documentation = "https://terraphim.ai"
homepage = "https://terraphim.ai"
readme = "README.md"
license = "MIT"
repository = "https://github.com/terraphim/terraphim-ai"
keywords = ["grep", "search", "knowledge-graph", "rlm"]
categories = ["development-tools"]

[dependencies]
tokio.workspace = true
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
anyhow.workspace = true
log.workspace = true
# Shared self-update backend (R2 manifest + GitHub fallback). Same crate the
# agent uses; provides `terraphim-grep check-update` / `terraphim-grep update`.
terraphim_update = { path = "../terraphim_update", version = "1.20.2" }

# Path deps include `version` so `cargo publish` accepts the manifest. The script
# `scripts/publish-crates.sh` rewrites these versions at publish time to align with
# the release version; the field's *presence* is what the publisher requires. The
# value here must match each crate's currently-declared local version so path
# resolution succeeds for local builds.
terraphim_types = { version = "1.15.0" }
terraphim_rolegraph = { version = "1.15.0" }
terraphim_automata = { version = "1.19.2" }
terraphim_service = { version = "1.20.5", optional = true }
terraphim_config = { version = "1.15.0" }

fff-search = { version = "0.8.4", optional = true }

async-trait.workspace = true
reqwest = { workspace = true, features = ["json", "rustls-tls"], optional = true }
parking_lot = "0.12"
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

clap = { version = "4", features = ["derive"] }

[features]
# `code-search` ships in the default set so a plain `cargo build`/`cargo install`
# produces a grep that actually searches file contents. Without it, `search_code`
# compiles to a no-op stub that returns no matches (see hybrid_searcher.rs).
# It is also required for the no-KG failover path.
default = ["llm", "code-search"]
llm = ["dep:terraphim_service", "dep:reqwest"]
# Enable fast file-finder code search. This is enabled by default so that
# terraphim-grep can fall back to plain enhanced grep when no knowledge graph
# thesaurus is configured.
code-search = ["dep:fff-search"]
# Enable OpenRouter provider support (required for live OpenRouter tests against free models)
openrouter = ["llm", "terraphim_service/openrouter"]

[dev-dependencies]
tokio-test = "0.4"
tempfile.workspace = true
criterion = { version = "0.8", features = ["async_tokio"] }
terraphim_router = { version = "1.8.0" }

[[bin]]
name = "terraphim-grep"
path = "src/main.rs"

[[bench]]
name = "hybrid_search"
harness = false
required-features = ["code-search"]

# Debian package metadata; consumed by `cargo deb -p terraphim_grep`. Mirrors the
# pattern in `crates/terraphim_agent/Cargo.toml` for consistency across binaries.
[package.metadata.deb]
maintainer = "Terraphim Contributors <team@terraphim.ai>"
copyright = "2026, Terraphim Contributors"
license-file = ["../../LICENSE-MIT", "4"]
extended-description = """
Terraphim Grep -- intelligent hybrid grep with knowledge-graph boosting and
LLM fallback. Runs fff-search code retrieval and a knowledge-graph concept
lookup in parallel, applies KG-aware boosting so chunks matching your thesaurus
rank above generic matches, and falls back to an LLM only when local sufficiency
is below threshold. Configured via role JSON; works in search-only mode without
any API key."""
depends = "$auto"
section = "utility"
priority = "optional"
assets = [
    ["target/release/terraphim-grep", "usr/bin/", "755"],
    ["../../README.md", "usr/share/doc/terraphim-grep/README", "644"],
    ["RELEASE_NOTES_v1.20.0.md", "usr/share/doc/terraphim-grep/RELEASE_NOTES.md", "644"],
]