[workspace]
members = [".", "crates/sapphire-agent-api", "crates/sapphire-call"]

[workspace.dependencies]
anyhow = "1.0"
clap = { version = "4.5", features = ["derive"] }
futures-util = "0.3"
reqwest = { version = "0.12", default-features = false, features = [
    "json",
    "rustls-tls",
    "stream",
] }
serde_json = "1.0"
tokio = { version = "1.50", default-features = false, features = [
    "rt-multi-thread",
    "macros",
] }
tracing-subscriber = { version = "0.3", default-features = false, features = [
    "fmt",
    "ansi",
    "env-filter",
] }

[workspace.package]
version = "0.3.3"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/fluo10/sapphire-agent"

[package]
name = "sapphire-agent"
version.workspace = true
edition.workspace = true
description = "A personal AI assistant agent with Matrix/Discord channels, Anthropic backend, and a sapphire-workspace memory layer"
license.workspace = true
repository.workspace = true
homepage = "https://github.com/fluo10/sapphire-agent"
keywords = ["ai", "agent", "anthropic", "matrix", "discord"]
categories = ["command-line-utilities"]
readme = "README.md"
exclude = ["/.github", "/.gitignore", "/.claude", "/.vscode", "/rust-toolchain.toml", "/config.example.toml"]

[[bin]]
name = "sapphire-agent"
path = "src/main.rs"

[features]
default = ["lancedb-store", "fastembed-embed", "git-sync"]
lancedb-store = ["sapphire-workspace/lancedb-store"]
fastembed-embed = ["sapphire-workspace/fastembed-embed"]
git-sync = ["sapphire-workspace/git-sync"]

[dependencies]
# Async runtime
tokio = { workspace = true, features = [
    "time",
    "sync",
    "fs",
    "signal",
    "net",
] }

# HTTP client (Anthropic API + tool HTTP calls)
reqwest = { workspace = true, features = ["blocking"] }

# Matrix client + E2EE
matrix-sdk = { version = "0.16", default-features = false, features = [
    "e2e-encryption",
    "rustls-tls",
    "sqlite",
    "bundled-sqlite",
    "markdown",
] }

# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json.workspace = true

# Config (TOML)
toml = "1.0"

# YAML (heartbeat task frontmatter)
serde_yaml = "0.9"

# Cron expression parsing (heartbeat schedules)
cron = "0.16"

# Error handling
anyhow.workspace = true

# Async traits
async-trait = "0.1"

# Futures utilities (SSE streaming)
futures-util.workspace = true

# Logging
tracing = "0.1"
tracing-subscriber.workspace = true

# CLI
clap.workspace = true

# XDG directories for config/data paths
directories = "6.0"

# Shell path expansion (~/)
shellexpand = "3.1"

# Date/time with serde support (human-readable ISO 8601 timestamps)
chrono = { version = "0.4", features = ["serde"] }

# Time-ordered unique IDs for session files
uuid = { version = "1", features = ["v7"] }

# Workspace: file indexing, FTS, vector search, git sync
# lancedb-store is gated behind the "lancedb-store" feature (default on)
sapphire-workspace = { version = "0.8.1", default-features = false }

# Human-readable session IDs for API sessions
grain-id = { version = "0.14", features = ["serde"] }

# Client library (shared with sapphire-call)
sapphire-agent-api = { path = "crates/sapphire-agent-api", version = "0.3.3" }

# HTTP server (serve command)
axum = { version = "0.8", default-features = false, features = ["http1", "json", "tokio"] }

# Stream utilities (axum SSE)
tokio-stream = { version = "0.1", features = ["sync"] }

# CORS middleware
tower-http = { version = "0.6", default-features = false, features = ["cors"] }

# Discord bot (gateway + HTTP, rustls TLS)
# Requires MESSAGE_CONTENT privileged intent enabled in Discord Developer Portal
serenity = { version = "0.12", default-features = false, features = [
    "client",
    "gateway",
    "model",
    "rustls_backend",
] }
