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: telemtry issue, #1195 related

Louis Beaumont00a1bfdaa140
diff --git a/pipes/data-table/bun.lockb b/pipes/data-table/bun.lockb
index 762017473..f7824a03d 100755
Binary files a/pipes/data-table/bun.lockb and b/pipes/data-table/bun.lockb differ
diff --git a/pipes/data-table/package.json b/pipes/data-table/package.json
index ab74210a3..b40d14412 100644
--- a/pipes/data-table/package.json
+++ b/pipes/data-table/package.json
@@ -23,8 +23,8 @@
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-toast": "^1.2.3",
"@radix-ui/react-tooltip": "^1.1.5",
- "@screenpipe/browser": "^0.1.22",
- "@screenpipe/js": "^1.0.6",
+ "@screenpipe/browser": "^0.1.24",
+ "@screenpipe/js": "^1.0.7",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@tanstack/react-table": "^8.20.6",
diff --git a/pipes/identify-speakers/bun.lockb b/pipes/identify-speakers/bun.lockb
index aa915b2f2..8af43bdca 100755
Binary files a/pipes/identify-speakers/bun.lockb and b/pipes/identify-speakers/bun.lockb differ
diff --git a/pipes/identify-speakers/package.json b/pipes/identify-speakers/package.json
index 4dfcf08ea..ee0ba9c71 100644
--- a/pipes/identify-speakers/package.json
+++ b/pipes/identify-speakers/package.json
@@ -22,8 +22,8 @@
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-toast": "^1.2.3",
"@radix-ui/react-tooltip": "^1.1.5",
- "@screenpipe/browser": "^0.1.22",
- "@screenpipe/js": "^1.0.6",
+ "@screenpipe/browser": "^0.1.24",
+ "@screenpipe/js": "^1.0.7",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@types/js-levenshtein": "^1.1.3",
diff --git a/pipes/linkedin-ai-assistant/bun.lockb b/pipes/linkedin-ai-assistant/bun.lockb
index 6506c939b..1db380cb8 100755
Binary files a/pipes/linkedin-ai-assistant/bun.lockb and b/pipes/linkedin-ai-assistant/bun.lockb differ
diff --git a/pipes/linkedin-ai-assistant/package.json b/pipes/linkedin-ai-assistant/package.json
index 8f6657ab9..9fb22cb34 100644
--- a/pipes/linkedin-ai-assistant/package.json
+++ b/pipes/linkedin-ai-assistant/package.json
@@ -16,8 +16,8 @@
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-toast": "^1.2.4",
"@radix-ui/react-tooltip": "^1.1.6",
- "@screenpipe/browser": "0.1.22",
- "@screenpipe/js": "^1.0.6",
+ "@screenpipe/browser": "0.1.24",
+ "@screenpipe/js": "^1.0.7",
"@sentry/nextjs": "^8.42.0",
"@tauri-apps/api": "^2.1.1",
"chrome-launcher": "^1.1.2",
diff --git a/pipes/meeting/bun.lockb b/pipes/meeting/bun.lockb
index e62857030..730a567ae 100755
Binary files a/pipes/meeting/bun.lockb and b/pipes/meeting/bun.lockb differ
diff --git a/pipes/meeting/package.json b/pipes/meeting/package.json
index b4129e5c7..d009179e3 100644
--- a/pipes/meeting/package.json
+++ b/pipes/meeting/package.json
@@ -22,8 +22,8 @@
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-toast": "^1.2.4",
"@radix-ui/react-tooltip": "^1.1.5",
- "@screenpipe/browser": "0.1.22",
- "@screenpipe/js": "1.0.5",
+ "@screenpipe/browser": "0.1.24",
+ "@screenpipe/js": "1.0.7",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@types/js-levenshtein": "^1.1.3",
diff --git a/pipes/memories/bun.lockb b/pipes/memories/bun.lockb
index 91719c402..6aca328c5 100755
Binary files a/pipes/memories/bun.lockb and b/pipes/memories/bun.lockb differ
diff --git a/pipes/memories/package.json b/pipes/memories/package.json
index 4ed9bccab..f4f81e338 100644
--- a/pipes/memories/package.json
+++ b/pipes/memories/package.json
@@ -22,8 +22,8 @@
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-toast": "^1.2.3",
"@radix-ui/react-tooltip": "^1.1.5",
- "@screenpipe/browser": "^0.1.22",
- "@screenpipe/js": "^1.0.6",
+ "@screenpipe/browser": "^0.1.24",
+ "@screenpipe/js": "^1.0.7",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@types/js-levenshtein": "^1.1.3",
diff --git a/pipes/obsidian/bun.lockb b/pipes/obsidian/bun.lockb
index ba5559726..1a6f041b6 100755
Binary files a/pipes/obsidian/bun.lockb and b/pipes/obsidian/bun.lockb differ
diff --git a/pipes/obsidian/package.json b/pipes/obsidian/package.json
index d483c1557..31afd8f15 100644
--- a/pipes/obsidian/package.json
+++ b/pipes/obsidian/package.json
@@ -23,8 +23,8 @@
"@radix-ui/react-tabs": "^1.1.2",
"@radix-ui/react-toast": "^1.2.4",
"@radix-ui/react-tooltip": "^1.1.5",
- "@screenpipe/browser": "0.1.22",
- "@screenpipe/js": "1.0.6",
+ "@screenpipe/browser": "0.1.24",
+ "@screenpipe/js": "1.0.7",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@types/js-levenshtein": "^1.1.3",
diff --git a/pipes/pipe-for-loom/bun.lockb b/pipes/pipe-for-loom/bun.lockb
index 77d31857c..4ff9f4f8c 100755
Binary files a/pipes/pipe-for-loom/bun.lockb and b/pipes/pipe-for-loom/bun.lockb differ
diff --git a/pipes/pipe-for-loom/package.json b/pipes/pipe-for-loom/package.json
index f9a0e6e69..aa8f382df 100644
--- a/pipes/pipe-for-loom/package.json
+++ b/pipes/pipe-for-loom/package.json
@@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
- "@screenpipe/browser": "0.1.22",
+ "@screenpipe/browser": "0.1.24",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-slot": "1.1.0",
diff --git a/pipes/reddit-auto-posts/bun.lockb b/pipes/reddit-auto-posts/bun.lockb
index f0fe8041c..88dba8326 100755
Binary files a/pipes/reddit-auto-posts/bun.lockb and b/pipes/reddit-auto-posts/bun.lockb differ
diff --git a/pipes/reddit-auto-posts/package.json b/pipes/reddit-auto-posts/package.json
index e330808e7..0d3c366ac 100644
--- a/pipes/reddit-auto-posts/package.json
+++ b/pipes/reddit-auto-posts/package.json
@@ -13,8 +13,8 @@
"@radix-ui/react-select": "^2.1.4",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-tooltip": "^1.1.6",
- "@screenpipe/browser": "0.1.22",
- "@screenpipe/js": "1.0.0",
+ "@screenpipe/browser": "0.1.24",
+ "@screenpipe/js": "1.0.7",
"@types/lodash": "^4.17.13",
"@types/nodemailer": "^6.4.17",
"ai": "^4.0.18",
diff --git a/pipes/rewind/bun.lockb b/pipes/rewind/bun.lockb
index 939ba4dfa..c2eca629a 100755
Binary files a/pipes/rewind/bun.lockb and b/pipes/rewind/bun.lockb differ
diff --git a/pipes/rewind/package.json b/pipes/rewind/package.json
index e2569ca03..d9ab60e48 100644
--- a/pipes/rewind/package.json
+++ b/pipes/rewind/package.json
@@ -23,8 +23,8 @@
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-toast": "^1.2.3",
"@radix-ui/react-tooltip": "^1.1.5",
- "@screenpipe/browser": "^0.1.22",
- "@screenpipe/js": "^1.0.6",
+ "@screenpipe/browser": "^0.1.24",
+ "@screenpipe/js": "^1.0.7",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@types/js-levenshtein": "^1.1.3",
diff --git a/pipes/search/bun.lockb b/pipes/search/bun.lockb
index a34cf50c0..ab6e69d5a 100755
Binary files a/pipes/search/bun.lockb and b/pipes/search/bun.lockb differ
diff --git a/pipes/search/package.json b/pipes/search/package.json
index 2e5367d18..037e22489 100644
--- a/pipes/search/package.json
+++ b/pipes/search/package.json
@@ -22,8 +22,8 @@
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-toast": "^1.2.3",
"@radix-ui/react-tooltip": "^1.1.5",
- "@screenpipe/browser": "^0.1.22",
- "@screenpipe/js": "^1.0.6",
+ "@screenpipe/browser": "^0.1.24",
+ "@screenpipe/js": "^1.0.7",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@types/js-levenshtein": "^1.1.3",
diff --git a/pipes/search/src/components/search-chat.tsx b/pipes/search/src/components/search-chat.tsx
index 0515ad9fa..9595ac2a7 100644
--- a/pipes/search/src/components/search-chat.tsx
+++ b/pipes/search/src/components/search-chat.tsx
@@ -37,6 +37,7 @@ import {
AlertCircle,
SpeechIcon,
ChevronsUpDown,
+ Bot,
} from "lucide-react";
import { useToast } from "@/lib/use-toast";
import { AnimatePresence, motion } from "framer-motion";
@@ -430,10 +431,11 @@ export function SearchChat() {
!settings.user?.token && settings.aiProviderType === "screenpipe-cloud";
const handleExampleSelect = async (example: ExampleSearch) => {
- if (isAiDisabled){
+ if (isAiDisabled) {
toast({
title: "error",
- description: "your selected ai provider is screenpipe-cloud. consider login in app to use screenpipe-cloud",
+ description:
+ "your selected ai provider is screenpipe-cloud. consider login in app to use screenpipe-cloud",
variant: "destructive",
});
return;
@@ -750,10 +752,11 @@ export function SearchChat() {
};
const handleSearch = async (newOffset = 0, overrides: any = {}) => {
- if (isAiDisabled){
+ if (isAiDisabled) {
toast({
title: "error",
- description: "your ai provider is screenpipe-cloud. consider login in app to use screenpipe-cloud",
+ description:
+ "your ai provider is screenpipe-cloud. consider login in app to use screenpipe-cloud",
duration: 3000,
variant: "destructive",
});
@@ -1134,7 +1137,6 @@ export function SearchChat() {
// Add any other reset logic you need
};
-
return (
<div className="w-full max-w-4xl mx-auto p-4 mt-12">
<div className="fixed top-4 left-4 z-50 flex items-center gap-2">
@@ -1292,8 +1294,12 @@ export function SearchChat() {
<span>
<Button
onClick={() => handleSearch(0)}
- disabled={(isLoading || isAiDisabled || !health
- || health?.status === "error")}
+ disabled={
+ isLoading ||
+ isAiDisabled ||
+ !health ||
+ health?.status === "error"
+ }
className="disabled:cursor-not-allowed"
>
{isLoading ? (
@@ -1313,10 +1319,11 @@ export function SearchChat() {
{(!health || health?.status === "error" || isAiDisabled) && (
<TooltipContent>
<p>
- {(isAiDisabled && isServerDown) ? (
+ {isAiDisabled && isServerDown ? (
<>
<AlertCircle className="mr-1 h-4 w-4 text-red-500 inline" />
- you don't have access to screenpipe-cloud <br /> and screenpipe server is down!
+ you don't have access to screenpipe-cloud <br /> and
+ screenpipe server is down!
</>
) : isServerDown ? (
<>
@@ -1326,7 +1333,8 @@ export function SearchChat() {
) : isAiDisabled ? (
<>
<AlertCircle className="mr-1 h-4 w-4 text-red-500 inline" />
- you don't have access to screenpipe-cloud :( <br/> please consider login!
+ you don't have access to screenpipe-cloud :( <br /> please
+ consider login!
</>
) : (
""
@@ -1802,13 +1810,27 @@ export function SearchChat() {
className="flex flex-col space-y-2 bg-white dark:bg-gray-800 shadow-lg rounded-lg overflow-hidden p-4 border border-gray-200 dark:border-gray-700"
>
<div className="relative flex-grow flex items-center space-x-2">
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger>
+ <div className="text-muted-foreground">
+ <Bot className="h-4 w-4" />
+ </div>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>using {settings.aiModel}</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
<Input
ref={floatingInputRef}
type="text"
placeholder="ask a question about the results..."
value={floatingInput}
disabled={
- calculateSelectedContentLength() > MAX_CONTENT_LENGTH || isAiDisabled
+ calculateSelectedContentLength() > MAX_CONTENT_LENGTH ||
+ isAiDisabled
}
onChange={(e) => setFloatingInput(e.target.value)}
className="flex-1 h-12 focus:outline-none focus:ring-0 border-0 focus:border-black dark:focus:border-white focus:border-b transition-all duration-200"
diff --git a/screenpipe-js/browser-sdk/bun.lockb b/screenpipe-js/browser-sdk/bun.lockb
index 880d948e1..82f686431 100755
Binary files a/screenpipe-js/browser-sdk/bun.lockb and b/screenpipe-js/browser-sdk/bun.lockb differ
diff --git a/screenpipe-js/browser-sdk/package.json b/screenpipe-js/browser-sdk/package.json
index 9993926c9..a043eed70 100644
--- a/screenpipe-js/browser-sdk/package.json
+++ b/screenpipe-js/browser-sdk/package.json
@@ -1,6 +1,6 @@
{
"name": "@screenpipe/browser",
- "version": "0.1.22",
+ "version": "0.1.24",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
diff --git a/screenpipe-js/browser-sdk/src/index.ts b/screenpipe-js/browser-sdk/src/index.ts
index 5eb3e396b..f1dcb39a5 100644
--- a/screenpipe-js/browser-sdk/src/index.ts
+++ b/screenpipe-js/browser-sdk/src/index.ts
@@ -65,14 +65,12 @@ export interface BrowserPipe {
}
class BrowserPipeImpl implements BrowserPipe {
- private analyticsInitialized = false;
- private analyticsEnabled = false;
- private userId?: string;
private userProperties?: Record<string, any>;
- private async initAnalyticsIfNeeded() {
- if (this.analyticsInitialized || !this.userId) return;
-
+ private async initAnalyticsIfNeeded(): Promise<{
+ analyticsEnabled: boolean;
+ userId?: string;
+ }> {
try {
// Connect to settings SSE stream
const settingsStream = new EventSource(
@@ -80,39 +78,52 @@ class BrowserPipeImpl implements BrowserPipe {
);
// Get initial settings
- const settings = await new Promise<{ analyticsEnabled: boolean }>(
- (resolve, reject) => {
- const timeout = setTimeout(() => {
- settingsStream.close();
- reject(new Error("settings stream timeout"));
- }, 5000);
+ const settings = await new Promise<{
+ analyticsEnabled: boolean;
+ userId?: string;
+ }>((resolve, reject) => {
+ const timeout = setTimeout(() => {
+ settingsStream.close();
+ reject(new Error("settings stream timeout"));
+ }, 5000);
- settingsStream.onmessage = (event) => {
- clearTimeout(timeout);
- settingsStream.close();
- resolve(JSON.parse(event.data));
- };
+ settingsStream.onmessage = (event) => {
+ clearTimeout(timeout);
+ settingsStream.close();
+ // Parse the settings array and find analyticsEnabled
+ const settingsArray: [string, any][] = JSON.parse(event.data);
+ const analyticsEnabled =
+ settingsArray.find(([key]) => key === "analyticsEnabled")?.[1] ??
+ false;
+ const userId =
+ settingsArray.find(([key]) => key === "user.clerk_id")?.[1] ??
+ undefined;
+ resolve({ analyticsEnabled, userId });
+ };
- settingsStream.onerror = (error) => {
- clearTimeout(timeout);
- settingsStream.close();
- reject(error);
- };
- }
- );
+ settingsStream.onerror = (error) => {
+ clearTimeout(timeout);
+ settingsStream.close();
+ reject(error);
+ };
+ });
- this.analyticsEnabled = settings.analyticsEnabled;
+ if (settings.analyticsEnabled && settings.userId) {
+ await identifyUser(settings.userId, this.userProperties);
+ }
+ return {
+ analyticsEnabled: settings.analyticsEnabled,
+ userId: settings.userId,
+ };
} catch (error) {
console.error(
"failed to fetch settings, defaulting to analytics enabled:",
error
);
- this.analyticsEnabled = false; // Default to false if fetch fails
- }
-
- if (this.analyticsEnabled) {
- await identifyUser(this.userId, this.userProperties);
- this.analyticsInitialized = true;
+ return {
+ analyticsEnabled: false,
+ userId: undefined,
+ };
}
}
@@ -141,6 +152,7 @@ class BrowserPipeImpl implements BrowserPipe {
async queryScreenpipe(
params: ScreenpipeQueryParams
): Promise<ScreenpipeResponse | null> {
+ console.log("queryScreenpipe:", params);
await this.initAnalyticsIfNeeded();
const queryParams = new URLSearchParams();
Object.entries(params).forEach(([key, value]) => {
@@ -300,8 +312,8 @@ class BrowserPipeImpl implements BrowserPipe {
eventName: string,
properties?: Record<string, any>
) {
- if (!this.analyticsEnabled) return;
- await this.initAnalyticsIfNeeded();
+ const { analyticsEnabled } = await this.initAnalyticsIfNeeded();
+ if (!analyticsEnabled) return;
return captureEvent(eventName, properties);
}
@@ -309,8 +321,8 @@ class BrowserPipeImpl implements BrowserPipe {
featureName: string,
properties?: Record<string, any>
) {
- if (!this.analyticsEnabled) return;
- await this.initAnalyticsIfNeeded();
+ const { analyticsEnabled } = await this.initAnalyticsIfNeeded();
+ if (!analyticsEnabled) return;
return captureMainFeatureEvent(featureName, properties);
}
}
diff --git a/screenpipe-js/node-sdk/package.json b/screenpipe-js/node-sdk/package.json
index fd62f6546..9087b7c5c 100644
--- a/screenpipe-js/node-sdk/package.json
+++ b/screenpipe-js/node-sdk/package.json
@@ -1,6 +1,6 @@
{
"name": "@screenpipe/js",
- "version": "1.0.6",
+ "version": "1.0.7",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
diff --git a/screenpipe-js/node-sdk/src/SettingsManager.ts b/screenpipe-js/node-sdk/src/SettingsManager.ts
index 09886c536..215e1900e 100644
--- a/screenpipe-js/node-sdk/src/SettingsManager.ts
+++ b/screenpipe-js/node-sdk/src/SettingsManager.ts
@@ -1,36 +1,14 @@
import fs from "fs/promises";
import path from "path";
import os from "os";
-import { flattenObject, unflattenObject } from "../../common/utils";
+import {
+ flattenObject,
+ getDefaultSettings,
+ unflattenObject,
+} from "../../common/utils";
import type { Settings } from "../../common/types";
-const DEFAULT_SETTINGS: Settings = {
- openaiApiKey: "",
- deepgramApiKey: "",
- aiModel: "gpt-4",
- aiUrl: "https://api.openai.com/v1",
- customPrompt: `Rules:
- - You can analyze/view/show/access videos to the user by putting .mp4 files in a code block (we'll render it) like this: \`/users/video.mp4\`, use the exact, absolute, file path from file_path property
- - Do not try to embed video in links (e.g. [](.mp4) or https://.mp4) instead put the file_path in a code block using backticks
- - Do not put video in multiline code block it will not render the video (e.g. \`\`\`bash\n.mp4\`\`\` IS WRONG) instead using inline code block with single backtick
- - Always answer my question/intent, do not make up things`,
- port: 3030,
- dataDir: "default",
- disableAudio: false,
- ignoredWindows: [],
- includedWindows: [],
- aiProviderType: "openai",
- embeddedLLM: {
- enabled: false,
- model: "llama3.2:1b-instruct-q4_K_M",
- port: 11438,
- },
- enableFrameCache: true,
- enableUiMonitoring: false,
- aiMaxContextChars: 512000,
- user: {},
- analyticsEnabled: true,
-};
+const DEFAULT_SETTINGS = getDefaultSettings();
export class SettingsManager {
private settings: Settings;
@@ -92,7 +70,7 @@ export class SettingsManager {
}
async init(): Promise<void> {
- if (this.initialized) return;
+ // if (this.initialized) return;
if (!fs || !path) throw new Error("failed to load required modules");