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.89

Louis Beaumontd616f7e0c2d2
diff --git a/apps/screenpipe-app-tauri/app/settings/page.tsx b/apps/screenpipe-app-tauri/app/home/page.tsx
similarity index 100%
rename from apps/screenpipe-app-tauri/app/settings/page.tsx
rename to apps/screenpipe-app-tauri/app/home/page.tsx
diff --git a/apps/screenpipe-app-tauri/components/deeplink-handler.tsx b/apps/screenpipe-app-tauri/components/deeplink-handler.tsx
index 852cd27ab..6a87c7172 100644
--- a/apps/screenpipe-app-tauri/components/deeplink-handler.tsx
+++ b/apps/screenpipe-app-tauri/components/deeplink-handler.tsx
@@ -80,7 +80,7 @@ export function DeeplinkHandler() {
});
}
- if (url.includes("settings")) {
+ if (url.includes("settings") || url.includes("home")) {
await openSettingsWindow();
}
diff --git a/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
index eb772548b..9d9719d4e 100644
--- a/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
@@ -250,11 +250,11 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
// --- Live Text hook (native macOS VisionKit overlay) ---
// Determine which window/panel to attach VisionKit overlay to.
- // In embedded mode, use the "settings" window (regular WebviewWindow).
+ // In embedded mode, use the "home" window (regular WebviewWindow).
// The overlay is positioned precisely over the frame using absolute
// coordinates from containerRef + renderedImageInfo.
const liveTextWindowLabel = embedded
- ? "settings"
+ ? "home"
: settings?.overlayMode === "window" ? "main-window" : "main";
const { nativeLiveTextActive } = useLiveText({
diff --git a/apps/screenpipe-app-tauri/components/settings/ai-presets.tsx b/apps/screenpipe-app-tauri/components/settings/ai-presets.tsx
index 7380d2ad7..e728a4a69 100644
--- a/apps/screenpipe-app-tauri/components/settings/ai-presets.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/ai-presets.tsx
@@ -475,6 +475,7 @@ const AISection = ({
} else if (isAnthropic && settingsPreset?.apiKey) {
headers["x-api-key"] = settingsPreset.apiKey;
headers["anthropic-version"] = "2023-06-01";
+ headers["anthropic-dangerous-direct-browser-access"] = "true";
} else if (settingsPreset?.apiKey) {
headers["Authorization"] = `Bearer ${settingsPreset.apiKey}`;
}
@@ -777,6 +778,7 @@ const AISection = ({
headers: {
"x-api-key": settingsPreset?.apiKey || "",
"anthropic-version": "2023-06-01",
+ "anthropic-dangerous-direct-browser-access": "true",
},
});
if (anthropicResp.ok) {
diff --git a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
index eecd72c95..017c17f8c 100644
--- a/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/general-settings.tsx
@@ -229,45 +229,6 @@ export default function GeneralSettings() {
</Card>
</div>
- {/* pipe suggestions */}
- <div className="space-y-2">
- <Card className="border-border bg-card">
- <CardContent className="px-3 py-2.5">
- <div className="flex items-center justify-between">
- <div className="flex items-center space-x-2.5">
- <Lightbulb className="h-4 w-4 text-muted-foreground shrink-0" />
- <div>
- <h3 className="text-sm font-medium text-foreground">Pipe suggestions</h3>
- <p className="text-xs text-muted-foreground">Get periodic notifications with automation ideas based on your data</p>
- </div>
- </div>
- <div className="flex items-center gap-3">
- <select
- className="text-xs border rounded px-2 py-1 bg-background"
- value={settings?.pipeSuggestionFrequencyHours ?? 24}
- onChange={(e) =>
- handleSettingsChange({ pipeSuggestionFrequencyHours: parseInt(e.target.value, 10) })
- }
- disabled={settings?.pipeSuggestionsEnabled === false}
- >
- <option value={6}>every 6h</option>
- <option value={12}>every 12h</option>
- <option value={24}>daily</option>
- <option value={72}>every 3 days</option>
- <option value={168}>weekly</option>
- </select>
- <Switch
- checked={settings?.pipeSuggestionsEnabled !== false}
- onCheckedChange={(checked) =>
- handleSettingsChange({ pipeSuggestionsEnabled: checked })
- }
- />
- </div>
- </div>
- </CardContent>
- </Card>
- </div>
-
</div>
);
}
diff --git a/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx b/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx
index 0d61f6ce3..5b0e64659 100644
--- a/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx
@@ -76,6 +76,7 @@ import { useHealthCheck } from "@/lib/hooks/use-health-check";
import { Badge } from "@/components/ui/badge";
import { HelpTooltip } from "@/components/ui/help-tooltip";
import { Switch } from "@/components/ui/switch";
+import { Slider } from "@/components/ui/slider";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { platform } from "@tauri-apps/plugin-os";
@@ -1559,6 +1560,35 @@ Your screen is a pipe. Everything you see, hear, and type flows through it. Scre
}
/>
</div>
+ {["smart", "batch"].includes(settings.transcriptionMode ?? "realtime") && (
+ <div className="mt-2.5 pt-2.5 border-t border-border/50">
+ <div className="flex items-center justify-between mb-1.5">
+ <span className="text-xs text-muted-foreground flex items-center gap-1.5">
+ Max batch duration
+ <HelpTooltip text="Maximum duration of audio to batch before transcribing. Longer batches give better context for transcription quality. 0 = auto (engine default: Deepgram 1h, Whisper/OpenAI 10min)." />
+ </span>
+ <span className="text-xs font-mono text-foreground">
+ {(settings.batchMaxDurationSecs ?? 0) === 0
+ ? "auto"
+ : `${Math.floor((settings.batchMaxDurationSecs ?? 0) / 60)}min`}
+ </span>
+ </div>
+ <Slider
+ value={[settings.batchMaxDurationSecs ?? 0]}
+ onValueChange={([value]) =>
+ handleSettingsChange({ batchMaxDurationSecs: value }, true)
+ }
+ min={0}
+ max={3600}
+ step={60}
+ className="w-full"
+ />
+ <div className="flex justify-between text-[10px] text-muted-foreground mt-0.5">
+ <span>auto</span>
+ <span>60min</span>
+ </div>
+ </div>
+ )}
</CardContent>
</Card>
)}
diff --git a/apps/screenpipe-app-tauri/components/update-banner.tsx b/apps/screenpipe-app-tauri/components/update-banner.tsx
index b30be4678..760dc296d 100644
--- a/apps/screenpipe-app-tauri/components/update-banner.tsx
+++ b/apps/screenpipe-app-tauri/components/update-banner.tsx
@@ -149,7 +149,7 @@ export function UpdateBanner({ className, compact = false }: UpdateBannerProps)
variant="ghost"
size="sm"
className="h-5 px-2 text-xs"
- onClick={() => window.location.href = "/settings"}
+ onClick={() => window.location.href = "/home"}
>
sign in to update
</Button>
@@ -172,7 +172,7 @@ export function UpdateBanner({ className, compact = false }: UpdateBannerProps)
variant="default"
size="sm"
className="h-7 px-3 text-xs"
- onClick={() => window.location.href = "/settings"}
+ onClick={() => window.location.href = "/home"}
>
sign in
</Button>
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index c878405e0..efd2dfc7b 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -131,6 +131,8 @@ export type Settings = SettingsStore & {
openaiCompatibleModel?: string;
/** Filter music-dominant audio before transcription (reduces Spotify/YouTube music noise) */
filterMusic?: boolean;
+ /** Maximum batch transcription duration in seconds (0 = engine default: Deepgram 3600s, Whisper 600s) */
+ batchMaxDurationSecs?: number;
/** Show periodic notifications suggesting pipe ideas based on user's data (default: true) */
pipeSuggestionsEnabled?: boolean;
/** Hours between pipe suggestion notifications (default: 24) */
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index ae533c342..f65a7b455 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -9172,7 +9172,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.2.87"
+version = "2.2.88"
dependencies = [
"anyhow",
"arboard",
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index a01e87336..c2cfb43ea 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.88"
+version = "2.2.89"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-api/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-api/SKILL.md
index 9e57f6fce..739b72f8d 100644
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-api/SKILL.md
+++ b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-api/SKILL.md
@@ -195,6 +195,7 @@ curl -X POST http://localhost:3030/raw_sql \
| `speakers` | `name`, `metadata` | — |
| `ui_events` | `event_type`, `app_name`, `window_title`, `browser_url` | `timestamp` |
| `accessibility` | `app_name`, `window_name`, `text_content`, `browser_url` | `timestamp` |
+| `meetings` | `meeting_app`, `title`, `attendees`, `detection_source` | `meeting_start` |
### Example Queries
@@ -250,7 +251,30 @@ If not connected, tell user to set up in Settings > Connections.
---
-## 9. Other Endpoints
+## 9. Meetings — `GET /meetings`
+
+```bash
+curl "http://localhost:3030/meetings?start_time=1d%20ago&end_time=now&limit=10&offset=0"
+curl "http://localhost:3030/meetings/42"
+```
+
+Returns detected meetings (from calendar, app detection, window titles, UI elements, multi-speaker audio).
+
+| Field | Type | Description |
+|-------|------|-------------|
+| `id` | integer | Meeting ID |
+| `meeting_start` | ISO 8601 | Start time |
+| `meeting_end` | ISO 8601? | End time (null if ongoing) |
+| `meeting_app` | string | App (zoom, teams, meet, etc.) |
+| `title` | string? | Meeting title |
+| `attendees` | string? | Attendees |
+| `detection_source` | string | How detected (`app`, `calendar`, `ui`, etc.) |
+
+Also available via raw SQL: `SELECT * FROM meetings WHERE meeting_start > datetime('now', '-24 hours') LIMIT 20`
+
+---
+
+## 10. Other Endpoints
```bash
curl http://localhost:3030/health # Health check
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
index f64ba2172..7f185f4cf 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs
@@ -85,7 +85,7 @@ pub fn show_main_window(app_handle: &tauri::AppHandle, _overlay: bool) {
#[cfg(target_os = "macos")]
let window_to_show = ShowRewindWindow::Main;
#[cfg(not(target_os = "macos"))]
- let window_to_show = ShowRewindWindow::Settings { page: None };
+ let window_to_show = ShowRewindWindow::Home { page: None };
match window_to_show.show(app_handle) {
Ok(window) => {
@@ -127,7 +127,7 @@ pub fn hide_main_window(app_handle: &tauri::AppHandle) {
#[cfg(target_os = "macos")]
let window_to_close = ShowRewindWindow::Main;
#[cfg(not(target_os = "macos"))]
- let window_to_close = ShowRewindWindow::Settings { page: None };
+ let window_to_close = ShowRewindWindow::Home { page: None };
if let Err(e) = window_to_close.close(app_handle) {
error!("failed to close window: {}", e);
@@ -242,7 +242,7 @@ pub fn update_show_screenpipe_shortcut(
}
#[cfg(not(target_os = "macos"))]
{
- if let Some(window) = app_handle.get_webview_window("settings") {
+ if let Some(window) = app_handle.get_webview_window("home") {
match window.is_visible() {
Ok(true) => hide_main_window(app_handle),
_ => show_main_window(app_handle, true),
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
index 2a2ba5aa2..74b8b4dc8 100755
--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -139,7 +139,7 @@ fn setup_dock_menu(app_handle: AppHandle) {
if let Some(ref app) = DOCK_APP_HANDLE {
let app_for_closure = app.clone();
let _ = app.run_on_main_thread(move || {
- let _ = ShowRewindWindow::Settings { page: None }.show(&app_for_closure);
+ let _ = ShowRewindWindow::Home { page: None }.show(&app_for_closure);
});
}
}
@@ -437,9 +437,9 @@ async fn apply_shortcuts(app: &AppHandle, config: &ShortcutConfig) -> Result<(),
}
#[cfg(not(target_os = "macos"))]
{
- // Windows uses the Settings window (embedded timeline) as main UI.
- // Check "settings" label directly instead of overlay labels.
- let label = "settings";
+ // Windows uses the Home window (embedded timeline) as main UI.
+ // Check "home" label directly instead of overlay labels.
+ let label = "home";
if let Some(window) = app.get_webview_window(label) {
info!("found {} window, checking visibility", label);
@@ -593,8 +593,8 @@ async fn apply_shortcuts(app: &AppHandle, config: &ShortcutConfig) -> Result<(),
}
#[cfg(not(target_os = "macos"))]
{
- // Windows uses "settings" window (embedded timeline)
- let label = "settings";
+ // Windows uses "home" window (embedded timeline)
+ let label = "home";
if let Some(window) = app.get_webview_window(label) {
// On Windows, minimized windows still report is_visible()=true
let needs_show = !window.is_visible().unwrap_or(false)
@@ -1495,7 +1495,7 @@ async fn main() {
// clicks X. For other windows, minimize or hide.
#[cfg(target_os = "windows")]
{
- if window.label() == "settings" {
+ if window.label() == "home" {
// Let the close proceed (don't prevent it)
return;
} else if window.label() == "main-window" {
@@ -1757,7 +1757,7 @@ async fn main() {
// Defer off event stack (same as tray: runs from tao::send_event).
let app_for_closure = app_handle.clone();
let _ = app_handle.run_on_main_thread(move || {
- let _ = ShowRewindWindow::Settings { page: None }.show(&app_for_closure);
+ let _ = ShowRewindWindow::Home { page: None }.show(&app_for_closure);
});
}
"check_for_updates" => {
@@ -2011,7 +2011,7 @@ async fn main() {
if !onboarding_store.is_completed {
let _ = ShowRewindWindow::Onboarding.show(&app.handle());
} else {
- let _ = ShowRewindWindow::Settings { page: None }.show(&app.handle());
+ let _ = ShowRewindWindow::Home { page: None }.show(&app.handle());
}
// Pre-create chat panel (hidden) so the shortcut can show an
@@ -2461,7 +2461,7 @@ async fn main() {
} => {
if let Ok(window_id) = RewindWindowId::from_str(label.as_str()) {
match window_id {
- RewindWindowId::Settings => {
+ RewindWindowId::Home => {
// Closing Settings hides the Main panel (it's always a panel now).
// Defer off the event stack: run handler must stay panic-free.
let app = app_handle.app_handle().clone();
@@ -2480,7 +2480,7 @@ async fn main() {
// Open the settings/app window (not the timeline overlay).
let app = app_handle.app_handle().clone();
let _ = app_handle.app_handle().run_on_main_thread(move || {
- let _ = ShowRewindWindow::Settings { page: None }.show(&app);
+ let _ = ShowRewindWindow::Home { page: None }.show(&app);
});
}
_ => {}
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index f5b39c8f1..7c1ed6ff9 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -744,6 +744,11 @@ impl SettingsStore {
.ok()
})
.unwrap_or_default(),
+ batch_max_duration_secs: self
+ .extra
+ .get("batchMaxDurationSecs")
+ .and_then(|v| v.as_u64())
+ .filter(|&v| v > 0),
}
}
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/tray.rs b/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
index 068941d84..9af006796 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
@@ -477,7 +477,7 @@ fn setup_tray_click_handlers(main_tray: &TrayIcon) -> Result<()> {
{
let app = tray.app_handle().clone();
let _ = tray.app_handle().run_on_main_thread(move || {
- let _ = ShowRewindWindow::Settings { page: None }.show(&app);
+ let _ = ShowRewindWindow::Home { page: None }.show(&app);
});
}
});
@@ -539,7 +539,7 @@ fn handle_menu_event(app_handle: &AppHandle, event: tauri::menu::MenuEvent) {
"upgrade" => {
let app = app_handle.clone();
let _ = app_handle.run_on_main_thread(move || {
- let _ = ShowRewindWindow::Settings {
+ let _ = ShowRewindWindow::Home {
page: Some("account".to_string()),
}
.show(&app);
@@ -598,14 +598,14 @@ fn handle_menu_event(app_handle: &AppHandle, event: tauri::menu::MenuEvent) {
"settings" | "settings_top" => {
let app = app_handle.clone();
let _ = app_handle.run_on_main_thread(move || {
- let _ = ShowRewindWindow::Settings { page: None }.show(&app);
+ let _ = ShowRewindWindow::Home { page: None }.show(&app);
});
}
"feedback" => {
let app = app_handle.clone();
let page = Some("help".to_string());
let _ = app_handle.run_on_main_thread(move || {
- let _ = ShowRewindWindow::Settings { page }.show(&app);
+ let _ = ShowRewindWindow::Home { page }.show(&app);
});
}
"book_call" => {
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
index 0e9d540fc..6053dc26d 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs
@@ -323,7 +323,7 @@ fn restore_frontmost_app_if_external_with_app(app: Option<&AppHandle>) {
// These are regular windows (not panels) that may be on another Space —
// we don't want to activate a previous app and bury them.
if let Some(app) = app {
- let non_panel_labels = ["settings", "chat", "search"];
+ let non_panel_labels = ["home", "chat", "search"];
for label in &non_panel_labels {
if app.get_webview_window(label).is_some() {
info!(
@@ -707,7 +707,7 @@ pub async fn close_window(
pub enum RewindWindowId {
Main,
- Settings,
+ Home,
Search,
Onboarding,
Chat,
@@ -720,7 +720,7 @@ impl FromStr for RewindWindowId {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"main" => Ok(RewindWindowId::Main),
- "settings" => Ok(RewindWindowId::Settings),
+ "home" | "settings" => Ok(RewindWindowId::Home),
"search" => Ok(RewindWindowId::Search),
"onboarding" => Ok(RewindWindowId::Onboarding),
"chat" => Ok(RewindWindowId::Chat),
@@ -734,7 +734,7 @@ impl std::fmt::Display for RewindWindowId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
RewindWindowId::Main => write!(f, "main"),
- RewindWindowId::Settings => write!(f, "settings"),
+ RewindWindowId::Home => write!(f, "home"),
RewindWindowId::Search => write!(f, "search"),
RewindWindowId::Onboarding => write!(f, "onboarding"),
RewindWindowId::Chat => write!(f, "chat"),
@@ -747,7 +747,7 @@ impl RewindWindowId {
pub fn label(&self) -> &str {
match self {
RewindWindowId::Main => "main",
- RewindWindowId::Settings => "settings",
+ RewindWindowId::Home => "home",
RewindWindowId::Search => "search",
RewindWindowId::Onboarding => "onboarding",
RewindWindowId::Chat => "chat",
@@ -758,7 +758,7 @@ impl RewindWindowId {
pub fn title(&self) -> &str {
match self {
RewindWindowId::Main => "screenpipe",
- RewindWindowId::Settings => "settings",
+ RewindWindowId::Home => "screenpipe",
RewindWindowId::Search => "search",
RewindWindowId::Onboarding => "onboarding",
RewindWindowId::Chat => "ai chat",
@@ -769,7 +769,7 @@ impl RewindWindowId {
pub fn min_size(&self) -> Option<(f64, f64)> {
Some(match self {
RewindWindowId::Main => (800.0, 600.0),
- RewindWindowId::Settings => (800.0, 600.0),
+ RewindWindowId::Home => (800.0, 600.0),
RewindWindowId::Search => (800.0, 600.0),
RewindWindowId::Onboarding => (450.0, 500.0),
RewindWindowId::Chat => (600.0, 750.0),
@@ -800,7 +800,7 @@ fn screen_aware_size(app: &AppHandle, desired_w: f64, desired_h: f64) -> (f64, f
#[derive(Serialize, Deserialize, Debug, Clone, specta::Type)]
pub enum ShowRewindWindow {
Main,
- Settings { page: Option<String> },
+ Home { page: Option<String> },
Search { query: Option<String> },
Onboarding,
Chat,
@@ -872,7 +872,7 @@ impl ShowRewindWindow {
pub fn id(&self) -> RewindWindowId {
match self {
ShowRewindWindow::Main => RewindWindowId::Main,
- ShowRewindWindow::Settings { page: _ } => RewindWindowId::Settings,
+ ShowRewindWindow::Home { page: _ } => RewindWindowId::Home,
ShowRewindWindow::Search { query: _ } => RewindWindowId::Search,
ShowRewindWindow::Onboarding => RewindWindowId::Onboarding,
ShowRewindWindow::Chat => RewindWindowId::Chat,
@@ -883,7 +883,7 @@ impl ShowRewindWindow {
pub fn metadata(&self) -> Option<String> {
match self {
ShowRewindWindow::Main => None,
- ShowRewindWindow::Settings { page: _ } => None,
+ ShowRewindWindow::Home { page: _ } => None,
ShowRewindWindow::Search { query } => {
Some(query.clone().unwrap_or_default().to_string())
}
@@ -1091,14 +1091,14 @@ impl ShowRewindWindow {
// Settings window: navigate to the requested section if specified
// and ensure it comes to front (macOS set_focus alone is unreliable from tray context)
- if id.label() == RewindWindowId::Settings.label() {
- if let ShowRewindWindow::Settings {
+ if id.label() == RewindWindowId::Home.label() {
+ if let ShowRewindWindow::Home {
page: Some(ref section),
} = self
{
let _ = window.emit(
"navigate",
- serde_json::json!({ "url": format!("/settings?section={}", section) }),
+ serde_json::json!({ "url": format!("/home?section={}", section) }),
);
}
window.show().ok();
@@ -1791,10 +1791,10 @@ impl ShowRewindWindow {
window
}
- ShowRewindWindow::Settings { page } => {
+ ShowRewindWindow::Home { page } => {
let url = match page {
- Some(p) => format!("/settings?section={}", p),
- None => "/settings".to_string(),
+ Some(p) => format!("/home?section={}", p),
+ None => "/home".to_string(),
};
let builder = self.window_builder(app, &url).focused(true);
#[cfg(target_os = "macos")]
@@ -2075,7 +2075,7 @@ impl ShowRewindWindow {
// On Windows, minimize the Settings window instead of closing it
// so it stays in the taskbar and can be restored quickly.
#[cfg(target_os = "windows")]
- if id.label() == RewindWindowId::Settings.label() {
+ if id.label() == RewindWindowId::Home.label() {
window.minimize().ok();
return Ok(());
}
diff --git a/crates/screenpipe-a11y/examples/linux_test.rs b/crates/screenpipe-a11y/examples/linux_test.rs
index 48643629d..27d97e97a 100644
--- a/crates/screenpipe-a11y/examples/linux_test.rs
+++ b/crates/screenpipe-a11y/examples/linux_test.rs
@@ -5,7 +5,7 @@
//! Quick smoke test for the Linux AT-SPI2 tree walker.
//! Run inside Docker: cargo run --example linux_test -p screenpipe-a11y
-use screenpipe_a11y::tree::{create_tree_walker, TreeWalkerConfig};
+use screenpipe_a11y::tree::{create_tree_walker, TreeWalkResult, TreeWalkerConfig};
use std::time::Duration;
fn main() {
@@ -23,7 +23,7 @@ fn main() {
println!("Walking focused window's accessibility tree...\n");
match walker.walk_focused_window() {
- Ok(Some(snapshot)) => {
+ Ok(TreeWalkResult::Found(snapshot)) => {
println!("SUCCESS! Got tree snapshot:");
println!(" App: {}", snapshot.app_name);
println!(" Window: {}", snapshot.window_name);
@@ -53,7 +53,10 @@ fn main() {
);
}
}
- Ok(None) => {
+ Ok(TreeWalkResult::Skipped) => {
+ println!("Window skipped (incognito/private or filtered).");
+ }
+ Ok(TreeWalkResult::NotFound) => {
println!("No focused window found (or no text content).");
println!("Make sure a window is focused in the desktop.");
}
diff --git a/crates/screenpipe-a11y/src/tree/linux.rs b/crates/screenpipe-a11y/src/tree/linux.rs
index afd23e544..19ae8d911 100644
--- a/crates/screenpipe-a11y/src/tree/linux.rs
+++ b/crates/screenpipe-a11y/src/tree/linux.rs
@@ -16,8 +16,8 @@
//! - Enable with: `gsettings set org.gnome.desktop.interface toolkit-accessibility true`
use super::{
- AccessibilityTreeNode, NodeBounds, TreeSnapshot, TreeWalkerConfig, TreeWalkerPlatform,
- TruncationReason,
+ AccessibilityTreeNode, NodeBounds, TreeSnapshot, TreeWalkResult, TreeWalkerConfig,
+ TreeWalkerPlatform, TruncationReason,
};
use anyhow::{Context, Result};
use chrono::Utc;
@@ -851,7 +851,7 @@ impl LinuxTreeWalker {
}
impl TreeWalkerPlatform for LinuxTreeWalker {
- fn walk_focused_window(&self) -> Result<Option<TreeSnapshot>> {
+ fn walk_focused_window(&self) -> Result<TreeWalkResult> {
let start = Instant::now();
// Safety: single-threaded access guaranteed by walker thread design
@@ -860,14 +860,14 @@ impl TreeWalkerPlatform for LinuxTreeWalker {
// Find the focused window
let (app_name, window_title, window_ref, _pid) = match find_focused_window(conn) {
Some(result) => result,
- None => return Ok(None),
+ None => return Ok(TreeWalkResult::NotFound),
};
// Skip incognito / private browsing windows (localized title check)
if self.config.ignore_incognito_windows
&& crate::incognito::is_title_private(&window_title)
{
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
let app_lower = app_name.to_lowercase();
@@ -878,7 +878,7 @@ impl TreeWalkerPlatform for LinuxTreeWalker {
let p = pattern.to_lowercase();
app_lower.contains(&p) || window_lower.contains(&p)
}) {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
// Apply user-configured included windows (whitelist)
@@ -888,7 +888,7 @@ impl TreeWalkerPlatform for LinuxTreeWalker {
app_lower.contains(&p) || window_lower.contains(&p)
});
if !matches {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
}
@@ -940,7 +940,7 @@ impl TreeWalkerPlatform for LinuxTreeWalker {
walk_duration
);
- Ok(Some(TreeSnapshot {
+ Ok(TreeWalkResult::Found(TreeSnapshot {
app_name,
window_name: window_title,
text_content,
diff --git a/crates/screenpipe-a11y/src/tree/macos.rs b/crates/screenpipe-a11y/src/tree/macos.rs
index e88a1f61d..ccc2ee78d 100644
--- a/crates/screenpipe-a11y/src/tree/macos.rs
+++ b/crates/screenpipe-a11y/src/tree/macos.rs
@@ -4,7 +4,9 @@
//! macOS accessibility tree walker using cidre AX APIs.
-use super::{AccessibilityTreeNode, TreeSnapshot, TreeWalkerConfig, TreeWalkerPlatform};
+use super::{
+ AccessibilityTreeNode, TreeSnapshot, TreeWalkResult, TreeWalkerConfig, TreeWalkerPlatform,
+};
use anyhow::Result;
use chrono::Utc;
use cidre::{ax, cf, ns};
@@ -167,14 +169,14 @@ impl MacosTreeWalker {
}
impl TreeWalkerPlatform for MacosTreeWalker {
- fn walk_focused_window(&self) -> Result<Option<TreeSnapshot>> {
+ fn walk_focused_window(&self) -> Result<TreeWalkResult> {
// Wrap in autorelease pool — cidre AX/NS APIs create autoreleased
// ObjC objects. Without this, objects accumulate on the tokio
// blocking thread (reused across calls), causing a memory leak
// proportional to capture rate.
// Note: ar_pool requires R: Clone, so we return Result<_, String>
// and convert back to anyhow::Error.
- cidre::objc::ar_pool(|| -> Result<Option<TreeSnapshot>, String> {
+ cidre::objc::ar_pool(|| -> Result<TreeWalkResult, String> {
self.walk_focused_window_inner()
.map_err(|e| format!("{}", e))
})
@@ -183,7 +185,7 @@ impl TreeWalkerPlatform for MacosTreeWalker {
}
impl MacosTreeWalker {
- fn walk_focused_window_inner(&self) -> Result<Option<TreeSnapshot>> {
+ fn walk_focused_window_inner(&self) -> Result<TreeWalkResult> {
let start = Instant::now();
// 1. Get the focused application via the AX system-wide element.
@@ -192,14 +194,14 @@ impl MacosTreeWalker {
let sys = ax::UiElement::sys_wide();
let focused_app = match sys.focused_app() {
Ok(app) => app,
- Err(_) => return Ok(None),
+ Err(_) => return Ok(TreeWalkResult::NotFound),
};
let pid = match focused_app.pid() {
Ok(pid) => pid,
- Err(_) => return Ok(None),
+ Err(_) => return Ok(TreeWalkResult::NotFound),
};
let Some(app) = ns::RunningApp::with_pid(pid) else {
- return Ok(None);
+ return Ok(TreeWalkResult::NotFound);
};
let app_name = app
@@ -220,7 +222,7 @@ impl MacosTreeWalker {
"loginwindow",
];
if EXCLUDED_APPS.iter().any(|ex| app_lower.contains(ex)) {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
// Apply user-configured ignored windows (check app name)
@@ -228,7 +230,7 @@ impl MacosTreeWalker {
let p = pattern.to_lowercase();
app_lower.contains(&p)
}) {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
// 2. Get the focused window via AX API
@@ -247,11 +249,11 @@ impl MacosTreeWalker {
let window_val = match ax_app.attr_value(ax::attr::focused_window()) {
Ok(v) => v,
- Err(_) => return Ok(None),
+ Err(_) => return Ok(TreeWalkResult::NotFound),
};
if window_val.get_type_id() != ax::UiElement::type_id() {
- return Ok(None);
+ return Ok(TreeWalkResult::NotFound);
}
let window: &ax::UiElement = unsafe { std::mem::transmute(&*window_val) };
@@ -263,7 +265,7 @@ impl MacosTreeWalker {
if self.config.ignore_incognito_windows
&& self.incognito_detector.is_incognito(&app_name, 0, &window_name)
{
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
// Apply user-configured ignored windows (also check window title)
@@ -272,7 +274,7 @@ impl MacosTreeWalker {
let p = pattern.to_lowercase();
window_lower.contains(&p)
}) {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
// Apply user-configured included windows (also check window title)
@@ -286,7 +288,7 @@ impl MacosTreeWalker {
window_lower.contains(&p)
});
if !matches_app && !matches_window {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
}
@@ -341,7 +343,7 @@ impl MacosTreeWalker {
walk_duration
);
- Ok(Some(TreeSnapshot {
+ Ok(TreeWalkResult::Found(TreeSnapshot {
app_name,
window_name,
text_content,
@@ -765,7 +767,7 @@ mod tests {
..Default::default()
};
let walker = MacosTreeWalker::new(config);
- if let Ok(Some(snapshot)) = walker.walk_focused_window() {
+ if let Ok(TreeWalkResult::Found(snapshot)) = walker.walk_focused_window() {
assert!(snapshot.node_count <= 11); // +1 for the rounding in the check
}
}
diff --git a/crates/screenpipe-a11y/src/tree/mod.rs b/crates/screenpipe-a11y/src/tree/mod.rs
index 63ed4eafb..cd8c56115 100644
--- a/crates/screenpipe-a11y/src/tree/mod.rs
+++ b/crates/screenpipe-a11y/src/tree/mod.rs
@@ -185,11 +185,21 @@ impl Default for TreeWalkerConfig {
}
}
+/// Result of a tree walk attempt.
+#[derive(Debug, Clone)]
+pub enum TreeWalkResult {
+ /// Successfully walked the tree and captured a snapshot.
+ Found(TreeSnapshot),
+ /// Window was skipped due to incognito/private browsing or user filters.
+ Skipped,
+ /// No focused window found or tree walk produced no text.
+ NotFound,
+}
+
/// Platform-specific tree walker trait.
pub trait TreeWalkerPlatform: Send {
/// Walk the focused window's accessibility tree.
- /// Returns `None` if no window is focused or no text is found.
- fn walk_focused_window(&self) -> Result<Option<TreeSnapshot>>;
+ fn walk_focused_window(&self) -> Result<TreeWalkResult>;
}
/// Create a platform-appropriate tree walker.
@@ -218,8 +228,8 @@ struct StubTreeWalker;
#[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "linux")))]
impl TreeWalkerPlatform for StubTreeWalker {
- fn walk_focused_window(&self) -> Result<Option<TreeSnapshot>> {
- Ok(None)
+ fn walk_focused_window(&self) -> Result<TreeWalkResult> {
+ Ok(TreeWalkResult::NotFound)
}
}
diff --git a/crates/screenpipe-a11y/src/tree/windows.rs b/crates/screenpipe-a11y/src/tree/windows.rs
index 204eb6b91..4658ab2c7 100644
--- a/crates/screenpipe-a11y/src/tree/windows.rs
+++ b/crates/screenpipe-a11y/src/tree/windows.rs
@@ -8,7 +8,8 @@
//! the focused window's tree and extract all visible text — matching macOS behavior.
use super::{
- AccessibilityTreeNode, NodeBounds, TreeSnapshot, TreeWalkerConfig, TreeWalkerPlatform,
+ AccessibilityTreeNode, NodeBounds, TreeSnapshot, TreeWalkResult, TreeWalkerConfig,
+ TreeWalkerPlatform,
};
use crate::events::AccessibilityNode;
use crate::platform::windows_uia::UiaContext;
@@ -164,7 +165,7 @@ impl Drop for WindowsTreeWalker {
}
impl TreeWalkerPlatform for WindowsTreeWalker {
- fn walk_focused_window(&self) -> Result<Option<TreeSnapshot>> {
+ fn walk_focused_window(&self) -> Result<TreeWalkResult> {
let start = Instant::now();
// Safety: single-threaded access guaranteed by walker thread design
@@ -173,7 +174,7 @@ impl TreeWalkerPlatform for WindowsTreeWalker {
// Get the focused window
let hwnd = unsafe { GetForegroundWindow() };
if hwnd == HWND::default() {
- return Ok(None);
+ return Ok(TreeWalkResult::NotFound);
}
// Get process info
@@ -185,7 +186,7 @@ impl TreeWalkerPlatform for WindowsTreeWalker {
// Skip excluded apps
let app_lower = app_name.to_lowercase();
if EXCLUDED_APPS.iter().any(|ex| app_lower.contains(ex)) {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
// Get window title
@@ -199,7 +200,7 @@ impl TreeWalkerPlatform for WindowsTreeWalker {
if self.config.ignore_incognito_windows
&& crate::incognito::is_title_private(&window_name)
{
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
// Apply user-configured ignored windows (check app name and window title)
@@ -208,7 +209,7 @@ impl TreeWalkerPlatform for WindowsTreeWalker {
let p = pattern.to_lowercase();
app_lower.contains(&p) || window_lower.contains(&p)
}) {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
// Apply user-configured included windows (whitelist mode)
@@ -218,19 +219,19 @@ impl TreeWalkerPlatform for WindowsTreeWalker {
app_lower.contains(&p) || window_lower.contains(&p)
});
if !matches {
- return Ok(None);
+ return Ok(TreeWalkResult::Skipped);
}
}
// Check timeout budget
if start.elapsed() >= self.config.walk_timeout {
- return Ok(None);
+ return Ok(TreeWalkResult::NotFound);
}
// Capture the accessibility tree
let root = match uia.capture_window_tree(hwnd, self.config.max_nodes) {
Some(tree) => tree,
- None => return Ok(None),
+ None => return Ok(TreeWalkResult::NotFound),
};
// Get monitor dimensions for normalizing element bounds to 0-1 coords
@@ -278,7 +279,7 @@ impl TreeWalkerPlatform for WindowsTreeWalker {
);
// Windows walker doesn't have timeout-based truncation yet — report as complete
- Ok(Some(TreeSnapshot {
+ Ok(TreeWalkResult::Found(TreeSnapshot {
app_name,
window_name,
text_content: text_buffer,
diff --git a/crates/screenpipe-a11y/tests/e2e_tree_walker.rs b/crates/screenpipe-a11y/tests/e2e_tree_walker.rs
index 4d06df9fa..e101e0fa3 100644
--- a/crates/screenpipe-a11y/tests/e2e_tree_walker.rs
+++ b/crates/screenpipe-a11y/tests/e2e_tree_walker.rs
@@ -20,7 +20,9 @@
#[cfg(target_os = "macos")]
mod e2e {
- use screenpipe_a11y::tree::{cache::TreeCache, create_tree_walker, TreeWalkerConfig};
+ use screenpipe_a11y::tree::{
+ cache::TreeCache, create_tree_walker, TreeWalkResult, TreeWalkerConfig,
+ };
use std::process::Command;
use std::time::{Duration, Instant};
@@ -137,9 +139,9 @@ mod e2e {
// Walk and verify
let result = walker.walk_focused_window();
assert!(result.is_ok(), "walk should not error");
- let snap = result.unwrap();
+ let walk_result = result.unwrap();
- if let Some(snap) = snap {
+ if let TreeWalkResult::Found(snap) = walk_result {
println!(
" Walk result: app={}, nodes={}, text_len={}, walk={:?}",
snap.app_name,
@@ -191,12 +193,13 @@ mod e2e {
return;
}
- let snap1 = walker.walk_focused_window().unwrap();
- if snap1.is_none() {
- eprintln!(" [skip] Finder returned no snapshot");
- return;
- }
- let snap1 = snap1.unwrap();
+ let snap1 = match walker.walk_focused_window().unwrap() {
+ TreeWalkResult::Found(s) => s,
+ _ => {
+ eprintln!(" [skip] Finder returned no snapshot");
+ return;
+ }
+ };
println!(
" Finder: nodes={}, hash={}, text_len={}",
snap1.node_count,
@@ -211,13 +214,14 @@ mod e2e {
return;
}
- let snap2 = walker.walk_focused_window().unwrap();
- if snap2.is_none() {
- eprintln!(" [skip] Calculator returned no snapshot");
- let _ = applescript(r#"tell application "Calculator" to quit"#);
- return;
- }
- let snap2 = snap2.unwrap();
+ let snap2 = match walker.walk_focused_window().unwrap() {
+ TreeWalkResult::Found(s) => s,
+ _ => {
+ eprintln!(" [skip] Calculator returned no snapshot");
+ let _ = applescript(r#"tell application "Calculator" to quit"#);
+ return;
+ }
+ };
println!(
" Calculator: nodes={}, hash={}, text_len={}",
snap2.node_count,
@@ -252,8 +256,8 @@ mod e2e {
// Use whatever app is currently focused — walk twice rapidly
// If the same app/window is focused and content hasn't changed, dedup should work
let snap = match walker.walk_focused_window().unwrap() {
- Some(s) => s,
- None => {
+ TreeWalkResult::Found(s) => s,
+ _ => {
println!(" [skip] No focused window");
return;
}
@@ -270,7 +274,7 @@ mod e2e {
// Walk again immediately — no user interaction, content should be stable
let snap2 = walker.walk_focused_window().unwrap();
- if let Some(snap2) = snap2 {
+ if let TreeWalkResult::Found(snap2) = snap2 {
let hashes_match = snap.content_hash == snap2.content_hash;
let should = cache.should_store(&snap2);
println!(
@@ -313,12 +317,12 @@ mod e2e {
for _ in 0..iterations {
match walker.walk_focused_window() {
- Ok(Some(snap)) => {
+ Ok(TreeWalkResult::Found(snap)) => {
durations.push(snap.walk_duration.as_micros() as u64);
node_counts.push(snap.node_count);
text_lengths.push(snap.text_content.len());
}
- Ok(None) => {}
+ Ok(_) => {}
Err(_) => {
errors += 1;
}
@@ -437,7 +441,7 @@ mod e2e {
activate_and_wait(target, Duration::from_secs(3));
match walker.walk_focused_window() {
- Ok(Some(snap)) => {
+ Ok(TreeWalkResult::Found(snap)) => {
if cache.should_store(&snap) {
cache.record_store(&snap.app_name, &snap.window_name, snap.simhash);
stored += 1;
@@ -445,7 +449,7 @@ mod e2e {
deduped += 1;
}
}
- Ok(None) => empty += 1,
+ Ok(_) => empty += 1,
Err(_) => {}
}
}
@@ -517,7 +521,7 @@ mod e2e {
let result = walker.walk_focused_window();
assert!(result.is_ok());
- if let Ok(Some(snap)) = result {
+ if let Ok(TreeWalkResult::Found(snap)) = result {
assert!(
snap.node_count <= 21,
"node count {} should be near limit of 20",
diff --git a/crates/screenpipe-audio/src/audio_manager/builder.rs b/crates/screenpipe-audio/src/audio_manager/builder.rs
index 7506eadef..4b45efdc5 100644
--- a/crates/screenpipe-audio/src/audio_manager/builder.rs
+++ b/crates/screenpipe-audio/src/audio_manager/builder.rs
@@ -68,6 +68,9 @@ pub struct AudioManagerOptions {
pub meeting_detector: Option<Arc<MeetingDetector>>,
/// Custom vocabulary entries for transcription biasing and word replacement.
pub vocabulary: Vec<VocabularyEntry>,
+ /// User-configurable maximum batch duration in seconds for reconciliation.
+ /// When set, overrides the engine-aware default. None = use engine default.
+ pub batch_max_duration_secs: Option<u64>,
}
impl Default for AudioManagerOptions {
@@ -98,6 +101,7 @@ impl Default for AudioManagerOptions {
transcription_mode: TranscriptionMode::default(),
meeting_detector: None,
vocabulary: vec![],
+ batch_max_duration_secs: None,
}
}
}
@@ -210,6 +214,11 @@ impl AudioManagerBuilder {
self
}
+ pub fn batch_max_duration_secs(mut self, secs: Option<u64>) -> Self {
+ self.options.batch_max_duration_secs = secs;
+ self
+ }
+
pub async fn build(&mut self, db: Arc<DatabaseManager>) -> Result<AudioManager> {
self.validate_options()?;
let options = &mut self.options;
diff --git a/crates/screenpipe-audio/src/audio_manager/manager.rs b/crates/screenpipe-audio/src/audio_manager/manager.rs
index 703ebc77b..9a722075d 100644
--- a/crates/screenpipe-audio/src/audio_manager/manager.rs
+++ b/crates/screenpipe-audio/src/audio_manager/manager.rs
@@ -177,6 +177,7 @@ impl AudioManager {
let openai_config = opts.openai_compatible_config.clone();
let langs = opts.languages.clone();
let vocab = opts.vocabulary.clone();
+ let batch_max_dur = opts.batch_max_duration_secs;
drop(opts);
// Get whisper context from transcription engine
@@ -195,6 +196,7 @@ impl AudioManager {
&vocab,
Some(seg_mgr.clone()),
data_dir,
+ batch_max_dur,
)
.await;
if count > 0 {
@@ -431,6 +433,7 @@ impl AudioManager {
let audio_transcription_engine = options.transcription_engine.clone();
let vocabulary = options.vocabulary.clone();
let is_batch_mode = options.transcription_mode == TranscriptionMode::Batch;
+ let batch_max_duration_secs = options.batch_max_duration_secs;
let filter_music = options.filter_music;
let vad_engine = self.vad_engine.clone();
let whisper_receiver = self.recording_receiver.clone();
@@ -583,6 +586,7 @@ impl AudioManager {
&vocabulary,
Some(segmentation_manager.clone()),
data_dir,
+ batch_max_duration_secs,
)
.await;
for _ in 0..count {
diff --git a/crates/screenpipe-audio/src/audio_manager/reconciliation.rs b/crates/screenpipe-audio/src/audio_manager/reconciliation.rs
index d27e0b8c3..d04b15142 100644
--- a/crates/screenpipe-audio/src/audio_manager/reconciliation.rs
+++ b/crates/screenpipe-audio/src/audio_manager/reconciliation.rs
@@ -45,9 +45,22 @@ struct PendingTranscription {
file_path: String,
}
-/// Maximum number of consecutive 30s chunks to concatenate into a single batch.
-/// 10 x 30s = 5 minutes — gives Whisper much more context for better quality.
-const MAX_BATCH_CHUNKS: usize = 10;
+/// Default maximum batch duration in seconds when no user override is set.
+/// Engine-aware: Deepgram can handle hours, local Whisper tops out around 10 min.
+fn default_max_batch_duration_secs(engine: &AudioTranscriptionEngine) -> u64 {
+ match engine {
+ // Cloud engines can handle long audio
+ AudioTranscriptionEngine::Deepgram => 3600, // 1 hour
+ // OpenAI-compatible has 25MB limit (~10 min at typical bitrates)
+ AudioTranscriptionEngine::OpenAICompatible => 600,
+ // Local Whisper quality degrades past ~10 min
+ _ => 600,
+ }
+}
+
+/// Maximum gap between consecutive chunks (in seconds) before starting a new batch.
+/// A gap >60s likely means a break in conversation (e.g., lunch, switching meetings).
+const MAX_GAP_BETWEEN_CHUNKS_SECS: i64 = 60;
/// Finds audio chunks with no transcription row (orphans), groups consecutive
/// chunks from the same device, concatenates them, and transcribes the batch.
@@ -61,13 +74,14 @@ pub async fn reconcile_untranscribed(
transcription_engine: &TranscriptionEngine,
on_insert: Option<&AudioInsertCallback>,
_whisper_context: Option<Arc<WhisperContext>>,
- _audio_engine: Arc<AudioTranscriptionEngine>,
+ audio_engine: Arc<AudioTranscriptionEngine>,
_deepgram_api_key: Option<String>,
_openai_compatible_config: Option<OpenAICompatibleConfig>,
_languages: Vec<Language>,
_vocabulary: &[VocabularyEntry],
segmentation_manager: Option<Arc<SegmentationManager>>,
data_dir: Option<&Path>,
+ batch_max_duration_secs: Option<u64>,
) -> usize {
// Prevent concurrent reconciliation runs — two Whisper sessions = 200%+ CPU
if RECONCILIATION_RUNNING
@@ -115,11 +129,13 @@ pub async fn reconcile_untranscribed(
);
// Group consecutive chunks by device for batched transcription.
- let batches = group_chunks_by_device(&chunks);
+ let max_duration = batch_max_duration_secs
+ .unwrap_or_else(|| default_max_batch_duration_secs(&audio_engine));
+ let batches = group_chunks_by_device(&chunks, max_duration);
debug!(
- "reconciliation: grouped into {} batches (max {}x30s each)",
+ "reconciliation: grouped into {} batches (max {}s each)",
batches.len(),
- MAX_BATCH_CHUNKS
+ max_duration
);
let engine_config = transcription_engine.config();
@@ -521,18 +537,40 @@ async fn extract_speaker_id(
/// Group chunks into batches of consecutive chunks from the same device.
/// Chunks are already ordered by timestamp DESC from the DB query (newest first).
-fn group_chunks_by_device(chunks: &[UntranscribedChunk]) -> Vec<Vec<&UntranscribedChunk>> {
+///
+/// Batching rules:
+/// 1. Same device only — device change starts a new batch
+/// 2. Duration cap — total batch duration must not exceed `max_duration_secs`
+/// 3. Gap detection — a gap of >60s between consecutive chunks starts a new batch
+/// (likely a break between meetings/conversations)
+fn group_chunks_by_device(
+ chunks: &[UntranscribedChunk],
+ max_duration_secs: u64,
+) -> Vec<Vec<&UntranscribedChunk>> {
let mut batches: Vec<Vec<&UntranscribedChunk>> = Vec::new();
+ // Each chunk is ~30s of audio
+ const CHUNK_DURATION_SECS: u64 = 30;
for chunk in chunks {
let (device, _) = extract_device_from_path(&chunk.file_path);
- let should_start_new = match batches.last() {
- None => true,
- Some(current_batch) => {
- let (last_device, _) = extract_device_from_path(&current_batch[0].file_path);
- last_device != device || current_batch.len() >= MAX_BATCH_CHUNKS
+ let should_start_new = if let Some(current_batch) = batches.last() {
+ let (last_device, _) = extract_device_from_path(&current_batch[0].file_path);
+ if last_device != device {
+ true
+ } else if (current_batch.len() as u64) * CHUNK_DURATION_SECS >= max_duration_secs {
+ // Duration cap reached
+ true
+ } else {
+ // Check for gap between this chunk and the last one in the batch
+ let last_chunk = current_batch.last().unwrap();
+ let gap = (chunk.timestamp - last_chunk.timestamp)
+ .num_seconds()
+ .abs();
+ gap > MAX_GAP_BETWEEN_CHUNKS_SECS
}
+ } else {
+ true
};
if should_start_new {
@@ -599,70 +637,106 @@ mod tests {
#[test]
fn group_chunks_same_device() {
+ let now = chrono::Utc::now();
let chunks = vec![
UntranscribedChunk {
id: 1,
file_path: "/data/input (input)_2026-02-27_23-15-08.mp4".to_string(),
- timestamp: chrono::Utc::now(),
+ timestamp: now,
},
UntranscribedChunk {
id: 2,
file_path: "/data/input (input)_2026-02-27_23-15-38.mp4".to_string(),
- timestamp: chrono::Utc::now(),
+ timestamp: now + chrono::Duration::seconds(30),
},
UntranscribedChunk {
id: 3,
file_path: "/data/input (input)_2026-02-27_23-16-08.mp4".to_string(),
- timestamp: chrono::Utc::now(),
+ timestamp: now + chrono::Duration::seconds(60),
},
];
- let batches = group_chunks_by_device(&chunks);
+ let batches = group_chunks_by_device(&chunks, 600);
assert_eq!(batches.len(), 1);
assert_eq!(batches[0].len(), 3);
}
#[test]
fn group_chunks_alternating_devices() {
+ let now = chrono::Utc::now();
let chunks = vec![
UntranscribedChunk {
id: 1,
file_path: "/data/input (input)_2026-02-27_23-15-08.mp4".to_string(),
- timestamp: chrono::Utc::now(),
+ timestamp: now,
},
UntranscribedChunk {
id: 2,
file_path: "/data/Display 3 (output)_2026-02-27_23-15-08.mp4".to_string(),
- timestamp: chrono::Utc::now(),
+ timestamp: now,
},
UntranscribedChunk {
id: 3,
file_path: "/data/input (input)_2026-02-27_23-15-38.mp4".to_string(),
- timestamp: chrono::Utc::now(),
+ timestamp: now + chrono::Duration::seconds(30),
},
UntranscribedChunk {
id: 4,
file_path: "/data/Display 3 (output)_2026-02-27_23-15-38.mp4".to_string(),
- timestamp: chrono::Utc::now(),
+ timestamp: now + chrono::Duration::seconds(30),
},
];
- let batches = group_chunks_by_device(&chunks);
+ let batches = group_chunks_by_device(&chunks, 600);
// input, output, input, output -> 4 batches (alternating)
assert_eq!(batches.len(), 4);
}
#[test]
- fn group_chunks_respects_max_batch() {
+ fn group_chunks_respects_max_duration() {
+ let now = chrono::Utc::now();
+ // 13 chunks x 30s = 390s, with max_duration=300s should split into 2 batches
let mut chunks = Vec::new();
- for i in 0..(MAX_BATCH_CHUNKS + 3) {
+ for i in 0..13 {
chunks.push(UntranscribedChunk {
id: i as i64,
file_path: format!("/data/input (input)_2026-02-27_23-{:02}-08.mp4", i),
- timestamp: chrono::Utc::now(),
+ timestamp: now + chrono::Duration::seconds(i as i64 * 30),
});
}
- let batches = group_chunks_by_device(&chunks);
+ let batches = group_chunks_by_device(&chunks, 300); // 300s = 10 chunks max
assert_eq!(batches.len(), 2);
- assert_eq!(batches[0].len(), MAX_BATCH_CHUNKS);
+ assert_eq!(batches[0].len(), 10);
assert_eq!(batches[1].len(), 3);
}
+
+ #[test]
+ fn group_chunks_gap_detection() {
+ let now = chrono::Utc::now();
+ let chunks = vec![
+ UntranscribedChunk {
+ id: 1,
+ file_path: "/data/input (input)_2026-02-27_23-15-08.mp4".to_string(),
+ timestamp: now,
+ },
+ UntranscribedChunk {
+ id: 2,
+ file_path: "/data/input (input)_2026-02-27_23-15-38.mp4".to_string(),
+ timestamp: now + chrono::Duration::seconds(30),
+ },
+ // 5 minute gap — should start new batch
+ UntranscribedChunk {
+ id: 3,
+ file_path: "/data/input (input)_2026-02-27_23-20-38.mp4".to_string(),
+ timestamp: now + chrono::Duration::seconds(330),
+ },
+ UntranscribedChunk {
+ id: 4,
+ file_path: "/data/input (input)_2026-02-27_23-21-08.mp4".to_string(),
+ timestamp: now + chrono::Duration::seconds(360),
+ },
+ ];
+ let batches = group_chunks_by_device(&chunks, 3600);
+ assert_eq!(batches.len(), 2, "5-minute gap should split into 2 batches");
+ assert_eq!(batches[0].len(), 2);
+ assert_eq!(batches[1].len(), 2);
+ }
}
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md
index 9e57f6fce..739b72f8d 100644
--- a/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md
+++ b/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md
@@ -195,6 +195,7 @@ curl -X POST http://localhost:3030/raw_sql \
| `speakers` | `name`, `metadata` | — |
| `ui_events` | `event_type`, `app_name`, `window_title`, `browser_url` | `timestamp` |
| `accessibility` | `app_name`, `window_name`, `text_content`, `browser_url` | `timestamp` |
+| `meetings` | `meeting_app`, `title`, `attendees`, `detection_source` | `meeting_start` |
### Example Queries
@@ -250,7 +251,30 @@ If not connected, tell user to set up in Settings > Connections.
---
-## 9. Other Endpoints
+## 9. Meetings — `GET /meetings`
+
+```bash
+curl "http://localhost:3030/meetings?start_time=1d%20ago&end_time=now&limit=10&offset=0"
+curl "http://localhost:3030/meetings/42"
+```
+
+Returns detected meetings (from calendar, app detection, window titles, UI elements, multi-speaker audio).
+
+| Field | Type | Description |
+|-------|------|-------------|
+| `id` | integer | Meeting ID |
+| `meeting_start` | ISO 8601 | Start time |
+| `meeting_end` | ISO 8601? | End time (null if ongoing) |
+| `meeting_app` | string | App (zoom, teams, meet, etc.) |
+| `title` | string? | Meeting title |
+| `attendees` | string? | Attendees |
+| `detection_source` | string | How detected (`app`, `calendar`, `ui`, etc.) |
+
+Also available via raw SQL: `SELECT * FROM meetings WHERE meeting_start > datetime('now', '-24 hours') LIMIT 20`
+
+---
+
+## 10. Other Endpoints
```bash
curl http://localhost:3030/health # Health check
diff --git a/crates/screenpipe-engine/src/cli/mod.rs b/crates/screenpipe-engine/src/cli/mod.rs
index 8bef48ea7..f3fbd9b8e 100644
--- a/crates/screenpipe-engine/src/cli/mod.rs
+++ b/crates/screenpipe-engine/src/cli/mod.rs
@@ -360,6 +360,7 @@ impl RecordArgs {
analytics_id: String::new(),
vocabulary: vec![],
ignore_incognito_windows: true,
+ batch_max_duration_secs: None,
}
}
}
diff --git a/crates/screenpipe-engine/src/event_driven_capture.rs b/crates/screenpipe-engine/src/event_driven_capture.rs
index b34320490..683f9130c 100644
--- a/crates/screenpipe-engine/src/event_driven_capture.rs
+++ b/crates/screenpipe-engine/src/event_driven_capture.rs
@@ -621,11 +621,29 @@ async fn do_capture(
// Walk accessibility tree on blocking thread (AX APIs are synchronous)
let config = tree_walker_config.clone();
- let tree_snapshot = tokio::task::spawn_blocking(move || {
+ let tree_walk_result = tokio::task::spawn_blocking(move || {
crate::paired_capture::walk_accessibility_tree(&config)
})
.await?;
+ // If the window was skipped (incognito/private browsing or user filter),
+ // bail out entirely — don't OCR the screenshot.
+ use screenpipe_a11y::tree::TreeWalkResult;
+ let tree_snapshot = match tree_walk_result {
+ TreeWalkResult::Found(snap) => Some(snap),
+ TreeWalkResult::Skipped => {
+ debug!(
+ "skipping capture: window filtered (incognito/private) on monitor {}",
+ monitor_id
+ );
+ return Ok(CaptureOutput {
+ result: None,
+ image,
+ });
+ }
+ TreeWalkResult::NotFound => None,
+ };
+
// Content dedup: skip capture if accessibility text hasn't changed.
// Never dedup Idle/Manual triggers — these are fallback captures that must
// always write so the timeline is never completely empty.
diff --git a/crates/screenpipe-engine/src/recording_config.rs b/crates/screenpipe-engine/src/recording_config.rs
index 318ae6bfe..02c577107 100644
--- a/crates/screenpipe-engine/src/recording_config.rs
+++ b/crates/screenpipe-engine/src/recording_config.rs
@@ -77,6 +77,11 @@ pub struct RecordingConfig {
/// Custom vocabulary for transcription biasing and word replacement.
pub vocabulary: Vec<VocabularyEntry>,
+
+ /// User-configurable maximum batch duration in seconds for batch transcription.
+ /// When set, overrides the engine-aware default (Deepgram=3600s, Whisper/OpenAI=600s).
+ /// None = use engine-aware defaults.
+ pub batch_max_duration_secs: Option<u64>,
}
impl RecordingConfig {
@@ -114,6 +119,7 @@ impl RecordingConfig {
.filter_music(self.filter_music)
.transcription_mode(self.transcription_mode.clone())
.vocabulary(self.vocabulary.clone())
+ .batch_max_duration_secs(self.batch_max_duration_secs)
}
/// Build a `VisionManagerConfig` from this config.
diff --git a/crates/screenpipe-engine/src/ui_recorder.rs b/crates/screenpipe-engine/src/ui_recorder.rs
index 2eb575cb8..2b4977ff4 100644
--- a/crates/screenpipe-engine/src/ui_recorder.rs
+++ b/crates/screenpipe-engine/src/ui_recorder.rs
@@ -8,7 +8,7 @@
use anyhow::Result;
use screenpipe_a11y::tree::{
- cache::TreeCache, create_tree_walker, TreeWalkerConfig, TruncationReason,
+ cache::TreeCache, create_tree_walker, TreeWalkResult, TreeWalkerConfig, TruncationReason,
};
use screenpipe_a11y::{UiCaptureConfig, UiRecorder};
use screenpipe_db::{DatabaseManager, InsertUiEvent};
@@ -575,7 +575,7 @@ fn run_tree_walker(
metrics.walks_total += 1;
match walker.walk_focused_window() {
- Ok(Some(snap)) => {
+ Ok(TreeWalkResult::Found(snap)) => {
let walk_ms = snap.walk_duration.as_millis() as u64;
metrics.total_walk_duration_ms += walk_ms;
metrics.max_walk_duration_ms = metrics.max_walk_duration_ms.max(walk_ms);
@@ -647,7 +647,10 @@ fn run_tree_walker(
metrics.walks_deduped += 1;
}
}
- Ok(None) => {
+ Ok(TreeWalkResult::Skipped) => {
+ metrics.walks_empty += 1;
+ }
+ Ok(TreeWalkResult::NotFound) => {
metrics.walks_empty += 1;
}
Err(e) => {