Files
tether/core/Cargo.toml
Patrick Ecord 3cb916ee5e core: M4 — files/photos over iroh-blobs (multi-modal clipboard)
IrohTransport.send_file now adds the (already-sealed) bytes to a MemStore and
broadcasts a blob announcement over gossip {hash, name, mime, provider}; on
receipt, peers fetch the blob P2P by hash via iroh-blobs and emit MeshEvent::File.
The engine's existing File handler decrypts and delivers — so the clipboard can
carry data/photos/etc, not just text. Replaces the hand-rolled M/C/E frame
protocol entirely.

Verified: `cargo run --features iroh-transport --example iroh_engine` syncs both
a text clipboard (gossip) AND a 200 KB photo (iroh-blobs), both E2E-decrypted
A→B, no SSE/RTC/LAN/relay. Default ship build untouched; feature build clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 01:15:41 -05:00

54 lines
1.7 KiB
TOML

[package]
name = "tethercore"
version = "0.1.0"
edition = "2021"
description = "Shared tether sync engine: codec + SSE client + reconnect, FFI-exported via UniFFI."
[lib]
# lib → examples/tests can link it natively
# staticlib → iOS .a / desktop agent
# cdylib → Android .so / bindgen library mode
crate-type = ["lib", "staticlib", "cdylib"]
name = "tethercore"
[[bin]]
name = "uniffi-bindgen"
path = "src/bin/uniffi-bindgen.rs"
[dependencies]
uniffi = { version = "0.28", features = ["cli"] }
serde = { version = "1", features = ["derive"] }
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", "net", "io-util"] }
futures-util = "0.3"
webrtc = "0.17.1"
mdns-sd = "0.20.0"
sha2 = "0.11.0"
bytes = "1.12.0"
chacha20poly1305 = "0.10.1"
base64 = "0.22.1"
getrandom = "0.4.3"
# M4: the iroh Mesh, behind the `iroh-transport` feature (off by default, so the
# UniFFI/xcframework/agent builds are untouched). When on, IrohTransport replaces
# the hand-rolled SSE/RTC/LAN stack.
iroh = { version = "1", optional = true }
iroh-gossip = { version = "0.101", optional = true }
iroh-blobs = { version = "0.103", optional = true }
[features]
default = []
iroh-transport = ["dep:iroh", "dep:iroh-gossip", "dep:iroh-blobs"]
[dev-dependencies]
# Iroh spikes (examples/iroh_*.rs) link iroh directly regardless of the feature.
iroh = "1"
iroh-gossip = "0.101"
anyhow = "1"
# The M4 integration example drives the real Engine over IrohTransport, so it
# needs the feature (and Engine::iroh_id, which only exists under it).
[[example]]
name = "iroh_engine"
required-features = ["iroh-transport"]