├── .nvmrc ├── docs ├── usage │ ├── tools-calling │ │ ├── groq.mdx │ │ ├── moonshot.mdx │ │ └── moonshot.zh-CN.mdx │ ├── tools-calling.mdx │ ├── features │ │ ├── mobile.zh-CN.mdx │ │ └── mobile.mdx │ ├── plugins │ │ └── store.zh-CN.mdx │ └── agents │ │ └── topics.zh-CN.mdx └── self-hosting │ ├── server-database │ ├── sealos.zh-CN.mdx │ ├── repocloud.zh-CN.mdx │ ├── railway.zh-CN.mdx │ ├── sealos.mdx │ ├── netlify.zh-CN.mdx │ ├── netlify.mdx │ ├── railway.mdx │ └── repocloud.mdx │ └── environment-variables.zh-CN.mdx ├── src ├── store │ ├── user │ │ ├── index.ts │ │ ├── slices │ │ │ ├── settings │ │ │ │ ├── selectors │ │ │ │ │ └── index.ts │ │ │ │ └── initialState.ts │ │ │ ├── modelList │ │ │ │ ├── selectors │ │ │ │ │ └── index.ts │ │ │ │ └── initialState.ts │ │ │ ├── sync │ │ │ │ └── initialState.ts │ │ │ ├── preference │ │ │ │ ├── initialState.ts │ │ │ │ └── selectors.ts │ │ │ └── common │ │ │ │ └── initialState.ts │ │ ├── helpers.ts │ │ └── selectors.ts │ ├── global │ │ └── index.ts │ ├── session │ │ ├── helpers.ts │ │ ├── slices │ │ │ ├── session │ │ │ │ ├── selectors │ │ │ │ │ └── index.ts │ │ │ │ └── helpers.ts │ │ │ └── sessionGroup │ │ │ │ ├── selectors.ts │ │ │ │ └── initialState.ts │ │ ├── index.ts │ │ ├── selectors.ts │ │ └── initialState.ts │ ├── agent │ │ ├── selectors.ts │ │ ├── slices │ │ │ └── chat │ │ │ │ └── index.ts │ │ ├── index.ts │ │ └── initialState.ts │ ├── file │ │ ├── slices │ │ │ ├── tts │ │ │ │ ├── index.ts │ │ │ │ └── selectors.ts │ │ │ └── images │ │ │ │ ├── index.ts │ │ │ │ └── initialState.ts │ │ ├── index.ts │ │ ├── initialState.ts │ │ └── selectors.ts │ ├── tool │ │ ├── index.ts │ │ ├── slices │ │ │ ├── builtin │ │ │ │ ├── index.ts │ │ │ │ ├── initialState.ts │ │ │ │ └── selectors.ts │ │ │ ├── store │ │ │ │ ├── index.ts │ │ │ │ └── initialState.ts │ │ │ ├── plugin │ │ │ │ ├── index.ts │ │ │ │ ├── initialState.ts │ │ │ │ └── __snapshots__ │ │ │ │ │ └── action.test.ts.snap │ │ │ └── customPlugin │ │ │ │ ├── index.ts │ │ │ │ ├── selectors.ts │ │ │ │ └── initialState.ts │ │ ├── selectors │ │ │ └── index.ts │ │ └── initialState.ts │ ├── chat │ │ ├── index.ts │ │ ├── slices │ │ │ ├── share │ │ │ │ └── initialState.ts │ │ │ ├── builtinTool │ │ │ │ ├── initialState.ts │ │ │ │ └── selectors.ts │ │ │ ├── message │ │ │ │ └── utils.ts │ │ │ └── portal │ │ │ │ ├── initialState.ts │ │ │ │ └── selectors.ts │ │ ├── selectors.ts │ │ └── utils │ │ │ └── index.ts │ ├── market │ │ ├── index.ts │ │ └── initialState.ts │ └── serverConfig │ │ └── index.ts ├── types │ ├── trace │ │ └── index.ts │ ├── message │ │ └── translate.ts │ ├── user │ │ └── settings │ │ │ ├── tool.ts │ │ │ ├── tts.ts │ │ │ ├── sync.ts │ │ │ ├── systemAgent.ts │ │ │ └── general.ts │ ├── locale.ts │ ├── service.ts │ ├── share.ts │ ├── i18next.d.ts │ ├── openai │ │ └── functionCall.ts │ ├── tool │ │ ├── tool.ts │ │ ├── dalle.ts │ │ └── index.ts │ ├── topic.ts │ ├── session │ │ ├── index.ts │ │ └── sessionGroup.ts │ ├── market.ts │ └── global.d.ts ├── const │ ├── message.ts │ ├── settings │ │ ├── tool.ts │ │ ├── sync.ts │ │ ├── common.ts │ │ ├── tts.ts │ │ └── systemAgent.ts │ ├── plugin.ts │ ├── hotkeys.ts │ ├── theme.ts │ ├── version.ts │ ├── user.ts │ ├── layoutTokens.test.ts │ ├── meta.ts │ ├── locale.ts │ └── market.ts ├── components │ ├── FileList │ │ ├── style.ts │ │ └── index.tsx │ ├── BrowserIcon │ │ ├── types.ts │ │ └── components │ │ │ ├── Chrome.tsx │ │ │ └── Chromium.tsx │ ├── Analytics │ │ ├── Google.tsx │ │ ├── Vercel.tsx │ │ ├── Umami.tsx │ │ ├── Plausible.tsx │ │ └── Posthog.tsx │ ├── PageTitle │ │ └── index.tsx │ ├── StructuredData │ │ └── index.tsx │ ├── ModelTag │ │ └── index.tsx │ ├── Error │ │ └── sentryCaptureException.ts │ ├── FetchErrorNotification │ │ └── index.tsx │ ├── server │ │ └── ServerLayout.tsx │ ├── Cell │ │ └── Divider.tsx │ └── SkeletonLoading │ │ └── index.tsx ├── database │ ├── server │ │ ├── index.ts │ │ └── schemas │ │ │ └── lobechat │ │ │ ├── index.ts │ │ │ └── _helpers.ts │ └── client │ │ ├── core │ │ ├── index.ts │ │ ├── types │ │ │ └── db.ts │ │ └── migrations │ │ │ └── migrateSettingsToUser │ │ │ ├── index.test.ts │ │ │ └── index.ts │ │ └── schemas │ │ ├── sessionGroup.ts │ │ ├── topic.ts │ │ └── plugin.ts ├── features │ ├── User │ │ ├── UserLoginOrSignup │ │ │ └── index.tsx │ │ └── UserPanel │ │ │ ├── useNewVersion.tsx │ │ │ └── UpgradeBadge.tsx │ ├── Conversation │ │ ├── Extras │ │ │ ├── type.ts │ │ │ ├── index.ts │ │ │ └── ExtraContainer.tsx │ │ ├── Error │ │ │ └── InvalidAPIKey.tsx │ │ ├── Actions │ │ │ ├── Fallback.tsx │ │ │ └── Error.tsx │ │ ├── Messages │ │ │ ├── components │ │ │ │ └── Arguments.tsx │ │ │ ├── Default.tsx │ │ │ └── Tool │ │ │ │ └── Inspector │ │ │ │ └── PluginResultJSON.tsx │ │ └── components │ │ │ └── ChatList │ │ │ └── index.tsx │ ├── AgentSetting │ │ ├── index.tsx │ │ ├── AgentTTS │ │ │ └── options.ts │ │ ├── store │ │ │ ├── selectors.ts │ │ │ └── index.ts │ │ ├── AgentSettingsStore.tsx │ │ ├── useSyncAgemtSettings.ts │ │ └── AgentModal │ │ │ └── ModelSelect.tsx │ ├── PluginStore │ │ └── Loading.tsx │ ├── PluginsUI │ │ └── Render │ │ │ ├── useParseContent.ts │ │ │ └── utils │ │ │ ├── pluginSettings.ts │ │ │ └── pluginState.ts │ ├── MobileSwitchLoading │ │ └── index.tsx │ ├── DataImporter │ │ └── style.ts │ └── ChatInput │ │ └── ActionBar │ │ └── ModelSwitch.tsx ├── libs │ ├── trpc │ │ ├── client │ │ │ ├── index.ts │ │ │ ├── types.ts │ │ │ └── edge.ts │ │ └── middleware │ │ │ └── userAuth.ts │ ├── agent-runtime │ │ ├── types │ │ │ └── index.ts │ │ ├── utils │ │ │ ├── streams │ │ │ │ ├── bedrock │ │ │ │ │ └── index.ts │ │ │ │ └── index.ts │ │ │ ├── response.ts │ │ │ └── createError.ts │ │ ├── ollama │ │ │ └── type.ts │ │ ├── novita │ │ │ └── type.ts │ │ ├── ai360 │ │ │ └── index.ts │ │ ├── openai │ │ │ └── index.ts │ │ ├── stepfun │ │ │ └── index.ts │ │ ├── deepseek │ │ │ └── index.ts │ │ ├── moonshot │ │ │ └── index.ts │ │ ├── taichu │ │ │ └── index.ts │ │ ├── zeroone │ │ │ └── index.ts │ │ └── siliconcloud │ │ │ └── index.ts │ ├── logger │ │ └── index.ts │ └── next-auth │ │ └── sso-providers │ │ ├── index.ts │ │ └── sso.config.ts ├── app │ ├── not-found.tsx │ ├── (main) │ │ ├── not-found.tsx │ │ ├── chat │ │ │ ├── loading.tsx │ │ │ ├── not-found.tsx │ │ │ ├── settings │ │ │ │ ├── not-found.tsx │ │ │ │ ├── error.tsx │ │ │ │ ├── loading.tsx │ │ │ │ ├── page.tsx │ │ │ │ └── _layout │ │ │ │ │ └── Mobile │ │ │ │ │ └── index.tsx │ │ │ ├── error.tsx │ │ │ ├── _layout │ │ │ │ └── type.ts │ │ │ ├── (workspace) │ │ │ │ ├── _layout │ │ │ │ │ ├── type.ts │ │ │ │ │ ├── Desktop │ │ │ │ │ │ └── ChatHeader │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ └── useInitAgentConfig.ts │ │ │ │ ├── features │ │ │ │ │ └── ShareButton │ │ │ │ │ │ └── type.ts │ │ │ │ ├── layout.ts │ │ │ │ ├── @conversation │ │ │ │ │ └── features │ │ │ │ │ │ └── ChatInput │ │ │ │ │ │ └── Desktop │ │ │ │ │ │ ├── Footer │ │ │ │ │ │ └── LocalFiles.tsx │ │ │ │ │ │ └── useAutoFocus.ts │ │ │ │ ├── @portal │ │ │ │ │ ├── _layout │ │ │ │ │ │ ├── Desktop.tsx │ │ │ │ │ │ └── Mobile.tsx │ │ │ │ │ ├── features │ │ │ │ │ │ └── Artifacts │ │ │ │ │ │ │ └── index.tsx │ │ │ │ │ └── index.tsx │ │ │ │ └── @topic │ │ │ │ │ └── _layout │ │ │ │ │ └── Desktop.tsx │ │ │ ├── features │ │ │ │ ├── Migration │ │ │ │ │ └── const.ts │ │ │ │ └── PageTitle │ │ │ │ │ └── index.tsx │ │ │ ├── layout.ts │ │ │ └── @session │ │ │ │ ├── _layout │ │ │ │ └── Desktop │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── PanelBody.tsx │ │ │ │ └── features │ │ │ │ └── SessionListContent │ │ │ │ └── index.tsx │ │ ├── settings │ │ │ ├── not-found.tsx │ │ │ ├── error.tsx │ │ │ ├── _layout │ │ │ │ ├── type.ts │ │ │ │ └── Mobile │ │ │ │ │ └── index.tsx │ │ │ ├── llm │ │ │ │ ├── type.ts │ │ │ │ ├── const.ts │ │ │ │ └── index.tsx │ │ │ ├── common │ │ │ │ ├── features │ │ │ │ │ └── Theme │ │ │ │ │ │ └── ThemeSwatches │ │ │ │ │ │ └── index.ts │ │ │ │ ├── index.tsx │ │ │ │ └── page.tsx │ │ │ ├── sync │ │ │ │ ├── features │ │ │ │ │ └── WebRTC │ │ │ │ │ │ └── generateRandomRoomName.ts │ │ │ │ └── index.tsx │ │ │ ├── loading.tsx │ │ │ ├── tts │ │ │ │ ├── index.tsx │ │ │ │ ├── page.tsx │ │ │ │ └── features │ │ │ │ │ └── const.ts │ │ │ ├── @category │ │ │ │ └── default.tsx │ │ │ ├── layout.ts │ │ │ ├── system-agent │ │ │ │ ├── index.tsx │ │ │ │ └── page.tsx │ │ │ ├── agent │ │ │ │ └── page.tsx │ │ │ ├── about │ │ │ │ └── page.tsx │ │ │ └── hooks │ │ │ │ └── useSyncSettings.ts │ │ ├── error.tsx │ │ ├── _layout │ │ │ └── type.ts │ │ ├── market │ │ │ ├── _layout │ │ │ │ ├── type.ts │ │ │ │ └── Mobile │ │ │ │ │ └── Header.tsx │ │ │ ├── @detail │ │ │ │ ├── default.tsx │ │ │ │ └── features │ │ │ │ │ └── Comment.tsx │ │ │ ├── layout.tsx │ │ │ └── loading.tsx │ │ ├── (mobile) │ │ │ └── me │ │ │ │ ├── data │ │ │ │ ├── loading.tsx │ │ │ │ └── layout.tsx │ │ │ │ ├── profile │ │ │ │ ├── loading.tsx │ │ │ │ └── layout.tsx │ │ │ │ ├── settings │ │ │ │ ├── loading.tsx │ │ │ │ ├── features │ │ │ │ │ └── Category.tsx │ │ │ │ └── layout.tsx │ │ │ │ └── (home) │ │ │ │ ├── features │ │ │ │ └── Category.tsx │ │ │ │ └── layout.tsx │ │ ├── @nav │ │ │ └── default.tsx │ │ ├── welcome │ │ │ ├── layout.tsx │ │ │ └── _layout │ │ │ │ └── Mobile.tsx │ │ ├── profile │ │ │ ├── _layout │ │ │ │ └── Mobile │ │ │ │ │ └── index.tsx │ │ │ ├── layout.tsx │ │ │ └── [[...slugs]] │ │ │ │ └── page.tsx │ │ └── layout.tsx │ ├── @modal │ │ ├── default.tsx │ │ ├── error.tsx │ │ ├── loading.tsx │ │ ├── (.)settings │ │ │ └── modal │ │ │ │ ├── loading.tsx │ │ │ │ └── page.tsx │ │ └── chat │ │ │ └── (.)settings │ │ │ └── modal │ │ │ └── loading.tsx │ ├── api │ │ ├── auth │ │ │ ├── [...nextauth] │ │ │ │ └── route.ts │ │ │ └── error │ │ │ │ └── page.tsx │ │ ├── chat │ │ │ ├── minimax │ │ │ │ └── route.ts │ │ │ └── openai │ │ │ │ └── route.ts │ │ ├── tts │ │ │ ├── edge-speech │ │ │ │ └── route.ts │ │ │ └── microsoft-speech │ │ │ │ └── route.ts │ │ ├── market │ │ │ ├── route.ts │ │ │ └── [id] │ │ │ │ └── route.ts │ │ ├── plugin │ │ │ └── store │ │ │ │ ├── Store.ts │ │ │ │ └── route.ts │ │ └── openai │ │ │ └── createBizOpenAI │ │ │ └── createOpenai.ts │ ├── error.tsx │ ├── (loading) │ │ └── Client.tsx │ ├── page.tsx │ ├── (auth) │ │ ├── layout.tsx │ │ └── login │ │ │ └── [[...login]] │ │ │ └── page.tsx │ └── global-error.tsx ├── tools │ ├── portals.ts │ ├── index.ts │ └── renders.ts ├── utils │ ├── env.ts │ ├── basePath.ts │ ├── tokenizer.ts │ ├── safeParseJSON.ts │ ├── uploadFIle.ts │ ├── zustand.ts │ ├── storeDebug.ts │ ├── parseMarkdown.ts │ ├── client │ │ └── switchLang.ts │ ├── merge.ts │ ├── keyboard.ts │ ├── cookie.ts │ ├── uuid.ts │ ├── url.ts │ └── locale.ts ├── locales │ └── default │ │ ├── auth.ts │ │ ├── tool.ts │ │ ├── portal.ts │ │ ├── metadata.ts │ │ └── components.ts ├── server │ ├── routers │ │ ├── tools │ │ │ └── index.ts │ │ └── edge │ │ │ ├── config │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── upload.ts │ └── mock.ts ├── hooks │ ├── useIsMobile.ts │ ├── useQuery.ts │ ├── useProviderName.ts │ ├── useIsSubSlug.ts │ ├── useActiveTabKey.ts │ ├── useYamlArguments.ts │ ├── useGreeting │ │ ├── greetingTime.ts │ │ └── index.ts │ ├── useTokenCount.ts │ ├── useQuery.test.ts │ └── useActiveSettingsKey.ts ├── services │ ├── import │ │ └── index.ts │ ├── plugin │ │ └── index.ts │ ├── topic │ │ └── index.ts │ ├── user │ │ ├── index.ts │ │ └── type.ts │ ├── session │ │ └── index.ts │ ├── message │ │ └── index.ts │ ├── file │ │ ├── type.ts │ │ └── index.ts │ └── sync.ts ├── migrations │ ├── FromV0ToV1.ts │ ├── FromV4ToV5 │ │ └── types │ │ │ └── v4.ts │ └── FromV2ToV3 │ │ └── types │ │ └── v3.ts ├── styles │ ├── index.ts │ ├── mobileHeader.ts │ └── antdOverride.ts ├── chains │ └── translate.ts ├── layout │ ├── AuthProvider │ │ ├── NoAuth │ │ │ └── index.tsx │ │ ├── NextAuth │ │ │ └── index.tsx │ │ └── index.tsx │ └── GlobalProvider │ │ └── Query.tsx ├── config │ └── modelProviders │ │ └── taichu.ts └── helpers │ └── url.ts ├── .bunfig.toml ├── vercel.json ├── .changelogrc.js ├── .husky └── pre-commit ├── .prettierrc.js ├── .remarkrc.js ├── .commitlintrc.js ├── .releaserc.js ├── public ├── favicon.ico ├── og │ └── cover.png ├── images │ ├── logo.png │ ├── updateFile.jpg │ ├── theme_auto.webp │ ├── theme_dark.webp │ ├── theme_light.webp │ ├── empty_topic_dark.webp │ ├── banner_market_modal.webp │ ├── chatmode_chat_dark.webp │ ├── chatmode_chat_light.webp │ ├── chatmode_docs_dark.webp │ ├── chatmode_docs_light.webp │ ├── empty_topic_light.webp │ └── screenshot_background.webp ├── videos │ ├── star.mp4 │ └── feedback.mp4 ├── favicon-32x32.ico ├── apple-touch-icon.png ├── icons │ ├── icon-192x192.png │ ├── icon-512x512.png │ ├── icon-192x192.maskable.png │ └── icon-512x512.maskable.png └── screenshots │ ├── shot-1.desktop.png │ ├── shot-1.mobile.png │ ├── shot-2.desktop.png │ ├── shot-2.mobile.png │ ├── shot-3.desktop.png │ ├── shot-3.mobile.png │ ├── shot-4.desktop.png │ ├── shot-4.mobile.png │ ├── shot-5.desktop.png │ └── shot-5.mobile.png ├── contributing └── _Footer.md ├── .dockerignore ├── locales ├── zh-TW │ ├── auth.json │ ├── portal.json │ ├── tool.json │ ├── metadata.json │ └── components.json ├── ko-KR │ ├── auth.json │ ├── tool.json │ └── portal.json ├── zh-CN │ ├── auth.json │ ├── tool.json │ ├── portal.json │ ├── metadata.json │ └── components.json ├── ja-JP │ ├── auth.json │ ├── tool.json │ └── portal.json ├── bg-BG │ ├── auth.json │ ├── tool.json │ └── portal.json ├── en-US │ ├── auth.json │ ├── tool.json │ └── portal.json ├── pt-BR │ ├── auth.json │ ├── tool.json │ └── portal.json ├── it-IT │ ├── auth.json │ ├── tool.json │ └── portal.json ├── tr-TR │ ├── auth.json │ ├── tool.json │ └── portal.json ├── vi-VN │ ├── auth.json │ ├── tool.json │ └── portal.json ├── ar │ ├── auth.json │ ├── tool.json │ └── portal.json ├── de-DE │ ├── auth.json │ ├── tool.json │ └── portal.json ├── fr-FR │ ├── auth.json │ ├── tool.json │ └── portal.json ├── nl-NL │ ├── auth.json │ ├── tool.json │ └── portal.json ├── ru-RU │ ├── auth.json │ ├── tool.json │ └── portal.json ├── es-ES │ ├── auth.json │ ├── tool.json │ └── portal.json └── pl-PL │ ├── auth.json │ ├── tool.json │ └── portal.json ├── tests ├── setup-db.ts └── utils.tsx ├── .stylelintrc.js ├── codecov.yml ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── 2_feature_request_cn.yml ├── workflows │ ├── issues-translate.yml │ └── wiki-sync.yml └── PULL_REQUEST_TEMPLATE.md ├── .seorc.cjs ├── netlify.toml ├── scripts ├── i18nWorkflow │ └── index.ts ├── readmeWorkflow │ └── index.ts └── docsWorkflow │ └── const.ts ├── .editorconfig ├── renovate.json ├── .eslintignore └── .npmrc /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/hydrogen 2 | -------------------------------------------------------------------------------- /docs/usage/tools-calling/groq.mdx: -------------------------------------------------------------------------------- 1 | TODO 2 | -------------------------------------------------------------------------------- /docs/usage/tools-calling/moonshot.mdx: -------------------------------------------------------------------------------- 1 | TODO 2 | -------------------------------------------------------------------------------- /src/store/user/index.ts: -------------------------------------------------------------------------------- 1 | export * from './store'; 2 | -------------------------------------------------------------------------------- /.bunfig.toml: -------------------------------------------------------------------------------- 1 | [install.lockfile] 2 | 3 | save = false 4 | -------------------------------------------------------------------------------- /src/store/global/index.ts: -------------------------------------------------------------------------------- 1 | export * from './store'; 2 | -------------------------------------------------------------------------------- /src/types/trace/index.ts: -------------------------------------------------------------------------------- 1 | export * from './action'; 2 | -------------------------------------------------------------------------------- /docs/usage/tools-calling.mdx: -------------------------------------------------------------------------------- 1 | # Tools Calling 2 | 3 | TODO 4 | -------------------------------------------------------------------------------- /src/const/message.ts: -------------------------------------------------------------------------------- 1 | export const LOADING_FLAT = '...'; 2 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "installCommand": "bun install" 3 | } 4 | -------------------------------------------------------------------------------- /.changelogrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@lobehub/lint').changelog; 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | npm run type-check 2 | npx --no-install lint-staged 3 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@lobehub/lint').prettier; 2 | -------------------------------------------------------------------------------- /.remarkrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@lobehub/lint').remarklint; 2 | -------------------------------------------------------------------------------- /src/components/FileList/style.ts: -------------------------------------------------------------------------------- 1 | export const MIN_IMAGE_SIZE = 70; 2 | -------------------------------------------------------------------------------- /src/database/server/index.ts: -------------------------------------------------------------------------------- 1 | export { serverDB } from './core/db'; 2 | -------------------------------------------------------------------------------- /.commitlintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@lobehub/lint').commitlint; 2 | -------------------------------------------------------------------------------- /.releaserc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@lobehub/lint').semanticRelease; 2 | -------------------------------------------------------------------------------- /src/store/session/helpers.ts: -------------------------------------------------------------------------------- 1 | export * from './slices/session/helpers'; 2 | -------------------------------------------------------------------------------- /src/features/User/UserLoginOrSignup/index.tsx: -------------------------------------------------------------------------------- 1 | export { default } from './Community'; 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/store/agent/selectors.ts: -------------------------------------------------------------------------------- 1 | export { agentSelectors } from './slices/chat/selectors'; 2 | -------------------------------------------------------------------------------- /public/og/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/og/cover.png -------------------------------------------------------------------------------- /src/store/file/slices/tts/index.ts: -------------------------------------------------------------------------------- 1 | export * from './action'; 2 | export * from './selectors'; 3 | -------------------------------------------------------------------------------- /src/store/tool/index.ts: -------------------------------------------------------------------------------- 1 | export * from './helpers'; 2 | export { useToolStore } from './store'; 3 | -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/logo.png -------------------------------------------------------------------------------- /public/videos/star.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/videos/star.mp4 -------------------------------------------------------------------------------- /src/libs/trpc/client/index.ts: -------------------------------------------------------------------------------- 1 | export { edgeClient } from './edge'; 2 | export * from './lambda'; 3 | -------------------------------------------------------------------------------- /src/store/agent/slices/chat/index.ts: -------------------------------------------------------------------------------- 1 | export * from './action'; 2 | export * from './selectors'; 3 | -------------------------------------------------------------------------------- /src/store/file/index.ts: -------------------------------------------------------------------------------- 1 | export * from './selectors'; 2 | export { useFileStore } from './store'; 3 | -------------------------------------------------------------------------------- /public/favicon-32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/favicon-32x32.ico -------------------------------------------------------------------------------- /src/store/session/slices/session/selectors/index.ts: -------------------------------------------------------------------------------- 1 | export * from './list'; 2 | export * from './meta'; 3 | -------------------------------------------------------------------------------- /src/store/tool/slices/builtin/index.ts: -------------------------------------------------------------------------------- 1 | export * from './action'; 2 | export * from './initialState'; 3 | -------------------------------------------------------------------------------- /src/types/message/translate.ts: -------------------------------------------------------------------------------- 1 | export interface Translate { 2 | from?: string; 3 | to: string; 4 | } 5 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/images/updateFile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/updateFile.jpg -------------------------------------------------------------------------------- /public/videos/feedback.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/videos/feedback.mp4 -------------------------------------------------------------------------------- /public/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/icons/icon-192x192.png -------------------------------------------------------------------------------- /public/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/icons/icon-512x512.png -------------------------------------------------------------------------------- /public/images/theme_auto.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/theme_auto.webp -------------------------------------------------------------------------------- /public/images/theme_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/theme_dark.webp -------------------------------------------------------------------------------- /public/images/theme_light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/theme_light.webp -------------------------------------------------------------------------------- /src/store/agent/index.ts: -------------------------------------------------------------------------------- 1 | export type { AgentStore } from './store'; 2 | export { useAgentStore } from './store'; 3 | -------------------------------------------------------------------------------- /contributing/_Footer.md: -------------------------------------------------------------------------------- 1 | This is the **🤯 / 🤖 Lobe Chat** wiki. [Wiki Home](https://github.com/lobehub/lobe-chat/wiki) 2 | -------------------------------------------------------------------------------- /src/store/session/index.ts: -------------------------------------------------------------------------------- 1 | export type { SessionStore } from './store'; 2 | export { useSessionStore } from './store'; 3 | -------------------------------------------------------------------------------- /public/images/empty_topic_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/empty_topic_dark.webp -------------------------------------------------------------------------------- /src/app/not-found.tsx: -------------------------------------------------------------------------------- 1 | import dynamic from 'next/dynamic'; 2 | 3 | export default dynamic(() => import('@/components/404')); 4 | -------------------------------------------------------------------------------- /src/const/settings/tool.ts: -------------------------------------------------------------------------------- 1 | export const DEFAULT_TOOL_CONFIG = { 2 | dalle: { 3 | autoGenerate: false, 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /src/libs/agent-runtime/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './chat'; 2 | export * from './textToImage'; 3 | export * from './type'; 4 | -------------------------------------------------------------------------------- /public/icons/icon-192x192.maskable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/icons/icon-192x192.maskable.png -------------------------------------------------------------------------------- /public/icons/icon-512x512.maskable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/icons/icon-512x512.maskable.png -------------------------------------------------------------------------------- /public/images/banner_market_modal.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/banner_market_modal.webp -------------------------------------------------------------------------------- /public/images/chatmode_chat_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/chatmode_chat_dark.webp -------------------------------------------------------------------------------- /public/images/chatmode_chat_light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/chatmode_chat_light.webp -------------------------------------------------------------------------------- /public/images/chatmode_docs_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/chatmode_docs_dark.webp -------------------------------------------------------------------------------- /public/images/chatmode_docs_light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/chatmode_docs_light.webp -------------------------------------------------------------------------------- /public/images/empty_topic_light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/empty_topic_light.webp -------------------------------------------------------------------------------- /public/screenshots/shot-1.desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-1.desktop.png -------------------------------------------------------------------------------- /public/screenshots/shot-1.mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-1.mobile.png -------------------------------------------------------------------------------- /public/screenshots/shot-2.desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-2.desktop.png -------------------------------------------------------------------------------- /public/screenshots/shot-2.mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-2.mobile.png -------------------------------------------------------------------------------- /public/screenshots/shot-3.desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-3.desktop.png -------------------------------------------------------------------------------- /public/screenshots/shot-3.mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-3.mobile.png -------------------------------------------------------------------------------- /public/screenshots/shot-4.desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-4.desktop.png -------------------------------------------------------------------------------- /public/screenshots/shot-4.mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-4.mobile.png -------------------------------------------------------------------------------- /public/screenshots/shot-5.desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-5.desktop.png -------------------------------------------------------------------------------- /public/screenshots/shot-5.mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/screenshots/shot-5.mobile.png -------------------------------------------------------------------------------- /src/const/plugin.ts: -------------------------------------------------------------------------------- 1 | export const PLUGIN_SCHEMA_SEPARATOR = '____'; 2 | export const PLUGIN_SCHEMA_API_MD5_PREFIX = 'MD5HASH_'; 3 | -------------------------------------------------------------------------------- /src/store/file/slices/tts/selectors.ts: -------------------------------------------------------------------------------- 1 | // import { FileStore } from '../../store'; 2 | 3 | export const ttsFilesSelectors = {}; 4 | -------------------------------------------------------------------------------- /src/types/user/settings/tool.ts: -------------------------------------------------------------------------------- 1 | export interface UserToolConfig { 2 | dalle: { 3 | autoGenerate: boolean; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /public/images/screenshot_background.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yanyutin753/lobe-chat/HEAD/public/images/screenshot_background.webp -------------------------------------------------------------------------------- /src/app/(main)/not-found.tsx: -------------------------------------------------------------------------------- 1 | import dynamic from 'next/dynamic'; 2 | 3 | export default dynamic(() => import('@/components/404')); 4 | -------------------------------------------------------------------------------- /src/app/@modal/default.tsx: -------------------------------------------------------------------------------- 1 | // This ensures that the modal is not rendered when it's not active. 2 | 3 | export default () => null; 4 | -------------------------------------------------------------------------------- /src/store/file/slices/images/index.ts: -------------------------------------------------------------------------------- 1 | export * from './action'; 2 | export * from './initialState'; 3 | export * from './selectors'; 4 | -------------------------------------------------------------------------------- /src/store/tool/slices/store/index.ts: -------------------------------------------------------------------------------- 1 | export * from './action'; 2 | export * from './initialState'; 3 | // export * from './selectors'; 4 | -------------------------------------------------------------------------------- /src/app/(main)/chat/loading.tsx: -------------------------------------------------------------------------------- 1 | import CircleLoading from '@/components/CircleLoading'; 2 | 3 | export default () => ; 4 | -------------------------------------------------------------------------------- /src/app/(main)/chat/not-found.tsx: -------------------------------------------------------------------------------- 1 | import dynamic from 'next/dynamic'; 2 | 3 | export default dynamic(() => import('@/components/404')); 4 | -------------------------------------------------------------------------------- /src/database/client/core/index.ts: -------------------------------------------------------------------------------- 1 | export { browserDB } from './db'; 2 | export * from './model'; 3 | export { dataSync } from './sync'; 4 | -------------------------------------------------------------------------------- /src/libs/agent-runtime/utils/streams/bedrock/index.ts: -------------------------------------------------------------------------------- 1 | export * from './claude'; 2 | export * from './common'; 3 | export * from './llama'; 4 | -------------------------------------------------------------------------------- /src/store/tool/slices/plugin/index.ts: -------------------------------------------------------------------------------- 1 | export * from './action'; 2 | export * from './initialState'; 3 | // export * from './selectors'; 4 | -------------------------------------------------------------------------------- /src/app/(main)/settings/not-found.tsx: -------------------------------------------------------------------------------- 1 | import dynamic from 'next/dynamic'; 2 | 3 | export default dynamic(() => import('@/components/404')); 4 | -------------------------------------------------------------------------------- /src/store/tool/slices/customPlugin/index.ts: -------------------------------------------------------------------------------- 1 | export * from './action'; 2 | export * from './initialState'; 3 | // export * from './selectors'; 4 | -------------------------------------------------------------------------------- /src/app/(main)/chat/settings/not-found.tsx: -------------------------------------------------------------------------------- 1 | import dynamic from 'next/dynamic'; 2 | 3 | export default dynamic(() => import('@/components/404')); 4 | -------------------------------------------------------------------------------- /src/app/api/auth/[...nextauth]/route.ts: -------------------------------------------------------------------------------- 1 | import NextAuthNode from '@/libs/next-auth'; 2 | 3 | export const { GET, POST } = NextAuthNode.handlers; 4 | -------------------------------------------------------------------------------- /src/app/error.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import dynamic from 'next/dynamic'; 4 | 5 | export default dynamic(() => import('@/components/Error')); 6 | -------------------------------------------------------------------------------- /src/tools/portals.ts: -------------------------------------------------------------------------------- 1 | import { BuiltinPortal } from '@/types/tool'; 2 | 3 | export const BuiltinToolsPortals: Record = {}; 4 | -------------------------------------------------------------------------------- /src/utils/env.ts: -------------------------------------------------------------------------------- 1 | export const isDev = process.env.NODE_ENV === 'development'; 2 | 3 | export const isOnServerSide = typeof window === 'undefined'; 4 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | .dockerignore 3 | node_modules 4 | npm-debug.log 5 | .next 6 | .git 7 | docs 8 | .github 9 | *.md 10 | .env.example 11 | -------------------------------------------------------------------------------- /src/app/(main)/error.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import dynamic from 'next/dynamic'; 4 | 5 | export default dynamic(() => import('@/components/Error')); 6 | -------------------------------------------------------------------------------- /src/app/@modal/error.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import dynamic from 'next/dynamic'; 4 | 5 | export default dynamic(() => import('@/components/Error')); 6 | -------------------------------------------------------------------------------- /src/utils/basePath.ts: -------------------------------------------------------------------------------- 1 | import { appEnv } from '@/config/app'; 2 | 3 | export const withBasePath = (path: string) => appEnv.NEXT_PUBLIC_BASE_PATH + path; 4 | -------------------------------------------------------------------------------- /src/app/(main)/chat/error.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import dynamic from 'next/dynamic'; 4 | 5 | export default dynamic(() => import('@/components/Error')); 6 | -------------------------------------------------------------------------------- /src/app/api/auth/error/page.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import dynamic from 'next/dynamic'; 4 | 5 | export default dynamic(() => import('./AuthErrorPage')); 6 | -------------------------------------------------------------------------------- /src/app/(main)/_layout/type.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | export interface LayoutProps { 4 | children: ReactNode; 5 | nav: ReactNode; 6 | } 7 | -------------------------------------------------------------------------------- /src/app/(main)/settings/error.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import dynamic from 'next/dynamic'; 4 | 5 | export default dynamic(() => import('@/components/Error')); 6 | -------------------------------------------------------------------------------- /src/libs/logger/index.ts: -------------------------------------------------------------------------------- 1 | import Pino from 'pino'; 2 | 3 | export const pino = Pino({ 4 | level: process.env.LOG_LEVEL ? process.env.LOG_LEVEL : 'info', 5 | }); 6 | -------------------------------------------------------------------------------- /src/app/(main)/chat/_layout/type.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | export interface LayoutProps { 4 | children: ReactNode; 5 | session: ReactNode; 6 | } 7 | -------------------------------------------------------------------------------- /src/app/(main)/chat/settings/error.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import dynamic from 'next/dynamic'; 4 | 5 | export default dynamic(() => import('@/components/Error')); 6 | -------------------------------------------------------------------------------- /src/store/chat/index.ts: -------------------------------------------------------------------------------- 1 | export type { ChatStoreState } from './initialState'; 2 | export type { ChatStore } from './store'; 3 | export { useChatStore } from './store'; 4 | -------------------------------------------------------------------------------- /src/store/market/index.ts: -------------------------------------------------------------------------------- 1 | export { agentMarketSelectors } from './selectors'; 2 | export { useMarketStore } from './store'; 3 | export { type Store } from './store'; 4 | -------------------------------------------------------------------------------- /src/types/locale.ts: -------------------------------------------------------------------------------- 1 | import { Locales } from '@/locales/resources'; 2 | 3 | export type * from '@/locales/resources'; 4 | 5 | export type LocaleMode = Locales | 'auto'; 6 | -------------------------------------------------------------------------------- /src/app/(main)/market/_layout/type.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | export interface LayoutProps { 4 | children: ReactNode; 5 | detail: ReactNode; 6 | } 7 | -------------------------------------------------------------------------------- /src/app/(main)/settings/_layout/type.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | export interface LayoutProps { 4 | category: ReactNode; 5 | children: ReactNode; 6 | } 7 | -------------------------------------------------------------------------------- /src/app/@modal/loading.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton } from 'antd'; 2 | 3 | export default () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/types/service.ts: -------------------------------------------------------------------------------- 1 | export interface BatchTaskResult { 2 | added: number; 3 | errors?: Error[]; 4 | ids: string[]; 5 | skips: string[]; 6 | success: boolean; 7 | } 8 | -------------------------------------------------------------------------------- /locales/zh-TW/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "登入", 3 | "loginOrSignup": "登入 / 註冊", 4 | "profile": "個人檔案", 5 | "security": "安全", 6 | "signout": "登出", 7 | "signup": "註冊" 8 | } 9 | -------------------------------------------------------------------------------- /src/app/(main)/chat/settings/loading.tsx: -------------------------------------------------------------------------------- 1 | import SkeletonLoading from '@/components/SkeletonLoading'; 2 | 3 | export default () => ; 4 | -------------------------------------------------------------------------------- /src/app/(main)/chat/settings/page.tsx: -------------------------------------------------------------------------------- 1 | import EditPage from './features/EditPage'; 2 | 3 | const Page = () => { 4 | return ; 5 | }; 6 | 7 | export default Page; 8 | -------------------------------------------------------------------------------- /src/types/share.ts: -------------------------------------------------------------------------------- 1 | export interface ShareGPTConversation { 2 | avatarUrl?: string | null; 3 | items: Array<{ 4 | from: 'human' | 'gpt'; 5 | value: any; 6 | }>; 7 | } 8 | -------------------------------------------------------------------------------- /src/utils/tokenizer.ts: -------------------------------------------------------------------------------- 1 | export const encodeAsync = async (str: string) => { 2 | const { encode } = await import('gpt-tokenizer'); 3 | 4 | return encode(str).length; 5 | }; 6 | -------------------------------------------------------------------------------- /locales/ko-KR/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "로그인", 3 | "loginOrSignup": "로그인 / 가입", 4 | "profile": "프로필", 5 | "security": "보안", 6 | "signout": "로그아웃", 7 | "signup": "가입" 8 | } 9 | -------------------------------------------------------------------------------- /locales/zh-CN/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "登录", 3 | "loginOrSignup": "登录 / 注册", 4 | "profile": "个人资料", 5 | "security": "安全", 6 | "signout": "退出登录", 7 | "signup": "注册" 8 | } 9 | -------------------------------------------------------------------------------- /src/features/Conversation/Extras/type.ts: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | 3 | import { ChatMessage } from '@/types/message'; 4 | 5 | export type RenderMessageExtra = FC; 6 | -------------------------------------------------------------------------------- /tests/setup-db.ts: -------------------------------------------------------------------------------- 1 | // import env 2 | import { Crypto } from '@peculiar/webcrypto'; 3 | import * as dotenv from 'dotenv'; 4 | 5 | dotenv.config(); 6 | 7 | global.crypto = new Crypto(); 8 | -------------------------------------------------------------------------------- /src/const/settings/sync.ts: -------------------------------------------------------------------------------- 1 | import { UserSyncSettings } from '@/types/user/settings'; 2 | 3 | export const DEFAULT_SYNC_CONFIG: UserSyncSettings = { 4 | webrtc: { enabled: false }, 5 | }; 6 | -------------------------------------------------------------------------------- /src/locales/default/auth.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | login: '登录', 3 | loginOrSignup: '登录 / 注册', 4 | profile: '个人资料', 5 | security: '安全', 6 | signout: '退出登录', 7 | signup: '注册', 8 | }; 9 | -------------------------------------------------------------------------------- /src/store/session/selectors.ts: -------------------------------------------------------------------------------- 1 | export { sessionMetaSelectors, sessionSelectors } from './slices/session/selectors'; 2 | export { sessionGroupSelectors } from './slices/sessionGroup/selectors'; 3 | -------------------------------------------------------------------------------- /locales/ja-JP/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "ログイン", 3 | "loginOrSignup": "ログイン / 登録", 4 | "profile": "プロフィール", 5 | "security": "セキュリティ", 6 | "signout": "ログアウト", 7 | "signup": "サインアップ" 8 | } 9 | -------------------------------------------------------------------------------- /src/app/@modal/(.)settings/modal/loading.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton } from 'antd'; 2 | 3 | export default () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/store/serverConfig/index.ts: -------------------------------------------------------------------------------- 1 | export { ServerConfigStoreProvider } from './Provider'; 2 | export { featureFlagsSelectors } from './selectors'; 3 | export { useServerConfigStore } from './store'; 4 | -------------------------------------------------------------------------------- /src/app/(main)/(mobile)/me/data/loading.tsx: -------------------------------------------------------------------------------- 1 | import SkeletonLoading from '@/components/SkeletonLoading'; 2 | 3 | export default () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/app/(main)/(mobile)/me/profile/loading.tsx: -------------------------------------------------------------------------------- 1 | import SkeletonLoading from '@/components/SkeletonLoading'; 2 | 3 | export default () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/app/(main)/(mobile)/me/settings/loading.tsx: -------------------------------------------------------------------------------- 1 | import SkeletonLoading from '@/components/SkeletonLoading'; 2 | 3 | export default () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/app/@modal/chat/(.)settings/modal/loading.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton } from 'antd'; 2 | 3 | export default () => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/app/(main)/settings/llm/type.ts: -------------------------------------------------------------------------------- 1 | import { ProviderConfigProps } from './components/ProviderConfig'; 2 | 3 | export interface ProviderItem extends Omit { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /src/store/chat/slices/share/initialState.ts: -------------------------------------------------------------------------------- 1 | export interface ChatShareState { 2 | shareLoading?: boolean; 3 | } 4 | 5 | export const initialShareState: ChatShareState = { 6 | shareLoading: false, 7 | }; 8 | -------------------------------------------------------------------------------- /.stylelintrc.js: -------------------------------------------------------------------------------- 1 | const config = require('@lobehub/lint').stylelint; 2 | 3 | module.exports = { 4 | ...config, 5 | rules: { 6 | 'selector-id-pattern': null, 7 | ...config.rules, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /locales/bg-BG/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Вход", 3 | "loginOrSignup": "Вход / Регистрация", 4 | "profile": "Профил", 5 | "security": "Сигурност", 6 | "signout": "Изход", 7 | "signup": "Регистрация" 8 | } 9 | -------------------------------------------------------------------------------- /locales/en-US/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Login", 3 | "loginOrSignup": "Log in / Sign up", 4 | "profile": "Profile", 5 | "security": "Security", 6 | "signout": "Sign out", 7 | "signup": "Sign up" 8 | } 9 | -------------------------------------------------------------------------------- /locales/pt-BR/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Entrar", 3 | "loginOrSignup": "Entrar / Registrar", 4 | "profile": "Perfil", 5 | "security": "Segurança", 6 | "signout": "Sair", 7 | "signup": "Cadastre-se" 8 | } 9 | -------------------------------------------------------------------------------- /src/const/hotkeys.ts: -------------------------------------------------------------------------------- 1 | export const ALT_KEY = 'alt'; 2 | export const META_KEY = 'mod'; 3 | export const SAVE_TOPIC_KEY = 'n'; 4 | export const CLEAN_MESSAGE_KEY = 'backspace'; 5 | export const REGENERATE_KEY = 'r'; 6 | -------------------------------------------------------------------------------- /locales/it-IT/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Accedi", 3 | "loginOrSignup": "Accedi / Registrati", 4 | "profile": "Profilo", 5 | "security": "Sicurezza", 6 | "signout": "Esci", 7 | "signup": "Registrati" 8 | } 9 | -------------------------------------------------------------------------------- /locales/tr-TR/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Giriş Yap", 3 | "loginOrSignup": "Giriş Yap / Kayıt Ol", 4 | "profile": "Profil", 5 | "security": "Güvenlik", 6 | "signout": "Çıkış Yap", 7 | "signup": "Kaydol" 8 | } 9 | -------------------------------------------------------------------------------- /src/store/user/slices/settings/selectors/index.ts: -------------------------------------------------------------------------------- 1 | export { userGeneralSettingsSelectors } from './general'; 2 | export { settingsSelectors } from './settings'; 3 | export { systemAgentSelectors } from './systemAgent'; 4 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: off 5 | server: 6 | flags: 7 | - server 8 | app: 9 | flags: 10 | - app 11 | patch: off 12 | -------------------------------------------------------------------------------- /locales/vi-VN/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Đăng nhập", 3 | "loginOrSignup": "Đăng nhập / Đăng ký", 4 | "profile": "Hồ sơ cá nhân", 5 | "security": "Bảo mật", 6 | "signout": "Đăng xuất", 7 | "signup": "Đăng ký" 8 | } 9 | -------------------------------------------------------------------------------- /src/app/(main)/settings/common/features/Theme/ThemeSwatches/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ThemeSwatchesNeutral } from './ThemeSwatchesNeutral'; 2 | export { default as ThemeSwatchesPrimary } from './ThemeSwatchesPrimary'; 3 | -------------------------------------------------------------------------------- /src/database/server/schemas/lobechat/index.ts: -------------------------------------------------------------------------------- 1 | export * from './chat'; 2 | export * from './discover'; 3 | export * from './file'; 4 | export * from './nextauth'; 5 | export * from './relations'; 6 | export * from './user'; 7 | -------------------------------------------------------------------------------- /src/features/AgentSetting/index.tsx: -------------------------------------------------------------------------------- 1 | export { AgentSettings } from './AgentSettings'; 2 | export { AgentSettingsStore } from './AgentSettingsStore'; 3 | export type { AgentSettingsInstance } from './hooks/useAgentSettings'; 4 | -------------------------------------------------------------------------------- /locales/ar/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "تسجيل الدخول", 3 | "loginOrSignup": "تسجيل الدخول / التسجيل", 4 | "profile": "الملف الشخصي", 5 | "security": "الأمان", 6 | "signout": "تسجيل الخروج", 7 | "signup": "التسجيل" 8 | } 9 | -------------------------------------------------------------------------------- /locales/de-DE/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Anmelden", 3 | "loginOrSignup": "Anmelden / Registrieren", 4 | "profile": "Profil", 5 | "security": "Sicherheit", 6 | "signout": "Abmelden", 7 | "signup": "Registrieren" 8 | } 9 | -------------------------------------------------------------------------------- /locales/fr-FR/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Connexion", 3 | "loginOrSignup": "Connexion / Inscription", 4 | "profile": "Profil", 5 | "security": "Sécurité", 6 | "signout": "Déconnexion", 7 | "signup": "Inscription" 8 | } 9 | -------------------------------------------------------------------------------- /locales/nl-NL/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Inloggen", 3 | "loginOrSignup": "Inloggen / Registreren", 4 | "profile": "Profiel", 5 | "security": "Veiligheid", 6 | "signout": "Uitloggen", 7 | "signup": "Registreren" 8 | } 9 | -------------------------------------------------------------------------------- /src/store/user/slices/modelList/selectors/index.ts: -------------------------------------------------------------------------------- 1 | export { keyVaultsConfigSelectors } from './keyVaults'; 2 | export { modelConfigSelectors } from './modelConfig'; 3 | export { modelProviderSelectors } from './modelProvider'; 4 | -------------------------------------------------------------------------------- /locales/ru-RU/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Войти", 3 | "loginOrSignup": "Войти / Зарегистрироваться", 4 | "profile": "Профиль", 5 | "security": "Безопасность", 6 | "signout": "Выйти", 7 | "signup": "Зарегистрироваться" 8 | } 9 | -------------------------------------------------------------------------------- /src/const/settings/common.ts: -------------------------------------------------------------------------------- 1 | import { UserGeneralConfig } from '@/types/user/settings'; 2 | 3 | export const DEFAULT_COMMON_SETTINGS: UserGeneralConfig = { 4 | fontSize: 14, 5 | language: 'auto', 6 | themeMode: 'auto', 7 | }; 8 | -------------------------------------------------------------------------------- /src/const/theme.ts: -------------------------------------------------------------------------------- 1 | export const LOBE_THEME_APPEARANCE = 'LOBE_THEME_APPEARANCE'; 2 | 3 | export const LOBE_THEME_PRIMARY_COLOR = 'LOBE_THEME_PRIMARY_COLOR'; 4 | 5 | export const LOBE_THEME_NEUTRAL_COLOR = 'LOBE_THEME_NEUTRAL_COLOR'; 6 | -------------------------------------------------------------------------------- /src/store/chat/slices/builtinTool/initialState.ts: -------------------------------------------------------------------------------- 1 | export interface ChatToolState { 2 | dalleImageLoading: Record; 3 | } 4 | 5 | export const initialToolState: ChatToolState = { 6 | dalleImageLoading: {}, 7 | }; 8 | -------------------------------------------------------------------------------- /src/app/(main)/chat/(workspace)/_layout/type.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | 3 | export interface LayoutProps { 4 | children: ReactNode; 5 | conversation: ReactNode; 6 | portal: ReactNode; 7 | topic: ReactNode; 8 | } 9 | -------------------------------------------------------------------------------- /src/app/(main)/settings/sync/features/WebRTC/generateRandomRoomName.ts: -------------------------------------------------------------------------------- 1 | export const generateRandomRoomName = async () => { 2 | const { generate } = await import('random-words'); 3 | return (generate(3) as string[]).join('-'); 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/BrowserIcon/types.ts: -------------------------------------------------------------------------------- 1 | import { CSSProperties } from 'react'; 2 | 3 | export interface SVGComponent { 4 | className?: string; 5 | height?: number | string; 6 | style?: CSSProperties; 7 | width?: number | string; 8 | } 9 | -------------------------------------------------------------------------------- /src/types/i18next.d.ts: -------------------------------------------------------------------------------- 1 | import { DefaultResources } from '@/types/locale'; 2 | 3 | declare module 'i18next' { 4 | interface CustomTypeOptions { 5 | defaultNS: ['common', 'setting']; 6 | resources: DefaultResources; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Questions and ideas | 问题和想法 3 | url: https://github.com/lobehub/lobe-chat/discussions/new/choose 4 | about: Please post questions, and ideas in discussions. | 请在讨论区发布问题和想法。 5 | -------------------------------------------------------------------------------- /.seorc.cjs: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('@lobehub/seo-cli'); 2 | 3 | module.exports = defineConfig({ 4 | entry: ['./docs/**/*.mdx'], 5 | modelName: 'gpt-4o-mini', 6 | experimental: { 7 | jsonMode: true, 8 | }, 9 | }); 10 | -------------------------------------------------------------------------------- /locales/es-ES/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Iniciar sesión", 3 | "loginOrSignup": "Iniciar sesión / Registrarse", 4 | "profile": "Perfil", 5 | "security": "Seguridad", 6 | "signout": "Cerrar sesión", 7 | "signup": "Registrarse" 8 | } 9 | -------------------------------------------------------------------------------- /src/app/api/chat/minimax/route.ts: -------------------------------------------------------------------------------- 1 | import { POST as UniverseRoute } from '../[provider]/route'; 2 | 3 | export const runtime = 'nodejs'; 4 | 5 | export const POST = async (req: Request) => UniverseRoute(req, { params: { provider: 'minimax' } }); 6 | -------------------------------------------------------------------------------- /locales/pl-PL/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": "Zaloguj się", 3 | "loginOrSignup": "Zaloguj się / Zarejestruj się", 4 | "profile": "Profil użytkownika", 5 | "security": "Bezpieczeństwo", 6 | "signout": "Wyloguj", 7 | "signup": "Zarejestruj się" 8 | } 9 | -------------------------------------------------------------------------------- /src/libs/agent-runtime/ollama/type.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @description images for ollama vision models (https://ollama.com/blog/vision-models) 3 | */ 4 | export interface OllamaMessage { 5 | content: string; 6 | images?: string[]; 7 | role: string; 8 | } 9 | -------------------------------------------------------------------------------- /src/store/file/initialState.ts: -------------------------------------------------------------------------------- 1 | import { ImageFileState, initialImageFileState } from './slices/images'; 2 | 3 | export type FilesStoreState = ImageFileState; 4 | 5 | export const initialState: FilesStoreState = { 6 | ...initialImageFileState, 7 | }; 8 | -------------------------------------------------------------------------------- /src/const/version.ts: -------------------------------------------------------------------------------- 1 | import pkg from '@/../package.json'; 2 | import { getServerDBConfig } from '@/config/db'; 3 | 4 | export const CURRENT_VERSION = pkg.version; 5 | 6 | export const isServerMode = getServerDBConfig().NEXT_PUBLIC_ENABLED_SERVER_SERVICE; 7 | -------------------------------------------------------------------------------- /src/server/routers/tools/index.ts: -------------------------------------------------------------------------------- 1 | import { publicProcedure, router } from '@/libs/trpc'; 2 | 3 | export const toolsRouter = router({ 4 | healthcheck: publicProcedure.query(() => "i'm live!"), 5 | }); 6 | 7 | export type ToolsRouter = typeof toolsRouter; 8 | -------------------------------------------------------------------------------- /src/store/chat/slices/message/utils.ts: -------------------------------------------------------------------------------- 1 | export const messageMapKey = (sessionId: string, topicId?: string | null) => { 2 | let topic = topicId; 3 | 4 | if (typeof topicId === 'undefined') topic = null; 5 | 6 | return `${sessionId}_${topic}`; 7 | }; 8 | -------------------------------------------------------------------------------- /src/types/openai/functionCall.ts: -------------------------------------------------------------------------------- 1 | export interface OpenAIFunctionCall { 2 | arguments: string; 3 | name: string; 4 | } 5 | 6 | export interface OpenAIToolCall { 7 | function: OpenAIFunctionCall; 8 | id: string; 9 | type: 'function'; 10 | } 11 | -------------------------------------------------------------------------------- /src/hooks/useIsMobile.ts: -------------------------------------------------------------------------------- 1 | import { useResponsive } from 'antd-style'; 2 | import { useMemo } from 'react'; 3 | 4 | export const useIsMobile = (): boolean => { 5 | const { mobile } = useResponsive(); 6 | 7 | return useMemo(() => !!mobile, [mobile]); 8 | }; 9 | -------------------------------------------------------------------------------- /src/store/agent/initialState.ts: -------------------------------------------------------------------------------- 1 | import { AgentState, initialAgentChatState } from './slices/chat/initialState'; 2 | 3 | export type SessionStoreState = AgentState; 4 | 5 | export const initialState: SessionStoreState = { 6 | ...initialAgentChatState, 7 | }; 8 | -------------------------------------------------------------------------------- /src/store/file/selectors.ts: -------------------------------------------------------------------------------- 1 | import { filesSelectors as imageFilesSelectors } from './slices/images'; 2 | import { ttsFilesSelectors } from './slices/tts'; 3 | 4 | export const filesSelectors = { 5 | ...imageFilesSelectors, 6 | ...ttsFilesSelectors, 7 | }; 8 | -------------------------------------------------------------------------------- /locales/zh-CN/tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "dalle": { 3 | "autoGenerate": "自动生成", 4 | "downloading": "DallE3 生成的图片链接有效期仅1小时,正在缓存图片到本地...", 5 | "generate": "生成", 6 | "generating": "生成中...", 7 | "images": "图片:", 8 | "prompt": "提示词" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /locales/zh-TW/portal.json: -------------------------------------------------------------------------------- 1 | { 2 | "Artifacts": "文物", 3 | "actions": { 4 | "genAiMessage": "生成助手訊息", 5 | "summary": "摘要", 6 | "summaryTooltip": "總結目前內容" 7 | }, 8 | "emptyArtifactList": "當前文物列表為空,請在會話中按需使用插件後再查看", 9 | "title": "擴展視窗" 10 | } 11 | -------------------------------------------------------------------------------- /locales/zh-TW/tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "dalle": { 3 | "autoGenerate": "自動生成", 4 | "downloading": "DallE3 生成的圖片連結有效期僅1小時,正在快取圖片到本地...", 5 | "generate": "生成", 6 | "generating": "生成中...", 7 | "images": "圖片:", 8 | "prompt": "提示詞" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/services/import/index.ts: -------------------------------------------------------------------------------- 1 | import { isServerMode } from '@/const/version'; 2 | 3 | import { ClientService } from './client'; 4 | import { ServerService } from './server'; 5 | 6 | export const importService = isServerMode ? new ServerService() : new ClientService(); 7 | -------------------------------------------------------------------------------- /src/services/plugin/index.ts: -------------------------------------------------------------------------------- 1 | import { isServerMode } from '@/const/version'; 2 | 3 | import { ClientService } from './client'; 4 | import { ServerService } from './server'; 5 | 6 | export const pluginService = isServerMode ? new ServerService() : new ClientService(); 7 | -------------------------------------------------------------------------------- /src/services/topic/index.ts: -------------------------------------------------------------------------------- 1 | import { isServerMode } from '@/const/version'; 2 | 3 | import { ClientService } from './client'; 4 | import { ServerService } from './server'; 5 | 6 | export const topicService = isServerMode ? new ServerService() : new ClientService(); 7 | -------------------------------------------------------------------------------- /src/services/user/index.ts: -------------------------------------------------------------------------------- 1 | import { isServerMode } from '@/const/version'; 2 | 3 | import { ClientService } from './client'; 4 | import { ServerService } from './server'; 5 | 6 | export const userService = isServerMode ? new ServerService() : new ClientService(); 7 | -------------------------------------------------------------------------------- /src/database/client/schemas/sessionGroup.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod'; 2 | 3 | export const DB_SessionGroupSchema = z.object({ 4 | name: z.string(), 5 | sort: z.number().optional(), 6 | }); 7 | 8 | export type DB_SessionGroup = z.infer; 9 | -------------------------------------------------------------------------------- /src/server/mock.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file contains the root router of your tRPC-backend 3 | */ 4 | import { createCallerFactory } from '@/libs/trpc'; 5 | 6 | import { edgeRouter } from './routers/edge'; 7 | 8 | export const createCaller = createCallerFactory(edgeRouter); 9 | -------------------------------------------------------------------------------- /src/services/session/index.ts: -------------------------------------------------------------------------------- 1 | import { isServerMode } from '@/const/version'; 2 | 3 | import { ClientService } from './client'; 4 | import { ServerService } from './server'; 5 | 6 | export const sessionService = isServerMode ? new ServerService() : new ClientService(); 7 | -------------------------------------------------------------------------------- /src/store/chat/slices/portal/initialState.ts: -------------------------------------------------------------------------------- 1 | export interface ChatPortalState { 2 | portalToolMessage?: { id: string; identifier: string }; 3 | showPortal: boolean; 4 | } 5 | 6 | export const initialChatPortalState: ChatPortalState = { 7 | showPortal: false, 8 | }; 9 | -------------------------------------------------------------------------------- /src/const/user.ts: -------------------------------------------------------------------------------- 1 | import { UserPreference } from '@/types/user'; 2 | 3 | export const DEFAULT_PREFERENCE: UserPreference = { 4 | guide: { 5 | moveSettingsToAvatar: true, 6 | topic: true, 7 | }, 8 | telemetry: null, 9 | useCmdEnterToSend: false, 10 | }; 11 | -------------------------------------------------------------------------------- /src/locales/default/tool.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | dalle: { 3 | autoGenerate: '自动生成', 4 | downloading: 'DallE3 生成的图片链接有效期仅1小时,正在缓存图片到本地...', 5 | generate: '生成', 6 | generating: '生成中...', 7 | images: '图片:', 8 | prompt: '提示词', 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /locales/zh-CN/portal.json: -------------------------------------------------------------------------------- 1 | { 2 | "Artifacts": "Artifacts", 3 | "actions": { 4 | "genAiMessage": "创建助手消息", 5 | "summary": "总结", 6 | "summaryTooltip": "总结当前内容" 7 | }, 8 | "emptyArtifactList": "当前 Artifacts 列表为空,请在会话中按需使用插件后再查看", 9 | "title": "工作区" 10 | } 11 | -------------------------------------------------------------------------------- /src/app/(main)/settings/loading.tsx: -------------------------------------------------------------------------------- 1 | import SkeletonLoading from '@/components/SkeletonLoading'; 2 | 3 | export default () => { 4 | return ( 5 |
6 | 7 |
8 | ); 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/user/settings/tts.ts: -------------------------------------------------------------------------------- 1 | export type STTServer = 'openai' | 'browser'; 2 | 3 | export interface UserTTSConfig { 4 | openAI: { 5 | sttModel: 'whisper-1'; 6 | ttsModel: 'tts-1' | 'tts-1-hd'; 7 | }; 8 | sttAutoStop: boolean; 9 | sttServer: STTServer; 10 | } 11 | -------------------------------------------------------------------------------- /locales/ja-JP/tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "dalle": { 3 | "autoGenerate": "自動生成", 4 | "downloading": "DallE3 で生成された画像リンクは有効期間が1時間しかありません。画像をローカルにキャッシュしています...", 5 | "generate": "生成する", 6 | "generating": "生成中...", 7 | "images": "画像:", 8 | "prompt": "プロンプト" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /locales/ko-KR/tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "dalle": { 3 | "autoGenerate": "자동 생성", 4 | "downloading": "DallE3로 생성된 이미지 링크는 1시간 동안 유효하며, 로컬에 이미지를 캐시하는 중입니다...", 5 | "generate": "생성", 6 | "generating": "생성 중...", 7 | "images": "이미지:", 8 | "prompt": "알림 단어" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/const/settings/tts.ts: -------------------------------------------------------------------------------- 1 | import { UserTTSConfig } from '@/types/user/settings'; 2 | 3 | export const DEFAULT_TTS_CONFIG: UserTTSConfig = { 4 | openAI: { 5 | sttModel: 'whisper-1', 6 | ttsModel: 'tts-1', 7 | }, 8 | sttAutoStop: true, 9 | sttServer: 'openai', 10 | }; 11 | -------------------------------------------------------------------------------- /src/locales/default/portal.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | Artifacts: 'Artifacts', 3 | actions: { 4 | genAiMessage: '创建助手消息', 5 | summary: '总结', 6 | summaryTooltip: '总结当前内容', 7 | }, 8 | emptyArtifactList: '当前 Artifacts 列表为空,请在会话中按需使用插件后再查看', 9 | title: '工作区', 10 | }; 11 | -------------------------------------------------------------------------------- /src/store/chat/selectors.ts: -------------------------------------------------------------------------------- 1 | export { chatToolSelectors } from './slices/builtinTool/selectors'; 2 | export { chatSelectors } from './slices/message/selectors'; 3 | export { chatPortalSelectors } from './slices/portal/selectors'; 4 | export { topicSelectors } from './slices/topic/selectors'; 5 | -------------------------------------------------------------------------------- /src/types/tool/tool.ts: -------------------------------------------------------------------------------- 1 | import { MetaData } from '@/types/meta'; 2 | 3 | export type LobeToolType = 'builtin' | 'customPlugin' | 'plugin'; 4 | 5 | export interface LobeToolMeta { 6 | author?: string; 7 | identifier: string; 8 | meta: MetaData; 9 | type: LobeToolType; 10 | } 11 | -------------------------------------------------------------------------------- /src/types/topic.ts: -------------------------------------------------------------------------------- 1 | import { BaseDataModel } from '@/types/meta'; 2 | 3 | export interface ChatTopic extends Omit { 4 | favorite?: boolean; 5 | sessionId?: string; 6 | title: string; 7 | } 8 | 9 | export type ChatTopicMap = Record; 10 | -------------------------------------------------------------------------------- /src/types/user/settings/sync.ts: -------------------------------------------------------------------------------- 1 | export interface WebRTCSyncConfig { 2 | channelName?: string; 3 | channelPassword?: string; 4 | enabled: boolean; 5 | signaling?: string; 6 | } 7 | export interface UserSyncSettings { 8 | deviceName?: string; 9 | webrtc: WebRTCSyncConfig; 10 | } 11 | -------------------------------------------------------------------------------- /locales/ko-KR/portal.json: -------------------------------------------------------------------------------- 1 | { 2 | "Artifacts": "아티팩트", 3 | "actions": { 4 | "genAiMessage": "AI 메시지 생성", 5 | "summary": "요약", 6 | "summaryTooltip": "현재 콘텐츠를 요약합니다" 7 | }, 8 | "emptyArtifactList": "현재 아티팩트 목록이 비어 있습니다. 플러그인을 사용한 후에 다시 확인해주세요.", 9 | "title": "확장 창" 10 | } 11 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "pnpm run build" 3 | publish = ".next" 4 | 5 | [build.environment] 6 | NODE_OPTIONS = "--max_old_space_size=8192" 7 | 8 | [template.environment] 9 | OPENAI_API_KEY = "set your OpenAI API Key" 10 | ACCESS_CODE = "set your password to protect your api key" 11 | -------------------------------------------------------------------------------- /src/components/Analytics/Google.tsx: -------------------------------------------------------------------------------- 1 | import { GoogleAnalytics as GA } from '@next/third-parties/google'; 2 | 3 | import { analyticsEnv } from '@/config/analytics'; 4 | 5 | const GoogleAnalytics = () => ; 6 | 7 | export default GoogleAnalytics; 8 | -------------------------------------------------------------------------------- /src/libs/next-auth/sso-providers/index.ts: -------------------------------------------------------------------------------- 1 | import Auth0 from './auth0'; 2 | import Authentik from './authentik'; 3 | import AzureAD from './azure-ad'; 4 | import Github from './github'; 5 | import Zitadel from './zitadel'; 6 | 7 | export const ssoProviders = [Auth0, Authentik, AzureAD, Github, Zitadel]; 8 | -------------------------------------------------------------------------------- /locales/ja-JP/portal.json: -------------------------------------------------------------------------------- 1 | { 2 | "Artifacts": "アーティファクト", 3 | "actions": { 4 | "genAiMessage": "AIメッセージを生成", 5 | "summary": "サマリー", 6 | "summaryTooltip": "現在の内容を要約" 7 | }, 8 | "emptyArtifactList": "現在、アーティファクトリストは空です。プラグインを使用してセッション中に追加してください。", 9 | "title": "拡張ウィンドウ" 10 | } 11 | -------------------------------------------------------------------------------- /src/hooks/useQuery.ts: -------------------------------------------------------------------------------- 1 | import { useSearchParams } from 'next/navigation'; 2 | import qs from 'query-string'; 3 | import { useMemo } from 'react'; 4 | 5 | export const useQuery = () => { 6 | const rawQuery = useSearchParams(); 7 | return useMemo(() => qs.parse(rawQuery.toString()), [rawQuery]); 8 | }; 9 | -------------------------------------------------------------------------------- /src/tools/index.ts: -------------------------------------------------------------------------------- 1 | import { LobeBuiltinTool } from '@/types/tool'; 2 | 3 | import { DalleManifest } from './dalle'; 4 | 5 | export const builtinTools: LobeBuiltinTool[] = [ 6 | { 7 | identifier: DalleManifest.identifier, 8 | manifest: DalleManifest, 9 | type: 'builtin', 10 | }, 11 | ]; 12 | -------------------------------------------------------------------------------- /src/app/(main)/@nav/default.tsx: -------------------------------------------------------------------------------- 1 | import ServerLayout from '@/components/server/ServerLayout'; 2 | 3 | import Desktop from './_layout/Desktop'; 4 | import Mobile from './_layout/Mobile'; 5 | 6 | const Nav = ServerLayout({ Desktop, Mobile }); 7 | 8 | Nav.displayName = 'Nav'; 9 | 10 | export default Nav; 11 | -------------------------------------------------------------------------------- /src/utils/safeParseJSON.ts: -------------------------------------------------------------------------------- 1 | export const safeParseJSON = >(text: string) => { 2 | if (typeof text !== 'string') return undefined; 3 | 4 | let json: T; 5 | try { 6 | json = JSON.parse(text); 7 | } catch { 8 | return undefined; 9 | } 10 | 11 | return json; 12 | }; 13 | -------------------------------------------------------------------------------- /scripts/i18nWorkflow/index.ts: -------------------------------------------------------------------------------- 1 | import { genDefaultLocale } from './genDefaultLocale'; 2 | import { genDiff } from './genDiff'; 3 | import { split } from './utils'; 4 | 5 | split('DIFF ANALYSIS'); 6 | genDiff(); 7 | 8 | split('GENERATE DEFAULT LOCALE'); 9 | genDefaultLocale(); 10 | 11 | split('GENERATE I18N FILES'); 12 | -------------------------------------------------------------------------------- /src/app/(main)/settings/tts/index.tsx: -------------------------------------------------------------------------------- 1 | import OpenAI from './features/OpenAI'; 2 | import STT from './features/STT'; 3 | 4 | const Page = () => { 5 | return ( 6 | <> 7 | 8 | 9 | 10 | ); 11 | }; 12 | 13 | Page.displayName = 'TtsSetting'; 14 | 15 | export default Page; 16 | -------------------------------------------------------------------------------- /src/components/Analytics/Vercel.tsx: -------------------------------------------------------------------------------- 1 | import { Analytics } from '@vercel/analytics/react'; 2 | import { memo } from 'react'; 3 | 4 | import { analyticsEnv } from '@/config/analytics'; 5 | 6 | const VercelAnalytics = memo(() => ); 7 | 8 | export default VercelAnalytics; 9 | -------------------------------------------------------------------------------- /src/migrations/FromV0ToV1.ts: -------------------------------------------------------------------------------- 1 | import type { Migration, MigrationData } from './VersionController'; 2 | 3 | export class MigrationV0ToV1 implements Migration { 4 | // from this version to start migration 5 | version = 0; 6 | 7 | migrate(data: MigrationData): MigrationData { 8 | return data; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/utils/uploadFIle.ts: -------------------------------------------------------------------------------- 1 | export const createUploadImageHandler = 2 | (onUploadImage: (base64: string) => void) => (file: any) => { 3 | const reader = new FileReader(); 4 | reader.readAsDataURL(file); 5 | reader.addEventListener('load', () => { 6 | onUploadImage(String(reader.result)); 7 | }); 8 | }; 9 | -------------------------------------------------------------------------------- /src/components/PageTitle/index.tsx: -------------------------------------------------------------------------------- 1 | import { memo, useEffect } from 'react'; 2 | 3 | const PageTitle = memo<{ title: string }>(({ title }) => { 4 | useEffect(() => { 5 | document.title = title ? `${title} · LobeChat` : 'LobeChat'; 6 | }, [title]); 7 | 8 | return null; 9 | }); 10 | 11 | export default PageTitle; 12 | -------------------------------------------------------------------------------- /src/libs/agent-runtime/novita/type.ts: -------------------------------------------------------------------------------- 1 | export interface NovitaModelCard { 2 | context_size: number; 3 | created: number; 4 | description: string; 5 | id: string; 6 | input_token_price_per_m: number; 7 | output_token_price_per_m: number; 8 | status: number; 9 | tags: string[]; 10 | title: string; 11 | } 12 | -------------------------------------------------------------------------------- /src/libs/agent-runtime/utils/streams/index.ts: -------------------------------------------------------------------------------- 1 | export * from './anthropic'; 2 | export * from './azureOpenai'; 3 | export * from './bedrock'; 4 | export * from './google-ai'; 5 | export * from './minimax'; 6 | export * from './ollama'; 7 | export * from './openai'; 8 | export * from './protocol'; 9 | export * from './qwen'; 10 | -------------------------------------------------------------------------------- /src/services/message/index.ts: -------------------------------------------------------------------------------- 1 | import { isServerMode } from '@/const/version'; 2 | 3 | import { ClientService } from './client'; 4 | import { ServerService } from './server'; 5 | 6 | export type { CreateMessageParams } from './type'; 7 | 8 | export const messageService = isServerMode ? new ServerService() : new ClientService(); 9 | -------------------------------------------------------------------------------- /src/utils/zustand.ts: -------------------------------------------------------------------------------- 1 | import { StoreApi } from 'zustand'; 2 | 3 | export interface StoreApiWithSelector extends Omit, 'subscribe'> { 4 | subscribe: ( 5 | selector: (state: Store, prevState: Store) => void, 6 | listener?: (state: Store[T]) => void, 7 | ) => () => void; 8 | } 9 | -------------------------------------------------------------------------------- /tests/utils.tsx: -------------------------------------------------------------------------------- 1 | import { PropsWithChildren } from 'react'; 2 | import { SWRConfig } from 'swr'; 3 | 4 | // 全局的 SWR 配置 5 | const swrConfig = { 6 | provider: () => new Map(), 7 | }; 8 | 9 | export const withSWR = ({ children }: PropsWithChildren) => ( 10 | {children} 11 | ); 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [Makefile] 16 | indent_style = tab 17 | -------------------------------------------------------------------------------- /docs/self-hosting/server-database/sealos.zh-CN.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 在 SealOS 上部署 LobeChat 3 | description: 学习如何在 SealOS 上部署 LobeChat,包括准备 OpenAI API Key、点击部署按钮、绑定自定义域名等操作。 4 | tags: 5 | - SealOS 6 | - LobeChat 7 | - OpenAI API Key 8 | - 部署流程 9 | - 自定义域名 10 | --- 11 | 12 | # 使用 SealOS 部署 LobeChat 数据库版 13 | 14 | TODO 15 | -------------------------------------------------------------------------------- /src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/index.tsx: -------------------------------------------------------------------------------- 1 | import { ChatHeader } from '@lobehub/ui'; 2 | 3 | import HeaderAction from './HeaderAction'; 4 | import Main from './Main'; 5 | 6 | const Header = () => } right={} style={{ zIndex: 11 }} />; 7 | 8 | export default Header; 9 | -------------------------------------------------------------------------------- /src/app/(main)/settings/common/index.tsx: -------------------------------------------------------------------------------- 1 | import Common from './features/Common'; 2 | import Theme from './features/Theme'; 3 | 4 | const Page = () => { 5 | return ( 6 | <> 7 | 8 | 9 | 10 | ); 11 | }; 12 | 13 | Page.displayName = 'CommonSetting'; 14 | 15 | export default Page; 16 | -------------------------------------------------------------------------------- /src/utils/storeDebug.ts: -------------------------------------------------------------------------------- 1 | export const setNamespace = (namespace: string) => { 2 | return (type: string, payload?: any) => { 3 | const name = [namespace, type].filter(Boolean).join('/'); 4 | return payload 5 | ? { 6 | payload, 7 | type: name, 8 | } 9 | : name; 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /src/app/api/tts/edge-speech/route.ts: -------------------------------------------------------------------------------- 1 | import { EdgeSpeechPayload, EdgeSpeechTTS } from '@lobehub/tts'; 2 | 3 | export const runtime = 'edge'; 4 | 5 | export const POST = async (req: Request) => { 6 | const payload = (await req.json()) as EdgeSpeechPayload; 7 | 8 | return await EdgeSpeechTTS.createRequest({ payload }); 9 | }; 10 | -------------------------------------------------------------------------------- /src/store/file/slices/images/initialState.ts: -------------------------------------------------------------------------------- 1 | import { FilePreview } from '@/types/files'; 2 | 3 | export interface ImageFileState { 4 | imagesMap: Record; 5 | inputFilesList: string[]; 6 | } 7 | 8 | export const initialImageFileState: ImageFileState = { 9 | imagesMap: {}, 10 | inputFilesList: [], 11 | }; 12 | -------------------------------------------------------------------------------- /src/store/user/helpers.ts: -------------------------------------------------------------------------------- 1 | import { userGeneralSettingsSelectors } from './slices/settings/selectors'; 2 | import { useUserStore } from './store'; 3 | 4 | const getCurrentLanguage = () => 5 | userGeneralSettingsSelectors.currentLanguage(useUserStore.getState()); 6 | 7 | export const globalHelpers = { 8 | getCurrentLanguage, 9 | }; 10 | -------------------------------------------------------------------------------- /src/utils/parseMarkdown.ts: -------------------------------------------------------------------------------- 1 | import { remark } from 'remark'; 2 | import remarkGfm from 'remark-gfm'; 3 | import remarkHtml from 'remark-html'; 4 | 5 | export const parseMarkdown = async (content: string) => { 6 | const file = await remark().use(remarkGfm).use(remarkHtml).process(content.trim()); 7 | 8 | return String(file); 9 | }; 10 | -------------------------------------------------------------------------------- /docs/self-hosting/server-database/repocloud.zh-CN.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 在 RepoCloud 上部署 LobeChat 数据库版 3 | description: 学习如何在RepoCloud上部署LobeChat应用,包括准备OpenAI API Key、点击部署按钮、绑定自定义域名等操作。 4 | tags: 5 | - RepoCloud 6 | - LobeChat 7 | - 部署流程 8 | - OpenAI API Key 9 | - 自定义域名 10 | --- 11 | 12 | # 使用 RepoCloud 部署 LobeChat 数据库版 13 | 14 | TODO 15 | -------------------------------------------------------------------------------- /locales/en-US/tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "dalle": { 3 | "autoGenerate": "Auto Generate", 4 | "downloading": "The image links generated by DALL·E3 are only valid for 1 hour, caching the images locally...", 5 | "generate": "Generate", 6 | "generating": "Generating...", 7 | "images": "Images:", 8 | "prompt": "提示词" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /locales/vi-VN/tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "dalle": { 3 | "autoGenerate": "Tự động tạo", 4 | "downloading": "Liên kết hình ảnh được tạo bởi DallE3 chỉ có hiệu lực trong 1 giờ, đang tải hình ảnh xuống máy...", 5 | "generate": "Tạo", 6 | "generating": "Đang tạo...", 7 | "images": "Hình ảnh:", 8 | "prompt": "Từ khóa" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/features/Conversation/Extras/index.ts: -------------------------------------------------------------------------------- 1 | import { RenderMessageExtra } from '../types'; 2 | import { AssistantMessageExtra } from './Assistant'; 3 | import { UserMessageExtra } from './User'; 4 | 5 | export const renderMessagesExtra: Record = { 6 | assistant: AssistantMessageExtra, 7 | user: UserMessageExtra, 8 | }; 9 | -------------------------------------------------------------------------------- /src/features/PluginStore/Loading.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton } from 'antd'; 2 | import { memo } from 'react'; 3 | import { Flexbox } from 'react-layout-kit'; 4 | 5 | const Loading = memo(() => { 6 | return ( 7 | 8 | 9 | 10 | ); 11 | }); 12 | 13 | export default Loading; 14 | -------------------------------------------------------------------------------- /src/utils/client/switchLang.ts: -------------------------------------------------------------------------------- 1 | import { changeLanguage } from 'i18next'; 2 | 3 | import { LocaleMode } from '@/types/locale'; 4 | 5 | export const switchLang = (locale: LocaleMode) => { 6 | const lang = locale === 'auto' ? navigator.language : locale; 7 | 8 | changeLanguage(lang); 9 | document.documentElement.lang = lang; 10 | }; 11 | -------------------------------------------------------------------------------- /docs/self-hosting/server-database/railway.zh-CN.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 在 Railway 上部署 LobeChat 数据库版 3 | description: 学习如何在 Railway 上部署 LobeChat 应用,包括准备 OpenAI API Key、点击按钮进行部署、绑定自定义域名等步骤。 4 | tags: 5 | - Railway 6 | - 部署 7 | - LobeChat 8 | - OpenAI 9 | - API Key 10 | - 自定义域名 11 | --- 12 | 13 | # 使用 Railway 部署 LobeChat 数据库版 14 | 15 | TODO 16 | -------------------------------------------------------------------------------- /src/app/(main)/welcome/layout.tsx: -------------------------------------------------------------------------------- 1 | import ServerLayout from '@/components/server/ServerLayout'; 2 | 3 | import Desktop from './_layout/Desktop'; 4 | import Mobile from './_layout/Mobile'; 5 | 6 | const WelcomeLayout = ServerLayout({ Desktop, Mobile }); 7 | 8 | WelcomeLayout.displayName = 'WelcomeLayout'; 9 | 10 | export default WelcomeLayout; 11 | -------------------------------------------------------------------------------- /src/store/tool/selectors/index.ts: -------------------------------------------------------------------------------- 1 | export { builtinToolSelectors } from '../slices/builtin/selectors'; 2 | export { customPluginSelectors } from '../slices/customPlugin/selectors'; 3 | export { pluginSelectors } from '../slices/plugin/selectors'; 4 | export { pluginStoreSelectors } from '../slices/store/selectors'; 5 | export { toolSelectors } from './tool'; 6 | -------------------------------------------------------------------------------- /src/utils/merge.ts: -------------------------------------------------------------------------------- 1 | import { merge as _merge, mergeWith } from 'lodash-es'; 2 | 3 | /** 4 | * 用于合并对象,如果是数组则直接替换 5 | * @param target 6 | * @param source 7 | */ 8 | export const merge: typeof _merge = (target: T, source: T) => 9 | mergeWith({}, target, source, (obj, src) => { 10 | if (Array.isArray(obj)) return src; 11 | }); 12 | -------------------------------------------------------------------------------- /locales/ar/tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "dalle": { 3 | "autoGenerate": "توليد تلقائي", 4 | "downloading": "صلاحية روابط الصور المُولَّدة بواسطة DallE3 تدوم ساعة واحدة فقط، يتم تحميل الصور إلى الجهاز المحلي...", 5 | "generate": "توليد", 6 | "generating": "جارٍ التوليد...", 7 | "images": "الصور:", 8 | "prompt": "كلمة تلميح" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/hooks/useProviderName.ts: -------------------------------------------------------------------------------- 1 | import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders'; 2 | 3 | export const useProviderName = (provider: string) => { 4 | // const { t } = useTranslation('modelProvider'); 5 | const providerCard = DEFAULT_MODEL_PROVIDER_LIST.find((p) => p.id === provider); 6 | 7 | return providerCard?.name || provider; 8 | }; 9 | -------------------------------------------------------------------------------- /.github/workflows/issues-translate.yml: -------------------------------------------------------------------------------- 1 | name: Issue Translate 2 | on: 3 | issue_comment: 4 | types: [created] 5 | issues: 6 | types: [opened] 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: usthe/issues-translate-action@v2.7 13 | with: 14 | BOT_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} 15 | -------------------------------------------------------------------------------- /scripts/readmeWorkflow/index.ts: -------------------------------------------------------------------------------- 1 | import { consola } from 'consola'; 2 | 3 | import syncAgentIndex from './syncAgentIndex'; 4 | import syncPluginIndex from './syncPluginIndex'; 5 | 6 | const runSync = async () => { 7 | consola.start('Start sync readme workflow...'); 8 | await syncAgentIndex(); 9 | await syncPluginIndex(); 10 | }; 11 | 12 | runSync(); 13 | -------------------------------------------------------------------------------- /src/app/api/tts/microsoft-speech/route.ts: -------------------------------------------------------------------------------- 1 | import { MicrosoftSpeechPayload, MicrosoftSpeechTTS } from '@lobehub/tts'; 2 | 3 | export const runtime = 'edge'; 4 | 5 | export const POST = async (req: Request) => { 6 | const payload = (await req.json()) as MicrosoftSpeechPayload; 7 | 8 | return await MicrosoftSpeechTTS.createRequest({ payload }); 9 | }; 10 | -------------------------------------------------------------------------------- /src/database/server/schemas/lobechat/_helpers.ts: -------------------------------------------------------------------------------- 1 | import { timestamp } from 'drizzle-orm/pg-core'; 2 | 3 | export const timestamptz = (name: string) => timestamp(name, { withTimezone: true }); 4 | 5 | export const createdAt = () => timestamptz('created_at').notNull().defaultNow(); 6 | export const updatedAt = () => timestamptz('updated_at').notNull().defaultNow(); 7 | -------------------------------------------------------------------------------- /src/app/(main)/chat/(workspace)/features/ShareButton/type.ts: -------------------------------------------------------------------------------- 1 | export enum ImageType { 2 | JPG = 'jpg', 3 | PNG = 'png', 4 | SVG = 'svg', 5 | WEBP = 'webp', 6 | } 7 | 8 | export type FieldType = { 9 | imageType: ImageType; 10 | withBackground: boolean; 11 | withFooter: boolean; 12 | withPluginInfo: boolean; 13 | withSystemRole: boolean; 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/StructuredData/index.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | 3 | const StructuredData: FC<{ ld: any }> = ({ ld }) => { 4 | return ( 5 |