[package]
name = "koda-core"
version = "0.2.8"
edition = "2024"
description = "Core engine for the Koda AI coding agent (macOS and Linux only)"
license = "MIT"
repository = "https://github.com/lijunzh/koda"
homepage = "https://github.com/lijunzh/koda"
readme = "README.md"
keywords = ["ai", "coding-agent", "llm", "engine", "unix"]
categories = ["development-tools"]
authors = ["Lijun Zhu"]

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

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

# Database
sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio", "sqlite", "macros"] }

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

# Logging
tracing = "0.1"

# File system (respects .gitignore)
ignore = "0.4"

# Path normalization
path-clean = "1"

# Text search
regex = "1"

# Diff computation
similar = "3"

# File globbing
glob = "0.3"

# URL parsing (for SSRF protection)
url = "2"

# Unique IDs
uuid = { version = "1", features = ["v4"] }

# Base64 encoding (for image support)
base64 = "0.22"

# HTTP client (for LLM API)
reqwest = { version = "0.13", features = ["json", "stream"] }

# Streaming support
futures-util = "0.3"

# Error handling
anyhow = "1"

# First-party workspace libraries (direct calls)

# Async trait support
async-trait = "0.1"

# Cancellation tokens
tokio-util = { version = "0.7", features = ["rt"] }

[features]
test-support = []

[dev-dependencies]
insta = { version = "1", features = ["yaml", "redactions"] }
koda-test-utils = { path = "../koda-test-utils" }
tempfile = "3"
tokio = { version = "1", features = ["full", "test-util"] }
regex = "1"
ignore = "0.4"
anyhow = "1"
async-trait = "0.1"

# Integration tests that need mock infrastructure.
# Run with: cargo test -p koda-core --features test-support
[[test]]
name = "e2e_test"
required-features = ["test-support"]

[[test]]
name = "e2e_agent_test"
required-features = ["test-support"]

[[test]]
name = "e2e_skills_test"
required-features = ["test-support"]

[[test]]
name = "e2e_tools_test"
required-features = ["test-support"]

[[test]]
name = "cancel_test"
required-features = ["test-support"]

[[test]]
name = "inference_recovery_test"
required-features = ["test-support"]

[[test]]
name = "inference_edge_test"
required-features = ["test-support"]

[[test]]
name = "e2e_safety_test"
required-features = ["test-support"]

[[test]]
name = "session_test"
required-features = ["test-support"]
