@lobehub/chat 1.77.6 → 1.77.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.
Files changed (47) hide show
  1. package/.github/scripts/pr-comment.js +80 -0
  2. package/.github/scripts/pr-release-body.js +59 -0
  3. package/.github/workflows/release-desktop.yml +331 -0
  4. package/.github/workflows/test.yml +1 -1
  5. package/CHANGELOG.md +58 -0
  6. package/changelog/v1.json +21 -0
  7. package/next.config.ts +16 -11
  8. package/package.json +92 -89
  9. package/packages/electron-client-ipc/README.md +48 -0
  10. package/packages/electron-client-ipc/package.json +7 -0
  11. package/packages/electron-client-ipc/src/events/devtools.ts +6 -0
  12. package/packages/electron-client-ipc/src/events/index.ts +13 -0
  13. package/packages/electron-client-ipc/src/index.ts +2 -0
  14. package/packages/electron-client-ipc/src/types/dispatch.ts +10 -0
  15. package/packages/electron-client-ipc/src/types/index.ts +1 -0
  16. package/packages/electron-server-ipc/README.md +1 -1
  17. package/packages/web-crawler/src/crawImpl/search1api.ts +20 -17
  18. package/pnpm-workspace.yaml +1 -0
  19. package/scripts/setup-test-postgres-db.sh +21 -0
  20. package/src/app/desktop/devtools/page.tsx +89 -0
  21. package/src/app/desktop/layout.tsx +31 -0
  22. package/src/app/layout.tsx +11 -0
  23. package/src/app/not-found.tsx +1 -0
  24. package/src/const/desktop.ts +1 -0
  25. package/src/const/version.ts +2 -0
  26. package/src/database/client/db.ts +3 -10
  27. package/src/database/models/__tests__/message.test.ts +97 -26
  28. package/src/database/models/__tests__/session.test.ts +2 -0
  29. package/src/database/models/drizzleMigration.ts +15 -0
  30. package/src/database/models/message.ts +10 -5
  31. package/src/database/models/user.ts +3 -0
  32. package/src/features/ChatInput/ActionBar/Token/TokenTag.tsx +13 -3
  33. package/src/features/DevPanel/features/FloatPanel.tsx +23 -6
  34. package/src/features/User/UserPanel/index.tsx +10 -6
  35. package/src/libs/trpc/middleware/userAuth.ts +10 -0
  36. package/src/server/routers/tools/__tests__/search.test.ts +1 -0
  37. package/src/server/translation.test.ts +72 -52
  38. package/src/server/translation.ts +2 -11
  39. package/src/services/electron/devtools.ts +9 -0
  40. package/src/styles/electron.ts +14 -0
  41. package/src/tools/web-browsing/Portal/Search/ResultList/SearchItem/index.tsx +3 -8
  42. package/src/tools/web-browsing/Render/Search/SearchResult/ShowMore.tsx +2 -4
  43. package/src/types/electron.ts +11 -0
  44. package/src/utils/electron/dispatch.ts +10 -0
  45. package/tsconfig.json +6 -6
  46. package/vitest.config.ts +3 -1
  47. package/vitest.server.config.ts +7 -3
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Generate PR comment with download links for desktop builds
3
+ */
4
+ module.exports = async ({ github, context, releaseUrl, version, tag }) => {
5
+ try {
6
+ // Get release assets to create download links
7
+ const release = await github.rest.repos.getReleaseByTag({
8
+ owner: context.repo.owner,
9
+ repo: context.repo.repo,
10
+ tag,
11
+ });
12
+
13
+ // Organize assets by platform
14
+ const macAssets = release.data.assets.filter(
15
+ (asset) =>
16
+ asset.name.includes('.dmg') ||
17
+ (asset.name.includes('latest-mac') && asset.name.endsWith('.yml')),
18
+ );
19
+
20
+ const winAssets = release.data.assets.filter(
21
+ (asset) =>
22
+ asset.name.includes('.exe') ||
23
+ (asset.name.includes('latest-win') && asset.name.endsWith('.yml')),
24
+ );
25
+
26
+ const linuxAssets = release.data.assets.filter(
27
+ (asset) =>
28
+ asset.name.includes('.AppImage') ||
29
+ (asset.name.includes('latest-linux') && asset.name.endsWith('.yml')),
30
+ );
31
+
32
+ // Generate combined download table
33
+ let assetTable = '| Platform | File | Size |\n| --- | --- | --- |\n';
34
+
35
+ // Add macOS assets
36
+ macAssets.forEach((asset) => {
37
+ const sizeInMB = (asset.size / (1024 * 1024)).toFixed(2);
38
+ assetTable += `| macOS | [${asset.name}](${asset.browser_download_url}) | ${sizeInMB} MB |\n`;
39
+ });
40
+
41
+ // Add Windows assets
42
+ winAssets.forEach((asset) => {
43
+ const sizeInMB = (asset.size / (1024 * 1024)).toFixed(2);
44
+ assetTable += `| Windows | [${asset.name}](${asset.browser_download_url}) | ${sizeInMB} MB |\n`;
45
+ });
46
+
47
+ // Add Linux assets
48
+ linuxAssets.forEach((asset) => {
49
+ const sizeInMB = (asset.size / (1024 * 1024)).toFixed(2);
50
+ assetTable += `| Linux | [${asset.name}](${asset.browser_download_url}) | ${sizeInMB} MB |\n`;
51
+ });
52
+
53
+ return `### 🚀 Desktop App Build Completed!
54
+
55
+ **Version**: \`${version}\`
56
+
57
+ 📦 [View All Build Artifacts](${releaseUrl})
58
+
59
+
60
+ ## Build Artifacts
61
+
62
+ ${assetTable}
63
+
64
+ > [!Warning]
65
+ >
66
+ > Note: This is a temporary build for testing purposes only.`;
67
+ } catch (error) {
68
+ console.error('Error generating PR comment:', error);
69
+ // Fallback to a simple comment if error occurs
70
+ return `
71
+ ### 🚀 Desktop App Build Completed!
72
+
73
+ **Version**: \`${version}\`
74
+
75
+ ## 📦 [View All Build Artifacts](${releaseUrl})
76
+
77
+ > Note: This is a temporary build for testing purposes only.
78
+ `;
79
+ }
80
+ };
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Generate PR pre-release body content
3
+ * This script generates the description text for PR pre-releases
4
+ */
5
+ module.exports = ({ version, prNumber, branch }) => {
6
+ const prLink = `https://github.com/lobehub/lobe-chat/pull/${prNumber}`;
7
+
8
+ return `
9
+ ## PR Build Information
10
+
11
+ **Version**: \`${version}\`
12
+ **PR**: [#${prNumber}](${prLink})
13
+
14
+ ## ⚠️ Important Notice
15
+
16
+ This is a **development build** specifically created for testing purposes. Please note:
17
+
18
+ - This build is **NOT** intended for production use
19
+ - Features may be incomplete or unstable
20
+ - Use only for validating PR changes in a desktop environment
21
+ - May contain experimental code that hasn't been fully reviewed
22
+ - No guarantees are provided regarding stability or reliability
23
+
24
+ ### Intended Use
25
+
26
+ - Focused testing of specific PR changes
27
+ - Verification of desktop-specific behaviors
28
+ - UI/UX validation on desktop platforms
29
+ - Performance testing on target devices
30
+
31
+ Please report any issues found in this build directly in the PR discussion.
32
+
33
+ ---
34
+
35
+ ## PR 构建信息
36
+
37
+ **版本**: \`${version}\`
38
+ **PR**: [#${prNumber}](${prLink})
39
+
40
+ ## ⚠️ 重要提示
41
+
42
+ 这是专为测试目的创建的**开发构建版本**。请注意:
43
+
44
+ - 本构建**不适用于**生产环境
45
+ - 功能可能不完整或不稳定
46
+ - 仅用于在桌面环境中验证 PR 更改
47
+ - 可能包含尚未完全审核的实验性代码
48
+ - 不对稳定性或可靠性提供任何保证
49
+
50
+ ### 适用场景
51
+
52
+ - 针对性测试特定 PR 变更
53
+ - 验证桌面特定的行为表现
54
+ - 在桌面平台上进行 UI/UX 验证
55
+ - 在目标设备上进行性能测试
56
+
57
+ 如发现任何问题,请直接在 PR 讨论中报告。
58
+ `;
59
+ };
@@ -0,0 +1,331 @@
1
+ name: Release Desktop
2
+
3
+ on:
4
+ # uncomment when official desktop version released
5
+ # release:
6
+ # types: [published] # 发布 release 时触发构建
7
+ pull_request:
8
+ types: [synchronize, labeled, unlabeled] # PR 更新或标签变化时触发
9
+
10
+ # 确保同一时间只运行一个相同的 workflow,取消正在进行的旧的运行
11
+ concurrency:
12
+ group: ${{ github.ref }}-${{ github.workflow }}
13
+ cancel-in-progress: true
14
+
15
+ env:
16
+ PR_TAG_PREFIX: pr- # PR 构建版本的前缀标识
17
+
18
+ jobs:
19
+ test:
20
+ name: Code quality check
21
+ # 添加 PR label 触发条件,只有添加了 Build Desktop 标签的 PR 才会触发构建
22
+ if: |
23
+ (github.event_name == 'pull_request' &&
24
+ contains(github.event.pull_request.labels.*.name, 'Build Desktop')) ||
25
+ github.event_name != 'pull_request'
26
+ runs-on: ubuntu-latest # 只在 ubuntu 上运行一次检查
27
+ steps:
28
+ - name: Checkout base
29
+ uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 0
32
+
33
+ - name: Setup Node.js
34
+ uses: actions/setup-node@v4
35
+ with:
36
+ node-version: 22
37
+
38
+ - name: Setup pnpm
39
+ uses: pnpm/action-setup@v2
40
+ with:
41
+ version: 8
42
+
43
+ - name: Install deps
44
+ run: pnpm install
45
+ env:
46
+ NODE_OPTIONS: --max-old-space-size=6144
47
+
48
+ - name: Lint
49
+ run: pnpm run lint
50
+ env:
51
+ NODE_OPTIONS: --max-old-space-size=6144
52
+
53
+ # - name: Test
54
+ # run: pnpm run test
55
+
56
+ version:
57
+ name: Determine version
58
+ # 与 test job 相同的触发条件
59
+ if: |
60
+ (github.event_name == 'pull_request' &&
61
+ contains(github.event.pull_request.labels.*.name, 'Build Desktop')) ||
62
+ github.event_name != 'pull_request'
63
+ runs-on: ubuntu-latest
64
+ outputs:
65
+ # 输出版本信息,供后续 job 使用
66
+ version: ${{ steps.set_version.outputs.version }}
67
+ is_pr_build: ${{ steps.set_version.outputs.is_pr_build }}
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+ with:
71
+ fetch-depth: 0
72
+
73
+ - name: Setup Node.js
74
+ uses: actions/setup-node@v4
75
+ with:
76
+ node-version: 22
77
+
78
+ # 主要逻辑:确定构建版本号
79
+ - name: Set version
80
+ id: set_version
81
+ run: |
82
+ # 从 apps/desktop/package.json 读取基础版本号
83
+ base_version=$(node -p "require('./apps/desktop/package.json').version")
84
+
85
+ if [ "${{ github.event_name }}" == "pull_request" ]; then
86
+ # PR 构建:在基础版本号上添加 PR 信息
87
+ branch_name="${{ github.head_ref }}"
88
+ # 清理分支名,移除非法字符
89
+ sanitized_branch=$(echo "${branch_name}" | sed -E 's/[^a-zA-Z0-9_.-]+/-/g')
90
+ # 创建特殊的 PR 版本号:基础版本号-PR前缀-分支名-提交哈希
91
+ version="${base_version}-${{ env.PR_TAG_PREFIX }}${sanitized_branch}-$(git rev-parse --short HEAD)"
92
+ echo "version=${version}" >> $GITHUB_OUTPUT
93
+ echo "is_pr_build=true" >> $GITHUB_OUTPUT
94
+ echo "📦 Release Version: ${version} (based on base version ${base_version})"
95
+
96
+ elif [ "${{ github.event_name }}" == "release" ]; then
97
+ # Release 事件直接使用 release tag 作为版本号,去掉可能的 v 前缀
98
+ version="${{ github.event.release.tag_name }}"
99
+ version="${version#v}"
100
+ echo "version=${version}" >> $GITHUB_OUTPUT
101
+ echo "is_pr_build=false" >> $GITHUB_OUTPUT
102
+ echo "📦 Release Version: ${version}"
103
+
104
+ else
105
+ # 其他情况(如手动触发)使用 apps/desktop/package.json 的版本号
106
+ version="${base_version}"
107
+ echo "version=${version}" >> $GITHUB_OUTPUT
108
+ echo "is_pr_build=false" >> $GITHUB_OUTPUT
109
+ echo "📦 Release Version: ${version}"
110
+ fi
111
+ env:
112
+ NODE_OPTIONS: --max-old-space-size=6144
113
+
114
+ # 输出版本信息总结,方便在 GitHub Actions 界面查看
115
+ - name: Version Summary
116
+ run: |
117
+ echo "🚦 Release Version: ${{ steps.set_version.outputs.version }}"
118
+ echo "🔄 Is PR Build: ${{ steps.set_version.outputs.is_pr_build }}"
119
+
120
+ build:
121
+ needs: [version, test]
122
+ name: Build Desktop App
123
+ runs-on: ${{ matrix.os }}
124
+ strategy:
125
+ matrix:
126
+ os: [macos-latest, windows-latest, ubuntu-latest]
127
+ steps:
128
+ - uses: actions/checkout@v4
129
+ with:
130
+ fetch-depth: 0
131
+
132
+ - name: Setup Node.js
133
+ uses: actions/setup-node@v4
134
+ with:
135
+ node-version: 22
136
+
137
+ - name: Setup pnpm
138
+ uses: pnpm/action-setup@v2
139
+ with:
140
+ version: 8
141
+
142
+ - name: Install deps
143
+ run: pnpm install
144
+
145
+ - name: Install deps on Desktop
146
+ run: npm run install-isolated --prefix=./apps/desktop
147
+
148
+ # 设置 package.json 的版本号
149
+ - name: Set package version
150
+ run: npm run workflow:set-desktop-version ${{ needs.version.outputs.version }}
151
+
152
+ # macOS 构建处理
153
+ - name: Build artifact on macOS
154
+ if: runner.os == 'macOS'
155
+ run: npm run desktop:build
156
+ env:
157
+ APP_URL: http://localhost:3010
158
+ DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
159
+ # 默认添加一个加密 SECRET
160
+ KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
161
+ # 公证部分将来再加回
162
+ # CSC_LINK: ./build/developer-id-app-certs.p12
163
+ # CSC_KEY_PASSWORD: ${{ secrets.APPLE_APP_CERTS_PASSWORD }}
164
+ # APPLE_ID: ${{ secrets.APPLE_ID }}
165
+ # APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
166
+
167
+ # 非 macOS 平台构建处理
168
+ - name: Build artifact on other platforms
169
+ if: runner.os != 'macOS'
170
+ run: npm run desktop:build
171
+ env:
172
+ APP_URL: http://localhost:3010
173
+ DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
174
+ KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
175
+
176
+ # 上传构建产物,移除了 zip 相关部分
177
+ - name: Upload artifact
178
+ uses: actions/upload-artifact@v4
179
+ with:
180
+ name: release-${{ matrix.os }}
181
+ path: |
182
+ apps/desktop/release/latest*
183
+ apps/desktop/release/*.dmg*
184
+ apps/desktop/release/*.zip*
185
+ apps/desktop/release/*.exe*
186
+ apps/desktop/release/*.AppImage
187
+ retention-days: 5
188
+
189
+ - name: Log build info
190
+ run: |
191
+ echo "🔄 Is PR Build: ${{ needs.version.outputs.is_pr_build }}"
192
+
193
+ # 将原本的 merge job 调整,作为所有构建产物的准备步骤
194
+ prepare-artifacts:
195
+ needs: [build, version]
196
+ name: Prepare Artifacts
197
+ runs-on: ubuntu-latest
198
+ outputs:
199
+ artifact_path: ${{ steps.set_path.outputs.path }}
200
+ steps:
201
+ # 下载所有平台的构建产物
202
+ - name: Download artifacts
203
+ uses: actions/download-artifact@v4
204
+ with:
205
+ path: release
206
+ pattern: release-*
207
+ merge-multiple: true
208
+
209
+ # 列出所有构建产物
210
+ - name: List artifacts
211
+ run: ls -R release
212
+
213
+ # 设置构建产物路径,供后续 job 使用
214
+ - name: Set artifact path
215
+ id: set_path
216
+ run: echo "path=release" >> $GITHUB_OUTPUT
217
+
218
+ # 正式版发布 job - 只处理 release 触发的场景
219
+ publish-release:
220
+ # 只在 release 事件触发且不是 PR 构建时执行
221
+ if: |
222
+ github.event_name == 'release' &&
223
+ needs.version.outputs.is_pr_build != 'true'
224
+ needs: [prepare-artifacts, version]
225
+ name: Publish Release
226
+ runs-on: ubuntu-latest
227
+ steps:
228
+ - uses: actions/checkout@v4
229
+ with:
230
+ fetch-depth: 0
231
+
232
+ # 下载构建产物
233
+ - name: Download artifacts
234
+ uses: actions/download-artifact@v4
235
+ with:
236
+ path: ${{ needs.prepare-artifacts.outputs.artifact_path }}
237
+ pattern: release-*
238
+ merge-multiple: true
239
+
240
+ # 将构建产物上传到现有 release
241
+ - name: Upload to Release
242
+ uses: softprops/action-gh-release@v1
243
+ with:
244
+ tag_name: ${{ github.event.release.tag_name }}
245
+ files: |
246
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/latest*
247
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/*.dmg*
248
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/*.zip*
249
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/*.exe*
250
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/*.AppImage
251
+ env:
252
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
253
+
254
+ # PR 构建的处理步骤
255
+ publish-pr:
256
+ if: needs.version.outputs.is_pr_build == 'true'
257
+ needs: [prepare-artifacts, version]
258
+ name: Publish PR Build
259
+ runs-on: ubuntu-latest
260
+ steps:
261
+ - uses: actions/checkout@v4
262
+ with:
263
+ fetch-depth: 0
264
+
265
+ # 下载构建产物
266
+ - name: Download artifacts
267
+ uses: actions/download-artifact@v4
268
+ with:
269
+ path: ${{ needs.prepare-artifacts.outputs.artifact_path }}
270
+ pattern: release-*
271
+ merge-multiple: true
272
+
273
+ # 生成PR发布描述
274
+ - name: Generate PR Release Body
275
+ id: pr_release_body
276
+ uses: actions/github-script@v7
277
+ with:
278
+ result-encoding: string
279
+ script: |
280
+ const generateReleaseBody = require('${{ github.workspace }}/.github/scripts/pr-release-body.js');
281
+
282
+ const body = generateReleaseBody({
283
+ version: "${{ needs.version.outputs.version }}",
284
+ prNumber: "${{ github.event.pull_request.number }}",
285
+ branch: "${{ github.head_ref }}"
286
+ });
287
+
288
+ return body;
289
+
290
+ # 为构建产物创建一个临时发布
291
+ - name: Create Temporary Release for PR
292
+ id: create_release
293
+ uses: softprops/action-gh-release@v1
294
+ with:
295
+ name: PR Build v${{ needs.version.outputs.version }}
296
+ tag_name: pr-build-${{ github.event.pull_request.number }}-${{ github.sha }}
297
+ body: ${{ steps.pr_release_body.outputs.result }}
298
+ draft: false
299
+ prerelease: true
300
+ files: |
301
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/latest*
302
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/*.dmg*
303
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/*.zip*
304
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/*.exe*
305
+ ${{ needs.prepare-artifacts.outputs.artifact_path }}/*.AppImage
306
+ env:
307
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
308
+
309
+ # 在 PR 上添加评论,包含构建信息和下载链接
310
+ - name: Comment on PR
311
+ uses: actions/github-script@v7
312
+ with:
313
+ github-token: ${{ secrets.GITHUB_TOKEN }}
314
+ script: |
315
+ const releaseUrl = "${{ steps.create_release.outputs.url }}";
316
+ const prCommentGenerator = require('${{ github.workspace }}/.github/scripts/pr-comment.js');
317
+
318
+ const body = await prCommentGenerator({
319
+ github,
320
+ context,
321
+ releaseUrl,
322
+ version: "${{ needs.version.outputs.version }}",
323
+ tag: "pr-build-${{ github.event.pull_request.number }}-${{ github.sha }}"
324
+ });
325
+
326
+ github.rest.issues.createComment({
327
+ issue_number: context.issue.number,
328
+ owner: context.repo.owner,
329
+ repo: context.repo.repo,
330
+ body: body
331
+ });
@@ -8,7 +8,7 @@ jobs:
8
8
 
9
9
  services:
10
10
  postgres:
11
- image: pgvector/pgvector:pg16
11
+ image: paradedb/paradedb:latest
12
12
  env:
13
13
  POSTGRES_PASSWORD: postgres
14
14
  options: >-
package/CHANGELOG.md CHANGED
@@ -2,6 +2,64 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.77.8](https://github.com/lobehub/lobe-chat/compare/v1.77.7...v1.77.8)
6
+
7
+ <sup>Released on **2025-04-03**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Add `SEARCH1API_CRAWL_API_KEY` env.
12
+
13
+ #### 💄 Styles
14
+
15
+ - **misc**: Auto refresh TokenTag count.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### What's fixed
23
+
24
+ - **misc**: Add `SEARCH1API_CRAWL_API_KEY` env, closes [#7270](https://github.com/lobehub/lobe-chat/issues/7270) ([85e8ff1](https://github.com/lobehub/lobe-chat/commit/85e8ff1))
25
+
26
+ #### Styles
27
+
28
+ - **misc**: Auto refresh TokenTag count, closes [#7011](https://github.com/lobehub/lobe-chat/issues/7011) ([9d62451](https://github.com/lobehub/lobe-chat/commit/9d62451))
29
+
30
+ </details>
31
+
32
+ <div align="right">
33
+
34
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
35
+
36
+ </div>
37
+
38
+ ### [Version 1.77.7](https://github.com/lobehub/lobe-chat/compare/v1.77.6...v1.77.7)
39
+
40
+ <sup>Released on **2025-04-03**</sup>
41
+
42
+ #### ♻ Code Refactoring
43
+
44
+ - **misc**: Add desktop-release workflow and improve code.
45
+
46
+ <br/>
47
+
48
+ <details>
49
+ <summary><kbd>Improvements and Fixes</kbd></summary>
50
+
51
+ #### Code refactoring
52
+
53
+ - **misc**: Add desktop-release workflow and improve code, closes [#7265](https://github.com/lobehub/lobe-chat/issues/7265) ([773d5dd](https://github.com/lobehub/lobe-chat/commit/773d5dd))
54
+
55
+ </details>
56
+
57
+ <div align="right">
58
+
59
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
60
+
61
+ </div>
62
+
5
63
  ### [Version 1.77.6](https://github.com/lobehub/lobe-chat/compare/v1.77.5...v1.77.6)
6
64
 
7
65
  <sup>Released on **2025-04-01**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,25 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Add SEARCH1API_CRAWL_API_KEY env."
6
+ ],
7
+ "improvements": [
8
+ "Auto refresh TokenTag count."
9
+ ]
10
+ },
11
+ "date": "2025-04-03",
12
+ "version": "1.77.8"
13
+ },
14
+ {
15
+ "children": {
16
+ "improvements": [
17
+ "Add desktop-release workflow and improve code."
18
+ ]
19
+ },
20
+ "date": "2025-04-03",
21
+ "version": "1.77.7"
22
+ },
2
23
  {
3
24
  "children": {
4
25
  "improvements": [
package/next.config.ts CHANGED
@@ -6,14 +6,22 @@ import ReactComponentName from 'react-scan/react-component-name/webpack';
6
6
 
7
7
  const isProd = process.env.NODE_ENV === 'production';
8
8
  const buildWithDocker = process.env.DOCKER === 'true';
9
+ const isDesktop = process.env.NEXT_PUBLIC_IS_DESKTOP_APP === '1';
9
10
  const enableReactScan = !!process.env.REACT_SCAN_MONITOR_API_KEY;
10
11
  const isUsePglite = process.env.NEXT_PUBLIC_CLIENT_DB === 'pglite';
11
12
 
12
13
  // if you need to proxy the api endpoint to remote server
13
14
 
14
15
  const basePath = process.env.NEXT_PUBLIC_BASE_PATH;
16
+ const isStandaloneMode = buildWithDocker || isDesktop;
17
+
18
+ const standaloneConfig: NextConfig = {
19
+ output: 'standalone',
20
+ outputFileTracingIncludes: { '*': ['public/**/*', '.next/static/**/*'] },
21
+ };
15
22
 
16
23
  const nextConfig: NextConfig = {
24
+ ...(isStandaloneMode ? standaloneConfig : {}),
17
25
  basePath,
18
26
  compress: isProd,
19
27
  experimental: {
@@ -110,10 +118,6 @@ const nextConfig: NextConfig = {
110
118
  hmrRefreshes: true,
111
119
  },
112
120
  },
113
- output: buildWithDocker ? 'standalone' : undefined,
114
- outputFileTracingIncludes: buildWithDocker
115
- ? { '*': ['public/**/*', '.next/static/**/*'] }
116
- : undefined,
117
121
  reactStrictMode: true,
118
122
  redirects: async () => [
119
123
  {
@@ -231,13 +235,14 @@ const noWrapper = (config: NextConfig) => config;
231
235
 
232
236
  const withBundleAnalyzer = process.env.ANALYZE === 'true' ? analyzer() : noWrapper;
233
237
 
234
- const withPWA = isProd
235
- ? withSerwistInit({
236
- register: false,
237
- swDest: 'public/sw.js',
238
- swSrc: 'src/app/sw.ts',
239
- })
240
- : noWrapper;
238
+ const withPWA =
239
+ isProd && !isDesktop
240
+ ? withSerwistInit({
241
+ register: false,
242
+ swDest: 'public/sw.js',
243
+ swSrc: 'src/app/sw.ts',
244
+ })
245
+ : noWrapper;
241
246
 
242
247
  const hasSentry = !!process.env.NEXT_PUBLIC_SENTRY_DSN;
243
248
  const withSentry =