Skip to content

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

chore: simplify shortcut reminder text

Louis Beaumont0ea09e214991
diff --git a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
index 82960e428..caaebc245 100644
--- a/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
+++ b/screenpipe-app-tauri/app/shortcut-reminder/page.tsx
@@ -100,9 +100,8 @@ export default function ShortcutReminderPage() {
{shortcut ?? "..."}
</span>
- {/* Always show text - hover unreliable on unfocused windows */}
<span className="text-[9px] text-white/50 whitespace-nowrap">
- open screenpipe
+ screenpipe
</span>
</div>
</div>
diff --git a/screenpipe-app-tauri/components/rewind/search-command.tsx b/screenpipe-app-tauri/components/rewind/search-command.tsx
index 156f80b65..b09c5d042 100644
--- a/screenpipe-app-tauri/components/rewind/search-command.tsx
+++ b/screenpipe-app-tauri/components/rewind/search-command.tsx
@@ -22,7 +22,6 @@ import { CommandShortcut } from "./ui/command";
import { commands } from "@/lib/utils/tauri";
import { Button } from "@/components/ui/button";
import { useSettings } from "@/lib/hooks/use-settings";
-import { useMcpClient } from "@/lib/hooks/use-mcp-client";
import { Badge } from "./ui/badge";
import ReactMarkdown from "react-markdown";
@@ -100,7 +99,6 @@ export function SearchCommand() {
const [open, setOpen] = React.useState(false);
const { settings } = useSettings();
const user = settings.user;
- const { callTool: mcpCallTool, isConnected: mcpConnected } = useMcpClient();
const [state] = useQueryStates(queryParser);
const [options, setOptions] = useState<QueryParser>(
@@ -200,55 +198,51 @@ export function SearchCommand() {
}
}
- // Execute search tool via MCP SDK client
+ // Execute search tool by calling Screenpipe API directly
async function executeSearchTool(args: Record<string, unknown>): Promise<string> {
try {
- // Use MCP SDK client to call search_content tool
- const result = await mcpCallTool("search_content", args);
- return result || "No results found.";
- } catch (error) {
- console.error("MCP search error:", error);
- // Fallback to direct API call if MCP server is not running
- try {
- const params = new URLSearchParams();
- if (args.q) params.append("q", String(args.q));
- if (args.content_type && args.content_type !== "all") {
- params.append("content_type", String(args.content_type));
- }
- if (args.limit) params.append("limit", String(args.limit));
- else params.append("limit", "10");
- if (args.start_time) params.append("start_time", String(args.start_time));
- if (args.end_time) params.append("end_time", String(args.end_time));
- if (args.app_name) params.append("app_name", String(args.app_name));
+ const params = new URLSearchParams();
+ if (args.q) params.append("q", String(args.q));
+ if (args.content_type && args.content_type !== "all") {
+ params.append("content_type", String(args.content_type));
+ }
+ if (args.limit) params.append("limit", String(args.limit));
+ else params.append("limit", "20");
+ if (args.start_time) params.append("start_time", String(args.start_time));
+ if (args.end_time) params.append("end_time", String(args.end_time));
+ if (args.app_name) params.append("app_name", String(args.app_name));
+ if (args.window_name) params.append("window_name", String(args.window_name));
- const response = await fetch(`${SCREENPIPE_API}/search?${params.toString()}`);
- if (!response.ok) throw new Error(`Search failed: ${response.status}`);
+ const response = await fetch(`${SCREENPIPE_API}/search?${params.toString()}`);
+ if (!response.ok) throw new Error(`Search failed: ${response.status}`);
- const data = await response.json();
- const searchResults = data.data || [];
+ const data = await response.json();
+ const searchResults = data.data || [];
+ const pagination = data.pagination || {};
- if (searchResults.length === 0) {
- return "No results found. Try broader search terms or a wider time range.";
- }
+ if (searchResults.length === 0) {
+ return "No results found. Try broader search terms or a wider time range.";
+ }
- const formatted = searchResults.map((result: SearchResult) => {
- const content = result.content;
- if (!content) return null;
+ const formatted = searchResults.map((result: SearchResult) => {
+ const content = result.content;
+ if (!content) return null;
- if (result.type === "OCR") {
- return `[Screen - ${content.app_name || "Unknown"}] ${content.timestamp}\n${content.text || ""}`;
- } else if (result.type === "Audio") {
- return `[Audio - ${content.device_name || "Unknown"}] ${content.timestamp}\n${content.transcription || ""}`;
- } else if (result.type === "UI") {
- return `[UI - ${content.app_name || "Unknown"}] ${content.timestamp}\n${content.text || ""}`;
- }
- return null;
- }).filter(Boolean);
+ if (result.type === "OCR") {
+ return `[OCR] ${content.app_name || "?"} | ${content.window_name || "?"}\n${content.timestamp}\n${content.text || ""}`;
+ } else if (result.type === "Audio") {
+ return `[Audio] ${content.device_name || "?"}\n${content.timestamp}\n${content.transcription || ""}`;
+ } else if (result.type === "UI") {
+ return `[UI] ${content.app_name || "?"} | ${content.window_name || "?"}\n${content.timestamp}\n${content.text || ""}`;
+ }
+ return null;
+ }).filter(Boolean);
- return `Found ${searchResults.length} results:\n\n${formatted.join("\n\n---\n\n")}`;
- } catch (fallbackError) {
- return `Search failed: ${fallbackError instanceof Error ? fallbackError.message : "Unknown error"}`;
- }
+ const header = `Results: ${searchResults.length}/${pagination.total || "?"}`;
+ return `${header}\n\n${formatted.join("\n---\n")}`;
+ } catch (error) {
+ console.error("Search error:", error);
+ return `Search failed: ${error instanceof Error ? error.message : "Unknown error"}`;
}
}
diff --git a/screenpipe-app-tauri/lib/hooks/use-mcp-client.ts b/screenpipe-app-tauri/lib/hooks/use-mcp-client.ts
deleted file mode 100644
index 4dd38f19d..000000000
--- a/screenpipe-app-tauri/lib/hooks/use-mcp-client.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-"use client";
-
-import { useState, useEffect, useCallback, useRef } from "react";
-import { Client } from "@modelcontextprotocol/sdk/client/index.js";
-import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
-
-const MCP_URL = "http://localhost:3031/mcp";
-
-interface McpClientState {
- isConnected: boolean;
- isConnecting: boolean;
- error: string | null;
-}
-
-export function useMcpClient() {
- const [state, setState] = useState<McpClientState>({
- isConnected: false,
- isConnecting: false,
- error: null,
- });
- const clientRef = useRef<Client | null>(null);
- const transportRef = useRef<StreamableHTTPClientTransport | null>(null);
-
- // Connect to MCP server
- const connect = useCallback(async () => {
- if (clientRef.current || state.isConnecting) return;
-
- setState((prev) => ({ ...prev, isConnecting: true, error: null }));
-
- try {
- const transport = new StreamableHTTPClientTransport(new URL(MCP_URL));
- transportRef.current = transport;
-
- const client = new Client(
- { name: "screenpipe-app", version: "1.0.0" },
- { capabilities: {} }
- );
-
- await client.connect(transport);
- clientRef.current = client;
-
- setState({ isConnected: true, isConnecting: false, error: null });
- } catch (error) {
- console.error("MCP connection error:", error);
- setState({
- isConnected: false,
- isConnecting: false,
- error: error instanceof Error ? error.message : "Failed to connect to MCP server",
- });
- }
- }, [state.isConnecting]);
-
- // Disconnect from MCP server
- const disconnect = useCallback(async () => {
- if (transportRef.current) {
- await transportRef.current.close();
- transportRef.current = null;
- }
- clientRef.current = null;
- setState({ isConnected: false, isConnecting: false, error: null });
- }, []);
-
- // Call a tool on the MCP server
- const callTool = useCallback(
- async (name: string, args: Record<string, unknown>): Promise<string> => {
- if (!clientRef.current) {
- // Try to connect first
- await connect();
- if (!clientRef.current) {
- throw new Error("MCP client not connected");
- }
- }
-
- try {
- const result = await clientRef.current.callTool({
- name,
- arguments: args,
- });
-
- // Extract text content from result
- const textContent = result.content
- ?.filter((block: any) => block.type === "text")
- .map((block: any) => block.text)
- .join("\n");
-
- return textContent || "No results";
- } catch (error) {
- console.error("MCP tool call error:", error);
- throw error;
- }
- },
- [connect]
- );
-
- // List available tools
- const listTools = useCallback(async () => {
- if (!clientRef.current) {
- await connect();
- if (!clientRef.current) {
- throw new Error("MCP client not connected");
- }
- }
-
- return await clientRef.current.listTools();
- }, [connect]);
-
- // Cleanup on unmount
- useEffect(() => {
- return () => {
- disconnect();
- };
- }, [disconnect]);
-
- return {
- ...state,
- connect,
- disconnect,
- callTool,
- listTools,
- };
-}