[package]
name = "arora"
version = "5.0.0"
edition = "2021"
description = "Opinionated Arora runtime: an engine pre-wired with the native behavior-tree control nodes and the Semio backend."
license = "MIT"

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

[[bin]]
name = "arora"
path = "src/main.rs"
# The binary is the headless Studio device runner, so it needs the opt-in
# studio-bridge feature. On wasm, build the library with --no-default-features.
required-features = ["native"]

# A worked example of a device-specific arora (custom HAL injected into
# arora::launch). Native-only, like the binary.
[[example]]
name = "device"
required-features = ["native"]

[features]
default = ["native", "tui"]
# Native build: the wasmtime + dynamic-library engine hosts and the binary. Build
# for wasm32 with --no-default-features (the browser host is selected by target
# cfg).
native = [
    "dep:tokio",
    "dep:arora-bridge-ws",
    "dep:env_logger",
    # The operator interface (`arora::operator`) is an async trait.
    "dep:async-trait",
    "arora-engine/wasmtime-host",
    "arora-engine/native-host",
]
# The Semio Studio connection: the studio-bridge Zenoh connector plus the
# headless device runner (Firebase auth, token storage, app-data dir, logging)
# that registers the device with Studio. Opt-in: a plain arora runtime (e.g.
# Vizij hosting a local bridge) does not talk to the Semio store at all.
studio-bridge = [
    "native",
    "dep:arora-studio-bridge-client",
    "dep:crypto_secretbox",
    "dep:dirs",
    "dep:rustls",
]
# The terminal operator UI (`arora::tui`): device header, scrollable log pane,
# live indicators, and the prompt line the operator answers questions on. The
# binary uses it when it detects an interactive terminal; embedders who bring
# their own UI can build with default-features = false + "native".
tui = ["native", "dep:ratatui", "dep:sysinfo", "dep:env_filter"]

[dependencies]
arora-engine = { path = "../arora-engine", version = "1", default-features = false }
arora-behavior-tree = { path = "../arora-behavior-tree", version = "4" }
arora-behavior = { path = "../arora-behavior", version = "3" }
arora-types = { path = "../arora-types", version = "1.4" }
arora-bridge-ws = { path = "../arora-bridge-ws", version = "3", optional = true }
anyhow = "1"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"], optional = true }
uuid = { version = "1", features = ["serde", "v4"] }
# The three interfaces the runtime loop wires around the shared state.
arora-hal = { path = "../arora-hal", version = "2" }
arora-bridge = { path = "../arora-bridge", version = "3" }
arora-simple-data-store = { path = "../arora-simple-data-store", version = "1" }
futures = "0.3"
# The default Bridge implementation: the studio-bridge Zenoh connector, published
# as `arora-studio-bridge-client` (it also provides the Firebase config types the
# headless runner needs, under `firestore_support::options`). Native-only
# (zenoh/firestore) and optional, so the wasm build of the library stays lean.
# arora bundles it so a device-specific binary only has to provide its own HAL.
arora-studio-bridge-client = { version = "2", optional = true }
# Headless device-runner deps (native-only, optional). Versions track
# studio-bridge/headless, the runner this is ported from.
crypto_secretbox = { version = "0.1.1", optional = true }
dirs = { version = "6", optional = true }
env_logger = { version = "0.11", optional = true }
log = "0.4"
rustls = { version = "0.23.27", default-features = false, features = ["ring"], optional = true }
# The operator interface (`arora::operator`) is an async trait.
async-trait = { version = "0.1", optional = true }
# Terminal operator UI (the "tui" feature).
ratatui = { version = "0.29", optional = true }
# Own-process CPU usage for the TUI's indicators panel.
sysinfo = { version = "0.33", default-features = false, features = ["system"], optional = true }
# RUST_LOG-style filtering for the TUI's in-pane log capture.
env_filter = { version = "0.1", optional = true }

[dev-dependencies]
async-trait = "0.1"
# `time` + `test-util` (tests only): the operator tests pause time
# (`start_paused`) to elapse the access grace instantly. The runtime-loop tests
# are fully synchronous (the I/O seams are non-blocking), so they need no timers.
tokio = { version = "1", features = ["time", "test-util"] }
