[workspace]
resolver = "2"
members = [
    # ============================================================
    # core/ — Init y compat (arje absorbido)
    # ============================================================
    "crates/core/brahman-card",
    "crates/core/brahman-card-wit",
    "crates/core/brahman-cards",
    "crates/core/brahman-handshake",
    "crates/core/brahman-broker",
    "crates/core/brahman-admin",
    "crates/shared/brahman-sidecar",
    "crates/shared/brahman-net",
    "crates/shared/ente-incarnate",
    "crates/core/ente-card",
    "crates/core/ente-bus",
    "crates/core/ente-cas",
    "crates/core/ente-kernel",
    "crates/core/ente-soma",
    "crates/core/ente-wasm",
    "crates/core/ente-snapshot",
    "crates/core/ente-brain",
    "crates/core/ente-zero",
    "crates/core/ente-echo",
    "crates/core/ente-policy-provider",
    "crates/core/ente-logind-compat",
    "crates/core/ente-hostnamed-compat",
    "crates/core/ente-timedated-compat",
    "crates/core/ente-localed-compat",
    "crates/core/ente-journald-compat",
    "crates/core/ente-resolved-compat",
    "crates/core/ente-polkit-compat",
    "crates/core/ente-machined-compat",
    "crates/core/ente-tmpfiles-compat",
    "crates/core/ente-systemd1-compat",
    "crates/core/ente-notify-compat",
    "crates/core/ente-binfmt-compat",
    "crates/core/ente-timer-compat",

    # ============================================================
    # modules/semantic_dht/ — DHT semántico (minga absorbido)
    # ============================================================
    "crates/modules/semantic_dht/minga-core",
    "crates/modules/semantic_dht/minga-store",
    "crates/modules/semantic_dht/minga-p2p",
    "crates/modules/semantic_dht/minga-vfs",
    "crates/modules/semantic_dht/minga-cli",

    # ============================================================
    # modules/ui_engine/ — Motor de widgets (yahweh libs+widgets)
    # ============================================================
    "crates/modules/ui_engine/libs/core",
    "crates/modules/ui_engine/libs/theme",
    "crates/modules/ui_engine/libs/launcher",
    "crates/modules/ui_engine/libs/bus",
    "crates/modules/ui_engine/libs/meta-schema",
    "crates/modules/ui_engine/libs/meta-runtime",
    "crates/modules/ui_engine/libs/providers/fs",
    "crates/modules/ui_engine/libs/providers/sqlite",
    "crates/modules/ui_engine/widgets/tree",
    "crates/modules/ui_engine/widgets/container_core",
    "crates/modules/ui_engine/widgets/splitter",
    "crates/modules/ui_engine/widgets/tabs",
    "crates/modules/ui_engine/widgets/tiled",
    "crates/modules/ui_engine/widgets/text_input",
    "crates/modules/ui_engine/widgets/meta-form",
    "crates/modules/ui_engine/widgets/banner",
    "crates/modules/ui_engine/widgets/card",
    "crates/modules/ui_engine/widgets/stat-card",
    "crates/modules/ui_engine/widgets/app-header",
    "crates/modules/ui_engine/widgets/theme-switcher",

    # --- lapaloma: módulo de gráficos data-viz (ver ARCHITECTURE.md fuente) ---
    "crates/modules/ui_engine/libs/lapaloma-core",
    "crates/modules/ui_engine/widgets/lapaloma-render",
    "crates/modules/ui_engine/widgets/lapaloma-cartesian",
    "crates/modules/ui_engine/widgets/lapaloma-stream",
    "crates/modules/ui_engine/widgets/lapaloma-mesh",
    "crates/modules/ui_engine/widgets/lapaloma-financial",
    "crates/modules/ui_engine/widgets/lapaloma-polar",
    "crates/modules/ui_engine/widgets/lapaloma-heatmap",
    "crates/modules/ui_engine/widgets/lapaloma-treemap",
    "crates/modules/ui_engine/widgets/lapaloma-flow",
    "crates/modules/ui_engine/widgets/lapaloma-phosphor",
    "crates/modules/ui_engine/widgets/lapaloma-export",
    "crates/modules/ui_engine/widgets/lapaloma",

    # ============================================================
    # modules/nakui/ — ERP matemático (nakui absorbido)
    # ============================================================
    "crates/modules/nakui/core",

    # ============================================================
    # modules/nouser/ — explorador de Mónadas (nuevo)
    # ============================================================
    "crates/modules/nouser/card",
    "crates/modules/nouser/core",
    "crates/modules/nouser/nous",
    "crates/modules/nouser/nous-mock",
    "crates/modules/nouser/nous-real",

    # ============================================================
    # modules/shipote/ — runtime de espacios aislados con flujo tipado
    # ============================================================
    "crates/modules/shipote/shipote-card",
    "crates/modules/shipote/shipote-protocol",
    "crates/modules/shipote/shipote-discern",
    "crates/modules/shipote/shipote-core",

    # ============================================================
    # modules/gioser/ — landing WASM (chacana + 4 elementos)
    # ============================================================
    "crates/modules/gioser/gioser-geom",
    "crates/modules/gioser/gioser-physics",
    "crates/modules/gioser/gioser-palette",
    "crates/modules/gioser/gioser-shaders",
    "crates/modules/gioser/gioser-canvas-web",

    # ============================================================
    # modules/pluma/ — markdown agnóstico + visor web elegante
    # ============================================================
    "crates/modules/pluma/pluma-md",
    "crates/modules/pluma/pluma-reader-web",

    # ============================================================
    # modules/vista/ — deck horizontal swipe estilo Flutter PageView
    # ============================================================
    "crates/modules/vista/vista-web",

    # ============================================================
    # modules/barra/ — taskbar agnóstica estilo Windows
    # ============================================================
    "crates/modules/barra/barra-web",

    # ============================================================
    # modules/tahuantinsuyu/ — estudio de astrología profesional
    # ============================================================
    "crates/modules/tahuantinsuyu/tahuantinsuyu-card",
    "crates/modules/tahuantinsuyu/tahuantinsuyu-model",
    "crates/modules/tahuantinsuyu/tahuantinsuyu-store",
    "crates/modules/tahuantinsuyu/tahuantinsuyu-engine",
    "crates/modules/tahuantinsuyu/tahuantinsuyu-modules",
    "crates/modules/tahuantinsuyu/tahuantinsuyu-theme",
    "crates/modules/tahuantinsuyu/tahuantinsuyu-canvas",
    "crates/modules/tahuantinsuyu/tahuantinsuyu-tree",
    "crates/modules/tahuantinsuyu/tahuantinsuyu-panel",

    # ============================================================
    # apps/ — apps que consumen el protocolo (yahweh modules+shell)
    # ============================================================
    "crates/apps/file_explorer",
    "crates/apps/database_explorer",
    "crates/apps/text_viewer",
    "crates/apps/image_viewer",
    "crates/apps/yahweh-shell",
    "crates/apps/nouser-explorer",
    "crates/apps/nakui-explorer",
    "crates/apps/nakui-ui",
    "crates/apps/minga-explorer",
    "crates/apps/brahman-broker-explorer",
    "crates/apps/brahman-demo",
    "crates/apps/shipote-daemon",
    "crates/apps/shipote-cli",
    "crates/apps/shipote-gateway",
    "crates/apps/shipote-shell",
    "crates/apps/gioser-web",
    "crates/apps/lapaloma-demo",
    "crates/apps/lapaloma-stream-demo",
    "crates/apps/lapaloma-phosphor-demo",
    "crates/apps/lapaloma-financial-demo",
    "crates/apps/tahuantinsuyu",
    "crates/apps/tahuantinsuyu-cli",
]

[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.80"
license = "MIT OR Apache-2.0"
authors = ["Brahman Contributors"]
publish = false
repository = "https://example.invalid/brahman"

[workspace.dependencies]
# === Serialización ===
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde-big-array = "0.5"
postcard = { version = "1", features = ["use-std"] }
toml = "0.8"
bincode = "1"
base64 = "0.22"

# === Errores ===
thiserror = "2"           # bump uniforme; arje (era 1) puede requerir ajustes menores
anyhow = "1"

# === Async ===
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["compat"] }
async-trait = "0.1"
futures = "0.3"

# === Observabilidad ===
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }

# === Linux primitives (arje) ===
nix = { version = "0.29", features = ["signal", "process", "sched", "mount", "fs", "socket", "net", "user"] }
libc = "0.2"

# === IDs / Hash / Crypto ===
ulid = { version = "1", features = ["serde"] }
uuid = { version = "1", features = ["v4"] }
sha2 = "0.10"
blake3 = "1.5"
ed25519-dalek = "2"
aes-gcm = "0.10"
argon2 = "0.5"
rand = "0.8"

# === WASM (arje) ===
wasmi = "0.40"
wat = "1"

# === Storage / DB ===
sled = "0.34"
rusqlite = { version = "0.31", features = ["bundled", "blob"] }

# === P2P (minga) ===
libp2p = { version = "0.56", features = ["tokio", "tcp", "noise", "yamux", "macros", "kad", "identify"] }
libp2p-stream = "=0.4.0-alpha"
libp2p-allow-block-list = "0.6"

# === Code parsing (minga) ===
tree-sitter = "0.24"
tree-sitter-rust = "0.23"
tree-sitter-python = "0.23"
tree-sitter-typescript = "0.23"
tree-sitter-javascript = "0.23"
tree-sitter-go = "0.23"

# === FS notify ===
notify = "6.1"

# === CLI / auth (minga) ===
clap = { version = "4", features = ["derive"] }
rpassword = "7"

# === D-Bus (arje compat) ===
zbus = { version = "4", default-features = false, features = ["tokio"] }

# === Tests ===
tempfile = "3"

# === GPUI (yahweh) ===
gpui = "0.2"

# === Filesystem helpers ===
directories = "5"

# === WASM web (gioser) ===
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
web-sys = "0.3"
glam = "0.30"

# === Markdown (pluma) ===
pulldown-cmark = { version = "0.12", default-features = false, features = ["html"] }

# ============================================================
# Intra-workspace deps de yahweh (referenciadas por workspace = true)
# ============================================================
yahweh-core = { path = "crates/modules/ui_engine/libs/core" }
yahweh-theme = { path = "crates/modules/ui_engine/libs/theme" }
yahweh-bus = { path = "crates/modules/ui_engine/libs/bus" }
yahweh-provider-fs = { path = "crates/modules/ui_engine/libs/providers/fs" }
yahweh-provider-sqlite = { path = "crates/modules/ui_engine/libs/providers/sqlite" }
yahweh-widget-tree = { path = "crates/modules/ui_engine/widgets/tree" }
yahweh-widget-container-core = { path = "crates/modules/ui_engine/widgets/container_core" }
yahweh-widget-splitter = { path = "crates/modules/ui_engine/widgets/splitter" }
yahweh-widget-tabs = { path = "crates/modules/ui_engine/widgets/tabs" }
yahweh-widget-tiled = { path = "crates/modules/ui_engine/widgets/tiled" }
yahweh-widget-text-input = { path = "crates/modules/ui_engine/widgets/text_input" }
yahweh-file-explorer = { path = "crates/apps/file_explorer" }
yahweh-database-explorer = { path = "crates/apps/database_explorer" }
yahweh-text-viewer = { path = "crates/apps/text_viewer" }
yahweh-image-viewer = { path = "crates/apps/image_viewer" }

# ============================================================
# Intra-workspace deps de lapaloma (módulo de gráficos)
# ============================================================
lapaloma-core = { path = "crates/modules/ui_engine/libs/lapaloma-core" }
lapaloma-render = { path = "crates/modules/ui_engine/widgets/lapaloma-render" }
lapaloma-cartesian = { path = "crates/modules/ui_engine/widgets/lapaloma-cartesian" }
lapaloma-stream = { path = "crates/modules/ui_engine/widgets/lapaloma-stream" }
lapaloma-mesh = { path = "crates/modules/ui_engine/widgets/lapaloma-mesh" }
lapaloma-financial = { path = "crates/modules/ui_engine/widgets/lapaloma-financial" }
lapaloma-polar = { path = "crates/modules/ui_engine/widgets/lapaloma-polar" }
lapaloma-heatmap = { path = "crates/modules/ui_engine/widgets/lapaloma-heatmap" }
lapaloma-treemap = { path = "crates/modules/ui_engine/widgets/lapaloma-treemap" }
lapaloma-flow = { path = "crates/modules/ui_engine/widgets/lapaloma-flow" }
lapaloma-phosphor = { path = "crates/modules/ui_engine/widgets/lapaloma-phosphor" }
lapaloma-export = { path = "crates/modules/ui_engine/widgets/lapaloma-export" }
lapaloma = { path = "crates/modules/ui_engine/widgets/lapaloma" }

[profile.release]
lto = "thin"
codegen-units = 1
strip = "symbols"
panic = "abort"

[profile.dev]
opt-level = 0
# `line-tables-only` mantiene stack traces con archivo:línea correctos
# pero descarta el resto de symbols. Reduce target/ ~40% sin sacrificar
# debugging real para nuestro flujo (no usamos gdb sobre estos crates).
debug = "line-tables-only"
split-debuginfo = "unpacked"
incremental = true
# Más codegen-units = más paralelismo + builds incrementales más chicas
# (cada cambio re-compila menos). Default es 256 en dev pero lo
# anclamos para evitar regresiones.
codegen-units = 256

# Override puntual para deps grandes que NO debuggeamos: gpui, ort,
# fastembed, tokenizers, image. Subir opt-level acá hace que sus libs
# pesen menos en target/ (símbolos descartados durante la build).
[profile.dev.package."*"]
opt-level = 0
debug = "line-tables-only"

[profile.dev.package.gpui]
opt-level = 1
debug = false

[profile.dev.package.ort]
opt-level = 1
debug = false

[profile.dev.package.fastembed]
opt-level = 1
debug = false

[profile.dev.package.tokenizers]
opt-level = 1
debug = false

[profile.dev.package.image]
opt-level = 1
debug = false
