[package]
name = "alcove"
version = "0.8.3"
edition = "2024"
description = "A quiet place for your project docs. MCP server that gives AI agents scoped access to private documentation."
license = "Apache-2.0"
repository = "https://github.com/epicsagas/alcove"
keywords = ["mcp", "documentation", "ai", "cli"]
categories = ["command-line-utilities", "development-tools"]

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

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

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.tar.gz"
bin-dir = "{ name }{ binary-ext }"
pkg-fmt = "tgz"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"

[dependencies]
anyhow = "1"
indexmap = "2"
clap = { version = "4", features = ["derive"] }
dialoguer = { version = "0.12", features = ["fuzzy-select"] }
console = "0.16"
dirs = "6"
indicatif = "0.18"
rand = "0.10"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
toml = "1"
walkdir = "2"
regex = "1"
libc = "0.2"
rayon = "1"
rust-i18n = "4"
sys-locale = "0.3.2"
tantivy = "0.26"

# alcove-full feature dependencies (lazy embedding + vector search)
fastembed = { version = "5", optional = true }
rusqlite = { version = "0.39", optional = true }
pdf-extract = { version = "0.10", optional = true }
zip = { version = "8.5", optional = true }
quick-xml = { version = "0.39", optional = true }
calamine = { version = "0.34", optional = true }

# Lightweight sync HTTP client for MCP proxy mode
ureq = "3"

# HTTP server dependencies (alcove-server feature)
axum = { version = "0.8", optional = true }
tokio = { version = "1", features = ["rt-multi-thread", "macros"], optional = true }
tower-http = { version = "0.6", features = ["cors"], optional = true }

# HNSW vector indexing (alcove-full feature)
hnsw_rs = { version = "0.3", optional = true }

[features]
default = ["full"]
alcove-full = ["fastembed", "rusqlite", "hnsw_rs", "pdf-extract", "zip", "quick-xml", "calamine"]
alcove-server = ["axum", "tokio", "tower-http"]
full = ["alcove-full", "alcove-server"]

[dev-dependencies]
tempfile = "3.26.0"
serial_test = "3"

# ---------------------------------------------------------------------------
# Build optimizations
# ---------------------------------------------------------------------------

[profile.dev]
opt-level = 0
debug = 1              # line numbers only, skip full debuginfo (saves link time)

[profile.release]
opt-level = 3
lto = "thin"           # faster than full LTO, still good dead-code elimination
codegen-units = 1      # single unit for best optimization
strip = "symbols"      # smaller binary, faster install copy

[profile.release.package."*"]
opt-level = 3
codegen-units = 4      # dependencies can parallelize more aggressively
