[package]
name = "memex-rs"
version = "0.0.4-platform.3"
edition = "2021"
description = "Memex - Claude Code session history manager (Rust backend)"
[lib]
name = "memex"
crate-type = ["cdylib", "rlib"]
[[bin]]
name = "memex"
path = "src/main.rs"
required-features = ["cli"]
[features]
default = ["cli"]
cli = ["notify", "notify-debouncer-mini", "axum", "tower-http", "tokio-cron-scheduler", "rust-embed", "mime_guess"]
[dependencies]
# HTTP 框架 (CLI only)
axum = { version = "0.8", optional = true }
tower-http = { version = "0.6", features = ["cors", "fs"], optional = true }
# 异步运行时
tokio = { version = "1", features = ["full", "sync"] }
# HTTP 客户端 (Ollama)
reqwest = { version = "0.12", features = ["json"] }
# 数据库
rusqlite = { version = "0.32", features = ["bundled", "vtab"] }
# 向量数据库
lancedb = "0.15"
arrow-array = "53"
arrow-schema = "53"
# 序列化
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# 文件监听 (CLI only)
# 禁用 crossbeam feature 避免与 tokio 冲突导致 100% CPU
notify = { version = "8", optional = true, default-features = false, features = ["macos_fsevent"] }
notify-debouncer-mini = { version = "0.6", optional = true, default-features = false }
# 定时任务 (CLI only)
tokio-cron-scheduler = { version = "0.13", optional = true }
# 嵌入式 Web 资源 (CLI only)
rust-embed = { version = "8", optional = true, features = ["include-exclude"] }
mime_guess = { version = "2", optional = true }
# 共享数据库(ETerm/Vlaude 数据统一层)
# 同时 re-export ai-cli-session-collector 类型,避免重复依赖
# 使用 git 依赖,支持独立编译;在 ETerm 主仓库中通过 [patch] 覆盖成本地路径
# [V2] memex-rs 只需要 reader + search,不再需要 client(事件订阅已移除)
ai-cli-session-db = { git = "https://github.com/vimo-ai/ai-cli-session-db", features = ["reader", "search"] }
# 工具
anyhow = "1"
thiserror = "2"
tracing = "0.1"
sha2 = "0.10"
tracing-subscriber = { version = "0.3", features = ["env-filter", "time"] }
time = { version = "0.3", features = ["formatting", "macros"] }
dirs = "5"
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["v4"] }
walkdir = "2"
percent-encoding = "2"
futures = "0.3"
async-trait = "0.1"
regex = "1"
libc = "0.2"
[dev-dependencies]
tempfile = "3"
filetime = "0.2"
[profile.release]
lto = "thin" # thin LTO 比 full LTO 内存占用低很多
codegen-units = 4 # 增加并行度,降低单次内存峰值
strip = true
opt-level = "s" # 优化体积但不那么激进