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
release-app add button to start screenpipe on store when it's down
Louis Beaumontb0e77f115c4e
diff --git a/screenpipe-app-tauri/components/pipe-store.tsx b/screenpipe-app-tauri/components/pipe-store.tsxindex 8bb1fc89e..0a3d829e4 100644--- a/screenpipe-app-tauri/components/pipe-store.tsx+++ b/screenpipe-app-tauri/components/pipe-store.tsx@@ -32,6 +32,7 @@ import localforage from "localforage";import { useLoginDialog } from "./login-dialog";import { PermissionButtons } from "./status/permission-buttons";import { usePlatform } from "@/lib/hooks/use-platform";+import { invoke } from "@tauri-apps/api/core";const corePipes: string[] = [];@@ -55,6 +56,7 @@ export const PipeStore: React.FC = () => {new Set());const { isMac: isMacOS } = usePlatform();+ const [isRestarting, setIsRestarting] = useState(false);const filteredPipes = pipes.filter((pipe) =>@@ -884,6 +886,46 @@ export const PipeStore: React.FC = () => {}};+ const handleRestartScreenpipe = async () => {+ setIsRestarting(true);+ const toastId = toast({+ title: "restarting screenpipe",+ description: "please wait...",+ duration: Infinity,+ });++ try {+ // First stop+ await invoke("stop_screenpipe");+ await new Promise((resolve) => setTimeout(resolve, 2000));++ // Then start+ await invoke("spawn_screenpipe");+ await new Promise((resolve) => setTimeout(resolve, 2000));++ toastId.update({+ id: toastId.id,+ title: "screenpipe restarted",+ description: "screenpipe has been restarted successfully.",+ duration: 3000,+ });+ } catch (error) {+ console.error("failed to restart screenpipe:", error);+ toastId.update({+ id: toastId.id,+ title: "error",+ description: "failed to restart screenpipe.",+ variant: "destructive",+ duration: 3000,+ });+ } finally {+ toastId.dismiss();+ await new Promise((resolve) => setTimeout(resolve, 2000));++ setIsRestarting(false);+ }+ };+useEffect(() => {fetchStorePlugins();}, [installedPipes, purchaseHistory]);@@ -922,18 +964,17 @@ export const PipeStore: React.FC = () => {// Store current time as last checkawait localforage.setItem("lastUpdateCheck", now);- const installedPipes = pipes.filter((pipe) =>- pipe.is_installed &&- pipe.installed_config?.version+ const installedPipes = pipes.filter(+ (pipe) => pipe.is_installed && pipe.installed_config?.version);-+// Skip if no pipes to checkif (installedPipes.length === 0) return;// Format pipes for batch update check- const pluginsToCheck = installedPipes.map(pipe => ({+ const pluginsToCheck = installedPipes.map((pipe) => ({pipe_id: pipe.id,- version: pipe.installed_config!.version!+ version: pipe.installed_config!.version!,}));const storeApi = await PipeApi.create(settings.user.token);@@ -941,8 +982,8 @@ export const PipeStore: React.FC = () => {// Process updates and install themfor (const pipe of installedPipes) {- const update = updates.results.find(u => u.pipe_id === pipe.id);- if (update && 'has_update' in update && update.has_update) {+ const update = updates.results.find((u) => u.pipe_id === pipe.id);+ if (update && "has_update" in update && update.has_update) {await handleUpdatePipe(pipe);}}@@ -1016,14 +1057,27 @@ export const PipeStore: React.FC = () => {<p className="text-sm text-muted-foreground">please start the screenpipe service to browse and manage pipes</p>- <Button- variant="outline"- onClick={openStatusDialog}- className="gap-2"- >- <Power className="h-4 w-4" />- check service status- </Button>+ <div className="flex flex-col gap-2">+ <Button+ variant="outline"+ onClick={handleRestartScreenpipe}+ disabled={isRestarting}+ className="gap-2"+ >+ <RefreshCw+ className={`h-4 w-4 ${isRestarting ? "animate-spin" : ""}`}+ />+ {isRestarting ? "restarting..." : "restart screenpipe"}+ </Button>+ <Button+ variant="outline"+ onClick={openStatusDialog}+ className="gap-2"+ >+ <Power className="h-4 w-4" />+ check service status+ </Button>+ </div>{isMacOS && (<div className="mt-6 pt-4 border-t w-full flex flex-col items-center">diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lockindex 8c577c8d5..41d12399c 100755--- a/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -5289,7 +5289,7 @@ dependencies = [[[package]]name = "screenpipe-app"-version = "0.38.3"+version = "0.38.5"dependencies = ["anyhow","async-stream",diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.tomlindex e57720c15..1afcfd071 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 = "0.38.5"+version = "0.38.6"description = ""authors = ["you"]license = ""