[package]
name = "batuta"
version = "0.6.3"
edition = "2021"
rust-version = "1.89"
authors = ["Pragmatic AI Labs"]
license = "MIT"
description = "Orchestration framework for converting ANY project (Python, C/C++, Shell) to modern Rust"
repository = "https://github.com/paiml/Batuta"
keywords = ["transpiler", "rust", "python", "c", "ml"]
categories = ["command-line-utilities", "development-tools"]
readme = "README.md"
exclude = [
    "book/",
    "docs/specifications/",
    ".github/",
    "*.md.bak",
]

[dependencies]
# Core dependencies (WASM-compatible)
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
thiserror = "2.0"
chrono = { version = "0.4", features = ["serde"] }
async-trait = "0.1"
# CLI and configuration (native-only)
clap = { version = "4.5", features = ["derive", "env"], optional = true }
serde_yaml = { version = "0.9", optional = true }
toml = { version = "0.9", optional = true }

# Async runtime (different for WASM vs native)
tokio = { version = "1.48", features = ["full"], optional = true }

# Logging and tracing (native-only)
tracing = { version = "0.1", optional = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }

# File system and paths (native-only)
walkdir = { version = "2.5", optional = true }
glob = { version = "0.3", optional = true }

# Process execution (native-only)
which = { version = "6.0", optional = true }

# Syscall tracing (native-only)
renacer = { version = "0.9.8", optional = true }

# High-performance compute (SIMD/GPU, native-only)
trueno = { version = "0.14", features = ["gpu"], optional = true }

# SIMD/GPU memory compression (LZ4/ZSTD, native-only)
trueno-zram-core = { version = "0.3", optional = true }

# GPU-accelerated block device via ublk (native-only)
trueno-ublk = { version = "0.3", optional = true }

# System monitor with GPU support (native-only)
ttop = { version = "0.3", optional = true }

# Distributed compute (CPU/GPU/Remote executors, native-only)
repartir = { version = "2.0", features = ["cpu", "remote"], optional = true }

# Apple hardware integration (macOS-only: Afterburner, Neural Engine, Metal, Secure Enclave)
manzana = { version = "0.2", optional = true }

# Graph database for Oracle Mode knowledge graph (native-only)
trueno-graph = { version = "0.1.13", optional = true }

# Vector database for similarity search (native-only)
trueno-db = { version = "0.3.13", optional = true }

# Utilities (native-only)
indicatif = { version = "0.18", optional = true }
dirs = { version = "5.0", optional = true }

# Syntax highlighting for code output (native-only)
syntect = { version = "5.2", default-features = false, features = ["default-syntaxes", "default-themes", "regex-fancy"], optional = true }
once_cell = { version = "1.21", optional = true }

# TUI dashboard (native-only) - uses presentar-terminal instead of ratatui
presentar-terminal = { version = "0.3", optional = true }
crossterm = { version = "0.28", optional = true }

# Stack orchestration dependencies (native-only)
cargo_metadata = { version = "0.19", optional = true }
semver = { version = "1.0", features = ["serde"], optional = true }
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false, optional = true }
dialoguer = { version = "0.12", optional = true }

# Pacha model registry (native-only)
pacha = { version = "0.2", optional = true }

# Realizar inference engine (GGUF/safetensors, native-only)
realizar = { version = "0.6", optional = true }

# ML algorithms and training (native-only)
aprender = { version = "0.25", optional = true }
entrenar = { version = "0.5", optional = true }
alimentar = { version = "0.2", optional = true }

# RAG and visualization (native-only)
trueno-rag = { version = "0.2", path = "../trueno-rag", features = ["sqlite"], optional = true }
trueno-viz = { version = "0.1.20", optional = true }
presentar = { version = "0.3", optional = true }

# Speech recognition (native-only)
whisper-apr = { version = "0.2", optional = true }

# Tiny kernel (native-only)
pepita = { version = "0.1", optional = true }

# Simulation engine (native-only)
simular = { version = "0.3", optional = true }

# Game engine (native-only)
jugar = { version = "0.1", optional = true }

# Systems scripting language (native-only)
ruchy = { version = "4.1", optional = true }

# Transpilers (native-only)
decy = { version = "2.0", optional = true }
# depyler = { version = "3.20", optional = true }  # blocked: serde version conflict (1.0.200-1.0.219)
bashrs = { version = "6.59", optional = true }
rascal = { version = "0.1", optional = true }

# MCP SDK (native-only)
rust-mcp-sdk = { version = "0.8", optional = true }

# Utilities (native-only)
copia = { version = "0.1", optional = true }
nviwatch = { version = "0.2", optional = true }
ruchydbg = { version = "0.1", optional = true }

# Testing and quality (native-only)
probar = { version = "0.1", optional = true }
certeza = { version = "0.1", optional = true }
verificar = { version = "0.5", optional = true }

# NVIDIA Jetson edge integration (native-only)
# cohete = { version = "0.1", optional = true }  # blocked: not yet on crates.io

# Cross-platform daemon framework (native-only)
duende = { version = "0.2", optional = true }

# MCP server framework (native-only)
# pforge = { version = "0.1", optional = true }  # blocked: not yet on crates.io

# Performance shell (native-only)
pzsh = { version = "0.3", optional = true }

# WASM-specific dependencies
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
js-sys = { version = "0.3", optional = true }
web-sys = { version = "0.3", features = ["console"], optional = true }

[features]
default = ["native"]

# Native build with core features (lean: ~249 deps)
native = [
    "clap",
    "serde_yaml",
    "toml",
    "tokio",
    "tracing",
    "tracing-subscriber",
    "walkdir",
    "glob",
    "which",
    "indicatif",
    "dirs",
    "cargo_metadata",
    "semver",
    "reqwest",
    "dialoguer",
    "pacha",
]

# TUI dashboards (stack status, RAG oracle)
tui = ["presentar-terminal", "crossterm", "native"]

# Syntax highlighting for code output
highlighting = ["syntect", "once_cell", "native"]

# WASM build with limited features
wasm = [
    "wasm-bindgen",
    "wasm-bindgen-futures",
    "js-sys",
    "web-sys",
]

# Optional feature for Trueno integration (native only)
trueno-integration = ["trueno", "native"]

# Oracle Mode with full knowledge graph support
oracle-mode = ["trueno-graph", "trueno-db", "native"]

# Inference engine integration (GGUF/safetensors serving)
inference = ["realizar", "native"]

# Distributed compute integration (CPU/GPU/Remote)
distributed = ["repartir", "native"]

# Apple hardware integration (macOS: Afterburner, Neural Engine, Metal, Secure Enclave)
apple-hardware = ["manzana"]

# ML training and algorithms
ml = ["aprender", "entrenar", "alimentar", "native"]

# RAG pipeline integration
rag = ["trueno-rag", "oracle-mode"]

# Visualization (terminal and WASM)
viz = ["trueno-viz", "presentar", "native"]

# Speech recognition (Whisper ASR)
speech = ["whisper-apr", "native"]

# Tiny kernel integration
kernel = ["pepita", "native"]

# SIMD/GPU compression (LZ4/ZSTD with AVX2/AVX-512/NEON)
compression = ["trueno-zram-core", "native"]

# GPU-accelerated block device (ublk)
block-device = ["trueno-ublk", "compression"]

# System monitoring with GPU support
monitoring = ["ttop", "native"]

# Simulation engine
simulation = ["simular", "native"]

# Game engine
gaming = ["jugar", "native"]

# Systems scripting language
scripting = ["ruchy", "native"]

# Transpilers (C, Rust -> Shell, Haskell -> Rust)
# depyler blocked until serde versions aligned
transpilers = ["decy", "bashrs", "rascal", "native"]

# MCP SDK
mcp-sdk = ["rust-mcp-sdk", "native"]

# Additional utilities
utilities = ["copia", "nviwatch", "ruchydbg", "native"]

# Testing and quality
testing = ["probar", "certeza", "verificar", "native"]

# Edge hardware (NVIDIA Jetson) - cohete not yet on crates.io
# edge = ["cohete", "native"]

# Daemon framework
daemon = ["duende", "native"]

# MCP server framework - pforge not yet on crates.io
# mcp = ["pforge", "native"]

# Performance shell
shell = ["pzsh", "native"]

# Full sovereign stack (all components)
sovereign-stack = [
    "trueno-integration", "oracle-mode", "inference", "distributed",
    "ml", "rag", "viz", "speech", "compression", "monitoring",
    "simulation", "gaming", "scripting", "transpilers", "mcp-sdk",
    "utilities", "testing", "daemon", "shell",
    "tui", "highlighting",
    # "edge", "mcp" blocked until cohete/pforge published to crates.io
]

[dev-dependencies]
assert_cmd = "2.0"
predicates = "3.1"
tempfile = "3.23"
criterion = { version = "0.8", features = ["html_reports"] }
proptest = "1.5"
blake3 = "1.8"
trueno-cuda-edge = { version = "0.1", path = "../trueno/trueno-cuda-edge" }

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

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

[profile.release]
opt-level = 3
lto = true
codegen-units = 1
strip = true

[profile.bench]
opt-level = 3
lto = true
codegen-units = 1

# ============================================================================
# LINTS (Per pmat rust-project-score recommendations)
# ============================================================================

[lints.rust]
# Safety and correctness
unsafe_op_in_unsafe_fn = "warn"
# Documentation
missing_docs = "allow"  # docs not yet complete for all public items
# Code quality - allow for now (too many to fix at once)
unreachable_pub = "allow"

[lints.clippy]
# Correctness - MUST pass
correctness = { level = "deny", priority = -1 }
# Performance - should pass
perf = { level = "warn", priority = -1 }
# Style - should pass
style = { level = "warn", priority = -1 }
# Complexity - advisory
cognitive_complexity = "warn"
too_many_arguments = "warn"
# Pedantic - allow for now (track via pmat, fix incrementally)
needless_pass_by_value = "allow"
clone_on_ref_ptr = "allow"
# Safety
unwrap_used = "allow"  # Tracked separately via pmat
