core: add webrtc-rs (validated host + iOS); SSE forwards clipboard only

Add the webrtc dependency that the in-core RTC transport will use. Verified
it cross-compiles to aarch64-apple-ios, confirming RTC can live in the shared
core and reach every native platform from one implementation (the browser
keeps native RTCPeerConnection and interops over the wire).

Also fix a latent bug: the SSE transport forwarded every message type to the
sink, so a peer's presence/signal chirps would leak into the clipboard feed.
Now SSE forwards only clipboard; presence/signal belong to the RTC layer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 20:33:22 -05:00
parent 19f5eaccdf
commit a700a4b54b
3 changed files with 1526 additions and 9 deletions

1530
core/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -22,3 +22,4 @@ serde_json = "1"
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "stream", "json"] }
tokio = { version = "1", features = ["rt-multi-thread", "time", "sync", "macros"] }
futures-util = "0.3"
webrtc = "0.17.1"

View File

@@ -275,7 +275,9 @@ impl SseTransport {
if line.is_empty() {
if !data.is_empty() {
if let Ok(m) = serde_json::from_slice::<Message>(&data) {
if m.from != self.cfg.from {
// Clipboard only — presence/signal chirps on the bus
// belong to the RTC layer, not the feed.
if m.from != self.cfg.from && (m.kind.is_empty() || m.kind == "clipboard") {
sink(m); // engine de-dups + forwards to handler
}
}