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
Bump app to v2.0.80, CLI to v0.2.94
Louis Beaumontb9bdd734cb78
diff --git a/Cargo.lock b/Cargo.lockindex cbff7bec8..da31365b7 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -6567,7 +6567,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"[[package]]name = "screenpipe-audio"-version = "0.2.92"+version = "0.2.93"dependencies = ["anyhow","bytemuck",@@ -6620,7 +6620,7 @@ dependencies = [[[package]]name = "screenpipe-core"-version = "0.2.92"+version = "0.2.93"dependencies = ["accessibility","accessibility-sys",@@ -6663,7 +6663,7 @@ dependencies = [[[package]]name = "screenpipe-db"-version = "0.2.92"+version = "0.2.93"dependencies = ["anyhow","chrono",@@ -6687,7 +6687,7 @@ dependencies = [[[package]]name = "screenpipe-events"-version = "0.2.92"+version = "0.2.93"dependencies = ["anyhow","chrono",@@ -6705,7 +6705,7 @@ dependencies = [[[package]]name = "screenpipe-integrations"-version = "0.2.92"+version = "0.2.93"dependencies = ["anyhow","image",@@ -6720,7 +6720,7 @@ dependencies = [[[package]]name = "screenpipe-server"-version = "0.2.92"+version = "0.2.93"dependencies = ["anyhow","axum",@@ -6783,7 +6783,7 @@ dependencies = [[[package]]name = "screenpipe-vision"-version = "0.2.92"+version = "0.2.93"dependencies = ["accessibility-sys","anyhow",diff --git a/Cargo.toml b/Cargo.tomlindex e5d6c8d9d..ee8b1d5c5 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -12,7 +12,7 @@ exclude = ["screenpipe-app-tauri/src-tauri"]resolver = "2"[workspace.package]-version = "0.2.93"+version = "0.2.94"authors = ["louis030195 <[email protected]>"]description = ""repository = "https://github.com/mediar-ai/screenpipe"diff --git a/screenpipe-app-tauri/components/global-chat.tsx b/screenpipe-app-tauri/components/global-chat.tsxindex 5c615dbba..d49175948 100644--- a/screenpipe-app-tauri/components/global-chat.tsx+++ b/screenpipe-app-tauri/components/global-chat.tsx@@ -43,6 +43,7 @@ interface ParsedMentions {contentType: "all" | "ocr" | "audio" | null;appName: string | null;usedSelection: boolean;+ speakerName: string | null;}interface ParseMentionsOptions {@@ -86,6 +87,7 @@ function parseMentions(input: string, options?: ParseMentionsOptions): ParsedMenlet contentType: "all" | "ocr" | "audio" | null = null;let appName: string | null = null;let usedSelection = false;+ let speakerName: string | null = null;// === TIME MENTIONS ===@@ -184,7 +186,33 @@ function parseMentions(input: string, options?: ParseMentionsOptions): ParsedMen}}- return { cleanedInput, timeRanges, contentType, appName, usedSelection };+ // === SPEAKER MENTIONS ===+ // Match @speaker:Name or just a capitalized name after @ that isn't a known tag+ // Pattern: @Name or @"Full Name" (quoted for multi-word names)+ const quotedSpeakerPattern = /@"([^"]+)"/g;+ const quotedMatch = quotedSpeakerPattern.exec(cleanedInput);+ if (quotedMatch) {+ speakerName = quotedMatch[1].trim();+ cleanedInput = cleanedInput.replace(quotedMatch[0], "").trim();+ } else {+ // Match @CapitalizedName (single word, must start with capital to distinguish from app tags)+ const simpleSpeakerPattern = /@([A-Z][a-zA-Z]+)(?:\s|$|,)/;+ const simpleMatch = simpleSpeakerPattern.exec(cleanedInput);+ if (simpleMatch) {+ const potentialName = simpleMatch[1];+ // Check if it's not a known app or time tag+ const knownTags = [+ "today", "yesterday", "selection", "audio", "screen", "ocr",+ ...Object.keys(APP_MAPPINGS).map(k => k.toLowerCase())+ ];+ if (!knownTags.includes(potentialName.toLowerCase())) {+ speakerName = potentialName;+ cleanedInput = cleanedInput.replace(`@${potentialName}`, "").trim();+ }+ }+ }++ return { cleanedInput, timeRanges, contentType, appName, usedSelection, speakerName };}// ============================================================================@@ -194,10 +222,11 @@ function parseMentions(input: string, options?: ParseMentionsOptions): ParsedMeninterface MentionSuggestion {tag: string;description: string;- category: "time" | "content" | "app";+ category: "time" | "content" | "app" | "speaker";}-const MENTION_SUGGESTIONS: MentionSuggestion[] = [+// Static suggestions - speakers are loaded dynamically+const STATIC_MENTION_SUGGESTIONS: MentionSuggestion[] = [// Time{ tag: "@today", description: "today's activity", category: "time" },{ tag: "@yesterday", description: "yesterday", category: "time" },@@ -220,6 +249,13 @@ const MENTION_SUGGESTIONS: MentionSuggestion[] = [{ tag: "@cursor", description: "Cursor", category: "app" },];+// Speaker interface for dynamic suggestions+interface Speaker {+ id: number;+ name: string;+ metadata?: string;+}+// Suggestion badges for timeline selectionconst TIMELINE_SUGGESTIONS = ["what did i work on?",@@ -280,6 +316,10 @@ EXAMPLES:type: "string",description: "Filter by window title substring. Useful for specific tabs/documents.",},+ speaker_name: {+ type: "string",+ description: "Filter audio transcriptions by speaker name. Use when user asks about what a specific person said. Case-insensitive partial match.",+ },},},},@@ -347,20 +387,71 @@ export function GlobalChat() {const [showMentionDropdown, setShowMentionDropdown] = useState(false);const [mentionFilter, setMentionFilter] = useState("");const [selectedMentionIndex, setSelectedMentionIndex] = useState(0);+ const [speakerSuggestions, setSpeakerSuggestions] = useState<MentionSuggestion[]>([]);+ const [isLoadingSpeakers, setIsLoadingSpeakers] = useState(false);const abortControllerRef = useRef<AbortController | null>(null);const messagesEndRef = useRef<HTMLDivElement>(null);const inputRef = useRef<HTMLInputElement>(null);const dropdownRef = useRef<HTMLDivElement>(null);- // Filter suggestions based on what user is typing after @- const filteredMentions = React.useMemo(() => {- if (!mentionFilter) return MENTION_SUGGESTIONS;- const filter = mentionFilter.toLowerCase();- return MENTION_SUGGESTIONS.filter(- s => s.tag.toLowerCase().includes(filter) || s.description.toLowerCase().includes(filter)+ // Fetch speakers dynamically when filter changes+ useEffect(() => {+ if (!mentionFilter || mentionFilter.length < 1) {+ setSpeakerSuggestions([]);+ return;+ }++ // Check if filter matches any static suggestion - if so, don't search speakers+ const matchesStatic = STATIC_MENTION_SUGGESTIONS.some(+ s => s.tag.toLowerCase().includes(`@${mentionFilter.toLowerCase()}`));+ if (matchesStatic && mentionFilter.length < 3) {+ setSpeakerSuggestions([]);+ return;+ }++ const searchSpeakers = async () => {+ setIsLoadingSpeakers(true);+ try {+ const response = await fetch(+ `${SCREENPIPE_API}/speakers/search?name=${encodeURIComponent(mentionFilter)}`+ );+ if (response.ok) {+ const speakers: Speaker[] = await response.json();+ const suggestions: MentionSuggestion[] = speakers+ .filter(s => s.name) // Only include speakers with names+ .slice(0, 5) // Limit to 5 speakers+ .map(s => ({+ tag: s.name.includes(" ") ? `@"${s.name}"` : `@${s.name}`,+ description: `speaker`,+ category: "speaker" as const,+ }));+ setSpeakerSuggestions(suggestions);+ }+ } catch (error) {+ console.error("Error searching speakers:", error);+ } finally {+ setIsLoadingSpeakers(false);+ }+ };++ const debounceTimeout = setTimeout(searchSpeakers, 300);+ return () => clearTimeout(debounceTimeout);}, [mentionFilter]);+ // Filter suggestions based on what user is typing after @+ const filteredMentions = React.useMemo(() => {+ const staticSuggestions = !mentionFilter+ ? STATIC_MENTION_SUGGESTIONS+ : STATIC_MENTION_SUGGESTIONS.filter(+ s => s.tag.toLowerCase().includes(mentionFilter.toLowerCase()) ||+ s.description.toLowerCase().includes(mentionFilter.toLowerCase())+ );++ // Combine static and dynamic speaker suggestions+ return [...staticSuggestions, ...speakerSuggestions];+ }, [mentionFilter, speakerSuggestions]);+// Handle input changes and detect @ mentionsconst handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {const value = e.target.value;@@ -528,6 +619,7 @@ export function GlobalChat() {if (args.end_time) params.append("end_time", String(args.end_time));if (args.app_name) params.append("app_name", String(args.app_name));if (args.window_name) params.append("window_name", String(args.window_name));+ if (args.speaker_name) params.append("speaker_name", String(args.speaker_name));// Add timeout to prevent hanging - 30s to handle large datasetsconst controller = new AbortController();@@ -670,6 +762,11 @@ export function GlobalChat() {mentionContext.push(`APP FILTER: ${mentions.appName} (use app_name: "${mentions.appName}")`);}+ // Speaker filter from @SpeakerName+ if (mentions.speakerName) {+ mentionContext.push(`SPEAKER FILTER: ${mentions.speakerName} (use speaker_name: "${mentions.speakerName}" and content_type: "audio")`);+ }+if (mentionContext.length > 0) {systemPrompt += `\n\nIMPORTANT - User specified filters via @mentions. ALWAYS use these in your search_content call:\n${mentionContext.join("\n\n")}`;}@@ -1206,13 +1303,13 @@ export function GlobalChat() {className="absolute bottom-full left-0 right-0 mb-1 bg-background border border-border rounded-lg shadow-lg overflow-hidden z-50 max-h-[240px] overflow-y-auto">{/* Group by category */}- {["time", "content", "app"].map(category => {+ {["time", "content", "app", "speaker"].map(category => {const items = filteredMentions.filter(m => m.category === category);if (items.length === 0) return null;return (<div key={category}><div className="px-2 py-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground bg-muted/30 border-b border-border/50">- {category === "time" ? "time" : category === "content" ? "content type" : "apps"}+ {category === "time" ? "time" : category === "content" ? "content type" : category === "speaker" ? "speakers" : "apps"}</div>{items.map((suggestion) => {const globalIndex = filteredMentions.indexOf(suggestion);@@ -1236,6 +1333,13 @@ export function GlobalChat() {</div>);})}+ {/* Loading indicator for speaker search */}+ {isLoadingSpeakers && (+ <div className="px-3 py-2 text-[10px] text-muted-foreground flex items-center gap-2">+ <Loader2 className="h-3 w-3 animate-spin" />+ <span>Searching speakers...</span>+ </div>+ )}<div className="px-2 py-1 text-[10px] text-muted-foreground border-t border-border/50 bg-muted/20"><kbd className="px-1 bg-muted rounded text-[9px]">↑↓</kbd> navigate<kbd className="px-1 bg-muted rounded text-[9px] ml-2">tab</kbd> selectdiff --git a/screenpipe-app-tauri/components/rewind/timeline.tsx b/screenpipe-app-tauri/components/rewind/timeline.tsxindex e938b3fd7..0746dfa53 100644--- a/screenpipe-app-tauri/components/rewind/timeline.tsx+++ b/screenpipe-app-tauri/components/rewind/timeline.tsx@@ -4,7 +4,9 @@ import { Loader2, RotateCcw, AlertCircle, X } from "lucide-react";import { commands } from "@/lib/utils/tauri";import { listen } from "@tauri-apps/api/event";import { AudioTranscript } from "@/components/rewind/timeline/audio-transcript";-import { TimelineProvider } from "@/lib/hooks/use-timeline-selection";+import { TimelineProvider, useTimelineSelection } from "@/lib/hooks/use-timeline-selection";+import { ExportButton } from "@/components/rewind/export-button";+import { usePlatform } from "@/lib/hooks/use-platform";import { throttle } from "lodash";import { TimelineControls } from "@/components/rewind/timeline/timeline-controls";import { addDays, isAfter, isSameDay, subDays } from "date-fns";@@ -85,6 +87,9 @@ export default function Timeline() {const { currentDate, setCurrentDate, fetchTimeRange, hasDateBeenFetched, loadingProgress, onWindowFocus, newFramesCount, lastFlushTimestamp, clearNewFramesCount } =useTimelineStore();+ const { selectionRange } = useTimelineSelection();+ const { isMac } = usePlatform();+const { frames, isLoading, error, message, fetchNextDayData, websocket } =useTimelineData(currentDate, (frame) => {setCurrentFrame(frame);@@ -638,6 +643,20 @@ export default function Timeline() {</div>)}+ {/* Selection Actions - Export Button + AI Chat Shortcut */}+ {(selectionRange?.frameIds?.length ?? 0) > 0 && (+ <div className="absolute bottom-28 right-4 z-40 pointer-events-auto">+ <div className="flex flex-col items-end gap-2">+ <div className="w-48">+ <ExportButton />+ </div>+ <div className="text-xs text-muted-foreground font-mono bg-background/80 backdrop-blur-sm px-2 py-1 border border-border">+ {isMac ? "⌘L" : "Ctrl+L"} for AI chat+ </div>+ </div>+ </div>+ )}+{/* Bottom Timeline - Overlay that doesn't cut off image */}<div className="absolute bottom-0 left-0 right-0 z-40 pointer-events-auto">{frames.length > 0 ? (diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.tomlindex 5e5b2e6c0..4b35d0e89 100644--- a/screenpipe-app-tauri/src-tauri/Cargo.toml+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml@@ -1,6 +1,6 @@[package]name = "screenpipe-app"-version = "2.0.79"+version = "2.0.80"description = "24/7 memory for your desktop. 100% local."authors = ["you"]license = ""diff --git a/screenpipe-db/src/db.rs b/screenpipe-db/src/db.rsindex 6eadfd94c..c0daaed83 100644--- a/screenpipe-db/src/db.rs+++ b/screenpipe-db/src/db.rs@@ -451,6 +451,7 @@ impl DatabaseManager {frame_name: Option<&str>,browser_url: Option<&str>,focused: Option<bool>,+ speaker_name: Option<&str>,) -> Result<Vec<SearchResult>, sqlx::Error> {let mut results = Vec::new();@@ -487,7 +488,8 @@ impl DatabaseManager {end_time,min_length,max_length,- speaker_ids+ speaker_ids,+ speaker_name,),self.search_ui_monitoring(query,@@ -567,6 +569,7 @@ impl DatabaseManager {min_length,max_length,speaker_ids,+ speaker_name,).await?;results.extend(audio_results.into_iter().map(SearchResult::Audio));@@ -597,6 +600,7 @@ impl DatabaseManager {min_length,max_length,speaker_ids,+ speaker_name,).await?;let ui_results = self@@ -657,6 +661,7 @@ impl DatabaseManager {min_length,max_length,speaker_ids,+ speaker_name,).await?;let ocr_results = self@@ -870,6 +875,7 @@ impl DatabaseManager {min_length: Option<usize>,max_length: Option<usize>,speaker_ids: Option<Vec<i64>>,+ speaker_name: Option<&str>,) -> Result<Vec<AudioResult>, sqlx::Error> {// base query for audio searchlet mut base_sql = String::from(@@ -918,6 +924,9 @@ impl DatabaseManager {if speaker_ids.is_some() {conditions.push("(json_array_length(?) = 0 OR audio_transcriptions.speaker_id IN (SELECT value FROM json_each(?)))");}+ if speaker_name.is_some() {+ conditions.push("speakers.name LIKE '%' || ? || '%' COLLATE NOCASE");+ }let where_clause = if conditions.is_empty() {"WHERE 1=1".to_owned()@@ -960,6 +969,9 @@ impl DatabaseManager {.bind(&speaker_ids_json).bind(&speaker_ids_json);}+ if let Some(name) = speaker_name {+ query_builder = query_builder.bind(name);+ }query_builder = query_builder.bind(limit as i64).bind(offset as i64);let results_raw: Vec<AudioResultRaw> = query_builder.fetch_all(&self.pool).await?;@@ -1073,6 +1085,7 @@ impl DatabaseManager {frame_name: Option<&str>,browser_url: Option<&str>,focused: Option<bool>,+ speaker_name: Option<&str>,) -> Result<usize, sqlx::Error> {// if focused or browser_url is present, we run only on OCRif focused.is_some() || browser_url.is_some() {@@ -1094,6 +1107,7 @@ impl DatabaseManager {frame_name,browser_url,focused,+ None,));let ui_future = Box::pin(self.count_search_results(@@ -1109,6 +1123,7 @@ impl DatabaseManager {None,None,None,+ None,));if app_name.is_none() && window_name.is_none() {@@ -1125,6 +1140,7 @@ impl DatabaseManager {None,None,None,+ speaker_name,));let (ocr_count, audio_count, ui_count) =@@ -1226,18 +1242,25 @@ impl DatabaseManager {ContentType::Audio => format!(r#"SELECT COUNT(DISTINCT audio_transcriptions.id)FROM {table}+ {speaker_join}WHERE {match_condition}AND (?2 IS NULL OR audio_transcriptions.timestamp >= ?2)AND (?3 IS NULL OR audio_transcriptions.timestamp <= ?3)AND (?4 IS NULL OR COALESCE(audio_transcriptions.text_length, LENGTH(audio_transcriptions.transcription)) >= ?4)AND (?5 IS NULL OR COALESCE(audio_transcriptions.text_length, LENGTH(audio_transcriptions.transcription)) <= ?5)AND (json_array_length(?6) = 0 OR audio_transcriptions.speaker_id IN (SELECT value FROM json_each(?6)))+ AND (?7 IS NULL OR speakers.name LIKE '%' || ?7 || '%' COLLATE NOCASE)"#,table = if query.is_empty() {"audio_transcriptions"} else {"audio_transcriptions_fts JOIN audio_transcriptions ON audio_transcriptions_fts.audio_chunk_id = audio_transcriptions.audio_chunk_id"},+ speaker_join = if speaker_name.is_some() {+ "LEFT JOIN speakers ON audio_transcriptions.speaker_id = speakers.id"+ } else {+ ""+ },match_condition = if query.is_empty() {"1=1"} else {@@ -1282,7 +1305,8 @@ impl DatabaseManager {.bind(end_time).bind(min_length.map(|l| l as i64)).bind(max_length.map(|l| l as i64))- .bind(json_array)+ .bind(&json_array)+ .bind(speaker_name).fetch_one(&self.pool).await?}diff --git a/screenpipe-server/src/server.rs b/screenpipe-server/src/server.rsindex 389367e4b..39ccbb037 100644--- a/screenpipe-server/src/server.rs+++ b/screenpipe-server/src/server.rs@@ -142,6 +142,9 @@ pub(crate) struct SearchQuery {focused: Option<bool>,#[serde(default)]browser_url: Option<String>,+ /// Filter audio transcriptions by speaker name (case-insensitive partial match)+ #[serde(default)]+ speaker_name: Option<String>,}#[derive(OaSchema, Deserialize)]@@ -338,7 +341,7 @@ pub(crate) async fn search(State(state): State<Arc<AppState>>,) -> Result<JsonResponse<SearchResponse>, (StatusCode, JsonResponse<serde_json::Value>)> {info!(- "received search request: query='{}', content_type={:?}, limit={}, offset={}, start_time={:?}, end_time={:?}, app_name={:?}, window_name={:?}, min_length={:?}, max_length={:?}, speaker_ids={:?}, frame_name={:?}, browser_url={:?}, focused={:?}",+ "received search request: query='{}', content_type={:?}, limit={}, offset={}, start_time={:?}, end_time={:?}, app_name={:?}, window_name={:?}, min_length={:?}, max_length={:?}, speaker_ids={:?}, frame_name={:?}, browser_url={:?}, focused={:?}, speaker_name={:?}",query.q.as_deref().unwrap_or(""),query.content_type,query.pagination.limit,@@ -353,6 +356,7 @@ pub(crate) async fn search(query.frame_name,query.browser_url,query.focused,+ query.speaker_name,);let query_str = query.q.as_deref().unwrap_or("");@@ -375,6 +379,7 @@ pub(crate) async fn search(query.frame_name.as_deref(),query.browser_url.as_deref(),query.focused,+ query.speaker_name.as_deref(),),state.db.count_search_results(query_str,@@ -389,6 +394,7 @@ pub(crate) async fn search(query.frame_name.as_deref(),query.browser_url.as_deref(),query.focused,+ query.speaker_name.as_deref(),),).await