[package]
name = "microresolve"
version = "0.2.2"
edition = "2021"
authors = ["Gladius Thayalarajan"]
description = "System 1 relay for LLM apps — sub-millisecond intent classification, safety gating, tool selection. CPU-only, continuous learning from corrections."
license = "MIT OR Apache-2.0"
repository = "https://github.com/gladius/microresolve"
homepage = "https://github.com/gladius/microresolve"
documentation = "https://docs.rs/microresolve"
readme = "README.md"
keywords = ["intent", "pre-llm", "llm", "safety", "agent-router"]
categories = ["text-processing", "algorithms"]

# Strip non-library artifacts from the crates.io tarball. Cargo's default
# is "everything tracked by git not in target/" plus any READMEs/CHANGELOGs
# under directories on disk, which sweeps in node_modules of the docs site.
exclude = [
    "ui/**",
    "docs-site/**",
    "node/**",
    "python/**",
    "scripts/**",
    "data/**",
    ".github/**",
    "_internal/**",
    "examples/curl/**",
    "examples/node/**",
    "examples/python/**",
    "examples/rust/**",
    "src/bin/test_hebbian.rs",
    ".env.example",
    ".gitignore",
]

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

[dependencies]
rustc-hash = "2"
aho-corasick = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
regex = "1"
thiserror = "2"
url = "2"
axum = { version = "0.8", features = ["multipart"], optional = true }
tokio = { version = "1", features = ["full"], optional = true }
tokio-stream = { version = "0.1", features = ["sync"], optional = true }
tower-http = { version = "0.6", features = ["cors", "fs"], optional = true }
reqwest = { version = "0.13", features = ["json", "blocking"], optional = true }
clap = { version = "4", features = ["derive"], optional = true }
toml = { version = "1", optional = true }
directories = { version = "6", optional = true }
open = { version = "5", optional = true }
rand = { version = "0.10", optional = true }
hex = { version = "0.4", optional = true }
sha2 = { version = "0.10", optional = true }
zip = { version = "8", optional = true }
tar = { version = "0.4", optional = true }
flate2 = { version = "1", default-features = false, features = ["rust_backend"], optional = true }
rust-embed = { version = "8", features = ["compression"], optional = true }
mime_guess = { version = "2", optional = true }

[features]
# Connected mode (live sync against a server) ships in the default build —
# it is a core capability of the library, not an optional extension. Users
# who want a smaller dep tree (no reqwest) can opt out:
#   microresolve = { version = "0.1", default-features = false }
default = ["connect"]
connect = ["reqwest"]
# Server binary build — pulls in axum/tokio/tower-http/clap/etc. Kept
# opt-in so embedded library users do not pay for the HTTP server stack.
# `server` implies `bundled-ui` so the studio binary always ships its UI
# in a single executable; build prerequisite: `cd ui && npm run build`.
server = ["axum", "tokio", "tokio-stream", "tower-http", "reqwest", "connect", "clap", "toml", "directories", "open", "rand", "hex", "sha2", "zip", "tar", "flate2", "bundled-ui"]
# Embed ui/dist/ into the binary at compile time. Pulled in transitively
# by `server`; named separately so future opt-outs are mechanical.
bundled-ui = ["rust-embed", "mime_guess"]

[[bin]]
name = "microresolve-studio"
path = "src/bin/server/main.rs"
required-features = ["server"]

[dev-dependencies]
reqwest = { version = "0.13", features = ["json", "blocking"] }
serde_json = "1"
criterion = { version = "0.8", features = ["html_reports"] }
tempfile = "3"

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