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

improve meeting page etc

Louis Beaumont5fb8d46656e8
diff --git a/pipes/meeting/bun.lockb b/pipes/meeting/bun.lockb
index 70c47b35c..1961302e4 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 2fc510f68..9604db65f 100644
--- a/pipes/meeting/package.json
+++ b/pipes/meeting/package.json
@@ -20,10 +20,10 @@
"@radix-ui/react-slider": "^1.2.2",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-switch": "^1.1.2",
- "@radix-ui/react-toast": "^1.2.3",
+ "@radix-ui/react-toast": "^1.2.4",
"@radix-ui/react-tooltip": "^1.1.5",
+ "@screenpipe/browser": "0.1.21",
"@screenpipe/js": "1.0.5",
- "@screenpipe/browser": "0.1.17",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@types/js-levenshtein": "^1.1.3",
@@ -42,6 +42,7 @@
"lucide-react": "^0.468.0",
"magic-ui": "^0.1.0",
"next": "15.1.0",
+ "novel": "^1.0.2",
"npm": "^10.9.2",
"openai": "^4.76.3",
"react": "^19.0.0",
diff --git a/pipes/meeting/src/app/layout.tsx b/pipes/meeting/src/app/layout.tsx
index 140191d39..74973ed87 100644
--- a/pipes/meeting/src/app/layout.tsx
+++ b/pipes/meeting/src/app/layout.tsx
@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
+import { Toaster } from "@/components/ui/toaster";
const geistSans = Geist({
variable: "--font-geist-sans",
@@ -12,7 +13,6 @@ const geistMono = Geist_Mono({
subsets: ["latin"],
});
-
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
@@ -28,7 +28,8 @@ export default function RootLayout({
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
- {children}
+ <main>{children}</main>
+ <Toaster />
</body>
</html>
);
diff --git a/pipes/meeting/src/app/page.tsx b/pipes/meeting/src/app/page.tsx
index 5396cc0df..b9551be5f 100644
--- a/pipes/meeting/src/app/page.tsx
+++ b/pipes/meeting/src/app/page.tsx
@@ -4,11 +4,8 @@ import MeetingHistory from "@/components/meeting-history";
import { useState } from "react";
export default function MeetingsPage() {
- const [showMeetingHistory, setShowMeetingHistory] = useState(true);
return (
<MeetingHistory
- showMeetingHistory={true}
- setShowMeetingHistory={setShowMeetingHistory}
/>
);
}
diff --git a/pipes/meeting/src/components/meeting-history.tsx b/pipes/meeting/src/components/meeting-history.tsx
index 28f576dbe..361078c2d 100644
--- a/pipes/meeting/src/components/meeting-history.tsx
+++ b/pipes/meeting/src/components/meeting-history.tsx
@@ -5,7 +5,6 @@ import { Button } from "@/components/ui/button";
import { OpenAI } from "openai";
import { useSettings } from "@/lib/hooks/use-settings";
-import { useToast } from "./ui/use-toast";
import ReactMarkdown from "react-markdown";
import {
X,
@@ -28,7 +27,7 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Input } from "./ui/input";
-import { cn, keysToCamelCase } from "@/lib/utils";
+import { keysToCamelCase } from "@/lib/utils";
import {
Card,
CardContent,
@@ -44,6 +43,12 @@ import {
PopoverTrigger,
} from "@/components/ui/popover";
import { Textarea } from "./ui/textarea";
+import { useToast } from "@/hooks/use-toast";
+import { Color } from "@tiptap/extension-color";
+import ListItem from "@tiptap/extension-list-item";
+import TextStyle from "@tiptap/extension-text-style";
+import { EditorProvider } from "@tiptap/react";
+import StarterKit from "@tiptap/starter-kit";
function formatDate(date: string): string {
const dateObj = new Date(date);
@@ -62,7 +67,11 @@ function formatDate(date: string): string {
async function setItem(key: string, value: any): Promise<void> {
try {
if (typeof window !== "undefined") {
+ console.log("storing to localforage:", key, value);
await localforage.setItem(key, value);
+ // Verify the save worked
+ const saved = await localforage.getItem(key);
+ console.log("verified save:", key, saved);
}
} catch (error) {
console.error("error setting item in storage:", error);
@@ -102,7 +111,6 @@ interface Meeting {
selectedDevices: Set<string>;
deviceNames: Set<string>;
segments: MeetingSegment[];
- isEditing?: boolean;
}
interface Speaker {
@@ -133,21 +141,27 @@ interface LiveMeeting {
transcription: string;
}
-export default function MeetingHistory({
- showMeetingHistory,
- setShowMeetingHistory,
- className,
-}: {
- showMeetingHistory: boolean;
- setShowMeetingHistory: (show: boolean) => void;
- className?: string;
-}) {
+const extensions = [
+ Color.configure({ types: [TextStyle.name, ListItem.name] }),
+ // TextStyle.configure({ types: [ListItem.name] }),
+ StarterKit.configure({
+ bulletList: {
+ keepMarks: true,
+ keepAttributes: false,
+ },
+ orderedList: {
+ keepMarks: true,
+ keepAttributes: false,
+ },
+ }),
+];
+
+export default function MeetingHistory() {
const { settings } = useSettings();
const [meetings, setMeetings] = useState<Meeting[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
const [isSummarizing, setIsSummarizing] = useState(false);
- const [isIdentifying, setIsIdentifying] = useState(false);
const { toast } = useToast();
const [showError, setShowError] = useState(false);
const { copyToClipboard } = useCopyToClipboard({ timeout: 2000 });
@@ -158,31 +172,53 @@ export default function MeetingHistory({
const [isClearing, setIsClearing] = useState(false);
const [liveMeeting, setLiveMeeting] = useState<LiveMeeting | null>(null);
const [isStartingRecording, setIsStartingRecording] = useState(false);
- const [editedTranscriptions, setEditedTranscriptions] = useState<{
- [key: number]: string;
- }>({});
+ const [isStreamingAvailable, setIsStreamingAvailable] =
+ useState<boolean>(false);
useEffect(() => {
- if (showMeetingHistory) {
- loadMeetings();
- }
- }, [showMeetingHistory]);
+ loadMeetings();
+ }, []);
useEffect(() => {
setShowError(!!error);
}, [error]);
useEffect(() => {
- console.log("Dialog state changed:", showMeetingHistory);
- }, [showMeetingHistory]);
+ const checkStreamingAvailability = async () => {
+ try {
+ const response = await fetch(
+ "http://localhost:3030/sse/transcriptions",
+ {
+ method: "HEAD",
+ }
+ );
+ setIsStreamingAvailable(response.ok);
+ } catch (error) {
+ setIsStreamingAvailable(false);
+ }
+ };
+
+ // Initial check
+ checkStreamingAvailability();
+
+ // Poll every 5 seconds
+ const interval = setInterval(checkStreamingAvailability, 5000);
+
+ return () => clearInterval(interval);
+ }, []);
async function loadMeetings() {
setLoading(true);
try {
- const storedMeetings = (await getItem("meetings")) || [];
- setMeetings(storedMeetings);
+ console.log("loading meetings from storage");
+ const storedMeetings = await getItem("meetings");
+ console.log("loaded meetings:", storedMeetings);
+ if (storedMeetings) {
+ setMeetings(storedMeetings);
+ }
await fetchMeetings();
} catch (err) {
+ console.error("failed to load meetings:", err);
setError("failed to load meetings");
} finally {
setLoading(false);
@@ -226,8 +262,27 @@ export default function MeetingHistory({
const newMeetings = processMeetings(camelCaseResult.data);
console.log("processed new meetings:", newMeetings);
- // Combine live recordings with fetched meetings
- const updatedMeetings = [...liveRecordings, ...newMeetings];
+ // Merge new meetings with stored meetings, preserving edited content
+ const mergedMeetings = newMeetings.map((newMeeting) => {
+ const existingMeeting = uniqueMeetings.find(
+ (m) => m.meetingGroup === newMeeting.meetingGroup
+ );
+ // If meeting exists and has edited content, preserve it
+ if (existingMeeting) {
+ return {
+ ...newMeeting,
+ segments: existingMeeting.segments,
+ fullTranscription: existingMeeting.fullTranscription,
+ summary: existingMeeting.summary,
+ name: existingMeeting.name,
+ participants: existingMeeting.participants,
+ };
+ }
+ return newMeeting;
+ });
+
+ // Combine live recordings with merged meetings
+ const updatedMeetings = [...liveRecordings, ...mergedMeetings];
// Sort meetings by start time (descending)
updatedMeetings.sort(
@@ -622,21 +677,43 @@ export default function MeetingHistory({
});
// Start streaming transcriptions
- for await (const chunk of pipe.streamTranscriptions()) {
- console.log("chunk", chunk);
- setLiveMeeting((prev) => {
- if (!prev) return null;
- return {
- ...prev,
- transcription: prev.transcription + (chunk.choices[0]?.text || ""),
- };
+ try {
+ for await (const chunk of pipe.streamTranscriptions()) {
+ console.log("chunk", chunk);
+ setLiveMeeting((prev) => {
+ if (!prev) return null;
+ return {
+ ...prev,
+ transcription:
+ prev.transcription + (chunk.choices[0]?.text || ""),
+ };
+ });
+ }
+ } catch (error: any) {
+ // Handle specific error cases
+ let errorMessage = "failed to start recording. ";
+
+ if (error?.message?.includes("403") || error?.status === 403) {
+ errorMessage +=
+ "please enable real-time transcription in your backend settings.";
+ } else {
+ errorMessage += "please check your connection and try again.";
+ }
+
+ setLiveMeeting(null);
+ toast({
+ title: "error",
+ description: errorMessage,
+ variant: "destructive",
});
}
} catch (error) {
console.error("error starting recording:", error);
+ setLiveMeeting(null);
toast({
title: "error",
- description: "failed to start recording. please try again.",
+ description:
+ "unexpected error occurred while recording. please try again.",
variant: "destructive",
});
} finally {
@@ -694,52 +771,35 @@ export default function MeetingHistory({
}
};
- const startEditing = (meetingGroup: number) => {
- setMeetings(
- meetings.map((m) =>
- m.meetingGroup === meetingGroup ? { ...m, isEditing: true } : m
- )
- );
-
- const meeting = meetings.find((m) => m.meetingGroup === meetingGroup);
- if (meeting) {
- setEditedTranscriptions({
- ...editedTranscriptions,
- [meetingGroup]: meeting.segments
- .filter((s) => meeting.selectedDevices.has(s.deviceName))
- .map((s) => s.transcription)
- .join("\n"),
- });
- }
- };
-
- const saveEdits = async (meetingGroup: number) => {
- const meeting = meetings.find((m) => m.meetingGroup === meetingGroup);
- if (!meeting) return;
-
- const updatedMeetings = meetings.map((m) =>
- m.meetingGroup === meetingGroup
- ? {
- ...m,
- isEditing: false,
- segments: [
- {
- ...m.segments[0], // Keep original metadata
- transcription: editedTranscriptions[meetingGroup],
- },
- ],
- }
- : m
- );
-
- setMeetings(updatedMeetings);
- await setItem("meetings", updatedMeetings);
-
- toast({
- title: "changes saved",
- description: "your edits have been saved successfully.",
- });
- };
+ const recordingButton = (
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <div>
+ <Button
+ onClick={startRecording}
+ disabled={isStartingRecording || !isStreamingAvailable}
+ variant="outline"
+ size="sm"
+ className="ml-4"
+ >
+ {isStartingRecording ? (
+ <RefreshCw className="h-4 w-4 mr-2 animate-spin" />
+ ) : (
+ <FileText className="h-4 w-4 mr-2" />
+ )}
+ start recording
+ </Button>
+ </div>
+ </TooltipTrigger>
+ {!isStreamingAvailable && (
+ <TooltipContent>
+ <p>streaming service not available</p>
+ </TooltipContent>
+ )}
+ </Tooltip>
+ </TooltipProvider>
+ );
return (
<Card>
@@ -756,20 +816,7 @@ export default function MeetingHistory({
meeting and conversation history
</h2>
{!liveMeeting ? (
- <Button
- onClick={startRecording}
- disabled={isStartingRecording}
- variant="outline"
- size="sm"
- className="ml-4"
- >
- {isStartingRecording ? (
- <RefreshCw className="h-4 w-4 mr-2 animate-spin" />
- ) : (
- <FileText className="h-4 w-4 mr-2" />
- )}
- start recording
- </Button>
+ recordingButton
) : (
<div className="flex items-center gap-2">
<Popover>
@@ -958,17 +1005,103 @@ export default function MeetingHistory({
<div className="mb-4 relative">
<h4 className="font-semibold mb-2">transcription:</h4>
<div className="flex gap-2 absolute top-0 right-0">
- {!meeting.isEditing ? (
- <>
- <Button
- onClick={() =>
- copyWithToast(
- meeting.segments
- .filter((s) =>
- meeting.selectedDevices.has(
- s.deviceName
- )
- )
+ <Button
+ onClick={() =>
+ copyWithToast(
+ meeting.segments
+ .filter((s) =>
+ meeting.selectedDevices.has(s.deviceName)
+ )
+ .map(
+ (s) =>
+ `${formatTimestamp(s.timestamp)} [${
+ s.speaker
+ ? s.speaker.name
+ : s.deviceType?.toLowerCase() ===
+ "input"
+ ? "you"
+ : "others"
+ }] ${s.transcription}`
+ )
+ .join("\n"),
+ "transcription"
+ )
+ }
+ className="p-1 h-6 w-6"
+ variant="outline"
+ size="icon"
+ >
+ <Copy className="h-4 w-4" />
+ </Button>
+ </div>
+ <EditorProvider
+ extensions={extensions}
+ content={meeting.segments
+ .filter((s) =>
+ meeting.selectedDevices.has(s.deviceName)
+ )
+ .map(
+ (s) =>
+ `<p><span class="select-none text-gray-500"><strong>${formatTimestamp(
+ s.timestamp
+ )} [${
+ s.speaker
+ ? s.speaker.name
+ : s.deviceType?.toLowerCase() === "input"
+ ? "you"
+ : "others"
+ }]</strong></span> ${s.transcription}</p>`
+ )
+ .join("")}
+ onUpdate={({ editor }) => {
+ console.log("editor update triggered");
+ const content = editor.getHTML();
+
+ // Parse the HTML content to extract timestamps and transcriptions
+ const parser = new DOMParser();
+ const doc = parser.parseFromString(
+ content,
+ "text/html"
+ );
+ const paragraphs = doc.querySelectorAll("p");
+
+ // Update segments with new transcriptions while preserving timestamps and speakers
+ const updatedSegments = meeting.segments.map(
+ (segment, index) => {
+ if (
+ index < paragraphs.length &&
+ meeting.selectedDevices.has(
+ segment.deviceName
+ )
+ ) {
+ const paragraph = paragraphs[index];
+ // Extract everything after the timestamp and speaker info
+ const text = paragraph.textContent || "";
+ const timestampMatch =
+ text.match(/\[(.*?)\]/);
+ if (timestampMatch) {
+ const transcription = text
+ .substring(text.indexOf("]") + 1)
+ .trim();
+ return {
+ ...segment,
+ transcription,
+ };
+ }
+ }
+ return segment;
+ }
+ );
+
+ console.log("updated segments:", updatedSegments);
+
+ // Update meetings state with new content
+ const updatedMeetings = meetings.map((m) =>
+ m.meetingGroup === meeting.meetingGroup
+ ? {
+ ...m,
+ segments: updatedSegments,
+ fullTranscription: updatedSegments
.map(
(s) =>
`${formatTimestamp(s.timestamp)} [${
@@ -981,79 +1114,36 @@ export default function MeetingHistory({
}] ${s.transcription}`
)
.join("\n"),
- "transcription"
- )
- }
- className="p-1 h-6 w-6"
- variant="outline"
- size="icon"
- >
- <Copy className="h-4 w-4" />
- </Button>
- <Button
- onClick={() =>
- startEditing(meeting.meetingGroup)
- }
- className="p-1 h-6 w-6"
- variant="outline"
- size="icon"
- >
- <Pencil className="h-4 w-4" />
- </Button>
- </>
- ) : (
- <Button
- onClick={() => saveEdits(meeting.meetingGroup)}
- className="p-1 h-6 w-6"
- variant="outline"
- size="icon"
- >
- <Save className="h-4 w-4" />
- </Button>
- )}
- </div>
- {!meeting.isEditing ? (
- <pre className="whitespace-pre-wrap bg-gray-100 p-3 rounded text-sm max-h-40 overflow-y-auto">
- {meeting.segments
- .filter((s) =>
- meeting.selectedDevices.has(s.deviceName)
- )
- .sort(
- (a, b) =>
- new Date(a.timestamp).getTime() -
- new Date(b.timestamp).getTime()
- )
- .map((s, i) => (
- <React.Fragment key={i}>
- <span className="font-bold">
- {`${formatTimestamp(s.timestamp)} [${
- s.speaker
- ? s.speaker.name
- : s.deviceType?.toLowerCase() ===
- "input"
- ? "you"
- : "others"
- }]`}
- </span>{" "}
- {s.transcription}
- {"\n"}
- </React.Fragment>
- ))}
- </pre>
- ) : (
- <Textarea
- value={
- editedTranscriptions[meeting.meetingGroup] || ""
- }
- onChange={(e) =>
- setEditedTranscriptions({
- ...editedTranscriptions,
- [meeting.meetingGroup]: e.target.value,
- })
- }
- className="min-h-[10rem] font-mono text-sm"
- />
- )}
+ }
+ : m
+ );
+
+ console.log(
+ "saving updated meetings:",
+ updatedMeetings
+ );
+
+ // Use Promise to ensure storage completes
+ (async () => {
+ try {
+ await setItem("meetings", updatedMeetings);
+ setMeetings(updatedMeetings);
+ console.log("save completed successfully");
+ } catch (err) {
+ console.error(
+ "failed to save meetings:",
+ err
+ );
+ }
+ })();
+ }}
+ editorProps={{
+ attributes: {
+ class:
+ "prose-sm p-3 rounded min-h-[10rem] max-h-[30rem] overflow-y-auto whitespace-pre-wrap break-words border shadow-sm",
+ },
+ }}
+ />
</div>
<div className="relative">
<h4 className="font-semibold mb-2">summary:</h4>
@@ -1102,19 +1192,6 @@ export default function MeetingHistory({
</div>
</CardContent>
</Card>
- {index < sortedMeetings.length - 1 && (
- <div className="flex justify-center my-2">
- <Button
- onClick={() => mergeMeetings(index)}
- size="sm"
- variant="outline"
- className="text-xs"
- >
- <ChevronDown className="h-4 w-4 mr-2" />
- merge with next meeting
- </Button>
- </div>
- )}
</React.Fragment>
))}
</div>
diff --git a/pipes/meeting/src/components/ui/toaster.tsx b/pipes/meeting/src/components/ui/toaster.tsx
index fe7103d70..171beb46d 100644
--- a/pipes/meeting/src/components/ui/toaster.tsx
+++ b/pipes/meeting/src/components/ui/toaster.tsx
@@ -1,6 +1,6 @@
"use client"
-import { useToast } from "@/components/ui/use-toast"
+import { useToast } from "@/hooks/use-toast"
import {
Toast,
ToastClose,
diff --git a/pipes/meeting/src/components/ui/use-toast.ts b/pipes/meeting/src/hooks/use-toast.ts
similarity index 100%
rename from pipes/meeting/src/components/ui/use-toast.ts
rename to pipes/meeting/src/hooks/use-toast.ts
diff --git a/pipes/meeting/src/lib/hooks/use-settings.tsx b/pipes/meeting/src/lib/hooks/use-settings.tsx
index 480cef458..046fa4db4 100644
--- a/pipes/meeting/src/lib/hooks/use-settings.tsx
+++ b/pipes/meeting/src/lib/hooks/use-settings.tsx
@@ -2,33 +2,10 @@
import { useState, useEffect } from "react";
import type { Settings } from "@screenpipe/browser";
+import { getDefaultSettings } from "@screenpipe/browser";
export function useSettings() {
- const defaultSettings: Settings = {
- openaiApiKey: "",
- deepgramApiKey: "",
- aiModel: "gpt-4",
- aiUrl: "https://api.openai.com/v1",
- customPrompt: "",
- 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: 128000,
- user: {
- token: "",
- },
- analyticsEnabled: true,
- };
+ const defaultSettings = getDefaultSettings();
const [settings, setSettings] = useState<Settings>(defaultSettings);
const [loading, setLoading] = useState(false);
diff --git a/screenpipe-app-tauri/components/cli-command-dialog.tsx b/screenpipe-app-tauri/components/cli-command-dialog.tsx
index 767dddc4c..04b0c2bd9 100644
--- a/screenpipe-app-tauri/components/cli-command-dialog.tsx
+++ b/screenpipe-app-tauri/components/cli-command-dialog.tsx
@@ -29,7 +29,10 @@ export function CliCommandDialog({ settings }: CliCommandDialogProps) {
let args = [];
let envVars = [];
- if (settings.user?.credits && !settings.audioTranscriptionEngine.includes("whisper")) {
+ if (
+ settings.user?.credits &&
+ !settings.audioTranscriptionEngine.includes("whisper")
+ ) {
envVars.push(
'DEEPGRAM_API_URL="https://ai-proxy.i-f9f.workers.dev/v1/listen"'
);
@@ -112,10 +115,6 @@ export function CliCommandDialog({ settings }: CliCommandDialogProps) {
if (settings.enableRealtimeAudioTranscription) {
args.push("--enable-realtime-audio-transcription");
- args.push("--realtime-audio-transcription-engine");
- args.push(
- settings.realtimeAudioTranscriptionEngine || "whisper-large-v3-turbo"
- );
}
const envString = envVars.length > 0 ? `${envVars.join(" ")} ` : "";
diff --git a/screenpipe-app-tauri/src-tauri/src/sidecar.rs b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
index f98e3c493..727b27da4 100644
--- a/screenpipe-app-tauri/src-tauri/src/sidecar.rs
+++ b/screenpipe-app-tauri/src-tauri/src/sidecar.rs
@@ -374,8 +374,6 @@ fn spawn_sidecar(app: &tauri::AppHandle) -> Result<CommandChild, String> {
if enable_realtime_audio_transcription {
args.push("--enable-realtime-audio-transcription");
- args.push("--realtime-audio-transcription-engine");
- args.push(realtime_audio_transcription_engine.as_str());
}
let disable_vision = store
diff --git a/screenpipe-js/browser-sdk/package.json b/screenpipe-js/browser-sdk/package.json
index 941b5c4f5..30a8cd2c1 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.18-beta.0",
+ "version": "0.1.21",
"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 cbe479312..fa3c564eb 100644
--- a/screenpipe-js/browser-sdk/src/index.ts
+++ b/screenpipe-js/browser-sdk/src/index.ts
@@ -288,3 +288,4 @@ const pipeImpl = new BrowserPipeImpl();
export const pipe = pipeImpl;
export * from "../../common/types";
+export { getDefaultSettings } from "../../common/utils";
diff --git a/screenpipe-js/common/types.ts b/screenpipe-js/common/types.ts
index 1b5635106..58b779933 100644
--- a/screenpipe-js/common/types.ts
+++ b/screenpipe-js/common/types.ts
@@ -211,6 +211,12 @@ export interface Settings {
analyticsEnabled: boolean;
user: User;
customSettings?: Record<string, any>;
+ monitorIds: string[];
+ audioDevices: string[];
+ audioTranscriptionEngine: string;
+ enableRealtimeAudioTranscription: boolean;
+ realtimeAudioTranscriptionEngine: string;
+ disableVision: boolean;
}
/**
diff --git a/screenpipe-js/common/utils.ts b/screenpipe-js/common/utils.ts
index 06e5ebee3..b996bb387 100644
--- a/screenpipe-js/common/utils.ts
+++ b/screenpipe-js/common/utils.ts
@@ -1,3 +1,5 @@
+import type { Settings } from "./types";
+
// Helper functions to flatten/unflatten objects
const flattenObject = (obj: any, prefix = ""): Record<string, any> => {
return Object.keys(obj).reduce((acc: Record<string, any>, k: string) => {
@@ -56,10 +58,52 @@ function convertToCamelCase(obj: any): any {
return obj;
}
+function getDefaultSettings(): Settings {
+ return {
+ openaiApiKey: "",
+ deepgramApiKey: "",
+ aiModel: "gpt-4o",
+ 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: 11434,
+ },
+ enableFrameCache: true,
+ enableUiMonitoring: false,
+ aiMaxContextChars: 512000,
+ analyticsEnabled: true,
+ user: {
+ token: "",
+ },
+ customSettings: {},
+ monitorIds: ["default"],
+ audioDevices: ["default"],
+ audioTranscriptionEngine: "whisper-large-v3-turbo",
+ enableRealtimeAudioTranscription: false,
+ realtimeAudioTranscriptionEngine: "deepgram",
+ disableVision: false,
+ };
+}
+
export {
flattenObject,
unflattenObject,
toCamelCase,
toSnakeCase,
convertToCamelCase,
+ getDefaultSettings,
};