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 now screenpipe-cloud list realtime available ai models, fix onboarding
Louis Beaumont8de59ff10b71
diff --git a/screenpipe-app-tauri/components/onboarding/login.tsx b/screenpipe-app-tauri/components/onboarding/login.tsxindex a2730f3ad..0cb382ddf 100644--- a/screenpipe-app-tauri/components/onboarding/login.tsx+++ b/screenpipe-app-tauri/components/onboarding/login.tsx@@ -21,7 +21,7 @@ const OnboardingLogin: React.FC<OnboardingLoginProps> = ({handlePrevSlide,handleNextSlide,}) => {- const { settings, updateSettings } = useSettings();+ const { settings, updateSettings, loadUser } = useSettings();useEffect(() => {const setupDeepLink = async () => {@@ -32,6 +32,7 @@ const OnboardingLogin: React.FC<OnboardingLoginProps> = ({const apiKey = new URL(url).searchParams.get("api_key");if (apiKey) {updateSettings({ user: { token: apiKey } });+ loadUser(apiKey);toast({title: "logged in!",description: "your api key has been set",@@ -55,76 +56,76 @@ const OnboardingLogin: React.FC<OnboardingLoginProps> = ({}, [settings.user?.token, updateSettings, handleNextSlide]);return (- <div className={`${className} w-full flex justify-center flex-col px-6`}>- <div className="flex flex-col items-center mb-8">- <img className="w-24 h-24" src="/128x128.png" alt="screenpipe-logo" />- <h1 className="text-2xl font-bold mt-4">welcome to screenpipe</h1>- </div>-- <div className="space-y-6">- <div className="flex items-center gap-3">- <Coins className="w-4 h-4 text-muted-foreground" />- <h4 className="text-sm font-medium">credits & usage</h4>- <Badge variant="secondary" className="rounded-full px-2.5 py-0.5">- {settings.user?.credits?.amount || 0} available- </Badge>+ <div className="w-full h-full flex flex-col items-center justify-center space-y-6 py-4">+ <div className="w-full max-w-md space-y-6">+ <div className="text-center space-y-2 mb-8">+ <h1 className="text-3xl font-bold">login to screenpipe</h1>+ <p className="text-sm text-muted-foreground">+ connect your account to unlock all features+ </p></div>- <div className="space-y-3">- <Label className="text-sm font-medium text-muted-foreground">- screenpipe api key- </Label>- <div className="flex gap-2">- <Input- value={settings.user?.token || ""}- onChange={(e) => {- updateSettings({- user: { token: e.target.value },- });- }}- placeholder="enter your api key"- className="font-mono text-sm bg-secondary/30"- />- <Button- variant="secondary"- size="sm"- onClick={async () => {- toast({ title: "key verified" });- handleNextSlide();- }}- >- verify- </Button>+ <div className="p-6 border border-border/50 rounded-lg bg-background/50">+ <div className="space-y-4">+ {settings.user?.email ? (+ <p className="text-sm text-muted-foreground flex items-center justify-center gap-2">+ <span className="inline-flex h-2 w-2 rounded-full bg-green-500" />+ logged in as {settings.user.email}+ </p>+ ) : (+ <p className="text-sm text-muted-foreground flex items-center justify-center gap-2">+ <span className="inline-flex h-2 w-2 rounded-full bg-yellow-500" />+ not logged in - some features will be limited+ </p>+ )}++ <div className="flex flex-col gap-2">+ {settings.user?.token ? (+ <>+ <Button+ variant="outline"+ size="sm"+ onClick={() => open("https://accounts.screenpi.pe/user")}+ className="w-full hover:bg-secondary/80"+ >+ manage account <UserCog className="w-4 h-4 ml-2" />+ </Button>+ <Button+ variant="outline"+ size="sm"+ onClick={() => {+ updateSettings({ user: { token: undefined } });+ toast({+ title: "logged out",+ description: "you have been logged out",+ });+ }}+ className="w-full hover:bg-secondary/80"+ >+ logout <ExternalLinkIcon className="w-4 h-4 ml-2" />+ </Button>+ </>+ ) : (+ <Button+ variant="outline"+ size="sm"+ onClick={() => open("https://screenpi.pe/login")}+ className="w-full hover:bg-secondary/80"+ >+ login <ExternalLinkIcon className="w-4 h-4 ml-2" />+ </Button>+ )}+ </div></div></div>- <div className="flex gap-2 justify-center mt-6">- {settings.user?.token && (- <Button- variant="outline"- size="sm"- onClick={() => open("https://accounts.screenpi.pe/user")}- className="hover:bg-secondary/80"- >- manage account <UserCog className="w-4 h-4 ml-2" />- </Button>- )}- <Button- variant="outline"- size="sm"- onClick={() => open("https://screenpi.pe/login")}- className="hover:bg-secondary/80"- >- login <ExternalLinkIcon className="w-4 h-4 ml-2" />- </Button>- <OnboardingNavigation- className="mt-6"- handlePrevSlide={handlePrevSlide}- handleNextSlide={handleNextSlide}- prevBtnText="previous"- nextBtnText="next"- />- </div>+ <OnboardingNavigation+ className="mt-6"+ handlePrevSlide={handlePrevSlide}+ handleNextSlide={handleNextSlide}+ prevBtnText="previous"+ nextBtnText="next"+ /></div></div>);diff --git a/screenpipe-app-tauri/components/onboarding/pipe-store.tsx b/screenpipe-app-tauri/components/onboarding/pipe-store.tsxindex 5ae8784df..66644dbb0 100644--- a/screenpipe-app-tauri/components/onboarding/pipe-store.tsx+++ b/screenpipe-app-tauri/components/onboarding/pipe-store.tsx@@ -5,6 +5,8 @@ import OnboardingNavigation from "./navigation";import { toast } from "@/components/ui/use-toast";import { invoke } from "@tauri-apps/api/core";import posthog from "posthog-js";+import { PipeApi } from "@/lib/api/store";+import { useSettings } from "@/lib/hooks/use-settings";interface OnboardingPipeStoreProps {className?: string;@@ -18,7 +20,8 @@ const OnboardingPipeStore: React.FC<OnboardingPipeStoreProps> = ({handleNextSlide,}) => {const [isLoading, setIsLoading] = React.useState(false);-+ const [status, setStatus] = React.useState<string>("");+ const { settings } = useSettings();const handleOpenSearchPipe = async () => {setIsLoading(true);try {@@ -42,7 +45,40 @@ const OnboardingPipeStore: React.FC<OnboardingPipeStoreProps> = ({await new Promise((resolve) => setTimeout(resolve, 5_000));}- // Enable the search pipe if not already enabled+ // First check if pipe is installed by listing pipes+ const listResponse = await fetch("http://localhost:3030/pipes/list");+ const listData = await listResponse.json();+ const searchPipe = listData.data.find(+ (p: any) => p.config?.id === "search"+ );++ // If not installed, download it first+ if (!searchPipe) {+ setStatus("downloading search pipe... (~10s)");+ const pipeApi = await PipeApi.create(settings.user?.token!);+ const storePlugins = await pipeApi.listStorePlugins();+ const downloadData = await pipeApi.downloadPipe(+ storePlugins.find((p) => p.name === "search")?.id!+ );++ await fetch("http://localhost:3030/pipes/download-private", {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ pipe_name: "search",+ pipe_id: "search",+ url: downloadData.download_url,+ }),+ });++ // Wait for download to complete+ await new Promise((resolve) => setTimeout(resolve, 2000));+ }++ // Enable the search pipe+ setStatus("enabling search pipe... (~10s)");await fetch("http://localhost:3030/pipes/enable", {method: "POST",headers: {@@ -52,20 +88,23 @@ const OnboardingPipeStore: React.FC<OnboardingPipeStoreProps> = ({});// Wait for pipe to initialize+ setStatus("initializing search pipe... (~10s)");await new Promise((resolve) => setTimeout(resolve, 2000));- // Get pipe info to find the port+ // Get updated pipe info to find the portconst response = await fetch("http://localhost:3030/pipes/list");const data = await response.json();- const searchPipe = data.data.find((p: any) => p.id === "search");+ const updatedSearchPipe = data.data.find(+ (p: any) => p.config?.id === "search"+ );- if (!searchPipe?.config?.port) {+ if (!updatedSearchPipe?.config?.port) {throw new Error("search pipe not found or port not configured");}- // Check if pipe is actually running by trying to connect to its port+ // Check if pipe is actually runningtry {- await fetch(`http://localhost:${searchPipe.config.port}`, {+ await fetch(`http://localhost:${updatedSearchPipe.config.port}`, {mode: "no-cors",});} catch (error) {@@ -74,7 +113,7 @@ const OnboardingPipeStore: React.FC<OnboardingPipeStoreProps> = ({// Open the pipe windowawait invoke("open_pipe_window", {- port: searchPipe.config.port,+ port: updatedSearchPipe.config.port,title: "search",});@@ -84,9 +123,6 @@ const OnboardingPipeStore: React.FC<OnboardingPipeStoreProps> = ({description: "you can now search through your recordings",duration: 2000,});-- // Move to next slide- // handleNextSlide();} catch (error) {console.error("failed to open search pipe:", error);toast({@@ -96,6 +132,7 @@ const OnboardingPipeStore: React.FC<OnboardingPipeStoreProps> = ({});} finally {setIsLoading(false);+ setStatus("");}};@@ -122,24 +159,29 @@ const OnboardingPipeStore: React.FC<OnboardingPipeStoreProps> = ({screenpipe records your screen and audio 24/7 and makes it easyfor AI to search through your recordings. developers can createpowerful apps on top of screenpipe. let's start with- "search" to explore your recordings.- once in the search pipe, you can use the "search"- button to search through your recordings and ask a summary to AI.+ "search" to explore your recordings. once in the search+ pipe, you can use the "search" button to search through+ your recordings and ask a summary to AI.</p>- <Button- size="lg"- className="gap-2 my-8"- onClick={handleOpenSearchPipe}- disabled={isLoading}- >- {isLoading ? (- <Loader2 className="w-4 h-4 animate-spin" />- ) : (- <Search className="w-4 h-4" />+ <div className="flex flex-col items-center">+ <Button+ size="lg"+ className="gap-2 my-8"+ onClick={handleOpenSearchPipe}+ disabled={isLoading}+ >+ {isLoading ? (+ <Loader2 className="w-4 h-4 animate-spin" />+ ) : (+ <Search className="w-4 h-4" />+ )}+ {isLoading ? "opening search..." : "open search pipe"}+ </Button>+ {status && (+ <p className="text-sm text-muted-foreground mt-1">{status}</p>)}- {isLoading ? "opening search..." : "open search pipe"}- </Button>+ </div></div></div></div>diff --git a/screenpipe-app-tauri/components/settings/ai-section.tsx b/screenpipe-app-tauri/components/settings/ai-section.tsxindex 3ef82e32a..41dd28ca6 100644--- a/screenpipe-app-tauri/components/settings/ai-section.tsx+++ b/screenpipe-app-tauri/components/settings/ai-section.tsx@@ -68,6 +68,12 @@ interface OllamaModel {modified_at: string;}+interface AIModel {+ id: string;+ name: string;+ provider: string;+}+const AIProviderCard = ({type,title,@@ -169,47 +175,66 @@ const AISection = () => {settings.aiUrl !== "http://localhost:11434/v1" &&settings.aiUrl !== "embedded";- const getModelSuggestions = (provider: AIProviderType) => {- switch (provider) {- case "screenpipe-cloud":- return [- "gpt-4o",- "gpt-4o-mini",- "o1-mini",- "o1",- "claude-3-5-sonnet-latest",- "claude-3-5-haiku-latest",- "gemini-2.0-flash-exp",- "gemini-1.5-flash",- "gemini-1.5-flash-8b",- "gemini-1.5-pro",- ];- case "openai":- return ["o3-mini", "gpt-4o", "gpt-4o-mini", "o1-mini", "o1"];- default:- return [];- }- };- console.log(getModelSuggestions(settings.aiProviderType));+ const [models, setModels] = useState<AIModel[]>([]);+ const [isLoadingModels, setIsLoadingModels] = useState(false);- const [ollamaModels, setOllamaModels] = useState<OllamaModel[]>([]);+ const fetchModels = async () => {+ setIsLoadingModels(true);+ try {+ switch (settings.aiProviderType) {+ case "screenpipe-cloud":+ const response = await fetch(+ "https://ai-proxy.i-f9f.workers.dev/v1/models",+ {+ headers: {+ Authorization: `Bearer ${settings.user?.id || ""}`,+ },+ }+ );+ if (!response.ok) throw new Error("Failed to fetch models");+ const data = await response.json();+ setModels(data.models);+ break;- useEffect(() => {- const fetchOllamaModels = async () => {- if (settings.aiProviderType !== "native-ollama") return;+ case "native-ollama":+ const ollamaResponse = await fetch("http://localhost:11434/api/tags");+ if (!ollamaResponse.ok)+ throw new Error("Failed to fetch Ollama models");+ const ollamaData = (await ollamaResponse.json()) as {+ models: OllamaModel[];+ };+ setModels(+ (ollamaData.models || []).map((model) => ({+ id: model.name,+ name: model.name,+ provider: "ollama",+ }))+ );+ break;++ case "openai":+ setModels([+ { id: "gpt-4", name: "gpt-4", provider: "openai" },+ { id: "gpt-3.5-turbo", name: "gpt-3.5-turbo", provider: "openai" },+ ]);+ break;- try {- const response = await fetch("http://localhost:11434/api/tags");- if (!response.ok) throw new Error("Failed to fetch Ollama models");- const data = (await response.json()) as { models: OllamaModel[] };- setOllamaModels(data.models || []);- } catch (error) {- console.error("Failed to fetch Ollama models:", error);- setOllamaModels([]);+ default:+ setModels([]);}- };+ } catch (error) {+ console.error(+ `Failed to fetch models for ${settings.aiProviderType}:`,+ error+ );+ setModels([]);+ } finally {+ setIsLoadingModels(false);+ }+ };- fetchOllamaModels();+ useEffect(() => {+ fetchModels();}, [settings.aiProviderType]);return (@@ -349,31 +374,27 @@ const AISection = () => {press enter to use "{settings.aiModel}"</CommandEmpty><CommandGroup heading="Suggestions">- {settings.aiProviderType === "native-ollama"- ? ollamaModels?.map((model) => (- <CommandItem- key={model.name}- value={model.name}- onSelect={() => {- updateSettings({ aiModel: model.name });- }}- >- {model.name}- </CommandItem>- ))- : getModelSuggestions(settings.aiProviderType)?.map(- (model) => (- <CommandItem- key={model}- value={model}- onSelect={() => {- updateSettings({ aiModel: model });- }}- >- {model}- </CommandItem>- )- )}+ {isLoadingModels ? (+ <CommandItem value="loading" disabled>+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />+ loading models...+ </CommandItem>+ ) : (+ models.map((model) => (+ <CommandItem+ key={model.id}+ value={model.id}+ onSelect={() => {+ updateSettings({ aiModel: model.id });+ }}+ >+ {model.name}+ <Badge variant="outline" className="ml-2">+ {model.provider}+ </Badge>+ </CommandItem>+ ))+ )}</CommandGroup></CommandList></Command>diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lockindex e6d2e60a4..04f2fd93f 100755--- a/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -5274,7 +5274,7 @@ dependencies = [[[package]]name = "screenpipe-app"-version = "0.30.9"+version = "0.31.0"dependencies = ["anyhow","async-stream",diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.tomlindex 84c4f356e..079e8c024 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.31.0"+version = "0.31.1"description = ""authors = ["you"]license = ""