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 fix build + pipe store
Louis Beaumont088e81b4fc1d
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.ymlindex 731e8e7a1..5cfbf5fc0 100644--- a/.github/workflows/release-app.yml+++ b/.github/workflows/release-app.yml@@ -280,7 +280,24 @@ jobs:throw "LLVM installation failed"}- - name: Run pre_build.js+ - name: Run pre_build.js on Windows+ if: matrix.tauri-args == '--target x86_64-pc-windows-msvc'+ shell: powershell+ env:+ SKIP_SCREENPIPE_SETUP: true+ run: |+ # Install wget using Chocolatey+ Set-ExecutionPolicy Bypass -Scope Process -Force+ [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072+ iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))+ choco install -y wget++ # Now run the pre_build script+ bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}+ working-directory: ./screenpipe-app-tauri++ - name: Run pre_build.js on non-Windows+ if: matrix.tauri-args != '--target x86_64-pc-windows-msvc'env:SKIP_SCREENPIPE_SETUP: truerun: bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}diff --git a/screenpipe-app-tauri/components/header.tsx b/screenpipe-app-tauri/components/header.tsxindex ad93ff82c..cab0b36b8 100644--- a/screenpipe-app-tauri/components/header.tsx+++ b/screenpipe-app-tauri/components/header.tsx@@ -25,6 +25,7 @@ import {Folder,Search,Book,+ User,} from "lucide-react";import { open } from "@tauri-apps/plugin-shell";import {@@ -147,8 +148,8 @@ export default function Header() {<Buttonvariant="ghost"size="icon"- className="cursor-pointer"onClick={() => setShowInbox(!showInbox)}+ className="cursor-pointer h-8 w-8 p-0"><Bell className="h-4 w-4" /><span className="sr-only">notifications</span>@@ -158,24 +159,9 @@ export default function Header() {<Buttonvariant="ghost"size="icon"- className="cursor-pointer rounded-full h-8 w-8 p-0"+ className="cursor-pointer h-8 w-8 p-0">- <Avatar>- <AvatarImage- src={user?.photoURL || "/avatar-placeholder.png"}- alt={user?.displayName || "user avatar"}- />- <AvatarFallback>- {user?.displayName- ? user.displayName- .split(" ")- .map((n) => n[0])- .join("")- .toUpperCase()- .slice(0, 2)- : "SP"}- </AvatarFallback>- </Avatar>+ <User className="h-4 w-4" /><span className="sr-only">user menu</span></Button></DropdownMenuTrigger>diff --git a/screenpipe-app-tauri/components/pipe-store.tsx b/screenpipe-app-tauri/components/pipe-store.tsxindex 8c5748fc7..469ea895d 100644--- a/screenpipe-app-tauri/components/pipe-store.tsx+++ b/screenpipe-app-tauri/components/pipe-store.tsx@@ -185,19 +185,13 @@ const PipeStore: React.FC = () => {const dataDir = await getDataDir();try {- const cmd = Command.sidecar("screenpipe", [- "pipe",- "list",- "--output",- "json",- ]);- const output = await cmd.execute();- const response = JSON.parse(output.stdout);-- if (!response.success) throw new Error("Failed to fetch installed pipes");-- const data = response.data;- for (const pipe of data) {+ const response = await fetch("http://localhost:3030/pipes/list");+ const data = await response.json();++ if (!data.success) throw new Error("Failed to fetch installed pipes");++ const pipes = data.data;+ for (const pipe of pipes) {const pathToReadme = await join(dataDir, "pipes", pipe.id, "README.md");try {const readme = await readFile(pathToReadme);@@ -208,7 +202,7 @@ const PipeStore: React.FC = () => {pipe.fullDescription = "no description available for this pipe.";}}- setPipes(data);+ setPipes(pipes);} catch (error) {console.error("Error fetching installed pipes:", error);toast({@@ -229,18 +223,17 @@ const PipeStore: React.FC = () => {description: "please wait...",});- const cmd = Command.sidecar("screenpipe", [- "pipe",- "download",- url,- "--output",- "json",- ]);- const output = await cmd.execute();- const response = JSON.parse(output.stdout);-- if (!response.success) {- throw new Error(response.error || "Failed to download pipe");+ const response = await fetch("http://localhost:3030/pipes/download", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({ url }),+ });+ const data = await response.json();++ if (!data.success) {+ throw new Error(data.error || "Failed to download pipe");}toast({@@ -250,7 +243,7 @@ const PipeStore: React.FC = () => {} catch (error) {console.error("Failed to download pipe:", error);toast({- title: "error downloading pipe",+ title: "error downloading pipe",description: "please try again or check the logs for more information.",variant: "destructive",});@@ -275,29 +268,34 @@ const PipeStore: React.FC = () => {enabled: !pipe.enabled,});- const action = pipe.enabled ? "disable" : "enable";- const cmd = Command.sidecar("screenpipe", ["pipe", action, pipe.id]);- await cmd.execute();+ const endpoint = pipe.enabled ? "disable" : "enable";+ const response = await fetch(`http://localhost:3030/pipes/${endpoint}`, {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({ pipe_id: pipe.id }),+ });++ const data = await response.json();+ if (!data.success) {+ throw new Error(data.error);+ }toast({- title: `${action}ing pipe`,+ title: `${endpoint}ing pipe`,description: "this may take a few moments...",});await new Promise((resolve) => setTimeout(resolve, 1000));await fetchInstalledPipes();} catch (error) {- console.error(- `Failed to ${pipe.enabled ? "disable" : "enable"} pipe:`,- error- );+ console.error(`Failed to ${pipe.enabled ? "disable" : "enable"} pipe:`, error);toast({title: "error toggling pipe",description: "please try again or check the logs for more information.",variant: "destructive",});- } finally {- await fetchInstalledPipes();}};@@ -312,18 +310,18 @@ const PipeStore: React.FC = () => {description: "please wait...",});- const cmd = Command.sidecar("screenpipe", [- "pipe",- "download",- newRepoUrl,- "--output",- "json",- ]);- const output = await cmd.execute();- const response = JSON.parse(output.stdout);-- if (!response.success) {- throw new Error(response.error || "Failed to download pipe");+ const response = await fetch("http://localhost:3030/pipes/download", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({ url: newRepoUrl }),+ });++ const data = await response.json();++ if (!data.success) {+ throw new Error(data.error || "Failed to download pipe");}await fetchInstalledPipes();@@ -368,14 +366,21 @@ const PipeStore: React.FC = () => {const handleConfigSave = async (config: Record<string, any>) => {if (selectedPipe) {try {- const configStr = JSON.stringify(config);- const cmd = Command.sidecar("screenpipe", [- "pipe",- "update",- selectedPipe.id,- configStr,- ]);- await cmd.execute();+ const response = await fetch("http://localhost:3030/pipes/update", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ pipe_id: selectedPipe.id,+ config: config,+ }),+ });++ const data = await response.json();+ if (!data.success) {+ throw new Error(data.error || "Failed to update pipe configuration");+ }toast({title: "Configuration saved",@@ -402,14 +407,21 @@ const PipeStore: React.FC = () => {description: "please wait...",});- const cmd = Command.sidecar("screenpipe", [- "pipe",- "delete",- pipe.id,- "--yes",- ]);- await cmd.execute();+ const response = await fetch("http://localhost:3030/pipes/delete", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({ pipe_id: pipe.id }),+ });+ const data = await response.json();+ if (!data.success) {+ throw new Error(data.error);+ }++ // First unselect the pipe, then fetch the updated list+ setSelectedPipe(null);await fetchInstalledPipes();toast({@@ -660,30 +672,49 @@ const PipeStore: React.FC = () => {};const handleCardClick = async (pipe: Pipe) => {- if (!pipe.enabled && pipe.source) {- // If pipe is not installed, download it first- await handleDownloadPipe(pipe.source);- // Fetch the updated pipe data after download- await fetchInstalledPipes();- // Find the newly downloaded pipe in the updated list- const updatedPipes = [- ...pipes,- ...corePipes- .filter((cp) => !pipes.some((p) => p.id === cp.id))- .map((cp) => ({- id: cp.id,- fullDescription: cp.description,- source: cp.url,- enabled: false,- })),- ];- const updatedPipe = updatedPipes.find((p) => p.id === pipe.id);- if (updatedPipe) {- setSelectedPipe(updatedPipe);+ // Check if pipe is already installed by looking in the pipes array+ const isInstalled = pipes.some(p => p.id === pipe.id);++ if (!isInstalled && pipe.source) {+ try {+ // If pipe is not installed, download it first+ await handleDownloadPipe(pipe.source);+ // Fetch the updated pipe data and wait for it+ const response = await fetch("http://localhost:3030/pipes/list");+ const data = await response.json();++ if (!data.success) throw new Error("Failed to fetch installed pipes");++ // Get the data dir and fetch README for the new pipe+ const dataDir = await getDataDir();+ const updatedPipe = data.data.find((p: Pipe) => p.id === pipe.id);++ if (updatedPipe) {+ const pathToReadme = await join(dataDir, "pipes", pipe.id, "README.md");+ try {+ const readme = await readFile(pathToReadme);+ updatedPipe.fullDescription = convertHtmlToMarkdown(+ new TextDecoder().decode(readme)+ );+ } catch (error) {+ updatedPipe.fullDescription = "no description available for this pipe.";+ }+ // Update pipes state and set selected pipe+ setPipes(data.data);+ setSelectedPipe(updatedPipe);+ }+ } catch (error) {+ console.error("Failed to download and show pipe:", error);+ toast({+ title: "error showing pipe details",+ description: "please try again or check the logs for more information.",+ variant: "destructive",+ });}} else {- // If pipe is already installed, just show the details- setSelectedPipe(pipe);+ // For already installed pipes, find the installed version+ const installedPipe = pipes.find(p => p.id === pipe.id);+ setSelectedPipe(installedPipe || pipe);}};diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lockindex 59d88ba1b..d2c2ceb93 100755--- a/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -4713,7 +4713,7 @@ dependencies = [[[package]]name = "screenpipe-app"-version = "0.14.26"+version = "0.14.27"dependencies = ["anyhow","axum",diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.tomlindex 20623bb53..b2a5aafaf 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.14.27"+version = "0.14.28"description = ""authors = ["you"]license = ""@@ -78,10 +78,6 @@ axum = "0.6.0" # or your current versiondirs = "5.0.1"-# bunch of hack for permissions-scap = { git = "https://github.com/CapSoftware/scap", rev = "58d4410bf52f" }-nokhwa-bindings-macos = { git = "https://github.com/CapSoftware/nokhwa", rev = "0d3d1f30a78b" }-tauri-nspanel = { git = "https://github.com/ahkohd/tauri-nspanel", branch = "v2" }[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]tauri-plugin-cli = "2.0.0"@@ -97,6 +93,11 @@ libc = "0.2.152"cocoa = "0.26.0"objc = "0.2.7"base64 = "0.22.1"+# bunch of hack for permissions+scap = { git = "https://github.com/CapSoftware/scap", rev = "58d4410bf52f" }+nokhwa-bindings-macos = { git = "https://github.com/CapSoftware/nokhwa", rev = "0d3d1f30a78b" }+tauri-nspanel = { git = "https://github.com/ahkohd/tauri-nspanel", branch = "v2" }+[target.'cfg(target_os = "windows")'.dependencies]winreg = "0.52.0"