[package]
name = "feagi-io"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
description = "FEAGI I/O System"

[features]
default = ["feagi-server", "feagi-client", "zmq-transport", "websocket-transport-std", "shm-transport"]

# Direction
feagi-server = []
feagi-client = []

# Platform targets
platform-std = []
platform-no-std = []
platform-wasm = []

zmq-transport = ["dep:zmq"]
websocket-transport-std = ["dep:tungstenite"] # Poll-based WebSocket using non-blocking sockets
shm-transport = [] # Shared memory
bluetooth-transport = [] # Serial over bluetooth
# WASM features cannot be mixed with any of the default ones
websocket-transport-wasm = [] # WASM WebSocket implementation
js-bridge-wasm = [] # WASM javascript bridge implementation



[dependencies]
feagi-serialization = { workspace = true }
serde = { workspace = true }


# Specific Dependencies
# ZMQ (have to use the C based package as it supports blocking configs)
zmq = { version = "0.10.0", optional = true }  # ZMQ transport

# WebSocket (non-WASM) - poll-based using non-blocking sockets
tungstenite = { version = "0.24.0", optional = true }
getrandom = "0.2.17"
base64 = "0.22.1" # Using an older version for now

[dev-dependencies]
feagi-structures = { workspace = true }
serde_json = { workspace = true }


# Examples that test both ZMQ and WebSocket transports
[[example]]
name = "pub_sub"
required-features = ["zmq-transport", "websocket-transport-std", "feagi-server", "feagi-client"]

[[example]]
name = "push_pull"
required-features = ["zmq-transport", "websocket-transport-std", "feagi-server", "feagi-client"]

[[example]]
name = "request_reply"
required-features = ["zmq-transport", "websocket-transport-std", "feagi-server", "feagi-client"]


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