[package]
authors.workspace = true
description = "Core library for TypeDialog - form handling and multiple rendering backends"
edition.workspace = true
license.workspace = true
name = "typedialog-core"
repository.workspace = true
version.workspace = true

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

[dependencies]
# Core dependencies
anyhow.workspace = true
async-trait.workspace = true
chrono.workspace = true
dirs.workspace = true                        # For config path resolution
serde = { workspace = true }
serde_json.workspace = true
serde_yaml.workspace = true
tempfile.workspace = true
tera = { workspace = true, optional = true }
thiserror.workspace = true
toml.workspace = true
tracing.workspace = true                     # Logging framework

# i18n (optional)
fluent = { workspace = true, optional = true }
fluent-bundle = { workspace = true, optional = true }
sys-locale = { workspace = true, optional = true }
unic-langid = { workspace = true, optional = true }

# Nushell integration (optional)
nu-plugin = { workspace = true, optional = true }
nu-protocol = { workspace = true, optional = true }

# CLI Backend (inquire) - optional
dialoguer = { workspace = true, optional = true }
inquire = { workspace = true, optional = true }
rpassword = { workspace = true, optional = true }

# TUI Backend (ratatui) - optional
atty = { workspace = true, optional = true }
crossterm = { workspace = true, optional = true }
ratatui = { workspace = true, optional = true }

# Web Backend (axum) - optional
axum = { workspace = true, optional = true }
futures = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
tower = { workspace = true, optional = true }
tower-http = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }

# Encryption - optional (prov-ecosystem integration)
encrypt = { path = "../../../prov-ecosystem/crates/encrypt", optional = true }

# AI Backend - optional
bincode = { workspace = true, optional = true }
instant-distance = { workspace = true, optional = true }
petgraph = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
serde_bytes = { workspace = true, optional = true }
tantivy = { workspace = true, optional = true }

[dev-dependencies]
age = "0.11"
criterion.workspace = true
proptest.workspace = true
serde_json.workspace = true
tokio = { workspace = true, features = ["full"] }

[features]
ai_backend = ["instant-distance", "tantivy", "bincode", "serde_bytes", "rand", "petgraph"]
all-backends = ["cli", "tui", "web"]
cli = ["inquire", "dialoguer", "rpassword"]
default = ["cli", "i18n", "templates"]
encryption = ["encrypt"]
full = ["i18n", "templates", "nushell", "encryption", "ai_backend", "all-backends"]
i18n = ["fluent", "fluent-bundle", "unic-langid", "sys-locale"]
nushell = ["nu-protocol", "nu-plugin"]
templates = ["tera"]
tui = ["ratatui", "crossterm", "atty"]
web = ["axum", "tokio", "tower", "tower-http", "tracing-subscriber", "futures"]

[[bench]]
harness = false
name = "parsing_benchmarks"

[lints]
workspace = true
