Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: lints

Louis Beaumontd751e714ef6c
diff --git a/pipes/data-table/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/data-table/src/lib/hooks/use-copy-to-clipboard.tsx
index e011d69bd..7249b0751 100644
--- a/pipes/data-table/src/lib/hooks/use-copy-to-clipboard.tsx
+++ b/pipes/data-table/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -9,7 +9,7 @@ export interface useCopyToClipboardProps {
export function useCopyToClipboard({
timeout = 2000,
}: useCopyToClipboardProps) {
- const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+ const [isCopied, setIsCopied] = React.useState<boolean>(false);
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
diff --git a/pipes/identify-speakers/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/identify-speakers/src/lib/hooks/use-copy-to-clipboard.tsx
index e011d69bd..7249b0751 100644
--- a/pipes/identify-speakers/src/lib/hooks/use-copy-to-clipboard.tsx
+++ b/pipes/identify-speakers/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -9,7 +9,7 @@ export interface useCopyToClipboardProps {
export function useCopyToClipboard({
timeout = 2000,
}: useCopyToClipboardProps) {
- const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+ const [isCopied, setIsCopied] = React.useState<boolean>(false);
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
diff --git a/pipes/meeting/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/meeting/src/lib/hooks/use-copy-to-clipboard.tsx
index e011d69bd..7249b0751 100644
--- a/pipes/meeting/src/lib/hooks/use-copy-to-clipboard.tsx
+++ b/pipes/meeting/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -9,7 +9,7 @@ export interface useCopyToClipboardProps {
export function useCopyToClipboard({
timeout = 2000,
}: useCopyToClipboardProps) {
- const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+ const [isCopied, setIsCopied] = React.useState<boolean>(false);
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
diff --git a/pipes/memories/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/memories/src/lib/hooks/use-copy-to-clipboard.tsx
index e011d69bd..7249b0751 100644
--- a/pipes/memories/src/lib/hooks/use-copy-to-clipboard.tsx
+++ b/pipes/memories/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -9,7 +9,7 @@ export interface useCopyToClipboardProps {
export function useCopyToClipboard({
timeout = 2000,
}: useCopyToClipboardProps) {
- const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+ const [isCopied, setIsCopied] = React.useState<boolean>(false);
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
diff --git a/pipes/obsidian/bun.lockb b/pipes/obsidian/bun.lockb
index 21efcb45b..0b87f14cb 100755
Binary files a/pipes/obsidian/bun.lockb and b/pipes/obsidian/bun.lockb differ
diff --git a/pipes/obsidian/package.json b/pipes/obsidian/package.json
index 3fd812387..91eb9829b 100644
--- a/pipes/obsidian/package.json
+++ b/pipes/obsidian/package.json
@@ -4,14 +4,14 @@
"private": true,
"scripts": {
"dev": "next dev --turbopack",
- "build": "next build",
+ "build": "next build --no-lint",
"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-dialog": "^1.1.4",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-popover": "^1.1.3",
"@radix-ui/react-progress": "^1.1.1",
@@ -21,7 +21,7 @@
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.2",
- "@radix-ui/react-toast": "^1.2.3",
+ "@radix-ui/react-toast": "^1.2.4",
"@radix-ui/react-tooltip": "^1.1.5",
"@screenpipe/browser": "0.1.17",
"@screenpipe/js": "1.0.0",
@@ -33,7 +33,7 @@
"ai": "^4.0.18",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
- "cmdk": "1.0.0",
+ "cmdk": "1.0.4",
"date-fns": "^4.1.0",
"framer-motion": "^11.14.4",
"install": "^0.13.0",
diff --git a/pipes/obsidian/src/components/ui/command.tsx b/pipes/obsidian/src/components/ui/command.tsx
index 59a264529..fe02572a4 100644
--- a/pipes/obsidian/src/components/ui/command.tsx
+++ b/pipes/obsidian/src/components/ui/command.tsx
@@ -1,12 +1,12 @@
-"use client"
+"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 * 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"
+import { cn } from "@/lib/utils";
+import { Dialog, DialogContent } from "@/components/ui/dialog";
const Command = React.forwardRef<
React.ElementRef<typeof CommandPrimitive>,
@@ -20,8 +20,8 @@ const Command = React.forwardRef<
)}
{...props}
/>
-))
-Command.displayName = CommandPrimitive.displayName
+));
+Command.displayName = CommandPrimitive.displayName;
const CommandDialog = ({ children, ...props }: DialogProps) => {
return (
@@ -32,8 +32,8 @@ const CommandDialog = ({ children, ...props }: DialogProps) => {
</Command>
</DialogContent>
</Dialog>
- )
-}
+ );
+};
const CommandInput = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Input>,
@@ -50,9 +50,9 @@ const CommandInput = React.forwardRef<
{...props}
/>
</div>
-))
+));
-CommandInput.displayName = CommandPrimitive.Input.displayName
+CommandInput.displayName = CommandPrimitive.Input.displayName;
const CommandList = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.List>,
@@ -63,9 +63,9 @@ const CommandList = React.forwardRef<
className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
{...props}
/>
-))
+));
-CommandList.displayName = CommandPrimitive.List.displayName
+CommandList.displayName = CommandPrimitive.List.displayName;
const CommandEmpty = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Empty>,
@@ -76,9 +76,9 @@ const CommandEmpty = React.forwardRef<
className="py-6 text-center text-sm"
{...props}
/>
-))
+));
-CommandEmpty.displayName = CommandPrimitive.Empty.displayName
+CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
const CommandGroup = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Group>,
@@ -92,9 +92,9 @@ const CommandGroup = React.forwardRef<
)}
{...props}
/>
-))
+));
-CommandGroup.displayName = CommandPrimitive.Group.displayName
+CommandGroup.displayName = CommandPrimitive.Group.displayName;
const CommandSeparator = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Separator>,
@@ -105,8 +105,8 @@ const CommandSeparator = React.forwardRef<
className={cn("-mx-1 h-px bg-border", className)}
{...props}
/>
-))
-CommandSeparator.displayName = CommandPrimitive.Separator.displayName
+));
+CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
const CommandItem = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Item>,
@@ -120,9 +120,9 @@ const CommandItem = React.forwardRef<
)}
{...props}
/>
-))
+));
-CommandItem.displayName = CommandPrimitive.Item.displayName
+CommandItem.displayName = CommandPrimitive.Item.displayName;
const CommandShortcut = ({
className,
@@ -136,9 +136,9 @@ const CommandShortcut = ({
)}
{...props}
/>
- )
-}
-CommandShortcut.displayName = "CommandShortcut"
+ );
+};
+CommandShortcut.displayName = "CommandShortcut";
export {
Command,
@@ -150,4 +150,4 @@ export {
CommandItem,
CommandShortcut,
CommandSeparator,
-}
+};
diff --git a/pipes/obsidian/src/components/ui/toaster.tsx b/pipes/obsidian/src/components/ui/toaster.tsx
index fe7103d70..171beb46d 100644
--- a/pipes/obsidian/src/components/ui/toaster.tsx
+++ b/pipes/obsidian/src/components/ui/toaster.tsx
@@ -1,6 +1,6 @@
"use client"
-import { useToast } from "@/components/ui/use-toast"
+import { useToast } from "@/hooks/use-toast"
import {
Toast,
ToastClose,
diff --git a/pipes/obsidian/src/hooks/use-toast.ts b/pipes/obsidian/src/hooks/use-toast.ts
new file mode 100644
index 000000000..02e111d81
--- /dev/null
+++ b/pipes/obsidian/src/hooks/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/obsidian/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/obsidian/src/lib/hooks/use-copy-to-clipboard.tsx
index e011d69bd..7249b0751 100644
--- a/pipes/obsidian/src/lib/hooks/use-copy-to-clipboard.tsx
+++ b/pipes/obsidian/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -9,7 +9,7 @@ export interface useCopyToClipboardProps {
export function useCopyToClipboard({
timeout = 2000,
}: useCopyToClipboardProps) {
- const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+ const [isCopied, setIsCopied] = React.useState<boolean>(false);
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
diff --git a/pipes/obsidian/src/lib/hooks/use-search-history.tsx b/pipes/obsidian/src/lib/hooks/use-search-history.tsx
deleted file mode 100644
index 4673e3e22..000000000
--- a/pipes/obsidian/src/lib/hooks/use-search-history.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-"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/search/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/search/src/lib/hooks/use-copy-to-clipboard.tsx
index e011d69bd..7249b0751 100644
--- a/pipes/search/src/lib/hooks/use-copy-to-clipboard.tsx
+++ b/pipes/search/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -9,7 +9,7 @@ export interface useCopyToClipboardProps {
export function useCopyToClipboard({
timeout = 2000,
}: useCopyToClipboardProps) {
- const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+ const [isCopied, setIsCopied] = React.useState<boolean>(false);
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
diff --git a/pipes/timeline/src/lib/hooks/use-copy-to-clipboard.tsx b/pipes/timeline/src/lib/hooks/use-copy-to-clipboard.tsx
index e011d69bd..7249b0751 100644
--- a/pipes/timeline/src/lib/hooks/use-copy-to-clipboard.tsx
+++ b/pipes/timeline/src/lib/hooks/use-copy-to-clipboard.tsx
@@ -9,7 +9,7 @@ export interface useCopyToClipboardProps {
export function useCopyToClipboard({
timeout = 2000,
}: useCopyToClipboardProps) {
- const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+ const [isCopied, setIsCopied] = React.useState<boolean>(false);
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
diff --git a/screenpipe-app-tauri/lib/hooks/use-copy-to-clipboard.tsx b/screenpipe-app-tauri/lib/hooks/use-copy-to-clipboard.tsx
index 4918b6110..ac5077b98 100644
--- a/screenpipe-app-tauri/lib/hooks/use-copy-to-clipboard.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-copy-to-clipboard.tsx
@@ -10,7 +10,7 @@ export interface useCopyToClipboardProps {
export function useCopyToClipboard({
timeout = 2000,
}: useCopyToClipboardProps) {
- const [isCopied, setIsCopied] = React.useState<Boolean>(false);
+ const [isCopied, setIsCopied] = React.useState<boolean>(false);
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {