[package]
name        = "klieo"
version     = "0.7.0"
edition     = "2021"
rust-version = "1.83"
description = "Open-source Rust agent framework — typed agents, durable inter-agent comms, local-first."
readme      = "README.md"
license     = "MIT"
keywords    = ["agent", "llm", "ai", "framework", "nats"]
categories  = ["asynchronous", "api-bindings"]
repository.workspace    = true
homepage.workspace      = true
documentation.workspace = true

[dependencies]
klieo-core         = { path = "../klieo-core", version = "0.7" }
secrecy            = { workspace = true, optional = true }
bytes              = { workspace = true, optional = true }

# Foundation (W2)
klieo-tools         = { path = "../klieo-tools",         version = "0.7", optional = true }
klieo-macros        = { path = "../klieo-macros",        version = "0.7", optional = true }
klieo-llm-ollama    = { path = "../klieo-llm-ollama",    version = "0.7", optional = true }
klieo-memory-sqlite = { path = "../klieo-memory-sqlite", version = "0.7", optional = true }
klieo-bus-memory    = { path = "../klieo-bus-memory",    version = "0.7", optional = true }
klieo-bus-nats      = { path = "../klieo-bus-nats",      version = "0.7", optional = true }
klieo-tools-mcp     = { path = "../klieo-tools-mcp",     version = "0.7", optional = true }

# LLM providers (W3)
klieo-llm-openai    = { path = "../klieo-llm-openai",    version = "0.7", optional = true }
klieo-llm-anthropic = { path = "../klieo-llm-anthropic", version = "0.7", optional = true }
klieo-llm-gemini    = { path = "../klieo-llm-gemini",    version = "0.7", optional = true }

# Memory backends (W3)
klieo-memory-neo4j  = { path = "../klieo-memory-neo4j",  version = "0.7", optional = true }
klieo-memory-qdrant = { path = "../klieo-memory-qdrant", version = "0.7", optional = true }
klieo-embed-common  = { path = "../klieo-embed-common",  version = "0.7", optional = true }

# Composition + protocol (W3)
klieo-flows         = { path = "../klieo-flows",         version = "0.7", optional = true }
klieo-a2a           = { path = "../klieo-a2a",           version = "0.7", optional = true }
klieo-spec          = { path = "../klieo-spec",          version = "0.7", optional = true }

# Observability + provenance (W3)
klieo-runlog        = { path = "../klieo-runlog",        version = "0.7", optional = true }
klieo-provenance    = { path = "../klieo-provenance",    version = "0.7", optional = true }
klieo-otel          = { path = "../klieo-otel",          version = "0.7", optional = true }

[features]
default = []

# Third-party re-export gates (auto-activated by capability features below)
secrecy        = ["dep:secrecy"]
bytes          = ["dep:bytes"]

# Foundation
tools          = ["dep:klieo-tools"]
macros         = ["dep:klieo-macros"]
llm-ollama     = ["dep:klieo-llm-ollama"]
memory-sqlite  = ["dep:klieo-memory-sqlite"]
bus-memory     = ["dep:klieo-bus-memory"]
bus-nats       = ["dep:klieo-bus-nats", "secrecy", "bytes"]
mcp            = ["dep:klieo-tools-mcp", "tools"]

# LLM providers
llm-openai     = ["dep:klieo-llm-openai", "secrecy"]
llm-anthropic  = ["dep:klieo-llm-anthropic", "secrecy"]
llm-gemini     = ["dep:klieo-llm-gemini", "secrecy"]
# Deprecated: renamed to `llm-gemini` in 0.7.0. Removed in 0.8.
llm-genai      = ["llm-gemini"]

# Memory backends
memory-neo4j   = ["dep:klieo-memory-neo4j", "secrecy"]
memory-qdrant  = ["dep:klieo-memory-qdrant", "secrecy"]
embed-common   = ["dep:klieo-embed-common"]

# Composition + protocol
flows          = ["dep:klieo-flows"]
a2a            = ["dep:klieo-a2a"]
spec           = ["dep:klieo-spec"]

# Observability + provenance
runlog              = ["dep:klieo-runlog"]
runlog-sqlite       = ["runlog", "klieo-runlog/sqlite"]
runlog-compaction-llm = ["runlog", "klieo-runlog/compaction-llm"]
provenance     = ["dep:klieo-provenance"]
otel           = ["dep:klieo-otel"]

# Cross-cutting: JsonSchema derives on public types.
# Activates klieo-provenance/schemars and klieo-runlog/schemars when those
# crates are already enabled. The `?` makes both activations conditional —
# if provenance or runlog are not in the feature set the no-op quietly.
schemars = [
    "klieo-provenance?/schemars",
    "klieo-runlog?/schemars",
]

# Aggregate features.
# `all-foundation` keeps backwards compatibility: the W2 foundation stack only.
all-foundation = ["tools", "macros", "llm-ollama", "memory-sqlite", "bus-memory", "bus-nats", "mcp"]
# `all-llm` — every LLM provider crate.
all-llm        = ["llm-ollama", "llm-openai", "llm-anthropic", "llm-gemini"]
# `all-memory` — every memory backend.
all-memory     = ["memory-sqlite", "memory-neo4j", "memory-qdrant", "embed-common"]
# `all-observability` — RunLog + OTel + provenance.
all-observability = ["runlog", "otel", "provenance"]
# `full` — every impl crate. Heavy compile cost; for downstream integration tests.
full = [
    "all-foundation",
    "all-llm",
    "all-memory",
    "all-observability",
    "flows",
    "a2a",
    "spec",
]

memory-fastembed  = ["memory-sqlite", "klieo-memory-sqlite/fastembed"]
memory-sqlite-vec = ["memory-sqlite", "klieo-memory-sqlite/sqlite-vec"]

test-utils = ["klieo-core/test-utils"]

[dev-dependencies]
klieo              = { path = ".", features = ["all-foundation", "test-utils"] }
tokio               = { workspace = true, features = ["macros", "rt-multi-thread"] }
tokio-util          = { workspace = true }
serde_json          = { workspace = true }
bytes               = { workspace = true }
tempfile            = { workspace = true }
wiremock            = { workspace = true }
tracing-subscriber  = "0.3"
hello-agent         = { path = "../../examples/hello-agent" }
klieo-tools-mcp    = { path = "../klieo-tools-mcp" }
