Commit Graph

54 Commits

Author SHA1 Message Date
YuTengjing
228044e649 🐛 fix: add ffmpeg-static to default serverExternalPackages (#12846) 2026-03-09 18:13:17 +08:00
YuTengjing
857f469323 🐛 fix: remove ffmpeg-static from outputFileTracingExcludes (#12844) 2026-03-09 17:10:57 +08:00
YuTengjing
5af5b80b83 🐛 fix: include pnpm store path for ffmpeg-static in Vercel tracing (#12838) 2026-03-09 14:37:59 +08:00
Innei
18ec113bba 🔧 chore: simplify build config and remove webpack customization (#12539)
- Remove desktop-related build steps from Dockerfile
- Simplify next.config.ts, only apply Vercel-specific config on Vercel
- Remove webpack customization from define-config.ts
- Fix String() type conversion in video.ts
2026-03-01 00:22:21 +08:00
Innei
687b36c81c ♻️ refactor: migrate frontend from Next.js App Router to Vite SPA (#12404)
* init plan

* 📝 docs: update SPA plan for dev mode Worker cross-origin handling

- Clarified the handling of Worker cross-origin issues in dev mode, emphasizing the need for `workerPatch` to wrap cross-origin URLs as blob URLs.
- Enhanced the explanation of the dev mode's resource URL rewriting process for better understanding.

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

* 🔧 refactor: Phase 1 - 环境变量整治

- Fix Pyodide env var mismatch (NEXT_PUBLIC_PYPI_INDEX_URL → pythonEnv.NEXT_PUBLIC_PYODIDE_PIP_INDEX_URL)
- Consolidate python.ts to use pythonEnv instead of direct process.env
- Remove NEXT_PUBLIC_ prefix from server-side MARKET_BASE_URL (5 files)

* 🏗️ chore: Phase 2 - Vite 工程搭建

- Add vite.config.ts with dual build (desktop/mobile via MOBILE env)
- Add index.html SPA template with __SERVER_CONFIG__ placeholder
- Add entry.desktop.tsx and entry.mobile.tsx SPA entry points
- Add dev:spa, dev:spa:mobile, build:spa, build:spa:copy scripts
- Install @vitejs/plugin-react and linkedom

* ♻️ refactor: Phase 3 - 第一方包 Next.js 解耦

- Replace next/link with <a> in builtin-tool-web-browsing (4 files, external links)
- Replace next/image with <img> in builtin-tool-agent-builder/InstallPlugin.tsx
- Add Vite import.meta.env compat for isDesktop in const/version.ts, builtin-tool-gtd, builtin-tool-group-management

* ♻️ refactor: Phase 4a - Auth 页面改用直接 next/navigation 和 next/link

- 9 auth files: @/libs/next/navigation → next/navigation
- 5 auth files: @/libs/next/Link → next/link
- Auth pages remain in Next.js App Router, need direct Next.js imports

* ♻️ refactor: Phase 4b - Next.js 抽象层替换为 react-router-dom/vanilla React

- navigation.ts: useRouter/usePathname/useSearchParams/useParams → react-router-dom
- navigation.ts: redirect/notFound → custom error throws
- navigation.ts: useServerInsertedHTML → no-op for SPA
- Link.tsx: next/link → react-router-dom Link adapter (href→to, external→<a>)
- Image.tsx: next/image → <img> wrapper with fill/style support
- dynamic.tsx: next/dynamic → React.lazy + Suspense wrapper

*  feat: Phase 5 - 新建 SPAGlobalProvider

- Create SPAServerConfig type (analyticsConfig, clientEnv, theme, featureFlags, locale)
- Add window.__SERVER_CONFIG__ and __MOBILE__ to global.d.ts
- Create SPAGlobalProvider (client-only Provider tree mirroring GlobalProvider)
- Includes AuthProvider for user session support
- Update entry.desktop.tsx and entry.mobile.tsx to wrap with SPAGlobalProvider

* ♻️ refactor: add SPA catch-all route handler with Vite dev proxy

- Create (spa)/[[...path]]/route.ts for serving SPA HTML
- Dev mode: proxy Vite dev server, rewrite asset URLs, inject Worker patch
- Prod mode: read pre-built HTML templates
- Build SPAServerConfig with analytics, theme, clientEnv, featureFlags
- Update middleware to pass SPA routes through to catch-all

* ♻️ refactor: skip auth checks for SPA routes in middleware

SPA pages are all public (no sensitive data in HTML).
Auth is handled client-side by SPAGlobalProvider's AuthProvider.
Only Next.js auth routes and API endpoints go through session checks.

* ♻️ refactor: replace Next.js-specific analytics with vanilla JS

- Google.tsx: replace @next/third-parties/google with direct gtag script
- ReactScan.tsx: replace react-scan/monitoring/next with generic script
- Desktop.tsx: replace next/script with native script injection

* ♻️ refactor: migrate @t3-oss/env-nextjs to @t3-oss/env-core

Replace framework-specific env validation with framework-agnostic version.
Add clientPrefix where client schemas exist.

* ♻️ refactor: replace next-mdx-remote/rsc with react-markdown

Use client-side react-markdown for MDX rendering instead of
Next.js RSC-dependent next-mdx-remote.

* 🔧 chore: update build scripts and Dockerfile for SPA integration

- build:docker now includes SPA build + copy steps
- dev defaults to Vite SPA, dev:next for Next.js backend
- Dockerfile copies public/spa/ assets for production
- Add public/spa/ to .gitignore (build artifact)

* 🗑️ chore: remove old Next.js route segment files and serwist PWA

- Delete [variants] page.tsx, error.tsx, not-found.tsx, loading.tsx
- Delete root loading.tsx and empty [[...path]] directory
- Delete unused loaders directory
- Remove @serwist/next PWA wrapper from Next.js config

* plan2

*  feat: add locale detection script to index.html for SPA dev mode

* ♻️ refactor: remove locale and theme from SPAServerConfig

*  feat: add [locale] segment with force-static and SEO meta generation

* ♻️ refactor: remove theme/locale reads from SPAGlobalProvider

*  feat: set vite base to /spa/ for production builds

*  feat: auto-generate spaHtmlTemplates from vite build output

* 🔧 chore: register dev:next task in turbo.json for parallel dev startup

* ♻️ refactor: rename (spa) route group to spa segment, rewrite SPA routes via middleware

*  feat: add Vite-compatible i18n/locale modules with import.meta.glob and resolve aliases

* 🔧 fix: use custom Vite plugin for module redirects instead of resolve.alias

* very important

* build

* 🔧 chore: update build scripts and clean up Vite configuration by removing unused plugin and code

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

* 🗑️ refactor: remove all electron modifier scripts

Modifiers are no longer needed with Vite SPA renderer build.

*  feat: add Vite renderer entry to electron-vite config

Add renderer build configuration to electron-vite, replacing the old
Next.js shadow workspace build flow. Delete buildNextApp.mts and
moveNextExports.ts, update package.json scripts accordingly.

*  feat: add .desktop suffix files for eager i18n loading

Create 4 .desktop files that use import.meta.glob({ eager: true })
for synchronous locale access in Electron desktop builds, replacing
the async lazy-loading used in web SPA builds.

* 🔧 refactor: adapt Electron main process for Vite renderer

Replace nextExportDir with rendererDir, update protocol from
app://next to app://renderer, simplify file resolution to SPA
fallback pattern, update _next/ asset paths to /assets/.

* 🔧 chore: update electron-builder files config for Vite renderer

Replace dist/next references with dist/renderer, remove Next.js
specific exclusion rules no longer applicable to Vite output.

* 🗑️ chore: remove @ast-grep/napi dependency

No longer needed after removing electron modifier scripts.

* 🔧 refactor: unify isDesktop to __ELECTRON__ compile-time constant

Remove NEXT_PUBLIC_IS_DESKTOP_APP and VITE_IS_DESKTOP_APP env vars.
Unify isDesktop in @lobechat/const using __ELECTRON__ defined by Vite.
Re-export from builtin-tool packages. Scripts use DESKTOP_BUILD.

* update

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

* 🔧 refactor: use electron-vite ELECTRON_RENDERER_URL instead of hardcoded port 3015

Replace hardcoded http://localhost:3015 with process.env.ELECTRON_RENDERER_URL
injected by electron-vite dev server. Clean up stale Next.js references.

* 🐛 fix: use local renderer-entry shim to resolve Vite root path issue

HTML entry ../../src/entry.desktop.tsx resolves to /src/entry.desktop.tsx
in URL space, which Vite cannot find within apps/desktop/ root. Add a
local shim that imports across root via module resolver instead.

* 🔧 refactor: extract shared renderer Vite config into sharedRendererConfig

Deduplicate plugins (nodeModuleStub, platformResolve, tsconfigPaths) and
define (__MOBILE__, __ELECTRON__, process.env) between root vite.config.ts
and electron.vite.config.ts renderer section.

* 🔧 refactor: move all renderer plugins and optimizeDeps into shared config

sharedRendererPlugins now includes react, codeInspectorPlugin alongside
nodeModuleStub, platformResolve, tsconfigPaths. Add sharedOptimizeDeps
for pre-bundling list. Both root and electron configs consume shared only.

* 🐛 fix: set electron renderer root to monorepo root for correct glob resolution

import.meta.glob with absolute paths (e.g. /node_modules/antd/...) resolved
within apps/desktop/ instead of monorepo root. Change renderer root to ROOT_DIR,
add electronDesktopHtmlPlugin middleware to rewrite / to /apps/desktop/index.html,
and remove the now-unnecessary renderer-entry.ts shim.

* desktop vite !!

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

* sync import !!

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

* clean ci!!

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

* 🔧 refactor: update SPA path structure and clean up dependencies

- Changed the path in .gitignore and related files from [locale] to [variants] for SPA templates.
- Updated index.html to set body height to 100%.
- Cleaned up package.json by removing unused dependencies and reorganizing devDependencies.
- Refactored RendererUrlManager to use a constant for SPA entry HTML path.
- Removed obsolete route.ts file from the SPA structure.
- Adjusted proxy configuration to reflect the new SPA path structure.

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

* 🔧 chore: update build script to include mobile SPA build

- Modified the build script in package.json to add the mobile SPA build step.
- Ensured the build process accommodates both desktop and mobile SPA versions.

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

* 🔧 chore: update build scripts and improve file encoding consistency

- Modified the build script in package.json to ensure the SPA copy step runs after the build.
- Updated file encoding in generateSpaTemplates.mts from 'utf-8' to 'utf8' for consistency.

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

* 🔧 fix: correct Blob import syntax and update global server config type

- Fixed the Blob import syntax in route.ts to ensure proper module loading.
- Updated the global server configuration type in global.d.ts for improved type safety.

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

* 🔧 test: update RendererUrlManager test to reflect new file path

- Modified the mock implementation in RendererUrlManager.test.ts to check for the updated file path '/mock/export/out/apps/desktop/index.html'.
- Adjusted the expected resolved path in the test to match the new structure.

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

* 🔧 refactor: remove catch-all example file and update imports

- Deleted the catch-all example file `catch-all.eg.ts` to streamline the codebase.
- Updated import paths in `ClientResponsiveLayout.tsx` and `ClientResponsiveContent/index.tsx` to use the new dynamic import location.
- Added type declarations for HTML templates in `spaHtmlTemplates.d.ts`.
- Adjusted `tsconfig.json` to include the updated file structure.
- Enhanced type definitions in `global.d.ts` and fixed locale loading in `locale.vite.ts`.

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

* e2e

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

* 🔧 chore: remove unused build script for Vercel deployment

- Deleted the `build:vercel` script from package.json to streamline the build process.
- Ensured the remaining build scripts are organized and relevant.

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

* 🔧 config: update Vite build input for mobile support

- Changed the build input path in vite.config.ts to conditionally use 'index.mobile.html' for mobile builds, enhancing support for mobile SPA versions.

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

* 🔧 feat: add compatibility checks for import maps and cascade layers

- Implemented functions to check for browser support of import maps and CSS cascade layers.
- Redirected users to a compatibility page if their browser does not support the required features.
- Updated the build script in package.json to use the experimental analyze command for better performance.

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

* chore: rename

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

* 🔧 feat: refactor authentication layout and introduce global providers

- Created a new `RootLayout` component to streamline the layout structure.
- Removed the old layout file for variants and integrated necessary features into the new layout.
- Added `AuthGlobalProvider` to manage authentication context and server configurations.
- Introduced language and theme selection components for enhanced user experience.
- Updated various components to utilize the new context and improve modularity.

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

* 🔧 config: exclude build artifacts from serverless functions

- Updated the `next.config.ts` to exclude SPA, desktop, and mobile build artifacts from serverless functions.
- Added paths for `public/spa/**`, `dist/**`, `apps/desktop/build/**`, and `packages/database/migrations/**` to the exclusion list.

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

* 🔧 config: refine exclusion of build artifacts from serverless functions

- Updated `next.config.ts` to specify exclusion paths for desktop and mobile build artifacts.
- Changed exclusions from `dist/**` and `apps/desktop/build/**` to `dist/desktop/**`, `dist/mobile/**`, and `apps/desktop/**` for better clarity and organization.

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

* 🔧 fix: update BrowserRouter basename for local development

- Modified the `ClientRouter` component to conditionally set the `basename` of `BrowserRouter` based on the `__DEBUG_PROXY__` variable, improving local development experience.

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

* 🔧 feat: implement mobile SPA workflow and S3 asset management

- Added a new workflow for building and uploading mobile SPA assets to S3, including environment variable configurations in `.env.example`.
- Updated `package.json` to include a new script for the mobile SPA workflow.
- Enhanced the Vite configuration to support dynamic CDN base paths.
- Refactored the template generation script to handle mobile HTML templates more effectively.
- Introduced new modules for uploading assets to S3 and generating mobile HTML templates.

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

* 🐛 fix: extract origin from MOBILE_S3_PUBLIC_DOMAIN to prevent double key prefix

* 🔧 fix: update mobile HTML template to use the latest asset versions

- Modified the mobile HTML template to reference the updated JavaScript asset version for improved functionality.
- Ensured consistency in the template structure while maintaining existing styles and scripts.

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

* 🔧 chore: update dependencies and refine service worker integration

- Removed outdated dependencies related to Serwist from package.json and tsconfig.json.
- Added vite-plugin-pwa to enhance PWA capabilities in the Vite configuration.
- Updated service worker registration logic in the PWA installation component.
- Introduced a new local development proxy route for debugging purposes.

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

* 🔧 chore: refactor development scripts and remove Turbo configuration

- Updated the `dev` script in `package.json` to use a new startup sequence script for improved development workflow.
- Removed the outdated `turbo.json` configuration file as it is no longer needed.
- Introduced `devStartupSequence.mts` to manage the startup of Next.js and Vite processes concurrently.

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

* 🔧 feat: update entry points and introduce debug proxy for local development

- Changed the main entry point in `index.html` from `entry.desktop.tsx` to `entry.web.tsx` for improved web compatibility.
- Added an `initialize.ts` file to enable `immer`'s `enableMapSet` functionality.
- Introduced a new `__DEBUG_PROXY__` variable in global types to support local development proxy features.
- Implemented a debug proxy route to facilitate local development with dynamic HTML injection and script handling.
- Removed outdated mobile routing components to streamline the codebase.

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

* 🔧 refactor: replace BrowserRouter with RouterProvider for improved routing

- Updated entry points for desktop, mobile, and web to utilize RouterProvider and createAppRouter for better routing management.
- Removed the deprecated renderRoutes function in favor of a more streamlined router configuration.
- Enhanced router setup to support error boundaries and dynamic routing.

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

* 🔧 refactor: remove direct access handling for SPA routes in proxy configuration

- Eliminated the handling of direct access to pre-rendered SPA pages in the proxy configuration.
- Simplified the request processing logic by removing checks for SPA routes, streamlining the middleware response flow.

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

* update

* 🔧 refactor: enhance Worker instantiation logic in mobile HTML template

* 🐛 fix: remove duplicate waitForPageWorkspaceReady calls in page CRUD e2e steps

* 🔧 refactor: simplify createTracePayload function by using btoa for base64 encoding

* 🔧 refactor: specify locales in import.meta.glob for dayjs and antd

* 🔧 refactor: replace Node.js Buffer with web-compatible btoa for base64 encoding in file upload

* 🐛 fix: disable consistent-type-imports rule for mdx files to prevent eslint crash

* 🔧 refactor: add height style to root div for consistent layout

* 🔧 refactor: replace btoa with Buffer for base64 encoding in trace and file upload handling

* 🔧 refactor: extract nextjsOnlyRoutes to a separate file for better organization

* 🔧 refactor: enable Immer MapSet plugin in tests for better state management

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

* 🔧 refactor: integrate sharedRollupOutput configuration and increase cache size for better performance

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

* 🗑️ chore: remove obsolete desktop.routes.test.ts file as it is no longer needed

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

* 🐛 fix: use cross-env for env vars in npm scripts (Windows CI)

Co-authored-by: Cursor <cursoragent@cursor.com>

* 🔧 chore: update Dockerfile for web-only build and adjust npm scripts to use pnpm

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

* 🔧 chore: enhance Dockerfile prebuild process with environment checks and add new dependencies

- Updated Dockerfile to include environment checks before removing desktop-only code.
- Added new dependencies in package.json: @aws-sdk/client-bedrock-runtime, @opentelemetry/auto-instrumentations-node, @opentelemetry/resources, @opentelemetry/sdk-metrics, and ajv.
- Configured Rollup to exclude @aws-sdk/client-bedrock-runtime from the SPA bundle.
- Introduced dockerPrebuild.mts script for environment variable validation and information logging.

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

* 🔧 chore: enhance Vite and Electron configurations with environment loading and trace encoding improvements

- Updated Vite and Electron configurations to load environment variables using loadEnv.
- Modified trace encoding in utils to use TextEncoder for better compatibility.
- Adjusted sharedRendererConfig to expose only necessary public environment variables.

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

* 🗑️ chore: remove plans directory (migrated to discussion)

* ♻️ refactor: inject NEXT_PUBLIC_* env per key in Vite define

Co-authored-by: Cursor <cursoragent@cursor.com>

*  feat: add loading screen with animation to enhance user experience

- Introduced a loading screen with a brand logo and animations for better visual feedback during loading times.
- Implemented CSS styles for the loading screen and animations in index.html.
- Removed the loading screen from the DOM once the layout is ready using useLayoutEffect in SPAGlobalProvider.

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

* 🗑️ chore: remove unnecessary external dependency from Vite configuration

- Eliminated the external dependency '@aws-sdk/client-bedrock-runtime' from the Vite configuration to streamline the build process for the SPA bundle.

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

*  feat: add web app manifest link in index.html and enable PWA support in Vite configuration

- Added a link to the web app manifest in index.html to enhance PWA capabilities.
- Enabled manifest support in Vite configuration for improved service worker functionality.

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

* 🔧 chore: update link rel attributes for improved SEO and consistency

- Modified link rel attributes in multiple components to remove 'noreferrer' and standardize to 'nofollow'.
- Adjusted imports in PageContent components for better organization.

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

* update provider

*  feat: enhance loading experience and update package dependencies

- Added a loading screen with animations and a brand logo in index.html for improved user feedback during loading times.
- Introduced CSS styles for the loading screen and animations.
- Updated package.json files across multiple packages to include "@lobechat/const" as a dependency.

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

* fix: update proxy

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

* 🗑️ chore: remove GlobalLayout and Locale components

- Deleted GlobalLayout and Locale components from the GlobalProvider directory to streamline the codebase.
- This removal is part of a refactor to simplify the layout structure and improve maintainability.

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

* chore: clean up console logs and improve component structure

- Removed unnecessary console log statements from AgentForkTag components in both agent and community directories to enhance code cleanliness.
- Refactored UserAgentList component for better readability by restructuring the useUserDetailContext hook and adjusting the layout of Flexbox components.

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

* chore: remove console log from MemoryAnalysis component

* chore: update mobile HTML template with new asset links

- Replaced the previous asset links in the mobile HTML template with updated versions to ensure the latest resources are utilized.
- Adjusted the link rel attributes for module preloading to enhance performance and loading efficiency.

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

* fix: correct variable assignment in createClientTaskThread integration test

- Updated the assignment of the second parent message in the createClientTaskThread integration test to improve clarity and ensure proper data handling.
- Changed the variable name from 'secondParentMsg' to 'inserted' for better context before extracting the first message from the inserted results.

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

* refactor: simplify authentication check in define-config

- Removed the dependency on the isDesktop variable in the authentication check to streamline the logic.
- Enhanced the clarity of the redirection process for protected routes by focusing solely on the isLoggedIn status.

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

*  feat(dev): enhance local development setup with debug proxy instructions

- Added detailed instructions for starting the development environment in CLAUDE.md, including commands for SPA and full-stack modes.
- Updated README.md and README.zh-CN.md to reflect new commands and the debug proxy URL for local development.
- Introduced a Vite plugin to print the debug proxy URL upon server start, facilitating easier local development against the production backend.
- Corrected the debug proxy route in entry.web.tsx and define-config.ts for consistency.

This improves the developer experience by providing clear guidance and tools for local development.

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

* optimize perf

* optimize perf

* optimize perf

* remove speedy plugin

* add dayjs vendor

* Revert "remove speedy plugin"

This reverts commit bf986afeb1.

---------

Signed-off-by: Innei <tukon479@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-28 00:01:01 +08:00
Arvin Xu
e7598fe90b feat: support agent benchmark (#12355)
* improve total

fix page size issue

fix error message handler

fix eval home page

try to fix batch run agent step issue

fix run list

fix dataset loading

fix abort issue

improve jump and table column

fix error streaming

try to fix error output in vercel

refactor qstash workflow client

improve passK

add evals to proxy

refactor metrics

try to fix build

refactor tests

improve detail page

fix passK issue

improve eval-rubric

fix types

support passK

fix type

update

fix db insert issue

improve dataset ui

improve run config

finish step limit now

add step limited

100% coverage to models

add failed tests todo

support interruptOperation

fix lint

improve report detail

improve pass rate

improve sort order issue

fix timeout issue

Update db schema

完整 case 跑通

update database

improve error handling

refactor to improve database

优化 test case 的处理流程

优化部分细节体验和实现

基本完成 Benchmark 全流程功能

优化 run case 展示

优化 run case 序号问题

优化 eval test case 页面

新增 eval test 模式

新增 dataset 页面

update schema

support

finish create test run

fix

update

improve import exp

refactor data flow

improve import workflow

rubric Benchmark detail 页面

improve import ux

update schema

finish eval home page

add eval workflow endpoint

implement benchmark run model

refactor RAG eval

implement backend

update db schema

update db migration

init benchmark

* support rerun error test case

* fix tests

* fix tests
2026-02-21 20:36:40 +08:00
YuTengjing
abe4c969a5 feat: add video generation feature 2026-02-14 20:16:25 +08:00
YuTengjing
a9702bf3a0 🐛 fix: docker deploy REDIS_URL check (#11773) 2026-01-24 18:04:45 +08:00
sxjeru
479556b39a 🔨 chore: fix Vercel build process (#11092)
* Update package.json

* Update next.config.ts

* improve webpack handling

* 调整构建命令以增加内存限制并更新 Vercel 构建命令
2026-01-01 19:18:38 +08:00
YuTengjing
d86f9831ca refactor: extract common next config 2025-12-25 18:04:59 +08:00
arvinxx
2da0691d4e 🔧 chore: update basic config 2025-12-24 12:54:35 +08:00
Rdmclin2
8c42a934b3 feat: mobile native better auth support (#10871)
* feat: mobile native better auth support

* chore: add android assetlinks

* chore: add android assetlinks

* chore: add expo fingerpoint

* chore: add relation

* chore: add android origin hash

* chore: update passkey table

* chore: optimize version

* chore: remove as any

* fix: sql not exits problem

* fix: passkey statement

* fix:  passkey origin null

* chore: remove strict peer dependencies

* fix: test case

* chore: remove local passkey origin
2025-12-23 15:19:42 +08:00
Innei
bde9bde17c 🔨 chore: integrate code inspector plugin and update turbopack configuration (#10588)
* feat: integrate code inspector plugin and update turbopack configuration

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

* chore: add e2e env

---------

Signed-off-by: Innei <tukon479@gmail.com>
2025-12-05 14:35:11 +08:00
YuTengjing
f72a5e6cc1 feat: betterauth username signin (#10607) 2025-12-05 01:35:20 +08:00
Arvin Xu
7114fc10c4 feat: support gemini 3.0 tools calling (#10301)
* fix error display

* 完整支持 gemini 的 Function calling 机制

* add fetchsse

* fix continue mode

* improve

* refactor

* fix
2025-11-19 17:24:46 +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
b95e741717 feat: refactor to use agent runtime as the generation core and support branch mode (#10080)
* refactor

* refactor

* refactor message group

* wip

# Conflicts:
#	src/store/chat/slices/aiChat/actions/generateAIChatV2.ts

* refactor

* refactor agent mode

* fix style

* refactor agent executors

* finish the refactor

* remove gpt-tokenizer

* add metadata api

* add fix

* support branch

* fix branch render data

* fix send issue

* refactor style

* refactor style

* refactor tests

* refactor chatStore

* refactor from model to model

* fix tests

* refactor regenerate mode

* update style

* fix lint

* refactor

* refactor

* refactor

* fix delete

* refactor thread mode

* fix basic experience

* fix

* fix tests

* fix manual add

* fix tests

* fix group
2025-11-07 16:44:03 +08:00
Arvin Xu
abb71ec846 feat: upgrade to Next 16 (#9851)
* upgrade next 16

* try to fix

* try to fix

* upgrade

* fix sitemap build

* try to fix build

* try to fix build with next 16

* fix docker permission

* 🔒 fix(ci): fix code injection vulnerability and permissions in docker workflow

- Add pull-requests: write permission to allow PR comments
- Fix code injection vulnerability by using env variables instead of direct interpolation
- Prevent potential security risks from malicious branch names in pull_request_target events

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

Co-Authored-By: Claude <noreply@anthropic.com>

* 🔧 chore(ci): change desktop pr build to use pull_request_target

- Change from pull_request to pull_request_target to access secrets and write permissions
- Update permissions from read-all to specific write permissions for contents and pull-requests
- This allows PR builds to create releases and comment on PRs from forks

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

Co-Authored-By: Claude <noreply@anthropic.com>

* add comment

* fix on

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-02 00:53:13 +08:00
Shinji-Li
2b7761c36e feat: add PDF export functionality to share modal (#9300)
* feat: add PDF export functionality to share modal

- Create usePdfExport hook with jsPDF and html2canvas
- Add "Export as PDF" button to screenshot tab in share modal
- Support multi-page PDFs for long conversations
- Add required dependencies: jspdf@^2.5.2 and html2canvas@^1.4.1
- Add localization support for PDF export button

Fixes #9299

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

Co-authored-by: LobeHub Bot <lobehubbot@users.noreply.github.com>

* ♻️ refactor: convert PDF export to separate tab with backend generation

- Create new SharePdf tab component with PDF.js preview
- Move PDF generation from frontend to backend via tRPC
- Add server-side PDF generation using jsPDF
- Remove old PDF export button from ShareImage component
- Add proper loading states and error handling
- Update localization for PDF tab

Co-authored-by: Shinji-Li <ONLY-yours@users.noreply.github.com>

* 🐛 fix: resolve unicorn/no-await-expression-member lint error in PDF exporter

Split await expression member access to avoid linting error in exporter.ts

Co-authored-by: Shinji-Li <ONLY-yours@users.noreply.github.com>

* feat: add i18n

* feat: use pdfkit to export a pdf

* feat: add fullscreen preview

* feat: update pdf preview styles

* feat: add i18n locales

* feat: add single pdf share modal

* feat: update css & client mode cant use pdf genertate

* fix: mobile style fixed

* fix: delete console.log & useless packagejson

* feat: use online otf link

---------

Co-authored-by: Shinji-Li <ONLY-yours@users.noreply.github.com>
2025-10-21 16:32:17 +08:00
sxjeru
12f54759df 🔨 chore: Enable webpackBuildWorker to optimize build memory (#9350)
Enable webpackBuildWorker in next.config.ts
2025-10-20 10:40:53 +08:00
peerless-hero
d379112d74 🐛 fix: fix the Worker URL cross-origin issue (#9624)
When the origin of the Worker script is different from the current page, reconstruct the URL relative to the current origin to avoid cross-origin errors.
2025-10-14 10:16:33 +08:00
Arvin Xu
1695f2f289 💄 style: improve styles and fix tools calling condition (#9591)
* clean and refactor

* improve

* update

* update

* fix tools engine
2025-10-06 23:36:15 +08:00
peerless-hero
dd9bbdc362 🔨 chore(config): add assetPrefix to nextConfig for environment variable support (#9427)
*  feat(config): add assetPrefix to nextConfig for environment variable support

*  feat(docs): add NEXT_PUBLIC_ASSET_PREFIX environment variable for CDN support
2025-09-26 02:57:18 +08:00
Shinji-Li
1251548120 refactor: refactor the settings page to improve the experience & change ssr as csr (#8961) 2025-09-22 11:30:47 +08:00
Arvin Xu
8711ea244c 🔨 chore: fix nextjs@15.5.x runtime warning (#9063)
* update

fix tools

Update route.ts

Update next dependency version to ^15.5.0

更新 package.json

test prebuild type-check

try

* Change 'next' dependency version in package.json

Updated 'next' dependency version from ^15.5.3 to ~15.3.5.
2025-09-18 19:13:36 +08:00
Arvin Xu
c21c14e715 🐛 fix: fix azure ai runtime error (#9276)
* fix azure ai

* improve agent schema

* improve agent schema

* improve header size

* remove sentry

* remove sentry

* fix

* clean

* fix tests
2025-09-16 15:19:55 +08:00
CanisMinor
11ceb8b346 🔧 chore: Migrating from Sentry NextJS SDK 7.x to 10.x (#9264)
* 🔧 chore: Migrating from Sentry JavaScript SDK 7.x to 8.x

* 🔧 chore: Migrating from Sentry JavaScript SDK 7.x to 8.x

* 🔧 chore: Migrate sentry v10
2025-09-15 15:35:36 +08:00
Arvin Xu
c38079d36f 🔨 chore: improve build process (#9227)
* update

* update
2025-09-12 19:11:42 +08:00
CanisMinor
38d9d98b97 feat: ChatInput support rich text and support parallel send (#8964)
*  feat: Add LobeEditor

* fix tests

* fix mobile

---------

Co-authored-by: arvinxx <arvinx@foxmail.com>
2025-09-06 09:51:52 +08:00
Arvin Xu
a9c660c26e 🔨 chore: fix webpack build OOM (#9066)
fix build
2025-09-04 12:57:50 +08:00
Arvin Xu
2a5f8d712f ♻️ refactor: remove base path (#9015)
* clean

* remove

* fix

* move config to envs

* remove envs
2025-09-01 00:30:13 +08:00
Shinji-Li
9250540912 🐛 fix: add Content-Security-Policy env (#8752)
* fix: add Content-Security-Policy

* feat: add env to control csp open or not

* update env
2025-08-29 17:14:04 +08:00
Arvin Xu
88e7d2ada1 💄 style: fix provider setting page hydration error (#8695)
* fix layout

goback

尝试开启生产环境react debug 模式

try to fix scroll issue

try to log settings layout pathname

try skip path

Revert "尝试移除 modal"

This reverts commit 7ffac36dcb680d5a9fdda6c675ad0adb66ed13d2.

remove debug

try to fix again

use InnerLink

fix

add InnerLink.tsx

add debug

* clean code

* fix modal cancel issue
2025-08-07 00:34:36 +08:00
Arvin Xu
34f061b51a Revert " 🔨 chore: Add Codecov Bundle Analysis (#6698)" (#8384)
This reverts commit b2e6777c81.
2025-07-10 18:22:55 +08:00
Katia
b2e6777c81 🔨 chore: Add Codecov Bundle Analysis (#6698)
* Add Codecov Bundle Analysis integration

- Add @codecov/webpack-plugin for bundle size tracking
- Configure bundle analysis settings in codecov.yml
- Update CI workflow to include bundle analysis step
- Set bundle change threshold to 10KB

* Use nextjs-webpack-plugin

* Seperate workflow

Move the Build with Bundle Analysis step to its own GitHub Actions workflow file.

* Revert line additon change

---------

Co-authored-by: katia-sentry <katia.al-amir@sentry.com>
2025-07-10 18:18:15 +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
Arvin Xu
4006721bff 🔨 chore: fix oidc provider proxy issue with host deployment (#7430)
* set provider proxy to true

* try to fix

* fix
2025-04-16 15:41:00 +08:00
Arvin Xu
b40caee32c 🔨 chore: add desktop pre-code to validate build process (#7261)
* add code

* fix lint

* fix tests
2025-04-02 09:31:08 +08:00
dadong
d9410b57c1 🐛fix: ignore epub2 compile error (#6779) 2025-03-07 19:28:15 +08:00
Arvin Xu
c599fcc3aa 👷 build: fix docker build failed (#6628)
* try to fix

* try to fix

* try to fix

* fix docker build

* try to fix

* try to fix docker build

* try to fix docker build

* update docs

* try  to not copy pg and drizzle orm

* remove /deps

* update
2025-03-02 21:58:57 +08:00
Arvin Xu
261d068028 💄 style: add o1 vision metadata (#6263)
* support

* update locale
2025-02-17 19:55:19 +08:00
Arvin Xu
09bf8f0a05 feat: add volcengine as a new provider (#6221)
* add volcengine

* add volcengine model

* fix

* add api key

* fix deployment name find bug

* add ability

* update i18n
2025-02-17 01:07:12 +08:00
Arvin Xu
e529108ff6 feat: refactor the auth condition in Next Auth (#5866)
This upgrade includes two changes:

For users deploying with Vercel using next-auth, it is necessary to add the environment variable `NEXT_PUBLIC_ENABLE_NEXT_AUTH=1` to ensure Next Auth is enabled; other users are not affected.
For users using clerk in self-built images, it is necessary to additionally configure `NEXT_PUBLIC_ENABLE_NEXT_AUTH=0` to disable Next Auth

Other standard deployment scenarios (using Clerk in Vercel and using next-auth in Docker) are not affected

For More detail, refer to https://github.com/lobehub/lobe-chat/issues/5804

本次升级存在两个变更:

- 针对使用 Vercel 部署中使用 next-auth 的用户,需要额外添加 `NEXT_PUBLIC_ENABLE_NEXT_AUTH=1` 环境变量来确保开启 Next Auth
- 针对使用自构建镜像中使用 clerk 的用户,需要额外配置 `NEXT_PUBLIC_ENABLE_NEXT_AUTH=0` 环境变量来关闭 Next Auth

其他标准部署场景(Vercel 中使用 Clerk 与 Docker 中使用 next-auth )不受影响

变更详情原因查看 https://github.com/lobehub/lobe-chat/issues/5804
2025-02-08 10:25:28 +08:00
Arvin Xu
9b7bd9906f 🐛 fix: try to fix discover error (#5794) 2025-02-06 20:48:32 +08:00
Arvin Xu
159f25526d ️ perf: make app page as static route to improve performance (#5478)
* move files

* refactor to static mode

* fix tests
2025-02-06 18:32:10 +08:00
CanisMinor
283157a84b 🔧 chore: Log fetch cache info (#5759) 2025-02-05 15:14:59 +08:00
Arvin Xu
8903aed12b ️ perf: improve code of user panel (#5752)
* improve code

* update repos
2025-02-05 10:56:32 +08:00
Arvin Xu
6dbc9c51f6 ️ perf: move pglite into web worker (#5500)
* move pglite into web worker

* fix turbopack build

* fix turbopack build

* improve code
2025-01-18 20:56:53 +08:00
Arvin Xu
90865706cc 🐛 fix: fix remark gfm regex breaks in Safari versions < 16.4 (#5357)
* fix build

* fix build
2025-01-09 12:26:19 +08:00
Arvin Xu
dc76d6f8fc 🐛 fix: fix model select not auto update and sort issue (#5330) 2025-01-08 10:21:58 +08:00