brainwires-code-interpreters 0.6.0

Sandboxed code execution for multiple languages (Rhai, Lua, JavaScript, Python)
Documentation
[package]
name = "brainwires-code-interpreters"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
description = "Sandboxed code execution for multiple languages (Rhai, Lua, JavaScript, Python)"
readme = "README.md"
documentation = "https://docs.rs/brainwires-code-interpreters"
keywords = ["code-execution", "sandbox", "javascript", "python", "interpreter"]
categories = ["development-tools"]

[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = ["native", "rhai", "lua"]
native = []
# Individual language support
rhai = ["dep:rhai"]
lua = ["dep:mlua"]
javascript = ["dep:boa_engine"]
# python = ["dep:rustpython-vm", "dep:rustpython-stdlib"]  # Temporarily disabled
# All languages
all-languages = ["rhai", "lua", "javascript"]
# WASM target support
wasm = ["wasm-bindgen", "js-sys", "web-sys", "getrandom/js", "serde-wasm-bindgen"]

[dependencies]
# Core
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0"

# Rhai - Native Rust scripting (lightweight, fast)
rhai = { version = "1.20", optional = true }

# Lua - mlua with Lua 5.4 (small, fast)
mlua = { version = "0.10.3", features = ["lua54", "vendored"], optional = true }

# JavaScript - Boa engine (ECMAScript compliant)
boa_engine = { version = "0.21", optional = true }

# Python - RustPython (CPython 3.12 compatible)
# Temporarily disabled: libsqlite3-sys version conflict with brainwires-cognition
# rustpython-vm = { version = "0.4", optional = true, default-features = false, features = ["freeze-stdlib"] }
# rustpython-stdlib = { version = "0.4", optional = true }

# WASM bindings (for browser target)
wasm-bindgen = { version = "0.2", optional = true }
js-sys = { version = "0.3", optional = true }
web-sys = { version = "0.3", features = ["console"], optional = true }
getrandom = { version = "0.2", optional = true }
serde-wasm-bindgen = { version = "0.6", optional = true }

[dev-dependencies]
tokio = { version = "1", features = ["rt", "macros"] }

[[example]]
name = "multi_language"
required-features = ["rhai", "lua"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom_03 = { package = "getrandom", version = "0.3", features = ["wasm_js"] }

[package.metadata.wasm-pack.profile.release]
wasm-opt = false