# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
name = "lean-ctx"
version = "3.8.13"
build = "build.rs"
exclude = [
    "examples/",
    "tests/",
    "crates/",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Context Runtime for AI Agents with CCP. 71 MCP tools, 10 read modes, 95+ compression patterns, cross-session memory (CCP), persistent AI knowledge with temporal facts + contradiction detection, multi-agent context sharing, LITM-aware positioning, AAAK compact format, adaptive compression with Thompson Sampling bandits. Supports 24+ AI tools. Reduces LLM token consumption by up to 99%."
homepage = "https://leanctx.com"
readme = "README.md"
keywords = [
    "mcp",
    "llm",
    "tokens",
    "compression",
    "ai",
]
categories = [
    "command-line-utilities",
    "development-tools",
]
license = "Apache-2.0"
repository = "https://github.com/yvgude/lean-ctx"

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

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.zip"

[features]
cloud-server = [
    "http-server",
    "dep:deadpool-postgres",
    "dep:tokio-postgres",
    "dep:lettre",
    "dep:jsonwebtoken",
    "dep:base64",
    "dep:uuid",
    "dep:hex",
    "dep:rand",
    "dep:argon2",
    "dep:resvg",
]
default = [
    "tree-sitter",
    "embeddings",
    "http-server",
    "team-server",
    "secure-update",
    "jemalloc",
]
dev-tools = []
embeddings = [
    "dep:ort",
    "dep:ndarray",
]
http-server = [
    "dep:axum",
    "dep:tower-http",
    "dep:reqwest",
]
jemalloc = [
    "dep:tikv-jemallocator",
    "dep:tikv-jemalloc-ctl",
]
neural = [
    "dep:ort",
    "dep:ndarray",
]
no-jail = []
ort-coreml = ["ort?/coreml"]
ort-cuda = ["ort?/cuda"]
ort-directml = ["ort?/directml"]
ort-rocm = ["ort?/rocm"]
ort-webgpu = ["ort?/webgpu"]
qdrant = ["embeddings"]
secure-update = []
team-server = ["http-server"]
tree-sitter = [
    "dep:tree-sitter",
    "dep:tree-sitter-rust",
    "dep:tree-sitter-typescript",
    "dep:tree-sitter-javascript",
    "dep:tree-sitter-python",
    "dep:tree-sitter-go",
    "dep:tree-sitter-java",
    "dep:tree-sitter-c",
    "dep:tree-sitter-cpp",
    "dep:tree-sitter-ruby",
    "dep:tree-sitter-c-sharp",
    "dep:tree-sitter-kotlin-ng",
    "dep:tree-sitter-swift",
    "dep:tree-sitter-php",
    "dep:tree-sitter-bash",
    "dep:tree-sitter-dart",
    "dep:tree-sitter-scala",
    "dep:tree-sitter-elixir",
    "dep:tree-sitter-zig",
    "dep:tree-sitter-gdscript",
    "dep:tree-sitter-lua",
    "dep:tree-sitter-luau",
]
wasm = ["dep:wasmi"]

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

[[bin]]
name = "lean-ctx"
path = "src/main.rs"

[[example]]
name = "gen_docs"
path = "src/bin/gen_docs.rs"
required-features = ["dev-tools"]

[[example]]
name = "gen_mcp_manifest"
path = "src/bin/gen_mcp_manifest.rs"
required-features = ["dev-tools"]

[[example]]
name = "gen_tdd_schema"
path = "src/bin/gen_tdd_schema.rs"
required-features = ["dev-tools"]

[[example]]
name = "lean-ctx-cloud-api"
path = "src/cloud_server_main.rs"
required-features = ["cloud-server"]

[[example]]
name = "locomo_bench"
path = "src/bin/locomo_bench.rs"
required-features = ["dev-tools"]

[[example]]
name = "seed_observatory"
path = "src/bin/seed_observatory.rs"
required-features = ["dev-tools"]

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

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

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

[dependencies.anyhow]
version = "1.0"

[dependencies.argon2]
version = "0.5"
optional = true

[dependencies.axum]
version = "0.8"
features = ["ws"]
optional = true

[dependencies.base64]
version = "0.22"
optional = true

[dependencies.blake3]
version = "1.8"

[dependencies.bytecount]
version = "0.6"

[dependencies.chacha20poly1305]
version = "0.10"

[dependencies.chrono]
version = "0.4"
features = ["serde"]

[dependencies.crossterm]
version = "0.29"

[dependencies.deadpool-postgres]
version = "0.14"
optional = true

[dependencies.dirs]
version = "6.0"

[dependencies.ed25519-dalek]
version = "2.2"
features = ["rand_core"]

[dependencies.flate2]
version = "1.1"

[dependencies.fs2]
version = "0.4"

[dependencies.futures]
version = "0.3"

[dependencies.gethostname]
version = "1.1"

[dependencies.getrandom]
version = "0.4"

[dependencies.glob]
version = "0.3"

[dependencies.hex]
version = "0.4"
optional = true

[dependencies.hkdf]
version = "0.13"

[dependencies.hmac]
version = "0.13"

[dependencies.http]
version = "1.4"

[dependencies.ignore]
version = "0.4"

[dependencies.jsonwebtoken]
version = "10.4"
optional = true

[dependencies.lettre]
version = "0.11"
features = [
    "tokio1-rustls-tls",
    "smtp-transport",
    "builder",
]
optional = true
default-features = false

[dependencies.libc]
version = "0.2"

[dependencies.lsp-types]
version = "0.97"

[dependencies.md-5]
version = "0.11"

[dependencies.memmap2]
version = "0.9"

[dependencies.moka]
version = "0.12"
features = ["sync"]

[dependencies.ndarray]
version = "0.17"
optional = true

[dependencies.ort]
version = "=2.0.0-rc.12"
features = [
    "api-24",
    "std",
    "ndarray",
    "tls-rustls",
    "tracing",
    "load-dynamic",
]
optional = true
default-features = false

[dependencies.pdf-extract]
version = "0.10"

[dependencies.postcard]
version = "1.1"
features = ["use-std"]

[dependencies.rand]
version = "0.10"
optional = true

[dependencies.ratatui]
version = "0.30"

[dependencies.rayon]
version = "1.12"

[dependencies.regex]
version = "1.12"

[dependencies.reqwest]
version = "0.13"
features = [
    "rustls",
    "stream",
    "json",
    "cookies",
]
optional = true
default-features = false

[dependencies.resvg]
version = "0.47"
optional = true

[dependencies.rmcp]
version = "1.7"
features = [
    "server",
    "client",
    "transport-io",
    "transport-streamable-http-server",
    "transport-child-process",
    "transport-streamable-http-client-reqwest",
]

[dependencies.rpassword]
version = "7.5"

[dependencies.rusqlite]
version = "0.40"
features = ["bundled"]

[dependencies.serde]
version = "1.0"
features = ["derive"]

[dependencies.serde_json]
version = "1.0"

[dependencies.sha2]
version = "0.11"

[dependencies.similar]
version = "3.1"

[dependencies.subtle]
version = "2.6"

[dependencies.tar]
version = "0.4"

[dependencies.tempfile]
version = "3.27"

[dependencies.thiserror]
version = "2.0"

[dependencies.tiktoken-rs]
version = "0.12"

[dependencies.tokio]
version = "1.52"
features = [
    "rt",
    "rt-multi-thread",
    "macros",
    "io-std",
    "io-util",
    "net",
    "sync",
    "time",
    "signal",
    "process",
]

[dependencies.tokio-postgres]
version = "0.7"
features = [
    "with-chrono-0_4",
    "with-uuid-1",
]
optional = true

[dependencies.tokio-util]
version = "0.7"
features = ["codec"]

[dependencies.toml]
version = "1.1"

[dependencies.toml_edit]
version = "0.25"

[dependencies.tower-http]
version = "0.7"
features = [
    "cors",
    "auth",
]
optional = true

[dependencies.tracing]
version = "0.1"

[dependencies.tracing-subscriber]
version = "0.3"
features = ["env-filter"]

[dependencies.tree-sitter]
version = "0.26"
optional = true

[dependencies.tree-sitter-bash]
version = "0.25"
optional = true

[dependencies.tree-sitter-c]
version = "0.24"
optional = true

[dependencies.tree-sitter-c-sharp]
version = "0.23"
optional = true

[dependencies.tree-sitter-cpp]
version = "0.23"
optional = true

[dependencies.tree-sitter-dart]
version = "0.2"
optional = true

[dependencies.tree-sitter-elixir]
version = "0.3"
optional = true

[dependencies.tree-sitter-gdscript]
version = "6.1"
optional = true

[dependencies.tree-sitter-go]
version = "0.25"
optional = true

[dependencies.tree-sitter-java]
version = "0.23"
optional = true

[dependencies.tree-sitter-javascript]
version = "0.25"
optional = true

[dependencies.tree-sitter-kotlin-ng]
version = "1.1"
optional = true

[dependencies.tree-sitter-lua]
version = "0.5"
optional = true

[dependencies.tree-sitter-luau]
version = "1.2"
optional = true

[dependencies.tree-sitter-php]
version = "0.24"
optional = true

[dependencies.tree-sitter-python]
version = "0.25"
optional = true

[dependencies.tree-sitter-ruby]
version = "0.23"
optional = true

[dependencies.tree-sitter-rust]
version = "0.24"
optional = true

[dependencies.tree-sitter-scala]
version = "0.26"
optional = true

[dependencies.tree-sitter-swift]
version = "0.7"
optional = true

[dependencies.tree-sitter-typescript]
version = "0.23"
optional = true

[dependencies.tree-sitter-zig]
version = "1.1"
optional = true

[dependencies.unicode-width]
version = "0.2"

[dependencies.ureq]
version = "3.3"

[dependencies.urlencoding]
version = "2.1"

[dependencies.uuid]
version = "1.23"
features = [
    "v4",
    "serde",
]
optional = true

[dependencies.walkdir]
version = "2.5"

[dependencies.wasmi]
version = "1.1"
optional = true

[dependencies.zip]
version = "8.6"

[dependencies.zstd]
version = "0.13"

[dev-dependencies.criterion]
version = "0.8"
features = ["html_reports"]

[dev-dependencies.filetime]
version = "0.2"

[dev-dependencies.insta]
version = "1.48"

[dev-dependencies.jsonschema]
version = "0.46"
default-features = false

[dev-dependencies.proptest]
version = "1.11"

[dev-dependencies.serial_test]
version = "3.5"

[dev-dependencies.tempfile]
version = "3.27"

[dev-dependencies.tower]
version = "0.5"

[dev-dependencies.wat]
version = "1.252"

[target."cfg(not(windows))".dependencies.tikv-jemalloc-ctl]
version = "0.7"
optional = true

[target."cfg(not(windows))".dependencies.tikv-jemallocator]
version = "0.7"
optional = true

[target."cfg(windows)".dependencies.windows-sys]
version = "0.61"
features = [
    "Win32_Foundation",
    "Win32_System_Threading",
    "Win32_Security",
    "Win32_System_Pipes",
]

[lints.clippy]
cast_lossless = "allow"
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
doc_markdown = "allow"
float_cmp = "allow"
format_push_string = "allow"
implicit_hasher = "allow"
items_after_statements = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
no_effect_underscore_binding = "allow"
return_self_not_must_use = "allow"
similar_names = "allow"
struct_excessive_bools = "allow"
too_many_lines = "allow"
trivially_copy_pass_by_ref = "allow"
unreadable_literal = "allow"
used_underscore_binding = "allow"

[lints.clippy.pedantic]
level = "warn"
priority = -1

[lints.rust]
unreachable_pub = "warn"

[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = ["cfg(tarpaulin)"]

[profile.dev]
debug = "line-tables-only"

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "unwind"
strip = true
