@lobehub/chat 1.82.6 → 1.82.8

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,66 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.82.8](https://github.com/lobehub/lobe-chat/compare/v1.82.7...v1.82.8)
6
+
7
+ <sup>Released on **2025-04-26**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Improve categories selection via SearXNG.
12
+
13
+ #### 🐛 Bug Fixes
14
+
15
+ - **http-adapter**: Extract protocol from base URL and add headers.
16
+ - **misc**: Fix oidc redirect urls.
17
+
18
+ <br/>
19
+
20
+ <details>
21
+ <summary><kbd>Improvements and Fixes</kbd></summary>
22
+
23
+ #### Code refactoring
24
+
25
+ - **misc**: Improve categories selection via SearXNG, closes [#7550](https://github.com/lobehub/lobe-chat/issues/7550) ([ac0dcd9](https://github.com/lobehub/lobe-chat/commit/ac0dcd9))
26
+
27
+ #### What's fixed
28
+
29
+ - **http-adapter**: Extract protocol from base URL and add headers, closes [#7545](https://github.com/lobehub/lobe-chat/issues/7545) ([327fd9e](https://github.com/lobehub/lobe-chat/commit/327fd9e))
30
+ - **misc**: Fix oidc redirect urls, closes [#7558](https://github.com/lobehub/lobe-chat/issues/7558) ([3013a00](https://github.com/lobehub/lobe-chat/commit/3013a00))
31
+
32
+ </details>
33
+
34
+ <div align="right">
35
+
36
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
37
+
38
+ </div>
39
+
40
+ ### [Version 1.82.7](https://github.com/lobehub/lobe-chat/compare/v1.82.6...v1.82.7)
41
+
42
+ <sup>Released on **2025-04-25**</sup>
43
+
44
+ #### 🐛 Bug Fixes
45
+
46
+ - **misc**: Pwa-install cause mobile infinity scroll.
47
+
48
+ <br/>
49
+
50
+ <details>
51
+ <summary><kbd>Improvements and Fixes</kbd></summary>
52
+
53
+ #### What's fixed
54
+
55
+ - **misc**: Pwa-install cause mobile infinity scroll, closes [#7521](https://github.com/lobehub/lobe-chat/issues/7521) [#7408](https://github.com/lobehub/lobe-chat/issues/7408) ([39f5bc7](https://github.com/lobehub/lobe-chat/commit/39f5bc7))
56
+
57
+ </details>
58
+
59
+ <div align="right">
60
+
61
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
62
+
63
+ </div>
64
+
5
65
  ### [Version 1.82.6](https://github.com/lobehub/lobe-chat/compare/v1.82.5...v1.82.6)
6
66
 
7
67
  <sup>Released on **2025-04-24**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,25 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Improve categories selection via SearXNG."
6
+ ],
7
+ "fixes": [
8
+ "Fix oidc redirect urls."
9
+ ]
10
+ },
11
+ "date": "2025-04-26",
12
+ "version": "1.82.8"
13
+ },
14
+ {
15
+ "children": {
16
+ "fixes": [
17
+ "Pwa-install cause mobile infinity scroll."
18
+ ]
19
+ },
20
+ "date": "2025-04-25",
21
+ "version": "1.82.7"
22
+ },
2
23
  {
3
24
  "children": {
4
25
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.82.6",
3
+ "version": "1.82.8",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot 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",
@@ -1,9 +1,12 @@
1
1
  'use client';
2
2
 
3
3
  import dynamic from 'next/dynamic';
4
- import { memo } from 'react';
4
+ import { pwaInstallHandler } from 'pwa-install-handler';
5
+ import { memo, useEffect, useState } from 'react';
5
6
 
6
7
  import { usePlatform } from '@/hooks/usePlatform';
8
+ import { useGlobalStore } from '@/store/global';
9
+ import { systemStatusSelectors } from '@/store/global/selectors';
7
10
  import { useUserStore } from '@/store/user';
8
11
 
9
12
  const Install: any = dynamic(() => import('./Install'), {
@@ -13,8 +16,28 @@ const Install: any = dynamic(() => import('./Install'), {
13
16
  const PWAInstall = memo(() => {
14
17
  const { isPWA, isSupportInstallPWA } = usePlatform();
15
18
  const isShowPWAGuide = useUserStore((s) => s.isShowPWAGuide);
19
+ const hidePWAInstaller = useGlobalStore((s) => systemStatusSelectors.hidePWAInstaller(s));
20
+ const [canInstallFromPWAInstallHandler, setCanInstallFromPWAInstallHandler] = useState<
21
+ boolean | undefined
22
+ >();
16
23
 
17
- if (isPWA || !isShowPWAGuide || !isSupportInstallPWA) return null;
24
+ useEffect(() => {
25
+ pwaInstallHandler.addListener((canInstall) => {
26
+ setCanInstallFromPWAInstallHandler(canInstall);
27
+ });
28
+ return () => {
29
+ pwaInstallHandler.removeListener(setCanInstallFromPWAInstallHandler);
30
+ };
31
+ }, []);
32
+
33
+ if (
34
+ isPWA ||
35
+ !isShowPWAGuide ||
36
+ !isSupportInstallPWA ||
37
+ hidePWAInstaller ||
38
+ canInstallFromPWAInstallHandler === false
39
+ )
40
+ return null;
18
41
 
19
42
  // only when the user is suitable for the pwa install and not install the pwa
20
43
  // then show the installation guide
@@ -14,9 +14,17 @@ export const defaultClients: ClientMetadata[] = [
14
14
  logo_uri: 'https://hub-apac-1.lobeobjects.space/lobehub-desktop-icon.png',
15
15
 
16
16
  // 桌面端注册的自定义协议回调(使用反向域名格式)
17
- post_logout_redirect_uris: ['com.lobehub.desktop://auth/logout/callback'],
18
-
19
- redirect_uris: ['com.lobehub.desktop://auth/callback', 'https://oauthdebugger.com/debug'],
17
+ post_logout_redirect_uris: [
18
+ 'com.lobehub.lobehub-desktop-dev://auth/logout/callback',
19
+ 'com.lobehub.lobehub-desktop-nightly://auth/logout/callback',
20
+ 'com.lobehub.lobehub-desktop://auth/logout/callback',
21
+ ],
22
+
23
+ redirect_uris: [
24
+ 'com.lobehub.lobehub-desktop-dev://auth/callback',
25
+ 'com.lobehub.lobehub-desktop-nightly://auth/callback',
26
+ 'com.lobehub.lobehub-desktop://auth/logout/callback',
27
+ ],
20
28
 
21
29
  // 支持授权码获取令牌和刷新令牌
22
30
  response_types: ['code'],
@@ -235,8 +235,10 @@ export const createContextForInteractionDetails = async (
235
235
  const baseUrl = appEnv.APP_URL!;
236
236
  log('Using base URL: %s', baseUrl);
237
237
 
238
- // 从baseUrl提取主机名用于headers
239
- const hostName = new URL(baseUrl).host;
238
+ // 从baseUrl提取主机名和协议用于headers
239
+ const parsedUrl = new URL(baseUrl);
240
+ const hostName = parsedUrl.host;
241
+ const protocol = parsedUrl.protocol.replace(':', '');
240
242
 
241
243
  // 1. 获取真实的 Cookies
242
244
  const cookieStore = await cookies();
@@ -255,7 +257,11 @@ export const createContextForInteractionDetails = async (
255
257
  }
256
258
 
257
259
  // 2. 构建包含真实 Cookie 的 Headers
258
- const headers = new Headers({ host: hostName });
260
+ const headers = new Headers({
261
+ 'host': hostName,
262
+ 'x-forwarded-host': hostName,
263
+ 'x-forwarded-proto': protocol,
264
+ });
259
265
  const cookieString = Object.entries(realCookies)
260
266
  .map(([name, value]) => `${name}=${value}`)
261
267
  .join('; ');
@@ -26,15 +26,10 @@ export const WebBrowsingManifest: BuiltinToolManifest = {
26
26
  description: 'The search categories you can set:',
27
27
  items: {
28
28
  enum: [
29
- 'files',
30
29
  'general',
31
30
  'images',
32
- 'it',
33
- 'map',
34
- 'music',
35
31
  'news',
36
32
  'science',
37
- 'social_media',
38
33
  'videos',
39
34
  ],
40
35
  type: 'string',
@@ -27,12 +27,8 @@ Choose search categories based on query type:
27
27
  - General: general
28
28
  - News: news
29
29
  - Academic & Science: science
30
- - Technical: it
31
30
  - Images: images
32
31
  - Videos: videos
33
- - Geographic & Maps: map
34
- - Files: files
35
- - Social Media: social_media
36
32
  </search_categories_selection>
37
33
 
38
34
  <search_engine_selection>
@@ -60,33 +56,6 @@ Choose time range based on the query type:
60
56
  - Leverage cross-platform meta-search capabilities for comprehensive results, but prioritize fetching results from a few highly relevant and authoritative sources rather than exhaustively querying many engines/categories. Aim for quality over quantity.
61
57
  - Prioritize authoritative sources in search results when available.
62
58
  - Avoid using overly broad category/engine combinations unless necessary.
63
-
64
- <search_strategy_best_practices>
65
- - Combine categories for multi-faceted queries:
66
- * "AI ethics whitepaper PDF" → files + science + general
67
- * "Python machine learning tutorial video" → videos + it + science
68
- * "Sustainable energy policy analysis" → news + science + general
69
-
70
- - Apply keyword-driven category mapping:
71
- * "GitHub repository statistics" → it + files
72
- * "Climate change documentary" → videos + science
73
- * "Restaurant recommendations Paris" → map + social_media
74
-
75
- - Use file-type targeting for document searches:
76
- * "Financial statement xls" → files + news
77
- * "Research paper citation RIS" → files + science
78
- * "Government policy brief docx" → files + general
79
-
80
- - Region-specific query handling:
81
- * "Beijing traffic update" → map + news (consider engine: baidu)
82
- * "Moscow event listings" → social_media + news (consider engine: yandex)
83
- * "Tokyo restaurant reviews" → social_media + map (consider engine: google)
84
-
85
- - Leverage cross-platform capabilities:
86
- * "Open-source project documentation" → files + it (engines: github + pypi)
87
- * "Historical weather patterns" → science + general (engines: google_scholar + wikipedia)
88
- * "Movie release dates 2025" → news + videos (engines: imdb + reddit)
89
- </search_strategy_best_practices>
90
59
  </search_strategy_guidelines>
91
60
 
92
61
  <citation_requirements>
@@ -95,19 +64,19 @@ Choose time range based on the query type:
95
64
  - Clearly distinguish between quoted information and your own analysis
96
65
  - Respond in the same language as the user's query
97
66
 
98
- <citation_examples>
99
- <example>
100
- According to recent studies, global temperatures have risen by 1.1°C since pre-industrial times[^1].
67
+ <citation_examples>
68
+ <example>
69
+ According to recent studies, global temperatures have risen by 1.1°C since pre-industrial times[^1].
101
70
 
102
- [^1]: [Climate Report in 2023](https://example.org/climate-report-2023)
103
- </example>
104
- <example>
105
- 以上信息主要基于业内测评和公开发布会(例如2025年4月16日的发布内容)的报道,详细介绍了 O3 与 O4-mini 模型在多模态推理、工具使用、模拟推理和成本效益等方面的综合提升。[^1][^2]
71
+ [^1]: [Climate Report in 2023](https://example.org/climate-report-2023)
72
+ </example>
73
+ <example>
74
+ 以上信息主要基于业内测评和公开发布会(例如2025年4月16日的发布内容)的报道,详细介绍了 O3 与 O4-mini 模型在多模态推理、工具使用、模拟推理和成本效益等方面的综合提升。[^1][^2]
106
75
 
107
- [^1]: [OpenAI发布o3与o4-mini,性能爆表,可用图像思考](https://zhuanlan.zhihu.com/p/1896105931709849860)
108
- [^2]: [OpenAI发新模型o3和o4-mini!首次实现"图像思维"(华尔街见闻)](https://wallstreetcn.com/articles/3745356)
109
- </example>
110
- </citation_examples>
76
+ [^1]: [OpenAI发布o3与o4-mini,性能爆表,可用图像思考](https://zhuanlan.zhihu.com/p/1896105931709849860)
77
+ [^2]: [OpenAI发新模型o3和o4-mini!首次实现"图像思维"(华尔街见闻)](https://wallstreetcn.com/articles/3745356)
78
+ </example>
79
+ </citation_examples>
111
80
  </citation_requirements>
112
81
 
113
82
  <response_format>