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
feat: OAuth fixes, team auto-join UI, pipes UX improvements
Louis Beaumont3856bf2589ac
diff --git a/Cargo.lock b/Cargo.lockindex 2f083700a..48ffc4206 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -6737,7 +6737,7 @@ dependencies = [[[package]]name = "screenpipe-audio"-version = "0.3.265"+version = "0.3.266"dependencies = ["anyhow","audiopipe",@@ -6797,7 +6797,7 @@ dependencies = [[[package]]name = "screenpipe-config"-version = "0.3.265"+version = "0.3.266"dependencies = ["dirs 6.0.0","serde",@@ -6810,7 +6810,7 @@ dependencies = [[[package]]name = "screenpipe-connect"-version = "0.3.265"+version = "0.3.266"dependencies = ["anyhow","async-trait",@@ -6839,7 +6839,7 @@ dependencies = [[[package]]name = "screenpipe-core"-version = "0.3.265"+version = "0.3.266"dependencies = ["accessibility","accessibility-sys",@@ -6885,7 +6885,7 @@ dependencies = [[[package]]name = "screenpipe-db"-version = "0.3.265"+version = "0.3.266"dependencies = ["anyhow","chrono",@@ -6911,7 +6911,7 @@ dependencies = [[[package]]name = "screenpipe-engine"-version = "0.3.265"+version = "0.3.266"dependencies = ["anyhow","async-trait",@@ -6981,7 +6981,7 @@ dependencies = [[[package]]name = "screenpipe-events"-version = "0.3.265"+version = "0.3.266"dependencies = ["anyhow","chrono",@@ -6999,7 +6999,7 @@ dependencies = [[[package]]name = "screenpipe-screen"-version = "0.3.265"+version = "0.3.266"dependencies = ["accessibility-sys","anyhow",@@ -7039,7 +7039,7 @@ dependencies = [[[package]]name = "screenpipe-vault"-version = "0.3.265"+version = "0.3.266"dependencies = ["argon2","chacha20poly1305",diff --git a/apps/screenpipe-app-tauri/app/home/page.tsx b/apps/screenpipe-app-tauri/app/home/page.tsxindex 163a5b5af..089602320 100644--- a/apps/screenpipe-app-tauri/app/home/page.tsx+++ b/apps/screenpipe-app-tauri/app/home/page.tsx@@ -291,7 +291,7 @@ function SettingsPageContent() {// Settings modal stateconst [settingsModalOpen, setSettingsModalOpen] = useState(false);- const [modalSection, setModalSection] = useState<SettingsModalSection>("general");+ const [modalSection, setModalSection] = useState<SettingsModalSection>("display");// Open modal when URL points to a modal sectionuseEffect(() => {diff --git a/apps/screenpipe-app-tauri/components/settings/connections-section.tsx b/apps/screenpipe-app-tauri/components/settings/connections-section.tsxindex d2c546570..96e98677e 100644--- a/apps/screenpipe-app-tauri/components/settings/connections-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/connections-section.tsx@@ -896,6 +896,9 @@ function WhatsAppPanel() {<p className="text-xs text-muted-foreground">Connect your personal WhatsApp by scanning a QR code, just like WhatsApp Web. Requires <a href="https://nodejs.org" target="_blank" rel="noopener noreferrer" className="underline">Node.js</a> installed.</p>+ <p className="text-xs text-destructive">+ ⚠️ WhatsApp may ban accounts using unofficial integrations. Use at your own risk.+ </p>{status === "idle" && (<Button onClick={handlePair} size="sm" className="gap-1.5 h-7 text-xs normal-case font-sans tracking-normal">pair with QR codediff --git a/apps/screenpipe-app-tauri/components/settings/team-section.tsx b/apps/screenpipe-app-tauri/components/settings/team-section.tsxindex b09b8523b..1b38db2f8 100644--- a/apps/screenpipe-app-tauri/components/settings/team-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/team-section.tsx@@ -53,6 +53,7 @@ export function TeamSection() {const [confirmDelete, setConfirmDelete] = useState(false);const [inviteEmail, setInviteEmail] = useState("");const [sendingInvite, setSendingInvite] = useState(false);+ const [togglingAutoJoin, setTogglingAutoJoin] = useState(false);const [passphraseInput, setPassphraseInput] = useState("");const [pendingJoin, setPendingJoin] = useState<{teamId: string;@@ -648,6 +649,82 @@ export function TeamSection() {</Card>)}+ {/* Auto-join by domain (admin only) */}+ {isAdmin && (+ <Card className="p-4">+ <div className="flex items-center justify-between">+ <div>+ <h3 className="text-sm font-medium flex items-center gap-1.5">+ <Globe className="h-4 w-4" />+ auto-join by email domain+ </h3>+ <p className="text-xs text-muted-foreground mt-1">+ {team.team?.auto_join_domain+ ? `anyone signing up with @${team.team.auto_join_domain} auto-joins this team`+ : "new users with your company email domain will auto-join this team"}+ </p>+ </div>+ <Button+ variant={team.team?.auto_join_domain ? "destructive" : "outline"}+ size="sm"+ className="text-xs whitespace-nowrap"+ disabled={togglingAutoJoin}+ onClick={async () => {+ setTogglingAutoJoin(true);+ try {+ const userEmail = settings.user?.email || "";+ const userDomain = userEmail.split("@")[1]?.toLowerCase();+ const isEnabled = !!team.team?.auto_join_domain;+ const newDomain = isEnabled ? null : userDomain;++ if (!isEnabled && !userDomain) {+ toast({ title: "could not detect your email domain", variant: "destructive" });+ return;+ }++ const token = settings.user?.token;+ const res = await fetch("https://screenpi.pe/api/team", {+ method: "PATCH",+ headers: {+ "Content-Type": "application/json",+ ...(token ? { Authorization: `Bearer ${token}` } : {}),+ },+ body: JSON.stringify({ auto_join_domain: newDomain }),+ });++ const data = await res.json();+ if (!res.ok) {+ toast({ title: data.error || "failed to update", variant: "destructive" });+ return;+ }++ if (data.retro_added > 0) {+ toast({ title: `auto-join enabled — ${data.retro_added} existing user(s) added to team` });+ } else {+ toast({ title: isEnabled ? "auto-join disabled" : "auto-join enabled" });+ }++ // Refresh team data+ team.fetchTeam();+ } catch (e: any) {+ toast({ title: "failed to update", description: e.message, variant: "destructive" });+ } finally {+ setTogglingAutoJoin(false);+ }+ }}+ >+ {togglingAutoJoin ? (+ <Loader2 className="h-3 w-3 animate-spin" />+ ) : team.team?.auto_join_domain ? (+ "disable"+ ) : (+ "enable"+ )}+ </Button>+ </div>+ </Card>+ )}+{/* Members */}<Card className="p-4"><h3 className="text-sm font-medium mb-3 flex items-center gap-1.5">diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-team.ts b/apps/screenpipe-app-tauri/lib/hooks/use-team.tsindex adb55882f..473764432 100644--- a/apps/screenpipe-app-tauri/lib/hooks/use-team.ts+++ b/apps/screenpipe-app-tauri/lib/hooks/use-team.ts@@ -26,6 +26,7 @@ export interface TeamInfo {name: string;created_at: string;member_count: number;+ auto_join_domain?: string | null;}export interface TeamMember {diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.tsindex c26a74072..35451de8e 100644--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts@@ -812,10 +812,11 @@ async chatgptOauthModels() : Promise<Result<string[], string>> {/*** Start the OAuth flow for any integration that has `oauth_config()` set.* `integration_id` must match the integration's `def().id`.+ * `instance` is an optional name for multi-account support (e.g. email address).*/-async oauthConnect(integrationId: string, instance?: string | null) : Promise<Result<OAuthStatus, string>> {+async oauthConnect(integrationId: string, instance: string | null) : Promise<Result<OAuthStatus, string>> {try {- return { status: "ok", data: await TAURI_INVOKE("oauth_connect", { integrationId, instance: instance ?? null }) };+ return { status: "ok", data: await TAURI_INVOKE("oauth_connect", { integrationId, instance }) };} catch (e) {if(e instanceof Error) throw e;else return { status: "error", error: e as any };@@ -824,20 +825,20 @@ async oauthConnect(integrationId: string, instance?: string | null) : Promise<Re/*** Check whether a valid (non-expired) OAuth token exists for the given integration.*/-async oauthStatus(integrationId: string, instance?: string | null) : Promise<Result<OAuthStatus, string>> {+async oauthStatus(integrationId: string, instance: string | null) : Promise<Result<OAuthStatus, string>> {try {- return { status: "ok", data: await TAURI_INVOKE("oauth_status", { integrationId, instance: instance ?? null }) };+ return { status: "ok", data: await TAURI_INVOKE("oauth_status", { integrationId, instance }) };} catch (e) {if(e instanceof Error) throw e;else return { status: "error", error: e as any };}},/**- * Remove the stored OAuth token for the given integration.+ * Remove the stored OAuth token for the given integration instance.*/-async oauthDisconnect(integrationId: string, instance?: string | null) : Promise<Result<boolean, string>> {+async oauthDisconnect(integrationId: string, instance: string | null) : Promise<Result<boolean, string>> {try {- return { status: "ok", data: await TAURI_INVOKE("oauth_disconnect", { integrationId, instance: instance ?? null }) };+ return { status: "ok", data: await TAURI_INVOKE("oauth_disconnect", { integrationId, instance }) };} catch (e) {if(e instanceof Error) throw e;else return { status: "error", error: e as any };@@ -1215,9 +1216,15 @@ ignoredUrls?: string[];*/ignoreIncognitoWindows: boolean;/**- * Pause all screen capture when a DRM streaming app (Netflix, etc.) is focused.+ * Experimental: pause screen capture when a DRM streaming app or site is focused.+ * Off by default; engine-only pause (no full app shutdown).*/pauseOnDrmContent?: boolean;+/**+ * Automatically append text typed during a meeting to the meeting's note+ * when the meeting ends. Groups typed text by app/window context.+ */+appendTypedTextToMeetingNotes?: boolean;/*** Languages for transcription (ISO 639-1 codes).*/@@ -1332,9 +1339,11 @@ deviceId?: string;* Auto-install updates and restart when a new version is available.* When disabled, users must click "update now" in the tray menu.*/-autoUpdate?: boolean;-/** Auto-update store-installed pipes that haven't been locally modified. */-autoUpdatePipes?: boolean;+autoUpdate?: boolean;+/**+ * Auto-update store-installed pipes that haven't been locally modified.+ */+autoUpdatePipes?: boolean;/*** Timeline overlay mode: "fullscreen" (floating panel above everything) or* "window" (normal resizable window with title bar).diff --git a/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.mdindex 3a4cbcb86..f8e536632 100644--- a/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md+++ b/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md@@ -41,6 +41,7 @@ Don't jump to heavy `/search` calls. Escalate:| Step | Endpoint | When ||------|----------|------|+| 0 | `GET /memories?q=...` | **Always query first/in parallel** — highest signal, lowest cost || 1 | `GET /activity-summary?start_time=...&end_time=...` | Broad questions ("what was I doing?", "which apps?") || 2 | `GET /search?...` | Need specific content || 3 | `GET /elements?...` or `GET /frames/{id}/context` | UI structure, buttons, links |@@ -340,19 +341,38 @@ When the user says "that was actually Jordan, not Karishma":----## 11. Memories — Persistent Facts & Preferences+## 11. Memories — High-Signal Persistent Knowledge-Store and retrieve persistent memories (user preferences, decisions, project context).+**Memories are the highest-signal data source in screenpipe.** They contain curated facts, user preferences, decisions, and project context — distilled from hours of screen/audio data. Always check memories when answering questions or building context.++### When to Query Memories++**Query memories FIRST (before or alongside `/search`)** when:+- The user asks about preferences, decisions, or past context+- You need background on a project, person, or workflow+- You're generating a summary, recommendation, or action plan+- You're unsure about user preferences or past decisions+- Any task where historical context would improve the output++**Rule: If you're calling `/search`, also call `/memories` in parallel.** Memories provide the "why" behind the raw screen data. Search gives you what happened; memories tell you what matters.++### API```bash+# Search memories (FTS) — do this often!+curl "http://localhost:3030/memories?q=preference&limit=20"++# List recent memories (high importance first)+curl "http://localhost:3030/memories?min_importance=0.5&limit=20"++# Filter by source or tags+curl "http://localhost:3030/memories?source=user&tags=project&limit=20"+# Create a memorycurl -X POST http://localhost:3030/memories \-H "Content-Type: application/json" \-d '{"content": "User prefers dark mode", "source": "user", "tags": ["preference", "ui"], "importance": 0.7}'-# List/search memories-curl "http://localhost:3030/memories?q=preference&limit=10"-# Update a memorycurl -X PUT http://localhost:3030/memories/1 \-H "Content-Type: application/json" \@@ -364,7 +384,11 @@ curl -X DELETE http://localhost:3030/memories/1Parameters for `GET /memories`: `q` (FTS search), `source`, `tags`, `min_importance`, `start_time`, `end_time`, `limit`, `offset`.-Memories also appear in `/search?content_type=memory`. Use sparingly — only store genuinely useful long-lived facts, not transient observations.+Memories also appear in `/search?content_type=memory`.++### Creating Memories++When you learn something important about the user (preferences, decisions, project context), store it as a memory. Use `importance` 0.0-1.0 to rank signal. Only store genuinely useful long-lived facts, not transient observations.---diff --git a/crates/screenpipe-engine/src/meeting_detector.rs b/crates/screenpipe-engine/src/meeting_detector.rsindex ea2e2e03a..bac3bede0 100644--- a/crates/screenpipe-engine/src/meeting_detector.rs+++ b/crates/screenpipe-engine/src/meeting_detector.rs@@ -24,7 +24,10 @@//! accompanied by a leave/hangup signal (see `min_signals_required`).use chrono::{DateTime, Utc};+use futures::{FutureExt, StreamExt};use screenpipe_db::DatabaseManager;+use screenpipe_events::subscribe_to_event;+use serde::{Deserialize, Serialize};use std::sync::atomic::{AtomicBool, Ordering};use std::sync::Arc;use std::time::{Duration, Instant};@@ -2028,6 +2031,11 @@ pub async fn run_meeting_detection_loop(Err(e) => warn!("meeting v2: failed to close orphaned meetings: {}", e),}+ // Calendar enrichment: subscribe to calendar events from the event bus.+ // If the calendar isn't connected, this stream simply never yields — safe no-op.+ let mut cal_sub = subscribe_to_event::<Vec<CalendarEventSignal>>("calendar_events");+ let mut calendar_events: Vec<CalendarEventSignal> = Vec::new();+info!("meeting v2: detection loop started (base_interval={:?}, profiles={})",base_interval,@@ -2057,6 +2065,16 @@ pub async fn run_meeting_detection_loop(}}+ // Drain pending calendar events (non-blocking).+ // Each publish replaces the full list, so we keep only the latest.+ while let Some(event) = cal_sub.next().now_or_never().flatten() {+ calendar_events = event+ .data+ .into_iter()+ .filter(|e| !e.is_all_day)+ .collect();+ }+// Skip if manual meeting is active{let manual = manual_meeting.read().await;@@ -2193,6 +2211,13 @@ pub async fn run_meeting_detection_loop(if let Some(action) = action {match action {StateAction::StartMeeting { app } => {+ // Calendar enrichment: find overlapping calendar event+ let (cal_title, cal_attendees) =+ find_overlapping_calendar_event(&calendar_events);+ let attendees_str = cal_attendees+ .as_ref()+ .map(|a| a.join(", "));+// Try to merge with recently-ended meetinglet meeting_id = match db.find_recent_meeting_for_app(&app, 120).await {Ok(Some(recent)) => match db.reopen_meeting(recent.id).await {@@ -2201,17 +2226,59 @@ pub async fn run_meeting_detection_loop("meeting v2: reopened recent meeting (id={}, app={})",recent.id, app);+ // Enrich reopened meeting with calendar data if it has none+ if cal_title.is_some()+ && recent.title.as_ref().is_none_or(|t| t.is_empty())+ {+ if let Err(e) = db+ .update_meeting(+ recent.id,+ None,+ None,+ cal_title.as_deref(),+ attendees_str.as_deref(),+ None,+ None,+ )+ .await+ {+ warn!(+ "meeting v2: failed to enrich reopened meeting {}: {}",+ recent.id, e+ );+ }+ }recent.id}Err(e) => {warn!("meeting v2: failed to reopen meeting {}: {}", recent.id, e);- insert_new_meeting(&db, &app).await+ insert_new_meeting(+ &db,+ &app,+ cal_title.as_deref(),+ attendees_str.as_deref(),+ )+ .await}},- Ok(None) => insert_new_meeting(&db, &app).await,+ Ok(None) => {+ insert_new_meeting(+ &db,+ &app,+ cal_title.as_deref(),+ attendees_str.as_deref(),+ )+ .await+ }Err(e) => {warn!("meeting v2: failed to find recent meeting: {}", e);- insert_new_meeting(&db, &app).await+ insert_new_meeting(+ &db,+ &app,+ cal_title.as_deref(),+ attendees_str.as_deref(),+ )+ .await}};@@ -2230,10 +2297,6 @@ pub async fn run_meeting_detection_loop(last_seen,};}-- // Calendar enrichment removed — the old MeetingDetector- // no longer holds calendar state. Can be re-added when- // calendar events are stored in the DB.}StateAction::EndMeeting { meeting_id } => {if meeting_id >= 0 {@@ -2352,11 +2415,61 @@ fn sync_meeting_flag(}}-/// Insert a new meeting into the database. Returns the meeting ID, or -1 on failure.-async fn insert_new_meeting(db: &DatabaseManager, app: &str) -> i64 {- match db.insert_meeting(app, "ui_scan", None, None).await {+/// Calendar event signal received from the event bus (published by calendar.rs in src-tauri).+#[derive(Debug, Clone, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+struct CalendarEventSignal {+ pub title: String,+ pub start: String,+ pub end: String,+ #[serde(default)]+ pub attendees: Vec<String>,+ #[serde(default)]+ pub is_all_day: bool,+}++/// Check if any non-all-day calendar event overlaps with the current time.+/// Returns (title, attendees) of the first matching event, or (None, None).+fn find_overlapping_calendar_event(+ events: &[CalendarEventSignal],+) -> (Option<String>, Option<Vec<String>>) {+ let now = Utc::now();+ for cal_event in events {+ if let (Ok(start), Ok(end)) = (+ DateTime::parse_from_rfc3339(&cal_event.start),+ DateTime::parse_from_rfc3339(&cal_event.end),+ ) {+ let start_utc = start.with_timezone(&Utc);+ let end_utc = end.with_timezone(&Utc);+ if start_utc <= now && end_utc >= now {+ return (+ Some(cal_event.title.clone()),+ if cal_event.attendees.is_empty() {+ None+ } else {+ Some(cal_event.attendees.clone())+ },+ );+ }+ }+ }+ (None, None)+}++/// Insert a new meeting into the database with optional calendar enrichment.+/// Returns the meeting ID, or -1 on failure.+async fn insert_new_meeting(+ db: &DatabaseManager,+ app: &str,+ title: Option<&str>,+ attendees: Option<&str>,+) -> i64 {+ match db.insert_meeting(app, "ui_scan", title, attendees).await {Ok(id) => {- info!("meeting v2: meeting started (id={}, app={})", id, app);+ info!(+ "meeting v2: meeting started (id={}, app={}, title={:?})",+ id, app, title+ );id}Err(e) => {