Adds sse.rs (a pure port of Sse.kt's frame parser), api.rs (a Transport trait plus a ureq-backed implementation and an ApiClient covering the session lifecycle: list/read, message/unqueue/answer, interrupt/stop/start, title/cwd/model/permission-mode/notify, command/compact, delete, and a transcript page), and event_stream.rs (follow_session_events, mirroring EventStream.kt's reset/event split). ureq rather than reqwest: server/ already depends on it for its own outbound HTTPS, this stays blocking like Api.kt's HttpURLConnection calls with no async runtime to carry, and its own PEM cert support means no extra rustls/rustls-pemfile dependency to pin. Network I/O sits behind Transport so ApiClient and follow_session_events are tested with fakes, no server involved. Not yet covered, tracked in CLIENT_CORE.md: setups, the file explorer, usage, models, and attachments/import. cargo test (78 passed), clippy --all-targets and fmt clean. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
33 lines
1.4 KiB
TOML
33 lines
1.4 KiB
TOML
[package]
|
|
name = "client-core"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
# The app's pure logic, held once instead of twice: the event model (shared
|
|
# with `server/` via `event-model`), the REST + SSE clients for its HTTP
|
|
# surface (see `server/src/routes.rs`'s module doc for the table), the
|
|
# transcript fold and cache, the markdown block model, the syntax
|
|
# highlighter and the ANSI parser. See CLIENT_CORE.md at the repo root for
|
|
# what this holds today, what it does not yet, and how it corresponds to
|
|
# the Kotlin it replaces.
|
|
#
|
|
# No UI framework dependency of any kind -- this crate is meant to outlive
|
|
# whichever one the app ends up drawing with (see RUST.md).
|
|
|
|
[dependencies]
|
|
event-model = { path = "../event-model" }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = { version = "1", features = ["float_roundtrip"] }
|
|
# The blocking HTTP client for the REST calls and the long-lived SSE GETs.
|
|
# `server/` already depends on ureq for its own outbound HTTPS (the usage
|
|
# poll in usage.rs) and it is rustls-backed like the rest of this project's
|
|
# TLS, so this reuses that choice rather than pulling in reqwest's async
|
|
# stack -- a client that runs one blocking request at a time, the way
|
|
# Api.kt's `HttpURLConnection` calls and Sse.kt's blocking read loop do, has
|
|
# no need of an async runtime, and RUST.md's brief for this port is
|
|
# "lightweight" throughout.
|
|
ureq = { version = "3", features = ["json"] }
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|