[package]
name = "hermes-core"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
authors.workspace = true
keywords.workspace = true
categories.workspace = true
description = "Core async search engine library with WASM support"

[dependencies]
tokio = { workspace = true, optional = true }
async-trait = { workspace = true }
futures = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
byteorder = { workspace = true }
zstd = { workspace = true }
rustc-hash = { workspace = true }
smallvec = { workspace = true }
parking_lot = { workspace = true }
crossbeam-channel = { workspace = true, optional = true }
num_cpus = { workspace = true, optional = true }
rayon = { workspace = true, optional = true }
thiserror = { workspace = true }
log = "0.4"
rust-stemmers = { workspace = true }
stop-words = { workspace = true }
pest = { workspace = true }
pest_derive = { workspace = true }
base64 = { workspace = true }
regex = { workspace = true }
rand = { workspace = true }
reqwest = { version = "0.13", default-features = false, optional = true }
instant = { version = "0.1", features = ["wasm-bindgen"], optional = true }
bumpalo = { workspace = true, optional = true }
lasso = { workspace = true, optional = true }
hashbrown = { workspace = true }
half = { version = "2.7", features = ["std"] }
fst = { version = "0.4", optional = true }
bincode = { version = "2.0", features = ["serde"] }
memmap2 = { workspace = true, optional = true }
uuid = { workspace = true, optional = true }
kentro = { version = "0.2", optional = true }
ndarray = { version = "0.16", optional = true }
nalgebra = { version = "0.34", optional = true }
hf-hub = { version = "0.4", default-features = false, features = ["ureq", "rustls-tls"], optional = true }

# Native tokenizers with onig (C library) for full regex support
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokenizers]
version = "0.22"
default-features = false
features = ["onig", "http"]
optional = true

# WASM tokenizers with fancy-regex (pure Rust, no C dependencies)
[target.'cfg(target_arch = "wasm32")'.dependencies.tokenizers]
version = "0.22"
default-features = false
features = ["fancy-regex"]
optional = true

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "test-util"] }
tempfile = { workspace = true }
rand = { workspace = true }
criterion = { workspace = true }
comfy-table = "7"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { workspace = true }


[[bench]]
name = "compression"
harness = false

[[bench]]
name = "indexing"
harness = false

[[bench]]
name = "posting_compression"
path = "benches/posting_compression/main.rs"
harness = false

[[bench]]
name = "vector_indexing"
harness = false

[[bench]]
name = "large_benchmark"
harness = false

[[bench]]
name = "hermes_benchmark"
path = "benches/hermes_benchmark/main.rs"
harness = false

[features]
default = ["native"]
native = ["dep:tokio", "dep:crossbeam-channel", "dep:num_cpus", "dep:rayon", "dep:bumpalo", "dep:lasso", "dep:memmap2", "dep:uuid", "dep:kentro", "dep:ndarray", "dep:nalgebra", "dep:tokenizers", "dep:fst", "dep:hf-hub"]
wasm = ["dep:tokenizers"]
http = ["dep:reqwest", "dep:instant"]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = ["rustls"]
optional = true

[target.'cfg(target_arch = "wasm32")'.dependencies.reqwest]
version = "0.13"
default-features = false
optional = true
