YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(chat): open home agent deep links cross-platform (#6866)
Ezra Elletted99ebcc6605b
diff --git a/apps/screenpipe-app-tauri/components/chat/home-card-agent-actions.test.tsx b/apps/screenpipe-app-tauri/components/chat/home-card-agent-actions.test.tsxindex c7f3869e8..2a49500f4 100644--- a/apps/screenpipe-app-tauri/components/chat/home-card-agent-actions.test.tsx+++ b/apps/screenpipe-app-tauri/components/chat/home-card-agent-actions.test.tsx@@ -5,6 +5,7 @@import React from "react";import { fireEvent, render, screen, waitFor } from "@testing-library/react";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import tauriConfig from "../../src-tauri/tauri.conf.json";import {buildHomeCardAgentPrompt,@@ -26,8 +27,8 @@ vi.mock("@/lib/utils/tauri", () => ({commands: { copyTextToClipboard: mocks.copyTextToClipboard },}));-vi.mock("@tauri-apps/plugin-opener", () => ({- openUrl: mocks.openUrl,+vi.mock("@/lib/open-external-url", () => ({+ openExternalUrl: mocks.openUrl,}));const DAY_RECAP = {@@ -185,6 +186,17 @@ describe("HomeCardAgentActions", () => {"home_card_agent_handoff_completed",expect.objectContaining({ agent: "codex", card: "custom" }),);+ const prompt = buildHomeCardAgentPrompt(+ {+ name: "custom-tpl-1",+ title: "Client recap",+ previewPrompt: "Summarize my client work",+ },+ "codex",+ );+ expect(mocks.openUrl).toHaveBeenCalledWith(+ `codex://threads/new?prompt=${encodeURIComponent(prompt)}`,+ );});it("shows the copied fallback when the app cannot open", async () => {@@ -226,6 +238,10 @@ describe("HomeCardAgentActions", () => {await waitFor(() =>expect(screen.getByRole("status")).toHaveTextContent("unavailable"),);+ const prompt = buildHomeCardAgentPrompt(DAY_RECAP, "cursor");+ expect(mocks.openUrl).toHaveBeenCalledWith(+ `cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(prompt)}`,+ );expect(mocks.capture).toHaveBeenCalledWith("home_card_agent_handoff_completed",expect.objectContaining({@@ -236,4 +252,14 @@ describe("HomeCardAgentActions", () => {}),);});++ it("allows every agent deeplink through the cross-platform shell validator", () => {+ const validator = new RegExp(`^${tauriConfig.plugins.shell.open}$`);++ expect(validator.test("claude://claude.ai/new?q=test")).toBe(true);+ expect(+ validator.test("cursor://anysphere.cursor-deeplink/prompt?text=test"),+ ).toBe(true);+ expect(validator.test("codex://threads/new?prompt=test")).toBe(true);+ });});diff --git a/apps/screenpipe-app-tauri/components/chat/home-card-agent-actions.tsx b/apps/screenpipe-app-tauri/components/chat/home-card-agent-actions.tsxindex b6e4c590b..cdde710c9 100644--- a/apps/screenpipe-app-tauri/components/chat/home-card-agent-actions.tsx+++ b/apps/screenpipe-app-tauri/components/chat/home-card-agent-actions.tsx@@ -23,6 +23,7 @@ import {} from "@/lib/first-run/agent-handoff";import { entryCardForHomeTemplate } from "@/lib/chat/response-feedback";import { type ChatEntryCard } from "@/lib/chat/types";+import { openExternalUrl } from "@/lib/open-external-url";import { commands } from "@/lib/utils/tauri";type HomeCardAgentId = "claude" | "cursor" | "codex";@@ -156,8 +157,7 @@ export function HomeCardAgentActions({if (copied.status === "error") throw new Error(copied.error);},openUrl: async (url) => {- const { openUrl } = await import("@tauri-apps/plugin-opener");- await openUrl(url);+ await openExternalUrl(url);},},prompt,diff --git a/apps/screenpipe-app-tauri/src-tauri/tauri.conf.json b/apps/screenpipe-app-tauri/src-tauri/tauri.conf.jsonindex 0536d3a70..4fa7f3214 100644--- a/apps/screenpipe-app-tauri/src-tauri/tauri.conf.json+++ b/apps/screenpipe-app-tauri/src-tauri/tauri.conf.json@@ -45,6 +45,9 @@}},"plugins": {+ "shell": {+ "open": "(?:https?://.*|mailto:.*|tel:.*|x-apple-reminderkit://.*|claude://claude\\.ai/new\\?q=.*|cursor://anysphere\\.cursor-deeplink/prompt\\?text=.*|codex://threads/new\\?prompt=.*)"+ },"updater": {"endpoints": [],"pubkey": ""