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.224, CLI to v0.3.224

Louis Beaumont73a5ae76ab3b
diff --git a/Cargo.toml b/Cargo.toml
index 71bce7588..5b6e99c28 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ exclude = ["apps/screenpipe-app-tauri/src-tauri", "crates/screenpipe-integration
resolver = "2"
[workspace.package]
-version = "0.3.223"
+version = "0.3.224"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/screenpipe/screenpipe"
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index c6372161c..f973f6055 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.2.223"
+version = "2.2.224"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/embedded_server.rs b/apps/screenpipe-app-tauri/src-tauri/src/embedded_server.rs
index d9902917a..40cf68bad 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/embedded_server.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/embedded_server.rs
@@ -360,6 +360,9 @@ pub async fn start_embedded_server(
match start_ui_recording(db_clone, ui_config, capture_trigger_tx).await {
Ok(handle) => {
info!("UI event recording started successfully");
+ // Register stop flag with DRM detector so it can stop the UI recorder
+ // when DRM streaming content is detected (releases event taps).
+ screenpipe_engine::drm_detector::set_ui_recorder_stop_flag(handle.stop_flag());
Some(handle)
}
Err(e) => {
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/health.rs b/apps/screenpipe-app-tauri/src-tauri/src/health.rs
index 41254921e..9946ac00d 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/health.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/health.rs
@@ -8,7 +8,7 @@ use once_cell::sync::Lazy;
use serde::Deserialize;
use std::sync::RwLock;
use std::time::Instant;
-use tauri::{path::BaseDirectory, Manager};
+use tauri::{path::BaseDirectory, Emitter, Manager};
use tokio::time::{interval, Duration};
use tracing::{error, info, warn};
@@ -144,6 +144,9 @@ struct HealthCheckResponse {
/// Audio devices active but DB writes stopped (pool exhaustion)
#[serde(default)]
audio_db_write_stalled: bool,
+ /// DRM streaming content detected — capture should be fully stopped
+ #[serde(default)]
+ drm_content_paused: bool,
}
/// Decide recording status based on health check result and time since startup.
@@ -310,6 +313,9 @@ pub async fn start_health_check(app: tauri::AppHandle) -> Result<()> {
let mut consecutive_failures: u32 = 0;
let mut consecutive_unhealthy: u32 = 0;
+ // DRM pause state — tracked here because engine memory is lost on stop_screenpipe
+ let mut drm_stopped = false;
+
// Capture stall detection state
let mut consecutive_audio_stall: u32 = 0;
let mut consecutive_vision_stall: u32 = 0;
@@ -465,6 +471,46 @@ pub async fn start_health_check(app: tauri::AppHandle) -> Result<()> {
}
}
+ // ── DRM content pause / resume ──
+ // When the engine detects DRM streaming content (Netflix, etc.),
+ // stop the entire recording pipeline — exactly like the "stop recording"
+ // button. This fully releases ScreenCaptureKit so DRM doesn't black out.
+ if let Ok(ref health) = health_result {
+ if health.drm_content_paused && !drm_stopped {
+ info!("DRM content detected — calling stop_screenpipe to fully release screen recording");
+ let _ = app.emit("shortcut-stop-recording", ());
+ drm_stopped = true;
+ }
+ }
+ // Auto-resume: when server is down due to DRM, poll the focused app.
+ // If user switched to a non-streaming, non-browser app, restart recording.
+ // Also try when server responds (it may still be shutting down).
+ if drm_stopped {
+ info!("DRM stopped state active, health_ok={}, checking focused app for resume", health_result.is_ok());
+ }
+ if drm_stopped {
+ let should_resume = tokio::task::spawn_blocking(|| {
+ // poll_drm_clear returns true = still DRM, false = cleared
+ !screenpipe_engine::drm_detector::poll_drm_clear()
+ }).await.unwrap_or(false);
+ if should_resume {
+ info!("DRM content no longer focused — auto-restarting recording");
+ let _ = app.emit("shortcut-start-recording", ());
+ drm_stopped = false;
+ // Give the server time to start before checking health again
+ last_restart_triggered = Some(Instant::now());
+ }
+ }
+ // Clear drm_stopped if server came back and DRM flag is no longer set
+ // (e.g. user manually started recording or toggled the setting off)
+ if drm_stopped && health_result.is_ok() {
+ if let Ok(ref health) = health_result {
+ if !health.drm_content_paused {
+ drm_stopped = false;
+ }
+ }
+ }
+
// ── Capture stall detection ──
// Only check when the server is responding (status == Recording),
// we're past the startup grace period, and not in a post-restart
diff --git a/crates/screenpipe-engine/src/drm_detector.rs b/crates/screenpipe-engine/src/drm_detector.rs
index 3201f1f19..7bcbe459c 100644
--- a/crates/screenpipe-engine/src/drm_detector.rs
+++ b/crates/screenpipe-engine/src/drm_detector.rs
@@ -14,12 +14,37 @@
//! 3. Only the focused-app poll runs (uses Accessibility APIs, not SCK)
//! 4. When user switches to a non-streaming app, everything restarts.
+use once_cell::sync::Lazy;
use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::{Arc, Mutex};
use tracing::{debug, info, warn};
/// Global flag — when `true`, all monitors skip screen capture.
static DRM_CONTENT_PAUSED: AtomicBool = AtomicBool::new(false);
+/// Global reference to the UI recorder's stop flag.
+/// Set during startup so the DRM detector can stop the UI recorder
+/// (which holds native event taps that keep Screen Recording active).
+static UI_RECORDER_STOP_FLAG: Lazy<Mutex<Option<Arc<AtomicBool>>>> =
+ Lazy::new(|| Mutex::new(None));
+
+/// Register the UI recorder's stop flag so DRM detector can stop it.
+pub fn set_ui_recorder_stop_flag(flag: Arc<AtomicBool>) {
+ if let Ok(mut guard) = UI_RECORDER_STOP_FLAG.lock() {
+ *guard = Some(flag);
+ }
+}
+
+/// Stop the UI recorder by setting its stop flag.
+pub fn stop_ui_recorder() {
+ if let Ok(guard) = UI_RECORDER_STOP_FLAG.lock() {
+ if let Some(ref flag) = *guard {
+ info!("DRM: stopping UI recorder to release event taps");
+ flag.store(true, Ordering::SeqCst);
+ }
+ }
+}
+
/// Read the current DRM pause state.
pub fn drm_content_paused() -> bool {
DRM_CONTENT_PAUSED.load(Ordering::SeqCst)
@@ -176,11 +201,9 @@ fn is_browser(app_name: &str) -> bool {
}
/// Query the current foreground app and check if DRM is still active.
-/// Called from the monitor watcher when monitors are stopped due to DRM.
-///
-/// Uses only Accessibility APIs (not ScreenCaptureKit) so we don't
-/// keep the SCK permission active.
+/// Called from the Tauri health check to decide when to auto-restart recording.
///
+/// Uses only Accessibility APIs (not ScreenCaptureKit).
/// Returns `true` if DRM is still active (stay paused).
#[cfg(target_os = "macos")]
pub fn poll_drm_clear() -> bool {
@@ -203,7 +226,7 @@ pub fn poll_drm_clear() -> bool {
true
} else if is_browser(&app_name) {
debug!(
- "browser '{}' focused — keeping DRM pause (can't check URL without SCK)",
+ "browser '{}' focused — keeping DRM pause (can't check URL)",
app_name
);
true
diff --git a/crates/screenpipe-engine/src/routes/health.rs b/crates/screenpipe-engine/src/routes/health.rs
index fb24addfa..2f5326cf8 100644
--- a/crates/screenpipe-engine/src/routes/health.rs
+++ b/crates/screenpipe-engine/src/routes/health.rs
@@ -70,6 +70,9 @@ pub struct HealthCheckResponse {
/// True when audio devices are active but DB writes have stopped (pool exhaustion).
#[serde(default)]
pub audio_db_write_stalled: bool,
+ /// True when DRM streaming content is detected and capture should be fully stopped.
+ #[serde(default)]
+ pub drm_content_paused: bool,
}
#[derive(Serialize, OaSchema, Deserialize, Clone)]
@@ -632,6 +635,7 @@ async fn health_check_inner(state: &Arc<AppState>) -> HealthCheckResponse {
},
vision_db_write_stalled,
audio_db_write_stalled,
+ drm_content_paused: crate::drm_detector::drm_content_paused(),
}
}
@@ -758,6 +762,7 @@ mod tests {
pool_stats: None,
vision_db_write_stalled: false,
audio_db_write_stalled: false,
+ drm_content_paused: false,
}
}
diff --git a/crates/screenpipe-engine/src/ui_recorder.rs b/crates/screenpipe-engine/src/ui_recorder.rs
index f1d45cb78..af997dbde 100644
--- a/crates/screenpipe-engine/src/ui_recorder.rs
+++ b/crates/screenpipe-engine/src/ui_recorder.rs
@@ -165,6 +165,11 @@ impl UiRecorderHandle {
self.stop_flag.store(true, Ordering::SeqCst);
}
+ /// Get the stop flag for external use (e.g. DRM detector).
+ pub fn stop_flag(&self) -> Arc<AtomicBool> {
+ self.stop_flag.clone()
+ }
+
/// Check if still running
pub fn is_running(&self) -> bool {
!self.stop_flag.load(Ordering::Relaxed)
diff --git a/crates/screenpipe-engine/src/vision_manager/monitor_watcher.rs b/crates/screenpipe-engine/src/vision_manager/monitor_watcher.rs
index da840ca33..29139607c 100644
--- a/crates/screenpipe-engine/src/vision_manager/monitor_watcher.rs
+++ b/crates/screenpipe-engine/src/vision_manager/monitor_watcher.rs
@@ -60,10 +60,12 @@ pub async fn start_monitor_watcher(vision_manager: Arc<VisionManager>) -> anyhow
// This ensures macOS DRM sees no active ScreenCaptureKit usage.
if drm_detector::drm_content_paused() {
if !drm_stopped {
- info!("DRM content focused — stopping all vision monitors to release SCK handles");
+ info!("DRM content focused — stopping vision + UI recorder to release screen capture");
if let Err(e) = vision_manager.stop().await {
warn!("failed to stop vision manager for DRM pause: {:?}", e);
}
+ // Also stop UI recorder — its native event taps keep Screen Recording active
+ drm_detector::stop_ui_recorder();
drm_stopped = true;
}
// Poll focused app (Accessibility API only, no SCK) to detect
@@ -83,6 +85,8 @@ pub async fn start_monitor_watcher(vision_manager: Arc<VisionManager>) -> anyhow
if let Err(e) = vision_manager.start().await {
warn!("failed to restart vision manager after DRM pause: {:?}", e);
}
+ // Note: UI recorder cannot be restarted (one-shot design).
+ // It will resume on next app restart. Vision capture resumes immediately.
drm_stopped = false;
// Re-populate known_monitors after restart
if let Ok(monitors) = list_monitors_detailed().await {