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

merge: resolve conflicts with upstream (keep memory fixes + chat auto-send fix)

Louis Beaumont9794083cd2ba
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 19e323edd..d2ab56de1 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -10,7 +10,7 @@ import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { useSettings, ChatMessage, ChatConversation } from "@/lib/hooks/use-settings";
import { cn } from "@/lib/utils";
-import { Loader2, Send, Square, User, Settings, ExternalLink, X, ImageIcon, Zap, History, Search, Trash2, ChevronLeft, ChevronDown, ChevronUp, Plus, Copy, Check, Clock, Paperclip, RefreshCw, ArrowDown, Filter } from "lucide-react";
+import { Loader2, Send, Square, User, Settings, ExternalLink, X, ImageIcon, Zap, History, Search, Trash2, ChevronLeft, ChevronDown, ChevronUp, Plus, Copy, Check, Clock, Paperclip } from "lucide-react";
import { SchedulePromptDialog } from "@/components/chat/schedule-prompt-dialog";
import { toast } from "@/components/ui/use-toast";
import { motion, AnimatePresence } from "framer-motion";
@@ -19,18 +19,17 @@ import { MemoizedReactMarkdown } from "@/components/markdown";
import { VideoComponent } from "@/components/rewind/video";
import { MermaidDiagram } from "@/components/rewind/mermaid-diagram";
import { AIPresetsSelector } from "@/components/rewind/ai-presets-selector";
-import { Dialog, DialogContent } from "@/components/ui/dialog";
-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { AIPreset } from "@/lib/utils/tauri";
import remarkGfm from "remark-gfm";
// OpenAI SDK no longer used directly — all providers route through Pi agent
import posthog from "posthog-js";
import { open as openUrl } from "@tauri-apps/plugin-shell";
-import { save as saveDialog } from "@tauri-apps/plugin-dialog";
-import { writeTextFile } from "@tauri-apps/plugin-fs";
+import { save as saveDialog, open as openFileDialog } from "@tauri-apps/plugin-dialog";
+import { writeTextFile, readFile } from "@tauri-apps/plugin-fs";
import { commands } from "@/lib/utils/tauri";
import { emit } from "@tauri-apps/api/event";
import { getCurrentWindow } from "@tauri-apps/api/window";
+import { getCurrentWebview } from "@tauri-apps/api/webview";
import { usePlatform } from "@/lib/hooks/use-platform";
import { useSqlAutocomplete } from "@/lib/hooks/use-sql-autocomplete";
import { homeDir, join } from "@tauri-apps/api/path";
@@ -38,20 +37,42 @@ import { useTimelineStore } from "@/lib/hooks/use-timeline-store";
import { UpgradeDialog } from "@/components/upgrade-dialog";
import {
parseMentions,
+ buildAppMentionSuggestions,
+ normalizeAppTag,
formatShortcutDisplay,
} from "@/lib/chat-utils";
import { useAutoSuggestions } from "@/lib/hooks/use-auto-suggestions";
import { SummaryCards } from "@/components/chat/summary-cards";
import { type CustomTemplate } from "@/lib/summary-templates";
import { usePipes } from "@/lib/hooks/use-pipes";
-import { useImageUpload } from "@/components/hooks/use-image-upload";
-import { useChatConversations } from "@/components/hooks/use-chat-conversations";
-import { useMentionSystem, STATIC_MENTION_SUGGESTIONS } from "@/components/hooks/use-mention-system";
-import { usePiEventHandler } from "@/components/hooks/use-pi-event-handler";
const SCREENPIPE_API = "http://localhost:3030";
const PI_CHAT_SESSION = "chat";
+interface MentionSuggestion {
+ tag: string;
+ description: string;
+ category: "time" | "content" | "app" | "speaker";
+ appName?: string;
+}
+
+const APP_SUGGESTION_LIMIT = 10;
+
+interface Speaker {
+ id: number;
+ name: string;
+ metadata?: string;
+}
+
+const STATIC_MENTION_SUGGESTIONS: MentionSuggestion[] = [
+ { tag: "@today", description: "today's activity", category: "time" },
+ { tag: "@yesterday", description: "yesterday", category: "time" },
+ { tag: "@last-week", description: "past 7 days", category: "time" },
+ { tag: "@last-hour", description: "past hour", category: "time" },
+ { tag: "@audio", description: "audio/meetings only", category: "content" },
+ { tag: "@screen", description: "screen text only", category: "content" },
+ { tag: "@input", description: "UI events (clicks, keys)", category: "content" },
+];
// TOOLS definition removed — search is now handled by Pi's screenpipe-search skill
@@ -107,10 +128,6 @@ DEEP LINKS & MEDIA:
- Video: show .mp4 paths in inline code: \`/path/to/video.mp4\`
ALWAYS use screenpipe://frame/{frame_id} for OCR results. Only use screenpipe://timeline for audio results (no frame_id). Copy IDs/timestamps verbatim from search results — NEVER fabricate them.
-CHAT HISTORY:
-Previous chat conversations are stored as individual JSON files in ~/.screenpipe/chats/{conversation-id}.json
-Each file contains: id, title, messages[], createdAt, updatedAt. You can reference or search these files when the user asks about previous conversations.
-
Current time: ${now.toISOString()}
User's timezone: ${timezone} (UTC${offsetStr})
User's local time: ${now.toLocaleString()}`;
@@ -360,7 +377,7 @@ function ThinkingBlock({ text, isThinking, durationMs }: { text: string; isThink
}
// Markdown renderer for text blocks
-function MarkdownBlock({ text, isUser, onImageClick }: { text: string; isUser: boolean; onImageClick?: (src: string) => void }) {
+function MarkdownBlock({ text, isUser }: { text: string; isUser: boolean }) {
return (
<MemoizedReactMarkdown
className={cn(
@@ -374,18 +391,6 @@ function MarkdownBlock({ text, isUser, onImageClick }: { text: string; isUser: b
p({ children }) {
return <p className="mb-2 last:mb-0 leading-relaxed">{children}</p>;
},
- img({ src, alt, ...props }) {
- return (
- // eslint-disable-next-line @next/next/no-img-element
- <img
- src={src}
- alt={alt || ""}
- className="max-w-full rounded border border-border/50 cursor-pointer hover:opacity-80 transition-opacity"
- onClick={() => src && onImageClick?.(src)}
- {...props}
- />
- );
- },
a({ href, children, ...props }) {
const isMediaLink = href?.toLowerCase().match(/\.(mp4|mp3|wav|webm)$/);
if (isMediaLink && href) {
@@ -578,7 +583,7 @@ function ToolCallGroup({ toolCalls }: { toolCalls: ToolCall[] }) {
}
// Renders message content with interleaved text and tool call blocks
-function MessageContent({ message, onImageClick }: { message: Message; onImageClick?: (src: string) => void }) {
+function MessageContent({ message }: { message: Message }) {
const isUser = message.role === "user";
// If we have content blocks (Pi messages with tool calls), render them in order
@@ -589,7 +594,7 @@ function MessageContent({ message, onImageClick }: { message: Message; onImageCl
<div className="space-y-2 min-w-0 w-full overflow-hidden">
{grouped.map((group) => {
if (group.type === "text") {
- return <MarkdownBlock key={`text-${group.key}`} text={group.text} isUser={isUser} onImageClick={onImageClick} />;
+ return <MarkdownBlock key={`text-${group.key}`} text={group.text} isUser={isUser} />;
}
if (group.type === "thinking") {
return <ThinkingBlock key={`thinking-${group.key}`} text={group.text} isThinking={group.isThinking} durationMs={group.durationMs} />;
@@ -608,13 +613,7 @@ function MessageContent({ message, onImageClick }: { message: Message; onImageCl
<div className="flex gap-1.5 flex-wrap">
{message.images.map((img, i) => (
// eslint-disable-next-line @next/next/no-img-element
- <img
- key={i}
- src={img}
- alt={`Attached ${i + 1}`}
- className="max-w-[120px] max-h-[80px] rounded border border-background/20 object-cover cursor-pointer hover:opacity-80 transition-opacity"
- onClick={() => onImageClick?.(img)}
- />
+ <img key={i} src={img} alt={`Attached ${i + 1}`} className="max-w-[120px] max-h-[80px] rounded border border-background/20 object-cover" />
))}
</div>
) : null;
@@ -632,7 +631,7 @@ function MessageContent({ message, onImageClick }: { message: Message; onImageCl
return (
<div className="space-y-2">
{imageThumbs}
- <MarkdownBlock text={message.content} isUser={isUser} onImageClick={onImageClick} />
+ <MarkdownBlock text={message.content} isUser={isUser} />
</div>
);
}
@@ -664,11 +663,7 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
const { settings, updateSettings, isSettingsLoaded, reloadStore } = useSettings();
const { isMac } = usePlatform();
const { items: appItems } = useSqlAutocomplete("app");
- const {
- suggestions: autoSuggestions,
- refreshing: suggestionsRefreshing,
- forceRefresh: refreshSuggestions,
- } = useAutoSuggestions();
+ const { suggestions: autoSuggestions } = useAutoSuggestions();
const { templatePipes, loading: pipesLoading } = usePipes();
// Custom summary templates (persisted in settings)
@@ -704,13 +699,15 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
const [isStreaming, setIsStreaming] = useState(false);
const [copiedMessageId, setCopiedMessageId] = useState<string | null>(null);
const [activePreset, setActivePreset] = useState<AIPreset | undefined>();
+ const [showMentionDropdown, setShowMentionDropdown] = useState(false);
+ const [mentionFilter, setMentionFilter] = useState("");
+ const [selectedMentionIndex, setSelectedMentionIndex] = useState(0);
+ const [speakerSuggestions, setSpeakerSuggestions] = useState<MentionSuggestion[]>([]);
+ const [isLoadingSpeakers, setIsLoadingSpeakers] = useState(false);
const abortControllerRef = useRef<AbortController | null>(null);
const messagesEndRef = useRef<HTMLDivElement>(null);
- const messagesContainerRef = useRef<HTMLDivElement>(null);
const inputRef = useRef<HTMLTextAreaElement>(null);
const dropdownRef = useRef<HTMLDivElement>(null);
- const [showScrollButton, setShowScrollButton] = useState(false);
- const [lightboxSrc, setLightboxSrc] = useState<string | null>(null);
const [showUpgradeDialog, setShowUpgradeDialog] = useState(false);
const [upgradeReason, setUpgradeReason] = useState<"daily_limit" | "model_not_allowed" | "rate_limit">("daily_limit");
@@ -719,14 +716,10 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
const [prefillContext, setPrefillContext] = useState<string | null>(null);
const [prefillSource, setPrefillSource] = useState<string>("search");
const [prefillFrameId, setPrefillFrameId] = useState<number | null>(null);
+ const [pastedImages, setPastedImages] = useState<string[]>([]); // Base64 data URLs
+ const [isDragging, setIsDragging] = useState(false);
const isEmbedded = !!className; // embedded in settings vs overlay panel
- // --- Extracted hooks ---
- const {
- pastedImages, setPastedImages, isDragging, handlePaste,
- loadImageFromPath, handleFilePicker, processImageFile,
- } = useImageUpload({ isEmbedded });
-
// Pi agent state
const [piInfo, setPiInfo] = useState<{ running: boolean; projectDir: string | null; pid: number | null } | null>(null);
const [piProjectDir, setPiProjectDir] = useState<string>("");
@@ -758,17 +751,404 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
// Chat history state
const [conversationId, setConversationId] = useState<string | null>(null);
+ const [showHistory, setShowHistory] = useState(false);
+ const [historySearch, setHistorySearch] = useState("");
+
+ // Process an image file to base64
+ // Resize image to max 1024px and compress as JPEG to keep base64 payload small
+ const resizeImage = useCallback((dataUrl: string): Promise<string> => {
+ return new Promise((resolve) => {
+ const img = new Image();
+ img.onload = () => {
+ const MAX = 1024;
+ let { width, height } = img;
+ if (width > MAX || height > MAX) {
+ const scale = MAX / Math.max(width, height);
+ width = Math.round(width * scale);
+ height = Math.round(height * scale);
+ }
+ const canvas = document.createElement("canvas");
+ canvas.width = width;
+ canvas.height = height;
+ const ctx = canvas.getContext("2d")!;
+ ctx.drawImage(img, 0, 0, width, height);
+ resolve(canvas.toDataURL("image/jpeg", 0.8));
+ };
+ img.onerror = () => resolve(dataUrl); // fallback to original
+ img.src = dataUrl;
+ });
+ }, []);
+
+ const processImageFile = useCallback((file: File) => {
+ if (!file.type.startsWith("image/")) return;
+ const reader = new FileReader();
+ reader.onload = async (event) => {
+ const base64 = event.target?.result as string;
+ const resized = await resizeImage(base64);
+ setPastedImages(prev => [...prev, resized]);
+ };
+ reader.readAsDataURL(file);
+ }, [resizeImage]);
+
+ // Always start with a fresh conversation — history is accessible via the History button
+ // (No auto-load of last active conversation)
+
+ // Save conversation to settings.
+ // IMPORTANT: reads fresh from the store (not React state) to avoid
+ // race conditions where the main window overwrites chatHistory with
+ // stale data. See: multi-window store concurrency issue.
+ const saveConversation = async (msgs: Message[]) => {
+ if (msgs.length === 0) return;
+
+ // Read fresh settings from store to get latest conversations
+ const { getStore } = await import("@/lib/hooks/use-settings");
+ const store = await getStore();
+ const freshSettings = await store.get<any>("settings");
+ const history = freshSettings?.chatHistory || { conversations: [], activeConversationId: null, historyEnabled: true };
+
+ if (!history.historyEnabled) return;
+
+ const convId = conversationId || crypto.randomUUID();
+
+ const existingIndex = history.conversations.findIndex((c: any) => c.id === convId);
+ const firstUserMsg = msgs.find(m => m.role === "user");
+ const title = firstUserMsg?.content.slice(0, 50) || "New Chat";
+
+ const conversation: ChatConversation = {
+ id: convId,
+ title,
+ messages: msgs.slice(-100).map(m => {
+ // For tool-only responses, content may be empty but contentBlocks has the data.
+ // Generate a text fallback so the message isn't lost when reloaded.
+ let content = m.content;
+ if (!content && m.contentBlocks?.length) {
+ content = m.contentBlocks
+ .filter((b: any) => b.type === "text")
+ .map((b: any) => b.text)
+ .join("\n") || "(tool result)";
+ }
+ // Persist contentBlocks so tool calls/results survive reload.
+ // Strip isRunning (stale) and cap result length to keep store small.
+ const blocks = m.contentBlocks?.map((b: any) => {
+ if (b.type === "tool") {
+ const { isRunning, ...rest } = b.toolCall;
+ return {
+ type: "tool",
+ toolCall: {
+ ...rest,
+ isRunning: false,
+ result: rest.result?.slice(0, 4000),
+ },
+ };
+ }
+ if (b.type === "thinking") {
+ return { ...b, isThinking: false };
+ }
+ return b;
+ });
+ return {
+ id: m.id,
+ role: m.role,
+ content,
+ timestamp: m.timestamp,
+ ...(blocks?.length ? { contentBlocks: blocks } : {}),
+ ...(m.images?.length ? { images: m.images } : {}),
+ };
+ }),
+ createdAt: existingIndex >= 0 ? history.conversations[existingIndex].createdAt : Date.now(),
+ updatedAt: Date.now(),
+ };
+
+ let newConversations = [...history.conversations];
+ if (existingIndex >= 0) {
+ newConversations[existingIndex] = conversation;
+ } else {
+ newConversations = [conversation, ...newConversations].slice(0, 50);
+ }
+
+ // Write only chatHistory — read-modify-write with fresh data
+ const currentFull = freshSettings || {};
+ await store.set("settings", {
+ ...currentFull,
+ chatHistory: {
+ ...history,
+ conversations: newConversations,
+ activeConversationId: convId,
+ }
+ });
+ await store.save();
+
+ if (!conversationId) {
+ setConversationId(convId);
+ }
+ };
+
+ // Auto-save conversation when a response completes (isLoading transitions from true to false)
+ // Skip saving pipe watch conversations — they're transient, not user-initiated chats
+ const prevIsLoadingRef = useRef(false);
+ useEffect(() => {
+ if (prevIsLoadingRef.current && !isLoading && messages.length > 0) {
+ const isPipeWatch = messages.some((m) => m.id?.startsWith("pipe-"));
+ if (!isPipeWatch) {
+ saveConversation(messages);
+ }
+ }
+ prevIsLoadingRef.current = isLoading;
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [isLoading, messages]);
+
+ // Delete a conversation
+ const deleteConversation = async (convId: string) => {
+ // Read fresh from store (same pattern as saveConversation)
+ const { getStore } = await import("@/lib/hooks/use-settings");
+ const store = await getStore();
+ const freshSettings = await store.get<any>("settings");
+ const history = freshSettings?.chatHistory;
+ if (!history) return;
+
+ const newConversations = history.conversations.filter((c: any) => c.id !== convId);
+ const newActiveId = history.activeConversationId === convId ? null : history.activeConversationId;
+
+ await store.set("settings", {
+ ...freshSettings,
+ chatHistory: {
+ ...history,
+ conversations: newConversations,
+ activeConversationId: newActiveId,
+ }
+ });
+ await store.save();
+
+ if (conversationId === convId) {
+ setMessages([]);
+ setConversationId(null);
+ }
+ };
+
+ // Load a specific conversation
+ const loadConversation = async (conv: ChatConversation) => {
+ // Abort any ongoing Pi processing before switching
+ if (isLoading || isStreaming) {
+ try {
+ await commands.piAbort(PI_CHAT_SESSION);
+ } catch (e) {
+ console.warn("[Pi] Failed to abort:", e);
+ }
+ piStreamingTextRef.current = "";
+ piMessageIdRef.current = null;
+ piContentBlocksRef.current = [];
+ setIsLoading(false);
+ setIsStreaming(false);
+ }
+ setMessages(conv.messages.map(m => ({
+ id: m.id,
+ role: m.role,
+ content: m.content,
+ timestamp: m.timestamp,
+ ...(m.contentBlocks?.length ? { contentBlocks: m.contentBlocks } : {}),
+ ...((m as any).images?.length ? { images: (m as any).images } : (m as any).image ? { images: [(m as any).image] } : {}),
+ })));
+ setConversationId(conv.id);
+ setShowHistory(false);
+ piSessionSyncedRef.current = false;
+
+ // Update activeConversationId directly in the store (read fresh to avoid
+ // overwriting conversations with stale React state)
+ try {
+ const { getStore } = await import("@/lib/hooks/use-settings");
+ const store = await getStore();
+ const freshSettings = await store.get<any>("settings");
+ if (freshSettings?.chatHistory) {
+ await store.set("settings", {
+ ...freshSettings,
+ chatHistory: {
+ ...freshSettings.chatHistory,
+ activeConversationId: conv.id,
+ }
+ });
+ await store.save();
+ }
+ } catch (e) {
+ console.warn("Failed to update active conversation:", e);
+ }
+ };
- const {
- showHistory, setShowHistory, historySearch, setHistorySearch,
- filteredConversations, groupedConversations,
- saveConversation, loadConversation, deleteConversation, startNewConversation,
- } = useChatConversations({
- messages, setMessages, conversationId, setConversationId,
- setInput, inputRef, isLoading, isStreaming,
- piInfo, piStreamingTextRef, piMessageIdRef, piContentBlocksRef,
- piSessionSyncedRef, setIsLoading, setIsStreaming, setPastedImages, settings,
- });
+ // Start a new conversation
+ const startNewConversation = async () => {
+ // Abort any ongoing Pi processing and start a fresh session
+ if (piInfo?.running) {
+ try {
+ if (isLoading || isStreaming) {
+ await commands.piAbort(PI_CHAT_SESSION);
+ }
+ await commands.piNewSession(PI_CHAT_SESSION);
+ } catch (e) {
+ console.warn("[Pi] Failed to reset session:", e);
+ }
+ piStreamingTextRef.current = "";
+ piMessageIdRef.current = null;
+ piContentBlocksRef.current = [];
+ setIsLoading(false);
+ setIsStreaming(false);
+ }
+ setMessages([]);
+ setConversationId(null);
+ setInput("");
+ if (inputRef.current) inputRef.current.style.height = "auto";
+ setShowHistory(false);
+ setPastedImages([]);
+ piSessionSyncedRef.current = true;
+ };
+
+ // Filter conversations by search
+ const filteredConversations = React.useMemo(() => {
+ const convs = settings.chatHistory?.conversations || [];
+ if (!historySearch.trim()) return convs;
+
+ const search = historySearch.toLowerCase();
+ return convs.filter(c =>
+ c.title.toLowerCase().includes(search) ||
+ c.messages.some(m => m.content.toLowerCase().includes(search))
+ );
+ }, [settings.chatHistory?.conversations, historySearch]);
+
+ // Group conversations by date
+ const groupedConversations = React.useMemo(() => {
+ const groups: { label: string; conversations: ChatConversation[] }[] = [];
+ const now = new Date();
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
+ const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
+ const lastWeek = new Date(today.getTime() - 7 * 24 * 60 * 60 * 1000);
+
+ const todayConvs: ChatConversation[] = [];
+ const yesterdayConvs: ChatConversation[] = [];
+ const lastWeekConvs: ChatConversation[] = [];
+ const olderConvs: ChatConversation[] = [];
+
+ for (const conv of filteredConversations) {
+ const convDate = new Date(conv.updatedAt);
+ if (convDate >= today) {
+ todayConvs.push(conv);
+ } else if (convDate >= yesterday) {
+ yesterdayConvs.push(conv);
+ } else if (convDate >= lastWeek) {
+ lastWeekConvs.push(conv);
+ } else {
+ olderConvs.push(conv);
+ }
+ }
+
+ if (todayConvs.length > 0) groups.push({ label: "Today", conversations: todayConvs });
+ if (yesterdayConvs.length > 0) groups.push({ label: "Yesterday", conversations: yesterdayConvs });
+ if (lastWeekConvs.length > 0) groups.push({ label: "Last 7 Days", conversations: lastWeekConvs });
+ if (olderConvs.length > 0) groups.push({ label: "Older", conversations: olderConvs });
+
+ return groups;
+ }, [filteredConversations]);
+
+ // Read an image file by path and append it to pastedImages (base64 data URL)
+ const loadImageFromPath = useCallback(async (filePath: string) => {
+ const ext = filePath.split(".").pop()?.toLowerCase() || "";
+ const imageExts = ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"];
+ if (!imageExts.includes(ext)) return;
+
+ try {
+ const bytes = await readFile(filePath);
+ const mimeMap: Record<string, string> = {
+ png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg",
+ gif: "image/gif", webp: "image/webp", bmp: "image/bmp", svg: "image/svg+xml",
+ };
+ const mime = mimeMap[ext] || "image/png";
+
+ // Convert Uint8Array to base64
+ let binary = "";
+ for (let i = 0; i < bytes.length; i++) {
+ binary += String.fromCharCode(bytes[i]);
+ }
+ const b64 = btoa(binary);
+ const dataUrl = `data:${mime};base64,${b64}`;
+ const resized = await resizeImage(dataUrl);
+ setPastedImages(prev => [...prev, resized]);
+ } catch (err) {
+ console.error("failed to read dropped image:", err);
+ }
+ }, [resizeImage]);
+
+ // Handle file picker
+ const handleFilePicker = useCallback(async () => {
+ try {
+ const selected = await openFileDialog({
+ multiple: false,
+ filters: [{
+ name: "Images",
+ extensions: ["png", "jpg", "jpeg", "gif", "webp", "bmp"],
+ }],
+ });
+ if (selected) {
+ await loadImageFromPath(selected);
+ }
+ } catch (err) {
+ console.error("file picker error:", err);
+ }
+ }, [loadImageFromPath]);
+
+ // Drag-drop only works in the embedded (non-overlay) chat. The overlay is an
+ // NSPanel with NonActivatingPanel style which doesn't receive drag events.
+ useEffect(() => {
+ if (!isEmbedded) return;
+
+ const webview = getCurrentWebview();
+ const unlisten = webview.onDragDropEvent((event) => {
+ if (event.payload.type === "enter" || event.payload.type === "over") {
+ setIsDragging(true);
+ } else if (event.payload.type === "drop") {
+ setIsDragging(false);
+ const paths = event.payload.paths;
+ if (paths && paths.length > 0) {
+ loadImageFromPath(paths[0]);
+ }
+ } else if (event.payload.type === "leave") {
+ setIsDragging(false);
+ }
+ });
+
+ return () => {
+ unlisten.then((fn) => fn());
+ };
+ }, [isEmbedded, loadImageFromPath]);
+
+ // Handle paste events to capture images
+ const handlePaste = useCallback((e: React.ClipboardEvent) => {
+ const items = e.clipboardData?.items;
+ const files = e.clipboardData?.files;
+
+ // Try items first (works in most browsers)
+ if (items) {
+ for (let i = 0; i < items.length; i++) {
+ const item = items[i];
+ if (item.type.startsWith("image/")) {
+ e.preventDefault();
+ const file = item.getAsFile();
+ if (file) {
+ processImageFile(file);
+ }
+ return;
+ }
+ }
+ }
+
+ // Fallback: try files array (some browsers put images here)
+ if (files && files.length > 0) {
+ for (let i = 0; i < files.length; i++) {
+ const file = files[i];
+ if (file.type.startsWith("image/")) {
+ e.preventDefault();
+ processImageFile(file);
+ return;
+ }
+ }
+ }
+ }, [processImageFile]);
// Signal that this chat window is ready to receive prefill events.
// Other windows wait for "chat-ready" before emitting "chat-prefill"
@@ -882,15 +1262,171 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [settings.chatHistory?.conversations]);
- const {
- showMentionDropdown, setShowMentionDropdown, mentionFilter,
- selectedMentionIndex, setSelectedMentionIndex,
- filteredMentions, activeFilters, hasActiveFilters,
- handleInputChange, insertMention, removeFilter,
- isLoadingSpeakers, appFilterOpen, setAppFilterOpen,
- speakerSuggestions, recentSpeakers, setRecentSpeakers,
- appMentionSuggestions, appTagMap,
- } = useMentionSystem({ input, setInput, appItems, inputRef });
+ const appMentionSuggestions = React.useMemo(
+ () => buildAppMentionSuggestions(appItems, APP_SUGGESTION_LIMIT),
+ [appItems]
+ );
+
+ const appTagMap = React.useMemo(() => {
+ const map: Record<string, string> = {};
+ for (const suggestion of appMentionSuggestions) {
+ if (suggestion.appName) {
+ map[suggestion.tag.slice(1).toLowerCase()] = suggestion.appName;
+ }
+ }
+ return map;
+ }, [appMentionSuggestions]);
+
+ const baseMentionSuggestions = React.useMemo(
+ () => [...STATIC_MENTION_SUGGESTIONS, ...appMentionSuggestions],
+ [appMentionSuggestions]
+ );
+
+ // Parse current input to extract active filters for chip display
+ const activeFilters = React.useMemo(() => {
+ if (!input.trim()) return { timeRanges: [], contentType: null, appName: null, speakerName: null };
+ const parsed = parseMentions(input, { appTagMap });
+ return {
+ timeRanges: parsed.timeRanges,
+ contentType: parsed.contentType,
+ appName: parsed.appName,
+ speakerName: parsed.speakerName,
+ };
+ }, [input, appTagMap]);
+
+ // Check if any filters are active
+ const hasActiveFilters = activeFilters.timeRanges.length > 0 ||
+ activeFilters.contentType ||
+ activeFilters.appName ||
+ activeFilters.speakerName;
+
+ // Remove a specific @mention from input
+ const removeFilter = (filterType: "time" | "content" | "app" | "speaker", label?: string) => {
+ let newInput = input;
+ if (filterType === "time" && label) {
+ // Remove time mentions like @today, @yesterday, @last-hour, etc.
+ const timePatterns: Record<string, RegExp> = {
+ "today": /@today\b/gi,
+ "yesterday": /@yesterday\b/gi,
+ "last week": /@last[- ]?week\b/gi,
+ "last hour": /@last[- ]?hour\b/gi,
+ "this morning": /@this[- ]?morning\b/gi,
+ };
+ const pattern = timePatterns[label];
+ if (pattern) newInput = newInput.replace(pattern, "").trim();
+ } else if (filterType === "content") {
+ newInput = newInput.replace(/@(audio|screen)\b/gi, "").trim();
+ } else if (filterType === "app" && activeFilters.appName) {
+ // Remove app mention - need to find the pattern
+ const appPattern = new RegExp(`@${activeFilters.appName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\b`, "gi");
+ newInput = newInput.replace(appPattern, "").trim();
+ // Also try normalized versions
+ for (const [tag, name] of Object.entries(appTagMap)) {
+ if (name === activeFilters.appName) {
+ newInput = newInput.replace(new RegExp(`@${tag}\\b`, "gi"), "").trim();
+ }
+ }
+ } else if (filterType === "speaker" && activeFilters.speakerName) {
+ const speakerPattern = new RegExp(`@"?${activeFilters.speakerName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}"?\\b`, "gi");
+ newInput = newInput.replace(speakerPattern, "").trim();
+ }
+ // Clean up extra spaces
+ newInput = newInput.replace(/\s+/g, " ").trim();
+ setInput(newInput);
+ };
+
+ // Fetch speakers dynamically
+ useEffect(() => {
+ if (!mentionFilter || mentionFilter.length < 1) {
+ setSpeakerSuggestions([]);
+ return;
+ }
+
+ const matchesBase = baseMentionSuggestions.some(
+ s => s.tag.toLowerCase().includes(`@${mentionFilter.toLowerCase()}`)
+ );
+ if (matchesBase && mentionFilter.length < 3) {
+ setSpeakerSuggestions([]);
+ return;
+ }
+
+ const searchSpeakers = async () => {
+ setIsLoadingSpeakers(true);
+ try {
+ const response = await fetch(
+ `${SCREENPIPE_API}/speakers/search?name=${encodeURIComponent(mentionFilter)}`
+ );
+ if (response.ok) {
+ const speakers: Speaker[] = await response.json();
+ const suggestions: MentionSuggestion[] = speakers
+ .filter(s => s.name)
+ .slice(0, 5)
+ .map(s => ({
+ tag: s.name.includes(" ") ? `@"${s.name}"` : `@${s.name}`,
+ description: `speaker`,
+ category: "speaker" as const,
+ }));
+ setSpeakerSuggestions(suggestions);
+ }
+ } catch (error) {
+ console.error("Error searching speakers:", error);
+ } finally {
+ setIsLoadingSpeakers(false);
+ }
+ };
+
+ const debounceTimeout = setTimeout(searchSpeakers, 300);
+ return () => clearTimeout(debounceTimeout);
+ }, [mentionFilter, baseMentionSuggestions]);
+
+ const filteredMentions = React.useMemo(() => {
+ const suggestions = !mentionFilter
+ ? baseMentionSuggestions
+ : baseMentionSuggestions.filter(
+ s => s.tag.toLowerCase().includes(mentionFilter.toLowerCase()) ||
+ s.description.toLowerCase().includes(mentionFilter.toLowerCase())
+ );
+ return [...suggestions, ...speakerSuggestions];
+ }, [mentionFilter, speakerSuggestions, baseMentionSuggestions]);
+
+ const handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
+ const value = e.target.value;
+ setInput(value);
+
+ // Auto-resize textarea
+ const textarea = e.target;
+ textarea.style.height = "auto";
+ textarea.style.height = Math.min(textarea.scrollHeight, 150) + "px";
+
+ const cursorPos = e.target.selectionStart || 0;
+ const textBeforeCursor = value.slice(0, cursorPos);
+ const atMatch = textBeforeCursor.match(/@(\w*)$/);
+
+ if (atMatch) {
+ setShowMentionDropdown(true);
+ setMentionFilter(atMatch[1]);
+ setSelectedMentionIndex(0);
+ } else {
+ setShowMentionDropdown(false);
+ setMentionFilter("");
+ }
+ };
+
+ const insertMention = (tag: string) => {
+ const cursorPos = inputRef.current?.selectionStart || input.length;
+ const textBeforeCursor = input.slice(0, cursorPos);
+ const textAfterCursor = input.slice(cursorPos);
+
+ const atIndex = textBeforeCursor.lastIndexOf("@");
+ if (atIndex !== -1) {
+ const newValue = textBeforeCursor.slice(0, atIndex) + tag + " " + textAfterCursor;
+ setInput(newValue);
+ }
+
+ setShowMentionDropdown(false);
+ setMentionFilter("");
+ inputRef.current?.focus();
+ };
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
// Prevent '/' from triggering app shortcuts while typing
@@ -978,18 +1514,6 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
}, [messages]);
- // Scroll-to-bottom detection
- useEffect(() => {
- const container = messagesContainerRef.current;
- if (!container) return;
- const onScroll = () => {
- const distanceFromBottom = container.scrollHeight - container.scrollTop - container.clientHeight;
- setShowScrollButton(distanceFromBottom > 100);
- };
- container.addEventListener("scroll", onScroll, { passive: true });
- return () => container.removeEventListener("scroll", onScroll);
- }, []);
-
// Pi project dir is managed Rust-side at boot
// Build Pi provider config from active preset
@@ -1034,7 +1558,7 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
const piRunningConfigRef = useRef<{ provider?: string; model?: string; token?: string | null }>({});
const piRestartTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
- // Restart Pi when user switches preset or account so the new model/token takes effect.
+ // Restart Pi when user switches preset so the new model takes effect immediately.
// Pi uses CLI args from startup, so config-only updates don't change the running model.
// Debounced to collapse rapid settings saves into a single restart.
useEffect(() => {
@@ -1043,26 +1567,12 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
const currentToken = settings.user?.token ?? null;
const configChanged = running.provider !== undefined &&
(running.provider !== activePreset.provider || running.model !== activePreset.model);
- // Always detect token changes — even on first mount. If Pi is already running
- // with a stale/null token (e.g. user logged out then into a different account),
- // we must restart it. Without this, switching accounts leaves Pi sending
- // requests as anonymous, hitting the free tier rate limit.
const tokenChanged = running.token !== undefined && running.token !== currentToken;
if (!configChanged && !tokenChanged) {
- // First mount — record what we expect Pi to be running, but also check
- // if Pi is already alive with a potentially stale token and restart it.
+ // First mount or same config — just record what we expect Pi to be running
if (running.provider === undefined) {
piRunningConfigRef.current = { provider: activePreset.provider, model: activePreset.model, token: currentToken };
- // If Pi is running, proactively push the current token/config so it
- // picks up any account change that happened while chat was unmounted.
- if (piInfo?.running) {
- const providerConfig = buildProviderConfig();
- console.log("[Pi] First mount with running Pi — syncing config/token");
- commands.piUpdateConfig(currentToken, providerConfig).catch((e) => {
- console.error("[Pi] First-mount config sync failed:", e);
- });
- }
}
return;
}
@@ -1085,16 +1595,563 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [activePreset?.provider, activePreset?.model, settings.user?.token]);
- // Pi event handler (extracted to hook)
- usePiEventHandler({
- messages, setMessages, setIsLoading, setIsStreaming,
- setShowUpgradeDialog, setUpgradeReason: setUpgradeReason as any,
- setUpgradeResetsAt, setActivePipeExecution, setPiInfo,
- activePreset, piStreamingTextRef, piMessageIdRef, piContentBlocksRef,
- piThinkingStartRef, piStoppedIntentionallyRef, piStartInFlightRef,
- piRunningConfigRef, piSessionSyncedRef, followUpFiredRef, lastUserMessageRef,
- buildProviderConfig, generateFollowUps, settingsUserToken: settings.user?.token ?? null,
- });
+ // Listen for Pi events (all providers route through Pi) and pipe events
+ useEffect(() => {
+ let unlistenEvent: UnlistenFn | null = null;
+ let unlistenPipeEvent: UnlistenFn | null = null;
+ let unlistenTerminated: UnlistenFn | null = null;
+ let unlistenLog: UnlistenFn | null = null;
+ let mounted = true;
+
+ // Shared handler for Pi event data — used by both pi_event and pipe_event
+ const handlePiEventData = (data: any) => {
+
+ if (data.type === "message_update" && data.assistantMessageEvent) {
+ const evt = data.assistantMessageEvent;
+ if (evt.type === "text_delta" && evt.delta) {
+ piStreamingTextRef.current += evt.delta;
+
+ // Append to last text block or create new one
+ const blocks = piContentBlocksRef.current;
+ const lastBlock = blocks[blocks.length - 1];
+ if (lastBlock && lastBlock.type === "text") {
+ lastBlock.text += evt.delta;
+ } else {
+ blocks.push({ type: "text", text: evt.delta });
+ }
+
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ const content = piStreamingTextRef.current;
+ const contentBlocks = [...blocks];
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content, contentBlocks } : m)
+ );
+ }
+
+ // Trigger follow-up generation after enough content
+ if (
+ piStreamingTextRef.current.length > 500 &&
+ !followUpFiredRef.current
+ ) {
+ followUpFiredRef.current = true;
+ generateFollowUps(
+ lastUserMessageRef.current,
+ piStreamingTextRef.current
+ );
+ }
+ } else if (evt.type === "thinking_start") {
+ piThinkingStartRef.current = Date.now();
+ const blocks = piContentBlocksRef.current;
+ blocks.push({ type: "thinking", text: "", isThinking: true });
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ const contentBlocks = [...blocks];
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: m.content === "Processing..." ? "" : m.content, contentBlocks } : m)
+ );
+ }
+ } else if (evt.type === "thinking_delta" && evt.delta) {
+ const blocks = piContentBlocksRef.current;
+ const thinkingBlock = blocks[blocks.length - 1];
+ if (thinkingBlock && thinkingBlock.type === "thinking") {
+ thinkingBlock.text += evt.delta;
+ }
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ const contentBlocks = [...blocks];
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: m.content === "Processing..." ? "" : m.content, contentBlocks } : m)
+ );
+ }
+ } else if (evt.type === "thinking_end") {
+ const blocks = piContentBlocksRef.current;
+ const thinkingBlock = blocks[blocks.length - 1];
+ if (thinkingBlock && thinkingBlock.type === "thinking") {
+ thinkingBlock.isThinking = false;
+ thinkingBlock.durationMs = piThinkingStartRef.current ? Date.now() - piThinkingStartRef.current : undefined;
+ if (evt.content) thinkingBlock.text = evt.content;
+ }
+ piThinkingStartRef.current = null;
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ const contentBlocks = [...blocks];
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, contentBlocks } : m)
+ );
+ }
+ }
+ } else if (data.type === "tool_execution_start") {
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ const toolCall: ToolCall = {
+ id: data.toolCallId || Date.now().toString(),
+ toolName: data.toolName || "unknown",
+ args: data.args || {},
+ isRunning: true,
+ };
+ // Add tool block (text before it is already its own block)
+ piContentBlocksRef.current.push({ type: "tool", toolCall });
+ const contentBlocks = [...piContentBlocksRef.current];
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, contentBlocks } : m)
+ );
+ }
+ } else if (data.type === "tool_execution_end") {
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ const toolCallId = data.toolCallId;
+ const resultText = data.result?.content
+ ?.map((c: any) => c.text || "")
+ .join("\n") || "";
+ const truncated = resultText.length > 2000
+ ? resultText.slice(0, 2000) + "\n... (truncated)"
+ : resultText;
+ // Update the tool block in-place
+ for (const block of piContentBlocksRef.current) {
+ if (block.type === "tool" && block.toolCall.id === toolCallId) {
+ block.toolCall.isRunning = false;
+ block.toolCall.result = truncated;
+ block.toolCall.isError = data.isError;
+ }
+ }
+ const contentBlocks = [...piContentBlocksRef.current];
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, contentBlocks } : m)
+ );
+ }
+ } else if (data.type === "auto_retry_end" && data.success === false) {
+ // Pi exhausted retries on a transient error (rate limit, overloaded, etc.)
+ const errorStr = data.finalError || "Request failed after retries";
+ console.error("[Pi] Auto-retry failed:", errorStr);
+
+ // Detect rate limit or daily limit from the error
+ if (errorStr.includes("daily_limit_exceeded") || errorStr.includes("429") || errorStr.includes("rate limit")) {
+ // Distinguish between daily limit and per-minute rate limit
+ const isDailyLimit = errorStr.includes("daily_limit_exceeded");
+ const isPerMinuteRate = errorStr.includes("rate limit exceeded") || errorStr.includes("requests per minute");
+
+ // Extract reset time if available
+ try {
+ const resetMatch = errorStr.match(/"reset_in":\s*(\d+)/);
+ const resetsAtMatch = errorStr.match(/"resets_at":\s*"([^"]+)"/);
+ if (resetsAtMatch) setUpgradeResetsAt(resetsAtMatch[1]);
+ else if (resetMatch) setUpgradeResetsAt(`${resetMatch[1]} seconds`);
+ } catch {}
+
+ if (isDailyLimit) {
+ setUpgradeReason("daily_limit");
+ posthog.capture("wall_hit", { reason: "daily_limit", source: "chat" });
+ } else {
+ setUpgradeReason("rate_limit");
+ }
+
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ let content: string;
+ if (isDailyLimit) {
+ content = "You've used all your free queries for today.";
+ } else if (isPerMinuteRate) {
+ // Extract wait time from error
+ const waitMatch = errorStr.match(/wait (\d+) seconds/i);
+ const waitTime = waitMatch ? waitMatch[1] : "a moment";
+ content = `Rate limited — please wait ${waitTime} seconds and try again.`;
+ } else {
+ content = "Rate limited — try again in a moment or switch to a different model.";
+ }
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content } : m)
+ );
+ }
+ // Don't clear refs yet — agent_end will follow
+ } else if (errorStr.includes("model_not_allowed")) {
+ setUpgradeReason("model_not_allowed");
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "This model requires an upgrade." } : m)
+ );
+ }
+ }
+ } else if (data.type === "message_update" && data.assistantMessageEvent?.type === "error") {
+ // Pi's LLM returned an error (e.g. rate limit, overloaded)
+ const reason = data.assistantMessageEvent.reason || "";
+ const errorDetail = data.assistantMessageEvent.error || "";
+ console.error("[Pi] Message error:", reason, errorDetail);
+
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ const fullError = `${reason} ${errorDetail}`.trim();
+
+ if (fullError.includes("daily_limit_exceeded") || fullError.includes("429") || fullError.includes("rate limit")) {
+ const isDailyLimit = fullError.includes("daily_limit_exceeded");
+ const isPerMinuteRate = fullError.includes("rate limit exceeded") || fullError.includes("requests per minute");
+ if (isDailyLimit) {
+ try {
+ const match = fullError.match(/"resets_at":\s*"([^"]+)"/);
+ if (match) setUpgradeResetsAt(match[1]);
+ } catch {}
+ setUpgradeReason("daily_limit");
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "You've used all your free queries for today." } : m)
+ );
+ } else {
+ setUpgradeReason("rate_limit");
+ const waitMatch = fullError.match(/wait (\d+) seconds/i);
+ const waitTime = waitMatch ? waitMatch[1] : "a moment";
+ const content = isPerMinuteRate
+ ? `Rate limited — please wait ${waitTime} seconds and try again.`
+ : "Rate limited — try again in a moment or switch to a different model.";
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content } : m)
+ );
+ }
+ } else if (fullError.includes("model_not_allowed")) {
+ setUpgradeReason("model_not_allowed");
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "This model requires an upgrade." } : m)
+ );
+ } else if (fullError.includes("already processing")) {
+ // Transient error — Pi was still busy when the prompt arrived.
+ // Don't show it; Pi will process the message once it's free.
+ console.warn("[Pi] Agent busy, waiting for it to finish:", fullError);
+ } else {
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: `Error: ${fullError || "Something went wrong"}` } : m)
+ );
+ }
+ }
+ } else if ((data.type === "message_start" || data.type === "message_end") &&
+ data.message?.role === "assistant" && data.message?.stopReason === "error") {
+ // LLM returned an error (credits_exhausted, rate limit, provider error, etc.)
+ const errMsg = data.message.errorMessage || data.message.error || "Unknown error";
+ console.error("[Pi] LLM error via", data.type, ":", errMsg);
+
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+
+ if (errMsg.includes("credits_exhausted") || errMsg.includes("daily_limit_exceeded") || errMsg.includes("429")) {
+ try {
+ const resetsAtMatch = errMsg.match(/"resets_at":\s*"([^"]+)"/);
+ if (resetsAtMatch) setUpgradeResetsAt(resetsAtMatch[1]);
+ } catch {}
+ setUpgradeReason("daily_limit");
+ posthog.capture("wall_hit", { reason: "daily_limit", source: "chat" });
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "You've used all your free queries for today." } : m)
+ );
+ } else if (errMsg.includes("rate limit") || errMsg.includes("rate_limit")) {
+ setUpgradeReason("rate_limit");
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "Rate limited — try again in a moment." } : m)
+ );
+ } else {
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: `Error: ${errMsg}` } : m)
+ );
+ }
+ }
+ } else if (data.type === "agent_end") {
+ // When watching a pipe, agent_end fires before pipe_done — don't
+ // clear pipe refs here, let pipe_done handle cleanup instead.
+ const isPipeWatch = piMessageIdRef.current?.startsWith("pipe-");
+ if (piMessageIdRef.current && !isPipeWatch) {
+ const msgId = piMessageIdRef.current;
+ // Use streamed text if available, otherwise extract from agent_end messages
+ let content = piStreamingTextRef.current;
+
+ // Check for LLM errors in agent_end messages (e.g. credits_exhausted mid-conversation)
+ let agentEndError: string | null = null;
+ if (data.messages && Array.isArray(data.messages)) {
+ for (const m of data.messages) {
+ if (m.role === "assistant" && m.stopReason === "error") {
+ agentEndError = m.errorMessage || m.error || null;
+ break;
+ }
+ }
+ if (!content) {
+ // Extract text from all assistant messages in the agent_end payload
+ content = data.messages
+ .filter((m: any) => m.role === "assistant")
+ .flatMap((m: any) => (m.content || [])
+ .filter((c: any) => c.type === "text")
+ .map((c: any) => c.text))
+ .join("\n\n");
+ }
+ }
+
+ // Surface credits_exhausted / rate limit errors from agent_end
+ if (agentEndError && !content) {
+ const errStr = agentEndError;
+ if (errStr.includes("credits_exhausted") || errStr.includes("daily_limit_exceeded") || errStr.includes("429")) {
+ try {
+ const resetsAtMatch = errStr.match(/"resets_at":\s*"([^"]+)"/);
+ if (resetsAtMatch) setUpgradeResetsAt(resetsAtMatch[1]);
+ } catch {}
+ setUpgradeReason("daily_limit");
+ content = "You've used all your free queries for today.";
+ } else if (errStr.includes("rate limit")) {
+ setUpgradeReason("rate_limit");
+ content = "Rate limited — try again in a moment.";
+ } else {
+ content = `Error: ${errStr}`;
+ }
+ }
+
+ // Snapshot refs BEFORE setMessages — React's batching may defer the
+ // functional updater until after the refs are cleared below.
+ const blocksSnapshot = [...piContentBlocksRef.current];
+ const streamedText = piStreamingTextRef.current;
+
+ // Check if content was already set by error handlers above
+ setMessages((prev) => {
+ const existing = prev.find((m) => m.id === msgId);
+ // Don't overwrite error messages with "Done" or empty content
+ const isErrorMessage = existing?.content?.includes("used all your free queries") ||
+ existing?.content?.includes("requires an upgrade") ||
+ existing?.content?.includes("Rate limited") ||
+ existing?.content?.includes("rate limit") ||
+ existing?.content?.startsWith("Error:");
+ if (isErrorMessage) {
+ return prev;
+ }
+ // Don't overwrite if we have no new content and existing isn't "Processing..."
+ if (existing && existing.content !== "Processing..." && !content) {
+ return prev;
+ }
+ const contentBlocks = [...blocksSnapshot];
+ // If no text content but we have tool/thinking blocks, don't show "no response"
+ const hasNonTextBlocks = contentBlocks.some((b) => b.type === "tool" || b.type === "thinking");
+ if (!content && hasNonTextBlocks) {
+ content = ""; // empty — tool/thinking blocks will render
+ } else if (!content) {
+ const provider = activePreset?.provider;
+ if (provider === "native-ollama") {
+ content = "No response — is Ollama running? Start it with `ollama serve` and make sure the model is pulled.";
+ } else {
+ content = "No response from model — try again or check your AI preset in settings.";
+ }
+ }
+ // Add text as a content block if no text block exists yet
+ const hasTextBlock = contentBlocks.some((b) => b.type === "text");
+ if (!streamedText && content && !hasTextBlock) {
+ contentBlocks.push({ type: "text", text: content });
+ }
+ return prev.map((m) => m.id === msgId ? { ...m, content, contentBlocks } : m);
+ });
+ }
+ if (!isPipeWatch) {
+ piStreamingTextRef.current = "";
+ piMessageIdRef.current = null;
+ piContentBlocksRef.current = [];
+ piThinkingStartRef.current = null;
+ followUpFiredRef.current = false;
+ setIsLoading(false);
+ setIsStreaming(false);
+ }
+ } else if (data.type === "response" && data.success === false) {
+ const errorStr = data.error || "Unknown error";
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+
+ if (errorStr.includes("daily_limit_exceeded") || errorStr.includes("429") || errorStr.includes("rate limit")) {
+ const isDailyLimit = errorStr.includes("daily_limit_exceeded");
+ const isPerMinuteRate = errorStr.includes("rate limit exceeded") || errorStr.includes("requests per minute");
+ if (isDailyLimit) {
+ try {
+ const match = errorStr.match(/"resets_at":\s*"([^"]+)"/);
+ if (match) setUpgradeResetsAt(match[1]);
+ } catch {}
+ setUpgradeReason("daily_limit");
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "You've used all your free queries for today." } : m)
+ );
+ } else {
+ setUpgradeReason("rate_limit");
+ const waitMatch = errorStr.match(/wait (\d+) seconds/i);
+ const waitTime = waitMatch ? waitMatch[1] : "a moment";
+ const content = isPerMinuteRate
+ ? `Rate limited — please wait ${waitTime} seconds and try again.`
+ : "Rate limited — try again in a moment or switch to a different model.";
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content } : m)
+ );
+ }
+ } else if (errorStr.includes("model_not_allowed")) {
+ setUpgradeReason("model_not_allowed");
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "This model requires an upgrade." } : m)
+ );
+ } else {
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: `Error: ${errorStr}` } : m)
+ );
+ }
+ }
+ piStreamingTextRef.current = "";
+ if (piMessageIdRef.current?.startsWith("pipe-")) setActivePipeExecution(null);
+ piMessageIdRef.current = null;
+ piContentBlocksRef.current = [];
+ setIsLoading(false);
+ setIsStreaming(false);
+ } else if (data.type === "pipe_done") {
+ // Pipe execution finished — clean up streaming state
+ if (piMessageIdRef.current?.startsWith("pipe-")) {
+ const msgId = piMessageIdRef.current;
+ const content = piStreamingTextRef.current || "Pipe completed with no output.";
+ const blocksSnapshot = [...piContentBlocksRef.current];
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content, contentBlocks: blocksSnapshot } : m)
+ );
+ piStreamingTextRef.current = "";
+ piMessageIdRef.current = null;
+ piContentBlocksRef.current = [];
+ piThinkingStartRef.current = null;
+ setActivePipeExecution(null);
+ setIsLoading(false);
+ setIsStreaming(false);
+ }
+ }
+ };
+
+ const setup = async () => {
+ unlistenEvent = await listen<any>("pi_event", (event) => {
+ if (!mounted) return;
+ const { sessionId, event: piEvent } = event.payload;
+ if (sessionId !== PI_CHAT_SESSION) return;
+ handlePiEventData(piEvent);
+ });
+
+ // Listen for pipe execution events (only when actively watching a pipe)
+ unlistenPipeEvent = await listen<any>("pipe_event", (event) => {
+ if (!mounted) return;
+ // Only process events for the pipe we're actively watching
+ if (!piMessageIdRef.current?.startsWith("pipe-")) return;
+ const payload = event.payload;
+ const piEvent = payload?.event;
+ if (!piEvent) return;
+
+ handlePiEventData(piEvent);
+ });
+
+ unlistenTerminated = await listen<any>("pi_terminated", (event) => {
+ if (!mounted) return;
+ const { sessionId, pid: terminatedPid } = event.payload;
+ if (sessionId !== PI_CHAT_SESSION) return;
+ if (piStoppedIntentionallyRef.current) {
+ piStoppedIntentionallyRef.current = false;
+ return;
+ }
+ console.log("[Pi] Process terminated, pid:", terminatedPid);
+
+ // If a message was in flight, mark it as errored so the UI doesn't stay stuck
+ if (piMessageIdRef.current) {
+ const msgId = piMessageIdRef.current;
+ setMessages((prev) =>
+ prev.map((m) =>
+ m.id === msgId && (m.content === "Processing..." || !m.content)
+ ? { ...m, content: "AI agent crashed — restarting automatically..." }
+ : m
+ )
+ );
+ piStreamingTextRef.current = "";
+ piMessageIdRef.current = null;
+ piContentBlocksRef.current = [];
+ setIsLoading(false);
+ setIsStreaming(false);
+ }
+
+ // Always auto-restart — Pi is a singleton, keep it alive
+ const delay = 1500;
+ setTimeout(async () => {
+ if (!mounted) return;
+ // Check if a newer Pi process is already running (race: stop → start → terminated)
+ try {
+ const result = await commands.piInfo(PI_CHAT_SESSION);
+ if (result.status === "ok" && result.data.running && result.data.pid !== terminatedPid) {
+ console.log("[Pi] Stale termination for pid", terminatedPid, "— newer pid", result.data.pid, "is running");
+ setPiInfo(result.data);
+ return;
+ }
+ } catch {}
+
+ if (!piStartInFlightRef.current) {
+ console.log("[Pi] Auto-restarting after crash");
+ try {
+ const providerConfig = buildProviderConfig();
+ const home = await homeDir();
+ const dir = await join(home, ".screenpipe", "pi-chat");
+ const result = await commands.piStart(PI_CHAT_SESSION, dir, settings.user?.token ?? null, providerConfig);
+ if (result.status === "ok") {
+ setPiInfo(result.data);
+ piSessionSyncedRef.current = false;
+ // Keep running-config ref in sync so preset watcher doesn't re-trigger
+ if (providerConfig) {
+ piRunningConfigRef.current = { provider: providerConfig.provider, model: providerConfig.model, token: settings.user?.token ?? null };
+ }
+ } else {
+ console.error("[Pi] Auto-restart failed:", result.error);
+ // Don't give up — user can still trigger restart on next message
+ setPiInfo(null);
+ }
+ } catch (e) {
+ console.error("[Pi] Auto-restart exception:", e);
+ setPiInfo(null);
+ }
+ }
+ }, delay);
+ });
+ // Listen for Pi stderr — only surface errors when user is actively waiting for a response
+ unlistenLog = await listen<string>("pi_log", (event) => {
+ if (!mounted) return;
+ // Only show errors if user sent a message and is waiting — not during background startup/restart
+ if (!piMessageIdRef.current) return;
+ const line = event.payload;
+ if (line.includes("model_not_allowed") || line.includes("403")) {
+ const msgId = piMessageIdRef.current;
+ setUpgradeReason("model_not_allowed");
+ if (msgId) {
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "This model requires an upgrade — try a different model in your AI preset." } : m)
+ );
+ }
+ } else if (line.includes("429") || line.includes("rate") || line.includes("daily_limit")) {
+ const msgId = piMessageIdRef.current;
+ if (msgId) {
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "Rate limited — try again in a moment or switch to a different model." } : m)
+ );
+ }
+ } else if (line.includes("content must be a string") || line.includes("does not support images") || line.includes("image_url is not supported")) {
+ const msgId = piMessageIdRef.current;
+ if (msgId) {
+ setMessages((prev) =>
+ prev.map((m) => m.id === msgId ? { ...m, content: "This model doesn't support images — try a vision-capable model (e.g. llama-4-scout on Groq, gpt-4o on OpenAI)." } : m)
+ );
+ }
+ } else if (line.includes("not found") || line.includes("ECONNREFUSED") || line.includes("connection refused")) {
+ let hint = line;
+ if (line.includes("not found")) {
+ hint = `Model not found: ${line}. Check your AI preset in settings.`;
+ } else if (line.includes("ECONNREFUSED") || line.includes("connection refused")) {
+ hint = "Cannot connect to Ollama — is it running? Start with: ollama serve";
+ }
+ toast({ title: "Pi agent error", description: hint, variant: "destructive" });
+ }
+ });
+ };
+
+ setup();
+
+ return () => {
+ mounted = false;
+ unlistenEvent?.();
+ unlistenPipeEvent?.();
+ unlistenTerminated?.();
+ unlistenLog?.();
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
// Watch pipe: set up tracking from either Tauri event or sessionStorage (for cross-page navigation)
useEffect(() => {
@@ -1175,23 +2232,25 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
piContentBlocksRef.current = [];
piThinkingStartRef.current = null;
piMessageIdRef.current = msgId;
- // Clear previous messages and reset conversation so pipe history doesn't bleed across pipes
- setConversationId(null);
- setMessages([
- {
- id: `pipe-user-${executionId}`,
- role: "user" as const,
- content: `Watching pipe: ${pipeName}`,
- timestamp: Date.now(),
- },
- {
- id: msgId,
- role: "assistant" as const,
- content: "",
- timestamp: Date.now(),
- contentBlocks: [],
- },
- ]);
+ setMessages((prev) => {
+ if (prev.some((m) => m.id === msgId)) return prev;
+ return [
+ ...prev,
+ {
+ id: `pipe-user-${executionId}`,
+ role: "user" as const,
+ content: `Watching pipe: ${pipeName}`,
+ timestamp: Date.now(),
+ },
+ {
+ id: msgId,
+ role: "assistant" as const,
+ content: "",
+ timestamp: Date.now(),
+ contentBlocks: [],
+ },
+ ];
+ });
setIsStreaming(true);
// Poll immediately in case execution already finished before we started listening
@@ -1454,39 +2513,14 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
{ id: assistantMessageId, role: "assistant", content: "Processing...", timestamp: Date.now() },
]);
- // Parse @mention filters from the user message to scope Pi's search
- const mentionFilters = parseMentions(userMessage, { appTagMap });
- const filterInstructions: string[] = [];
- if (mentionFilters.appName) {
- filterInstructions.push(`- app_name="${mentionFilters.appName}" — ONLY search this app`);
- }
- if (mentionFilters.contentType) {
- if (mentionFilters.contentType === "screen") {
- filterInstructions.push(`- content_type: use "ocr" and "accessibility" (try both) — user wants screen text only, NO audio`);
- } else if (mentionFilters.contentType === "audio") {
- filterInstructions.push(`- content_type="audio" — user wants voice/meeting transcriptions only, NO screen text`);
- } else {
- filterInstructions.push(`- content_type="${mentionFilters.contentType}"`);
- }
- }
- if (mentionFilters.speakerName) {
- filterInstructions.push(`- speaker_name="${mentionFilters.speakerName}" — filter to this speaker`);
- }
- const filterPrefix = filterInstructions.length > 0
- ? `<MANDATORY_SEARCH_FILTERS>\nThe user has set explicit search filters. You MUST include these parameters in EVERY screenpipe_search call. Never omit them:\n${filterInstructions.join("\n")}\n</MANDATORY_SEARCH_FILTERS>\n\n`
- : "";
-
// If Pi's session is out of sync (restart, conversation load), inject history
- let promptMessage = filterPrefix + (mentionFilters.cleanedInput || userMessage);
- if (!promptMessage.trim() && piImages.length > 0) {
- promptMessage = "Please analyze this image.";
- }
+ let promptMessage = userMessage;
if (!piSessionSyncedRef.current && messages.length > 0) {
const historyLines = messages
.slice(-40)
.map(m => `${m.role}: ${m.content}`)
.join("\n");
- promptMessage = `<conversation_history>\n${historyLines}\n</conversation_history>\n\n${promptMessage}`;
+ promptMessage = `<conversation_history>\n${historyLines}\n</conversation_history>\n\n${userMessage}`;
piSessionSyncedRef.current = true;
} else {
piSessionSyncedRef.current = true;
@@ -1852,7 +2886,6 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
{/* Messages */}
<div
- ref={messagesContainerRef}
className="relative flex-1 overflow-y-auto overflow-x-hidden"
onContextMenu={(e) => {
if (messages.length === 0) return;
@@ -1936,8 +2969,6 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
<SummaryCards
onSendMessage={sendMessage}
autoSuggestions={autoSuggestions}
- suggestionsRefreshing={suggestionsRefreshing}
- onRefreshSuggestions={refreshSuggestions}
customTemplates={customTemplates}
onSaveCustomTemplate={saveCustomTemplate}
onDeleteCustomTemplate={deleteCustomTemplate}
@@ -1991,7 +3022,7 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
: "bg-muted/30 border-border/50"
)}
>
- <MessageContent message={message} onImageClick={setLightboxSrc} />
+ <MessageContent message={message} />
{/* Upgrade button for daily limit errors */}
{message.role === "assistant" &&
(message.content.includes("used all your free queries") ||
@@ -2091,198 +3122,22 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
</AnimatePresence>
<div ref={messagesEndRef} />
</div> {/* End of max-w-4xl wrapper */}
-
- {/* Scroll to bottom button */}
- <AnimatePresence>
- {showScrollButton && (
- <motion.button
- initial={{ opacity: 0, scale: 0.8 }}
- animate={{ opacity: 1, scale: 1 }}
- exit={{ opacity: 0, scale: 0.8 }}
- transition={{ duration: 0.15 }}
- onClick={() => messagesEndRef.current?.scrollIntoView({ behavior: "smooth" })}
- className="absolute bottom-3 right-3 z-10 w-8 h-8 flex items-center justify-center rounded-full border border-border bg-muted hover:bg-accent text-muted-foreground hover:text-foreground transition-colors shadow-md"
- title="Scroll to bottom"
- >
- <ArrowDown className="w-4 h-4" />
- </motion.button>
- )}
- </AnimatePresence>
</div>
</div> {/* End of main content area with history sidebar */}
{/* Input */}
<div className="relative border-t border-border/50 bg-gradient-to-t from-muted/20 to-transparent">
<div className="max-w-4xl mx-auto w-full">
- <div className="p-2 border-b border-border/30 flex items-center gap-2">
- <Popover open={appFilterOpen} onOpenChange={setAppFilterOpen}>
- <PopoverTrigger asChild>
- <button
- type="button"
- className={cn(
- "shrink-0 flex items-center gap-1 px-2 h-10 text-[11px] font-mono border rounded-md transition-colors",
- hasActiveFilters
- ? "border-foreground text-foreground"
- : "border-border text-muted-foreground hover:text-foreground hover:border-foreground"
- )}
- title="Search filters"
- >
- <Filter className="w-3 h-3" />
- <span>filter</span>
- {hasActiveFilters && (
- <span className="text-[10px] text-muted-foreground">
- ({(activeFilters.timeRanges.length > 0 ? 1 : 0) +
- (activeFilters.contentType ? 1 : 0) +
- (activeFilters.appName ? 1 : 0) +
- (activeFilters.speakerName ? 1 : 0)})
- </span>
- )}
- </button>
- </PopoverTrigger>
- <PopoverContent className="w-64 p-0 max-h-[360px] overflow-y-auto" align="start">
- {/* Time filters */}
- <div className="px-2 py-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground bg-muted/30 border-b border-border/50">
- time
- </div>
- {STATIC_MENTION_SUGGESTIONS.filter((s) => s.category === "time").map((s) => {
- const isActive = activeFilters.timeRanges.some((r) => r.label === s.description);
- return (
- <button
- key={s.tag}
- type="button"
- onClick={() => {
- if (isActive) {
- removeFilter("time", s.description);
- } else {
- setInput((prev) => `${s.tag} ${prev.trim()}`.trim() + " ");
- }
- setAppFilterOpen(false);
- }}
- className={cn(
- "w-full px-3 py-1.5 text-left text-xs font-mono hover:bg-muted/50 transition-colors flex items-center justify-between gap-2",
- isActive && "bg-muted"
- )}
- >
- <span>{s.tag}</span>
- <span className="text-[10px] text-muted-foreground">{s.description}</span>
- </button>
- );
- })}
-
- {/* Content type filters */}
- <div className="px-2 py-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground bg-muted/30 border-b border-border/50 border-t">
- content type
- </div>
- {STATIC_MENTION_SUGGESTIONS.filter((s) => s.category === "content").map((s) => {
- // @screen maps to "ocr", @audio to "audio", @input to "input"
- const contentTypeMap: Record<string, string> = { screen: "screen", audio: "audio", input: "input" };
- const tagName = s.tag.slice(1);
- const isActive = activeFilters.contentType === (contentTypeMap[tagName] || tagName);
- return (
- <button
- key={s.tag}
- type="button"
- onClick={() => {
- if (isActive) {
- removeFilter("content");
- } else {
- if (activeFilters.contentType) removeFilter("content");
- setInput((prev) => `${s.tag} ${prev.trim()}`.trim() + " ");
- }
- setAppFilterOpen(false);
- }}
- className={cn(
- "w-full px-3 py-1.5 text-left text-xs font-mono hover:bg-muted/50 transition-colors flex items-center justify-between gap-2",
- isActive && "bg-muted"
- )}
- >
- <span>{s.tag}</span>
- <span className="text-[10px] text-muted-foreground">{s.description}</span>
- </button>
- );
- })}
-
- {/* App filters (sorted by most used) */}
- <div className="px-2 py-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground bg-muted/30 border-b border-border/50 border-t">
- apps
- </div>
- {appMentionSuggestions.length === 0 ? (
- <div className="px-3 py-2 text-[10px] text-muted-foreground">no apps detected yet</div>
- ) : (
- appMentionSuggestions.map((suggestion) => {
- const isActive = activeFilters.appName === suggestion.appName;
- return (
- <button
- key={suggestion.tag}
- type="button"
- onClick={() => {
- if (isActive) {
- removeFilter("app");
- } else {
- if (activeFilters.appName) removeFilter("app");
- setInput((prev) => `${suggestion.tag} ${prev.trim()}`.trim() + " ");
- }
- setAppFilterOpen(false);
- }}
- className={cn(
- "w-full px-3 py-1.5 text-left text-xs font-mono hover:bg-muted/50 transition-colors flex items-center justify-between gap-2",
- isActive && "bg-muted"
- )}
- >
- <span>{suggestion.tag}</span>
- <span className="text-[10px] text-muted-foreground truncate">{suggestion.description}</span>
- </button>
- );
- })
- )}
-
- {/* Speakers */}
- {recentSpeakers.length > 0 && (
- <>
- <div className="px-2 py-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground bg-muted/30 border-b border-border/50 border-t">
- speakers
- </div>
- {recentSpeakers.map((s) => {
- const speakerName = s.tag.startsWith('@"') ? s.tag.slice(2, -1) : s.tag.slice(1);
- const isActive = activeFilters.speakerName === speakerName;
- return (
- <button
- key={s.tag}
- type="button"
- onClick={() => {
- if (isActive) {
- removeFilter("speaker");
- } else {
- if (activeFilters.speakerName) removeFilter("speaker");
- setInput((prev) => `${s.tag} ${prev.trim()}`.trim() + " ");
- }
- setAppFilterOpen(false);
- }}
- className={cn(
- "w-full px-3 py-1.5 text-left text-xs font-mono hover:bg-muted/50 transition-colors flex items-center justify-between gap-2",
- isActive && "bg-muted"
- )}
- >
- <span>{s.tag}</span>
- <span className="text-[10px] text-muted-foreground">speaker</span>
- </button>
- );
- })}
- </>
- )}
- </PopoverContent>
- </Popover>
- <div className="flex-1 min-w-0">
- <AIPresetsSelector
- onPresetChange={setActivePreset}
- controlledPresetId={activePipeExecution ? activePreset?.id : undefined}
- onControlledSelect={activePipeExecution ? (id) => {
- const match = settings.aiPresets?.find((p) => p.id === id);
- if (match) setActivePreset(match);
- } : undefined}
- showLoginCta={false}
- />
- </div>
+ <div className="p-2 border-b border-border/30">
+ <AIPresetsSelector
+ onPresetChange={setActivePreset}
+ controlledPresetId={activePipeExecution ? activePreset?.id : undefined}
+ onControlledSelect={activePipeExecution ? (id) => {
+ const match = settings.aiPresets?.find((p) => p.id === id);
+ if (match) setActivePreset(match);
+ } : undefined}
+ showLoginCta={false}
+ />
</div>
{/* Prefill context indicator from search */}
@@ -2340,40 +3195,44 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
key={`time-${idx}`}
type="button"
onClick={() => removeFilter("time", range.label)}
- className="inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-mono font-medium text-foreground border border-border hover:bg-muted transition-colors"
+ className="inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20 rounded-full hover:bg-blue-500/20 transition-colors"
>
+ <span>🕐</span>
<span>{range.label}</span>
- <X className="w-2.5 h-2.5 ml-0.5 text-muted-foreground" />
+ <X className="w-2.5 h-2.5 ml-0.5" />
</button>
))}
{activeFilters.contentType && (
<button
type="button"
onClick={() => removeFilter("content")}
- className="inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-mono font-medium text-foreground border border-border hover:bg-muted transition-colors"
+ className="inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 border border-purple-500/20 rounded-full hover:bg-purple-500/20 transition-colors"
>
- <span>{activeFilters.contentType === "audio" ? "voice & meetings" : activeFilters.contentType === "input" ? "clicks & keystrokes" : "what's on screen"}</span>
- <X className="w-2.5 h-2.5 ml-0.5 text-muted-foreground" />
+ <span>{activeFilters.contentType === "audio" ? "🎤" : "🖥️"}</span>
+ <span>{activeFilters.contentType}</span>
+ <X className="w-2.5 h-2.5 ml-0.5" />
</button>
)}
{activeFilters.appName && (
<button
type="button"
onClick={() => removeFilter("app")}
- className="inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-mono font-medium text-foreground border border-border hover:bg-muted transition-colors"
+ className="inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 border border-green-500/20 rounded-full hover:bg-green-500/20 transition-colors"
>
+ <span>📱</span>
<span>{activeFilters.appName}</span>
- <X className="w-2.5 h-2.5 ml-0.5 text-muted-foreground" />
+ <X className="w-2.5 h-2.5 ml-0.5" />
</button>
)}
{activeFilters.speakerName && (
<button
type="button"
onClick={() => removeFilter("speaker")}
- className="inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-mono font-medium text-foreground border border-border hover:bg-muted transition-colors"
+ className="inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium bg-orange-500/10 text-orange-600 dark:text-orange-400 border border-orange-500/20 rounded-full hover:bg-orange-500/20 transition-colors"
>
+ <span>👤</span>
<span>{activeFilters.speakerName}</span>
- <X className="w-2.5 h-2.5 ml-0.5 text-muted-foreground" />
+ <X className="w-2.5 h-2.5 ml-0.5" />
</button>
)}
</div>
@@ -2407,33 +3266,18 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
</AnimatePresence>
{/* Auto-suggestions above input */}
- {!isLoading && messages.length > 0 && autoSuggestions.length > 0 && (
- <div className="px-3 pt-2 flex flex-wrap items-center gap-1.5">
- <AnimatePresence mode="popLayout">
- {autoSuggestions.slice(0, 3).map((s, i) => (
- <motion.button
- key={s.text}
- layout
- initial={{ opacity: 0, scale: 0.95 }}
- animate={{ opacity: 1, scale: 1 }}
- exit={{ opacity: 0, scale: 0.95 }}
- transition={{ duration: 0.15, delay: i * 0.03 }}
- type="button"
- onClick={() => sendMessage(s.text)}
- className="px-2.5 py-1 font-mono text-[11px] bg-muted/20 hover:bg-foreground hover:text-background border border-border/20 hover:border-foreground text-muted-foreground transition-all duration-150 cursor-pointer"
- >
- {s.text}
- </motion.button>
- ))}
- </AnimatePresence>
- <button
- onClick={refreshSuggestions}
- disabled={suggestionsRefreshing}
- className="p-1 text-muted-foreground/30 hover:text-foreground transition-colors duration-150 disabled:opacity-30 cursor-pointer"
- title="refresh suggestions"
- >
- <RefreshCw className={`w-3.5 h-3.5 ${suggestionsRefreshing ? "animate-spin" : ""}`} strokeWidth={1.5} />
- </button>
+ {messages.length > 0 && !isLoading && autoSuggestions.length > 0 && (
+ <div className="px-3 pt-2 flex flex-wrap gap-1.5">
+ {autoSuggestions.slice(0, 3).map((s, i) => (
+ <button
+ key={i}
+ type="button"
+ onClick={() => sendMessage(s.text)}
+ className="px-2.5 py-1 text-[11px] bg-muted/20 hover:bg-muted/50 rounded-full border border-border/20 hover:border-border/50 text-muted-foreground hover:text-foreground transition-colors cursor-pointer"
+ >
+ {s.text}
+ </button>
+ ))}
</div>
)}
@@ -2613,20 +3457,6 @@ export function StandaloneChat({ className }: { className?: string } = {}) {
responsePreview={scheduleDialogMessage.response}
/>
)}
-
- {/* Image lightbox */}
- <Dialog open={!!lightboxSrc} onOpenChange={(open) => !open && setLightboxSrc(null)}>
- <DialogContent className="max-w-[90vw] max-h-[90vh] p-0 border-none bg-transparent shadow-none [&>button]:text-white [&>button]:bg-black/50 [&>button]:rounded-full">
- {lightboxSrc && (
- // eslint-disable-next-line @next/next/no-img-element
- <img
- src={lightboxSrc}
- alt="Full size preview"
- className="max-w-[90vw] max-h-[90vh] object-contain"
- />
- )}
- </DialogContent>
- </Dialog>
</div>
);
}
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index 7d19417cf..903b9f8b5 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -125,8 +125,6 @@ export type Settings = SettingsStore & {
openaiCompatibleModel?: string;
/** Filter music-dominant audio before transcription (reduces Spotify/YouTube music noise) */
filterMusic?: boolean;
- /** When true, chat window stays above all other windows */
- chatAlwaysOnTop?: boolean;
}
export function getEffectiveFilters(settings: Settings) {
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index ddd50f1e8..3c09346f0 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -214,33 +214,8 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
dependencies = [
- "crypto-common 0.1.7",
- "generic-array 0.14.7",
-]
-
-[[package]]
-name = "aes"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
-dependencies = [
- "cfg-if 1.0.4",
- "cipher",
- "cpufeatures",
-]
-
-[[package]]
-name = "aes-gcm"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1"
-dependencies = [
- "aead",
- "aes",
- "cipher",
- "ctr",
- "ghash",
- "subtle",
+ "crypto-common",
+ "generic-array",
]
[[package]]
@@ -250,7 +225,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
dependencies = [
"cfg-if 1.0.4",
- "const-random",
"getrandom 0.3.4",
"once_cell",
"version_check",
@@ -897,29 +871,6 @@ dependencies = [
"arrayvec",
]
-[[package]]
-name = "aws-lc-rs"
-version = "1.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94bffc006df10ac2a68c83692d734a465f8ee6c5b384d8545a636f81d858f4bf"
-dependencies = [
- "aws-lc-sys",
- "untrusted 0.7.1",
- "zeroize",
-]
-
-[[package]]
-name = "aws-lc-sys"
-version = "0.38.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4321e568ed89bb5a7d291a7f37997c2c0df89809d7b6d12062c81ddb54aa782e"
-dependencies = [
- "cc",
- "cmake",
- "dunce",
- "fs_extra",
-]
-
[[package]]
name = "axum"
version = "0.6.20"
@@ -979,7 +930,7 @@ dependencies = [
"serde_json",
"serde_path_to_error",
"serde_urlencoded",
- "sha1 0.10.6",
+ "sha1",
"sync_wrapper 1.0.2",
"tokio",
"tokio-tungstenite 0.24.0",
@@ -1042,18 +993,6 @@ dependencies = [
"windows-link 0.2.1",
]
-[[package]]
-name = "base16ct"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
-
-[[package]]
-name = "base16ct"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd307490d624467aa6f74b0eabb77633d1f758a7b25f12bceb0b22e08d9726f6"
-
[[package]]
name = "base64"
version = "0.21.7"
@@ -1072,17 +1011,6 @@ version = "1.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
-[[package]]
-name = "bcrypt-pbkdf"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6aeac2e1fe888769f34f05ac343bbef98b14d1ffb292ab69d4608b3abc86f2a2"
-dependencies = [
- "blowfish",
- "pbkdf2",
- "sha2 0.10.9",
-]
-
[[package]]
name = "bincode"
version = "1.3.3"
@@ -1202,7 +1130,7 @@ version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
dependencies = [
- "digest 0.10.7",
+ "digest",
]
[[package]]
@@ -1217,25 +1145,7 @@ version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
- "generic-array 0.14.7",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdd35008169921d80bc60d3d0ab416eecb028c4cd653352907921d95084790be"
-dependencies = [
- "hybrid-array",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
-dependencies = [
- "generic-array 0.14.7",
+ "generic-array",
]
[[package]]
@@ -1269,16 +1179,6 @@ dependencies = [
"piper",
]
-[[package]]
-name = "blowfish"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7"
-dependencies = [
- "byteorder",
- "cipher",
-]
-
[[package]]
name = "brotli"
version = "8.0.2"
@@ -1446,15 +1346,6 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
-[[package]]
-name = "cbc"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6"
-dependencies = [
- "cipher",
-]
-
[[package]]
name = "cc"
version = "1.2.56"
@@ -1643,7 +1534,7 @@ version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
dependencies = [
- "crypto-common 0.1.7",
+ "crypto-common",
"inout",
"zeroize",
]
@@ -1717,12 +1608,6 @@ dependencies = [
"cc",
]
-[[package]]
-name = "cmov"
-version = "0.5.0-pre.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5417da527aa9bf6a1e10a781231effd1edd3ee82f27d5f8529ac9b279babce96"
-
[[package]]
name = "cocoa"
version = "0.20.2"
@@ -1847,12 +1732,6 @@ version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
-[[package]]
-name = "const-oid"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"
-
[[package]]
name = "const-random"
version = "0.1.18"
@@ -2058,17 +1937,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "core-models"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0940496e5c83c54f3b753d5317daec82e8edac71c33aaa1f666d76f518de2444"
-dependencies = [
- "hax-lib",
- "pastey",
- "rand 0.9.2",
-]
-
[[package]]
name = "core-video-sys"
version = "0.1.4"
@@ -2312,62 +2180,17 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
-[[package]]
-name = "crypto-bigint"
-version = "0.5.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76"
-dependencies = [
- "generic-array 0.14.7",
- "rand_core 0.6.4",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "crypto-bigint"
-version = "0.7.0-rc.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37387ceb32048ff590f2cbd24d8b05fffe63c3f69a5cfa089d4f722ca4385a19"
-dependencies = [
- "ctutils",
- "num-traits",
- "rand_core 0.10.0-rc-3",
- "serdect",
- "zeroize",
-]
-
[[package]]
name = "crypto-common"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
dependencies = [
- "generic-array 0.14.7",
+ "generic-array",
"rand_core 0.6.4",
"typenum",
]
-[[package]]
-name = "crypto-common"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77727bb15fa921304124b128af125e7e3b968275d1b108b379190264f4423710"
-dependencies = [
- "hybrid-array",
-]
-
-[[package]]
-name = "crypto-primes"
-version = "0.7.0-pre.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e79c98a281f9441200b24e3151407a629bfbe720399186e50516da939195e482"
-dependencies = [
- "crypto-bigint 0.7.0-rc.18",
- "libm",
- "rand_core 0.10.0-rc-3",
-]
-
[[package]]
name = "cssparser"
version = "0.29.6"
@@ -2405,51 +2228,6 @@ dependencies = [
"syn 2.0.117",
]
-[[package]]
-name = "ctr"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
-dependencies = [
- "cipher",
-]
-
-[[package]]
-name = "ctutils"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "758e5ed90be3c8abff7f9a6f37ab7f6d8c59c2210d448b81f3f508134aec84e4"
-dependencies = [
- "cmov",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "4.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
-dependencies = [
- "cfg-if 1.0.4",
- "cpufeatures",
- "curve25519-dalek-derive",
- "digest 0.10.7",
- "fiat-crypto",
- "rustc_version",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "curve25519-dalek-derive"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.117",
-]
-
[[package]]
name = "dark-light"
version = "2.0.0"
@@ -2568,36 +2346,14 @@ dependencies = [
"uuid",
]
-[[package]]
-name = "delegate"
-version = "0.13.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "780eb241654bf097afb00fc5f054a09b687dad862e485fdcf8399bb056565370"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.117",
-]
-
[[package]]
name = "der"
version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
dependencies = [
- "const-oid 0.9.6",
- "pem-rfc7468 0.7.0",
- "zeroize",
-]
-
-[[package]]
-name = "der"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b"
-dependencies = [
- "const-oid 0.10.2",
- "pem-rfc7468 1.0.0",
+ "const-oid",
+ "pem-rfc7468",
"zeroize",
]
@@ -2664,23 +2420,12 @@ version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
- "block-buffer 0.10.4",
- "const-oid 0.9.6",
- "crypto-common 0.1.7",
+ "block-buffer",
+ "const-oid",
+ "crypto-common",
"subtle",
]
-[[package]]
-name = "digest"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "285743a676ccb6b3e116bc14cc69319b957867930ae9c4822f8e0f54509d7243"
-dependencies = [
- "block-buffer 0.12.0",
- "const-oid 0.10.2",
- "crypto-common 0.2.1",
-]
-
[[package]]
name = "dirs"
version = "4.0.0"
@@ -2910,45 +2655,6 @@ version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
-[[package]]
-name = "ecdsa"
-version = "0.16.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca"
-dependencies = [
- "der 0.7.10",
- "digest 0.10.7",
- "elliptic-curve",
- "rfc6979",
- "signature 2.2.0",
- "spki 0.7.3",
-]
-
-[[package]]
-name = "ed25519"
-version = "2.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
-dependencies = [
- "pkcs8 0.10.2",
- "signature 2.2.0",
-]
-
-[[package]]
-name = "ed25519-dalek"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9"
-dependencies = [
- "curve25519-dalek",
- "ed25519",
- "rand_core 0.6.4",
- "serde",
- "sha2 0.10.9",
- "subtle",
- "zeroize",
-]
-
[[package]]
name = "either"
version = "1.15.0"
@@ -2958,27 +2664,6 @@ dependencies = [
"serde",
]
-[[package]]
-name = "elliptic-curve"
-version = "0.13.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47"
-dependencies = [
- "base16ct 0.2.0",
- "crypto-bigint 0.5.5",
- "digest 0.10.7",
- "ff",
- "generic-array 0.14.7",
- "group",
- "hkdf",
- "pem-rfc7468 0.7.0",
- "pkcs8 0.10.2",
- "rand_core 0.6.4",
- "sec1",
- "subtle",
- "zeroize",
-]
-
[[package]]
name = "embed-resource"
version = "3.0.6"
@@ -3020,18 +2705,6 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
-[[package]]
-name = "enum_dispatch"
-version = "0.3.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd"
-dependencies = [
- "once_cell",
- "proc-macro2",
- "quote",
- "syn 2.0.117",
-]
-
[[package]]
name = "enumflags2"
version = "0.7.12"
@@ -3274,16 +2947,6 @@ dependencies = [
"simd-adler32",
]
-[[package]]
-name = "ff"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393"
-dependencies = [
- "rand_core 0.6.4",
- "subtle",
-]
-
[[package]]
name = "ffmpeg-sidecar"
version = "2.3.0"
@@ -3296,12 +2959,6 @@ dependencies = [
"zip",
]
-[[package]]
-name = "fiat-crypto"
-version = "0.2.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
-
[[package]]
name = "field-offset"
version = "0.3.6"
@@ -3392,18 +3049,6 @@ dependencies = [
"spin",
]
-[[package]]
-name = "flurry"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf5efcf77a4da27927d3ab0509dec5b0954bb3bc59da5a1de9e52642ebd4cdf9"
-dependencies = [
- "ahash",
- "num_cpus",
- "parking_lot",
- "seize",
-]
-
[[package]]
name = "fnv"
version = "1.0.7"
@@ -3799,18 +3444,6 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
- "zeroize",
-]
-
-[[package]]
-name = "generic-array"
-version = "1.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eaf57c49a95fd1fe24b90b3033bee6dc7e8f1288d51494cb44e627c295e38542"
-dependencies = [
- "generic-array 0.14.7",
- "rustversion",
- "typenum",
]
[[package]]
@@ -3894,16 +3527,6 @@ dependencies = [
"temp-dir",
]
-[[package]]
-name = "ghash"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1"
-dependencies = [
- "opaque-debug",
- "polyval",
-]
-
[[package]]
name = "gif"
version = "0.13.3"
@@ -4087,17 +3710,6 @@ dependencies = [
"scroll",
]
-[[package]]
-name = "group"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
-dependencies = [
- "ff",
- "rand_core 0.6.4",
- "subtle",
-]
-
[[package]]
name = "gtk"
version = "0.18.2"
@@ -4222,43 +3834,6 @@ dependencies = [
"hashbrown 0.14.5",
]
-[[package]]
-name = "hax-lib"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74d9ba66d1739c68e0219b2b2238b5c4145f491ebf181b9c6ab561a19352ae86"
-dependencies = [
- "hax-lib-macros",
- "num-bigint",
- "num-traits",
-]
-
-[[package]]
-name = "hax-lib-macros"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24ba777a231a58d1bce1d68313fa6b6afcc7966adef23d60f45b8a2b9b688bf1"
-dependencies = [
- "hax-lib-macros-types",
- "proc-macro-error2",
- "proc-macro2",
- "quote",
- "syn 2.0.117",
-]
-
-[[package]]
-name = "hax-lib-macros-types"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "867e19177d7425140b417cd27c2e05320e727ee682e98368f88b7194e80ad515"
-dependencies = [
- "proc-macro2",
- "quote",
- "serde",
- "serde_json",
- "uuid",
-]
-
[[package]]
name = "heck"
version = "0.4.1"
@@ -4286,12 +3861,6 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-[[package]]
-name = "hex-literal"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
-
[[package]]
name = "hf-hub"
version = "0.3.2"
@@ -4348,7 +3917,7 @@ version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
dependencies = [
- "digest 0.10.7",
+ "digest",
]
[[package]]
@@ -4474,15 +4043,6 @@ version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424"
-[[package]]
-name = "hybrid-array"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1b229d73f5803b562cc26e4da0396c8610a4ee209f4fac8fa4f8d709166dc45"
-dependencies = [
- "typenum",
-]
-
[[package]]
name = "hyper"
version = "0.14.32"
@@ -4926,39 +4486,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
dependencies = [
- "block-padding",
- "generic-array 0.14.7",
-]
-
-[[package]]
-name = "internal-russh-forked-ssh-key"
-version = "0.6.16+upstream-0.6.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe44f2bbd99fcb302e246e2d6bcf51aeda346d02a365f80296a07a8c711b6da6"
-dependencies = [
- "argon2",
- "bcrypt-pbkdf",
- "digest 0.11.1",
- "ecdsa",
- "ed25519-dalek",
- "hex",
- "hmac",
- "num-bigint-dig",
- "p256",
- "p384",
- "p521",
- "rand_core 0.6.4",
- "rsa 0.10.0-rc.12",
- "sec1",
- "sha1 0.10.6",
- "sha1 0.11.0-rc.5",
- "sha2 0.10.9",
- "signature 2.2.0",
- "signature 3.0.0-rc.6",
- "ssh-cipher",
- "ssh-encoding",
- "subtle",
- "zeroize",
+ "generic-array",
]
[[package]]
@@ -5200,9 +4728,8 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
[[package]]
name = "knf-rs"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15ebe7cf9eae245a44ab76cabdd06c0b3769972fd06050ed9aea6a22ff0d682f"
+version = "0.2.4"
+source = "git+https://github.com/Neptune650/knf-rs.git#b782e6bb02db495ce767f0094c0aa6bca5dba61c"
dependencies = [
"eyre",
"knf-rs-sys",
@@ -5211,9 +4738,8 @@ dependencies = [
[[package]]
name = "knf-rs-sys"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9aa7679fdc0ecdaab1f4e7c9603413f303765f33c8e34e6ca4f26e7d61d6023"
+version = "0.2.4"
+source = "git+https://github.com/Neptune650/knf-rs.git#b782e6bb02db495ce767f0094c0aa6bca5dba61c"
dependencies = [
"bindgen 0.69.5",
"cmake",
@@ -5334,72 +4860,6 @@ version = "0.2.182"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112"
-[[package]]
-name = "libcrux-intrinsics"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc9ee7ef66569dd7516454fe26de4e401c0c62073929803486b96744594b9632"
-dependencies = [
- "core-models",
- "hax-lib",
-]
-
-[[package]]
-name = "libcrux-ml-kem"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4bb6a88086bf11bd2ec90926c749c4a427f2e59841437dbdede8cde8a96334ab"
-dependencies = [
- "hax-lib",
- "libcrux-intrinsics",
- "libcrux-platform",
- "libcrux-secrets",
- "libcrux-sha3",
- "libcrux-traits",
- "rand 0.9.2",
- "tls_codec",
-]
-
-[[package]]
-name = "libcrux-platform"
-version = "0.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db82d058aa76ea315a3b2092f69dfbd67ddb0e462038a206e1dcd73f058c0778"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "libcrux-secrets"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e4dbbf6bc9f2bc0f20dc3bea3e5c99adff3bdccf6d2a40488963da69e2ec307"
-dependencies = [
- "hax-lib",
-]
-
-[[package]]
-name = "libcrux-sha3"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2400bec764d1c75b8a496d5747cffe32f1fb864a12577f0aca2f55a92021c962"
-dependencies = [
- "hax-lib",
- "libcrux-intrinsics",
- "libcrux-platform",
- "libcrux-traits",
-]
-
-[[package]]
-name = "libcrux-traits"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9adfd58e79d860f6b9e40e35127bfae9e5bd3ade33201d1347459011a2add034"
-dependencies = [
- "libcrux-secrets",
- "rand 0.9.2",
-]
-
[[package]]
name = "libfuzzer-sys"
version = "0.4.12"
@@ -5775,7 +5235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
dependencies = [
"cfg-if 1.0.4",
- "digest 0.10.7",
+ "digest",
]
[[package]]
@@ -6290,7 +5750,6 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
- "rand 0.8.5",
]
[[package]]
@@ -6305,7 +5764,6 @@ dependencies = [
"num-iter",
"num-traits",
"rand 0.8.5",
- "serde",
"smallvec",
"zeroize",
]
@@ -7098,7 +6556,7 @@ checksum = "b4174960a7b93a17564a05b26e05889f0dea9ee70e68db5841f27b40c0c9804e"
dependencies = [
"flate2",
"pkg-config",
- "sha2 0.10.9",
+ "sha2",
"tar",
"ureq 2.12.1",
]
@@ -7152,63 +6610,6 @@ dependencies = [
"ttf-parser",
]
-[[package]]
-name = "p256"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b"
-dependencies = [
- "ecdsa",
- "elliptic-curve",
- "primeorder",
- "sha2 0.10.9",
-]
-
-[[package]]
-name = "p384"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6"
-dependencies = [
- "ecdsa",
- "elliptic-curve",
- "primeorder",
- "sha2 0.10.9",
-]
-
-[[package]]
-name = "p521"
-version = "0.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2"
-dependencies = [
- "base16ct 0.2.0",
- "ecdsa",
- "elliptic-curve",
- "primeorder",
- "rand_core 0.6.4",
- "sha2 0.10.9",
-]
-
-[[package]]
-name = "pageant"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b537f975f6d8dcf48db368d7ec209d583b015713b5df0f5d92d2631e4ff5595"
-dependencies = [
- "byteorder",
- "bytes",
- "delegate",
- "futures",
- "log",
- "rand 0.8.5",
- "sha2 0.10.9",
- "thiserror 1.0.69",
- "tokio",
- "windows 0.62.2",
- "windows-strings 0.5.1",
-]
-
[[package]]
name = "pango"
version = "0.18.3"
@@ -7292,16 +6693,6 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
-[[package]]
-name = "pbkdf2"
-version = "0.12.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
-dependencies = [
- "digest 0.10.7",
- "hmac",
-]
-
[[package]]
name = "pem-rfc7468"
version = "0.7.0"
@@ -7311,15 +6702,6 @@ dependencies = [
"base64ct",
]
-[[package]]
-name = "pem-rfc7468"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9"
-dependencies = [
- "base64ct",
-]
-
[[package]]
name = "percent-encoding"
version = "2.3.2"
@@ -7543,56 +6925,19 @@ version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f"
dependencies = [
- "der 0.7.10",
- "pkcs8 0.10.2",
- "spki 0.7.3",
-]
-
-[[package]]
-name = "pkcs1"
-version = "0.8.0-rc.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "986d2e952779af96ea048f160fd9194e1751b4faea78bcf3ceb456efe008088e"
-dependencies = [
- "der 0.8.0",
- "spki 0.8.0-rc.4",
-]
-
-[[package]]
-name = "pkcs5"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e847e2c91a18bfa887dd028ec33f2fe6f25db77db3619024764914affe8b69a6"
-dependencies = [
- "aes",
- "cbc",
- "der 0.7.10",
- "pbkdf2",
- "scrypt",
- "sha2 0.10.9",
- "spki 0.7.3",
-]
-
-[[package]]
-name = "pkcs8"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
-dependencies = [
- "der 0.7.10",
- "pkcs5",
- "rand_core 0.6.4",
- "spki 0.7.3",
+ "der",
+ "pkcs8",
+ "spki",
]
[[package]]
name = "pkcs8"
-version = "0.11.0-rc.11"
+version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12922b6296c06eb741b02d7b5161e3aaa22864af38dfa025a1a3ba3f68c84577"
+checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
dependencies = [
- "der 0.8.0",
- "spki 0.8.0-rc.4",
+ "der",
+ "spki",
]
[[package]]
@@ -7699,18 +7044,6 @@ dependencies = [
"universal-hash",
]
-[[package]]
-name = "polyval"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25"
-dependencies = [
- "cfg-if 1.0.4",
- "cpufeatures",
- "opaque-debug",
- "universal-hash",
-]
-
[[package]]
name = "port_check"
version = "0.2.1"
@@ -7781,15 +7114,6 @@ dependencies = [
"num-integer",
]
-[[package]]
-name = "primeorder"
-version = "0.13.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6"
-dependencies = [
- "elliptic-curve",
-]
-
[[package]]
name = "proc-macro-crate"
version = "1.3.1"
@@ -7843,28 +7167,6 @@ dependencies = [
"version_check",
]
-[[package]]
-name = "proc-macro-error-attr2"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5"
-dependencies = [
- "proc-macro2",
- "quote",
-]
-
-[[package]]
-name = "proc-macro-error2"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802"
-dependencies = [
- "proc-macro-error-attr2",
- "proc-macro2",
- "quote",
- "syn 2.0.117",
-]
-
[[package]]
name = "proc-macro-hack"
version = "0.5.20+deprecated"
@@ -8154,12 +7456,6 @@ dependencies = [
"getrandom 0.3.4",
]
-[[package]]
-name = "rand_core"
-version = "0.10.0-rc-3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f66ee92bc15280519ef199a274fe0cafff4245d31bc39aaa31c011ad56cb1f05"
-
[[package]]
name = "rand_distr"
version = "0.4.3"
@@ -8494,16 +7790,6 @@ dependencies = [
"zune-jpeg 0.4.21",
]
-[[package]]
-name = "rfc6979"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
-dependencies = [
- "hmac",
- "subtle",
-]
-
[[package]]
name = "rfd"
version = "0.16.0"
@@ -8547,7 +7833,7 @@ dependencies = [
"cfg-if 1.0.4",
"getrandom 0.2.17",
"libc",
- "untrusted 0.9.0",
+ "untrusted",
"windows-sys 0.52.0",
]
@@ -8569,39 +7855,20 @@ version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d"
dependencies = [
- "const-oid 0.9.6",
- "digest 0.10.7",
+ "const-oid",
+ "digest",
"num-bigint-dig",
"num-integer",
"num-traits",
- "pkcs1 0.7.5",
- "pkcs8 0.10.2",
+ "pkcs1",
+ "pkcs8",
"rand_core 0.6.4",
- "signature 2.2.0",
- "spki 0.7.3",
+ "signature",
+ "spki",
"subtle",
"zeroize",
]
-[[package]]
-name = "rsa"
-version = "0.10.0-rc.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9a2b1eacbc34fbaf77f6f1db1385518446008d49b9f9f59dc9d1340fce4ca9e"
-dependencies = [
- "const-oid 0.10.2",
- "crypto-bigint 0.7.0-rc.18",
- "crypto-primes",
- "digest 0.11.1",
- "pkcs1 0.8.0-rc.4",
- "pkcs8 0.11.0-rc.11",
- "rand_core 0.10.0-rc-3",
- "sha2 0.11.0-rc.5",
- "signature 3.0.0-rc.6",
- "spki 0.8.0-rc.4",
- "zeroize",
-]
-
[[package]]
name = "rubato"
version = "0.15.0"
@@ -8614,110 +7881,6 @@ dependencies = [
"realfft",
]
-[[package]]
-name = "russh"
-version = "0.57.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afe62631a04a1f4d71a14b99505483b95ff97c503b67d876c042fce659186956"
-dependencies = [
- "aes",
- "aws-lc-rs",
- "bitflags 2.11.0",
- "block-padding",
- "byteorder",
- "bytes",
- "cbc",
- "ctr",
- "curve25519-dalek",
- "data-encoding",
- "delegate",
- "der 0.7.10",
- "digest 0.10.7",
- "ecdsa",
- "ed25519-dalek",
- "elliptic-curve",
- "enum_dispatch",
- "flate2",
- "futures",
- "generic-array 1.3.5",
- "getrandom 0.2.17",
- "hex-literal",
- "hmac",
- "home",
- "inout",
- "internal-russh-forked-ssh-key",
- "libcrux-ml-kem",
- "log",
- "md5",
- "num-bigint",
- "p256",
- "p384",
- "p521",
- "pageant",
- "pbkdf2",
- "pkcs1 0.8.0-rc.4",
- "pkcs5",
- "pkcs8 0.10.2",
- "rand 0.9.2",
- "rand_core 0.10.0-rc-3",
- "rsa 0.10.0-rc.12",
- "russh-cryptovec",
- "russh-util",
- "sec1",
- "sha1 0.10.6",
- "sha2 0.10.9",
- "signature 2.2.0",
- "spki 0.7.3",
- "ssh-encoding",
- "subtle",
- "thiserror 1.0.69",
- "tokio",
- "typenum",
- "zeroize",
-]
-
-[[package]]
-name = "russh-cryptovec"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb0ed583ff0f6b4aa44c7867dd7108df01b30571ee9423e250b4cc939f8c6cf"
-dependencies = [
- "libc",
- "log",
- "nix 0.29.0",
- "ssh-encoding",
- "winapi",
-]
-
-[[package]]
-name = "russh-sftp"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3bb94393cafad0530145b8f626d8687f1ee1dedb93d7ba7740d6ae81868b13b5"
-dependencies = [
- "bitflags 2.11.0",
- "bytes",
- "chrono",
- "flurry",
- "log",
- "serde",
- "thiserror 2.0.18",
- "tokio",
- "tokio-util",
-]
-
-[[package]]
-name = "russh-util"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "668424a5dde0bcb45b55ba7de8476b93831b4aa2fa6947e145f3b053e22c60b6"
-dependencies = [
- "chrono",
- "tokio",
- "wasm-bindgen",
- "wasm-bindgen-futures",
-]
-
[[package]]
name = "rust-ini"
version = "0.21.3"
@@ -8876,7 +8039,7 @@ checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
dependencies = [
"ring",
"rustls-pki-types",
- "untrusted 0.9.0",
+ "untrusted",
]
[[package]]
@@ -8933,15 +8096,6 @@ dependencies = [
"bytemuck",
]
-[[package]]
-name = "salsa20"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213"
-dependencies = [
- "cipher",
-]
-
[[package]]
name = "same-file"
version = "1.0.6"
@@ -9069,7 +8223,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.2.41"
+version = "2.2.9"
dependencies = [
"anyhow",
"arboard",
@@ -9117,7 +8271,7 @@ dependencies = [
"sentry 0.42.0",
"serde",
"serde_json",
- "sha2 0.10.9",
+ "sha2",
"specta",
"specta-typescript",
"sysinfo",
@@ -9168,7 +8322,7 @@ dependencies = [
[[package]]
name = "screenpipe-audio"
-version = "0.3.171"
+version = "0.3.160"
dependencies = [
"anyhow",
"audiopipe",
@@ -9220,7 +8374,7 @@ dependencies = [
[[package]]
name = "screenpipe-core"
-version = "0.3.171"
+version = "0.3.160"
dependencies = [
"accessibility",
"accessibility-sys",
@@ -9250,7 +8404,7 @@ dependencies = [
"serde",
"serde_json",
"serde_yaml",
- "sha2 0.10.9",
+ "sha2",
"thiserror 1.0.69",
"tokio",
"tracing",
@@ -9261,7 +8415,7 @@ dependencies = [
[[package]]
name = "screenpipe-db"
-version = "0.3.171"
+version = "0.3.160"
dependencies = [
"anyhow",
"chrono",
@@ -9286,7 +8440,7 @@ dependencies = [
[[package]]
name = "screenpipe-events"
-version = "0.3.171"
+version = "0.3.160"
dependencies = [
"anyhow",
"chrono",
@@ -9302,11 +8456,10 @@ dependencies = [
[[package]]
name = "screenpipe-integrations"
-version = "0.3.171"
+version = "0.3.160"
dependencies = [
"anyhow",
"chrono",
- "dirs 6.0.0",
"eventkit-rs",
"image 0.25.9",
"log",
@@ -9314,10 +8467,7 @@ dependencies = [
"objc2-event-kit",
"objc2-foundation 0.3.2",
"reqwest 0.12.12",
- "russh",
- "russh-sftp",
"screenpipe-core",
- "serde",
"serde_json",
"tokio",
"tracing",
@@ -9326,7 +8476,7 @@ dependencies = [
[[package]]
name = "screenpipe-server"
-version = "0.3.171"
+version = "0.3.160"
dependencies = [
"anyhow",
"async-trait",
@@ -9343,10 +8493,8 @@ dependencies = [
"fastrand",
"futures",
"hostname",
- "http-body-util",
"image 0.25.9",
"imageproc",
- "libc",
"lru",
"md5",
"moka",
@@ -9366,8 +8514,7 @@ dependencies = [
"sentry 0.36.0",
"serde",
"serde_json",
- "sha2 0.10.9",
- "socket2 0.5.10",
+ "sha2",
"sqlx",
"sysinfo",
"tempfile",
@@ -9385,7 +8532,7 @@ dependencies = [
[[package]]
name = "screenpipe-vision"
-version = "0.3.171"
+version = "0.3.160"
dependencies = [
"accessibility-sys",
"anyhow",
@@ -9439,31 +8586,6 @@ dependencies = [
"syn 2.0.117",
]
-[[package]]
-name = "scrypt"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f"
-dependencies = [
- "pbkdf2",
- "salsa20",
- "sha2 0.10.9",
-]
-
-[[package]]
-name = "sec1"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
-dependencies = [
- "base16ct 0.2.0",
- "der 0.7.10",
- "generic-array 0.14.7",
- "pkcs8 0.10.2",
- "subtle",
- "zeroize",
-]
-
[[package]]
name = "security-framework"
version = "3.7.0"
@@ -9487,12 +8609,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "seize"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "689224d06523904ebcc9b482c6a3f4f7fb396096645c4cd10c0d2ff7371a34d3"
-
[[package]]
name = "selectors"
version = "0.24.0"
@@ -9936,16 +9052,6 @@ dependencies = [
"unsafe-libyaml",
]
-[[package]]
-name = "serdect"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9af4a3e75ebd5599b30d4de5768e00b5095d518a79fefc3ecbaf77e665d1ec06"
-dependencies = [
- "base16ct 1.0.0",
- "serde",
-]
-
[[package]]
name = "serialize-to-javascript"
version = "0.1.2"
@@ -9986,18 +9092,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
dependencies = [
"cfg-if 1.0.4",
"cpufeatures",
- "digest 0.10.7",
-]
-
-[[package]]
-name = "sha1"
-version = "0.11.0-rc.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b167252f3c126be0d8926639c4c4706950f01445900c4b3db0fd7e89fcb750a"
-dependencies = [
- "cfg-if 1.0.4",
- "cpufeatures",
- "digest 0.11.1",
+ "digest",
]
[[package]]
@@ -10008,18 +9103,7 @@ checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
dependencies = [
"cfg-if 1.0.4",
"cpufeatures",
- "digest 0.10.7",
-]
-
-[[package]]
-name = "sha2"
-version = "0.11.0-rc.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c5f3b1e2dc8aad28310d8410bd4d7e180eca65fca176c52ab00d364475d0024"
-dependencies = [
- "cfg-if 1.0.4",
- "cpufeatures",
- "digest 0.11.1",
+ "digest",
]
[[package]]
@@ -10031,7 +9115,7 @@ dependencies = [
"async-trait",
"bytes",
"hex",
- "sha2 0.10.9",
+ "sha2",
"tokio",
]
@@ -10098,20 +9182,10 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
dependencies = [
- "digest 0.10.7",
+ "digest",
"rand_core 0.6.4",
]
-[[package]]
-name = "signature"
-version = "3.0.0-rc.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "597a96996ccff7dfa16f052bd995b4cecc72af22c35138738dc029f0ead6608d"
-dependencies = [
- "digest 0.11.1",
- "rand_core 0.10.0-rc-3",
-]
-
[[package]]
name = "simba"
version = "0.8.1"
@@ -10334,17 +9408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
dependencies = [
"base64ct",
- "der 0.7.10",
-]
-
-[[package]]
-name = "spki"
-version = "0.8.0-rc.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8baeff88f34ed0691978ec34440140e1572b68c7dd4a495fd14a3dc1944daa80"
-dependencies = [
- "base64ct",
- "der 0.8.0",
+ "der",
]
[[package]]
@@ -10411,7 +9475,7 @@ dependencies = [
"percent-encoding",
"serde",
"serde_json",
- "sha2 0.10.9",
+ "sha2",
"smallvec",
"sqlformat",
"thiserror 1.0.69",
@@ -10449,7 +9513,7 @@ dependencies = [
"quote",
"serde",
"serde_json",
- "sha2 0.10.9",
+ "sha2",
"sqlx-core",
"sqlx-mysql",
"sqlx-postgres",
@@ -10473,14 +9537,14 @@ dependencies = [
"bytes",
"chrono",
"crc",
- "digest 0.10.7",
+ "digest",
"dotenvy",
"either",
"futures-channel",
"futures-core",
"futures-io",
"futures-util",
- "generic-array 0.14.7",
+ "generic-array",
"hex",
"hkdf",
"hmac",
@@ -10491,10 +9555,10 @@ dependencies = [
"once_cell",
"percent-encoding",
"rand 0.8.5",
- "rsa 0.9.10",
+ "rsa",
"serde",
- "sha1 0.10.6",
- "sha2 0.10.9",
+ "sha1",
+ "sha2",
"smallvec",
"sqlx-core",
"stringprep",
@@ -10533,8 +9597,8 @@ dependencies = [
"rand 0.8.5",
"serde",
"serde_json",
- "sha1 0.10.6",
- "sha2 0.10.9",
+ "sha1",
+ "sha2",
"smallvec",
"sqlx-core",
"stringprep",
@@ -10566,35 +9630,6 @@ dependencies = [
"url",
]
-[[package]]
-name = "ssh-cipher"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "caac132742f0d33c3af65bfcde7f6aa8f62f0e991d80db99149eb9d44708784f"
-dependencies = [
- "aes",
- "aes-gcm",
- "cbc",
- "chacha20",
- "cipher",
- "ctr",
- "poly1305",
- "ssh-encoding",
- "subtle",
-]
-
-[[package]]
-name = "ssh-encoding"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb9242b9ef4108a78e8cd1a2c98e193ef372437f8c22be363075233321dd4a15"
-dependencies = [
- "base64ct",
- "bytes",
- "pem-rfc7468 0.7.0",
- "sha2 0.10.9",
-]
-
[[package]]
name = "stable_deref_trait"
version = "1.2.1"
@@ -11200,7 +10235,7 @@ dependencies = [
"semver",
"serde",
"serde_json",
- "sha2 0.10.9",
+ "sha2",
"syn 2.0.117",
"tauri-utils",
"thiserror 2.0.18",
@@ -11907,27 +10942,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-[[package]]
-name = "tls_codec"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0de2e01245e2bb89d6f05801c564fa27624dbd7b1846859876c7dad82e90bf6b"
-dependencies = [
- "tls_codec_derive",
- "zeroize",
-]
-
-[[package]]
-name = "tls_codec_derive"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.117",
-]
-
[[package]]
name = "tokio"
version = "1.49.0"
@@ -12371,7 +11385,7 @@ dependencies = [
"httparse",
"log",
"rand 0.8.5",
- "sha1 0.10.6",
+ "sha1",
"thiserror 1.0.69",
"utf-8",
]
@@ -12390,7 +11404,7 @@ dependencies = [
"rand 0.9.2",
"rustls",
"rustls-pki-types",
- "sha1 0.10.6",
+ "sha1",
"thiserror 2.0.18",
"utf-8",
]
@@ -12587,7 +11601,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
dependencies = [
- "crypto-common 0.1.7",
+ "crypto-common",
"subtle",
]
@@ -12597,12 +11611,6 @@ version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
-[[package]]
-name = "untrusted"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
-
[[package]]
name = "untrusted"
version = "0.9.0"
@@ -12636,7 +11644,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdc97a28575b85cfedf2a7e7d3cc64b3e11bd8ac766666318003abbacc7a21fc"
dependencies = [
"base64 0.22.1",
- "der 0.7.10",
+ "der",
"flate2",
"log",
"native-tls",
@@ -13274,7 +12282,7 @@ dependencies = [
[[package]]
name = "whisper-rs"
version = "0.15.1"
-source = "git+https://github.com/tazz4843/whisper-rs.git?rev=d38738df8dc54b12d2918494586ba0817c3cb12f#d38738df8dc54b12d2918494586ba0817c3cb12f"
+source = "git+https://codeberg.org/tazz4843/whisper-rs.git?rev=d38738df8dc54b12d2918494586ba0817c3cb12f#d38738df8dc54b12d2918494586ba0817c3cb12f"
dependencies = [
"tracing",
"whisper-rs-sys",
@@ -13283,7 +12291,7 @@ dependencies = [
[[package]]
name = "whisper-rs-sys"
version = "0.14.1"
-source = "git+https://github.com/tazz4843/whisper-rs.git?rev=d38738df8dc54b12d2918494586ba0817c3cb12f#d38738df8dc54b12d2918494586ba0817c3cb12f"
+source = "git+https://codeberg.org/tazz4843/whisper-rs.git?rev=d38738df8dc54b12d2918494586ba0817c3cb12f#d38738df8dc54b12d2918494586ba0817c3cb12f"
dependencies = [
"bindgen 0.71.1",
"cfg-if 1.0.4",
@@ -13399,23 +12407,11 @@ version = "0.61.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
dependencies = [
- "windows-collections 0.2.0",
+ "windows-collections",
"windows-core 0.61.2",
- "windows-future 0.2.1",
+ "windows-future",
"windows-link 0.1.3",
- "windows-numerics 0.2.0",
-]
-
-[[package]]
-name = "windows"
-version = "0.62.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
-dependencies = [
- "windows-collections 0.3.2",
- "windows-core 0.62.2",
- "windows-future 0.3.2",
- "windows-numerics 0.3.1",
+ "windows-numerics",
]
[[package]]
@@ -13427,15 +12423,6 @@ dependencies = [
"windows-core 0.61.2",
]
-[[package]]
-name = "windows-collections"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
-dependencies = [
- "windows-core 0.62.2",
-]
-
[[package]]
name = "windows-core"
version = "0.54.0"
@@ -13506,18 +12493,7 @@ checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
dependencies = [
"windows-core 0.61.2",
"windows-link 0.1.3",
- "windows-threading 0.1.0",
-]
-
-[[package]]
-name = "windows-future"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
-dependencies = [
- "windows-core 0.62.2",
- "windows-link 0.2.1",
- "windows-threading 0.2.1",
+ "windows-threading",
]
[[package]]
@@ -13610,16 +12586,6 @@ dependencies = [
"windows-link 0.1.3",
]
-[[package]]
-name = "windows-numerics"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
-dependencies = [
- "windows-core 0.62.2",
- "windows-link 0.2.1",
-]
-
[[package]]
name = "windows-registry"
version = "0.2.0"
@@ -13841,15 +12807,6 @@ dependencies = [
"windows-link 0.1.3",
]
-[[package]]
-name = "windows-threading"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"
-dependencies = [
- "windows-link 0.2.1",
-]
-
[[package]]
name = "windows-version"
version = "0.1.7"
@@ -14217,7 +13174,7 @@ dependencies = [
"once_cell",
"percent-encoding",
"raw-window-handle",
- "sha2 0.10.9",
+ "sha2",
"soup3",
"tao-macros",
"thiserror 2.0.18",
diff --git a/crates/screenpipe-audio/src/speaker/prepare_segments.rs b/crates/screenpipe-audio/src/speaker/prepare_segments.rs
index 4f049a98c..c534ecd9c 100644
--- a/crates/screenpipe-audio/src/speaker/prepare_segments.rs
+++ b/crates/screenpipe-audio/src/speaker/prepare_segments.rs
@@ -1,8 +1,6 @@
use super::segment::get_segments;
use crate::{
- utils::audio::{
- average_noise_spectrum, filter_music_frames, normalize_v2, spectral_subtraction,
- },
+ utils::audio::{average_noise_spectrum, filter_music_frames, normalize_v2, spectral_subtraction},
vad::VadEngine,
};
use anyhow::Result;