ijima-server 0.2.3

HTTP daemon and store backends for the Ijima centralized agentic memory backend
[package]
name = "ijima-server"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
readme = "README.md"
description = "HTTP daemon and store backends for the Ijima centralized agentic memory backend"

[features]
default = ["std", "http", "server-auth", "backend-surreal"]
std = []
# HTTP/JSON transport (axum). Disable to embed the store without a server.
http = ["dep:axum", "dep:tokio", "dep:tracing", "dep:tracing-subscriber", "ijima-core/serde"]
# SurrealDB store backend — the primary backend (D6). Embedded (`kv-mem`)
# or server mode. Requires ijima-core's serde.
backend-surreal = ["dep:surrealdb", "ijima-core/serde", "dep:tokio", "dep:sha2"]
# SQLite store backend — MIGRATION ONLY. Reads the live pi-mempalace
# corpus once during import; not used at runtime in production.
backend-sqlite = ["dep:rusqlite", "ijima-core/serde"]
# Authentication + authorization via Schubert proof-carrying capability
# tokens on Gr(4,8). Loads policy/policy.toml. When off, the store runs
# in unauthenticated single-process mode (tests, embedded use).
server-auth = ["dep:schubert", "dep:base64", "dep:ed25519-dalek", "dep:sha2"]
# Schubert geometric rate limiting (Phase 3.4). Per-principal token
# buckets whose capacity scales with the capability's Schubert
# intersection number (codimension). Composes with `server-auth`.
rate-limit = ["server-auth", "http"]
# The `ijima` CLI binary (clap). The `ijima token issue` subcommand.
cli = ["dep:clap", "dep:reqwest", "dep:ijima-client"]
# Candle (Hugging Face Rust ML) embedding backend — the IA-standard
# default, consistent with Quantizon. Builds candle on CPU; GPU/CUDA
# acceleration is a future opt-in (requires a CUDA toolchain).
# When this is off, the store cannot embed new memories at write time.
embeddings-candle = ["dep:candle-core", "dep:candle-nn", "dep:candle-transformers", "dep:tokenizers", "dep:hf-hub", "ijima-core/serde"]
# Mining trigger orchestration: fetch session turns, run the extraction
# engine, and ingest (Auto → palace, PendingReview → review queue).
mining = ["dep:ijima-miner", "dep:proserpina-agent", "backend-surreal", "ijima-miner/llm", "proserpina-agent/backend-http"]
# Optional TLS for the HTTP daemon. Env-driven (`IJIMA_TLS_CERT` +
# `IJIMA_TLS_KEY` PEM paths). Plain HTTP remains the default.
tls = ["dep:axum-server", "http"]
# Federation control-API scaffold (ADR federation-control-api). The 3
# /federation/* routes + instance config; boundary enforcement deferred.
federation = ["ijima-core/federation", "http"]

[dependencies]
ijima-core = { workspace = true }
ijima-client = { workspace = true, optional = true }
ijima-miner = { workspace = true, optional = true }
# Direct (optional) so the mining trigger can construct a Proserpina HTTP
# agent. `mining` enables `backend-http` to compile the http module.
proserpina-agent = { workspace = true, optional = true }
thiserror = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
toml = "1.1"
async-trait = "0.1"
axum = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
tracing = { workspace = true, optional = true }
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "env-filter", "smallvec"], optional = true }
candle-core = { version = "0.11", default-features = false, optional = true }
candle-nn = { version = "0.11", default-features = false, optional = true }
candle-transformers = { version = "0.11", default-features = false, optional = true }
tokenizers = { version = "0.21", optional = true }
hf-hub = { version = "1.0", features = ["blocking"], optional = true }
schubert = { version = "0.5", features = ["std", "crypto", "policy"], optional = true }
base64 = { version = "0.23", optional = true }
surrealdb = { version = "3", default-features = false, features = ["kv-mem", "kv-surrealkv"], optional = true }
rusqlite = { workspace = true, optional = true }
sha2 = { version = "0.11", optional = true }
ed25519-dalek = { version = "2", default-features = false, features = ["rand_core"], optional = true }
axum-server = { version = "0.8", features = ["tls-rustls"], optional = true }
clap = { version = "4", features = ["derive"], optional = true }
regex = "1"
reqwest = { workspace = true, optional = true }

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt", "net", "time"] }
tower = { version = "0.5", features = ["util"] }
ijima-client = { workspace = true }

[[bin]]
name = "ijima"
path = "src/main.rs"
required-features = ["http", "server-auth", "backend-surreal", "cli"]