[package]
name        = "tatara-wasm"
description = "Multi-runtime WASI/WASM host for tatara — one crate, feature-gated runtimes (wasmtime, WasmEdge, Wasmer, wasmi, WAMR). Phase H.3 + H.4."
version     .workspace = true
edition     .workspace = true
authors     .workspace = true
license     .workspace = true

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

[features]
# Default: the reference WASI Preview 2 implementation.
default = ["runtime-wasmtime"]

# Runtime backends — each pluggable, each can coexist at consumer choice.
runtime-wasmtime = ["dep:wasmtime", "dep:wasmtime-wasi", "dep:wat"]
runtime-wasmer   = ["dep:wasmer", "dep:wat"]
runtime-wasmi    = ["dep:wasmi", "dep:wat"]
runtime-wamr     = []       # H.4 follow-up — needs C build harness.
runtime-wasmedge = []       # H.4 follow-up — needs C++ SDK.

# "All Rust-native" — convenient feature for the CI smoke matrix.
all-rust-runtimes = ["runtime-wasmtime", "runtime-wasmer", "runtime-wasmi"]

# Optional WASI feature gates — runtime support varies.
wasi-nn    = []   # Neural network interface.
wasi-http  = []   # HTTP imports.
wasi-clocks = []  # Clocks (baseline p2 — enabled by default per runtime).
wasi-sockets = [] # Raw socket imports.

[dependencies]
wasmtime      = { version = "25", optional = true }
wasmtime-wasi = { version = "25", optional = true }
wasmer        = { version = "5", optional = true, default-features = false, features = ["cranelift", "sys"] }
wasmi         = { version = "0.40", optional = true }
wat           = { version = "1", optional = true }

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