# 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 = "2021"
name = "lean-ctx"
version = "3.5.0"
build = "build.rs"
exclude = [
    "examples/",
    "tests/",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Context Runtime for AI Agents with CCP. 57 MCP tools, 10 read modes, 95+ compression patterns, cross-session memory (CCP), persistent AI knowledge with temporal facts + contradiction detection, multi-agent context sharing + diaries, 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"

[features]
cloud-server = [
    "http-server",
    "dep:deadpool-postgres",
    "dep:tokio-postgres",
    "dep:lettre",
    "dep:jsonwebtoken",
    "dep:uuid",
    "dep:hex",
    "dep:rand",
]
default = [
    "tree-sitter",
    "embeddings",
    "http-server",
    "secure-update",
]
embeddings = [
    "dep:rten",
    "dep:rten-tensor",
]
http-server = [
    "dep:axum",
    "dep:tower-http",
    "dep:reqwest",
]
neural = [
    "dep:rten",
    "dep:rten-tensor",
]
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",
]

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

[[bin]]
name = "gen_mcp_manifest"
path = "src/bin/gen_mcp_manifest.rs"

[[bin]]
name = "gen_tdd_schema"
path = "src/bin/gen_tdd_schema.rs"

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

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

[[bin]]
name = "seed_observatory"
path = "src/bin/seed_observatory.rs"

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

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

[dependencies.anyhow]
version = "1"

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

[dependencies.bytecount]
version = "0.6.9"

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

[dependencies.crossterm]
version = "0.28"

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

[dependencies.dirs]
version = "5"

[dependencies.flate2]
version = "1"

[dependencies.futures]
version = "0.3"

[dependencies.getrandom]
version = "0.3"

[dependencies.glob]
version = "0.3.3"

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

[dependencies.ignore]
version = "0.4"

[dependencies.jsonwebtoken]
version = "10.3"
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.md-5]
version = "0.10"

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

[dependencies.ratatui]
version = "0.30"

[dependencies.regex]
version = "1"

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

[dependencies.rmcp]
version = "1"
features = [
    "server",
    "transport-io",
    "transport-streamable-http-server",
]

[dependencies.rpassword]
version = "7.4.0"

[dependencies.rten]
version = "0.24"
optional = true

[dependencies.rten-tensor]
version = "0.24"
optional = true

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

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

[dependencies.serde_json]
version = "1"

[dependencies.sha2]
version = "0.10"

[dependencies.similar]
version = "2"

[dependencies.tar]
version = "0.4.45"

[dependencies.thiserror]
version = "2"

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

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

[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 = "0.8"

[dependencies.tower-http]
version = "0.6"
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.1"
optional = true

[dependencies.tree-sitter-elixir]
version = "0.3"
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-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.25"
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.ureq]
version = "3.3.0"

[dependencies.urlencoding]
version = "2"

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

[dependencies.walkdir]
version = "2"

[dependencies.zip]
version = "8.4.0"

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

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

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

[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.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = ["cfg(tarpaulin)"]

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