[workspace]
members = [
    "src/crates/core-types",
    "src/crates/events",
    "src/crates/ai-adapters",
    "src/crates/agent-stream",
    "src/crates/runtime-ports",
    "src/crates/services-core",
    "src/crates/services-integrations",
    "src/crates/product-domains",
    "src/crates/agent-tools",
    "src/crates/tool-packs",
    "src/crates/acp",
    "src/crates/core",
    "src/crates/terminal",
    "src/crates/tool-runtime",
    "src/crates/transport",
    "src/crates/api-layer",
    "src/crates/webdriver",
    "src/apps/cli",
    "src/apps/desktop",
    "src/apps/server",
    "src/apps/relay-server",
]

exclude = [
    "BitFun-Installer/src-tauri",
]

resolver = "2"

# Shared package metadata — single source of truth for version
[workspace.package]
version = "0.2.7" # x-release-please-version
authors = ["BitFun Team"]
edition = "2021"

# Shared dependency versions to keep all crates aligned
[workspace.dependencies]
# Async runtime
tokio = { version = "1.0", features = ["full"] }
tokio-stream = "0.1"
tokio-util = "0.7"
async-trait = "0.1"
futures = "0.3"
futures-util = "0.3"

# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"

# Error handling
anyhow = "1.0"
thiserror = "1.0"

# Logging
log = "0.4"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# Utilities
uuid = { version = "1.0", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde", "clock"] }
chrono-tz = "0.10.4"
cron = "0.15.0"
regex = "1"
base64 = "0.22"
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "webp", "bmp"] }
md5 = "0.7"
dashmap = "5"
indexmap = "2"
include_dir = "0.7"

# HTTP client
reqwest = { version = "0.12", default-features = false, features = ["native-tls", "rustls-tls-native-roots", "json", "stream", "multipart"] }

# Debug Log HTTP Server
axum = { version = "0.7", features = ["json", "ws"] }
tower-http = { version = "0.6", features = ["cors", "fs"] }

# File system
glob = "0.3"
ignore = "0.4"
notify = "6.1"
dirs = "5.0"
dark-light = "1.1"
dunce = "1"
filetime = "0.2"
fs2 = "0.4"
zip = "0.6" # plugin load
flate2 = "1.0"
toml = "0.8"

# Git
git2 = { version = "0.18", default-features = false, features = ["https", "vendored-libgit2"] }

# Terminal
portable-pty = "0.9.0"
vte = "0.15.0"

# Grep (search)
grep-searcher = "0.1"
grep-regex = "0.1"
globset = "0.4"

# SSE
eventsource-stream = "0.2.3"

# Command detection (cross-platform)
which = "8.0"
similar = "2.5"
urlencoding = "2.1"

# Tauri (desktop only)
tauri = { git = "https://github.com/richerfu/tauri", branch = "feat/open-harmony", features = [] }
tauri-plugin-dialog = "2"
tauri-plugin-opener = "2"
tauri-plugin-fs = "2"
tauri-plugin-log = "2"
tauri-plugin-autostart = "2"
tauri-plugin-notification = "2"
tauri-plugin-updater = "2"
tauri-build = { git = "https://github.com/richerfu/tauri", branch = "feat/open-harmony", features = [] }
napi-ohos = { version = "1.1" }
napi-derive-ohos = { version = "1.1" }

# Windows-specific dependencies
win32job = "2.0"

# I18n internationalization
fluent-bundle = "0.15"
unic-langid = "0.9"

# Encryption (Remote Connect E2E)
x25519-dalek = { version = "2.0", features = ["static_secrets"] }
aes-gcm = "0.10"
sha2 = "0.10"
sha1 = "0.10"
rand = "0.8"

# Device/Network info (Remote Connect)
mac_address = "1.1"
local-ip-address = "0.6"
hostname = "0.4"

# QR code generation
qrcode = "0.14"

# WebSocket client
tokio-tungstenite = { version = "0.24", features = ["rustls-tls-native-roots"] }

[profile.dev]
incremental = true

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

[profile.release-fast]
inherits = "release"
lto = false
codegen-units = 16
strip = false
incremental = true

[patch.crates-io]
wry = { git = "https://github.com/richerfu/wry"}
tao = { git = "https://github.com/richerfu/tao", branch = "feat-ohos-webview"}
openharmony-ability = {git = "https://github.com/harmony-contrib/openharmony-ability.git"}
openharmony-ability-derive = {git = "https://github.com/harmony-contrib/openharmony-ability.git"}
tauri = { git = "https://github.com/richerfu/tauri", branch = "feat/open-harmony"}
tauri-runtime = { git = "https://github.com/richerfu/tauri", branch = "feat/open-harmony"}
tauri-macros = { git = "https://github.com/richerfu/tauri", branch = "feat/open-harmony"}
tauri-runtime-wry = { git = "https://github.com/richerfu/tauri", branch = "feat/open-harmony"}