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

feat: switch to Haiku 4.5, add sync history

Louis Beaumonta23d17bd4ee9
diff --git a/Cargo.lock b/Cargo.lock
index ee0a4d93c..ea9ce56b5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6617,6 +6617,7 @@ dependencies = [
"crossbeam-channel",
"parking_lot",
"regex",
+ "screenpipe-core",
"screenpipe-db",
"serde",
"serde_json",
diff --git a/screenpipe-accessibility/Cargo.toml b/screenpipe-accessibility/Cargo.toml
index c732d55b9..ef361b0ed 100644
--- a/screenpipe-accessibility/Cargo.toml
+++ b/screenpipe-accessibility/Cargo.toml
@@ -11,6 +11,7 @@ db = ["screenpipe-db"]
[dependencies]
screenpipe-db = { path = "../screenpipe-db", optional = true }
+screenpipe-core = { path = "../screenpipe-core" }
# Core
anyhow = "1.0"
tracing = "0.1"
diff --git a/screenpipe-accessibility/src/platform/macos.rs b/screenpipe-accessibility/src/platform/macos.rs
index 981918518..54e7a2eb1 100644
--- a/screenpipe-accessibility/src/platform/macos.rs
+++ b/screenpipe-accessibility/src/platform/macos.rs
@@ -9,6 +9,7 @@ use anyhow::Result;
use chrono::Utc;
use crossbeam_channel::{bounded, Receiver, Sender};
use parking_lot::Mutex;
+use screenpipe_core::pii_removal::remove_pii;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::thread;
@@ -321,7 +322,12 @@ fn run_event_tap(
let mut buf = state.text_buf.lock();
if buf.should_flush() {
if let Some(s) = buf.flush() {
- let event = UiEvent::text(Utc::now(), state.start.elapsed().as_millis() as u64, s);
+ let text = if state.config.apply_pii_removal {
+ remove_pii(&s)
+ } else {
+ s
+ };
+ let event = UiEvent::text(Utc::now(), state.start.elapsed().as_millis() as u64, text);
let _ = state.tx.try_send(event);
}
}
@@ -330,7 +336,12 @@ fn run_event_tap(
// Final flush
let mut buf = state.text_buf.lock();
if let Some(s) = buf.flush() {
- let event = UiEvent::text(Utc::now(), state.start.elapsed().as_millis() as u64, s);
+ let text = if state.config.apply_pii_removal {
+ remove_pii(&s)
+ } else {
+ s
+ };
+ let event = UiEvent::text(Utc::now(), state.start.elapsed().as_millis() as u64, text);
let _ = state.tx.try_send(event);
}
@@ -521,10 +532,14 @@ extern "C" fn tap_callback(
let tx = state.tx.clone();
let start = state.start;
let capture_content = state.config.capture_clipboard_content;
+ let apply_pii = state.config.apply_pii_removal;
std::thread::spawn(move || {
std::thread::sleep(std::time::Duration::from_millis(50));
let content = if capture_content {
- get_clipboard().map(|s| truncate(&s, 1000))
+ get_clipboard().map(|s| {
+ let truncated = truncate(&s, 1000);
+ if apply_pii { remove_pii(&truncated) } else { truncated }
+ })
} else {
None
};
@@ -549,10 +564,14 @@ extern "C" fn tap_callback(
let tx = state.tx.clone();
let start = state.start;
let capture_content = state.config.capture_clipboard_content;
+ let apply_pii = state.config.apply_pii_removal;
std::thread::spawn(move || {
std::thread::sleep(std::time::Duration::from_millis(50));
let content = if capture_content {
- get_clipboard().map(|s| truncate(&s, 1000))
+ get_clipboard().map(|s| {
+ let truncated = truncate(&s, 1000);
+ if apply_pii { remove_pii(&truncated) } else { truncated }
+ })
} else {
None
};
@@ -575,7 +594,10 @@ extern "C" fn tap_callback(
}
KEY_V => {
let content = if state.config.capture_clipboard_content {
- get_clipboard().map(|s| truncate(&s, 1000))
+ get_clipboard().map(|s| {
+ let truncated = truncate(&s, 1000);
+ if state.config.apply_pii_removal { remove_pii(&truncated) } else { truncated }
+ })
} else {
None
};
@@ -800,7 +822,10 @@ fn get_element_at_position(x: f64, y: f64, config: &UiCaptureConfig) -> Option<E
Some(ElementContext {
role,
name: name.map(|s| truncate(&s, 200)),
- value: value.map(|s| truncate(&s, 500)),
+ value: value.map(|s| {
+ let truncated = truncate(&s, 500);
+ if config.apply_pii_removal { remove_pii(&truncated) } else { truncated }
+ }),
description: description.map(|s| truncate(&s, 200)),
automation_id: None,
bounds: None,
diff --git a/screenpipe-accessibility/src/platform/windows.rs b/screenpipe-accessibility/src/platform/windows.rs
index 1eca14520..5778e877b 100644
--- a/screenpipe-accessibility/src/platform/windows.rs
+++ b/screenpipe-accessibility/src/platform/windows.rs
@@ -9,6 +9,7 @@ use anyhow::Result;
use chrono::Utc;
use crossbeam_channel::{bounded, Receiver, Sender};
use parking_lot::Mutex;
+use screenpipe_core::pii_removal::remove_pii;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::thread;
@@ -305,10 +306,15 @@ fn run_native_hooks(
fn flush_text_buffer(state: &mut HookState) {
if !state.text_buf.is_empty() {
let content = std::mem::take(&mut state.text_buf);
+ let text = if state.config.apply_pii_removal {
+ remove_pii(&content)
+ } else {
+ content
+ };
let event = UiEvent::text(
Utc::now(),
state.start.elapsed().as_millis() as u64,
- content,
+ text,
);
let _ = state.tx.try_send(event);
state.last_text_time = None;
@@ -364,6 +370,7 @@ unsafe extern "system" fn keyboard_hook_proc(
// Check for clipboard operations (Ctrl+C, Ctrl+X, Ctrl+V)
if mods & 0x02 != 0 && s.config.capture_clipboard {
// Ctrl is pressed
+ let apply_pii = s.config.apply_pii_removal;
match vk_code {
0x43 => {
// C
@@ -374,7 +381,7 @@ unsafe extern "system" fn keyboard_hook_proc(
data: EventData::Clipboard {
operation: 'c',
content: if s.config.capture_clipboard_content {
- get_clipboard_text()
+ get_clipboard_text().map(|c| if apply_pii { remove_pii(&c) } else { c })
} else {
None
},
@@ -397,7 +404,7 @@ unsafe extern "system" fn keyboard_hook_proc(
data: EventData::Clipboard {
operation: 'x',
content: if s.config.capture_clipboard_content {
- get_clipboard_text()
+ get_clipboard_text().map(|c| if apply_pii { remove_pii(&c) } else { c })
} else {
None
},
@@ -420,7 +427,7 @@ unsafe extern "system" fn keyboard_hook_proc(
data: EventData::Clipboard {
operation: 'v',
content: if s.config.capture_clipboard_content {
- get_clipboard_text()
+ get_clipboard_text().map(|c| if apply_pii { remove_pii(&c) } else { c })
} else {
None
},
diff --git a/screenpipe-app-tauri/components/settings/obsidian-sync-card.tsx b/screenpipe-app-tauri/components/settings/obsidian-sync-card.tsx
index 51fab3067..9b4eda4b3 100644
--- a/screenpipe-app-tauri/components/settings/obsidian-sync-card.tsx
+++ b/screenpipe-app-tauri/components/settings/obsidian-sync-card.tsx
@@ -131,6 +131,12 @@ interface ObsidianSyncStatus {
notesCreatedToday: number;
}
+interface SyncHistoryEntry {
+ timestamp: string;
+ status: "success" | "error";
+ error?: string;
+}
+
const DEFAULT_SETTINGS: ObsidianSyncSettings = {
enabled: false,
vaultPath: "",
@@ -158,6 +164,7 @@ export function ObsidianSyncCard() {
const [isExpanded, setIsExpanded] = useState(false);
const [settingsLoaded, setSettingsLoaded] = useState(false);
const [syncStatusMessage, setSyncStatusMessage] = useState<string>("");
+ const [syncHistory, setSyncHistory] = useState<SyncHistoryEntry[]>([]);
// Load settings from localStorage on mount
useEffect(() => {
@@ -172,6 +179,16 @@ export function ObsidianSyncCard() {
}
setSettingsLoaded(true);
+ // Load sync history
+ const savedHistory = localStorage.getItem("obsidian-sync-history");
+ if (savedHistory) {
+ try {
+ setSyncHistory(JSON.parse(savedHistory).slice(0, 10)); // Keep last 10
+ } catch (e) {
+ console.error("Failed to parse sync history:", e);
+ }
+ }
+
// Fetch suggested vault paths
fetchVaultPaths();
@@ -211,6 +228,13 @@ export function ObsidianSyncCard() {
listen<ObsidianSyncStatus>("obsidian_sync_completed", (event) => {
setStatus(event.payload);
setSyncStatusMessage("");
+ // Add to history
+ const newEntry: SyncHistoryEntry = { timestamp: new Date().toISOString(), status: "success" };
+ setSyncHistory(prev => {
+ const updated = [newEntry, ...prev].slice(0, 10);
+ localStorage.setItem("obsidian-sync-history", JSON.stringify(updated));
+ return updated;
+ });
toast({
title: "Obsidian sync completed",
description: "Your activity has been synced to Obsidian",
@@ -224,6 +248,13 @@ export function ObsidianSyncCard() {
lastError: event.payload,
}));
setSyncStatusMessage("");
+ // Add to history
+ const newEntry: SyncHistoryEntry = { timestamp: new Date().toISOString(), status: "error", error: event.payload };
+ setSyncHistory(prev => {
+ const updated = [newEntry, ...prev].slice(0, 10);
+ localStorage.setItem("obsidian-sync-history", JSON.stringify(updated));
+ return updated;
+ });
toast({
variant: "destructive",
title: "Obsidian sync failed",
@@ -651,7 +682,7 @@ export function ObsidianSyncCard() {
)}
{/* Status Bar */}
- <div className="px-6 py-3 bg-muted/50 border-t border-border">
+ <div className="px-6 py-3 bg-muted/50 border-t border-border space-y-2">
<div className="flex items-center justify-between text-sm text-muted-foreground">
<div className="flex items-center gap-4">
<span>
@@ -673,6 +704,29 @@ export function ObsidianSyncCard() {
</span>
)}
</div>
+
+ {/* Sync History */}
+ {syncHistory.length > 0 && (
+ <div className="text-xs text-muted-foreground">
+ <div className="flex items-center gap-2 flex-wrap">
+ <span>Recent:</span>
+ {syncHistory.slice(0, 5).map((entry, i) => (
+ <span
+ key={i}
+ className={`px-1.5 py-0.5 rounded ${
+ entry.status === "success"
+ ? "bg-green-500/10 text-green-600"
+ : "bg-red-500/10 text-red-500"
+ }`}
+ title={entry.error || "Success"}
+ >
+ {new Date(entry.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
+ {entry.status === "success" ? " ✓" : " ✗"}
+ </span>
+ ))}
+ </div>
+ </div>
+ )}
</div>
</CardContent>
</Card>
diff --git a/screenpipe-app-tauri/src-tauri/src/pi.rs b/screenpipe-app-tauri/src-tauri/src/pi.rs
index 43cca0f2f..e22db3492 100644
--- a/screenpipe-app-tauri/src-tauri/src/pi.rs
+++ b/screenpipe-app-tauri/src-tauri/src/pi.rs
@@ -7,7 +7,7 @@ use tracing::{debug, error, info, warn};
const PI_PACKAGE: &str = "@mariozechner/pi-coding-agent";
const SCREENPIPE_API_URL: &str = "https://api.screenpi.pe/v1";
-const DEFAULT_MODEL: &str = "claude-opus-4-5@20251101";
+const DEFAULT_MODEL: &str = "claude-haiku-4-5@20251001"; // Haiku for speed/cost
/// Ensure pi CLI is installed/updated via bun
pub async fn ensure_installed() -> Result<(), String> {
diff --git a/screenpipe-server/src/analytics.rs b/screenpipe-server/src/analytics.rs
index 97a868c93..d61bb36be 100644
--- a/screenpipe-server/src/analytics.rs
+++ b/screenpipe-server/src/analytics.rs
@@ -3,7 +3,8 @@ use reqwest::Client;
use serde_json::{json, Value};
use std::env;
use std::sync::atomic::{AtomicBool, Ordering};
-use tracing::{debug, error, trace};
+use sysinfo::{System, SystemExt};
+use tracing::{debug, error, trace, warn};
const POSTHOG_API_KEY: &str = "phc_Bt8GoTBPgkCpDrbaIZzJIEYt0CrJjhBiuLaBck1clce";
const POSTHOG_HOST: &str = "https://eu.i.posthog.com";
@@ -96,3 +97,91 @@ pub fn capture_event_nonblocking(event: &'static str, properties: Value) {
capture_event(event, properties).await;
});
}
+
+/// Parse macOS version string (e.g., "14.5" or "10.15.7") into major version number
+#[cfg(target_os = "macos")]
+fn parse_macos_major_version(version_str: &str) -> Option<u32> {
+ version_str.split('.').next()?.parse().ok()
+}
+
+/// Check macOS version and send telemetry event if below recommended versions.
+/// This helps track users on older macOS versions that may have compatibility issues.
+///
+/// Thresholds:
+/// - Below 12 (Monterey): ScreenCaptureKit not available at all
+/// - Below 14 (Sonoma): sck-rs may have issues, recommended to upgrade
+#[cfg(target_os = "macos")]
+pub fn check_macos_version() {
+ if !TELEMETRY_ENABLED.load(Ordering::SeqCst) {
+ return;
+ }
+
+ let sys = System::new();
+ let os_version = sys.os_version().unwrap_or_default();
+ let os_name = sys.name().unwrap_or_default();
+
+ // Only check on macOS
+ if !os_name.to_lowercase().contains("mac") {
+ return;
+ }
+
+ let major_version = match parse_macos_major_version(&os_version) {
+ Some(v) => v,
+ None => {
+ debug!("Could not parse macOS version: {}", os_version);
+ return;
+ }
+ };
+
+ // Determine version category
+ let (below_12, below_14) = (major_version < 12, major_version < 14);
+
+ if !below_12 && !below_14 {
+ debug!("macOS version {} is supported", os_version);
+ return;
+ }
+
+ // Log warning for user
+ if below_12 {
+ warn!(
+ "macOS {} detected. Screen recording requires macOS 12.3+ (Monterey). \
+ Please upgrade your macOS for screen capture to work.",
+ os_version
+ );
+ } else if below_14 {
+ warn!(
+ "macOS {} detected. For best screen capture performance, \
+ macOS 14+ (Sonoma) is recommended.",
+ os_version
+ );
+ }
+
+ // Send telemetry event
+ let event_name: &'static str = if below_12 {
+ "macos_version_below_12"
+ } else {
+ "macos_version_below_14"
+ };
+
+ capture_event_nonblocking(
+ event_name,
+ json!({
+ "os_version": os_version,
+ "major_version": major_version,
+ "below_12": below_12,
+ "below_14": below_14,
+ "screen_capture_supported": !below_12,
+ }),
+ );
+
+ debug!(
+ "Sent {} event for macOS {}",
+ event_name, os_version
+ );
+}
+
+/// No-op on non-macOS platforms
+#[cfg(not(target_os = "macos"))]
+pub fn check_macos_version() {
+ // Only relevant on macOS
+}
diff --git a/screenpipe-server/src/bin/screenpipe-server.rs b/screenpipe-server/src/bin/screenpipe-server.rs
index 1dd94e6f5..9b16940a0 100644
--- a/screenpipe-server/src/bin/screenpipe-server.rs
+++ b/screenpipe-server/src/bin/screenpipe-server.rs
@@ -707,6 +707,10 @@ async fn main() -> anyhow::Result<()> {
// Initialize analytics for API tracking
analytics::init(!cli.disable_telemetry);
+ // Check macOS version and send telemetry if below supported versions
+ // This helps track users who may have screen capture issues due to old macOS
+ analytics::check_macos_version();
+
// Start sleep/wake monitor for telemetry (macOS only)
// This tracks sleep/wake events and checks if recording is degraded after wake
start_sleep_monitor();