- store: a swappable Store trait + bundled-SQLite implementation (WAL,
sessions/messages with per-turn token usage, cascade delete). The standard
/v1 API stays stateless; conversation context lives server-side so
multi-session, statistics and advanced settings can grow on top. DB path
configurable (db_path, default ~/.config/strata-ctl/sessions.db).
- api::sessions: session-aware GUI API — session CRUD, history, POST .../chat
(loads stored context, reuses the completion service, persists new turns with
usage; streaming accumulates the assistant turn and persists before [DONE]),
and /api/stats.
- api::web + web/: a mobile-first chat GUI (vanilla ES modules, no build step),
embedded via rust-embed and served at GET / (same-origin, offline, single
binary). Off-canvas session drawer on phones, persistent sidebar on wide
screens; live streaming with a collapsible thinking panel; model output is
inserted via textContent only.
- router_with_store mounts the GUI + session API only when a store is configured;
router()/router_with_auth() are unchanged (API-only).
- Fix: a global [hidden]{display:none!important} reset so an author display rule
(the stats modal's display:flex) cannot defeat the hidden attribute.
7 new tests (2 store unit + 4 session HTTP end-to-end + 1 config); 94 green +
2 ignored; clippy/fmt clean. Validated live on engine 0.1.67 (context retention,
streaming, stats) and via a browser check (modal, send/render, stats open/close).
Future: the Store backend is intended to move to ArangoDB (multi-model).
34 lines
1.1 KiB
TOML
34 lines
1.1 KiB
TOML
[package]
|
|
name = "strata-ctl"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Rust control layer for the Strata inference engine: OpenAI-compatible HTTP API over the engine's line protocol"
|
|
license = "MIT"
|
|
|
|
[dependencies]
|
|
anyhow = "1"
|
|
thiserror = "2"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
tokio = { version = "1", features = ["rt-multi-thread", "process", "io-util", "sync", "time", "macros", "signal", "net"] }
|
|
tracing = "0.1"
|
|
axum = "0.8"
|
|
futures = "0.3.34"
|
|
tokio-stream = "0.1.19"
|
|
tokenizers = "0.23.2"
|
|
minijinja = { version = "3.1.0", features = ["serde"] }
|
|
image = "0.25.10"
|
|
base64 = "0.23.1"
|
|
ureq = "3.5.2"
|
|
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
|
|
# Embedded SQLite for the GUI's session/context store (bundled = compiled into the
|
|
# binary, no external service). Behind a `Store` trait so it can be swapped later.
|
|
rusqlite = { version = "0.32", features = ["bundled"] }
|
|
# Embeds the web/ GUI assets into the binary (single-binary, offline-capable).
|
|
rust-embed = "8"
|
|
|
|
[dev-dependencies]
|
|
http-body-util = "0.1.5"
|
|
tokio = { version = "1", features = ["full"] }
|
|
tower = { version = "0.5", features = ["util"] }
|