[package]
name = "pawan-core"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
description = "Pawan (पवन) — Core library: agent, tools, config, healing"
keywords = ["cli", "coding", "agent", "ai", "self-healing"]
categories = ["command-line-utilities", "development-tools"]
readme = "README.md"

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

[features]
default = ["deagle", "tasks", "git-sessions"]

# deagle: embedded code-intelligence (deagle-core + deagle-parse + rayon).
# Adds tree-sitter parsers for 9 languages; ~30-50 MB binary overhead.
# Disable with `default-features = false` for lean builds (pawan-api, tests).
deagle = ["dep:deagle-core", "dep:deagle-parse", "dep:rayon"]

# tasks: SQLite-backed beads task tracker (rusqlite bundled).
# Disable to skip the C build of SQLite.
tasks = ["dep:rusqlite"]

# git-sessions: gix-backed conversation tree persistence.
# Disable to skip pure-Rust gix dep (no C, but adds compile units).
git-sessions = ["dep:gix"]

# lancor: llama.cpp local inference backend (optional).
lancor = ["dep:lancor"]

# memory: lightweight long-term memory store + prompt injection.
# Flat-file store under ~/.pawan/memories by default.
memory = []

[dependencies]
# Core from workspace
tokio = { workspace = true }
tokio-util = "0.7"
serde = { workspace = true }
serde_json = { workspace = true }
async-trait = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
uuid = { workspace = true }
chrono = { workspace = true }
futures = { workspace = true }
toml = { workspace = true }

# HTTP client
reqwest = { workspace = true }
url = "2"

# Binary detection for native tools
which = { workspace = true }

# Home directory resolution
dirs = { workspace = true }

# File operations
glob = "0.3"
ignore = "0.4"
walkdir = "2.5"
similar = "2.6"
regex = "1.12"
rand = "0.8"

# Git-backed sessions (pure Rust — gix, no C) (conversation trees)
gix = { version = "0.83", default-features = false, features = ["sha1", "tree-editor"], optional = true }

# Beads-style task tracking (SQLite-backed)
rusqlite = { optional = true, version = "0.34", features = ["bundled"] }

# Deagle code intelligence — embedded directly so pawan no longer
# requires the `deagle` binary on PATH. Adds tree-sitter parsers for
# 9 languages (~30-50MB binary bloat) but eliminates one external dep.
# `pattern` feature enables ast-grep structural search; `text-search`
# enables FTS5 keyword indexing via the grep-* crates.
# 0.1.5 adds tree-sitter-ruby for Ruby/Rake/gemspec files.
deagle-core = { version = "0.1.5", optional = true }
deagle-parse = { optional = true, version = "0.1.5", features = ["pattern", "text-search"] }

# Parallel walking for the embedded deagle_map implementation
rayon = { version = "1.10", optional = true }

# Secure password input
rpassword = "7.3"

# Thulp — reuse tool types + skill file parsing (DRY)
thulp-core = { workspace = true }
thulp-skill-files = { workspace = true }
thulp-skills = { workspace = true }
thulp-query = { workspace = true }

# Thulpoff — skill distillation from agent sessions
thulpoff-core = { workspace = true }
thulpoff-engine = { workspace = true }

# Ares — composable LLM backends + tool coordination (REQUIRED)
# Renamed to `ares` so existing bridge code (ares_backend.rs, ares_bridge.rs)
# can use `ares::llm::...` etc. without changes.
ares-server = { workspace = true }

# Terminal multiplexing / persistent pane automation
rmux-sdk = "0.5"

# Secure credential storage
keyring = "3.6"

# Lancor — llama.cpp toolkit for local inference (optional, feature-gated)
lancor = { workspace = true, optional = true }

[dev-dependencies]
tempfile = { workspace = true }
tokio-test = "0.4"
serial_test = "3.2"

mockito = "1.6"