Commit graph

4872 commits

Author SHA1 Message Date
Vonic
20c4f128bb feat(story-5.3): add Stripe webhook subscription lifecycle handlers
- Add migration 125: subscription_current_period_end column
- Add PLAN_LIMITS config (free/pro_monthly/pro_yearly token + pages limits)
- Add subscription webhook handlers: created/updated/deleted, invoice payment
- Handle checkout.session.completed for subscription mode separately from PAYG
- Idempotency: subscription_id + status + plan_id + period_end guard
- pages_limit upgraded on activation, gracefully downgraded on cancel
- Token reset on subscription_create and subscription_cycle billing events
- Period_end forward-only guard against out-of-order webhook delivery

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 00:43:07 +07:00
Vonic
07a4bc3fc3 feat(story-5.2): add Stripe subscription checkout with session verification
Add POST /api/v1/stripe/create-subscription-checkout endpoint with
get_or_create_stripe_customer (SELECT FOR UPDATE), plan_id→price_id
mapping from env vars, active subscription guard (409), and
session_id in success URL. Add GET /verify-checkout-session endpoint
for server-side payment verification. Add /subscription-success
frontend page with loading/verified/failed states.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 23:58:57 +07:00
Vonic
71edc183c4 feat(story-5.1): add subscription pricing UI with Stripe checkout integration
Replace PAYG pricing tiers with subscription model (Free/Pro/Enterprise),
enable Monthly/Yearly billing toggle, wire Pro CTA to Stripe checkout with
authenticatedFetch, toast error feedback, double-click guard, checkout_url
validation, and offline graceful degradation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 23:28:14 +07:00
Vonic
c1776b3ec8 feat(story-3.5): add cloud-mode LLM model selection with token quota enforcement
Implement system-managed model catalog, subscription tier enforcement,
atomic token quota tracking, and frontend cloud/self-hosted conditional
rendering. Apply all 20 BMAD code review patches including security
fixes (cross-user API key hijack), race condition mitigation (atomic SQL
UPDATE), and SSE mid-stream quota error handling.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-14 17:01:21 +07:00
Vonic
e7382b26de docs: rewrite story 3.5 and epic 5 stories to match actual codebase
Keeps subscription SaaS vision from PRD while adding accurate as-is
analysis of existing code. Each story now has an "As-Is" table showing
what exists and where the gaps are.

Key points:
- Story 3.5: Transition from BYOK to system-managed models with token
  billing. BYOK stays for self-hosted mode (deployment_mode=self-hosted),
  system models + subscription quota for hosted mode.
- Story 5.1: Pricing UI exists (Free/PAYG/Enterprise) but needs redesign
  to subscription tiers (Free/Pro) with monthly/yearly toggle.
- Story 5.2: PAYG checkout exists (mode=payment), need NEW subscription
  endpoint (mode=subscription) with stripe_customer_id binding.
- Story 5.3: Webhook infrastructure exists (signature verify, PAYG handlers).
  Need subscription event handlers (customer.subscription.*) alongside.
- Story 5.4: PageLimitService fully implemented. Gap is HTTP-layer pre-check,
  plan-based limits, frontend quota indicator, and 402 error handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 14:19:57 +07:00
Vonic
a368dbcb08 Revert "docs: rewrite story 3.5 and epic 5 stories to match actual codebase"
This reverts commit 04fb9eec0f.
2026-04-14 14:16:52 +07:00
Vonic
04fb9eec0f docs: rewrite story 3.5 and epic 5 stories to match actual codebase
Stories were written for a subscription SaaS model, but SurfSense is a
self-hosted product with BYOK + optional PAYG page packs via Stripe.

Key corrections:
- Story 3.5: Not "remove BYOK + token billing" → actual gap is adding
  HTTP-layer quota pre-check before document upload enqueue
- Story 5.1: Pricing UI already exists (Free/PAYG/Enterprise) → gap is
  wiring "Get Started" button to existing Stripe checkout endpoint
- Story 5.2: mode=payment PAYG already works → needs verification/hardening
  not a subscription checkout rewrite
- Story 5.3: Webhook already handles checkout.session.completed correctly
  → no subscription events needed, gap is idempotency test + purchase history UI
- Story 5.4: PageLimitService + enforcement in tasks/connectors already exists
  → gap is HTTP-layer pre-check, quota UI indicator, and 402 frontend handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 14:08:55 +07:00
Vonic
dc545f8028 fix: resolve runtime crashes in tool-ui components and backend import errors
Backend:
- Remove dead imports (display_image, link_preview, knowledge_base) from tools registry and __init__
- Delete orphaned elif chain (lines 784-1046) in knowledge_base.py left after asyncio.gather refactor
- Add missing NotionAPIError class to notion_history.py

Frontend:
- Add display-image.tsx, link-preview.tsx, scrape-webpage.tsx tool UI components
- Fix GeneratePodcastToolUI: add null guard for no-props render + optional chaining on status/args
- Fix SaveMemoryToolUI/RecallMemoryToolUI: add null guard when rendered without props in provider
- Update launch.json to use pnpm on port 3999

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:42:31 +07:00
Vonic
67429c287f update 2026-04-13 23:35:26 +07:00
Vonic
6e86cd7e8a chore: merge upstream with local feature additions
- Merged dexscreener connector, composio connectors, crypto realtime tools from upstream
- Kept local additions: dropbox/onedrive connectors, memory routes, model_list routes, RefreshToken model
- Resolved frontend conflicts: kept tool UIs from both sides
- Accepted upstream lock files (uv.lock, pnpm-lock.yaml)
2026-04-13 23:31:52 +07:00
Vonic
923c7a0f69 update 2026-04-13 23:17:12 +07:00
Vonic
8a9fb30d0c chore: recreate standard BMad stories with corrected names based on sprint status keys 2026-04-13 09:56:30 +07:00
Vonic
b35b4337bb feat: initialize agent and claude skill libraries with comprehensive knowledge bases, workflow templates, and implementation artifacts. 2026-04-13 09:49:58 +07:00
Vonic
956d8c6322 Merge remote-tracking branch 'origin/dev' 2026-04-12 21:16:55 +07:00
DESKTOP-RTLN3BA\$punk
7ea840dbb2 feat: enhance SurfSense with new skills, blog section, and improve SEO metadata
Some checks failed
Build and Push Docker Images / tag_release (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Has been cancelled
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Has been cancelled
- Added multiple new skills to skills-lock.json from the repository `aaron-he-zhu/seo-geo-claude-skills`.
- Introduced `fuzzy-search` dependency in package.json for improved search functionality.
- Updated pnpm-lock.yaml to include the new `fuzzy-search` package.
- Enhanced SEO metadata across various pages, including canonical links and descriptions for better search visibility.
- Improved layout and structure of several components, including the homepage and changelog, to enhance user experience.
2026-04-11 23:38:12 -07:00
Rohan Verma
61b3f0d7e3
Merge pull request #1207 from CREDO23/feat/kb-export-and-folder-upload
Some checks are pending
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
[Feat] KB Export, Folder Upload & Vision LLM for Image Processing
2026-04-11 13:56:57 -07:00
CREDO23
ec3bd2f5f4 fix: renumber vision_llm migration from 121 to 123 to resolve conflict with upstream 2026-04-11 11:02:44 +02:00
CREDO23
51c2633c30 chore: add .env.example for desktop 2026-04-11 10:46:39 +02:00
CREDO23
10ef2a81ab chore: add .env to desktop gitignore 2026-04-11 10:45:01 +02:00
CREDO23
c30cc08771 Merge upstream/dev into feat/kb-export-and-folder-upload 2026-04-11 10:28:40 +02:00
Rohan Verma
43c859047f
Merge pull request #1215 from mvanhorn/feat/1198-tanstack-query-github-stars
Some checks are pending
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
feat: migrate GitHub stars fetch to TanStack Query
2026-04-10 21:44:28 -07:00
Matt Van Horn
b65502322a feat: migrate GitHub stars fetch to TanStack Query
Replace the manual useEffect + fetch in NavbarGitHubStars with
useQuery from @tanstack/react-query. This gives the component
caching, request deduplication, automatic retries, and devtools
visibility for free.

The useLatestRelease hook referenced in the issue has already been
removed from hero-section.tsx, so only the stars badge needed
migration.

Closes #1198
2026-04-10 22:44:03 -04:00
Rohan Verma
7ec2973223
Merge pull request #1214 from AnishSarkar22/fix/azure-document-intelligence
Some checks are pending
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
fix: update Azure Document Intelligence to use `prebuilt-layout`
2026-04-10 14:37:55 -07:00
Rohan Verma
e273197ed2
Merge pull request #1212 from mmatsumoto1026/fix/define-proper-interfaces-for-navprops
fix: define proper interfaces for navprops
2026-04-10 14:36:59 -07:00
Rohan Verma
c2ab3316fe
Merge pull request #1211 from tmchow/osc/1193-remove-use-client
perf: remove unnecessary `"use client"` from pricing-section.tsx
2026-04-10 14:36:26 -07:00
Rohan Verma
b96dc49c8a
Merge pull request #1200 from AnishSarkar22/refactor/persistent-memory
refactor: persistent memory
2026-04-10 14:34:16 -07:00
CREDO23
f556446d07 Fix test mocks for vision_llm kwarg 2026-04-10 18:20:49 +02:00
Anish Sarkar
bb5b90e5bd fix: update Azure Document Intelligence parser to use prebuilt-layout model 2026-04-10 20:40:54 +05:30
CREDO23
a95bf58c8f Make Vision LLM opt-in for uploads and connectors 2026-04-10 16:45:51 +02:00
Anish Sarkar
c6730c5551 feat: implement download functionality for different OS in SidebarUserProfile and DownloadButton components, enhance user experience with localized download messages 2026-04-10 19:53:13 +05:30
Anish Sarkar
42572ad09d refactor: simplify alert descriptions, improved icons, improved UI in LLM settings 2026-04-10 19:07:35 +05:30
Anish Sarkar
0925f89b7c fix: guard display_name.split() against whitespace-only IndexError (recurseml feedback) 2026-04-10 15:29:56 +05:30
Anish Sarkar
27cd032d28 feat: implement input handling improvements in MemoryContent and TeamMemoryManager components, including click outside to close functionality 2026-04-10 15:23:04 +05:30
Anish Sarkar
8c9440998a chore: ran linting 2026-04-10 14:20:11 +05:30
Anish Sarkar
a5bf3af4f8 feat: migrate legacy memory tables to markdown format and drop old structures 2026-04-10 14:19:20 +05:30
Trevin Chow
112d5f21cb perf: remove unnecessary "use client" from pricing-section.tsx
The component uses no hooks, event handlers, or browser APIs.
The child <Pricing> component already has its own client boundary,
so this wrapper can safely render on the server.

Fixes #1193
2026-04-10 01:16:03 -07:00
Anish Sarkar
ac87f3fde0 feat: replace loading skeleton in ReportPanel with a new animated skeleton component 2026-04-10 12:53:12 +05:30
Anish Sarkar
bbfce5028f feat: enhance MemoryContent and TeamMemoryManager components with new input handling, improved export options 2026-04-10 12:52:27 +05:30
mmatsumoto1026
1948f0825c fix: use NavItem interface for arguments of callback functions 2026-04-10 13:38:27 +09:00
mmatsumoto1026
694da5e439 fix: define proper interfaces for navprops 2026-04-10 13:03:47 +09:00
Anish Sarkar
8d7b5bfe36 feat: enhance memory management protocols to enforce structured headings, utilize user first names in entries, and improve clarity in memory update rules 2026-04-10 04:51:56 +05:30
Anish Sarkar
b8e1c9801b feat: update memory extraction and management protocols to enforce structured bullet formats, utilize user first names, and enhance validation for team and user memory entries 2026-04-10 04:36:51 +05:30
Rohan Verma
649f315dba
Merge pull request #1209 from tmchow/fix/remove-dead-more-pages-dialog
Some checks are pending
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
Remove dead MorePagesDialog component and morePagesDialogAtom
2026-04-09 14:38:20 -07:00
Trevin Chow
b544b161ae Remove dead MorePagesDialog component and morePagesDialogAtom
MorePagesDialog is never imported anywhere in the codebase.
The /more-pages route uses MorePagesContent directly from
page.tsx. The associated morePagesDialogAtom is also unused
outside the deleted component.

Closes #1192

This contribution was developed with AI assistance (Claude Code).
2026-04-09 14:13:31 -07:00
Anish Sarkar
ad2a981a77 chore: ran linting 2026-04-10 02:33:48 +05:30
Anish Sarkar
fdbb6200a6 feat: add export functionality to MemoryContent and TeamMemoryManager components, allowing users to download memory as markdown files 2026-04-10 02:31:59 +05:30
Rohan Verma
7808950abc
Merge pull request #1208 from SohamBhattacharjee2003/fix/snapshot-delete-error-feedback
fix: add user feedback for snapshot deletion failures (#1197)
2026-04-09 14:01:09 -07:00
Anish Sarkar
c06b82647d feat: refine team memory extraction decision policy to prioritize durable context and clarify criteria for updates, enhancing memory relevance and management 2026-04-10 02:02:14 +05:30
DESKTOP-RTLN3BA\$punk
fedb4bcd76 fix: update metadata descriptions to emphasize privacy and data limits 2026-04-09 13:29:34 -07:00
Anish Sarkar
a0883d2ab6 feat: implement team memory extraction and validation mechanisms, enhancing memory management by enforcing scope restrictions and improving memory persistence for shared threads 2026-04-10 01:54:00 +05:30