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: implement whole new pipe system with automatic payout to developers, statistics, automatic pipe publishing, etc.
Louis Beaumont629020accff1
diff --git a/content/docs/pages/docs/plugins.mdx b/content/docs/pages/docs/plugins.mdxindex 3df04272b..e563daa66 100644--- a/content/docs/pages/docs/plugins.mdx+++ b/content/docs/pages/docs/plugins.mdx@@ -78,29 +78,28 @@ for developers wanting to publish pipes to the store, we provide a dedicated CLI-```bash copy-npm install -g @screenpipe/dev-```-prerequisite: connect your Stripe account in settings/account to obtain your developer API key.available commands:```bash copy# authenticate with your API key-screenpipe login --apiKey <your-key>+bunx @screenpipe/dev login --apiKey <your-key># create a new pipe-screenpipe create --name my-pipe [--paid --price 9.99]+bunx @screenpipe/dev create --name my-pipe [--paid --price 9.99] # MAKE SURE TO SET THE PRICE IF YOU WANT TO SELL IT - IRREVERSIBLE+# you'll receive payouts to your stripe account on a daily basis# publish your pipe to the store-screenpipe publish --name my-pipe+bunx @screenpipe/dev publish --name my-pipe+# our team will review your pipe and publish it to the store+# if approved, your pipe will be available in the store to everyone# list all versions of your pipe-screenpipe list-versions --name my-pipe+bunx @screenpipe/dev list-versions --name my-pipe# end current session-screenpipe logout+bunx @screenpipe/dev logout```you can deploy your pipe to your screenpipe app through the UI or using `screenpipe install <path>` and `screenpipe enable <id/folder of your pipe>`.diff --git a/pipes/obsidian/package.json b/pipes/obsidian/package.jsonindex 31afd8f15..b28d5c348 100644--- a/pipes/obsidian/package.json+++ b/pipes/obsidian/package.json@@ -1,6 +1,6 @@{- "name": "search",- "version": "0.1.0",+ "name": "obsidian",+ "version": "0.1.2","private": true,"scripts": {"dev": "next dev --turbopack",diff --git a/pipes/obsidian/src/components/obsidian-settings.tsx b/pipes/obsidian/src/components/obsidian-settings.tsxindex 6a4b2b2c3..f140acc1a 100644--- a/pipes/obsidian/src/components/obsidian-settings.tsx+++ b/pipes/obsidian/src/components/obsidian-settings.tsx@@ -571,7 +571,7 @@ export function ObsidianSettings() {</div><div className="space-y-2">- <Label htmlFor="aiModel">ollama/embedded ai model</Label>+ <Label htmlFor="aiModel">ollama/local openai-compatible model</Label><OllamaModelsListdisabled={!pathValidation.isValid}defaultValue={diff --git a/pipes/search/package.json b/pipes/search/package.jsonindex 037e22489..8a60b5544 100644--- a/pipes/search/package.json+++ b/pipes/search/package.json@@ -1,6 +1,6 @@{"name": "search",- "version": "0.1.0",+ "version": "0.1.2","private": true,"scripts": {"dev": "next dev --turbopack",diff --git a/screenpipe-actions/ai-proxy/src/index.ts b/screenpipe-actions/ai-proxy/src/index.tsindex fd0e3ba19..7c04ace20 100644--- a/screenpipe-actions/ai-proxy/src/index.ts+++ b/screenpipe-actions/ai-proxy/src/index.ts@@ -4,14 +4,64 @@ import { verifyToken } from '@clerk/backend';import { Anthropic } from '@anthropic-ai/sdk';import * as Sentry from '@sentry/cloudflare';-async function verifyClerkToken(env: Env, token: string): Promise<boolean> {+// Add cache for subscription status+class SubscriptionCache {+ private cache: Map<string, { isValid: boolean; timestamp: number }>;+ private readonly CACHE_TTL = 5 * 60 * 1000; // 5 minutes in milliseconds++ constructor() {+ this.cache = new Map();+ }++ get(userId: string): boolean | null {+ const entry = this.cache.get(userId);+ if (!entry) return null;++ if (Date.now() - entry.timestamp > this.CACHE_TTL) {+ this.cache.delete(userId);+ return null;+ }++ return entry.isValid;+ }++ set(userId: string, isValid: boolean) {+ this.cache.set(userId, {+ isValid,+ timestamp: Date.now(),+ });+ }+}++const subscriptionCache = new SubscriptionCache();++async function validateSubscription(env: Env, userId: string): Promise<boolean> {+ // Check cache first+ const cached = subscriptionCache.get(userId);+ if (cached !== null) {+ return cached;+ }+try {- const payload = await verifyToken(token, {- secretKey: env.CLERK_SECRET_KEY,+ const response = await fetch(`${env.SUPABASE_URL}/rest/v1/rpc/has_active_cloud_subscription`, {+ method: 'POST',+ headers: {+ apikey: env.SUPABASE_ANON_KEY,+ Authorization: `Bearer ${env.SUPABASE_ANON_KEY}`,+ 'Content-Type': 'application/json',+ },+ body: JSON.stringify({ user_id: userId }),});- return !!payload.sub;++ if (!response.ok) {+ throw new Error(`Supabase error: ${response.status}`);+ }++ const isValid: boolean = await response.json();+ subscriptionCache.set(userId, isValid);+ return isValid;} catch (error) {- console.error('clerk verification failed:', error);+ console.error('Error checking subscription:', error);return false;}}@@ -145,11 +195,11 @@ export default Sentry.withSentry(});}- const token = authHeader.split(' ')[1];- const isValid = await verifyClerkToken(env, token);+ const userId = authHeader.split(' ')[1];+ const isValid = await validateSubscription(env, userId);if (!isValid) {- return new Response(JSON.stringify({ error: 'invalid token' }), {+ return new Response(JSON.stringify({ error: 'invalid subscription' }), {status: 401,headers: corsHeaders,});@@ -486,9 +536,10 @@ interface Env {ANTHROPIC_API_KEY: string;DEEPGRAM_API_KEY: string;RATE_LIMITER: DurableObjectNamespace;- CLERK_SECRET_KEY: string;GEMINI_API_KEY: string;NODE_ENV?: string;+ SUPABASE_URL: string;+ SUPABASE_ANON_KEY: string;}/*diff --git a/screenpipe-app-tauri/components/pipe-store.tsx b/screenpipe-app-tauri/components/pipe-store.tsxindex cfcb000e2..af9258403 100644--- a/screenpipe-app-tauri/components/pipe-store.tsx+++ b/screenpipe-app-tauri/components/pipe-store.tsx@@ -138,6 +138,12 @@ export const PipeStore: React.FC = () => {const pipeApi = await PipeApi.create(settings.user!.token!);const response = await pipeApi.purchasePipe(pipe.id);+ if (response.data.used_credits) {+ toast({+ title: "purchase successful",+ description: "your purchase has been successful",+ });+ }openUrl(response.data.checkout_url);onComplete?.();} catch (error) {diff --git a/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx b/screenpipe-app-tauri/components/pipe-store/pipe-card.tsxindex 505252e5a..efdf3020b 100644--- a/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx+++ b/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx@@ -1,6 +1,6 @@import React, { useState } from "react";import { Button } from "@/components/ui/button";-import { Download, Puzzle, UserIcon } from "lucide-react";+import { CheckCircle, Download, Puzzle, UserIcon } from "lucide-react";import { PipeStoreMarkdown } from "@/components/pipe-store-markdown";import { PipeWithStatus } from "./types";import { invoke } from "@tauri-apps/api/core";@@ -110,7 +110,8 @@ export const PipeCard: React.FC<PipeCardProps> = ({onClick={handleOpenWindow}className="hover:bg-muted font-medium">- Installed+ <CheckCircle className="h-3.5 w-3.5 mr-2" />+ installed</Button>) : (<Button@@ -133,26 +134,26 @@ export const PipeCard: React.FC<PipeCardProps> = ({) : (<><Download className="h-3.5 w-3.5 mr-2" />- Get+ get</>)}</Button>)}</div></div>- {pipe.installed_config?.source === 'store' && (+ {pipe.installed_config?.source === "store" && (<div className="flex items-center gap-3 text-xs text-muted-foreground"><div className="flex items-center gap-1"><div className="size-6 rounded-full bg-muted flex items-center justify-center">- <UserIcon className="size-3" />+ <UserIcon className="size-3" />+ </div>+ {pipe.developer_accounts.developer_name}</div>- {pipe.developer_accounts.developer_name}- </div>- {pipe.plugin_analytics.downloads_count != null && (- <span className="flex items-center gap-1">- <Download className="h-3 w-3" />- {pipe.plugin_analytics.downloads_count}- </span>+ {pipe.plugin_analytics.downloads_count != null && (+ <span className="flex items-center gap-1">+ <Download className="h-3 w-3" />+ {pipe.plugin_analytics.downloads_count}+ </span>)}</div>)}diff --git a/screenpipe-app-tauri/components/settings/account-section.tsx b/screenpipe-app-tauri/components/settings/account-section.tsxindex cf05a7572..1f16dccce 100644--- a/screenpipe-app-tauri/components/settings/account-section.tsx+++ b/screenpipe-app-tauri/components/settings/account-section.tsx@@ -1,24 +1,14 @@"use client";import React, { useEffect, useState } from "react";-import { Input } from "@/components/ui/input";-import { Label } from "@/components/ui/label";import { Button } from "@/components/ui/button";import { useSettings } from "@/lib/hooks/use-settings";-import {- Tooltip,- TooltipContent,- TooltipProvider,- TooltipTrigger,-} from "@/components/ui/tooltip";+import { Separator } from "@/components/ui/separator";-import { Badge } from "@/components/ui/badge";import { cn } from "@/lib/utils";import {- HelpCircle,RefreshCw,- Coins,UserCog,ExternalLinkIcon,Key,@@ -26,9 +16,7 @@ import {Eye,ArrowUpRight,BookOpen,- EyeIcon,- EyeOffIcon,- CopyIcon,+ X,} from "lucide-react";import { toast } from "@/components/ui/use-toast";@@ -37,6 +25,10 @@ import { open as openUrl } from "@tauri-apps/plugin-shell";import { Card } from "../ui/card";import { onOpenUrl } from "@tauri-apps/plugin-deep-link";import { invoke } from "@tauri-apps/api/core";+import { PricingToggle } from "./pricing-toggle";+import { Label } from "@/components/ui/label";+import { Textarea } from "@/components/ui/textarea";+import { Input } from "@/components/ui/input";function PlanCard({title,@@ -89,10 +81,9 @@ function PlanCard({export function AccountSection() {const { settings, updateSettings, loadUser } = useSettings();- const [isRefreshing, setIsRefreshing] = useState(false);- const [selectedPlan, setSelectedPlan] = useState<string | null>(null);const [isConnectingStripe, setIsConnectingStripe] = useState(false);const [showApiKey, setShowApiKey] = useState(false);+ const [isAnnual, setIsAnnual] = useState(true);useEffect(() => {const setupDeepLink = async () => {@@ -103,6 +94,8 @@ export function AccountSection() {const apiKey = new URL(url).searchParams.get("api_key");if (apiKey) {updateSettings({ user: { token: apiKey } });+ await loadUser(apiKey);+toast({title: "logged in!",description: "your api key has been set",@@ -121,6 +114,7 @@ export function AccountSection() {stripe_connected: true,},});+ loadUser(settings.user.token!);}toast({title: "stripe connected!",@@ -148,52 +142,30 @@ export function AccountSection() {};}, [settings.user?.token, updateSettings]);- const handleRefreshCredits = async () => {- if (!settings.user?.token) return;-- setIsRefreshing(true);- try {- toast({- title: "credits refreshed",- description: "your credit balance has been updated",- });- } catch (error) {- toast({- title: "failed to refresh credits",- description: "please try again later",- variant: "destructive",- });- } finally {- setIsRefreshing(false);- }- };-const clientRefId = `${settings.user?.id}&customer_email=${encodeURIComponent(settings.user?.email ?? "")}`;const plans = [{- title: "monthly",- price: "$30/mo",+ title: "subscription",+ price: isAnnual ? "$200/year" : "$20/mo",features: [- "15 credits/mo","unlimited screenpipe cloud","priority support",+ isAnnual ? "17% discount applied" : "switch to annual for 17% off",],- url: `https://buy.stripe.com/5kA6p79qefweacg5kJ?client_reference_id=${clientRefId}`,- },- {- title: "one-time",- price: "$50",- features: ["50 credits", "never expires", "priority support"],- url: `https://buy.stripe.com/eVaeVD45UbfYeswcNd?client_reference_id=${clientRefId}`,+ url: isAnnual+ ? "https://buy.stripe.com/eVadRzfOCgAi5W0fZu" ++ `?client_reference_id=${clientRefId}`+ : "https://buy.stripe.com/7sIdRzbym4RA98c7sX" ++ `?client_reference_id=${clientRefId}`,},{title: "enterprise",price: "book a call",features: [- "enterprise process intelligence & process mining",+ "enterprise screen search engine","dedicated support","consulting","custom features",@@ -208,7 +180,8 @@ export function AccountSection() {const BASE_URL =(await invoke("get_env", { name: "BASE_URL_PRIVATE" })) ??"https://screenpi.pe";- const host = `${BASE_URL}/api/dev-stripe`;+ // const host = `${BASE_URL}/api/dev-stripe`;+ const host = `https://screenpi.pe/api/dev-stripe`;const response = await fetch(host, {method: "POST",headers: {@@ -222,6 +195,7 @@ export function AccountSection() {const { url } = await response.json();await openUrl(url);} catch (error) {+ console.warn("failed to connect stripe", error);toast({title: "failed to connect stripe",description: "please try again later",@@ -232,16 +206,6 @@ export function AccountSection() {}};- const handleCopyApiKey = () => {- if (settings.user?.token) {- navigator.clipboard.writeText(settings.user.token);- toast({- title: "copied to clipboard",- description: "api key copied successfully",- });- }- };-useEffect(() => {console.log("document visibility state:", document.visibilityState);@@ -249,6 +213,33 @@ export function AccountSection() {updateSettings({ user: updatedUser });}, []);+ const updateProfile = async (updates: Partial<typeof settings.user>) => {+ if (!settings.user?.token) return;++ try {+ const response = await fetch(+ "https://screenpi.pe/api/plugins/dev-profile",+ {+ method: "PUT",+ headers: {+ "Content-Type": "application/json",+ Authorization: `Bearer ${settings.user.api_key}`,+ },+ body: JSON.stringify(updates),+ }+ );++ if (!response.ok) throw new Error("failed to update profile");+ } catch (error) {+ console.error("failed to update profile:", error);+ toast({+ title: "update failed",+ description: "couldn't save your profile changes",+ variant: "destructive",+ });+ }+ };+return (<div className="w-full space-y-6 py-4"><div className="flex items-center justify-between">@@ -277,98 +268,11 @@ export function AccountSection() {<div className="space-y-8"><div className="space-y-6">- <div className="flex items-center justify-between">- <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>- <Button- variant="ghost"- size="icon"- onClick={handleRefreshCredits}- disabled={isRefreshing}- className="h-8 w-8"- >- <RefreshCw- className={cn("w-4 h-4", { "animate-spin": isRefreshing })}- />- </Button>- </div>-- <div className="space-y-3">- <div className="flex items-center gap-2">- <Label className="text-sm font-medium text-muted-foreground">- screenpipe api key- </Label>- <TooltipProvider>- <Tooltip>- <TooltipTrigger asChild>- <HelpCircle className="h-3.5 w-3.5 cursor-help text-muted-foreground/50" />- </TooltipTrigger>- <TooltipContent side="right" className="max-w-[280px]">- <p className="text-xs leading-relaxed">- (dev preview) you can use your key to use screenpipe cloud- with code.{" "}- <span className="text-destructive font-medium">- keep it private.- </span>- </p>- </TooltipContent>- </Tooltip>- </TooltipProvider>- </div>-- <div className="space-y-2">- <div className="flex gap-2">- <div className="relative flex-1">- <Input- value={settings.user?.token || ""}- type={showApiKey ? "text" : "password"}- onChange={(e) => {- updateSettings({- user: { token: e.target.value },- });- loadUser(e.target.value);- }}- placeholder="enter your api key"- className="font-mono text-sm bg-secondary/30 pr-20"- />- <div className="absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1">- <Button- variant="ghost"- size="icon"- className="h-7 w-7"- onClick={() => setShowApiKey(!showApiKey)}- >- {showApiKey ? (- <EyeOffIcon className="h-4 w-4" />- ) : (- <EyeIcon className="h-4 w-4" />- )}- </Button>- <Button- variant="ghost"- size="icon"- className="h-7 w-7"- onClick={handleCopyApiKey}- disabled={!settings.user?.token}- >- <CopyIcon className="h-4 w-4" />- </Button>- </div>- </div>- </div>- </div>- </div>-- <Separator className="my-6" />-<div className="grid gap-4"><div className="space-y-6">- <h4 className="text-lg font-medium">active plan</h4>+ <h4 className="text-lg font-medium">plans</h4>++ <PricingToggle isAnnual={isAnnual} onToggle={setIsAnnual} /><div className="flex flex-col gap-4">{plans.map((plan) => (@@ -377,23 +281,20 @@ export function AccountSection() {title={plan.title}price={plan.price}features={plan.features}- isSelected={selectedPlan === plan.title}- onSelect={() => setSelectedPlan(plan.title)}+ onSelect={async () => {+ if (!settings.user?.id) {+ toast({+ title: "not logged in",+ description: "please login first to subscribe",+ variant: "destructive",+ });+ return;+ }+ openUrl(plan.url);+ }}/>))}</div>-- {selectedPlan && (- <Button- className="w-full text-white"- onClick={() => {- const plan = plans.find((p) => p.title === selectedPlan);- if (plan) openUrl(plan.url);- }}- >- Checkout- </Button>- )}</div></div></div>@@ -441,22 +342,46 @@ export function AccountSection() {</p></div></div>- {settings.user?.stripe_connected ? (- <Button- variant="secondary"- size="sm"- className="h-9"- onClick={() => openUrl("https://dashboard.stripe.com/")}- >- manage- </Button>+ {settings.user?.api_key ? (+ <div className="flex gap-2">+ <Button+ variant="secondary"+ size="sm"+ className="h-9"+ onClick={() => openUrl("https://dashboard.stripe.com/")}+ >+ manage+ </Button>+ <Button+ variant="ghost"+ size="icon"+ className="h-9 w-9"+ onClick={() => {+ if (settings.user) {+ const updatedUser = {+ ...settings.user,+ api_key: undefined,+ stripe_connected: false,+ };+ updateSettings({ user: updatedUser });+ toast({+ title: "stripe disconnected",+ description:+ "your stripe account has been disconnected",+ });+ }+ }}+ >+ <X className="h-4 w-4" />+ </Button>+ </div>) : (<Buttonvariant="secondary"size="sm"onClick={handleConnectStripe}className="h-9"- disabled={isConnectingStripe}+ disabled={isConnectingStripe || !settings.user?.id}>{isConnectingStripe ? (<RefreshCw className="w-4 h-4 animate-spin" />@@ -546,6 +471,106 @@ export function AccountSection() {</div></div></div>++ <Separator className="my-6" />++ <div className="flex items-center justify-between">+ <div className="space-y-1.5">+ <h4 className="text-lg font-medium">developer profile</h4>+ <p className="text-sm text-muted-foreground">+ {settings.user?.api_key+ ? "customize your public developer profile, this will help us approve your pipe faster and help you get more users"+ : "connect your stripe account first to customize your developer profile"}+ </p>+ </div>+ </div>++ <div className="space-y-6">+ <div className="grid gap-4">+ <div className="grid gap-2">+ <Label htmlFor="bio">bio</Label>+ <Textarea+ id="bio"+ placeholder="tell us about yourself..."+ className="resize-none"+ rows={3}+ value={settings.user?.bio || ""}+ disabled={!settings.user?.api_key}+ onChange={(e) => {+ if (settings.user) {+ const updatedUser = {+ ...settings.user,+ bio: e.target.value,+ };+ updateSettings({ user: updatedUser });+ updateProfile({ bio: e.target.value });+ }+ }}+ />+ </div>++ <div className="grid gap-2">+ <Label htmlFor="github">github username</Label>+ <Input+ id="github"+ placeholder="username"+ disabled={!settings.user?.api_key}+ value={settings.user?.github_username || ""}+ onChange={(e) => {+ if (settings.user) {+ const updatedUser = {+ ...settings.user,+ github_username: e.target.value,+ };+ updateSettings({ user: updatedUser });+ updateProfile({ github_username: e.target.value });+ }+ }}+ />+ </div>++ <div className="grid gap-2">+ <Label htmlFor="website">website</Label>+ <Input+ id="website"+ type="url"+ placeholder="https://..."+ value={settings.user?.website || ""}+ disabled={!settings.user?.api_key}+ onChange={(e) => {+ if (settings.user) {+ const updatedUser = {+ ...settings.user,+ website: e.target.value,+ };+ updateSettings({ user: updatedUser });+ updateProfile({ website: e.target.value });+ }+ }}+ />+ </div>++ <div className="grid gap-2">+ <Label htmlFor="contact">additional contact</Label>+ <Input+ id="contact"+ placeholder="discord, twitter, etc..."+ value={settings.user?.contact || ""}+ disabled={!settings.user?.api_key}+ onChange={(e) => {+ if (settings.user) {+ const updatedUser = {+ ...settings.user,+ contact: e.target.value,+ };+ updateSettings({ user: updatedUser });+ updateProfile({ contact: e.target.value });+ }+ }}+ />+ </div>+ </div>+ </div></div></div>);diff --git a/screenpipe-app-tauri/components/settings/ai-section.tsx b/screenpipe-app-tauri/components/settings/ai-section.tsxindex 8379e4a39..7c21813fd 100644--- a/screenpipe-app-tauri/components/settings/ai-section.tsx+++ b/screenpipe-app-tauri/components/settings/ai-section.tsx@@ -114,14 +114,6 @@ const AIProviderCard = ({const AISection = () => {const { settings, updateSettings, resetSetting } = useSettings();- const [ollamaStatus, setOllamaStatus] = useState<- "idle" | "running" | "error"- >("idle");-- const [embeddedAIStatus, setEmbeddedAIStatus] = useState<- "idle" | "running" | "error"- >("idle");-const [showApiKey, setShowApiKey] = React.useState(false);const handleApiKeyChange = (e: React.ChangeEvent<HTMLInputElement>) => {@@ -132,109 +124,6 @@ const AISection = () => {updateSettings({ aiMaxContextChars: value[0] });};- const handleEmbeddedLLMChange = (checked: boolean) => {- updateSettings({- embeddedLLM: {- ...settings.embeddedLLM,- enabled: checked,- },- });- if (!checked) {- setOllamaStatus("idle");- }- };-- const handleEmbeddedLLMModelChange = (- e: React.ChangeEvent<HTMLInputElement>- ) => {- const newModel = e.target.value;- updateSettings({- embeddedLLM: {- ...settings.embeddedLLM,- model: newModel,- },- aiModel: newModel,- });- };-- const handleEmbeddedLLMPortChange = (- e: React.ChangeEvent<HTMLInputElement>- ) => {- updateSettings({- embeddedLLM: {- ...settings.embeddedLLM,- port: parseInt(e.target.value, 10),- },- });- };-- const startOllamaSidecar = async () => {- posthog.capture("start_ollama_sidecar");- setOllamaStatus("running");- toast({- title: "starting ai",- description:- "downloading and initializing the embedded ai, may take a while (check $HOME/.ollama/models)...",- });-- try {- console.log(- "starting ollama sidecar with settings:",- settings.embeddedLLM- );- const result = await invoke<string>("start_ollama_sidecar", {- settings: {- enabled: settings.embeddedLLM.enabled,- model: settings.embeddedLLM.model,- port: settings.embeddedLLM.port,- },- });-- setOllamaStatus("running");- setEmbeddedAIStatus("running");- toast({- title: "ai ready",- description: `${settings.embeddedLLM.model} is running.`,- });-- // Show the LLM test result in a toast- toast({- title: `${settings.embeddedLLM.model} wants to tell you a joke.`,- description: result,- duration: 10000,- });- } catch (error) {- console.error("Error starting ai sidecar:", error);- setOllamaStatus("error");- setEmbeddedAIStatus("error");- toast({- title: "error starting ai",- description: "check the console for more details",- variant: "destructive",- });- }- };-- const handleStopLLM = async () => {- try {- await invoke("stop_ollama_sidecar");- setOllamaStatus("idle");- setEmbeddedAIStatus("idle");- toast({- title: "ai stopped",- description: "the embedded ai has been shut down",- });- } catch (error) {- console.error("error stopping ai:", error);- setEmbeddedAIStatus("error");- toast({- title: "error stopping ai",- description: "check the console for more details",- variant: "destructive",- });- }- };-const handleCustomPromptChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {@@ -374,17 +263,6 @@ const AISection = () => {selected={settings.aiProviderType === "custom"}onClick={() => handleAiProviderChange("custom")}/>-- {embeddedAIStatus === "running" && (- <AIProviderCard- type="embedded"- title="embedded ai"- description="use the built-in ai engine for offline processing"- imageSrc="/images/embedded.png"- selected={settings.aiProviderType === "embedded"}- onClick={() => handleAiProviderChange("embedded")}- />- )}</div></div>{settings.aiProviderType === "custom" && (@@ -568,114 +446,6 @@ const AISection = () => {</div></div></div>-- <div className="flex items-center gap-4 mb-4 w-full">- <div className="flex items-center justify-between w-full">- <div className="space-y-1">- <h4 className="font-medium">embedded ai</h4>- <p className="text-sm text-muted-foreground">- enable this to use local ai features in screenpipe.- </p>- </div>- <div className="flex items-center gap-2">- <Switch- id="embeddedLLM"- checked={settings.embeddedLLM.enabled}- onCheckedChange={handleEmbeddedLLMChange}- />- {settings.embeddedLLM.enabled && (- <>- <Button- onClick={startOllamaSidecar}- disabled={ollamaStatus === "running"}- className="ml-auto"- >- {ollamaStatus === "running" ? (- <Check className="h-4 w-4 mr-2" />- ) : ollamaStatus === "error" ? (- <X className="h-4 w-4 mr-2" />- ) : ollamaStatus === "idle" ? (- <Play className="h-4 w-4 mr-2" />- ) : (- <Loader2 className="h-4 w-4 mr-2 animate-spin" />- )}- {ollamaStatus === "running"- ? "running"- : ollamaStatus === "error"- ? "error"- : "start ai"}- </Button>- <Button- variant="outline"- onClick={handleStopLLM}- className="ml-auto"- >- <X className="h-4 w-4 mr-2" />- stop ai- </Button>- <LogFileButton isAppLog={true} />- <Badge>{embeddedAIStatus}</Badge>- </>- )}- </div>- </div>- </div>-- {settings.embeddedLLM.enabled && (- <>- <div className="w-full">- <div className="flex items-center gap-4 mb-4">- <Label- htmlFor="embeddedLLMModel"- className="min-w-[80px] text-right"- >- llm model- </Label>- <div className="flex-grow flex items-center">- <Input- id="embeddedLLMModel"- value={settings.embeddedLLM.model}- onChange={handleEmbeddedLLMModelChange}- className="flex-grow"- placeholder="enter embedded llm model"- />- <TooltipProvider>- <Tooltip>- <TooltipTrigger asChild>- <HelpCircle className="ml-2 h-4 w-4 cursor-help" />- </TooltipTrigger>- <TooltipContent side="right" className="max-w-[300px]">- <p>- supported models are the same as ollama. check the- ollama documentation for a list of available models.- </p>- </TooltipContent>- </Tooltip>- </TooltipProvider>- </div>- </div>- </div>-- <div className="w-full">- <div className="flex items-center gap-4 mb-4">- <Label- htmlFor="embeddedLLMPort"- className="min-w-[80px] text-right"- >- llm port- </Label>- <Input- id="embeddedLLMPort"- type="number"- value={settings.embeddedLLM.port}- onChange={handleEmbeddedLLMPortChange}- className="flex-grow"- placeholder="enter embedded llm port"- />- </div>- </div>- </>- )}</div>);};diff --git a/screenpipe-app-tauri/components/settings/pricing-toggle.tsx b/screenpipe-app-tauri/components/settings/pricing-toggle.tsxnew file mode 100644index 000000000..4d1597dba--- /dev/null+++ b/screenpipe-app-tauri/components/settings/pricing-toggle.tsx@@ -0,0 +1,25 @@+import { Label } from "@/components/ui/label";+import { Switch } from "@/components/ui/switch";++interface PricingToggleProps {+ isAnnual: boolean;+ onToggle: (value: boolean) => void;+}++export function PricingToggle({ isAnnual, onToggle }: PricingToggleProps) {+ return (+ <div className="flex items-center gap-4 mb-4">+ <Label htmlFor="billing-toggle" className="text-sm">+ monthly+ </Label>+ <Switch+ id="billing-toggle"+ checked={isAnnual}+ onCheckedChange={onToggle}+ />+ <Label htmlFor="billing-toggle" className="text-sm">+ annual (save 17%)+ </Label>+ </div>+ );+}diff --git a/screenpipe-app-tauri/lib/api/store/index.ts b/screenpipe-app-tauri/lib/api/store/index.tsindex 47ad9ead0..d896f37a2 100644--- a/screenpipe-app-tauri/lib/api/store/index.ts+++ b/screenpipe-app-tauri/lib/api/store/index.ts@@ -51,6 +51,8 @@ interface Developer_accounts {interface PurchaseUrlResponse {data: {checkout_url: string;+ // when user had credits from previous app purchase+ used_credits?: boolean;};}diff --git a/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/screenpipe-app-tauri/lib/hooks/use-settings.tsxindex 7fb7547de..72fa8764e 100644--- a/screenpipe-app-tauri/lib/hooks/use-settings.tsx+++ b/screenpipe-app-tauri/lib/hooks/use-settings.tsx@@ -47,6 +47,10 @@ export type User = {amount: number;};stripe_connected?: boolean;+ github_username?: string;+ bio?: string;+ website?: string;+ contact?: string;};export type Settings = {@@ -345,9 +349,11 @@ export function useSettings() {const loadUser = async (token: string) => {try {- const BASE_URL = await invoke("get_env", { name: "BASE_URL_PRIVATE" }) ?? "https://screenpi.pe";+ const BASE_URL =+ (await invoke("get_env", { name: "BASE_URL_PRIVATE" })) ??+ "https://screenpi.pe";- const response = await fetch(`${BASE_URL}/api/tauri`, {+ const response = await fetch(`https://screenpi.pe/api/tauri`, {method: "POST",headers: {"Content-Type": "application/json",@@ -361,14 +367,14 @@ export function useSettings() {const data = await response.json();const userData = {+ api_key: settings.user.api_key,...data.user,stripe_connected: data.user.stripe_connected ?? false,} as User;- setSettings({- user: userData+ setSettings({+ user: userData,});-} catch (err) {console.error("failed to load user:", err);}diff --git a/screenpipe-app-tauri/scripts/pre_build.js b/screenpipe-app-tauri/scripts/pre_build.jsindex 9ca61b8d7..4d7f67f1f 100644--- a/screenpipe-app-tauri/scripts/pre_build.js+++ b/screenpipe-app-tauri/scripts/pre_build.js@@ -558,7 +558,7 @@ async function installOllamaSidecar() {// Near the end of the script, call these functionsawait copyBunBinary();-await installOllamaSidecar().catch(console.error);+// await installOllamaSidecar().catch(console.error);// --dev or --buildconst action = process.argv?.[2]diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lockindex 4615370fd..25e31df6f 100755--- a/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -5273,7 +5273,7 @@ dependencies = [[[package]]name = "screenpipe-app"-version = "0.26.9"+version = "0.27.0"dependencies = ["anyhow","async-stream",diff --git a/screenpipe-app-tauri/src-tauri/capabilities/main.json b/screenpipe-app-tauri/src-tauri/capabilities/main.jsonindex 677855113..5586065b4 100644--- a/screenpipe-app-tauri/src-tauri/capabilities/main.json+++ b/screenpipe-app-tauri/src-tauri/capabilities/main.json@@ -140,35 +140,6 @@}]},- {- "identifier": "shell:allow-spawn",- "allow": [- {- "name": "ollama",- "cmd": "ollama",- "args": [- "serve"- ],- "sidecar": true- }- ]- },- {- "identifier": "shell:allow-spawn",- "allow": [- {- "name": "ollama-run",- "cmd": "ollama",- "args": [- "run",- {- "validator": "\\S*"- }- ],- "sidecar": true- }- ]- },"cli:default","shell:default","shell:allow-spawn",diff --git a/screenpipe-app-tauri/src-tauri/gen/schemas/capabilities.json b/screenpipe-app-tauri/src-tauri/gen/schemas/capabilities.jsonindex e65218e77..e3ab467ed 100644--- a/screenpipe-app-tauri/src-tauri/gen/schemas/capabilities.json+++ b/screenpipe-app-tauri/src-tauri/gen/schemas/capabilities.json@@ -1 +1 @@-{"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","remote":{"urls":["http://localhost:*"]},"local":true,"windows":["*"],"permissions":["core:event:allow-listen","core:event:default","core:app:allow-version","process:allow-restart","process:allow-exit","notification:default","core:resources:default","core:menu:default","core:tray:default","shell:default","shell:allow-open","store:default","shell:allow-open","fs:allow-watch","fs:allow-open","fs:default","fs:allow-read-file","fs:allow-read-dir","fs:allow-read","fs:allow-write-file","fs:read-dirs","fs:allow-copy-file","fs:allow-exists","fs:allow-read-text-file","fs:allow-create","fs:allow-mkdir","fs:allow-remove","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-unregister","global-shortcut:allow-unregister-all","global-shortcut:default","sentry:default",{"identifier":"fs:scope","allow":[{"path":"$XDG_DATA_HOME","requireLiteralLeadingDot":false},{"path":"$XDG_DATA_HOME/**","requireLiteralLeadingDot":false},{"path":"$LOCALAPPDATA/*","requireLiteralLeadingDot":false},{"path":"$LOCALAPPDATA/**","requireLiteralLeadingDot":false},{"path":"$APPLOCALDATA/*","requireLiteralLeadingDot":false},{"path":"$APPLOCALDATA/**","requireLiteralLeadingDot":false},{"path":"$APPDATA/*","requireLiteralLeadingDot":false},{"path":"$APPDATA/**","requireLiteralLeadingDot":false},{"path":"$APPCONFIG/*","requireLiteralLeadingDot":false},{"path":"$RESOURCE/*","requireLiteralLeadingDot":false},{"path":"$RESOURCE/.screenpipe/*","requireLiteralLeadingDot":false},{"path":"$HOME/*","requireLiteralLeadingDot":false},{"path":"$HOME/.screenpipe/*","requireLiteralLeadingDot":false},{"path":"$APP/*","requireLiteralLeadingDot":false},{"path":"$HOME/.screenpipe/data/**","requireLiteralLeadingDot":false},{"path":"$HOME/.screenpipe/pipes/**","requireLiteralLeadingDot":false}]},{"identifier":"shell:allow-execute","allow":[{"args":["-c",{"validator":"\\S+"}],"cmd":"sh","name":"exec-sh","sidecar":false}]},{"identifier":"shell:allow-execute","allow":[{"args":true,"cmd":"screenpipe","name":"screenpipe","sidecar":true}]},{"identifier":"shell:allow-spawn","allow":[{"args":["serve"],"cmd":"ollama","name":"ollama","sidecar":true}]},{"identifier":"shell:allow-spawn","allow":[{"args":["run",{"validator":"\\S*"}],"cmd":"ollama","name":"ollama-run","sidecar":true}]},"cli:default","shell:default","shell:allow-spawn","dialog:default","updater:default","os:default","os:allow-arch","os:allow-hostname","os:allow-os-type","core:path:default","process:default","core:webview:allow-internal-toggle-devtools",{"identifier":"shell:allow-execute","allow":[{"args":["pipe","list","--output","json"],"cmd":"screenpipe","name":"screenpipe-pipe-list","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","download",{"validator":"\\S+"},"--output","json"],"cmd":"screenpipe","name":"screenpipe-pipe-download","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","enable",{"validator":"\\S+"}],"cmd":"screenpipe","name":"screenpipe-pipe-enable","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","disable",{"validator":"\\S+"}],"cmd":"screenpipe","name":"screenpipe-pipe-disable","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","update",{"validator":"\\S+"},{"validator":"\\{.*\\}"}],"cmd":"screenpipe","name":"screenpipe-pipe-update","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","delete",{"validator":"\\S+"},"--yes"],"cmd":"screenpipe","name":"screenpipe-pipe-delete","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","info",{"validator":"\\S+"},"--output","json"],"cmd":"screenpipe","name":"screenpipe-pipe-info","sidecar":true}]},{"identifier":"http:default","allow":[{"methods":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"],"url":"http://**/*"},{"methods":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"],"url":"https://**/*"}]},"deep-link:default","fs:allow-write-text-file",{"identifier":"fs:scope","allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"}]}]}}\ No newline at end of file+{"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","remote":{"urls":["http://localhost:*"]},"local":true,"windows":["*"],"permissions":["core:event:allow-listen","core:event:default","core:app:allow-version","process:allow-restart","process:allow-exit","notification:default","core:resources:default","core:menu:default","core:tray:default","shell:default","shell:allow-open","store:default","shell:allow-open","fs:allow-watch","fs:allow-open","fs:default","fs:allow-read-file","fs:allow-read-dir","fs:allow-read","fs:allow-write-file","fs:read-dirs","fs:allow-copy-file","fs:allow-exists","fs:allow-read-text-file","fs:allow-create","fs:allow-mkdir","fs:allow-remove","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-unregister","global-shortcut:allow-unregister-all","global-shortcut:default","sentry:default",{"identifier":"fs:scope","allow":[{"path":"$XDG_DATA_HOME","requireLiteralLeadingDot":false},{"path":"$XDG_DATA_HOME/**","requireLiteralLeadingDot":false},{"path":"$LOCALAPPDATA/*","requireLiteralLeadingDot":false},{"path":"$LOCALAPPDATA/**","requireLiteralLeadingDot":false},{"path":"$APPLOCALDATA/*","requireLiteralLeadingDot":false},{"path":"$APPLOCALDATA/**","requireLiteralLeadingDot":false},{"path":"$APPDATA/*","requireLiteralLeadingDot":false},{"path":"$APPDATA/**","requireLiteralLeadingDot":false},{"path":"$APPCONFIG/*","requireLiteralLeadingDot":false},{"path":"$RESOURCE/*","requireLiteralLeadingDot":false},{"path":"$RESOURCE/.screenpipe/*","requireLiteralLeadingDot":false},{"path":"$HOME/*","requireLiteralLeadingDot":false},{"path":"$HOME/.screenpipe/*","requireLiteralLeadingDot":false},{"path":"$APP/*","requireLiteralLeadingDot":false},{"path":"$HOME/.screenpipe/data/**","requireLiteralLeadingDot":false},{"path":"$HOME/.screenpipe/pipes/**","requireLiteralLeadingDot":false}]},{"identifier":"shell:allow-execute","allow":[{"args":["-c",{"validator":"\\S+"}],"cmd":"sh","name":"exec-sh","sidecar":false}]},{"identifier":"shell:allow-execute","allow":[{"args":true,"cmd":"screenpipe","name":"screenpipe","sidecar":true}]},"cli:default","shell:default","shell:allow-spawn","dialog:default","updater:default","os:default","os:allow-arch","os:allow-hostname","os:allow-os-type","core:path:default","process:default","core:webview:allow-internal-toggle-devtools",{"identifier":"shell:allow-execute","allow":[{"args":["pipe","list","--output","json"],"cmd":"screenpipe","name":"screenpipe-pipe-list","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","download",{"validator":"\\S+"},"--output","json"],"cmd":"screenpipe","name":"screenpipe-pipe-download","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","enable",{"validator":"\\S+"}],"cmd":"screenpipe","name":"screenpipe-pipe-enable","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","disable",{"validator":"\\S+"}],"cmd":"screenpipe","name":"screenpipe-pipe-disable","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","update",{"validator":"\\S+"},{"validator":"\\{.*\\}"}],"cmd":"screenpipe","name":"screenpipe-pipe-update","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","delete",{"validator":"\\S+"},"--yes"],"cmd":"screenpipe","name":"screenpipe-pipe-delete","sidecar":true}]},{"identifier":"shell:allow-execute","allow":[{"args":["pipe","info",{"validator":"\\S+"},"--output","json"],"cmd":"screenpipe","name":"screenpipe-pipe-info","sidecar":true}]},{"identifier":"http:default","allow":[{"methods":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"],"url":"http://**/*"},{"methods":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"],"url":"https://**/*"}]},"deep-link:default","fs:allow-write-text-file",{"identifier":"fs:scope","allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"}]}]}}\ No newline at end of filediff --git a/screenpipe-app-tauri/src-tauri/src/main.rs b/screenpipe-app-tauri/src-tauri/src/main.rsindex 977f3bc15..031445849 100755--- a/screenpipe-app-tauri/src-tauri/src/main.rs+++ b/screenpipe-app-tauri/src-tauri/src/main.rs@@ -4,7 +4,6 @@use commands::load_pipe_config;use commands::save_pipe_config;use commands::show_main_window;-use llm_sidecar::EmbeddedLLMSettings;use serde_json::Value;use sidecar::SidecarManager;use std::env;@@ -38,7 +37,6 @@ use uuid::Uuid;mod analytics;mod icons;use crate::analytics::start_analytics;-use crate::llm_sidecar::LLMSidecar;mod commands;mod llm_sidecar;@@ -1045,28 +1043,28 @@ async fn main() {app.set_activation_policy(tauri::ActivationPolicy::Regular);// LLM Sidecar setup- let embedded_llm: EmbeddedLLMSettings = store- .get("embeddedLLM")- .and_then(|v| serde_json::from_value(v.clone()).ok())- .unwrap_or_else(|| EmbeddedLLMSettings {- enabled: false,- model: "llama3.2:3b-instruct-q4_K_M".to_string(),- port: 11438,- });-- if embedded_llm.enabled {- let app_handle = app.handle().clone();- tauri::async_runtime::spawn(async move {- match LLMSidecar::new(embedded_llm).start(app_handle).await {- Ok(result) => {- info!("LLM Sidecar started successfully: {}", result);- }- Err(e) => {- error!("Failed to start LLM Sidecar: {}", e);- }- }- });- }+ // let embedded_llm: EmbeddedLLMSettings = store+ // .get("embeddedLLM")+ // .and_then(|v| serde_json::from_value(v.clone()).ok())+ // .unwrap_or_else(|| EmbeddedLLMSettings {+ // enabled: false,+ // model: "llama3.2:3b-instruct-q4_K_M".to_string(),+ // port: 11438,+ // });++ // if embedded_llm.enabled {+ // let app_handle = app.handle().clone();+ // tauri::async_runtime::spawn(async move {+ // match LLMSidecar::new(embedded_llm).start(app_handle).await {+ // Ok(result) => {+ // info!("LLM Sidecar started successfully: {}", result);+ // }+ // Err(e) => {+ // error!("Failed to start LLM Sidecar: {}", e);+ // }+ // }+ // });+ // }// Initialize global shortcutslet app_handle = app.handle().clone();tauri::async_runtime::spawn(async move {diff --git a/screenpipe-app-tauri/src-tauri/tauri.linux.conf.json b/screenpipe-app-tauri/src-tauri/tauri.linux.conf.jsonindex f27755a28..99fa8af26 100644--- a/screenpipe-app-tauri/src-tauri/tauri.linux.conf.json+++ b/screenpipe-app-tauri/src-tauri/tauri.linux.conf.json@@ -2,11 +2,7 @@"bundle": {"externalBin": ["screenpipe",- "bun",- "ollama"- ],- "resources": [- "lib/ollama/*"+ "bun"],"linux": {"deb": {diff --git a/screenpipe-app-tauri/src-tauri/tauri.macos.conf.json b/screenpipe-app-tauri/src-tauri/tauri.macos.conf.jsonindex bcaceee36..2b05090a0 100644--- a/screenpipe-app-tauri/src-tauri/tauri.macos.conf.json+++ b/screenpipe-app-tauri/src-tauri/tauri.macos.conf.json@@ -12,7 +12,6 @@"externalBin": ["screenpipe","bun",- "ollama","ui_monitor"]}diff --git a/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json b/screenpipe-app-tauri/src-tauri/tauri.windows.conf.jsonindex 63b9e56d8..3ad747b92 100644--- a/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json+++ b/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json@@ -2,8 +2,7 @@"bundle": {"externalBin": ["screenpipe",- "bun",- "ollama"+ "bun"],"targets": ["nsis"@@ -16,7 +15,6 @@"onnxruntime*\\lib\\onnxruntime.dll": "./","onnxruntime*\\lib\\onnxruntime_providers_cuda.dll": "./","onnxruntime*\\lib\\onnxruntime_providers_shared.dll": "./",- "lib\\ollama\\*": "./","mkl\\*.dll": "./"}}diff --git a/screenpipe-app-tauri/src-tauri/ui_monitor-aarch64-apple-darwin b/screenpipe-app-tauri/src-tauri/ui_monitor-aarch64-apple-darwinindex 509c1cea2..9aba920f6 100755Binary files a/screenpipe-app-tauri/src-tauri/ui_monitor-aarch64-apple-darwin and b/screenpipe-app-tauri/src-tauri/ui_monitor-aarch64-apple-darwin differdiff --git a/screenpipe-app-tauri/src-tauri/ui_monitor-x86_64-apple-darwin b/screenpipe-app-tauri/src-tauri/ui_monitor-x86_64-apple-darwinindex f5a5acf0d..4cab4bf60 100755Binary files a/screenpipe-app-tauri/src-tauri/ui_monitor-x86_64-apple-darwin and b/screenpipe-app-tauri/src-tauri/ui_monitor-x86_64-apple-darwin differdiff --git a/screenpipe-server/src/server.rs b/screenpipe-server/src/server.rsindex 3908dd74e..0bd9e521f 100644--- a/screenpipe-server/src/server.rs+++ b/screenpipe-server/src/server.rs@@ -5,7 +5,6 @@ use axum::{routing::{get, post},serve, Router,};-use axum_macros::debug_handler;use futures::{future::{try_join, try_join_all},Stream,