From 848e5ac369eb40cbeb28c564e91c01560784fc33 Mon Sep 17 00:00:00 2001 From: shamAnimates <145093437+shamAnimates@users.noreply.github.com> Date: Mon, 12 Oct 2026 22:13:40 -0700 Subject: [PATCH] fix(raycast): allow scoped keys on supported commands (#1513) --- apps/raycast-extension/src/api.ts | 6 ------ .../raycast-extension/src/search-projects.tsx | 4 ++-- .../raycast-extension/src/withSupermemory.tsx | 19 +++++-------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/apps/raycast-extension/src/api.ts b/apps/raycast-extension/src/api.ts index f36d82fb..87899bc3 100644 --- a/apps/raycast-extension/src/api.ts +++ b/apps/raycast-extension/src/api.ts @@ -214,9 +214,3 @@ export async function searchMemories( throw error } } - -// Helper function to check if API key is configured and valid -export async function fetchSettings(): Promise { - const response = await makeAuthenticatedRequest("/v3/settings") - return response -} diff --git a/apps/raycast-extension/src/search-projects.tsx b/apps/raycast-extension/src/search-projects.tsx index 02b423d5..e0d3fe5e 100644 --- a/apps/raycast-extension/src/search-projects.tsx +++ b/apps/raycast-extension/src/search-projects.tsx @@ -11,15 +11,15 @@ import { fetchProjects, addProject } from "./api" import { FormValidation, showFailureToast, - useCachedPromise, useForm, + usePromise, } from "@raycast/utils" import { withSupermemory } from "./withSupermemory" export default withSupermemory(Command) function Command() { - const { isLoading, data: projects, mutate } = useCachedPromise(fetchProjects) + const { isLoading, data: projects, mutate } = usePromise(fetchProjects) return ( diff --git a/apps/raycast-extension/src/withSupermemory.tsx b/apps/raycast-extension/src/withSupermemory.tsx index 9c789751..01043c3f 100644 --- a/apps/raycast-extension/src/withSupermemory.tsx +++ b/apps/raycast-extension/src/withSupermemory.tsx @@ -1,9 +1,7 @@ -import { usePromise } from "@raycast/utils" -import { fetchSettings } from "./api" import { Action, ActionPanel, - Detail, + getPreferenceValues, Icon, List, openExtensionPreferences, @@ -12,18 +10,11 @@ import type { ComponentType } from "react" export function withSupermemory

(Component: ComponentType

) { return function SupermemoryWrappedComponent(props: P) { - const { isLoading, data } = usePromise(fetchSettings, [], { - failureToastOptions: { - title: "Invalid API Key", - message: - "Invalid API key. Please check your API key in preferences. Get a new one from https://supermemory.link/raycast", - }, - }) + // Let each command enforce its own endpoint-specific permissions and rate limit. + const { apiKey } = getPreferenceValues() - if (!data) { - return isLoading ? ( - - ) : ( + if (!apiKey.trim()) { + return (