Skip to content

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

fix ton of stuff

Louis Beaumontf915056a400c
diff --git a/pipes/data-table/README.md b/pipes/data-table/README.md
index b35fb012c..3ff81cc45 100644
--- a/pipes/data-table/README.md
+++ b/pipes/data-table/README.md
@@ -1,3 +1,5 @@
visualize your data in a table
+.
+
<img width="1494" alt="Screenshot 2024-12-16 at 2 16 28 PM" src="https://github.com/user-attachments/assets/91ed54a4-e45f-4f1d-92e4-f2c919e94df6" />
diff --git a/pipes/data-table/package.json b/pipes/data-table/package.json
index b40d14412..6dbca48f3 100644
--- a/pipes/data-table/package.json
+++ b/pipes/data-table/package.json
@@ -1,6 +1,6 @@
{
"name": "data-table",
- "version": "0.1.0",
+ "version": "0.1.1",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
diff --git a/pipes/reddit-auto-posts/README.md b/pipes/reddit-auto-posts/README.md
index 5938fa2d0..a928a3832 100644
--- a/pipes/reddit-auto-posts/README.md
+++ b/pipes/reddit-auto-posts/README.md
@@ -1,11 +1,10 @@
-### pipe-post-questions-on-reddit
-
-<img width="1312" alt="Screenshot 2024-10-12 at 14 09 01" src="https://github.com/user-attachments/assets/3e5abd07-0a3c-4c3b-8351-5107beb4fb10">
+Easily grow your followers, market your product, or be useful.
GPT-4o (or local model) looks at your screen 24/7 and sends you emails with questions to post on Reddit based on your activity.
-Easily grow your followers, market your product, or be useful.
+<img width="1312" alt="Screenshot 2024-10-12 at 14 09 01" src="https://github.com/user-attachments/assets/3e5abd07-0a3c-4c3b-8351-5107beb4fb10">
+
https://github.com/user-attachments/assets/289d1809-6855-4336-807f-dd9ee7181324
diff --git a/pipes/reddit-auto-posts/package.json b/pipes/reddit-auto-posts/package.json
index 0d3c366ac..244c1c6cd 100644
--- a/pipes/reddit-auto-posts/package.json
+++ b/pipes/reddit-auto-posts/package.json
@@ -1,6 +1,6 @@
{
"name": "reddit-auto-posts",
- "version": "0.1.0",
+ "version": "0.1.1",
"private": true,
"scripts": {
"dev": "next dev",
diff --git a/screenpipe-app-tauri/components/pipe-config-form.tsx b/screenpipe-app-tauri/components/pipe-config-form.tsx
index d4a9522c5..d3870e6cc 100644
--- a/screenpipe-app-tauri/components/pipe-config-form.tsx
+++ b/screenpipe-app-tauri/components/pipe-config-form.tsx
@@ -356,95 +356,103 @@ export const PipeConfigForm: React.FC<PipeConfigFormProps> = ({
return (
<div className="space-y-6">
<h3 className="text-lg font-semibold">pipe configuration</h3>
-
- {config?.is_nextjs && (
- <div className="space-y-2">
- <Label htmlFor="port" className="font-medium">
- port (number)
- </Label>
- <div className="flex items-center space-x-2">
- <Input
- id="port"
- type="number"
- value={config.port ?? ''}
- onChange={(e) => setConfig(prev => prev ? {
- ...prev,
- port: parseInt(e.target.value) || 3000
- } : prev)}
- onWheel={(e) => e.preventDefault()}
- step="1"
- min="1"
- max="65535"
- autoCorrect="off"
- spellCheck="false"
- />
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- size="icon"
- variant="ghost"
- onClick={() => setConfig(prev => prev ? {...prev, port: 3000} : prev)}
- className="h-8 w-8"
- >
- <RefreshCw className="h-4 w-4" />
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- <p>Reset to default (3000)</p>
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- </div>
- <MemoizedReactMarkdown
- className="prose prose-sm break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 w-full"
- remarkPlugins={[remarkGfm, remarkMath]}
- components={{
- p({ children }) {
- return <p className="mb-2 last:mb-0">{children}</p>;
- },
- a({ node, href, children, ...props }) {
- return (
- <a
- href={href}
- target="_blank"
- rel="noopener noreferrer"
- {...props}
- >
- {children}
- </a>
- );
- },
- code({ node, className, children, ...props }) {
- const content = String(children).replace(/\n$/, "");
- const match = /language-(\w+)/.exec(className || "");
- if (!match) {
- return (
- <code
- className="px-1 py-0.5 rounded-sm font-mono text-sm"
- {...props}
- >
- {content}
- </code>
- );
- }
+ <div className="space-y-2">
+ <Label htmlFor="port" className="font-medium">
+ port (number)
+ </Label>
+ <div className="flex items-center space-x-2">
+ <Input
+ id="port"
+ type="number"
+ value={config?.port ?? ""}
+ onChange={(e) =>
+ setConfig((prev) =>
+ prev
+ ? {
+ ...prev,
+ port: parseInt(e.target.value) || 3000,
+ }
+ : prev
+ )
+ }
+ onWheel={(e) => e.preventDefault()}
+ step="1"
+ min="1"
+ max="65535"
+ autoCorrect="off"
+ spellCheck="false"
+ />
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ size="icon"
+ variant="ghost"
+ onClick={() =>
+ setConfig((prev) => (prev ? { ...prev, port: 3000 } : prev))
+ }
+ className="h-8 w-8"
+ >
+ <RefreshCw className="h-4 w-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>Reset to default (3000)</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+ <MemoizedReactMarkdown
+ className="prose prose-sm break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 w-full"
+ remarkPlugins={[remarkGfm, remarkMath]}
+ components={{
+ p({ children }) {
+ return <p className="mb-2 last:mb-0">{children}</p>;
+ },
+ a({ node, href, children, ...props }) {
+ return (
+ <a
+ href={href}
+ target="_blank"
+ rel="noopener noreferrer"
+ {...props}
+ >
+ {children}
+ </a>
+ );
+ },
+ code({ node, className, children, ...props }) {
+ const content = String(children).replace(/\n$/, "");
+ const match = /language-(\w+)/.exec(className || "");
+ if (!match) {
return (
- <CodeBlock
- key={Math.random()}
- language={(match && match[1]) || ""}
- value={content}
+ <code
+ className="px-1 py-0.5 rounded-sm font-mono text-sm"
{...props}
- />
+ >
+ {content}
+ </code>
);
- },
- }}
- >
- Port number for this pipe. If the selected port is already in use when starting the pipe, a random available port will be automatically assigned.
- </MemoizedReactMarkdown>
- </div>
- )}
+ }
+
+ return (
+ <CodeBlock
+ key={Math.random()}
+ language={(match && match[1]) || ""}
+ value={content}
+ {...props}
+ />
+ );
+ },
+ }}
+ >
+ Port number for this pipe. If the selected port is already in use when
+ starting the pipe, a random available port will be automatically
+ assigned.
+ </MemoizedReactMarkdown>
+ </div>
{config?.fields?.map((field: FieldConfig) => (
<div key={field.name} className="space-y-2">
@@ -501,9 +509,9 @@ export const PipeConfigForm: React.FC<PipeConfigFormProps> = ({
</MemoizedReactMarkdown>
</div>
))}
- <Button type="submit" onClick={() => onConfigSave(config || {})}>
- save configuration
- </Button>
+ <Button type="submit" onClick={() => onConfigSave(config || {})}>
+ save configuration
+ </Button>
</div>
);
};
diff --git a/screenpipe-app-tauri/components/pipe-store-markdown.tsx b/screenpipe-app-tauri/components/pipe-store-markdown.tsx
index 2b04fa396..ef10a77ed 100644
--- a/screenpipe-app-tauri/components/pipe-store-markdown.tsx
+++ b/screenpipe-app-tauri/components/pipe-store-markdown.tsx
@@ -101,10 +101,10 @@ export function PipeStoreMarkdown({
},
img({ node, ...props }) {
return (
- <img
- {...props}
+ <img
+ {...props}
className="max-w-full h-auto rounded-lg"
- style={{ maxHeight: '600px' }}
+ style={{ maxHeight: "600px" }}
/>
);
},
diff --git a/screenpipe-app-tauri/components/pipe-store.tsx b/screenpipe-app-tauri/components/pipe-store.tsx
index b14bda9fc..ff23f8618 100644
--- a/screenpipe-app-tauri/components/pipe-store.tsx
+++ b/screenpipe-app-tauri/components/pipe-store.tsx
@@ -25,18 +25,8 @@ import { onOpenUrl } from "@tauri-apps/plugin-deep-link";
import { useStatusDialog } from "@/lib/hooks/use-status-dialog";
const corePipes: string[] = [
- "auto-pay",
- "linkedin-ai-assistant",
- "memories",
- "data-table",
+ // "data-table",
"search",
- "timeline",
- "identify-speakers",
- "obsidian",
- "meeting",
- "pipe-for-loom",
- "pipe-simple-nextjs",
- "reddit-auto-posts",
];
export const PipeStore: React.FC = () => {
@@ -52,19 +42,25 @@ export const PipeStore: React.FC = () => {
);
const { showLoginDialog, setShowLoginDialog, checkLogin } = useLoginCheck();
const { open: openStatusDialog } = useStatusDialog();
+ const [loadingPurchases, setLoadingPurchases] = useState<Set<string>>(
+ new Set()
+ );
+ const [loadingInstalls, setLoadingInstalls] = useState<Set<string>>(
+ new Set()
+ );
const filteredPipes = pipes
.filter(
(pipe) =>
pipe.id.toLowerCase().includes(searchQuery.toLowerCase()) &&
- (!showInstalledOnly || pipe.is_installed)
+ (!showInstalledOnly || pipe.is_installed) &&
+ !pipe.is_installing
)
.sort((a, b) => Number(b.is_paid) - Number(a.is_paid));
const fetchStorePlugins = async () => {
try {
const pipeApi = await PipeApi.create(settings.user?.token!);
- console.log("fetching store plugins", settings.user?.token);
const plugins = await pipeApi.listStorePlugins();
// Create PipeWithStatus objects for store plugins
@@ -120,16 +116,7 @@ export const PipeStore: React.FC = () => {
setPurchaseHistory(purchaseHistory);
};
- // TODO: replace with actual IDs once published on the new store
- const installDefaultPipes = async () => {
- const DEFAULT_PIPES = [
- "memories",
- "data-table",
- "search",
- "timeline",
- "identify-speakers",
- ];
- };
+
const handlePurchasePipe = async (
pipe: PipeWithStatus,
@@ -138,18 +125,24 @@ export const PipeStore: React.FC = () => {
try {
if (!checkLogin(settings.user)) return;
+ setLoadingPurchases((prev) => new Set(prev).add(pipe.id));
+
const pipeApi = await PipeApi.create(settings.user!.token!);
const response = await pipeApi.purchasePipe(pipe.id);
- // user had credits left
+
if (response.data.used_credits) {
+ await handleInstallPipe(pipe);
+ toast({
+ title: "purchase & install successful",
+ description: "your pipe has been purchased and installed",
+ });
} else if (response.data.checkout_url) {
- // user had no credits left
openUrl(response.data.checkout_url);
+ toast({
+ title: "redirecting to checkout",
+ description: "you'll be able to install the pipe after purchase",
+ });
}
- toast({
- title: "purchase successful",
- description: "your purchase has been successful",
- });
onComplete?.();
} catch (error) {
console.error("error purchasing pipe:", error);
@@ -158,6 +151,12 @@ export const PipeStore: React.FC = () => {
description: "please try again or check the logs",
variant: "destructive",
});
+ } finally {
+ setLoadingPurchases((prev) => {
+ const next = new Set(prev);
+ next.delete(pipe.id);
+ return next;
+ });
}
};
@@ -240,6 +239,15 @@ export const PipeStore: React.FC = () => {
try {
if (!checkLogin(settings.user)) return;
+ // Keep the pipe in its current position by updating its status
+ setPipes((prevPipes) =>
+ prevPipes.map((p) =>
+ p.id === pipe.id ? { ...p, is_installing: true } : p
+ )
+ );
+
+ setLoadingInstalls((prev) => new Set(prev).add(pipe.id));
+
const t = toast({
title: "downloading pipe",
description: (
@@ -300,8 +308,24 @@ export const PipeStore: React.FC = () => {
duration: 2000,
});
+ // Update the pipe's status after successful installation
+ setPipes((prevPipes) =>
+ prevPipes.map((p) =>
+ p.id === pipe.id
+ ? { ...p, is_installed: true, is_installing: false }
+ : p
+ )
+ );
+
onComplete?.();
+ t.dismiss();
} catch (error) {
+ // Reset the pipe's status on error
+ setPipes((prevPipes) =>
+ prevPipes.map((p) =>
+ p.id === pipe.id ? { ...p, is_installing: false } : p
+ )
+ );
if ((error as Error).cause === PipeDownloadError.PURCHASE_REQUIRED) {
return toast({
title: "paid pipe",
@@ -315,6 +339,12 @@ export const PipeStore: React.FC = () => {
description: (error as Error).message,
variant: "destructive",
});
+ } finally {
+ setLoadingInstalls((prev) => {
+ const next = new Set(prev);
+ next.delete(pipe.id);
+ return next;
+ });
}
};
@@ -392,19 +422,26 @@ export const PipeStore: React.FC = () => {
});
const data = await response.json();
-
if (!data.success) {
throw new Error(data.error);
}
+ console.log("data", data);
toast({
title: `pipe ${endpoint}d`,
});
+ const installedPipes = await fetchInstalledPipes();
+ console.log("installedPipes", installedPipes);
+
+ const pp = installedPipes?.find((p) => p.config.id === pipe.id);
+ const port = pp?.config.port;
+
setSelectedPipe((prev) => {
if (!prev) return prev;
return {
...prev,
installed_config: {
+ port,
...prev.installed_config!,
enabled: !pipe.installed_config?.enabled,
},
@@ -676,11 +713,54 @@ export const PipeStore: React.FC = () => {
console.log("received deep link urls:", urls);
for (const url of urls) {
if (url.includes("purchase-successful")) {
- fetchPurchaseHistory();
+ const urlObj = new URL(url);
+ const pipeId = urlObj.searchParams.get("pipe_id");
+
+ if (!pipeId) {
+ toast({
+ title: "purchase successful",
+ description: "your purchase was successful",
+ });
+ return;
+ }
+
toast({
title: "purchase successful",
- description: "your purchase has been successful",
+ description: "installing your new pipe...",
});
+
+ // refresh store data first
+
+ const pipeApi = await PipeApi.create(settings.user?.token!);
+ const plugins = await pipeApi.listStorePlugins();
+
+ // find the pipe in the store
+ const pipe = plugins.find((p) => p.id === pipeId);
+ if (!pipe) {
+ console.error("pipe not found:", pipeId);
+ toast({
+ title: "error installing pipe",
+ description: "pipe not found in store",
+ variant: "destructive",
+ });
+ return;
+ }
+
+ // install the pipe
+ await handleInstallPipe(
+ {
+ ...pipe,
+ is_installed: false,
+ has_purchased: true,
+ is_core_pipe: false,
+ },
+ () => {
+ toast({
+ title: "installation complete",
+ description: `${pipe.name} is ready to use`,
+ });
+ }
+ );
}
}
});
@@ -775,6 +855,8 @@ export const PipeStore: React.FC = () => {
onInstall={handleInstallPipe}
onClick={setSelectedPipe}
onPurchase={handlePurchasePipe}
+ isLoadingPurchase={loadingPurchases.has(pipe.id)}
+ isLoadingInstall={loadingInstalls.has(pipe.id)}
/>
))}
</div>
diff --git a/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx b/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx
index 40f9eac29..f61e4ca7b 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 { CheckCircle, Download, Puzzle, UserIcon } from "lucide-react";
+import { CheckCircle, Download, Puzzle, UserIcon, Loader2 } from "lucide-react";
import { PipeStoreMarkdown } from "@/components/pipe-store-markdown";
import { PipeWithStatus } from "./types";
import { invoke } from "@tauri-apps/api/core";
@@ -11,53 +11,17 @@ interface PipeCardProps {
onInstall: (pipe: PipeWithStatus, onComplete: () => void) => Promise<any>;
onPurchase: (pipe: PipeWithStatus, onComplete: () => void) => Promise<any>;
onClick: (pipe: PipeWithStatus) => void;
+ isLoadingPurchase?: boolean;
+ isLoadingInstall?: boolean;
}
-const truncateDescription = (description: string, maxLines: number = 4) => {
- if (!description) return "";
- const cleaned = description.replace(/Â/g, "").trim();
-
- // Split into lines and track codeblock state
- const lines = cleaned.split(/\r?\n/);
- let inCodeBlock = false;
- let visibleLines: string[] = [];
- let lineCount = 0;
-
- for (const line of lines) {
- // Check for codeblock markers
- if (line.trim().startsWith("```")) {
- inCodeBlock = !inCodeBlock;
- visibleLines.push(line);
- continue;
- }
-
- // If we're in a codeblock, include the line
- if (inCodeBlock) {
- visibleLines.push(line);
- continue;
- }
-
- // For non-codeblock content, count lines normally
- if (lineCount < maxLines) {
- visibleLines.push(line);
- if (line.trim()) lineCount++;
- }
- }
-
- // If we ended inside a codeblock, close it
- if (inCodeBlock) {
- visibleLines.push("```");
- }
-
- const result = visibleLines.join("\n");
- return lineCount >= maxLines ? result + "..." : result;
-};
-
export const PipeCard: React.FC<PipeCardProps> = ({
pipe,
onInstall,
- onPurchase,
onClick,
+ onPurchase,
+ isLoadingPurchase,
+ isLoadingInstall,
}) => {
const [isLoading, setIsLoading] = useState(false);
const handleOpenWindow = async (e: React.MouseEvent) => {
@@ -66,7 +30,7 @@ export const PipeCard: React.FC<PipeCardProps> = ({
if (pipe.installed_config?.port) {
await invoke("open_pipe_window", {
port: pipe.installed_config.port,
- title: pipe.id,
+ title: pipe.name, // atm we don't support pipes with same name
});
}
} catch (err) {
@@ -125,8 +89,13 @@ export const PipeCard: React.FC<PipeCardProps> = ({
}
}}
className="font-medium"
+ disabled={isLoadingPurchase}
>
- {pipe.is_paid && !pipe.has_purchased ? (
+ {isLoadingPurchase ? (
+ <>
+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />
+ </>
+ ) : pipe.is_paid && !pipe.has_purchased ? (
`$${pipe.price}`
) : (
<>
diff --git a/screenpipe-app-tauri/components/pipe-store/pipe-details.tsx b/screenpipe-app-tauri/components/pipe-store/pipe-details.tsx
index 67c17a940..92a11b5f4 100644
--- a/screenpipe-app-tauri/components/pipe-store/pipe-details.tsx
+++ b/screenpipe-app-tauri/components/pipe-store/pipe-details.tsx
@@ -91,6 +91,7 @@ export const PipeDetails: React.FC<PipeDetailsProps> = ({
<TooltipTrigger asChild>
<Button
onClick={() => {
+ setIsLoading(true);
onToggle(pipe, () => setIsLoading(false));
}}
variant={
@@ -228,7 +229,7 @@ export const PipeDetails: React.FC<PipeDetailsProps> = ({
try {
await invoke("open_pipe_window", {
port: pipe.installed_config!.port,
- title: pipe.id,
+ title: pipe.name,
});
} catch (err) {
console.error("failed to open pipe window:", err);
diff --git a/screenpipe-app-tauri/components/pipe-store/types.ts b/screenpipe-app-tauri/components/pipe-store/types.ts
index 5b2326049..8d449e835 100644
--- a/screenpipe-app-tauri/components/pipe-store/types.ts
+++ b/screenpipe-app-tauri/components/pipe-store/types.ts
@@ -21,9 +21,10 @@ export interface PipeWithStatus extends PipeStorePlugin {
installed_config?: InstalledPipe['config'];
has_purchased: boolean;
is_core_pipe: boolean;
+ is_installing?: boolean;
}
export interface BrokenPipe {
id: string;
lastAttempt: number;
-}
\ No newline at end of file
+}
diff --git a/screenpipe-app-tauri/lib/api/store/index.ts b/screenpipe-app-tauri/lib/api/store/index.ts
index f33d1f5b2..7452e9702 100644
--- a/screenpipe-app-tauri/lib/api/store/index.ts
+++ b/screenpipe-app-tauri/lib/api/store/index.ts
@@ -91,13 +91,10 @@ export class PipeApi {
}
}
- async getUserPurchaseHistory(): Promise<any> {
+ async getUserPurchaseHistory(): Promise<PurchaseHistoryResponse> {
try {
- console.log("listing purchase history", this.authToken);
-
const response = await fetch(
`${this.baseUrl}/api/plugins/user-purchase-history`,
- // `http://localhost:3001/api/plugins/user-purchase-history`,
{
headers: {
Authorization: `Bearer ${this.authToken}`,
@@ -108,9 +105,9 @@ export class PipeApi {
const { error } = (await response.json()) as { error: string };
throw new Error(`failed to fetch purchase history: ${error}`);
}
- // const dataText = await response.text();
- // console.log("purchase history data", dataText);
+
const data = (await response.json()) as PurchaseHistoryResponse;
+ console.log("purchase history data", data);
return data;
} catch (error) {
console.error("error getting purchase history:", error);
@@ -120,7 +117,6 @@ export class PipeApi {
async listStorePlugins(): Promise<PipeStorePlugin[]> {
try {
- // const response = await fetch(`http://localhost:3001/api/plugins/registry`, {
const response = await fetch(`${this.baseUrl}/api/plugins/registry`, {
headers: {
Authorization: `Bearer ${this.authToken}`,
diff --git a/screenpipe-server/src/pipe_manager.rs b/screenpipe-server/src/pipe_manager.rs
index 86d12e03b..fc4a6aeac 100644
--- a/screenpipe-server/src/pipe_manager.rs
+++ b/screenpipe-server/src/pipe_manager.rs
@@ -22,6 +22,7 @@ pub struct PipeInfo {
pub config: Value,
pub source: String,
pub port: Option<u16>,
+ pub is_nextjs: bool,
}
struct PipeHandle {
@@ -164,6 +165,10 @@ impl PipeManager {
.get("port")
.and_then(Value::as_u64)
.and_then(|p| u16::try_from(p).ok()),
+ is_nextjs: config
+ .get("is_nextjs")
+ .and_then(Value::as_bool)
+ .unwrap_or(false),
}
}