feat: Add doctate-client-core crate

Introduces a new crate `doctate-client-core` to house shared client-side
logic. This includes:

- `case_store`: Manages local case marker files and merging with server
  snapshots.
- `snapshot_cache`: Placeholder for caching server responses.
- `oneliner_poller`: Placeholder for the background polling task.

The workspace configuration and `Cargo.lock` have been updated to
include the new crate.
This commit is contained in:
2026-04-18 10:03:40 +02:00
parent 94392e72d8
commit ac7157cdca
10 changed files with 647 additions and 17 deletions
+2
View File
@@ -1,5 +1,6 @@
pub mod ack;
pub mod constants;
pub mod oneliners;
pub mod timestamp;
pub use ack::{AckResponse, AckStatus};
@@ -7,4 +8,5 @@ pub use constants::{
API_KEY_HEADER, CONTENT_TYPE_AUDIO_MP4, FIELD_AUDIO, FIELD_CASE_ID, FIELD_RECORDED_AT,
UPLOAD_PATH,
};
pub use oneliners::{OnelinerEntry, OnelinersResponse, ONELINERS_PATH};
pub use timestamp::{filename_stem_to_recorded_at, now_rfc3339, recorded_at_to_filename_stem};
+32
View File
@@ -0,0 +1,32 @@
//! Shared DTOs for the `/api/oneliners` endpoint.
//!
//! Server serializes [`OnelinersResponse`]; clients deserialize the same
//! type. Keeping this in a client-agnostic crate avoids drift between
//! server output and client parsing.
use serde::{Deserialize, Serialize};
/// HTTP path of the oneliners endpoint.
pub const ONELINERS_PATH: &str = "/api/oneliners";
/// Full response body of `GET /api/oneliners`.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OnelinersResponse {
/// RFC3339 UTC timestamp at which the server built this response.
pub as_of: String,
/// Effective window (after server-side clamp).
pub window_hours: u32,
/// Oneliners of cases whose earliest recording sits inside the window,
/// sorted newest-first by `created_at`.
pub oneliners: Vec<OnelinerEntry>,
}
/// One case summary. `oneliner` is `None` while the case is still
/// transcribing / generating; `updated_at` is `None` for the same reason.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OnelinerEntry {
pub case_id: String,
pub oneliner: Option<String>,
pub created_at: String,
pub updated_at: Option<String>,
}