Skip to content

Development - #1

Merged
idehen-divine merged 8 commits into
masterfrom
development
Jul 11, 2026
Merged

idehen-divine merged 8 commits into
masterfrom
development

Conversation

@idehen-divine

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 11, 2026 16:59
@idehen-divine
idehen-divine merged commit d6e2ddc into master Jul 11, 2026
1 of 5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands wiresend-core with foundational modules for discovery, networking, protocol messaging, cryptography, and file transfers, and wires parts of it into the Tauri desktop app. It also adds a GitHub Actions CI workflow to build/test/clippy the Rust workspace and build the frontend.

Changes:

  • Added protocol + transport foundations (message types, packet framing, TCP transport, connection management).
  • Added discovery (mDNS + device registry) and transfer primitives (sender/receiver, progress, queue, manager).
  • Updated the desktop Tauri app to expose device/config commands and start the core manager on startup; added CI workflow.

Reviewed changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
crates/wiresend-core/tests/integration_test.rs Adds broad integration-style tests for core primitives (devices, crypto, protocol, transfer utils).
crates/wiresend-core/src/transfer/sender.rs Implements chunked encrypted file sending over a Connection.
crates/wiresend-core/src/transfer/receiver.rs Implements encrypted file receiving and hash verification over a Connection.
crates/wiresend-core/src/transfer/queue.rs Adds an in-memory FIFO queue for pending transfers.
crates/wiresend-core/src/transfer/progress.rs Adds a simple progress tracker for bytes-sent and percent complete.
crates/wiresend-core/src/transfer/mod.rs Exposes new transfer submodules via the crate public API.
crates/wiresend-core/src/transfer/manager.rs Adds a transfer manager to track active transfers and a queue.
crates/wiresend-core/src/transfer/chunk.rs Adds chunk hashing + random-access chunk writing helpers.
crates/wiresend-core/src/storage/trusted_devices.rs Adds persistence for trusted devices in a JSON file.
crates/wiresend-core/src/storage/mod.rs Exposes trusted_devices module.
crates/wiresend-core/src/storage/history.rs Adjusts stored history entry schema.
crates/wiresend-core/src/protocol/version.rs Introduces protocol version constant.
crates/wiresend-core/src/protocol/packet.rs Adds a length-prefixed packet framing layer for messages.
crates/wiresend-core/src/protocol/mod.rs Exposes protocol submodules.
crates/wiresend-core/src/protocol/message.rs Defines the wire message enum for pairing/transfer flows.
crates/wiresend-core/src/network/transport.rs Adds Transport/Connection async traits.
crates/wiresend-core/src/network/tcp.rs Implements a TCP transport.
crates/wiresend-core/src/network/mod.rs Exposes network submodules.
crates/wiresend-core/src/network/manager.rs Adds a device-id keyed connection manager.
crates/wiresend-core/src/network/connection.rs Implements a TCP Connection with timeouts.
crates/wiresend-core/src/error.rs Adds protocol/crypto error variants for new subsystems.
crates/wiresend-core/src/discovery/mod.rs Exposes discovery submodules.
crates/wiresend-core/src/discovery/mdns.rs Implements mDNS advertising + browsing to discover peers.
crates/wiresend-core/src/discovery/manager.rs Adds a TTL-based device registry with expiration logic.
crates/wiresend-core/src/discovery/device.rs Defines device identity/type/capabilities and merge/expiry logic.
crates/wiresend-core/src/discovery/ble.rs Adds a stub BLE discovery implementation.
crates/wiresend-core/src/crypto/mod.rs Exposes crypto submodules.
crates/wiresend-core/src/crypto/keys.rs Adds X25519 keypair generation and shared-secret derivation.
crates/wiresend-core/src/crypto/encrypt.rs Adds AES-GCM encryption/decryption helpers and key derivation.
crates/wiresend-core/src/app/state.rs Refactors AppState to hold an AppManager behind Arc<Mutex<_>>.
crates/wiresend-core/src/app/manager.rs Adds AppManager to own key/core subsystem managers and start discovery.
crates/wiresend-core/src/app/event.rs Minor formatting-only change.
crates/wiresend-core/Cargo.toml Adds dependencies/features required for new networking/crypto/discovery/protocol modules.
Cargo.lock Locks new Rust dependencies.
apps/desktop/src-tauri/src/desktop/mod.rs Adds Tauri commands and starts AppManager during setup.
apps/desktop/src-tauri/Cargo.toml Adds tokio runtime deps and whoami.
.github/workflows/ci.yml Adds CI jobs for Rust workspace + frontend build/typecheck.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +32
let len = u32::from_be_bytes(header) as usize;

let mut body = vec![0u8; len];
Comment on lines +9 to +10
let len = data.len() as u32;
let header = len.to_be_bytes();
Comment on lines +1 to +3
use crate::error::AppError;
use crate::network::transport::Connection;
use crate::protocol::message::Message;
Comment on lines 50 to +54
pub fn run(shutdown_handle: ShutdownHandle) {
let handle = shutdown_handle.clone();
let app_manager = AppManager::new();
let app_state = AppState::new(Arc::new(Mutex::new(app_manager)));

let handle_clone = shutdown_handle.clone();
Comment on lines +24 to +27
pub fn compute_shared_secret(&self, peer_public: &[u8]) -> Vec<u8> {
let secret_bytes: [u8; 32] = self.secret[..32].try_into().expect("Invalid key length");
let peer_bytes: [u8; 32] = peer_public[..32].try_into().expect("Invalid key length");
let secret = StaticSecret::from(secret_bytes);
Comment on lines +51 to +55
loop {
let n = file
.read(&mut buf)
.map_err(|e| AppError::Transfer(format!("Failed to read file: {e}")))?;

Comment on lines +74 to +78
let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async {
let mut manager = manager_clone.lock().unwrap();
if let Err(e) = manager.start(D_PORT).await {
eprintln!("Failed to start app: {e}");
Comment on lines +79 to +85
let mut manager = DeviceManager::new(Duration::from_millis(1));
let id = DeviceId::new("stale-dev");
let device = Device::new(id.clone(), "Stale", DeviceType::Unknown, vec![]);
manager.add_or_update(device);

std::thread::sleep(Duration::from_millis(2));
let expired = manager.expire_stale();
Comment on lines +93 to +103
let mut manager = DeviceManager::new(Duration::from_millis(1));
let fresh_id = DeviceId::new("fresh");
let stale_id = DeviceId::new("stale");

manager.add_or_update(Device::new(fresh_id.clone(), "Fresh", DeviceType::Desktop, vec![]));

std::thread::sleep(Duration::from_millis(2));

manager.add_or_update(Device::new(stale_id.clone(), "Stale", DeviceType::Desktop, vec![]));

let devices = manager.get_all();
Comment on lines +30 to +34
pub async fn start_transfer(
&self,
transfer_id: String,
kind: TransferKind,
) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants