Skip to content

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

Bump app to v2.2.269 + cargo fmt

Louis Beaumont2552d90c3b6b
diff --git a/Cargo.lock b/Cargo.lock
index dd338ae89..d71dcd5aa 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6692,7 +6692,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"anyhow",
"audiopipe",
@@ -6752,7 +6752,7 @@ dependencies = [
[[package]]
name = "screenpipe-config"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -6765,7 +6765,7 @@ dependencies = [
[[package]]
name = "screenpipe-connect"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"anyhow",
"async-trait",
@@ -6791,7 +6791,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -6836,7 +6836,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"anyhow",
"chrono",
@@ -6862,7 +6862,7 @@ dependencies = [
[[package]]
name = "screenpipe-engine"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"anyhow",
"async-trait",
@@ -6932,7 +6932,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"anyhow",
"chrono",
@@ -6950,7 +6950,7 @@ dependencies = [
[[package]]
name = "screenpipe-screen"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"accessibility-sys",
"anyhow",
@@ -6990,7 +6990,7 @@ dependencies = [
[[package]]
name = "screenpipe-vault"
-version = "0.3.232"
+version = "0.3.233"
dependencies = [
"argon2",
"chacha20poly1305",
diff --git a/crates/screenpipe-a11y/src/incognito/macos.rs b/crates/screenpipe-a11y/src/incognito/macos.rs
index 35f08ec4a..2c72aadd7 100644
--- a/crates/screenpipe-a11y/src/incognito/macos.rs
+++ b/crates/screenpipe-a11y/src/incognito/macos.rs
@@ -150,8 +150,7 @@ end if"#,
Some(HashSet::new())
}
_ => {
- let titles: HashSet<String> =
- result.split("~~~").map(|s| s.to_string()).collect();
+ let titles: HashSet<String> = result.split("~~~").map(|s| s.to_string()).collect();
debug!(
"incognito: {} has {} incognito window(s): {:?}",
as_name,
diff --git a/crates/screenpipe-a11y/src/tree/linux.rs b/crates/screenpipe-a11y/src/tree/linux.rs
index f35f6bde4..95b39ca5d 100644
--- a/crates/screenpipe-a11y/src/tree/linux.rs
+++ b/crates/screenpipe-a11y/src/tree/linux.rs
@@ -155,13 +155,17 @@ const EXCLUDED_APPS: &[&str] = &[
"screenpipe",
"nm-connection-editor",
"polkit",
- // Window managers — no user content
+ // Window managers / desktop shells — no user content
"xfwm4",
"mutter",
+ "muffin",
"kwin",
"marco",
"openbox",
"compiz",
+ "cinnamon",
+ "budgie-panel",
+ "budgie-wm",
];
/// Known browser process names for URL extraction.
diff --git a/crates/screenpipe-audio/examples/bench_engines.rs b/crates/screenpipe-audio/examples/bench_engines.rs
index 0323a0f11..e8403ff64 100644
--- a/crates/screenpipe-audio/examples/bench_engines.rs
+++ b/crates/screenpipe-audio/examples/bench_engines.rs
@@ -38,7 +38,8 @@ fn get_rss_mb() -> f64 {
}
extern "system" {
fn GetCurrentProcess() -> isize;
- fn K32GetProcessMemoryInfo(h: isize, pmc: *mut PROCESS_MEMORY_COUNTERS, cb: u32) -> i32;
+ fn K32GetProcessMemoryInfo(h: isize, pmc: *mut PROCESS_MEMORY_COUNTERS, cb: u32)
+ -> i32;
}
unsafe {
let mut pmc = MaybeUninit::<PROCESS_MEMORY_COUNTERS>::zeroed().assume_init();
@@ -80,7 +81,13 @@ where
{
extern "system" {
fn GetCurrentProcess() -> isize;
- fn GetProcessTimes(h: isize, c: *mut u64, e: *mut u64, k: *mut u64, u: *mut u64) -> i32;
+ fn GetProcessTimes(
+ h: isize,
+ c: *mut u64,
+ e: *mut u64,
+ k: *mut u64,
+ u: *mut u64,
+ ) -> i32;
}
let _ = pid;
let mut prev_kernel: u64 = 0;
@@ -92,7 +99,9 @@ where
let (mut c, mut e) = (0u64, 0u64);
GetProcessTimes(h, &mut c, &mut e, &mut prev_kernel, &mut prev_user);
}
- let num_cpus = std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1) as f64;
+ let num_cpus = std::thread::available_parallelism()
+ .map(|n| n.get())
+ .unwrap_or(1) as f64;
while !done_clone.load(std::sync::atomic::Ordering::Relaxed) {
std::thread::sleep(std::time::Duration::from_millis(200));
unsafe {
@@ -101,10 +110,12 @@ where
if GetProcessTimes(h, &mut c, &mut e, &mut k, &mut u) != 0 {
let wall_elapsed = prev_wall.elapsed().as_secs_f64();
if wall_elapsed > 0.0 {
- let cpu_delta = ((k - prev_kernel) + (u - prev_user)) as f64 / 10_000_000.0;
+ let cpu_delta =
+ ((k - prev_kernel) + (u - prev_user)) as f64 / 10_000_000.0;
let cpu_pct = (cpu_delta / wall_elapsed) * 100.0 / num_cpus;
let cpu_bits = (cpu_pct * 10.0) as u64;
- peak_cpu_clone.fetch_max(cpu_bits, std::sync::atomic::Ordering::Relaxed);
+ peak_cpu_clone
+ .fetch_max(cpu_bits, std::sync::atomic::Ordering::Relaxed);
}
prev_kernel = k;
prev_user = u;
@@ -167,15 +178,29 @@ async fn main() -> anyhow::Result<()> {
println!("║ Screenpipe Transcription Engine Benchmark ║");
println!("╚══════════════════════════════════════════════════════════════╝");
println!();
- println!("Audio: {}Hz, {:.1}s, {} samples", spec.sample_rate, duration_secs, samples.len());
+ println!(
+ "Audio: {}Hz, {:.1}s, {} samples",
+ spec.sample_rate,
+ duration_secs,
+ samples.len()
+ );
println!();
// Engines to test (local only, skip cloud/disabled)
let engines: Vec<(AudioTranscriptionEngine, &str)> = vec![
- (AudioTranscriptionEngine::WhisperLargeV3Turbo, "whisper-large-v3-turbo"),
- (AudioTranscriptionEngine::WhisperLargeV3TurboQuantized, "whisper-large-v3-turbo-q8"),
+ (
+ AudioTranscriptionEngine::WhisperLargeV3Turbo,
+ "whisper-large-v3-turbo",
+ ),
+ (
+ AudioTranscriptionEngine::WhisperLargeV3TurboQuantized,
+ "whisper-large-v3-turbo-q8",
+ ),
#[cfg(feature = "parakeet")]
- (AudioTranscriptionEngine::Parakeet, "parakeet-tdt-0.6b-v3-int8"),
+ (
+ AudioTranscriptionEngine::Parakeet,
+ "parakeet-tdt-0.6b-v3-int8",
+ ),
#[cfg(feature = "parakeet-mlx")]
(AudioTranscriptionEngine::ParakeetMlx, "parakeet-mlx (GPU)"),
#[cfg(feature = "qwen3-asr")]
@@ -205,8 +230,16 @@ async fn main() -> anyhow::Result<()> {
Err(e) => {
println!(
"│ {:<28} │ {:>8} │ {:>8} │ {:>8} │ {:>8} │ {:>8} │ {:<40} │",
- label, "FAIL", "-", "-", "-", "-",
- format!("load error: {}", &e.to_string()[..e.to_string().len().min(32)])
+ label,
+ "FAIL",
+ "-",
+ "-",
+ "-",
+ "-",
+ format!(
+ "load error: {}",
+ &e.to_string()[..e.to_string().len().min(32)]
+ )
);
continue;
}
@@ -220,8 +253,15 @@ async fn main() -> anyhow::Result<()> {
Err(e) => {
println!(
"│ {:<28} │ {:>7.1}s │ {:>8} │ {:>8} │ {:>8} │ {:<48} │",
- label, load_time, "FAIL", "-", "-",
- format!("session error: {}", &e.to_string()[..e.to_string().len().min(40)])
+ label,
+ load_time,
+ "FAIL",
+ "-",
+ "-",
+ format!(
+ "session error: {}",
+ &e.to_string()[..e.to_string().len().min(40)]
+ )
);
continue;
}
@@ -243,13 +283,14 @@ async fn main() -> anyhow::Result<()> {
for i in 0..3 {
let t0 = Instant::now();
- let (result, cpu) = with_cpu_monitor(
- session.transcribe(&samples, spec.sample_rate, "benchmark")
- ).await;
+ let (result, cpu) =
+ with_cpu_monitor(session.transcribe(&samples, spec.sample_rate, "benchmark")).await;
match result {
Ok(text) => {
times.push(t0.elapsed().as_secs_f64());
- if cpu > peak_cpu { peak_cpu = cpu; }
+ if cpu > peak_cpu {
+ peak_cpu = cpu;
+ }
if i == 0 {
transcript = text;
}
@@ -269,7 +310,12 @@ async fn main() -> anyhow::Result<()> {
if times.is_empty() {
println!(
"│ {:<28} │ {:>7.1}s │ {:>8} │ {:>8} │ {:>8} │ {:>7.0}MB │ {:<40} │",
- label, load_time, "FAIL", "-", "-", mem_delta,
+ label,
+ load_time,
+ "FAIL",
+ "-",
+ "-",
+ mem_delta,
&transcript[..transcript.len().min(40)]
);
} else {
diff --git a/crates/screenpipe-audio/examples/bench_parakeet.rs b/crates/screenpipe-audio/examples/bench_parakeet.rs
index 6673b1fc7..3f5a73dbe 100644
--- a/crates/screenpipe-audio/examples/bench_parakeet.rs
+++ b/crates/screenpipe-audio/examples/bench_parakeet.rs
@@ -17,10 +17,16 @@ fn get_rss_mb() -> f64 {
#[repr(C)]
#[allow(non_snake_case)]
struct PMC {
- cb: u32, PageFaultCount: u32, PeakWorkingSetSize: usize, WorkingSetSize: usize,
- QuotaPeakPagedPoolUsage: usize, QuotaPagedPoolUsage: usize,
- QuotaPeakNonPagedPoolUsage: usize, QuotaNonPagedPoolUsage: usize,
- PagefileUsage: usize, PeakPagefileUsage: usize,
+ cb: u32,
+ PageFaultCount: u32,
+ PeakWorkingSetSize: usize,
+ WorkingSetSize: usize,
+ QuotaPeakPagedPoolUsage: usize,
+ QuotaPagedPoolUsage: usize,
+ QuotaPeakNonPagedPoolUsage: usize,
+ QuotaNonPagedPoolUsage: usize,
+ PagefileUsage: usize,
+ PeakPagefileUsage: usize,
}
extern "system" {
fn GetCurrentProcess() -> isize;
@@ -31,7 +37,9 @@ fn get_rss_mb() -> f64 {
pmc.cb = std::mem::size_of::<PMC>() as u32;
if K32GetProcessMemoryInfo(GetCurrentProcess(), &mut pmc, pmc.cb) != 0 {
pmc.WorkingSetSize as f64 / (1024.0 * 1024.0)
- } else { 0.0 }
+ } else {
+ 0.0
+ }
}
}
@@ -41,7 +49,9 @@ async fn main() -> anyhow::Result<()> {
.with_env_filter("warn,audiopipe=info,screenpipe_audio=info")
.init();
- let wav_path = std::env::args().nth(1).expect("usage: bench_parakeet <audio.wav>");
+ let wav_path = std::env::args()
+ .nth(1)
+ .expect("usage: bench_parakeet <audio.wav>");
// Read WAV
let mut reader = hound::WavReader::open(&wav_path)?;
@@ -49,12 +59,21 @@ async fn main() -> anyhow::Result<()> {
let samples: Vec<f32> = if spec.sample_format == hound::SampleFormat::Float {
reader.samples::<f32>().filter_map(|s| s.ok()).collect()
} else {
- reader.samples::<i16>().filter_map(|s| s.ok()).map(|s| s as f32 / 32768.0).collect()
+ reader
+ .samples::<i16>()
+ .filter_map(|s| s.ok())
+ .map(|s| s as f32 / 32768.0)
+ .collect()
};
let duration_secs = samples.len() as f64 / spec.sample_rate as f64;
println!("\n=== Parakeet Benchmark ===");
- println!("Audio: {}Hz, {:.1}s, {} samples\n", spec.sample_rate, duration_secs, samples.len());
+ println!(
+ "Audio: {}Hz, {:.1}s, {} samples\n",
+ spec.sample_rate,
+ duration_secs,
+ samples.len()
+ );
let mem_before = get_rss_mb();
println!("Memory before load: {:.0} MB", mem_before);
@@ -63,14 +82,20 @@ async fn main() -> anyhow::Result<()> {
let t_load = Instant::now();
let engine = TranscriptionEngine::new(
Arc::new(AudioTranscriptionEngine::Parakeet),
- None, None,
+ None,
+ None,
vec![Language::English],
vec![],
- ).await?;
+ )
+ .await?;
let load_time = t_load.elapsed().as_secs_f64();
let mem_after_load = get_rss_mb();
println!("Load time: {:.1}s", load_time);
- println!("Memory after load: {:.0} MB (delta: {:.0} MB)\n", mem_after_load, mem_after_load - mem_before);
+ println!(
+ "Memory after load: {:.0} MB (delta: {:.0} MB)\n",
+ mem_after_load,
+ mem_after_load - mem_before
+ );
// Create session
let mut session = engine.create_session()?;
@@ -78,24 +103,34 @@ async fn main() -> anyhow::Result<()> {
// Warmup (short clip)
println!("Warming up...");
let warmup_samples = &samples[..samples.len().min(16000 * 3)];
- let _ = session.transcribe(warmup_samples, spec.sample_rate, "bench").await;
+ let _ = session
+ .transcribe(warmup_samples, spec.sample_rate, "bench")
+ .await;
let mem_after_warmup = get_rss_mb();
println!("Memory after warmup: {:.0} MB\n", mem_after_warmup);
// Benchmark: 3 runs
- println!("Running 3 transcription passes on {:.1}s audio...\n", duration_secs);
+ println!(
+ "Running 3 transcription passes on {:.1}s audio...\n",
+ duration_secs
+ );
let mut times = Vec::new();
let mut transcript = String::new();
for i in 0..3 {
let t0 = Instant::now();
- match session.transcribe(&samples, spec.sample_rate, "bench").await {
+ match session
+ .transcribe(&samples, spec.sample_rate, "bench")
+ .await
+ {
Ok(text) => {
let elapsed = t0.elapsed().as_secs_f64();
let rtf = elapsed / duration_secs;
println!(" Run {}: {:.2}s (RTF: {:.3}x)", i + 1, elapsed, rtf);
times.push(elapsed);
- if i == 0 { transcript = text; }
+ if i == 0 {
+ transcript = text;
+ }
}
Err(e) => {
println!(" Run {}: ERROR: {}", i + 1, e);
@@ -111,9 +146,21 @@ async fn main() -> anyhow::Result<()> {
let avg = times.iter().sum::<f64>() / times.len() as f64;
let rtf = avg / duration_secs;
println!("Avg transcription: {:.2}s", avg);
- println!("Avg RTF: {:.3}x ({})", rtf, if rtf < 1.0 { "faster than real-time" } else { "slower than real-time" });
+ println!(
+ "Avg RTF: {:.3}x ({})",
+ rtf,
+ if rtf < 1.0 {
+ "faster than real-time"
+ } else {
+ "slower than real-time"
+ }
+ );
}
- println!("Peak memory: {:.0} MB (delta from baseline: {:.0} MB)", mem_final, mem_final - mem_before);
+ println!(
+ "Peak memory: {:.0} MB (delta from baseline: {:.0} MB)",
+ mem_final,
+ mem_final - mem_before
+ );
println!("\nTranscript:\n---\n{}\n---", transcript);
Ok(())
diff --git a/crates/screenpipe-audio/examples/bench_quality.rs b/crates/screenpipe-audio/examples/bench_quality.rs
index 23def02b3..fd829a8d4 100644
--- a/crates/screenpipe-audio/examples/bench_quality.rs
+++ b/crates/screenpipe-audio/examples/bench_quality.rs
@@ -28,17 +28,29 @@ fn word_error_rate(reference: &str, hypothesis: &str) -> (f64, usize, usize) {
// DP matrix
let mut d = vec![vec![0usize; h + 1]; r + 1];
- for i in 0..=r { d[i][0] = i; }
- for j in 0..=h { d[0][j] = j; }
+ for i in 0..=r {
+ d[i][0] = i;
+ }
+ for j in 0..=h {
+ d[0][j] = j;
+ }
for i in 1..=r {
for j in 1..=h {
- let cost = if ref_words[i-1].to_lowercase() == hyp_words[j-1].to_lowercase() { 0 } else { 1 };
- d[i][j] = (d[i-1][j] + 1) // deletion
- .min(d[i][j-1] + 1) // insertion
- .min(d[i-1][j-1] + cost); // substitution
+ let cost = if ref_words[i - 1].to_lowercase() == hyp_words[j - 1].to_lowercase() {
+ 0
+ } else {
+ 1
+ };
+ d[i][j] = (d[i - 1][j] + 1) // deletion
+ .min(d[i][j - 1] + 1) // insertion
+ .min(d[i - 1][j - 1] + cost); // substitution
}
}
- let wer = if r > 0 { d[r][h] as f64 / r as f64 } else { 0.0 };
+ let wer = if r > 0 {
+ d[r][h] as f64 / r as f64
+ } else {
+ 0.0
+ };
(wer, d[r][h], r)
}
@@ -47,7 +59,11 @@ fn char_accuracy(reference: &str, hypothesis: &str) -> f64 {
let r = reference.to_lowercase();
let h = hypothesis.to_lowercase();
let dist = strsim_levenshtein(&r, &h);
- if r.len() > 0 { 1.0 - (dist as f64 / r.len() as f64) } else { 1.0 }
+ if r.len() > 0 {
+ 1.0 - (dist as f64 / r.len() as f64)
+ } else {
+ 1.0
+ }
}
fn strsim_levenshtein(a: &str, b: &str) -> usize {
@@ -55,12 +71,18 @@ fn strsim_levenshtein(a: &str, b: &str) -> usize {
let b: Vec<char> = b.chars().collect();
let (m, n) = (a.len(), b.len());
let mut dp = vec![vec![0usize; n + 1]; m + 1];
- for i in 0..=m { dp[i][0] = i; }
- for j in 0..=n { dp[0][j] = j; }
+ for i in 0..=m {
+ dp[i][0] = i;
+ }
+ for j in 0..=n {
+ dp[0][j] = j;
+ }
for i in 1..=m {
for j in 1..=n {
- let cost = if a[i-1] == b[j-1] { 0 } else { 1 };
- dp[i][j] = (dp[i-1][j] + 1).min(dp[i][j-1] + 1).min(dp[i-1][j-1] + cost);
+ let cost = if a[i - 1] == b[j - 1] { 0 } else { 1 };
+ dp[i][j] = (dp[i - 1][j] + 1)
+ .min(dp[i][j - 1] + 1)
+ .min(dp[i - 1][j - 1] + cost);
}
}
dp[m][n]
@@ -71,33 +93,39 @@ fn read_wav(path: &std::path::Path) -> anyhow::Result<(Vec<f32>, u32)> {
let mut reader = hound::WavReader::open(path)?;
let spec = reader.spec();
let samples: Vec<f32> = match (spec.sample_format, spec.bits_per_sample) {
- (hound::SampleFormat::Float, _) => {
- reader.samples::<f32>().filter_map(|s| s.ok()).collect()
- }
- (hound::SampleFormat::Int, 16) => {
- reader.samples::<i16>().filter_map(|s| s.ok())
- .map(|s| s as f32 / 32768.0).collect()
- }
- (hound::SampleFormat::Int, 24) => {
- reader.samples::<i32>().filter_map(|s| s.ok())
- .map(|s| s as f32 / 8388608.0).collect()
- }
- (hound::SampleFormat::Int, 32) => {
- reader.samples::<i32>().filter_map(|s| s.ok())
- .map(|s| s as f32 / 2147483648.0).collect()
- }
- _ => {
- reader.samples::<i16>().filter_map(|s| s.ok())
- .map(|s| s as f32 / 32768.0).collect()
- }
+ (hound::SampleFormat::Float, _) => reader.samples::<f32>().filter_map(|s| s.ok()).collect(),
+ (hound::SampleFormat::Int, 16) => reader
+ .samples::<i16>()
+ .filter_map(|s| s.ok())
+ .map(|s| s as f32 / 32768.0)
+ .collect(),
+ (hound::SampleFormat::Int, 24) => reader
+ .samples::<i32>()
+ .filter_map(|s| s.ok())
+ .map(|s| s as f32 / 8388608.0)
+ .collect(),
+ (hound::SampleFormat::Int, 32) => reader
+ .samples::<i32>()
+ .filter_map(|s| s.ok())
+ .map(|s| s as f32 / 2147483648.0)
+ .collect(),
+ _ => reader
+ .samples::<i16>()
+ .filter_map(|s| s.ok())
+ .map(|s| s as f32 / 32768.0)
+ .collect(),
};
Ok((samples, spec.sample_rate))
}
/// LCS dedup for overlap merging (same as in engine.rs)
fn longest_common_word_substring(s1: &str, s2: &str) -> Option<(usize, usize, usize)> {
- let s1 = s1.to_lowercase().replace(|c: char| c.is_ascii_punctuation(), "");
- let s2 = s2.to_lowercase().replace(|c: char| c.is_ascii_punctuation(), "");
+ let s1 = s1
+ .to_lowercase()
+ .replace(|c: char| c.is_ascii_punctuation(), "");
+ let s2 = s2
+ .to_lowercase()
+ .replace(|c: char| c.is_ascii_punctuation(), "");
let s1_words: Vec<&str> = s1.split_whitespace().collect();
let s2_words: Vec<&str> = s2.split_whitespace().collect();
let (s1_len, s2_len) = (s1_words.len(), s2_words.len());
@@ -107,8 +135,8 @@ fn longest_common_word_substring(s1: &str, s2: &str) -> Option<(usize, usize, us
let mut max_j = None;
for i in 1..=s1_len {
for j in 1..=s2_len {
- if s1_words[i-1] == s2_words[j-1] {
- dp[i][j] = dp[i-1][j-1] + 1;
+ if s1_words[i - 1] == s2_words[j - 1] {
+ dp[i][j] = dp[i - 1][j - 1] + 1;
if dp[i][j] > max_len {
max_len = dp[i][j];
max_i = Some(i - max_len);
@@ -134,7 +162,11 @@ fn transcribe_chunked(
) -> String {
let chunk_samples = sample_rate as usize * chunk_secs;
let overlap_samples = sample_rate as usize * overlap_secs;
- let step = if overlap_samples < chunk_samples { chunk_samples - overlap_samples } else { chunk_samples };
+ let step = if overlap_samples < chunk_samples {
+ chunk_samples - overlap_samples
+ } else {
+ chunk_samples
+ };
let opts = audiopipe::TranscribeOptions {
language: lang.map(|s| s.to_string()),
@@ -142,7 +174,8 @@ fn transcribe_chunked(
};
if audio.len() <= chunk_samples {
- return engine.transcribe_with_sample_rate(audio, sample_rate, opts)
+ return engine
+ .transcribe_with_sample_rate(audio, sample_rate, opts)
.map(|r| r.text)
.unwrap_or_default();
}
@@ -157,7 +190,9 @@ fn transcribe_chunked(
word_timestamps: false,
};
let result = engine.transcribe_with_sample_rate(chunk, sample_rate, opts);
- let text = result.map(|r| r.text.trim().to_string()).unwrap_or_default();
+ let text = result
+ .map(|r| r.text.trim().to_string())
+ .unwrap_or_default();
if !text.is_empty() {
if overlap_secs > 0 {
@@ -182,7 +217,9 @@ fn transcribe_chunked(
texts.push(text);
}
}
- if end >= audio.len() { break; }
+ if end >= audio.len() {
+ break;
+ }
offset += step;
}
texts.join(" ")
@@ -240,10 +277,12 @@ async fn main() -> anyhow::Result<()> {
let t0 = Instant::now();
let te = TranscriptionEngine::new(
Arc::new(AudioTranscriptionEngine::Parakeet),
- None, None,
+ None,
+ None,
vec![Language::English],
vec![],
- ).await?;
+ )
+ .await?;
println!("Model loaded in {:.1}s\n", t0.elapsed().as_secs_f64());
// Use audiopipe directly for fine-grained control over transcription options
@@ -258,19 +297,67 @@ async fn main() -> anyhow::Result<()> {
lang: Option<&'static str>,
}
let configs = vec![
- Config { label: "full-audio (no chunk)", chunk_secs: 9999, overlap_secs: 0, lang: None },
- Config { label: "30s/0s overlap, auto-lang", chunk_secs: 30, overlap_secs: 0, lang: None },
- Config { label: "30s/1s overlap, auto-lang", chunk_secs: 30, overlap_secs: 1, lang: None },
- Config { label: "30s/2s overlap, auto-lang", chunk_secs: 30, overlap_secs: 2, lang: None },
- Config { label: "30s/1s overlap, lang=en", chunk_secs: 30, overlap_secs: 1, lang: Some("en") },
- Config { label: "25s/1s overlap, auto-lang", chunk_secs: 25, overlap_secs: 1, lang: None },
- Config { label: "40s/1s overlap, auto-lang", chunk_secs: 40, overlap_secs: 1, lang: None },
- Config { label: "30s/3s overlap, auto-lang", chunk_secs: 30, overlap_secs: 3, lang: None },
- Config { label: "20s/1s overlap, auto-lang", chunk_secs: 20, overlap_secs: 1, lang: None },
+ Config {
+ label: "full-audio (no chunk)",
+ chunk_secs: 9999,
+ overlap_secs: 0,
+ lang: None,
+ },
+ Config {
+ label: "30s/0s overlap, auto-lang",
+ chunk_secs: 30,
+ overlap_secs: 0,
+ lang: None,
+ },
+ Config {
+ label: "30s/1s overlap, auto-lang",
+ chunk_secs: 30,
+ overlap_secs: 1,
+ lang: None,
+ },
+ Config {
+ label: "30s/2s overlap, auto-lang",
+ chunk_secs: 30,
+ overlap_secs: 2,
+ lang: None,
+ },
+ Config {
+ label: "30s/1s overlap, lang=en",
+ chunk_secs: 30,
+ overlap_secs: 1,
+ lang: Some("en"),
+ },
+ Config {
+ label: "25s/1s overlap, auto-lang",
+ chunk_secs: 25,
+ overlap_secs: 1,
+ lang: None,
+ },
+ Config {
+ label: "40s/1s overlap, auto-lang",
+ chunk_secs: 40,
+ overlap_secs: 1,
+ lang: None,
+ },
+ Config {
+ label: "30s/3s overlap, auto-lang",
+ chunk_secs: 30,
+ overlap_secs: 3,
+ lang: None,
+ },
+ Config {
+ label: "20s/1s overlap, auto-lang",
+ chunk_secs: 20,
+ overlap_secs: 1,
+ lang: None,
+ },
];
// Results table
- println!("{:<35} {:>6} {:>6} {:>7} {:>7}", "Config", "WER%", "ChrAc%", "Time", "Notes");
+ println!(
+ "{:<35} {:>6} {:>6} {:>7} {:>7}",
+ "Config", "WER%", "ChrAc%", "Time", "Notes"
+ );
println!("{}", "-".repeat(70));
for config in &configs {
@@ -293,8 +380,12 @@ async fn main() -> anyhow::Result<()> {
let t = Instant::now();
let transcript = transcribe_chunked(
- &mut model, &samples, sr,
- config.chunk_secs, config.overlap_secs, config.lang,
+ &mut model,
+ &samples,
+ sr,
+ config.chunk_secs,
+ config.overlap_secs,
+ config.lang,
);
total_time += t.elapsed().as_secs_f64();
@@ -310,7 +401,10 @@ async fn main() -> anyhow::Result<()> {
let avg_ca = total_char_acc / n * 100.0;
let note = format!("{}short/{}chunked", n_short, n_chunked);
- println!("{:<35} {:>5.1}% {:>5.1}% {:>6.1}s {}", config.label, avg_wer, avg_ca, total_time, note);
+ println!(
+ "{:<35} {:>5.1}% {:>5.1}% {:>6.1}s {}",
+ config.label, avg_wer, avg_ca, total_time, note
+ );
}
// Detailed per-file results for the current production config (30s/1s)
@@ -321,15 +415,18 @@ async fn main() -> anyhow::Result<()> {
let (samples, sr) = read_wav(&audio_path)?;
let dur = samples.len() as f64 / sr as f64;
- let transcript = transcribe_chunked(
- &mut model, &samples, sr, 30, 1, None,
- );
+ let transcript = transcribe_chunked(&mut model, &samples, sr, 30, 1, None);
let (wer, edits, ref_len) = word_error_rate(tc.reference, &transcript);
let ca = char_accuracy(tc.reference, &transcript);
println!("--- {} ({:.1}s) ---", tc.name, dur);
- println!(" WER: {:.1}% ({} edits / {} ref words)", wer * 100.0, edits, ref_len);
+ println!(
+ " WER: {:.1}% ({} edits / {} ref words)",
+ wer * 100.0,
+ edits,
+ ref_len
+ );
println!(" ChrAcc: {:.1}%", ca * 100.0);
println!(" Ref: {}...", &tc.reference[..80.min(tc.reference.len())]);
println!(" Got: {}...", &transcript[..80.min(transcript.len())]);
diff --git a/crates/screenpipe-audio/examples/bench_quality2.rs b/crates/screenpipe-audio/examples/bench_quality2.rs
index dac70e4f3..bba49b7ca 100644
--- a/crates/screenpipe-audio/examples/bench_quality2.rs
+++ b/crates/screenpipe-audio/examples/bench_quality2.rs
@@ -27,21 +27,22 @@ fn read_wav(path: &Path) -> anyhow::Result<(Vec<f32>, u32)> {
let mut reader = hound::WavReader::open(path)?;
let spec = reader.spec();
let samples: Vec<f32> = match (spec.sample_format, spec.bits_per_sample) {
- (hound::SampleFormat::Float, _) => {
- reader.samples::<f32>().filter_map(|s| s.ok()).collect()
- }
- (hound::SampleFormat::Int, 32) => {
- reader.samples::<i32>().filter_map(|s| s.ok())
- .map(|s| s as f32 / 2147483648.0).collect()
- }
- (hound::SampleFormat::Int, 24) => {
- reader.samples::<i32>().filter_map(|s| s.ok())
- .map(|s| s as f32 / 8388608.0).collect()
- }
- _ => {
- reader.samples::<i16>().filter_map(|s| s.ok())
- .map(|s| s as f32 / 32768.0).collect()
- }
+ (hound::SampleFormat::Float, _) => reader.samples::<f32>().filter_map(|s| s.ok()).collect(),
+ (hound::SampleFormat::Int, 32) => reader
+ .samples::<i32>()
+ .filter_map(|s| s.ok())
+ .map(|s| s as f32 / 2147483648.0)
+ .collect(),
+ (hound::SampleFormat::Int, 24) => reader
+ .samples::<i32>()
+ .filter_map(|s| s.ok())
+ .map(|s| s as f32 / 8388608.0)
+ .collect(),
+ _ => reader
+ .samples::<i16>()
+ .filter_map(|s| s.ok())
+ .map(|s| s as f32 / 32768.0)
+ .collect(),
};
Ok((samples, spec.sample_rate))
}
@@ -49,20 +50,40 @@ fn read_wav(path: &Path) -> anyhow::Result<(Vec<f32>, u32)> {
// ─── Metrics ────────────────────────────────────────────────────────────────
fn word_error_rate(reference: &str, hypothesis: &str) -> (f64, usize, usize) {
- let ref_words: Vec<String> = reference.split_whitespace().map(|w| w.to_lowercase()).collect();
- let hyp_words: Vec<String> = hypothesis.split_whitespace().map(|w| w.to_lowercase()).collect();
+ let ref_words: Vec<String> = reference
+ .split_whitespace()
+ .map(|w| w.to_lowercase())
+ .collect();
+ let hyp_words: Vec<String> = hypothesis
+ .split_whitespace()
+ .map(|w| w.to_lowercase())
+ .collect();
let r = ref_words.len();
let h = hyp_words.len();
let mut d = vec![vec![0usize; h + 1]; r + 1];
- for i in 0..=r { d[i][0] = i; }
- for j in 0..=h { d[0][j] = j; }
+ for i in 0..=r {
+ d[i][0] = i;
+ }
+ for j in 0..=h {
+ d[0][j] = j;
+ }
for i in 1..=r {
for j in 1..=h {
- let cost = if ref_words[i-1] == hyp_words[j-1] { 0 } else { 1 };
- d[i][j] = (d[i-1][j] + 1).min(d[i][j-1] + 1).min(d[i-1][j-1] + cost);
+ let cost = if ref_words[i - 1] == hyp_words[j - 1] {
+ 0
+ } else {
+ 1
+ };
+ d[i][j] = (d[i - 1][j] + 1)
+ .min(d[i][j - 1] + 1)
+ .min(d[i - 1][j - 1] + cost);
}
}
- let wer = if r > 0 { d[r][h] as f64 / r as f64 } else { 0.0 };
+ let wer = if r > 0 {
+ d[r][h] as f64 / r as f64
+ } else {
+ 0.0
+ };
(wer, d[r][h], r)
}
@@ -71,31 +92,45 @@ fn char_accuracy(reference: &str, hypothesis: &str) -> f64 {
let h: Vec<char> = hypothesis.to_lowercase().chars().collect();
let (m, n) = (r.len(), h.len());
let mut dp = vec![vec![0usize; n + 1]; m + 1];
- for i in 0..=m { dp[i][0] = i; }
- for j in 0..=n { dp[0][j] = j; }
+ for i in 0..=m {
+ dp[i][0] = i;
+ }
+ for j in 0..=n {
+ dp[0][j] = j;
+ }
for i in 1..=m {
for j in 1..=n {
- let cost = if r[i-1] == h[j-1] { 0 } else { 1 };
- dp[i][j] = (dp[i-1][j] + 1).min(dp[i][j-1] + 1).min(dp[i-1][j-1] + cost);
+ let cost = if r[i - 1] == h[j - 1] { 0 } else { 1 };
+ dp[i][j] = (dp[i - 1][j] + 1)
+ .min(dp[i][j - 1] + 1)
+ .min(dp[i - 1][j - 1] + cost);
}
}
- if m > 0 { 1.0 - (dp[m][n] as f64 / m as f64) } else { 1.0 }
+ if m > 0 {
+ 1.0 - (dp[m][n] as f64 / m as f64)
+ } else {
+ 1.0
+ }
}
// ─── Resampling ─────────────────────────────────────────────────────────────
fn resample_linear(audio: &[f32], from_sr: u32, to_sr: u32) -> Vec<f32> {
- if from_sr == to_sr { return audio.to_vec(); }
+ if from_sr == to_sr {
+ return audio.to_vec();
+ }
let ratio = from_sr as f64 / to_sr as f64;
let out_len = (audio.len() as f64 / ratio) as usize;
- (0..out_len).map(|i| {
- let src_pos = i as f64 * ratio;
- let idx = src_pos as usize;
- let frac = (src_pos - idx as f64) as f32;
- let a = audio[idx.min(audio.len() - 1)];
- let b = audio[(idx + 1).min(audio.len() - 1)];
- a + frac * (b - a)
- }).collect()
+ (0..out_len)
+ .map(|i| {
+ let src_pos = i as f64 * ratio;
+ let idx = src_pos as usize;
+ let frac = (src_pos - idx as f64) as f32;
+ let a = audio[idx.min(audio.len() - 1)];
+ let b = audio[(idx + 1).min(audio.len() - 1)];
+ a + frac * (b - a)
+ })
+ .collect()
}
// ─── Peak normalize ─────────────────────────────────────────────────────────
@@ -113,8 +148,12 @@ fn peak_normalize(audio: &[f32]) -> Vec<f32> {
// ─── LCS dedup ──────────────────────────────────────────────────────────────
fn lcs_dedup(s1: &str, s2: &str) -> Option<(usize, usize, usize)> {
- let s1 = s1.to_lowercase().replace(|c: char| c.is_ascii_punctuation(), "");
- let s2 = s2.to_lowercase().replace(|c: char| c.is_ascii_punctuation(), "");
+ let s1 = s1
+ .to_lowercase()
+ .replace(|c: char| c.is_ascii_punctuation(), "");
+ let s2 = s2
+ .to_lowercase()
+ .replace(|c: char| c.is_ascii_punctuation(), "");
let w1: Vec<&str> = s1.split_whitespace().collect();
let w2: Vec<&str> = s2.split_whitespace().collect();
let (n1, n2) = (w1.len(), w2.len());
@@ -122,13 +161,21 @@ fn lcs_dedup(s1: &str, s2: &str) -> Option<(usize, usize, usize)> {
let (mut ml, mut mi, mut mj) = (0, 0, 0);
for i in 1..=n1 {
for j in 1..=n2 {
- if w1[i-1] == w2[j-1] {
- dp[i][j] = dp[i-1][j-1] + 1;
- if dp[i][j] > ml { ml = dp[i][j]; mi = i - ml; mj = j - ml; }
+ if w1[i - 1] == w2[j - 1] {
+ dp[i][j] = dp[i - 1][j - 1] + 1;
+ if dp[i][j] > ml {
+ ml = dp[i][j];
+ mi = i - ml;
+ mj = j - ml;
+ }
}
}
}
- if ml > 0 { Some((mi, mj, ml)) } else { None }
+ if ml > 0 {
+ Some((mi, mj, ml))
+ } else {
+ None
+ }
}
// ─── VAD segmentation ───────────────────────────────────────────────────────
@@ -143,7 +190,9 @@ async fn vad_segment(audio: &[f32], sr: u32) -> Vec<(usize, usize)> {
let mut speech_start = 0;
for (i, chunk) in audio.chunks(chunk_size).enumerate() {
- if chunk.len() < chunk_size { break; }
+ if chunk.len() < chunk_size {
+ break;
+ }
let is_speech = vad.is_voice_segment(chunk).unwrap_or(false);
if is_speech && !in_speech {
speech_start = i * chunk_size;
@@ -171,7 +220,9 @@ fn merge_and_cut_segments(
max_chunk_samples: usize,
sr: u32,
) -> Vec<(usize, usize)> {
- if segments.is_empty() { return vec![]; }
+ if segments.is_empty() {
+ return vec![];
+ }
// Phase 1: Merge short adjacent segments
let mut merged: Vec<(usize, usize)> = Vec::new();
@@ -226,8 +277,12 @@ fn merge_and_cut_segments(
// ─── Transcription strategies ───────────────────────────────────────────────
fn transcribe_full(model: &mut audiopipe::Model, audio: &[f32], sr: u32) -> String {
- let opts = audiopipe::TranscribeOptions { language: None, word_timestamps: false };
- model.transcribe_with_sample_rate(audio, sr, opts)
+ let opts = audiopipe::TranscribeOptions {
+ language: None,
+ word_timestamps: false,
+ };
+ model
+ .transcribe_with_sample_rate(audio, sr, opts)
.map(|r| r.text.trim().to_string())
.unwrap_or_default()
}
@@ -252,8 +307,12 @@ fn transcribe_fixed_chunks(
while offset < audio.len() {
let end = (offset + chunk_samples).min(audio.len());
let chunk = &audio[offset..end];
- let opts = audiopipe::TranscribeOptions { language: None, word_timestamps: false };
- let text = model.transcribe_with_sample_rate(chunk, sr, opts)
+ let opts = audiopipe::TranscribeOptions {
+ language: None,
+ word_timestamps: false,
+ };
+ let text = model
+ .transcribe_with_sample_rate(chunk, sr, opts)
.map(|r| r.text.trim().to_string())
.unwrap_or_default();
@@ -278,7 +337,9 @@ fn transcribe_fixed_chunks(
texts.push(text);
}
}
- if end >= audio.len() { break; }
+ if end >= audio.len() {
+ break;
+ }
offset += step;
}
texts.join(" ")
@@ -294,9 +355,15 @@ fn transcribe_vad_segments(
let mut texts: Vec<String> = Vec::new();
for &(s, e) in segments {
let chunk = &audio[s..e];
- if chunk.len() < sr as usize / 5 { continue; } // skip < 200ms
- let opts = audiopipe::TranscribeOptions { language: None, word_timestamps: false };
- let text = model.transcribe_with_sample_rate(chunk, sr, opts)
+ if chunk.len() < sr as usize / 5 {
+ continue;
+ } // skip < 200ms
+ let opts = audiopipe::TranscribeOptions {
+ language: None,
+ word_timestamps: false,
+ };
+ let text = model
+ .transcribe_with_sample_rate(chunk, sr, opts)
.map(|r| r.text.trim().to_string())
.unwrap_or_default();
if !text.is_empty() {
@@ -316,10 +383,16 @@ fn get_rss_mb() -> f64 {
#[repr(C)]
#[allow(non_snake_case)]
struct PMC {
- cb: u32, PageFaultCount: u32, PeakWorkingSetSize: usize, WorkingSetSize: usize,
- QuotaPeakPagedPoolUsage: usize, QuotaPagedPoolUsage: usize,
- QuotaPeakNonPagedPoolUsage: usize, QuotaNonPagedPoolUsage: usize,
- PagefileUsage: usize, PeakPagefileUsage: usize,
+ cb: u32,
+ PageFaultCount: u32,
+ PeakWorkingSetSize: usize,
+ WorkingSetSize: usize,
+ QuotaPeakPagedPoolUsage: usize,
+ QuotaPagedPoolUsage: usize,
+ QuotaPeakNonPagedPoolUsage: usize,
+ QuotaNonPagedPoolUsage: usize,
+ PagefileUsage: usize,
+ PeakPagefileUsage: usize,
}
extern "system" {
fn GetCurrentProcess() -> isize;
@@ -330,7 +403,9 @@ fn get_rss_mb() -> f64 {
pmc.cb = std::mem::size_of::<PMC>() as u32;
if K32GetProcessMemoryInfo(GetCurrentProcess(), &mut pmc, pmc.cb) != 0 {
pmc.WorkingSetSize as f64 / (1024.0 * 1024.0)
- } else { 0.0 }
+ } else {
+ 0.0
+ }
}
}
@@ -395,18 +470,27 @@ async fn main() -> anyhow::Result<()> {
let chunk = &poetic_16k[..n];
let mem_before = get_rss_mb();
let t = Instant::now();
- let opts = audiopipe::TranscribeOptions { language: None, word_timestamps: false };
+ let opts = audiopipe::TranscribeOptions {
+ language: None,
+ word_timestamps: false,
+ };
match model.transcribe(chunk, opts) {
Ok(r) => {
let elapsed = t.elapsed().as_secs_f64();
let mem_delta = get_rss_mb() - mem_before;
let words = r.text.split_whitespace().count();
- println!(" {}s: OK {:.2}s {}w mem_delta={:.0}MB", secs, elapsed, words, mem_delta);
+ println!(
+ " {}s: OK {:.2}s {}w mem_delta={:.0}MB",
+ secs, elapsed, words, mem_delta
+ );
}
Err(e) => {
let elapsed = t.elapsed().as_secs_f64();
let mem_delta = get_rss_mb() - mem_before;
- println!(" {}s: ERR {:.2}s mem_delta={:.0}MB {}", secs, elapsed, mem_delta, e);
+ println!(
+ " {}s: ERR {:.2}s mem_delta={:.0}MB {}",
+ secs, elapsed, mem_delta, e
+ );
}
}
}
@@ -422,21 +506,59 @@ async fn main() -> anyhow::Result<()> {
}
enum StrategyKind {
Full,
- Fixed { chunk_secs: usize, overlap_secs: usize },
- Vad { max_chunk_secs: usize },
- FixedNormalized { chunk_secs: usize, overlap_secs: usize },
+ Fixed {
+ chunk_secs: usize,
+ overlap_secs: usize,
+ },
+ Vad {
+ max_chunk_secs: usize,
+ },
+ FixedNormalized {
+ chunk_secs: usize,
+ overlap_secs: usize,
+ },
}
let strategies = vec![
- Strategy { name: "A: full audio (baseline)", kind: StrategyKind::Full },
- Strategy { name: "B: 30s fixed, 0s overlap", kind: StrategyKind::Fixed { chunk_secs: 30, overlap_secs: 0 } },
- Strategy { name: "C: 30s fixed, 1s overlap+LCS", kind: StrategyKind::Fixed { chunk_secs: 30, overlap_secs: 1 } },
- Strategy { name: "D: VAD split, max 30s", kind: StrategyKind::Vad { max_chunk_secs: 30 } },
- Strategy { name: "E: 30s fixed, 0s, normalized", kind: StrategyKind::FixedNormalized { chunk_secs: 30, overlap_secs: 0 } },
- Strategy { name: "F: VAD split, max 45s", kind: StrategyKind::Vad { max_chunk_secs: 45 } },
+ Strategy {
+ name: "A: full audio (baseline)",
+ kind: StrategyKind::Full,
+ },
+ Strategy {
+ name: "B: 30s fixed, 0s overlap",
+ kind: StrategyKind::Fixed {
+ chunk_secs: 30,
+ overlap_secs: 0,
+ },
+ },
+ Strategy {
+ name: "C: 30s fixed, 1s overlap+LCS",
+ kind: StrategyKind::Fixed {
+ chunk_secs: 30,
+ overlap_secs: 1,
+ },
+ },
+ Strategy {
+ name: "D: VAD split, max 30s",
+ kind: StrategyKind::Vad { max_chunk_secs: 30 },
+ },
+ Strategy {
+ name: "E: 30s fixed, 0s, normalized",
+ kind: StrategyKind::FixedNormalized {
+ chunk_secs: 30,
+ overlap_secs: 0,
+ },
+ },
+ Strategy {
+ name: "F: VAD split, max 45s",
+ kind: StrategyKind::Vad { max_chunk_secs: 45 },
+ },
];
- println!("{:<35} {:>6} {:>7} {:>6}", "Strategy", "WER%", "ChrAcc%", "Time");
+ println!(
+ "{:<35} {:>6} {:>7} {:>6}",
+ "Strategy", "WER%", "ChrAcc%", "Time"
+ );
println!("{}", "-".repeat(60));
for strat in &strategies {
@@ -452,16 +574,20 @@ async fn main() -> anyhow::Result<()> {
let t = Instant::now();
let transcript = match &strat.kind {
StrategyKind::Full => transcribe_full(&mut model, &raw, sr),
- StrategyKind::Fixed { chunk_secs, overlap_secs } => {
- transcribe_fixed_chunks(&mut model, &raw, sr, *chunk_secs, *overlap_secs)
- }
+ StrategyKind::Fixed {
+ chunk_secs,
+ overlap_secs,
+ } => transcribe_fixed_chunks(&mut model, &raw, sr, *chunk_secs, *overlap_secs),
StrategyKind::Vad { max_chunk_secs } => {
let segments = vad_segment(&audio_16k, 16000).await;
let max_samples = 16000 * max_chunk_secs;
let merged = merge_and_cut_segments(&audio_16k, &segments, max_samples, 16000);
transcribe_vad_segments(&mut model, &audio_16k, 16000, &merged)
}
- StrategyKind::FixedNormalized { chunk_secs, overlap_secs } => {
+ StrategyKind::FixedNormalized {
+ chunk_secs,
+ overlap_secs,
+ } => {
let norm = peak_normalize(&raw);
transcribe_fixed_chunks(&mut model, &norm, sr, *chunk_secs, *overlap_secs)
}
@@ -474,8 +600,13 @@ async fn main() -> anyhow::Result<()> {
total_ca += ca;
}
- println!("{:<35} {:>5.1}% {:>6.1}% {:>5.1}s",
- strat.name, total_wer/n*100.0, total_ca/n*100.0, total_time);
+ println!(
+ "{:<35} {:>5.1}% {:>6.1}% {:>5.1}s",
+ strat.name,
+ total_wer / n * 100.0,
+ total_ca / n * 100.0,
+ total_time
+ );
}
// ═══════════════════════════════════════════════════════════════════════
@@ -517,7 +648,10 @@ async fn main() -> anyhow::Result<()> {
// Show transcript diffs for the worst case
if vad_wer < full_wer {
- println!(" ** VAD beats full by {:.1}pp **", (full_wer - vad_wer) * 100.0);
+ println!(
+ " ** VAD beats full by {:.1}pp **",
+ (full_wer - vad_wer) * 100.0
+ );
}
println!(" Full: {}...", &full[..80.min(full.len())]);
println!(" VAD: {}...", &vad[..80.min(vad.len())]);
@@ -537,15 +671,19 @@ async fn main() -> anyhow::Result<()> {
if path.extension().map(|e| e == "wav").unwrap_or(false) {
let (raw, sr) = read_wav(&path)?;
let dur = raw.len() as f64 / sr as f64;
- if dur < 1.0 { continue; }
+ if dur < 1.0 {
+ continue;
+ }
- let audio_16k = if sr != 16000 { resample_linear(&raw, sr, 16000) } else { raw.clone() };
+ let audio_16k = if sr != 16000 {
+ resample_linear(&raw, sr, 16000)
+ } else {
+ raw.clone()
+ };
// VAD to see how much speech
let segments = vad_segment(&audio_16k, 16000).await;
- let speech_secs: f64 = segments.iter()
- .map(|(s, e)| (e - s) as f64 / 16000.0)
- .sum();
+ let speech_secs: f64 = segments.iter().map(|(s, e)| (e - s) as f64 / 16000.0).sum();
let merged = merge_and_cut_segments(&audio_16k, &segments, 16000 * 30, 16000);
@@ -555,7 +693,13 @@ async fn main() -> anyhow::Result<()> {
let words = transcript.split_whitespace().count();
let fname = path.file_name().unwrap().to_string_lossy();
- println!("--- {} ({:.1}s, speech: {:.1}s, {} segments) ---", fname, dur, speech_secs, merged.len());
+ println!(
+ "--- {} ({:.1}s, speech: {:.1}s, {} segments) ---",
+ fname,
+ dur,
+ speech_secs,
+ merged.len()
+ );
println!(" Time: {:.2}s Words: {}", elapsed, words);
if words > 0 {
let preview = &transcript[..200.min(transcript.len())];
diff --git a/crates/screenpipe-audio/src/audio_manager/manager.rs b/crates/screenpipe-audio/src/audio_manager/manager.rs
index 29a88e5eb..c8091eeb6 100644
--- a/crates/screenpipe-audio/src/audio_manager/manager.rs
+++ b/crates/screenpipe-audio/src/audio_manager/manager.rs
@@ -459,13 +459,12 @@ impl AudioManager {
// Max deferral cap: hardcoded per engine (user override only for OpenAI-compatible).
// This lets meetings accumulate audio up to the engine's optimal capacity.
let max_deferral_secs = match *audio_transcription_engine {
- AudioTranscriptionEngine::OpenAICompatible => {
- batch_max_duration_secs.unwrap_or_else(|| {
+ AudioTranscriptionEngine::OpenAICompatible => batch_max_duration_secs
+ .unwrap_or_else(|| {
super::reconciliation::default_max_batch_duration_secs(
&audio_transcription_engine,
)
- })
- }
+ }),
_ => super::reconciliation::default_max_batch_duration_secs(
&audio_transcription_engine,
),
diff --git a/crates/screenpipe-audio/src/audio_manager/reconciliation.rs b/crates/screenpipe-audio/src/audio_manager/reconciliation.rs
index 472f8ce3c..930bf394e 100644
--- a/crates/screenpipe-audio/src/audio_manager/reconciliation.rs
+++ b/crates/screenpipe-audio/src/audio_manager/reconciliation.rs
@@ -145,9 +145,8 @@ pub async fn reconcile_untranscribed(
// User override only applies to OpenAI-compatible (unknown engine limits).
// All other engines use hardcoded optimal defaults.
let max_duration = match *audio_engine {
- AudioTranscriptionEngine::OpenAICompatible => {
- batch_max_duration_secs.unwrap_or_else(|| default_max_batch_duration_secs(&audio_engine))
- }
+ AudioTranscriptionEngine::OpenAICompatible => batch_max_duration_secs
+ .unwrap_or_else(|| default_max_batch_duration_secs(&audio_engine)),
_ => default_max_batch_duration_secs(&audio_engine),
};
let batches = group_chunks_by_device(&chunks, max_duration);
diff --git a/crates/screenpipe-audio/src/transcription/engine.rs b/crates/screenpipe-audio/src/transcription/engine.rs
index 19fc24829..708bac1fe 100644
--- a/crates/screenpipe-audio/src/transcription/engine.rs
+++ b/crates/screenpipe-audio/src/transcription/engine.rs
@@ -199,11 +199,7 @@ impl TranscriptionEngine {
info!("loading whisper model with GPU acceleration...");
let context = tokio::task::spawn_blocking(move || {
- WhisperContext::new_with_params(
- &quantized_path,
- context_param,
- )
- .map(Arc::new)
+ WhisperContext::new_with_params(&quantized_path, context_param).map(Arc::new)
})
.await
.map_err(|e| anyhow!("whisper model loading task panicked: {}", e))?
diff --git a/crates/screenpipe-config/src/defaults.rs b/crates/screenpipe-config/src/defaults.rs
index d063a8774..5d0e6cbf8 100644
--- a/crates/screenpipe-config/src/defaults.rs
+++ b/crates/screenpipe-config/src/defaults.rs
@@ -100,15 +100,15 @@ impl DbConfig {
match tier {
DeviceTier::High => Self::default(),
DeviceTier::Mid => Self {
- mmap_size: 128 * 1024 * 1024, // 128 MB
- cache_size_kb: 32_000, // 32 MB
+ mmap_size: 128 * 1024 * 1024, // 128 MB
+ cache_size_kb: 32_000, // 32 MB
read_pool_max: 12,
read_pool_min: 2,
write_pool_max: 3,
},
DeviceTier::Low => Self {
- mmap_size: 32 * 1024 * 1024, // 32 MB
- cache_size_kb: 8_000, // 8 MB
+ mmap_size: 32 * 1024 * 1024, // 32 MB
+ cache_size_kb: 8_000, // 8 MB
read_pool_max: 5,
read_pool_min: 1,
write_pool_max: 2,
@@ -121,8 +121,8 @@ impl Default for DbConfig {
/// High-tier defaults — identical to the previous hardcoded values.
fn default() -> Self {
Self {
- mmap_size: 256 * 1024 * 1024, // 256 MB
- cache_size_kb: 64_000, // 64 MB
+ mmap_size: 256 * 1024 * 1024, // 256 MB
+ cache_size_kb: 64_000, // 64 MB
read_pool_max: 27,
read_pool_min: 3,
write_pool_max: 3,
@@ -254,7 +254,10 @@ mod tests {
fn detect_tier_returns_valid_tier() {
let tier = detect_tier();
// Just verify it doesn't panic and returns a valid tier
- assert!(matches!(tier, DeviceTier::High | DeviceTier::Mid | DeviceTier::Low));
+ assert!(matches!(
+ tier,
+ DeviceTier::High | DeviceTier::Mid | DeviceTier::Low
+ ));
}
// ── classify_tier boundary tests ──────────────────────────────────
@@ -315,7 +318,10 @@ mod tests {
#[test]
fn channel_config_default_matches_high() {
- assert_eq!(ChannelConfig::default(), ChannelConfig::for_tier(DeviceTier::High));
+ assert_eq!(
+ ChannelConfig::default(),
+ ChannelConfig::for_tier(DeviceTier::High)
+ );
}
#[test]
diff --git a/crates/screenpipe-config/src/recording.rs b/crates/screenpipe-config/src/recording.rs
index bbc4aa3df..83c423c71 100644
--- a/crates/screenpipe-config/src/recording.rs
+++ b/crates/screenpipe-config/src/recording.rs
@@ -204,7 +204,11 @@ pub struct RecordingSettings {
/// Detected hardware tier ("high", "mid", "low").
/// Set once on first launch; `None` for existing installs (treated as High).
- #[serde(rename = "deviceTier", default, skip_serializing_if = "Option::is_none")]
+ #[serde(
+ rename = "deviceTier",
+ default,
+ skip_serializing_if = "Option::is_none"
+ )]
pub device_tier: Option<String>,
}
@@ -280,8 +284,6 @@ fn default_true() -> bool {
true
}
-
-
#[cfg(test)]
mod tests {
use super::*;
diff --git a/crates/screenpipe-connect/src/connections/mod.rs b/crates/screenpipe-connect/src/connections/mod.rs
index 118105eb1..a301a51ee 100644
--- a/crates/screenpipe-connect/src/connections/mod.rs
+++ b/crates/screenpipe-connect/src/connections/mod.rs
@@ -228,10 +228,7 @@ impl ConnectionManager {
/// Matches keys that are exactly `id` (the default instance) or start with
/// `id:` (named instances). Each entry is returned as
/// `(instance_name_or_none, connection)`.
- pub fn get_all_instances(
- &self,
- id: &str,
- ) -> Result<Vec<(Option<String>, SavedConnection)>> {
+ pub fn get_all_instances(&self, id: &str) -> Result<Vec<(Option<String>, SavedConnection)>> {
self.find(id)?;
let store = load_store(&self.screenpipe_dir);
let prefix = format!("{}:", id);
diff --git a/crates/screenpipe-core/src/pipes/mod.rs b/crates/screenpipe-core/src/pipes/mod.rs
index e1b23ee02..1eec5547c 100644
--- a/crates/screenpipe-core/src/pipes/mod.rs
+++ b/crates/screenpipe-core/src/pipes/mod.rs
@@ -416,7 +416,10 @@ pub fn load_local_overrides(pipes_dir: &Path) -> HashMap<String, bool> {
}
/// Write local enabled overrides atomically (write to temp, then rename).
-pub(crate) fn save_local_overrides(pipes_dir: &Path, overrides: &HashMap<String, bool>) -> Result<()> {
+pub(crate) fn save_local_overrides(
+ pipes_dir: &Path,
+ overrides: &HashMap<String, bool>,
+) -> Result<()> {
let path = pipes_dir.join(LOCAL_OVERRIDES_FILE);
let tmp_path = pipes_dir.join(".local-overrides.json.tmp");
let json = serde_json::to_string_pretty(overrides)?;
@@ -2246,7 +2249,10 @@ impl PipeManager {
// Persist enabled state to local overrides so it
// survives cross-device sync (never synced).
if let Err(e) = set_local_override(&self.pipes_dir, name, b) {
- warn!("failed to save local enabled override for '{}': {}", name, e);
+ warn!(
+ "failed to save local enabled override for '{}': {}",
+ name, e
+ );
}
}
}
@@ -2648,9 +2654,7 @@ impl PipeManager {
std::collections::HashSet::new();
{
use futures::FutureExt;
- while let Some(event) =
- workflow_rx.next().now_or_never().flatten()
- {
+ while let Some(event) = workflow_rx.next().now_or_never().flatten() {
let event_type = &event.data.event_type;
for (name, config, _body) in &pipe_snapshot {
if !config.enabled {
@@ -2817,15 +2821,14 @@ impl PipeManager {
tokio::spawn(async move {
// Create DB execution row
- let trigger = if is_event_triggered { "event" } else { "scheduled" };
+ let trigger = if is_event_triggered {
+ "event"
+ } else {
+ "scheduled"
+ };
let exec_id = if let Some(ref store) = store_ref {
match store
- .create_execution(
- &pipe_name,
- trigger,
- &model,
- provider.as_deref(),
- )
+ .create_execution(&pipe_name, trigger, &model, provider.as_deref())
.await
{
Ok(id) => {
diff --git a/crates/screenpipe-core/src/pipes/sync.rs b/crates/screenpipe-core/src/pipes/sync.rs
index d89f4220f..8c48a7c93 100644
--- a/crates/screenpipe-core/src/pipes/sync.rs
+++ b/crates/screenpipe-core/src/pipes/sync.rs
@@ -15,7 +15,9 @@ use std::collections::HashMap;
use std::path::Path;
use tracing::{info, warn};
-use super::{load_local_overrides, parse_frontmatter, read_tombstones, save_local_overrides, serialize_pipe};
+use super::{
+ load_local_overrides, parse_frontmatter, read_tombstones, save_local_overrides, serialize_pipe,
+};
/// Current schema version for the sync manifest.
pub const PIPE_SYNC_SCHEMA: u32 = 1;
diff --git a/crates/screenpipe-db/benches/db_benchmarks.rs b/crates/screenpipe-db/benches/db_benchmarks.rs
index 69df596f9..4105fda46 100644
--- a/crates/screenpipe-db/benches/db_benchmarks.rs
+++ b/crates/screenpipe-db/benches/db_benchmarks.rs
@@ -11,7 +11,9 @@ use std::sync::Arc;
use tokio::runtime::Runtime;
async fn setup_large_db(size: usize) -> DatabaseManager {
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
let mut rng = rand::thread_rng();
for _ in 0..size {
diff --git a/crates/screenpipe-db/tests/audio_duplicate_test.rs b/crates/screenpipe-db/tests/audio_duplicate_test.rs
index f5fb9050c..74e91dd76 100644
--- a/crates/screenpipe-db/tests/audio_duplicate_test.rs
+++ b/crates/screenpipe-db/tests/audio_duplicate_test.rs
@@ -14,7 +14,9 @@ mod tests {
use screenpipe_db::{AudioDevice, DatabaseManager, DeviceType};
async fn setup_test_db() -> DatabaseManager {
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
match sqlx::migrate!("./src/migrations").run(&db.pool).await {
Ok(_) => {}
diff --git a/crates/screenpipe-db/tests/db.rs b/crates/screenpipe-db/tests/db.rs
index 99c303c50..7701bdf04 100644
--- a/crates/screenpipe-db/tests/db.rs
+++ b/crates/screenpipe-db/tests/db.rs
@@ -17,7 +17,9 @@ mod tests {
.with_max_level(tracing::Level::INFO)
.try_init();
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
// Run all migrations with better error handling
match sqlx::migrate!("./src/migrations").run(&db.pool).await {
diff --git a/crates/screenpipe-db/tests/frame_offset_sync_test.rs b/crates/screenpipe-db/tests/frame_offset_sync_test.rs
index 9b657bdff..c1aa6b62f 100644
--- a/crates/screenpipe-db/tests/frame_offset_sync_test.rs
+++ b/crates/screenpipe-db/tests/frame_offset_sync_test.rs
@@ -15,7 +15,9 @@ mod tests {
use screenpipe_db::DatabaseManager;
async fn setup_test_db() -> DatabaseManager {
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
match sqlx::migrate!("./src/migrations").run(&db.pool).await {
Ok(_) => {}
diff --git a/crates/screenpipe-db/tests/fts_contention_test.rs b/crates/screenpipe-db/tests/fts_contention_test.rs
index b47bdf5f7..bcbc6cf91 100644
--- a/crates/screenpipe-db/tests/fts_contention_test.rs
+++ b/crates/screenpipe-db/tests/fts_contention_test.rs
@@ -23,7 +23,9 @@ mod fts_contention_tests {
.with_max_level(tracing::Level::INFO)
.try_init();
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
diff --git a/crates/screenpipe-db/tests/fts_dots_test.rs b/crates/screenpipe-db/tests/fts_dots_test.rs
index 5590f1b53..3e6efaaed 100644
--- a/crates/screenpipe-db/tests/fts_dots_test.rs
+++ b/crates/screenpipe-db/tests/fts_dots_test.rs
@@ -14,7 +14,9 @@ mod tests {
use std::sync::Arc;
async fn setup_test_db() -> DatabaseManager {
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
.await
diff --git a/crates/screenpipe-db/tests/heavy_read_test.rs b/crates/screenpipe-db/tests/heavy_read_test.rs
index a009d5023..ee33b8415 100644
--- a/crates/screenpipe-db/tests/heavy_read_test.rs
+++ b/crates/screenpipe-db/tests/heavy_read_test.rs
@@ -23,7 +23,11 @@ async fn open_real_db() -> Arc<DatabaseManager> {
}
let db_url = format!("sqlite:{}", db_path.display());
- Arc::new(DatabaseManager::new(&db_url, Default::default()).await.unwrap())
+ Arc::new(
+ DatabaseManager::new(&db_url, Default::default())
+ .await
+ .unwrap(),
+ )
}
/// Simulate the pipe scenario: fire 4 heavy OCR searches concurrently
diff --git a/crates/screenpipe-db/tests/keyword_search_accessibility_test.rs b/crates/screenpipe-db/tests/keyword_search_accessibility_test.rs
index daa64fc2f..4b19fdee5 100644
--- a/crates/screenpipe-db/tests/keyword_search_accessibility_test.rs
+++ b/crates/screenpipe-db/tests/keyword_search_accessibility_test.rs
@@ -9,7 +9,9 @@ mod tests {
use std::sync::Arc;
async fn setup_test_db() -> DatabaseManager {
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
.await
diff --git a/crates/screenpipe-db/tests/keyword_search_order_test.rs b/crates/screenpipe-db/tests/keyword_search_order_test.rs
index b2bd275ec..c3b8f5262 100644
--- a/crates/screenpipe-db/tests/keyword_search_order_test.rs
+++ b/crates/screenpipe-db/tests/keyword_search_order_test.rs
@@ -9,7 +9,9 @@ mod tests {
use std::sync::Arc;
async fn setup_test_db() -> DatabaseManager {
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
.await
diff --git a/crates/screenpipe-db/tests/query_plan_test.rs b/crates/screenpipe-db/tests/query_plan_test.rs
index e08dade62..74a2b2c5c 100644
--- a/crates/screenpipe-db/tests/query_plan_test.rs
+++ b/crates/screenpipe-db/tests/query_plan_test.rs
@@ -20,7 +20,9 @@ mod query_plan_tests {
.with_max_level(tracing::Level::INFO)
.try_init();
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
diff --git a/crates/screenpipe-db/tests/search_ocr_snapshot_test.rs b/crates/screenpipe-db/tests/search_ocr_snapshot_test.rs
index 56bdefdf4..dd0cdd0d5 100644
--- a/crates/screenpipe-db/tests/search_ocr_snapshot_test.rs
+++ b/crates/screenpipe-db/tests/search_ocr_snapshot_test.rs
@@ -16,7 +16,9 @@ mod tests {
use std::sync::Arc;
async fn setup_test_db() -> DatabaseManager {
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
.await
diff --git a/crates/screenpipe-db/tests/speaker_reassignment_test.rs b/crates/screenpipe-db/tests/speaker_reassignment_test.rs
index d72b4c3d2..4fbbba866 100644
--- a/crates/screenpipe-db/tests/speaker_reassignment_test.rs
+++ b/crates/screenpipe-db/tests/speaker_reassignment_test.rs
@@ -11,7 +11,9 @@ mod speaker_reassignment_tests {
.with_max_level(tracing::Level::INFO)
.try_init();
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
diff --git a/crates/screenpipe-db/tests/timeline_performance_test.rs b/crates/screenpipe-db/tests/timeline_performance_test.rs
index 2b2d73fc3..5ea13d640 100644
--- a/crates/screenpipe-db/tests/timeline_performance_test.rs
+++ b/crates/screenpipe-db/tests/timeline_performance_test.rs
@@ -14,7 +14,9 @@ mod timeline_performance_tests {
.with_max_level(tracing::Level::INFO)
.try_init();
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
@@ -403,7 +405,9 @@ mod timeline_performance_tests {
let db_url = format!("sqlite:{}", path);
- let db = DatabaseManager::new(&db_url, Default::default()).await.unwrap();
+ let db = DatabaseManager::new(&db_url, Default::default())
+ .await
+ .unwrap();
sqlx::migrate!("./src/migrations")
.run(&db.pool)
diff --git a/crates/screenpipe-db/tests/untranscribed_chunks_test.rs b/crates/screenpipe-db/tests/untranscribed_chunks_test.rs
index 916bbbdf3..2fe3e63a0 100644
--- a/crates/screenpipe-db/tests/untranscribed_chunks_test.rs
+++ b/crates/screenpipe-db/tests/untranscribed_chunks_test.rs
@@ -11,7 +11,9 @@ mod tests {
use screenpipe_db::{AudioDevice, DatabaseManager, DeviceType};
async fn setup_test_db() -> DatabaseManager {
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
match sqlx::migrate!("./src/migrations").run(&db.pool).await {
Ok(_) => {}
diff --git a/crates/screenpipe-engine/src/cli/status.rs b/crates/screenpipe-engine/src/cli/status.rs
index 7b97e1d47..5d42eed7e 100644
--- a/crates/screenpipe-engine/src/cli/status.rs
+++ b/crates/screenpipe-engine/src/cli/status.rs
@@ -19,7 +19,9 @@ pub async fn handle_status_command(
// Get DB stats
let (frame_count, audio_count, last_timestamp) = if db_path.exists() {
- match screenpipe_db::DatabaseManager::new(&db_path.to_string_lossy(), Default::default()).await {
+ match screenpipe_db::DatabaseManager::new(&db_path.to_string_lossy(), Default::default())
+ .await
+ {
Ok(db) => {
let frames: i64 = sqlx::query("SELECT COUNT(*) as cnt FROM frames")
.fetch_one(&db.pool)
diff --git a/crates/screenpipe-engine/src/lib.rs b/crates/screenpipe-engine/src/lib.rs
index f97892c12..5b051e3d2 100644
--- a/crates/screenpipe-engine/src/lib.rs
+++ b/crates/screenpipe-engine/src/lib.rs
@@ -25,7 +25,6 @@ pub mod event_driven_capture;
pub mod hot_frame_cache;
pub mod meeting_detector;
pub mod meeting_persister;
-pub mod workflow_classifier;
pub mod meeting_watcher;
pub mod paired_capture;
pub mod power;
@@ -40,6 +39,7 @@ mod video;
pub mod video_cache;
pub mod video_utils;
pub mod vision_manager;
+pub mod workflow_classifier;
pub use auto_destruct::watch_pid;
pub use axum::Json as JsonResponse;
pub use cli::Cli;
diff --git a/crates/screenpipe-engine/src/paired_capture.rs b/crates/screenpipe-engine/src/paired_capture.rs
index 174586a11..c26c57a2c 100644
--- a/crates/screenpipe-engine/src/paired_capture.rs
+++ b/crates/screenpipe-engine/src/paired_capture.rs
@@ -548,7 +548,9 @@ mod tests {
async fn test_paired_capture_without_accessibility() {
let tmp = TempDir::new().unwrap();
let snapshot_writer = SnapshotWriter::new(tmp.path(), 80);
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
let image = test_image();
let now = Utc::now();
@@ -583,7 +585,9 @@ mod tests {
async fn test_paired_capture_with_accessibility_text() {
let tmp = TempDir::new().unwrap();
let snapshot_writer = SnapshotWriter::new(tmp.path(), 80);
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
let image = test_image();
let now = Utc::now();
@@ -641,7 +645,9 @@ mod tests {
async fn test_paired_capture_empty_accessibility_text() {
let tmp = TempDir::new().unwrap();
let snapshot_writer = SnapshotWriter::new(tmp.path(), 80);
- let db = DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap();
+ let db = DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap();
let image = test_image();
let now = Utc::now();
diff --git a/crates/screenpipe-engine/src/routes/pipe_store.rs b/crates/screenpipe-engine/src/routes/pipe_store.rs
index 9b04de1b6..6c7c361cb 100644
--- a/crates/screenpipe-engine/src/routes/pipe_store.rs
+++ b/crates/screenpipe-engine/src/routes/pipe_store.rs
@@ -245,10 +245,9 @@ pub async fn pipe_store_install(
.unwrap_or(1);
// Extract connections from frontmatter before installing
- let connections: Vec<String> =
- screenpipe_core::pipes::parse_frontmatter(&source_md)
- .map(|(cfg, _)| cfg.connections)
- .unwrap_or_default();
+ let connections: Vec<String> = screenpipe_core::pipes::parse_frontmatter(&source_md)
+ .map(|(cfg, _)| cfg.connections)
+ .unwrap_or_default();
// 2. Install locally with store tracking
let mgr = pm.lock().await;
diff --git a/crates/screenpipe-engine/src/workflow_classifier.rs b/crates/screenpipe-engine/src/workflow_classifier.rs
index 319d1f036..706d0bdd3 100644
--- a/crates/screenpipe-engine/src/workflow_classifier.rs
+++ b/crates/screenpipe-engine/src/workflow_classifier.rs
@@ -197,7 +197,11 @@ async fn get_recent_activities(client: &Client, port: u16) -> Option<Vec<Activit
};
if !app.is_empty() || !window.is_empty() {
- activities.push(ActivityEntry { app, window, timestamp: ts });
+ activities.push(ActivityEntry {
+ app,
+ window,
+ timestamp: ts,
+ });
}
}
@@ -258,8 +262,7 @@ async fn classify(
content.trim()
};
- serde_json::from_str::<ClassifierResult>(clean)
- .map_err(|e| format!("parse '{}': {}", clean, e))
+ serde_json::from_str::<ClassifierResult>(clean).map_err(|e| format!("parse '{}': {}", clean, e))
}
fn hash_activities(activities: &[ActivityEntry]) -> u64 {
diff --git a/crates/screenpipe-engine/tests/endpoint_test.rs b/crates/screenpipe-engine/tests/endpoint_test.rs
index 53e5867c0..f3ca0cbcd 100644
--- a/crates/screenpipe-engine/tests/endpoint_test.rs
+++ b/crates/screenpipe-engine/tests/endpoint_test.rs
@@ -32,7 +32,11 @@ mod tests {
}
async fn setup_test_app() -> (Router, Arc<DatabaseManager>) {
- let db = Arc::new(DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap());
+ let db = Arc::new(
+ DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap(),
+ );
let audio_manager = Arc::new(
AudioManagerBuilder::new()
diff --git a/crates/screenpipe-engine/tests/tags_test.rs b/crates/screenpipe-engine/tests/tags_test.rs
index 6d7ccfc31..46577c1f0 100644
--- a/crates/screenpipe-engine/tests/tags_test.rs
+++ b/crates/screenpipe-engine/tests/tags_test.rs
@@ -22,7 +22,11 @@ fn init() {
}
async fn setup_test_app() -> (Router, Arc<DatabaseManager>) {
- let db = Arc::new(DatabaseManager::new("sqlite::memory:", Default::default()).await.unwrap());
+ let db = Arc::new(
+ DatabaseManager::new("sqlite::memory:", Default::default())
+ .await
+ .unwrap(),
+ );
let audio_manager = Arc::new(
AudioManagerBuilder::new()
diff --git a/crates/screenpipe-screen/src/capture_screenshot_by_window.rs b/crates/screenpipe-screen/src/capture_screenshot_by_window.rs
index f0867937a..06ad58ccc 100644
--- a/crates/screenpipe-screen/src/capture_screenshot_by_window.rs
+++ b/crates/screenpipe-screen/src/capture_screenshot_by_window.rs
@@ -127,6 +127,10 @@ static SKIP_APPS: Lazy<HashSet<&'static str>> = Lazy::new(|| {
"i3bar",
"Plank",
"Dock",
+ "Cinnamon",
+ "cinnamon",
+ "Muffin",
+ "Budgie-panel",
// Screenpipe's own UI should never be captured
"screenpipe",
"screenpipe - Development",