[workspace]
members = [
    ".",
    "./crates/macros",
    "./crates/faiss-sys",
]

[package]
name = "ailoy"
version = "0.2.2"
edition = "2024"

[lib]
crate-type = ["rlib", "dylib"]
path = "src/lib.rs"

[[bin]]
name = "py_stub_gen"
path = "src/bin/py_stub_gen.rs"
doc = false
required-features = ["python"]

[[bin]]
name = "ailoy-model"
path = "src/bin/ailoy_model.rs"
required-features = ["ailoy-model-cli"]

[features]
python = [
    "dep:pyo3",
    "dep:pyo3-async-runtimes",
    "dep:pyo3-stub-gen",
    "dep:pyo3-stub-gen-derive",
]
nodejs = ["dep:napi", "dep:napi-derive"]
wasm = []
ailoy-model-cli = ["dep:aws-config", "dep:aws-sdk-s3", "dep:clap", "dep:indicatif"]
default = []

[dependencies]
ailoy-macros = { path = "./crates/macros" }
anyhow = "1"
async-stream = "0.3"
async-trait = "0.1"
aws-config = { version = "1.8", optional = true, default-features = false, features = ["rt-tokio"] }
aws-sdk-s3 = { version = "1.115", optional = true, default-features = false, features = ["default-https-client", "rt-tokio", "http-1x"] }
base64 = "0.22"
chromadb = { git = "https://github.com/brekkylab/chromadb-rs.git", branch = "master" }
clap = { version = "4.5.48", optional = true, features = ["derive"] }
dedent = "0.1.1"
derive_builder = "0.20.2"
futures = "0.3.31"
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "webp"] }
indexmap = { version = "2", features = ["serde"] }
indicatif = { version = "0.18.0", optional = true }
jsonschema = { version = "0.37", default-features = false }
minijinja = { version = "2.11.0", features = ["loader", "custom_syntax", "json", "preserve_order"] }
minijinja-contrib = { version = "2.11.0", features = ["pycompat"] }
napi = { version = "3.4.0", features = ["tokio_rt", "napi8", "serde-json"], optional = true }
napi-derive = { version = "3.3.0", optional = true }
ordered-float = { version = "5.0.0", features = ["serde"] }
pyo3 = { version = "0.27.0", features = ["abi3-py310", "experimental-async", "macros", "anyhow"], optional = true }
pyo3-async-runtimes = { version = "0.27.0", features = ["attributes", "tokio-runtime"], optional = true }
pyo3-stub-gen = { version = "0.17.2", optional = true }
pyo3-stub-gen-derive = { version = "0.17.2", optional = true }
reqwest = { version = "0.12", features = ["json", "stream"] }
rmcp = { version = "0.5.0", features = ["default"] }
scraper = "0.24"
serde = { version = "1.0", features = ["derive"] }
serde_bytes = "0.11"
serde_json = { version = "1.0", features = ["preserve_order"] }
sha1 = "0.10"
strum = { version = "0.27", features = ["derive"] }
strum_macros = "0.27"
thiserror = "2.0.15"
unicode-segmentation = "1.12.0"
url = "2.5.4"
urlencoding = "2.1"
version-compare = "0.2.1"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ailoy-faiss-sys = { path = "./crates/faiss-sys" }
cxx = "1.0.189"
log = "0.4.27"
onig = { version = "6", default-features = false }
parking_lot = "0.12.4"
rmcp = { version = "0.5.0", features = ["client", "reqwest", "transport-child-process", "transport-streamable-http-client"] }
tokenizers = { version = "0.21.4", default-features = false, features = ["onig"] }
tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread", "sync"] }
uuid = { version = "1.18.0", features = ["v4"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.3", features = ["wasm_js"] }
gloo-timers = { version = "0.3", features = ["futures"] }
js-sys = "0.3"
regex = "1.12"
sse-stream = "0.2"
tokenizers = { version = "0.21.4", default-features = false, features = ["fancy-regex"] }
tokio = { version = "1.0", default-features = false, features = ["macros", "rt", "sync"] }
tsify = { version = "0.5.5", default-features = false, features = ["js"] }
uuid = { version = "1.18.0", features = ["v4", "js"] }
wasm-bindgen = "=0.2.105"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
    "FileSystemCreateWritableOptions",
    "FileSystemDirectoryHandle",
    "FileSystemFileHandle",
    "FileSystemGetDirectoryOptions",
    "FileSystemGetFileOptions",
    "FileSystemRemoveOptions",
    "FileSystemWritableFileStream",
    "Navigator",
    "Storage",
    "StorageManager",
    "console"
] }
web-time = "1.1"

[build-dependencies]
dotenvy = "0.15.7"
napi-build = "2"

[target.'cfg(not(target_arch = "wasm32"))'.build-dependencies]
cmake = "0.1"
scratch = "1.0"

[dev-dependencies]
yare = "3.0.0"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
env_logger = "0.11"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3"
