Implement the launcher design as a production peer-to-peer feature. Call to Play actions are immutable, validated events broadcast over the existing QUIC control channel, deduplicated in a bounded in-memory history, and exchanged in Hello/HelloAck so late joiners reconstruct current calls. Add the Tauri bridge and modular launcher surfaces for play-now and scheduled calls, check-in, readiness buffers, role-aware controls, chat, tickers, and actual caller launch. A deterministic frontend reducer derives presentation state from replicated history. Extend the JSONL peer harness with publish/list commands and a three-peer live-delivery and late-join scenario. This intentionally raises the only supported wire protocol from version 5 to version 6; older builds are not supported. Document the transport architecture and exclude generated peer-test state from Docker build contexts. Test Plan: - `just fmt` -- passed - `just clippy` -- passed - `just test` -- passed - `just frontend-test` -- passed, 20 tests - `just build` -- passed - `just peer-cli-tests S2 S48` -- passed - `git diff --cached --check` -- passed
35 lines
973 B
Rust
35 lines
973 B
Rust
use std::path::Path;
|
|
|
|
use uuid::Uuid;
|
|
|
|
use crate::state_paths::peer_id_path;
|
|
|
|
pub const FEATURE_LIBRARY_DELTA: &str = "library-delta-v1";
|
|
pub const FEATURE_LIBRARY_SNAPSHOT: &str = "library-snapshot-v1";
|
|
pub const FEATURE_CALL_TO_PLAY: &str = "call-to-play-v1";
|
|
|
|
pub fn load_or_create_peer_id(state_dir: &Path) -> eyre::Result<String> {
|
|
let path = peer_id_path(state_dir);
|
|
if let Ok(existing) = std::fs::read_to_string(&path) {
|
|
let trimmed = existing.trim();
|
|
if !trimmed.is_empty() {
|
|
return Ok(trimmed.to_string());
|
|
}
|
|
}
|
|
|
|
let peer_id = Uuid::now_v7().simple().to_string();
|
|
if let Some(parent) = path.parent() {
|
|
std::fs::create_dir_all(parent)?;
|
|
}
|
|
std::fs::write(&path, peer_id.as_bytes())?;
|
|
Ok(peer_id)
|
|
}
|
|
|
|
pub fn default_features() -> Vec<String> {
|
|
vec![
|
|
FEATURE_LIBRARY_DELTA.to_string(),
|
|
FEATURE_LIBRARY_SNAPSHOT.to_string(),
|
|
FEATURE_CALL_TO_PLAY.to_string(),
|
|
]
|
|
}
|