[package]
name = "probe-code"
version = "0.6.0"
edition = "2021"
rust-version = "1.88.0"
authors = ["Leonid Bugaev <leonsbox@gmail.com>"]
description = "AI-friendly, fully local, semantic code search tool for large codebases"
license = "MIT"
repository = "https://github.com/probelabs/probe"
readme = "README.md"
keywords = ["search", "code", "ast", "grep", "semantic"]
categories = ["command-line-utilities", "development-tools", "text-processing"]

[lints.clippy]
# Allow uninlined format args for existing code - will be addressed in future cleanup
uninlined_format_args = "allow"

[dependencies]
ahash = "0.8.6"  # Fast, non-cryptographic hash function
dashmap = "5.5.3"  # Thread-safe concurrent HashMap
anyhow = "1.0"
atty = "0.2.13"
colored = "3.0.0"
dirs = "5.0.1"
ignore = "0.4"
tree-sitter = "0.24.5"
tree-sitter-rust = "0.23.2"
tree-sitter-javascript = "0.23.1"
tree-sitter-typescript = "0.23.2"
tree-sitter-python = "0.23.6"
tree-sitter-go = "0.23.4"
tree-sitter-c = "0.23.4"
tree-sitter-cpp = "0.23.4"
tree-sitter-java = "0.23.5"
tree-sitter-ruby = "0.23.1"
tree-sitter-php = "0.23.11"
tree-sitter-swift = { version = "0.7.0" }
tree-sitter-c-sharp = { version = "0.23.1" }
tree-sitter-html = "0.23.2"
tree-sitter-md = "0.3.2"
tree-sitter-yaml = "0.6.1"
ast-grep-core = "0.36.1"
ast-grep-language = "0.36.1"
clap = { version = "4.3", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rust-stemmers = "1.2"
tokio = { version = "1", features = ["full"] }
tiktoken-rs = "0.6.0"
regex = "1.9"
rayon = "1.8"
once_cell = "1.19.0"
decompound = "0.3.0"
lazy_static = "1.4.0"
rand = "0.8.5"
glob = "0.3.1"
arboard = "3.4.1"
md5 = "0.7.0"
lru = "0.12.5"
simsimd = "6.1.0"  # SIMD-accelerated similarity metrics for vector operations
memchr = "2.7"  # SIMD-accelerated string searching and processing
aho-corasick = "1.1"  # SIMD-accelerated multi-pattern string matching
num_cpus = "1.16"  # Detect number of CPUs for parallel processing
# BERT reranker dependencies - optional for ms-marco-tinybert reranker
candle-core = { version = "0.8", optional = true }
candle-nn = { version = "0.8", optional = true }
candle-transformers = { version = "0.8", optional = true }
tokenizers = { version = "0.20", optional = true }
hf-hub = { version = "0.3", features = ["tokio"], optional = true }
parking_lot = { version = "0.12", optional = true }

[dev-dependencies]
tempfile = "3.10.1"
proptest = "1.2"
criterion = "0.5"
roxmltree = "0.18.0"
jsonschema = "0.17.1"

[lib]
name = "probe_code"
path = "src/lib.rs"

[[bin]]
name = "probe"
path = "src/main.rs"

[features]
default = []
bert-reranker = [
    "candle-core",
    "candle-nn", 
    "candle-transformers",
    "tokenizers",
    "hf-hub",
    "parking_lot"
]


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

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

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

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

[profile.release]
opt-level = "z"  # Optimize for size ("s" also works, but "z" is smaller)
strip = true     # Strip symbols automatically
lto = true       # Link-time optimization
codegen-units = 1 # Slower compile, smaller binary
panic = "abort"  # Ditch unwinding code
