hjkl_anvil/lib.rs
1//! Mason-style LSP and developer-tool installer.
2//!
3//! `hjkl-anvil` is the tool-installation sibling of `hjkl-bonsai`. Where
4//! bonsai manages tree-sitter grammars, anvil manages language servers,
5//! formatters, linters, and debug adapters — using the same XDG path
6//! conventions and compile-time embedded catalog pattern.
7//!
8//! # Features
9//!
10//! ## `sync` (dev-only)
11//!
12//! Enables the `sync-anvil` xtask binary that regenerates `anvil.toml` from
13//! the upstream `mason-org/mason-registry` JSON artifact. Not needed by
14//! downstream consumers — it pulls in `reqwest`, `zip`, and `serde_json`.
15//!
16//! Maintainers run:
17//! ```text
18//! cargo run -p hjkl-anvil --features sync --bin sync-anvil -- --pin <tag>
19//! ```
20//!
21//! # Quick start
22//!
23//! ```rust
24//! use hjkl_anvil::{Registry, ToolCategory};
25//!
26//! let registry = Registry::embedded().expect("embedded catalog must load");
27//! println!("catalog has {} tools", registry.len());
28//!
29//! if let Some(spec) = registry.get("rust-analyzer") {
30//! println!("rust-analyzer v{}", spec.version);
31//! }
32//!
33//! for name in registry.by_category(ToolCategory::Lsp) {
34//! println!(" lsp: {name}");
35//! }
36//! ```
37
38pub mod installer;
39pub mod job;
40pub mod manifest;
41pub mod registry;
42pub mod store;
43
44pub use installer::{Install, InstallError, InstallStatus, install_blocking};
45pub use job::{InstallHandle, InstallPool};
46pub use manifest::{
47 CargoMethod, GithubMethod, GoMethod, InstallMethod, Manifest, ManifestError, ManifestMeta,
48 NpmMethod, PipMethod, ScriptMethod, ToolCategory, ToolSpec,
49};
50pub use registry::{Registry, RegistryError};
51pub use store::{ChecksumSidecar, RevSidecar, StoreError};