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
fix: resolve all clippy warnings and cargo fmt across codebase
Louis Beaumont213ee5bb6f39
diff --git a/crates/screenpipe-accessibility/src/events.rs b/crates/screenpipe-accessibility/src/events.rsindex 2351fe90b..a5fda8dcc 100644--- a/crates/screenpipe-accessibility/src/events.rs+++ b/crates/screenpipe-accessibility/src/events.rs@@ -333,7 +333,7 @@ impl AccessibilityNode {/// Count nodes that have a non-empty name (i.e., visible text content).pub fn named_node_count(&self) -> usize {- let self_count = if self.name.as_ref().map_or(false, |n| !n.is_empty()) {+ let self_count = if self.name.as_ref().is_some_and(|n| !n.is_empty()) {1} else {0diff --git a/crates/screenpipe-audio/src/meeting_detector.rs b/crates/screenpipe-audio/src/meeting_detector.rsindex f0931c6a9..b2c11593b 100644--- a/crates/screenpipe-audio/src/meeting_detector.rs+++ b/crates/screenpipe-audio/src/meeting_detector.rs@@ -40,6 +40,12 @@ struct MeetingState {directly_focused: bool,}+impl Default for MeetingDetector {+ fn default() -> Self {+ Self::new()+ }+}+impl MeetingDetector {pub fn new() -> Self {// Only apps that unambiguously indicate a live call.@@ -112,11 +118,13 @@ impl MeetingDetector {let was_in_meeting = state.directly_focused;state.directly_focused = true;state.last_meeting_focus = Some(Instant::now());- state.current_app = Some(if let Some(pattern) = self.matching_browser_pattern(&app_lower, window_title) {- format!("{} ({})", app_name, pattern)- } else {- app_name.to_string()- });+ state.current_app = Some(+ if let Some(pattern) = self.matching_browser_pattern(&app_lower, window_title) {+ format!("{} ({})", app_name, pattern)+ } else {+ app_name.to_string()+ },+ );if !was_in_meeting && !self.in_meeting.load(Ordering::Relaxed) {debug!("meeting detected: app={}", app_name);@@ -248,7 +256,10 @@ mod tests {// Switch awaydetector.on_app_switch("Finder", None).await;- assert!(detector.is_in_meeting(), "grace period should keep it active");+ assert!(+ detector.is_in_meeting(),+ "grace period should keep it active"+ );// Manually expire the grace period by backdating last_meeting_focus{diff --git a/crates/screenpipe-audio/src/speaker/models.rs b/crates/screenpipe-audio/src/speaker/models.rsindex 872061fe9..d423fa1ba 100644--- a/crates/screenpipe-audio/src/speaker/models.rs+++ b/crates/screenpipe-audio/src/speaker/models.rs@@ -58,10 +58,7 @@ pub async fn get_or_download_model(model_type: PyannoteModel) -> Result<PathBuf>.is_ok(){info!("initiating {} model download...", filename);- let model_type_clone = match model_type {- PyannoteModel::Segmentation => PyannoteModel::Segmentation,- PyannoteModel::Embedding => PyannoteModel::Embedding,- };+ let model_type_clone = model_type;let flag = downloading_flag;tokio::spawn(async move {match download_model(model_type_clone).await {diff --git a/crates/screenpipe-audio/src/transcription/whisper/batch.rs b/crates/screenpipe-audio/src/transcription/whisper/batch.rsindex 4a9f18bc8..dc28fd71b 100644--- a/crates/screenpipe-audio/src/transcription/whisper/batch.rs+++ b/crates/screenpipe-audio/src/transcription/whisper/batch.rs@@ -11,7 +11,6 @@ pub async fn process_with_whisper(languages: Vec<Language>,whisper_state: &mut WhisperState,) -> Result<String> {-let mut params = FullParams::new(SamplingStrategy::Greedy { best_of: 0 });let mut audio = audio.to_vec();diff --git a/crates/screenpipe-audio/src/vad/mod.rs b/crates/screenpipe-audio/src/vad/mod.rsindex 4b9029767..bcf77e03a 100644--- a/crates/screenpipe-audio/src/vad/mod.rs+++ b/crates/screenpipe-audio/src/vad/mod.rs@@ -84,21 +84,33 @@ mod tests {#[test]fn vad_sensitivity_from_str_low() {- assert!(matches!("low".parse::<VadSensitivity>().unwrap(), VadSensitivity::Low));+ assert!(matches!(+ "low".parse::<VadSensitivity>().unwrap(),+ VadSensitivity::Low+ ));}#[test]fn vad_sensitivity_from_str_medium() {- assert!(matches!("medium".parse::<VadSensitivity>().unwrap(), VadSensitivity::Medium));+ assert!(matches!(+ "medium".parse::<VadSensitivity>().unwrap(),+ VadSensitivity::Medium+ ));}#[test]fn vad_sensitivity_from_str_high() {- assert!(matches!("high".parse::<VadSensitivity>().unwrap(), VadSensitivity::High));+ assert!(matches!(+ "high".parse::<VadSensitivity>().unwrap(),+ VadSensitivity::High+ ));}#[test]fn vad_sensitivity_from_str_unknown_defaults_to_high() {- assert!(matches!("anything".parse::<VadSensitivity>().unwrap(), VadSensitivity::High));+ assert!(matches!(+ "anything".parse::<VadSensitivity>().unwrap(),+ VadSensitivity::High+ ));}}diff --git a/crates/screenpipe-core/src/pipes/mod.rs b/crates/screenpipe-core/src/pipes/mod.rsindex 0fec0a9e7..8a776bbaa 100644--- a/crates/screenpipe-core/src/pipes/mod.rs+++ b/crates/screenpipe-core/src/pipes/mod.rs@@ -148,6 +148,7 @@ pub struct SchedulerState {/// `PipeManager` works without a store (CLI mode) — all methods are guarded/// by `Option<Arc<dyn PipeStore>>`.#[async_trait::async_trait]+#[allow(clippy::too_many_arguments)]pub trait PipeStore: Send + Sync {/// Insert a new execution row with status='queued'. Returns the row id.async fn create_execution(@@ -628,15 +629,15 @@ impl PipeManager {}// Resolve preset- let (run_model, run_provider, run_provider_url) =- if let Some(ref preset_id) = config.preset {- match resolve_preset(&self.pipes_dir, preset_id) {- Some(resolved) => (resolved.model, resolved.provider, resolved.url),- None => (config.model.clone(), config.provider.clone(), None),- }- } else {- (config.model.clone(), config.provider.clone(), None)- };+ let (run_model, run_provider, run_provider_url) = if let Some(ref preset_id) = config.preset+ {+ match resolve_preset(&self.pipes_dir, preset_id) {+ Some(resolved) => (resolved.model, resolved.provider, resolved.url),+ None => (config.model.clone(), config.provider.clone(), None),+ }+ } else {+ (config.model.clone(), config.provider.clone(), None)+ };// Create DB execution rowlet exec_id = if let Some(ref store) = self.store {@@ -750,7 +751,11 @@ impl PipeManager {} else {(None, None)};- let status = if output.success { "completed" } else { "failed" };+ let status = if output.success {+ "completed"+ } else {+ "failed"+ };if let (Some(ref store), Some(id)) = (&store_ref, exec_id) {let _ = store.finish_execution(@@ -765,7 +770,9 @@ impl PipeManager {.await;}if let Some(ref store) = store_ref {- let _ = store.upsert_scheduler_state(&pipe_name, output.success).await;+ let _ = store+ .upsert_scheduler_state(&pipe_name, output.success)+ .await;}PipeRunLog {pipe_name: pipe_name.clone(),@@ -780,7 +787,12 @@ impl PipeManager {if let (Some(ref store), Some(id)) = (&store_ref, exec_id) {let _ = store.finish_execution(- id, "failed", "", &e.to_string(), None, Some("crash"),+ id,+ "failed",+ "",+ &e.to_string(),+ None,+ Some("crash"),Some(&e.to_string()),).await;@@ -808,8 +820,16 @@ impl PipeManager {if let (Some(ref store), Some(id)) = (&store_ref, exec_id) {let _ = store.finish_execution(- id, "timed_out", "", "", None, Some("timeout"),- Some(&format!("execution timed out after {}s", DEFAULT_TIMEOUT_SECS)),+ id,+ "timed_out",+ "",+ "",+ None,+ Some("timeout"),+ Some(&format!(+ "execution timed out after {}s",+ DEFAULT_TIMEOUT_SECS+ )),).await;}@@ -830,8 +850,7 @@ impl PipeManager {// Write log to disklet log_dir = pipes_dir_for_log.join(&log.pipe_name).join("logs");let _ = std::fs::create_dir_all(&log_dir);- let log_file =- log_dir.join(format!("{}.json", log.started_at.format("%Y%m%d_%H%M%S")));+ let log_file = log_dir.join(format!("{}.json", log.started_at.format("%Y%m%d_%H%M%S")));let _ = std::fs::write(&log_file,serde_json::to_string_pretty(&log).unwrap_or_default(),@@ -1256,7 +1275,7 @@ impl PipeManager {if source_path.exists() {// Local file or directory- if source_path.is_file() && source_path.extension().map_or(false, |e| e == "md") {+ if source_path.is_file() && source_path.extension().is_some_and(|e| e == "md") {// Single .md file — derive name from filenamelet name = source_path.file_stem()@@ -1909,7 +1928,7 @@ Screenpipe API: http://localhost:{api_port}/// Parsed schedule — either a fixed interval or a cron expression.pub enum ParsedSchedule {Interval(std::time::Duration),- Cron(CronSchedule),+ Cron(Box<CronSchedule>),}/// Parse a schedule string into an interval or cron expression.@@ -1939,7 +1958,7 @@ pub fn parse_schedule(schedule: &str) -> Option<ParsedSchedule> {_ => s.to_string(),};if let Ok(cron) = CronSchedule::from_str(&padded) {- return Some(ParsedSchedule::Cron(cron));+ return Some(ParsedSchedule::Cron(Box::new(cron)));}None}diff --git a/crates/screenpipe-db/src/fts_indexer.rs b/crates/screenpipe-db/src/fts_indexer.rsindex a98dc91af..1332e7fea 100644--- a/crates/screenpipe-db/src/fts_indexer.rs+++ b/crates/screenpipe-db/src/fts_indexer.rs@@ -170,6 +170,7 @@ async fn update_last_indexed(}/// Index new rows from `frames` into `frames_fts` using bulk INSERT...SELECT.+#[allow(clippy::explicit_auto_deref)]async fn index_frames_fts(db: &DatabaseManager) -> Result<i64, sqlx::Error> {let last = get_last_indexed(db, "frames").await?;@@ -210,6 +211,7 @@ async fn index_frames_fts(db: &DatabaseManager) -> Result<i64, sqlx::Error> {}/// Index new rows from `ocr_text` into `ocr_text_fts` using bulk INSERT...SELECT.+#[allow(clippy::explicit_auto_deref)]async fn index_ocr_text_fts(db: &DatabaseManager) -> Result<i64, sqlx::Error> {let last = get_last_indexed(db, "ocr_text").await?;@@ -252,6 +254,7 @@ async fn index_ocr_text_fts(db: &DatabaseManager) -> Result<i64, sqlx::Error> {}/// Index new rows from `audio_transcriptions` into `audio_transcriptions_fts` using bulk INSERT...SELECT.+#[allow(clippy::explicit_auto_deref)]async fn index_audio_transcriptions_fts(db: &DatabaseManager) -> Result<i64, sqlx::Error> {let last = get_last_indexed(db, "audio_transcriptions").await?;@@ -296,6 +299,7 @@ async fn index_audio_transcriptions_fts(db: &DatabaseManager) -> Result<i64, sql}/// Index new rows from `accessibility` into `accessibility_fts` using bulk INSERT...SELECT.+#[allow(clippy::explicit_auto_deref)]async fn index_accessibility_fts(db: &DatabaseManager) -> Result<i64, sqlx::Error> {let last = get_last_indexed(db, "accessibility").await?;diff --git a/crates/screenpipe-integrations/src/unstructured_ocr.rs b/crates/screenpipe-integrations/src/unstructured_ocr.rsindex 917f08a93..fc2a82131 100644--- a/crates/screenpipe-integrations/src/unstructured_ocr.rs+++ b/crates/screenpipe-integrations/src/unstructured_ocr.rs@@ -110,4 +110,3 @@ fn calculate_overall_confidence(parsed_response: &[HashMap<String, serde_json::V0.0}}-diff --git a/crates/screenpipe-server/src/bin/screenpipe-server.rs b/crates/screenpipe-server/src/bin/screenpipe-server.rsindex 9b4f30a8c..f6c4b4630 100644--- a/crates/screenpipe-server/src/bin/screenpipe-server.rs+++ b/crates/screenpipe-server/src/bin/screenpipe-server.rs@@ -32,9 +32,7 @@ use screenpipe_server::{cli_status::handle_status_command,start_continuous_recording, start_meeting_watcher, start_sleep_monitor, start_ui_recording,sync_provider::ScreenpipeSyncProvider,- vision_manager::{- start_monitor_watcher, stop_monitor_watcher, VisionManager,- },+ vision_manager::{start_monitor_watcher, stop_monitor_watcher, VisionManager},watch_pid, ResourceMonitor, SCServer,};use screenpipe_vision::monitor::list_monitors;@@ -329,8 +327,14 @@ async fn main() -> anyhow::Result<()> {"vad_sensitivity".into(),json!(format!("{:?}", cli.vad_sensitivity)),);- map.insert("enable_input_capture".into(), json!(cli.enable_input_capture));- map.insert("enable_accessibility".into(), json!(cli.enable_accessibility));+ map.insert(+ "enable_input_capture".into(),+ json!(cli.enable_input_capture),+ );+ map.insert(+ "enable_accessibility".into(),+ json!(cli.enable_accessibility),+ );map.insert("enable_sync".into(), json!(cli.enable_sync));map.insert("sync_interval_secs".into(), json!(cli.sync_interval_secs));map.insert("debug".into(), json!(cli.debug));@@ -669,48 +673,47 @@ async fn main() -> anyhow::Result<()> {// Create VisionManager for dynamic monitor detection if enabledlet vision_manager: Option<Arc<VisionManager>> =- if config.use_all_monitors && !config.disable_vision- {+ if config.use_all_monitors && !config.disable_vision {info!("Using dynamic monitor detection (--use-all-monitors)");// Create activity feed for adaptive FPS if enabled#[cfg(feature = "adaptive-fps")]let activity_feed: screenpipe_vision::ActivityFeedOption = if config.adaptive_fps {- info!("Starting activity feed for adaptive FPS");- match screenpipe_accessibility::UiRecorder::with_defaults().start_activity_only() {- Ok(feed) => {- info!("Activity feed started successfully");- Some(feed)- }- Err(e) => {- warn!(- "Failed to start activity feed: {:?}. Adaptive FPS will be disabled.",- e- );- None+ info!("Starting activity feed for adaptive FPS");+ match screenpipe_accessibility::UiRecorder::with_defaults().start_activity_only() {+ Ok(feed) => {+ info!("Activity feed started successfully");+ Some(feed)+ }+ Err(e) => {+ warn!(+ "Failed to start activity feed: {:?}. Adaptive FPS will be disabled.",+ e+ );+ None+ }}- }+ } else {+ None+ };++ #[cfg(not(feature = "adaptive-fps"))]+ let activity_feed: screenpipe_vision::ActivityFeedOption = None;++ let vision_config = config.to_vision_manager_config(+ output_path_clone.to_string(),+ activity_feed,+ vision_metrics.clone(),+ );+ Some(Arc::new(VisionManager::new(+ vision_config,+ db_clone.clone(),+ vision_handle.clone(),+ )))} else {None};- #[cfg(not(feature = "adaptive-fps"))]- let activity_feed: screenpipe_vision::ActivityFeedOption = None;-- let vision_config = config.to_vision_manager_config(- output_path_clone.to_string(),- activity_feed,- vision_metrics.clone(),- );- Some(Arc::new(VisionManager::new(- vision_config,- db_clone.clone(),- vision_handle.clone(),- )))- } else {- None- };-let handle = if let Some(ref vm) = vision_manager {// Use VisionManager for dynamic monitor detectionlet vm_clone = vm.clone();@@ -779,7 +782,7 @@ async fn main() -> anyhow::Result<()> {&config_clone,monitor_ids_clone.clone(),&vision_handle,- activity_feed_legacy.clone(),+ activity_feed_legacy,vision_metrics_for_recording.clone(),);@@ -839,8 +842,12 @@ async fn main() -> anyhow::Result<()> {screenpipe_server::pipe_store::SqlitePipeStore::new(db.pool.clone()),));- let mut pipe_manager =- screenpipe_core::pipes::PipeManager::new(pipes_dir, agent_executors, pipe_store, config.port);+ let mut pipe_manager = screenpipe_core::pipes::PipeManager::new(+ pipes_dir,+ agent_executors,+ pipe_store,+ config.port,+ );pipe_manager.set_on_run_complete(std::sync::Arc::new(|pipe_name, success, duration_secs| {analytics::capture_event_nonblocking("pipe_scheduled_run",@@ -1121,11 +1128,9 @@ async fn main() -> anyhow::Result<()> {// Start meeting watcher (standalone accessibility listener for smart mode)// Independent of enable_input_capture/enable_accessibility — only needs accessibility permission- let _meeting_watcher_handle = if let Some(ref detector) = meeting_detector {- Some(start_meeting_watcher(detector.clone()))- } else {- None- };+ let _meeting_watcher_handle = meeting_detector+ .as_ref()+ .map(|detector| start_meeting_watcher(detector.clone()));// Start background FTS indexer (replaces synchronous INSERT triggers)let _fts_handle = screenpipe_db::fts_indexer::start_fts_indexer(db.clone());diff --git a/crates/screenpipe-server/src/cli.rs b/crates/screenpipe-server/src/cli.rsindex 4f2bfc664..f06b3059a 100644--- a/crates/screenpipe-server/src/cli.rs+++ b/crates/screenpipe-server/src/cli.rs@@ -6,10 +6,10 @@ use screenpipe_audio::{vad::{VadEngineEnum, VadSensitivity},};use screenpipe_core::Language;-use std::path::PathBuf;use screenpipe_db::CustomOcrConfig as DBCustomOcrConfig;use screenpipe_db::OcrEngine as DBOcrEngine;use screenpipe_vision::{custom_ocr::CustomOcrConfig, utils::OcrEngine as CoreOcrEngine};+use std::path::PathBuf;use std::sync::Arc;#[derive(Clone, Debug, ValueEnum, PartialEq)]@@ -342,6 +342,7 @@ impl Cli {// =============================================================================#[derive(Subcommand)]+#[allow(clippy::large_enum_variant)]pub enum Command {/// Start recording screen, audio, and optionally serve the APIRecord(RecordArgs),@@ -612,7 +613,10 @@ impl RecordArgs {}/// Convert RecordArgs into a unified RecordingConfig.- pub fn into_recording_config(self, data_dir: PathBuf) -> crate::recording_config::RecordingConfig {+ pub fn into_recording_config(+ self,+ data_dir: PathBuf,+ ) -> crate::recording_config::RecordingConfig {let languages = self.unique_languages().unwrap_or_default();crate::recording_config::RecordingConfig {fps: self.fps,diff --git a/crates/screenpipe-server/src/core.rs b/crates/screenpipe-server/src/core.rsindex 302b4515f..e56093c71 100644--- a/crates/screenpipe-server/src/core.rs+++ b/crates/screenpipe-server/src/core.rs@@ -57,7 +57,6 @@ pub async fn start_continuous_recording(let activity_feed = activity_feed.clone();let video_quality = video_quality.clone();let vision_metrics = vision_metrics.clone();- let disable_ocr = disable_ocr;debug!("Starting video recording for monitor {}", monitor_id);vision_handle.spawn(async move {diff --git a/crates/screenpipe-server/src/lib.rs b/crates/screenpipe-server/src/lib.rsindex f87c22092..23aa86af7 100644--- a/crates/screenpipe-server/src/lib.rs+++ b/crates/screenpipe-server/src/lib.rs@@ -8,21 +8,21 @@ mod apple_intelligence_api;mod auto_destruct;pub mod cli;pub mod cli_pipe;-pub mod recording_config;pub mod cli_status;pub mod cloud_search;pub mod core;pub mod logging;pub mod pipe_store;pub mod pipes_api;+pub mod recording_config;pub mod routes;+pub mod meeting_watcher;mod resource_monitor;mod server;pub mod sleep_monitor;mod sync_api;pub mod sync_provider;-pub mod meeting_watcher;pub mod ui_recorder;mod video;pub mod video_cache;@@ -31,10 +31,11 @@ pub mod vision_manager;pub use auto_destruct::watch_pid;pub use axum::Json as JsonResponse;pub use cli::Cli;-pub use recording_config::RecordingConfig;pub use core::{record_video, start_continuous_recording};+pub use recording_config::RecordingConfig;pub use cloud_search::{CloudSearchClient, CloudSearchMetadata, CloudStatus};+pub use meeting_watcher::start_meeting_watcher;pub use resource_monitor::{ResourceMonitor, RestartSignal};pub use screenpipe_core::Language;pub use server::health_check_handler as health_check;@@ -45,7 +46,6 @@ pub use server::PaginatedResponse;pub use server::SCServer;pub use server::{api_list_monitors_handler as api_list_monitors, MonitorInfo};pub use sleep_monitor::start_sleep_monitor;-pub use meeting_watcher::start_meeting_watcher;pub use ui_recorder::{start_ui_recording, UiRecorderConfig, UiRecorderHandle};pub use video::{video_quality_to_crf, video_quality_to_jpeg_q, video_quality_to_preset, FrameWriteInfo,diff --git a/crates/screenpipe-server/src/meeting_watcher.rs b/crates/screenpipe-server/src/meeting_watcher.rsindex 695ec8850..4dcd8c915 100644--- a/crates/screenpipe-server/src/meeting_watcher.rs+++ b/crates/screenpipe-server/src/meeting_watcher.rs@@ -64,7 +64,10 @@ pub fn start_meeting_watcher(detector: Arc<MeetingDetector>) -> tokio::task::Joilet handle = match recorder.start() {Ok(h) => h,Err(e) => {- error!("meeting watcher: failed to start accessibility listener: {}", e);+ error!(+ "meeting watcher: failed to start accessibility listener: {}",+ e+ );return;}};@@ -82,9 +85,7 @@ pub fn start_meeting_watcher(detector: Arc<MeetingDetector>) -> tokio::task::Joi.await;}EventData::WindowFocus { app, title } => {- detector- .on_app_switch(app, title.as_deref())- .await;+ detector.on_app_switch(app, title.as_deref()).await;}_ => {// Ignore other events — shouldn't arrive given our config@@ -93,7 +94,10 @@ pub fn start_meeting_watcher(detector: Arc<MeetingDetector>) -> tokio::task::Joi}None => {// Timeout — no events, just loop- debug!("meeting watcher: tick (in_meeting={})", detector.is_in_meeting());+ debug!(+ "meeting watcher: tick (in_meeting={})",+ detector.is_in_meeting()+ );}}}@@ -106,8 +110,6 @@ pub fn start_meeting_watcher(detector: Arc<MeetingDetector>) -> tokio::task::Joipub fn start_meeting_watcher(_detector: std::sync::Arc<screenpipe_audio::meeting_detector::MeetingDetector>,) -> tokio::task::JoinHandle<()> {- tracing::warn!(- "meeting watcher: ui-events feature disabled, meeting detection unavailable"- );+ tracing::warn!("meeting watcher: ui-events feature disabled, meeting detection unavailable");tokio::spawn(async {})}diff --git a/crates/screenpipe-server/src/routes/streaming.rs b/crates/screenpipe-server/src/routes/streaming.rsindex edacceddd..e27b94f0b 100644--- a/crates/screenpipe-server/src/routes/streaming.rs+++ b/crates/screenpipe-server/src/routes/streaming.rs@@ -235,8 +235,10 @@ async fn handle_stream_frames_socket(// Shared state for live frame polling// Stores (start_time, end_time, is_descending, last_polled_timestamp)- let active_request: Arc<Mutex<Option<(DateTime<Utc>, DateTime<Utc>, bool, DateTime<Utc>)>>> =- Arc::new(Mutex::new(None));+ #[allow(clippy::type_complexity)]+ let active_request: Arc<+ Mutex<Option<(DateTime<Utc>, DateTime<Utc>, bool, DateTime<Utc>)>>,+ > = Arc::new(Mutex::new(None));// Track sent frame IDs to avoid duplicateslet sent_frame_ids: Arc<Mutex<std::collections::HashSet<i64>>> =Arc::new(Mutex::new(std::collections::HashSet::new()));diff --git a/crates/screenpipe-server/src/server.rs b/crates/screenpipe-server/src/server.rsindex 6676e796c..a1cca3cbb 100644--- a/crates/screenpipe-server/src/server.rs+++ b/crates/screenpipe-server/src/server.rs@@ -190,10 +190,7 @@ impl SCServer {/// Start the server with a pre-bound TcpListener./// Use this when the caller needs to confirm the port is bound before proceeding.- pub async fn start_with_listener(- self,- listener: TcpListener,- ) -> Result<(), std::io::Error> {+ pub async fn start_with_listener(self, listener: TcpListener) -> Result<(), std::io::Error> {let app = self.create_router().await;info!("Server listening on {}", self.addr);@@ -301,8 +298,11 @@ impl SCServer {screenpipe_dir: self.screenpipe_dir.clone(),vision_disabled: self.vision_disabled,audio_disabled: self.audio_disabled,- frame_cache: match FrameCache::new(self.screenpipe_dir.clone().join("data"), self.db.clone())- .await+ frame_cache: match FrameCache::new(+ self.screenpipe_dir.clone().join("data"),+ self.db.clone(),+ )+ .await{Ok(cache) => Some(Arc::new(cache)),Err(e) => {diff --git a/crates/screenpipe-server/src/sync_provider.rs b/crates/screenpipe-server/src/sync_provider.rsindex 0136d439d..ac940a2da 100644--- a/crates/screenpipe-server/src/sync_provider.rs+++ b/crates/screenpipe-server/src/sync_provider.rs@@ -128,6 +128,7 @@ impl ScreenpipeSyncProvider {let pool = &self.db.pool;// Get unsynced frames+ #[allow(clippy::type_complexity)]let frames: Vec<(i64, String, i64, Option<String>, Option<String>, Option<String>, String)> = sqlx::query_as(r#"SELECT f.id, f.timestamp, f.offset_index, f.app_name, f.window_name, f.browser_url, f.device_name@@ -337,6 +338,7 @@ impl ScreenpipeSyncProvider {) -> SyncResult<Option<(SyncChunk, String, String)>> {let pool = &self.db.pool;+ #[allow(clippy::type_complexity)]let records: Vec<(i64,String,diff --git a/crates/screenpipe-server/src/video.rs b/crates/screenpipe-server/src/video.rsindex d76b99597..efbe870d9 100644--- a/crates/screenpipe-server/src/video.rs+++ b/crates/screenpipe-server/src/video.rs@@ -700,7 +700,7 @@ async fn log_ffmpeg_output(stream: impl AsyncBufReadExt + Unpin, stream_name: &s}}-#[allow(clippy::too_many_arguments)]+#[allow(clippy::too_many_arguments, clippy::type_complexity)]async fn save_frames_as_video(frame_queue: &Arc<ArrayQueue<Arc<RawCaptureResult>>>,output_path: &str,@@ -912,6 +912,7 @@ fn spawn_ffmpeg_loggers(stderr: Option<ChildStderr>, stdout: Option<ChildStdout>}}+#[allow(clippy::too_many_arguments)]async fn process_frames(frame_queue: &Arc<ArrayQueue<Arc<RawCaptureResult>>>,current_stdin: &mut Option<ChildStdin>,diff --git a/crates/screenpipe-vision/src/browser_utils/mod.rs b/crates/screenpipe-vision/src/browser_utils/mod.rsindex e32eacd20..6e31d5281 100644--- a/crates/screenpipe-vision/src/browser_utils/mod.rs+++ b/crates/screenpipe-vision/src/browser_utils/mod.rs@@ -60,7 +60,7 @@ pub fn strip_title_badge(title: &str) -> &str {let prefix = &trimmed[..pos];// If prefix is short and contains emoji + digits, strip itif prefix.chars().count() <= 5- && prefix.chars().any(|c| !c.is_ascii())+ && !prefix.is_ascii()&& prefix.chars().any(|c| c.is_ascii_digit()){return trimmed[pos + 3..].trim_start();@@ -91,10 +91,8 @@ pub fn titles_match(sck_title: &str, browser_title: &str) -> bool {}// One contains the other (handles truncation, e.g., SCK may truncate long titles)- if a.len() >= 4 && b.len() >= 4 {- if a.contains(b) || b.contains(a) {- return true;- }+ if a.len() >= 4 && b.len() >= 4 && (a.contains(b) || b.contains(a)) {+ return true;}falsediff --git a/crates/screenpipe-vision/src/utils.rs b/crates/screenpipe-vision/src/utils.rsindex 655b40268..8ce193590 100644--- a/crates/screenpipe-vision/src/utils.rs+++ b/crates/screenpipe-vision/src/utils.rs@@ -49,11 +49,17 @@ impl From<screenpipe_db::OcrEngine> for OcrEngine {impl OcrEngine {pub fn platform_default() -> Self {#[cfg(target_os = "macos")]- { Self::AppleNative }+ {+ Self::AppleNative+ }#[cfg(target_os = "windows")]- { Self::WindowsNative }+ {+ Self::WindowsNative+ }#[cfg(target_os = "linux")]- { Self::Tesseract }+ {+ Self::Tesseract+ }}}@@ -76,22 +82,34 @@ mod tests {#[test]fn ocr_engine_from_str_tesseract() {- assert!(matches!("tesseract".parse::<OcrEngine>().unwrap(), OcrEngine::Tesseract));+ assert!(matches!(+ "tesseract".parse::<OcrEngine>().unwrap(),+ OcrEngine::Tesseract+ ));}#[test]fn ocr_engine_from_str_windows_native() {- assert!(matches!("windows-native".parse::<OcrEngine>().unwrap(), OcrEngine::WindowsNative));+ assert!(matches!(+ "windows-native".parse::<OcrEngine>().unwrap(),+ OcrEngine::WindowsNative+ ));}#[test]fn ocr_engine_from_str_unstructured() {- assert!(matches!("unstructured".parse::<OcrEngine>().unwrap(), OcrEngine::Unstructured));+ assert!(matches!(+ "unstructured".parse::<OcrEngine>().unwrap(),+ OcrEngine::Unstructured+ ));}#[test]fn ocr_engine_from_str_apple_native() {- assert!(matches!("apple-native".parse::<OcrEngine>().unwrap(), OcrEngine::AppleNative));+ assert!(matches!(+ "apple-native".parse::<OcrEngine>().unwrap(),+ OcrEngine::AppleNative+ ));}#[test]@@ -99,7 +117,10 @@ mod tests {let engine = "something-else".parse::<OcrEngine>().unwrap();// platform_default varies by OS, just ensure it doesn't errorlet default = OcrEngine::platform_default();- assert_eq!(std::mem::discriminant(&engine), std::mem::discriminant(&default));+ assert_eq!(+ std::mem::discriminant(&engine),+ std::mem::discriminant(&default)+ );}}