[package]
name = "ecotokens"
version = "0.14.3"
edition = "2021"
description = "Token optimizer for AI coding assistants — hooks into Claude Code/Gemini CLI to compress shell outputs and track USD savings"
license = "MIT"
repository = "https://github.com/hansipie/ecotokens"
homepage = "https://github.com/hansipie/ecotokens"
keywords = ["claude", "gemini", "tokens", "cli", "ai"]
categories = ["command-line-utilities", "development-tools"]
exclude = ["assets/*.gif", "assets/picture.png", "assets/icon.png"]

[features]
default = ["embeddings", "ai-summary"]
exact-tokens = ["tiktoken-rs"]
embeddings = []
ai-summary = []

[dependencies]
clap = { version = "4", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
similar = "2"
regex = "1.10"
lazy-regex = "3"
dirs = "5"
rusqlite = { version = "0.31", features = ["bundled"] }
toml = "0.8"
ratatui = { version = "0.29", features = ["crossterm"] }
uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4", features = ["serde"] }

# P3 — index BM25 + symbolic
tantivy = "0.22"
ignore = "0.4"          # gitignore-aware file walker
tree-sitter = "0.24"
tree-sitter-rust = "0.23"
tree-sitter-python = "0.23"
tree-sitter-javascript = "0.23"
tree-sitter-c = "0.23"
tree-sitter-cpp = "0.23"

# P3 daemon — file watcher
notify = "6"

# Optional
tiktoken-rs = { version = "0.5", optional = true }
reqwest = { version = "0.12", features = ["json", "blocking", "rustls-tls"], default-features = false }

# Daemonization for background watch
[target.'cfg(unix)'.dependencies]
daemonize = "0.5"

[dev-dependencies]
tempfile = "3"

# ── Integration test targets ──────────────────────────────────────────────────
[[test]]
name = "counter_test"
path = "tests/tokens/counter_test.rs"

[[test]]
name = "settings_test"
path = "tests/config/settings_test.rs"

[[test]]
name = "session_store_test"
path = "tests/config/session_store_test.rs"

[[test]]
name = "patterns_test"
path = "tests/masking/patterns_test.rs"

[[test]]
name = "generic_test"
path = "tests/filter/generic_test.rs"

[[test]]
name = "git_test"
path = "tests/filter/git_test.rs"

[[test]]
name = "cargo_test"
path = "tests/filter/cargo_test.rs"

[[test]]
name = "fs_test"
path = "tests/filter/fs_test.rs"

[[test]]
name = "markdown_test"
path = "tests/filter/markdown_test.rs"

[[test]]
name = "python_test"
path = "tests/filter/python_test.rs"

[[test]]
name = "cpp_test"
path = "tests/filter/cpp_test.rs"

[[test]]
name = "config_file_test"
path = "tests/filter/config_file_test.rs"

[[test]]
name = "ai_summary_test"
path = "tests/filter/ai_summary_test.rs"

[[test]]
name = "go_test"
path = "tests/filter/go_test.rs"

[[test]]
name = "js_test"
path = "tests/filter/js_test.rs"

[[test]]
name = "gh_test"
path = "tests/filter/gh_test.rs"

[[test]]
name = "container_test"
path = "tests/filter/container_test.rs"

[[test]]
name = "store_test"
path = "tests/metrics/store_test.rs"

[[test]]
name = "clear_test"
path = "tests/metrics/clear_test.rs"

[[test]]
name = "report_test"
path = "tests/metrics/report_test.rs"

[[test]]
name = "handler_test"
path = "tests/hook/handler_test.rs"

[[test]]
name = "post_handler_test"
path = "tests/hook/post_handler_test.rs"

[[test]]
name = "read_handler_test"
path = "tests/hook/read_handler_test.rs"

[[test]]
name = "grep_handler_test"
path = "tests/hook/grep_handler_test.rs"

[[test]]
name = "glob_handler_test"
path = "tests/hook/glob_handler_test.rs"

[[test]]
name = "install_test"
path = "tests/integration/install_test.rs"

[[test]]
name = "index_test"
path = "tests/search/index_test.rs"

[[test]]
name = "search_test"
path = "tests/search/search_test.rs"

[[test]]
name = "symbols_test"
path = "tests/search/symbols_test.rs"

[[test]]
name = "outline_test"
path = "tests/search/outline_test.rs"

[[test]]
name = "text_docs_test"
path = "tests/search/text_docs_test.rs"

[[test]]
name = "constitution_test"
path = "tests/integration/constitution_test.rs"

[[test]]
name = "end_to_end_test"
path = "tests/integration/end_to_end_test.rs"

[[test]]
name = "perf_test"
path = "tests/integration/perf_test.rs"

[[test]]
name = "fault_test"
path = "tests/integration/fault_test.rs"

[[test]]
name = "outline_tui_test"
path = "tests/tui/outline_test.rs"

[[test]]
name = "progress_tui_test"
path = "tests/tui/progress_test.rs"

[[test]]
name = "trace_test"
path = "tests/trace/trace_test.rs"

[[test]]
name = "trace_tui_test"
path = "tests/tui/trace_test.rs"

[[test]]
name = "gain_tui_test"
path = "tests/tui/gain_test.rs"

[[test]]
name = "embed_test"
path = "tests/search/embed_test.rs"

[[test]]
name = "watcher_test"
path = "tests/search/watcher_test.rs"

[[test]]
name = "daemon_test"
path = "tests/integration/daemon_test.rs"

[[test]]
name = "watch_tui_test"
path = "tests/tui/watch_test.rs"

[[test]]
name = "grep_test"
path = "tests/filter/grep_test.rs"

[[test]]
name = "aws_test"
path = "tests/filter/aws_test.rs"

[[test]]
name = "network_test"
path = "tests/filter/network_test.rs"

[[test]]
name = "db_test"
path = "tests/filter/db_test.rs"

[[test]]
name = "detect_test"
path = "tests/duplicates/detect_test.rs"

[[test]]
name = "proposals_test"
path = "tests/duplicates/proposals_test.rs"

[[test]]
name = "duplicates_integration_test"
path = "tests/duplicates/integration_test.rs"
