YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
Push all local changes from parallel agents
Louis Beaumont73dfe5d53c89
diff --git a/CLAUDE.md b/CLAUDE.mdindex 9e7fe7676..d68fc0c20 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -19,7 +19,7 @@ Use `#` for Python, `//` for Rust/TS/JS/Swift. Keep it as the first comment in t- `apps/screenpipe-app-tauri/` - Desktop app (Tauri + Next.js)- `crates/screenpipe-server/` - Core backend (Rust)- `crates/screenpipe-audio/` - Audio capture/transcription (Rust)-- `crates/screenpipe-vision/` - Screen capture/OCR (Rust)+- `crates/screenpipe-vision/` - Screen capture/accessibility text (OCR fallback) (Rust)## Analytics- PostHog API key: source from `.env.local` (gitignored)diff --git a/Cargo.lock b/Cargo.lockindex 598ec1ae0..3fa8eb31e 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -5388,7 +5388,7 @@ dependencies = [[[package]]name = "screenpipe-audio"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","bytemuck",@@ -5444,7 +5444,7 @@ dependencies = [[[package]]name = "screenpipe-core"-version = "0.3.157"+version = "0.3.158"dependencies = ["accessibility","accessibility-sys",@@ -5485,7 +5485,7 @@ dependencies = [[[package]]name = "screenpipe-db"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","chrono",@@ -5510,7 +5510,7 @@ dependencies = [[[package]]name = "screenpipe-events"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","chrono",@@ -5528,7 +5528,7 @@ dependencies = [[[package]]name = "screenpipe-integrations"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","chrono",@@ -5548,7 +5548,7 @@ dependencies = [[[package]]name = "screenpipe-server"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","async-trait",@@ -5607,7 +5607,7 @@ dependencies = [[[package]]name = "screenpipe-vision"-version = "0.3.157"+version = "0.3.158"dependencies = ["accessibility-sys","anyhow",diff --git a/apps/screenpipe-app-tauri/components/rewind/search-modal.tsx b/apps/screenpipe-app-tauri/components/rewind/search-modal.tsxindex a2bd5474b..54bae0c8f 100644--- a/apps/screenpipe-app-tauri/components/rewind/search-modal.tsx+++ b/apps/screenpipe-app-tauri/components/rewind/search-modal.tsx@@ -41,38 +41,28 @@ interface SearchModalProps {embedded?: boolean;}-// stopwords to filter out from suggestions+// stopwords to filter out from suggestions — keep this minimal so real+// content words survive. Only filter grammatical words and code tokens.const STOP_WORDS = new Set([+ // grammar / function words"the", "a", "an", "and", "or", "but", "in", "on", "at", "to", "for","of", "with", "by", "from", "is", "it", "this", "that", "was", "are","be", "has", "had", "have", "not", "no", "do", "does", "did", "will","can", "could", "would", "should", "may", "might", "shall", "if", "so",- "as", "he", "she", "we", "they", "you", "i", "my", "your", "his", "her",+ "as", "he", "she", "we", "they", "you", "my", "your", "his", "her","its", "our", "their", "me", "him", "us", "them", "am", "been", "being","were", "what", "which", "who", "whom", "when", "where", "why", "how","all", "each", "every", "both", "few", "more", "most", "other", "some","such", "than", "too", "very", "just", "about", "above", "after", "again","also", "any", "because", "before", "between", "here", "there", "then","these", "those", "through", "under", "until", "while", "into", "over",- "only", "own", "same", "still", "up", "out", "off", "down", "now", "new",- "one", "two", "first", "last", "long", "great", "little", "right", "old",- "big", "high", "small", "large", "next", "early", "young", "important",- "public", "bad", "com", "www", "http", "https", "html", "css", "div",- "span", "class", "true", "false", "null", "undefined", "var", "let",- "const", "function", "return", "import", "export", "default", "type",- "interface", "string", "number", "boolean", "object", "array", "void",- "png", "jpg", "svg", "gif", "pdf", "tsx", "jsx", "src", "img", "alt",- "width", "height", "style", "font", "size", "color", "text", "data",- "value", "name", "index", "item", "list", "page", "file", "path",- "error", "log", "get", "set", "app", "use", "end", "start", "time",- "date", "day", "year", "month", "week", "like", "make", "know", "take",- "come", "see", "look", "find", "give", "tell", "think", "say", "help",- "show", "try", "ask", "need", "feel", "become", "leave", "put", "mean",- "keep", "let", "begin", "seem", "talk", "turn", "hand", "run", "move",- "play", "back", "way", "home", "work", "even", "good", "much", "well",- "part", "made", "got", "going", "went", "done", "said", "line", "click",- "button", "menu", "view", "open", "close", "save", "edit", "delete",- "copy", "paste", "select", "search", "enter", "tab", "window", "screen",+ "only", "own", "same", "still", "now",+ // code / web tokens+ "com", "www", "http", "https", "html", "css", "div", "span", "class",+ "true", "false", "null", "undefined", "var", "let", "const", "function",+ "return", "import", "export", "default", "type", "interface", "void",+ "png", "jpg", "svg", "gif", "src", "img", "alt",+ "width", "height", "style", "font", "size", "color",]);function isGarbageWord(word: string): boolean {@@ -93,8 +83,8 @@ function isGarbageWord(word: string): boolean {// words that are proper nouns (Capitalized in original text) are more interestingfunction extractInterestingWords(text: string): Map<string, { count: number; original: string }> {const words = new Map<string, { count: number; original: string }>();- // split on whitespace/punctuation but preserve original casing- const tokens = text.match(/[A-Za-z][a-z]{2,24}/g) || [];+ // split on whitespace/punctuation, match words 3-25 chars (letters, including unicode)+ const tokens = text.match(/[\p{L}]{3,25}/gu) || [];for (const token of tokens) {const lower = token.toLowerCase();if (STOP_WORDS.has(lower)) continue;@@ -128,9 +118,7 @@ function useSuggestions(isOpen: boolean) {const now = new Date();const oneDayAgo = new Date(now.getTime() - 24 * 60 * 60 * 1000);// Match the keyword search exclusion window (1 minute) so suggestions- // only contain words from data that's already FTS-indexed. Previously- // used `now` which meant suggestions showed words the keyword search- // couldn't find yet (FTS indexer runs every 30s).+ // only contain words from data that's already FTS-indexed.const endTime = new Date(now.getTime() - 60_000);const params = new URLSearchParams({@@ -141,13 +129,19 @@ function useSuggestions(isOpen: boolean) {end_time: endTime.toISOString(),});- const resp = await fetch(`http://localhost:3030/search?${params}`);- if (!resp.ok || cancelled) return;+ const resp = await fetch(`http://localhost:3030/search?${params}`, {+ signal: AbortSignal.timeout(5000),+ });+ if (cancelled) return;+ if (!resp.ok) {+ if (!cancelled) setIsLoading(false);+ return;+ }const data = await resp.json();const items = data?.data || [];- // collect app names (used as fallback suggestions)+ // collect app names (always useful as suggestions)const appNameCounts = new Map<string, { count: number; original: string }>();const allWords = new Map<string, { count: number; original: string }>();@@ -200,8 +194,9 @@ function useSuggestions(isOpen: boolean) {const shuffled = topPool.sort(() => Math.random() - 0.5);let picked = shuffled.slice(0, 8).map(([, info]) => info.original);- // fallback: if we got fewer than 4 keyword suggestions, fill with app names- if (picked.length < 4 && appNameCounts.size > 0) {+ // fallback: always fill remaining slots with top app names+ // (app names are the most reliable suggestions — always available)+ if (picked.length < 8 && appNameCounts.size > 0) {const topApps = [...appNameCounts.entries()].sort((a, b) => b[1].count - a[1].count).slice(0, 8 - picked.length)diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsxindex d52d6270b..13ba101e4 100644--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx@@ -1265,9 +1265,9 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {return () => target.removeEventListener("wheel", handler);}, [handleScroll, embedded]);- // Native trackpad pinch-to-zoom via Tauri event.+ // Native trackpad pinch-to-zoom via Tauri event (macOS).// WKWebView swallows magnifyWithEvent: — no JS gesture/wheel events fire.- // The Rust side uses an NSEvent local monitor to catch magnify gestures+ // The Rust side attaches an NSMagnificationGestureRecognizer to the panel// and emits "native-magnify" with the magnification delta.useEffect(() => {const unlisten = listen<number>("native-magnify", (event) => {@@ -1277,7 +1277,6 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {zoomTimeoutRef.current = setTimeout(() => {isZoomingRef.current = false;}, 150);- // Amplify: NSEvent magnification is small (~0.01-0.05 per tick)setTargetZoom((prev) =>Math.min(MAX_ZOOM, Math.max(MIN_ZOOM, prev * (1 + magnification * 5))),);@@ -1285,26 +1284,6 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {return () => { unlisten.then((f) => f()); };}, [setTargetZoom]);- // Ensure WKWebView is first responder so pinch-to-zoom works.- // On macOS, magnifyWithEvent: only reaches the WKWebView if it's first responder.- // Various panel operations can steal this, so we re-assert on pointer enter- // and window focus events.- useEffect(() => {- const ensureFocus = () => {- commands.ensureWebviewFocus();- };- // Re-assert on any pointer entry into the page- document.addEventListener("pointerenter", ensureFocus, true);- // Re-assert when the window regains focus- const unlistenFocus = listen("window-focused", ensureFocus);- // Also assert on mount- ensureFocus();- return () => {- document.removeEventListener("pointerenter", ensureFocus, true);- unlistenFocus.then((f) => f());- };- }, []);-const handleRefresh = useCallback(() => {// Full page reload - simpler and more reliable than WebSocket reconnectionwindow.location.reload();diff --git a/apps/screenpipe-app-tauri/components/settings/billing-section.tsx b/apps/screenpipe-app-tauri/components/settings/billing-section.tsxindex f79005b71..f8a2bd80a 100644--- a/apps/screenpipe-app-tauri/components/settings/billing-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/billing-section.tsx@@ -46,8 +46,9 @@ function formatCardBrand(brand: string): string {return brands[brand] ?? brand;}-function getUsageLabel(ratio: number): string {- if (ratio >= 1) return "using paid overage";+function getUsageLabel(ratio: number, unlimited: boolean): string {+ if (unlimited) return "unlimited";+ if (ratio >= 1) return "limit reached";if (ratio >= 0.8) return "heavy usage";if (ratio >= 0.5) return "moderate usage";return "low usage";@@ -217,13 +218,14 @@ export function BillingSection() {);}+ const isUnlimited = !usage?.limit_today || usage.limit_today <= 0;const usageRatio = usage- ? usage.limit_today > 0- ? usage.used_today / usage.limit_today- : 0+ ? isUnlimited+ ? 0+ : usage.used_today / usage.limit_today: 0;- const progressValue = Math.min(usageRatio * 100, 100);- const usageLabel = getUsageLabel(usageRatio);+ const progressValue = isUnlimited ? 0 : Math.min(usageRatio * 100, 100);+ const usageLabel = getUsageLabel(usageRatio, isUnlimited);const tierLabel =usage?.tier === "pro" || settings.user?.cloud_subscribed ? "pro" : "free";@@ -273,7 +275,7 @@ export function BillingSection() {</div></Card>- {/* Daily usage progress */}+ {/* Daily usage */}<Card className="p-5"><div className="flex items-center justify-between mb-3"><h3 className="text-sm font-semibold text-foreground">@@ -283,19 +285,33 @@ export function BillingSection() {{usageLabel}</span></div>- <Progress value={progressValue} className="h-2.5 mb-2" />- <div className="flex items-center justify-between">- <p className="text-xs text-muted-foreground">- {usageRatio >= 1- ? "daily free queries exhausted — using paid overage"- : "daily free AI queries"}- </p>- {usage?.resets_at && (- <p className="text-xs text-muted-foreground">- resets at {formatResetTime(usage.resets_at)}+ {isUnlimited ? (+ <div className="flex items-center justify-between">+ <p className="text-sm font-medium text-foreground">+ {usage?.used_today ?? 0} queries used today</p>- )}- </div>+ {usage?.resets_at && (+ <p className="text-xs text-muted-foreground">+ resets at {formatResetTime(usage.resets_at)}+ </p>+ )}+ </div>+ ) : (+ <>+ <Progress value={progressValue} className="h-2.5 mb-2" />+ <div className="flex items-center justify-between">+ <p className="text-xs text-muted-foreground">+ {usage?.used_today ?? 0} / {usage?.limit_today ?? 0} queries+ {usageRatio >= 1 && " — limit reached, using paid credits"}+ </p>+ {usage?.resets_at && (+ <p className="text-xs text-muted-foreground">+ resets at {formatResetTime(usage.resets_at)}+ </p>+ )}+ </div>+ </>+ )}</Card>{/* Payment method */}@@ -324,7 +340,7 @@ export function BillingSection() {auto-reload</h3><p className="text-xs text-muted-foreground mt-0.5">- automatically top up when overage balance is low+ automatically top up when credit balance is low</p></div><Switchdiff --git a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsxindex 9dc17e3c1..8dd1d3497 100644--- a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx@@ -21,6 +21,8 @@ import {ExternalLink,Check,Users,+ MoreHorizontal,+ Plus,} from "lucide-react";import { Textarea } from "@/components/ui/textarea";import { Label } from "@/components/ui/label";@@ -31,6 +33,13 @@ import { revealItemInDir, openUrl } from "@tauri-apps/plugin-opener";import { emit } from "@tauri-apps/api/event";import { commands } from "@/lib/utils/tauri";import { cn } from "@/lib/utils";+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuSeparator,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";import { useSettings } from "@/lib/hooks/use-settings";import { useTeam } from "@/lib/hooks/use-team";import { useToast } from "@/components/ui/use-toast";@@ -41,7 +50,7 @@ const PIPE_CREATION_PROMPT = `create a screenpipe pipe that does the following.## what is screenpipe?-screenpipe is a desktop app that continuously records your screen (OCR) and audio (transcription).+screenpipe is a desktop app that continuously captures your screen text (via accessibility APIs, with OCR as fallback for apps that don't support accessibility) and audio (transcription).it runs a local API at http://localhost:3030 that lets you query everything you've seen, said, or heard.## what is a pipe?@@ -82,7 +91,7 @@ curl "http://localhost:3030/search?limit=20&content_type=all&start_time=<ISO8601### query parameters- q: text search query (optional)-- content_type: "all" | "ocr" | "audio" | "input" | "accessibility"+- content_type: "all" | "ocr" | "audio" | "input" | "accessibility" (prefer "all" or "accessibility" for screen text; "ocr" is a legacy fallback)- limit: max results (default 20)- offset: pagination offset- start_time / end_time: ISO 8601 timestamps@@ -197,6 +206,18 @@ interface PipeExecution {duration_ms: number | null;}+function relativeTime(dateStr: string): string {+ const diff = Date.now() - new Date(dateStr).getTime();+ const secs = Math.floor(diff / 1000);+ if (secs < 60) return "just now";+ const mins = Math.floor(secs / 60);+ if (mins < 60) return `${mins}m ago`;+ const hrs = Math.floor(mins / 60);+ if (hrs < 24) return `${hrs}h ago`;+ const days = Math.floor(hrs / 24);+ return `${days}d ago`;+}+function formatDuration(ms: number): string {if (ms < 1000) return `${ms}ms`;const secs = Math.floor(ms / 1000);@@ -206,19 +227,47 @@ function formatDuration(ms: number): string {return `${mins}:${String(remainSecs).padStart(2, "0")}`;}-/** Extract human-readable text from Pi stdout, filtering out JSON event noise */+/** Extract human-readable text from Pi JSON-mode stdout.+ * Parses structured events and pulls out only the text deltas+ * that form the actual assistant response. Falls back to showing+ * non-JSON lines as-is. */function cleanPipeStdout(raw: string): string {- return raw- .split("\n")- .filter((line) => {- const trimmed = line.trim();- if (!trimmed) return false;- // Skip JSON event lines (Pi session/agent/message events)- if (trimmed.startsWith("{") && trimmed.endsWith("}")) return false;- return true;- })- .join("\n")- .trim();+ const parts: string[] = [];+ for (const line of raw.split("\n")) {+ const trimmed = line.trim();+ if (!trimmed) continue;+ // Try to parse as JSON event+ if (trimmed.startsWith("{") && trimmed.endsWith("}")) {+ try {+ const evt = JSON.parse(trimmed);+ // text_delta — the main assistant text stream+ if (+ evt.type === "message_update" &&+ evt.assistantMessageEvent?.type === "text_delta" &&+ evt.assistantMessageEvent.delta+ ) {+ parts.push(evt.assistantMessageEvent.delta);+ continue;+ }+ // message_start may contain initial text content+ if (evt.type === "message_start" && evt.message?.content) {+ for (const block of evt.message.content) {+ if (block.type === "text" && block.text) {+ parts.push(block.text);+ }+ }+ continue;+ }+ // Skip all other JSON events (session, agent_start, tool calls, etc.)+ continue;+ } catch {+ // Not valid JSON — fall through to treat as plain text+ }+ }+ // Non-JSON line — keep as-is+ parts.push(trimmed);+ }+ return parts.join("").trim();}function ElapsedTimer({ startedAt }: { startedAt: string }) {@@ -306,11 +355,20 @@ export function PipesSection() {.map((c) => c.key));- const filteredPipes = pipes.filter((p) => {- if (pipeFilter === "all") return true;- if (pipeFilter === "team") return sharedPipeNames.has(p.config.name);- return !sharedPipeNames.has(p.config.name); // personal- });+ const filteredPipes = pipes+ .filter((p) => {+ if (pipeFilter === "all") return true;+ if (pipeFilter === "team") return sharedPipeNames.has(p.config.name);+ return !sharedPipeNames.has(p.config.name); // personal+ })+ .sort((a, b) => {+ // Enabled first+ if (a.config.enabled !== b.config.enabled) return a.config.enabled ? -1 : 1;+ // Then by last run time (most recent first)+ const aTime = a.last_run ? new Date(a.last_run).getTime() : 0;+ const bTime = b.last_run ? new Date(b.last_run).getTime() : 0;+ return bTime - aTime;+ });const sharePipeToTeam = async (pipe: PipeStatus) => {setSharingPipe(pipe.config.name);@@ -647,33 +705,6 @@ export function PipesSection() {</div></div>- <form- onSubmit={async (e) => {- e.preventDefault();- const form = e.currentTarget;- const input = form.querySelector("input") as HTMLInputElement;- const value = input?.value?.trim();- if (!value) return;- input.value = "";-- // Open the chat window first- await commands.showWindow("Chat");- // Wait for chat to mount- await new Promise((r) => setTimeout(r, 200));- // Emit prefill with pipe creation prompt + user's idea, and auto-send- await emit("chat-prefill", {- context: PIPE_CREATION_PROMPT,- prompt: value,- autoSend: true,- });- }}- >- <Input- placeholder="describe a pipe to create..."- className="font-mono text-sm"- />- </form>-{/* All | Personal | Shared with team tabs */}{team.team && (<div className="flex items-center gap-4 border-b border-border">@@ -754,23 +785,23 @@ export function PipesSection() {const runningExec = recentExecs.find((e) => e.status === "running");return (- <Card key={pipe.config.name}>+ <Card key={pipe.config.name} className={cn(!pipe.config.enabled && "opacity-50")}><CardContent className="p-4">{/* Header row */}- <div className="flex items-center gap-3">+ <div className="flex items-center gap-2"><buttononClick={() => toggleExpand(pipe.config.name)}- className="flex items-center gap-1 text-sm font-medium flex-1 text-left"+ className="flex items-center gap-1 text-sm font-medium flex-1 text-left min-w-0">{expanded === pipe.config.name ? (- <ChevronDown className="h-4 w-4" />+ <ChevronDown className="h-4 w-4 shrink-0" />) : (- <ChevronRight className="h-4 w-4" />+ <ChevronRight className="h-4 w-4 shrink-0" />)}- {pipe.config.name}+ <span className="truncate">{pipe.config.name}</span></button>- <Badge variant="outline" className="text-xs">+ <Badge variant="outline" className="text-xs shrink-0">{pipe.config.schedule}</Badge>@@ -778,46 +809,28 @@ export function PipesSection() {{isRunning ? (<Buttonvariant="ghost"- size="sm"+ size="icon"+ className="h-7 w-7"onClick={() => stopPipe(pipe.config.name)}disabled={stoppingPipe === pipe.config.name}title="stop pipe">{stoppingPipe === pipe.config.name ? (- <Loader2 className="h-4 w-4 animate-spin" />+ <Loader2 className="h-3.5 w-3.5 animate-spin" />) : (- <Square className="h-4 w-4" />+ <Square className="h-3.5 w-3.5" />)}</Button>) : (<Buttonvariant="ghost"- size="sm"+ size="icon"+ className="h-7 w-7"onClick={() => runPipe(pipe.config.name)}disabled={runningPipe === pipe.config.name}title="run pipe">- <Play className="h-4 w-4" />- </Button>- )}-- {isTeamAdmin && (- <Button- variant="outline"- size="sm"- className="h-7 text-xs cursor-pointer gap-1"- disabled={sharingPipe === pipe.config.name}- onClick={() => sharePipeToTeam(pipe)}- title={sharedPipeNames.has(pipe.config.name) ? "update team copy" : "share to team"}- >- {sharingPipe === pipe.config.name ? (- <Loader2 className="h-3 w-3 animate-spin" />- ) : sharedPipeNames.has(pipe.config.name) ? (- <Check className="h-3 w-3" />- ) : (- <Users className="h-3 w-3" />- )}- {sharedPipeNames.has(pipe.config.name) ? "shared" : "share"}+ <Play className="h-3.5 w-3.5" /></Button>)}@@ -827,6 +840,40 @@ export function PipesSection() {togglePipe(pipe.config.name, checked)}/>++ {/* Overflow menu */}+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" size="icon" className="h-7 w-7 shrink-0">+ <MoreHorizontal className="h-3.5 w-3.5" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ {isTeamAdmin && (+ <>+ <DropdownMenuItem+ disabled={sharingPipe === pipe.config.name}+ onClick={() => sharePipeToTeam(pipe)}+ >+ {sharedPipeNames.has(pipe.config.name) ? (+ <Check className="h-3.5 w-3.5 mr-2" />+ ) : (+ <Users className="h-3.5 w-3.5 mr-2" />+ )}+ {sharedPipeNames.has(pipe.config.name) ? "update team copy" : "share to team"}+ </DropdownMenuItem>+ <DropdownMenuSeparator />+ </>+ )}+ <DropdownMenuItem+ className="text-destructive"+ onClick={() => deletePipe(pipe.config.name)}+ >+ <Trash2 className="h-3.5 w-3.5 mr-2" />+ delete+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu></div>{/* Live running indicator */}@@ -858,89 +905,75 @@ export function PipesSection() {);})()}- {/* Compact recent runs — always visible */}- {recentExecs.length > 0 && (- <div className="mt-2">- <table className="w-full text-[11px] font-mono">- <tbody>- {recentExecs.slice(0, 3).map((exec) => (- <tr key={exec.id} className="border-b last:border-b-0 border-muted/40">- <td className="py-0.5 pr-2 text-muted-foreground whitespace-nowrap">- {exec.started_at- ? new Date(exec.started_at).toLocaleString([], {- month: "short",- day: "numeric",- hour: "2-digit",- minute: "2-digit",- })- : "queued"}- </td>- <td className="py-0.5 pr-2 whitespace-nowrap">- {exec.status === "completed" ? (- <span className="text-green-600 dark:text-green-400">ok</span>- ) : exec.status === "running" ? (- <span className="flex items-center gap-1 text-muted-foreground">- <Loader2 className="h-2.5 w-2.5 animate-spin" />- running- </span>- ) : exec.status === "failed" ? (- <span className="text-red-600 dark:text-red-400">failed</span>- ) : exec.status === "timed_out" ? (- <span className="text-orange-600 dark:text-orange-400">timeout</span>- ) : exec.status === "cancelled" ? (- <span className="text-muted-foreground">cancelled</span>- ) : (- <span className="text-muted-foreground">{exec.status}</span>- )}- </td>- <td className="py-0.5 pr-2 text-muted-foreground whitespace-nowrap">- {exec.status === "running" && exec.started_at ? (- <span className="flex items-center gap-1">- <ElapsedTimer startedAt={exec.started_at} />- <button- className="text-[10px] text-primary underline hover:no-underline ml-1"- onClick={(e) => {- e.stopPropagation();- // Store in sessionStorage so the chat can pick it up on mount- // (the chat component may not be mounted yet)- sessionStorage.setItem(- "watchPipe",- JSON.stringify({- pipeName: pipe.config.name,- executionId: exec.id,- })- );- emit("watch_pipe", {- pipeName: pipe.config.name,- executionId: exec.id,- });- }}- title="watch live output"- >- watch- </button>- </span>- ) : exec.duration_ms != null ? (- formatDuration(exec.duration_ms)- ) : null}- </td>- <td className="py-0.5 text-muted-foreground truncate max-w-[200px]">- {exec.error_type ? (- <span className="text-red-600/70 dark:text-red-400/70">- {exec.error_type.replace("_", " ")}- </span>- ) : exec.status === "completed" && exec.stdout ? (- <span className="truncate block">- {cleanPipeStdout(exec.stdout).split("\n")[0].slice(0, 60) || "completed"}- </span>- ) : null}- </td>- </tr>- ))}- </tbody>- </table>+ {/* Last run — single line summary */}+ {recentExecs.length > 0 && (() => {+ const exec = recentExecs[0];+ return (+ <div className="mt-1.5 flex items-center gap-2 text-[11px] font-mono text-muted-foreground">+ <span>+ {exec.started_at ? relativeTime(exec.started_at) : "queued"}+ </span>+ <span className="text-muted-foreground/50">·</span>+ {exec.status === "completed" ? (+ <span className="text-green-600 dark:text-green-400">ok</span>+ ) : exec.status === "running" ? (+ <span className="flex items-center gap-1">+ <Loader2 className="h-2.5 w-2.5 animate-spin" />+ running+ {exec.started_at && <ElapsedTimer startedAt={exec.started_at} />}+ <button+ className="text-[10px] text-primary underline hover:no-underline ml-1"+ onClick={(e) => {+ e.stopPropagation();+ sessionStorage.setItem(+ "watchPipe",+ JSON.stringify({+ pipeName: pipe.config.name,+ executionId: exec.id,+ })+ );+ emit("watch_pipe", {+ pipeName: pipe.config.name,+ executionId: exec.id,+ });+ }}+ title="watch live output"+ >+ watch+ </button>+ </span>+ ) : exec.status === "failed" ? (+ <span className="text-red-600 dark:text-red-400">failed</span>+ ) : exec.status === "timed_out" ? (+ <span className="text-orange-600 dark:text-orange-400">timeout</span>+ ) : (+ <span>{exec.status}</span>+ )}+ {exec.duration_ms != null && exec.status !== "running" && (+ <>+ <span className="text-muted-foreground/50">·</span>+ <span>{formatDuration(exec.duration_ms)}</span>+ </>+ )}+ {exec.error_type && (+ <>+ <span className="text-muted-foreground/50">·</span>+ <span className="text-red-600/70 dark:text-red-400/70">+ {exec.error_type.replace("_", " ")}+ </span>+ </>+ )}+ {exec.status === "completed" && exec.stdout && !exec.error_type && (+ <>+ <span className="text-muted-foreground/50">·</span>+ <span className="truncate max-w-[200px]">+ {cleanPipeStdout(exec.stdout).split("\n")[0].slice(0, 50) || "done"}+ </span>+ </>+ )}</div>- )}+ );+ })()}{/* Expanded detail */}{expanded === pipe.config.name && (@@ -1112,16 +1145,6 @@ export function PipesSection() {</div></div>- <div className="flex gap-2">- <Button- variant="destructive"- size="sm"- onClick={() => deletePipe(pipe.config.name)}- >- <Trash2 className="h-4 w-4 mr-1" />- delete- </Button>- </div></div>)}</CardContent>@@ -1131,6 +1154,34 @@ export function PipesSection() {</div>)}+ {/* Create new pipe — at bottom */}+ <form+ onSubmit={async (e) => {+ e.preventDefault();+ const form = e.currentTarget;+ const input = form.querySelector("input") as HTMLInputElement;+ const value = input?.value?.trim();+ if (!value) return;+ input.value = "";++ await commands.showWindow("Chat");+ await new Promise((r) => setTimeout(r, 200));+ await emit("chat-prefill", {+ context: PIPE_CREATION_PROMPT,+ prompt: value,+ autoSend: true,+ });+ }}+ >+ <div className="flex items-center gap-2">+ <Plus className="h-4 w-4 text-muted-foreground shrink-0" />+ <Input+ placeholder="describe a pipe to create..."+ className="font-mono text-sm"+ />+ </div>+ </form>+<UpgradeDialogopen={showUpgrade}onOpenChange={setShowUpgrade}diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.tsindex c4ceb5fd1..5dd4f474a 100644--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts@@ -167,9 +167,11 @@ async showWindow(window: ShowRewindWindow) : Promise<Result<null, string>> {}},/**- * Open the screenpi.pe login page inside an in-app WebView.- * Intercepts the screenpipe:// deep-link redirect so we don't rely on- * Safari custom-scheme support (which can silently fail).+ * Open the screenpi.pe login page.+ * On Windows, opens in the system browser (WebView2 has issues with some auth+ * providers; the registered deep-link scheme handles the redirect back).+ * On macOS/Linux, uses an in-app WebView that intercepts the screenpipe://+ * deep-link redirect (Safari blocks custom-scheme redirects).*/async openLoginWindow() : Promise<Result<null, string>> {try {diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lockindex 4d217a5bc..d48fbf928 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -8097,7 +8097,7 @@ dependencies = [[[package]]name = "screenpipe-app"-version = "2.0.567"+version = "2.0.570"dependencies = ["anyhow","arboard",@@ -8192,7 +8192,7 @@ dependencies = [[[package]]name = "screenpipe-audio"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","bytemuck",@@ -8243,7 +8243,7 @@ dependencies = [[[package]]name = "screenpipe-core"-version = "0.3.157"+version = "0.3.158"dependencies = ["accessibility","accessibility-sys",@@ -8284,7 +8284,7 @@ dependencies = [[[package]]name = "screenpipe-db"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","chrono",@@ -8309,7 +8309,7 @@ dependencies = [[[package]]name = "screenpipe-events"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","chrono",@@ -8325,7 +8325,7 @@ dependencies = [[[package]]name = "screenpipe-integrations"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","chrono",@@ -8345,7 +8345,7 @@ dependencies = [[[package]]name = "screenpipe-server"-version = "0.3.157"+version = "0.3.158"dependencies = ["anyhow","async-trait",@@ -8400,7 +8400,7 @@ dependencies = [[[package]]name = "screenpipe-vision"-version = "0.3.157"+version = "0.3.158"dependencies = ["accessibility-sys","anyhow",diff --git a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs b/apps/screenpipe-app-tauri/src-tauri/src/commands.rsindex cecebcadc..493bf3a5d 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/commands.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/commands.rs@@ -343,51 +343,69 @@ pub async fn get_disk_usage(}}-/// Open the screenpi.pe login page inside an in-app WebView.-/// Intercepts the screenpipe:// deep-link redirect so we don't rely on-/// Safari custom-scheme support (which can silently fail).+/// Open the screenpi.pe login page.+/// On Windows, opens in the system browser (WebView2 has issues with some auth+/// providers; the registered deep-link scheme handles the redirect back).+/// On macOS/Linux, uses an in-app WebView that intercepts the screenpipe://+/// deep-link redirect (Safari blocks custom-scheme redirects).#[tauri::command]#[specta::specta]pub async fn open_login_window(app_handle: tauri::AppHandle) -> Result<(), String> {- use tauri::{WebviewUrl, WebviewWindowBuilder};-- let label = "login-browser";-- // If already open, just focus it- if let Some(w) = app_handle.get_webview_window(label) {- let _ = w.show();- let _ = w.set_focus();+ // Windows: open in system browser — deep link is registered via+ // tauri_plugin_deep_link::register_all() so the screenpipe:// redirect works+ #[cfg(target_os = "windows")]+ {+ use tauri_plugin_opener::OpenerExt;+ app_handle+ .opener()+ .open_url("https://screenpi.pe/login", None::<&str>)+ .map_err(|e| e.to_string())?;return Ok(());}- let app_for_nav = app_handle.clone();+ // macOS / Linux: in-app WebView to intercept the deep-link redirect+ #[cfg(not(target_os = "windows"))]+ {+ use tauri::{WebviewUrl, WebviewWindowBuilder};- WebviewWindowBuilder::new(- &app_handle,- label,- WebviewUrl::External("https://screenpi.pe/login".parse().unwrap()),- )- .title("sign in to screenpipe")- .inner_size(460.0, 700.0)- .focused(true)- .on_navigation(move |url| {- if url.scheme() == "screenpipe" {- info!("login window intercepted deep link: {}", url);- let _ = app_for_nav.emit("deep-link-received", url.to_string());- // Close the login window after a short delay to avoid- // closing before the event is delivered- if let Some(w) = app_for_nav.get_webview_window("login-browser") {- let _ = w.close();- }- false // block navigation to custom scheme- } else {- true // allow all https navigations (Clerk, OAuth providers, etc.)+ let label = "login-browser";++ // If already open, just focus it+ if let Some(w) = app_handle.get_webview_window(label) {+ let _ = w.show();+ let _ = w.set_focus();+ return Ok(());}- })- .build()- .map_err(|e| e.to_string())?;- Ok(())+ let app_for_nav = app_handle.clone();++ WebviewWindowBuilder::new(+ &app_handle,+ label,+ WebviewUrl::External("https://screenpi.pe/login".parse().unwrap()),+ )+ .title("sign in to screenpipe")+ .inner_size(460.0, 700.0)+ .focused(true)+ .on_navigation(move |url| {+ if url.scheme() == "screenpipe" {+ info!("login window intercepted deep link: {}", url);+ let _ = app_for_nav.emit("deep-link-received", url.to_string());+ // Close the login window after a short delay to avoid+ // closing before the event is delivered+ if let Some(w) = app_for_nav.get_webview_window("login-browser") {+ let _ = w.close();+ }+ false // block navigation to custom scheme+ } else {+ true // allow all https navigations (Clerk, OAuth providers, etc.)+ }+ })+ .build()+ .map_err(|e| e.to_string())?;++ Ok(())+ }}/// Open Google Calendar OAuth inside an in-app WebView.diff --git a/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/apps/screenpipe-app-tauri/src-tauri/src/main.rsindex fed72ef0e..752c97d27 100755--- a/apps/screenpipe-app-tauri/src-tauri/src/main.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/main.rs@@ -1538,43 +1538,9 @@ async fn main() {// activateIgnoringOtherApps + activation policy toggling.space_monitor::setup_space_listener(app.handle().clone());- // Forward native trackpad magnify (pinch) gestures to JS as Tauri events.- // WKWebView swallows magnifyWithEvent: and doesn't fire JS gesture events.- // We use an NSEvent local monitor to intercept magnify events before they- // reach the WKWebView. The handler returns nil to CONSUME the event,- // preventing WKWebView's built-in magnification from handling it (which- // would steal subsequent gesture events after the first pinch).- // Note: magnify events are directed at the window under the cursor, so- // the local monitor catches them even when the panel is nonactivating.- // A global monitor is NOT used — it would incorrectly trigger zoom when- // the user pinches in other apps.- {- use objc::{class, msg_send, sel, sel_impl, runtime::Object};- use tauri_nspanel::block::ConcreteBlock;-- let app_for_magnify = app.handle().clone();-- // NSEventMaskMagnify = 1 << 30- let mask: u64 = 1 << 30;-- let block = ConcreteBlock::new(move |event: *mut Object| -> *mut Object {- let magnification: f64 = unsafe { msg_send![event, magnification] };- tracing::debug!("magnify event: {magnification}");- let _ = app_for_magnify.emit("native-magnify", magnification);- event // pass through — returning nil breaks event delivery entirely- });- let block = block.copy();- unsafe {- let _: *mut Object = msg_send![- class!(NSEvent),- addLocalMonitorForEventsMatchingMask: mask- handler: &*block- ];- }- std::mem::forget(block);-- info!("magnify event monitor installed");- }+ // Set up pinch-to-zoom: store the app handle so the gesture+ // recognizer callback (in window_api.rs) can emit Tauri events.+ crate::window_api::init_magnify_handler(app.handle().clone());}// Logging setupdiff --git a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs b/apps/screenpipe-app-tauri/src-tauri/src/pi.rsindex 422d77160..5d5d293e2 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs@@ -120,6 +120,9 @@ pub struct PiManager {/// `pi_terminated(pid)` (crash). Each Pi session creates a fresh Arc so/// old reader threads don't interfere with new sessions.idle_stopped: Arc<AtomicBool>,+ /// Guard: ensures only one `pi_terminated` event is emitted per session.+ /// Both the reader thread and watchdog check-and-set this before emitting.+ terminated_emitted: Arc<AtomicBool>,}impl PiManager {@@ -133,6 +136,7 @@ impl PiManager {last_activity: std::time::Instant::now(),watchdog_handle: None,idle_stopped: Arc::new(AtomicBool::new(false)),+ terminated_emitted: Arc::new(AtomicBool::new(false)),}}@@ -849,6 +853,7 @@ pub async fn pi_start_inner(// Update managerlet idle_stopped = Arc::new(AtomicBool::new(false));+ let terminated_emitted = Arc::new(AtomicBool::new(false));if let Some(m) = manager_guard.as_mut() {m.child = Some(child);m.stdin = Some(stdin);@@ -856,8 +861,9 @@ pub async fn pi_start_inner(// Reset idle timer so the watchdog doesn't use a stale timestamp// from a previous session and immediately kill this new processm.last_activity = std::time::Instant::now();- // Fresh flag for this session — old reader threads keep their own Arc+ // Fresh flags for this session — old reader threads keep their own Arcm.idle_stopped = idle_stopped.clone();+ m.terminated_emitted = terminated_emitted.clone();}// Snapshot the state BEFORE dropping the lock, so we don't hold it during I/O@@ -876,6 +882,7 @@ pub async fn pi_start_inner(// real pid (frontend auto-restarts).let app_handle = app.clone();let idle_stopped_reader = idle_stopped.clone();+ let terminated_guard = terminated_emitted.clone();std::thread::spawn(move || {let reader = BufReader::new(stdout);info!("Pi stdout reader started (pid: {})", pid);@@ -914,8 +921,13 @@ pub async fn pi_start_inner(}}info!("Pi stdout reader ended (pid: {}), processed {} lines", pid, line_count);- let terminated_pid = if idle_stopped_reader.load(Ordering::Acquire) { 0u32 } else { pid };- let _ = app_handle.emit("pi_terminated", terminated_pid);+ // Only emit once per session — watchdog or overlapping sessions could race+ if terminated_guard.compare_exchange(false, true, Ordering::AcqRel, Ordering::Acquire).is_ok() {+ let terminated_pid = if idle_stopped_reader.load(Ordering::Acquire) { 0u32 } else { pid };+ let _ = app_handle.emit("pi_terminated", terminated_pid);+ } else {+ debug!("Pi stdout reader: pi_terminated already emitted for this session, skipping");+ }});// Spawn stderr reader thread — Pi may emit JSON events to stderr in somediff --git a/apps/screenpipe-app-tauri/src-tauri/src/recording.rs b/apps/screenpipe-app-tauri/src-tauri/src/recording.rsindex fc05a331a..9b366c2bd 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/recording.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/recording.rs@@ -218,15 +218,22 @@ pub async fn spawn_screenpipe(// shutting down after handle.shutdown() or stop_screenpipe()).// The embedded server will fail to bind if the port is still occupied,// so this is critical for restart reliability.- for i in 0..20 {+ // On Windows, socket cleanup after taskkill can take >7s; use 40 iterations+ // (10s) instead of 20 (5s) to avoid error 10048 (WSAEADDRINUSE).+ let max_poll_iters = if cfg!(windows) { 40 } else { 20 };+ for i in 0..max_poll_iters {match tokio::net::TcpListener::bind(format!("0.0.0.0:{}", port)).await {Ok(_) => {debug!("Port {} is free after {}ms", port, i * 250);break;}Err(_) => {- if i == 19 {- warn!("Port {} still in use after 5s, will attempt start anyway", port);+ if i == max_poll_iters - 1 {+ warn!(+ "Port {} still in use after {}s, will attempt start anyway",+ port,+ max_poll_iters * 250 / 1000+ );} else {tokio::time::sleep(tokio::time::Duration::from_millis(250)).await;}@@ -464,7 +471,8 @@ async fn kill_process_on_port(port: u16) {}let _ = kill_cmd.output().await;}- tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;+ // Windows needs extra time for socket cleanup after taskkill+ tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;info!("Killed orphaned process(es) on port {}", port);}_ => {}diff --git a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rsindex c6480b80c..3a8055fc0 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/window_api.rs@@ -14,6 +14,108 @@ use tracing::{error, info};#[cfg(target_os = "macos")]use tauri_nspanel::WebviewWindowExt;+// ---------------------------------------------------------------------------+// Pinch-to-zoom via NSMagnificationGestureRecognizer (macOS only)+// ---------------------------------------------------------------------------+// WKWebView swallows magnifyWithEvent: and doesn't fire JS gesture/wheel+// events for trackpad pinch. After the first gesture, WebKit's multi-process+// architecture routes subsequent magnify events directly to the WebContent+// process, bypassing the app's NSEvent queue entirely.+//+// The fix: attach an NSMagnificationGestureRecognizer to the panel's content+// view. Gesture recognizers fire at the view level, continuously, for every+// pinch gesture. The handler emits "native-magnify" Tauri events that the+// JS timeline code listens for.+// ---------------------------------------------------------------------------++#[cfg(target_os = "macos")]+static MAGNIFY_APP_HANDLE: std::sync::OnceLock<tauri::AppHandle> = std::sync::OnceLock::new();++/// Call once during app setup to store the AppHandle for the magnify handler.+#[cfg(target_os = "macos")]+pub fn init_magnify_handler(app: tauri::AppHandle) {+ use objc::declare::ClassDecl;+ use objc::runtime::{Class, Object, Sel};++ let _ = MAGNIFY_APP_HANDLE.set(app);++ // Register ObjC class with handleMagnify: method (only once)+ if Class::get("ScreenpipeMagnifyHandler").is_none() {+ let superclass = Class::get("NSObject").unwrap();+ let mut decl = ClassDecl::new("ScreenpipeMagnifyHandler", superclass).unwrap();+ extern "C" fn handle_magnify(_this: &Object, _sel: Sel, recognizer: *mut Object) {+ unsafe {+ use objc::{msg_send, sel, sel_impl};+ let magnification: f64 = msg_send![recognizer, magnification];+ // Reset so next callback gives delta, not cumulative+ let _: () = msg_send![recognizer, setMagnification: 0.0f64];+ if let Some(app) = MAGNIFY_APP_HANDLE.get() {+ let _ = app.emit("native-magnify", magnification);+ }+ }+ }+ unsafe {+ use objc::{sel, sel_impl};+ decl.add_method(+ sel!(handleMagnify:),+ handle_magnify as extern "C" fn(&Object, Sel, *mut Object),+ );+ }+ decl.register();+ }++ info!("magnify gesture handler registered");+}++#[cfg(not(target_os = "macos"))]+pub fn init_magnify_handler(_app: tauri::AppHandle) {}++/// Attach an NSMagnificationGestureRecognizer to a panel's content view.+/// Safe to call multiple times — skips if already attached.+#[cfg(target_os = "macos")]+pub unsafe fn attach_magnify_gesture(panel: &tauri_nspanel::raw_nspanel::RawNSPanel) {+ use objc::{class, msg_send, sel, sel_impl};+ use tauri_nspanel::cocoa::base::{id, nil};+ use tauri_nspanel::cocoa::foundation::NSArray;++ let content_view: id = panel.content_view();++ // Check if we already added our recognizer (look for ScreenpipeMagnifyHandler target)+ let recognizers: id = msg_send![content_view, gestureRecognizers];+ if recognizers != nil {+ let count: u64 = NSArray::count(recognizers);+ let handler_class = class!(ScreenpipeMagnifyHandler);+ for i in 0..count {+ let r: id = NSArray::objectAtIndex(recognizers, i);+ let target: id = msg_send![r, target];+ if target != nil {+ let is_ours: bool = msg_send![target, isKindOfClass: handler_class];+ if is_ours {+ return; // already attached+ }+ }+ }+ }++ // Create handler instance+ let handler_class = class!(ScreenpipeMagnifyHandler);+ let handler: id = msg_send![handler_class, new];++ // Create NSMagnificationGestureRecognizer+ let recognizer: id = msg_send![+ class!(NSMagnificationGestureRecognizer),+ alloc+ ];+ let recognizer: id = msg_send![+ recognizer,+ initWithTarget: handler+ action: sel!(handleMagnify:)+ ];++ // Add to content view+ let _: () = msg_send![content_view, addGestureRecognizer: recognizer];+}+/// Run a closure on the main thread, catching any panics so they don't abort/// the process (Rust panics inside `run_on_main_thread` cross the Obj-C FFI/// boundary in `tao::send_event`, which is `nounwind` → calls `abort()`).@@ -113,6 +215,9 @@ pub unsafe fn make_webview_first_responder(panel: &tauri_nspanel::raw_nspanel::Ruse tauri_nspanel::cocoa::base::{id, nil};use tauri_nspanel::cocoa::foundation::NSArray;+ // Ensure pinch-to-zoom gesture recognizer is attached+ attach_magnify_gesture(panel);+let content_view: id = panel.content_view();let wk_class: *const objc::runtime::Class = class!(WKWebView);diff --git a/crates/screenpipe-integrations/screenpipe-mcp/package-lock.json b/crates/screenpipe-integrations/screenpipe-mcp/package-lock.jsonindex e9d792782..e0548610e 100644--- a/crates/screenpipe-integrations/screenpipe-mcp/package-lock.json+++ b/crates/screenpipe-integrations/screenpipe-mcp/package-lock.json@@ -1,12 +1,12 @@{"name": "screenpipe-mcp",- "version": "0.3.1",+ "version": "0.8.2","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "screenpipe-mcp",- "version": "0.3.1",+ "version": "0.8.2","license": "MIT","dependencies": {"@modelcontextprotocol/sdk": "^1.0.0",@@ -900,7 +900,6 @@"integrity": "sha512-WJtwWJu7UdlvzEAUm484QNg5eAoq5QR08KDNx7g45Usrs2NtOPiX8ugDqmKdXkyL03rBqU5dYNYVQetEpBHq2g==","dev": true,"license": "MIT",- "peer": true,"dependencies": {"undici-types": "~6.21.0"}@@ -1502,7 +1501,6 @@"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz","integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==","license": "MIT",- "peer": true,"dependencies": {"accepts": "^2.0.0","body-parser": "^2.2.1",@@ -2482,7 +2480,6 @@"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==","dev": true,"license": "Apache-2.0",- "peer": true,"bin": {"tsc": "bin/tsc","tsserver": "bin/tsserver"@@ -2746,7 +2743,6 @@"resolved": "https://registry.npmjs.org/zod/-/zod-4.3.5.tgz","integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==","license": "MIT",- "peer": true,"funding": {"url": "https://github.com/sponsors/colinhacks"}diff --git a/crates/screenpipe-integrations/screenpipe-mcp/src/index.ts b/crates/screenpipe-integrations/screenpipe-mcp/src/index.tsindex 7a179d109..49917e0a9 100644--- a/crates/screenpipe-integrations/screenpipe-mcp/src/index.ts+++ b/crates/screenpipe-integrations/screenpipe-mcp/src/index.ts@@ -64,7 +64,7 @@ const BASE_TOOLS: Tool[] = [{name: "search-content",description:- "Search screenpipe's recorded content: screen text (OCR), audio transcriptions, and UI elements. " ++ "Search screenpipe's recorded content: screen text (accessibility APIs, with OCR fallback), audio transcriptions, and UI elements. " +"Returns timestamped results with app context. " +"Call with no parameters to get recent activity. " +"Use the 'screenpipe://context' resource for current time when building time-based queries.\n\n" +@@ -86,7 +86,7 @@ const BASE_TOOLS: Tool[] = [content_type: {type: "string",enum: ["all", "ocr", "audio", "input", "accessibility"],- description: "Content type filter: 'ocr' (screen text), 'audio' (transcriptions), 'input' (clicks, keystrokes, clipboard, app switches), 'accessibility' (accessibility tree text), 'all'. Default: 'all'.",+ description: "Content type filter: 'ocr' (screen text via OCR, legacy fallback), 'audio' (transcriptions), 'input' (clicks, keystrokes, clipboard, app switches), 'accessibility' (accessibility tree text, preferred for screen content), 'all'. Default: 'all'.",default: "all",},limit: {@@ -291,16 +291,16 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {## Data ModalitiesScreenpipe captures four types of data:-1. **OCR** - Screen text from screenshots-2. **Audio** - Transcribed speech from microphone/system audio-3. **Input** - Keyboard input, mouse clicks, app switches, clipboard (macOS)-4. **Accessibility** - Accessibility tree text+1. **Accessibility** - Screen text via accessibility APIs (primary, preferred for screen content)+2. **OCR** - Screen text from screenshots (legacy fallback for apps without accessibility support)+3. **Audio** - Transcribed speech from microphone/system audio+4. **Input** - Keyboard input, mouse clicks, app switches, clipboard (macOS)## Quick Start- **Get recent activity**: Call search-content with no parameters-- **Search text**: \`{"q": "search term", "content_type": "ocr"}\`+- **Search screen text**: \`{"q": "search term", "content_type": "all"}\`- **Get keyboard input**: \`{"content_type": "input"}\`-- **Get accessibility text**: \`{"content_type": "accessibility"}\`+- **Get audio only**: \`{"content_type": "audio"}\`## search-content| Parameter | Description | Default |@@ -471,7 +471,7 @@ Current time: ${dateInfo.isoDate}Use search-content with:- app_name: "${app}"${query ? `- q: "${query}"` : "- No query filter"}-- content_type: "ocr"+- content_type: "all"- limit: 50`,},},diff --git a/crates/screenpipe-server/src/sync_api.rs b/crates/screenpipe-server/src/sync_api.rsindex 7d0478d3a..89af05af5 100644--- a/crates/screenpipe-server/src/sync_api.rs+++ b/crates/screenpipe-server/src/sync_api.rs@@ -230,6 +230,8 @@ pub async fn sync_init(tokio::time::sleep(tokio::time::Duration::from_secs(30)).await;let interval = tokio::time::Duration::from_secs(request.sync_interval_secs.unwrap_or(300));+ let max_backoff = tokio::time::Duration::from_secs(30 * 60); // 30 minutes+ let mut consecutive_failures: u32 = 0;loop {let end = chrono::Utc::now();@@ -301,19 +303,38 @@ pub async fn sync_init(// Advance cursor*download_cursor.write().await = Some(end.to_rfc3339());+ consecutive_failures = 0;}Ok(_) => {info!("sync download: no new blobs from other devices");// Still advance cursor so we don't re-check the same window*download_cursor.write().await = Some(end.to_rfc3339());+ consecutive_failures = 0;}Err(e) => {- warn!("sync download: failed: {}", e);+ consecutive_failures += 1;+ warn!(+ "sync download: failed (attempt {}): {}",+ consecutive_failures, e+ );// Don't advance cursor on failure — retry same window next time}}- tokio::time::sleep(interval).await;+ // Exponential backoff after 3+ consecutive failures (capped at 30 min)+ let sleep_dur = if consecutive_failures >= 3 {+ let exp = (consecutive_failures - 2).min(3); // 1,2,3 → 2x,4x,8x+ let backoff = interval * 2u32.pow(exp);+ let capped = backoff.min(max_backoff);+ warn!(+ "sync download: {} consecutive failures, backing off to {:?}",+ consecutive_failures, capped+ );+ capped+ } else {+ interval+ };+ tokio::time::sleep(sleep_dur).await;}});diff --git a/crates/screenpipe-server/src/ui_recorder.rs b/crates/screenpipe-server/src/ui_recorder.rsindex 676c5a914..35505627d 100644--- a/crates/screenpipe-server/src/ui_recorder.rs+++ b/crates/screenpipe-server/src/ui_recorder.rs@@ -592,13 +592,20 @@ fn run_tree_walker(metrics.total_text_chars += snap.text_content.len() as u64;- match rt_handle.block_on(db.insert_accessibility_text(- &snap.app_name,- &snap.window_name,- &snap.text_content,- snap.browser_url.as_deref(),- )) {- Ok(_id) => {+ // Wrap block_on in catch_unwind — during shutdown the tokio+ // runtime may be tearing down, causing block_on to panic.+ // Losing one DB write on shutdown is harmless.+ let db_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {+ rt_handle.block_on(db.insert_accessibility_text(+ &snap.app_name,+ &snap.window_name,+ &snap.text_content,+ snap.browser_url.as_deref(),+ ))+ }));++ match db_result {+ Ok(Ok(_id)) => {debug!("Stored accessibility text: app={}, window={}, len={}, nodes={}, walk={}ms",snap.app_name,@@ -610,10 +617,14 @@ fn run_tree_walker(cache.record_store(&snap.app_name, &snap.window_name, snap.simhash);metrics.walks_stored += 1;}- Err(e) => {+ Ok(Err(e)) => {debug!("Failed to insert accessibility text: {}", e);metrics.walks_error += 1;}+ Err(_) => {+ debug!("Runtime shutting down, stopping tree-walker DB writes");+ break;+ }}} else {metrics.walks_deduped += 1;