Commit graph

1891 commits

Author SHA1 Message Date
ved015
8a1fae3bb7 chore: merge latest stacked changes 2026-08-22 19:57:18 +05:30
claude[bot]
7153801f11 fix(tools): resolve lint and format errors
- Replace `as any` with typed assertion in claude-memory.ts
- Apply Biome formatting fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-08-22 06:46:13 +00:00
ved015
d21d661380 fix(tools): harden seven-tool parity 2026-08-22 12:13:25 +05:30
ved015
d04bb3b7b1 chore: merge latest stacked changes 2026-08-22 12:10:44 +05:30
ved015
006a3f5500 chore(ci): harden Python SDK test workflow 2026-08-21 23:03:33 +05:30
ved015
7cf0480b83 fix(openai-sdk-python): harden 7-tool parity 2026-08-21 21:59:32 +05:30
ved015
7eca7c7e53 Merge remote-tracking branch 'origin/main' into fix/openai-sdk-python-v4-api 2026-08-21 21:24:40 +05:30
ved015
183e9fba93 fix(openai-sdk-python): harden v4 migration 2026-08-21 21:24:38 +05:30
Dhravya
3487666481
feat(web): add MCP connector directory (#1461)
<!-- VORFLUX_AGENT_PR_BODY_BEGIN -->
Adds the full 654-entry MCP directory without bundling records into client JavaScript, with explicit capability status and connector branding that degrades safely when no authoritative logo is available.

## Changes

- Lazy-load and validate the searchable, filterable, progressively rendered MCP catalog.
- Render same-origin proxied provider icons for 543 entries, with a reviewed domain allowlist and deterministic fallback marks for 111 unresolved or unbranded entries.
- Record OAuth discovery capability separately from end-to-end support; all directory setup actions remain suppressed until their authentication flow is verified.
- Add a reproducible OAuth metadata probe with HTTPS/private-network protections, stable URL keys, authorization-server scanning, and catalog fingerprint validation.
- Add Google Drive branding for the curated built-in connector.

## Testing

- **Passed:** Deterministic generation and catalog assertions.
  ```bash
  PATH="$HOME/.bun/bin:$PATH" python3 apps/web/scripts/generate-mcp-directory.py --output
  cmp apps/web/public/mcp-directory.json
  ```
  Verified 654 entries, 254 DCR discoveries, 27 preregistered OAuth discoveries, 373 unclassified entries, and zero directory setup actions.
- **Passed:** Stale OAuth metadata fingerprint is rejected by the generator.
- **Passed:** Touched-file Biome checks and `git diff --check`.
- **Passed:** Icon proxy returned 200 for an allowlisted domain and 400 for an unknown valid-looking domain.
- **Passed:** Authenticated desktop/mobile browser inspection and conservative capability labels.
- **Passed:** Public preview returned HTTP 200 and rendered the real app. Authentication cookies do not transfer to the public hostname, so the public screenshot shows login.
- **Partial:** Repository-wide TypeScript checks remain blocked by unrelated existing errors outside the touched MCP files.
- **Partial:** 111 entries intentionally retain deterministic fallback marks; endpoint-derived domains may not always be the canonical brand logo.
- **Blocked:** Google rejected the local HTTP OAuth callback, so live Google Drive consent, callback, persistence, tool discovery, disconnect, and reconnect were not completed.

Public preview: https://ar8ruchhbi65.preview.us1.vorflux.com/configure/tools

---
**Attached Images**

*[288.csv]*

*[mcp-directory-final.json]*

![mcp-directory-branding-desktop.png](https://api.us1.vorflux.com/assets/artifacts/c3VwZXJtZW1vcnk6Zjo4MDA0.3_UzR_OP9Jk228FYbrAPTXyqybRBlqwn5Uv4tksf_Y0.png)

![mcp-directory-branding-mobile.png](https://api.us1.vorflux.com/assets/artifacts/c3VwZXJtZW1vcnk6Zjo4MDA1.b5G6nsOBVm2s6DlEFWFiMFCcULAkV0MCCGZ8XVsA5js.png)

![mcp-directory-public-preview.png](https://api.us1.vorflux.com/assets/artifacts/c3VwZXJtZW1vcnk6Zjo4MDA2.ZrBAeBi62JX1xavAtaDLQ0fuixgBjN7x1NrqIxtdmKw.png)
<!-- VORFLUX_AGENT_PR_BODY_END -->

---
**Session Details**
- Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/1cd0aab9-2a45-4818-aa13-f9bfe032ddba)
- Requested by: Dhravya Shah (dhravya@supermemory.com)
- Address comments on this PR. Add `(aside)` to your comment to have me ignore it.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes how users pick MCP URLs and auth (OAuth vs API key) before hitting existing connect endpoints; no new backend auth logic in this diff, but misconfiguration or trusting bad URLs remains a user-risk surface.
>
> **Overview**
> Adds a **browseable MCP directory** on the Company Brain connectors page: the catalog is **not bundled in JS**—it loads from static **`/mcp-directory.json`** only after the user opens the directory (with validation, caching, and abort handling).
>
> The new **`McpDirectoryBrowser`** supports search, category/availability filters, and progressive “show more” rendering. Supported remote entries route into the existing custom MCP flow via **Set up**, which pre-fills name/URL and opens the connector dialog with context-specific copy.
>
> The custom connector dialog now uses an explicit **OAuth vs API key** toggle; API key fields only appear for API-key mode, and directory-backed connections get **stable slugs** (`-dir-` suffix) so names display cleanly on connected cards. **Middleware** excludes `mcp-directory.json` from the auth matcher so the asset can be fetched publicly.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8b59bae84a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-08-20 22:58:39 +00:00
ishaanxgupta
dda56e766e Add plugin CLI command guide to integrations (#1534)
## Summary

- add an “Install plugins with one command” action beside the Plugins section

<img width="1280" height="651" alt="image" src="https://github.com/user-attachments/assets/a2e19a91-c94c-4a56-87c4-b72c4dbe89ba" />
<img width="1280" height="554" alt="image" src="https://github.com/user-attachments/assets/2cd4b3a4-ac30-4411-8221-baca09e90b0f" />
2026-08-20 18:07:31 +00:00
Dhravya Shah
818a83a381
fix(mcp): strip API extras from listMemories entries (#1539)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-19 14:05:52 -07:00
Aditya Mishra
7b1175cb1a
fix(browser-extension): run wxt prepare before type checking (#1557) 2026-08-19 19:23:52 +05:30
Rajarshi Datta
20410a6862
fix(ui): remove the unused, broken AnonymousAuth component (#1555) 2026-08-19 19:22:17 +05:30
Rajarshi Datta
7d59070ad6
fix(web): scope the ?view=mcp guest exemption to / (#1553) 2026-08-19 18:33:58 +05:30
Dhravya
18a2dfbe39
feat(mcp): accept Supermemory API keys as Bearer auth (#1537)
## Stack Context

Single-auth story for the Claude Code supermemory plugin rework: the plugin's hooks and its MCP surface share one credential (`sm_` API key from the existing browser connect flow). That requires `mcp.supermemory.ai` to accept plain API keys, which it currently rejects (OAuth JWT only).

## What?

- `validateApiKey()` in `server/auth`: `sm_`-prefixed Bearer tokens validate via the existing `fetchSession()` (`GET /v3/session`) and map to the same `AuthUser` shape as OAuth tokens (`userId` ← `user.id`, `organizationId` ← `org.id`, the key itself as `bearerToken` for downstream API calls). Successful lookups cached per isolate for 60s.
- `handleMcpRequest` routes by token shape: `sm_` keys → session validation, everything else → OAuth JWT verification (unchanged).
- `sessionInfoSchema` now types the `org.id` field the session endpoint already returns.

## Why?

MCP clients that already hold an API key (Claude Code plugin hooks, CLI, scripts) can connect without an OAuth dance or a second consent. OAuth behavior is untouched — the existing "rejects opaque API keys" test on the OAuth validator still passes; keys just get their own path. Malformed keys are rejected without an API round-trip.

Tests: 4 new cases (valid key → AuthUser, cache hit → single fetch, 401 → null, malformed → no request). `vitest run src/server/auth` 13/13, `tsc --noEmit` clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Adds a new authentication path on the MCP entrypoint with in-memory key caching (60s TTL), so revoked keys may remain valid briefly within an isolate; OAuth behavior is unchanged.
>
> **Overview**
> MCP Bearer auth now accepts **`sm_` Supermemory API keys** in addition to OAuth JWTs, so clients that already hold an API key can connect without OAuth.
>
> **`validateApiKey`** treats keys matching `sm_` plus at least 17 non-space characters as API keys: it calls **`GET /v3/session`** with the key as Bearer, maps **`user.id`** and **`org.id`** into the same **`AuthUser`** shape as OAuth (key kept as **`bearerToken`** for downstream API calls), and caches successful results per isolate for **60s** (up to 1000 entries, full clear on overflow). Malformed keys are rejected locally with no HTTP call; session **401** yields unauthenticated.
>
> **`handleMcpRequest`** branches on token shape: API keys go through session validation; other tokens still use JWT verification unchanged.
>
> **`sessionInfoSchema`** now includes optional **`org.id`** typing for session responses used when resolving organization context from API keys.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e54fb11bf1598d07a807eb2b0b63a347aaa58fb6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-08-19 02:27:27 +00:00
MaheshtheDev
149589ae7e fix(brain): keep the confirmed company domain after checkout return (#1536)
Returning from Stripe remounts onboarding and reseeds the domain from the user's email, so the header showed the wrong company and a research retry would re-run on the wrong domain. Past the confirm step, read the org's stored brainWorkspaceDomain instead.
2026-08-18 23:13:12 +00:00
MaheshtheDev
c0eb81c887 refactor(brain): one isCompanyBrainOrg helper in the web app (#1535)
Two hand-rolled copies of the add-on/brainMode rule replaced by a single shared helper, and the one-line isCompanyBrainOrganization wrapper dropped. No behaviour change.
2026-08-18 23:13:12 +00:00
Cursor Agent
f68bd30262
Merge origin/main into fix/openai-sdk-python-v4-api
Resolve pyproject.toml conflict by keeping supermemory>=3.50.0
(required for v4 API migration) and main's package version 1.0.5.

Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
2026-08-18 15:20:49 +00:00
claude[bot]
b69a28dd65 chore: update bun.lock
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-08-18 15:20:34 +00:00
claude[bot]
61030190d9 chore: update bun.lock
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-08-18 15:19:56 +00:00
ishaanxgupta
e2be9c9edd Fix integrations layout and mobile promo responsiveness (#1481)
## Summary

- Reorder Apps & extensions so Import X bookmarks appears in the top row and Apple Shortcuts uses the open space below.
- Keep both Apple Shortcut actions inline on larger screens while allowing the card to grow only as much as needed.
- Rework the Company Brain promo on phones so its logo, copy, close control, and CTA remain readable and aligned.
2026-08-17 18:47:36 +00:00
Dhravya
5d2b5855fe
feat(auth): AgentID sign-in button on the web login page (#1467)
## What?

Adds a "Continue with AgentID" button to the web app's login page, matching the existing Google/GitHub buttons (same `ExternalAuthButton` pattern, PostHog `login_attempt` capture, last-used badge).

- `packages/lib/auth.ts`: adds the `genericOAuthClient` plugin — generic OAuth providers sign in via `signIn.oauth2({ providerId })`, not `signIn.social`.
- `apps/web/app/(auth)/login/page.tsx`: the button, gated the same way as the other social buttons — always shown on cloud (`NEXT_PUBLIC_HOST_ID === "supermemory"`), opt-in elsewhere via `NEXT_PUBLIC_AGENTID_AUTH_ENABLED` (added to `.env.example`).

## Why?

Companion to supermemoryai/mono#2908, which registers an `agentid` generic OAuth provider (OIDC against auth.agentid.com) on the API so agents can authenticate with their AgentID identity. The consumer app talks to the same better-auth server, so it gets the same sign-in option. mono#2916 additionally auto-invites the agent's verified human owner to the agent's workspace.

Requires mono#2908 to be deployed for the button to work; until then the API rejects the unknown provider and the page shows its normal error state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches authentication entry points and OAuth client configuration; risk is moderate because it extends login surface area but follows existing social sign-in patterns and is feature-flagged.
>
> **Overview**
> Adds **Continue with AgentID** on the web login page, using the same `ExternalAuthButton` flow as Google/GitHub (PostHog `login_attempt`, last-used badge, loading/error handling).
>
> The button calls **`signIn.oauth2({ providerId: "agentid" })`** instead of `signIn.social`, enabled by registering **`genericOAuthClient`** on the shared better-auth client in `packages/lib/auth.ts`.
>
> Visibility matches other social providers: shown on cloud when `NEXT_PUBLIC_HOST_ID === "supermemory"`, or elsewhere when **`NEXT_PUBLIC_AGENTID_AUTH_ENABLED`** is set (documented in `.env.example`). Depends on the API registering the `agentid` generic OAuth provider.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 90a32786a3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-08-16 23:20:38 +00:00
Dhravya Shah
d14b209f7c
feat(web): support discount code checkout (#1523) 2026-08-16 13:43:53 -07:00
Ishaan Gupta
e651045ac5
Remove paid plugin UI (#1403) 2026-08-15 18:41:46 +05:30
Dhravya
5ecbc26345
fix(mcp): surface real API error messages instead of 'restricted or blocked' (#1406)
## Why?

Plain **T-1554**: a user with a **read-only** MCP OAuth grant got 403s on memory listing, and the client rendered them as *"Access forbidden. Your account may be restricted or blocked."* The API's actual error body said `{"error": "This API key has read-only access"}` — but `handleError` discarded it, so the user (and support) chased a nonexistent account ban.

Two masking layers:
1. `handleError` used the raw error `message`, which for our raw-fetch endpoints was a hardcoded string ("Failed to fetch documents") or unparsed JSON, and fell back to the scary "restricted or blocked" text when empty.
2. `getDocuments` didn't read the response body at all.

## What?

- New `extractApiErrorMessage()` unwraps JSON error bodies (`{"error": ...}` / `{"message": ...}`) so the API's real reason reaches the user.
- `getDocuments` and `listMemoryEntries` now pass the (unwrapped) response body through with the status, letting `handleError` apply status-aware fallbacks when the body is empty.
- Reworded the empty-body 403 fallback to point at the common cause first: *"Access forbidden. This connection may be read-only or scoped to specific spaces — reconnect with broader access, or check your account status."*

Companion API-side fix (read-only grants couldn't call semantically-read POST list endpoints at all): supermemoryai/mono#2772.

## Testing

- Added tests: a 403 with a JSON error body surfaces the API's message; an empty-body 403 gets the scope-aware fallback. `vitest run src/server/client/index.test.ts` — 3 passed.
- `tsc --noEmit -p tsconfig.json` clean. (The `check-types` script also runs `tsconfig.widget.json`, which fails on origin/main with a pre-existing `UseAppOptions.strict` error, unrelated.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> User-facing error text only in the MCP client; no auth or API behavior changes.
>
> **Overview**
> **MCP client errors now show what the API actually returned** instead of hardcoded strings or misleading “restricted or blocked” text.
>
> Adds `extractApiErrorMessage()` to parse JSON bodies (`error` / `message` fields) from failed responses. **`getDocuments`** and **`listMemoryEntries`** read the response body on non-OK status and attach the unwrapped message (with status) for **`handleError`**, which also uses the helper on error messages. When a 403 has no body message, the fallback now points users toward **read-only or scoped OAuth** rather than an account ban.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1f492470cf. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-08-14 22:36:52 +00:00
Prasanna721
9cbddcec56 docs: historical backfill guide (#1474)
Adds a focused guide for backfilling dated documents with `documentDate` and the batch ingestion API.

- includes TypeScript and Python batch examples plus optional completion polling
- links the guide from the docs navigation and ingestion entry points

Validated with `bunx mintlify@latest validate` and `bunx mintlify@latest broken-links`.
2026-08-14 20:46:21 +00:00
MaheshtheDev
2e85722cf4 Clarify Company Brain trial copy (#1469)
Make the trial terms and payment timing clear, and simplify the call to action.
2026-08-14 05:36:31 +00:00
Dhravya Shah
eac070048b
feat(web): add memory button to company brain navbar (#1468)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-13 22:04:01 -07:00
Abhinav Kumar Singh
82dae50ef4
fix(tools): bound memory forget requests (#1451) 2026-08-13 19:11:00 +05:30
Sarath Donepudi
7f448d55d8
docs: document pinned install for supermemory-server (#1238)
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
2026-08-13 17:56:49 +05:30
Abhinav Kumar Singh
9d64e0f950
fix: add type checks for TypeScript workspaces (#1447) 2026-08-13 17:55:50 +05:30
James Yang
1356affbd1
fix(extension): finish Included Memories leftovers on T3 (#1257) (#1421)
Co-authored-by: abhay-codes07 <abhaysingh0293@gmail.com>
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
2026-08-13 17:55:16 +05:30
Ishaan Gupta
fcf49855ce
Upgrade Nova model picker to current runtime models (#1404) 2026-08-13 17:08:50 +05:30
MaheshtheDev
0695ca421b feat(web): take a card before the Company Brain trial starts (#1459)
Onboarding now opens a trial step that collects a card through Stripe checkout before the brain is enabled, with a timeline showing today's $0, the day-12 reminder, and the day-14 charge.

- Only leaves the card step once the API confirms the trial is live
- Brain home shows a setup banner and dims what the trial unlocks
- Recovers orgs that abandoned checkout instead of stranding them
- Adds the organization ID to account settings, copyable from the label
2026-08-13 06:58:47 +00:00
Dhravya Shah
c70c142fc7
fix(web): open Slack install in new window (#1460) 2026-08-12 13:12:54 -07:00
Abhay Singh
b7a6ea9a5f
fix(extension): stop fragmenting Included Memories that contain commas or newlines (#1339)
Some checks failed
Publish OpenAI SDK Python / publish (push) Has been cancelled
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
2026-08-12 20:58:06 +05:30
Abhay Singh
00e57fb9c2
fix(web): stop formatUsageNumber rendering 1000.0K at unit boundaries (#1340)
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
2026-08-12 20:57:33 +05:30
pawan
47152afc1d
fix(openai-sdk): cap supermemory to <3.5 so a fresh install imports (#1236) 2026-08-12 20:56:54 +05:30
Abhay Singh
14bcc92c31
fix(memory-graph): center arrow-key navigation in the visible graph area (#1337) 2026-08-12 20:56:23 +05:30
Abhay Singh
74b2201eeb
fix(memory-graph): stop painting expired memories as expiring (#1335)
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
2026-08-12 20:55:53 +05:30
Abhay Singh
f163c932cf
fix(web): keep highlights card active index in range on refresh (#1334)
Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
2026-08-12 20:55:01 +05:30
Abhay Singh
a7efd817ec
fix(validation): reject non-positive page/limit in pagination query schemas (#1271) 2026-08-12 19:35:45 +05:30
MaheshtheDev
59b148e5b2 feat(web): sell Company Brain on Max as well as Scale (#1440)
Company Brain workspaces could only buy Scale at $399/mo, which is roughly eight times what the median team uses. Adds the $100/mo Max card to the Company Brain plan picker, notes what a Scale trial loses on the way down, and flags that Scale is cheaper above about $400/mo of credits.
2026-08-10 00:10:46 +00:00
MaheshtheDev
be267c2fc8 feat(web): automation connection warnings and calmer automations page (#1396)
Inline notice with app icons when a channel automation can't use personal-only connections (footer, next to Save), post-save warning toast from the API, templates capped to 3 connection-relevant ideas with a show-all toggle, and New automation promoted to a primary button on the heading row. Pairs with mono #2724; degrades gracefully without it.

Fixes ENG-1151
2026-08-10 00:02:50 +00:00
Dhravya Shah
9c3f84b5cb feat(ai-sdk): re-export full Supermemory tool set from @supermemory/tools
Thin @supermemory/ai-sdk package now mirrors the canonical 7-tool surface
with updated tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 19:39:57 -07:00
Dhravya Shah
d5937b8b26 feat(tools): align 7-tool surface and refresh tool descriptions
Update shared tool descriptions (proactive search, documentAdd guidance),
export TOOL_DESCRIPTIONS from package index, and align OpenAI/AI SDK tool
schemas with memoryForget and document operations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 19:39:50 -07:00
Dhravya Shah
93fe02056c chore(ci): add Python SDK pytest workflow
Run pytest for openai-sdk-python, agent-framework, cartesia, and pipecat
packages on PRs touching those paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 19:39:39 -07:00
Dhravya Shah
1160c46ccc feat(openai-sdk-python): expand OpenAI tools to 7-tool parity
Add document_list, document_add, document_delete, get_profile, and
memory_forget alongside search_memories and add_memory. Includes
forget_memory HTTP helper and expanded tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 19:39:24 -07:00
Dhravya Shah
03849ce94f fix(openai-sdk-python): migrate tools and middleware to v4 Supermemory APIs
Replace deprecated search.execute and memories.add with search.memories
(hybrid) and client.add. Fix middleware container_tag param and dedupe
string/pydantic profile memory items.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 19:38:47 -07:00
vorflux[bot]
2731de5c06
fix(web): add Gmail connector logo (#1428)
Co-authored-by: Vorflux AI <249966464+vorflux[bot]@users.noreply.github.com>
2026-08-07 17:35:26 -07:00