From be2008dff58a7e7f9d2017b1613f07119d80b5d5 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Tue, 23 Sep 2025 01:17:53 +0000 Subject: [PATCH 1/6] Rename CONTRIBUTING.md file (#433) - Renamed CONTRIBUTE.md to CONTRIBUTING.md to follow standard GitHub conventions. --- CONTRIBUTE.md => CONTRIBUTING.md | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename CONTRIBUTE.md => CONTRIBUTING.md (100%) diff --git a/CONTRIBUTE.md b/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTE.md rename to CONTRIBUTING.md diff --git a/README.md b/README.md index de2bdea7..83c88559 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ We welcome contributions from developers of all skill levels! Whether you're fix 3. **Set up your environment** by copying `.env.example` to `.env.local` 4. **Start developing** with `bun run dev` -For detailed guidelines, development setup, coding standards, and the complete contribution workflow, please see our [**Contributing Guide**](CONTRIBUTE.md). +For detailed guidelines, development setup, coding standards, and the complete contribution workflow, please see our [**Contributing Guide**](CONTRIBUTING.md). ### Ways to Contribute From 8c92aad6a78fe7a3229dc4ed4b1a81ff52340d5c Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Tue, 23 Sep 2025 21:08:55 +0000 Subject: [PATCH 2/6] Update ADD_MEMORY_SHORTCUT_URL to new URL (#434) --- packages/lib/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index fde5bce1..967beb19 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -3,7 +3,7 @@ const DEFAULT_PROJECT_ID = "sm_project_default" const SEARCH_MEMORY_SHORTCUT_URL = "https://www.icloud.com/shortcuts/f2b5c544372844a38ab4c6900e2a88de" const ADD_MEMORY_SHORTCUT_URL = - "https://www.icloud.com/shortcuts/ec33b029b2c7481d89eda7640dbb7688" + "https://www.icloud.com/shortcuts/0fd3e855be444845b457f94c78c2c8d9" export { BIG_DIMENSIONS_NEW, From 3c4045ba8948c648c4db22cce9952fe9e9e7b427 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Tue, 23 Sep 2025 23:25:34 +0000 Subject: [PATCH 3/6] feat: add one click install to cursor on connect to ai modal (#436) --- apps/web/components/connect-ai-modal.tsx | 217 ++++++++++++++++++----- 1 file changed, 177 insertions(+), 40 deletions(-) diff --git a/apps/web/components/connect-ai-modal.tsx b/apps/web/components/connect-ai-modal.tsx index 6500ba23..2d29dd55 100644 --- a/apps/web/components/connect-ai-modal.tsx +++ b/apps/web/components/connect-ai-modal.tsx @@ -27,6 +27,7 @@ import { useEffect, useState } from "react" import { toast } from "sonner" import { z } from "zod/v4" import { analytics } from "@/lib/analytics" +import { cn } from "@lib/utils" const clients = { cursor: "Cursor", @@ -79,6 +80,9 @@ export function ConnectAIModal({ const setIsOpen = onOpenChange || setInternalIsOpen const [isMigrateDialogOpen, setIsMigrateDialogOpen] = useState(false) const [selectedProject, setSelectedProject] = useState("none") + const [cursorInstallTab, setCursorInstallTab] = useState< + "oneClick" | "manual" + >("oneClick") const projectId = localStorage.getItem("selectedProject") ?? "default" useEffect(() => { @@ -164,6 +168,10 @@ export function ConnectAIModal({ return command } + function getCursorDeeplink() { + return "https://cursor.com/en/install-mcp?name=supermemory-mcp&config=eyJjb21tYW5kIjoibnB4IC15IG1jcC1yZW1vdGUgaHR0cHM6Ly9hcGkuc3VwZXJtZW1vcnkuYWkvbWNwIn0%3D" + } + const copyToClipboard = () => { const command = generateInstallCommand() navigator.clipboard.writeText(command) @@ -252,21 +260,142 @@ export function ConnectAIModal({ - {/* Step 2: Project Selection or MCP URL */} + {/* Step 2: One-click Install for Cursor, Project Selection for others, or MCP URL */} {selectedClient && (
-
-
- 2 +
+
+
+ 2 +
+

+ {selectedClient === "cursor" + ? "Install Supermemory MCP" + : selectedClient === "mcp-url" + ? "MCP Server URL" + : "Select Target Project (Optional)"} +

+
+ +
+ {/* Tabs */} +
+
+ + +
+
-

- {selectedClient === "mcp-url" - ? "MCP Server URL" - : "Select Target Project (Optional)"} -

- {selectedClient === "mcp-url" ? ( + {selectedClient === "cursor" ? ( +
+ {/* Tab Content */} + {cursorInstallTab === "oneClick" ? ( +
+
+
+

+ Click the button below to automatically install and + configure Supermemory in Cursor +

+

+ This will install the MCP server without any + additional setup required +

+
+ { + analytics.mcpInstallCmdCopied() + toast.success("Opening Cursor installer...") + }} + > + Add Supermemory MCP server to Cursor + +
+

+ Make sure you have Cursor installed on your system +

+
+ ) : ( +
+

+ Choose a project and follow the installation steps below +

+
+ +
+
+ )} +
+ ) : selectedClient === "mcp-url" ? (
)} - {/* Step 3: Command Line */} - {selectedClient && selectedClient !== "mcp-url" && ( -
-
-
- 3 + {/* Step 3: Command Line - Show for manual installation or non-cursor clients */} + {selectedClient && + selectedClient !== "mcp-url" && + (selectedClient !== "cursor" || cursorInstallTab === "manual") && ( +
+
+
+ 3 +
+

+ {selectedClient === "cursor" && + cursorInstallTab === "manual" + ? "Manual Installation Command" + : "Installation Command"} +

-

Installation Command

+ +
+ + +
+ +

+ {selectedClient === "cursor" && cursorInstallTab === "manual" + ? "Copy and run this command in your terminal for manual installation (or switch to the one-click option above)" + : "Copy and run this command in your terminal to install the MCP server"} +

+ )} -
- - -
- -

- Copy and run this command in your terminal to install the MCP - server -

-
- )} - - {/* Blurred Command Placeholder */} + {/* Blurred Command Placeholder - Only show when no client selected */} {!selectedClient && (
From 5f09fe0cf13bb78d9a55cc9554bb66e3f3caa86f Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Wed, 24 Sep 2025 20:59:56 +0000 Subject: [PATCH 4/6] fix(pricing): update the new pricing limits on pro plan (#439) --- apps/web/components/views/billing.tsx | 2 +- apps/web/components/views/profile.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/components/views/billing.tsx b/apps/web/components/views/billing.tsx index 033a3915..8b79eb23 100644 --- a/apps/web/components/views/billing.tsx +++ b/apps/web/components/views/billing.tsx @@ -216,7 +216,7 @@ export function BillingView() {
  • - 5000 memories + Unlimited memories
  • diff --git a/apps/web/components/views/profile.tsx b/apps/web/components/views/profile.tsx index 9fa086ec..3d49d395 100644 --- a/apps/web/components/views/profile.tsx +++ b/apps/web/components/views/profile.tsx @@ -301,7 +301,7 @@ export function ProfileView() {
    • - 5000 memories + Unlimited memories
    • From 7e8b65b36dce243babeefe27ef1739cb4c495beb Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Wed, 24 Sep 2025 21:02:05 +0000 Subject: [PATCH 5/6] feat(extension): Auto Logout when token is invalidated, Account Section (#438) ## Changes: - Added token validation logic that checks if the current auth token is still valid - Implemented automatic logout when token is invalidated with appropriate user feedback - Added an Account section in the popup that displays the user's email - Improved error toast messages with clearer formatting and helper text ![image.png](https://app.graphite.dev/user-attachments/assets/b751f6a4-1a33-42d1-88dd-61aff55dd1c7.png)![image.png](https://app.graphite.dev/user-attachments/assets/202f69f9-c853-4801-850e-ee6d115e300c.png) --- .../entrypoints/popup/App.tsx | 106 +++++++++++++++--- apps/browser-extension/utils/api.ts | 29 +++++ apps/browser-extension/utils/query-hooks.ts | 12 ++ apps/browser-extension/utils/ui-components.ts | 52 +++++++-- apps/browser-extension/wxt.config.ts | 2 +- 5 files changed, 173 insertions(+), 28 deletions(-) diff --git a/apps/browser-extension/entrypoints/popup/App.tsx b/apps/browser-extension/entrypoints/popup/App.tsx index 3e4f15e2..c6e8468c 100644 --- a/apps/browser-extension/entrypoints/popup/App.tsx +++ b/apps/browser-extension/entrypoints/popup/App.tsx @@ -1,11 +1,13 @@ import { useQueryClient } from "@tanstack/react-query" import { useEffect, useState } from "react" import "./App.css" +import { validateAuthToken } from "../../utils/api" import { MESSAGE_TYPES, STORAGE_KEYS } from "../../utils/constants" import { useDefaultProject, useProjects, useSetDefaultProject, + useUserData, } from "../../utils/query-hooks" import type { Project } from "../../utils/types" @@ -20,6 +22,7 @@ function App() { "save", ) const [autoSearchEnabled, setAutoSearchEnabled] = useState(false) + const [authInvalidated, setAuthInvalidated] = useState(false) const queryClient = useQueryClient() const { data: projects = [], isLoading: loadingProjects } = useProjects({ @@ -28,8 +31,12 @@ function App() { const { data: defaultProject } = useDefaultProject({ enabled: userSignedIn, }) + const { data: userData, isLoading: loadingUserData } = useUserData({ + enabled: userSignedIn, + }) const setDefaultProjectMutation = useSetDefaultProject() + // biome-ignore lint/correctness/useExhaustiveDependencies: suppress dependency analysis useEffect(() => { const checkAuthStatus = async () => { try { @@ -37,8 +44,28 @@ function App() { STORAGE_KEYS.BEARER_TOKEN, STORAGE_KEYS.AUTO_SEARCH_ENABLED, ]) - const isSignedIn = !!result[STORAGE_KEYS.BEARER_TOKEN] - setUserSignedIn(isSignedIn) + const hasToken = !!result[STORAGE_KEYS.BEARER_TOKEN] + + if (hasToken) { + const isTokenValid = await validateAuthToken() + + if (isTokenValid) { + setUserSignedIn(true) + setAuthInvalidated(false) + } else { + await chrome.storage.local.remove([ + STORAGE_KEYS.BEARER_TOKEN, + STORAGE_KEYS.USER_DATA, + STORAGE_KEYS.DEFAULT_PROJECT, + ]) + queryClient.clear() + setUserSignedIn(false) + setAuthInvalidated(true) + } + } else { + setUserSignedIn(false) + setAuthInvalidated(false) + } const autoSearchSetting = result[STORAGE_KEYS.AUTO_SEARCH_ENABLED] ?? false @@ -46,6 +73,7 @@ function App() { } catch (error) { console.error("Error checking auth status:", error) setUserSignedIn(false) + setAuthInvalidated(false) } finally { setLoading(false) } @@ -397,6 +425,34 @@ function App() {
) : (
+ {/* Account Section */} +
+

+ Account +

+
+ {loadingUserData ? ( +
+ Loading account data... +
+ ) : userData?.email ? ( +
+ + Email + + + {userData.email} + +
+ ) : ( +
+ No email found +
+ )} +
+
+ + {/* Chat Integration Section */}

Chat Integration @@ -480,23 +536,37 @@ function App() {

) : (
-
-

- Login to unlock all chrome extension features -

+ {authInvalidated ? ( +
+
+

+ Session Expired +

+

+ Logged out since authentication was invalidated. Please + login again. +

+
+
+ ) : ( +
+

+ Login to unlock all chrome extension features +

-
    -
  • - Save any page to your supermemory -
  • -
  • - Import all your Twitter / X Bookmarks -
  • -
  • - Import your ChatGPT Memories -
  • -
-
+
    +
  • + Save any page to your supermemory +
  • +
  • + Import all your Twitter / X Bookmarks +
  • +
  • + Import your ChatGPT Memories +
  • +
+
+ )}

diff --git a/apps/browser-extension/utils/api.ts b/apps/browser-extension/utils/api.ts index 2a4c838b..d98b39f5 100644 --- a/apps/browser-extension/utils/api.ts +++ b/apps/browser-extension/utils/api.ts @@ -99,6 +99,35 @@ export async function setDefaultProject(project: Project): Promise { } } +/** + * Validate if current bearer token is still valid + */ +export async function validateAuthToken(): Promise { + try { + await makeAuthenticatedRequest("/v3/projects") + return true + } catch (error) { + if (error instanceof AuthenticationError) { + return false + } + console.error("Failed to validate auth token:", error) + return true + } +} + +/** + * Get user data from storage + */ +export async function getUserData(): Promise<{ email?: string } | null> { + try { + const result = await chrome.storage.local.get([STORAGE_KEYS.USER_DATA]) + return result[STORAGE_KEYS.USER_DATA] || null + } catch (error) { + console.error("Failed to get user data:", error) + return null + } +} + /** * Save memory to Supermemory API */ diff --git a/apps/browser-extension/utils/query-hooks.ts b/apps/browser-extension/utils/query-hooks.ts index 721a68ad..5c7cfc21 100644 --- a/apps/browser-extension/utils/query-hooks.ts +++ b/apps/browser-extension/utils/query-hooks.ts @@ -5,6 +5,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query" import { fetchProjects, getDefaultProject, + getUserData, saveMemory, searchMemories, setDefaultProject, @@ -15,6 +16,7 @@ import type { MemoryPayload } from "./types" export const queryKeys = { projects: ["projects"] as const, defaultProject: ["defaultProject"] as const, + userData: ["userData"] as const, } // Projects Query @@ -37,6 +39,16 @@ export function useDefaultProject(options?: { enabled?: boolean }) { }) } +// User Data Query +export function useUserData(options?: { enabled?: boolean }) { + return useQuery({ + queryKey: queryKeys.userData, + queryFn: getUserData, + staleTime: 5 * 60 * 1000, // 5 minutes + enabled: options?.enabled ?? true, + }) +} + // Set Default Project Mutation export function useSetDefaultProject() { const queryClient = useQueryClient() diff --git a/apps/browser-extension/utils/ui-components.ts b/apps/browser-extension/utils/ui-components.ts index 8a56ea5a..dabe4974 100644 --- a/apps/browser-extension/utils/ui-components.ts +++ b/apps/browser-extension/utils/ui-components.ts @@ -94,8 +94,8 @@ export function createToast(state: ToastState): HTMLElement { const icon = document.createElement("div") icon.style.cssText = "width: 20px; height: 20px; flex-shrink: 0;" - const text = document.createElement("span") - text.style.fontWeight = "500" + let textElement: HTMLElement = document.createElement("span") + textElement.style.fontWeight = "500" // Configure toast based on state switch (state) { @@ -113,17 +113,17 @@ export function createToast(state: ToastState): HTMLElement { ` icon.style.animation = "spin 1s linear infinite" - text.textContent = "Adding to Memory..." + textElement.textContent = "Adding to Memory..." break case "success": { const iconUrl = browser.runtime.getURL("/icon-16.png") icon.innerHTML = `Success` - text.textContent = "Added to Memory" + textElement.textContent = "Added to Memory" break } - case "error": + case "error": { icon.innerHTML = ` @@ -131,12 +131,29 @@ export function createToast(state: ToastState): HTMLElement { ` - text.textContent = "Failed to save memory / Make sure you are logged in" + const textContainer = document.createElement("div") + textContainer.style.cssText = + "display: flex; flex-direction: column; gap: 2px;" + + const mainText = document.createElement("span") + mainText.style.cssText = "font-weight: 500; line-height: 1.2;" + mainText.textContent = "Failed to save memory" + + const helperText = document.createElement("span") + helperText.style.cssText = + "font-size: 12px; color: #6b7280; font-weight: 400; line-height: 1.2;" + helperText.textContent = "Make sure you are logged in" + + textContainer.appendChild(mainText) + textContainer.appendChild(helperText) + + textElement = textContainer break + } } toast.appendChild(icon) - toast.appendChild(text) + toast.appendChild(textElement) return toast } @@ -433,8 +450,25 @@ export const DOMUtils = { ` icon.style.animation = "" - text.textContent = - "Failed to save memory / Make sure you are logged in" + + const textContainer = document.createElement("div") + textContainer.style.cssText = + "display: flex; flex-direction: column; gap: 2px;" + + const mainText = document.createElement("span") + mainText.style.cssText = "font-weight: 500; line-height: 1.2;" + mainText.textContent = "Failed to save memory" + + const helperText = document.createElement("span") + helperText.style.cssText = + "font-size: 12px; color: #6b7280; font-weight: 400; line-height: 1.2;" + helperText.textContent = "Make sure you are logged in" + + textContainer.appendChild(mainText) + textContainer.appendChild(helperText) + + text.innerHTML = "" + text.appendChild(textContainer) } // Auto-dismiss diff --git a/apps/browser-extension/wxt.config.ts b/apps/browser-extension/wxt.config.ts index 1bd7910d..b536b853 100644 --- a/apps/browser-extension/wxt.config.ts +++ b/apps/browser-extension/wxt.config.ts @@ -11,7 +11,7 @@ export default defineConfig({ manifest: { name: "supermemory", homepage_url: "https://supermemory.ai", - version: "6.0.002", + version: "6.0.003", permissions: ["contextMenus", "storage", "activeTab", "webRequest", "tabs"], host_permissions: [ "*://x.com/*", From 3c127639c3ce4bba3357f65e8af3dec53a7373e3 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Wed, 24 Sep 2025 21:04:12 +0000 Subject: [PATCH 6/6] fix: SSR issue while localStorage is being accessed (#437) --- apps/web/components/connect-ai-modal.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/web/components/connect-ai-modal.tsx b/apps/web/components/connect-ai-modal.tsx index 2d29dd55..b9759d4e 100644 --- a/apps/web/components/connect-ai-modal.tsx +++ b/apps/web/components/connect-ai-modal.tsx @@ -83,7 +83,16 @@ export function ConnectAIModal({ const [cursorInstallTab, setCursorInstallTab] = useState< "oneClick" | "manual" >("oneClick") - const projectId = localStorage.getItem("selectedProject") ?? "default" + + const [projectId, setProjectId] = useState("default") + + useEffect(() => { + if (typeof window !== "undefined") { + const storedProjectId = + localStorage.getItem("selectedProject") ?? "default" + setProjectId(storedProjectId) + } + }, []) useEffect(() => { analytics.mcpViewOpened()