Add all scaffolding, design, and decision documentation AKA first commit
This commit is contained in:
1 parent
b19e01c171
commit
aae22a0e23
63 files changed
+4690
No files matched your search
@@ -0,0 +1,194 @@
|
||||
//! Shared data types crossing the IPC boundary and between services.
|
||||
//! Mirrors `docs/03-data-model.md` and `docs/04-api-contracts.md`.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub type MeetingId = String; // uuid v4
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum BackendId {
|
||||
Npu,
|
||||
Nvidia,
|
||||
Amd,
|
||||
Intel,
|
||||
Cpu,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct BackendInfo {
|
||||
pub id: BackendId,
|
||||
pub name: String,
|
||||
pub available: bool,
|
||||
/// Lower rank = higher priority (NPU=0 … CPU=4).
|
||||
pub rank: u8,
|
||||
pub vram_mb: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum MeetingStatus {
|
||||
Recording,
|
||||
Transcribing,
|
||||
Ready,
|
||||
Recovering,
|
||||
Error,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct TranscriptSegment {
|
||||
pub id: u64,
|
||||
pub start_ms: u64,
|
||||
pub end_ms: u64,
|
||||
/// Internal speaker label ("S1"…); name resolved at render time (FR-SPK-5).
|
||||
pub speaker: String,
|
||||
pub text: String,
|
||||
pub confidence: Option<f32>,
|
||||
pub interim: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SpeakerInfo {
|
||||
pub label: String, // "S1"
|
||||
pub display_name: Option<String>,
|
||||
pub participant_id: Option<String>,
|
||||
}
|
||||
|
||||
/// A diarization result span before alignment to transcript segments.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct SpeakerSpan {
|
||||
pub start_ms: u64,
|
||||
pub end_ms: u64,
|
||||
pub speaker: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MeetingListItem {
|
||||
pub id: MeetingId,
|
||||
pub title: String,
|
||||
pub started_at: i64,
|
||||
pub duration_secs: Option<i64>,
|
||||
pub status: MeetingStatus,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ActionItem {
|
||||
pub id: Option<String>,
|
||||
pub text: String,
|
||||
pub owner: Option<String>,
|
||||
pub due_at: Option<i64>,
|
||||
pub confirmed: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct CalendarEvent {
|
||||
pub id: String,
|
||||
pub source: String, // pst|graph|ics
|
||||
pub subject: Option<String>,
|
||||
pub organizer: Option<String>,
|
||||
pub starts_at: Option<i64>,
|
||||
pub ends_at: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Participant {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub email: Option<String>,
|
||||
pub role: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Settings {
|
||||
pub theme: String, // system|light|dark
|
||||
pub storage_root: String,
|
||||
pub llm_provider: String, // ollama|custom|off
|
||||
pub llm_endpoint: String,
|
||||
pub llm_model: String,
|
||||
pub preferred_backend: String, // auto|npu|nvidia|amd|intel|cpu
|
||||
pub low_overhead: bool,
|
||||
// Recording retention (ADR-0009). Default OFF.
|
||||
pub default_record: bool,
|
||||
pub consent_acknowledged: bool,
|
||||
// Sync master switch (ADR-0010). Default OFF. Target rows live in the DB; secrets in OS keychain.
|
||||
pub sync_enabled: bool,
|
||||
}
|
||||
|
||||
// ---- Sync (ADR-0010) ----
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum SyncKind {
|
||||
WebDav,
|
||||
OneDrive,
|
||||
Dropbox,
|
||||
Box,
|
||||
}
|
||||
|
||||
/// What the UI sees about a target. NEVER contains the secret (FR-SYNC-6).
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SyncTargetInfo {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub kind: SyncKind,
|
||||
pub provider_hint: Option<String>, // nextcloud|owncloud|cloudreve|seafile|synology|generic
|
||||
pub base_url: Option<String>,
|
||||
pub remote_base_path: String,
|
||||
pub username: Option<String>,
|
||||
pub enabled: bool,
|
||||
pub third_party: bool,
|
||||
pub host: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SyncJobInfo {
|
||||
pub id: String,
|
||||
pub target_id: String,
|
||||
pub meeting_id: MeetingId,
|
||||
pub artifact: String, // transcript|notes|summary|recording
|
||||
pub status: String, // pending|uploading|done|failed|skipped
|
||||
pub attempts: u32,
|
||||
pub bytes_sent: u64,
|
||||
pub bytes_total: Option<u64>,
|
||||
pub last_error: Option<String>,
|
||||
}
|
||||
|
||||
// ---- Feature briefs + MCP (ADR-0011) ----
|
||||
|
||||
/// Agent-ready spec distilled from a meeting; served by the MCP `get_feature_brief` tool.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FeatureBrief {
|
||||
pub id: String,
|
||||
pub meeting_id: MeetingId,
|
||||
pub title: String,
|
||||
pub problem: String,
|
||||
pub desired_outcome: String,
|
||||
pub acceptance_criteria: Vec<String>,
|
||||
pub target_repo: Option<String>,
|
||||
pub context_excerpts: Vec<ContextExcerpt>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ContextExcerpt {
|
||||
pub speaker: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
/// Lightweight listing row (no full body).
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FeatureBriefInfo {
|
||||
pub id: String,
|
||||
pub meeting_id: MeetingId,
|
||||
pub title: String,
|
||||
pub target_repo: Option<String>,
|
||||
pub exposed: bool,
|
||||
}
|
||||
|
||||
/// One row of the MCP audit log (FR-MCP-5).
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct McpAccessEntry {
|
||||
pub at: i64,
|
||||
pub tool: String,
|
||||
pub meeting_id: Option<MeetingId>,
|
||||
pub client: Option<String>,
|
||||
}
|
||||
Reference in new issue
Block a user