YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
chore: bump rust-toolchain to 1.93.1, cargo fmt all files
Louis Beaumontd1aae05d4a43
diff --git a/crates/screenpipe-accessibility/src/platform/windows_uia.rs b/crates/screenpipe-accessibility/src/platform/windows_uia.rsindex 7362bb761..b315750c9 100644--- a/crates/screenpipe-accessibility/src/platform/windows_uia.rs+++ b/crates/screenpipe-accessibility/src/platform/windows_uia.rs@@ -28,11 +28,10 @@ use windows::Win32::UI::Accessibility::{AutomationElementMode_Full, AutomationElementMode_None, CUIAutomation, IUIAutomation,IUIAutomationCacheRequest, IUIAutomationElement, IUIAutomationFocusChangedEventHandler,IUIAutomationFocusChangedEventHandler_Impl, IUIAutomationTreeWalker, TreeScope_Element,- TreeScope_Subtree,- UIA_AutomationIdPropertyId, UIA_BoundingRectanglePropertyId, UIA_ClassNamePropertyId,- UIA_ControlTypePropertyId, UIA_HasKeyboardFocusPropertyId, UIA_IsEnabledPropertyId,- UIA_IsKeyboardFocusablePropertyId, UIA_NamePropertyId, UIA_ValueValuePropertyId,- UIA_PROPERTY_ID,+ TreeScope_Subtree, UIA_AutomationIdPropertyId, UIA_BoundingRectanglePropertyId,+ UIA_ClassNamePropertyId, UIA_ControlTypePropertyId, UIA_HasKeyboardFocusPropertyId,+ UIA_IsEnabledPropertyId, UIA_IsKeyboardFocusablePropertyId, UIA_NamePropertyId,+ UIA_ValueValuePropertyId, UIA_PROPERTY_ID,};use windows::Win32::UI::WindowsAndMessaging::{DispatchMessageW, GetForegroundWindow, GetWindowTextW, GetWindowThreadProcessId, PeekMessageW,@@ -142,9 +141,7 @@ impl UiaContext {// handful of titlebar nodes. When this happens, fall back to// TreeWalker which makes individual COM calls per element.if count <= 10 {- if let Some(walker_root) =- self.capture_window_tree_walker(hwnd, max_elements)- {+ if let Some(walker_root) = self.capture_window_tree_walker(hwnd, max_elements) {let walker_count = walker_root.node_count();if walker_count > count {debug!(@@ -220,11 +217,7 @@ impl UiaContext {.GetNextSiblingElementBuildCache(¤t, &self.walker_cache_request){Ok(next) => {- children.push(self.build_node_walker(- &next,- max_elements,- count,- ));+ children.push(self.build_node_walker(&next, max_elements, count));current = next;}Err(_) => break,diff --git a/crates/screenpipe-accessibility/src/tree/windows.rs b/crates/screenpipe-accessibility/src/tree/windows.rsindex 63605458e..cdbf517db 100644--- a/crates/screenpipe-accessibility/src/tree/windows.rs+++ b/crates/screenpipe-accessibility/src/tree/windows.rs@@ -20,7 +20,9 @@ use std::time::Instant;use tracing::debug;use windows::Win32::Foundation::{HWND, RECT};-use windows::Win32::Graphics::Gdi::{GetMonitorInfoW, MonitorFromWindow, MONITORINFO, MONITOR_DEFAULTTONEAREST};+use windows::Win32::Graphics::Gdi::{+ GetMonitorInfoW, MonitorFromWindow, MONITORINFO, MONITOR_DEFAULTTONEAREST,+};use windows::Win32::System::Com::{CoInitializeEx, COINIT_APARTMENTTHREADED};use windows::Win32::UI::WindowsAndMessaging::{GetForegroundWindow, GetWindowTextW, GetWindowThreadProcessId,@@ -478,7 +480,15 @@ fn extract_text_from_tree(// Recurse into childrenfor child in &node.children {- extract_text_from_tree(child, depth + 1, max_depth, buffer, nodes, browser_url, monitor_rect);+ extract_text_from_tree(+ child,+ depth + 1,+ max_depth,+ buffer,+ nodes,+ browser_url,+ monitor_rect,+ );}}diff --git a/crates/screenpipe-audio/src/transcription/deepgram/batch.rs b/crates/screenpipe-audio/src/transcription/deepgram/batch.rsindex 971bd1429..ffb2214d1 100644--- a/crates/screenpipe-audio/src/transcription/deepgram/batch.rs+++ b/crates/screenpipe-audio/src/transcription/deepgram/batch.rs@@ -150,7 +150,10 @@ async fn handle_deepgram_response(let body_text = resp.text().await.unwrap_or_default();// Detect firewall/proxy/captive portal interference- if content_type.contains("text/html") || body_text.starts_with("<!") || body_text.starts_with("<html") {+ if content_type.contains("text/html")+ || body_text.starts_with("<!")+ || body_text.starts_with("<html")+ {error!("device: {}, deepgram request blocked — received HTML instead of JSON (status {}). \this usually means a firewall, corporate proxy, or captive portal is intercepting \@@ -186,7 +189,8 @@ async fn handle_deepgram_response(device, status);return Err(anyhow::anyhow!(- "Deepgram returned empty response (HTTP {})", status+ "Deepgram returned empty response (HTTP {})",+ status));}@@ -264,7 +268,10 @@ async fn handle_deepgram_response());}- error!("device: {}, failed to send request to Deepgram API: {:?}", device, e);+ error!(+ "device: {}, failed to send request to Deepgram API: {:?}",+ device, e+ );Err(anyhow::anyhow!("Failed to send request to Deepgram API: {:?}",ediff --git a/crates/screenpipe-audio/tests/music_detection_real.rs b/crates/screenpipe-audio/tests/music_detection_real.rsindex 5cd7694d7..22dec033e 100644--- a/crates/screenpipe-audio/tests/music_detection_real.rs+++ b/crates/screenpipe-audio/tests/music_detection_real.rs@@ -41,7 +41,10 @@ macro_rules! skip_if_no_fixture {match load_pcm($name) {Some(audio) => audio,None => {- eprintln!("[SKIP] fixture {} not found — run fixture generation first", $name);+ eprintln!(+ "[SKIP] fixture {} not found — run fixture generation first",+ $name+ );return;}}@@ -68,7 +71,9 @@ fn test_music_output_should_be_filtered() {let (orig, filt, removed) = filter_and_measure(&mut audio);eprintln!("[music_sample_1] orig_energy={:.2}, filt_energy={:.2}, removed={:.1}%",- orig, filt, removed * 100.0+ orig,+ filt,+ removed * 100.0);assert!(removed > 0.50,@@ -83,7 +88,9 @@ fn test_music_output_2_should_be_filtered() {let (orig, filt, removed) = filter_and_measure(&mut audio);eprintln!("[music_sample_2] orig_energy={:.2}, filt_energy={:.2}, removed={:.1}%",- orig, filt, removed * 100.0+ orig,+ filt,+ removed * 100.0);assert!(removed > 0.50,@@ -98,7 +105,9 @@ fn test_music_via_mic_should_be_filtered() {let (orig, filt, removed) = filter_and_measure(&mut audio);eprintln!("[music_mic_1] orig_energy={:.2}, filt_energy={:.2}, removed={:.1}%",- orig, filt, removed * 100.0+ orig,+ filt,+ removed * 100.0);assert!(removed > 0.30,@@ -113,7 +122,9 @@ fn test_speech_should_be_preserved() {let (orig, filt, removed) = filter_and_measure(&mut audio);eprintln!("[speech_sample_1] orig_energy={:.2}, filt_energy={:.2}, removed={:.1}%",- orig, filt, removed * 100.0+ orig,+ filt,+ removed * 100.0);assert!(removed < 0.20,@@ -128,7 +139,9 @@ fn test_speech_2_should_be_preserved() {let (orig, filt, removed) = filter_and_measure(&mut audio);eprintln!("[speech_sample_2] orig_energy={:.2}, filt_energy={:.2}, removed={:.1}%",- orig, filt, removed * 100.0+ orig,+ filt,+ removed * 100.0);assert!(removed < 0.20,@@ -143,7 +156,9 @@ fn test_speech_3_should_be_preserved() {let (orig, filt, removed) = filter_and_measure(&mut audio);eprintln!("[speech_sample_3] orig_energy={:.2}, filt_energy={:.2}, removed={:.1}%",- orig, filt, removed * 100.0+ orig,+ filt,+ removed * 100.0);assert!(removed < 0.20,diff --git a/crates/screenpipe-core/src/pipes/mod.rs b/crates/screenpipe-core/src/pipes/mod.rsindex 49e964b6b..58aa9f0a7 100644--- a/crates/screenpipe-core/src/pipes/mod.rs+++ b/crates/screenpipe-core/src/pipes/mod.rs@@ -2901,5 +2901,4 @@ mod tests {.unwrap_or(false);assert!(!history, "history should default to false");}-}diff --git a/crates/screenpipe-db/tests/heavy_read_test.rs b/crates/screenpipe-db/tests/heavy_read_test.rsindex 360cb52e4..90bf3c89d 100644--- a/crates/screenpipe-db/tests/heavy_read_test.rs+++ b/crates/screenpipe-db/tests/heavy_read_test.rs@@ -113,17 +113,17 @@ async fn test_concurrent_ocr_searches_dont_starve_pool() {// The write task should complete quickly (< 5s) even with 4 concurrent searches.// Without the semaphore, the write could be starved for 10+ seconds.- assert!(- write_ok,- "write task should succeed"- );+ assert!(write_ok, "write task should succeed");assert!(write_elapsed < Duration::from_secs(5),"write should complete in <5s (got {:.2}s) — pool not starved",write_elapsed.as_secs_f64());- println!("\nPASS: write completed in {:.2}s while 4 OCR searches ran concurrently", write_elapsed.as_secs_f64());+ println!(+ "\nPASS: write completed in {:.2}s while 4 OCR searches ran concurrently",+ write_elapsed.as_secs_f64()+ );}/// Test that the 30s timeout on search would fire for pathologically slow queries.diff --git a/crates/screenpipe-server/src/routes/frames.rs b/crates/screenpipe-server/src/routes/frames.rsindex 47d7080ab..9c603d61d 100644--- a/crates/screenpipe-server/src/routes/frames.rs+++ b/crates/screenpipe-server/src/routes/frames.rs@@ -838,8 +838,7 @@ pub async fn run_frame_ocr(#[cfg(not(any(target_os = "macos", target_os = "windows")))]let ocr_result = tokio::task::spawn_blocking(move || {- let (text, json, _confidence) =- screenpipe_vision::perform_ocr_tesseract(&image, vec![]);+ let (text, json, _confidence) = screenpipe_vision::perform_ocr_tesseract(&image, vec![]);(text, json)}).awaitdiff --git a/crates/screenpipe-server/src/routes/health.rs b/crates/screenpipe-server/src/routes/health.rsindex 61b7fa25c..1d9e0f4b4 100644--- a/crates/screenpipe-server/src/routes/health.rs+++ b/crates/screenpipe-server/src/routes/health.rs@@ -435,10 +435,7 @@ pub async fn health_check(State(state): State<Arc<AppState>>) -> JsonResponse<He(None, None)};- let device_names: Vec<String> = audio_devices- .iter()- .map(|d| d.to_string())- .collect();+ let device_names: Vec<String> = audio_devices.iter().map(|d| d.to_string()).collect();Some(AudioPipelineHealthInfo {uptime_secs: audio_snap.uptime_secs,@@ -459,7 +456,11 @@ pub async fn health_check(State(state): State<Arc<AppState>>) -> JsonResponse<Hechunks_received: Some(audio_snap.chunks_received),process_errors: Some(audio_snap.process_errors),audio_level_rms: Some(audio_snap.audio_level_rms),- audio_devices: if device_names.is_empty() { None } else { Some(device_names) },+ audio_devices: if device_names.is_empty() {+ None+ } else {+ Some(device_names)+ },// Batch/Smart modetranscription_mode: if audio_snap.segments_deferred > 0|| audio_snap.segments_batch_processed > 0diff --git a/crates/screenpipe-server/src/vision_manager/manager.rs b/crates/screenpipe-server/src/vision_manager/manager.rsindex bf09dddbf..7c280a8c5 100644--- a/crates/screenpipe-server/src/vision_manager/manager.rs+++ b/crates/screenpipe-server/src/vision_manager/manager.rs@@ -112,11 +112,14 @@ impl VisionManager {return true;}let stable_id = monitor.stable_id();- fn prefix(sid: &str) -> &str { sid.rsplitn(2, '_').last().unwrap_or(sid) }+ fn prefix(sid: &str) -> &str {+ sid.rsplitn(2, '_').last().unwrap_or(sid)+ }let monitor_prefix = prefix(&stable_id);- self.config.monitor_ids.iter().any(|allowed| {- *allowed == stable_id || prefix(allowed) == monitor_prefix- })+ self.config+ .monitor_ids+ .iter()+ .any(|allowed| *allowed == stable_id || prefix(allowed) == monitor_prefix)}/// Start recording on all currently connected monitorsdiff --git a/crates/screenpipe-vision/src/core.rs b/crates/screenpipe-vision/src/core.rsindex 14d5507b8..bd7c4cea7 100644--- a/crates/screenpipe-vision/src/core.rs+++ b/crates/screenpipe-vision/src/core.rs@@ -384,8 +384,7 @@ pub async fn process_ocr_task(for captured_window in &raw.window_images {// Calculate hash for this window's image- let window_image_hash =- WindowOcrCache::calculate_image_hash(&captured_window.image);+ let window_image_hash = WindowOcrCache::calculate_image_hash(&captured_window.image);let window_id =WindowOcrCache::make_window_id(&captured_window.app_name, &captured_window.window_name);let cache_key = WindowCacheKey {diff --git a/crates/screenpipe-vision/src/ocr_cache.rs b/crates/screenpipe-vision/src/ocr_cache.rsindex 5f127ecb7..107a0d19a 100644--- a/crates/screenpipe-vision/src/ocr_cache.rs+++ b/crates/screenpipe-vision/src/ocr_cache.rs@@ -397,15 +397,18 @@ mod tests {use image::{DynamicImage, RgbaImage};let img1 = DynamicImage::ImageRgba8(RgbaImage::from_pixel(- 100, 100,+ 100,+ 100,image::Rgba([255, 0, 0, 255]),));let img2 = DynamicImage::ImageRgba8(RgbaImage::from_pixel(- 100, 100,+ 100,+ 100,image::Rgba([255, 0, 0, 255]),));let img3 = DynamicImage::ImageRgba8(RgbaImage::from_pixel(- 100, 100,+ 100,+ 100,image::Rgba([0, 255, 0, 255]),));diff --git a/rust-toolchain.toml b/rust-toolchain.tomlindex 3c4842b8d..6bdbf7660 100644--- a/rust-toolchain.toml+++ b/rust-toolchain.toml@@ -1,4 +1,4 @@[toolchain]-channel = "1.92.0"+channel = "1.93.1"targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"]components = ["rustfmt", "clippy"]