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
chore: improve dev move UI/UX + filter out Text not found from search results
Louis Beaumont47142587c12d
diff --git a/examples/apps/screenpipe-app-tauri/app/page.tsx b/examples/apps/screenpipe-app-tauri/app/page.tsxindex 772f7bf1c..1e2e9770c 100644--- a/examples/apps/screenpipe-app-tauri/app/page.tsx+++ b/examples/apps/screenpipe-app-tauri/app/page.tsx@@ -64,17 +64,16 @@ export default function Home() {ollamaUrl={settings.ollamaUrl}/>) : (- <div className="flex flex-col items-center justify-center h-[calc(60vh-200px)]">- <Card className="w-[350px]">+ <div className="flex flex-col items-center justify-center h-[calc(80vh-200px)]">+ <Card className="w-[600px]"><CardHeader><CardTitle>Welcome to Screenpipe playground</CardTitle><CardDescription>- Make sure to run screenpipe CLI first (check status above).- Also, please, set your AI provider settings to ask questions+ Make sure to set your AI provider settings to ask questionsabout your data.<br /><br />- <Link+ {/* <Link// open new tabhref="https://youtu.be/WGnHmFFFJOc"target="_blank"@@ -82,7 +81,16 @@ export default function Home() {className="font-bold underline">Watch the onboarding video- </Link>+ </Link> */}+ <div className="aspect-w-16 aspect-h-9">+ <iframe+ src="https://www.youtube.com/embed/WGnHmFFFJOc"+ title="Onboarding Video"+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"+ allowFullScreen+ className="w-full h-[300px] rounded-lg shadow-lg"+ ></iframe>+ </div></CardDescription></CardHeader><CardContent>diff --git a/examples/apps/screenpipe-app-tauri/components/chat-list-openai-v2.tsx b/examples/apps/screenpipe-app-tauri/components/chat-list-openai-v2.tsxindex 5c456e24d..f72504a5e 100644--- a/examples/apps/screenpipe-app-tauri/components/chat-list-openai-v2.tsx+++ b/examples/apps/screenpipe-app-tauri/components/chat-list-openai-v2.tsx@@ -1,4 +1,3 @@-// ignore all file ts errors"use client";import { useState } from "react";import { z } from "zod";diff --git a/examples/apps/screenpipe-app-tauri/components/screenpipe-status.tsx b/examples/apps/screenpipe-app-tauri/components/screenpipe-status.tsxindex 186ea41da..89326b6dc 100644--- a/examples/apps/screenpipe-app-tauri/components/screenpipe-status.tsx+++ b/examples/apps/screenpipe-app-tauri/components/screenpipe-status.tsx@@ -1,30 +1,316 @@"use client";import React, { useState, useEffect } from "react";-import {- Tooltip,- TooltipContent,- TooltipProvider,- TooltipTrigger,-} from "@/components/ui/tooltip";-import { Button } from "@/components/ui/button";import {Dialog,DialogContent,DialogHeader,DialogTitle,- DialogTrigger,} from "@/components/ui/dialog";import { CodeBlock } from "@/components/ui/codeblock";-import { MemoizedReactMarkdown } from "./markdown";-import { invoke } from "@tauri-apps/api/core";-import { spinner } from "./spinner";-import {- isPermissionGranted,- sendNotification,-} from "@tauri-apps/plugin-notification";import { platform } from "@tauri-apps/plugin-os";import { MarkdownWithExternalLinks } from "./markdown-with-external-links";import { Badge } from "./ui/badge";+import { Label } from "./ui/label";+import { Switch } from "./ui/switch";+import { useSettings } from "@/lib/hooks/use-settings";+import { invoke } from "@tauri-apps/api/core";+import { toast, useToast } from "./ui/use-toast";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "./ui/tooltip";+import { Button } from "./ui/button";+import { Separator } from "./ui/separator";+import { Card, CardContent, CardFooter } from "./ui/card";++const getDebuggingCommands = (os: string | null) => {+ const cliInstructions =+ os === "windows"+ ? "# 1. Open Command Prompt as admin (search for 'cmd' in the Start menu, right click, 'Run as admin')\n# 2. Navigate to: %LOCALAPPDATA%\\screenpipe\\\n# Type: cd %LOCALAPPDATA%\\screenpipe\n"+ : os === "macos"+ ? "# 1. Open Terminal app\n# 2. Navigate to: /Applications/screenpipe.app/Contents/MacOS/\n# Type: cd /Applications/screenpipe.app/Contents/MacOS/\n"+ : "# 1. Open Terminal\n# 2. Navigate to the Screenpipe installation directory\n";++ const baseInstructions = `# First, view the Screenpipe CLI arguments:+${cliInstructions}+# 3. Run: screenpipe -h+# 4. Choose your preferred setup and start Screenpipe:+# (Replace [YOUR_ARGS] with your chosen arguments)+# Example: screenpipe --data-dir `;++ const dataDir =+ os === "windows"+ ? "%LOCALAPPDATA%\\screenpipe"+ : os === "macos"+ ? "$HOME/Library/Application\\ Support/screenpipe"+ : "$HOME/.config/screenpipe";++ const baseCommand =+ baseInstructions ++ dataDir ++ (os === "windows"+ ? "\n\n# We highly recommend adding --ocr-engine windows-native to your command.\n# This will use a very experimental but powerful engine to extract text from your screen instead of the default one.\n# Example: screenpipe --data-dir %LOCALAPPDATA%\\screenpipe --ocr-engine windows-native\n"+ : "") ++ "\n\n# 5. If you've already started Screenpipe, try these debugging commands:\n";++ if (os === "windows") {+ return (+ baseCommand ++ `# Stream the log (depending how you set the data-dir):+type %LOCALAPPDATA%\\screenpipe\\screenpipe.log++# Scroll the logs:+more %LOCALAPPDATA%\\screenpipe\\screenpipe.log++# View last 10 frames:+sqlite3 %LOCALAPPDATA%\\screenpipe\\db.sqlite "SELECT * FROM frames ORDER BY timestamp DESC LIMIT 10;"++# View last 10 audio transcriptions:+sqlite3 %LOCALAPPDATA%\\screenpipe\\db.sqlite "SELECT * FROM audio_transcriptions ORDER BY timestamp DESC LIMIT 10;"`+ );+ } else if (os === "macos") {+ return (+ baseCommand ++ `# Stream the log (depending how you set the data-dir):+tail -f $HOME/Library/Application\\ Support/screenpipe/screenpipe.log++# Scroll the logs:+less $HOME/Library/Application\\ Support/screenpipe/screenpipe.log++# View last 10 frames:+sqlite3 $HOME/Library/Application\\ Support/screenpipe/db.sqlite "SELECT * FROM frames ORDER BY timestamp DESC LIMIT 10;"++# View last 10 audio transcriptions:+sqlite3 $HOME/Library/Application\\ Support/screenpipe/db.sqlite "SELECT * FROM audio_transcriptions ORDER BY timestamp DESC LIMIT 10;"`+ );+ } else if (os === "linux") {+ return (+ baseCommand ++ `# Stream the log (depending how you set the data-dir):+tail -f $HOME/.config/screenpipe/screenpipe.log++# Scroll the logs:+less $HOME/.config/screenpipe/screenpipe.log++# View last 10 frames:+sqlite3 $HOME/.config/screenpipe/db.sqlite "SELECT * FROM frames ORDER BY timestamp DESC LIMIT 10;"++# View last 10 audio transcriptions:+sqlite3 $HOME/.config/screenpipe/db.sqlite "SELECT * FROM audio_transcriptions ORDER BY timestamp DESC LIMIT 10;"`+ );+ } else {+ return "OS not recognized. \n\nPlease check the documentation for your specific operating system.";+ }+};++const DevModeSettings = () => {+ const { settings, updateSettings } = useSettings();+ const [localSettings, setLocalSettings] = useState(settings);+ const handleDevModeToggle = (checked: boolean) => {+ setLocalSettings({ ...localSettings, devMode: checked });+ updateSettings({ ...localSettings, devMode: checked });+ };+ const [isLoading, setIsLoading] = useState(false);+ const { toast } = useToast();++ React.useEffect(() => {+ setLocalSettings(settings);+ }, [settings]);++ const handleStartScreenpipe = async () => {+ setIsLoading(true);+ const toastId = toast({+ title: "Starting Screenpipe",+ description: "Please wait...",+ duration: Infinity,+ });+ try {+ await invoke("spawn_screenpipe");+ await new Promise((resolve) => setTimeout(resolve, 2000));+ toastId.update({+ id: toastId.id,+ title: "Screenpipe Started",+ description: "Screenpipe is now running.",+ duration: 3000,+ });+ } catch (error) {+ console.error("Failed to start screenpipe:", error);+ toastId.update({+ id: toastId.id,+ title: "Error",+ description: "Failed to start Screenpipe.",+ variant: "destructive",+ duration: 3000,+ });+ } finally {+ toastId.dismiss();+ setIsLoading(false);+ }+ };++ const handleStopScreenpipe = async () => {+ setIsLoading(true);+ const toastId = toast({+ title: "Stopping Screenpipe",+ description: "Please wait...",+ duration: Infinity,+ });+ try {+ await invoke("kill_all_sreenpipes");+ await new Promise((resolve) => setTimeout(resolve, 2000));+ toastId.update({+ id: toastId.id,+ title: "Screenpipe Stopped",+ description: "Screenpipe is now stopped.",+ duration: 3000,+ });+ } catch (error) {+ console.error("Failed to stop screenpipe:", error);+ toastId.update({+ id: toastId.id,+ title: "Error",+ description: "Failed to stop Screenpipe.",+ variant: "destructive",+ duration: 3000,+ });+ } finally {+ toastId.dismiss();+ setIsLoading(false);+ }+ };++ return (+ <>+ <div className="w-full my-4">+ <div className="flex justify-around">+ <Card className="p-4 ">+ <CardContent>+ <div className="flex flex-col space-y-2">+ <div className="flex items-center space-x-2">+ <Label htmlFor="dev-mode">enable dev mode</Label>+ <Switch+ id="dev-mode"+ checked={localSettings.devMode}+ onCheckedChange={handleDevModeToggle}+ />+ </div>+ <p className="text-sm text-muted-foreground mb-4">+ on = use CLI for more control+ </p>+ </div>+ </CardContent>+ </Card>++ <div className="relative">+ <Badge+ variant="secondary"+ className="text-xs absolute -top-3 left-1/2 transform -translate-x-1/2 z-10"+ >+ expert only+ </Badge>+ <Card className="p-4">+ <CardContent>+ <div className="flex items-center space-x-2">+ <div className="flex flex-col items-center w-full">+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="outline"+ onClick={handleStopScreenpipe}+ disabled={isLoading}+ className="text-xs w-full"+ >+ stop+ </Button>+ </TooltipTrigger>+ <TooltipContent>+ <p>Stop Screenpipe backend</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ </div>+ <div className="flex flex-col items-center w-full">+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="outline"+ onClick={handleStartScreenpipe}+ disabled={isLoading}+ className="text-xs w-full"+ >+ start+ </Button>+ </TooltipTrigger>+ <TooltipContent>+ <p>Start Screenpipe backend</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ </div>+ </div>+ </CardContent>+ <CardFooter className="flex flex-col items-center">+ <p className="text-sm text-muted-foreground">+ start or stop screenpipe backend+ </p>+ <p className="text-xs text-muted-foreground">+ (auto started when dev mode is off)+ </p>+ </CardFooter>+ </Card>+ </div>+ </div>+ </div>+ {/* vertical separator */}+ <Separator orientation="vertical" />+ {settings.devMode === true && (+ <>+ <p className="font-bold my-2">did you run screenpipe backend? either click start on the right, or thru CLI 👇</p>+ <CodeBlock language="bash" value={getDebuggingCommands(platform())} />++ <div className="mt-4 text-sm text-gray-500">+ <p>or, for more advanced queries:</p>+ <ol className="list-decimal list-inside mt-2">+ <li>+ <a+ href="https://github.com/louis030195/screen-pipe/blob/main/screenpipe-server/src/db.rs"+ target="_blank"+ rel="noopener noreferrer"+ className="text-blue-500 hover:underline"+ >+ go to the database schema+ </a>+ </li>+ <li>Copy the entire page (Cmd+A, Cmd+C)</li>+ <li>Paste into ChatGPT (Cmd+V)</li>+ <li>+ ask: "give me 10 sqlite query CLI to look up my data. My db+ is in $HOME/.screenpipe/db.sqlite"+ </li>+ </ol>+ <p className="mt-2">+ or if you prefer using curl, follow the same steps with the{" "}+ <a+ href="https://github.com/louis030195/screen-pipe/blob/main/screenpipe-server/src/server.rs"+ target="_blank"+ rel="noopener noreferrer"+ className="text-blue-500 hover:underline"+ >+ server.rs file+ </a>{" "}+ and ask ChatGPT for curl commands to interact with the API.+ </p>+ </div>+ </>+ )}+ </>+ );+};+interface HealthCheckResponse {status: string;last_frame_timestamp: string | null;@@ -38,7 +324,7 @@ const HealthStatus = ({ className }: { className?: string }) => {const [health, setHealth] = useState<HealthCheckResponse | null>(null);const [isBlinking, setIsBlinking] = useState(false);const [isDialogOpen, setIsDialogOpen] = useState(false);-+ const { settings } = useSettings();const fetchHealth = async () => {try {const response = await fetch("http://localhost:3030/health");@@ -47,6 +333,10 @@ const HealthStatus = ({ className }: { className?: string }) => {throw new Error(`HTTP error! status: ${response.status} ${text}`);}const data: HealthCheckResponse = await response.json();+ // only change blink and health if it changed+ if (health !== null && health.status === data.status) {+ return;+ }if (health && data.status !== health.status) {setIsBlinking(true);setTimeout(() => setIsBlinking(false), 5000); // Blink for 5 seconds on status change@@ -59,102 +349,22 @@ const HealthStatus = ({ className }: { className?: string }) => {setHealth({last_frame_timestamp: null,last_audio_timestamp: null,- frame_status: "Error",- audio_status: "Error",- status: "Error",- message: "Failed to fetch health status. Server might be down.",+ frame_status: "error",+ audio_status: "error",+ status: "error",+ message: "failed to fetch health status. server might be down.",});}};useEffect(() => {- fetchHealth();+ // fetchHealth();const interval = setInterval(fetchHealth, 1000); // Poll every 1 secondsreturn () => clearInterval(interval);// eslint-disable-next-line react-hooks/exhaustive-deps}, []);- const getDebuggingCommands = (os: string | null) => {- const cliInstructions =- os === "windows"- ? "# 1. Open Command Prompt as admin (search for 'cmd' in the Start menu, right click, 'Run as admin')\n# 2. Navigate to: %LOCALAPPDATA%\\screenpipe\\\n# Type: cd %LOCALAPPDATA%\\screenpipe\n"- : os === "macos"- ? "# 1. Open Terminal app\n# 2. Navigate to: /Applications/screenpipe.app/Contents/MacOS/\n# Type: cd /Applications/screenpipe.app/Contents/MacOS/\n"- : "# 1. Open Terminal\n# 2. Navigate to the Screenpipe installation directory\n";-- const baseInstructions = `# First, view the Screenpipe CLI arguments:-${cliInstructions}-# 3. Run: screenpipe -h-# 4. Choose your preferred setup and start Screenpipe:-# (Replace [YOUR_ARGS] with your chosen arguments)-# Example: screenpipe --data-dir `;-- const dataDir =- os === "windows"- ? "%LOCALAPPDATA%\\screenpipe"- : os === "macos"- ? "$HOME/Library/Application\\ Support/screenpipe"- : "$HOME/.config/screenpipe";-- const baseCommand =- baseInstructions +- dataDir +- (os === "windows"- ? "\n\n# We highly recommend adding --ocr-engine windows-native to your command.\n# This will use a very experimental but powerful engine to extract text from your screen instead of the default one.\n# Example: screenpipe --data-dir %LOCALAPPDATA%\\screenpipe --ocr-engine windows-native\n"- : "") +- "\n\n# 5. If you've already started Screenpipe, try these debugging commands:\n";-- if (os === "windows") {- return (- baseCommand +- `# Stream the log (depending how you set the data-dir):-type %LOCALAPPDATA%\\screenpipe\\screenpipe.log--# Scroll the logs:-more %LOCALAPPDATA%\\screenpipe\\screenpipe.log--# View last 10 frames:-sqlite3 %LOCALAPPDATA%\\screenpipe\\db.sqlite "SELECT * FROM frames ORDER BY timestamp DESC LIMIT 10;"--# View last 10 audio transcriptions:-sqlite3 %LOCALAPPDATA%\\screenpipe\\db.sqlite "SELECT * FROM audio_transcriptions ORDER BY timestamp DESC LIMIT 10;"`- );- } else if (os === "macos") {- return (- baseCommand +- `# Stream the log (depending how you set the data-dir):-tail -f $HOME/Library/Application\\ Support/screenpipe/screenpipe.log--# Scroll the logs:-less $HOME/Library/Application\\ Support/screenpipe/screenpipe.log--# View last 10 frames:-sqlite3 $HOME/Library/Application\\ Support/screenpipe/db.sqlite "SELECT * FROM frames ORDER BY timestamp DESC LIMIT 10;"--# View last 10 audio transcriptions:-sqlite3 $HOME/Library/Application\\ Support/screenpipe/db.sqlite "SELECT * FROM audio_transcriptions ORDER BY timestamp DESC LIMIT 10;"`- );- } else if (os === "linux") {- return (- baseCommand +- `# Stream the log (depending how you set the data-dir):-tail -f $HOME/.config/screenpipe/screenpipe.log--# Scroll the logs:-less $HOME/.config/screenpipe/screenpipe.log--# View last 10 frames:-sqlite3 $HOME/.config/screenpipe/db.sqlite "SELECT * FROM frames ORDER BY timestamp DESC LIMIT 10;"--# View last 10 audio transcriptions:-sqlite3 $HOME/.config/screenpipe/db.sqlite "SELECT * FROM audio_transcriptions ORDER BY timestamp DESC LIMIT 10;"`- );- } else {- return "OS not recognized. \n\nPlease check the documentation for your specific operating system.";- }- };-const getStatusColor = (status: string) => {switch (status) {case "Healthy":@@ -169,57 +379,6 @@ sqlite3 $HOME/.config/screenpipe/db.sqlite "SELECT * FROM audio_transcriptions O}};- if (health && health.status === "Error") {- return (- <>- <Badge- variant="outline"- className="cursor-pointer bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground"- onClick={() => setIsDialogOpen(true)}- >- Status{" "}- <span- className={`ml-1 w-2 h-2 rounded-full ${getStatusColor(- health.status- )} inline-block ${- // @ts-ignore- health.status === "Unhealthy" || health.status === "Error"- ? "animate-pulse"- : ""- }`}- />- </Badge>- <Dialog open={isDialogOpen} onOpenChange={setIsDialogOpen}>- <DialogContent className="max-w-3xl max-h-[80vh] flex flex-col">- <DialogHeader>- <DialogTitle>Error Status</DialogTitle>- </DialogHeader>- <div className="flex-grow overflow-auto">- <p className="text-sm mb-4">{health.message}</p>- <div className="text-xs text-red-500">- <p className="font-bold mb-1">Troubleshooting Instructions:</p>- <MarkdownWithExternalLinks className="prose prose-sm">- {`If you're experiencing issues, please try the following steps:-1. Restart screenpipe CLI.-2. Reset your Screenpipe OS audio/screen recording permissions.-3. If the problem persists, please contact support at [[email protected]](mailto:[email protected]) or @louis030195 on Discord, X, or LinkedIn.-4. Last, here are some [FAQ](https://github.com/louis030195/screen-pipe/blob/main/content/docs/NOTES.md) with visuals to help you troubleshoot.`}- </MarkdownWithExternalLinks>- <p className="font-bold mt-2 text-red-500">- Did you run screenpipe CLI first?- </p>- </div>- <CodeBlock- language="bash"- value={getDebuggingCommands(platform())}- />- </div>- </DialogContent>- </Dialog>- </>- );- }-if (!health) return null;const formatTimestamp = (timestamp: string | null) => {@@ -245,71 +404,36 @@ sqlite3 $HOME/.config/screenpipe/db.sqlite "SELECT * FROM audio_transcriptions O/></Badge><Dialog open={isDialogOpen} onOpenChange={setIsDialogOpen}>- <DialogContent className="max-w-3xl max-h-[80vh] flex flex-col">+ <DialogContent+ className="max-w-3xl max-h-[80vh] flex flex-col"+ aria-describedby="status-dialog-description"+ ><DialogHeader>- <DialogTitle>{health.status} Status</DialogTitle>+ <DialogTitle>{health.status.toLowerCase()} status</DialogTitle></DialogHeader><div className="flex-grow overflow-auto">- <p className="text-sm mb-2">{health.message}</p>- <p className="text-xs mb-1">Frame: {health.frame_status}</p>- <p className="text-xs mb-1">Audio: {health.audio_status}</p>+ <p className="text-sm mb-2">{health.message.toLowerCase()}</p>+ <p className="text-xs mb-1">frame: {health.frame_status}</p>+ <p className="text-xs mb-1">audio: {health.audio_status}</p><p className="text-xs mb-1">- Last Frame: {formatTimestamp(health.last_frame_timestamp)}+ last frame: {formatTimestamp(health.last_frame_timestamp)}</p><p className="text-xs mb-1">- Last Audio: {formatTimestamp(health.last_audio_timestamp)}+ last audio: {formatTimestamp(health.last_audio_timestamp)}</p>- <div className="text-xs mt-2 text-red-500">- <p className="font-bold mb-1">Troubleshooting Instructions:</p>++ <div className="text-xs mt-2">+ <p className="font-bold mb-1">troubleshooting Instructions:</p><MarkdownWithExternalLinks className="prose prose-sm">- {`If you're experiencing issues, please try the following steps:-1. Restart screenpipe CLI.-2. Reset your Screenpipe OS audio/screen recording permissions.-3. If the problem persists, please contact support at [[email protected]](mailto:[email protected]) or @louis030195 on Discord, X, or LinkedIn.-4. Last, here are some [FAQ](https://github.com/louis030195/screen-pipe/blob/main/content/docs/NOTES.md) with visuals to help you troubleshoot.`}+ {`if you're experiencing issues, please try the following steps:+1. restart screenpipe+2. reset your Screenpipe OS audio/screen recording permissions+3. if the problem persists, please contact support at [[email protected]](mailto:[email protected]) or @louis030195 on Discord, X, or LinkedIn+4. last, here are some [FAQ](https://github.com/louis030195/screen-pipe/blob/main/content/docs/NOTES.md) with visuals to help you troubleshoot`}</MarkdownWithExternalLinks>- <p className="font-bold mt-2 text-red-500">- Did you run screenpipe CLI first?- </p>- </div>- <CodeBlock- language="bash"- value={getDebuggingCommands(platform())}- />-- <div className="mt-4 text-sm text-gray-500">- <p>Or, for more advanced queries:</p>- <ol className="list-decimal list-inside mt-2">- <li>- <a- href="https://github.com/louis030195/screen-pipe/blob/main/screenpipe-server/src/db.rs"- target="_blank"- rel="noopener noreferrer"- className="text-blue-500 hover:underline"- >- Go to the database schema- </a>- </li>- <li>Copy the entire page (Cmd+A, Cmd+C)</li>- <li>Paste into ChatGPT (Cmd+V)</li>- <li>- Ask: "give me 10 sqlite query CLI to look up my data. My- db is in $HOME/.screenpipe/db.sqlite"- </li>- </ol>- <p className="mt-2">- Or if you prefer using curl, follow the same steps with the{" "}- <a- href="https://github.com/louis030195/screen-pipe/blob/main/screenpipe-server/src/server.rs"- target="_blank"- rel="noopener noreferrer"- className="text-blue-500 hover:underline"- >- server.rs file- </a>{" "}- and ask ChatGPT for curl commands to interact with the API.- </p></div>+ <Separator className="my-4" />+ <DevModeSettings /></div></DialogContent></Dialog>diff --git a/examples/apps/screenpipe-app-tauri/components/settings.tsx b/examples/apps/screenpipe-app-tauri/components/settings.tsxindex 5f3c731f1..ab30a3c96 100644--- a/examples/apps/screenpipe-app-tauri/components/settings.tsx+++ b/examples/apps/screenpipe-app-tauri/components/settings.tsx@@ -1,5 +1,5 @@"use client";-import React, { useState } from "react";+import React from "react";import { Input } from "@/components/ui/input";import { Label } from "@/components/ui/label";import {@@ -25,16 +25,11 @@ import { Separator } from "@/components/ui/separator";import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";import { platform } from "@tauri-apps/plugin-os";import { Textarea } from "./ui/textarea";-import { invoke } from "@tauri-apps/api/core";-import { Loader2 } from "lucide-react";-import { useToast } from "./ui/use-toast";export function Settings({ className }: { className?: string }) {const { settings, updateSettings } = useSettings();const [localSettings, setLocalSettings] = React.useState(settings);const [currentPlatform, setCurrentPlatform] = React.useState<string>("");- const [isLoading, setIsLoading] = useState(false);- const { toast } = useToast();const handleApiKeyChange = (e: React.ChangeEvent<HTMLInputElement>) => {setLocalSettings({ ...localSettings, openaiApiKey: e.target.value });@@ -64,73 +59,6 @@ export function Settings({ className }: { className?: string }) {updateSettings({ ...localSettings, customPrompt: e.target.value });};- const handleEmbeddedScreenpipeToggle = (checked: boolean) => {- setLocalSettings({ ...localSettings, useEmbeddedScreenpipe: checked });- updateSettings({ ...localSettings, useEmbeddedScreenpipe: checked });- };-- const handleStartScreenpipe = async () => {- setIsLoading(true);- const toastId = toast({- title: "Starting Screenpipe",- description: "Please wait...",- duration: Infinity,- });- try {- toastId.update({- id: toastId.id,- title: "Screenpipe Started",- description: "Screenpipe is now running.",- duration: 3000,- });- await invoke("spawn_screenpipe");- await new Promise((resolve) => setTimeout(resolve, 2000));- } catch (error) {- console.error("Failed to start screenpipe:", error);- toastId.update({- id: toastId.id,- title: "Error",- description: "Failed to start Screenpipe.",- variant: "destructive",- duration: 3000,- });- } finally {- toastId.dismiss();- setIsLoading(false);- }- };-- const handleStopScreenpipe = async () => {- setIsLoading(true);- const toastId = toast({- title: "Stopping Screenpipe",- description: "Please wait...",- duration: Infinity,- });- try {- await invoke("kill_all_sreenpipes");- await new Promise((resolve) => setTimeout(resolve, 2000));- toastId.update({- id: toastId.id,- title: "Screenpipe Stopped",- description: "Screenpipe is now stopped.",- duration: 3000,- });- } catch (error) {- console.error("Failed to stop screenpipe:", error);- toastId.update({- id: toastId.id,- title: "Error",- description: "Failed to stop Screenpipe.",- variant: "destructive",- duration: 3000,- });- } finally {- toastId.dismiss();- setIsLoading(false);- }- };-React.useEffect(() => {setLocalSettings(settings);setCurrentPlatform(platform());@@ -166,68 +94,6 @@ export function Settings({ className }: { className?: string }) {)}</DialogHeader><div className="mt-8 space-y-6">- <Card>- <CardHeader>- <CardTitle className="text-center flex items-center justify-center">- embedded screenpipe settings{" "}- <Badge variant="outline" className="ml-2">- experimental- </Badge>- </CardTitle>- </CardHeader>- <CardContent className="flex flex-col items-center">- <div className="w-full max-w-md">- <div className="flex items-center mb-4">- <Label- htmlFor="use-embedded-screenpipe"- className="flex items-center space-x-2 mr-4"- >- use embedded screenpipe- </Label>- <Switch- id="use-embedded-screenpipe"- checked={localSettings.useEmbeddedScreenpipe || false}- onCheckedChange={handleEmbeddedScreenpipeToggle}- />- </div>- <p className="text-sm text-muted-foreground mb-4">- off = use CLI- <br />- on = will try to keep one instance up all the time- <br />- (starts automatically on app boot if enabled)- </p>- <div className="flex justify-center space-x-4">- <TooltipProvider>- <Tooltip>- <TooltipTrigger asChild>- <Button- variant="outline"- onClick={handleStopScreenpipe}- disabled={isLoading}- >- stop- </Button>- </TooltipTrigger>- <TooltipContent>- <p>- This will stop all screenpipe instances running on- your computer- </p>- </TooltipContent>- </Tooltip>- </TooltipProvider>- <Button- variant="outline"- onClick={handleStartScreenpipe}- disabled={!localSettings.useEmbeddedScreenpipe || isLoading}- >- start- </Button>- </div>- </div>- </CardContent>- </Card><Card><CardHeader><CardTitle className="text-center">general ai settings</CardTitle>diff --git a/examples/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/examples/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsxindex 45fd9cc19..c84bbd72f 100644--- a/examples/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx+++ b/examples/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx@@ -1,6 +1,6 @@import { useState, useEffect } from "react";import { Store } from "@tauri-apps/plugin-store";-import { dataDir, homeDir, localDataDir } from "@tauri-apps/api/path";+import { localDataDir } from "@tauri-apps/api/path";import { join } from "@tauri-apps/api/path";interface Settings {@@ -14,7 +14,7 @@ interface Settings {installedPipes: string[];userId: string;customPrompt: string;- useEmbeddedScreenpipe: boolean;+ devMode: boolean;}let store: Store | null = null;@@ -31,8 +31,9 @@ export function useSettings() {installedPipes: [],userId: "",customPrompt: "",- useEmbeddedScreenpipe: false,+ devMode: false,});+ console.log("settings", settings);useEffect(() => {const loadSettings = async () => {@@ -59,8 +60,8 @@ export function useSettings() {const savedUserId = ((await store!.get("userId")) as string) || "";const savedCustomPrompt =((await store!.get("customPrompt")) as string) || "";- const savedUseEmbeddedScreenpipe =- ((await store!.get("useEmbeddedScreenpipe")) as boolean) || false;+ const savedDevMode =+ ((await store!.get("devMode")) as boolean) || false;setSettings({openaiApiKey: savedKey,useOllama: savedUseOllama,@@ -72,7 +73,7 @@ export function useSettings() {installedPipes: savedInstalledPipes,userId: savedUserId,customPrompt: savedCustomPrompt,- useEmbeddedScreenpipe: savedUseEmbeddedScreenpipe,+ devMode: savedDevMode,});} catch (error) {console.error("Failed to load settings:", error);@@ -89,6 +90,7 @@ export function useSettings() {try {const updatedSettings = { ...settings, ...newSettings };+ setSettings(updatedSettings);await store!.set("openaiApiKey", updatedSettings.openaiApiKey);await store!.set("useOllama", updatedSettings.useOllama);await store!.set("useCloudAudio", updatedSettings.useCloudAudio);@@ -98,11 +100,12 @@ export function useSettings() {await store!.set("installedPipes", updatedSettings.installedPipes);await store!.set("userId", updatedSettings.userId);await store!.set("customPrompt", updatedSettings.customPrompt);- await store!.set("useEmbeddedScreenpipe", updatedSettings.useEmbeddedScreenpipe);+ await store!.set("devMode", updatedSettings.devMode);await store!.save();- setSettings(updatedSettings);} catch (error) {console.error("Failed to update settings:", error);+ // Revert local state if store update fails+ setSettings(settings);}};diff --git a/screenpipe-server/src/db.rs b/screenpipe-server/src/db.rsindex 289414ccc..aed1c1291 100644--- a/screenpipe-server/src/db.rs+++ b/screenpipe-server/src/db.rs@@ -549,6 +549,7 @@ impl DatabaseManager {video_chunks ON frames.video_chunk_id = video_chunks.idWHEREocr_text.text LIKE '%' || ?1 || '%'+ AND ocr_text.text != 'No text found'AND (?2 IS NULL OR frames.timestamp >= ?2)AND (?3 IS NULL OR frames.timestamp <= ?3)"#.to_string();