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

chore: add breaking change dialog, other small fixes

Louis Beaumont3880dee269e5
diff --git a/pipes/identify-speakers/package.json b/pipes/identify-speakers/package.json
index ee0ba9c71..42f817ccc 100644
--- a/pipes/identify-speakers/package.json
+++ b/pipes/identify-speakers/package.json
@@ -1,5 +1,5 @@
{
- "name": "search",
+ "name": "identify-speakers",
"version": "0.1.0",
"private": true,
"scripts": {
diff --git a/pipes/linkedin-ai-assistant/package.json b/pipes/linkedin-ai-assistant/package.json
index 11e9d7da2..24e1d2fab 100644
--- a/pipes/linkedin-ai-assistant/package.json
+++ b/pipes/linkedin-ai-assistant/package.json
@@ -1,5 +1,5 @@
{
- "name": "linkedin_ai_assistant",
+ "name": "linkedin-ai-assistant",
"version": "0.1.0",
"private": true,
"type": "commonjs",
diff --git a/pipes/meeting/package.json b/pipes/meeting/package.json
index d009179e3..e4d6892b8 100644
--- a/pipes/meeting/package.json
+++ b/pipes/meeting/package.json
@@ -1,5 +1,5 @@
{
- "name": "search",
+ "name": "meeting",
"version": "0.1.0",
"private": true,
"scripts": {
diff --git a/pipes/obsidian/package.json b/pipes/obsidian/package.json
index b28d5c348..44dbfb0be 100644
--- a/pipes/obsidian/package.json
+++ b/pipes/obsidian/package.json
@@ -1,6 +1,6 @@
{
"name": "obsidian",
- "version": "0.1.2",
+ "version": "0.1.6",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
diff --git a/pipes/obsidian/src/components/obsidian-settings.tsx b/pipes/obsidian/src/components/obsidian-settings.tsx
index f140acc1a..caf6d10cc 100644
--- a/pipes/obsidian/src/components/obsidian-settings.tsx
+++ b/pipes/obsidian/src/components/obsidian-settings.tsx
@@ -45,7 +45,6 @@ export function ObsidianSettings() {
const [intelligenceDeepLink, setIntelligenceDeepLink] = useState<
string | null
>(null);
- console.log("settings", settings);
const [customPrompt, setCustomPrompt] = useState<string | null>(null);
const [testLogLoading, setTestLogLoading] = useState(false);
const [pathValidation, setPathValidation] = useState<{
diff --git a/pipes/reddit-auto-posts/app/api/pipeline/route.ts b/pipes/reddit-auto-posts/app/api/pipeline/route.ts
index 460d5e22b..7ae08194c 100644
--- a/pipes/reddit-auto-posts/app/api/pipeline/route.ts
+++ b/pipes/reddit-auto-posts/app/api/pipeline/route.ts
@@ -1,4 +1,3 @@
-"use server";
import fs from "node:fs";
import path from "node:path";
import { DailyLog } from "@/lib/types";
@@ -9,24 +8,32 @@ import generateDailyLog from "@/lib/actions/generate-log";
import generateRedditQuestions from "@/lib/actions/generate-reddit-question";
async function saveDailyLog(logEntry: DailyLog) {
- if (!logEntry){
- throw new Error("no log entry to save")
+ if (!logEntry) {
+ throw new Error("no log entry to save");
}
console.log("saving log entry:", logEntry);
const screenpipeDir = process.env.SCREENPIPE_DIR || process.cwd();
- const logsDir = path.join(screenpipeDir, "pipes", "reddit-auto-posts", "logs");
+ const logsDir = path.join(
+ screenpipeDir,
+ "pipes",
+ "reddit-auto-posts",
+ "logs"
+ );
const timestamp = new Date()
.toISOString()
.replace(/:/g, "-")
.replace(/\..+/, "");
- const filename = `${timestamp}-${logEntry.category?.replace(/[\/\\?%*:|"<>']/g, "-")}.json`;
- const logFile = path.join(logsDir, filename)
+ const filename = `${timestamp}-${logEntry.category?.replace(
+ /[\/\\?%*:|"<>']/g,
+ "-"
+ )}.json`;
+ const logFile = path.join(logsDir, filename);
try {
fs.writeFileSync(logFile, JSON.stringify(logEntry, null, 2));
} catch (error) {
- console.log(`Failed to write log file: ${error}`)
- throw new Error(`failed to write log file: ${error}`)
+ console.log(`Failed to write log file: ${error}`);
+ throw new Error(`failed to write log file: ${error}`);
}
}
@@ -34,22 +41,26 @@ async function retry(fn: any, retries = 3, delay = 5000) {
for (let i = 0; i < retries; i++) {
try {
const result = await fn();
- if (result){
+ if (result) {
return result;
}
} catch (error) {
- console.log(`Screenpipe query failed, retry, attempt: ${i + 1}`)
+ console.log(`Screenpipe query failed, retry, attempt: ${i + 1}`);
if (i === retries - 1) throw error;
- await new Promise(res => setTimeout(res, delay));
+ await new Promise((res) => setTimeout(res, delay));
}
}
}
+export const dynamic = "force-dynamic";
+
export async function GET(request: NextRequest) {
try {
console.log("starting daily log pipeline");
const settingsManager = pipe.settings;
- const redditSettings = await pipe.settings.getNamespaceSettings("reddit-auto-posts");
+ const redditSettings = await pipe.settings.getNamespaceSettings(
+ "reddit-auto-posts"
+ );
if (!settingsManager) {
return NextResponse.json(
@@ -77,16 +88,29 @@ export async function GET(request: NextRequest) {
const contentType = redditSettings?.contentType || "ocr";
const emailEnabled = !!(emailAddress && emailPassword);
const screenpipeDir = process.env.SCREENPIPE_DIR || process.cwd();
- const logsDir = path.join(screenpipeDir, "pipes", "reddit-auto-posts", "logs");
- const pipeConfigPath = path.join(screenpipeDir, "pipes", "reddit-auto-posts", "pipe.json");
+ const logsDir = path.join(
+ screenpipeDir,
+ "pipes",
+ "reddit-auto-posts",
+ "logs"
+ );
+ const pipeConfigPath = path.join(
+ screenpipeDir,
+ "pipes",
+ "reddit-auto-posts",
+ "pipe.json"
+ );
try {
fs.mkdirSync(logsDir);
} catch (_error) {
- console.warn("creating logs directory, probably already exists:", logsDir);
+ console.warn(
+ "creating logs directory, probably already exists:",
+ logsDir
+ );
}
- const fileContent = fs.readFileSync(pipeConfigPath, 'utf-8');
+ const fileContent = fs.readFileSync(pipeConfigPath, "utf-8");
const configData = JSON.parse(fileContent);
const url = new URL(request.url);
const fromButton = url.searchParams.get("fromButton");
@@ -110,123 +134,121 @@ export async function GET(request: NextRequest) {
"daily reddit questions",
welcomeEmail
);
- configData.welcomeEmailSent = true;
- fs.writeFileSync(pipeConfigPath, JSON.stringify(configData, null, 2));
+ configData.welcomeEmailSent = true;
+ fs.writeFileSync(pipeConfigPath, JSON.stringify(configData, null, 2));
} catch (error) {
- configData.welcomeEmailSent = false;
- fs.writeFileSync(pipeConfigPath, JSON.stringify(configData, null, 2));
+ configData.welcomeEmailSent = false;
+ fs.writeFileSync(pipeConfigPath, JSON.stringify(configData, null, 2));
return NextResponse.json(
{ error: `Error in sending welcome email: ${error}` },
{ status: 500 }
);
}
- };
+ }
const now = new Date();
const startTime = new Date(now.getTime() - interval);
- const screenData = await retry(() => pipe.queryScreenpipe({
+ const screenData = await retry(() =>
+ pipe.queryScreenpipe({
startTime: startTime.toISOString(),
endTime: now.toISOString(),
windowName: windowName,
limit: pageSize,
contentType: contentType,
- }));
+ })
+ );
+
+ if (screenData && screenData.data && screenData.data.length > 0) {
+ if (aiProvider === "screenpipe-cloud" && !userToken) {
+ return NextResponse.json(
+ { error: `seems like you don't have screenpipe-cloud access :(` },
+ { status: 500 }
+ );
+ }
+
+ let logEntry: DailyLog | undefined;
+ logEntry = await generateDailyLog(
+ screenData.data,
+ dailylogPrompt,
+ aiProvider,
+ aiModel,
+ aiUrl,
+ openaiApiKey,
+ userToken as string
+ );
+ await saveDailyLog(logEntry);
+
+ const redditQuestions = await generateRedditQuestions(
+ screenData.data,
+ customPrompt,
+ aiProvider,
+ aiModel,
+ aiUrl,
+ openaiApiKey,
+ userToken as string
+ );
+ console.log("reddit questions:", redditQuestions);
- if (screenData && screenData.data && screenData.data.length > 0) {
- if (aiProvider === "screenpipe-cloud" && !userToken) {
+ // only send mail in those request that are made from cron jobs,
+ // cz at that time user, is not seeing the frontend of this pipe
+ if (emailEnabled && redditQuestions && !fromButton) {
+ try {
+ await sendEmail(
+ emailAddress!,
+ emailPassword!,
+ "reddit questions",
+ redditQuestions
+ );
+ } catch (error) {
return NextResponse.json(
- { error: `seems like you don't have screenpipe-cloud access :(` },
+ { error: `error in sending mail ${error}` },
{ status: 500 }
);
}
+ } else {
+ console.log("Failed to get reddit questions!!");
+ }
- let logEntry: DailyLog | undefined;
- logEntry = await generateDailyLog(
- screenData.data,
- dailylogPrompt,
- aiProvider,
- aiModel,
- aiUrl,
- openaiApiKey,
- userToken as string,
- );
- await saveDailyLog(logEntry);
-
- const redditQuestions = await generateRedditQuestions(
- screenData.data,
- customPrompt,
- aiProvider,
- aiModel,
- aiUrl,
- openaiApiKey,
- userToken as string,
- );
- console.log("reddit questions:", redditQuestions);
-
- // only send mail in those request that are made from cron jobs,
- // cz at that time user, is not seeing the frontend of this pipe
- if (emailEnabled && redditQuestions && !fromButton) {
- try {
- await sendEmail(
- emailAddress!,
- emailPassword!,
- "reddit questions",
- redditQuestions
- );
- } catch(error) {
- return NextResponse.json(
- { error: `error in sending mail ${error}` },
- { status: 500 }
- );
- }
- } else {
- console.log("Failed to get reddit questions!!")
- }
-
- if (redditQuestions) {
- try {
- console.log("Sending screenpipe inbox notification");
- await pipe.inbox.send({
- title: "reddit questions",
- body: redditQuestions,
- });
- } catch(error) {
- return NextResponse.json(
- { error: `error in sending inbox notification ${error}` },
- { status: 500 }
- );
- }
- } else {
- console.log("Failed to get reddit questions!!")
- }
-
+ if (redditQuestions) {
try {
- console.log("Sending desktop notification");
- await pipe.sendDesktopNotification({
- badge: "reddit questions",
- body: "just sent you some reddit questions",
+ console.log("Sending screenpipe inbox notification");
+ await pipe.inbox.send({
+ title: "reddit questions",
+ body: redditQuestions,
});
} catch (error) {
return NextResponse.json(
- { error: `error in sending desktop notification ${error}` },
+ { error: `error in sending inbox notification ${error}` },
{ status: 500 }
);
}
- return NextResponse.json(
- { message: "pipe executed successfully", suggestedQuestions: redditQuestions },
- { status: 200 }
- );
} else {
+ console.log("Failed to get reddit questions!!");
+ }
+
+ try {
+ console.log("Sending desktop notification");
+ } catch (error) {
return NextResponse.json(
- { message: "query is empty please wait & and try again!" },
- { status: 200 }
+ { error: `error in sending desktop notification ${error}` },
+ { status: 500 }
);
- };
+ }
+ return NextResponse.json(
+ {
+ message: "pipe executed successfully",
+ suggestedQuestions: redditQuestions,
+ },
+ { status: 200 }
+ );
+ } else {
+ return NextResponse.json(
+ { message: "query is empty please wait & and try again!" },
+ { status: 200 }
+ );
+ }
} catch (error) {
console.error("error in GET handler:", error);
- return NextResponse.json(
- { error: `${error}` },
- { status: 400 }
- );
+ return NextResponse.json({ error: `${error}` }, { status: 400 });
}
}
diff --git a/pipes/reddit-auto-posts/components/pipe.tsx b/pipes/reddit-auto-posts/components/pipe.tsx
index 3a5a196df..55e5663fd 100644
--- a/pipes/reddit-auto-posts/components/pipe.tsx
+++ b/pipes/reddit-auto-posts/components/pipe.tsx
@@ -29,7 +29,6 @@ import {
} from "./ui/select";
const Pipe: React.FC = () => {
-
const { settings, updateSettings } = useSettings();
const { isAvailable, error } = useAiProvider(settings);
const { isServerDown } = useHealthCheck();
@@ -43,17 +42,16 @@ const Pipe: React.FC = () => {
const [emailTime, setEmailTime] = useState("");
const [hourlyRepetance, setHourlyRepetance] = useState("1");
- const aiDisabled = settings.aiProviderType === "screenpipe-cloud" && !settings.user.token;
+ const aiDisabled =
+ settings.aiProviderType === "screenpipe-cloud" && !settings.user.token;
- const defaultDailylogPrompt =
-`- Analyze user activities and summarize them into a structured daily log.
+ const defaultDailylogPrompt = `- Analyze user activities and summarize them into a structured daily log.
- Focus on identifying the purpose and context of each activity, categorizing them into clear categories like 'work', 'email', 'slack', etc.
- Assign appropriate tags that provide context and detail about the activity.
- Ensure the summary is concise, relevant, and uses simple language.
`;
-
- const defaultCustomPrompt =
-`- Craft engaging and community-friendly posts based on given screen data.
+
+ const defaultCustomPrompt = `- Craft engaging and community-friendly posts based on given screen data.
- Focus on generating specific and thoughtful questions that encourage discussion or helpful responses from the Reddit community.
- Use casual and approachable language, keeping the posts concise and easy to read.
- Include context when it adds value to the question but avoid overly personal details.
@@ -64,9 +62,16 @@ const Pipe: React.FC = () => {
useEffect(() => {
if (!contentType || !frequency) {
const timer = setTimeout(() => {
- setContentType(settings.customSettings?.["reddit-auto-posts"]?.contentType || "all");
- setFrequency(settings.customSettings?.["reddit-auto-posts"]?.summaryFrequency || "daily")
- setEmailTime(settings.customSettings?.["reddit-auto-posts"]?.emailTime || "11:00")
+ setContentType(
+ settings.customSettings?.["reddit-auto-posts"]?.contentType || "all"
+ );
+ setFrequency(
+ settings.customSettings?.["reddit-auto-posts"]?.summaryFrequency ||
+ "daily"
+ );
+ setEmailTime(
+ settings.customSettings?.["reddit-auto-posts"]?.emailTime || "11:00"
+ );
}, 1000);
return () => clearTimeout(timer);
}
@@ -80,13 +85,13 @@ const Pipe: React.FC = () => {
toast({
title: "failed to intialize daily log",
description: "please check your credentials",
- variant: "destructive"
- })
+ variant: "destructive",
+ });
} else if (res.status === 200) {
toast({
title: "pipe initalized sucessfully",
- variant: "default"
- })
+ variant: "default",
+ });
}
const data = await res.json();
if (data.suggestedQuestions) {
@@ -102,7 +107,8 @@ const Pipe: React.FC = () => {
};
const isMacOS = () => {
- return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
+ if (typeof navigator === "undefined") return false;
+ return navigator.platform.toUpperCase().indexOf("MAC") >= 0;
};
const handleSave = async (e: React.FormEvent) => {
@@ -110,21 +116,22 @@ const Pipe: React.FC = () => {
const formData = new FormData(e.target as HTMLFormElement);
let finalFrequency = frequency;
- if(frequency.startsWith("hourly")) {
+ if (frequency.startsWith("hourly")) {
finalFrequency = `hourly:${hourlyRepetance}`;
}
const newRedditSettings = {
interval: parseInt(formData.get("interval") as string),
pageSize: parseInt(formData.get("pageSize") as string),
- summaryFrequency: finalFrequency || formData.get("summaryFrequency") as string,
+ summaryFrequency:
+ finalFrequency || (formData.get("summaryFrequency") as string),
emailAddress: formData.get("emailAddress") as string,
emailPassword: formData.get("emailPassword") as string,
- emailTime: emailTime || (formData).get("emailTime") as string,
+ emailTime: emailTime || (formData.get("emailTime") as string),
customPrompt: formData.get("customPrompt") as string,
dailylogPrompt: formData.get("dailylogPrompt") as string,
- windowName: formData.get("windowName") as string || windowName,
+ windowName: (formData.get("windowName") as string) || windowName,
contentType: contentType as string,
- }
+ };
try {
await updateSettings(newRedditSettings, "reddit-auto-posts");
@@ -147,13 +154,18 @@ const Pipe: React.FC = () => {
<form onSubmit={handleSave} className="space-y-4 w-full">
<div className="space-y-2">
<Label htmlFor="path">time interval </Label>
- <span className="text-[13px] text-muted-foreground">&nbsp;&nbsp;we will extract information chunks at this interval to create posts</span>
+ <span className="text-[13px] text-muted-foreground">
+ &nbsp;&nbsp;we will extract information chunks at this interval to
+ create posts
+ </span>
<div className="flex gap-2">
<Input
id="interval"
name="interval"
type="number"
- defaultValue={settings.customSettings?.["reddit-auto-posts"]?.interval || 60}
+ defaultValue={
+ settings.customSettings?.["reddit-auto-posts"]?.interval || 60
+ }
placeholder="value in seconds"
className="flex-1"
/>
@@ -161,37 +173,49 @@ const Pipe: React.FC = () => {
</div>
<div className="space-y-3">
<Label htmlFor="pageSize">page size </Label>
- <span className="text-[13px] text-muted-foreground">&nbsp;&nbsp;number of records to retrieve per page for extraction, considering LLM context limits</span>
+ <span className="text-[13px] text-muted-foreground">
+ &nbsp;&nbsp;number of records to retrieve per page for extraction,
+ considering LLM context limits
+ </span>
<Input
id="pageSize"
name="pageSize"
type="number"
- defaultValue={settings.customSettings?.["reddit-auto-posts"]?.pageSize || 100}
+ defaultValue={
+ settings.customSettings?.["reddit-auto-posts"]?.pageSize || 100
+ }
placeholder="size of page"
/>
</div>
<div className="space-y-3">
<Label htmlFor="summaryFrequency">summary frequency </Label>
- <span className="text-[13px] text-muted-foreground">&nbsp;&nbsp;email frequency: &apos;daily&apos; at email time or &apos;hourly:X&apos;(e.g.
- &apos;hourly:4&apos; for every 4 hrs).</span>
+ <span className="text-[13px] text-muted-foreground">
+ &nbsp;&nbsp;email frequency: &apos;daily&apos; at email time or
+ &apos;hourly:X&apos;(e.g. &apos;hourly:4&apos; for every 4 hrs).
+ </span>
<Select
name="summaryFrequency"
value={frequency}
- onValueChange={(v) => { setFrequency(v)}}
+ onValueChange={(v) => {
+ setFrequency(v);
+ }}
>
- <SelectTrigger>
- <SelectValue placeholder="select the summary frequency type" />
- </SelectTrigger>
- <SelectContent>
- <SelectItem value="daily">daily</SelectItem>
- <SelectItem value="hourly">hourly</SelectItem>
- </SelectContent>
+ <SelectTrigger>
+ <SelectValue placeholder="select the summary frequency type" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="daily">daily</SelectItem>
+ <SelectItem value="hourly">hourly</SelectItem>
+ </SelectContent>
</Select>
</div>
{frequency === "daily" && (
<div className="space-y-2">
<Label htmlFor="emailTime">email time</Label>
- <span className="text-[13px] text-muted-foreground">&nbsp;&nbsp;time to send daily summary email (used only if summary frequency is &apos;daily&apos;)</span>
+ <span className="text-[13px] text-muted-foreground">
+ &nbsp;&nbsp;time to send daily summary email (used only if summary
+ frequency is &apos;daily&apos;)
+ </span>
<Input
id="emailTime"
name="emailTime"
@@ -208,7 +232,8 @@ const Pipe: React.FC = () => {
<div className="space-y-2">
<Label htmlFor="hourlyRepetance">hourly repetance</Label>
<span className="text-[13px] text-muted-foreground">
- &nbsp;&nbsp;specify the number of hours for hourly repetition (e.g., &apos;4&apos; for every 4 hours)
+ &nbsp;&nbsp;specify the number of hours for hourly repetition
+ (e.g., &apos;4&apos; for every 4 hours)
</span>
<Input
id="hourlyRepetance"
@@ -224,26 +249,44 @@ const Pipe: React.FC = () => {
)}
<div className="space-y-2">
<Label htmlFor="emailAddress">email address </Label>
- <span className="text-[13px] text-muted-foreground">&nbsp;&nbsp;email address to send the daily summary to: (eg. [email protected])</span>
+ <span className="text-[13px] text-muted-foreground">
+ &nbsp;&nbsp;email address to send the daily summary to: (eg.
+ </span>
<Input
id="emailAddress"
name="emailAddress"
type="email"
- defaultValue={settings.customSettings?.["reddit-auto-posts"]?.emailAddress || ""}
+ defaultValue={
+ settings.customSettings?.["reddit-auto-posts"]?.emailAddress || ""
+ }
placeholder="email address"
/>
</div>
<div className="space-y-3 relative items-center">
<Label htmlFor="emailPassword">email app specific password </Label>
- <span className="text-[13px] text-muted-foreground">&nbsp;&nbsp;app specific password for your gmail account, you can find it
- <a href="https://support.google.com/accounts/answer/185833?hl=en" target="_blank" className="hover:underline text-sky-700"> here</a></span>
+ <span className="text-[13px] text-muted-foreground">
+ &nbsp;&nbsp;app specific password for your gmail account, you can
+ find it
+ <a
+ href="https://support.google.com/accounts/answer/185833?hl=en"
+ target="_blank"
+ className="hover:underline text-sky-700"
+ >
+ {" "}
+ here
+ </a>
+ </span>
<Input
id="emailPassword"
name="emailPassword"
type={showKey ? "text" : "password"}
autoCorrect="off"
autoComplete="off"
- defaultValue={settings.customSettings?.["reddit-auto-posts"]?.emailPassword || ""}
+ defaultValue={
+ settings.customSettings?.["reddit-auto-posts"]?.emailPassword ||
+ ""
+ }
placeholder="password"
/>
<Button
@@ -256,42 +299,56 @@ const Pipe: React.FC = () => {
{showKey ? (
<EyeOff className="h-4 w-4" />
) : (
- <Eye className="h-4 w-4" />
- )}
+ <Eye className="h-4 w-4" />
+ )}
</Button>
</div>
<div className="space-y-3">
<Label htmlFor="contentType">
<span>content type </span>
- <span className="text-[13px] text-muted-foreground !font-normal">&nbsp;&nbsp;type of content to analyze &apos;ocr&apos;, &apos;audio&apos;, or &apos;all&apos;. &apos;ocr&apos; is recommended due to more content</span>
+ <span className="text-[13px] text-muted-foreground !font-normal">
+ &nbsp;&nbsp;type of content to analyze &apos;ocr&apos;,
+ &apos;audio&apos;, or &apos;all&apos;. &apos;ocr&apos; is
+ recommended due to more content
+ </span>
</Label>
<Select
value={contentType}
onValueChange={(value) => {
- setContentType(value);
+ setContentType(value);
}}
>
<SelectTrigger>
<SelectValue placeholder="select content type" />
</SelectTrigger>
<SelectContent>
- <SelectItem textValue="all" value="all">all</SelectItem>
- <SelectItem textValue="ocr" value="ocr">ocr</SelectItem>
- <SelectItem textValue="audio" value="audio">audio</SelectItem>
+ <SelectItem textValue="all" value="all">
+ all
+ </SelectItem>
+ <SelectItem textValue="ocr" value="ocr">
+ ocr
+ </SelectItem>
+ <SelectItem textValue="audio" value="audio">
+ audio
+ </SelectItem>
{isMacOS() && <SelectItem value="ui">ui</SelectItem>}
</SelectContent>
</Select>
</div>
<div className="space-y-3">
<Label htmlFor="windowName">window name</Label>
- <span className="text-[13px] text-muted-foreground">&nbsp;&nbsp;specific window name to filter the screen data, for example &apos;gmail&apos;,
- &apos;john&apos;, &apos;slack&apos; etc.</span>
+ <span className="text-[13px] text-muted-foreground">
+ &nbsp;&nbsp;specific window name to filter the screen data, for
+ example &apos;gmail&apos;, &apos;john&apos;, &apos;slack&apos; etc.
+ </span>
<SqlAutocompleteInput
id="windowName"
name="windowName"
type="window"
icon={<Laptop className="h-4 w-4" />}
- defaultValue={settings.customSettings?.["reddit-auto-posts"]?.windowName}
+ defaultValue={
+ settings.customSettings?.["reddit-auto-posts"]?.windowName
+ }
onChange={(v) => setWindowName(v)}
placeholder="window name to filter the screen data"
className="flex-grow"
@@ -303,7 +360,10 @@ const Pipe: React.FC = () => {
id="dailylogPrompt"
name="dailylogPrompt"
className="w-full text-sm min-h-[30px] p-2 rounded-md border bg-background"
- defaultValue={ settings.customSettings?.["reddit-auto-posts"]?.dailylogPrompt || `${defaultDailylogPrompt}` }
+ defaultValue={
+ settings.customSettings?.["reddit-auto-posts"]?.dailylogPrompt ||
+ `${defaultDailylogPrompt}`
+ }
placeholder="additional prompt for the AI assistant that will be used to extract information from the screen data every specified amount of minutes"
/>
</div>
@@ -313,11 +373,14 @@ const Pipe: React.FC = () => {
id="customPrompt"
name="customPrompt"
className="w-full text-sm min-h-[30px] p-2 rounded-md border bg-background"
- defaultValue={settings.customSettings?.["reddit-auto-posts"]?.customPrompt || `${defaultCustomPrompt}` }
+ defaultValue={
+ settings.customSettings?.["reddit-auto-posts"]?.customPrompt ||
+ `${defaultCustomPrompt}`
+ }
placeholder="additional prompt for the AI assistant that will be used to generate a list of questions to post on reddit based on the logs previously extracted"
/>
</div>
- <Button type="submit" >
+ <Button type="submit">
<FileCheck className="mr-2 h-4 w-4" />
save settings
</Button>
@@ -331,59 +394,65 @@ const Pipe: React.FC = () => {
onClick={testPipe}
className="w-full border-[1.4px] shadow-sm"
variant={"outline"}
- disabled={loading || aiDisabled || isServerDown || !isAvailable}
+ disabled={
+ loading || aiDisabled || isServerDown || !isAvailable
+ }
>
- {loading ? "generating..." : "generate reddit questions"}
+ {loading ? "generating..." : "generate reddit questions"}
</Button>
</span>
</TooltipTrigger>
{(aiDisabled || isServerDown || !isAvailable) && (
<TooltipContent>
- <p>{`${(aiDisabled && isServerDown || !isAvailable) ?
- "you don't have access of screenpipe-cloud and screenpipe is down!"
- : isServerDown ? "screenpipe is not running..."
- : aiDisabled ? "you don't have access to screenpipe-cloud :( please consider login"
- : !isAvailable ? {error}
- : ""
- }
+ <p>{`${
+ (aiDisabled && isServerDown) || !isAvailable
+ ? "you don't have access of screenpipe-cloud and screenpipe is down!"
+ : isServerDown
+ ? "screenpipe is not running..."
+ : aiDisabled
+ ? "you don't have access to screenpipe-cloud :( please consider login"
+ : !isAvailable
+ ? { error }
+ : ""
+ }
`}</p>
</TooltipContent>
)}
</Tooltip>
</TooltipProvider>
{lastLog && (
- <div className="p-4 border rounded-lg space-y-2 font-mono text-sm">
- <MemoizedReactMarkdown
- className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 w-[35vw] text-sm"
- remarkPlugins={[remarkGfm, remarkMath]}
- components={{
- p: ({ children }) => (
- <p className="mb-2 last:mb-0">{children}</p>
- ),
- a: ({ href, children, ...props }) => {
- const isExternal =
- href?.startsWith("http") || href?.startsWith("https");
- return (
- <a
- href={href}
- target={isExternal ? "_blank" : undefined}
- rel={isExternal ? "noopener noreferrer" : undefined}
- className="break-all text-blue-500 hover:underline"
- {...props}
- >
- {children}
- </a>
- );
- },
- }}
- >
- {lastLog}
- </MemoizedReactMarkdown>
- </div>
+ <div className="p-4 border rounded-lg space-y-2 font-mono text-sm">
+ <MemoizedReactMarkdown
+ className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 w-[35vw] text-sm"
+ remarkPlugins={[remarkGfm, remarkMath]}
+ components={{
+ p: ({ children }) => (
+ <p className="mb-2 last:mb-0">{children}</p>
+ ),
+ a: ({ href, children, ...props }) => {
+ const isExternal =
+ href?.startsWith("http") || href?.startsWith("https");
+ return (
+ <a
+ href={href}
+ target={isExternal ? "_blank" : undefined}
+ rel={isExternal ? "noopener noreferrer" : undefined}
+ className="break-all text-blue-500 hover:underline"
+ {...props}
+ >
+ {children}
+ </a>
+ );
+ },
+ }}
+ >
+ {lastLog}
+ </MemoizedReactMarkdown>
+ </div>
)}
</div>
</div>
);
-}
+};
export default Pipe;
diff --git a/screenpipe-app-tauri/app/page.tsx b/screenpipe-app-tauri/app/page.tsx
index 01b913da5..b34a504a0 100644
--- a/screenpipe-app-tauri/app/page.tsx
+++ b/screenpipe-app-tauri/app/page.tsx
@@ -201,7 +201,7 @@ export default function Home() {
) : (
<>
<ChangelogDialog />
- {/* <BreakingChangesInstructionsDialog /> */}
+ <BreakingChangesInstructionsDialog />
<Header />
<div className=" w-[90%]">
<PipeStore />
diff --git a/screenpipe-app-tauri/components/breaking-changes-instructions-dialog.tsx b/screenpipe-app-tauri/components/breaking-changes-instructions-dialog.tsx
index f3a349666..19d210623 100644
--- a/screenpipe-app-tauri/components/breaking-changes-instructions-dialog.tsx
+++ b/screenpipe-app-tauri/components/breaking-changes-instructions-dialog.tsx
@@ -7,13 +7,17 @@ import {
DialogTitle,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
-import { Trash2 } from "lucide-react";
+import { Trash2, Loader2 } from "lucide-react";
import localforage from "localforage";
+import { useToast } from "@/components/ui/use-toast";
+import { Command } from "@tauri-apps/plugin-shell";
export function BreakingChangesInstructionsDialog() {
+ const { toast } = useToast();
const [open, setOpen] = useState(false);
const [hasShownDialog, setHasShownDialog] = useState(false);
const [hasPipes, setHasPipes] = useState(false);
+ const [isDeleting, setIsDeleting] = useState(false);
useEffect(() => {
const init = async () => {
@@ -38,26 +42,85 @@ export function BreakingChangesInstructionsDialog() {
}
}, [hasShownDialog, hasPipes]);
+ const handleResetAllPipes = async () => {
+ setIsDeleting(true);
+ try {
+ const cmd = Command.sidecar("screenpipe", ["pipe", "purge", "-y"]);
+ await cmd.execute();
+ toast({
+ title: "all pipes deleted",
+ description: "you can now reinstall the updated pipes from the store",
+ });
+ localforage.setItem("has-shown-delete-pipes-dialog", true);
+ setOpen(false);
+ } catch (error) {
+ console.error("failed to reset pipes:", error);
+ toast({
+ title: "error deleting pipes",
+ description: "please try again or check the logs",
+ variant: "destructive",
+ });
+ } finally {
+ setIsDeleting(false);
+ }
+ };
+
if (!hasPipes) return null;
return (
- <Dialog open={open} onOpenChange={setOpen}>
- <DialogContent className="sm:max-w-[425px]">
+ <Dialog open={open} onOpenChange={() => {}}>
+ <DialogContent
+ className="sm:max-w-[525px] [&>button]:hidden"
+ onPointerDownOutside={(e) => e.preventDefault()}
+ >
<DialogHeader>
<DialogTitle className="flex gap-2 items-center">
<Trash2 className="h-5 w-5" />
- major update: please reinstall all pipes
+ critical update: new pipe system available
</DialogTitle>
- <DialogDescription>
- we&apos;ve made significant changes to the pipe system. to ensure
- everything works correctly, please delete all your existing pipes
- and reinstall them. you can do this by clicking the trash icon in
- the pipe store.
+ <DialogDescription className="space-y-4">
+ <p>
+ we&apos;ve completely redesigned the pipe system from the ground
+ up to make it more powerful and efficient. this is a breaking
+ change that requires action from you.
+ </p>
+ <div className="bg-muted p-4 rounded-md space-y-2">
+ <p className="font-medium">required actions:</p>
+ <ol className="list-decimal list-inside space-y-1">
+ <li>delete all your existing pipes using the button below</li>
+ <li>
+ reinstall the pipes you need from the updated collection
+ </li>
+ </ol>
+ </div>
+ <p className="text-sm text-muted-foreground">
+ clicking &apos;delete all pipes&apos; will remove all your
+ existing pipes. don&apos;t worry, you can reinstall them from the
+ store afterwards.
+ </p>
+ <p className="text-sm text-muted-foreground">
+ face any issues? DM us on{" "}
+ <a
+ href="https://discord.gg/dU9EBuw7Uq"
+ target="_blank"
+ className="text-blue-500 hover:underline"
+ >
+ discord
+ </a>
+ .
+ </p>
</DialogDescription>
</DialogHeader>
- <div className="flex justify-end">
- <Button variant="outline" onClick={() => setOpen(false)}>
- got it
+ <div className="flex justify-end gap-2">
+ <Button onClick={handleResetAllPipes} disabled={isDeleting}>
+ {isDeleting ? (
+ <>
+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />
+ deleting...
+ </>
+ ) : (
+ "delete all pipes"
+ )}
</Button>
</div>
</DialogContent>
diff --git a/screenpipe-app-tauri/components/pipe-store.tsx b/screenpipe-app-tauri/components/pipe-store.tsx
index af9258403..b14bda9fc 100644
--- a/screenpipe-app-tauri/components/pipe-store.tsx
+++ b/screenpipe-app-tauri/components/pipe-store.tsx
@@ -64,6 +64,7 @@ export const PipeStore: React.FC = () => {
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
@@ -115,6 +116,7 @@ export const PipeStore: React.FC = () => {
if (!settings.user?.token) return;
const pipeApi = await PipeApi.create(settings.user!.token!);
const purchaseHistory = await pipeApi.getUserPurchaseHistory();
+ console.log("purchase history", purchaseHistory);
setPurchaseHistory(purchaseHistory);
};
@@ -138,13 +140,16 @@ export const PipeStore: React.FC = () => {
const pipeApi = await PipeApi.create(settings.user!.token!);
const response = await pipeApi.purchasePipe(pipe.id);
+ // user had credits left
if (response.data.used_credits) {
- toast({
- title: "purchase successful",
- description: "your purchase has been successful",
- });
+ } else if (response.data.checkout_url) {
+ // user had no credits left
+ openUrl(response.data.checkout_url);
}
- openUrl(response.data.checkout_url);
+ toast({
+ title: "purchase successful",
+ description: "your purchase has been successful",
+ });
onComplete?.();
} catch (error) {
console.error("error purchasing pipe:", error);
@@ -408,7 +413,9 @@ export const PipeStore: React.FC = () => {
onComplete();
} catch (error) {
console.error(
- `Failed to ${pipe.installed_config?.enabled ? "disable" : "enable"} pipe:`,
+ `Failed to ${
+ pipe.installed_config?.enabled ? "disable" : "enable"
+ } pipe:`,
error
);
toast({
diff --git a/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx b/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx
index efdf3020b..40f9eac29 100644
--- a/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx
+++ b/screenpipe-app-tauri/components/pipe-store/pipe-card.tsx
@@ -84,12 +84,9 @@ export const PipeCard: React.FC<PipeCardProps> = ({
className="group border rounded-xl p-5 hover:bg-muted/40 transition-all duration-200 cursor-pointer backdrop-blur-sm"
onClick={() => onClick(pipe)}
>
- <div className="flex flex-col h-full space-y-4">
+ <div className="flex flex-col h-full justify-between space-y-4">
<div className="flex items-start justify-between gap-4">
<div className="flex items-center gap-3">
- <div className="size-12 rounded-[20%] bg-muted flex items-center justify-center overflow-hidden">
- <Puzzle className="size-4 text-muted-foreground" />
- </div>
<div className="flex-1 min-w-0">
<h3 className="font-semibold text-lg tracking-tight">
{pipe.name}
@@ -141,8 +138,8 @@ export const PipeCard: React.FC<PipeCardProps> = ({
)}
</div>
</div>
- {pipe.installed_config?.source === "store" && (
- <div className="flex items-center gap-3 text-xs text-muted-foreground">
+ {pipe.developer_accounts.developer_name && (
+ <div className="flex items-center gap-3 text-xs text-muted-foreground mt-auto">
<div className="flex items-center gap-1">
<div className="size-6 rounded-full bg-muted flex items-center justify-center">
<UserIcon className="size-3" />
diff --git a/screenpipe-app-tauri/lib/api/store/index.ts b/screenpipe-app-tauri/lib/api/store/index.ts
index d896f37a2..f33d1f5b2 100644
--- a/screenpipe-app-tauri/lib/api/store/index.ts
+++ b/screenpipe-app-tauri/lib/api/store/index.ts
@@ -93,8 +93,11 @@ export class PipeApi {
async getUserPurchaseHistory(): Promise<any> {
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}`,
@@ -105,6 +108,8 @@ 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;
return data;
} catch (error) {
@@ -115,6 +120,7 @@ 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}`,
@@ -147,6 +153,7 @@ export class PipeApi {
throw new Error(`failed to purchase pipe: ${error}`);
}
const data = (await response.json()) as PurchaseUrlResponse;
+ console.log("purchase data", data);
return data;
} catch (error) {
console.error("error purchasing pipe:", error);