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 pipe

Louis Beaumont0aab75bb704d
diff --git a/examples/typescript/pipe-email-daily-log/pipe.ts b/examples/typescript/pipe-email-daily-log/pipe.ts
index c454e6e71..b7fa5a113 100644
--- a/examples/typescript/pipe-email-daily-log/pipe.ts
+++ b/examples/typescript/pipe-email-daily-log/pipe.ts
@@ -49,7 +49,7 @@ async function queryScreenpipe(
}
return await response.json();
} catch (error) {
- console.error("error querying screenpipe:", error);
+ console.warn("error querying screenpipe:", error);
return { data: [] };
}
}
@@ -110,8 +110,8 @@ async function generateDailyLog(
try {
content = JSON.parse(cleanedResult);
} catch (error) {
- console.error("failed to parse ai response:", error);
- console.error("cleaned result:", cleanedResult);
+ console.warn("failed to parse ai response:", error);
+ console.warn("cleaned result:", cleanedResult);
throw new Error("invalid ai response format");
}
@@ -233,7 +233,7 @@ async function getTodayLogs(): Promise<DailyLog[]> {
return logs;
} catch (error) {
- console.error("error getting today's logs:", error);
+ console.warn("error getting today's logs:", error);
return [];
}
}
@@ -263,7 +263,11 @@ async function dailyLogPipeline(): Promise<void> {
Welcome to the daily log pipeline!
This pipe will send you a daily summary of your activities.
- It will run at ${emailTime} every day.
+ ${
+ summaryFrequency === "daily"
+ ? `It will run at ${emailTime} every day.`
+ : `It will run every ${summaryFrequency} hours.`
+ }
`;
await sendEmail(
@@ -335,13 +339,12 @@ async function dailyLogPipeline(): Promise<void> {
"activity summary",
summary
);
+ lastEmailSent = now;
}
});
-
- lastEmailSent = now;
}
} catch (error) {
- console.error("error in daily log pipeline:", error);
+ console.warn("error in daily log pipeline:", error);
}
await new Promise((resolve) => setTimeout(resolve, interval));
}
diff --git a/screenpipe-core/src/deno/runtime.js b/screenpipe-core/src/deno/runtime.js
index 768eb63da..98623ed85 100644
--- a/screenpipe-core/src/deno/runtime.js
+++ b/screenpipe-core/src/deno/runtime.js
@@ -41,6 +41,10 @@ const console = {
core.print(`[js][error]: ${argsToMessage(...args)}\n`, true);
// sendLog("error", ...args);
},
+ warn: (...args) => {
+ core.print(`[js][warn]: ${argsToMessage(...args)}\n`, true);
+ // sendLog("warn", ...args);
+ }
};
globalThis.console = console;