Files
zeekay e9e6096ce4 feat(rust): fs search_text and code search_symbol on tgrep, in process
hanzo-trigram is the one search engine behind both actions: tgrep-core
(the hanzoai fork, MIT, pinned by commit, feature docs) linked as a
library, so a search is a call, not an rg spawn. It is its own crate so
Dev can link it without this crate's browser and parser dependencies;
hanzo_mcp::trigram re-exports it.

Results are ranked (matching lines a file, or definitions before uses
for a symbol), then path, then line, so a page is an offset into one
fixed list and the cursor really pages: before, rg stopped at limit and
a cursor repeated the first page. .gitignore, hidden and binary files
are skipped as rg skips them. A glob that names a document type (*.pdf,
*.docx, *.zip) reads documents too, and a hit inside one carries the
archive members and its page, slide, paragraph or cell.

fs and code keep their names, schemas and answer shapes; entry and place
appear on a document hit only. search_symbol now reads definitions by
the engine's declaration patterns, not the first-keyword guess.

Linking tgrep-core brings libsqlite3-sys (its managed-index code), which
needs a newer cc than the tree-sitter grammars allow, so Cargo resolves
tree-sitter-{c,cpp,javascript,python,rust,typescript} to their previous
patch releases. 241 library tests and the code tool's pass on them.
Gating managed/ behind a feature in the fork removes both.
2026-10-14 13:37:01 -07:00

21 lines
773 B
TOML

[package]
name = "hanzo-trigram"
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/hanzoai/mcp"
description = "Text, symbol and document search over tgrep-core, in process: the engine behind hanzo-mcp's fs search_text and code search_symbol, light enough for Dev to link."
[dependencies]
# tgrep (MIT), the hanzoai fork, pinned by exact commit. `docs` adds the PDF, office and
# archive adapters. Its walker applies .gitignore, hidden-file and binary rules as rg does.
tgrep-core = { git = "https://github.com/hanzoai/tgrep", rev = "68555338dfd28a28aaf0fae21dc812780fa94ab7", features = ["docs"] }
globset = "0.4.18"
memchr = "2"
rayon = "1"
regex = "1"
serde = { version = "1", features = ["derive"] }
[dev-dependencies]
tempfile = "3"