[workspace]
members = [
    "crates/kreuzberg",
    "crates/kreuzberg-cli",
    "crates/kreuzberg-ffi",
    "crates/kreuzberg-jni",
    "crates/kreuzberg-node",
    "crates/kreuzberg-paddle-ocr",
    "crates/kreuzberg-php",
    "crates/kreuzberg-py",
    "crates/kreuzberg-tesseract",
    "crates/kreuzberg-wasm",
    "packages/dart/rust",
    "packages/swift/rust",
    "tools/benchmark-harness",
]
exclude = [
    "e2e/rust",
    "packages/elixir/native/kreuzberg_nif",
    "packages/r/src/rust",
    "packages/ruby/ext/kreuzberg_rb",
]
default-members = ["crates/kreuzberg", "crates/kreuzberg-cli"]
resolver = "2"

[workspace.package]
version = "5.0.0-rc.3"
edition = "2024"
rust-version = "1.91"
authors = ["Na'aman Hirschfeld <naaman@kreuzberg.dev>"]
license = "Elastic-2.0"
repository = "https://github.com/kreuzberg-dev/kreuzberg"
homepage = "https://kreuzberg.dev"

[workspace.lints.rust]
unsafe_code = "deny"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(alef)'] }

[workspace.lints.clippy]
all = "warn"

[workspace.dependencies]
ahash = { version = "0.8.12", features = ["serde"] }
anyhow = "1.0"
async-trait = "0.1.89"
base64 = "0.22.1"
blake3 = "1"
bytes = { version = "1", features = ["serde"] }
cfb = "0.14"
chrono = "0.4"
clap = { version = "4.6", features = ["derive", "color", "suggestions"] }
comrak = { version = "0.52", default-features = false }
console_error_panic_hook = "0.1"
criterion = { version = "0.8", features = ["html_reports"] }
dbase = "0.7"
futures = "0.3"
getrandom = { version = "0.4.2", features = ["wasm_js"] }
hex = "0.4.3"
html-to-markdown-rs = { version = "3.5.7", default-features = false }
image = { version = "0.25.10", default-features = false }
itertools = "0.14"
js-sys = "0.3"
kreuzberg = { path = "./crates/kreuzberg", version = "5.0.0-rc.3", default-features = false }

lazy_static = "1.5.0"
libc = "0.2.186"
liter-llm = { version = "1.4.0-rc.48", default-features = false, features = ["tracing"] }
log = "0.4"
lzma-rust2 = { version = "0.16.3" }
memmap2 = "0.9"
minijinja = "2"
num_cpus = "1.17.0"
once_cell = "1.21.4"

ort = { version = "2.0.0-rc.12", default-features = false, features = ["std", "api-18"] }
parking_lot = "0.12.5"
pdf_oxide = { version = "0.3.56", default-features = false, features = [
    "rendering",
    "legacy-crypto",
] }
rayon = "1.12.0"
reqwest = { version = "0.13.4", default-features = false }

serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.150" }
serde_toon_format = "0.1"
similar = "2"
tempfile = "3.27.0"
thiserror = "2.0.18"
tokio = { version = "1.52.3", features = [
    "rt",
    "rt-multi-thread",
    "macros",
    "sync",
    "process",
    "fs",
    "time",
    "io-util",
] }
toml = "1.1.2"
tracing = "0.1"
tree-sitter-language-pack = { version = "1.9.0-rc.17", default-features = false, features = ["serde"] }
wasm-bindgen = { version = "0.2", features = ["enable-interning"] }
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
    "Blob",
    "File",
    "FileReader",
    "console",
    "TextDecoder",
    "ImageData",
    "Window",
    "Response",
] }

[patch.crates-io]
kreuzberg = { path = "crates/kreuzberg" }
kreuzberg-tesseract = { path = "crates/kreuzberg-tesseract" }
kreuzberg-paddle-ocr = { path = "crates/kreuzberg-paddle-ocr" }

[profile.release]
lto = "thin"
codegen-units = 1
opt-level = 3
strip = true

# Archive crates crash with SIGBUS under opt-level=3 on macOS ARM64.
# Reduce optimization to prevent miscompilation of unsafe code.
[profile.release.package.sevenz-rust2]
opt-level = 2

[profile.release.package.zip]
opt-level = 2

# WASM size optimization: reduce memory spikes during compilation
[profile.release.package.kreuzberg-wasm]
opt-level = "z"

[profile.dev]
opt-level = 0
debug = true

[profile.profiling]
inherits = "release"
debug = true
strip = false
