[workspace]
members = [".", "packages/python"]

[package]
name = "cognigraph-chunker"
version = "2.2.4"
edition = "2024"
license = "MIT"
description = "Fast text chunking toolkit: fixed-size, delimiter, semantic, cognition-aware, intent-driven, topology-aware, enriched, and adaptive strategies with CLI, REST API, and Python bindings"
repository = "https://github.com/gedankrayze/cognigraph-chunker"
readme = "README.md"
keywords = ["chunking", "rag", "embeddings", "nlp", "text-processing"]
categories = ["text-processing", "command-line-utilities"]
exclude = [
    "docs/",
    "tests/python/",
    "packages/",
    ".github/",
    "models/",
    ".env*",
    ".claude/",
    ".DS_Store",
]

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

[[bin]]
name = "cognigraph-chunker"
path = "src/main.rs"

[dependencies]
# Core algorithms (from chunk library)
memchr = "2.8"
daggrs = "0.1"

# CLI
clap = { version = "4.6", features = ["derive"] }
clap_complete = "4.6"

# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# Async runtime
tokio = { version = "1.51", features = ["full"] }

# HTTP client (embedding providers)
# rustls instead of the default native-tls: no system OpenSSL dependency,
# so wheels build in the manylinux container and binaries stay portable.
# rustls-no-provider (not `rustls`) avoids the default aws-lc-sys crypto
# backend, which fails to cross-compile for aarch64 in the manylinux
# container; we install the `ring` provider ourselves (see http_util).
reqwest = { version = "0.13", default-features = false, features = [
    "json",
    "form",
    "charset",
    "http2",
    "rustls-no-provider",
] }
rustls = { version = "0.23", default-features = false, features = ["ring"] }

# ONNX Runtime (local embeddings). We re-enable ort's default features
# EXCEPT `download-binaries` + `tls-native`, whose ureq → native-tls →
# openssl-sys build chain fails in the manylinux wheel container. We load
# the runtime dynamically, so no download/TLS machinery is needed.
ort = { version = "2.0.0-rc.11", default-features = false, features = [
    "std",
    "ndarray",
    "tracing",
    "api-24",
    "load-dynamic",
] }

# Tokenizer (for ONNX models)
tokenizers = "0.23"

# N-dimensional arrays (used by ort)
ndarray = "0.17"

# Unicode sentence segmentation
unicode-segmentation = "1.13"

# Language detection
whatlang = "0.18"

# Unicode script detection (entity heuristics for CJK, etc.)
unicode-script = "0.5"

# Markdown AST parsing
pulldown-cmark = "0.13.3"

# Web framework
axum = "0.8"
tower-http = { version = "0.6", features = ["cors", "timeout", "limit"] }

# URL parsing (SSRF validation)
url = "2"

# Constant-time comparison for API key auth
subtle = "2"

# Bounded-concurrency streams for LLM/reranker fan-out
futures = "0.3"

# Error handling
anyhow = "1.0"

[profile.release]
strip = true
lto = true
codegen-units = 1
panic = "abort"

[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }

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