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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
refactor: rename timeline to rewind
Louis Beaumont1ac1a4c0d729
diff --git a/pipes/rewind/.gitignore b/pipes/rewind/.gitignorenew file mode 100644index 000000000..5ef6a5207--- /dev/null+++ b/pipes/rewind/.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.tsdiff --git a/pipes/rewind/README.md b/pipes/rewind/README.mdnew file mode 100644index 000000000..ee670679c--- /dev/null+++ b/pipes/rewind/README.md@@ -0,0 +1,8 @@+++scroll back in time, select a time range, cmd+k and ask AI anything about your screen activity or audio conversations++<img width="912" alt="Screenshot 2024-12-16 at 12 33 16 PM" src="https://github.com/user-attachments/assets/071941ba-3b54-4d63-a6a5-66e2e5358814" />++<img width="1119" alt="Screenshot 2024-12-16 at 2 03 25 PM" src="https://github.com/user-attachments/assets/48a8deec-c014-4a35-927a-b74b32c3d5cd" />+diff --git a/pipes/rewind/bun.lockb b/pipes/rewind/bun.lockbnew file mode 100755index 000000000..8e14c97a5Binary files /dev/null and b/pipes/rewind/bun.lockb differdiff --git a/pipes/rewind/components.json b/pipes/rewind/components.jsonnew file mode 100644index 000000000..d710b4962--- /dev/null+++ b/pipes/rewind/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 filediff --git a/pipes/rewind/eslint.config.mjs b/pipes/rewind/eslint.config.mjsnew file mode 100644index 000000000..c85fb67c4--- /dev/null+++ b/pipes/rewind/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/rewind/next.config.ts b/pipes/rewind/next.config.tsnew file mode 100644index 000000000..b6d621fe0--- /dev/null+++ b/pipes/rewind/next.config.ts@@ -0,0 +1,14 @@+import type { NextConfig } from "next";++const nextConfig: NextConfig = {+ transpilePackages: ["@screenpipe/js"],+ webpack: (config, { }) => {+ return config;+ },+ devIndicators: {+ buildActivity: false,+ appIsrStatus: false+ }+};++export default nextConfig;diff --git a/pipes/rewind/package.json b/pipes/rewind/package.jsonnew file mode 100644index 000000000..4d7dd058f--- /dev/null+++ b/pipes/rewind/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-scroll-area": "^1.2.2",+ "@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/browser": "^0.1.21",+ "@screenpipe/js": "^1.0.6",+ "@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",+ "postcss": "^8.4.49",+ "tailwindcss": "^3.4.16",+ "typescript": "^5"+ }+}diff --git a/pipes/rewind/postcss.config.mjs b/pipes/rewind/postcss.config.mjsnew file mode 100644index 000000000..1a69fd2a4--- /dev/null+++ b/pipes/rewind/postcss.config.mjs@@ -0,0 +1,8 @@+/** @type {import('postcss-load-config').Config} */+const config = {+ plugins: {+ tailwindcss: {},+ },+};++export default config;diff --git a/pipes/rewind/public/file.svg b/pipes/rewind/public/file.svgnew file mode 100644index 000000000..004145cdd--- /dev/null+++ b/pipes/rewind/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 filediff --git a/pipes/rewind/public/globe.svg b/pipes/rewind/public/globe.svgnew file mode 100644index 000000000..567f17b0d--- /dev/null+++ b/pipes/rewind/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 filediff --git a/pipes/rewind/public/next.svg b/pipes/rewind/public/next.svgnew file mode 100644index 000000000..5174b28c5--- /dev/null+++ b/pipes/rewind/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 filediff --git a/pipes/rewind/public/vercel.svg b/pipes/rewind/public/vercel.svgnew file mode 100644index 000000000..770539603--- /dev/null+++ b/pipes/rewind/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 filediff --git a/pipes/rewind/public/window.svg b/pipes/rewind/public/window.svgnew file mode 100644index 000000000..b2b2a44f6--- /dev/null+++ b/pipes/rewind/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 filediff --git a/pipes/rewind/src/app/api/settings/route.ts b/pipes/rewind/src/app/api/settings/route.tsnew file mode 100644index 000000000..5f2bf8fdc--- /dev/null+++ b/pipes/rewind/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 = {+ analyticsEnabled: true,+ 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();+ 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/rewind/src/app/favicon.ico b/pipes/rewind/src/app/favicon.iconew file mode 100644index 000000000..5be4ba27aBinary files /dev/null and b/pipes/rewind/src/app/favicon.ico differdiff --git a/pipes/rewind/src/app/globals.css b/pipes/rewind/src/app/globals.cssnew file mode 100644index 000000000..ff005b73a--- /dev/null+++ b/pipes/rewind/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 !pointer-events-auto;+ }+}diff --git a/pipes/rewind/src/app/layout.tsx b/pipes/rewind/src/app/layout.tsxnew file mode 100644index 000000000..819c745ad--- /dev/null+++ b/pipes/rewind/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: "Timeline • Screenpipe",+ description: "View your screenpipe recordings in a timeline",+};++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/rewind/src/app/page.tsx b/pipes/rewind/src/app/page.tsxnew file mode 100644index 000000000..7a3c0aa5a--- /dev/null+++ b/pipes/rewind/src/app/page.tsx@@ -0,0 +1,477 @@+"use client";+import { useEffect, useState, useRef, useMemo } from "react";+import { Loader2, RotateCcw, AlertCircle } from "lucide-react";+import { TimelineIconsSection } from "@/components/timeline/timeline-dock-section";+import { AudioTranscript } from "@/components/timeline/audio-transcript";+import { AIPanel } from "@/components/timeline/ai-panel";+import { TimelineProvider } from "@/lib/hooks/use-timeline-selection";+import { throttle } from "lodash";+import { AGENTS } from "@/components/timeline/agents";+import { TimelineSelection } from "@/components/timeline/timeline-selection";++export interface StreamTimeSeriesResponse {+ timestamp: string;+ devices: DeviceFrameResponse[];+}++interface DeviceFrameResponse {+ device_id: string;+ frame: string; // base64 encoded image+ metadata: DeviceMetadata;+ audio: AudioData[];+}++interface DeviceMetadata {+ file_path: string;+ app_name: string;+ window_name: string;+ ocr_text: string;+ timestamp: string;+}++export interface AudioData {+ device_name: string;+ is_input: boolean;+ transcription: string;+ audio_file_path: string;+ duration_secs: number;+ start_offset: number;+}++interface TimeRange {+ start: Date;+ end: Date;+}++export default function Timeline() {+ const [currentFrame, setCurrentFrame] = useState<DeviceFrameResponse | null>(+ null+ );+ const [frames, setFrames] = useState<StreamTimeSeriesResponse[]>([]);+ const [currentIndex, setCurrentIndex] = useState(0);+ const [isLoading, setIsLoading] = useState(true);+ const [message, setMessage] = useState<string | null>(null);+ const [error, setError] = useState<string | null>(null);+ const eventSourceRef = useRef<EventSource | null>(null);+ const retryTimeoutRef = useRef<NodeJS.Timeout | null>(null);+ const [loadedTimeRange, setLoadedTimeRange] = useState<TimeRange | null>(+ null+ );+ const [isAiPanelExpanded, setIsAiPanelExpanded] = useState(false);+ const containerRef = useRef<HTMLDivElement | null>(null);+ const [position, setPosition] = useState({+ x: 0,+ y: 0,+ });++ useEffect(() => {+ setPosition({+ x: window.innerWidth - 400,+ y: window.innerHeight / 4,+ });+ }, []);++ const setupEventSource = () => {+ if (eventSourceRef.current) {+ eventSourceRef.current.close();+ }++ const endTime = new Date();+ endTime.setMinutes(endTime.getMinutes() - 2);+ const startTime = new Date();+ startTime.setHours(0, 1, 0, 0);++ const url = `http://localhost:3030/stream/frames?start_time=${startTime.toISOString()}&end_time=${endTime.toISOString()}&order=descending`;++ setLoadedTimeRange({+ start: startTime,+ end: endTime,+ });++ console.log("starting stream:", url);+ setMessage("connecting to the server...");++ const eventSource = new EventSource(url);+ eventSourceRef.current = eventSource;++ const connectionTimeout = setTimeout(() => {+ if (eventSource.readyState !== EventSource.OPEN) {+ console.error(+ "Connection timeout: Unable to establish connection, make sure screenpipe is running"+ );+ setIsLoading(false);+ setMessage(null);+ setError("unable to establish connection, is screenpipe running?");+ eventSource.close();+ }+ }, 5000);++ eventSource.onmessage = (event) => {+ try {+ const data = JSON.parse(event.data);+ if (data === "keep-alive-text") {+ setError(null);+ setIsLoading(false);+ setMessage(+ "please wait, we are collecting data to stream timeline..."+ );+ return;+ }++ if (data.timestamp && data.devices) {+ setFrames((prev) => {+ const exists = prev.some((f) => f.timestamp === data.timestamp);+ if (exists) return prev;++ if (prev.length === 0) {+ const frameTime = new Date(data.timestamp);+ setLoadedTimeRange((current) => {+ if (!current) return null;+ return {+ ...current,+ start: frameTime,+ end: current.end,+ };+ });+ return [data];+ }++ // Find the correct insertion index using binary search+ const timestamp = new Date(data.timestamp).getTime();+ let left = 0;+ let right = prev.length;++ while (left < right) {+ const mid = Math.floor((left + right) / 2);+ const midTimestamp = new Date(prev[mid].timestamp).getTime();++ if (midTimestamp < timestamp) {+ right = mid;+ } else {+ left = mid + 1;+ }+ }++ const newFrames = [...prev];+ newFrames.splice(left, 0, data);+ return newFrames;+ });++ setCurrentFrame((prev) => prev || data.devices[0]);+ setIsLoading(false);+ setError(null);+ setMessage(null);+ }+ } catch (error) {+ console.error("failed to parse frame data:", error);+ }+ };++ eventSource.onerror = (error) => {+ clearTimeout(connectionTimeout);+ if (eventSource.readyState === EventSource.CLOSED) {+ console.log("stream ended (expected behavior)", error);+ setMessage(null);+ setIsLoading(false);+ return;+ }++ console.error("eventsource error:", error);+ setError("connection lost. retrying...");+ };++ eventSource.onopen = () => {+ console.log("eventsource connection opened");+ clearTimeout(connectionTimeout);+ setError(null);+ setMessage(null);+ setIsLoading(true);+ };+ };++ useEffect(() => {+ setupEventSource();+ const currentRetryTimeout = retryTimeoutRef.current;++ return () => {+ if (eventSourceRef.current) {+ eventSourceRef.current.close();+ }+ if (currentRetryTimeout) {+ clearTimeout(currentRetryTimeout);+ }+ setIsLoading(false);+ setError(null);+ setMessage(null);+ };+ }, []);++ const handleScroll = useMemo(+ () =>+ throttle((e: WheelEvent) => {+ const isWithinAiPanel = document+ .querySelector(".ai-panel")+ ?.contains(e.target as Node);+ const isWithinAudioPanel = document+ .querySelector(".audio-transcript-panel")+ ?.contains(e.target as Node);+ const isWithinTimelineDialog = document+ .querySelector('[role="dialog"]')+ ?.contains(e.target as Node);++ if (isWithinAiPanel || isWithinAudioPanel || isWithinTimelineDialog) {+ e.preventDefault();+ e.stopPropagation();+ return;+ }++ e.preventDefault();+ e.stopPropagation();++ const scrollSensitivity = 1;+ const delta = -Math.sign(e.deltaY) / scrollSensitivity;++ const newIndex = Math.min(+ Math.max(+ 0,+ currentIndex + (delta > 0 ? Math.ceil(delta) : Math.floor(delta))+ ),+ frames.length - 1+ );++ if (newIndex !== currentIndex) {+ setCurrentIndex(newIndex);+ frames[newIndex] && setCurrentFrame(frames[newIndex].devices[0]);+ }+ }, 16),+ [currentIndex, frames]+ );++ const timePercentage = useMemo(() => {+ if (!frames.length || currentIndex >= frames.length || !loadedTimeRange) {+ return 0;+ }++ const currentFrame = frames[currentIndex];+ if (!currentFrame?.timestamp) {+ return 0;+ }++ const frameTime = new Date(currentFrame.timestamp);+ const totalVisibleMilliseconds =+ loadedTimeRange.end.getTime() - loadedTimeRange.start.getTime();+ const currentMilliseconds =+ frameTime.getTime() - loadedTimeRange.start.getTime();++ return (currentMilliseconds / totalVisibleMilliseconds) * 100;+ }, [currentIndex, frames, loadedTimeRange]);++ useEffect(() => {+ const preventScroll = (e: WheelEvent) => {+ const isWithinAiPanel = document+ .querySelector(".ai-panel")+ ?.contains(e.target as Node);+ const isWithinAudioPanel = document+ .querySelector(".audio-transcript-panel")+ ?.contains(e.target as Node);+ const isWithinTimelineDialog = document+ .querySelector('[role="dialog"]')+ ?.contains(e.target as Node);++ if (!isWithinAiPanel && !isWithinAudioPanel && !isWithinTimelineDialog) {+ e.preventDefault();+ }+ };++ document.addEventListener("wheel", preventScroll, { passive: false });+ return () => document.removeEventListener("wheel", preventScroll);+ }, []);++ const handleRefresh = () => {+ window.location.reload();+ setFrames([]);+ setCurrentFrame(null);+ setCurrentIndex(0);+ setError(null);+ setMessage(null);+ setIsLoading(false);+ setMessage("connecting to the server...");+ setupEventSource();+ };++ useEffect(() => {+ const container = containerRef.current;+ if (container) {+ container.addEventListener("wheel", handleScroll, { passive: false });+ }++ return () => {+ if (container) {+ container.removeEventListener("wheel", handleScroll);+ }+ };+ }, [handleScroll]);++ return (+ <TimelineProvider>+ <div+ ref={containerRef}+ className="fixed inset-0 flex flex-col bg-background text-foreground overflow-hidden relative"+ style={{+ height: "100vh",+ overscrollBehavior: "none",+ WebkitUserSelect: "none",+ userSelect: "none",+ MozUserSelect: "none",+ msUserSelect: "none",+ }}+ >+ <button+ onClick={handleRefresh}+ className="absolute top-4 right-4 p-2 text-foreground hover:text-foreground/70 bg-background rounded border border-muted-foreground hover:border-foreground/50 transition-colors z-50"+ >+ <RotateCcw className="h-4 w-4" />+ </button>++ <div className="flex-1 relative min-h-0">+ {isLoading && (+ <div className="absolute inset-0 flex items-center justify-center">+ <div className="bg-background/90 p-5 border rounded-lg shadow-lg text-center">+ <p>loading frames...</p>+ <Loader2 className="h-4 w-4 animate-spin mx-auto mt-2" />+ </div>+ </div>+ )}+ {message && (+ <div className="absolute inset-0 flex items-center justify-center">+ <div className="bg-background/90 p-5 border rounded-lg shadow-lg text-center">+ <p>{message}</p>+ <Loader2 className="h-4 w-4 animate-spin mx-auto mt-2" />+ </div>+ </div>+ )}+ {error && (+ <div className="absolute inset-0 flex items-center justify-center">+ <div className="bg-destructive/10 p-5 border-destructive/20 border rounded-lg text-destructive flex flex-col items-center">+ <AlertCircle className="h-4 w-4 mb-2" />+ <p className="mb-4">+ i cannot reach your screenpipe data, did you enable the+ timeline feature?+ </p>+ <button+ onClick={handleRefresh}+ className="flex items-center gap-2 px-4 py-2 bg-background text-foreground hover:bg-muted transition-colors rounded-md border border-input"+ >+ <RotateCcw className="h-4 w-4" />+ reload+ </button>+ </div>+ </div>+ )}+ {currentFrame && (+ <img+ src={`data:image/png;base64,${currentFrame.frame}`}+ className="absolute inset-0 w-4/5 h-auto max-h-[75vh] object-contain mx-auto border rounded-xl p-2 mt-2"+ alt="Current frame"+ />+ )}+ {currentFrame && (+ <AudioTranscript+ frames={frames}+ currentIndex={currentIndex}+ groupingWindowMs={30000} // 30 seconds window+ />+ )}+ </div>++ <div className="w-4/5 mx-auto my-8 relative select-none">+ <div className="h-[60px] bg-card border rounded-lg shadow-sm cursor-crosshair relative">+ {loadedTimeRange && (+ <TimelineSelection loadedTimeRange={loadedTimeRange} />+ )}+ <div+ className="absolute top-0 h-full w-1 bg-foreground/50 shadow-sm opacity-80 z-10"+ style={{ left: `${timePercentage}%` }}+ >+ <div className="relative -top-6 right-3 text-[10px] text-muted-foreground whitespace-nowrap">+ {currentIndex < frames.length &&+ frames[currentIndex] &&+ frames[currentIndex].timestamp &&+ (() => {+ try {+ return new Date(+ frames[currentIndex].timestamp+ ).toLocaleTimeString(+ "en-US", // explicitly specify locale+ {+ hour: "2-digit",+ minute: "2-digit",+ second: "2-digit",+ }+ );+ } catch (e) {+ console.error("failed to format timestamp:", e);+ return frames[currentIndex].timestamp; // fallback to raw timestamp+ }+ })()}+ </div>+ </div>+ </div>++ <AIPanel+ position={position}+ onPositionChange={setPosition}+ onClose={() => {+ setIsAiPanelExpanded(false);+ }}+ frames={frames}+ agents={AGENTS}+ isExpanded={isAiPanelExpanded}+ onExpandedChange={setIsAiPanelExpanded}+ />++ {loadedTimeRange && frames.length > 0 && (+ <TimelineIconsSection blocks={frames} />+ )}++ <div className="relative mt-1 px-2 text-[10px] text-muted-foreground select-none">+ {Array(7)+ .fill(0)+ .map((_, i) => {+ if (!loadedTimeRange) return null;+ const totalMinutes =+ (loadedTimeRange.end.getTime() -+ loadedTimeRange.start.getTime()) /+ (1000 * 60);+ const minutesPerStep = totalMinutes / 6;+ const date = new Date(+ loadedTimeRange.start.getTime() ++ i * minutesPerStep * 60 * 1000+ );+ return (+ <div+ key={i}+ className="absolute transform -translate-x-1/2"+ style={{ left: `${(i * 100) / 6}%` }}+ >+ {date.toLocaleTimeString([], {+ hour: "2-digit",+ minute: "2-digit",+ })}+ </div>+ );+ })}+ </div>+ </div>++ <div className="fixed left-12 top-1/2 -translate-y-1/2 text-xs text-muted-foreground">+ <div className="flex flex-col items-center gap-1">+ <span>▲</span>+ <span>scroll</span>+ <span>▼</span>+ </div>+ </div>+ </div>+ </TimelineProvider>+ );+}diff --git a/pipes/rewind/src/components/chat-message-actions.tsx b/pipes/rewind/src/components/chat-message-actions.tsxnew file mode 100644index 000000000..da312d152--- /dev/null+++ b/pipes/rewind/src/components/chat-message-actions.tsx@@ -0,0 +1,40 @@+"use client";++// import { type Message } from "ai";++import { Button } from "@/components/ui/button";+import { IconCheck, IconCopy } from "@/components/ui/icons";+import { useCopyToClipboard } from "@/lib/hooks/use-copy-to-clipboard";+import { cn } from "@/lib/utils";++interface ChatMessageActionsProps extends React.ComponentProps<"div"> {+ message: any;+}++export function ChatMessageActions({+ message,+ className,+ ...props+}: ChatMessageActionsProps) {+ const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });++ const onCopy = () => {+ if (isCopied) return;+ copyToClipboard(message.content);+ };++ return (+ <div+ className={cn(+ "flex items-center justify-end transition-opacity group-hover:opacity-100 md:absolute md:-right-10 md:-top-2 md:opacity-0",+ className+ )}+ {...props}+ >+ <Button variant="ghost" size="icon" onClick={onCopy}>+ {isCopied ? <IconCheck /> : <IconCopy />}+ <span className="sr-only">Copy message</span>+ </Button>+ </div>+ );+}diff --git a/pipes/rewind/src/components/chat-message.tsx b/pipes/rewind/src/components/chat-message.tsxnew file mode 100644index 000000000..2dee23299--- /dev/null+++ b/pipes/rewind/src/components/chat-message.tsx@@ -0,0 +1,111 @@+import { Message } from "ai";+import remarkGfm from "remark-gfm";+import remarkMath from "remark-math";++import { cn } from "@/lib/utils";+import { CodeBlock } from "@/components/ui/codeblock";+import { MemoizedReactMarkdown } from "@/components/markdown";+import { IconOpenAI, IconUser, IconOllama } from "@/components/ui/icons";+import { ChatMessageActions } from "@/components/chat-message-actions";+import { useSettings } from "@/lib/hooks/use-settings";+import { VideoComponent } from "./video";++export interface ChatMessageProps {+ message: Message;+}++export function ChatMessage({ message, ...props }: ChatMessageProps) {+ const { settings } = useSettings();++ const hasMP4File = (content: string) =>+ content.trim().toLowerCase().includes(".mp4");++ if (!message?.content?.trim()) {+ return null;+ }++ return (+ <div+ className={cn("group relative mb-4 flex items-start w-full")}+ {...props}+ >+ <div+ className={cn(+ "flex size-8 shrink-0 select-none items-center justify-center rounded-md border shadow",+ message.role === "user"+ ? "bg-background"+ : "bg-primary text-primary-foreground"+ )}+ >+ {message.role === "user" ? (+ <IconUser />+ ) : settings.aiUrl.includes("openai") ||+ settings.aiUrl.includes("worker") ? (+ <IconOpenAI />+ ) : (+ <>🦙</>+ )}+ </div>+ <div className="flex-1 px-1 ml-4 space-y-2 overflow-hidden w-[96em]">+ <MemoizedReactMarkdown+ className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 w-full"+ remarkPlugins={[remarkGfm, remarkMath]}+ components={{+ p({ children }) {+ return <p className="mb-2 last:mb-0">{children}</p>;+ },+ a({ node, href, children, ...props }) {+ const isMP4Link = href?.toLowerCase().includes(".mp4");++ if (isMP4Link && href) {+ return <VideoComponent filePath={href} />;+ }+ return (+ <a+ href={href}+ target="_blank"+ rel="noopener noreferrer"+ {...props}+ >+ {children}+ </a>+ );+ },+ code({ node, className, children, ...props }) {+ const content = String(children).replace(/\n$/, "");+ const match = /language-(\w+)/.exec(className || "");++ const isMP4File = hasMP4File(content);++ if (isMP4File || !match) {+ if (isMP4File) {+ return <VideoComponent filePath={content.trim()} />;+ }+ return (+ <code+ className="px-1 py-0.5 rounded-sm font-mono text-sm"+ {...props}+ >+ {content}+ </code>+ );+ }++ return (+ <CodeBlock+ key={Math.random()}+ language={(match && match[1]) || ""}+ value={content}+ {...props}+ />+ );+ },+ }}+ >+ {message.content}+ </MemoizedReactMarkdown>+ <ChatMessageActions message={message} />+ </div>+ </div>+ );+}diff --git a/pipes/rewind/src/components/context-usage-indicator.tsx b/pipes/rewind/src/components/context-usage-indicator.tsxnew file mode 100644index 000000000..daa188abd--- /dev/null+++ b/pipes/rewind/src/components/context-usage-indicator.tsx@@ -0,0 +1,46 @@+import React from "react";+import { motion } from "framer-motion";+import { AlertTriangle } from "lucide-react";++interface ContextUsageIndicatorProps {+ currentSize: number;+ maxSize: number;+}++export function ContextUsageIndicator({+ currentSize,+ maxSize,+}: ContextUsageIndicatorProps) {+ const percentage = Math.min((currentSize / maxSize) * 100, 100);+ const circumference = 2 * Math.PI * 14;++ return (+ <div className="w-8 h-8 relative">+ <svg width="32" height="32" viewBox="0 0 32 32">+ <circle+ cx="16"+ cy="16"+ r="14"+ fill="none"+ stroke="#e2e8f0"+ strokeWidth="2"+ />+ <motion.circle+ cx="16"+ cy="16"+ r="14"+ fill="none"+ stroke="black"+ strokeWidth="2"+ strokeDasharray={circumference}+ initial={{ strokeDashoffset: circumference }}+ animate={{ strokeDashoffset: circumference - (percentage / 100) * circumference }}+ transition={{ duration: 0.5 }}+ />+ </svg>+ {percentage > 90 && (+ <AlertTriangle className="w-5 h-5 absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-red-500" />+ )}+ </div>+ );+}diff --git a/pipes/rewind/src/components/date-time-picker.tsx b/pipes/rewind/src/components/date-time-picker.tsxnew file mode 100644index 000000000..1ef5766a7--- /dev/null+++ b/pipes/rewind/src/components/date-time-picker.tsx@@ -0,0 +1,80 @@+import * as React from "react";+import { format } from "date-fns";+import { Calendar as CalendarIcon } from "lucide-react";++import { cn } from "@/lib/utils";+import { Button } from "@/components/ui/button";+import { Calendar } from "@/components/ui/calendar";+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@/components/ui/popover";+import { Input } from "./ui/input";++export function DateTimePicker({+ date,+ setDate,+ className,+}: {+ date: Date;+ setDate: (date: Date) => void;+ className?: string;+}) {+ const [selectedDateTime, setSelectedDateTime] = React.useState<Date>(date);++ React.useEffect(() => {+ setSelectedDateTime(date);+ }, [date]);++ const handleDateSelect = (selectedDate: Date | undefined) => {+ if (selectedDate) {+ const newDateTime = new Date(selectedDateTime);+ newDateTime.setFullYear(selectedDate.getFullYear());+ newDateTime.setMonth(selectedDate.getMonth());+ newDateTime.setDate(selectedDate.getDate());+ setSelectedDateTime(newDateTime);+ setDate(newDateTime);+ }+ };++ const handleTimeChange = (event: React.ChangeEvent<HTMLInputElement>) => {+ const [hours, minutes] = event.target.value.split(":").map(Number);+ if (!isNaN(hours) && !isNaN(minutes)) {+ const newDateTime = new Date(selectedDateTime);+ newDateTime.setHours(hours);+ newDateTime.setMinutes(minutes);+ setSelectedDateTime(newDateTime);+ setDate(newDateTime);+ }+ };++ return (+ <Popover>+ <PopoverTrigger asChild>+ <Button+ variant={"outline"}+ className={cn("w-full justify-start text-left font-normal")}+ >+ <CalendarIcon className="mr-2 h-4 w-4 text-gray-400" size={18} />+ {format(date, "PPP HH:mm").toLowerCase()}+ </Button>+ </PopoverTrigger>+ <PopoverContent className={cn("w-auto p-0", className)}>+ <Calendar+ mode="single"+ selected={selectedDateTime}+ onSelect={handleDateSelect}+ initialFocus+ />+ <div className="p-3 border-t border-border">+ <Input+ type="time"+ onChange={handleTimeChange}+ value={format(selectedDateTime, "HH:mm")}+ />+ </div>+ </PopoverContent>+ </Popover>+ );+}diff --git a/pipes/rewind/src/components/example-search-cards.tsx b/pipes/rewind/src/components/example-search-cards.tsxnew file mode 100644index 000000000..588be3870--- /dev/null+++ b/pipes/rewind/src/components/example-search-cards.tsx@@ -0,0 +1,127 @@+import React from "react";+import { Card, CardContent } from "@/components/ui/card";+import { Search, Mail, Clock, AlertCircle } from "lucide-react";+import { Badge } from "./ui/badge";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "./ui/tooltip";+import { useHealthCheck } from "@/lib/hooks/use-health-check";++export interface ExampleSearch {+ title: string;+ windowName?: string;+ appName?: string;+ limit: number;+ minLength: number;+ contentType: string;+ startDate: Date;+}++interface ExampleSearchCardsProps {+ onSelect: (example: ExampleSearch) => void;+}++const exampleSearches: ExampleSearch[] = [+ {+ title: "summarize last hour meeting",+ contentType: "audio",+ limit: 120,+ minLength: 10,+ startDate: new Date(Date.now() - 60 * 60 * 1000), // 1 hour ago+ },+ {+ title: "summarize my mails",+ contentType: "ocr",+ windowName: "gmail",+ limit: 25,+ minLength: 50,+ startDate: new Date(new Date().setHours(0, 0, 0, 0)), // since midnight local time+ },+ {+ title: "time spent last hour",+ contentType: "ocr",+ limit: 25,+ minLength: 50,+ startDate: new Date(Date.now() - 60 * 60 * 1000), // 1 hour ago+ },+];++export function ExampleSearchCards({ onSelect }: ExampleSearchCardsProps) {+ const { health } = useHealthCheck();+ const getIcon = (title: string) => {+ switch (title) {+ case "summarize last hour meeting":+ return <Search className="mr-2 h-4 w-4" />;+ case "summarize my mails":+ return <Mail className="mr-2 h-4 w-4" />;+ case "time spent last hour":+ return <Clock className="mr-2 h-4 w-4" />;+ default:+ return <Search className="mr-2 h-4 w-4" />; // default icon+ }+ };++ const isHealthError = health?.status === "error";++ return (+ <div className="grid grid-cols-1 md:grid-cols-3 gap-4 mt-4">+ {exampleSearches.map((example, index) => (+ <TooltipProvider key={index}>+ <Tooltip>+ <TooltipTrigger asChild>+ <div+ className={`relative group h-[150px] ${+ isHealthError ? "opacity-50 cursor-not-allowed" : ""+ }`}+ >+ <div className="absolute inset-0 rounded-lg transition-all duration-300 ease-out group-hover:before:opacity-100 group-hover:before:scale-100 before:absolute before:inset-0 before:rounded-lg before:border-2 before:border-black dark:before:border-white before:opacity-0 before:scale-95 group-hover:before:opacity-100 group-hover:before:scale-100 before:transition-all before:duration-300 before:ease-out" />+ <Card+ className={`cursor-pointer relative bg-white dark:bg-gray-800 z-10 h-full transition-transform duration-300 ease-out ${+ isHealthError ? "" : "group-hover:scale-[0.98]"+ }`}+ onClick={() => !isHealthError && onSelect(example)}+ >+ <CardContent className="p-3 flex flex-col h-full">+ <div className="flex items-center mb-1">+ {getIcon(example.title)}+ <h3 className="text-sm font-semibold">{example.title}</h3>+ </div>+ <div className="flex flex-wrap gap-2 mt-2">+ {example.contentType && (+ <Badge>{example.contentType}</Badge>+ )}+ {example.windowName && (+ <Badge>window: {example.windowName}</Badge>+ )}+ {example.appName && <Badge>app: {example.appName}</Badge>}+ {example.limit && <Badge>limit: {example.limit}</Badge>}+ {example.minLength && (+ <Badge>min: {example.minLength}</Badge>+ )}+ {example.startDate && (+ <Badge>+ start: {example.startDate.toLocaleString()}+ </Badge>+ )}+ </div>+ </CardContent>+ </Card>+ </div>+ </TooltipTrigger>+ {isHealthError && (+ <TooltipContent>+ <div className="flex items-center">+ <AlertCircle className="mr-2 h-4 w-4 text-red-500" />+ <p>screenpipe is not running. examples are disabled.</p>+ </div>+ </TooltipContent>+ )}+ </Tooltip>+ </TooltipProvider>+ ))}+ </div>+ );+}diff --git a/pipes/rewind/src/components/markdown.tsx b/pipes/rewind/src/components/markdown.tsxnew file mode 100644index 000000000..d4491467a--- /dev/null+++ b/pipes/rewind/src/components/markdown.tsx@@ -0,0 +1,9 @@+import { FC, memo } from 'react'+import ReactMarkdown, { Options } from 'react-markdown'++export const MemoizedReactMarkdown: FC<Options> = memo(+ ReactMarkdown,+ (prevProps, nextProps) =>+ prevProps.children === nextProps.children &&+ prevProps.className === nextProps.className+)diff --git a/pipes/rewind/src/components/spinner.tsx b/pipes/rewind/src/components/spinner.tsxnew file mode 100644index 000000000..68e47ccbd--- /dev/null+++ b/pipes/rewind/src/components/spinner.tsx@@ -0,0 +1,16 @@+"use client";++export const spinner = (+ <svg+ fill="none"+ stroke="currentColor"+ strokeWidth="1.5"+ viewBox="0 0 24 24"+ strokeLinecap="round"+ strokeLinejoin="round"+ xmlns="http://www.w3.org/2000/svg"+ className="size-5 animate-spin stroke-zinc-400"+ >+ <path d="M12 3v3m6.366-.366-2.12 2.12M21 12h-3m.366 6.366-2.12-2.12M12 21v-3m-6.366.366 2.12-2.12M3 12h3m-.366-6.366 2.12 2.12"></path>+ </svg>+);diff --git a/pipes/rewind/src/components/timeline/agents.tsx b/pipes/rewind/src/components/timeline/agents.tsxnew file mode 100644index 000000000..b795f7a2a--- /dev/null+++ b/pipes/rewind/src/components/timeline/agents.tsx@@ -0,0 +1,322 @@+import { StreamTimeSeriesResponse } from "@/app/page";+import OpenAI from "openai";+import { ChatCompletionMessageParam } from "openai/resources/index.mjs";++export interface Agent {+ id: string;+ name: string;+ description: string;+ analyze: (+ frames: StreamTimeSeriesResponse[],+ openai: OpenAI,+ options: {+ model: string;+ onProgress: (chunk: string) => void;+ signal?: AbortSignal;+ },+ userQuery: string+ ) => Promise<void>;+}++async function streamCompletion(+ openai: OpenAI,+ messages: ChatCompletionMessageParam[],+ userQuery: string,+ options: {+ model: string;+ onProgress: (chunk: string) => void;+ signal?: AbortSignal;+ }+) {+ const messagesWithQuery = [+ ...messages,+ {+ role: "user" as const,+ content: `User question: "${userQuery}"\nPlease analyze the data in context of this question.`,+ },+ ];++ const stream = await openai.chat.completions.create(+ {+ model: options.model,+ messages: messagesWithQuery,+ stream: true,+ },+ {+ signal: options.signal,+ }+ );++ let fullResponse = "";+ for await (const chunk of stream) {+ const content = chunk.choices[0]?.delta?.content || "";+ fullResponse += content;+ options.onProgress(fullResponse);+ }+}++export async function analyzeChunk(+ chunk: any[],+ openai: OpenAI,+ model: string,+ signal?: AbortSignal+): Promise<string> {+ const response = await openai.chat.completions.create(+ {+ model,+ messages: [+ {+ role: "user" as const,+ content:+ "summarize this chunk of activity in 2-3 sentences, focus on key events and patterns",+ },+ {+ role: "user",+ content: JSON.stringify(chunk),+ },+ ],+ },+ {+ signal,+ }+ );+ return response.choices[0]?.message?.content || "";+}++export const AGENTS: Agent[] = [+ {+ id: "recursive-summarizer",+ name: "recursive summarizer",+ description:+ "good at processing long time ranges but quality decreases with shorter time ranges",+ analyze: async (+ frames,+ openai,+ { model, onProgress = () => {}, signal },+ userQuery+ ) => {+ console.log("userQuery", userQuery);+ console.log("frames", frames);+ if (!frames.length) {+ onProgress("no frames to analyze\n\n");+ return;+ }++ onProgress("analyzing chunks...\n\n");++ const chunkSize = 5 * 60 * 1000;+ const chunks: any[] = [];+ let currentChunk: any[] = [];++ frames.forEach((frame) => {+ const frameTime = new Date(frame.timestamp);+ if (+ currentChunk.length === 0 ||+ frameTime.getTime() - new Date(currentChunk[0].timestamp).getTime() <+ chunkSize+ ) {+ currentChunk.push({+ timestamp: frame.timestamp,+ apps: frame.devices.map((d) => d.metadata.app_name),+ windows: frame.devices.map((d) => d.metadata.window_name),+ text: frame.devices.map((d) => d.metadata.ocr_text).filter(Boolean),+ audio: frame.devices.flatMap((d) => d.audio),+ });+ } else {+ chunks.push(currentChunk);+ currentChunk = [frame];+ }+ });++ if (currentChunk.length > 0) {+ chunks.push(currentChunk);+ }++ const chunkSummaries = await Promise.all(+ chunks.map(async (chunk, index) => {+ const summary = await analyzeChunk(chunk, openai, model, signal);+ onProgress(`chunk ${index + 1}/${chunks.length}: ${summary}\n`);+ return {+ time: new Date(chunk[0].timestamp).toLocaleTimeString(),+ summary,+ };+ })+ );++ onProgress("\ncreating final summary...\n\n");++ await streamCompletion(+ openai,+ [+ {+ role: "user",+ content: `create a hierarchical summary with these sections:+ ### overview+ (one paragraph summary of entire time range, focusing on answering the user's question)++ ### timeline+ (list of chunk summaries with timestamps)++ ### patterns+ (key patterns or insights across chunks)`,+ },+ {+ role: "user",+ content: JSON.stringify({+ timeRange: {+ start: new Date(+ frames[frames.length - 1].timestamp+ ).toLocaleTimeString(),+ end: new Date(frames[0].timestamp).toLocaleTimeString(),+ },+ chunkSummaries,+ }),+ },+ ],+ userQuery,+ { model, onProgress, signal }+ );+ },+ },+ {+ id: "context-master",+ name: "context master",+ description: "analyzes everything: apps, windows, text & audio",+ analyze: async (+ frames,+ openai,+ { model, onProgress, signal },+ userQuery+ ) => {+ const contextData = frames.map((frame) => ({+ timestamp: frame.timestamp,+ devices: frame.devices.map((device) => ({+ device_id: device.device_id,+ metadata: device.metadata,+ audio: device.audio,+ })),+ }));++ await streamCompletion(+ openai,+ [+ {+ role: "user",+ content:+ "analyze all context including apps, windows, text & audio. provide insights about user activity patterns",+ },+ {+ role: "user",+ content: JSON.stringify(contextData),+ },+ ],+ userQuery,+ { model, onProgress, signal }+ );+ },+ },+ {+ id: "window-tracker",+ name: "window tracker",+ description: "focuses on app & window usage data",+ analyze: async (+ frames,+ openai,+ { model, onProgress, signal },+ userQuery+ ) => {+ const windowData = frames.map((frame) => ({+ timestamp: frame.timestamp,+ windows: frame.devices.map((device) => ({+ app: device.metadata.app_name,+ window: device.metadata.window_name,+ })),+ }));++ await streamCompletion(+ openai,+ [+ {+ role: "user",+ content:+ "analyze app and window usage patterns, focus on work habits and application transitions",+ },+ {+ role: "user",+ content: JSON.stringify(windowData),+ },+ ],+ userQuery,+ { model, onProgress, signal }+ );+ },+ },+ {+ id: "text-scanner",+ name: "text scanner",+ description: "analyzes visible text (OCR)",+ analyze: async (+ frames,+ openai,+ { model, onProgress, signal },+ userQuery+ ) => {+ const textData = frames.map((frame) => ({+ timestamp: frame.timestamp,+ text: frame.devices+ .map((device) => device.metadata.ocr_text)+ .filter(Boolean),+ }));++ await streamCompletion(+ openai,+ [+ {+ role: "user",+ content:+ "analyze OCR text content, identify key topics and information being viewed",+ },+ {+ role: "user",+ content: JSON.stringify(textData),+ },+ ],+ userQuery,+ { model, onProgress, signal }+ );+ },+ },+ {+ id: "voice-analyzer",+ name: "voice analyzer",+ description: "focuses on audio transcriptions",+ analyze: async (+ frames,+ openai,+ { model, onProgress, signal },+ userQuery+ ) => {+ const audioData = frames.map((frame) => ({+ timestamp: frame.timestamp,+ audio: frame.devices.flatMap((device) => device.audio),+ }));++ await streamCompletion(+ openai,+ [+ {+ role: "user",+ content:+ "analyze audio transcriptions, identify key conversations and spoken content",+ },+ {+ role: "user",+ content: JSON.stringify(audioData),+ },+ ],+ userQuery,+ { model, onProgress, signal }+ );+ },+ },+];diff --git a/pipes/rewind/src/components/timeline/ai-panel.tsx b/pipes/rewind/src/components/timeline/ai-panel.tsxnew file mode 100644index 000000000..c420851a1--- /dev/null+++ b/pipes/rewind/src/components/timeline/ai-panel.tsx@@ -0,0 +1,441 @@+import { useRef, useState, useEffect } from "react";+import { Message, generateId } from "ai";+import { OpenAI } from "openai";+import { ChatMessage } from "@/components/chat-message";+import { useToast } from "@/components/ui/use-toast";+import { Input } from "@/components/ui/input";+import { Button } from "@/components/ui/button";+import { Loader2, Send, Square, X, GripHorizontal, Bot } from "lucide-react";+import { StreamTimeSeriesResponse } from "@/app/page";+import { useTimelineSelection } from "@/lib/hooks/use-timeline-selection";+import { Agent } from "./agents";+import { pipe, type Settings } from "@screenpipe/browser";+import { useAiProvider } from "@/lib/hooks/use-ai-provider";+import {+ Tooltip,+ TooltipContent,+ TooltipProvider,+ TooltipTrigger,+} from "@/components/ui/tooltip";+import { useSettings } from "@/lib/hooks/use-settings";++interface AIPanelProps {+ position: { x: number; y: number };+ onPositionChange: (pos: { x: number; y: number }) => void;+ onClose: () => void;+ frames: StreamTimeSeriesResponse[];+ agents: Agent[];+ isExpanded: boolean;+ onExpandedChange: (expanded: boolean) => void;+}++export function AIPanel({+ position,+ onPositionChange,+ onClose,+ frames,+ agents,+ isExpanded,+ onExpandedChange,+}: AIPanelProps) {+ const { settings } = useSettings();+ const [chatMessages, setChatMessages] = useState<Array<Message>>([]);+ const [isAiLoading, setIsAiLoading] = useState(false);+ const [isStreaming, setIsStreaming] = useState(false);+ const [aiInput, setAiInput] = useState("");+ const [selectedAgent, setSelectedAgent] = useState<Agent>(agents[0]);+ const [isDraggingPanel, setIsDraggingPanel] = useState(false);+ const [dragOffset, setDragOffset] = useState({ x: 0, y: 0 });+ const [chatWindowSize, setChatWindowSize] = useState({+ width: 400,+ height: 500,+ });+ const [osType, setOsType] = useState<string>("");++ const inputRef = useRef<HTMLInputElement>(null);+ const aiPanelRef = useRef<HTMLDivElement>(null);+ const resizerRef = useRef<HTMLDivElement | null>(null);+ const { toast } = useToast();+ const { selectionRange, setSelectionRange } = useTimelineSelection();+ const { isAvailable, error } = useAiProvider(settings);++ // Add abort controller ref+ const abortControllerRef = useRef<AbortController | null>(null);++ useEffect(() => {+ const detectOS = () => {+ // Try using modern API first+ if ("userAgentData" in navigator) {+ // @ts-ignore - userAgentData is not yet in all TypeScript definitions+ return navigator.userAgentData.platform;+ }+ // Fallback to user agent string parsing+ const userAgent = window.navigator.userAgent.toLowerCase();+ if (userAgent.includes("mac")) return "macos";+ if (userAgent.includes("win")) return "windows";+ if (userAgent.includes("linux")) return "linux";+ return "unknown";+ };++ setOsType(detectOS());+ }, []);++ const handlePanelMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {+ e.preventDefault();+ setIsDraggingPanel(true);+ setDragOffset({+ x: e.clientX - position.x,+ y: e.clientY - position.y,+ });+ };++ useEffect(() => {+ const handleGlobalMouseMove = (e: MouseEvent) => {+ if (isDraggingPanel) {+ e.preventDefault();+ const newX = e.clientX - dragOffset.x;+ const newY = e.clientY - dragOffset.y;++ const maxX = window.innerWidth - chatWindowSize.width;+ const maxY = window.innerHeight - chatWindowSize.height;++ onPositionChange({+ x: Math.max(0, Math.min(maxX, newX)),+ y: Math.max(0, Math.min(maxY, newY)),+ });+ }+ };++ const handleGlobalMouseUp = () => {+ setIsDraggingPanel(false);+ };++ if (isDraggingPanel) {+ document.addEventListener("mousemove", handleGlobalMouseMove);+ document.addEventListener("mouseup", handleGlobalMouseUp);+ }++ return () => {+ document.removeEventListener("mousemove", handleGlobalMouseMove);+ document.removeEventListener("mouseup", handleGlobalMouseUp);+ };+ }, [+ isDraggingPanel,+ dragOffset,+ chatWindowSize.width,+ chatWindowSize.height,+ onPositionChange,+ ]);++ // Add keyboard shortcut handler+ useEffect(() => {+ const handleKeyDown = (e: KeyboardEvent) => {+ if (+ (e.metaKey || e.ctrlKey) &&+ e.key.toLowerCase() === "k" &&+ !isExpanded+ ) {+ e.preventDefault();+ onExpandedChange(true);+ setTimeout(() => {+ inputRef.current?.focus();+ }, 100);+ }+ };++ window.addEventListener("keydown", handleKeyDown);+ return () => window.removeEventListener("keydown", handleKeyDown);+ }, [isExpanded, onExpandedChange]);++ const handleMouseDown = (e: React.MouseEvent) => {+ e.preventDefault();+ const startX = e.clientX;+ const startY = e.clientY;+ const startWidth = chatWindowSize.width;+ const startHeight = chatWindowSize.height;++ const handleMouseMove = (moveEvent: MouseEvent) => {+ const newWidth = Math.max(200, startWidth + moveEvent.clientX - startX);+ const newHeight = Math.max(200, startHeight + moveEvent.clientY - startY);+ setChatWindowSize({ width: newWidth, height: newHeight });+ };++ const handleMouseUp = () => {+ document.removeEventListener("mousemove", handleMouseMove);+ document.removeEventListener("mouseup", handleMouseUp);+ };++ document.addEventListener("mousemove", handleMouseMove);+ document.addEventListener("mouseup", handleMouseUp);+ };++ const handleAgentChange = (agentId: string) => {+ const newAgent = agents.find((a) => a.id === agentId) || agents[0];++ setSelectedAgent(newAgent);+ };++ const handleClose = () => {+ // Abort any ongoing request+ if (abortControllerRef.current) {+ abortControllerRef.current.abort();+ abortControllerRef.current = null;+ }+ setIsAiLoading(false);+ setIsStreaming(false);+ setChatMessages([]);+ setAiInput("");+ onClose();+ setSelectionRange(null);+ };++ const handleStopStreaming = () => {+ if (abortControllerRef.current) {+ abortControllerRef.current.abort();+ abortControllerRef.current = null;+ setIsStreaming(false);+ setIsAiLoading(false);+ }+ };++ const handleAiSubmit = async (e: React.FormEvent) => {+ pipe.captureMainFeatureEvent("ai-panel", {+ action: "ai-submit",+ });+ e.preventDefault();+ if (!selectionRange || !aiInput.trim()) return;++ // Create new abort controller for this request+ abortControllerRef.current = new AbortController();++ const userMessage = {+ id: generateId(),+ role: "user" as const,+ content: aiInput,+ };+ setChatMessages((prev) => [...prev, userMessage]);+ setAiInput("");+ setIsAiLoading(true);+ setIsStreaming(true);++ try {+ const relevantFrames = frames.filter((frame) => {+ const frameTime = new Date(frame.timestamp);+ return (+ frameTime >= selectionRange.start && frameTime <= selectionRange.end+ );+ });++ const openai = new OpenAI({+ apiKey:+ settings.aiProviderType === "screenpipe-cloud"+ ? settings.user.token+ : settings.openaiApiKey,+ baseURL: settings.aiUrl,+ dangerouslyAllowBrowser: true,+ });++ let currentResponse = "";+ setChatMessages((prev) => [+ ...prev,+ { id: generateId(), role: "assistant", content: "" },+ ]);++ await selectedAgent.analyze(+ relevantFrames,+ openai,+ {+ model: settings.aiModel,+ onProgress: (chunk) => {+ currentResponse = chunk;+ setChatMessages((prev) => [+ ...prev.slice(0, -1),+ { id: generateId(), role: "assistant", content: currentResponse },+ ]);+ },+ signal: abortControllerRef.current.signal,+ },+ aiInput+ );+ } catch (error) {+ // Only show error if not aborted+ if (!(error instanceof Error && error.name === "AbortError")) {+ console.error("Error generating AI response:", error);+ toast({+ title: "error",+ description: "failed to generate AI response. please try again.",+ variant: "destructive",+ });+ }+ } finally {+ setIsAiLoading(false);+ setIsStreaming(false);+ abortControllerRef.current = null;+ }+ };++ if (!selectionRange) return null;++ return (+ <div+ ref={aiPanelRef}+ className="ai-panel bg-background border border-muted-foreground rounded-lg shadow-lg transition-all duration-300 ease-in-out z-[100]"+ style={{+ position: "fixed",+ left: position.x,+ top: position.y,+ width: chatWindowSize.width,+ height: isExpanded ? chatWindowSize.height : 120,+ cursor: isDraggingPanel ? "grabbing" : "default",+ }}+ >+ <div+ className="select-none cursor-grab active:cursor-grabbing"+ onMouseDown={handlePanelMouseDown}+ >+ <div className="p-4 border-b border-muted-foreground flex justify-between items-center group">+ <div className="flex items-center gap-2 flex-1">+ <GripHorizontal className="w-4 h-4 text-muted-foreground group-hover:text-foreground" />+ <div className="text-muted-foreground text-xs">+ {new Date(selectionRange.start.getTime()).toLocaleTimeString()} -{" "}+ {new Date(selectionRange.end.getTime()).toLocaleTimeString()}+ </div>+ </div>+ <button+ onClick={handleClose}+ className="text-muted-foreground hover:text-foreground transition-colors ml-2"+ >+ <X className="h-4 w-4" />+ </button>+ </div>++ {!isExpanded && (+ <div className="p-4">+ <button+ className="px-3 py-1 bg-background hover:bg-accent border text-foreground text-xs rounded flex items-center gap-2 transition-colors"+ onClick={(e) => {+ e.stopPropagation();+ onExpandedChange(true);+ setTimeout(() => {+ inputRef.current?.focus();+ }, 100);+ }}+ >+ <span>ask ai</span>+ <span className="text-muted-foreground text-[10px]">+ {osType === "macos" ? "⌘K" : "Ctrl+K"}+ </span>+ </button>+ </div>+ )}+ </div>++ {isExpanded && (+ <div className="flex flex-col h-[calc(100%-52px)]">+ <div+ className="flex-1 overflow-y-auto p-4 space-y-4 min-h-0 hover:cursor-auto text-foreground font-mono text-sm leading-relaxed"+ style={{+ WebkitUserSelect: "text",+ userSelect: "text",+ MozUserSelect: "text",+ msUserSelect: "text",+ overscrollBehavior: "contain",+ overflowY: "scroll",+ height: "100%",+ }}+ >+ {chatMessages.map((msg, index) => (+ <ChatMessage key={index} message={msg} />+ ))}+ {isAiLoading && (+ <div className="flex justify-center">+ <Loader2 className="h-6 w-6 animate-spin text-foreground" />+ </div>+ )}+ </div>++ <form+ onSubmit={handleAiSubmit}+ className="p-3 border-t border-muted-foreground"+ >+ <div className="flex flex-col gap-2">+ <div className="flex items-center gap-2">+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger>+ <Bot className="h-4 w-4 text-muted-foreground" />+ </TooltipTrigger>+ <TooltipContent>+ <p className="text-xs">using {settings.aiModel}</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ <select+ value={selectedAgent.id}+ onChange={(e) => handleAgentChange(e.target.value)}+ className="w-full bg-background border border-muted-foreground text-foreground rounded px-2 py-1 text-xs"+ >+ {agents.map((agent) => (+ <option+ key={agent.id}+ value={agent.id}+ className="bg-background text-foreground"+ >+ {agent.name} - {agent.description}+ </option>+ ))}+ </select>+ </div>+ <div className="flex gap-2">+ <TooltipProvider>+ <Tooltip open={!isAvailable}>+ <TooltipTrigger asChild>+ <div className="flex-1">+ <Input+ ref={inputRef}+ type="text"+ value={aiInput}+ onChange={(e) => setAiInput(e.target.value)}+ placeholder="ask about this time range..."+ className="flex-1 bg-background border border-muted-foreground text-foreground placeholder-muted-foreground"+ disabled={isAiLoading || !isAvailable}+ />+ </div>+ </TooltipTrigger>+ <TooltipContent side="top">+ <p className="text-sm text-destructive">{error}</p>+ </TooltipContent>+ </Tooltip>+ </TooltipProvider>+ <Button+ type="submit"+ variant="outline"+ className="hover:bg-accent transition-colors"+ disabled={!isAvailable}+ onClick={isStreaming ? handleStopStreaming : handleAiSubmit}+ >+ {isStreaming ? (+ <Square className="h-4 w-4" />+ ) : (+ <Send className="h-4 w-4" />+ )}+ </Button>+ </div>+ </div>+ </form>+ </div>+ )}++ <div+ ref={resizerRef}+ onMouseDown={handleMouseDown}+ className="absolute right-0 bottom-0 w-4 h-4 cursor-se-resize bg-transparent"+ style={{+ borderTopLeftRadius: "4px",+ borderBottomRightRadius: "4px",+ cursor: "se-resize",+ }}+ />+ </div>+ );+}diff --git a/pipes/rewind/src/components/timeline/audio-transcript.tsx b/pipes/rewind/src/components/timeline/audio-transcript.tsxnew file mode 100644index 000000000..907d6c7fd--- /dev/null+++ b/pipes/rewind/src/components/timeline/audio-transcript.tsx@@ -0,0 +1,265 @@+import { useState, useEffect, useRef } from "react";+import { AudioData, StreamTimeSeriesResponse } from "@/app/page";+import { Button } from "@/components/ui/button";+import { Card } from "@/components/ui/card";+import { Play, Pause, Volume2, GripHorizontal, X } from "lucide-react";+import { VideoComponent } from "@/components/video";++interface AudioGroup {+ deviceName: string;+ isInput: boolean;+ audioItems: AudioData[];+ startTime: Date;+ endTime: Date;+}++interface AudioTranscriptProps {+ frames: StreamTimeSeriesResponse[];+ currentIndex: number;+ groupingWindowMs?: number; // how many ms to group audio files together+ onClose?: () => void;+}++export function AudioTranscript({+ frames,+ currentIndex,+ groupingWindowMs = 30000,+ onClose,+}: AudioTranscriptProps) {+ const [audioGroups, setAudioGroups] = useState<AudioGroup[]>([]);+ const [playing, setPlaying] = useState<string | null>(null);+ const [position, setPosition] = useState({+ x: window.innerWidth - 320,+ y: 100,+ });+ const [isDragging, setIsDragging] = useState(false);+ const [dragOffset, setDragOffset] = useState({ x: 0, y: 0 });+ const [windowSize, setWindowSize] = useState({ width: 300, height: 500 });+ const resizerRef = useRef<HTMLDivElement | null>(null);+ const panelRef = useRef<HTMLDivElement | null>(null);+ const [isVisible, setIsVisible] = useState(true);++ // Group audio files from nearby frames+ useEffect(() => {+ if (!frames.length) return;++ const currentFrame = frames[currentIndex];+ const currentTime = new Date(currentFrame?.timestamp);+ const windowStart = new Date(currentTime.getTime() - groupingWindowMs);+ const windowEnd = new Date(currentTime.getTime() + groupingWindowMs);++ // Get frames within our time window+ const nearbyFrames = frames.filter((frame) => {+ const frameTime = new Date(frame.timestamp);+ return frameTime >= windowStart && frameTime <= windowEnd;+ });++ // Check if any nearby frames have audio+ const hasNearbyAudio = nearbyFrames.some((frame) =>+ frame.devices.some((device) => device.audio.length > 0)+ );++ // Show/hide panel based on nearby audio+ setIsVisible(hasNearbyAudio);++ // Group audio by device+ const groups = new Map<string, AudioGroup>();++ nearbyFrames.forEach((frame) => {+ frame.devices.forEach((device) => {+ device.audio.forEach((audio) => {+ const key = `${audio.device_name}-${audio.is_input}`;++ if (!groups.has(key)) {+ groups.set(key, {+ deviceName: audio.device_name,+ isInput: audio.is_input,+ audioItems: [],+ startTime: new Date(frame.timestamp),+ endTime: new Date(frame.timestamp),+ });+ }++ const group = groups.get(key)!;+ group.audioItems.push(audio);++ // Update time range+ const frameTime = new Date(frame.timestamp);+ if (frameTime < group.startTime) group.startTime = frameTime;+ if (frameTime > group.endTime) group.endTime = frameTime;+ });+ });+ });++ setAudioGroups(Array.from(groups.values()));+ }, [frames, currentIndex, groupingWindowMs]);++ const handlePlay = (audioPath: string) => {+ if (playing === audioPath) {+ setPlaying(null);+ } else {+ setPlaying(audioPath);+ }+ };++ const handlePanelMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {+ setIsDragging(true);+ setDragOffset({+ x: e.clientX - position.x,+ y: e.clientY - position.y,+ });+ };++ const handlePanelMouseMove = (e: React.MouseEvent) => {+ if (isDragging) {+ setPosition({+ x: e.clientX - dragOffset.x,+ y: e.clientY - dragOffset.y,+ });+ }+ };++ const handlePanelMouseUp = () => {+ if (isDragging) {+ setIsDragging(false);+ }+ };++ const handleResizeMouseDown = (e: React.MouseEvent) => {+ e.preventDefault();+ const startX = e.clientX;+ const startY = e.clientY;+ const startWidth = windowSize.width;+ const startHeight = windowSize.height;++ const handleMouseMove = (moveEvent: MouseEvent) => {+ const newWidth = Math.max(200, startWidth + moveEvent.clientX - startX);+ const newHeight = Math.max(200, startHeight + moveEvent.clientY - startY);+ setWindowSize({ width: newWidth, height: newHeight });+ };++ const handleMouseUp = () => {+ document.removeEventListener("mousemove", handleMouseMove);+ document.removeEventListener("mouseup", handleMouseUp);+ };++ document.addEventListener("mousemove", handleMouseMove);+ document.addEventListener("mouseup", handleMouseUp);+ };++ // Modify the content scroll handler+ const handleContentScroll = (e: React.WheelEvent<HTMLDivElement>) => {+ e.stopPropagation(); // Stop the event from reaching the timeline+ };++ const handleClose = (e: React.MouseEvent) => {+ e.stopPropagation();+ setIsVisible(false);+ onClose?.();+ };++ return isVisible ? (+ <div+ ref={panelRef}+ style={{+ position: "fixed",+ left: position.x,+ top: position.y,+ width: windowSize.width,+ height: windowSize.height,+ cursor: isDragging ? "grabbing" : "default",+ }}+ className="audio-transcript-panel bg-background/80 backdrop-blur border border-muted-foreground rounded-lg shadow-lg z-[100] overflow-hidden"+ >+ <div+ className="select-none cursor-grab active:cursor-grabbing p-2 border-b border-muted-foreground"+ onMouseDown={handlePanelMouseDown}+ onMouseMove={handlePanelMouseMove}+ onMouseUp={handlePanelMouseUp}+ onMouseLeave={handlePanelMouseUp}+ >+ <div className="flex items-center justify-between gap-2 text-xs text-muted-foreground">+ <div className="flex items-center gap-2">+ <GripHorizontal className="w-4 h-4" />+ <span>audio transcripts</span>+ </div>+ <Button+ variant="ghost"+ size="sm"+ className="h-6 w-6 p-0"+ onClick={handleClose}+ >+ <X className="h-3 w-3" />+ </Button>+ </div>+ </div>++ <div+ className="space-y-2 p-2 overflow-y-auto"+ style={{+ height: "calc(100% - 37px)",+ overscrollBehavior: "contain", // Prevent scroll chaining+ WebkitOverflowScrolling: "touch", // Smooth scrolling on iOS+ }}+ >+ {audioGroups.map((group, groupIndex) => (+ <Card key={groupIndex} className="p-4 bg-background/80 backdrop-blur">+ <div className="text-xs text-muted-foreground mb-2">+ {group.deviceName} ({group.isInput ? "input" : "output"})+ <div className="text-[10px]">+ {group.startTime.toLocaleTimeString()} -{" "}+ {group.endTime.toLocaleTimeString()}+ </div>+ </div>++ {group.audioItems.map((audio, index) => (+ <div key={index} className="space-y-2 mb-2 last:mb-0">+ <div className="flex items-center gap-2">+ <Button+ variant="ghost"+ size="sm"+ className="h-6 w-6 p-0"+ onClick={() => handlePlay(audio.audio_file_path)}+ >+ {playing === audio.audio_file_path ? (+ <Pause className="h-3 w-3" />+ ) : (+ <Play className="h-3 w-3" />+ )}+ </Button>+ <div className="flex items-center gap-1 text-xs">+ <Volume2 className="h-3 w-3" />+ <span>{Math.round(audio.duration_secs)}s</span>+ </div>+ </div>++ {audio.transcription && (+ <div className="text-xs pl-8 text-muted-foreground">+ {audio.transcription}+ </div>+ )}++ {playing === audio.audio_file_path && (+ <div className="pl-8">+ <VideoComponent filePath={audio.audio_file_path} />+ </div>+ )}+ </div>+ ))}+ </Card>+ ))}+ </div>++ <div+ ref={resizerRef}+ onMouseDown={handleResizeMouseDown}+ className="absolute right-0 bottom-0 w-4 h-4 cursor-se-resize bg-transparent"+ style={{+ borderTopLeftRadius: "4px",+ borderBottomRightRadius: "4px",+ cursor: "se-resize",+ }}+ />+ </div>+ ) : null;+}diff --git a/pipes/rewind/src/components/timeline/timeline-dock-section.tsx b/pipes/rewind/src/components/timeline/timeline-dock-section.tsxnew file mode 100644index 000000000..b42688c55--- /dev/null+++ b/pipes/rewind/src/components/timeline/timeline-dock-section.tsx@@ -0,0 +1,413 @@+import localforage from "localforage";+import React, { useEffect, useState, useCallback, useMemo } from "react";+import { StreamTimeSeriesResponse } from "@/app/page";+import { stringToColor } from "@/lib/utils";+import { motion, useAnimation } from "framer-motion";+import {+ Dialog,+ DialogContent,+ DialogHeader,+ DialogTitle,+} from "@/components/ui/dialog";+import { ScrollArea } from "@/components/ui/scroll-area";++import { useTimelineSelection } from "@/lib/hooks/use-timeline-selection";+import { Button } from "@/components/ui/button";+import { MessageSquarePlus, Volume2 } from "lucide-react";++// Add this near the top of the file, after imports+const GAP_THRESHOLD = 3 * 60 * 1000; // 5 minutes in milliseconds++interface ProcessedBlock {+ appName: string;+ percentThroughDay: number;+ timestamp: Date;+ iconSrc?: string;+ windows: Array<{+ title: string;+ timestamp: Date;+ }>;+}++interface AppIcon {+ base64: string;+ path?: string;+}++async function getAppIcon(+ appName: string,+ appPath?: string+): Promise<AppIcon | null> {+ const params = new URLSearchParams({+ name: appName,+ ...(appPath && { path: appPath }),+ });++ try {+ const response = await fetch(`http://localhost:11435/app-icon?${params}`, {+ method: "GET",+ headers: {+ Accept: "application/json",+ },+ });++ if (!response.ok) {+ const error = await response.text();+ throw new Error(`failed to get app icon: ${error}`);+ }++ return await response.json();+ } catch (error) {+ console.error("error getting app icon:", error);+ return null;+ }+}++export function TimelineIconsSection({+ blocks,+}: {+ blocks: StreamTimeSeriesResponse[];+}) {+ const [iconCache, setIconCache] = useState<{ [key: string]: string }>({});+ const [selectedApp, setSelectedApp] = useState<ProcessedBlock | null>(null);+ const [iconInvocationCount, setIconInvocationCount] = useState<{+ [key: string]: number;+ }>({});+ const { setSelectionRange } = useTimelineSelection();++ // Get the visible time range+ const timeRange = useMemo(() => {+ if (blocks.length === 0) return null;+ const startTime = new Date(blocks[blocks.length - 1].timestamp);+ const endTime = new Date(blocks[0].timestamp);+ return { start: startTime, end: endTime };+ }, [blocks]);++ // Combine both computations into one useMemo+ const { processedBlocks, processedAudioGroups } = useMemo(() => {+ if (!timeRange) return { processedBlocks: [], processedAudioGroups: [] };++ // Process audio groups first+ const audioGroups = blocks+ .flatMap((frame) =>+ frame.devices.flatMap((device) =>+ device.audio.map((audio) => ({+ deviceName: audio.device_name,+ isInput: audio.is_input,+ timestamp: new Date(frame.timestamp),+ duration: audio.duration_secs,+ percentThroughDay:+ ((new Date(frame.timestamp).getTime() -+ timeRange.start.getTime()) /+ (timeRange.end.getTime() - timeRange.start.getTime())) *+ 100,+ }))+ )+ )+ .filter((audio) => {+ const timestamp = audio.timestamp;+ return timestamp >= timeRange.start && timestamp <= timeRange.end;+ })+ .filter((audio, index, array) => {+ if (index === 0) return true;+ const prevAudio = array[index - 1];+ return (+ Math.abs(audio.percentThroughDay - prevAudio.percentThroughDay) > 0.25+ );+ });++ // Process app blocks (existing logic)+ const appGroups: {+ [key: string]: Array<{+ timestamp: Date;+ title?: string;+ blockId?: number;+ }>;+ } = {};++ blocks.forEach((frame) => {+ frame.devices.forEach((device) => {+ if (!device.metadata?.app_name) return;++ const timestamp = new Date(frame.timestamp);+ const appName = device.metadata.app_name;+ const windowTitle = device.metadata.window_name;++ if (timestamp < timeRange.start || timestamp > timeRange.end) return;++ if (!appGroups[appName]) {+ appGroups[appName] = [];+ }+ appGroups[appName].push({ timestamp, title: windowTitle });+ });+ });++ Object.entries(appGroups).forEach(([appName, timestamps]) => {+ timestamps.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime());++ let currentBlockId = 0;+ let blockStart = timestamps[0];+ let lastTimestamp = timestamps[0];++ timestamps.forEach((entry, idx) => {+ if (+ entry.timestamp.getTime() - lastTimestamp.timestamp.getTime() >+ GAP_THRESHOLD+ ) {+ currentBlockId++;+ blockStart = entry;+ }+ entry.blockId = currentBlockId;+ lastTimestamp = entry;+ });+ });++ const b: ProcessedBlock[] = [];++ Object.entries(appGroups).forEach(([appName, entries]) => {+ const blockIds = [...new Set(entries.map((e) => e.blockId))];++ blockIds.forEach((blockId) => {+ const blockEntries = entries.filter((e) => e.blockId === blockId);+ if (blockEntries.length === 0) return;++ const blockStart = blockEntries[0].timestamp;+ const blockEnd = blockEntries[blockEntries.length - 1].timestamp;+ const blockMiddle = new Date(+ blockStart.getTime() + (blockEnd.getTime() - blockStart.getTime()) / 2+ );++ const windowsInBlock = blockEntries+ .filter((w) => w.title) // only keep windows with titles+ .map((w) => ({+ title: w.title!,+ timestamp: w.timestamp,+ }))+ .sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime()); // most recent first++ b.push({+ appName,+ timestamp: blockMiddle,+ percentThroughDay:+ ((blockMiddle.getTime() - timeRange.start.getTime()) /+ (timeRange.end.getTime() - timeRange.start.getTime())) *+ 100,+ iconSrc: iconCache[appName],+ windows: windowsInBlock,+ });+ });+ });++ return {+ processedBlocks: b+ .sort((a, b) => a.percentThroughDay - b.percentThroughDay)+ .filter((block, index, array) => {+ if (index === 0) return true;+ const prevBlock = array[index - 1];+ return (+ Math.abs(block.percentThroughDay - prevBlock.percentThroughDay) >+ 0.25+ );+ }),+ processedAudioGroups: audioGroups,+ };+ }, [blocks, iconCache, timeRange]);++ const loadAppIcon = useCallback(+ async (appName: string, appPath?: string) => {+ try {+ if (iconCache[appName]) return;++ const cachedIcon = await localforage.getItem<string>(`icon-${appName}`);+ if (cachedIcon) {+ setIconCache((prev) => ({+ ...prev,+ [appName]: cachedIcon,+ }));+ return;+ }++ if (iconInvocationCount[appName] >= 100) return;++ const icon = await getAppIcon(appName, appPath);++ if (icon?.base64) {+ // Add null check for base64+ setIconCache((prev) => ({+ ...prev,+ [appName]: icon.base64,+ }));++ await localforage.setItem(`icon-${appName}`, icon.base64);++ setIconInvocationCount((prev) => ({+ ...prev,+ [appName]: (prev[appName] || 0) + 1,+ }));+ }+ } catch (error) {+ console.error(`failed to load icon for ${appName}:`, error);+ // Fail silently - the UI will just not show an icon+ }+ },+ [iconCache, iconInvocationCount]+ );++ useEffect(() => {+ const loadIcons = async () => {+ // Load icons for unique app names only+ processedBlocks.forEach((block) => {+ loadAppIcon(block.appName);+ });+ };++ loadIcons();+ }, [processedBlocks, loadAppIcon]);++ return (+ <>+ <div className="absolute -top-8 inset-x-0 h-8">+ {processedBlocks.map((block, i) => {+ const bgColor = stringToColor(block.appName);++ return (+ <motion.div+ key={`${block.appName}-${i}`}+ className="absolute h-full pointer-events-auto cursor-pointer"+ style={{+ left: `${block.percentThroughDay}%`,+ transform: "translateX(-50%)",+ zIndex: 50,+ }}+ onClick={() => setSelectedApp(block)}+ whileHover={{+ scale: 1.5,+ backgroundColor: "red",+ y: -20,+ }}+ transition={{+ type: "spring",+ stiffness: 300,+ damping: 30,+ }}+ >+ {block.iconSrc ? (+ <motion.div+ className="w-5 h-5 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full"+ style={{+ backgroundColor: `${bgColor}40`,+ padding: "2px",+ }}+ >+ <img+ src={+ window.navigator.platform === "Linux"+ ? `data:image/svg+xml;base64,${block.iconSrc}`+ : `data:image/png;base64,${block.iconSrc}`+ }+ className="w-full h-full opacity-70"+ alt={block.appName}+ loading="lazy"+ decoding="async"+ />+ </motion.div>+ ) : (+ <motion.div+ className="w-5 h-5 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full"+ style={{ backgroundColor: bgColor }}+ />+ )}+ </motion.div>+ );+ })}++ {/* Add this new section for audio markers */}+ {processedAudioGroups.map((audio, i) => (+ <div+ key={`audio-${i}`}+ className="absolute h-full pointer-events-auto "+ style={{+ left: `${audio.percentThroughDay}%`,+ transform: "translateX(-50%)",+ zIndex: 40,+ top: "-16px", // Moved higher+ }}+ >+ <div+ className="w-4 h-4 flex items-center justify-center rounded-full bg-muted/50 backdrop-blur"+ style={{+ border: `1px solid ${+ audio.isInput ? "rgba(0, 0, 0, 0.7)" : "rgba(0, 0, 0, 0.4)"+ }`,+ }}+ >+ <Volume2+ className="w-2 h-2"+ style={{+ color: audio.isInput+ ? "rgba(0, 0, 0, 0.7)"+ : "rgba(0, 0, 0, 0.4)",+ }}+ />+ </div>+ </div>+ ))}+ </div>++ <Dialog+ open={selectedApp !== null}+ onOpenChange={() => setSelectedApp(null)}+ >+ <DialogContent className="max-w-md p-8">+ <DialogHeader>+ <DialogTitle className="flex items-center justify-between">+ <div className="flex items-center gap-2">+ {selectedApp?.iconSrc && (+ <img+ src={+ window.navigator.platform === "Linux"+ ? `data:image/svg+xml;base64,${selectedApp.iconSrc}`+ : `data:image/png;base64,${selectedApp.iconSrc}`+ }+ className="w-6 h-6"+ alt={selectedApp.appName}+ />+ )}+ <span>{selectedApp?.appName}</span>+ </div>+ <Button+ variant="outline"+ size="sm"+ className="gap-2"+ onClick={() => {+ if (!selectedApp) return;+ setSelectedApp(null);+ setSelectionRange({+ start: selectedApp.timestamp,+ end: new Date(selectedApp.timestamp.getTime() + 60000),+ });+ }}+ >+ <MessageSquarePlus className="h-4 w-4" />+ <span className="text-xs">ask ai about this</span>+ </Button>+ </DialogTitle>+ </DialogHeader>++ <ScrollArea className="max-h-[60vh]">+ <div className="space-y-2">+ {selectedApp?.windows.map((window, i) => (+ <div key={i} className="p-2 rounded-lg bg-muted/50 text-sm">+ <p className="font-medium">{window.title}</p>+ <p className="text-xs text-muted-foreground">+ {window.timestamp.toLocaleTimeString()}+ </p>+ </div>+ ))}+ </div>+ </ScrollArea>+ </DialogContent>+ </Dialog>+ </>+ );+}diff --git a/pipes/rewind/src/components/timeline/timeline-selection.tsx b/pipes/rewind/src/components/timeline/timeline-selection.tsxnew file mode 100644index 000000000..81eb94886--- /dev/null+++ b/pipes/rewind/src/components/timeline/timeline-selection.tsx@@ -0,0 +1,97 @@+import { useTimelineSelection } from "@/lib/hooks/use-timeline-selection";+import { useState, useCallback, MouseEvent } from "react";++interface TimelineSelectionProps {+ loadedTimeRange: { start: Date; end: Date };+ numChunks?: number;+}++export function TimelineSelection({+ loadedTimeRange,+ numChunks = 60,+}: TimelineSelectionProps) {+ const { setSelectionRange, selectionRange } = useTimelineSelection();+ const [isDragging, setIsDragging] = useState(false);+ const [currentChunk, setCurrentChunk] = useState<number | null>(null);+ const [startChunk, setStartChunk] = useState<number | null>(null);++ const getDateFromChunk = useCallback(+ (chunkIndex: number) => {+ const totalMs =+ loadedTimeRange.end.getTime() - loadedTimeRange.start.getTime();+ const msPerChunk = totalMs / numChunks;+ return new Date(+ loadedTimeRange.start.getTime() + chunkIndex * msPerChunk+ );+ },+ [loadedTimeRange, numChunks]+ );++ const handleMouseDown = (e: MouseEvent, chunkIndex: number) => {+ e.preventDefault(); // Prevent text selection+ setIsDragging(true);+ setStartChunk(chunkIndex);+ setCurrentChunk(chunkIndex);+ const date = getDateFromChunk(chunkIndex);+ setSelectionRange({ start: date, end: date });+ };++ const handleMouseMove = (e: MouseEvent, chunkIndex: number) => {+ if (!isDragging || startChunk === null) return;+ setCurrentChunk(chunkIndex);++ const start = Math.min(startChunk, chunkIndex);+ const end = Math.max(startChunk, chunkIndex);++ setSelectionRange({+ start: getDateFromChunk(start),+ end: getDateFromChunk(end + 1), // +1 to include the full chunk+ });+ };++ const handleMouseUp = () => {+ setIsDragging(false);+ setStartChunk(null);+ setCurrentChunk(null);+ };++ const isChunkSelected = useCallback(+ (chunkIndex: number) => {+ if (isDragging && startChunk !== null && currentChunk !== null) {+ const start = Math.min(startChunk, currentChunk);+ const end = Math.max(startChunk, currentChunk);+ return chunkIndex >= start && chunkIndex <= end;+ } else if (selectionRange) {+ const chunkDate = getDateFromChunk(chunkIndex);+ const nextChunkDate = getDateFromChunk(chunkIndex + 1);+ return (+ chunkDate >= selectionRange.start && chunkDate < selectionRange.end+ );+ }+ return false;+ },+ [isDragging, startChunk, currentChunk, selectionRange, getDateFromChunk]+ );++ return (+ <div+ className="absolute inset-0 flex"+ onMouseLeave={handleMouseUp}+ onMouseUp={handleMouseUp}+ >+ {Array.from({ length: numChunks }).map((_, i) => (+ <div+ key={i}+ className={`h-full flex-1 border-r border-foreground/5 transition-colors ${+ isChunkSelected(i) ? "bg-primary/30" : "hover:bg-foreground/10"+ }`}+ style={{+ cursor: isDragging ? "col-resize" : "pointer",+ }}+ onMouseDown={(e) => handleMouseDown(e, i)}+ onMouseMove={(e) => handleMouseMove(e, i)}+ />+ ))}+ </div>+ );+}diff --git a/pipes/rewind/src/components/ui/accordion.tsx b/pipes/rewind/src/components/ui/accordion.tsxnew file mode 100644index 000000000..24c788c2c--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/badge.tsx b/pipes/rewind/src/components/ui/badge.tsxnew file mode 100644index 000000000..f000e3ef5--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/button.tsx b/pipes/rewind/src/components/ui/button.tsxnew file mode 100644index 000000000..36496a287--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/calendar.tsx b/pipes/rewind/src/components/ui/calendar.tsxnew file mode 100644index 000000000..61d2b451e--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/card.tsx b/pipes/rewind/src/components/ui/card.tsxnew file mode 100644index 000000000..f62edea57--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/checkbox.tsx b/pipes/rewind/src/components/ui/checkbox.tsxnew file mode 100644index 000000000..df61a1388--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/codeblock.tsx b/pipes/rewind/src/components/ui/codeblock.tsxnew file mode 100644index 000000000..e52893032--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/command.tsx b/pipes/rewind/src/components/ui/command.tsxnew file mode 100644index 000000000..59a264529--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/dialog.tsx b/pipes/rewind/src/components/ui/dialog.tsxnew file mode 100644index 000000000..01ff19c7e--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/icons.tsx b/pipes/rewind/src/components/ui/icons.tsxnew file mode 100644index 000000000..492377647--- /dev/null+++ b/pipes/rewind/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+VicIsqJVtjjpvycYClvCrFLXkGcYiyemA8XpFwfTxflR8fL48QLszih0fJ48OUgHLBAAKADCaxpYArIAoLOvuY+eCfvCQIcIAYZgA/sFczQiCRZjxBe40Ah+BMiPsgbHucv6+WDAsh/HWblV3uQLustkI3IB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rZHAamxCoQCAKj4qkXrciWF1zWvmoQyj1+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/rewind/src/components/ui/input.tsx b/pipes/rewind/src/components/ui/input.tsxnew file mode 100644index 000000000..68551b927--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/label.tsx b/pipes/rewind/src/components/ui/label.tsxnew file mode 100644index 000000000..534182176--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/popover.tsx b/pipes/rewind/src/components/ui/popover.tsxnew file mode 100644index 000000000..a0ec48bee--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/progress.tsx b/pipes/rewind/src/components/ui/progress.tsxnew file mode 100644index 000000000..5c87ea486--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/scroll-area.tsx b/pipes/rewind/src/components/ui/scroll-area.tsxnew file mode 100644index 000000000..0b4a48d87--- /dev/null+++ b/pipes/rewind/src/components/ui/scroll-area.tsx@@ -0,0 +1,48 @@+"use client"++import * as React from "react"+import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"++import { cn } from "@/lib/utils"++const ScrollArea = React.forwardRef<+ React.ElementRef<typeof ScrollAreaPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>+>(({ className, children, ...props }, ref) => (+ <ScrollAreaPrimitive.Root+ ref={ref}+ className={cn("relative overflow-hidden", className)}+ {...props}+ >+ <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">+ {children}+ </ScrollAreaPrimitive.Viewport>+ <ScrollBar />+ <ScrollAreaPrimitive.Corner />+ </ScrollAreaPrimitive.Root>+))+ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName++const ScrollBar = React.forwardRef<+ React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>+>(({ className, orientation = "vertical", ...props }, ref) => (+ <ScrollAreaPrimitive.ScrollAreaScrollbar+ ref={ref}+ orientation={orientation}+ className={cn(+ "flex touch-none select-none transition-colors",+ orientation === "vertical" &&+ "h-full w-2.5 border-l border-l-transparent p-[1px]",+ orientation === "horizontal" &&+ "h-2.5 flex-col border-t border-t-transparent p-[1px]",+ className+ )}+ {...props}+ >+ <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />+ </ScrollAreaPrimitive.ScrollAreaScrollbar>+))+ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName++export { ScrollArea, ScrollBar }diff --git a/pipes/rewind/src/components/ui/select.tsx b/pipes/rewind/src/components/ui/select.tsxnew file mode 100644index 000000000..cbe5a36b6--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/separator.tsx b/pipes/rewind/src/components/ui/separator.tsxnew file mode 100644index 000000000..12d81c4a8--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/skeleton.tsx b/pipes/rewind/src/components/ui/skeleton.tsxnew file mode 100644index 000000000..01b8b6d4f--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/slider.tsx b/pipes/rewind/src/components/ui/slider.tsxnew file mode 100644index 000000000..c31c2b3bc--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/switch.tsx b/pipes/rewind/src/components/ui/switch.tsxnew file mode 100644index 000000000..bc69cf2db--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/toast.tsx b/pipes/rewind/src/components/ui/toast.tsxnew file mode 100644index 000000000..521b94b07--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/toaster.tsx b/pipes/rewind/src/components/ui/toaster.tsxnew file mode 100644index 000000000..fe7103d70--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/tooltip.tsx b/pipes/rewind/src/components/ui/tooltip.tsxnew file mode 100644index 000000000..30fc44d90--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/ui/use-toast.ts b/pipes/rewind/src/components/ui/use-toast.tsnew file mode 100644index 000000000..02e111d81--- /dev/null+++ b/pipes/rewind/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/rewind/src/components/video.tsx b/pipes/rewind/src/components/video.tsxnew file mode 100644index 000000000..2fedd23e0--- /dev/null+++ b/pipes/rewind/src/components/video.tsx@@ -0,0 +1,134 @@+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 = () => (+ <div className="mt-2 text-center text-xs text-gray-500 truncate px-2" title={filePath}>+ {customDescription || filePath}+ </div>+ );++ 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.warn("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; codecs="hvc1"' />+ <source src={mediaSrc} type='video/mp4; codecs="hvec"' />+ <source src={mediaSrc} type="video/mp4" />+ Your browser does not support the video tag.+ </video>+ )}+ {renderFileLink()}+ </div>+ );+});diff --git a/pipes/rewind/src/lib/actions/video-actions.ts b/pipes/rewind/src/lib/actions/video-actions.tsnew file mode 100644index 000000000..9238c9e96--- /dev/null+++ b/pipes/rewind/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/rewind/src/lib/hooks/use-ai-provider.tsx b/pipes/rewind/src/lib/hooks/use-ai-provider.tsxnew file mode 100644index 000000000..827efdb05--- /dev/null+++ b/pipes/rewind/src/lib/hooks/use-ai-provider.tsx@@ -0,0 +1,81 @@+import { useState, useEffect } from "react";+import type { Settings } from "@screenpipe/browser";++interface AIProviderStatus {+ isAvailable: boolean;+ error: string;+}++export function useAiProvider(settings: Settings): AIProviderStatus {+ const [status, setStatus] = useState<AIProviderStatus>({+ isAvailable: true,+ error: "",+ });++ useEffect(() => {+ const checkAiProvider = async () => {+ try {+ switch (settings.aiProviderType) {+ case "openai":+ if (!settings.openaiApiKey) {+ setStatus({+ isAvailable: false,+ error: "openai api key not configured",+ });+ return;+ }+ break;++ case "native-ollama":+ try {+ const response = await fetch("http://localhost:11434/api/tags");+ if (!response.ok) throw new Error();+ } catch {+ setStatus({+ isAvailable: false,+ error: "ollama not running on port 11434",+ });+ return;+ }+ break;++ case "screenpipe-cloud":+ if (!settings.user?.token) {+ setStatus({+ isAvailable: false,+ error: "login required for screenpipe cloud",+ });+ return;+ }+ break;++ case "custom":+ if (!settings.aiUrl) {+ setStatus({+ isAvailable: false,+ error: "custom ai url not configured",+ });+ return;+ }+ break;+ }++ setStatus({ isAvailable: true, error: "" });+ } catch (error) {+ setStatus({+ isAvailable: false,+ error: "failed to check ai provider",+ });+ }+ };++ checkAiProvider();+ }, [+ settings.aiProviderType,+ settings.openaiApiKey,+ settings.aiUrl,+ settings.user?.token,+ ]);++ return status;+}diff --git a/pipes/rewind/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/rewind/src/lib/hooks/use-copy-to-clipboard.tsxnew file mode 100644index 000000000..7249b0751--- /dev/null+++ b/pipes/rewind/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/rewind/src/lib/hooks/use-debounce.tsx b/pipes/rewind/src/lib/hooks/use-debounce.tsxnew file mode 100644index 000000000..ba49720b5--- /dev/null+++ b/pipes/rewind/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/rewind/src/lib/hooks/use-health-check.tsx b/pipes/rewind/src/lib/hooks/use-health-check.tsxnew file mode 100644index 000000000..8d32570d0--- /dev/null+++ b/pipes/rewind/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/rewind/src/lib/hooks/use-search-history.tsx b/pipes/rewind/src/lib/hooks/use-search-history.tsxnew file mode 100644index 000000000..4673e3e22--- /dev/null+++ b/pipes/rewind/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/rewind/src/lib/hooks/use-settings.tsx b/pipes/rewind/src/lib/hooks/use-settings.tsxnew file mode 100644index 000000000..1e9a327b9--- /dev/null+++ b/pipes/rewind/src/lib/hooks/use-settings.tsx@@ -0,0 +1,97 @@+"use client";++import { useState, useEffect } from "react";+import { getDefaultSettings, type Settings } from "@screenpipe/browser";++export function useSettings() {+ const defaultSettings = getDefaultSettings();++ 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);+ }+ };++ // Initial load+ loadSettings();++ // Refresh on window focus+ const onFocus = () => loadSettings();+ window.addEventListener("focus", onFocus);++ // Optional: periodic refresh every 30s+ const interval = setInterval(loadSettings, 30000);++ return () => {+ window.removeEventListener("focus", onFocus);+ clearInterval(interval);+ };+ }, []);++ 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/rewind/src/lib/hooks/use-sql-autocomplete.tsx b/pipes/rewind/src/lib/hooks/use-sql-autocomplete.tsxnew file mode 100644index 000000000..7db3de855--- /dev/null+++ b/pipes/rewind/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/rewind/src/lib/hooks/use-timeline-selection.tsx b/pipes/rewind/src/lib/hooks/use-timeline-selection.tsxnew file mode 100644index 000000000..84918fcad--- /dev/null+++ b/pipes/rewind/src/lib/hooks/use-timeline-selection.tsx@@ -0,0 +1,33 @@+import { createContext, useContext, ReactNode, useState } from "react";++interface TimelineContextType {+ selectionRange: { start: Date; end: Date } | null;+ setSelectionRange: (range: { start: Date; end: Date } | null) => void;+}++const TimelineContext = createContext<TimelineContextType | undefined>(+ undefined+);++export function TimelineProvider({ children }: { children: ReactNode }) {+ const [selectionRange, setSelectionRange] = useState<{+ start: Date;+ end: Date;+ } | null>(null);++ return (+ <TimelineContext.Provider value={{ selectionRange, setSelectionRange }}>+ {children}+ </TimelineContext.Provider>+ );+}++export function useTimelineSelection() {+ const context = useContext(TimelineContext);+ if (!context) {+ throw new Error(+ "useTimelineSelection must be used within a TimelineProvider"+ );+ }+ return context;+}diff --git a/pipes/rewind/src/lib/utils.ts b/pipes/rewind/src/lib/utils.tsnew file mode 100644index 000000000..847c458cf--- /dev/null+++ b/pipes/rewind/src/lib/utils.ts@@ -0,0 +1,60 @@+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 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;+}diff --git a/pipes/rewind/tailwind.config.ts b/pipes/rewind/tailwind.config.tsnew file mode 100644index 000000000..9a58f7ad4--- /dev/null+++ b/pipes/rewind/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/rewind/tsconfig.json b/pipes/rewind/tsconfig.jsonnew file mode 100644index 000000000..c1334095f--- /dev/null+++ b/pipes/rewind/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"]+}