Commit Graph

100 Commits

Author SHA1 Message Date
Arvin Xu
a43415bd60 👷 build: fix docker build (#11768)
* fix build

* fix build
2026-01-24 15:24:05 +08:00
YuTengjing
1eff8646f7 feat: remove NextAuth (#11732) 2026-01-23 23:57:08 +08:00
YuTengjing
395595a2c8 feat: remove Clerk authentication code (#11711) 2026-01-23 14:41:22 +08:00
Innei
e999851592 perf: optimize first-screen rendering (#11718)
* ♻️ refactor: migrate SkillStore and IntegrationDetailModal to imperative API

- Refactor SkillStore to use createModal imperative API instead of declarative Modal
- Refactor IntegrationDetailModal to use createModal with IntegrationDetailContent
- Remove open/setOpen state management from all calling components
- Add modal-imperative.mdc rule for modal best practices
- Reduce code complexity and improve maintainability

* 🐛 fix: keep modal open during OAuth flow until connection completes

Close modal only after isConnected becomes true, not immediately after
handleConnect returns. This ensures useSkillConnect listeners stay alive
to detect OAuth completion via postMessage/polling.

* 🔧 chore: update dependencies and refactor markdown handling

- Updated "@lobehub/ui" to version "^4.27.4" in package.json.
- Replaced "markdown-to-txt" with a local utility "markdownToTxt" for converting markdown to plain text across multiple components.
- Refactored imports in various files to utilize the new markdownToTxt utility, improving code consistency and maintainability.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-23 14:41:07 +08:00
YuTengjing
bfe387c027 📝 docs: add clerk to betterauth migration scripts and enhance auth docs (#11701)
* 🔧 chore: add clerk to betterauth migration scripts

* 🔧 chore: support node-postgres driver for migration scripts

* 🔥 chore: remove unnecessary chore scripts

* ♻️ refactor: reorganize migration scripts directory structure

* 📝 docs: add example column to email service configuration table

* 📝 docs: rename auth/better-auth to auth/providers

* 📝 docs: enhance email service configuration with detailed guides

* 📝 docs: add Clerk to Better Auth migration guide

- Add migration documentation (EN & CN) with step-by-step instructions
- Add dry-run environment variable for safe testing
- Enhance script output with success/failure emojis
- Add placeholder files for migration data directories
- Update .gitignore to exclude migration data files

*  feat(auth): add set password option for social-only users

- Add isSocialOnly state to detect users without password
- Show Alert with "set password" link when magic link is disabled
- Update migration docs to clarify Magic Link vs non-Magic Link scenarios
- Add profile page password management info to docs

* ♻️ refactor: improve migration safety and sign-in link styling

- Add production mode confirmation prompt requiring "yes" input
- Use createStaticStyles for setPassword link styling with theme token

* 📝 docs: clarify migration script requirements and remove invalid links

* 📝 docs: add clerk migration guide link to legacy auth docs

* ♻️ refactor: enforce strict validation for clerk external accounts

* 📝 docs: add step to disable new user registration before migration

* 🐛 fix: handle missing .env file in migration scripts
2026-01-22 19:54:08 +08:00
Innei
ad32a61704 perf(electron): add codemods to convert dynamic imports to static (#11690)
*  feat(electron): add codemods to convert dynamic imports to static

Add multiple modifiers for Electron build workflow:
- dynamicToStatic: Convert dynamicElement() to static imports
- nextDynamicToStatic: Convert next/dynamic (ssr: false) to static
- wrapChildrenWithClientOnly: Wrap layout children with ClientOnly + Loading fallback
- settingsContentToStatic: Handle SettingsContent componentMap pattern
- removeSuspense: Remove Suspense wrappers from components
- routes: Delete loading.tsx files and (mobile) directory

Also add fallback prop support to ClientOnly component for better UX during hydration.

*  feat(electron): enhance settingsContentToStatic with business features support

- Introduced a new function to check if business features are enabled via environment variables.
- Updated import generation functions to conditionally include business-related imports based on the new feature flag.
- Improved regex patterns for better matching of dynamic imports.
- Added logging to indicate when business features are active, enhancing debugging and user awareness.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-22 17:18:06 +08:00
YuTengjing
c0f9875195 ♻️ refactor(auth): remove NEXT_PUBLIC_AUTH_URL env variable (#11658) 2026-01-21 11:51:46 +08:00
Innei
05a08734ba 🐛 fix(desktop): resolve onboarding navigation issues after logout (#11628)
* 🐛 fix(desktop): resolve onboarding navigation issues after logout

- Refactor step-based navigation to screen-based navigation system
- Add DesktopOnboardingScreen enum for type-safe screen handling
- Fix screen persistence and URL synchronization
- Improve platform-specific screen resolution (macOS permissions)
- Extract navigation logic into reusable utility functions

* cleanup

Signed-off-by: Innei <tukon479@gmail.com>

* 🐛 fix(UserPanel): handle errors during remote server config clearance

- Added error handling for the remote server configuration clearance process in the UserPanel component.
- Ensured that the onboarding completion and sign-out actions are executed regardless of the error state.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-20 01:04:03 +08:00
Innei
4e5a516865 🐛 fix(desktop): add auth required modal and improve error handling (#11574)
* 🐛 fix(desktop): add auth required modal and improve error handling

- Add AuthRequiredModal component to handle authentication expiration
- Improve backend proxy protocol error handling for auth errors
- Add updater manager authentication header support
- Add i18n strings for auth error messages

* 🔧 fix(desktop): update UpdaterManager to leave channel unset for GitHub prerelease matching

- Modify UpdaterManager to leave the channel unset, allowing GitHub to use version tags for prerelease matching.
- Update logging to reflect the new behavior when the channel is unset or kept as is.

Signed-off-by: Innei <tukon479@gmail.com>

* 🔧 fix(desktop): clarify UpdaterManager behavior for GitHub provider

- Update comments and logging in UpdaterManager to clarify that the channel is left unset for beta/nightly, allowing GitHub to use version tags for prerelease matching.
- Ensure logging accurately reflects the new behavior when the channel is unset.

Signed-off-by: Innei <tukon479@gmail.com>

*  feat(desktop): add desktop build channel script and update documentation

- Introduced a new script for building desktop applications for specific release channels (stable, beta, nightly).
- Updated package.json to include a new npm command for the build channel.
- Enhanced README documentation to guide users on simulating CI channel builds and retaining changes.

Signed-off-by: Innei <tukon479@gmail.com>

* 🔧 fix(desktop): streamline NODE_ENV usage in logger and config

- Removed redundant process.env.NODE_ENV definition from electron.vite.config.ts.
- Simplified logger implementation by directly using process.env.NODE_ENV for environment checks.
- Improved readability and maintainability of logging behavior based on the environment.

Signed-off-by: Innei <tukon479@gmail.com>

* 🔧 fix(desktop): enhance logging configuration to support debug mode

- Updated logger configuration to allow for debug level logging when DEBUG environment variable is set.
- Simplified the logic for console logging levels based on the environment, improving clarity and maintainability.

Signed-off-by: Innei <tukon479@gmail.com>

* 🔧 fix(desktop): enhance version generation and logging in UpdaterManager

- Updated version generation logic in manual-build-desktop.yml to handle channel suffixes more effectively.
- Added inferredChannel logging in UpdaterManager to improve clarity on the current update channel being used.

Signed-off-by: Innei <tukon479@gmail.com>

* 🔧 fix(desktop): update localization files and set default entry locale to English

- Changed default entry locale from Chinese (zh-CN) to English (en) in .i18nrc.js.
- Added full disk access messages in multiple languages (Arabic, Bulgarian, German, Spanish, French, Italian, Japanese, Korean, Dutch, Polish, Portuguese, Russian, Turkish, Vietnamese, Traditional Chinese).
- Enhanced menu localization with new settings and permissions options across various languages.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-18 18:55:18 +08:00
Innei
2253d46ee0 ♻️ refactor: migrate Next.js navigation APIs to React Router for SPA (#11394)
This implements Phase 3 of LOBE-2850, establishing a dual routing architecture
for the Next.js to Vite React Router SPA migration.

## Changes

### New wrapper modules
- `src/libs/next/` - Next.js wrappers for auth pages (Link, Image, navigation, dynamic)
- `src/libs/router/` - React Router wrappers for SPA routes (Link, navigation hooks)

### Link component updates
- External links (`http://`, `https://`) → native `<a>` tags
- SPA internal routes → React Router `<Link>`
- Auth pages → Next.js `<Link>` (preserved)
- Global `src/components/Link.tsx` → smart component for ConfigProvider

### Navigation hook updates
- SPA routes use `@/libs/router/navigation` (useRouter, usePathname, useSearchParams)
- Auth pages use `@/libs/next/navigation`
- GlobalProvider uses `window.location` (outside Router context)

### Architecture
```
GlobalProvider (no Router context)
└── AppTheme + ConfigProvider
    ├── Auth pages (Next.js routing)
    └── SPA Router (BrowserRouter)
        └── SPA pages (React Router)
```

Resolves LOBE-2850
2026-01-16 00:28:15 +08:00
Innei
959c210e86 feat(desktop): add local update testing scripts and stable channel API version check (#11474)
* chore: stable updater

*  feat: add local update testing scripts and configuration

- Introduced scripts for local update testing, including setup, server management, and manifest generation.
- Added `dev-app-update.local.yml` for local server configuration.
- Implemented `generate-manifest.sh` to create update manifests.
- Created `run-test.sh` for streamlined testing process.
- Updated `README.md` with instructions for local testing setup and usage.
- Enhanced `UpdaterManager` to allow forced use of dev update configuration in packaged apps.

Signed-off-by: Innei <tukon479@gmail.com>

* 🐛 fix(desktop): update UpdaterManager test mocks for new exports

Add missing mock exports for @/modules/updater/configs:
- isStableChannel
- githubConfig
- UPDATE_SERVER_URL

Add mock for @/env with getDesktopEnv
Add setFeedURL method to autoUpdater mock

*  feat: add Conductor setup scripts and configuration

*  feat: enhance update modal functionality and refactor modal hooks

- Added `useUpdateModal` for managing update modal state and behavior.
- Refactored `UpdateModal` to utilize new modal management approach.
- Improved `useWatchBroadcast` integration for handling update events.
- Removed deprecated `createModalHooks` and related components from `FunctionModal`.
- Updated `AddFilesToKnowledgeBase` and `CreateNew` modals to use new modal context for closing behavior.

This refactor streamlines modal management and enhances the user experience during update processes.

Signed-off-by: Innei <tukon479@gmail.com>

* update flow (#11513)

* ci: simplify desktop release workflow and add renderer tarball

* 👷 ci: fix s3 upload credentials for desktop release

* 🐛 fix(ci): use compact jq output for GitHub Actions matrix

Add -c flag to jq commands to produce single-line JSON output,
fixing "Invalid format" error when setting GITHUB_OUTPUT.

* 🐛 fix(ci): add administration permission to detect self-hosted runner

The /actions/runners API requires administration:read permission
to list repository runners.

* 🔧 refactor(ci): use workflow input for self-hosted runner selection

Replace API-based runner detection with workflow input parameter since
GITHUB_TOKEN lacks permission to call /actions/runners API.

- Add `use_self_hosted_mac` input (default: true)
- Release events always use self-hosted runner
- Manual dispatch can toggle via input

* feat(updater): add stable channel support with fallback mechanism

- Configure electron-builder to generate stable-mac.yml for stable channel
- Update CI workflow to handle both stable and latest manifest files
- Implement fallback to GitHub provider when primary S3 provider fails
- Reset to primary provider after successful update check

* 🐛 fix(updater): remove invalid channel config from electron-builder

- Remove unsupported 'channel' property from electron-builder config
- Create stable*.yml files from latest*.yml in workflow instead
- This ensures electron-updater finds correct manifest for stable channel

* 🐛 fix(updater): use correct channel based on provider type

- S3 provider: channel='stable' → looks for stable-mac.yml
- GitHub provider: channel='latest' → looks for latest-mac.yml

This fixes the 404 error when falling back to GitHub releases,
which only have latest-mac.yml files.

* refactor(env): remove unused OFFICIAL_CLOUD_SERVER and update env defaults

Update environment variable handling by removing unused OFFICIAL_CLOUD_SERVER and setting defaults for UPDATE_CHANNEL and UPDATE_SERVER_URL from process.env during build stage.

* 🐛 fix(ci): add version prefix to stable manifest URLs for S3

S3 directory structure: stable/{version}/xxx.dmg
So stable-mac.yml URLs need version prefix:
  url: LobeHub-2.1.0-arm64.dmg → url: 2.1.1/LobeHub-2.1.0-arm64.dmg

*  feat(ci): add renderer tar manifest for integrity verification

Creates stable-renderer.yml with SHA512 checksum for lobehub-renderer.tar.gz
This allows the desktop app to verify renderer tarball integrity before extraction.

* 🐛 fix(ci): fix YAML syntax error in renderer manifest generation

*  feat(ci): archive manifest files in version directory

* refactor(ci): update desktop release workflows to streamline build process

- Removed unnecessary dependencies in the build job for the desktop beta workflow.
- Introduced a new gate job to conditionally proceed with publishing based on the success of previous jobs.
- Updated macOS file merging to depend on the new gate job instead of the build job.
- Simplified macOS runner selection logic in the stable workflow by using GitHub-hosted runners exclusively.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor(electron): reorganize titlebar components and update imports

- Moved titlebar components to a new directory structure for better organization.
- Updated import paths for `SimpleTitleBar`, `TitleBar`, and related constants.
- Introduced new components for connection management and navigation within the titlebar.
- Added constants for title bar height to maintain consistency across components.

This refactor enhances the maintainability of the titlebar code and improves the overall structure of the Electron application.

Signed-off-by: Innei <tukon479@gmail.com>

* feat(ci): add release notes handling to desktop stable workflow

- Enhanced the desktop stable release workflow to include release notes.
- Updated output variables to capture release notes from the GitHub event.
- Adjusted environment variables in subsequent jobs to utilize the new release notes data.

This addition improves the clarity and documentation of releases by ensuring that release notes are included in the workflow process.

Signed-off-by: Innei <tukon479@gmail.com>

* 🐛 fix: call onClose after knowledge base modal closes

* 🧪 test: fix UpdaterManager update channel mocks

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-15 17:26:19 +08:00
Innei
07dc919496 🔧 chore(desktop): exclude node_modules from electron-builder packaging (#11397)
* 🔧 chore(desktop): exclude node_modules from electron-builder packaging

- Add !node_modules to files config to prevent bundling node_modules
- Remove unused asarUnpack config for sharp and @img (not used in electron main process)

Fixes LOBE-3008

* 🔧 chore(file-loaders): move @napi-rs/canvas to devDependencies

@napi-rs/canvas is only used in test/setup.ts for DOMMatrix polyfill,
not required at runtime. Moving to devDependencies allows Vite to
bundle all runtime dependencies as pure JS.

* 🔧 chore(desktop): remove pdfjs-dist from dependencies

Removed the pdfjs-dist package from the dependencies in package.json as it is no longer needed.

Signed-off-by: Innei <tukon479@gmail.com>

* 🔧 chore(desktop): refactor electron-builder configuration and remove unused files

* 🔧 chore(desktop): refactor electron-builder configuration and remove unused files

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-10 23:15:42 +08:00
YuTengjing
5277650dc6 ♻️ refactor(auth): improve auth configuration for better Docker runtime support (#11253) 2026-01-06 15:15:22 +08:00
Innei
06cb019b8e 🐛 fix(electron): correct next config codemod pattern matching (#11228)
- Use findAll with kind: 'pair' instead of find with pattern for redirects
- Add webVitalsAttribution removal logic
- Improve pattern matching to handle spacing variations
- Add invariant checks for better error handling

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

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-05 14:29:52 +08:00
Innei
0205cf73bd refactor: Extract renderer URL and protocol management into dedicated manager (#11208)
* feat: Add static export modifier for Electron, refactor route variant constants, and simplify renderer file path resolution.

* refactor: Extract renderer URL and protocol management into a dedicated `RendererUrlManager` and update `App` to utilize it.

Signed-off-by: Innei <tukon479@gmail.com>

* feat: Implement Electron app locale management and i18n initialization based on stored settings.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-01-05 00:59:35 +08:00
Arvin Xu
bb2799dc75 ♻️ refactor: remove client db and refactor test (#11123)
* ♻️ refactor: refactor to remove client db

* remove tableViewer

*  tests: remove tests
2026-01-03 13:59:45 +08:00
Innei
95806721ba 🐛 fix(prebuild): correct syntax in partialBuildPages array
- Fixed the syntax of the partialBuildPages array in prebuild.mts by replacing a trailing comma with a closing brace.
- Ensured proper structure for the array to avoid potential runtime errors.

Signed-off-by: Innei <tukon479@gmail.com>
2025-12-29 14:38:43 +08:00
Innei
5380f76ed1 🔧 chore: increase NODE_OPTIONS memory limit to 8GB across configurations
- Updated NODE_OPTIONS from 6144MB to 8192MB in Dockerfile, package.json scripts, GitHub workflows, and environment configurations.
- Ensured consistent memory allocation for builds and tests to improve performance.

Signed-off-by: Innei <tukon479@gmail.com>
2025-12-29 14:35:04 +08:00
Innei
2fc3b4238a 🐛 fix(ci): skip backend routes in bundle analyzer build (#10944)
- Add isBundleAnalyzer check in prebuild script to skip backend routes when ANALYZE=true && CI=true
- Update bundle analyzer workflow to use fallback KEY_VAULTS_SECRET from generate-secret step
- Increase NODE_OPTIONS memory limit to 8GB
- Remove unnecessary S3_PUBLIC_DOMAIN and APP_URL env vars

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-29 13:51:03 +08:00
Innei
a763f12fd3 build: add assertions to electron workflow modifiers (#11003)
- Add post-condition assertions to all file modification operations
- Add verify-desktop-patch.yml workflow for CI validation
- Add invariant, updateFile, writeFileEnsuring, removePathEnsuring utilities
- Improve error messages and validation in workflow scripts

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-27 02:04:53 +08:00
YuTengjing
12fb04b88d refactor: move src/config/modelProviders to model-bank 2025-12-25 21:02:19 +08:00
CanisMinor
024aeb2e4e 💄 style: Update i18n microcopy (#10905)
* chore: update i18n

* chore: update i18n

* chore: update i18n

* chore: update i18n

* chore: update i18n

* chore: update i18n

* chore: update i18n

* chore: update i18n translations and placeholders across multiple components

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update i18n translations for consistency in terminology across chat, onboarding, and settings components

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update i18n translations to replace 'assistant' with 'agent' and ensure consistency across all components

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update model descriptions in locales for clarity and accuracy

Signed-off-by: Innei <tukon479@gmail.com>

* feat: extract hard code string

Signed-off-by: Innei <tukon479@gmail.com>

* feat: enhance Chinese localization with new proxy and sync settings, update dialog messages for version checks and OAuth authorization

Signed-off-by: Innei <tukon479@gmail.com>

* chore: flatten

* chore: standardize localization keys by flattening nested structures across multiple languages

Signed-off-by: Innei <tukon479@gmail.com>

* chore: refine i18n documentation by consolidating key naming conventions and workflow guidelines for translation management

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update i18n

* feat: add chat title localization for improved user experience in Chinese

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
Co-authored-by: Innei <tukon479@gmail.com>
2025-12-24 12:55:12 +08:00
Innei
10e048c9c5 feat: refactor desktop implement with brand new 2.0 2025-12-24 12:54:35 +08:00
Innei
f74befadc9 ♻️ refactor(electron-main): client ipc decorate (#10679)
* refactor: client ipc

* refactor: server ipc

refactor: update IPC method names for consistency

Signed-off-by: Innei <tukon479@gmail.com>

fix: cast IPC return type to DesktopIpcServices for type safety

Signed-off-by: Innei <tukon479@gmail.com>

chore: add new workspace for desktop application in package.json

Signed-off-by: Innei <tukon479@gmail.com>

fix: export FileMetadata interface for improved accessibility

Signed-off-by: Innei <tukon479@gmail.com>

refactor: unify IPC mocking across test files for consistency

Signed-off-by: Innei <tukon479@gmail.com>

feat: enhance type-safe IPC flow with context propagation and service registry

- Introduced `getIpcContext()` and `runWithIpcContext()` for improved context management in IPC handlers.
- Updated `BrowserWindowsCtr` methods to utilize the new context handling.
- Added `McpInstallCtr` to the IPC constructors registry.
- Enhanced README with details on the new type-safe IPC features.

Signed-off-by: Innei <tukon479@gmail.com>

refactor: enhance IPC method registration for improved type safety

- Updated `registerMethod` in `IpcHandler` and `IpcService` to accept variable argument types, enhancing flexibility in method signatures.
- Simplified the `ExtractMethodSignature` type to support multiple arguments.

Signed-off-by: Innei <tukon479@gmail.com>

chore: add global type definitions and refactor import statements

- Introduced a new global type definition file to support Vite client imports.
- Refactored import statements in `App.ts` and `App.test.ts` to remove unnecessary type casting for `import.meta.glob`, improving code clarity.

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: make groupName in BrowserWindowsCtr readonly for better encapsulation

Signed-off-by: Innei <tukon479@gmail.com>

* refactor: update IPC method registration and usage for improved type safety and consistency

- Replaced `@ipcClientEvent` with `@IpcMethod()` in various controllers to standardize IPC method definitions.
- Enhanced the usage of `ensureElectronIpc()` for type-safe IPC calls in service layers.
- Updated `BrowserWindowsCtr` and `NotificationCtr` to utilize the new IPC method structure, improving encapsulation and clarity.
- Refactored service methods to eliminate manual string concatenation for IPC event names, ensuring better maintainability.

Signed-off-by: Innei <tukon479@gmail.com>

---------

Signed-off-by: Innei <tukon479@gmail.com>
2025-12-09 15:01:18 +08:00
Innei
c6aa46a154 🔨 chore: environment variable loading with dotenv-expand (#10590)
fix: environment variable loading with dotenv-expand

Signed-off-by: Innei <tukon479@gmail.com>
2025-12-04 09:46:48 +08:00
YuTengjing
ca2a1a21f6 🐛 fix: user email unique migration error (#10548) 2025-12-02 12:37:42 +08:00
Shinji-Li
871d1416cc 🐛 fix: fixed changelog pages and open again (#10285)
* feat: fixed  changelog pages and open again

* fix: add discover use dynamic import

* fix: update the routers

* fix: change the pre build mts
2025-11-21 17:47:13 +08:00
René Wang
c0542e80a3 🔨 chore: Add CI to Check console.log (#10333)
* lint: Clean breakpoints

* build: Add CI to check

* build: Add `next` branch

* build: Remove markdown files

* fix: CI hang out

* fix: Show warning on GitHub

* feat: Send comment

* fix: CI error

* fix: show file list
2025-11-21 14:18:10 +08:00
Arvin Xu
3785a7109a feat: edit local file render & intervention (#10269)
* support editFile render

* clean and add tests

* improve hover state

* support edit local file

* fix tests

* fix desktop build

* fix desktop build

* Revert "fix desktop build"

This reverts commit 6ce58b2eeb.
2025-11-18 02:07:58 +08:00
Shinji-Li
f445ab013c ♻️ refactor: refactor the root from nextjs router to react-router-dom (#10094)
* feat: change the root path to react-router-dom to render spa

* feat: disable / to /chat rewrite

* feat: change /settings labs image profile changelog to spa mode

* feat: use loading to dynamic loading

* fix: change the goback & knowledge/base url

* feat: change some nextjs router to react-router-dom use

* feat: link replace to react-router-dom

* fix: delete useless code

* feat: fix mobile agent settings page not work problem

* fix: fix the test

* fix: slove the router back

* fix: slove ts problem

* fix: change the router judge by servers

* feat: change AppRouter to Desktop Router & mobile Router to dynamic import

* fix: refactor the memory router to browser router

* feat: /chat delete pages & layouts dir

* feat: change all discover page to the spa

* feat: discover pages layout & pages routers get done

* feat: change all routes to outer routes

* feat: change the :slug to react-router loader to get

* feat: change NextJs Link useRouter useSearchParams change to react-router way

* fix: delete some layout tsx & update the ts

* feat: change local params get use ReactRouter Outlet context

* fix: fix hydrateFallback problem

* fix: fix build problem

* fix: change the changelog pages render

* feat: delete all nuqs

* feat: change the mobile me layout back

* chore: add mobile me layout back

* fix: discover find more  link error fixed

* fix: add nuqs back & useQueryState back in oath

* fix: add files back

* fix: add files back

* feat: use starTransition to navigate url

* fix: close the loading in the layout loading

* chore: update test.ts in TopActions.tsx

* fix: delete useless code

* fix: fix mobile router goback fc

* fix: delete the changelog modal page

* feat: fix a lot router problem

* fix: fix useNav in discover page error problem

* feat: rollback some changes about layout

* fix: fixed the desktop knowledge page router

* fix: fixed usage router error

* fix: fixed router link error

* fix: fixed the url & new url not path problem

* fix: fixed the test

* feat: update the useQueryParams throttleMs params

* feat: use more simple way to update session hydration

* fix: delete useless code

* fix: delete uesless code

* fix: mobile chat settings go back

* fix: fix the reload was loading page problem

* fix: fixed the test error

* fix: add router ErrorBoundary

* test: test the loading error

* fix: try to fixed

* fix: test mobile

* feat: add loading back
2025-11-17 20:54:37 +08:00
Arvin Xu
f2ab2fcef6 ♻️ refactor: remove NEXT_PUBLIC_SERVICE_MODE env and use server by default (#10017)
* remove NEXT_PUBLIC_SERVICE_MODE

* update

* fix tests

* update e2e workflow

* update config

* Rename DATABASE_TEST_URL to DATABASE_URL
2025-11-04 00:34:37 +08:00
Arvin Xu
8abfdecd54 ️ perf: improve db query performance (#9946)
* fix db performance issue

* fix tests
2025-10-31 12:39:59 +08:00
Maple Gao
3eaeb6c531 📝 docs: consolidate image generation docs with server database setup (#9096)
♻️ refactor: consolidate image generation docs with server database setup

- Merge image-generation-setup content into work-with-server-side-database docs
- Remove duplicate image-generation-setup documentation files
- Add server-side database links to setup-development guides
- Add missing .env.development copy step to setup instructions
- Add .env.development to .gitignore for security

The setup script approach has been replaced by Docker Compose configuration
with .env.example.development file, eliminating documentation duplication
and providing a unified server-side development workflow.
2025-09-11 01:16:58 +08:00
YuTengjing
ea819a3421 feat: support mac intel desktop (#9136) 2025-09-08 23:46:57 +08:00
Arvin Xu
ae28f1794c ️ build : Revert "support mac intel chip" (#9134)
Revert "feat(desktop): support mac intel chip (#9084)"

This reverts commit 1a75f4a6b5.
2025-09-06 16:14:42 +08:00
YuTengjing
1a75f4a6b5 feat(desktop): support mac intel chip (#9084) 2025-09-06 14:03:16 +08:00
Arvin Xu
8dedc2d3e1 ♻️ refactor: move utils to separate package (#8889)
* move utils

* move utils

* move utils

* update

* update

* update

* update

* update

* refactor to clean the tests

* fix release workflow

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* try to fix client db migration issue

* fix tests
2025-08-22 14:05:01 +08:00
Arvin Xu
af1f71572f ♻️ refactor: move database to packages (#8874)
* move db

* refactor db import

* refactor eval types

* fix tests

* fix tests

* fix tests

* fix db migration issues

* fix docker issue

* fix tests

* update alias

* fix tests

* update db test for client and server

* refactor db

* update codecov

* update codecov

* update codecov

* add docker pr comments
2025-08-22 11:09:03 +08:00
Maple Gao
3ae5134984 📝 docs: Add image generation development environment setup (#8859)
* 🔨 chore: add image generation development environment setup

- Add setup-image-generation-dev.sh script for automated environment configuration
- Add English and Chinese documentation for image generation development setup
- Configure PostgreSQL and MinIO for local development with automatic bucket creation
- Include database migration and S3 environment variable configuration

* Update scripts/setup-image-generation-dev.sh
2025-08-21 23:44:21 +08:00
Arvin Xu
29417d5e18 🔨 chore: fix type in some scripts (#8631)
* upgrade types

* fix types

* fix types
2025-08-01 12:42:55 +08:00
Arvin Xu
416a4b1212 feat: Add MCP marketplace and mcp plugin one-click installation in desktop (#8334)
* move plugin Component

*  feat(wip): Add MCP Discover Market

*  test: Fix test

*  test: Fix test

* 🐛 fix: Fix build

* 🐛 fix: Fix build

* 💄 style: update plugin store

* 💄 style: Update plugin store

*  feat: Update cache control headers and optimize Next.js config for performance

* 💄 style: Update discover markdown

* 💄 style: Update scroes step

* 优化 list 细节

* 优化 list 细节

* 优化 list 细节

* 完成基础 mcp 安装实现

* 完成安装上报

* 新增安装过程

* fix

* 优化插件设置页面配置

* 💄 style: update official icon

* 完善安装错误状态

* 支持取消安装

* fix types

* fix types

* 完成系统依赖检查流程

* 完成系统依赖安装流程上报

* try to fix suspense

* try to fix suspense

* try to fix suspense

* try to fix tests

* upgrade electron

* fix suspense

* fix tool name issue

* fix test

* add i18n

* fix tool call

*  test: fix tests

* move

* fix tests

* refactor plugin install store

* improve old plugin install

* fix

* fix header link

* fix plugin detail

* fix oldPlugin detail

* fix tests

* update i18n

* fix i18n

* 💄 style: improve style

* add debug log

* fix link

* improve

* fix link

* 🚚 refactor: refactor the market runtime to nodejs

* 移除 props.searchParams 调用

*  test: fix tests

* 尝试静态化 discover page

* ♻️ refactor: refactor config to nodejs runtime

* fix min width

* 修正自定义插件的编辑展示区域

* fix i18n

* 调整部分组件目录结构

* 完善 MCP 市场安装流程

* 完善安装上报事件

* test: fix test

*  feat: 实现 m2m oauth 请求

*  feat: 完善 m2m 注册链路

*  feat: 完善 m2m 注册链路

* 🐛 fix: 优化 debug 日志输出问题

*  feat: 支持 call 上报

* 💄 style: 使用更大的版本

* 🐛 fix: tools calling report

* 🐛 fix: try to fix call report

* 🐛 fix: try to use expires cookies

* 🐛 fix: fix cookies expires issue

* test: fix customPluginInfo report

* 🐛 fix: fix connection issue

* 🐛 fix: fix platform report

* 🐛 fix: fix version issue

---------

Co-authored-by: canisminor1990 <i@canisminor.cc>
2025-07-08 19:51:22 +08:00
YuTengjing
780ee82b12 ️ build: integrate tsgo to validate ts (#8331)
* ️ build: integrate tsgo to validate ts

* 📝 docs: add code comment to @ts-ignore

* Update package.json

* Update apps/desktop/package.json

* Update package.json

* Update package.json
2025-07-04 01:01:11 +08:00
𝑾𝒖𝒙𝒉
8953523575 🔧 chore: improve i18n workflow diff script (#8153)
* 🔧 chore: Add writeJSONWithPrettier utility and update locale generation scripts

* 🔧 chore: Implement genRemoveDiff utility for locale diff analysis and update workflow

* chore: update script

* chore: revert

* 🔧 chore: Refactor genDiff to improve diff analysis and streamline locale processing
2025-06-12 14:54:05 +08:00
Arvin Xu
ed97363255 feat: support desktop release framework and workflow (#6474)
* add desktop

fix build

update release desktop ci

improve desktop build for pr workflow

update desktop build workflow

test auto updater

fix

fix release nightly channel

support shortcut framework

improve nightly version rule

add zip release

only add mac publish

fix static file relative issue

support delete files

fix lint

enable asar

add setting open in editor in menu

add electron store framework and locale update flow

fix default searchFCModel

refactor the electron server ipc to stable mode

improve electron dev workflow

improve electron build workflow

make qwen2.5b default

improve comment workflow

fix types

refactor code

improve window size of settings/provider

路由拦截器v3.5

fix RouteIntercept issue

improve log

use productName in package.json

update

add pin list for feature flag

update

sure settings update

make ollama as default provider in desktop

fix desktop close page issue

fix desktop default variants

improve to reduce bundle

improve to reduce bundle again

improve set desktop version workflow

add nightly icons

add prebuild scripts to reduce package size

add to test prebuild

fix workflow

try to add sign and notarize for mac in workflow

try to add sign and notarize

add i18n for menu and main

update menu i18n

add i18n framework

add menu implement and setting

improve layout design for desktop

update Author

fix failed register protocol

fix prod building

fix tests

fix open error of mac and windows
improve lint

update pr comment

add service framework

add fileSearchService

improve

fix release workflow

add header

improve pr workflow fetch

improve client fetch

add linux upload workflow

improve workflow and implement

fix build electron in ci

build the desktop framework

fix build electron in ci

update tsconfig

fix desktop build workflow

finish desktop build workflow

fix workflow build steps

update workflow

test release workflow

refactor

update

update

improve loading state

refactor the 404 error

* 重构存储路径,统一到一个 lobehub-storage 下,方便未来用户自定义存储路径

* fix lint

* update

* try to fix windows open issue

* rename

* fix storage

* refactor the remote server sync

* refactor the request method

* 完成服务端同步实现逻辑

* fix lint

* save size

* refactor to make sure different instance of ipc channel

* clean log

* fix refresh

* fix tools calling

* fix auth callback issue

* update workflow

* add window ico

* push

* update

* add beta release

* fix update issue

* 完成官方实例链接

* fix

* fix stdio
2025-04-27 11:57:06 +08:00
Arvin Xu
0085e639b8 💄 style: support update tool calling params and trigger again (#7476)
* update client ipc

* test web prebuild

* update i18n

* support update tools calling params

* add local files tools

* fix docker build flow

* fix suspense
2025-04-19 14:13:09 +08:00
YuTengjing
6002e823e2 Merge branch 'main' of github.com:lobehub/lobe-chat into tj/feat/guide-message 2025-04-14 11:34:06 +08:00
Arvin Xu
b12b24018e 🔨 chore: add OAuth 2.0 and OIDC core implement (#7380)
* add oidc implement

* add oidc implement

* update

* update

* migration db

* improve

* improve scripts

* update

* 解决 auth 302 跳转的问题

* 完成 policy 实现调试

* improve middleware log

* 初步完成 auth 授权实现

* 初步完成 auth 授权实现

* fix adapter

* add adapter tests

* refactor with http adapter

* refactor for oidc service

* finish oauth 授权基础实现

* 区分 backend 入口与 client 页面入口

* add i18n

* update db schema

* fix lint

* improve

* fix tests and update i18n

* improve db adaptor

* fix tests

* fix tests

* fix tests
2025-04-13 00:49:31 +08:00
Arvin Xu
f57f7af1b8 👷 build: add desktop workflow and pre-merge desktop code (#7361)
* add desktop workflow code

* add desktop relative code

* Update pr-release-body.js
2025-04-10 10:47:05 +08:00
YuTengjing
2e763f808c ♻️ chore: update database schema docs path from developer to development 2025-04-09 20:14:57 +08:00
Arvin Xu
addea48b52 💄 style: support default config for system agent and pre-merge some desktop code (#7296)
* refactor

* update

* improve scripts

* fix changelog issue

* improve system agent config

* fix tests

* update scripts

* update ollama models

* Update ollama.ts
2025-04-06 12:09:57 +08:00