@lobehub/lobehub 2.0.0-next.184 → 2.0.0-next.186

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +18 -0
  3. package/e2e/src/support/webServer.ts +0 -1
  4. package/locales/ar/auth.json +1 -0
  5. package/locales/ar/models.json +40 -0
  6. package/locales/ar/setting.json +1 -0
  7. package/locales/ar/subscription.json +13 -0
  8. package/locales/bg-BG/auth.json +1 -0
  9. package/locales/bg-BG/models.json +22 -0
  10. package/locales/bg-BG/setting.json +1 -0
  11. package/locales/bg-BG/subscription.json +13 -0
  12. package/locales/de-DE/auth.json +1 -0
  13. package/locales/de-DE/models.json +37 -0
  14. package/locales/de-DE/setting.json +1 -0
  15. package/locales/de-DE/subscription.json +13 -0
  16. package/locales/en-US/auth.json +1 -0
  17. package/locales/en-US/setting.json +1 -1
  18. package/locales/es-ES/auth.json +1 -0
  19. package/locales/es-ES/models.json +30 -0
  20. package/locales/es-ES/setting.json +1 -0
  21. package/locales/es-ES/subscription.json +13 -0
  22. package/locales/fa-IR/auth.json +1 -0
  23. package/locales/fa-IR/models.json +31 -0
  24. package/locales/fa-IR/setting.json +1 -0
  25. package/locales/fa-IR/subscription.json +13 -0
  26. package/locales/fr-FR/auth.json +1 -0
  27. package/locales/fr-FR/models.json +17 -0
  28. package/locales/fr-FR/setting.json +1 -0
  29. package/locales/fr-FR/subscription.json +13 -0
  30. package/locales/it-IT/auth.json +1 -0
  31. package/locales/it-IT/models.json +31 -0
  32. package/locales/it-IT/setting.json +1 -0
  33. package/locales/it-IT/subscription.json +13 -0
  34. package/locales/ja-JP/auth.json +1 -0
  35. package/locales/ja-JP/models.json +1 -0
  36. package/locales/ja-JP/setting.json +1 -0
  37. package/locales/ja-JP/subscription.json +13 -0
  38. package/locales/ko-KR/auth.json +1 -0
  39. package/locales/ko-KR/models.json +39 -0
  40. package/locales/ko-KR/setting.json +1 -0
  41. package/locales/ko-KR/subscription.json +13 -0
  42. package/locales/nl-NL/auth.json +1 -0
  43. package/locales/nl-NL/models.json +35 -0
  44. package/locales/nl-NL/setting.json +1 -0
  45. package/locales/nl-NL/subscription.json +13 -0
  46. package/locales/pl-PL/auth.json +1 -0
  47. package/locales/pl-PL/models.json +12 -0
  48. package/locales/pl-PL/setting.json +1 -0
  49. package/locales/pl-PL/subscription.json +13 -0
  50. package/locales/pt-BR/auth.json +1 -0
  51. package/locales/pt-BR/models.json +1 -0
  52. package/locales/pt-BR/setting.json +1 -0
  53. package/locales/pt-BR/subscription.json +13 -0
  54. package/locales/ru-RU/auth.json +1 -0
  55. package/locales/ru-RU/models.json +32 -0
  56. package/locales/ru-RU/setting.json +1 -0
  57. package/locales/ru-RU/subscription.json +13 -0
  58. package/locales/tr-TR/auth.json +1 -0
  59. package/locales/tr-TR/models.json +20 -0
  60. package/locales/tr-TR/setting.json +1 -0
  61. package/locales/tr-TR/subscription.json +13 -0
  62. package/locales/vi-VN/auth.json +1 -0
  63. package/locales/vi-VN/models.json +39 -0
  64. package/locales/vi-VN/setting.json +1 -0
  65. package/locales/vi-VN/subscription.json +13 -0
  66. package/locales/zh-CN/auth.json +1 -0
  67. package/locales/zh-CN/models.json +49 -0
  68. package/locales/zh-CN/setting.json +1 -1
  69. package/locales/zh-TW/auth.json +1 -0
  70. package/locales/zh-TW/models.json +23 -0
  71. package/locales/zh-TW/setting.json +1 -0
  72. package/locales/zh-TW/subscription.json +13 -0
  73. package/next.config.ts +14 -1
  74. package/package.json +2 -1
  75. package/packages/types/src/message/common/base.ts +1 -1
  76. package/packages/types/src/message/ui/chat.ts +3 -3
  77. package/packages/types/src/message/ui/extra.ts +2 -2
  78. package/packages/types/src/openai/plugin.ts +1 -1
  79. package/packages/types/src/session/agentSession.ts +1 -1
  80. package/packages/types/src/user/settings/index.ts +1 -1
  81. package/src/app/(backend)/oidc/[...oidc]/route.ts +2 -2
  82. package/src/app/[variants]/(auth)/oauth/consent/[uid]/page.tsx +2 -2
  83. package/src/envs/auth.ts +2 -0
  84. package/src/libs/next/config/define-config.ts +19 -10
  85. package/src/libs/next/proxy/define-config.ts +4 -5
  86. package/src/libs/trpc/lambda/context.ts +9 -11
  87. package/src/server/services/oidc/oidcProvider.ts +2 -2
  88. package/src/store/image/utils/size.test.ts +245 -0
  89. package/vercel.json +1 -1
  90. package/src/envs/oidc.ts +0 -18
@@ -147,6 +147,7 @@
147
147
  "loginGuide.f4": "探索強大的外掛功能",
148
148
  "loginGuide.title": "登入後,您可以:",
149
149
  "loginOrSignup": "登入 / 註冊",
150
+ "profile.account": "帳戶",
150
151
  "profile.authorizations.actions.revoke": "取消授權",
151
152
  "profile.authorizations.revoke.description": "取消授權後,該工具將無法存取您的資料。如需再次使用,需重新授權。",
152
153
  "profile.authorizations.revoke.title": "確認取消授權 {{name}}?",
@@ -223,7 +223,30 @@
223
223
  "alibaba/qwen-3-235b.description": "Qwen3 是 Qwen 系列的最新一代,提供完整的密集與 MoE 模型組合。透過大規模訓練,在推理、指令遵循、代理能力與多語言支援方面實現突破。",
224
224
  "alibaba/qwen-3-30b.description": "Qwen3 是 Qwen 系列的最新一代,提供完整的密集與 MoE 模型組合。透過大規模訓練,在推理、指令遵循、代理能力與多語言支援方面實現突破。",
225
225
  "alibaba/qwen-3-32b.description": "Qwen3 是 Qwen 系列的最新一代,提供完整的密集與 MoE 模型組合。透過大規模訓練,在推理、指令遵循、代理能力與多語言支援方面實現突破。",
226
+ "alibaba/qwen3-coder.description": "Qwen3-Coder-480B-A35B-Instruct 是 Qwen 最具代理能力的程式模型,在代理式編碼、瀏覽器操作及其他核心編碼任務上表現優異,達到與 Claude Sonnet 同級的成果。",
227
+ "amazon/nova-lite.description": "一款極低成本的多模態模型,能以極快速度處理圖像、影片與文字輸入。",
228
+ "amazon/nova-micro.description": "一款僅支援文字的模型,提供超低延遲與極低成本的運算效能。",
229
+ "amazon/nova-pro.description": "一款功能強大的多模態模型,在準確性、速度與成本之間達到最佳平衡,適用於各類任務。",
226
230
  "amazon/titan-embed-text-v2.description": "Amazon Titan Text Embeddings V2 是一個輕量級、高效的多語言嵌入模型,支援 1024、512 和 256 維度。",
231
+ "anthropic.claude-3-5-sonnet-20240620-v1:0.description": "Claude 3.5 Sonnet 提升了業界標準,在多項評估中超越競爭對手與 Claude 3 Opus,同時維持中階速度與成本。",
232
+ "anthropic.claude-3-5-sonnet-20241022-v2:0.description": "Claude 3.5 Sonnet 提升了業界標準,在多項評估中超越競爭對手與 Claude 3 Opus,同時維持中階速度與成本。",
233
+ "anthropic.claude-3-haiku-20240307-v1:0.description": "Claude 3 Haiku 是 Anthropic 速度最快、體積最小的模型,能即時回應簡單查詢,提供流暢自然的 AI 體驗,並支援圖像輸入與 200K 的上下文視窗。",
234
+ "anthropic.claude-3-opus-20240229-v1:0.description": "Claude 3 Opus 是 Anthropic 最強大的 AI 模型,在處理高度複雜任務時展現最先進的效能,具備開放式提示與新穎情境的流暢應對能力,並支援圖像輸入與 200K 的上下文視窗。",
235
+ "anthropic.claude-3-sonnet-20240229-v1:0.description": "Claude 3 Sonnet 在智慧與速度之間取得平衡,適用於企業級工作負載,提供高性價比與可靠的大規模部署能力,並支援圖像輸入與 200K 的上下文視窗。",
236
+ "anthropic.claude-instant-v1.description": "一款快速、經濟且功能強大的模型,適用於日常對話、文字分析、摘要與文件問答。",
237
+ "anthropic.claude-v2.description": "一款功能全面的模型,涵蓋複雜對話、創意生成與精確指令執行等任務。",
238
+ "anthropic.claude-v2:1.description": "Claude 2 的升級版,具備雙倍上下文視窗,並在長文件與檢索增強生成(RAG)任務中提升可靠性、降低幻覺率與提升基於證據的準確性。",
239
+ "anthropic/claude-3-haiku.description": "Claude 3 Haiku 是 Anthropic 速度最快的模型,專為處理長提示的企業級工作負載設計,能快速分析大型文件如季報、合約或法律案件,成本僅為同類模型的一半。",
240
+ "anthropic/claude-3-opus.description": "Claude 3 Opus 是 Anthropic 最智慧的模型,在處理高度複雜任務時展現市場領先的效能,能流暢應對開放式提示與新穎情境,具備類人理解能力。",
241
+ "anthropic/claude-3.5-haiku.description": "Claude 3.5 Haiku 提升了速度、程式碼準確性與工具使用能力,適用於對速度與工具互動有高要求的場景。",
242
+ "anthropic/claude-3.5-sonnet.description": "Claude 3.5 Sonnet 是 Sonnet 系列中快速且高效的模型,具備更佳的程式與推理能力,部分版本已逐步由 Sonnet 3.7 或更新版本取代。",
243
+ "anthropic/claude-3.7-sonnet.description": "Claude 3.7 Sonnet 是升級版的 Sonnet 模型,具備更強的推理與程式能力,適用於企業級複雜任務。",
244
+ "anthropic/claude-haiku-4.5.description": "Claude Haiku 4.5 是 Anthropic 的高效能快速模型,在保持高準確度的同時提供極低延遲。",
245
+ "anthropic/claude-opus-4.1.description": "Opus 4.1 是 Anthropic 的高階模型,針對程式設計、複雜推理與長時間任務進行最佳化。",
246
+ "anthropic/claude-opus-4.5.description": "Claude Opus 4.5 是 Anthropic 的旗艦模型,結合頂尖智慧與可擴展效能,適用於複雜且高品質的推理任務。",
247
+ "anthropic/claude-opus-4.description": "Opus 4 是 Anthropic 為複雜任務與企業應用設計的旗艦模型。",
248
+ "anthropic/claude-sonnet-4.5.description": "Claude Sonnet 4.5 是 Anthropic 最新的混合推理模型,針對複雜推理與程式設計進行最佳化。",
249
+ "anthropic/claude-sonnet-4.description": "Claude Sonnet 4 是 Anthropic 的混合推理模型,具備思考與非思考能力的結合。",
227
250
  "gemini-flash-latest.description": "Gemini Flash 最新版本",
228
251
  "gemini-flash-lite-latest.description": "Gemini Flash-Lite 最新版本",
229
252
  "gemini-pro-latest.description": "Gemini Pro 最新版本",
@@ -215,6 +215,7 @@
215
215
  "settingAgent.name.placeholder": "請輸入助手名稱",
216
216
  "settingAgent.name.title": "名稱",
217
217
  "settingAgent.prompt.placeholder": "輸入助手設定,按 / 開啟指令選單",
218
+ "settingAgent.prompt.templatePlaceholder": "#### 目標\n描述此代理的主要目的與目標。\n\n#### 技能\n- 列出主要能力\n- 以及專業知識領域\n\n#### 工作流程\n1. 步驟式流程\n2. 代理執行任務的方式\n3. 與使用者的預期互動方式\n\n#### 限制\n- 必須遵守的重要限制\n- 行為準則",
218
219
  "settingAgent.prompt.title": "助手設定",
219
220
  "settingAgent.submit": "更新助手資訊",
220
221
  "settingAgent.tag.desc": "助手標籤將會在助手社群中顯示",
@@ -271,15 +271,28 @@
271
271
  "referral.edit.hint": "支援 2-8 位英文字母、數字或底線",
272
272
  "referral.edit.placeholder": "輸入推薦碼",
273
273
  "referral.edit.save": "儲存",
274
+ "referral.errors.alreadyBound": "您已綁定邀請碼",
275
+ "referral.errors.backfillExpired": "補填期限已過。註冊後超過 3 天無法補填",
274
276
  "referral.errors.codeExists": "此推薦碼已被使用,請選擇其他碼",
277
+ "referral.errors.invalidCode": "邀請碼不存在,請確認後再試一次",
275
278
  "referral.errors.invalidFormat": "推薦碼格式錯誤,請輸入 2-8 位英文字母、數字或底線",
279
+ "referral.errors.selfReferral": "您不能使用自己的邀請碼",
276
280
  "referral.errors.updateFailed": "更新失敗,請稍後再試",
277
281
  "referral.inviteCode.description": "分享您的專屬推薦碼,邀請朋友註冊",
278
282
  "referral.inviteCode.title": "我的推薦碼",
279
283
  "referral.inviteLink.description": "複製連結並分享給朋友,完成註冊即可獲得獎勵",
280
284
  "referral.inviteLink.title": "推薦連結",
285
+ "referral.rules.backfill.alreadyBound": "您已綁定邀請碼",
286
+ "referral.rules.backfill.description": "忘記輸入邀請碼?您可以在註冊後 3 天內補填",
287
+ "referral.rules.backfill.expiredTip": "補填期限已過。註冊後超過 3 天無法補填",
288
+ "referral.rules.backfill.link": "補填邀請碼",
289
+ "referral.rules.backfill.placeholder": "請輸入邀請碼",
290
+ "referral.rules.backfill.submit": "確認綁定",
291
+ "referral.rules.backfill.success": "邀請碼綁定成功",
292
+ "referral.rules.backfill.title": "補填邀請碼",
281
293
  "referral.rules.description": "了解推薦獎勵計畫規則",
282
294
  "referral.rules.expiry": "點數有效期:用戶 100 天未活躍後,推薦點數將被清除",
295
+ "referral.rules.missedCode": "錯過邀請碼:您可以在註冊後 3 天內<0>補填</0>",
283
296
  "referral.rules.priority": "點數使用優先順序:免費點數 → 訂閱點數 → 推薦點數 → 儲值點數",
284
297
  "referral.rules.registration": "註冊方式:受邀者透過推薦連結註冊或在註冊頁輸入推薦碼",
285
298
  "referral.rules.reward": "獎勵:推薦人與受邀人各獲得 {{reward}}M 點數",
package/next.config.ts CHANGED
@@ -1,5 +1,18 @@
1
1
  import { defineConfig } from './src/libs/next/config/define-config';
2
2
 
3
- const nextConfig = defineConfig({});
3
+ const nextConfig = defineConfig({
4
+ experimental: {
5
+ webpackBuildWorker: true,
6
+ webpackMemoryOptimizations: true,
7
+ },
8
+ webpack: (webpackConfig, context) => {
9
+ const { dev } = context;
10
+ if (!dev) {
11
+ webpackConfig.cache = false;
12
+ }
13
+
14
+ return webpackConfig;
15
+ },
16
+ });
4
17
 
5
18
  export default nextConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.184",
3
+ "version": "2.0.0-next.186",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -40,6 +40,7 @@
40
40
  "build:analyze": "NODE_OPTIONS=--max-old-space-size=8192 ANALYZE=true next build --webpack",
41
41
  "build:docker": "npm run prebuild && NODE_OPTIONS=--max-old-space-size=8192 DOCKER=true next build --webpack && npm run build-sitemap",
42
42
  "build:electron": "cross-env NODE_OPTIONS=--max-old-space-size=8192 NEXT_PUBLIC_IS_DESKTOP_APP=1 tsx scripts/electronWorkflow/buildNextApp.mts",
43
+ "build:vercel": "npm run prebuild && cross-env NODE_OPTIONS=--max-old-space-size=6144 next build --webpack",
43
44
  "clean:node_modules": "bash -lc 'set -e; echo \"Removing all node_modules...\"; rm -rf node_modules; pnpm -r exec rm -rf node_modules; rm -rf apps/desktop/node_modules; echo \"All node_modules removed.\"'",
44
45
  "db:generate": "drizzle-kit generate && npm run db:generate-client && npm run workflow:dbml",
45
46
  "db:generate-client": "tsx ./scripts/migrateClientDB/compile-migrations.ts",
@@ -5,7 +5,7 @@ import type { ILobeAgentRuntimeErrorType } from '../../agentRuntime';
5
5
  import { ErrorType } from '../../fetch';
6
6
 
7
7
  /**
8
- * 聊天消息错误对象
8
+ * Chat message error object
9
9
  */
10
10
  export interface ChatMessageError {
11
11
  body?: any;
@@ -107,7 +107,7 @@ export interface UIChatMessage {
107
107
  content: string;
108
108
  createdAt: number;
109
109
  error?: ChatMessageError | null;
110
- // 扩展字段
110
+ // Extended fields
111
111
  extra?: ChatMessageExtra;
112
112
  fileList?: ChatFileItem[];
113
113
  /**
@@ -186,11 +186,11 @@ export interface UIChatMessage {
186
186
  tool_call_id?: string;
187
187
  tools?: ChatToolPayload[];
188
188
  /**
189
- * 保存到主题的消息
189
+ * Messages saved to topic
190
190
  */
191
191
  topicId?: string;
192
192
  /**
193
- * 观测链路 id
193
+ * Observation trace ID
194
194
  */
195
195
  traceId?: string;
196
196
  updatedAt: number;
@@ -9,8 +9,8 @@ export interface ChatTTS {
9
9
  export interface ChatMessageExtra {
10
10
  model?: string;
11
11
  provider?: string;
12
- // 翻译
12
+ // Translation
13
13
  translate?: ChatTranslate | false | null;
14
- // TTS
14
+ // Text-to-Speech
15
15
  tts?: ChatTTS;
16
16
  }
@@ -53,5 +53,5 @@ export interface OpenAIPluginManifest {
53
53
  name_for_human: string;
54
54
  name_for_model: string;
55
55
  schema_version: string;
56
- // 其他可能的字段...
56
+ // Other possible fields...
57
57
  }
@@ -47,7 +47,7 @@ export interface LobeGroupSession {
47
47
 
48
48
  export interface LobeAgentSettings {
49
49
  /**
50
- * 语言模型角色设定
50
+ * Language model agent configuration
51
51
  */
52
52
  config: LobeAgentConfig;
53
53
  meta: MetaData;
@@ -28,7 +28,7 @@ export * from './tool';
28
28
  export * from './tts';
29
29
 
30
30
  /**
31
- * 配置设置
31
+ * User configuration settings
32
32
  */
33
33
  export interface UserSettings {
34
34
  defaultAgent: UserDefaultAgent;
@@ -2,7 +2,7 @@ import debug from 'debug';
2
2
  import { type NextRequest, NextResponse } from 'next/server';
3
3
  import { URL } from 'node:url';
4
4
 
5
- import { oidcEnv } from '@/envs/oidc';
5
+ import { authEnv } from '@/envs/auth';
6
6
  import { createNodeRequest, createNodeResponse } from '@/libs/oidc-provider/http-adapter';
7
7
  import { getOIDCProvider } from '@/server/services/oidc/oidcProvider';
8
8
 
@@ -17,7 +17,7 @@ const handler = async (req: NextRequest) => {
17
17
  let responseCollector;
18
18
 
19
19
  try {
20
- if (!oidcEnv.ENABLE_OIDC) {
20
+ if (!authEnv.ENABLE_OIDC) {
21
21
  log('OIDC is not enabled');
22
22
  return new NextResponse('OIDC is not enabled', { status: 404 });
23
23
  }
@@ -1,6 +1,6 @@
1
1
  import { notFound } from 'next/navigation';
2
2
 
3
- import { oidcEnv } from '@/envs/oidc';
3
+ import { authEnv } from '@/envs/auth';
4
4
  import { defaultClients } from '@/libs/oidc-provider/config';
5
5
  import { OIDCService } from '@/server/services/oidc';
6
6
 
@@ -9,7 +9,7 @@ import Consent from './Consent';
9
9
  import Login from './Login';
10
10
 
11
11
  const InteractionPage = async (props: { params: Promise<{ uid: string }> }) => {
12
- if (!oidcEnv.ENABLE_OIDC) return notFound();
12
+ if (!authEnv.ENABLE_OIDC) return notFound();
13
13
 
14
14
  const params = await props.params;
15
15
  const uid = params.uid;
package/src/envs/auth.ts CHANGED
@@ -284,6 +284,7 @@ export const getAuthConfig = () => {
284
284
 
285
285
  // Generic JWKS key for signing/verifying JWTs
286
286
  JWKS_KEY: z.string().optional(),
287
+ ENABLE_OIDC: z.boolean(),
287
288
  },
288
289
 
289
290
  runtimeEnv: {
@@ -407,6 +408,7 @@ export const getAuthConfig = () => {
407
408
 
408
409
  // Generic JWKS key (fallback to OIDC_JWKS_KEY for backward compatibility)
409
410
  JWKS_KEY: process.env.JWKS_KEY || process.env.OIDC_JWKS_KEY,
411
+ ENABLE_OIDC: !!(process.env.JWKS_KEY || process.env.OIDC_JWKS_KEY),
410
412
  },
411
413
  });
412
414
  };
@@ -6,9 +6,11 @@ import type { Header, Redirect } from 'next/dist/lib/load-custom-routes';
6
6
  import ReactComponentName from 'react-scan/react-component-name/webpack';
7
7
 
8
8
  interface CustomNextConfig {
9
+ experimental?: NextConfig['experimental'];
9
10
  headers?: Header[];
10
11
  redirects?: Redirect[];
11
12
  turbopack?: NextConfig['turbopack'];
13
+ webpack?: NextConfig['webpack'];
12
14
  }
13
15
 
14
16
  export function defineConfig(config: CustomNextConfig) {
@@ -56,6 +58,7 @@ export function defineConfig(config: CustomNextConfig) {
56
58
  webVitalsAttribution: ['CLS', 'LCP'],
57
59
  webpackBuildWorker: true,
58
60
  webpackMemoryOptimizations: true,
61
+ ...config.experimental,
59
62
  },
60
63
  async headers() {
61
64
  const securityHeaders = [
@@ -325,20 +328,20 @@ export function defineConfig(config: CustomNextConfig) {
325
328
  ignoreBuildErrors: true,
326
329
  },
327
330
 
328
- webpack(config) {
329
- config.experiments = {
331
+ webpack(baseWebpackConfig, options) {
332
+ baseWebpackConfig.experiments = {
330
333
  asyncWebAssembly: true,
331
334
  layers: true,
332
335
  };
333
336
 
334
337
  // 开启该插件会导致 pglite 的 fs bundler 被改表
335
338
  if (enableReactScan) {
336
- config.plugins.push(ReactComponentName({}));
339
+ baseWebpackConfig.plugins.push(ReactComponentName({}));
337
340
  }
338
341
 
339
342
  // to fix shikiji compile error
340
343
  // refs: https://github.com/antfu/shikiji/issues/23
341
- config.module.rules.push({
344
+ baseWebpackConfig.module.rules.push({
342
345
  resolve: {
343
346
  fullySpecified: false,
344
347
  },
@@ -347,14 +350,14 @@ export function defineConfig(config: CustomNextConfig) {
347
350
  });
348
351
 
349
352
  // https://github.com/pinojs/pino/issues/688#issuecomment-637763276
350
- config.externals.push('pino-pretty');
353
+ baseWebpackConfig.externals.push('pino-pretty');
351
354
 
352
- config.resolve.alias.canvas = false;
355
+ baseWebpackConfig.resolve.alias.canvas = false;
353
356
 
354
357
  // to ignore epub2 compile error
355
358
  // refs: https://github.com/lobehub/lobe-chat/discussions/6769
356
- config.resolve.fallback = {
357
- ...config.resolve.fallback,
359
+ baseWebpackConfig.resolve.fallback = {
360
+ ...baseWebpackConfig.resolve.fallback,
358
361
  zipfile: false,
359
362
  };
360
363
 
@@ -364,7 +367,7 @@ export function defineConfig(config: CustomNextConfig) {
364
367
  ) {
365
368
  // fix the Worker URL cross-origin issue
366
369
  // refs: https://github.com/lobehub/lobe-chat/pull/9624
367
- config.module.rules.push({
370
+ baseWebpackConfig.module.rules.push({
368
371
  generator: {
369
372
  // @see https://webpack.js.org/configuration/module/#rulegeneratorpublicpath
370
373
  publicPath: '/_next/',
@@ -375,7 +378,13 @@ export function defineConfig(config: CustomNextConfig) {
375
378
  });
376
379
  }
377
380
 
378
- return config;
381
+ const updatedConfig = baseWebpackConfig;
382
+
383
+ if (config.webpack) {
384
+ return config.webpack(updatedConfig, options);
385
+ }
386
+
387
+ return updatedConfig;
379
388
  },
380
389
  };
381
390
 
@@ -12,7 +12,6 @@ import { LOBE_THEME_APPEARANCE } from '@/const/theme';
12
12
  import { isDesktop } from '@/const/version';
13
13
  import { appEnv } from '@/envs/app';
14
14
  import { authEnv } from '@/envs/auth';
15
- import { oidcEnv } from '@/envs/oidc';
16
15
  import NextAuth from '@/libs/next-auth';
17
16
  import { type Locales } from '@/locales/resources';
18
17
  import { parseBrowserLanguage } from '@/utils/locale';
@@ -236,7 +235,7 @@ export function defineConfig() {
236
235
  response.headers.set(OAUTH_AUTHORIZED, 'true');
237
236
 
238
237
  // If OIDC is enabled and user is logged in, add OIDC session pre-sync header
239
- if (oidcEnv.ENABLE_OIDC && session?.user?.id) {
238
+ if (authEnv.ENABLE_OIDC && session?.user?.id) {
240
239
  logNextAuth('OIDC session pre-sync: Setting %s = %s', OIDC_SESSION_HEADER, session.user.id);
241
240
  response.headers.set(OIDC_SESSION_HEADER, session.user.id);
242
241
  }
@@ -285,10 +284,10 @@ export function defineConfig() {
285
284
  });
286
285
 
287
286
  // If OIDC is enabled and Clerk user is logged in, add OIDC session pre-sync header
288
- if (oidcEnv.ENABLE_OIDC && data.userId) {
287
+ if (authEnv.ENABLE_OIDC && data.userId) {
289
288
  logClerk('OIDC session pre-sync: Setting %s = %s', OIDC_SESSION_HEADER, data.userId);
290
289
  response.headers.set(OIDC_SESSION_HEADER, data.userId);
291
- } else if (oidcEnv.ENABLE_OIDC) {
290
+ } else if (authEnv.ENABLE_OIDC) {
292
291
  logClerk('No Clerk user detected, not setting OIDC session sync header');
293
292
  }
294
293
 
@@ -351,7 +350,7 @@ export function defineConfig() {
351
350
  enableBetterAuth: authEnv.NEXT_PUBLIC_ENABLE_BETTER_AUTH,
352
351
  enableClerk: authEnv.NEXT_PUBLIC_ENABLE_CLERK_AUTH,
353
352
  enableNextAuth: authEnv.NEXT_PUBLIC_ENABLE_NEXT_AUTH,
354
- enableOIDC: oidcEnv.ENABLE_OIDC,
353
+ enableOIDC: authEnv.ENABLE_OIDC,
355
354
  });
356
355
 
357
356
  return {
@@ -1,17 +1,17 @@
1
- import { type ClientSecretPayload } from '@lobechat/types';
2
- import { parse } from 'cookie';
3
- import debug from 'debug';
4
- import { type User } from 'next-auth';
5
- import { type NextRequest } from 'next/server';
6
-
7
1
  import {
8
2
  LOBE_CHAT_AUTH_HEADER,
9
3
  LOBE_CHAT_OIDC_AUTH_HEADER,
10
4
  enableBetterAuth,
11
5
  enableClerk,
12
6
  enableNextAuth,
13
- } from '@/const/auth';
14
- import { oidcEnv } from '@/envs/oidc';
7
+ } from '@lobechat/const';
8
+ import { type ClientSecretPayload } from '@lobechat/types';
9
+ import { parse } from 'cookie';
10
+ import debug from 'debug';
11
+ import { type User } from 'next-auth';
12
+ import { type NextRequest } from 'next/server';
13
+
14
+ import { authEnv } from '@/envs/auth';
15
15
  import { ClerkAuth, type IClerkAuth } from '@/libs/clerk-auth';
16
16
  import { validateOIDCJWT } from '@/libs/oidc-provider/jwt';
17
17
 
@@ -129,11 +129,9 @@ export const createLambdaContext = async (request: NextRequest): Promise<LambdaC
129
129
  let oidcAuth = null;
130
130
 
131
131
  // Prioritize checking for OIDC authentication (both standard Authorization and custom Oidc-Auth headers)
132
- if (oidcEnv.ENABLE_OIDC) {
132
+ if (authEnv.ENABLE_OIDC) {
133
133
  log('OIDC enabled, attempting OIDC authentication');
134
- const standardAuthorization = request.headers.get('Authorization');
135
134
  const oidcAuthToken = request.headers.get(LOBE_CHAT_OIDC_AUTH_HEADER);
136
- log('Standard Authorization header: %s', standardAuthorization ? 'exists' : 'not found');
137
135
  log('Oidc-Auth header: %s', oidcAuthToken ? 'exists' : 'not found');
138
136
 
139
137
  try {
@@ -1,5 +1,5 @@
1
1
  import { getDBInstance } from '@/database/core/web-server';
2
- import { oidcEnv } from '@/envs/oidc';
2
+ import { authEnv } from '@/envs/auth';
3
3
  import { type OIDCProvider, createOIDCProvider } from '@/libs/oidc-provider/provider';
4
4
 
5
5
  /**
@@ -13,7 +13,7 @@ let provider: OIDCProvider;
13
13
  */
14
14
  export const getOIDCProvider = async (): Promise<OIDCProvider> => {
15
15
  if (!provider) {
16
- if (!oidcEnv.ENABLE_OIDC) {
16
+ if (!authEnv.ENABLE_OIDC) {
17
17
  throw new Error('OIDC is not enabled. Set ENABLE_OIDC=1 to enable it.');
18
18
  }
19
19