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: move meeting and speaker page to store

Louis Beaumont33e59acf5d3e
diff --git a/pipes/identify-speakers/.gitignore b/pipes/identify-speakers/.gitignore
new file mode 100644
index 000000000..5ef6a5207
--- /dev/null
+++ b/pipes/identify-speakers/.gitignore
@@ -0,0 +1,41 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.*
+.yarn/*
+!.yarn/patches
+!.yarn/plugins
+!.yarn/releases
+!.yarn/versions
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+.pnpm-debug.log*
+
+# env files (can opt-in for committing if needed)
+.env*
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
diff --git a/pipes/identify-speakers/README.md b/pipes/identify-speakers/README.md
new file mode 100644
index 000000000..bfb02e189
--- /dev/null
+++ b/pipes/identify-speakers/README.md
@@ -0,0 +1,22 @@
+
+search, review, summarize, get specific answer to specific questions over your life digital context
+
+audio
+
+<img width="1142" alt="Screenshot 2024-12-16 at 12 39 18 PM" src="https://github.com/user-attachments/assets/05b48d11-7c89-4f88-afba-76da91691f61" />
+<img width="1142" alt="Screenshot 2024-12-16 at 12 39 52 PM" src="https://github.com/user-attachments/assets/3f6eb8fe-1bde-42cd-8f84-0b8e597431d2" />
+
+keyword filtering
+
+<img width="1142" alt="Screenshot 2024-12-16 at 12 40 52 PM" src="https://github.com/user-attachments/assets/5eae6be7-db50-4ae3-990a-4cb2c934843f" />
+
+window/app filtering
+
+<img width="1142" alt="Screenshot 2024-12-16 at 12 41 14 PM" src="https://github.com/user-attachments/assets/d799a1da-4b22-4956-b917-f8bdf90187a4" />
+
+speaker fitlering (we identify people you speak to 24/7)
+
+<img width="1170" alt="Screenshot 2024-12-16 at 12 48 02 PM" src="https://github.com/user-attachments/assets/dc2f13e0-8745-40a5-be8d-5b34dfa97493" />
+
+
+etc.
diff --git a/pipes/identify-speakers/bun.lockb b/pipes/identify-speakers/bun.lockb
new file mode 100755
index 000000000..ab47763d5
Binary files /dev/null and b/pipes/identify-speakers/bun.lockb differ
diff --git a/pipes/identify-speakers/components.json b/pipes/identify-speakers/components.json
new file mode 100644
index 000000000..d710b4962
--- /dev/null
+++ b/pipes/identify-speakers/components.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "default",
+ "rsc": true,
+ "tsx": true,
+ "tailwind": {
+ "config": "tailwind.config.ts",
+ "css": "src/app/globals.css",
+ "baseColor": "neutral",
+ "cssVariables": true,
+ "prefix": ""
+ },
+ "aliases": {
+ "components": "@/components",
+ "utils": "@/lib/utils",
+ "ui": "@/components/ui",
+ "lib": "@/lib",
+ "hooks": "@/hooks"
+ },
+ "iconLibrary": "lucide"
+}
\ No newline at end of file
diff --git a/pipes/identify-speakers/eslint.config.mjs b/pipes/identify-speakers/eslint.config.mjs
new file mode 100644
index 000000000..c85fb67c4
--- /dev/null
+++ b/pipes/identify-speakers/eslint.config.mjs
@@ -0,0 +1,16 @@
+import { dirname } from "path";
+import { fileURLToPath } from "url";
+import { FlatCompat } from "@eslint/eslintrc";
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = dirname(__filename);
+
+const compat = new FlatCompat({
+ baseDirectory: __dirname,
+});
+
+const eslintConfig = [
+ ...compat.extends("next/core-web-vitals", "next/typescript"),
+];
+
+export default eslintConfig;
diff --git a/pipes/identify-speakers/next.config.ts b/pipes/identify-speakers/next.config.ts
new file mode 100644
index 000000000..b3978a6a4
--- /dev/null
+++ b/pipes/identify-speakers/next.config.ts
@@ -0,0 +1,16 @@
+import type { NextConfig } from "next";
+
+const nextConfig: NextConfig = {
+ transpilePackages: ["@screenpipe/js"],
+ webpack: (config, { isServer }) => {
+ config.resolve.alias = {
+ ...config.resolve.alias,
+ "@screenpipe/js": isServer
+ ? "@screenpipe/js/dist/node.js"
+ : "@screenpipe/js/dist/browser.js",
+ };
+ return config;
+ },
+};
+
+export default nextConfig;
diff --git a/pipes/identify-speakers/package.json b/pipes/identify-speakers/package.json
new file mode 100644
index 000000000..854e95464
--- /dev/null
+++ b/pipes/identify-speakers/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "search",
+ "version": "0.1.0",
+ "private": true,
+ "scripts": {
+ "dev": "next dev --turbopack",
+ "build": "next build",
+ "start": "next start",
+ "lint": "next lint"
+ },
+ "dependencies": {
+ "@radix-ui/react-accordion": "^1.2.2",
+ "@radix-ui/react-checkbox": "^1.1.3",
+ "@radix-ui/react-dialog": "^1.1.3",
+ "@radix-ui/react-label": "^2.1.1",
+ "@radix-ui/react-popover": "^1.1.3",
+ "@radix-ui/react-progress": "^1.1.1",
+ "@radix-ui/react-select": "^2.1.3",
+ "@radix-ui/react-separator": "^1.1.1",
+ "@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-tooltip": "^1.1.5",
+ "@screenpipe/js": "0.1.10-beta.20",
+ "@shadcn/ui": "^0.0.4",
+ "@tanstack/react-query": "^5.62.7",
+ "@types/js-levenshtein": "^1.1.3",
+ "@types/lodash": "^4.17.13",
+ "@types/react-syntax-highlighter": "^15.5.13",
+ "ai": "^4.0.18",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "cmdk": "1.0.0",
+ "date-fns": "^4.1.0",
+ "framer-motion": "^11.14.4",
+ "install": "^0.13.0",
+ "js-levenshtein": "^1.1.6",
+ "localforage": "^1.10.0",
+ "lodash": "^4.17.21",
+ "lucide-react": "^0.468.0",
+ "magic-ui": "^0.1.0",
+ "next": "15.1.0",
+ "npm": "^10.9.2",
+ "openai": "^4.76.3",
+ "react": "^19.0.0",
+ "react-day-picker": "8.10.1",
+ "react-dom": "^19.0.0",
+ "react-markdown": "^9.0.1",
+ "react-syntax-highlighter": "^15.6.1",
+ "remark-gfm": "^4.0.0",
+ "remark-math": "^6.0.0",
+ "tailwind-merge": "^2.5.5",
+ "tailwindcss-animate": "^1.0.7"
+ },
+ "devDependencies": {
+ "@eslint/eslintrc": "^3",
+ "@types/node": "^22.10.2",
+ "@types/react": "^19",
+ "@types/react-dom": "^19",
+ "autoprefixer": "^10.4.20",
+ "eslint": "^9",
+ "eslint-config-next": "15.1.0",
+ "postcss": "^8.4.49",
+ "tailwindcss": "^3.4.16",
+ "typescript": "^5"
+ }
+}
diff --git a/pipes/identify-speakers/postcss.config.mjs b/pipes/identify-speakers/postcss.config.mjs
new file mode 100644
index 000000000..1a69fd2a4
--- /dev/null
+++ b/pipes/identify-speakers/postcss.config.mjs
@@ -0,0 +1,8 @@
+/** @type {import('postcss-load-config').Config} */
+const config = {
+ plugins: {
+ tailwindcss: {},
+ },
+};
+
+export default config;
diff --git a/pipes/identify-speakers/public/file.svg b/pipes/identify-speakers/public/file.svg
new file mode 100644
index 000000000..004145cdd
--- /dev/null
+++ b/pipes/identify-speakers/public/file.svg
@@ -0,0 +1 @@
+<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
\ No newline at end of file
diff --git a/pipes/identify-speakers/public/globe.svg b/pipes/identify-speakers/public/globe.svg
new file mode 100644
index 000000000..567f17b0d
--- /dev/null
+++ b/pipes/identify-speakers/public/globe.svg
@@ -0,0 +1 @@
+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
\ No newline at end of file
diff --git a/pipes/identify-speakers/public/next.svg b/pipes/identify-speakers/public/next.svg
new file mode 100644
index 000000000..5174b28c5
--- /dev/null
+++ b/pipes/identify-speakers/public/next.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7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.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
\ No newline at end of file
diff --git a/pipes/identify-speakers/public/vercel.svg b/pipes/identify-speakers/public/vercel.svg
new file mode 100644
index 000000000..770539603
--- /dev/null
+++ b/pipes/identify-speakers/public/vercel.svg
@@ -0,0 +1 @@
+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file
diff --git a/pipes/identify-speakers/public/window.svg b/pipes/identify-speakers/public/window.svg
new file mode 100644
index 000000000..b2b2a44f6
--- /dev/null
+++ b/pipes/identify-speakers/public/window.svg
@@ -0,0 +1 @@
+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
\ No newline at end of file
diff --git a/pipes/identify-speakers/src/app/api/settings/route.ts b/pipes/identify-speakers/src/app/api/settings/route.ts
new file mode 100644
index 000000000..e26c10393
--- /dev/null
+++ b/pipes/identify-speakers/src/app/api/settings/route.ts
@@ -0,0 +1,84 @@
+// app/api/settings/route.ts
+import { pipe } from "@screenpipe/js";
+import { NextResponse } from "next/server";
+import type { Settings } from "@screenpipe/js";
+// Force Node.js runtime
+export const runtime = "nodejs"; // Add this line
+export const dynamic = 'force-dynamic'
+
+export async function GET() {
+ 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: "",
+ },
+ };
+
+ try {
+ const settingsManager = pipe.settings;
+ if (!settingsManager) {
+ throw new Error("settingsManager not found");
+ }
+ const rawSettings = await settingsManager.getAll();
+ console.log("rawSettings", rawSettings);
+ return NextResponse.json(rawSettings);
+ } catch (error) {
+ console.error("failed to get settings:", error);
+ return NextResponse.json(defaultSettings);
+ }
+}
+
+export async function PUT(request: Request) {
+ try {
+ const settingsManager = pipe.settings;
+ if (!settingsManager) {
+ throw new Error("settingsManager not found");
+ }
+
+ const body = await request.json();
+ const { key, value, isPartialUpdate, reset } = body;
+
+ if (reset) {
+ if (key) {
+ await settingsManager.resetKey(key);
+ } else {
+ await settingsManager.reset();
+ }
+ return NextResponse.json({ success: true });
+ }
+
+ if (isPartialUpdate) {
+ const serializedSettings = JSON.parse(JSON.stringify(value));
+ await settingsManager.update(serializedSettings);
+ } else {
+ const serializedValue = JSON.parse(JSON.stringify(value));
+ await settingsManager.set(key, serializedValue);
+ }
+
+ return NextResponse.json({ success: true });
+ } catch (error) {
+ console.error("failed to update settings:", error);
+ return NextResponse.json(
+ { error: "failed to update settings" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/pipes/identify-speakers/src/app/favicon.ico b/pipes/identify-speakers/src/app/favicon.ico
new file mode 100644
index 000000000..718d6fea4
Binary files /dev/null and b/pipes/identify-speakers/src/app/favicon.ico differ
diff --git a/pipes/identify-speakers/src/app/globals.css b/pipes/identify-speakers/src/app/globals.css
new file mode 100644
index 000000000..a23ac26b0
--- /dev/null
+++ b/pipes/identify-speakers/src/app/globals.css
@@ -0,0 +1,72 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+body {
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+@layer base {
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 0 0% 3.9%;
+ --card: 0 0% 100%;
+ --card-foreground: 0 0% 3.9%;
+ --popover: 0 0% 100%;
+ --popover-foreground: 0 0% 3.9%;
+ --primary: 0 0% 9%;
+ --primary-foreground: 0 0% 98%;
+ --secondary: 0 0% 96.1%;
+ --secondary-foreground: 0 0% 9%;
+ --muted: 0 0% 96.1%;
+ --muted-foreground: 0 0% 45.1%;
+ --accent: 0 0% 96.1%;
+ --accent-foreground: 0 0% 9%;
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 0 0% 89.8%;
+ --input: 0 0% 89.8%;
+ --ring: 0 0% 3.9%;
+ --chart-1: 12 76% 61%;
+ --chart-2: 173 58% 39%;
+ --chart-3: 197 37% 24%;
+ --chart-4: 43 74% 66%;
+ --chart-5: 27 87% 67%;
+ --radius: 0.5rem;
+ }
+ .dark {
+ --background: 0 0% 3.9%;
+ --foreground: 0 0% 98%;
+ --card: 0 0% 3.9%;
+ --card-foreground: 0 0% 98%;
+ --popover: 0 0% 3.9%;
+ --popover-foreground: 0 0% 98%;
+ --primary: 0 0% 98%;
+ --primary-foreground: 0 0% 9%;
+ --secondary: 0 0% 14.9%;
+ --secondary-foreground: 0 0% 98%;
+ --muted: 0 0% 14.9%;
+ --muted-foreground: 0 0% 63.9%;
+ --accent: 0 0% 14.9%;
+ --accent-foreground: 0 0% 98%;
+ --destructive: 0 62.8% 30.6%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 0 0% 14.9%;
+ --input: 0 0% 14.9%;
+ --ring: 0 0% 83.1%;
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ --chart-3: 30 80% 55%;
+ --chart-4: 280 65% 60%;
+ --chart-5: 340 75% 55%;
+ }
+}
+
+@layer base {
+ * {
+ @apply border-border;
+ }
+ body {
+ @apply bg-background text-foreground;
+ }
+}
diff --git a/pipes/identify-speakers/src/app/layout.tsx b/pipes/identify-speakers/src/app/layout.tsx
new file mode 100644
index 000000000..140191d39
--- /dev/null
+++ b/pipes/identify-speakers/src/app/layout.tsx
@@ -0,0 +1,35 @@
+import type { Metadata } from "next";
+import { Geist, Geist_Mono } from "next/font/google";
+import "./globals.css";
+
+const geistSans = Geist({
+ variable: "--font-geist-sans",
+ subsets: ["latin"],
+});
+
+const geistMono = Geist_Mono({
+ variable: "--font-geist-mono",
+ subsets: ["latin"],
+});
+
+
+export const metadata: Metadata = {
+ title: "Create Next App",
+ description: "Generated by create next app",
+};
+
+export default function RootLayout({
+ children,
+}: Readonly<{
+ children: React.ReactNode;
+}>) {
+ return (
+ <html lang="en">
+ <body
+ className={`${geistSans.variable} ${geistMono.variable} antialiased`}
+ >
+ {children}
+ </body>
+ </html>
+ );
+}
diff --git a/pipes/identify-speakers/src/app/page.tsx b/pipes/identify-speakers/src/app/page.tsx
new file mode 100644
index 000000000..de5488fd7
--- /dev/null
+++ b/pipes/identify-speakers/src/app/page.tsx
@@ -0,0 +1,14 @@
+"use client";
+
+import IdentifySpeakers from "@/components/identify-speakers";
+import { useState } from "react";
+
+export default function IdentifySpeakersPage() {
+ const [_, setShowIdentifySpeakers] = useState(true);
+ return (
+ <IdentifySpeakers
+ showIdentifySpeakers={true}
+ setShowIdentifySpeakers={setShowIdentifySpeakers}
+ />
+ );
+}
diff --git a/pipes/identify-speakers/src/components/identify-speakers.tsx b/pipes/identify-speakers/src/components/identify-speakers.tsx
new file mode 100644
index 000000000..1416de165
--- /dev/null
+++ b/pipes/identify-speakers/src/components/identify-speakers.tsx
@@ -0,0 +1,1339 @@
+"use client";
+
+import { useState, useEffect } from "react";
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+import { useSettings } from "@/lib/hooks/use-settings";
+import { useToast } from "./ui/use-toast";
+import {
+ X,
+ Fingerprint,
+ Check,
+ ChevronRight,
+ Save,
+ Ghost,
+ Trash,
+} from "lucide-react";
+import { Badge } from "./ui/badge";
+import { Input } from "./ui/input";
+import { getFileSize, keysToCamelCase } from "@/lib/utils";
+import { VideoComponent } from "@/components/video";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "./ui/card";
+
+export interface MeetingSegment {
+ timestamp: string;
+ transcription: string;
+ deviceName: string;
+ deviceType: string;
+ speaker: Speaker;
+}
+
+export type AudioSample = {
+ path: string;
+ transcript: string;
+};
+
+export interface Speaker {
+ id: number;
+ name: string;
+ metadata?: {
+ audioSamples: AudioSample[];
+ };
+}
+
+interface UnnamedSpeaker {
+ id: number;
+ name: string;
+ metadata: string;
+}
+
+export default function IdentifySpeakers({
+ showIdentifySpeakers,
+ setShowIdentifySpeakers,
+ segments,
+ className,
+}: {
+ showIdentifySpeakers: boolean;
+ setShowIdentifySpeakers: (show: boolean) => void;
+ segments?: MeetingSegment[];
+ className?: string;
+}) {
+ const { settings } = useSettings();
+ const [unnamedSpeakers, setUnnamedSpeakers] = useState<Speaker[]>([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState<string | null>(null);
+ const { toast } = useToast();
+ const [showError, setShowError] = useState(false);
+ const [currentSpeakerIndex, setCurrentSpeakerIndex] = useState(0);
+ const [showHallucinationConfirm, setShowHallucinationConfirm] =
+ useState(false);
+ const [showNameUpdateConfirm, setShowNameUpdateConfirm] = useState(false);
+ const [speakerSearchTerm, setSpeakerSearchTerm] = useState<string>("");
+ const [speakers, setSpeakers] = useState<Speaker[]>([]);
+ const [isSearching, setIsSearching] = useState(false);
+ const [showMergeConfirm, setShowMergeConfirm] = useState(false);
+ const [selectedExistingSpeaker, setSelectedExistingSpeaker] =
+ useState<Speaker | null>(null);
+ const [segmentSpeakerIds, setSegmentSpeakerIds] = useState<number[]>([]);
+ const [similarSpeakers, setSimilarSpeakers] = useState<Speaker[]>([]);
+ const [isFetchingSimilarSpeakers, setIsFetchingSimilarSpeakers] =
+ useState(false);
+ const [speakerIdentified, setSpeakerIdentified] = useState(false);
+ const [similarSpeakerIndex, setSimilarSpeakerIndex] = useState(0);
+ const [showRemoveSpeakerConfirm, setShowRemoveSpeakerConfirm] =
+ useState(false);
+ const [showSpeakerNames, setShowSpeakerNames] = useState(false);
+ const [mounted, setMounted] = useState(false);
+ useEffect(() => {
+ setMounted(true);
+ }, []);
+ useEffect(() => {
+ if (!isSearching && speakers.length > 0) {
+ setShowSpeakerNames(true);
+ }
+ }, [isSearching, speakers]);
+
+ useEffect(() => {
+ if (speakerSearchTerm) {
+ fetchSpeakers(speakerSearchTerm);
+ }
+ }, [speakerSearchTerm]);
+
+ useEffect(() => {
+ if (unnamedSpeakers.length > 0) {
+ fetchSimilarSpeakers(unnamedSpeakers[currentSpeakerIndex].id);
+ }
+ }, [currentSpeakerIndex]);
+
+ useEffect(() => {
+ speakerIdentified &&
+ setSimilarSpeakers(similarSpeakers.filter((s) => !s.name));
+ }, [speakerIdentified]);
+
+ useEffect(() => {
+ if (segments) {
+ setSegmentSpeakerIds(segments.map((segment) => segment.speaker.id));
+ }
+ }, [segments]);
+
+ useEffect(() => {
+ if (showIdentifySpeakers) {
+ loadUnnamedSpeakers();
+ } else {
+ setSpeakerIdentified(false);
+ setSelectedExistingSpeaker(null);
+ setSpeakerSearchTerm("");
+ setSpeakers([]);
+ setSimilarSpeakers([]);
+ setCurrentSpeakerIndex(0);
+ }
+ /* eslint-disable-next-line react-hooks/exhaustive-deps */
+ }, [showIdentifySpeakers]);
+
+ useEffect(() => {
+ setShowError(!!error);
+ }, [error]);
+
+ useEffect(() => {
+ if (showError) {
+ setTimeout(() => {
+ setShowError(false);
+ }, 5000);
+ }
+ }, [showError]);
+
+ async function loadUnnamedSpeakers() {
+ setLoading(true);
+ try {
+ await fetchUnnamedSpeakers();
+ } catch (err) {
+ setError("failed to load unnamed speakers");
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function fetchSpeakers(searchTerm: string) {
+ setIsSearching(true);
+
+ try {
+ const response = await fetch(
+ `http://localhost:3030/speakers/search?name=${searchTerm}`
+ );
+ if (!response.ok) {
+ throw new Error("failed to fetch speakers");
+ }
+ const result = await response.json();
+ setSpeakers(result);
+ } catch (error) {
+ console.error("error fetching speakers:", error);
+ setError("failed to fetch speakers");
+ } finally {
+ setIsSearching(false);
+ }
+ }
+
+ async function fetchSimilarSpeakers(speakerId: number) {
+ setIsFetchingSimilarSpeakers(true);
+
+ console.log("fetching similar speakers for", speakerId);
+ try {
+ const response = await fetch(
+ `http://localhost:3030/speakers/similar?speaker_id=${speakerId}&limit=5`
+ );
+ if (!response.ok) {
+ throw new Error("failed to fetch similar speakers");
+ }
+ const result = await response.json();
+
+ const updatedUnnamedSpeakers = result.map((speaker: UnnamedSpeaker) => ({
+ ...speaker,
+ metadata: speaker.metadata ? JSON.parse(speaker.metadata) : undefined,
+ }));
+ const camelCaseResult: Speaker[] = updatedUnnamedSpeakers.map(
+ keysToCamelCase<Speaker>
+ );
+
+ let similarSpeakersResult: Speaker[] = [];
+ for (const speaker of camelCaseResult) {
+ let longestAudioSample = speaker.metadata?.audioSamples[0];
+ let longestAudioPathSize = -Infinity;
+ for (const sample of speaker.metadata?.audioSamples || []) {
+ const size = await getFileSize(sample.path);
+ if (size > longestAudioPathSize) {
+ longestAudioSample = sample;
+ longestAudioPathSize = size;
+ }
+ }
+ similarSpeakersResult.push({
+ ...speaker,
+ metadata: {
+ audioSamples: [
+ {
+ path: longestAudioSample?.path || "",
+ transcript: longestAudioSample?.transcript || "",
+ },
+ ],
+ },
+ });
+ }
+
+ setSimilarSpeakers(similarSpeakersResult);
+ } catch (error) {
+ console.error("error fetching similar speakers:", error);
+ setError("failed to fetch similar speakers");
+ } finally {
+ setIsFetchingSimilarSpeakers(false);
+ }
+ }
+
+ async function fetchUnnamedSpeakers() {
+ setLoading(true);
+ try {
+ // Always fetch from the last 7x24 hours
+
+ const response = await fetch(
+ `http://localhost:3030/speakers/unnamed?limit=1&offset=0${
+ segmentSpeakerIds.length > 0
+ ? `&speaker_ids=${segmentSpeakerIds.join(",")}`
+ : ""
+ }`
+ );
+ if (!response.ok) {
+ throw new Error("failed to fetch unnamed speakers");
+ }
+ const result = await response.json();
+ const updatedUnnamedSpeakers = result.map((speaker: UnnamedSpeaker) => ({
+ ...speaker,
+ metadata: speaker.metadata ? JSON.parse(speaker.metadata) : undefined,
+ }));
+ const camelCaseResult = updatedUnnamedSpeakers.map(
+ keysToCamelCase<Speaker>
+ );
+
+ const results: Speaker[] = await camelCaseResult.map(
+ async (speaker: Speaker) => {
+ const durations: Map<string, number> = new Map();
+ for (const sample of speaker.metadata?.audioSamples || []) {
+ const size = await getFileSize(sample.path);
+ durations.set(sample.path, size);
+ }
+
+ return {
+ ...speaker,
+ metadata: {
+ ...speaker.metadata,
+ audioSamples: speaker.metadata?.audioSamples.sort(
+ (a: AudioSample, b: AudioSample) =>
+ (durations.get(b.path) || 0) - (durations.get(a.path) || 0)
+ ),
+ },
+ };
+ }
+ );
+
+ let sortedResults = await Promise.all(results);
+ console.log("results", sortedResults);
+
+ setUnnamedSpeakers(sortedResults);
+ } catch (err) {
+ setError(
+ "some trouble fetching new meetings. please check health status."
+ );
+ console.error("fetch error:", err);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ const handleRefresh = async () => {
+ setSpeakers([]);
+ try {
+ await fetchUnnamedSpeakers();
+ toast({
+ title: "speakers refreshed",
+ description: "your speaker identification has been updated.",
+ });
+ } catch (error) {
+ console.error("error refreshing meetings:", error);
+ toast({
+ title: "refresh failed",
+ description:
+ "failed to refresh speaker identification. please try again.",
+ variant: "destructive",
+ });
+ } finally {
+ setSpeakerSearchTerm("");
+ setSpeakerIdentified(false);
+ setSelectedExistingSpeaker(null);
+ }
+ };
+
+ const handleUpdateSpeakerName = async (newName: string) => {
+ // use the endpoint /speakers/update to update the name
+ try {
+ await fetch(`http://localhost:3030/speakers/update`, {
+ method: "POST",
+ body: JSON.stringify({
+ id: unnamedSpeakers[currentSpeakerIndex].id,
+ name: newName,
+ }),
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+ setSpeakerIdentified(true);
+ } catch (error) {
+ console.error("error updating speaker name:", error);
+ toast({
+ title: "error",
+ description: "failed to update speaker name. please try again.",
+ variant: "destructive",
+ });
+ }
+ };
+
+ const handleRemoveSpeaker = async () => {
+ try {
+ await fetch(`http://localhost:3030/speakers/delete`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ id: unnamedSpeakers[currentSpeakerIndex].id,
+ }),
+ });
+
+ handleRefresh();
+ } catch (error) {
+ console.error("error removing speaker:", error);
+ toast({
+ title: "error",
+ description: "failed to remove speaker. please try again.",
+ variant: "destructive",
+ });
+ }
+ };
+
+ const handleMergeSpeakers = async () => {
+ if (selectedExistingSpeaker) {
+ try {
+ // Add API call to merge speakers
+ await fetch(`http://localhost:3030/speakers/merge`, {
+ method: "POST",
+ body: JSON.stringify({
+ speaker_to_merge_id: unnamedSpeakers[currentSpeakerIndex].id,
+ speaker_to_keep_id: selectedExistingSpeaker.id,
+ }),
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+
+ toast({
+ title: "speakers merged",
+ description: "the speakers have been successfully merged",
+ });
+
+ if (selectedExistingSpeaker.name) {
+ setSpeakerIdentified(true);
+ setSpeakerSearchTerm(selectedExistingSpeaker.name);
+ }
+
+ setSimilarSpeakers(similarSpeakers.filter((s) => !s.name));
+
+ setUnnamedSpeakers(
+ unnamedSpeakers.map((s) => ({
+ ...s,
+ id:
+ s.id === unnamedSpeakers[currentSpeakerIndex].id
+ ? selectedExistingSpeaker.id
+ : s.id,
+ }))
+ );
+ } catch (error) {
+ console.error("error merging speakers:", error);
+ toast({
+ title: "error",
+ description: "failed to merge speakers. please try again.",
+ variant: "destructive",
+ });
+ }
+ }
+ setShowMergeConfirm(false);
+ };
+
+ const handleMarkSpeakerAsHallucination = async () => {
+ // use the endpoint /speakers/hallucination to mark the speaker as hallucination
+ try {
+ await fetch(`http://localhost:3030/speakers/hallucination`, {
+ method: "POST",
+ body: JSON.stringify({
+ speaker_id: unnamedSpeakers[currentSpeakerIndex].id,
+ }),
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+ } catch (error) {
+ console.error("error ignoring speaker:", error);
+ toast({
+ title: "error",
+ description: "failed to ignore speaker. please try again.",
+ variant: "destructive",
+ });
+ }
+ };
+
+ // 4. Return null on first render to avoid hydration mismatch
+ if (!mounted) {
+ return null;
+ }
+
+ return segments ? (
+ <Dialog open={showIdentifySpeakers} onOpenChange={setShowIdentifySpeakers}>
+ <DialogTrigger asChild>
+ <Button
+ onClick={() => setShowIdentifySpeakers(true)}
+ size="sm"
+ className="text-xs bg-black text-white hover:bg-gray-800"
+ >
+ <Fingerprint className="mr-2 h-4 w-4" />
+ identify speakers
+ </Button>
+ </DialogTrigger>
+ <DialogContent className="max-w-[90vw] w-full max-h-[90vh] h-full">
+ <DialogHeader className="py-4">
+ <DialogTitle className="flex items-center justify-between">
+ <div className="flex items-center">
+ identify speakers based on recent audio clips
+ <Badge variant="secondary" className="ml-2">
+ experimental
+ </Badge>
+ </div>
+ </DialogTitle>
+ </DialogHeader>
+ <div className="flex-grow overflow-auto min-h-[600px] flex flex-col">
+ {loading ? (
+ <div className="space-y-6 min-h-[600px]">
+ {[1, 2, 3].map((i) => (
+ <div key={i} className="p-4 border rounded animate-pulse">
+ <div className="h-6 bg-gray-200 rounded w-3/4 mb-4"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/2 mb-2"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/4 mb-4"></div>
+ <div className="h-20 bg-gray-200 rounded mb-2"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/3"></div>
+ </div>
+ ))}
+ </div>
+ ) : (
+ <div className="min-h-[600px] flex flex-col">
+ {showError && error && (
+ <div
+ className="bg-gray-100 border-l-4 border-black text-gray-700 p-4 mb-4 flex justify-between items-center"
+ role="alert"
+ >
+ <div>
+ <p className="font-bold">warning</p>
+ <p>{error}</p>
+ </div>
+ <button
+ onClick={() => setShowError(false)}
+ className="text-gray-700 hover:text-black"
+ >
+ <X size={18} />
+ </button>
+ </div>
+ )}
+ {unnamedSpeakers.length === 0 && !loading && !error && (
+ <p className="text-center">no unnamed speakers found.</p>
+ )}
+
+ {unnamedSpeakers.length > 0 && (
+ <div className="mx-4">
+ <div className="p-4 border rounded h-full">
+ <div className="flex items-center justify-between mb-4">
+ <div className="flex items-center space-x-2">
+ <span className="font-medium">identify speaker</span>
+ </div>
+ </div>
+ <form
+ className="space-y-4"
+ onSubmit={async (e) => {
+ e.preventDefault();
+ setShowNameUpdateConfirm(true);
+ await fetchSpeakers(speakerSearchTerm);
+ }}
+ >
+ <div className="flex items-center space-x-2">
+ <div className="relative flex-1 max-w-xs">
+ <Input
+ onFocus={() => {
+ setShowSpeakerNames(true);
+ }}
+ onBlur={(e) => {
+ // Add a small delay to allow the click event to fire first
+ setTimeout(() => {
+ setShowSpeakerNames(false);
+ }, 200);
+ }}
+ value={speakerSearchTerm}
+ name="speakerName"
+ onChange={(e) => {
+ const newValue = e.target.value;
+ setSpeakerSearchTerm(newValue);
+ // Only filter existing speakers if we have any
+ if (speakers.length > 0) {
+ setSpeakers(
+ speakers.filter((speaker) =>
+ speaker.name
+ .toLowerCase()
+ .includes(newValue.toLowerCase())
+ )
+ );
+ }
+ }}
+ onKeyDown={(e) => {
+ if (e.key === " " && !segments) {
+ setSpeakerSearchTerm(speakerSearchTerm + " ");
+ }
+ }}
+ placeholder="Enter speaker name"
+ className="w-full"
+ />
+ {speakerSearchTerm && (
+ <div className="absolute z-10 w-full mt-1 bg-white border rounded-md shadow-lg max-h-48 overflow-y-auto">
+ {isSearching ? (
+ <div className="flex justify-center items-center p-4">
+ <div className="animate-spin rounded-full h-6 w-6 border-b-2 border-gray-900"></div>
+ </div>
+ ) : (
+ showSpeakerNames && (
+ <ul className="py-1">
+ {speakers.map((speaker) => (
+ <li
+ key={speaker.id}
+ className="px-3 py-2 hover:bg-gray-100 cursor-pointer truncate"
+ onClick={(e) => {
+ setSpeakerSearchTerm(speaker.name);
+ setSelectedExistingSpeaker(speaker);
+ setShowMergeConfirm(true);
+ setShowSpeakerNames(false);
+ }}
+ >
+ {speaker.name}
+ </li>
+ ))}
+ </ul>
+ )
+ )}
+ </div>
+ )}
+ </div>
+ <Button
+ type="submit"
+ disabled={!speakerSearchTerm || speakerIdentified}
+ size="sm"
+ onClick={(e) => {
+ e.preventDefault();
+ setShowNameUpdateConfirm(true);
+ }}
+ >
+ <Save className="mr-2" />
+ update name
+ </Button>
+ <Button
+ type="button"
+ variant="outline"
+ disabled={speakerIdentified}
+ onClick={async (e) => {
+ e.preventDefault();
+ setShowHallucinationConfirm(true);
+ }}
+ >
+ <Ghost className="mr-2" />
+ nobody is speaking
+ </Button>
+ <Button
+ type="button"
+ disabled={speakerIdentified}
+ variant="secondary"
+ onClick={async (e) => {
+ e.preventDefault();
+ setShowRemoveSpeakerConfirm(true);
+ }}
+ >
+ <Trash className="mr-2" />
+ remove speaker
+ </Button>
+ </div>
+ </form>
+
+ <div className="mt-4">
+ <p className="text-sm text-gray-500 mb-2">
+ audio samples:
+ </p>
+ <div className="grid grid-cols-3 gap-2">
+ {unnamedSpeakers[
+ currentSpeakerIndex
+ ].metadata?.audioSamples
+ .slice(0, 3)
+ .map((sample, index) => (
+ <VideoComponent
+ key={index}
+ filePath={sample.path}
+ customDescription={`transcript: ${sample.transcript}`}
+ />
+ ))}
+ </div>
+ </div>
+ {speakerIdentified && (
+ <div className="mt-4 flex justify-end">
+ <Button
+ onClick={() => {
+ handleRefresh();
+ }}
+ >
+ next speaker
+ <ChevronRight className="ml-2" />
+ </Button>
+ </div>
+ )}
+ <div className="mt-8">
+ {similarSpeakers.length > 0 && (
+ <p className="text-sm text-gray-500 mb-4">
+ is this the same speaker?
+ </p>
+ )}
+ {isFetchingSimilarSpeakers ? (
+ <div className="flex justify-center items-center p-4">
+ <div className="animate-spin rounded-full h-6 w-6 border-b-2 border-gray-900"></div>
+ </div>
+ ) : (
+ <div>
+ {similarSpeakers.map((speaker, index) => {
+ if (similarSpeakerIndex !== index) {
+ return null;
+ }
+ return (
+ <div
+ className="flex space-x-2 items-center"
+ key={speaker.id}
+ >
+ <span>{speaker.name || ""}</span>
+ {speaker.metadata?.audioSamples.map(
+ (sample) => (
+ <VideoComponent
+ key={sample.path}
+ filePath={sample.path}
+ customDescription={`transcript: ${sample.transcript}`}
+ className="max-w-[300px]"
+ />
+ )
+ )}
+ <Button
+ size="default"
+ variant="default"
+ onClick={() => {
+ setSelectedExistingSpeaker(speaker);
+ setShowMergeConfirm(true);
+ }}
+ >
+ <Check className="mr-2" />
+ same speaker
+ </Button>
+ <Button
+ size="default"
+ variant="outline"
+ onClick={() => {
+ const newSpeakers = similarSpeakers.filter(
+ (s) => s.id !== speaker.id
+ );
+ setSimilarSpeakers(newSpeakers);
+ setSimilarSpeakerIndex(
+ Math.max(
+ 0,
+ Math.min(
+ similarSpeakerIndex,
+ newSpeakers.length - 1
+ )
+ )
+ );
+ }}
+ >
+ <X className="mr-2" />
+ different speaker
+ </Button>
+ <Button
+ size="default"
+ className={
+ similarSpeakers.length === 1 ? "hidden" : ""
+ }
+ variant="secondary"
+ onClick={() => {
+ setSimilarSpeakerIndex(
+ (index + 1) % similarSpeakers.length
+ );
+ }}
+ >
+ skip
+ <ChevronRight className="ml-2" />
+ </Button>
+ </div>
+ );
+ })}
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ </DialogContent>
+ <Dialog
+ open={showHallucinationConfirm}
+ onOpenChange={setShowHallucinationConfirm}
+ >
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>confirm</DialogTitle>
+ <DialogDescription>
+ are you sure you nobody is speaking? this action cannot be undone.
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex justify-end space-x-2">
+ <Button
+ variant="outline"
+ onClick={() => setShowHallucinationConfirm(false)}
+ >
+ cancel
+ </Button>
+ <Button
+ variant="default"
+ onClick={async () => {
+ await handleMarkSpeakerAsHallucination();
+ setShowHallucinationConfirm(false);
+ toast({
+ title: "speaker ignored",
+ description:
+ "This speaker will be ignored in future processing",
+ });
+ setSpeakerIdentified(true);
+ }}
+ >
+ confirm
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ <Dialog
+ open={showNameUpdateConfirm}
+ onOpenChange={setShowNameUpdateConfirm}
+ >
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>confirm name update</DialogTitle>
+ <DialogDescription>
+ are you sure you want to update this speaker&apos;s name to &quot;
+ {speakerSearchTerm}
+ &quot;?
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex justify-end space-x-2">
+ <Button
+ variant="ghost"
+ onClick={() => setShowNameUpdateConfirm(false)}
+ >
+ cancel
+ </Button>
+ <Button
+ onClick={async () => {
+ await handleUpdateSpeakerName(speakerSearchTerm);
+ setShowNameUpdateConfirm(false);
+ toast({
+ title: "speaker renamed",
+ description: "the speaker name has been updated",
+ });
+ }}
+ >
+ confirm
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ <Dialog open={showMergeConfirm} onOpenChange={setShowMergeConfirm}>
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>merge speakers</DialogTitle>
+ {selectedExistingSpeaker?.name ? (
+ <DialogDescription>
+ do you want to merge this speaker with existing speaker
+ {` "${selectedExistingSpeaker?.name}"`}? this will combine their
+ audio samples and future recordings.
+ </DialogDescription>
+ ) : (
+ <DialogDescription>
+ do you want to merge this speaker? this will combine their audio
+ samples and future recordings.
+ </DialogDescription>
+ )}
+ </DialogHeader>
+ <div className="flex justify-end space-x-2">
+ <Button variant="ghost" onClick={() => setShowMergeConfirm(false)}>
+ cancel
+ </Button>
+ {selectedExistingSpeaker?.name && (
+ <Button
+ variant="outline"
+ onClick={() => {
+ setShowMergeConfirm(false);
+ // Still update the name without merging
+ handleUpdateSpeakerName(selectedExistingSpeaker?.name || "");
+ toast({
+ title: "speaker renamed",
+ description:
+ "the speaker name has been updated without merging",
+ });
+ }}
+ >
+ just update name
+ </Button>
+ )}
+
+ <Button onClick={handleMergeSpeakers}>merge speakers</Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ <Dialog
+ open={showRemoveSpeakerConfirm}
+ onOpenChange={setShowRemoveSpeakerConfirm}
+ >
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>confirm remove speaker</DialogTitle>
+ <DialogDescription>
+ are you sure you want to remove this speaker? this action cannot
+ be undone.
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex justify-end space-x-2">
+ <Button
+ variant="outline"
+ onClick={() => setShowRemoveSpeakerConfirm(false)}
+ >
+ cancel
+ </Button>
+ <Button
+ onClick={async () => {
+ await handleRemoveSpeaker();
+ setShowRemoveSpeakerConfirm(false);
+ toast({
+ title: "speaker removed",
+ description: "the speaker has been removed",
+ });
+ }}
+ >
+ confirm
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ </Dialog>
+ ) : (
+ <Card>
+ <CardHeader>
+ <CardTitle>identify speakers</CardTitle>
+ <CardDescription>
+ identify speakers based on recent audio clips
+ <Badge variant="secondary" className="ml-2">
+ experimental
+ </Badge>
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="max-w-[90vw] w-full max-h-[90vh] h-full">
+ <div className="flex-grow overflow-auto min-h-[600px] flex flex-col">
+ {loading ? (
+ <div className="space-y-6 min-h-[600px]">
+ {[1, 2, 3].map((i) => (
+ <div key={i} className="p-4 border rounded animate-pulse">
+ <div className="h-6 bg-gray-200 rounded w-3/4 mb-4"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/2 mb-2"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/4 mb-4"></div>
+ <div className="h-20 bg-gray-200 rounded mb-2"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/3"></div>
+ </div>
+ ))}
+ </div>
+ ) : (
+ <div className="min-h-[600px] flex flex-col">
+ {showError && error && (
+ <div
+ className="bg-gray-100 border-l-4 border-black text-gray-700 p-4 mb-4 flex justify-between items-center"
+ role="alert"
+ >
+ <div>
+ <p className="font-bold">warning</p>
+ <p>{error}</p>
+ </div>
+ <button
+ onClick={() => setShowError(false)}
+ className="text-gray-700 hover:text-black"
+ >
+ <X size={18} />
+ </button>
+ </div>
+ )}
+ {unnamedSpeakers.length === 0 && !loading && !error && (
+ <p className="text-center">no unnamed speakers found.</p>
+ )}
+
+ {unnamedSpeakers.length > 0 && (
+ <div className="mx-4">
+ <div className="p-4 border rounded h-full">
+ <div className="flex items-center justify-between mb-4">
+ <div className="flex items-center space-x-2">
+ <span className="font-medium">identify speaker</span>
+ </div>
+ </div>
+ <form
+ className="space-y-4"
+ onSubmit={async (e) => {
+ e.preventDefault();
+ setShowNameUpdateConfirm(true);
+ await fetchSpeakers(speakerSearchTerm);
+ }}
+ >
+ <div className="flex items-center space-x-2">
+ <div className="relative flex-1 max-w-xs">
+ <Input
+ onFocus={() => {
+ setShowSpeakerNames(true);
+ }}
+ onBlur={(e) => {
+ // Add a small delay to allow the click event to fire first
+ setTimeout(() => {
+ setShowSpeakerNames(false);
+ }, 200);
+ }}
+ value={speakerSearchTerm}
+ name="speakerName"
+ onChange={(e) => {
+ const newValue = e.target.value;
+ setSpeakerSearchTerm(newValue);
+ // Only filter existing speakers if we have any
+ if (speakers.length > 0) {
+ setSpeakers(
+ speakers.filter((speaker) =>
+ speaker.name
+ .toLowerCase()
+ .includes(newValue.toLowerCase())
+ )
+ );
+ }
+ }}
+ onKeyDown={(e) => {
+ if (e.key === " " && !segments) {
+ setSpeakerSearchTerm(speakerSearchTerm + " ");
+ }
+ }}
+ placeholder="Enter speaker name"
+ className="w-full"
+ />
+ {speakerSearchTerm && (
+ <div className="absolute z-10 w-full mt-1 bg-white border rounded-md shadow-lg max-h-48 overflow-y-auto">
+ {isSearching ? (
+ <div className="flex justify-center items-center p-4">
+ <div className="animate-spin rounded-full h-6 w-6 border-b-2 border-gray-900"></div>
+ </div>
+ ) : (
+ showSpeakerNames && (
+ <ul className="py-1">
+ {speakers.map((speaker) => (
+ <li
+ key={speaker.id}
+ className="px-3 py-2 hover:bg-gray-100 cursor-pointer truncate"
+ onClick={(e) => {
+ setSpeakerSearchTerm(speaker.name);
+ setSelectedExistingSpeaker(speaker);
+ setShowMergeConfirm(true);
+ setShowSpeakerNames(false);
+ }}
+ >
+ {speaker.name}
+ </li>
+ ))}
+ </ul>
+ )
+ )}
+ </div>
+ )}
+ </div>
+ <Button
+ type="submit"
+ disabled={!speakerSearchTerm || speakerIdentified}
+ size="sm"
+ onClick={(e) => {
+ e.preventDefault();
+ setShowNameUpdateConfirm(true);
+ }}
+ >
+ <Save className="mr-2" />
+ update name
+ </Button>
+ <Button
+ type="button"
+ variant="outline"
+ disabled={speakerIdentified}
+ onClick={async (e) => {
+ e.preventDefault();
+ setShowHallucinationConfirm(true);
+ }}
+ >
+ <Ghost className="mr-2" />
+ nobody is speaking
+ </Button>
+ <Button
+ type="button"
+ disabled={speakerIdentified}
+ variant="secondary"
+ onClick={async (e) => {
+ e.preventDefault();
+ setShowRemoveSpeakerConfirm(true);
+ }}
+ >
+ <Trash className="mr-2" />
+ remove speaker
+ </Button>
+ </div>
+ </form>
+
+ <div className="mt-4">
+ <p className="text-sm text-gray-500 mb-2">
+ audio samples:
+ </p>
+ <div className="grid grid-cols-3 gap-2">
+ {unnamedSpeakers[
+ currentSpeakerIndex
+ ].metadata?.audioSamples
+ .slice(0, 3)
+ .map((sample, index) => (
+ <VideoComponent
+ key={index}
+ filePath={sample.path}
+ customDescription={`transcript: ${sample.transcript}`}
+ />
+ ))}
+ </div>
+ </div>
+ {speakerIdentified && (
+ <div className="mt-4 flex justify-end">
+ <Button
+ onClick={() => {
+ handleRefresh();
+ }}
+ >
+ next speaker
+ <ChevronRight className="ml-2" />
+ </Button>
+ </div>
+ )}
+ <div className="mt-8">
+ {similarSpeakers.length > 0 && (
+ <p className="text-sm text-gray-500 mb-4">
+ is this the same speaker?
+ </p>
+ )}
+ {isFetchingSimilarSpeakers ? (
+ <div className="flex justify-center items-center p-4">
+ <div className="animate-spin rounded-full h-6 w-6 border-b-2 border-gray-900"></div>
+ </div>
+ ) : (
+ <div>
+ {similarSpeakers.map((speaker, index) => {
+ if (similarSpeakerIndex !== index) {
+ return null;
+ }
+ return (
+ <div
+ className="flex space-x-2 items-center"
+ key={speaker.id}
+ >
+ <span>{speaker.name || ""}</span>
+ {speaker.metadata?.audioSamples.map(
+ (sample) => (
+ <VideoComponent
+ key={sample.path}
+ filePath={sample.path}
+ customDescription={`transcript: ${sample.transcript}`}
+ className="max-w-[300px]"
+ />
+ )
+ )}
+ <Button
+ size="default"
+ variant="default"
+ onClick={() => {
+ setSelectedExistingSpeaker(speaker);
+ setShowMergeConfirm(true);
+ }}
+ >
+ <Check className="mr-2" />
+ same speaker
+ </Button>
+ <Button
+ size="default"
+ variant="outline"
+ onClick={() => {
+ const newSpeakers = similarSpeakers.filter(
+ (s) => s.id !== speaker.id
+ );
+ setSimilarSpeakers(newSpeakers);
+ setSimilarSpeakerIndex(
+ Math.max(
+ 0,
+ Math.min(
+ similarSpeakerIndex,
+ newSpeakers.length - 1
+ )
+ )
+ );
+ }}
+ >
+ <X className="mr-2" />
+ different speaker
+ </Button>
+ <Button
+ size="default"
+ className={
+ similarSpeakers.length === 1 ? "hidden" : ""
+ }
+ variant="secondary"
+ onClick={() => {
+ setSimilarSpeakerIndex(
+ (index + 1) % similarSpeakers.length
+ );
+ }}
+ >
+ skip
+ <ChevronRight className="ml-2" />
+ </Button>
+ </div>
+ );
+ })}
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ </CardContent>
+ <Dialog
+ open={showHallucinationConfirm}
+ onOpenChange={setShowHallucinationConfirm}
+ >
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>confirm</DialogTitle>
+ <DialogDescription>
+ are you sure you nobody is speaking? this action cannot be undone.
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex justify-end space-x-2">
+ <Button
+ variant="outline"
+ onClick={() => setShowHallucinationConfirm(false)}
+ >
+ cancel
+ </Button>
+ <Button
+ variant="default"
+ onClick={async () => {
+ await handleMarkSpeakerAsHallucination();
+ setShowHallucinationConfirm(false);
+ toast({
+ title: "speaker ignored",
+ description:
+ "This speaker will be ignored in future processing",
+ });
+ setSpeakerIdentified(true);
+ }}
+ >
+ confirm
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ <Dialog
+ open={showNameUpdateConfirm}
+ onOpenChange={setShowNameUpdateConfirm}
+ >
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>confirm name update</DialogTitle>
+ <DialogDescription>
+ are you sure you want to update this speaker&apos;s name to &quot;
+ {speakerSearchTerm}
+ &quot;?
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex justify-end space-x-2">
+ <Button
+ variant="ghost"
+ onClick={() => setShowNameUpdateConfirm(false)}
+ >
+ cancel
+ </Button>
+ <Button
+ onClick={async () => {
+ await handleUpdateSpeakerName(speakerSearchTerm);
+ setShowNameUpdateConfirm(false);
+ toast({
+ title: "speaker renamed",
+ description: "the speaker name has been updated",
+ });
+ }}
+ >
+ confirm
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ <Dialog open={showMergeConfirm} onOpenChange={setShowMergeConfirm}>
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>merge speakers</DialogTitle>
+ {selectedExistingSpeaker?.name ? (
+ <DialogDescription>
+ do you want to merge this speaker with existing speaker
+ {` "${selectedExistingSpeaker?.name}"`}? this will combine their
+ audio samples and future recordings.
+ </DialogDescription>
+ ) : (
+ <DialogDescription>
+ do you want to merge this speaker? this will combine their audio
+ samples and future recordings.
+ </DialogDescription>
+ )}
+ </DialogHeader>
+ <div className="flex justify-end space-x-2">
+ <Button variant="ghost" onClick={() => setShowMergeConfirm(false)}>
+ cancel
+ </Button>
+ {selectedExistingSpeaker?.name && (
+ <Button
+ variant="outline"
+ onClick={() => {
+ setShowMergeConfirm(false);
+ // Still update the name without merging
+ handleUpdateSpeakerName(selectedExistingSpeaker?.name || "");
+ toast({
+ title: "speaker renamed",
+ description:
+ "the speaker name has been updated without merging",
+ });
+ }}
+ >
+ just update name
+ </Button>
+ )}
+
+ <Button onClick={handleMergeSpeakers}>merge speakers</Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ <Dialog
+ open={showRemoveSpeakerConfirm}
+ onOpenChange={setShowRemoveSpeakerConfirm}
+ >
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>confirm remove speaker</DialogTitle>
+ <DialogDescription>
+ are you sure you want to remove this speaker? this action cannot
+ be undone.
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex justify-end space-x-2">
+ <Button
+ variant="outline"
+ onClick={() => setShowRemoveSpeakerConfirm(false)}
+ >
+ cancel
+ </Button>
+ <Button
+ onClick={async () => {
+ await handleRemoveSpeaker();
+ setShowRemoveSpeakerConfirm(false);
+ toast({
+ title: "speaker removed",
+ description: "the speaker has been removed",
+ });
+ }}
+ >
+ confirm
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ </Card>
+ );
+}
diff --git a/pipes/identify-speakers/src/components/meeting-history.tsx b/pipes/identify-speakers/src/components/meeting-history.tsx
new file mode 100644
index 000000000..2551453ec
--- /dev/null
+++ b/pipes/identify-speakers/src/components/meeting-history.tsx
@@ -0,0 +1,894 @@
+"use client";
+
+import React, { useState, useEffect, useCallback, useMemo } from "react";
+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,
+ Copy,
+ RefreshCw,
+ Trash2,
+ FileText,
+ PlusCircle,
+ ChevronDown,
+} from "lucide-react";
+import { Badge } from "./ui/badge";
+import { useCopyToClipboard } from "@/lib/hooks/use-copy-to-clipboard";
+import localforage from "localforage";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import { Input } from "./ui/input";
+import { cn, keysToCamelCase } from "@/lib/utils";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+import { Checkbox } from "./ui/checkbox";
+
+function formatDate(date: string): string {
+ const dateObj = new Date(date);
+ const formattedDate = dateObj.toLocaleDateString("en-US", {
+ month: "long",
+ day: "numeric",
+ year: "numeric",
+ });
+ const formattedTime = dateObj.toLocaleTimeString("en-US", {
+ hour: "2-digit",
+ minute: "2-digit",
+ });
+ return `${formattedDate} at ${formattedTime}`;
+}
+
+async function setItem(key: string, value: any): Promise<void> {
+ try {
+ if (typeof window !== "undefined") {
+ await localforage.setItem(key, value);
+ }
+ } catch (error) {
+ console.error("error setting item in storage:", error);
+ throw error;
+ }
+}
+
+async function getItem(key: string): Promise<any> {
+ try {
+ if (typeof window !== "undefined") {
+ return await localforage.getItem(key);
+ }
+ } catch (error) {
+ console.error("error getting item from storage:", error);
+ throw error;
+ }
+ return null;
+}
+
+interface MeetingSegment {
+ timestamp: string;
+ transcription: string;
+ deviceName: string;
+ deviceType: string;
+ speaker: Speaker;
+}
+
+interface Meeting {
+ meetingGroup: number;
+ meetingStart: string;
+ meetingEnd: string;
+ fullTranscription: string;
+ name: string | null;
+ participants: string | null;
+ summary: string | null;
+ mergedWith?: number[]; // Array of meeting groups merged with this one
+ selectedDevices: Set<string>;
+ deviceNames: Set<string>;
+ segments: MeetingSegment[];
+}
+
+interface Speaker {
+ id: number;
+ name: string;
+}
+
+interface AudioContent {
+ chunkId: number;
+ transcription: string;
+ timestamp: string;
+ filePath: string;
+ offsetIndex: number;
+ tags: string[];
+ deviceName: string;
+ deviceType: string;
+ speaker: Speaker;
+}
+
+interface AudioTranscription {
+ type: "Audio";
+ content: AudioContent;
+}
+
+export default function MeetingHistory({
+ showMeetingHistory,
+ setShowMeetingHistory,
+ className,
+}: {
+ showMeetingHistory: boolean;
+ setShowMeetingHistory: (show: boolean) => void;
+ className?: string;
+}) {
+ 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 });
+ const [isRefreshing, setIsRefreshing] = useState(false);
+ const [customSummaryPrompt, setCustomSummaryPrompt] = useState<string>(
+ "please provide a concise summary of the following meeting transcript"
+ );
+ const [isClearing, setIsClearing] = useState(false);
+
+ useEffect(() => {
+ if (showMeetingHistory) {
+ loadMeetings();
+ }
+ }, [showMeetingHistory]);
+
+ useEffect(() => {
+ setShowError(!!error);
+ }, [error]);
+
+ useEffect(() => {
+ console.log("Dialog state changed:", showMeetingHistory);
+ }, [showMeetingHistory]);
+
+ async function loadMeetings() {
+ setLoading(true);
+ try {
+ const storedMeetings = (await getItem("meetings")) || [];
+ setMeetings(storedMeetings);
+ await fetchMeetings();
+ } catch (err) {
+ setError("failed to load meetings");
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function fetchMeetings() {
+ console.log("fetching meetings...");
+ setLoading(true);
+ try {
+ // Always fetch from the last 7x24 hours
+ const startTime = new Date(
+ Date.now() - 7 * 24 * 60 * 60 * 1000
+ ).toISOString();
+ console.log("searching from:", startTime);
+
+ const response = await fetch(
+ `http://localhost:3030/search?content_type=audio&start_time=${startTime}&limit=1000`
+ );
+ if (!response.ok) {
+ throw new Error("failed to fetch meeting history");
+ }
+ const result = await response.json();
+ const camelCaseResult = keysToCamelCase<{ data: AudioTranscription[] }>(
+ result
+ );
+ console.log("fetch result:", camelCaseResult);
+ const newMeetings = processMeetings(camelCaseResult.data);
+ console.log("processed new meetings:", newMeetings);
+
+ // merge new meetings with stored meetings, updating existing ones
+ let updatedMeetings = [...meetings];
+ newMeetings.forEach((newMeeting) => {
+ const existingMeetingIndex = updatedMeetings.findIndex(
+ (m) => m.meetingGroup === newMeeting.meetingGroup
+ );
+ if (existingMeetingIndex === -1) {
+ // add new meeting if it doesn't exist
+ updatedMeetings.push(newMeeting);
+ } else {
+ // update existing meeting with new data
+ updatedMeetings[existingMeetingIndex] = {
+ ...updatedMeetings[existingMeetingIndex],
+ ...newMeeting,
+ fullTranscription:
+ updatedMeetings[existingMeetingIndex].fullTranscription +
+ newMeeting.fullTranscription,
+ };
+ }
+ });
+
+ // sort meetings by start time (descending)
+ updatedMeetings.sort(
+ (a, b) =>
+ new Date(b.meetingStart).getTime() -
+ new Date(a.meetingStart).getTime()
+ );
+
+ setMeetings(updatedMeetings);
+
+ // store updated meetings
+ await setItem("meetings", updatedMeetings);
+ } catch (err) {
+ setError(
+ "some trouble fetching new meetings. please check health status."
+ );
+ console.error("fetch error:", err);
+ } finally {
+ console.log("fetch completed");
+ setLoading(false);
+ }
+ }
+
+ async function generateSummary(meeting: Meeting) {
+ setIsSummarizing(true);
+
+ try {
+ const openai = new OpenAI({
+ apiKey: settings.openaiApiKey,
+ baseURL: settings.aiUrl,
+ dangerouslyAllowBrowser: true,
+ });
+
+ const model = settings.aiModel;
+
+ // create an enhanced prompt that includes identified participants
+ const enhancedPrompt = meeting.participants
+ ? `${customSummaryPrompt}\n\nparticipants: ${meeting.participants}`
+ : customSummaryPrompt;
+
+ const messages = [
+ {
+ role: "system" as const,
+ content: `you are a helpful assistant that summarizes meetings. `,
+ },
+ {
+ role: "user" as const,
+ content: `${enhancedPrompt}:\n\n${meeting.segments
+ .map((s) => s.transcription)
+ .join("\n")}`,
+ },
+ ];
+
+ const stream = await openai.chat.completions.create({
+ model: model,
+ messages: messages,
+ stream: true,
+ });
+
+ let summary = "";
+ const updatedMeeting = { ...meeting, summary: "" };
+
+ for await (const chunk of stream) {
+ const content = chunk.choices[0]?.delta?.content || "";
+ summary += content;
+ updatedMeeting.summary = summary;
+
+ // update the meeting with the new summary
+ const updatedMeetings = meetings.map((m) =>
+ m.meetingGroup === meeting.meetingGroup ? updatedMeeting : m
+ );
+ setMeetings(updatedMeetings);
+ }
+
+ // final update after streaming is complete
+ const finalUpdatedMeetings = meetings.map((m) =>
+ m.meetingGroup === meeting.meetingGroup ? updatedMeeting : m
+ );
+ setMeetings(finalUpdatedMeetings);
+
+ try {
+ console.log("updating meetings state...");
+ setMeetings(finalUpdatedMeetings);
+
+ console.log("storing meetings in storage...");
+ await setItem("meetings", finalUpdatedMeetings);
+
+ console.log("storage operation completed");
+
+ toast({
+ title: "summary generated",
+ description:
+ "the meeting summary has been created and saved successfully.",
+ });
+ } catch (storageError) {
+ console.error("error updating storage:", storageError);
+ toast({
+ title: "warning",
+ description:
+ "summary generated but couldn't be saved due to storage limits. older meetings might be removed to make space.",
+ variant: "destructive",
+ });
+
+ // attempt to remove older meetings to make space
+ try {
+ const oldMeetings = (await getItem("meetings")) || [];
+ const meetingsToKeep = oldMeetings.slice(-10); // keep only the last 10 meetings
+ await setItem("meetings", meetingsToKeep);
+ setMeetings(meetingsToKeep);
+ toast({
+ title: "storage cleaned",
+ description:
+ "older meetings were removed to make space for new ones.",
+ });
+ } catch (cleanupError) {
+ console.error("failed to clean up storage:", cleanupError);
+ toast({
+ title: "error",
+ description:
+ "failed to clean up storage. please clear your browser data manually.",
+ variant: "destructive",
+ });
+ }
+ }
+ } catch (error) {
+ console.error("error generating summary:", error);
+ toast({
+ title: "error",
+ description: "failed to generate meeting summary. please try again.",
+ variant: "destructive",
+ });
+ } finally {
+ setIsSummarizing(false);
+ }
+ }
+
+ function formatTimestamp(timestamp: string): string {
+ const date = new Date(timestamp);
+ return new Intl.DateTimeFormat("en-US", {
+ year: "numeric",
+ month: "short",
+ day: "2-digit",
+ hour: "2-digit",
+ minute: "2-digit",
+ second: "2-digit",
+ timeZoneName: "short",
+ }).format(date);
+ }
+
+ function processMeetings(transcriptions: AudioTranscription[]): Meeting[] {
+ console.log("processing transcriptions:", transcriptions);
+ let meetings: Meeting[] = [];
+ let currentMeeting: Meeting | null = null;
+ let meetingGroup = 0;
+
+ // sort transcriptions by timestamp
+ transcriptions.sort(
+ (a, b) =>
+ new Date(a.content.timestamp).getTime() -
+ new Date(b.content.timestamp).getTime()
+ );
+
+ transcriptions.forEach((trans, index) => {
+ const currentTime = new Date(trans.content.timestamp);
+ const prevTime =
+ index > 0
+ ? new Date(transcriptions[index - 1].content.timestamp)
+ : null;
+
+ // Get speaker name based on speaker info or device type
+ const speakerName =
+ trans.content.speaker?.name && trans.content.speaker.name.length > 0
+ ? trans.content.speaker.name
+ : trans.content.deviceType?.toLowerCase() === "input"
+ ? "you"
+ : trans.content.deviceType?.toLowerCase() === "output"
+ ? "others"
+ : "unknown";
+
+ if (
+ !currentMeeting ||
+ (prevTime &&
+ currentTime.getTime() - prevTime.getTime() >= 5 * 60 * 1000) // increased to 5 minutes
+ ) {
+ if (currentMeeting) {
+ meetings.push(currentMeeting);
+ }
+ meetingGroup++;
+ currentMeeting = {
+ meetingGroup: meetingGroup,
+ meetingStart: trans.content.timestamp,
+ meetingEnd: trans.content.timestamp,
+ fullTranscription: `${formatTimestamp(
+ trans.content.timestamp
+ )} [${speakerName}] ${trans.content.transcription}\n`,
+ name: null,
+ participants: null,
+ summary: null,
+ selectedDevices: new Set([trans.content.deviceName]),
+ segments: [
+ {
+ timestamp: trans.content.timestamp,
+ transcription: trans.content.transcription,
+ deviceName: trans.content.deviceName,
+ deviceType: trans.content.deviceType,
+ speaker: trans.content.speaker || {
+ id: -1,
+ name: speakerName,
+ },
+ },
+ ],
+ deviceNames: new Set([trans.content.deviceName]),
+ };
+ } else if (currentMeeting) {
+ currentMeeting.meetingEnd = trans.content.timestamp;
+ currentMeeting.fullTranscription += `${formatTimestamp(
+ trans.content.timestamp
+ )} [${speakerName}] ${trans.content.transcription}\n`;
+ currentMeeting.selectedDevices.add(trans.content.deviceName);
+ currentMeeting.segments.push({
+ timestamp: trans.content.timestamp,
+ transcription: trans.content.transcription,
+ deviceName: trans.content.deviceName,
+ deviceType: trans.content.deviceType,
+ speaker: trans.content.speaker || {
+ id: -1,
+ name: speakerName,
+ },
+ });
+ currentMeeting.deviceNames.add(trans.content.deviceName);
+ }
+ });
+
+ if (currentMeeting) {
+ meetings.push(currentMeeting);
+ }
+
+ // sort meetings by start time
+ meetings.sort(
+ (a, b) =>
+ new Date(b.meetingStart).getTime() - new Date(a.meetingStart).getTime()
+ );
+
+ // remove duplicate meetings
+ meetings = meetings.filter(
+ (meeting, index, self) =>
+ index === self.findIndex((t) => t.meetingGroup === meeting.meetingGroup)
+ );
+
+ console.log("processed meetings:", meetings);
+ return meetings.filter(
+ (m) => m.fullTranscription.replace(/\n/g, "").length >= 200
+ );
+ }
+
+ // Memoize expensive computations
+ const sortedMeetings = useMemo(() => {
+ return [...meetings].sort(
+ (a, b) =>
+ new Date(b.meetingStart).getTime() - new Date(a.meetingStart).getTime()
+ );
+ }, [meetings]);
+
+ const copyWithToast = (content: string, type: string) => {
+ copyToClipboard(content);
+ toast({
+ title: "copied to clipboard",
+ description: `${type} has been copied to your clipboard.`,
+ });
+ };
+
+ const handleRefresh = async () => {
+ setIsRefreshing(true);
+ try {
+ await fetchMeetings();
+ toast({
+ title: "meetings refreshed",
+ description: "your meeting history has been updated.",
+ });
+ } catch (error) {
+ console.error("error refreshing meetings:", error);
+ toast({
+ title: "refresh failed",
+ description: "failed to refresh meetings. please try again.",
+ variant: "destructive",
+ });
+ } finally {
+ setIsRefreshing(false);
+ }
+ };
+
+ const handleClearMeetings = async () => {
+ setIsClearing(true);
+ try {
+ await localforage.removeItem("meetings");
+ setMeetings([]);
+ toast({
+ title: "meeting data cleared",
+ description: "all stored meeting data has been removed.",
+ });
+ } catch (error) {
+ console.error("error clearing meeting data:", error);
+ toast({
+ title: "error",
+ description: "failed to clear meeting data. please try again.",
+ variant: "destructive",
+ });
+ } finally {
+ setIsClearing(false);
+ }
+ };
+
+ const mergeMeetings = (index: number) => {
+ const updatedMeetings = [...meetings];
+ const currentMeeting = updatedMeetings[index];
+ const nextMeeting = updatedMeetings[index + 1];
+
+ const mergedMeeting: Meeting = {
+ ...currentMeeting,
+ meetingEnd: new Date(
+ Math.max(
+ new Date(currentMeeting.meetingEnd).getTime(),
+ new Date(nextMeeting.meetingEnd).getTime()
+ )
+ ).toISOString(),
+ meetingStart: new Date(
+ Math.min(
+ new Date(currentMeeting.meetingStart).getTime(),
+ new Date(nextMeeting.meetingStart).getTime()
+ )
+ ).toISOString(),
+ fullTranscription: `${currentMeeting.fullTranscription}\n${nextMeeting.fullTranscription}`,
+ mergedWith: [
+ ...(currentMeeting.mergedWith || []),
+ nextMeeting.meetingGroup,
+ ...(nextMeeting.mergedWith || []),
+ ],
+ segments: [...currentMeeting.segments, ...nextMeeting.segments],
+ selectedDevices: new Set([
+ ...Array.from(currentMeeting.selectedDevices),
+ ...Array.from(nextMeeting.selectedDevices),
+ ]),
+ };
+
+ updatedMeetings[index] = mergedMeeting;
+ updatedMeetings.splice(index + 1, 1); // remove the next meeting
+ setMeetings(updatedMeetings);
+ setItem("meetings", updatedMeetings);
+ };
+
+ const handleDeviceToggle = useCallback(
+ (meetingGroup: number, deviceName: string, isChecked: boolean) => {
+ setMeetings((prevMeetings) => {
+ return prevMeetings.map((meeting) => {
+ if (meeting.meetingGroup === meetingGroup) {
+ const updatedSelectedDevices = new Set(meeting.selectedDevices);
+ if (isChecked) {
+ updatedSelectedDevices.add(deviceName);
+ } else {
+ updatedSelectedDevices.delete(deviceName);
+ }
+ return {
+ ...meeting,
+ selectedDevices: updatedSelectedDevices,
+ };
+ }
+ return meeting;
+ });
+ });
+ },
+ []
+ );
+
+ return (
+ <Card>
+ <CardContent
+ className="h-full"
+ onClick={(e) => {
+ e.stopPropagation();
+ }}
+ >
+ <CardHeader className="py-4">
+ <CardTitle className="flex items-center justify-between">
+ <div className="flex items-center">
+ meeting and conversation history
+ <Badge variant="secondary" className="ml-2">
+ experimental
+ </Badge>
+ </div>
+ <div className="flex space-x-2">
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ onClick={handleClearMeetings}
+ disabled={isClearing}
+ size="sm"
+ variant="outline"
+ className="text-xs"
+ >
+ {isClearing ? (
+ <Trash2 className="h-4 w-4 animate-pulse" />
+ ) : (
+ <Trash2 className="h-4 w-4" />
+ )}
+ <span className="ml-2">reset data</span>
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="left">
+ <p>
+ this will restore your meeting data to the original state
+ based on transcription timestamps,
+ <br />
+ without the editing you have done here
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ onClick={handleRefresh}
+ disabled={isRefreshing}
+ size="sm"
+ variant="outline"
+ className="text-xs "
+ >
+ {isRefreshing ? (
+ <RefreshCw className="h-4 w-4 animate-spin" />
+ ) : (
+ <RefreshCw className="h-4 w-4" />
+ )}
+ <span className="ml-2">refresh</span>
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="left">
+ <p>fetch latest meeting data</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+ </CardTitle>
+ </CardHeader>
+ <CardDescription className="mb-4">
+ <span className="block text-sm text-gray-600">
+ this page provides transcriptions and summaries of your daily
+ meetings. it uses your ai settings to generate summaries. note:
+ phrases like &quot;thank you&quot; or &quot;you know&quot; might be
+ transcription errors. for better accuracy, consider using deepgram
+ as the engine or adjust your prompt to ignore these.
+ </span>
+ <span className="block text-sm text-gray-600 mt-2">
+ <strong>make sure to setup your ai settings</strong>
+ </span>
+ </CardDescription>
+ <div className="flex-grow overflow-auto">
+ {loading ? (
+ <div className="space-y-6">
+ {[1, 2, 3].map((i) => (
+ <div key={i} className="p-4 border rounded animate-pulse">
+ <div className="h-6 bg-gray-200 rounded w-3/4 mb-4"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/2 mb-2"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/4 mb-4"></div>
+ <div className="h-20 bg-gray-200 rounded mb-2"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/3"></div>
+ </div>
+ ))}
+ </div>
+ ) : (
+ <>
+ {showError && error && (
+ <div
+ className="bg-gray-100 border-l-4 border-black text-gray-700 p-4 mb-4 flex justify-between items-center"
+ role="alert"
+ >
+ <div>
+ <p className="font-bold">warning</p>
+ <p>{error}</p>
+ </div>
+ <button
+ onClick={() => setShowError(false)}
+ className="text-gray-700 hover:text-black"
+ >
+ <X size={18} />
+ </button>
+ </div>
+ )}
+ {meetings.length === 0 && !loading && !error && (
+ <p className="text-center">no meetings found.</p>
+ )}
+ <div className="space-y-6">
+ {sortedMeetings.map((meeting, index) => (
+ <React.Fragment key={index}>
+ <Card className="relative">
+ <CardHeader>
+ <div className="grid grid-cols-2">
+ <div>
+ <CardTitle className="text-lg font-semibold flex flex-wrap items-center gap-2">
+ meeting {meeting.meetingGroup}
+ {meeting.mergedWith &&
+ meeting.mergedWith.length > 0 && (
+ <>
+ <Badge variant="secondary">merged</Badge>
+ {meeting.mergedWith.map((mergedGroupId) => (
+ <Badge
+ key={mergedGroupId}
+ variant="outline"
+ >
+ meeting {mergedGroupId}
+ </Badge>
+ ))}
+ </>
+ )}
+ </CardTitle>
+ <CardDescription>
+ {formatDate(meeting.meetingStart)} -{" "}
+ {formatDate(meeting.meetingEnd)}
+ </CardDescription>
+ </div>
+ <div className="mb-4 text-end">
+ <h4 className="font-semibold mb-2">Devices:</h4>
+ <div className="flex flex-wrap gap-4 justify-end">
+ {Array.from(meeting.deviceNames).map(
+ (deviceName) => (
+ <label
+ key={deviceName}
+ className="flex items-center space-x-2"
+ >
+ <Checkbox
+ checked={meeting.selectedDevices.has(
+ deviceName
+ )}
+ onCheckedChange={(checked) =>
+ handleDeviceToggle(
+ meeting.meetingGroup,
+ deviceName,
+ checked as boolean
+ )
+ }
+ />
+ <span className="text-sm">
+ {deviceName}
+ </span>
+ </label>
+ )
+ )}
+ </div>
+ </div>
+ </div>
+ </CardHeader>
+ <CardContent>
+ <div className="mb-4 relative">
+ <h4 className="font-semibold mb-2">transcription:</h4>
+ <Button
+ onClick={() =>
+ copyWithToast(
+ meeting.segments
+ .filter((s) =>
+ meeting.selectedDevices.has(s.deviceName)
+ )
+ .map((s) => {
+ return `${formatTimestamp(s.timestamp)} [${
+ s.speaker
+ ? s.speaker.name
+ : s.deviceType?.toLowerCase() ===
+ "input"
+ ? "you"
+ : "others"
+ }] ${s.transcription}`;
+ })
+ .join("\n"),
+ "transcription"
+ )
+ }
+ className="absolute top-0 right-0 p-1 h-6 w-6"
+ variant="outline"
+ size="icon"
+ >
+ <Copy className="h-4 w-4" />
+ </Button>
+ <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>
+ </div>
+ <div className="relative">
+ <h4 className="font-semibold mb-2">summary:</h4>
+ {meeting.summary && (
+ <Button
+ onClick={() =>
+ copyWithToast(meeting.summary || "", "summary")
+ }
+ className="absolute top-0 right-0 p-1 h-6 w-6"
+ variant="outline"
+ size="icon"
+ >
+ <Copy className="h-4 w-4" />
+ </Button>
+ )}
+ {meeting.summary ? (
+ <ReactMarkdown className="prose max-w-none">
+ {meeting.summary}
+ </ReactMarkdown>
+ ) : (
+ <div className="flex items-center mt-2">
+ <Input
+ type="text"
+ value={customSummaryPrompt}
+ onChange={(e) =>
+ setCustomSummaryPrompt(e.target.value)
+ }
+ placeholder="custom summary prompt (optional)"
+ className="mr-2 p-2 border rounded text-sm flex-grow"
+ />
+ <Button
+ onClick={() => generateSummary(meeting)}
+ disabled={isSummarizing}
+ >
+ {isSummarizing ? (
+ <FileText className="h-4 w-4 mr-2 animate-pulse" />
+ ) : (
+ <PlusCircle className="h-4 w-4 mr-2" />
+ )}
+ {isSummarizing
+ ? "generating summary..."
+ : "generate summary"}
+ </Button>
+ </div>
+ )}
+ </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>
+ </>
+ )}
+ </div>
+ </CardContent>
+ </Card>
+ );
+}
diff --git a/pipes/identify-speakers/src/components/ui/accordion.tsx b/pipes/identify-speakers/src/components/ui/accordion.tsx
new file mode 100644
index 000000000..24c788c2c
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/accordion.tsx
@@ -0,0 +1,58 @@
+"use client"
+
+import * as React from "react"
+import * as AccordionPrimitive from "@radix-ui/react-accordion"
+import { ChevronDown } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Accordion = AccordionPrimitive.Root
+
+const AccordionItem = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
+>(({ className, ...props }, ref) => (
+ <AccordionPrimitive.Item
+ ref={ref}
+ className={cn("border-b", className)}
+ {...props}
+ />
+))
+AccordionItem.displayName = "AccordionItem"
+
+const AccordionTrigger = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
+>(({ className, children, ...props }, ref) => (
+ <AccordionPrimitive.Header className="flex">
+ <AccordionPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
+ </AccordionPrimitive.Trigger>
+ </AccordionPrimitive.Header>
+))
+AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
+
+const AccordionContent = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
+>(({ className, children, ...props }, ref) => (
+ <AccordionPrimitive.Content
+ ref={ref}
+ className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
+ {...props}
+ >
+ <div className={cn("pb-4 pt-0", className)}>{children}</div>
+ </AccordionPrimitive.Content>
+))
+
+AccordionContent.displayName = AccordionPrimitive.Content.displayName
+
+export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
diff --git a/pipes/identify-speakers/src/components/ui/badge.tsx b/pipes/identify-speakers/src/components/ui/badge.tsx
new file mode 100644
index 000000000..f000e3ef5
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/badge.tsx
@@ -0,0 +1,36 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const badgeVariants = cva(
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ {
+ variants: {
+ variant: {
+ default:
+ "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
+ secondary:
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ destructive:
+ "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
+ outline: "text-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+export interface BadgeProps
+ extends React.HTMLAttributes<HTMLDivElement>,
+ VariantProps<typeof badgeVariants> {}
+
+function Badge({ className, variant, ...props }: BadgeProps) {
+ return (
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
+ )
+}
+
+export { Badge, badgeVariants }
diff --git a/pipes/identify-speakers/src/components/ui/button.tsx b/pipes/identify-speakers/src/components/ui/button.tsx
new file mode 100644
index 000000000..36496a287
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/button.tsx
@@ -0,0 +1,56 @@
+import * as React from "react"
+import { Slot } from "@radix-ui/react-slot"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const buttonVariants = cva(
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ {
+ variants: {
+ variant: {
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
+ destructive:
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
+ outline:
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
+ secondary:
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ link: "text-primary underline-offset-4 hover:underline",
+ },
+ size: {
+ default: "h-10 px-4 py-2",
+ sm: "h-9 rounded-md px-3",
+ lg: "h-11 rounded-md px-8",
+ icon: "h-10 w-10",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
+ VariantProps<typeof buttonVariants> {
+ asChild?: boolean
+}
+
+const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "button"
+ return (
+ <Comp
+ className={cn(buttonVariants({ variant, size, className }))}
+ ref={ref}
+ {...props}
+ />
+ )
+ }
+)
+Button.displayName = "Button"
+
+export { Button, buttonVariants }
diff --git a/pipes/identify-speakers/src/components/ui/calendar.tsx b/pipes/identify-speakers/src/components/ui/calendar.tsx
new file mode 100644
index 000000000..61d2b451e
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/calendar.tsx
@@ -0,0 +1,66 @@
+"use client"
+
+import * as React from "react"
+import { ChevronLeft, ChevronRight } from "lucide-react"
+import { DayPicker } from "react-day-picker"
+
+import { cn } from "@/lib/utils"
+import { buttonVariants } from "@/components/ui/button"
+
+export type CalendarProps = React.ComponentProps<typeof DayPicker>
+
+function Calendar({
+ className,
+ classNames,
+ showOutsideDays = true,
+ ...props
+}: CalendarProps) {
+ return (
+ <DayPicker
+ showOutsideDays={showOutsideDays}
+ className={cn("p-3", className)}
+ classNames={{
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
+ month: "space-y-4",
+ caption: "flex justify-center pt-1 relative items-center",
+ caption_label: "text-sm font-medium",
+ nav: "space-x-1 flex items-center",
+ nav_button: cn(
+ buttonVariants({ variant: "outline" }),
+ "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
+ ),
+ nav_button_previous: "absolute left-1",
+ nav_button_next: "absolute right-1",
+ table: "w-full border-collapse space-y-1",
+ head_row: "flex",
+ head_cell:
+ "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
+ row: "flex w-full mt-2",
+ cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
+ day: cn(
+ buttonVariants({ variant: "ghost" }),
+ "h-9 w-9 p-0 font-normal aria-selected:opacity-100"
+ ),
+ day_range_end: "day-range-end",
+ day_selected:
+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
+ day_today: "bg-accent text-accent-foreground",
+ day_outside:
+ "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",
+ day_disabled: "text-muted-foreground opacity-50",
+ day_range_middle:
+ "aria-selected:bg-accent aria-selected:text-accent-foreground",
+ day_hidden: "invisible",
+ ...classNames,
+ }}
+ components={{
+ IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
+ IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
+ }}
+ {...props}
+ />
+ )
+}
+Calendar.displayName = "Calendar"
+
+export { Calendar }
diff --git a/pipes/identify-speakers/src/components/ui/card.tsx b/pipes/identify-speakers/src/components/ui/card.tsx
new file mode 100644
index 000000000..f62edea57
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/card.tsx
@@ -0,0 +1,79 @@
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+const Card = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
+ className
+ )}
+ {...props}
+ />
+))
+Card.displayName = "Card"
+
+const CardHeader = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
+ {...props}
+ />
+))
+CardHeader.displayName = "CardHeader"
+
+const CardTitle = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ "text-2xl font-semibold leading-none tracking-tight",
+ className
+ )}
+ {...props}
+ />
+))
+CardTitle.displayName = "CardTitle"
+
+const CardDescription = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+))
+CardDescription.displayName = "CardDescription"
+
+const CardContent = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
+))
+CardContent.displayName = "CardContent"
+
+const CardFooter = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("flex items-center p-6 pt-0", className)}
+ {...props}
+ />
+))
+CardFooter.displayName = "CardFooter"
+
+export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
diff --git a/pipes/identify-speakers/src/components/ui/checkbox.tsx b/pipes/identify-speakers/src/components/ui/checkbox.tsx
new file mode 100644
index 000000000..df61a1388
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/checkbox.tsx
@@ -0,0 +1,30 @@
+"use client"
+
+import * as React from "react"
+import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
+import { Check } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Checkbox = React.forwardRef<
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
+>(({ className, ...props }, ref) => (
+ <CheckboxPrimitive.Root
+ ref={ref}
+ className={cn(
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
+ className
+ )}
+ {...props}
+ >
+ <CheckboxPrimitive.Indicator
+ className={cn("flex items-center justify-center text-current")}
+ >
+ <Check className="h-4 w-4" />
+ </CheckboxPrimitive.Indicator>
+ </CheckboxPrimitive.Root>
+))
+Checkbox.displayName = CheckboxPrimitive.Root.displayName
+
+export { Checkbox }
diff --git a/pipes/identify-speakers/src/components/ui/codeblock.tsx b/pipes/identify-speakers/src/components/ui/codeblock.tsx
new file mode 100644
index 000000000..e52893032
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/codeblock.tsx
@@ -0,0 +1,148 @@
+// Inspired by Chatbot-UI and modified to fit the needs of this project
+// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Markdown/CodeBlock.tsx
+
+"use client";
+
+import { FC, memo } from "react";
+import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
+import { coldarkDark } from "react-syntax-highlighter/dist/cjs/styles/prism";
+
+import { useCopyToClipboard } from "@/lib/hooks/use-copy-to-clipboard";
+import { IconCheck, IconCopy, IconDownload } from "@/components/ui/icons";
+import { Button } from "@/components/ui/button";
+
+interface Props {
+ language: string;
+ value: string;
+}
+
+interface languageMap {
+ [key: string]: string | undefined;
+}
+
+export const programmingLanguages: languageMap = {
+ javascript: ".js",
+ python: ".py",
+ java: ".java",
+ c: ".c",
+ cpp: ".cpp",
+ "c++": ".cpp",
+ "c#": ".cs",
+ ruby: ".rb",
+ php: ".php",
+ swift: ".swift",
+ "objective-c": ".m",
+ kotlin: ".kt",
+ typescript: ".ts",
+ go: ".go",
+ perl: ".pl",
+ rust: ".rs",
+ scala: ".scala",
+ haskell: ".hs",
+ lua: ".lua",
+ shell: ".sh",
+ sql: ".sql",
+ html: ".html",
+ css: ".css",
+ // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component
+};
+
+export const generateRandomString = (length: number, lowercase = false) => {
+ const chars = "ABCDEFGHJKLMNPQRSTUVWXY3456789"; // excluding similar looking characters like Z, 2, I, 1, O, 0
+ let result = "";
+ for (let i = 0; i < length; i++) {
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
+ }
+ return lowercase ? result.toLowerCase() : result;
+};
+
+const CodeBlock: FC<Props> = memo(({ language, value }) => {
+ const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });
+
+ const downloadAsFile = () => {
+ if (typeof window === "undefined") {
+ return;
+ }
+ const fileExtension = programmingLanguages[language] || ".file";
+ const suggestedFileName = `file-${generateRandomString(
+ 3,
+ true
+ )}${fileExtension}`;
+ const fileName = window.prompt("Enter file name", suggestedFileName);
+
+ if (!fileName) {
+ // User pressed cancel on prompt.
+ return;
+ }
+
+ const blob = new Blob([value], { type: "text/plain" });
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.download = fileName;
+ link.href = url;
+ link.style.display = "none";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ };
+
+ const onCopy = () => {
+ if (isCopied) return;
+ copyToClipboard(value);
+ };
+
+ return (
+ <div className="relative w-full font-sans codeblock bg-zinc-950">
+ <div className="flex items-center justify-between w-full px-6 py-2 pr-4 bg-zinc-800 text-zinc-100">
+ <span className="text-xs lowercase">{language}</span>
+ <div className="flex items-center space-x-1">
+ <Button
+ variant="ghost"
+ className="hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"
+ onClick={downloadAsFile}
+ size="icon"
+ >
+ <IconDownload />
+ <span className="sr-only">Download</span>
+ </Button>
+ <Button
+ variant="ghost"
+ size="icon"
+ className="text-xs hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"
+ onClick={onCopy}
+ >
+ {isCopied ? <IconCheck /> : <IconCopy />}
+ <span className="sr-only">Copy code</span>
+ </Button>
+ </div>
+ </div>
+ <SyntaxHighlighter
+ language={language}
+ style={coldarkDark}
+ PreTag="div"
+ showLineNumbers
+ customStyle={{
+ margin: 0,
+ width: "100%",
+ background: "transparent",
+ padding: "1.5rem 1rem",
+ }}
+ lineNumberStyle={{
+ userSelect: "none",
+ }}
+ codeTagProps={{
+ style: {
+ fontSize: "0.9rem",
+ fontFamily: "var(--font-mono)",
+ },
+ }}
+ >
+ {value}
+ </SyntaxHighlighter>
+ </div>
+ );
+});
+CodeBlock.displayName = "CodeBlock";
+
+export { CodeBlock };
diff --git a/pipes/identify-speakers/src/components/ui/command.tsx b/pipes/identify-speakers/src/components/ui/command.tsx
new file mode 100644
index 000000000..59a264529
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/command.tsx
@@ -0,0 +1,153 @@
+"use client"
+
+import * as React from "react"
+import { type DialogProps } from "@radix-ui/react-dialog"
+import { Command as CommandPrimitive } from "cmdk"
+import { Search } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+import { Dialog, DialogContent } from "@/components/ui/dialog"
+
+const Command = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive
+ ref={ref}
+ className={cn(
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
+ className
+ )}
+ {...props}
+ />
+))
+Command.displayName = CommandPrimitive.displayName
+
+const CommandDialog = ({ children, ...props }: DialogProps) => {
+ return (
+ <Dialog {...props}>
+ <DialogContent className="overflow-hidden p-0 shadow-lg">
+ <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
+ {children}
+ </Command>
+ </DialogContent>
+ </Dialog>
+ )
+}
+
+const CommandInput = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Input>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
+>(({ className, ...props }, ref) => (
+ <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
+ <CommandPrimitive.Input
+ ref={ref}
+ className={cn(
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ {...props}
+ />
+ </div>
+))
+
+CommandInput.displayName = CommandPrimitive.Input.displayName
+
+const CommandList = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.List>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.List
+ ref={ref}
+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
+ {...props}
+ />
+))
+
+CommandList.displayName = CommandPrimitive.List.displayName
+
+const CommandEmpty = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Empty>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
+>((props, ref) => (
+ <CommandPrimitive.Empty
+ ref={ref}
+ className="py-6 text-center text-sm"
+ {...props}
+ />
+))
+
+CommandEmpty.displayName = CommandPrimitive.Empty.displayName
+
+const CommandGroup = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Group>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Group
+ ref={ref}
+ className={cn(
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+))
+
+CommandGroup.displayName = CommandPrimitive.Group.displayName
+
+const CommandSeparator = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 h-px bg-border", className)}
+ {...props}
+ />
+))
+CommandSeparator.displayName = CommandPrimitive.Separator.displayName
+
+const CommandItem = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ className
+ )}
+ {...props}
+ />
+))
+
+CommandItem.displayName = CommandPrimitive.Item.displayName
+
+const CommandShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLSpanElement>) => {
+ return (
+ <span
+ className={cn(
+ "ml-auto text-xs tracking-widest text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+CommandShortcut.displayName = "CommandShortcut"
+
+export {
+ Command,
+ CommandDialog,
+ CommandInput,
+ CommandList,
+ CommandEmpty,
+ CommandGroup,
+ CommandItem,
+ CommandShortcut,
+ CommandSeparator,
+}
diff --git a/pipes/identify-speakers/src/components/ui/dialog.tsx b/pipes/identify-speakers/src/components/ui/dialog.tsx
new file mode 100644
index 000000000..01ff19c7e
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/dialog.tsx
@@ -0,0 +1,122 @@
+"use client"
+
+import * as React from "react"
+import * as DialogPrimitive from "@radix-ui/react-dialog"
+import { X } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Dialog = DialogPrimitive.Root
+
+const DialogTrigger = DialogPrimitive.Trigger
+
+const DialogPortal = DialogPrimitive.Portal
+
+const DialogClose = DialogPrimitive.Close
+
+const DialogOverlay = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Overlay
+ ref={ref}
+ className={cn(
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
+ className
+ )}
+ {...props}
+ />
+))
+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
+
+const DialogContent = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
+>(({ className, children, ...props }, ref) => (
+ <DialogPortal>
+ <DialogOverlay />
+ <DialogPrimitive.Content
+ ref={ref}
+ className={cn(
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
+ <X className="h-4 w-4" />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ </DialogPrimitive.Content>
+ </DialogPortal>
+))
+DialogContent.displayName = DialogPrimitive.Content.displayName
+
+const DialogHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col space-y-1.5 text-center sm:text-left",
+ className
+ )}
+ {...props}
+ />
+)
+DialogHeader.displayName = "DialogHeader"
+
+const DialogFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
+ className
+ )}
+ {...props}
+ />
+)
+DialogFooter.displayName = "DialogFooter"
+
+const DialogTitle = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Title>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Title
+ ref={ref}
+ className={cn(
+ "text-lg font-semibold leading-none tracking-tight",
+ className
+ )}
+ {...props}
+ />
+))
+DialogTitle.displayName = DialogPrimitive.Title.displayName
+
+const DialogDescription = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Description>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Description
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+))
+DialogDescription.displayName = DialogPrimitive.Description.displayName
+
+export {
+ Dialog,
+ DialogPortal,
+ DialogOverlay,
+ DialogClose,
+ DialogTrigger,
+ DialogContent,
+ DialogHeader,
+ DialogFooter,
+ DialogTitle,
+ DialogDescription,
+}
diff --git a/pipes/identify-speakers/src/components/ui/icons.tsx b/pipes/identify-speakers/src/components/ui/icons.tsx
new file mode 100644
index 000000000..492377647
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/icons.tsx
@@ -0,0 +1,593 @@
+"use client";
+
+import * as React from "react";
+
+import { cn } from "@/lib/utils";
+
+function IconNextChat({
+ className,
+ inverted,
+ ...props
+}: React.ComponentProps<"svg"> & { inverted?: boolean }) {
+ const id = React.useId();
+
+ return (
+ <svg
+ viewBox="0 0 17 17"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <defs>
+ <linearGradient
+ id={`gradient-${id}-1`}
+ x1="10.6889"
+ y1="10.3556"
+ x2="13.8445"
+ y2="14.2667"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stopColor={inverted ? "white" : "black"} />
+ <stop
+ offset={1}
+ stopColor={inverted ? "white" : "black"}
+ stopOpacity={0}
+ />
+ </linearGradient>
+ <linearGradient
+ id={`gradient-${id}-2`}
+ x1="11.7555"
+ y1="4.8"
+ x2="11.7376"
+ y2="9.50002"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stopColor={inverted ? "white" : "black"} />
+ <stop
+ offset={1}
+ stopColor={inverted ? "white" : "black"}
+ stopOpacity={0}
+ />
+ </linearGradient>
+ </defs>
+ <path
+ d="M1 16L2.58314 11.2506C1.83084 9.74642 1.63835 8.02363 2.04013 6.39052C2.4419 4.75741 3.41171 3.32057 4.776 2.33712C6.1403 1.35367 7.81003 0.887808 9.4864 1.02289C11.1628 1.15798 12.7364 1.8852 13.9256 3.07442C15.1148 4.26363 15.842 5.83723 15.9771 7.5136C16.1122 9.18997 15.6463 10.8597 14.6629 12.224C13.6794 13.5883 12.2426 14.5581 10.6095 14.9599C8.97637 15.3616 7.25358 15.1692 5.74942 14.4169L1 16Z"
+ fill={inverted ? "black" : "white"}
+ stroke={inverted ? "black" : "white"}
+ strokeWidth={2}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <mask
+ id="mask0_91_2047"
+ style={{ maskType: "alpha" }}
+ maskUnits="userSpaceOnUse"
+ x={1}
+ y={0}
+ width={16}
+ height={16}
+ >
+ <circle cx={9} cy={8} r={8} fill={inverted ? "black" : "white"} />
+ </mask>
+ <g mask="url(#mask0_91_2047)">
+ <circle cx={9} cy={8} r={8} fill={inverted ? "black" : "white"} />
+ <path
+ d="M14.2896 14.0018L7.146 4.8H5.80005V11.1973H6.87681V6.16743L13.4444 14.6529C13.7407 14.4545 14.0231 14.2369 14.2896 14.0018Z"
+ fill={`url(#gradient-${id}-1)`}
+ />
+ <rect
+ x="11.2222"
+ y="4.8"
+ width="1.06667"
+ height="6.4"
+ fill={`url(#gradient-${id}-2)`}
+ />
+ </g>
+ </svg>
+ );
+}
+
+function IconOpenAI({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ fill="currentColor"
+ viewBox="0 0 24 24"
+ role="img"
+ xmlns="http://www.w3.org/2000/svg"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <title>OpenAI icon</title>
+ <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
+ </svg>
+ );
+}
+
+function IconVercel({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ aria-label="Vercel logomark"
+ role="img"
+ viewBox="0 0 74 64"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path
+ d="M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z"
+ fill="currentColor"
+ ></path>
+ </svg>
+ );
+}
+
+function IconGitHub({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ role="img"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <title>GitHub</title>
+ <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
+ </svg>
+ );
+}
+
+function IconSeparator({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ fill="none"
+ shapeRendering="geometricPrecision"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1"
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M16.88 3.549L7.12 20.451"></path>
+ </svg>
+ );
+}
+
+function IconArrowDown({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="m205.66 149.66-72 72a8 8 0 0 1-11.32 0l-72-72a8 8 0 0 1 11.32-11.32L120 196.69V40a8 8 0 0 1 16 0v156.69l58.34-58.35a8 8 0 0 1 11.32 11.32Z" />
+ </svg>
+ );
+}
+
+function IconArrowRight({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="m221.66 133.66-72 72a8 8 0 0 1-11.32-11.32L196.69 136H40a8 8 0 0 1 0-16h156.69l-58.35-58.34a8 8 0 0 1 11.32-11.32l72 72a8 8 0 0 1 0 11.32Z" />
+ </svg>
+ );
+}
+
+function IconUser({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M230.92 212c-15.23-26.33-38.7-45.21-66.09-54.16a72 72 0 1 0-73.66 0c-27.39 8.94-50.86 27.82-66.09 54.16a8 8 0 1 0 13.85 8c18.84-32.56 52.14-52 89.07-52s70.23 19.44 89.07 52a8 8 0 1 0 13.85-8ZM72 96a56 56 0 1 1 56 56 56.06 56.06 0 0 1-56-56Z" />
+ </svg>
+ );
+}
+
+function IconPlus({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8Z" />
+ </svg>
+ );
+}
+
+function IconArrowElbow({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M200 32v144a8 8 0 0 1-8 8H67.31l34.35 34.34a8 8 0 0 1-11.32 11.32l-48-48a8 8 0 0 1 0-11.32l48-48a8 8 0 0 1 11.32 11.32L67.31 168H184V32a8 8 0 0 1 16 0Z" />
+ </svg>
+ );
+}
+
+function IconSpinner({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4 animate-spin", className)}
+ {...props}
+ >
+ <path d="M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128Z" />
+ </svg>
+ );
+}
+
+function IconMessage({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M216 48H40a16 16 0 0 0-16 16v160a15.84 15.84 0 0 0 9.25 14.5A16.05 16.05 0 0 0 40 240a15.89 15.89 0 0 0 10.25-3.78.69.69 0 0 0 .13-.11L82.5 208H216a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16ZM40 224Zm176-32H82.5a16 16 0 0 0-10.3 3.75l-.12.11L40 224V64h176Z" />
+ </svg>
+ );
+}
+
+function IconTrash({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16ZM96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Z" />
+ </svg>
+ );
+}
+
+function IconRefresh({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z" />
+ </svg>
+ );
+}
+
+function IconStop({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z" />
+ </svg>
+ );
+}
+
+function IconSidebar({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16ZM40 56h40v144H40Zm176 144H96V56h120v144Z" />
+ </svg>
+ );
+}
+
+function IconMoon({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M233.54 142.23a8 8 0 0 0-8-2 88.08 88.08 0 0 1-109.8-109.8 8 8 0 0 0-10-10 104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88 104.84 104.84 0 0 0 37-52.91 8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104 106 106 0 0 0 14.92-1.06 89 89 0 0 1-26.02 31.4Z" />
+ </svg>
+ );
+}
+
+function IconSun({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64 64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48 48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z" />
+ </svg>
+ );
+}
+
+function IconCopy({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z" />
+ </svg>
+ );
+}
+
+function IconCheck({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z" />
+ </svg>
+ );
+}
+
+function IconDownload({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z" />
+ </svg>
+ );
+}
+
+function IconClose({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z" />
+ </svg>
+ );
+}
+
+function IconEdit({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 24 24"
+ strokeWidth={1.5}
+ stroke="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
+ />
+ </svg>
+ );
+}
+
+function IconShare({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ viewBox="0 0 256 256"
+ {...props}
+ >
+ <path d="m237.66 106.35-80-80A8 8 0 0 0 144 32v40.35c-25.94 2.22-54.59 14.92-78.16 34.91-28.38 24.08-46.05 55.11-49.76 87.37a12 12 0 0 0 20.68 9.58c11-11.71 50.14-48.74 107.24-52V192a8 8 0 0 0 13.66 5.65l80-80a8 8 0 0 0 0-11.3ZM160 172.69V144a8 8 0 0 0-8-8c-28.08 0-55.43 7.33-81.29 21.8a196.17 196.17 0 0 0-36.57 26.52c5.8-23.84 20.42-46.51 42.05-64.86C99.41 99.77 127.75 88 152 88a8 8 0 0 0 8-8V51.32L220.69 112Z" />
+ </svg>
+ );
+}
+
+function IconUsers({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ viewBox="0 0 256 256"
+ {...props}
+ >
+ <path d="M117.25 157.92a60 60 0 1 0-66.5 0 95.83 95.83 0 0 0-47.22 37.71 8 8 0 1 0 13.4 8.74 80 80 0 0 1 134.14 0 8 8 0 0 0 13.4-8.74 95.83 95.83 0 0 0-47.22-37.71ZM40 108a44 44 0 1 1 44 44 44.05 44.05 0 0 1-44-44Zm210.14 98.7a8 8 0 0 1-11.07-2.33A79.83 79.83 0 0 0 172 168a8 8 0 0 1 0-16 44 44 0 1 0-16.34-84.87 8 8 0 1 1-5.94-14.85 60 60 0 0 1 55.53 105.64 95.83 95.83 0 0 1 47.22 37.71 8 8 0 0 1-2.33 11.07Z" />
+ </svg>
+ );
+}
+
+function IconExternalLink({
+ className,
+ ...props
+}: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ viewBox="0 0 256 256"
+ {...props}
+ >
+ <path d="M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8Z" />
+ </svg>
+ );
+}
+
+function IconChevronUpDown({
+ className,
+ ...props
+}: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ viewBox="0 0 256 256"
+ {...props}
+ >
+ <path d="M181.66 170.34a8 8 0 0 1 0 11.32l-48 48a8 8 0 0 1-11.32 0l-48-48a8 8 0 0 1 11.32-11.32L128 212.69l42.34-42.35a8 8 0 0 1 11.32 0Zm-96-84.68L128 43.31l42.34 42.35a8 8 0 0 0 11.32-11.32l-48-48a8 8 0 0 0-11.32 0l-48 48a8 8 0 0 0 11.32 11.32Z" />
+ </svg>
+ );
+}
+
+function IconLlama({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ fill="currentColor"
+ viewBox="0 0 24 24"
+ role="img"
+ xmlns="http://www.w3.org/2000/svg"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <title>Llama3 icon</title>
+ <circle
+ cx="12"
+ cy="12"
+ r="10"
+ stroke="currentColor"
+ strokeWidth="2"
+ fill="none"
+ />
+ <path
+ d="M6 9l6 6 6-6"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+function IconCode({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ width="15"
+ height="15"
+ viewBox="0 0 15 15"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M9.96424 2.68571C10.0668 2.42931 9.94209 2.13833 9.6857 2.03577C9.4293 1.93322 9.13832 2.05792 9.03576 2.31432L5.03576 12.3143C4.9332 12.5707 5.05791 12.8617 5.3143 12.9642C5.5707 13.0668 5.86168 12.9421 5.96424 12.6857L9.96424 2.68571ZM3.85355 5.14646C4.04882 5.34172 4.04882 5.6583 3.85355 5.85356L2.20711 7.50001L3.85355 9.14646C4.04882 9.34172 4.04882 9.6583 3.85355 9.85356C3.65829 10.0488 3.34171 10.0488 3.14645 9.85356L1.14645 7.85356C0.951184 7.6583 0.951184 7.34172 1.14645 7.14646L3.14645 5.14646C3.34171 4.9512 3.65829 4.9512 3.85355 5.14646ZM11.1464 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14646L13.8536 7.14646C14.0488 7.34172 14.0488 7.6583 13.8536 7.85356L11.8536 9.85356C11.6583 10.0488 11.3417 10.0488 11.1464 9.85356C10.9512 9.6583 10.9512 9.34172 11.1464 9.14646L12.7929 7.50001L11.1464 5.85356C10.9512 5.6583 10.9512 5.34172 11.1464 5.14646Z"
+ fill="currentColor"
+ fillRule="evenodd"
+ clipRule="evenodd"
+ ></path>
+ </svg>
+ );
+}
+
+function IconOllama({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ width="133"
+ height="185"
+ viewBox="0 0 133 185"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+ <rect width="133" height="185" fill="url(#pattern0)" />
+ <defs>
+ <pattern
+ id="pattern0"
+ patternContentUnits="objectBoundingBox"
+ width="1"
+ height="1"
+ >
+ <use
+ xlinkHref="#image0_406_1657"
+ transform="matrix(0.00552486 0 0 0.00397193 0 -0.00840675)"
+ />
+ </pattern>
+ <image
+ id="image0_406_1657"
+ width="181"
+ height="256"
+ xlinkHref="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAAEACAYAAAD1IzfbAAAMQGlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEBoAQSkhN4EkRpASggt9I5gIyQBQokxEFTsyKKCa0FFBGzoqoiCFRA7YmdR7H2xoKKsiwW78iYFdN1XvjffN3f++8+Z/5w5d+beOwCoHeeIRDmoOgC5wnxxbLA/fVxyCp30FJAAARCBOjDncPNEzOjocADLUPv38u46QKTtFXup1j/7/2vR4PHzuAAg0RCn8fK4uRDvBwCv4YrE+QAQpbzZtHyRFMMKtMQwQIgXSXGGHNdIcZoc75bZxMeyIG4HQEmFwxFnAKB6CfL0Am4G1FDth9hRyBMIAVCjQ+yTmzuFB3EqxNbQRgSxVJ+R9oNOxt8004Y1OZyMYSyfi6woBQjyRDmcGf9nOv53yc2RDPmwhFUlUxwSK50zzNvN7ClhUqwCcZ8wLTIKYk2IPwh4MnuIUUqmJCRBbo8acPNYMGdAB2JHHicgDGIDiIOEOZHhCj4tXRDEhhiuEHS6IJ8dD7EuxIv4eYFxCpuN4imxCl9oU7qYxVTwZzlimV+pr/uS7ASmQv91Jp+t0MdUCzPjkyCmQGxeIEiMhFgVYoe87Lgwhc3YwkxW5JCNWBIrjd8c4li+MNhfro8VpIuDYhX2pbl5Q/PFNmYK2JEKvDc/Mz5Enh+sncuRxQ/ngl3iC5kJQzr8vHHhQ3Ph8QMC5XPHnvGFCXEKnQ+ifP9Y+VicIsqJVtjjpvycYClvCrFLXkGcYiyemA8XpFwfTxflR8fL48QLszih0fJ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R9vi6TevDRUfePt9UPSiIRALQJWHvXxtkjqdWrDlg/gT2ySJASaImDlUR9vi6TeyJjVfUa7ZJYQyCNg5VEfb4ukzgcI2b8rZHAamxCoQCAKj4qkXrciWF1zWvmoQyj1+yBg5VEfb4uktr6QZD1t+BSaxowPAlYe9fG2SGorfCyaJ0kINEUgCo+KpOZpjkU2sBglm4RAAQErj/p4WyT1tEeOhaBVH9ep6kjtCYEABKw86uNtkdSPBiSQH7p2/kPaTwgYEbD++GMfb4uk7juMByS2acDYNDQhUIXAllUdNe19vC2Smt9gsAg/qZAkIdAUgW2MDvp4WyR137VJQIAdAsamoQmBKgSsPOrjbZHU1mfv0/6kpirr1J4QcCBg5ZGTt/xG2QNSrlFC9GmN71sA1+ckCYEQBOAPPArhHWPha99vPhaP1Ay6QRoqK8vg5aFGaXxCIIcA/IFHoQJf4e2UFElNR/AP7016Sz9kMwVr2jEgYOWPF1/nK6HQUwDjH5bOliZJCIQiAG/gj4V3832CzTE6J6E9fQKkMQmBAgLwxkJobOYUfJX+BfgyDbquONDzc98fQHrapGEJAStvrhd0y4rwlV1TM+as4kCPz89ozE0e49KQhEARAXgDf0Ll22UG/w9yreSQIAJvAgAAAABJRU5ErkJggg=="
+ />
+ </defs>
+ </svg>
+ );
+}
+
+export {
+ IconOllama,
+ IconEdit,
+ IconNextChat,
+ IconOpenAI,
+ IconVercel,
+ IconGitHub,
+ IconSeparator,
+ IconArrowDown,
+ IconArrowRight,
+ IconUser,
+ IconPlus,
+ IconArrowElbow,
+ IconSpinner,
+ IconMessage,
+ IconTrash,
+ IconRefresh,
+ IconStop,
+ IconSidebar,
+ IconMoon,
+ IconSun,
+ IconCopy,
+ IconCheck,
+ IconDownload,
+ IconClose,
+ IconShare,
+ IconUsers,
+ IconExternalLink,
+ IconChevronUpDown,
+ IconLlama,
+ IconCode,
+};
diff --git a/pipes/identify-speakers/src/components/ui/input.tsx b/pipes/identify-speakers/src/components/ui/input.tsx
new file mode 100644
index 000000000..68551b927
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/input.tsx
@@ -0,0 +1,22 @@
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
+ ({ className, type, ...props }, ref) => {
+ return (
+ <input
+ type={type}
+ className={cn(
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ )
+ }
+)
+Input.displayName = "Input"
+
+export { Input }
diff --git a/pipes/identify-speakers/src/components/ui/label.tsx b/pipes/identify-speakers/src/components/ui/label.tsx
new file mode 100644
index 000000000..534182176
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/label.tsx
@@ -0,0 +1,26 @@
+"use client"
+
+import * as React from "react"
+import * as LabelPrimitive from "@radix-ui/react-label"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const labelVariants = cva(
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
+)
+
+const Label = React.forwardRef<
+ React.ElementRef<typeof LabelPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
+ VariantProps<typeof labelVariants>
+>(({ className, ...props }, ref) => (
+ <LabelPrimitive.Root
+ ref={ref}
+ className={cn(labelVariants(), className)}
+ {...props}
+ />
+))
+Label.displayName = LabelPrimitive.Root.displayName
+
+export { Label }
diff --git a/pipes/identify-speakers/src/components/ui/popover.tsx b/pipes/identify-speakers/src/components/ui/popover.tsx
new file mode 100644
index 000000000..a0ec48bee
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/popover.tsx
@@ -0,0 +1,31 @@
+"use client"
+
+import * as React from "react"
+import * as PopoverPrimitive from "@radix-ui/react-popover"
+
+import { cn } from "@/lib/utils"
+
+const Popover = PopoverPrimitive.Root
+
+const PopoverTrigger = PopoverPrimitive.Trigger
+
+const PopoverContent = React.forwardRef<
+ React.ElementRef<typeof PopoverPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
+>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
+ <PopoverPrimitive.Portal>
+ <PopoverPrimitive.Content
+ ref={ref}
+ align={align}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className
+ )}
+ {...props}
+ />
+ </PopoverPrimitive.Portal>
+))
+PopoverContent.displayName = PopoverPrimitive.Content.displayName
+
+export { Popover, PopoverTrigger, PopoverContent }
diff --git a/pipes/identify-speakers/src/components/ui/progress.tsx b/pipes/identify-speakers/src/components/ui/progress.tsx
new file mode 100644
index 000000000..5c87ea486
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/progress.tsx
@@ -0,0 +1,28 @@
+"use client"
+
+import * as React from "react"
+import * as ProgressPrimitive from "@radix-ui/react-progress"
+
+import { cn } from "@/lib/utils"
+
+const Progress = React.forwardRef<
+ React.ElementRef<typeof ProgressPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
+>(({ className, value, ...props }, ref) => (
+ <ProgressPrimitive.Root
+ ref={ref}
+ className={cn(
+ "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
+ className
+ )}
+ {...props}
+ >
+ <ProgressPrimitive.Indicator
+ className="h-full w-full flex-1 bg-primary transition-all"
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
+ />
+ </ProgressPrimitive.Root>
+))
+Progress.displayName = ProgressPrimitive.Root.displayName
+
+export { Progress }
diff --git a/pipes/identify-speakers/src/components/ui/select.tsx b/pipes/identify-speakers/src/components/ui/select.tsx
new file mode 100644
index 000000000..cbe5a36b6
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/select.tsx
@@ -0,0 +1,160 @@
+"use client"
+
+import * as React from "react"
+import * as SelectPrimitive from "@radix-ui/react-select"
+import { Check, ChevronDown, ChevronUp } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Select = SelectPrimitive.Root
+
+const SelectGroup = SelectPrimitive.Group
+
+const SelectValue = SelectPrimitive.Value
+
+const SelectTrigger = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
+>(({ className, children, ...props }, ref) => (
+ <SelectPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <SelectPrimitive.Icon asChild>
+ <ChevronDown className="h-4 w-4 opacity-50" />
+ </SelectPrimitive.Icon>
+ </SelectPrimitive.Trigger>
+))
+SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
+
+const SelectScrollUpButton = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.ScrollUpButton
+ ref={ref}
+ className={cn(
+ "flex cursor-default items-center justify-center py-1",
+ className
+ )}
+ {...props}
+ >
+ <ChevronUp className="h-4 w-4" />
+ </SelectPrimitive.ScrollUpButton>
+))
+SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
+
+const SelectScrollDownButton = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.ScrollDownButton
+ ref={ref}
+ className={cn(
+ "flex cursor-default items-center justify-center py-1",
+ className
+ )}
+ {...props}
+ >
+ <ChevronDown className="h-4 w-4" />
+ </SelectPrimitive.ScrollDownButton>
+))
+SelectScrollDownButton.displayName =
+ SelectPrimitive.ScrollDownButton.displayName
+
+const SelectContent = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
+>(({ className, children, position = "popper", ...props }, ref) => (
+ <SelectPrimitive.Portal>
+ <SelectPrimitive.Content
+ ref={ref}
+ className={cn(
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ position === "popper" &&
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
+ className
+ )}
+ position={position}
+ {...props}
+ >
+ <SelectScrollUpButton />
+ <SelectPrimitive.Viewport
+ className={cn(
+ "p-1",
+ position === "popper" &&
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
+ )}
+ >
+ {children}
+ </SelectPrimitive.Viewport>
+ <SelectScrollDownButton />
+ </SelectPrimitive.Content>
+ </SelectPrimitive.Portal>
+))
+SelectContent.displayName = SelectPrimitive.Content.displayName
+
+const SelectLabel = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Label>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.Label
+ ref={ref}
+ className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
+ {...props}
+ />
+))
+SelectLabel.displayName = SelectPrimitive.Label.displayName
+
+const SelectItem = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
+>(({ className, children, ...props }, ref) => (
+ <SelectPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <SelectPrimitive.ItemIndicator>
+ <Check className="h-4 w-4" />
+ </SelectPrimitive.ItemIndicator>
+ </span>
+
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
+ </SelectPrimitive.Item>
+))
+SelectItem.displayName = SelectPrimitive.Item.displayName
+
+const SelectSeparator = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
+ {...props}
+ />
+))
+SelectSeparator.displayName = SelectPrimitive.Separator.displayName
+
+export {
+ Select,
+ SelectGroup,
+ SelectValue,
+ SelectTrigger,
+ SelectContent,
+ SelectLabel,
+ SelectItem,
+ SelectSeparator,
+ SelectScrollUpButton,
+ SelectScrollDownButton,
+}
diff --git a/pipes/identify-speakers/src/components/ui/separator.tsx b/pipes/identify-speakers/src/components/ui/separator.tsx
new file mode 100644
index 000000000..12d81c4a8
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/separator.tsx
@@ -0,0 +1,31 @@
+"use client"
+
+import * as React from "react"
+import * as SeparatorPrimitive from "@radix-ui/react-separator"
+
+import { cn } from "@/lib/utils"
+
+const Separator = React.forwardRef<
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
+>(
+ (
+ { className, orientation = "horizontal", decorative = true, ...props },
+ ref
+ ) => (
+ <SeparatorPrimitive.Root
+ ref={ref}
+ decorative={decorative}
+ orientation={orientation}
+ className={cn(
+ "shrink-0 bg-border",
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
+ className
+ )}
+ {...props}
+ />
+ )
+)
+Separator.displayName = SeparatorPrimitive.Root.displayName
+
+export { Separator }
diff --git a/pipes/identify-speakers/src/components/ui/skeleton.tsx b/pipes/identify-speakers/src/components/ui/skeleton.tsx
new file mode 100644
index 000000000..01b8b6d4f
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/skeleton.tsx
@@ -0,0 +1,15 @@
+import { cn } from "@/lib/utils"
+
+function Skeleton({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) {
+ return (
+ <div
+ className={cn("animate-pulse rounded-md bg-muted", className)}
+ {...props}
+ />
+ )
+}
+
+export { Skeleton }
diff --git a/pipes/identify-speakers/src/components/ui/slider.tsx b/pipes/identify-speakers/src/components/ui/slider.tsx
new file mode 100644
index 000000000..c31c2b3bc
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/slider.tsx
@@ -0,0 +1,28 @@
+"use client"
+
+import * as React from "react"
+import * as SliderPrimitive from "@radix-ui/react-slider"
+
+import { cn } from "@/lib/utils"
+
+const Slider = React.forwardRef<
+ React.ElementRef<typeof SliderPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
+>(({ className, ...props }, ref) => (
+ <SliderPrimitive.Root
+ ref={ref}
+ className={cn(
+ "relative flex w-full touch-none select-none items-center",
+ className
+ )}
+ {...props}
+ >
+ <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">
+ <SliderPrimitive.Range className="absolute h-full bg-primary" />
+ </SliderPrimitive.Track>
+ <SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
+ </SliderPrimitive.Root>
+))
+Slider.displayName = SliderPrimitive.Root.displayName
+
+export { Slider }
diff --git a/pipes/identify-speakers/src/components/ui/switch.tsx b/pipes/identify-speakers/src/components/ui/switch.tsx
new file mode 100644
index 000000000..bc69cf2db
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/switch.tsx
@@ -0,0 +1,29 @@
+"use client"
+
+import * as React from "react"
+import * as SwitchPrimitives from "@radix-ui/react-switch"
+
+import { cn } from "@/lib/utils"
+
+const Switch = React.forwardRef<
+ React.ElementRef<typeof SwitchPrimitives.Root>,
+ React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
+>(({ className, ...props }, ref) => (
+ <SwitchPrimitives.Root
+ className={cn(
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
+ className
+ )}
+ {...props}
+ ref={ref}
+ >
+ <SwitchPrimitives.Thumb
+ className={cn(
+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
+ )}
+ />
+ </SwitchPrimitives.Root>
+))
+Switch.displayName = SwitchPrimitives.Root.displayName
+
+export { Switch }
diff --git a/pipes/identify-speakers/src/components/ui/toast.tsx b/pipes/identify-speakers/src/components/ui/toast.tsx
new file mode 100644
index 000000000..521b94b07
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/toast.tsx
@@ -0,0 +1,129 @@
+"use client"
+
+import * as React from "react"
+import * as ToastPrimitives from "@radix-ui/react-toast"
+import { cva, type VariantProps } from "class-variance-authority"
+import { X } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const ToastProvider = ToastPrimitives.Provider
+
+const ToastViewport = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Viewport>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Viewport
+ ref={ref}
+ className={cn(
+ "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
+ className
+ )}
+ {...props}
+ />
+))
+ToastViewport.displayName = ToastPrimitives.Viewport.displayName
+
+const toastVariants = cva(
+ "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
+ {
+ variants: {
+ variant: {
+ default: "border bg-background text-foreground",
+ destructive:
+ "destructive group border-destructive bg-destructive text-destructive-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+const Toast = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Root>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
+ VariantProps<typeof toastVariants>
+>(({ className, variant, ...props }, ref) => {
+ return (
+ <ToastPrimitives.Root
+ ref={ref}
+ className={cn(toastVariants({ variant }), className)}
+ {...props}
+ />
+ )
+})
+Toast.displayName = ToastPrimitives.Root.displayName
+
+const ToastAction = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Action>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Action
+ ref={ref}
+ className={cn(
+ "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
+ className
+ )}
+ {...props}
+ />
+))
+ToastAction.displayName = ToastPrimitives.Action.displayName
+
+const ToastClose = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Close>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Close
+ ref={ref}
+ className={cn(
+ "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
+ className
+ )}
+ toast-close=""
+ {...props}
+ >
+ <X className="h-4 w-4" />
+ </ToastPrimitives.Close>
+))
+ToastClose.displayName = ToastPrimitives.Close.displayName
+
+const ToastTitle = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Title>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Title
+ ref={ref}
+ className={cn("text-sm font-semibold", className)}
+ {...props}
+ />
+))
+ToastTitle.displayName = ToastPrimitives.Title.displayName
+
+const ToastDescription = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Description>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Description
+ ref={ref}
+ className={cn("text-sm opacity-90", className)}
+ {...props}
+ />
+))
+ToastDescription.displayName = ToastPrimitives.Description.displayName
+
+type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>
+
+type ToastActionElement = React.ReactElement<typeof ToastAction>
+
+export {
+ type ToastProps,
+ type ToastActionElement,
+ ToastProvider,
+ ToastViewport,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ ToastClose,
+ ToastAction,
+}
diff --git a/pipes/identify-speakers/src/components/ui/toaster.tsx b/pipes/identify-speakers/src/components/ui/toaster.tsx
new file mode 100644
index 000000000..fe7103d70
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/toaster.tsx
@@ -0,0 +1,35 @@
+"use client"
+
+import { useToast } from "@/components/ui/use-toast"
+import {
+ Toast,
+ ToastClose,
+ ToastDescription,
+ ToastProvider,
+ ToastTitle,
+ ToastViewport,
+} from "@/components/ui/toast"
+
+export function Toaster() {
+ const { toasts } = useToast()
+
+ return (
+ <ToastProvider>
+ {toasts.map(function ({ id, title, description, action, ...props }) {
+ return (
+ <Toast key={id} {...props}>
+ <div className="grid gap-1">
+ {title && <ToastTitle>{title}</ToastTitle>}
+ {description && (
+ <ToastDescription>{description}</ToastDescription>
+ )}
+ </div>
+ {action}
+ <ToastClose />
+ </Toast>
+ )
+ })}
+ <ToastViewport />
+ </ToastProvider>
+ )
+}
diff --git a/pipes/identify-speakers/src/components/ui/tooltip.tsx b/pipes/identify-speakers/src/components/ui/tooltip.tsx
new file mode 100644
index 000000000..30fc44d90
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/tooltip.tsx
@@ -0,0 +1,30 @@
+"use client"
+
+import * as React from "react"
+import * as TooltipPrimitive from "@radix-ui/react-tooltip"
+
+import { cn } from "@/lib/utils"
+
+const TooltipProvider = TooltipPrimitive.Provider
+
+const Tooltip = TooltipPrimitive.Root
+
+const TooltipTrigger = TooltipPrimitive.Trigger
+
+const TooltipContent = React.forwardRef<
+ React.ElementRef<typeof TooltipPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
+>(({ className, sideOffset = 4, ...props }, ref) => (
+ <TooltipPrimitive.Content
+ ref={ref}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className
+ )}
+ {...props}
+ />
+))
+TooltipContent.displayName = TooltipPrimitive.Content.displayName
+
+export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
diff --git a/pipes/identify-speakers/src/components/ui/use-toast.ts b/pipes/identify-speakers/src/components/ui/use-toast.ts
new file mode 100644
index 000000000..02e111d81
--- /dev/null
+++ b/pipes/identify-speakers/src/components/ui/use-toast.ts
@@ -0,0 +1,194 @@
+"use client"
+
+// Inspired by react-hot-toast library
+import * as React from "react"
+
+import type {
+ ToastActionElement,
+ ToastProps,
+} from "@/components/ui/toast"
+
+const TOAST_LIMIT = 1
+const TOAST_REMOVE_DELAY = 1000000
+
+type ToasterToast = ToastProps & {
+ id: string
+ title?: React.ReactNode
+ description?: React.ReactNode
+ action?: ToastActionElement
+}
+
+const actionTypes = {
+ ADD_TOAST: "ADD_TOAST",
+ UPDATE_TOAST: "UPDATE_TOAST",
+ DISMISS_TOAST: "DISMISS_TOAST",
+ REMOVE_TOAST: "REMOVE_TOAST",
+} as const
+
+let count = 0
+
+function genId() {
+ count = (count + 1) % Number.MAX_SAFE_INTEGER
+ return count.toString()
+}
+
+type ActionType = typeof actionTypes
+
+type Action =
+ | {
+ type: ActionType["ADD_TOAST"]
+ toast: ToasterToast
+ }
+ | {
+ type: ActionType["UPDATE_TOAST"]
+ toast: Partial<ToasterToast>
+ }
+ | {
+ type: ActionType["DISMISS_TOAST"]
+ toastId?: ToasterToast["id"]
+ }
+ | {
+ type: ActionType["REMOVE_TOAST"]
+ toastId?: ToasterToast["id"]
+ }
+
+interface State {
+ toasts: ToasterToast[]
+}
+
+const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>()
+
+const addToRemoveQueue = (toastId: string) => {
+ if (toastTimeouts.has(toastId)) {
+ return
+ }
+
+ const timeout = setTimeout(() => {
+ toastTimeouts.delete(toastId)
+ dispatch({
+ type: "REMOVE_TOAST",
+ toastId: toastId,
+ })
+ }, TOAST_REMOVE_DELAY)
+
+ toastTimeouts.set(toastId, timeout)
+}
+
+export const reducer = (state: State, action: Action): State => {
+ switch (action.type) {
+ case "ADD_TOAST":
+ return {
+ ...state,
+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
+ }
+
+ case "UPDATE_TOAST":
+ return {
+ ...state,
+ toasts: state.toasts.map((t) =>
+ t.id === action.toast.id ? { ...t, ...action.toast } : t
+ ),
+ }
+
+ case "DISMISS_TOAST": {
+ const { toastId } = action
+
+ // ! Side effects ! - This could be extracted into a dismissToast() action,
+ // but I'll keep it here for simplicity
+ if (toastId) {
+ addToRemoveQueue(toastId)
+ } else {
+ state.toasts.forEach((toast) => {
+ addToRemoveQueue(toast.id)
+ })
+ }
+
+ return {
+ ...state,
+ toasts: state.toasts.map((t) =>
+ t.id === toastId || toastId === undefined
+ ? {
+ ...t,
+ open: false,
+ }
+ : t
+ ),
+ }
+ }
+ case "REMOVE_TOAST":
+ if (action.toastId === undefined) {
+ return {
+ ...state,
+ toasts: [],
+ }
+ }
+ return {
+ ...state,
+ toasts: state.toasts.filter((t) => t.id !== action.toastId),
+ }
+ }
+}
+
+const listeners: Array<(state: State) => void> = []
+
+let memoryState: State = { toasts: [] }
+
+function dispatch(action: Action) {
+ memoryState = reducer(memoryState, action)
+ listeners.forEach((listener) => {
+ listener(memoryState)
+ })
+}
+
+type Toast = Omit<ToasterToast, "id">
+
+function toast({ ...props }: Toast) {
+ const id = genId()
+
+ const update = (props: ToasterToast) =>
+ dispatch({
+ type: "UPDATE_TOAST",
+ toast: { ...props, id },
+ })
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id })
+
+ dispatch({
+ type: "ADD_TOAST",
+ toast: {
+ ...props,
+ id,
+ open: true,
+ onOpenChange: (open) => {
+ if (!open) dismiss()
+ },
+ },
+ })
+
+ return {
+ id: id,
+ dismiss,
+ update,
+ }
+}
+
+function useToast() {
+ const [state, setState] = React.useState<State>(memoryState)
+
+ React.useEffect(() => {
+ listeners.push(setState)
+ return () => {
+ const index = listeners.indexOf(setState)
+ if (index > -1) {
+ listeners.splice(index, 1)
+ }
+ }
+ }, [state])
+
+ return {
+ ...state,
+ toast,
+ dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
+ }
+}
+
+export { useToast, toast }
diff --git a/pipes/identify-speakers/src/components/video.tsx b/pipes/identify-speakers/src/components/video.tsx
new file mode 100644
index 000000000..2d71a82e3
--- /dev/null
+++ b/pipes/identify-speakers/src/components/video.tsx
@@ -0,0 +1,133 @@
+import { memo, useCallback, useEffect, useState } from "react";
+import { cn } from "@/lib/utils";
+import { getMediaFile } from "@/lib/actions/video-actions";
+
+export const VideoComponent = memo(function VideoComponent({
+ filePath,
+ customDescription,
+ className,
+}: {
+ filePath: string;
+ customDescription?: string;
+ className?: string;
+}) {
+ const [mediaSrc, setMediaSrc] = useState<string | null>(null);
+ const [error, setError] = useState<string | null>(null);
+ const [isAudio, setIsAudio] = useState(false);
+
+ const sanitizeFilePath = useCallback((path: string): string => {
+ const isWindows = navigator.userAgent.includes("Windows");
+ if (isWindows) {
+ return path; // no sanitization on windows
+ }
+ return path
+ .replace(/^["']|["']$/g, "")
+ .trim()
+ .replace(/\//g, "/");
+ }, []);
+
+ const renderFileLink = () => (
+ // TODO button open link
+ <p className={"mt-2 text-center text-xs text-gray-500"}>
+ {customDescription || filePath}
+ </p>
+ );
+
+ const getMimeType = (path: string): string => {
+ const ext = path.split(".").pop()?.toLowerCase();
+ switch (ext) {
+ case "mp4":
+ return "video/mp4";
+ case "webm":
+ return "video/webm";
+ case "ogg":
+ return "video/ogg";
+ case "mp3":
+ return "audio/mpeg";
+ case "wav":
+ return "audio/wav";
+ default:
+ return isAudio ? "audio/mpeg" : "video/mp4";
+ }
+ };
+
+ useEffect(() => {
+ async function loadMedia() {
+ try {
+ console.log("Loading media:", filePath);
+ const sanitizedPath = sanitizeFilePath(filePath);
+ console.log("Sanitized path:", sanitizedPath);
+ if (!sanitizedPath) {
+ throw new Error("Invalid file path");
+ }
+
+ setIsAudio(
+ sanitizedPath.toLowerCase().includes("input") ||
+ sanitizedPath.toLowerCase().includes("output")
+ );
+
+ const { data, mimeType } = await getMediaFile(sanitizedPath);
+ const binaryData = atob(data);
+ const bytes = new Uint8Array(binaryData.length);
+ for (let i = 0; i < binaryData.length; i++) {
+ bytes[i] = binaryData.charCodeAt(i);
+ }
+ const blob = new Blob([bytes], { type: mimeType });
+ setMediaSrc(URL.createObjectURL(blob));
+ } catch (error) {
+ console.error("Failed to load media:", error);
+ setError(
+ `Failed to load media: ${
+ error instanceof Error ? error.message : "Unknown error"
+ }`
+ );
+ }
+ }
+
+ loadMedia();
+ return () => {
+ if (mediaSrc) URL.revokeObjectURL(mediaSrc);
+ };
+ }, [filePath, sanitizeFilePath]);
+
+ if (error) {
+ return (
+ <div className="w-full p-4 bg-red-100 border border-red-300 rounded-md">
+ <p className="text-red-700">{error}</p>
+ {renderFileLink()}
+ </div>
+ );
+ }
+
+ if (!mediaSrc) {
+ return (
+ <div
+ className={cn(
+ "w-full h-48 bg-gray-200 animate-pulse rounded-md flex items-center justify-center",
+ className
+ )}
+ >
+ <span className="text-gray-500">Loading media...</span>
+ </div>
+ );
+ }
+
+ return (
+ <div className={cn("w-full max-w-2xl text-center", className)}>
+ {isAudio ? (
+ <div className="bg-gray-100 p-4 rounded-md">
+ <audio controls className="w-full">
+ <source src={mediaSrc} type="audio/mpeg" />
+ Your browser does not support the audio element.
+ </audio>
+ </div>
+ ) : (
+ <video controls className="w-full rounded-md">
+ <source src={mediaSrc} type="video/mp4" />
+ Your browser does not support the video tag.
+ </video>
+ )}
+ {renderFileLink()}
+ </div>
+ );
+});
diff --git a/pipes/identify-speakers/src/lib/actions/video-actions.ts b/pipes/identify-speakers/src/lib/actions/video-actions.ts
new file mode 100644
index 000000000..9238c9e96
--- /dev/null
+++ b/pipes/identify-speakers/src/lib/actions/video-actions.ts
@@ -0,0 +1,35 @@
+'use server'
+
+import { readFile } from 'node:fs/promises'
+import { resolve } from 'node:path'
+
+export async function getMediaFile(filePath: string): Promise<{ data: string; mimeType: string }> {
+ try {
+ const absolutePath = resolve(filePath)
+ const buffer = await readFile(absolutePath)
+ // convert to base64
+ const data = buffer.toString('base64')
+
+ const getMimeType = (path: string): string => {
+ const ext = path.split('.').pop()?.toLowerCase()
+ const isAudio = path.toLowerCase().includes('input') || path.toLowerCase().includes('output')
+
+ switch (ext) {
+ case 'mp4': return 'video/mp4'
+ case 'webm': return 'video/webm'
+ case 'ogg': return 'video/ogg'
+ case 'mp3': return 'audio/mpeg'
+ case 'wav': return 'audio/wav'
+ default: return isAudio ? 'audio/mpeg' : 'video/mp4'
+ }
+ }
+
+ return {
+ data,
+ mimeType: getMimeType(filePath)
+ }
+ } catch (error) {
+ console.error('failed to read media file:', error)
+ throw new Error(`failed to read media file: ${error instanceof Error ? error.message : 'unknown error'}`)
+ }
+}
diff --git a/pipes/identify-speakers/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/identify-speakers/src/lib/hooks/use-copy-to-clipboard.tsx
new file mode 100644
index 000000000..e011d69bd
--- /dev/null
+++ b/pipes/identify-speakers/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -0,0 +1,33 @@
+"use client";
+
+import * as React from "react";
+
+export interface useCopyToClipboardProps {
+ timeout?: number;
+}
+
+export function useCopyToClipboard({
+ timeout = 2000,
+}: useCopyToClipboardProps) {
+ const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+
+ const copyToClipboard = (value: string) => {
+ if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
+ return;
+ }
+
+ if (!value) {
+ return;
+ }
+
+ navigator.clipboard.writeText(value).then(() => {
+ setIsCopied(true);
+
+ setTimeout(() => {
+ setIsCopied(false);
+ }, timeout);
+ });
+ };
+
+ return { isCopied, copyToClipboard };
+}
diff --git a/pipes/identify-speakers/src/lib/hooks/use-debounce.tsx b/pipes/identify-speakers/src/lib/hooks/use-debounce.tsx
new file mode 100644
index 000000000..ba49720b5
--- /dev/null
+++ b/pipes/identify-speakers/src/lib/hooks/use-debounce.tsx
@@ -0,0 +1,17 @@
+import { useState, useEffect } from "react";
+
+export function useDebounce<T>(value: T, delay: number): T {
+ const [debouncedValue, setDebouncedValue] = useState<T>(value);
+
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedValue(value);
+ }, delay);
+
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [value, delay]);
+
+ return debouncedValue;
+}
diff --git a/pipes/identify-speakers/src/lib/hooks/use-health-check.tsx b/pipes/identify-speakers/src/lib/hooks/use-health-check.tsx
new file mode 100644
index 000000000..8d32570d0
--- /dev/null
+++ b/pipes/identify-speakers/src/lib/hooks/use-health-check.tsx
@@ -0,0 +1,131 @@
+import { useState, useEffect, useCallback, useRef } from "react";
+
+import { debounce } from "lodash";
+
+
+interface HealthCheckResponse {
+ status: string;
+ status_code: number;
+ last_frame_timestamp: string | null;
+ last_audio_timestamp: string | null;
+ last_ui_timestamp: string | null;
+ frame_status: string;
+ audio_status: string;
+ ui_status: string;
+ message: string;
+}
+
+function isHealthChanged(
+ oldHealth: HealthCheckResponse | null,
+ newHealth: HealthCheckResponse
+): boolean {
+ if (!oldHealth) return true;
+ return (
+ oldHealth.status !== newHealth.status ||
+ oldHealth.status_code !== newHealth.status_code ||
+ oldHealth.last_frame_timestamp !== newHealth.last_frame_timestamp ||
+ oldHealth.last_audio_timestamp !== newHealth.last_audio_timestamp ||
+ oldHealth.last_ui_timestamp !== newHealth.last_ui_timestamp ||
+ oldHealth.frame_status !== newHealth.frame_status ||
+ oldHealth.audio_status !== newHealth.audio_status ||
+ oldHealth.ui_status !== newHealth.ui_status ||
+ oldHealth.message !== newHealth.message
+ );
+}
+
+interface HealthCheckHook {
+ health: HealthCheckResponse | null;
+ isServerDown: boolean;
+ isLoading: boolean;
+ fetchHealth: () => Promise<void>;
+ debouncedFetchHealth: () => Promise<void>;
+}
+
+export function useHealthCheck() {
+ const [health, setHealth] = useState<HealthCheckResponse | null>(null);
+ const [isServerDown, setIsServerDown] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+ const abortControllerRef = useRef<AbortController | null>(null);
+ const healthRef = useRef(health);
+
+ const fetchHealth = useCallback(async () => {
+ if (abortControllerRef.current) {
+ abortControllerRef.current.abort();
+ }
+
+ abortControllerRef.current = new AbortController();
+
+ try {
+ setIsLoading(true);
+ const response = await fetch("http://localhost:3030/health", {
+ cache: "no-store",
+ signal: abortControllerRef.current.signal,
+ headers: {
+ "Cache-Control": "no-cache",
+ Pragma: "no-cache",
+ },
+ });
+
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+
+ const data: HealthCheckResponse = await response.json();
+
+ if (isHealthChanged(healthRef.current, data)) {
+ setHealth(data);
+ healthRef.current = data;
+ }
+
+ setIsServerDown(false);
+ } catch (error) {
+ if (error instanceof Error && error.name === "AbortError") {
+ return;
+ }
+
+ // console.error("Health check error:", error);
+ if (!isServerDown) {
+ setIsServerDown(true);
+ const errorHealth: HealthCheckResponse = {
+ last_frame_timestamp: null,
+ last_audio_timestamp: null,
+ last_ui_timestamp: null,
+ frame_status: "error",
+ audio_status: "error",
+ ui_status: "error",
+ status: "error",
+ status_code: 500,
+ message: "Failed to fetch health status. Server might be down.",
+ };
+ setHealth(errorHealth);
+ healthRef.current = errorHealth;
+ }
+ } finally {
+ setIsLoading(false);
+ }
+ }, [isServerDown, setIsLoading]);
+
+ const debouncedFetchHealth = useCallback(debounce(fetchHealth, 200), [
+ fetchHealth,
+ ]);
+
+ useEffect(() => {
+ fetchHealth();
+ const interval = setInterval(fetchHealth, 1000);
+
+ return () => {
+ clearInterval(interval);
+ if (abortControllerRef.current) {
+ abortControllerRef.current.abort();
+ }
+ };
+ }, [fetchHealth]);
+
+ return {
+ health,
+ isServerDown,
+ isLoading,
+ fetchHealth,
+ debouncedFetchHealth,
+ } as HealthCheckHook;
+}
diff --git a/pipes/identify-speakers/src/lib/hooks/use-search-history.tsx b/pipes/identify-speakers/src/lib/hooks/use-search-history.tsx
new file mode 100644
index 000000000..4673e3e22
--- /dev/null
+++ b/pipes/identify-speakers/src/lib/hooks/use-search-history.tsx
@@ -0,0 +1,127 @@
+"use client";
+
+import { useEffect, useState } from 'react';
+import localforage from 'localforage';
+
+export interface SearchHistory {
+ id: string;
+ query: string;
+ timestamp: string;
+ searchParams: {
+ q?: string;
+ content_type: string;
+ limit: number;
+ offset: number;
+ start_time: string;
+ end_time: string;
+ app_name?: string;
+ window_name?: string;
+ include_frames: boolean;
+ min_length: number;
+ max_length: number;
+ };
+ results: any[];
+ messages: {
+ id: string;
+ type: 'search' | 'ai';
+ content: string;
+ timestamp: string;
+ }[];
+ }
+
+const HISTORY_KEY = 'screenpipe-search-history';
+
+export function useSearchHistory() {
+ const [searches, setSearches] = useState<SearchHistory[]>([]);
+ const [currentSearchId, setCurrentSearchId] = useState<string | null>(null);
+ const [isLoading, setIsLoading] = useState(true);
+ const [isCollapsed, setIsCollapsed] = useState(true);
+
+ useEffect(() => {
+ loadSearches();
+ }, []);
+
+ const loadSearches = async () => {
+ try {
+ const stored = await localforage.getItem<SearchHistory[]>(HISTORY_KEY);
+ setSearches(stored || []);
+ } catch (error) {
+ console.error('failed to load search history:', error);
+ }
+ setIsLoading(false);
+ };
+
+ const saveSearches = async (updated: SearchHistory[]) => {
+ try {
+ await localforage.setItem(HISTORY_KEY, updated);
+ setSearches(updated);
+ } catch (error) {
+ console.error('failed to save search history:', error);
+ }
+ };
+
+ const addSearch = async (searchParams: any, results: any[]) => {
+ const timestamp = new Date().toISOString();
+ const newSearch: SearchHistory = {
+ id: crypto.randomUUID(),
+ query: searchParams.q || '',
+ timestamp,
+ searchParams,
+ results,
+ messages: [{
+ id: crypto.randomUUID(),
+ type: 'search' as const,
+ content: searchParams.q || '',
+ timestamp
+ }]
+ };
+
+ const updated = [newSearch, ...searches];
+ await saveSearches(updated);
+ setCurrentSearchId(newSearch.id);
+ return newSearch.id;
+ };
+
+ const addAIResponse = async (searchId: string, response: string) => {
+ const timestamp = new Date().toISOString();
+ const updated = searches.map(search => {
+ if (search.id === searchId) {
+ return {
+ ...search,
+ messages: [...search.messages, {
+ id: crypto.randomUUID(),
+ type: 'ai' as const,
+ content: response,
+ timestamp
+ }]
+ };
+ }
+ return search;
+ });
+ await saveSearches(updated);
+ };
+
+ const deleteSearch = async (id: string) => {
+ const updated = searches.filter(s => s.id !== id);
+ await saveSearches(updated);
+ if (currentSearchId === id) {
+ setCurrentSearchId(null);
+ }
+ };
+
+ const toggleCollapse = () => {
+ setIsCollapsed(!isCollapsed);
+ };
+
+ return {
+ searches,
+ currentSearchId,
+ setCurrentSearchId,
+ addSearch,
+ addAIResponse,
+ deleteSearch,
+ isLoading,
+ isCollapsed,
+ toggleCollapse
+ };
+}
diff --git a/pipes/identify-speakers/src/lib/hooks/use-settings.tsx b/pipes/identify-speakers/src/lib/hooks/use-settings.tsx
new file mode 100644
index 000000000..7c4f3a6ea
--- /dev/null
+++ b/pipes/identify-speakers/src/lib/hooks/use-settings.tsx
@@ -0,0 +1,106 @@
+"use client";
+
+import { useState, useEffect } from "react";
+import type { Settings } from "@screenpipe/js";
+
+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: "",
+ },
+ };
+
+ const [settings, setSettings] = useState<Settings>(defaultSettings);
+ const [loading, setLoading] = useState(false);
+ const [error, setError] = useState<Error | null>(null);
+
+ useEffect(() => {
+ const loadSettings = async () => {
+ setLoading(true);
+ try {
+ const response = await fetch("/api/settings");
+ const data = await response.json();
+ setSettings({ ...defaultSettings, ...data });
+ } catch (err) {
+ setError(err as Error);
+ } finally {
+ setLoading(false);
+ }
+ };
+ loadSettings();
+ }, []);
+
+ const updateSetting = async <T extends keyof Settings>(
+ key: T,
+ value: Settings[T]
+ ) => {
+ try {
+ await fetch("/api/settings", {
+ method: "PUT",
+ body: JSON.stringify({ key, value }),
+ });
+ setSettings((prev) => ({ ...prev, [key]: value }));
+ } catch (err) {
+ setError(err as Error);
+ }
+ };
+
+ const updateSettings = async (newSettings: Partial<Settings>) => {
+ try {
+ await fetch("/api/settings", {
+ method: "PUT",
+ body: JSON.stringify({ value: newSettings, isPartialUpdate: true }),
+ });
+ setSettings((prev) => ({ ...prev, ...newSettings }));
+ } catch (err) {
+ setError(err as Error);
+ }
+ };
+
+ const resetSettings = async (settingKey?: keyof Settings) => {
+ try {
+ await fetch("/api/settings", {
+ method: "PUT",
+ body: JSON.stringify({ reset: true, key: settingKey }),
+ });
+ if (settingKey) {
+ setSettings((prev) => ({
+ ...prev,
+ [settingKey]: defaultSettings[settingKey],
+ }));
+ } else {
+ setSettings(defaultSettings);
+ }
+ } catch (err) {
+ setError(err as Error);
+ }
+ };
+
+ return {
+ settings,
+ loading,
+ error,
+ updateSetting,
+ updateSettings,
+ resetSettings,
+ };
+}
diff --git a/pipes/identify-speakers/src/lib/hooks/use-sql-autocomplete.tsx b/pipes/identify-speakers/src/lib/hooks/use-sql-autocomplete.tsx
new file mode 100644
index 000000000..7db3de855
--- /dev/null
+++ b/pipes/identify-speakers/src/lib/hooks/use-sql-autocomplete.tsx
@@ -0,0 +1,61 @@
+import { useState, useEffect, useCallback } from "react";
+
+interface AutocompleteItem {
+ name: string;
+ count: number;
+}
+
+const CACHE_DURATION = 5 * 60 * 1000; // 5 minutes
+
+const cache: Record<string, { data: AutocompleteItem[]; timestamp: number }> =
+ {};
+
+export function useSqlAutocomplete(type: "app" | "window") {
+ const [items, setItems] = useState<AutocompleteItem[]>([]);
+ const [isLoading, setIsLoading] = useState(false);
+
+ const fetchItems = useCallback(async () => {
+ setIsLoading(true);
+ try {
+ const cachedData = cache[type];
+ if (cachedData && Date.now() - cachedData.timestamp < CACHE_DURATION) {
+ setItems(cachedData.data);
+ } else {
+ const query = `
+ SELECT ${
+ type === "app" ? "ocr.app_name" : "ocr.window_name"
+ } as name, COUNT(*) as count
+ FROM ocr_text ocr
+ JOIN frames f ON ocr.frame_id = f.id
+ WHERE f.timestamp > datetime('now', '-7 days')
+ GROUP BY ${type === "app" ? "ocr.app_name" : "ocr.window_name"}
+ ORDER BY count DESC
+ LIMIT 100
+ `;
+ const response = await fetch("http://localhost:3030/raw_sql", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ query }),
+ });
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+ const result = await response.json();
+ setItems(result);
+ cache[type] = { data: result, timestamp: Date.now() };
+ }
+ } catch (error) {
+ console.error("failed to fetch items:", error);
+ } finally {
+ setIsLoading(false);
+ }
+ }, [type]);
+
+ useEffect(() => {
+ fetchItems();
+ }, [fetchItems]);
+
+ return { items, isLoading };
+}
diff --git a/pipes/identify-speakers/src/lib/utils.ts b/pipes/identify-speakers/src/lib/utils.ts
new file mode 100644
index 000000000..7c08df633
--- /dev/null
+++ b/pipes/identify-speakers/src/lib/utils.ts
@@ -0,0 +1,149 @@
+import { stat } from "@tauri-apps/plugin-fs";
+import { platform } from "@tauri-apps/plugin-os";
+import { type ClassValue, clsx } from "clsx";
+import { twMerge } from "tailwind-merge";
+import { ContentItem } from "./screenpipe";
+import levenshtein from "js-levenshtein";
+import { Duration } from "date-fns";
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
+// Add this function to your existing utils.ts file
+export function stripAnsiCodes(str: string): string {
+ return str.replace(/\x1B\[[0-9;]*[JKmsu]/g, "");
+}
+export function toCamelCase(str: string): string {
+ return str.replace(/([-_][a-z])/g, (group) =>
+ group.toUpperCase().replace("-", "").replace("_", "")
+ );
+}
+
+export function keysToCamelCase<T>(obj: any): T {
+ if (Array.isArray(obj)) {
+ return obj.map((v) => keysToCamelCase<T>(v)) as any;
+ } else if (obj !== null && obj.constructor === Object) {
+ return Object.keys(obj).reduce(
+ (result, key) => ({
+ ...result,
+ [toCamelCase(key)]: keysToCamelCase(obj[key]),
+ }),
+ {}
+ ) as T;
+ }
+ return obj;
+}
+
+export function encode(str: string): string {
+ return encodeURIComponent(str).replace(/[!'()*]/g, (c) => {
+ return "%" + c.charCodeAt(0).toString(16).toUpperCase();
+ });
+}
+export const convertHtmlToMarkdown = (html: string) => {
+ const convertedHtml = html.replace(
+ /<img\s+(?:[^>]*?\s+)?src="([^"]*)"(?:\s+(?:[^>]*?\s+)?alt="([^"]*)")?\s*\/?>/g,
+ (match, src, alt) => {
+ return `![${alt || ""}](${src})`;
+ }
+ );
+ return convertedHtml.replace(/<[^>]*>/g, "");
+};
+
+export function getCliPath() {
+ const os = platform();
+ switch (os) {
+ case "windows":
+ return "%LOCALAPPDATA%\\screenpipe\\screenpipe.exe";
+ case "macos":
+ return "/Applications/screenpipe.app/Contents/MacOS/screenpipe";
+ case "linux":
+ return "/usr/local/bin/screenpipe";
+ default:
+ return "screenpipe";
+ }
+}
+
+// Add this pure function outside of the SearchChat component
+export const removeDuplicateSelections = (
+ results: ContentItem[],
+ selectedResults: Set<number>,
+ similarityThreshold: number = 0.9
+): Set<number> => {
+ const newSelectedResults = new Set<number>();
+ const seenContents: string[] = [];
+
+ const getSimilarity = (str1: string, str2: string): number => {
+ const maxLength = Math.max(str1.length, str2.length);
+ const distance = levenshtein(str1, str2);
+ return 1 - distance / maxLength;
+ };
+
+ const isDuplicate = (content: string): boolean => {
+ return seenContents.some(
+ (seenContent) =>
+ getSimilarity(content, seenContent) >= similarityThreshold
+ );
+ };
+
+ Array.from(selectedResults).forEach((index) => {
+ const item = results[index];
+ if (!item || !item.type) return;
+
+ let content = "";
+ if (item.type === "OCR") content = item.content.text;
+ else if (item.type === "Audio") content = item.content.transcription;
+ else if (item.type === "FTS") content = item.content.matched_text;
+
+ if (!isDuplicate(content)) {
+ seenContents.push(content);
+ newSelectedResults.add(index);
+ }
+ });
+
+ return newSelectedResults;
+};
+
+export function parseKeyboardShortcut(shortcut: string): string {
+ if (typeof window !== "undefined") {
+ const os = platform();
+
+ const uniqueKeys = new Set(
+ shortcut
+ .toLowerCase()
+ .split("+")
+ .map((key) => key.trim())
+ );
+
+ return Array.from(uniqueKeys)
+ .map((key) => {
+ if (key === "super") {
+ return os === "macos" ? "⌘" : "⊞";
+ }
+ if (key === "ctrl") return "⌃";
+ if (key === "alt") return os === "macos" ? "⌥" : "Alt";
+ if (key === "shift") return "⇧";
+ return key.charAt(0).toUpperCase() + key.slice(1);
+ })
+ .join(" + ");
+ }
+ return "";
+}
+
+export function stringToColor(str: string): string {
+ let hash = 0;
+ for (let i = 0; i < str.length; i++) {
+ hash = str.charCodeAt(i) + ((hash << 5) - hash);
+ }
+ let color = "#";
+ for (let i = 0; i < 3; i++) {
+ const value = (hash >> (i * 8)) & 0xff;
+ color += ("00" + value.toString(16)).substr(-2);
+ }
+ return color;
+}
+
+export async function getFileSize(filePath: string): Promise<number> {
+ const { size } = await stat(filePath);
+
+ return size;
+}
diff --git a/pipes/identify-speakers/tailwind.config.ts b/pipes/identify-speakers/tailwind.config.ts
new file mode 100644
index 000000000..9a58f7ad4
--- /dev/null
+++ b/pipes/identify-speakers/tailwind.config.ts
@@ -0,0 +1,84 @@
+import type { Config } from "tailwindcss";
+
+export default {
+ darkMode: ["class"],
+ content: [
+ "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
+ "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
+ "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
+ ],
+ theme: {
+ extend: {
+ colors: {
+ background: 'hsl(var(--background))',
+ foreground: 'hsl(var(--foreground))',
+ card: {
+ DEFAULT: 'hsl(var(--card))',
+ foreground: 'hsl(var(--card-foreground))'
+ },
+ popover: {
+ DEFAULT: 'hsl(var(--popover))',
+ foreground: 'hsl(var(--popover-foreground))'
+ },
+ primary: {
+ DEFAULT: 'hsl(var(--primary))',
+ foreground: 'hsl(var(--primary-foreground))'
+ },
+ secondary: {
+ DEFAULT: 'hsl(var(--secondary))',
+ foreground: 'hsl(var(--secondary-foreground))'
+ },
+ muted: {
+ DEFAULT: 'hsl(var(--muted))',
+ foreground: 'hsl(var(--muted-foreground))'
+ },
+ accent: {
+ DEFAULT: 'hsl(var(--accent))',
+ foreground: 'hsl(var(--accent-foreground))'
+ },
+ destructive: {
+ DEFAULT: 'hsl(var(--destructive))',
+ foreground: 'hsl(var(--destructive-foreground))'
+ },
+ border: 'hsl(var(--border))',
+ input: 'hsl(var(--input))',
+ ring: 'hsl(var(--ring))',
+ chart: {
+ '1': 'hsl(var(--chart-1))',
+ '2': 'hsl(var(--chart-2))',
+ '3': 'hsl(var(--chart-3))',
+ '4': 'hsl(var(--chart-4))',
+ '5': 'hsl(var(--chart-5))'
+ }
+ },
+ borderRadius: {
+ lg: 'var(--radius)',
+ md: 'calc(var(--radius) - 2px)',
+ sm: 'calc(var(--radius) - 4px)'
+ },
+ keyframes: {
+ 'accordion-down': {
+ from: {
+ height: '0'
+ },
+ to: {
+ height: 'var(--radix-accordion-content-height)'
+ }
+ },
+ 'accordion-up': {
+ from: {
+ height: 'var(--radix-accordion-content-height)'
+ },
+ to: {
+ height: '0'
+ }
+ }
+ },
+ animation: {
+ 'accordion-down': 'accordion-down 0.2s ease-out',
+ 'accordion-up': 'accordion-up 0.2s ease-out'
+ }
+ }
+ },
+ plugins: [require("tailwindcss-animate")],
+} satisfies Config;
diff --git a/pipes/identify-speakers/tsconfig.json b/pipes/identify-speakers/tsconfig.json
new file mode 100644
index 000000000..c1334095f
--- /dev/null
+++ b/pipes/identify-speakers/tsconfig.json
@@ -0,0 +1,27 @@
+{
+ "compilerOptions": {
+ "target": "ES2017",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ],
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ },
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
+ "exclude": ["node_modules"]
+}
diff --git a/pipes/meeting/.gitignore b/pipes/meeting/.gitignore
new file mode 100644
index 000000000..5ef6a5207
--- /dev/null
+++ b/pipes/meeting/.gitignore
@@ -0,0 +1,41 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.*
+.yarn/*
+!.yarn/patches
+!.yarn/plugins
+!.yarn/releases
+!.yarn/versions
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+.pnpm-debug.log*
+
+# env files (can opt-in for committing if needed)
+.env*
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
diff --git a/pipes/meeting/README.md b/pipes/meeting/README.md
new file mode 100644
index 000000000..bfb02e189
--- /dev/null
+++ b/pipes/meeting/README.md
@@ -0,0 +1,22 @@
+
+search, review, summarize, get specific answer to specific questions over your life digital context
+
+audio
+
+<img width="1142" alt="Screenshot 2024-12-16 at 12 39 18 PM" src="https://github.com/user-attachments/assets/05b48d11-7c89-4f88-afba-76da91691f61" />
+<img width="1142" alt="Screenshot 2024-12-16 at 12 39 52 PM" src="https://github.com/user-attachments/assets/3f6eb8fe-1bde-42cd-8f84-0b8e597431d2" />
+
+keyword filtering
+
+<img width="1142" alt="Screenshot 2024-12-16 at 12 40 52 PM" src="https://github.com/user-attachments/assets/5eae6be7-db50-4ae3-990a-4cb2c934843f" />
+
+window/app filtering
+
+<img width="1142" alt="Screenshot 2024-12-16 at 12 41 14 PM" src="https://github.com/user-attachments/assets/d799a1da-4b22-4956-b917-f8bdf90187a4" />
+
+speaker fitlering (we identify people you speak to 24/7)
+
+<img width="1170" alt="Screenshot 2024-12-16 at 12 48 02 PM" src="https://github.com/user-attachments/assets/dc2f13e0-8745-40a5-be8d-5b34dfa97493" />
+
+
+etc.
diff --git a/pipes/meeting/bun.lockb b/pipes/meeting/bun.lockb
new file mode 100755
index 000000000..ab47763d5
Binary files /dev/null and b/pipes/meeting/bun.lockb differ
diff --git a/pipes/meeting/components.json b/pipes/meeting/components.json
new file mode 100644
index 000000000..d710b4962
--- /dev/null
+++ b/pipes/meeting/components.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "default",
+ "rsc": true,
+ "tsx": true,
+ "tailwind": {
+ "config": "tailwind.config.ts",
+ "css": "src/app/globals.css",
+ "baseColor": "neutral",
+ "cssVariables": true,
+ "prefix": ""
+ },
+ "aliases": {
+ "components": "@/components",
+ "utils": "@/lib/utils",
+ "ui": "@/components/ui",
+ "lib": "@/lib",
+ "hooks": "@/hooks"
+ },
+ "iconLibrary": "lucide"
+}
\ No newline at end of file
diff --git a/pipes/meeting/eslint.config.mjs b/pipes/meeting/eslint.config.mjs
new file mode 100644
index 000000000..c85fb67c4
--- /dev/null
+++ b/pipes/meeting/eslint.config.mjs
@@ -0,0 +1,16 @@
+import { dirname } from "path";
+import { fileURLToPath } from "url";
+import { FlatCompat } from "@eslint/eslintrc";
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = dirname(__filename);
+
+const compat = new FlatCompat({
+ baseDirectory: __dirname,
+});
+
+const eslintConfig = [
+ ...compat.extends("next/core-web-vitals", "next/typescript"),
+];
+
+export default eslintConfig;
diff --git a/pipes/meeting/next.config.ts b/pipes/meeting/next.config.ts
new file mode 100644
index 000000000..b3978a6a4
--- /dev/null
+++ b/pipes/meeting/next.config.ts
@@ -0,0 +1,16 @@
+import type { NextConfig } from "next";
+
+const nextConfig: NextConfig = {
+ transpilePackages: ["@screenpipe/js"],
+ webpack: (config, { isServer }) => {
+ config.resolve.alias = {
+ ...config.resolve.alias,
+ "@screenpipe/js": isServer
+ ? "@screenpipe/js/dist/node.js"
+ : "@screenpipe/js/dist/browser.js",
+ };
+ return config;
+ },
+};
+
+export default nextConfig;
diff --git a/pipes/meeting/package.json b/pipes/meeting/package.json
new file mode 100644
index 000000000..854e95464
--- /dev/null
+++ b/pipes/meeting/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "search",
+ "version": "0.1.0",
+ "private": true,
+ "scripts": {
+ "dev": "next dev --turbopack",
+ "build": "next build",
+ "start": "next start",
+ "lint": "next lint"
+ },
+ "dependencies": {
+ "@radix-ui/react-accordion": "^1.2.2",
+ "@radix-ui/react-checkbox": "^1.1.3",
+ "@radix-ui/react-dialog": "^1.1.3",
+ "@radix-ui/react-label": "^2.1.1",
+ "@radix-ui/react-popover": "^1.1.3",
+ "@radix-ui/react-progress": "^1.1.1",
+ "@radix-ui/react-select": "^2.1.3",
+ "@radix-ui/react-separator": "^1.1.1",
+ "@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-tooltip": "^1.1.5",
+ "@screenpipe/js": "0.1.10-beta.20",
+ "@shadcn/ui": "^0.0.4",
+ "@tanstack/react-query": "^5.62.7",
+ "@types/js-levenshtein": "^1.1.3",
+ "@types/lodash": "^4.17.13",
+ "@types/react-syntax-highlighter": "^15.5.13",
+ "ai": "^4.0.18",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "cmdk": "1.0.0",
+ "date-fns": "^4.1.0",
+ "framer-motion": "^11.14.4",
+ "install": "^0.13.0",
+ "js-levenshtein": "^1.1.6",
+ "localforage": "^1.10.0",
+ "lodash": "^4.17.21",
+ "lucide-react": "^0.468.0",
+ "magic-ui": "^0.1.0",
+ "next": "15.1.0",
+ "npm": "^10.9.2",
+ "openai": "^4.76.3",
+ "react": "^19.0.0",
+ "react-day-picker": "8.10.1",
+ "react-dom": "^19.0.0",
+ "react-markdown": "^9.0.1",
+ "react-syntax-highlighter": "^15.6.1",
+ "remark-gfm": "^4.0.0",
+ "remark-math": "^6.0.0",
+ "tailwind-merge": "^2.5.5",
+ "tailwindcss-animate": "^1.0.7"
+ },
+ "devDependencies": {
+ "@eslint/eslintrc": "^3",
+ "@types/node": "^22.10.2",
+ "@types/react": "^19",
+ "@types/react-dom": "^19",
+ "autoprefixer": "^10.4.20",
+ "eslint": "^9",
+ "eslint-config-next": "15.1.0",
+ "postcss": "^8.4.49",
+ "tailwindcss": "^3.4.16",
+ "typescript": "^5"
+ }
+}
diff --git a/pipes/meeting/postcss.config.mjs b/pipes/meeting/postcss.config.mjs
new file mode 100644
index 000000000..1a69fd2a4
--- /dev/null
+++ b/pipes/meeting/postcss.config.mjs
@@ -0,0 +1,8 @@
+/** @type {import('postcss-load-config').Config} */
+const config = {
+ plugins: {
+ tailwindcss: {},
+ },
+};
+
+export default config;
diff --git a/pipes/meeting/public/file.svg b/pipes/meeting/public/file.svg
new file mode 100644
index 000000000..004145cdd
--- /dev/null
+++ b/pipes/meeting/public/file.svg
@@ -0,0 +1 @@
+<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
\ No newline at end of file
diff --git a/pipes/meeting/public/globe.svg b/pipes/meeting/public/globe.svg
new file mode 100644
index 000000000..567f17b0d
--- /dev/null
+++ b/pipes/meeting/public/globe.svg
@@ -0,0 +1 @@
+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
\ No newline at end of file
diff --git a/pipes/meeting/public/next.svg b/pipes/meeting/public/next.svg
new file mode 100644
index 000000000..5174b28c5
--- /dev/null
+++ b/pipes/meeting/public/next.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
\ No newline at end of file
diff --git a/pipes/meeting/public/vercel.svg b/pipes/meeting/public/vercel.svg
new file mode 100644
index 000000000..770539603
--- /dev/null
+++ b/pipes/meeting/public/vercel.svg
@@ -0,0 +1 @@
+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
\ No newline at end of file
diff --git a/pipes/meeting/public/window.svg b/pipes/meeting/public/window.svg
new file mode 100644
index 000000000..b2b2a44f6
--- /dev/null
+++ b/pipes/meeting/public/window.svg
@@ -0,0 +1 @@
+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
\ No newline at end of file
diff --git a/pipes/meeting/src/app/api/settings/route.ts b/pipes/meeting/src/app/api/settings/route.ts
new file mode 100644
index 000000000..e26c10393
--- /dev/null
+++ b/pipes/meeting/src/app/api/settings/route.ts
@@ -0,0 +1,84 @@
+// app/api/settings/route.ts
+import { pipe } from "@screenpipe/js";
+import { NextResponse } from "next/server";
+import type { Settings } from "@screenpipe/js";
+// Force Node.js runtime
+export const runtime = "nodejs"; // Add this line
+export const dynamic = 'force-dynamic'
+
+export async function GET() {
+ 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: "",
+ },
+ };
+
+ try {
+ const settingsManager = pipe.settings;
+ if (!settingsManager) {
+ throw new Error("settingsManager not found");
+ }
+ const rawSettings = await settingsManager.getAll();
+ console.log("rawSettings", rawSettings);
+ return NextResponse.json(rawSettings);
+ } catch (error) {
+ console.error("failed to get settings:", error);
+ return NextResponse.json(defaultSettings);
+ }
+}
+
+export async function PUT(request: Request) {
+ try {
+ const settingsManager = pipe.settings;
+ if (!settingsManager) {
+ throw new Error("settingsManager not found");
+ }
+
+ const body = await request.json();
+ const { key, value, isPartialUpdate, reset } = body;
+
+ if (reset) {
+ if (key) {
+ await settingsManager.resetKey(key);
+ } else {
+ await settingsManager.reset();
+ }
+ return NextResponse.json({ success: true });
+ }
+
+ if (isPartialUpdate) {
+ const serializedSettings = JSON.parse(JSON.stringify(value));
+ await settingsManager.update(serializedSettings);
+ } else {
+ const serializedValue = JSON.parse(JSON.stringify(value));
+ await settingsManager.set(key, serializedValue);
+ }
+
+ return NextResponse.json({ success: true });
+ } catch (error) {
+ console.error("failed to update settings:", error);
+ return NextResponse.json(
+ { error: "failed to update settings" },
+ { status: 500 }
+ );
+ }
+}
diff --git a/pipes/meeting/src/app/favicon.ico b/pipes/meeting/src/app/favicon.ico
new file mode 100644
index 000000000..718d6fea4
Binary files /dev/null and b/pipes/meeting/src/app/favicon.ico differ
diff --git a/pipes/meeting/src/app/globals.css b/pipes/meeting/src/app/globals.css
new file mode 100644
index 000000000..a23ac26b0
--- /dev/null
+++ b/pipes/meeting/src/app/globals.css
@@ -0,0 +1,72 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+body {
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+@layer base {
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 0 0% 3.9%;
+ --card: 0 0% 100%;
+ --card-foreground: 0 0% 3.9%;
+ --popover: 0 0% 100%;
+ --popover-foreground: 0 0% 3.9%;
+ --primary: 0 0% 9%;
+ --primary-foreground: 0 0% 98%;
+ --secondary: 0 0% 96.1%;
+ --secondary-foreground: 0 0% 9%;
+ --muted: 0 0% 96.1%;
+ --muted-foreground: 0 0% 45.1%;
+ --accent: 0 0% 96.1%;
+ --accent-foreground: 0 0% 9%;
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 0 0% 89.8%;
+ --input: 0 0% 89.8%;
+ --ring: 0 0% 3.9%;
+ --chart-1: 12 76% 61%;
+ --chart-2: 173 58% 39%;
+ --chart-3: 197 37% 24%;
+ --chart-4: 43 74% 66%;
+ --chart-5: 27 87% 67%;
+ --radius: 0.5rem;
+ }
+ .dark {
+ --background: 0 0% 3.9%;
+ --foreground: 0 0% 98%;
+ --card: 0 0% 3.9%;
+ --card-foreground: 0 0% 98%;
+ --popover: 0 0% 3.9%;
+ --popover-foreground: 0 0% 98%;
+ --primary: 0 0% 98%;
+ --primary-foreground: 0 0% 9%;
+ --secondary: 0 0% 14.9%;
+ --secondary-foreground: 0 0% 98%;
+ --muted: 0 0% 14.9%;
+ --muted-foreground: 0 0% 63.9%;
+ --accent: 0 0% 14.9%;
+ --accent-foreground: 0 0% 98%;
+ --destructive: 0 62.8% 30.6%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 0 0% 14.9%;
+ --input: 0 0% 14.9%;
+ --ring: 0 0% 83.1%;
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ --chart-3: 30 80% 55%;
+ --chart-4: 280 65% 60%;
+ --chart-5: 340 75% 55%;
+ }
+}
+
+@layer base {
+ * {
+ @apply border-border;
+ }
+ body {
+ @apply bg-background text-foreground;
+ }
+}
diff --git a/pipes/meeting/src/app/layout.tsx b/pipes/meeting/src/app/layout.tsx
new file mode 100644
index 000000000..140191d39
--- /dev/null
+++ b/pipes/meeting/src/app/layout.tsx
@@ -0,0 +1,35 @@
+import type { Metadata } from "next";
+import { Geist, Geist_Mono } from "next/font/google";
+import "./globals.css";
+
+const geistSans = Geist({
+ variable: "--font-geist-sans",
+ subsets: ["latin"],
+});
+
+const geistMono = Geist_Mono({
+ variable: "--font-geist-mono",
+ subsets: ["latin"],
+});
+
+
+export const metadata: Metadata = {
+ title: "Create Next App",
+ description: "Generated by create next app",
+};
+
+export default function RootLayout({
+ children,
+}: Readonly<{
+ children: React.ReactNode;
+}>) {
+ return (
+ <html lang="en">
+ <body
+ className={`${geistSans.variable} ${geistMono.variable} antialiased`}
+ >
+ {children}
+ </body>
+ </html>
+ );
+}
diff --git a/screenpipe-app-tauri/app/meetings/page.tsx b/pipes/meeting/src/app/page.tsx
similarity index 100%
rename from screenpipe-app-tauri/app/meetings/page.tsx
rename to pipes/meeting/src/app/page.tsx
diff --git a/pipes/meeting/src/components/meeting-history.tsx b/pipes/meeting/src/components/meeting-history.tsx
new file mode 100644
index 000000000..2551453ec
--- /dev/null
+++ b/pipes/meeting/src/components/meeting-history.tsx
@@ -0,0 +1,894 @@
+"use client";
+
+import React, { useState, useEffect, useCallback, useMemo } from "react";
+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,
+ Copy,
+ RefreshCw,
+ Trash2,
+ FileText,
+ PlusCircle,
+ ChevronDown,
+} from "lucide-react";
+import { Badge } from "./ui/badge";
+import { useCopyToClipboard } from "@/lib/hooks/use-copy-to-clipboard";
+import localforage from "localforage";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import { Input } from "./ui/input";
+import { cn, keysToCamelCase } from "@/lib/utils";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+import { Checkbox } from "./ui/checkbox";
+
+function formatDate(date: string): string {
+ const dateObj = new Date(date);
+ const formattedDate = dateObj.toLocaleDateString("en-US", {
+ month: "long",
+ day: "numeric",
+ year: "numeric",
+ });
+ const formattedTime = dateObj.toLocaleTimeString("en-US", {
+ hour: "2-digit",
+ minute: "2-digit",
+ });
+ return `${formattedDate} at ${formattedTime}`;
+}
+
+async function setItem(key: string, value: any): Promise<void> {
+ try {
+ if (typeof window !== "undefined") {
+ await localforage.setItem(key, value);
+ }
+ } catch (error) {
+ console.error("error setting item in storage:", error);
+ throw error;
+ }
+}
+
+async function getItem(key: string): Promise<any> {
+ try {
+ if (typeof window !== "undefined") {
+ return await localforage.getItem(key);
+ }
+ } catch (error) {
+ console.error("error getting item from storage:", error);
+ throw error;
+ }
+ return null;
+}
+
+interface MeetingSegment {
+ timestamp: string;
+ transcription: string;
+ deviceName: string;
+ deviceType: string;
+ speaker: Speaker;
+}
+
+interface Meeting {
+ meetingGroup: number;
+ meetingStart: string;
+ meetingEnd: string;
+ fullTranscription: string;
+ name: string | null;
+ participants: string | null;
+ summary: string | null;
+ mergedWith?: number[]; // Array of meeting groups merged with this one
+ selectedDevices: Set<string>;
+ deviceNames: Set<string>;
+ segments: MeetingSegment[];
+}
+
+interface Speaker {
+ id: number;
+ name: string;
+}
+
+interface AudioContent {
+ chunkId: number;
+ transcription: string;
+ timestamp: string;
+ filePath: string;
+ offsetIndex: number;
+ tags: string[];
+ deviceName: string;
+ deviceType: string;
+ speaker: Speaker;
+}
+
+interface AudioTranscription {
+ type: "Audio";
+ content: AudioContent;
+}
+
+export default function MeetingHistory({
+ showMeetingHistory,
+ setShowMeetingHistory,
+ className,
+}: {
+ showMeetingHistory: boolean;
+ setShowMeetingHistory: (show: boolean) => void;
+ className?: string;
+}) {
+ 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 });
+ const [isRefreshing, setIsRefreshing] = useState(false);
+ const [customSummaryPrompt, setCustomSummaryPrompt] = useState<string>(
+ "please provide a concise summary of the following meeting transcript"
+ );
+ const [isClearing, setIsClearing] = useState(false);
+
+ useEffect(() => {
+ if (showMeetingHistory) {
+ loadMeetings();
+ }
+ }, [showMeetingHistory]);
+
+ useEffect(() => {
+ setShowError(!!error);
+ }, [error]);
+
+ useEffect(() => {
+ console.log("Dialog state changed:", showMeetingHistory);
+ }, [showMeetingHistory]);
+
+ async function loadMeetings() {
+ setLoading(true);
+ try {
+ const storedMeetings = (await getItem("meetings")) || [];
+ setMeetings(storedMeetings);
+ await fetchMeetings();
+ } catch (err) {
+ setError("failed to load meetings");
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function fetchMeetings() {
+ console.log("fetching meetings...");
+ setLoading(true);
+ try {
+ // Always fetch from the last 7x24 hours
+ const startTime = new Date(
+ Date.now() - 7 * 24 * 60 * 60 * 1000
+ ).toISOString();
+ console.log("searching from:", startTime);
+
+ const response = await fetch(
+ `http://localhost:3030/search?content_type=audio&start_time=${startTime}&limit=1000`
+ );
+ if (!response.ok) {
+ throw new Error("failed to fetch meeting history");
+ }
+ const result = await response.json();
+ const camelCaseResult = keysToCamelCase<{ data: AudioTranscription[] }>(
+ result
+ );
+ console.log("fetch result:", camelCaseResult);
+ const newMeetings = processMeetings(camelCaseResult.data);
+ console.log("processed new meetings:", newMeetings);
+
+ // merge new meetings with stored meetings, updating existing ones
+ let updatedMeetings = [...meetings];
+ newMeetings.forEach((newMeeting) => {
+ const existingMeetingIndex = updatedMeetings.findIndex(
+ (m) => m.meetingGroup === newMeeting.meetingGroup
+ );
+ if (existingMeetingIndex === -1) {
+ // add new meeting if it doesn't exist
+ updatedMeetings.push(newMeeting);
+ } else {
+ // update existing meeting with new data
+ updatedMeetings[existingMeetingIndex] = {
+ ...updatedMeetings[existingMeetingIndex],
+ ...newMeeting,
+ fullTranscription:
+ updatedMeetings[existingMeetingIndex].fullTranscription +
+ newMeeting.fullTranscription,
+ };
+ }
+ });
+
+ // sort meetings by start time (descending)
+ updatedMeetings.sort(
+ (a, b) =>
+ new Date(b.meetingStart).getTime() -
+ new Date(a.meetingStart).getTime()
+ );
+
+ setMeetings(updatedMeetings);
+
+ // store updated meetings
+ await setItem("meetings", updatedMeetings);
+ } catch (err) {
+ setError(
+ "some trouble fetching new meetings. please check health status."
+ );
+ console.error("fetch error:", err);
+ } finally {
+ console.log("fetch completed");
+ setLoading(false);
+ }
+ }
+
+ async function generateSummary(meeting: Meeting) {
+ setIsSummarizing(true);
+
+ try {
+ const openai = new OpenAI({
+ apiKey: settings.openaiApiKey,
+ baseURL: settings.aiUrl,
+ dangerouslyAllowBrowser: true,
+ });
+
+ const model = settings.aiModel;
+
+ // create an enhanced prompt that includes identified participants
+ const enhancedPrompt = meeting.participants
+ ? `${customSummaryPrompt}\n\nparticipants: ${meeting.participants}`
+ : customSummaryPrompt;
+
+ const messages = [
+ {
+ role: "system" as const,
+ content: `you are a helpful assistant that summarizes meetings. `,
+ },
+ {
+ role: "user" as const,
+ content: `${enhancedPrompt}:\n\n${meeting.segments
+ .map((s) => s.transcription)
+ .join("\n")}`,
+ },
+ ];
+
+ const stream = await openai.chat.completions.create({
+ model: model,
+ messages: messages,
+ stream: true,
+ });
+
+ let summary = "";
+ const updatedMeeting = { ...meeting, summary: "" };
+
+ for await (const chunk of stream) {
+ const content = chunk.choices[0]?.delta?.content || "";
+ summary += content;
+ updatedMeeting.summary = summary;
+
+ // update the meeting with the new summary
+ const updatedMeetings = meetings.map((m) =>
+ m.meetingGroup === meeting.meetingGroup ? updatedMeeting : m
+ );
+ setMeetings(updatedMeetings);
+ }
+
+ // final update after streaming is complete
+ const finalUpdatedMeetings = meetings.map((m) =>
+ m.meetingGroup === meeting.meetingGroup ? updatedMeeting : m
+ );
+ setMeetings(finalUpdatedMeetings);
+
+ try {
+ console.log("updating meetings state...");
+ setMeetings(finalUpdatedMeetings);
+
+ console.log("storing meetings in storage...");
+ await setItem("meetings", finalUpdatedMeetings);
+
+ console.log("storage operation completed");
+
+ toast({
+ title: "summary generated",
+ description:
+ "the meeting summary has been created and saved successfully.",
+ });
+ } catch (storageError) {
+ console.error("error updating storage:", storageError);
+ toast({
+ title: "warning",
+ description:
+ "summary generated but couldn't be saved due to storage limits. older meetings might be removed to make space.",
+ variant: "destructive",
+ });
+
+ // attempt to remove older meetings to make space
+ try {
+ const oldMeetings = (await getItem("meetings")) || [];
+ const meetingsToKeep = oldMeetings.slice(-10); // keep only the last 10 meetings
+ await setItem("meetings", meetingsToKeep);
+ setMeetings(meetingsToKeep);
+ toast({
+ title: "storage cleaned",
+ description:
+ "older meetings were removed to make space for new ones.",
+ });
+ } catch (cleanupError) {
+ console.error("failed to clean up storage:", cleanupError);
+ toast({
+ title: "error",
+ description:
+ "failed to clean up storage. please clear your browser data manually.",
+ variant: "destructive",
+ });
+ }
+ }
+ } catch (error) {
+ console.error("error generating summary:", error);
+ toast({
+ title: "error",
+ description: "failed to generate meeting summary. please try again.",
+ variant: "destructive",
+ });
+ } finally {
+ setIsSummarizing(false);
+ }
+ }
+
+ function formatTimestamp(timestamp: string): string {
+ const date = new Date(timestamp);
+ return new Intl.DateTimeFormat("en-US", {
+ year: "numeric",
+ month: "short",
+ day: "2-digit",
+ hour: "2-digit",
+ minute: "2-digit",
+ second: "2-digit",
+ timeZoneName: "short",
+ }).format(date);
+ }
+
+ function processMeetings(transcriptions: AudioTranscription[]): Meeting[] {
+ console.log("processing transcriptions:", transcriptions);
+ let meetings: Meeting[] = [];
+ let currentMeeting: Meeting | null = null;
+ let meetingGroup = 0;
+
+ // sort transcriptions by timestamp
+ transcriptions.sort(
+ (a, b) =>
+ new Date(a.content.timestamp).getTime() -
+ new Date(b.content.timestamp).getTime()
+ );
+
+ transcriptions.forEach((trans, index) => {
+ const currentTime = new Date(trans.content.timestamp);
+ const prevTime =
+ index > 0
+ ? new Date(transcriptions[index - 1].content.timestamp)
+ : null;
+
+ // Get speaker name based on speaker info or device type
+ const speakerName =
+ trans.content.speaker?.name && trans.content.speaker.name.length > 0
+ ? trans.content.speaker.name
+ : trans.content.deviceType?.toLowerCase() === "input"
+ ? "you"
+ : trans.content.deviceType?.toLowerCase() === "output"
+ ? "others"
+ : "unknown";
+
+ if (
+ !currentMeeting ||
+ (prevTime &&
+ currentTime.getTime() - prevTime.getTime() >= 5 * 60 * 1000) // increased to 5 minutes
+ ) {
+ if (currentMeeting) {
+ meetings.push(currentMeeting);
+ }
+ meetingGroup++;
+ currentMeeting = {
+ meetingGroup: meetingGroup,
+ meetingStart: trans.content.timestamp,
+ meetingEnd: trans.content.timestamp,
+ fullTranscription: `${formatTimestamp(
+ trans.content.timestamp
+ )} [${speakerName}] ${trans.content.transcription}\n`,
+ name: null,
+ participants: null,
+ summary: null,
+ selectedDevices: new Set([trans.content.deviceName]),
+ segments: [
+ {
+ timestamp: trans.content.timestamp,
+ transcription: trans.content.transcription,
+ deviceName: trans.content.deviceName,
+ deviceType: trans.content.deviceType,
+ speaker: trans.content.speaker || {
+ id: -1,
+ name: speakerName,
+ },
+ },
+ ],
+ deviceNames: new Set([trans.content.deviceName]),
+ };
+ } else if (currentMeeting) {
+ currentMeeting.meetingEnd = trans.content.timestamp;
+ currentMeeting.fullTranscription += `${formatTimestamp(
+ trans.content.timestamp
+ )} [${speakerName}] ${trans.content.transcription}\n`;
+ currentMeeting.selectedDevices.add(trans.content.deviceName);
+ currentMeeting.segments.push({
+ timestamp: trans.content.timestamp,
+ transcription: trans.content.transcription,
+ deviceName: trans.content.deviceName,
+ deviceType: trans.content.deviceType,
+ speaker: trans.content.speaker || {
+ id: -1,
+ name: speakerName,
+ },
+ });
+ currentMeeting.deviceNames.add(trans.content.deviceName);
+ }
+ });
+
+ if (currentMeeting) {
+ meetings.push(currentMeeting);
+ }
+
+ // sort meetings by start time
+ meetings.sort(
+ (a, b) =>
+ new Date(b.meetingStart).getTime() - new Date(a.meetingStart).getTime()
+ );
+
+ // remove duplicate meetings
+ meetings = meetings.filter(
+ (meeting, index, self) =>
+ index === self.findIndex((t) => t.meetingGroup === meeting.meetingGroup)
+ );
+
+ console.log("processed meetings:", meetings);
+ return meetings.filter(
+ (m) => m.fullTranscription.replace(/\n/g, "").length >= 200
+ );
+ }
+
+ // Memoize expensive computations
+ const sortedMeetings = useMemo(() => {
+ return [...meetings].sort(
+ (a, b) =>
+ new Date(b.meetingStart).getTime() - new Date(a.meetingStart).getTime()
+ );
+ }, [meetings]);
+
+ const copyWithToast = (content: string, type: string) => {
+ copyToClipboard(content);
+ toast({
+ title: "copied to clipboard",
+ description: `${type} has been copied to your clipboard.`,
+ });
+ };
+
+ const handleRefresh = async () => {
+ setIsRefreshing(true);
+ try {
+ await fetchMeetings();
+ toast({
+ title: "meetings refreshed",
+ description: "your meeting history has been updated.",
+ });
+ } catch (error) {
+ console.error("error refreshing meetings:", error);
+ toast({
+ title: "refresh failed",
+ description: "failed to refresh meetings. please try again.",
+ variant: "destructive",
+ });
+ } finally {
+ setIsRefreshing(false);
+ }
+ };
+
+ const handleClearMeetings = async () => {
+ setIsClearing(true);
+ try {
+ await localforage.removeItem("meetings");
+ setMeetings([]);
+ toast({
+ title: "meeting data cleared",
+ description: "all stored meeting data has been removed.",
+ });
+ } catch (error) {
+ console.error("error clearing meeting data:", error);
+ toast({
+ title: "error",
+ description: "failed to clear meeting data. please try again.",
+ variant: "destructive",
+ });
+ } finally {
+ setIsClearing(false);
+ }
+ };
+
+ const mergeMeetings = (index: number) => {
+ const updatedMeetings = [...meetings];
+ const currentMeeting = updatedMeetings[index];
+ const nextMeeting = updatedMeetings[index + 1];
+
+ const mergedMeeting: Meeting = {
+ ...currentMeeting,
+ meetingEnd: new Date(
+ Math.max(
+ new Date(currentMeeting.meetingEnd).getTime(),
+ new Date(nextMeeting.meetingEnd).getTime()
+ )
+ ).toISOString(),
+ meetingStart: new Date(
+ Math.min(
+ new Date(currentMeeting.meetingStart).getTime(),
+ new Date(nextMeeting.meetingStart).getTime()
+ )
+ ).toISOString(),
+ fullTranscription: `${currentMeeting.fullTranscription}\n${nextMeeting.fullTranscription}`,
+ mergedWith: [
+ ...(currentMeeting.mergedWith || []),
+ nextMeeting.meetingGroup,
+ ...(nextMeeting.mergedWith || []),
+ ],
+ segments: [...currentMeeting.segments, ...nextMeeting.segments],
+ selectedDevices: new Set([
+ ...Array.from(currentMeeting.selectedDevices),
+ ...Array.from(nextMeeting.selectedDevices),
+ ]),
+ };
+
+ updatedMeetings[index] = mergedMeeting;
+ updatedMeetings.splice(index + 1, 1); // remove the next meeting
+ setMeetings(updatedMeetings);
+ setItem("meetings", updatedMeetings);
+ };
+
+ const handleDeviceToggle = useCallback(
+ (meetingGroup: number, deviceName: string, isChecked: boolean) => {
+ setMeetings((prevMeetings) => {
+ return prevMeetings.map((meeting) => {
+ if (meeting.meetingGroup === meetingGroup) {
+ const updatedSelectedDevices = new Set(meeting.selectedDevices);
+ if (isChecked) {
+ updatedSelectedDevices.add(deviceName);
+ } else {
+ updatedSelectedDevices.delete(deviceName);
+ }
+ return {
+ ...meeting,
+ selectedDevices: updatedSelectedDevices,
+ };
+ }
+ return meeting;
+ });
+ });
+ },
+ []
+ );
+
+ return (
+ <Card>
+ <CardContent
+ className="h-full"
+ onClick={(e) => {
+ e.stopPropagation();
+ }}
+ >
+ <CardHeader className="py-4">
+ <CardTitle className="flex items-center justify-between">
+ <div className="flex items-center">
+ meeting and conversation history
+ <Badge variant="secondary" className="ml-2">
+ experimental
+ </Badge>
+ </div>
+ <div className="flex space-x-2">
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ onClick={handleClearMeetings}
+ disabled={isClearing}
+ size="sm"
+ variant="outline"
+ className="text-xs"
+ >
+ {isClearing ? (
+ <Trash2 className="h-4 w-4 animate-pulse" />
+ ) : (
+ <Trash2 className="h-4 w-4" />
+ )}
+ <span className="ml-2">reset data</span>
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="left">
+ <p>
+ this will restore your meeting data to the original state
+ based on transcription timestamps,
+ <br />
+ without the editing you have done here
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ onClick={handleRefresh}
+ disabled={isRefreshing}
+ size="sm"
+ variant="outline"
+ className="text-xs "
+ >
+ {isRefreshing ? (
+ <RefreshCw className="h-4 w-4 animate-spin" />
+ ) : (
+ <RefreshCw className="h-4 w-4" />
+ )}
+ <span className="ml-2">refresh</span>
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="left">
+ <p>fetch latest meeting data</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+ </CardTitle>
+ </CardHeader>
+ <CardDescription className="mb-4">
+ <span className="block text-sm text-gray-600">
+ this page provides transcriptions and summaries of your daily
+ meetings. it uses your ai settings to generate summaries. note:
+ phrases like &quot;thank you&quot; or &quot;you know&quot; might be
+ transcription errors. for better accuracy, consider using deepgram
+ as the engine or adjust your prompt to ignore these.
+ </span>
+ <span className="block text-sm text-gray-600 mt-2">
+ <strong>make sure to setup your ai settings</strong>
+ </span>
+ </CardDescription>
+ <div className="flex-grow overflow-auto">
+ {loading ? (
+ <div className="space-y-6">
+ {[1, 2, 3].map((i) => (
+ <div key={i} className="p-4 border rounded animate-pulse">
+ <div className="h-6 bg-gray-200 rounded w-3/4 mb-4"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/2 mb-2"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/4 mb-4"></div>
+ <div className="h-20 bg-gray-200 rounded mb-2"></div>
+ <div className="h-4 bg-gray-200 rounded w-1/3"></div>
+ </div>
+ ))}
+ </div>
+ ) : (
+ <>
+ {showError && error && (
+ <div
+ className="bg-gray-100 border-l-4 border-black text-gray-700 p-4 mb-4 flex justify-between items-center"
+ role="alert"
+ >
+ <div>
+ <p className="font-bold">warning</p>
+ <p>{error}</p>
+ </div>
+ <button
+ onClick={() => setShowError(false)}
+ className="text-gray-700 hover:text-black"
+ >
+ <X size={18} />
+ </button>
+ </div>
+ )}
+ {meetings.length === 0 && !loading && !error && (
+ <p className="text-center">no meetings found.</p>
+ )}
+ <div className="space-y-6">
+ {sortedMeetings.map((meeting, index) => (
+ <React.Fragment key={index}>
+ <Card className="relative">
+ <CardHeader>
+ <div className="grid grid-cols-2">
+ <div>
+ <CardTitle className="text-lg font-semibold flex flex-wrap items-center gap-2">
+ meeting {meeting.meetingGroup}
+ {meeting.mergedWith &&
+ meeting.mergedWith.length > 0 && (
+ <>
+ <Badge variant="secondary">merged</Badge>
+ {meeting.mergedWith.map((mergedGroupId) => (
+ <Badge
+ key={mergedGroupId}
+ variant="outline"
+ >
+ meeting {mergedGroupId}
+ </Badge>
+ ))}
+ </>
+ )}
+ </CardTitle>
+ <CardDescription>
+ {formatDate(meeting.meetingStart)} -{" "}
+ {formatDate(meeting.meetingEnd)}
+ </CardDescription>
+ </div>
+ <div className="mb-4 text-end">
+ <h4 className="font-semibold mb-2">Devices:</h4>
+ <div className="flex flex-wrap gap-4 justify-end">
+ {Array.from(meeting.deviceNames).map(
+ (deviceName) => (
+ <label
+ key={deviceName}
+ className="flex items-center space-x-2"
+ >
+ <Checkbox
+ checked={meeting.selectedDevices.has(
+ deviceName
+ )}
+ onCheckedChange={(checked) =>
+ handleDeviceToggle(
+ meeting.meetingGroup,
+ deviceName,
+ checked as boolean
+ )
+ }
+ />
+ <span className="text-sm">
+ {deviceName}
+ </span>
+ </label>
+ )
+ )}
+ </div>
+ </div>
+ </div>
+ </CardHeader>
+ <CardContent>
+ <div className="mb-4 relative">
+ <h4 className="font-semibold mb-2">transcription:</h4>
+ <Button
+ onClick={() =>
+ copyWithToast(
+ meeting.segments
+ .filter((s) =>
+ meeting.selectedDevices.has(s.deviceName)
+ )
+ .map((s) => {
+ return `${formatTimestamp(s.timestamp)} [${
+ s.speaker
+ ? s.speaker.name
+ : s.deviceType?.toLowerCase() ===
+ "input"
+ ? "you"
+ : "others"
+ }] ${s.transcription}`;
+ })
+ .join("\n"),
+ "transcription"
+ )
+ }
+ className="absolute top-0 right-0 p-1 h-6 w-6"
+ variant="outline"
+ size="icon"
+ >
+ <Copy className="h-4 w-4" />
+ </Button>
+ <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>
+ </div>
+ <div className="relative">
+ <h4 className="font-semibold mb-2">summary:</h4>
+ {meeting.summary && (
+ <Button
+ onClick={() =>
+ copyWithToast(meeting.summary || "", "summary")
+ }
+ className="absolute top-0 right-0 p-1 h-6 w-6"
+ variant="outline"
+ size="icon"
+ >
+ <Copy className="h-4 w-4" />
+ </Button>
+ )}
+ {meeting.summary ? (
+ <ReactMarkdown className="prose max-w-none">
+ {meeting.summary}
+ </ReactMarkdown>
+ ) : (
+ <div className="flex items-center mt-2">
+ <Input
+ type="text"
+ value={customSummaryPrompt}
+ onChange={(e) =>
+ setCustomSummaryPrompt(e.target.value)
+ }
+ placeholder="custom summary prompt (optional)"
+ className="mr-2 p-2 border rounded text-sm flex-grow"
+ />
+ <Button
+ onClick={() => generateSummary(meeting)}
+ disabled={isSummarizing}
+ >
+ {isSummarizing ? (
+ <FileText className="h-4 w-4 mr-2 animate-pulse" />
+ ) : (
+ <PlusCircle className="h-4 w-4 mr-2" />
+ )}
+ {isSummarizing
+ ? "generating summary..."
+ : "generate summary"}
+ </Button>
+ </div>
+ )}
+ </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>
+ </>
+ )}
+ </div>
+ </CardContent>
+ </Card>
+ );
+}
diff --git a/pipes/meeting/src/components/ui/accordion.tsx b/pipes/meeting/src/components/ui/accordion.tsx
new file mode 100644
index 000000000..24c788c2c
--- /dev/null
+++ b/pipes/meeting/src/components/ui/accordion.tsx
@@ -0,0 +1,58 @@
+"use client"
+
+import * as React from "react"
+import * as AccordionPrimitive from "@radix-ui/react-accordion"
+import { ChevronDown } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Accordion = AccordionPrimitive.Root
+
+const AccordionItem = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
+>(({ className, ...props }, ref) => (
+ <AccordionPrimitive.Item
+ ref={ref}
+ className={cn("border-b", className)}
+ {...props}
+ />
+))
+AccordionItem.displayName = "AccordionItem"
+
+const AccordionTrigger = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
+>(({ className, children, ...props }, ref) => (
+ <AccordionPrimitive.Header className="flex">
+ <AccordionPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
+ </AccordionPrimitive.Trigger>
+ </AccordionPrimitive.Header>
+))
+AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
+
+const AccordionContent = React.forwardRef<
+ React.ElementRef<typeof AccordionPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
+>(({ className, children, ...props }, ref) => (
+ <AccordionPrimitive.Content
+ ref={ref}
+ className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
+ {...props}
+ >
+ <div className={cn("pb-4 pt-0", className)}>{children}</div>
+ </AccordionPrimitive.Content>
+))
+
+AccordionContent.displayName = AccordionPrimitive.Content.displayName
+
+export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
diff --git a/pipes/meeting/src/components/ui/badge.tsx b/pipes/meeting/src/components/ui/badge.tsx
new file mode 100644
index 000000000..f000e3ef5
--- /dev/null
+++ b/pipes/meeting/src/components/ui/badge.tsx
@@ -0,0 +1,36 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const badgeVariants = cva(
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ {
+ variants: {
+ variant: {
+ default:
+ "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
+ secondary:
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ destructive:
+ "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
+ outline: "text-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+export interface BadgeProps
+ extends React.HTMLAttributes<HTMLDivElement>,
+ VariantProps<typeof badgeVariants> {}
+
+function Badge({ className, variant, ...props }: BadgeProps) {
+ return (
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
+ )
+}
+
+export { Badge, badgeVariants }
diff --git a/pipes/meeting/src/components/ui/button.tsx b/pipes/meeting/src/components/ui/button.tsx
new file mode 100644
index 000000000..36496a287
--- /dev/null
+++ b/pipes/meeting/src/components/ui/button.tsx
@@ -0,0 +1,56 @@
+import * as React from "react"
+import { Slot } from "@radix-ui/react-slot"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const buttonVariants = cva(
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ {
+ variants: {
+ variant: {
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
+ destructive:
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
+ outline:
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
+ secondary:
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ link: "text-primary underline-offset-4 hover:underline",
+ },
+ size: {
+ default: "h-10 px-4 py-2",
+ sm: "h-9 rounded-md px-3",
+ lg: "h-11 rounded-md px-8",
+ icon: "h-10 w-10",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
+ VariantProps<typeof buttonVariants> {
+ asChild?: boolean
+}
+
+const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "button"
+ return (
+ <Comp
+ className={cn(buttonVariants({ variant, size, className }))}
+ ref={ref}
+ {...props}
+ />
+ )
+ }
+)
+Button.displayName = "Button"
+
+export { Button, buttonVariants }
diff --git a/pipes/meeting/src/components/ui/calendar.tsx b/pipes/meeting/src/components/ui/calendar.tsx
new file mode 100644
index 000000000..61d2b451e
--- /dev/null
+++ b/pipes/meeting/src/components/ui/calendar.tsx
@@ -0,0 +1,66 @@
+"use client"
+
+import * as React from "react"
+import { ChevronLeft, ChevronRight } from "lucide-react"
+import { DayPicker } from "react-day-picker"
+
+import { cn } from "@/lib/utils"
+import { buttonVariants } from "@/components/ui/button"
+
+export type CalendarProps = React.ComponentProps<typeof DayPicker>
+
+function Calendar({
+ className,
+ classNames,
+ showOutsideDays = true,
+ ...props
+}: CalendarProps) {
+ return (
+ <DayPicker
+ showOutsideDays={showOutsideDays}
+ className={cn("p-3", className)}
+ classNames={{
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
+ month: "space-y-4",
+ caption: "flex justify-center pt-1 relative items-center",
+ caption_label: "text-sm font-medium",
+ nav: "space-x-1 flex items-center",
+ nav_button: cn(
+ buttonVariants({ variant: "outline" }),
+ "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
+ ),
+ nav_button_previous: "absolute left-1",
+ nav_button_next: "absolute right-1",
+ table: "w-full border-collapse space-y-1",
+ head_row: "flex",
+ head_cell:
+ "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
+ row: "flex w-full mt-2",
+ cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
+ day: cn(
+ buttonVariants({ variant: "ghost" }),
+ "h-9 w-9 p-0 font-normal aria-selected:opacity-100"
+ ),
+ day_range_end: "day-range-end",
+ day_selected:
+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
+ day_today: "bg-accent text-accent-foreground",
+ day_outside:
+ "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",
+ day_disabled: "text-muted-foreground opacity-50",
+ day_range_middle:
+ "aria-selected:bg-accent aria-selected:text-accent-foreground",
+ day_hidden: "invisible",
+ ...classNames,
+ }}
+ components={{
+ IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
+ IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
+ }}
+ {...props}
+ />
+ )
+}
+Calendar.displayName = "Calendar"
+
+export { Calendar }
diff --git a/pipes/meeting/src/components/ui/card.tsx b/pipes/meeting/src/components/ui/card.tsx
new file mode 100644
index 000000000..f62edea57
--- /dev/null
+++ b/pipes/meeting/src/components/ui/card.tsx
@@ -0,0 +1,79 @@
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+const Card = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
+ className
+ )}
+ {...props}
+ />
+))
+Card.displayName = "Card"
+
+const CardHeader = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
+ {...props}
+ />
+))
+CardHeader.displayName = "CardHeader"
+
+const CardTitle = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ "text-2xl font-semibold leading-none tracking-tight",
+ className
+ )}
+ {...props}
+ />
+))
+CardTitle.displayName = "CardTitle"
+
+const CardDescription = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+))
+CardDescription.displayName = "CardDescription"
+
+const CardContent = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
+))
+CardContent.displayName = "CardContent"
+
+const CardFooter = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("flex items-center p-6 pt-0", className)}
+ {...props}
+ />
+))
+CardFooter.displayName = "CardFooter"
+
+export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
diff --git a/pipes/meeting/src/components/ui/checkbox.tsx b/pipes/meeting/src/components/ui/checkbox.tsx
new file mode 100644
index 000000000..df61a1388
--- /dev/null
+++ b/pipes/meeting/src/components/ui/checkbox.tsx
@@ -0,0 +1,30 @@
+"use client"
+
+import * as React from "react"
+import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
+import { Check } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Checkbox = React.forwardRef<
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
+>(({ className, ...props }, ref) => (
+ <CheckboxPrimitive.Root
+ ref={ref}
+ className={cn(
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
+ className
+ )}
+ {...props}
+ >
+ <CheckboxPrimitive.Indicator
+ className={cn("flex items-center justify-center text-current")}
+ >
+ <Check className="h-4 w-4" />
+ </CheckboxPrimitive.Indicator>
+ </CheckboxPrimitive.Root>
+))
+Checkbox.displayName = CheckboxPrimitive.Root.displayName
+
+export { Checkbox }
diff --git a/pipes/meeting/src/components/ui/codeblock.tsx b/pipes/meeting/src/components/ui/codeblock.tsx
new file mode 100644
index 000000000..e52893032
--- /dev/null
+++ b/pipes/meeting/src/components/ui/codeblock.tsx
@@ -0,0 +1,148 @@
+// Inspired by Chatbot-UI and modified to fit the needs of this project
+// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Markdown/CodeBlock.tsx
+
+"use client";
+
+import { FC, memo } from "react";
+import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
+import { coldarkDark } from "react-syntax-highlighter/dist/cjs/styles/prism";
+
+import { useCopyToClipboard } from "@/lib/hooks/use-copy-to-clipboard";
+import { IconCheck, IconCopy, IconDownload } from "@/components/ui/icons";
+import { Button } from "@/components/ui/button";
+
+interface Props {
+ language: string;
+ value: string;
+}
+
+interface languageMap {
+ [key: string]: string | undefined;
+}
+
+export const programmingLanguages: languageMap = {
+ javascript: ".js",
+ python: ".py",
+ java: ".java",
+ c: ".c",
+ cpp: ".cpp",
+ "c++": ".cpp",
+ "c#": ".cs",
+ ruby: ".rb",
+ php: ".php",
+ swift: ".swift",
+ "objective-c": ".m",
+ kotlin: ".kt",
+ typescript: ".ts",
+ go: ".go",
+ perl: ".pl",
+ rust: ".rs",
+ scala: ".scala",
+ haskell: ".hs",
+ lua: ".lua",
+ shell: ".sh",
+ sql: ".sql",
+ html: ".html",
+ css: ".css",
+ // add more file extensions here, make sure the key is same as language prop in CodeBlock.tsx component
+};
+
+export const generateRandomString = (length: number, lowercase = false) => {
+ const chars = "ABCDEFGHJKLMNPQRSTUVWXY3456789"; // excluding similar looking characters like Z, 2, I, 1, O, 0
+ let result = "";
+ for (let i = 0; i < length; i++) {
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
+ }
+ return lowercase ? result.toLowerCase() : result;
+};
+
+const CodeBlock: FC<Props> = memo(({ language, value }) => {
+ const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });
+
+ const downloadAsFile = () => {
+ if (typeof window === "undefined") {
+ return;
+ }
+ const fileExtension = programmingLanguages[language] || ".file";
+ const suggestedFileName = `file-${generateRandomString(
+ 3,
+ true
+ )}${fileExtension}`;
+ const fileName = window.prompt("Enter file name", suggestedFileName);
+
+ if (!fileName) {
+ // User pressed cancel on prompt.
+ return;
+ }
+
+ const blob = new Blob([value], { type: "text/plain" });
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.download = fileName;
+ link.href = url;
+ link.style.display = "none";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ };
+
+ const onCopy = () => {
+ if (isCopied) return;
+ copyToClipboard(value);
+ };
+
+ return (
+ <div className="relative w-full font-sans codeblock bg-zinc-950">
+ <div className="flex items-center justify-between w-full px-6 py-2 pr-4 bg-zinc-800 text-zinc-100">
+ <span className="text-xs lowercase">{language}</span>
+ <div className="flex items-center space-x-1">
+ <Button
+ variant="ghost"
+ className="hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"
+ onClick={downloadAsFile}
+ size="icon"
+ >
+ <IconDownload />
+ <span className="sr-only">Download</span>
+ </Button>
+ <Button
+ variant="ghost"
+ size="icon"
+ className="text-xs hover:bg-zinc-800 focus-visible:ring-1 focus-visible:ring-slate-700 focus-visible:ring-offset-0"
+ onClick={onCopy}
+ >
+ {isCopied ? <IconCheck /> : <IconCopy />}
+ <span className="sr-only">Copy code</span>
+ </Button>
+ </div>
+ </div>
+ <SyntaxHighlighter
+ language={language}
+ style={coldarkDark}
+ PreTag="div"
+ showLineNumbers
+ customStyle={{
+ margin: 0,
+ width: "100%",
+ background: "transparent",
+ padding: "1.5rem 1rem",
+ }}
+ lineNumberStyle={{
+ userSelect: "none",
+ }}
+ codeTagProps={{
+ style: {
+ fontSize: "0.9rem",
+ fontFamily: "var(--font-mono)",
+ },
+ }}
+ >
+ {value}
+ </SyntaxHighlighter>
+ </div>
+ );
+});
+CodeBlock.displayName = "CodeBlock";
+
+export { CodeBlock };
diff --git a/pipes/meeting/src/components/ui/command.tsx b/pipes/meeting/src/components/ui/command.tsx
new file mode 100644
index 000000000..59a264529
--- /dev/null
+++ b/pipes/meeting/src/components/ui/command.tsx
@@ -0,0 +1,153 @@
+"use client"
+
+import * as React from "react"
+import { type DialogProps } from "@radix-ui/react-dialog"
+import { Command as CommandPrimitive } from "cmdk"
+import { Search } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+import { Dialog, DialogContent } from "@/components/ui/dialog"
+
+const Command = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive
+ ref={ref}
+ className={cn(
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
+ className
+ )}
+ {...props}
+ />
+))
+Command.displayName = CommandPrimitive.displayName
+
+const CommandDialog = ({ children, ...props }: DialogProps) => {
+ return (
+ <Dialog {...props}>
+ <DialogContent className="overflow-hidden p-0 shadow-lg">
+ <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
+ {children}
+ </Command>
+ </DialogContent>
+ </Dialog>
+ )
+}
+
+const CommandInput = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Input>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
+>(({ className, ...props }, ref) => (
+ <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
+ <CommandPrimitive.Input
+ ref={ref}
+ className={cn(
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ {...props}
+ />
+ </div>
+))
+
+CommandInput.displayName = CommandPrimitive.Input.displayName
+
+const CommandList = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.List>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.List
+ ref={ref}
+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
+ {...props}
+ />
+))
+
+CommandList.displayName = CommandPrimitive.List.displayName
+
+const CommandEmpty = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Empty>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
+>((props, ref) => (
+ <CommandPrimitive.Empty
+ ref={ref}
+ className="py-6 text-center text-sm"
+ {...props}
+ />
+))
+
+CommandEmpty.displayName = CommandPrimitive.Empty.displayName
+
+const CommandGroup = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Group>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Group
+ ref={ref}
+ className={cn(
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+))
+
+CommandGroup.displayName = CommandPrimitive.Group.displayName
+
+const CommandSeparator = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 h-px bg-border", className)}
+ {...props}
+ />
+))
+CommandSeparator.displayName = CommandPrimitive.Separator.displayName
+
+const CommandItem = React.forwardRef<
+ React.ElementRef<typeof CommandPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
+>(({ className, ...props }, ref) => (
+ <CommandPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ className
+ )}
+ {...props}
+ />
+))
+
+CommandItem.displayName = CommandPrimitive.Item.displayName
+
+const CommandShortcut = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLSpanElement>) => {
+ return (
+ <span
+ className={cn(
+ "ml-auto text-xs tracking-widest text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+CommandShortcut.displayName = "CommandShortcut"
+
+export {
+ Command,
+ CommandDialog,
+ CommandInput,
+ CommandList,
+ CommandEmpty,
+ CommandGroup,
+ CommandItem,
+ CommandShortcut,
+ CommandSeparator,
+}
diff --git a/pipes/meeting/src/components/ui/dialog.tsx b/pipes/meeting/src/components/ui/dialog.tsx
new file mode 100644
index 000000000..01ff19c7e
--- /dev/null
+++ b/pipes/meeting/src/components/ui/dialog.tsx
@@ -0,0 +1,122 @@
+"use client"
+
+import * as React from "react"
+import * as DialogPrimitive from "@radix-ui/react-dialog"
+import { X } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Dialog = DialogPrimitive.Root
+
+const DialogTrigger = DialogPrimitive.Trigger
+
+const DialogPortal = DialogPrimitive.Portal
+
+const DialogClose = DialogPrimitive.Close
+
+const DialogOverlay = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Overlay
+ ref={ref}
+ className={cn(
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
+ className
+ )}
+ {...props}
+ />
+))
+DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
+
+const DialogContent = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
+>(({ className, children, ...props }, ref) => (
+ <DialogPortal>
+ <DialogOverlay />
+ <DialogPrimitive.Content
+ ref={ref}
+ className={cn(
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
+ <X className="h-4 w-4" />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ </DialogPrimitive.Content>
+ </DialogPortal>
+))
+DialogContent.displayName = DialogPrimitive.Content.displayName
+
+const DialogHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col space-y-1.5 text-center sm:text-left",
+ className
+ )}
+ {...props}
+ />
+)
+DialogHeader.displayName = "DialogHeader"
+
+const DialogFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
+ className
+ )}
+ {...props}
+ />
+)
+DialogFooter.displayName = "DialogFooter"
+
+const DialogTitle = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Title>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Title
+ ref={ref}
+ className={cn(
+ "text-lg font-semibold leading-none tracking-tight",
+ className
+ )}
+ {...props}
+ />
+))
+DialogTitle.displayName = DialogPrimitive.Title.displayName
+
+const DialogDescription = React.forwardRef<
+ React.ElementRef<typeof DialogPrimitive.Description>,
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
+>(({ className, ...props }, ref) => (
+ <DialogPrimitive.Description
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+))
+DialogDescription.displayName = DialogPrimitive.Description.displayName
+
+export {
+ Dialog,
+ DialogPortal,
+ DialogOverlay,
+ DialogClose,
+ DialogTrigger,
+ DialogContent,
+ DialogHeader,
+ DialogFooter,
+ DialogTitle,
+ DialogDescription,
+}
diff --git a/pipes/meeting/src/components/ui/icons.tsx b/pipes/meeting/src/components/ui/icons.tsx
new file mode 100644
index 000000000..492377647
--- /dev/null
+++ b/pipes/meeting/src/components/ui/icons.tsx
@@ -0,0 +1,593 @@
+"use client";
+
+import * as React from "react";
+
+import { cn } from "@/lib/utils";
+
+function IconNextChat({
+ className,
+ inverted,
+ ...props
+}: React.ComponentProps<"svg"> & { inverted?: boolean }) {
+ const id = React.useId();
+
+ return (
+ <svg
+ viewBox="0 0 17 17"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <defs>
+ <linearGradient
+ id={`gradient-${id}-1`}
+ x1="10.6889"
+ y1="10.3556"
+ x2="13.8445"
+ y2="14.2667"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stopColor={inverted ? "white" : "black"} />
+ <stop
+ offset={1}
+ stopColor={inverted ? "white" : "black"}
+ stopOpacity={0}
+ />
+ </linearGradient>
+ <linearGradient
+ id={`gradient-${id}-2`}
+ x1="11.7555"
+ y1="4.8"
+ x2="11.7376"
+ y2="9.50002"
+ gradientUnits="userSpaceOnUse"
+ >
+ <stop stopColor={inverted ? "white" : "black"} />
+ <stop
+ offset={1}
+ stopColor={inverted ? "white" : "black"}
+ stopOpacity={0}
+ />
+ </linearGradient>
+ </defs>
+ <path
+ d="M1 16L2.58314 11.2506C1.83084 9.74642 1.63835 8.02363 2.04013 6.39052C2.4419 4.75741 3.41171 3.32057 4.776 2.33712C6.1403 1.35367 7.81003 0.887808 9.4864 1.02289C11.1628 1.15798 12.7364 1.8852 13.9256 3.07442C15.1148 4.26363 15.842 5.83723 15.9771 7.5136C16.1122 9.18997 15.6463 10.8597 14.6629 12.224C13.6794 13.5883 12.2426 14.5581 10.6095 14.9599C8.97637 15.3616 7.25358 15.1692 5.74942 14.4169L1 16Z"
+ fill={inverted ? "black" : "white"}
+ stroke={inverted ? "black" : "white"}
+ strokeWidth={2}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <mask
+ id="mask0_91_2047"
+ style={{ maskType: "alpha" }}
+ maskUnits="userSpaceOnUse"
+ x={1}
+ y={0}
+ width={16}
+ height={16}
+ >
+ <circle cx={9} cy={8} r={8} fill={inverted ? "black" : "white"} />
+ </mask>
+ <g mask="url(#mask0_91_2047)">
+ <circle cx={9} cy={8} r={8} fill={inverted ? "black" : "white"} />
+ <path
+ d="M14.2896 14.0018L7.146 4.8H5.80005V11.1973H6.87681V6.16743L13.4444 14.6529C13.7407 14.4545 14.0231 14.2369 14.2896 14.0018Z"
+ fill={`url(#gradient-${id}-1)`}
+ />
+ <rect
+ x="11.2222"
+ y="4.8"
+ width="1.06667"
+ height="6.4"
+ fill={`url(#gradient-${id}-2)`}
+ />
+ </g>
+ </svg>
+ );
+}
+
+function IconOpenAI({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ fill="currentColor"
+ viewBox="0 0 24 24"
+ role="img"
+ xmlns="http://www.w3.org/2000/svg"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <title>OpenAI icon</title>
+ <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
+ </svg>
+ );
+}
+
+function IconVercel({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ aria-label="Vercel logomark"
+ role="img"
+ viewBox="0 0 74 64"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path
+ d="M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z"
+ fill="currentColor"
+ ></path>
+ </svg>
+ );
+}
+
+function IconGitHub({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ role="img"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <title>GitHub</title>
+ <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
+ </svg>
+ );
+}
+
+function IconSeparator({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ fill="none"
+ shapeRendering="geometricPrecision"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1"
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M16.88 3.549L7.12 20.451"></path>
+ </svg>
+ );
+}
+
+function IconArrowDown({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="m205.66 149.66-72 72a8 8 0 0 1-11.32 0l-72-72a8 8 0 0 1 11.32-11.32L120 196.69V40a8 8 0 0 1 16 0v156.69l58.34-58.35a8 8 0 0 1 11.32 11.32Z" />
+ </svg>
+ );
+}
+
+function IconArrowRight({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="m221.66 133.66-72 72a8 8 0 0 1-11.32-11.32L196.69 136H40a8 8 0 0 1 0-16h156.69l-58.35-58.34a8 8 0 0 1 11.32-11.32l72 72a8 8 0 0 1 0 11.32Z" />
+ </svg>
+ );
+}
+
+function IconUser({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M230.92 212c-15.23-26.33-38.7-45.21-66.09-54.16a72 72 0 1 0-73.66 0c-27.39 8.94-50.86 27.82-66.09 54.16a8 8 0 1 0 13.85 8c18.84-32.56 52.14-52 89.07-52s70.23 19.44 89.07 52a8 8 0 1 0 13.85-8ZM72 96a56 56 0 1 1 56 56 56.06 56.06 0 0 1-56-56Z" />
+ </svg>
+ );
+}
+
+function IconPlus({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8Z" />
+ </svg>
+ );
+}
+
+function IconArrowElbow({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M200 32v144a8 8 0 0 1-8 8H67.31l34.35 34.34a8 8 0 0 1-11.32 11.32l-48-48a8 8 0 0 1 0-11.32l48-48a8 8 0 0 1 11.32 11.32L67.31 168H184V32a8 8 0 0 1 16 0Z" />
+ </svg>
+ );
+}
+
+function IconSpinner({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4 animate-spin", className)}
+ {...props}
+ >
+ <path d="M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128Z" />
+ </svg>
+ );
+}
+
+function IconMessage({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M216 48H40a16 16 0 0 0-16 16v160a15.84 15.84 0 0 0 9.25 14.5A16.05 16.05 0 0 0 40 240a15.89 15.89 0 0 0 10.25-3.78.69.69 0 0 0 .13-.11L82.5 208H216a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16ZM40 224Zm176-32H82.5a16 16 0 0 0-10.3 3.75l-.12.11L40 224V64h176Z" />
+ </svg>
+ );
+}
+
+function IconTrash({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16ZM96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Z" />
+ </svg>
+ );
+}
+
+function IconRefresh({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M197.67 186.37a8 8 0 0 1 0 11.29C196.58 198.73 170.82 224 128 224c-37.39 0-64.53-22.4-80-39.85V208a8 8 0 0 1-16 0v-48a8 8 0 0 1 8-8h48a8 8 0 0 1 0 16H55.44C67.76 183.35 93 208 128 208c36 0 58.14-21.46 58.36-21.68a8 8 0 0 1 11.31.05ZM216 40a8 8 0 0 0-8 8v23.85C192.53 54.4 165.39 32 128 32c-42.82 0-68.58 25.27-69.66 26.34a8 8 0 0 0 11.3 11.34C69.86 69.46 92 48 128 48c35 0 60.24 24.65 72.56 40H168a8 8 0 0 0 0 16h48a8 8 0 0 0 8-8V48a8 8 0 0 0-8-8Z" />
+ </svg>
+ );
+}
+
+function IconStop({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm24-120h-48a8 8 0 0 0-8 8v48a8 8 0 0 0 8 8h48a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8Zm-8 48h-32v-32h32Z" />
+ </svg>
+ );
+}
+
+function IconSidebar({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16ZM40 56h40v144H40Zm176 144H96V56h120v144Z" />
+ </svg>
+ );
+}
+
+function IconMoon({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M233.54 142.23a8 8 0 0 0-8-2 88.08 88.08 0 0 1-109.8-109.8 8 8 0 0 0-10-10 104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.09 103.09 0 0 0 62.52-20.88 104.84 104.84 0 0 0 37-52.91 8 8 0 0 0-1.98-7.98Zm-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104 106 106 0 0 0 14.92-1.06 89 89 0 0 1-26.02 31.4Z" />
+ </svg>
+ );
+}
+
+function IconSun({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0Zm72 88a64 64 0 1 1-64-64 64.07 64.07 0 0 1 64 64Zm-16 0a48 48 0 1 0-48 48 48.05 48.05 0 0 0 48-48ZM58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32ZM192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72Zm5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8Zm80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8Zm112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16Z" />
+ </svg>
+ );
+}
+
+function IconCopy({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8Zm-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z" />
+ </svg>
+ );
+}
+
+function IconCheck({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="m229.66 77.66-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69 218.34 66.34a8 8 0 0 1 11.32 11.32Z" />
+ </svg>
+ );
+}
+
+function IconDownload({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M224 152v56a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16v-56a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0Zm-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 132.69V40a8 8 0 0 0-16 0v92.69l-26.34-26.35a8 8 0 0 0-11.32 11.32Z" />
+ </svg>
+ );
+}
+
+function IconClose({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 256 256"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path d="M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z" />
+ </svg>
+ );
+}
+
+function IconEdit({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 24 24"
+ strokeWidth={1.5}
+ stroke="currentColor"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <path
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
+ />
+ </svg>
+ );
+}
+
+function IconShare({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ viewBox="0 0 256 256"
+ {...props}
+ >
+ <path d="m237.66 106.35-80-80A8 8 0 0 0 144 32v40.35c-25.94 2.22-54.59 14.92-78.16 34.91-28.38 24.08-46.05 55.11-49.76 87.37a12 12 0 0 0 20.68 9.58c11-11.71 50.14-48.74 107.24-52V192a8 8 0 0 0 13.66 5.65l80-80a8 8 0 0 0 0-11.3ZM160 172.69V144a8 8 0 0 0-8-8c-28.08 0-55.43 7.33-81.29 21.8a196.17 196.17 0 0 0-36.57 26.52c5.8-23.84 20.42-46.51 42.05-64.86C99.41 99.77 127.75 88 152 88a8 8 0 0 0 8-8V51.32L220.69 112Z" />
+ </svg>
+ );
+}
+
+function IconUsers({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ viewBox="0 0 256 256"
+ {...props}
+ >
+ <path d="M117.25 157.92a60 60 0 1 0-66.5 0 95.83 95.83 0 0 0-47.22 37.71 8 8 0 1 0 13.4 8.74 80 80 0 0 1 134.14 0 8 8 0 0 0 13.4-8.74 95.83 95.83 0 0 0-47.22-37.71ZM40 108a44 44 0 1 1 44 44 44.05 44.05 0 0 1-44-44Zm210.14 98.7a8 8 0 0 1-11.07-2.33A79.83 79.83 0 0 0 172 168a8 8 0 0 1 0-16 44 44 0 1 0-16.34-84.87 8 8 0 1 1-5.94-14.85 60 60 0 0 1 55.53 105.64 95.83 95.83 0 0 1 47.22 37.71 8 8 0 0 1-2.33 11.07Z" />
+ </svg>
+ );
+}
+
+function IconExternalLink({
+ className,
+ ...props
+}: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ viewBox="0 0 256 256"
+ {...props}
+ >
+ <path d="M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8Z" />
+ </svg>
+ );
+}
+
+function IconChevronUpDown({
+ className,
+ ...props
+}: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ className={cn("size-4", className)}
+ viewBox="0 0 256 256"
+ {...props}
+ >
+ <path d="M181.66 170.34a8 8 0 0 1 0 11.32l-48 48a8 8 0 0 1-11.32 0l-48-48a8 8 0 0 1 11.32-11.32L128 212.69l42.34-42.35a8 8 0 0 1 11.32 0Zm-96-84.68L128 43.31l42.34 42.35a8 8 0 0 0 11.32-11.32l-48-48a8 8 0 0 0-11.32 0l-48 48a8 8 0 0 0 11.32 11.32Z" />
+ </svg>
+ );
+}
+
+function IconLlama({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ fill="currentColor"
+ viewBox="0 0 24 24"
+ role="img"
+ xmlns="http://www.w3.org/2000/svg"
+ className={cn("size-4", className)}
+ {...props}
+ >
+ <title>Llama3 icon</title>
+ <circle
+ cx="12"
+ cy="12"
+ r="10"
+ stroke="currentColor"
+ strokeWidth="2"
+ fill="none"
+ />
+ <path
+ d="M6 9l6 6 6-6"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+function IconCode({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ width="15"
+ height="15"
+ viewBox="0 0 15 15"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M9.96424 2.68571C10.0668 2.42931 9.94209 2.13833 9.6857 2.03577C9.4293 1.93322 9.13832 2.05792 9.03576 2.31432L5.03576 12.3143C4.9332 12.5707 5.05791 12.8617 5.3143 12.9642C5.5707 13.0668 5.86168 12.9421 5.96424 12.6857L9.96424 2.68571ZM3.85355 5.14646C4.04882 5.34172 4.04882 5.6583 3.85355 5.85356L2.20711 7.50001L3.85355 9.14646C4.04882 9.34172 4.04882 9.6583 3.85355 9.85356C3.65829 10.0488 3.34171 10.0488 3.14645 9.85356L1.14645 7.85356C0.951184 7.6583 0.951184 7.34172 1.14645 7.14646L3.14645 5.14646C3.34171 4.9512 3.65829 4.9512 3.85355 5.14646ZM11.1464 5.14646C11.3417 4.9512 11.6583 4.9512 11.8536 5.14646L13.8536 7.14646C14.0488 7.34172 14.0488 7.6583 13.8536 7.85356L11.8536 9.85356C11.6583 10.0488 11.3417 10.0488 11.1464 9.85356C10.9512 9.6583 10.9512 9.34172 11.1464 9.14646L12.7929 7.50001L11.1464 5.85356C10.9512 5.6583 10.9512 5.34172 11.1464 5.14646Z"
+ fill="currentColor"
+ fillRule="evenodd"
+ clipRule="evenodd"
+ ></path>
+ </svg>
+ );
+}
+
+function IconOllama({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <svg
+ width="133"
+ height="185"
+ viewBox="0 0 133 185"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlnsXlink="http://www.w3.org/1999/xlink"
+ >
+ <rect width="133" height="185" fill="url(#pattern0)" />
+ <defs>
+ <pattern
+ id="pattern0"
+ patternContentUnits="objectBoundingBox"
+ width="1"
+ height="1"
+ >
+ <use
+ xlinkHref="#image0_406_1657"
+ transform="matrix(0.00552486 0 0 0.00397193 0 -0.00840675)"
+ />
+ </pattern>
+ <image
+ id="image0_406_1657"
+ width="181"
+ height="256"
+ xlinkHref="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAAEACAYAAAD1IzfbAAAMQGlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkEBoAQSkhN4EkRpASggt9I5gIyQBQokxEFTsyKKCa0FFBGzoqoiCFRA7YmdR7H2xoKKsiwW78iYFdN1XvjffN3f++8+Z/5w5d+beOwCoHeeIRDmoOgC5wnxxbLA/fVxyCp30FJAAARCBOjDncPNEzOjocADLUPv38u46QKTtFXup1j/7/2vR4PHzuAAg0RCn8fK4uRDvBwCv4YrE+QAQpbzZtHyRFMMKtMQwQIgXSXGGHNdIcZoc75bZxMeyIG4HQEmFwxFnAKB6CfL0Am4G1FDth9hRyBMIAVCjQ+yTmzuFB3EqxNbQRgSxVJ+R9oNOxt8004Y1OZyMYSyfi6woBQjyRDmcGf9nOv53yc2RDPmwhFUlUxwSK50zzNvN7ClhUqwCcZ8wLTIKYk2IPwh4MnuIUUqmJCRBbo8acPNYMGdAB2JHHicgDGIDiIOEOZHhCj4tXRDEhhiuEHS6IJ8dD7EuxIv4eYFxCpuN4imxCl9oU7qYxVTwZzlimV+pr/uS7ASmQv91Jp+t0MdUCzPjkyCmQGxeI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zyNTAhMIQBv4I9FpvG1jNS7WzzL5lKjXTJLCICAlT/T+FpG6l2NGPPzUUkSAlYErPyZxtcyUu9izOoKo10ySwiAgJU/Xny9RwFCL9gfkk3ZF4RkkyQEfBCAP/AolHvwtU+KRFxDvZaHJ/xvozzhSZIQsCIAf6b+19oAJ/AV3k5JkdRbTfWE7dwYNjyNTgiUImDlUR9vi6TevDRUfePt9UPSiIRALQJWHvXxtkjqdWrDlg/gT2ySJASaImDlUR9vi6TeyJjVfUa7ZJYQyCNg5VEfb4ukzgcI2b8rZHAamxCoQCAKj4qkXrciWF1zWvmoQyj1+yBg5VEfb4uktr6QZD1t+BSaxowPAlYe9fG2SGorfCyaJ0kINEUgCo+KpOZpjkU2sBglm4RAAQErj/p4WyT1tEeOhaBVH9ep6kjtCYEABKw86uNtkdSPBiSQH7p2/kPaTwgYEbD++GMfb4uk7juMByS2acDYNDQhUIXAllUdNe19vC2Smt9gsAg/qZAkIdAUgW2MDvp4WyR137VJQIAdAsamoQmBKgSsPOrjbZHU1mfv0/6kpirr1J4QcCBg5ZGTt/xG2QNSrlFC9GmN71sA1+ckCYEQBOAPPArhHWPha99vPhaP1Ay6QRoqK8vg5aFGaXxCIIcA/IFHoQJf4e2UFElNR/AP7016Sz9kMwVr2jEgYOWPF1/nK6HQUwDjH5bOliZJCIQiAG/gj4V3832CzTE6J6E9fQKkMQmBAgLwxkJobOYUfJX+BfgyDbquONDzc98fQHrapGEJAStvrhd0y4rwlV1TM+as4kCPz89ozE0e49KQhEARAXgDf0Ll22UG/w9yreSQIAJvAgAAAABJRU5ErkJggg=="
+ />
+ </defs>
+ </svg>
+ );
+}
+
+export {
+ IconOllama,
+ IconEdit,
+ IconNextChat,
+ IconOpenAI,
+ IconVercel,
+ IconGitHub,
+ IconSeparator,
+ IconArrowDown,
+ IconArrowRight,
+ IconUser,
+ IconPlus,
+ IconArrowElbow,
+ IconSpinner,
+ IconMessage,
+ IconTrash,
+ IconRefresh,
+ IconStop,
+ IconSidebar,
+ IconMoon,
+ IconSun,
+ IconCopy,
+ IconCheck,
+ IconDownload,
+ IconClose,
+ IconShare,
+ IconUsers,
+ IconExternalLink,
+ IconChevronUpDown,
+ IconLlama,
+ IconCode,
+};
diff --git a/pipes/meeting/src/components/ui/input.tsx b/pipes/meeting/src/components/ui/input.tsx
new file mode 100644
index 000000000..68551b927
--- /dev/null
+++ b/pipes/meeting/src/components/ui/input.tsx
@@ -0,0 +1,22 @@
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
+ ({ className, type, ...props }, ref) => {
+ return (
+ <input
+ type={type}
+ className={cn(
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
+ className
+ )}
+ ref={ref}
+ {...props}
+ />
+ )
+ }
+)
+Input.displayName = "Input"
+
+export { Input }
diff --git a/pipes/meeting/src/components/ui/label.tsx b/pipes/meeting/src/components/ui/label.tsx
new file mode 100644
index 000000000..534182176
--- /dev/null
+++ b/pipes/meeting/src/components/ui/label.tsx
@@ -0,0 +1,26 @@
+"use client"
+
+import * as React from "react"
+import * as LabelPrimitive from "@radix-ui/react-label"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const labelVariants = cva(
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
+)
+
+const Label = React.forwardRef<
+ React.ElementRef<typeof LabelPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
+ VariantProps<typeof labelVariants>
+>(({ className, ...props }, ref) => (
+ <LabelPrimitive.Root
+ ref={ref}
+ className={cn(labelVariants(), className)}
+ {...props}
+ />
+))
+Label.displayName = LabelPrimitive.Root.displayName
+
+export { Label }
diff --git a/pipes/meeting/src/components/ui/popover.tsx b/pipes/meeting/src/components/ui/popover.tsx
new file mode 100644
index 000000000..a0ec48bee
--- /dev/null
+++ b/pipes/meeting/src/components/ui/popover.tsx
@@ -0,0 +1,31 @@
+"use client"
+
+import * as React from "react"
+import * as PopoverPrimitive from "@radix-ui/react-popover"
+
+import { cn } from "@/lib/utils"
+
+const Popover = PopoverPrimitive.Root
+
+const PopoverTrigger = PopoverPrimitive.Trigger
+
+const PopoverContent = React.forwardRef<
+ React.ElementRef<typeof PopoverPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
+>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
+ <PopoverPrimitive.Portal>
+ <PopoverPrimitive.Content
+ ref={ref}
+ align={align}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className
+ )}
+ {...props}
+ />
+ </PopoverPrimitive.Portal>
+))
+PopoverContent.displayName = PopoverPrimitive.Content.displayName
+
+export { Popover, PopoverTrigger, PopoverContent }
diff --git a/pipes/meeting/src/components/ui/progress.tsx b/pipes/meeting/src/components/ui/progress.tsx
new file mode 100644
index 000000000..5c87ea486
--- /dev/null
+++ b/pipes/meeting/src/components/ui/progress.tsx
@@ -0,0 +1,28 @@
+"use client"
+
+import * as React from "react"
+import * as ProgressPrimitive from "@radix-ui/react-progress"
+
+import { cn } from "@/lib/utils"
+
+const Progress = React.forwardRef<
+ React.ElementRef<typeof ProgressPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
+>(({ className, value, ...props }, ref) => (
+ <ProgressPrimitive.Root
+ ref={ref}
+ className={cn(
+ "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
+ className
+ )}
+ {...props}
+ >
+ <ProgressPrimitive.Indicator
+ className="h-full w-full flex-1 bg-primary transition-all"
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
+ />
+ </ProgressPrimitive.Root>
+))
+Progress.displayName = ProgressPrimitive.Root.displayName
+
+export { Progress }
diff --git a/pipes/meeting/src/components/ui/select.tsx b/pipes/meeting/src/components/ui/select.tsx
new file mode 100644
index 000000000..cbe5a36b6
--- /dev/null
+++ b/pipes/meeting/src/components/ui/select.tsx
@@ -0,0 +1,160 @@
+"use client"
+
+import * as React from "react"
+import * as SelectPrimitive from "@radix-ui/react-select"
+import { Check, ChevronDown, ChevronUp } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Select = SelectPrimitive.Root
+
+const SelectGroup = SelectPrimitive.Group
+
+const SelectValue = SelectPrimitive.Value
+
+const SelectTrigger = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Trigger>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
+>(({ className, children, ...props }, ref) => (
+ <SelectPrimitive.Trigger
+ ref={ref}
+ className={cn(
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <SelectPrimitive.Icon asChild>
+ <ChevronDown className="h-4 w-4 opacity-50" />
+ </SelectPrimitive.Icon>
+ </SelectPrimitive.Trigger>
+))
+SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
+
+const SelectScrollUpButton = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.ScrollUpButton
+ ref={ref}
+ className={cn(
+ "flex cursor-default items-center justify-center py-1",
+ className
+ )}
+ {...props}
+ >
+ <ChevronUp className="h-4 w-4" />
+ </SelectPrimitive.ScrollUpButton>
+))
+SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
+
+const SelectScrollDownButton = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.ScrollDownButton
+ ref={ref}
+ className={cn(
+ "flex cursor-default items-center justify-center py-1",
+ className
+ )}
+ {...props}
+ >
+ <ChevronDown className="h-4 w-4" />
+ </SelectPrimitive.ScrollDownButton>
+))
+SelectScrollDownButton.displayName =
+ SelectPrimitive.ScrollDownButton.displayName
+
+const SelectContent = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
+>(({ className, children, position = "popper", ...props }, ref) => (
+ <SelectPrimitive.Portal>
+ <SelectPrimitive.Content
+ ref={ref}
+ className={cn(
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ position === "popper" &&
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
+ className
+ )}
+ position={position}
+ {...props}
+ >
+ <SelectScrollUpButton />
+ <SelectPrimitive.Viewport
+ className={cn(
+ "p-1",
+ position === "popper" &&
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
+ )}
+ >
+ {children}
+ </SelectPrimitive.Viewport>
+ <SelectScrollDownButton />
+ </SelectPrimitive.Content>
+ </SelectPrimitive.Portal>
+))
+SelectContent.displayName = SelectPrimitive.Content.displayName
+
+const SelectLabel = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Label>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.Label
+ ref={ref}
+ className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
+ {...props}
+ />
+))
+SelectLabel.displayName = SelectPrimitive.Label.displayName
+
+const SelectItem = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
+>(({ className, children, ...props }, ref) => (
+ <SelectPrimitive.Item
+ ref={ref}
+ className={cn(
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
+ className
+ )}
+ {...props}
+ >
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <SelectPrimitive.ItemIndicator>
+ <Check className="h-4 w-4" />
+ </SelectPrimitive.ItemIndicator>
+ </span>
+
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
+ </SelectPrimitive.Item>
+))
+SelectItem.displayName = SelectPrimitive.Item.displayName
+
+const SelectSeparator = React.forwardRef<
+ React.ElementRef<typeof SelectPrimitive.Separator>,
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
+>(({ className, ...props }, ref) => (
+ <SelectPrimitive.Separator
+ ref={ref}
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
+ {...props}
+ />
+))
+SelectSeparator.displayName = SelectPrimitive.Separator.displayName
+
+export {
+ Select,
+ SelectGroup,
+ SelectValue,
+ SelectTrigger,
+ SelectContent,
+ SelectLabel,
+ SelectItem,
+ SelectSeparator,
+ SelectScrollUpButton,
+ SelectScrollDownButton,
+}
diff --git a/pipes/meeting/src/components/ui/separator.tsx b/pipes/meeting/src/components/ui/separator.tsx
new file mode 100644
index 000000000..12d81c4a8
--- /dev/null
+++ b/pipes/meeting/src/components/ui/separator.tsx
@@ -0,0 +1,31 @@
+"use client"
+
+import * as React from "react"
+import * as SeparatorPrimitive from "@radix-ui/react-separator"
+
+import { cn } from "@/lib/utils"
+
+const Separator = React.forwardRef<
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
+>(
+ (
+ { className, orientation = "horizontal", decorative = true, ...props },
+ ref
+ ) => (
+ <SeparatorPrimitive.Root
+ ref={ref}
+ decorative={decorative}
+ orientation={orientation}
+ className={cn(
+ "shrink-0 bg-border",
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
+ className
+ )}
+ {...props}
+ />
+ )
+)
+Separator.displayName = SeparatorPrimitive.Root.displayName
+
+export { Separator }
diff --git a/pipes/meeting/src/components/ui/skeleton.tsx b/pipes/meeting/src/components/ui/skeleton.tsx
new file mode 100644
index 000000000..01b8b6d4f
--- /dev/null
+++ b/pipes/meeting/src/components/ui/skeleton.tsx
@@ -0,0 +1,15 @@
+import { cn } from "@/lib/utils"
+
+function Skeleton({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) {
+ return (
+ <div
+ className={cn("animate-pulse rounded-md bg-muted", className)}
+ {...props}
+ />
+ )
+}
+
+export { Skeleton }
diff --git a/pipes/meeting/src/components/ui/slider.tsx b/pipes/meeting/src/components/ui/slider.tsx
new file mode 100644
index 000000000..c31c2b3bc
--- /dev/null
+++ b/pipes/meeting/src/components/ui/slider.tsx
@@ -0,0 +1,28 @@
+"use client"
+
+import * as React from "react"
+import * as SliderPrimitive from "@radix-ui/react-slider"
+
+import { cn } from "@/lib/utils"
+
+const Slider = React.forwardRef<
+ React.ElementRef<typeof SliderPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
+>(({ className, ...props }, ref) => (
+ <SliderPrimitive.Root
+ ref={ref}
+ className={cn(
+ "relative flex w-full touch-none select-none items-center",
+ className
+ )}
+ {...props}
+ >
+ <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">
+ <SliderPrimitive.Range className="absolute h-full bg-primary" />
+ </SliderPrimitive.Track>
+ <SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
+ </SliderPrimitive.Root>
+))
+Slider.displayName = SliderPrimitive.Root.displayName
+
+export { Slider }
diff --git a/pipes/meeting/src/components/ui/switch.tsx b/pipes/meeting/src/components/ui/switch.tsx
new file mode 100644
index 000000000..bc69cf2db
--- /dev/null
+++ b/pipes/meeting/src/components/ui/switch.tsx
@@ -0,0 +1,29 @@
+"use client"
+
+import * as React from "react"
+import * as SwitchPrimitives from "@radix-ui/react-switch"
+
+import { cn } from "@/lib/utils"
+
+const Switch = React.forwardRef<
+ React.ElementRef<typeof SwitchPrimitives.Root>,
+ React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
+>(({ className, ...props }, ref) => (
+ <SwitchPrimitives.Root
+ className={cn(
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
+ className
+ )}
+ {...props}
+ ref={ref}
+ >
+ <SwitchPrimitives.Thumb
+ className={cn(
+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
+ )}
+ />
+ </SwitchPrimitives.Root>
+))
+Switch.displayName = SwitchPrimitives.Root.displayName
+
+export { Switch }
diff --git a/pipes/meeting/src/components/ui/toast.tsx b/pipes/meeting/src/components/ui/toast.tsx
new file mode 100644
index 000000000..521b94b07
--- /dev/null
+++ b/pipes/meeting/src/components/ui/toast.tsx
@@ -0,0 +1,129 @@
+"use client"
+
+import * as React from "react"
+import * as ToastPrimitives from "@radix-ui/react-toast"
+import { cva, type VariantProps } from "class-variance-authority"
+import { X } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const ToastProvider = ToastPrimitives.Provider
+
+const ToastViewport = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Viewport>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Viewport
+ ref={ref}
+ className={cn(
+ "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
+ className
+ )}
+ {...props}
+ />
+))
+ToastViewport.displayName = ToastPrimitives.Viewport.displayName
+
+const toastVariants = cva(
+ "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
+ {
+ variants: {
+ variant: {
+ default: "border bg-background text-foreground",
+ destructive:
+ "destructive group border-destructive bg-destructive text-destructive-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+const Toast = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Root>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
+ VariantProps<typeof toastVariants>
+>(({ className, variant, ...props }, ref) => {
+ return (
+ <ToastPrimitives.Root
+ ref={ref}
+ className={cn(toastVariants({ variant }), className)}
+ {...props}
+ />
+ )
+})
+Toast.displayName = ToastPrimitives.Root.displayName
+
+const ToastAction = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Action>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Action
+ ref={ref}
+ className={cn(
+ "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
+ className
+ )}
+ {...props}
+ />
+))
+ToastAction.displayName = ToastPrimitives.Action.displayName
+
+const ToastClose = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Close>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Close
+ ref={ref}
+ className={cn(
+ "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
+ className
+ )}
+ toast-close=""
+ {...props}
+ >
+ <X className="h-4 w-4" />
+ </ToastPrimitives.Close>
+))
+ToastClose.displayName = ToastPrimitives.Close.displayName
+
+const ToastTitle = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Title>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Title
+ ref={ref}
+ className={cn("text-sm font-semibold", className)}
+ {...props}
+ />
+))
+ToastTitle.displayName = ToastPrimitives.Title.displayName
+
+const ToastDescription = React.forwardRef<
+ React.ElementRef<typeof ToastPrimitives.Description>,
+ React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
+>(({ className, ...props }, ref) => (
+ <ToastPrimitives.Description
+ ref={ref}
+ className={cn("text-sm opacity-90", className)}
+ {...props}
+ />
+))
+ToastDescription.displayName = ToastPrimitives.Description.displayName
+
+type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>
+
+type ToastActionElement = React.ReactElement<typeof ToastAction>
+
+export {
+ type ToastProps,
+ type ToastActionElement,
+ ToastProvider,
+ ToastViewport,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ ToastClose,
+ ToastAction,
+}
diff --git a/pipes/meeting/src/components/ui/toaster.tsx b/pipes/meeting/src/components/ui/toaster.tsx
new file mode 100644
index 000000000..fe7103d70
--- /dev/null
+++ b/pipes/meeting/src/components/ui/toaster.tsx
@@ -0,0 +1,35 @@
+"use client"
+
+import { useToast } from "@/components/ui/use-toast"
+import {
+ Toast,
+ ToastClose,
+ ToastDescription,
+ ToastProvider,
+ ToastTitle,
+ ToastViewport,
+} from "@/components/ui/toast"
+
+export function Toaster() {
+ const { toasts } = useToast()
+
+ return (
+ <ToastProvider>
+ {toasts.map(function ({ id, title, description, action, ...props }) {
+ return (
+ <Toast key={id} {...props}>
+ <div className="grid gap-1">
+ {title && <ToastTitle>{title}</ToastTitle>}
+ {description && (
+ <ToastDescription>{description}</ToastDescription>
+ )}
+ </div>
+ {action}
+ <ToastClose />
+ </Toast>
+ )
+ })}
+ <ToastViewport />
+ </ToastProvider>
+ )
+}
diff --git a/pipes/meeting/src/components/ui/tooltip.tsx b/pipes/meeting/src/components/ui/tooltip.tsx
new file mode 100644
index 000000000..30fc44d90
--- /dev/null
+++ b/pipes/meeting/src/components/ui/tooltip.tsx
@@ -0,0 +1,30 @@
+"use client"
+
+import * as React from "react"
+import * as TooltipPrimitive from "@radix-ui/react-tooltip"
+
+import { cn } from "@/lib/utils"
+
+const TooltipProvider = TooltipPrimitive.Provider
+
+const Tooltip = TooltipPrimitive.Root
+
+const TooltipTrigger = TooltipPrimitive.Trigger
+
+const TooltipContent = React.forwardRef<
+ React.ElementRef<typeof TooltipPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
+>(({ className, sideOffset = 4, ...props }, ref) => (
+ <TooltipPrimitive.Content
+ ref={ref}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className
+ )}
+ {...props}
+ />
+))
+TooltipContent.displayName = TooltipPrimitive.Content.displayName
+
+export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
diff --git a/pipes/meeting/src/components/ui/use-toast.ts b/pipes/meeting/src/components/ui/use-toast.ts
new file mode 100644
index 000000000..02e111d81
--- /dev/null
+++ b/pipes/meeting/src/components/ui/use-toast.ts
@@ -0,0 +1,194 @@
+"use client"
+
+// Inspired by react-hot-toast library
+import * as React from "react"
+
+import type {
+ ToastActionElement,
+ ToastProps,
+} from "@/components/ui/toast"
+
+const TOAST_LIMIT = 1
+const TOAST_REMOVE_DELAY = 1000000
+
+type ToasterToast = ToastProps & {
+ id: string
+ title?: React.ReactNode
+ description?: React.ReactNode
+ action?: ToastActionElement
+}
+
+const actionTypes = {
+ ADD_TOAST: "ADD_TOAST",
+ UPDATE_TOAST: "UPDATE_TOAST",
+ DISMISS_TOAST: "DISMISS_TOAST",
+ REMOVE_TOAST: "REMOVE_TOAST",
+} as const
+
+let count = 0
+
+function genId() {
+ count = (count + 1) % Number.MAX_SAFE_INTEGER
+ return count.toString()
+}
+
+type ActionType = typeof actionTypes
+
+type Action =
+ | {
+ type: ActionType["ADD_TOAST"]
+ toast: ToasterToast
+ }
+ | {
+ type: ActionType["UPDATE_TOAST"]
+ toast: Partial<ToasterToast>
+ }
+ | {
+ type: ActionType["DISMISS_TOAST"]
+ toastId?: ToasterToast["id"]
+ }
+ | {
+ type: ActionType["REMOVE_TOAST"]
+ toastId?: ToasterToast["id"]
+ }
+
+interface State {
+ toasts: ToasterToast[]
+}
+
+const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>()
+
+const addToRemoveQueue = (toastId: string) => {
+ if (toastTimeouts.has(toastId)) {
+ return
+ }
+
+ const timeout = setTimeout(() => {
+ toastTimeouts.delete(toastId)
+ dispatch({
+ type: "REMOVE_TOAST",
+ toastId: toastId,
+ })
+ }, TOAST_REMOVE_DELAY)
+
+ toastTimeouts.set(toastId, timeout)
+}
+
+export const reducer = (state: State, action: Action): State => {
+ switch (action.type) {
+ case "ADD_TOAST":
+ return {
+ ...state,
+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
+ }
+
+ case "UPDATE_TOAST":
+ return {
+ ...state,
+ toasts: state.toasts.map((t) =>
+ t.id === action.toast.id ? { ...t, ...action.toast } : t
+ ),
+ }
+
+ case "DISMISS_TOAST": {
+ const { toastId } = action
+
+ // ! Side effects ! - This could be extracted into a dismissToast() action,
+ // but I'll keep it here for simplicity
+ if (toastId) {
+ addToRemoveQueue(toastId)
+ } else {
+ state.toasts.forEach((toast) => {
+ addToRemoveQueue(toast.id)
+ })
+ }
+
+ return {
+ ...state,
+ toasts: state.toasts.map((t) =>
+ t.id === toastId || toastId === undefined
+ ? {
+ ...t,
+ open: false,
+ }
+ : t
+ ),
+ }
+ }
+ case "REMOVE_TOAST":
+ if (action.toastId === undefined) {
+ return {
+ ...state,
+ toasts: [],
+ }
+ }
+ return {
+ ...state,
+ toasts: state.toasts.filter((t) => t.id !== action.toastId),
+ }
+ }
+}
+
+const listeners: Array<(state: State) => void> = []
+
+let memoryState: State = { toasts: [] }
+
+function dispatch(action: Action) {
+ memoryState = reducer(memoryState, action)
+ listeners.forEach((listener) => {
+ listener(memoryState)
+ })
+}
+
+type Toast = Omit<ToasterToast, "id">
+
+function toast({ ...props }: Toast) {
+ const id = genId()
+
+ const update = (props: ToasterToast) =>
+ dispatch({
+ type: "UPDATE_TOAST",
+ toast: { ...props, id },
+ })
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id })
+
+ dispatch({
+ type: "ADD_TOAST",
+ toast: {
+ ...props,
+ id,
+ open: true,
+ onOpenChange: (open) => {
+ if (!open) dismiss()
+ },
+ },
+ })
+
+ return {
+ id: id,
+ dismiss,
+ update,
+ }
+}
+
+function useToast() {
+ const [state, setState] = React.useState<State>(memoryState)
+
+ React.useEffect(() => {
+ listeners.push(setState)
+ return () => {
+ const index = listeners.indexOf(setState)
+ if (index > -1) {
+ listeners.splice(index, 1)
+ }
+ }
+ }, [state])
+
+ return {
+ ...state,
+ toast,
+ dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
+ }
+}
+
+export { useToast, toast }
diff --git a/pipes/meeting/src/lib/actions/video-actions.ts b/pipes/meeting/src/lib/actions/video-actions.ts
new file mode 100644
index 000000000..9238c9e96
--- /dev/null
+++ b/pipes/meeting/src/lib/actions/video-actions.ts
@@ -0,0 +1,35 @@
+'use server'
+
+import { readFile } from 'node:fs/promises'
+import { resolve } from 'node:path'
+
+export async function getMediaFile(filePath: string): Promise<{ data: string; mimeType: string }> {
+ try {
+ const absolutePath = resolve(filePath)
+ const buffer = await readFile(absolutePath)
+ // convert to base64
+ const data = buffer.toString('base64')
+
+ const getMimeType = (path: string): string => {
+ const ext = path.split('.').pop()?.toLowerCase()
+ const isAudio = path.toLowerCase().includes('input') || path.toLowerCase().includes('output')
+
+ switch (ext) {
+ case 'mp4': return 'video/mp4'
+ case 'webm': return 'video/webm'
+ case 'ogg': return 'video/ogg'
+ case 'mp3': return 'audio/mpeg'
+ case 'wav': return 'audio/wav'
+ default: return isAudio ? 'audio/mpeg' : 'video/mp4'
+ }
+ }
+
+ return {
+ data,
+ mimeType: getMimeType(filePath)
+ }
+ } catch (error) {
+ console.error('failed to read media file:', error)
+ throw new Error(`failed to read media file: ${error instanceof Error ? error.message : 'unknown error'}`)
+ }
+}
diff --git a/pipes/meeting/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/meeting/src/lib/hooks/use-copy-to-clipboard.tsx
new file mode 100644
index 000000000..e011d69bd
--- /dev/null
+++ b/pipes/meeting/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -0,0 +1,33 @@
+"use client";
+
+import * as React from "react";
+
+export interface useCopyToClipboardProps {
+ timeout?: number;
+}
+
+export function useCopyToClipboard({
+ timeout = 2000,
+}: useCopyToClipboardProps) {
+ const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+
+ const copyToClipboard = (value: string) => {
+ if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
+ return;
+ }
+
+ if (!value) {
+ return;
+ }
+
+ navigator.clipboard.writeText(value).then(() => {
+ setIsCopied(true);
+
+ setTimeout(() => {
+ setIsCopied(false);
+ }, timeout);
+ });
+ };
+
+ return { isCopied, copyToClipboard };
+}
diff --git a/pipes/meeting/src/lib/hooks/use-debounce.tsx b/pipes/meeting/src/lib/hooks/use-debounce.tsx
new file mode 100644
index 000000000..ba49720b5
--- /dev/null
+++ b/pipes/meeting/src/lib/hooks/use-debounce.tsx
@@ -0,0 +1,17 @@
+import { useState, useEffect } from "react";
+
+export function useDebounce<T>(value: T, delay: number): T {
+ const [debouncedValue, setDebouncedValue] = useState<T>(value);
+
+ useEffect(() => {
+ const handler = setTimeout(() => {
+ setDebouncedValue(value);
+ }, delay);
+
+ return () => {
+ clearTimeout(handler);
+ };
+ }, [value, delay]);
+
+ return debouncedValue;
+}
diff --git a/pipes/meeting/src/lib/hooks/use-health-check.tsx b/pipes/meeting/src/lib/hooks/use-health-check.tsx
new file mode 100644
index 000000000..8d32570d0
--- /dev/null
+++ b/pipes/meeting/src/lib/hooks/use-health-check.tsx
@@ -0,0 +1,131 @@
+import { useState, useEffect, useCallback, useRef } from "react";
+
+import { debounce } from "lodash";
+
+
+interface HealthCheckResponse {
+ status: string;
+ status_code: number;
+ last_frame_timestamp: string | null;
+ last_audio_timestamp: string | null;
+ last_ui_timestamp: string | null;
+ frame_status: string;
+ audio_status: string;
+ ui_status: string;
+ message: string;
+}
+
+function isHealthChanged(
+ oldHealth: HealthCheckResponse | null,
+ newHealth: HealthCheckResponse
+): boolean {
+ if (!oldHealth) return true;
+ return (
+ oldHealth.status !== newHealth.status ||
+ oldHealth.status_code !== newHealth.status_code ||
+ oldHealth.last_frame_timestamp !== newHealth.last_frame_timestamp ||
+ oldHealth.last_audio_timestamp !== newHealth.last_audio_timestamp ||
+ oldHealth.last_ui_timestamp !== newHealth.last_ui_timestamp ||
+ oldHealth.frame_status !== newHealth.frame_status ||
+ oldHealth.audio_status !== newHealth.audio_status ||
+ oldHealth.ui_status !== newHealth.ui_status ||
+ oldHealth.message !== newHealth.message
+ );
+}
+
+interface HealthCheckHook {
+ health: HealthCheckResponse | null;
+ isServerDown: boolean;
+ isLoading: boolean;
+ fetchHealth: () => Promise<void>;
+ debouncedFetchHealth: () => Promise<void>;
+}
+
+export function useHealthCheck() {
+ const [health, setHealth] = useState<HealthCheckResponse | null>(null);
+ const [isServerDown, setIsServerDown] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+ const abortControllerRef = useRef<AbortController | null>(null);
+ const healthRef = useRef(health);
+
+ const fetchHealth = useCallback(async () => {
+ if (abortControllerRef.current) {
+ abortControllerRef.current.abort();
+ }
+
+ abortControllerRef.current = new AbortController();
+
+ try {
+ setIsLoading(true);
+ const response = await fetch("http://localhost:3030/health", {
+ cache: "no-store",
+ signal: abortControllerRef.current.signal,
+ headers: {
+ "Cache-Control": "no-cache",
+ Pragma: "no-cache",
+ },
+ });
+
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+
+ const data: HealthCheckResponse = await response.json();
+
+ if (isHealthChanged(healthRef.current, data)) {
+ setHealth(data);
+ healthRef.current = data;
+ }
+
+ setIsServerDown(false);
+ } catch (error) {
+ if (error instanceof Error && error.name === "AbortError") {
+ return;
+ }
+
+ // console.error("Health check error:", error);
+ if (!isServerDown) {
+ setIsServerDown(true);
+ const errorHealth: HealthCheckResponse = {
+ last_frame_timestamp: null,
+ last_audio_timestamp: null,
+ last_ui_timestamp: null,
+ frame_status: "error",
+ audio_status: "error",
+ ui_status: "error",
+ status: "error",
+ status_code: 500,
+ message: "Failed to fetch health status. Server might be down.",
+ };
+ setHealth(errorHealth);
+ healthRef.current = errorHealth;
+ }
+ } finally {
+ setIsLoading(false);
+ }
+ }, [isServerDown, setIsLoading]);
+
+ const debouncedFetchHealth = useCallback(debounce(fetchHealth, 200), [
+ fetchHealth,
+ ]);
+
+ useEffect(() => {
+ fetchHealth();
+ const interval = setInterval(fetchHealth, 1000);
+
+ return () => {
+ clearInterval(interval);
+ if (abortControllerRef.current) {
+ abortControllerRef.current.abort();
+ }
+ };
+ }, [fetchHealth]);
+
+ return {
+ health,
+ isServerDown,
+ isLoading,
+ fetchHealth,
+ debouncedFetchHealth,
+ } as HealthCheckHook;
+}
diff --git a/pipes/meeting/src/lib/hooks/use-search-history.tsx b/pipes/meeting/src/lib/hooks/use-search-history.tsx
new file mode 100644
index 000000000..4673e3e22
--- /dev/null
+++ b/pipes/meeting/src/lib/hooks/use-search-history.tsx
@@ -0,0 +1,127 @@
+"use client";
+
+import { useEffect, useState } from 'react';
+import localforage from 'localforage';
+
+export interface SearchHistory {
+ id: string;
+ query: string;
+ timestamp: string;
+ searchParams: {
+ q?: string;
+ content_type: string;
+ limit: number;
+ offset: number;
+ start_time: string;
+ end_time: string;
+ app_name?: string;
+ window_name?: string;
+ include_frames: boolean;
+ min_length: number;
+ max_length: number;
+ };
+ results: any[];
+ messages: {
+ id: string;
+ type: 'search' | 'ai';
+ content: string;
+ timestamp: string;
+ }[];
+ }
+
+const HISTORY_KEY = 'screenpipe-search-history';
+
+export function useSearchHistory() {
+ const [searches, setSearches] = useState<SearchHistory[]>([]);
+ const [currentSearchId, setCurrentSearchId] = useState<string | null>(null);
+ const [isLoading, setIsLoading] = useState(true);
+ const [isCollapsed, setIsCollapsed] = useState(true);
+
+ useEffect(() => {
+ loadSearches();
+ }, []);
+
+ const loadSearches = async () => {
+ try {
+ const stored = await localforage.getItem<SearchHistory[]>(HISTORY_KEY);
+ setSearches(stored || []);
+ } catch (error) {
+ console.error('failed to load search history:', error);
+ }
+ setIsLoading(false);
+ };
+
+ const saveSearches = async (updated: SearchHistory[]) => {
+ try {
+ await localforage.setItem(HISTORY_KEY, updated);
+ setSearches(updated);
+ } catch (error) {
+ console.error('failed to save search history:', error);
+ }
+ };
+
+ const addSearch = async (searchParams: any, results: any[]) => {
+ const timestamp = new Date().toISOString();
+ const newSearch: SearchHistory = {
+ id: crypto.randomUUID(),
+ query: searchParams.q || '',
+ timestamp,
+ searchParams,
+ results,
+ messages: [{
+ id: crypto.randomUUID(),
+ type: 'search' as const,
+ content: searchParams.q || '',
+ timestamp
+ }]
+ };
+
+ const updated = [newSearch, ...searches];
+ await saveSearches(updated);
+ setCurrentSearchId(newSearch.id);
+ return newSearch.id;
+ };
+
+ const addAIResponse = async (searchId: string, response: string) => {
+ const timestamp = new Date().toISOString();
+ const updated = searches.map(search => {
+ if (search.id === searchId) {
+ return {
+ ...search,
+ messages: [...search.messages, {
+ id: crypto.randomUUID(),
+ type: 'ai' as const,
+ content: response,
+ timestamp
+ }]
+ };
+ }
+ return search;
+ });
+ await saveSearches(updated);
+ };
+
+ const deleteSearch = async (id: string) => {
+ const updated = searches.filter(s => s.id !== id);
+ await saveSearches(updated);
+ if (currentSearchId === id) {
+ setCurrentSearchId(null);
+ }
+ };
+
+ const toggleCollapse = () => {
+ setIsCollapsed(!isCollapsed);
+ };
+
+ return {
+ searches,
+ currentSearchId,
+ setCurrentSearchId,
+ addSearch,
+ addAIResponse,
+ deleteSearch,
+ isLoading,
+ isCollapsed,
+ toggleCollapse
+ };
+}
diff --git a/pipes/meeting/src/lib/hooks/use-settings.tsx b/pipes/meeting/src/lib/hooks/use-settings.tsx
new file mode 100644
index 000000000..7c4f3a6ea
--- /dev/null
+++ b/pipes/meeting/src/lib/hooks/use-settings.tsx
@@ -0,0 +1,106 @@
+"use client";
+
+import { useState, useEffect } from "react";
+import type { Settings } from "@screenpipe/js";
+
+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: "",
+ },
+ };
+
+ const [settings, setSettings] = useState<Settings>(defaultSettings);
+ const [loading, setLoading] = useState(false);
+ const [error, setError] = useState<Error | null>(null);
+
+ useEffect(() => {
+ const loadSettings = async () => {
+ setLoading(true);
+ try {
+ const response = await fetch("/api/settings");
+ const data = await response.json();
+ setSettings({ ...defaultSettings, ...data });
+ } catch (err) {
+ setError(err as Error);
+ } finally {
+ setLoading(false);
+ }
+ };
+ loadSettings();
+ }, []);
+
+ const updateSetting = async <T extends keyof Settings>(
+ key: T,
+ value: Settings[T]
+ ) => {
+ try {
+ await fetch("/api/settings", {
+ method: "PUT",
+ body: JSON.stringify({ key, value }),
+ });
+ setSettings((prev) => ({ ...prev, [key]: value }));
+ } catch (err) {
+ setError(err as Error);
+ }
+ };
+
+ const updateSettings = async (newSettings: Partial<Settings>) => {
+ try {
+ await fetch("/api/settings", {
+ method: "PUT",
+ body: JSON.stringify({ value: newSettings, isPartialUpdate: true }),
+ });
+ setSettings((prev) => ({ ...prev, ...newSettings }));
+ } catch (err) {
+ setError(err as Error);
+ }
+ };
+
+ const resetSettings = async (settingKey?: keyof Settings) => {
+ try {
+ await fetch("/api/settings", {
+ method: "PUT",
+ body: JSON.stringify({ reset: true, key: settingKey }),
+ });
+ if (settingKey) {
+ setSettings((prev) => ({
+ ...prev,
+ [settingKey]: defaultSettings[settingKey],
+ }));
+ } else {
+ setSettings(defaultSettings);
+ }
+ } catch (err) {
+ setError(err as Error);
+ }
+ };
+
+ return {
+ settings,
+ loading,
+ error,
+ updateSetting,
+ updateSettings,
+ resetSettings,
+ };
+}
diff --git a/pipes/meeting/src/lib/hooks/use-sql-autocomplete.tsx b/pipes/meeting/src/lib/hooks/use-sql-autocomplete.tsx
new file mode 100644
index 000000000..7db3de855
--- /dev/null
+++ b/pipes/meeting/src/lib/hooks/use-sql-autocomplete.tsx
@@ -0,0 +1,61 @@
+import { useState, useEffect, useCallback } from "react";
+
+interface AutocompleteItem {
+ name: string;
+ count: number;
+}
+
+const CACHE_DURATION = 5 * 60 * 1000; // 5 minutes
+
+const cache: Record<string, { data: AutocompleteItem[]; timestamp: number }> =
+ {};
+
+export function useSqlAutocomplete(type: "app" | "window") {
+ const [items, setItems] = useState<AutocompleteItem[]>([]);
+ const [isLoading, setIsLoading] = useState(false);
+
+ const fetchItems = useCallback(async () => {
+ setIsLoading(true);
+ try {
+ const cachedData = cache[type];
+ if (cachedData && Date.now() - cachedData.timestamp < CACHE_DURATION) {
+ setItems(cachedData.data);
+ } else {
+ const query = `
+ SELECT ${
+ type === "app" ? "ocr.app_name" : "ocr.window_name"
+ } as name, COUNT(*) as count
+ FROM ocr_text ocr
+ JOIN frames f ON ocr.frame_id = f.id
+ WHERE f.timestamp > datetime('now', '-7 days')
+ GROUP BY ${type === "app" ? "ocr.app_name" : "ocr.window_name"}
+ ORDER BY count DESC
+ LIMIT 100
+ `;
+ const response = await fetch("http://localhost:3030/raw_sql", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ query }),
+ });
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+ const result = await response.json();
+ setItems(result);
+ cache[type] = { data: result, timestamp: Date.now() };
+ }
+ } catch (error) {
+ console.error("failed to fetch items:", error);
+ } finally {
+ setIsLoading(false);
+ }
+ }, [type]);
+
+ useEffect(() => {
+ fetchItems();
+ }, [fetchItems]);
+
+ return { items, isLoading };
+}
diff --git a/pipes/meeting/src/lib/utils.ts b/pipes/meeting/src/lib/utils.ts
new file mode 100644
index 000000000..5fe39b53c
--- /dev/null
+++ b/pipes/meeting/src/lib/utils.ts
@@ -0,0 +1,62 @@
+import { ContentItem } from "@screenpipe/js";
+import { clsx, type ClassValue } from "clsx";
+import { twMerge } from "tailwind-merge";
+import levenshtein from "js-levenshtein";
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
+
+export const removeDuplicateSelections = (
+ results: ContentItem[],
+ selectedResults: Set<number>,
+ similarityThreshold: number = 0.9
+): Set<number> => {
+ const newSelectedResults = new Set<number>();
+ const seenContents: string[] = [];
+
+ const getSimilarity = (str1: string, str2: string): number => {
+ const maxLength = Math.max(str1.length, str2.length);
+ const distance = levenshtein(str1, str2);
+ return 1 - distance / maxLength;
+ };
+
+ const isDuplicate = (content: string): boolean => {
+ return seenContents.some(
+ (seenContent) =>
+ getSimilarity(content, seenContent) >= similarityThreshold
+ );
+ };
+
+ Array.from(selectedResults).forEach((index) => {
+ const item = results[index];
+ if (!item || !item.type) return;
+
+ let content = "";
+ if (item.type === "OCR") content = item.content.text;
+ else if (item.type === "Audio") content = item.content.transcription;
+ else if (item.type === "UI") content = item.content.text;
+
+ if (!isDuplicate(content)) {
+ seenContents.push(content);
+ newSelectedResults.add(index);
+ }
+ });
+
+ return newSelectedResults;
+};
+
+export function keysToCamelCase<T>(obj: any): T {
+ if (Array.isArray(obj)) {
+ return obj.map((v) => keysToCamelCase<T>(v)) as any;
+ } else if (obj !== null && obj.constructor === Object) {
+ return Object.keys(obj).reduce(
+ (result, key) => ({
+ ...result,
+ [toCamelCase(key)]: keysToCamelCase(obj[key]),
+ }),
+ {}
+ ) as T;
+ }
+ return obj;
+}
diff --git a/pipes/meeting/tailwind.config.ts b/pipes/meeting/tailwind.config.ts
new file mode 100644
index 000000000..9a58f7ad4
--- /dev/null
+++ b/pipes/meeting/tailwind.config.ts
@@ -0,0 +1,84 @@
+import type { Config } from "tailwindcss";
+
+export default {
+ darkMode: ["class"],
+ content: [
+ "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
+ "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
+ "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
+ ],
+ theme: {
+ extend: {
+ colors: {
+ background: 'hsl(var(--background))',
+ foreground: 'hsl(var(--foreground))',
+ card: {
+ DEFAULT: 'hsl(var(--card))',
+ foreground: 'hsl(var(--card-foreground))'
+ },
+ popover: {
+ DEFAULT: 'hsl(var(--popover))',
+ foreground: 'hsl(var(--popover-foreground))'
+ },
+ primary: {
+ DEFAULT: 'hsl(var(--primary))',
+ foreground: 'hsl(var(--primary-foreground))'
+ },
+ secondary: {
+ DEFAULT: 'hsl(var(--secondary))',
+ foreground: 'hsl(var(--secondary-foreground))'
+ },
+ muted: {
+ DEFAULT: 'hsl(var(--muted))',
+ foreground: 'hsl(var(--muted-foreground))'
+ },
+ accent: {
+ DEFAULT: 'hsl(var(--accent))',
+ foreground: 'hsl(var(--accent-foreground))'
+ },
+ destructive: {
+ DEFAULT: 'hsl(var(--destructive))',
+ foreground: 'hsl(var(--destructive-foreground))'
+ },
+ border: 'hsl(var(--border))',
+ input: 'hsl(var(--input))',
+ ring: 'hsl(var(--ring))',
+ chart: {
+ '1': 'hsl(var(--chart-1))',
+ '2': 'hsl(var(--chart-2))',
+ '3': 'hsl(var(--chart-3))',
+ '4': 'hsl(var(--chart-4))',
+ '5': 'hsl(var(--chart-5))'
+ }
+ },
+ borderRadius: {
+ lg: 'var(--radius)',
+ md: 'calc(var(--radius) - 2px)',
+ sm: 'calc(var(--radius) - 4px)'
+ },
+ keyframes: {
+ 'accordion-down': {
+ from: {
+ height: '0'
+ },
+ to: {
+ height: 'var(--radix-accordion-content-height)'
+ }
+ },
+ 'accordion-up': {
+ from: {
+ height: 'var(--radix-accordion-content-height)'
+ },
+ to: {
+ height: '0'
+ }
+ }
+ },
+ animation: {
+ 'accordion-down': 'accordion-down 0.2s ease-out',
+ 'accordion-up': 'accordion-up 0.2s ease-out'
+ }
+ }
+ },
+ plugins: [require("tailwindcss-animate")],
+} satisfies Config;
diff --git a/pipes/meeting/tsconfig.json b/pipes/meeting/tsconfig.json
new file mode 100644
index 000000000..c1334095f
--- /dev/null
+++ b/pipes/meeting/tsconfig.json
@@ -0,0 +1,27 @@
+{
+ "compilerOptions": {
+ "target": "ES2017",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ],
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ },
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
+ "exclude": ["node_modules"]
+}
diff --git a/screenpipe-app-tauri/components/header.tsx b/screenpipe-app-tauri/components/header.tsx
index 359da87b5..d9ba1e8a8 100644
--- a/screenpipe-app-tauri/components/header.tsx
+++ b/screenpipe-app-tauri/components/header.tsx
@@ -123,13 +123,6 @@ export default function Header() {
const { setShowOnboarding } = useOnboarding();
const { setShowChangelogDialog } = useChangelogDialog();
- const handleShowMeetingHistory = async () => {
- await invoke("show_meetings");
- };
-
- const handleShowIdentifySpeakers = async () => {
- await invoke("show_identify_speakers");
- };
return (
<div>
@@ -181,24 +174,6 @@ export default function Header() {
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
- <DropdownMenuGroup>
- <DropdownMenuItem
- className="cursor-pointer"
- onClick={handleShowMeetingHistory}
- disabled={!health || health.status === "error"}
- >
- <Calendar className="mr-2 h-4 w-4" />
- <span>meetings</span>
- </DropdownMenuItem>
- <DropdownMenuItem
- className="cursor-pointer"
- onClick={handleShowIdentifySpeakers}
- >
- <Fingerprint className="mr-2 h-4 w-4" />
- <span>identify speakers</span>
- </DropdownMenuItem>
- </DropdownMenuGroup>
- <DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem
className="cursor-pointer"
diff --git a/screenpipe-app-tauri/lib/types/index.ts b/screenpipe-app-tauri/lib/types/index.ts
index bc0f308e3..e69de29bb 100644
--- a/screenpipe-app-tauri/lib/types/index.ts
+++ b/screenpipe-app-tauri/lib/types/index.ts
@@ -1,3 +0,0 @@
-export * from "./meeting";
-export * from "./speaker";
-export * from "./history";
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lock
index 0f79116d7..e9d91ab60 100755
--- a/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -4966,7 +4966,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "0.18.3"
+version = "0.18.4"
dependencies = [
"anyhow",
"axum",
diff --git a/screenpipe-app-tauri/src-tauri/src/main.rs b/screenpipe-app-tauri/src-tauri/src/main.rs
index c4b11178d..7c7d679b9 100755
--- a/screenpipe-app-tauri/src-tauri/src/main.rs
+++ b/screenpipe-app-tauri/src-tauri/src/main.rs
@@ -36,7 +36,6 @@ mod analytics;
mod icons;
use crate::analytics::start_analytics;
use crate::llm_sidecar::LLMSidecar;
-use tauri::Emitter;
mod commands;
mod llm_sidecar;
diff --git a/screenpipe-app-tauri/src-tauri/tauri.conf.json b/screenpipe-app-tauri/src-tauri/tauri.conf.json
index e8b1741a5..ac6d94df8 100644
--- a/screenpipe-app-tauri/src-tauri/tauri.conf.json
+++ b/screenpipe-app-tauri/src-tauri/tauri.conf.json
@@ -88,29 +88,6 @@
"minWidth": 1200,
"minHeight": 850,
"resizable": true
- },
- {
- "title": "meetings",
- "url": "/meetings",
- "label": "meetings",
- "width": 1200,
- "height": 1000,
- "minWidth": 1000,
- "minHeight": 600,
- "visible": false,
- "decorations": true,
- "transparent": true
- },
- {
- "title": "identify speakers",
- "url": "/identify-speakers",
- "label": "identify-speakers",
- "visible": false,
- "width": 1200,
- "height": 850,
- "minWidth": 1200,
- "minHeight": 850,
- "resizable": true
}
],
"security": {