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: automatically connect VS Code to screenpipe MCP (#7271)
Louis Beaumont75c3c607ff19
diff --git a/.github/pr-assets/vscode-auto-connect/vscode-after.png b/.github/pr-assets/vscode-auto-connect/vscode-after.pngnew file mode 100644index 000000000..6fba9d6bfBinary files /dev/null and b/.github/pr-assets/vscode-auto-connect/vscode-after.png differdiff --git a/.github/pr-assets/vscode-auto-connect/vscode-before.png b/.github/pr-assets/vscode-auto-connect/vscode-before.pngnew file mode 100644index 000000000..9d9ffe843Binary files /dev/null and b/.github/pr-assets/vscode-auto-connect/vscode-before.png differdiff --git a/.github/pr-assets/vscode-auto-connect/vscode-disconnected.png b/.github/pr-assets/vscode-auto-connect/vscode-disconnected.pngnew file mode 100644index 000000000..9419d1d42Binary files /dev/null and b/.github/pr-assets/vscode-auto-connect/vscode-disconnected.png differdiff --git a/Cargo.lock b/Cargo.lockindex 38c2fe069..9e3ebb08d 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -5025,6 +5025,15 @@ dependencies = ["wasm-bindgen",]+[[package]]+name = "jsonc-parser"+version = "0.33.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9ff5a48f48971be8e762a6ff955725a0802b6e46c441057992da5a673db9fd3a"+dependencies = [+ "serde_json",+]+[[package]]name = "keccak"version = "0.1.6"@@ -8923,6 +8932,7 @@ dependencies = ["http-body-util","hyper-util","image",+ "jsonc-parser","libc","lru","md5 0.7.0",diff --git a/apps/screenpipe-app-tauri/bun.lock b/apps/screenpipe-app-tauri/bun.lockindex 7e9f73b0a..16cdb6a16 100644--- a/apps/screenpipe-app-tauri/bun.lock+++ b/apps/screenpipe-app-tauri/bun.lock@@ -54,6 +54,7 @@"gt-react": "11.4.0","hotkeys-js": "^3.13.15","js-levenshtein": "^1.1.6",+ "jsonc-parser": "3.3.1","localforage": "^1.10.0","lodash": "^4.17.23","lucide-react": "^0.414.0",@@ -2111,6 +2112,8 @@"json5": ["[email protected]", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],+ "jsonc-parser": ["[email protected]", "", {}, "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ=="],+"jsonpath-plus": ["[email protected]", "", { "dependencies": { "@jsep-plugin/assignment": "^1.3.0", "@jsep-plugin/regex": "^1.0.4", "jsep": "^1.4.0" }, "bin": { "jsonpath": "bin/jsonpath-cli.js", "jsonpath-plus": "bin/jsonpath-cli.js" } }, "sha512-T92WWatJXmhBbKsgH/0hl+jxjdXrifi5IKeMY02DWggRxX0UElcbVzPlmgLTbvsPeW1PasQ6xE2Q75stkhGbsA=="],"jsonpointer": ["[email protected]", "", {}, "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ=="],diff --git a/apps/screenpipe-app-tauri/components/settings/__tests__/ai-tools-card.test.tsx b/apps/screenpipe-app-tauri/components/settings/__tests__/ai-tools-card.test.tsxindex 4779ccb50..9f8301ce1 100644--- a/apps/screenpipe-app-tauri/components/settings/__tests__/ai-tools-card.test.tsx+++ b/apps/screenpipe-app-tauri/components/settings/__tests__/ai-tools-card.test.tsx@@ -22,6 +22,7 @@ const libMocks = vi.hoisted(() => ({isGeminiMcpInstalled: vi.fn(async () => false),isRunnerMcpInstalled: vi.fn(async () => false),isWindsurfMcpInstalled: vi.fn(async () => false),+ isVscodeMcpInstalled: vi.fn(async () => false),}));const hookMocks = vi.hoisted(() => ({@@ -54,6 +55,7 @@ vi.mock("@/lib/ai-tools-mcp", () => ({hermes: "Hermes",runner: "Runner",windsurf: "Windsurf (Devin Desktop)",+ vscode: "VS Code",},SKILLS_TARGET: {claude: "claude",@@ -90,6 +92,17 @@ describe("AiToolsCard", () => {afterEach(() => cleanup());+ it("shows VS Code as connected and allows removing its MCP connection", async () => {+ libMocks.detectAiTools.mockResolvedValue(["vscode"]);+ libMocks.isVscodeMcpInstalled.mockResolvedValue(true);+ render(<AiToolsCard />);+ expect(await screen.findByText("All 1 connected")).toBeTruthy();+ fireEvent.click(screen.getByRole("button", { name: /manage/i }));+ expect(await screen.findByText("VS Code")).toBeTruthy();+ fireEvent.click(screen.getByRole("button", { name: /remove/i }));+ await waitFor(() => expect(libMocks.disconnectAiToolTargets).toHaveBeenCalledWith(["vscode"]));+ });+it("shows the last confirmed Grok Bot connection without reconnecting", async () => {libMocks.detectAiTools.mockResolvedValue(["grokbot"]);grokMocks.isGrokBotConnected.mockResolvedValue(true);diff --git a/apps/screenpipe-app-tauri/components/settings/ai-tools-card.tsx b/apps/screenpipe-app-tauri/components/settings/ai-tools-card.tsxindex fb71e6dbf..0214aab63 100644--- a/apps/screenpipe-app-tauri/components/settings/ai-tools-card.tsx+++ b/apps/screenpipe-app-tauri/components/settings/ai-tools-card.tsx@@ -31,6 +31,7 @@ import {isGeminiMcpInstalled,isRunnerMcpInstalled,isWindsurfMcpInstalled,+ isVscodeMcpInstalled,} from "@/lib/ai-tools-mcp";import { areExternalAgentSkillsInstalled } from "@/lib/external-agent-skills";import {@@ -112,6 +113,8 @@ async function isToolConnected(id: ConnectAllToolId): Promise<boolean> {return isRunnerMcpInstalled();case "windsurf":return isWindsurfMcpInstalled();+ case "vscode":+ return isVscodeMcpInstalled();}}@@ -134,6 +137,8 @@ function ToolIcon({ id }: { id: ConnectAllToolId }) {return <img src="/images/openclaw.png" alt="" className={`${img} rounded`} />;case "hermes":return <img src="/images/hermes.png" alt="" className={`${img} rounded`} />;+ case "vscode":+ return <img src="/images/vscode.svg" alt="" className={img} />;case "grokbot":case "runner":return <Bot className={img} />;@@ -388,6 +393,11 @@ export function AiToolsCard({ onChanged }: { onChanged?: () => void }) {)}</p>)}+ {id === "vscode" && isOn && !err && (+ <p className="text-[11px] mt-1 text-muted-foreground">+ In VS Code, open Copilot Chat and approve screenpipe when prompted.+ </p>+ )}{id === "runner" && isOn && !err && (<p className="text-[11px] mt-1 text-muted-foreground">In Runner, enable Settings > Workspace > Local MCP Servers, then start a new conversation.diff --git a/apps/screenpipe-app-tauri/lib/__tests__/ai-tools-mcp.test.ts b/apps/screenpipe-app-tauri/lib/__tests__/ai-tools-mcp.test.tsindex d930c4090..42f51054d 100644--- a/apps/screenpipe-app-tauri/lib/__tests__/ai-tools-mcp.test.ts+++ b/apps/screenpipe-app-tauri/lib/__tests__/ai-tools-mcp.test.ts@@ -38,6 +38,7 @@ vi.mock("@tauri-apps/api/path", async () => {const simplified = (path: string) => path.replace(/^\\\\\?\\/, "");return {homeDir: vi.fn(async () => pathMock.home),+ configDir: vi.fn(async () => paths().join(pathMock.home, "Library/Application Support")),join: vi.fn(async (...parts: string[]) => simplified(paths().join(...parts)).replace(/[\\/]+$/, "")),dirname: vi.fn(async (path: string) => simplified(paths().dirname(path))),};@@ -100,6 +101,10 @@ vi.mock("@/lib/hooks/use-hardcoded-tiles", () => ({vi.mock("@/lib/external-agent-skills", () => skillsMock);import {+ installVscodeMcp,+ uninstallVscodeMcp,+ isVscodeMcpInstalled,+ isToolConfigHealthy,installCodexMcp,uninstallCodexMcp,installCursorMcp,@@ -503,3 +508,51 @@ describe("Grok Bot skill transport", () => {await expect(connectAiTool("grokbot")).rejects.toThrow("not confirmed");});});+++describe("VS Code MCP", () => {+ const path = "/Users/test/Library/Application Support/Code/User/mcp.json";+ it("detects the user profile and preserves JSONC, inputs, and other servers through connect/disconnect", async () => {+ fsMock.files.set(path.slice(0, -"/mcp.json".length), "");+ const original = `{+ // keep this comment+ "servers": { "screenpipe": { "command": "old", "sandboxEnabled": true, "cwd": "/project" }, "other": { "type": "http", "url": "https://example.com" }, },+ "inputs": [{ "id": "token" }],+ }`;+ fsMock.files.set(path, original);+ expect(await detectAiTools()).toContain("vscode");+ expect(await isToolConfigHealthy("vscode")).toBe(true);+ await connectAiTool("vscode");+ expect(await isVscodeMcpInstalled()).toBe(true);+ const text = fsMock.files.get(path)!;+ const { parse } = await import("jsonc-parser");+ const config = parse(text);+ expect(text).toContain("// keep this comment");+ expect(config.servers.other.url).toBe("https://example.com");+ expect(config.inputs).toEqual([{ id: "token" }]);+ expect(config.mcpServers).toBeUndefined();+ expect(config.servers.screenpipe.sandboxEnabled).toBe(true);+ expect(config.servers.screenpipe.cwd).toBe("/project");+ expect(config.servers.screenpipe).toMatchObject({ type: "stdio", command: "/app/bun", env: { SCREENPIPE_LOCAL_API_KEY: "sp-test", SCREENPIPE_MCP_CLIENT: "vscode", SCREENPIPE_API_URL: "http://localhost:3030" } });+ expect(backupsOf(path).map((p) => fsMock.files.get(p))).toContain(original);+ expect(tauriMock.setAiToolAutoConnectOptOut).toHaveBeenCalledWith("vscode", false);+ await disconnectAiTool("vscode");+ expect(tauriMock.setAiToolAutoConnectOptOut).toHaveBeenCalledWith("vscode", true);+ expect(await isVscodeMcpInstalled()).toBe(false);+ expect(parse(fsMock.files.get(path)!).servers.other).toEqual(config.servers.other);+ expect(skillsMock.installExternalAgentSkills).not.toHaveBeenCalled();+ });+ it.each(["[]", "null", '{"servers":[]}', '{"servers":null}', '{"servers":{} "inputs":[]}'])("refuses malformed config %s without overwriting", async (original) => {+ fsMock.files.set(path, original);+ await expect(installVscodeMcp()).rejects.toThrow();+ expect(fsMock.files.get(path)).toBe(original);+ expect(await isToolConfigHealthy("vscode")).toBe(false);+ });+ it("initializes missing config and removes mixed-case stale entries", async () => {+ await installVscodeMcp();+ expect(await isVscodeMcpInstalled()).toBe(true);+ fsMock.files.set(path, '{"servers":{"Screenpipe":{"type":"stdio"},"screenpipe":{"type":"stdio"},"other":{}}}');+ await uninstallVscodeMcp();+ expect(JSON.parse(fsMock.files.get(path)!).servers).toEqual({ other: {} });+ });+});diff --git a/apps/screenpipe-app-tauri/lib/ai-tools-mcp.ts b/apps/screenpipe-app-tauri/lib/ai-tools-mcp.tsindex 9e15d6a0a..a28f00890 100644--- a/apps/screenpipe-app-tauri/lib/ai-tools-mcp.ts+++ b/apps/screenpipe-app-tauri/lib/ai-tools-mcp.ts@@ -6,7 +6,7 @@// launch reconciliation in crates/screenpipe-engine/src/cli/agent.rs; this// module remains the explicit connect/remove surface in Settings.-import { homeDir, join, dirname } from "@tauri-apps/api/path";+import { homeDir, configDir, join, dirname } from "@tauri-apps/api/path";import {readTextFile,writeFile,@@ -31,6 +31,8 @@ import {import { isGrokBotDetected, grokBotConnection } from "@/lib/grokbot-connection";+import { parse, modify, applyEdits, type ParseError } from "jsonc-parser";+type McpCommand = { command: string; args: string[]; env?: Record<string, string> };// ─── Tool matrix ──────────────────────────────────────────────────────────────@@ -45,6 +47,7 @@ const CONNECT_ALL_TOOL_IDS = ["hermes","runner","windsurf",+ "vscode","grokbot",] as const;export type ConnectAllToolId = (typeof CONNECT_ALL_TOOL_IDS)[number];@@ -63,6 +66,7 @@ export const CONNECT_ALL_TOOL_NAMES: Record<ConnectAllToolId, string> = {// config stayed at ~/.codeium/windsurf — show both names so users on either// side of the OTA update recognize it.windsurf: "Windsurf (Devin Desktop)",+ vscode: "VS Code",};// Skills support per tool lives in the disconnect-all component's@@ -92,6 +96,7 @@ export async function detectAiTools(): Promise<ConnectAllToolId[]> {["hermes", async () => exists(await join(home, ".hermes"))],["runner", async () => exists(await join(home, ".runner"))],["windsurf", async () => exists(await join(home, ".codeium", "windsurf"))],+ ["vscode", async () => exists(await dirname(await getVscodeMcpConfigPath()))],// Connect all finishes the local integrations before a cloud request.["grokbot", isGrokBotDetected],];@@ -552,6 +557,73 @@ export async function uninstallHermesMcp(): Promise<void> {await replaceConfig(configPath, next);}+// VS Code's default user profile uses JSONC and a `servers` map.+export async function getVscodeMcpConfigPath(): Promise<string> {+ return join(await configDir(), "Code", "User", "mcp.json");+}++function parseVscodeConfig(text: string, path: string): Record<string, unknown> {+ const errors: ParseError[] = [];+ const parsed = parse(text, errors, { allowTrailingComma: true, allowEmptyContent: true });+ const root = parsed === undefined ? {} : parsed;+ if (errors.length || !root || typeof root !== "object" || Array.isArray(root)) {+ throw new Error(`${path} is not valid JSON — fix or remove it; screenpipe won't overwrite it`);+ }+ if ("servers" in root && (!root.servers || typeof root.servers !== "object" || Array.isArray(root.servers))) {+ throw new Error(`${path}: servers is present but not an object`);+ }+ return root;+}++export async function isVscodeMcpInstalled(): Promise<boolean> {+ try {+ const path = await getVscodeMcpConfigPath();+ const root = parseVscodeConfig(await readTextFile(path), path);+ const servers = root.servers as Record<string, { type?: string }> | undefined;+ return Object.entries(servers ?? {}).some(([key, value]) =>+ key.toLowerCase() === "screenpipe" && value?.type === "stdio");+ } catch { return false; }+}++async function updateVscodeMcp(mcp?: McpCommand): Promise<void> {+ const path = await getVscodeMcpConfigPath();+ let text = (await readConfigText(path)) ?? "";+ const root = parseVscodeConfig(text, path);+ const servers = root.servers as Record<string, unknown> | undefined;+ const keys = Object.keys(servers ?? {}).filter((key) => key.toLowerCase() === "screenpipe");+ if (!mcp && !keys.length) return;+ const options = { formattingOptions: { insertSpaces: true, tabSize: 2 } };+ // Preserve user-owned server options, including sandboxEnabled and cwd.+ const primary = keys[0] ?? "screenpipe";+ for (const key of mcp ? keys.slice(1) : keys) {+ text = applyEdits(text, modify(text, ["servers", key], undefined, options));+ }+ if (mcp) {+ const previous = servers?.[primary];+ if (!previous || typeof previous !== "object" || Array.isArray(previous)) {+ text = applyEdits(text, modify(text, ["servers", primary], {}, options));+ }+ for (const [key, value] of Object.entries({ type: "stdio", ...mcp })) {+ text = applyEdits(text, modify(text, ["servers", primary, key], value, options));+ }+ }+ await replaceConfig(path, text);+}++export async function installVscodeMcp(): Promise<McpCommand> {+ const mcp = await buildMcpConfig({ client: "vscode" });+ const config = await commands.getLocalApiConfig() as { port?: number };+ if (config?.port) {+ mcp.env = { ...mcp.env, SCREENPIPE_API_URL: `http://localhost:${config.port}` };+ }+ await updateVscodeMcp(mcp);+ return mcp;+}++export async function uninstallVscodeMcp(): Promise<void> {+ await updateVscodeMcp();+}+// ─── Windsurf ────────────────────────────────────────────────────────────────// MCP-only (no skills dir), standard mcpServers JSON at// ~/.codeium/windsurf/mcp_config.json.@@ -666,6 +738,7 @@ const INSTALL_MCP: Record<Exclude<ConnectAllToolId, "grokbot">, () => Promise<Mchermes: installHermesMcp,runner: installRunnerMcp,windsurf: installWindsurfMcp,+ vscode: installVscodeMcp,};const UNINSTALL_MCP: Record<Exclude<ConnectAllToolId, "grokbot">, () => Promise<void>> = {@@ -678,6 +751,7 @@ const UNINSTALL_MCP: Record<Exclude<ConnectAllToolId, "grokbot">, () => Promise<hermes: uninstallHermesMcp,runner: uninstallRunnerMcp,windsurf: uninstallWindsurfMcp,+ vscode: uninstallVscodeMcp,};async function setAutoConnectOptOut(id: ConnectAllToolId, optOut: boolean): Promise<void> {@@ -889,6 +963,11 @@ export async function isToolConfigHealthy(id: ConnectAllToolId): Promise<booleancase "openclaw":await readJsonConfigStrict(await getOpenclawMcpConfigPath());return true;+ case "vscode": {+ const path = await getVscodeMcpConfigPath();+ parseVscodeConfig((await readConfigText(path)) ?? "", path);+ return true;+ }case "windsurf":await readJsonConfigStrict(await getWindsurfMcpConfigPath());return true;diff --git a/apps/screenpipe-app-tauri/package.json b/apps/screenpipe-app-tauri/package.jsonindex 9b31ae751..744f26b83 100644--- a/apps/screenpipe-app-tauri/package.json+++ b/apps/screenpipe-app-tauri/package.json@@ -135,6 +135,7 @@"gt-react": "11.4.0","hotkeys-js": "^3.13.15","js-levenshtein": "^1.1.6",+ "jsonc-parser": "3.3.1","localforage": "^1.10.0","lodash": "^4.17.23","lucide-react": "^0.414.0",diff --git a/apps/screenpipe-app-tauri/public/images/vscode.svg b/apps/screenpipe-app-tauri/public/images/vscode.svgnew file mode 100644index 000000000..c453e633f--- /dev/null+++ b/apps/screenpipe-app-tauri/public/images/vscode.svg@@ -0,0 +1,41 @@+<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">+<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100">+<path fill-rule="evenodd" clip-rule="evenodd" d="M70.9119 99.3171C72.4869 99.9307 74.2828 99.8914 75.8725 99.1264L96.4608 89.2197C98.6242 88.1787 100 85.9892 100 83.5872V16.4133C100 14.0113 98.6243 11.8218 96.4609 10.7808L75.8725 0.873756C73.7862 -0.130129 71.3446 0.11576 69.5135 1.44695C69.252 1.63711 69.0028 1.84943 68.769 2.08341L29.3551 38.0415L12.1872 25.0096C10.589 23.7965 8.35363 23.8959 6.86933 25.2461L1.36303 30.2549C-0.452552 31.9064 -0.454633 34.7627 1.35853 36.417L16.2471 50.0001L1.35853 63.5832C-0.454633 65.2374 -0.452552 68.0938 1.36303 69.7453L6.86933 74.7541C8.35363 76.1043 10.589 76.2037 12.1872 74.9905L29.3551 61.9587L68.769 97.9167C69.3925 98.5406 70.1246 99.0104 70.9119 99.3171ZM75.0152 27.2989L45.1091 50.0001L75.0152 72.7012V27.2989Z" fill="white"/>+</mask>+<g mask="url(#mask0)">+<path d="M96.4614 10.7962L75.8569 0.875542C73.4719 -0.272773 70.6217 0.211611 68.75 2.08333L1.29858 63.5832C-0.515693 65.2373 -0.513607 68.0937 1.30308 69.7452L6.81272 74.754C8.29793 76.1042 10.5347 76.2036 12.1338 74.9905L93.3609 13.3699C96.086 11.3026 100 13.2462 100 16.6667V16.4275C100 14.0265 98.6246 11.8378 96.4614 10.7962Z" fill="#0065A9"/>+<g filter="url(#filter0_d)">+<path d="M96.4614 89.2038L75.8569 99.1245C73.4719 100.273 70.6217 99.7884 68.75 97.9167L1.29858 36.4169C-0.515693 34.7627 -0.513607 31.9063 1.30308 30.2548L6.81272 25.246C8.29793 23.8958 10.5347 23.7964 12.1338 25.0095L93.3609 86.6301C96.086 88.6974 100 86.7538 100 83.3334V83.5726C100 85.9735 98.6246 88.1622 96.4614 89.2038Z" fill="#007ACC"/>+</g>+<g filter="url(#filter1_d)">+<path d="M75.8578 99.1263C73.4721 100.274 70.6219 99.7885 68.75 97.9166C71.0564 100.223 75 98.5895 75 95.3278V4.67213C75 1.41039 71.0564 -0.223106 68.75 2.08329C70.6219 0.211402 73.4721 -0.273666 75.8578 0.873633L96.4587 10.7807C98.6234 11.8217 100 14.0112 100 16.4132V83.5871C100 85.9891 98.6234 88.1786 96.4586 89.2196L75.8578 99.1263Z" fill="#1F9CF0"/>+</g>+<g style="mix-blend-mode:overlay" opacity="0.25">+<path fill-rule="evenodd" clip-rule="evenodd" d="M70.8511 99.3171C72.4261 99.9306 74.2221 99.8913 75.8117 99.1264L96.4 89.2197C98.5634 88.1787 99.9392 85.9892 99.9392 83.5871V16.4133C99.9392 14.0112 98.5635 11.8217 96.4001 10.7807L75.8117 0.873695C73.7255 -0.13019 71.2838 0.115699 69.4527 1.44688C69.1912 1.63705 68.942 1.84937 68.7082 2.08335L29.2943 38.0414L12.1264 25.0096C10.5283 23.7964 8.29285 23.8959 6.80855 25.246L1.30225 30.2548C-0.513334 31.9064 -0.515415 34.7627 1.29775 36.4169L16.1863 50L1.29775 63.5832C-0.515415 65.2374 -0.513334 68.0937 1.30225 69.7452L6.80855 74.754C8.29285 76.1042 10.5283 76.2036 12.1264 74.9905L29.2943 61.9586L68.7082 97.9167C69.3317 98.5405 70.0638 99.0104 70.8511 99.3171ZM74.9544 27.2989L45.0483 50L74.9544 72.7012V27.2989Z" fill="url(#paint0_linear)"/>+</g>+</g>+<defs>+<filter id="filter0_d" x="-8.39411" y="15.8291" width="116.727" height="92.2456" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">+<feFlood flood-opacity="0" result="BackgroundImageFix"/>+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>+<feOffset/>+<feGaussianBlur stdDeviation="4.16667"/>+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>+<feBlend mode="overlay" in2="BackgroundImageFix" result="effect1_dropShadow"/>+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>+</filter>+<filter id="filter1_d" x="60.4167" y="-8.07558" width="47.9167" height="116.151" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">+<feFlood flood-opacity="0" result="BackgroundImageFix"/>+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>+<feOffset/>+<feGaussianBlur stdDeviation="4.16667"/>+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>+<feBlend mode="overlay" in2="BackgroundImageFix" result="effect1_dropShadow"/>+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>+</filter>+<linearGradient id="paint0_linear" x1="49.9392" y1="0.257812" x2="49.9392" y2="99.7423" gradientUnits="userSpaceOnUse">+<stop stop-color="white"/>+<stop offset="1" stop-color="white" stop-opacity="0"/>+</linearGradient>+</defs>+</svg>diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lockindex 9257a5e4a..dd04ec9f6 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -6516,6 +6516,15 @@ dependencies = ["thiserror 1.0.69",]+[[package]]+name = "jsonc-parser"+version = "0.33.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9ff5a48f48971be8e762a6ff955725a0802b6e46c441057992da5a673db9fd3a"+dependencies = [+ "serde_json",+]+[[package]]name = "jsonptr"version = "0.6.3"@@ -11607,6 +11616,7 @@ dependencies = ["http-body-util","hyper-util","image 0.25.10",+ "jsonc-parser","libc","lru","md5 0.7.0",diff --git a/apps/screenpipe-app-tauri/src-tauri/src/skills.rs b/apps/screenpipe-app-tauri/src-tauri/src/skills.rsindex 47c36509e..511083309 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/skills.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/skills.rs@@ -27,7 +27,7 @@ use tracing::{info, warn};pub(crate) const AI_TOOL_CHECK_INTERVAL: Duration = Duration::from_secs(60);-const AI_TOOL_AUTO_CONNECT_TARGETS: [&str; 10] = [+const AI_TOOL_AUTO_CONNECT_TARGETS: [&str; 11] = ["claude","claude-code","codex",@@ -37,6 +37,7 @@ const AI_TOOL_AUTO_CONNECT_TARGETS: [&str; 10] = ["hermes","runner","windsurf",+ "vscode","grokbot",];@@ -1836,6 +1837,10 @@ mod tests {ai_tool_auto_connect_opt_outs_in(&root),BTreeSet::from(["claude-code".to_string()]));+ set_ai_tool_auto_connect_opt_out_in(&root, "vscode", true).unwrap();+ assert!(ai_tool_auto_connect_opt_outs_in(&root).contains("vscode"));+ set_ai_tool_auto_connect_opt_out_in(&root, "vscode", false).unwrap();+ assert!(!ai_tool_auto_connect_opt_outs_in(&root).contains("vscode"));assert!(set_ai_tool_auto_connect_opt_out_in(&root, "../escape", true).is_err());let _ = std::fs::remove_dir_all(root);}diff --git a/crates/screenpipe-engine/Cargo.toml b/crates/screenpipe-engine/Cargo.tomlindex 6819c2818..e06a11910 100644--- a/crates/screenpipe-engine/Cargo.toml+++ b/crates/screenpipe-engine/Cargo.toml@@ -17,6 +17,7 @@ edition = { workspace = true }screenpipe-fs = { path = "../screenpipe-fs" }serde = { workspace = true }serde_json = { workspace = true }+jsonc-parser = { version = "0.33.2", features = ["cst", "serde_json"] }serde_yaml = { workspace = true }libc = { workspace = true }oasgen = { workspace = true }diff --git a/crates/screenpipe-engine/src/cli/agent.rs b/crates/screenpipe-engine/src/cli/agent.rsindex 9cf2a876c..8a2a7bd61 100644--- a/crates/screenpipe-engine/src/cli/agent.rs+++ b/crates/screenpipe-engine/src/cli/agent.rs@@ -55,7 +55,7 @@ pub enum AgentCommand {Setup {/// Which agent to wire up. Omit when using --all.#[arg(- value_parser = ["openclaw", "hermes", "claude-code", "claude-desktop", "codex", "cursor", "gemini", "runner", "windsurf"],+ value_parser = ["openclaw", "hermes", "claude-code", "claude-desktop", "codex", "cursor", "gemini", "runner", "windsurf", "vscode"],required_unless_present = "all",conflicts_with = "all")]@@ -75,7 +75,7 @@ pub enum AgentCommand {/// agent's own config or other skills.Remove {/// Which agent to unwire.- #[arg(value_parser = ["openclaw", "hermes", "claude-code", "claude-desktop", "codex", "cursor", "gemini", "runner", "windsurf"])]+ #[arg(value_parser = ["openclaw", "hermes", "claude-code", "claude-desktop", "codex", "cursor", "gemini", "runner", "windsurf", "vscode"])]target: String,},}@@ -251,6 +251,12 @@ fn detected_agents_in(home: &Path) -> Vec<DetectedAgent> {detected.push(DetectedAgent { target, name });}}+ if vscode_config(home).parent().is_some_and(Path::is_dir) {+ detected.push(DetectedAgent {+ target: "vscode",+ name: "VS Code",+ });+ }detected}@@ -297,15 +303,21 @@ fn has_screenpipe_mcp(layout: &AgentLayout) -> bool {return false;};match layout.mcp_format {- McpFormat::Json => serde_json::from_str::<serde_json::Value>(&existing)+ McpFormat::Json | McpFormat::VscodeJson => read_mcp_json(&existing, &layout.mcp_format).ok().and_then(|root| {- let servers = root.get("mcpServers")?.as_object()?;+ let servers = root+ .get(if layout.mcp_format == McpFormat::VscodeJson {+ "servers"+ } else {+ "mcpServers"+ })?+ .as_object()?;servers.get(screenpipe_json_key(servers)?).cloned()}).is_some_and(|entry| {!entry.is_null()- && (layout.name != "Runner"+ && (!matches!(layout.name, "Runner" | "VS Code")|| entry.get("type").and_then(|value| value.as_str()) == Some("stdio"))}),McpFormat::Toml => existing.lines().any(is_screenpipe_toml_table),@@ -397,6 +409,7 @@ struct AgentLayout {#[derive(PartialEq)]enum McpFormat {Json,+ VscodeJson,Yaml,Toml,}@@ -459,6 +472,14 @@ fn detected_desktop_agents_in(home: &Path) -> Vec<DesktopDetectedAgent> {});}}+ if vscode_config(home).parent().is_some_and(Path::is_dir) {+ detected.push(DesktopDetectedAgent {+ id: "vscode",+ name: "VS Code",+ mcp_target: "vscode",+ skills_target: None,+ });+ }detected}@@ -520,7 +541,7 @@ fn desktop_launch_config(args: vec!["x".to_string(), "screenpipe-mcp@latest".to_string()],env,transport: (agent.id == "openclaw").then_some("stdio".to_string()),- server_type: (agent.id == "runner").then_some("stdio".to_string()),+ server_type: matches!(agent.id, "runner" | "vscode").then_some("stdio".to_string()),}}@@ -529,10 +550,16 @@ fn desktop_mcp_ready(layout: &AgentLayout, launch: &McpLaunchConfig) -> bool {return false;};match layout.mcp_format {- McpFormat::Json => serde_json::from_str::<serde_json::Value>(&existing)+ McpFormat::Json | McpFormat::VscodeJson => read_mcp_json(&existing, &layout.mcp_format).ok().and_then(|root| {- let servers = root.get("mcpServers")?.as_object()?;+ let servers = root+ .get(if layout.mcp_format == McpFormat::VscodeJson {+ "servers"+ } else {+ "mcpServers"+ })?+ .as_object()?;servers.get(screenpipe_json_key(servers)?).cloned()}).is_some_and(|entry| {@@ -813,6 +840,13 @@ fn layout_in(target: &str, h: &Path) -> Result<AgentLayout> {mcp_path: h.join(".runner/mcp.json"),mcp_format: McpFormat::Json,},+ "vscode" => AgentLayout {+ client,+ name: "VS Code",+ skills_dir: None,+ mcp_path: vscode_config(h),+ mcp_format: McpFormat::VscodeJson,+ },"windsurf" => AgentLayout {client,name: "Windsurf",@@ -821,11 +855,128 @@ fn layout_in(target: &str, h: &Path) -> Result<AgentLayout> {mcp_format: McpFormat::Json,},other => anyhow::bail!(- "unknown agent target '{other}' (use: openclaw, hermes, claude-code, claude-desktop, codex, cursor, gemini, runner, windsurf)"+ "unknown agent target '{other}' (use: openclaw, hermes, claude-code, claude-desktop, codex, cursor, gemini, runner, windsurf, vscode)"),})}+/// Default VS Code user profile; never create workspace configs or infer an+/// install from ~/.vscode (which can contain extensions alone).+fn vscode_config(home: &Path) -> PathBuf {+ let config_dir = if dirs::home_dir().as_deref() == Some(home) {+ dirs::config_dir()+ } else {+ None+ }+ .unwrap_or_else(|| {+ if cfg!(target_os = "macos") {+ home.join("Library/Application Support")+ } else if cfg!(target_os = "windows") {+ home.join("AppData/Roaming")+ } else {+ home.join(".config")+ }+ });+ config_dir.join("Code/User/mcp.json")+}++fn parse_vscode_config(text: &str) -> Result<jsonc_parser::cst::CstRootNode> {+ let root = jsonc_parser::cst::CstRootNode::parse(+ text,+ &jsonc_parser::ParseOptions {+ allow_comments: true,+ allow_trailing_commas: true,+ allow_loose_object_property_names: false,+ allow_missing_commas: false,+ allow_single_quoted_strings: false,+ allow_hexadecimal_numbers: false,+ allow_unary_plus_numbers: false,+ },+ )?;+ // A comment-only/empty file can be initialized, but never replace a scalar.+ if root.value().is_some() && root.object_value().is_none() {+ anyhow::bail!("config is not a JSON object");+ }+ Ok(root)+}++fn read_mcp_json(text: &str, format: &McpFormat) -> Result<serde_json::Value> {+ if *format == McpFormat::VscodeJson {+ Ok(parse_vscode_config(text)?+ .to_serde_value()+ .unwrap_or(serde_json::json!({})))+ } else {+ Ok(serde_json::from_str(text)?)+ }+}++/// VS Code uses `servers`, not `mcpServers`, and accepts JSONC. Edit only the+/// owned entry so comments, inputs, sandbox rules and other servers survive.+fn update_vscode_mcp(path: &Path, launch: Option<&McpLaunchConfig>) -> Result<()> {+ use jsonc_parser::cst::CstInputValue as Input;+ let existing = read_config_text(path)?;+ if existing.is_none() && launch.is_none() {+ return Ok(());+ }+ let root = parse_vscode_config(existing.as_deref().unwrap_or("{}"))+ .with_context(|| format!("{} is not valid JSON; fix or remove it", path.display()))?;+ let obj = root+ .object_value_or_create()+ .context("config is not a JSON object")?;+ let servers = obj+ .object_value_or_create("servers")+ .context("servers is present but not an object")?;+ let matching: Vec<_> = servers+ .properties()+ .into_iter()+ .filter(|prop| {+ prop.decoded_name()+ .is_some_and(|name| name.eq_ignore_ascii_case("screenpipe"))+ })+ .collect();+ if let Some(launch) = launch {+ // Keep server-specific user options such as sandboxEnabled and cwd.+ // Only the launch fields belong to Screenpipe's automatic setup.+ let entry = if let Some(prop) = matching.first() {+ prop.object_value_or_set()+ } else {+ servers.object_value_or_set("screenpipe")+ };+ for duplicate in matching.into_iter().skip(1) {+ duplicate.remove();+ }+ for (key, value) in [+ ("type", Input::from("stdio")),+ ("command", launch.command.clone().into()),+ ("args", launch.args.clone().into()),+ (+ "env",+ Input::Object(+ launch+ .env+ .iter()+ .map(|(key, value)| (key.clone(), value.clone().into()))+ .collect(),+ ),+ ),+ ] {+ if let Some(prop) = entry.get(key) {+ prop.set_value(value);+ } else {+ entry.append(key, value);+ }+ }+ } else {+ if matching.is_empty() {+ return Ok(());+ }+ for prop in matching {+ prop.remove();+ }+ }+ replace_config(path, existing.as_deref(), &root.to_string())+}+/// Claude Desktop's MCP config path (the desktop app is macOS/Windows only).fn claude_desktop_config(home: &Path) -> Result<PathBuf> {if cfg!(target_os = "macos") {@@ -990,6 +1141,11 @@ fn setup(target: &str, api_url: &str) -> Result<()> {}match l.mcp_format {+ McpFormat::VscodeJson => {+ let mut launch = cli_launch_config(remote, api_url);+ launch.server_type = Some("stdio".to_string());+ update_vscode_mcp(&l.mcp_path, Some(&launch))?;+ }McpFormat::Json if target == "runner" => {let mut launch = cli_launch_config(remote, api_url);launch.server_type = Some("stdio".to_string());@@ -1086,6 +1242,7 @@ fn remove(target: &str) -> Result<()> {}match l.mcp_format {+ McpFormat::VscodeJson => update_vscode_mcp(&l.mcp_path, None)?,McpFormat::Json => remove_mcp_json(&l.mcp_path)?,McpFormat::Toml => remove_mcp_toml(&l.mcp_path)?,McpFormat::Yaml => remove_mcp_yaml(&l.mcp_path)?,@@ -1298,6 +1455,7 @@ fn cli_launch_config(remote: bool, api_url: &str) -> McpLaunchConfig {fn merge_mcp_launch(layout: &AgentLayout, launch: &McpLaunchConfig) -> Result<()> {match layout.mcp_format {+ McpFormat::VscodeJson => update_vscode_mcp(&layout.mcp_path, Some(launch)),McpFormat::Json => merge_mcp_json_launch(&layout.mcp_path, launch),McpFormat::Yaml => merge_mcp_yaml_launch(&layout.mcp_path, launch),McpFormat::Toml => merge_mcp_toml_launch(&layout.mcp_path, launch),@@ -1548,6 +1706,134 @@ fn merge_mcp_toml_launch(path: &Path, launch: &McpLaunchConfig) -> Result<()> {mod tests {use super::*;+ #[test]+ fn test_vscode_background_jsonc_lifecycle() {+ let dir = tempfile::tempdir().unwrap();+ let home = dir.path();+ let config = vscode_config(home);+ let bun = home.join("bundled bun");+ let mut reconciler = DesktopAgentReconciler::default();+ let opts = BTreeSet::new();+ assert_eq!(+ reconciler+ .reconcile(home, &bun, Some("test-key"), "http://localhost:3039", &opts)+ .detected,+ 0+ );+ std::fs::create_dir_all(config.parent().unwrap()).unwrap();+ std::fs::write(+ &config,+ r#"{+ // keep my servers+ "servers": { "existing": { "type": "http", "url": "https://example.com" }, },+ "inputs": [{ "id": "token", "type": "promptString" }],+ "sandbox": { "network": { "allowedDomains": ["example.com"] } },+}"#,+ )+ .unwrap();+ let report =+ reconciler.reconcile(home, &bun, Some("test-key"), "http://localhost:3039", &opts);+ assert_eq!(report.connected, 1, "{:?}", report.failures);+ let written = std::fs::read_to_string(&config).unwrap();+ assert!(written.contains("// keep my servers"));+ let root = read_mcp_json(&written, &McpFormat::VscodeJson).unwrap();+ assert!(root.get("mcpServers").is_none());+ assert_eq!(root["servers"]["existing"]["url"], "https://example.com");+ assert_eq!(root["inputs"][0]["id"], "token");+ assert_eq!(+ root["sandbox"]["network"]["allowedDomains"][0],+ "example.com"+ );+ let entry = &root["servers"]["screenpipe"];+ assert_eq!(entry["type"], "stdio");+ assert_eq!(entry["command"], bun.to_string_lossy().as_ref());+ assert_eq!(entry["env"]["SCREENPIPE_LOCAL_API_KEY"], "test-key");+ assert_eq!(entry["env"]["SCREENPIPE_API_URL"], "http://localhost:3039");+ assert_eq!(entry["env"]["SCREENPIPE_MCP_CLIENT"], "vscode");+ let report =+ reconciler.reconcile(home, &bun, Some("test-key"), "http://localhost:3039", &opts);+ assert_eq!(report.already_connected, 1);+ assert_eq!(std::fs::read_to_string(&config).unwrap(), written);+ let restarted = DesktopAgentReconciler::default().reconcile(+ home,+ &bun,+ Some("test-key"),+ "http://localhost:3039",+ &opts,+ );+ assert_eq!(restarted.already_connected, 1);+ assert_eq!(std::fs::read_to_string(&config).unwrap(), written);+ update_vscode_mcp(&config, None).unwrap();+ let opts = BTreeSet::from(["vscode".to_string()]);+ assert_eq!(+ reconciler+ .reconcile(home, &bun, None, "http://localhost:3030", &opts)+ .opted_out,+ 1+ );+ let disconnected = std::fs::read_to_string(&config).unwrap();+ assert!(!disconnected.contains("screenpipe"));+ assert!(disconnected.contains("// keep my servers"));+ assert_eq!(+ reconciler+ .reconcile(home, &bun, None, "http://localhost:3030", &BTreeSet::new())+ .connected,+ 1+ );+ }++ #[test]+ fn test_vscode_refuses_invalid_configs_without_modifying_them() {+ let dir = tempfile::tempdir().unwrap();+ let config = vscode_config(dir.path());+ std::fs::create_dir_all(config.parent().unwrap()).unwrap();+ let launch = cli_launch_config(false, "http://localhost:3030");+ for original in [+ "[]",+ "null",+ r#"{"servers": []}"#,+ r#"{"servers": null}"#,+ r#"{"servers": { broken }}"#,+ r#"{"servers": {} "inputs": []}"#,+ ] {+ std::fs::write(&config, original).unwrap();+ assert!(+ update_vscode_mcp(&config, Some(&launch)).is_err(),+ "{original}"+ );+ assert_eq!(std::fs::read_to_string(&config).unwrap(), original);+ }+ }++ #[test]+ fn test_vscode_cli_setup_and_remove_preserve_other_servers() {+ let dir = tempfile::tempdir().unwrap();+ let config = vscode_config(dir.path());+ std::fs::create_dir_all(config.parent().unwrap()).unwrap();+ std::fs::write(+ &config,+ r#"{"servers":{"Screenpipe":{"command":"old","sandboxEnabled":true,"cwd":"/project"},"other":{"type":"http"}}}"#,+ )+ .unwrap();+ assert!(detected_agents_in(dir.path())+ .iter()+ .any(|agent| agent.target == "vscode"));+ let layout = layout_in("vscode", dir.path()).unwrap();+ merge_mcp_launch(&layout, &cli_launch_config(false, "http://localhost:3030")).unwrap();+ assert!(is_agent_setup_in("vscode", dir.path()));+ let root = read_mcp_json(+ &std::fs::read_to_string(&config).unwrap(),+ &McpFormat::VscodeJson,+ )+ .unwrap();+ assert_eq!(root["servers"].as_object().unwrap().len(), 2);+ assert_eq!(root["servers"]["Screenpipe"]["sandboxEnabled"], true);+ assert_eq!(root["servers"]["Screenpipe"]["cwd"], "/project");+ update_vscode_mcp(&config, None).unwrap();+ assert!(!is_agent_setup_in("vscode", dir.path()));+ assert!(std::fs::read_to_string(&config).unwrap().contains("other"));+ }+#[test]fn test_host_port() {assert_eq!(host_port("http://localhost:3030"), "localhost:3030");diff --git a/crates/screenpipe-engine/src/qualified_value.rs b/crates/screenpipe-engine/src/qualified_value.rsindex 001c4308f..c113f18d1 100644--- a/crates/screenpipe-engine/src/qualified_value.rs+++ b/crates/screenpipe-engine/src/qualified_value.rs@@ -18,6 +18,7 @@ pub(crate) enum AgentClient {Hermes,Runner,Windsurf,+ Vscode,Grok,Grokbot,#[default]@@ -42,6 +43,7 @@ impl AgentClient {Self::Hermes => "hermes",Self::Runner => "runner",Self::Windsurf => "windsurf",+ Self::Vscode => "vscode",Self::Grok => "grok",Self::Grokbot => "grokbot",Self::Unknown => "unknown",@@ -181,7 +183,7 @@ mod tests {fn api_and_mcp_share_fixed_app_identifiers() {for name in ["claude", "chatgpt", "codex", "cursor", "gemini", "openclaw", "hermes", "runner",- "windsurf", "grok", "grokbot",+ "windsurf", "vscode", "grok", "grokbot",] {let client = AgentClient::from_name(name);let api = api_outcome_properties(ApiOutcomeKind::SearchResult, client);diff --git a/docs/COVERAGE.md b/docs/COVERAGE.mdindex f9c00d05f..4794ba7dd 100644--- a/docs/COVERAGE.md+++ b/docs/COVERAGE.md@@ -38,15 +38,15 @@ results and `cargo llvm-cov` data on top when judging release confidence.- Mapped suites: 35- Mapped Rust files: 372-- Active test blocks: 3658+- Active test blocks: 3661- Ignored/manual test blocks: 164-- Weighted coverage points: 3018.9+- Weighted coverage points: 3021.0| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score || --- | --- | --- | --- | --- | --- | --- | --- |-| windows | 31 | 3512 | 150 | 2952.6 | 21 | 11 | 100% |-| macos | 31 | 3557 | 125 | 2954.4 | 22 | 11 | 100% |-| linux | 28 | 3114 | 125 | 2589.3 | 20 | 11 | 100% |+| windows | 31 | 3515 | 150 | 2954.7 | 21 | 11 | 100% |+| macos | 31 | 3560 | 125 | 2956.5 | 22 | 11 | 100% |+| linux | 28 | 3117 | 125 | 2591.4 | 20 | 11 | 100% |## Refreshdiff --git a/docs/coverage/CORE.md b/docs/coverage/CORE.mdindex 64d3e55e4..cb17ef747 100644--- a/docs/coverage/CORE.md+++ b/docs/coverage/CORE.md@@ -9,10 +9,10 @@ confidence, and criticality.- Tracked crates: screenpipe-engine, screenpipe-db, screenpipe-sqlite-coordinator, screenpipe-audio, screenpipe-screen, screenpipe-a11y, screenpipe-fs- Mapped suites: 35- Mapped Rust files: 372-- Active test blocks: 3658+- Active test blocks: 3661- Ignored/manual test blocks: 164-- Declared test blocks: 3822-- Weighted coverage points: 3018.9+- Declared test blocks: 3825+- Weighted coverage points: 3021.0Confidence weights: strong=1.0, partial=0.7, conditional=0.4, smoke=0.3.Criticality weights: high=1.0, medium=0.7, low=0.4.@@ -23,15 +23,15 @@ are explicitly enabled in a runtime lane.| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score || --- | --- | --- | --- | --- | --- | --- | --- |-| windows | 31 | 3512 | 150 | 2952.6 | 21 | 11 | 100% |-| macos | 31 | 3557 | 125 | 2954.4 | 22 | 11 | 100% |-| linux | 28 | 3114 | 125 | 2589.3 | 20 | 11 | 100% |+| windows | 31 | 3515 | 150 | 2954.7 | 21 | 11 | 100% |+| macos | 31 | 3560 | 125 | 2956.5 | 22 | 11 | 100% |+| linux | 28 | 3117 | 125 | 2591.4 | 20 | 11 | 100% |## Crate Summary| Crate | Suites | Integration files | Source unit files | Active tests | Ignored tests | Weighted points | Flows || --- | --- | --- | --- | --- | --- | --- | --- |-| screenpipe-engine | 12 | 21 | 123 | 1771 | 51 | 1363.5 | 10 |+| screenpipe-engine | 12 | 21 | 123 | 1774 | 51 | 1365.6 | 10 || screenpipe-db | 5 | 62 | 25 | 577 | 25 | 549.1 | 9 || screenpipe-sqlite-coordinator | 1 | 0 | 3 | 27 | 0 | 27.0 | 2 || screenpipe-audio | 6 | 25 | 52 | 649 | 45 | 568.8 | 5 |@@ -70,19 +70,19 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| db-search | 2 suites / 113 active / 9 ignored / 113.0 pts | 2 suites / 113 active / 9 ignored / 113.0 pts | 2 suites / 113 active / 9 ignored / 113.0 pts || engine-lifecycle | 6 suites / 247 active / 1 ignored / 222.0 pts | 6 suites / 247 active / 1 ignored / 222.0 pts | 6 suites / 243 active / 9 ignored / 221.1 pts || local-api | 3 suites / 462 active / 10 ignored / 325.8 pts | 3 suites / 462 active / 10 ignored / 325.8 pts | 3 suites / 462 active / 10 ignored / 325.8 pts |-| meeting | 6 suites / 1660 active / 21 ignored / 1355.8 pts | 6 suites / 1660 active / 21 ignored / 1355.8 pts | 4 suites / 1311 active / 17 ignored / 1030.5 pts |+| meeting | 6 suites / 1663 active / 21 ignored / 1357.9 pts | 6 suites / 1663 active / 21 ignored / 1357.9 pts | 4 suites / 1314 active / 17 ignored / 1032.6 pts || ocr | 4 suites / 125 active / 7 ignored / 119.0 pts | 4 suites / 129 active / 7 ignored / 124.5 pts | 3 suites / 120 active / 6 ignored / 115.5 pts || os-integration | 1 suites / 6 active / 0 ignored / 1.7 pts | 1 suites / 6 active / 0 ignored / 1.7 pts | - || performance | 13 suites / 1601 active / 77 ignored / 1415.5 pts | 14 suites / 1709 active / 81 ignored / 1458.7 pts | 13 suites / 1601 active / 77 ignored / 1415.5 pts |-| pipes | 1 suites / 515 active / 3 ignored / 360.5 pts | 1 suites / 515 active / 3 ignored / 360.5 pts | 1 suites / 515 active / 3 ignored / 360.5 pts |-| privacy | 5 suites / 965 active / 42 ignored / 780.2 pts | 5 suites / 1006 active / 17 ignored / 776.5 pts | 5 suites / 925 active / 14 ignored / 746.5 pts |+| pipes | 1 suites / 518 active / 3 ignored / 362.6 pts | 1 suites / 518 active / 3 ignored / 362.6 pts | 1 suites / 518 active / 3 ignored / 362.6 pts |+| privacy | 5 suites / 968 active / 42 ignored / 782.3 pts | 5 suites / 1009 active / 17 ignored / 778.6 pts | 5 suites / 928 active / 14 ignored / 748.6 pts || real-app | - | 1 suites / 108 active / 4 ignored / 43.2 pts | - || speaker | 2 suites / 376 active / 9 ignored / 376.0 pts | 2 suites / 376 active / 9 ignored / 376.0 pts | 2 suites / 376 active / 9 ignored / 376.0 pts || storage | 4 suites / 660 active / 38 ignored / 547.5 pts | 4 suites / 660 active / 38 ignored / 547.5 pts | 4 suites / 660 active / 38 ignored / 547.5 pts |-| sync | 1 suites / 515 active / 3 ignored / 360.5 pts | 1 suites / 515 active / 3 ignored / 360.5 pts | 1 suites / 515 active / 3 ignored / 360.5 pts |+| sync | 1 suites / 518 active / 3 ignored / 362.6 pts | 1 suites / 518 active / 3 ignored / 362.6 pts | 1 suites / 518 active / 3 ignored / 362.6 pts || timeline | 4 suites / 1198 active / 43 ignored / 981.4 pts | 4 suites / 1198 active / 43 ignored / 981.4 pts | 4 suites / 1198 active / 43 ignored / 981.4 pts || transcription | 5 suites / 842 active / 43 ignored / 659.5 pts | 5 suites / 842 active / 43 ignored / 659.5 pts | 5 suites / 842 active / 43 ignored / 659.5 pts |-| ui-events | 4 suites / 781 active / 34 ignored / 592.6 pts | 3 suites / 714 active / 5 ignored / 545.7 pts | 3 suites / 714 active / 5 ignored / 545.7 pts |+| ui-events | 4 suites / 784 active / 34 ignored / 594.7 pts | 3 suites / 717 active / 5 ignored / 547.8 pts | 3 suites / 717 active / 5 ignored / 547.8 pts || vision-capture | 6 suites / 553 active / 32 ignored / 437.5 pts | 6 suites / 557 active / 32 ignored / 443.0 pts | 5 suites / 548 active / 31 ignored / 434.0 pts |## Critical Flow Matrix@@ -141,7 +141,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| engine-focus-os | screenpipe-engine | windows, macos | engine-lifecycle, os-integration | engine-health-lifecycle, performance-liveness | medium | conditional | unit | 3 | 6 | 0 | Platform focus-tracker parsing/helpers. These files are cfg-gated and only execute on their target OS. || engine-linux-keep-awake | screenpipe-engine | linux | engine-lifecycle | engine-health-lifecycle | high | conditional | mixed | 1 | 2 | 8 | Existing isolated-process missing/stalled bus regressions plus ignored live logind inhibitor tests. Live tests require logind and explicit execution. || engine-local-api-search-integration | screenpipe-engine | windows, macos, linux | local-api, db-search | local-api-search | high | strong | integration | 1 | 8 | 5 | Active /search route test builds an audio-disabled router, seeds captured-screen-shaped OCR data into an in-memory DB, and asserts the HTTP response and pagination. |-| engine-meeting-privacy-sync | screenpipe-engine | windows, macos, linux | meeting, privacy, ui-events, pipes, sync | meeting-live-notes, privacy-and-redaction, accessibility-ui-events, performance-liveness | medium | strong | unit | 32 | 515 | 3 | Unit-heavy coverage for privacy filter policy, capture exclusions, UI recorder safety, pipes/live-view/structured-output helpers, sync helpers, and CLI parsing. Meeting detection moved to the engine-meeting-watcher suite. |+| engine-meeting-privacy-sync | screenpipe-engine | windows, macos, linux | meeting, privacy, ui-events, pipes, sync | meeting-live-notes, privacy-and-redaction, accessibility-ui-events, performance-liveness | medium | strong | unit | 32 | 518 | 3 | Unit-heavy coverage for privacy filter policy, capture exclusions, UI recorder safety, pipes/live-view/structured-output helpers, sync helpers, and CLI parsing. Meeting detection moved to the engine-meeting-watcher suite. || engine-meeting-watcher | screenpipe-engine | windows, macos | meeting | meeting-live-notes | high | strong | mixed | 10 | 270 | 3 | Successor of src/meeting_detector.rs and src/meeting_telemetry.rs. Audio-process and UI-scan backend state machines, candidate resolution, shared telemetry, and a scored trajectory eval. ui_scan/macos.rs and ui_scan/windows.rs are cfg-gated and only execute on their target OS; both backends are null on Linux. || engine-retention-storage | screenpipe-engine | windows, macos, linux | storage, engine-lifecycle, performance | engine-health-lifecycle, performance-liveness | medium | strong | mixed | 5 | 39 | 0 | Local retention deletion (including lean-mode heavy-text stripping), cloud archive watermarking, atomic state-file replacement, and the low-disk capture monitor. || engine-telemetry-observability | screenpipe-engine | windows, macos, linux | engine-lifecycle, performance | engine-health-lifecycle, performance-liveness | medium | strong | unit | 6 | 30 | 0 | PostHog capture gating, telemetry context shaping, piggyback telemetry forwarding, crash-log helpers, resource monitoring, and the recording-coverage reliability metric. |@@ -366,7 +366,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| engine-config-lifecycle | screenpipe-engine | src/bin/screenpipe-engine.rs | source | 4 | 0 | 4 || engine-meeting-privacy-sync | screenpipe-engine | src/calendar_speaker_id.rs | source | 41 | 0 | 41 || engine-meeting-privacy-sync | screenpipe-engine | src/capture_exclusions.rs | source | 7 | 0 | 7 |-| engine-meeting-privacy-sync | screenpipe-engine | src/cli/agent.rs | source | 38 | 0 | 38 |+| engine-meeting-privacy-sync | screenpipe-engine | src/cli/agent.rs | source | 41 | 0 | 41 || engine-db-recovery-cli | screenpipe-engine | src/cli/db.rs | source | 29 | 0 | 29 || engine-meeting-privacy-sync | screenpipe-engine | src/cli/install.rs | source | 4 | 0 | 4 || engine-meeting-privacy-sync | screenpipe-engine | src/cli/login.rs | source | 1 | 0 | 1 |diff --git a/packages/screenpipe-mcp/README.md b/packages/screenpipe-mcp/README.mdindex 6e73fe1a1..9972e0da0 100644--- a/packages/screenpipe-mcp/README.md+++ b/packages/screenpipe-mcp/README.md@@ -13,7 +13,7 @@ MCP server for screenpipe - search your screen recordings, audio transcriptions,When Screenpipe analytics are enabled, successful nonempty retrievals produce`qualified_value_event` with `surface` (`api` or `mcp`) and `agent_client`.Supported app identifiers are `claude`, `chatgpt`, `codex`, `cursor`, `gemini`,-`openclaw`, `hermes`, `runner`, `windsurf`, `grok`, and `grokbot`. Claude Desktop+`openclaw`, `hermes`, `runner`, `windsurf`, `vscode`, `grok`, and `grokbot`. Claude Desktopand Claude Code share the existing `claude` bucket. This identifies the caller,not the app appearing in a recording.diff --git a/packages/screenpipe-mcp/src/qualified-value.test.ts b/packages/screenpipe-mcp/src/qualified-value.test.tsindex 0cde53e36..bf62281df 100644--- a/packages/screenpipe-mcp/src/qualified-value.test.ts+++ b/packages/screenpipe-mcp/src/qualified-value.test.ts@@ -55,6 +55,7 @@ describe("createMcpQualifiedValueReporter", () => {["chatgpt", "ChatGPT", "chatgpt"],["gemini", "gemini-cli", "gemini"],["runner", "Runner", "runner"],+ ["vscode", "vscode", "vscode"],["grokbot", "Grok Bot", "grokbot"],])("recognizes configured %s and its handshake name", (configured, protocol, expected) => {expect(resolveMcpClient(configured, "unrecognized-client")).toBe(expected);diff --git a/packages/screenpipe-mcp/src/qualified-value.ts b/packages/screenpipe-mcp/src/qualified-value.tsindex b4a0d12a9..c2dcf2096 100644--- a/packages/screenpipe-mcp/src/qualified-value.ts+++ b/packages/screenpipe-mcp/src/qualified-value.ts@@ -4,7 +4,7 @@const CLIENTS = ["claude", "chatgpt", "codex", "cursor", "gemini", "openclaw",- "hermes", "runner", "windsurf", "grok", "grokbot",+ "hermes", "runner", "windsurf", "vscode", "grok", "grokbot",] as const;export type McpClient = (typeof CLIENTS)[number] | "unknown";