@lobehub/chat 1.103.1 → 1.103.2
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 +35 -0
- package/apps/desktop/build/icon-beta.ico +0 -0
- package/apps/desktop/build/icon-dev.ico +0 -0
- package/apps/desktop/build/icon-nightly.ico +0 -0
- package/apps/desktop/build/icon.ico +0 -0
- package/apps/desktop/electron.vite.config.ts +4 -2
- package/apps/desktop/package.json +1 -0
- package/apps/desktop/src/main/appBrowsers.ts +2 -2
- package/apps/desktop/src/main/const/env.ts +5 -4
- package/apps/desktop/src/main/const/store.ts +1 -0
- package/apps/desktop/src/main/const/theme.ts +11 -0
- package/apps/desktop/src/main/controllers/BrowserWindowsCtr.ts +1 -1
- package/apps/desktop/src/main/controllers/NotificationCtr.ts +2 -4
- package/apps/desktop/src/main/controllers/SystemCtr.ts +4 -0
- package/apps/desktop/src/main/controllers/TrayMenuCtr.ts +5 -5
- package/apps/desktop/src/main/controllers/index.ts +1 -1
- package/apps/desktop/src/main/core/App.ts +9 -10
- package/apps/desktop/src/main/core/{Browser.ts → browser/Browser.ts} +129 -88
- package/apps/desktop/src/main/core/{BrowserManager.ts → browser/BrowserManager.ts} +13 -3
- package/apps/desktop/src/main/core/{StaticFileServerManager.ts → infrastructure/StaticFileServerManager.ts} +13 -7
- package/apps/desktop/src/main/core/{StoreManager.ts → infrastructure/StoreManager.ts} +1 -1
- package/apps/desktop/src/main/core/{UpdaterManager.ts → infrastructure/UpdaterManager.ts} +1 -1
- package/apps/desktop/src/main/core/{MenuManager.ts → ui/MenuManager.ts} +2 -2
- package/apps/desktop/src/main/core/{ShortcutManager.ts → ui/ShortcutManager.ts} +7 -1
- package/apps/desktop/src/main/core/{Tray.ts → ui/Tray.ts} +61 -59
- package/apps/desktop/src/main/core/{TrayManager.ts → ui/TrayManager.ts} +5 -5
- package/apps/desktop/src/main/shortcuts/config.ts +2 -2
- package/apps/desktop/src/main/types/store.ts +1 -0
- package/changelog/v1.json +12 -0
- package/docs/development/basic/add-new-image-model.mdx +162 -0
- package/docs/development/basic/add-new-image-model.zh-CN.mdx +162 -0
- package/docs/usage/providers/fal.mdx +1 -1
- package/docs/usage/providers/fal.zh-CN.mdx +1 -1
- package/package.json +66 -66
- package/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/Portal.tsx +3 -1
- package/src/app/[variants]/(main)/chat/(workspace)/features/AgentSettings/index.tsx +4 -2
- package/src/app/[variants]/(main)/image/@menu/components/SeedNumberInput/index.tsx +1 -1
- package/src/app/[variants]/(main)/image/features/GenerationFeed/BatchItem.tsx +39 -3
- package/src/app/[variants]/(main)/image/features/GenerationFeed/ReferenceImages.tsx +122 -0
- package/src/config/aiModels/fal.ts +31 -7
- package/src/config/aiModels/openai.ts +10 -1
- package/src/features/ElectronTitlebar/WinControl/index.tsx +85 -90
- package/src/features/ElectronTitlebar/hooks/useWatchThemeUpdate.ts +10 -5
- package/src/features/ImageTopicPanel/index.tsx +0 -1
- package/src/features/PluginDevModal/index.tsx +3 -1
- package/src/features/User/__tests__/UserAvatar.test.tsx +5 -4
- package/src/libs/model-runtime/fal/index.ts +1 -1
- package/src/libs/model-runtime/types/image.ts +1 -1
- package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.ts +1 -1
- package/src/libs/model-runtime/utils/response.ts +2 -0
- package/src/libs/model-runtime/utils/streams/google-ai.test.ts +46 -0
- package/src/libs/model-runtime/utils/streams/google-ai.ts +4 -4
- package/src/libs/model-runtime/utils/streams/vertex-ai.ts +6 -8
- package/src/libs/standard-parameters/{meta-schema.test.ts → index.test.ts} +1 -1
- package/src/libs/standard-parameters/index.ts +152 -1
- package/src/server/ld.test.ts +4 -3
- package/src/server/routers/async/image.ts +1 -1
- package/src/services/__tests__/chat.test.ts +3 -4
- package/src/store/chat/slices/message/selectors.test.ts +2 -3
- package/src/store/chat/slices/plugin/action.test.ts +2 -1
- package/src/store/image/slices/generationConfig/action.test.ts +2 -2
- package/src/store/image/slices/generationConfig/action.ts +1 -1
- package/src/store/image/slices/generationConfig/hooks.test.ts +2 -2
- package/src/store/image/slices/generationConfig/hooks.ts +1 -4
- package/src/store/image/slices/generationConfig/initialState.ts +2 -2
- package/src/store/image/slices/generationConfig/selectors.test.ts +2 -2
- package/src/store/image/slices/generationConfig/selectors.ts +1 -1
- package/src/store/user/slices/auth/selectors.test.ts +3 -2
- package/src/types/generation/index.ts +1 -0
- package/docs/development/basic/add-new-ai-image-model.mdx +0 -36
- package/docs/development/basic/add-new-ai-image-model.zh-CN.mdx +0 -0
- package/src/config/paramsSchemas/fal/flux-kontext-dev.ts +0 -8
- package/src/config/paramsSchemas/fal/flux-pro-kontext.ts +0 -11
- package/src/config/paramsSchemas/fal/flux-schnell.ts +0 -9
- package/src/config/paramsSchemas/fal/imagen4.ts +0 -10
- package/src/config/paramsSchemas/openai/gpt-image-1.ts +0 -10
- package/src/libs/standard-parameters/meta-schema.ts +0 -147
- /package/apps/desktop/src/main/core/{I18nManager.ts → infrastructure/I18nManager.ts} +0 -0
- /package/apps/desktop/src/main/core/{IoCContainer.ts → infrastructure/IoCContainer.ts} +0 -0
@@ -0,0 +1,162 @@
|
|
1
|
+
# 添加新的图像模型
|
2
|
+
|
3
|
+
> 了解更多关于 AI 绘画模态的设计,请参考 [AI 绘画模态设计讨论](https://github.com/lobehub/lobe-chat/discussions/7442)
|
4
|
+
|
5
|
+
## 参数标准化
|
6
|
+
|
7
|
+
所有图像生成模型都必须使用 `src/libs/standard-parameters/index.ts` 中定义的标准参数。这确保了不同 Provider 之间的参数一致性,让用户体验更加统一。
|
8
|
+
|
9
|
+
**支持的标准参数**:
|
10
|
+
|
11
|
+
- `prompt` (必需):生成图像的提示词
|
12
|
+
- `aspectRatio`:宽高比(如 "16:9", "1:1")
|
13
|
+
- `width` / `height`:图像宽高
|
14
|
+
- `size`:预设尺寸(如 "1024x1024")
|
15
|
+
- `seed`:随机种子
|
16
|
+
- `steps`:生成步数
|
17
|
+
- `cfg`:引导缩放
|
18
|
+
- 其他参数请查看源文件
|
19
|
+
|
20
|
+
## 兼容 OpenAI 请求格式的模型
|
21
|
+
|
22
|
+
指的是可以使用 openai SDK 进行请求,并且请求参数和和返回值和 dall-e 以及 gpt-image-x 系列一致。
|
23
|
+
|
24
|
+
以智谱的 CogView-4 为例,它是一个兼容 openai 请求格式的模型。你只需要在对应的 ai models 文件 `src/config/aiModels/zhipu.ts` 中,添加模型配置,例如:
|
25
|
+
|
26
|
+
```ts
|
27
|
+
const zhipuImageModels: AIImageModelCard[] = [
|
28
|
+
// 添加模型配置
|
29
|
+
// https://bigmodel.cn/dev/howuse/image-generation-model/cogview-4
|
30
|
+
{
|
31
|
+
description:
|
32
|
+
'CogView-4 是智谱首个支持生成汉字的开源文生图模型,在语义理解、图像生成质量、中英文字生成能力等方面全面提升,支持任意长度的中英双语输入,能够生成在给定范围内的任意分辨率图像。',
|
33
|
+
displayName: 'CogView-4',
|
34
|
+
enabled: true,
|
35
|
+
id: 'cogview-4',
|
36
|
+
parameters: {
|
37
|
+
prompt: {
|
38
|
+
default: '',
|
39
|
+
},
|
40
|
+
size: {
|
41
|
+
default: '1024x1024',
|
42
|
+
enum: ['1024x1024', '768x1344', '864x1152', '1344x768', '1152x864', '1440x720', '720x1440'],
|
43
|
+
},
|
44
|
+
},
|
45
|
+
releasedAt: '2025-03-04',
|
46
|
+
type: 'image',
|
47
|
+
},
|
48
|
+
];
|
49
|
+
```
|
50
|
+
|
51
|
+
## 不兼容 OpenAI 请求格式的模型
|
52
|
+
|
53
|
+
对于不兼容 OpenAI 格式的图像生成模型,需要实现自定义的 `createImage` 方法。有两种主要实现方式:
|
54
|
+
|
55
|
+
### 方式一:使用 OpenAI Compatible Factory
|
56
|
+
|
57
|
+
大部分 Provider 都使用 `openaiCompatibleFactory` 来兼容 OpenAI,可以通过传入自定义的 `createImage` 函数(参考 [PR #8534](https://github.com/lobehub/lobe-chat/pull/8534))。
|
58
|
+
|
59
|
+
**实现步骤**:
|
60
|
+
|
61
|
+
1. **阅读 Provider 官方文档和标准参数定义**
|
62
|
+
- 查看 Provider 的图像生成 API 文档,了解请求格式和响应格式
|
63
|
+
- 阅读 `src/libs/standard-parameters/index.ts`,了解支持的参数
|
64
|
+
- 在对应的 ai models 文件中增加 image model 配置
|
65
|
+
|
66
|
+
2. **实现自定义的 createImage 方法**
|
67
|
+
- 创建独立的图像生成函数,接受标准生图参数
|
68
|
+
- 将标准参数转换为 Provider 特定的格式
|
69
|
+
- 调用 Provider 的生图接口
|
70
|
+
- 返回统一格式的响应(imageUrl 和可选的宽高)
|
71
|
+
|
72
|
+
3. **补充测试**
|
73
|
+
- 编写单元测试覆盖成功场景
|
74
|
+
- 测试各种错误情况和边界条件
|
75
|
+
|
76
|
+
**代码示例**:
|
77
|
+
|
78
|
+
```ts
|
79
|
+
// src/libs/model-runtime/provider-name/createImage.ts
|
80
|
+
export const createProviderImage = async (
|
81
|
+
payload: ImageGenerationPayload,
|
82
|
+
options: any,
|
83
|
+
): Promise<ImageGenerationResponse> => {
|
84
|
+
const { model, prompt, ...params } = payload;
|
85
|
+
|
86
|
+
// 调用 Provider 的原生 API
|
87
|
+
const result = await callProviderAPI({
|
88
|
+
model,
|
89
|
+
prompt,
|
90
|
+
// 转换参数格式
|
91
|
+
custom_param: params.width,
|
92
|
+
// ...
|
93
|
+
});
|
94
|
+
|
95
|
+
// 返回统一格式
|
96
|
+
return {
|
97
|
+
created: Date.now(),
|
98
|
+
data: [{ url: result.imageUrl }],
|
99
|
+
};
|
100
|
+
};
|
101
|
+
```
|
102
|
+
|
103
|
+
```ts
|
104
|
+
// src/libs/model-runtime/provider-name/index.ts
|
105
|
+
export const LobeProviderAI = openaiCompatibleFactory({
|
106
|
+
constructorOptions: {
|
107
|
+
// ... 其他配置
|
108
|
+
},
|
109
|
+
createImage: createProviderImage, // 传入自定义实现
|
110
|
+
provider: ModelProvider.ProviderName,
|
111
|
+
});
|
112
|
+
```
|
113
|
+
|
114
|
+
### 方式二:在 Provider 类中直接实现
|
115
|
+
|
116
|
+
如果你的 Provider 有独立的类实现,可以直接在类中添加 `createImage` 方法(参考 [PR #8503](https://github.com/lobehub/lobe-chat/pull/8503))。
|
117
|
+
|
118
|
+
**实现步骤**:
|
119
|
+
|
120
|
+
1. **阅读 Provider 官方文档和标准参数定义**
|
121
|
+
- 查看 Provider 的图像生成 API 文档
|
122
|
+
- 阅读 `src/libs/standard-parameters/index.ts`
|
123
|
+
- 在对应的 ai models 文件中增加 image model 配置
|
124
|
+
|
125
|
+
2. **在 Provider 类中实现 createImage 方法**
|
126
|
+
- 直接在类中添加 `createImage` 方法
|
127
|
+
- 处理参数转换和 API 调用
|
128
|
+
- 返回统一格式的响应
|
129
|
+
|
130
|
+
3. **补充测试**
|
131
|
+
- 为新方法编写完整的测试用例
|
132
|
+
|
133
|
+
**代码示例**:
|
134
|
+
|
135
|
+
```ts
|
136
|
+
// src/libs/model-runtime/provider-name/index.ts
|
137
|
+
export class LobeProviderAI {
|
138
|
+
async createImage(
|
139
|
+
payload: ImageGenerationPayload,
|
140
|
+
options?: ChatStreamCallbacks,
|
141
|
+
): Promise<ImageGenerationResponse> {
|
142
|
+
const { model, prompt, ...params } = payload;
|
143
|
+
|
144
|
+
// 调用原生 API 并处理响应
|
145
|
+
const result = await this.client.generateImage({
|
146
|
+
model,
|
147
|
+
prompt,
|
148
|
+
// 参数转换
|
149
|
+
});
|
150
|
+
|
151
|
+
return {
|
152
|
+
created: Date.now(),
|
153
|
+
data: [{ url: result.url }],
|
154
|
+
};
|
155
|
+
}
|
156
|
+
}
|
157
|
+
```
|
158
|
+
|
159
|
+
### 重要注意事项
|
160
|
+
|
161
|
+
- **测试要求**:为自定义实现添加完整的单元测试,确保覆盖成功场景和各种错误情况
|
162
|
+
- **错误处理**:统一使用 `AgentRuntimeError` 进行错误封装,保持错误信息的一致性
|
@@ -56,7 +56,7 @@ tags:
|
|
56
56
|
<Image alt={'Enter API Key'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/fa056feecba0133c76abe1ad12706c05.png'} />
|
57
57
|
|
58
58
|
- Paste the API key you obtained.
|
59
|
-
- Choose a Fal model (e.g. `
|
59
|
+
- Choose a Fal model (e.g. `Flux.1 Schnell`, `Flux.1 Kontext Dev`) for image or video generation.
|
60
60
|
|
61
61
|
<Image alt={'Select Fal model for media generation'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/7560502f31b8500032922103fc22e69b.png'} />
|
62
62
|
|
@@ -56,7 +56,7 @@ tags:
|
|
56
56
|
<Image alt={'填入 API 密钥'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/fa056feecba0133c76abe1ad12706c05.png'} />
|
57
57
|
|
58
58
|
- 粘贴获取到的 API Key;
|
59
|
-
- 选择一个 Fal 模型(如 `
|
59
|
+
- 选择一个 Fal 模型(如 `Flux.1 Schnell`、`Flux.1 Kontext Dev`)用于图像或视频生成。
|
60
60
|
|
61
61
|
<Image alt={'选择 Fal 模型进行媒体生成'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/7560502f31b8500032922103fc22e69b.png'} />
|
62
62
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.103.
|
3
|
+
"version": "1.103.2",
|
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",
|
@@ -120,28 +120,28 @@
|
|
120
120
|
},
|
121
121
|
"dependencies": {
|
122
122
|
"@ant-design/icons": "^5.6.1",
|
123
|
-
"@ant-design/pro-components": "^2.8.
|
123
|
+
"@ant-design/pro-components": "^2.8.10",
|
124
124
|
"@anthropic-ai/sdk": "^0.56.0",
|
125
125
|
"@auth/core": "^0.38.0",
|
126
|
-
"@aws-sdk/client-bedrock-runtime": "^3.
|
127
|
-
"@aws-sdk/client-s3": "^3.
|
128
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
126
|
+
"@aws-sdk/client-bedrock-runtime": "^3.848.0",
|
127
|
+
"@aws-sdk/client-s3": "^3.850.0",
|
128
|
+
"@aws-sdk/s3-request-presigner": "^3.850.0",
|
129
129
|
"@azure-rest/ai-inference": "1.0.0-beta.5",
|
130
|
-
"@azure/core-auth": "^1.
|
130
|
+
"@azure/core-auth": "^1.10.0",
|
131
131
|
"@cfworker/json-schema": "^4.1.1",
|
132
|
-
"@clerk/localizations": "^3.
|
133
|
-
"@clerk/nextjs": "^6.
|
134
|
-
"@clerk/themes": "^2.
|
132
|
+
"@clerk/localizations": "^3.20.1",
|
133
|
+
"@clerk/nextjs": "^6.25.4",
|
134
|
+
"@clerk/themes": "^2.3.3",
|
135
135
|
"@codesandbox/sandpack-react": "^2.20.0",
|
136
136
|
"@cyntler/react-doc-viewer": "^1.17.0",
|
137
137
|
"@electric-sql/pglite": "0.2.17",
|
138
|
-
"@fal-ai/client": "^1.
|
138
|
+
"@fal-ai/client": "^1.6.1",
|
139
139
|
"@formkit/auto-animate": "^0.8.2",
|
140
|
-
"@google/genai": "^1.
|
140
|
+
"@google/genai": "^1.10.0",
|
141
141
|
"@huggingface/inference": "^2.8.1",
|
142
142
|
"@icons-pack/react-simple-icons": "9.6.0",
|
143
143
|
"@khmyznikov/pwa-install": "0.3.9",
|
144
|
-
"@langchain/community": "^0.3.
|
144
|
+
"@langchain/community": "^0.3.49",
|
145
145
|
"@lobechat/electron-client-ipc": "workspace:*",
|
146
146
|
"@lobechat/electron-server-ipc": "workspace:*",
|
147
147
|
"@lobechat/file-loaders": "workspace:*",
|
@@ -150,29 +150,29 @@
|
|
150
150
|
"@lobehub/charts": "^2.0.0",
|
151
151
|
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
152
152
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
153
|
-
"@lobehub/icons": "^2.
|
154
|
-
"@lobehub/market-sdk": "^0.22.
|
153
|
+
"@lobehub/icons": "^2.17.0",
|
154
|
+
"@lobehub/market-sdk": "^0.22.7",
|
155
155
|
"@lobehub/tts": "^2.0.1",
|
156
|
-
"@lobehub/ui": "^2.7.
|
157
|
-
"@modelcontextprotocol/sdk": "^1.
|
158
|
-
"@neondatabase/serverless": "^1.0.
|
159
|
-
"@next/third-parties": "^15.
|
156
|
+
"@lobehub/ui": "^2.7.4",
|
157
|
+
"@modelcontextprotocol/sdk": "^1.16.0",
|
158
|
+
"@neondatabase/serverless": "^1.0.1",
|
159
|
+
"@next/third-parties": "^15.4.3",
|
160
160
|
"@react-spring/web": "^9.7.5",
|
161
161
|
"@sentry/nextjs": "^7.120.3",
|
162
|
-
"@serwist/next": "^9.
|
162
|
+
"@serwist/next": "^9.1.1",
|
163
163
|
"@t3-oss/env-nextjs": "^0.12.0",
|
164
|
-
"@tanstack/react-query": "^5.
|
165
|
-
"@trpc/client": "^11.
|
166
|
-
"@trpc/next": "^11.
|
167
|
-
"@trpc/react-query": "^11.
|
168
|
-
"@trpc/server": "^11.
|
164
|
+
"@tanstack/react-query": "^5.83.0",
|
165
|
+
"@trpc/client": "^11.4.3",
|
166
|
+
"@trpc/next": "^11.4.3",
|
167
|
+
"@trpc/react-query": "^11.4.3",
|
168
|
+
"@trpc/server": "^11.4.3",
|
169
169
|
"@vercel/analytics": "^1.5.0",
|
170
170
|
"@vercel/edge-config": "^1.4.0",
|
171
|
-
"@vercel/functions": "^2.
|
171
|
+
"@vercel/functions": "^2.2.4",
|
172
172
|
"@vercel/speed-insights": "^1.2.0",
|
173
173
|
"@xterm/xterm": "^5.5.0",
|
174
|
-
"ahooks": "^3.
|
175
|
-
"antd": "^5.26.
|
174
|
+
"ahooks": "^3.9.0",
|
175
|
+
"antd": "^5.26.6",
|
176
176
|
"antd-style": "^3.7.1",
|
177
177
|
"brotli-wasm": "^3.0.1",
|
178
178
|
"chroma-js": "^3.1.2",
|
@@ -187,12 +187,12 @@
|
|
187
187
|
"epub2": "^3.0.2",
|
188
188
|
"fast-deep-equal": "^3.1.3",
|
189
189
|
"file-type": "^20.5.0",
|
190
|
-
"framer-motion": "^12.
|
190
|
+
"framer-motion": "^12.23.6",
|
191
191
|
"gpt-tokenizer": "^2.9.0",
|
192
192
|
"gray-matter": "^4.0.3",
|
193
193
|
"html-to-text": "^9.0.5",
|
194
194
|
"i18next": "^24.2.3",
|
195
|
-
"i18next-browser-languagedetector": "^8.
|
195
|
+
"i18next-browser-languagedetector": "^8.2.0",
|
196
196
|
"i18next-resources-to-backend": "^1.2.1",
|
197
197
|
"idb-keyval": "^6.2.2",
|
198
198
|
"immer": "^10.1.1",
|
@@ -200,17 +200,17 @@
|
|
200
200
|
"js-sha256": "^0.11.1",
|
201
201
|
"jsonl-parse-stringify": "^1.0.3",
|
202
202
|
"keyv": "^4.5.4",
|
203
|
-
"langchain": "^0.3.
|
204
|
-
"langfuse": "^3.
|
205
|
-
"langfuse-core": "^3.
|
203
|
+
"langchain": "^0.3.30",
|
204
|
+
"langfuse": "^3.38.4",
|
205
|
+
"langfuse-core": "^3.38.4",
|
206
206
|
"lodash-es": "^4.17.21",
|
207
207
|
"lucide-react": "^0.525.0",
|
208
208
|
"mammoth": "^1.9.1",
|
209
209
|
"markdown-to-txt": "^2.0.1",
|
210
210
|
"mdast-util-to-markdown": "^2.1.2",
|
211
|
-
"modern-screenshot": "^4.6.
|
211
|
+
"modern-screenshot": "^4.6.5",
|
212
212
|
"nanoid": "^5.1.5",
|
213
|
-
"next": "~15.3.
|
213
|
+
"next": "~15.3.5",
|
214
214
|
"next-auth": "5.0.0-beta.29",
|
215
215
|
"next-mdx-remote": "^5.0.0",
|
216
216
|
"nextjs-toploader": "^3.8.16",
|
@@ -218,7 +218,7 @@
|
|
218
218
|
"numeral": "^2.0.6",
|
219
219
|
"nuqs": "^2.4.3",
|
220
220
|
"officeparser": "5.1.1",
|
221
|
-
"oidc-provider": "^9.
|
221
|
+
"oidc-provider": "^9.4.0",
|
222
222
|
"ollama": "^0.5.16",
|
223
223
|
"openai": "^4.104.0",
|
224
224
|
"openapi-fetch": "^0.9.8",
|
@@ -226,41 +226,41 @@
|
|
226
226
|
"path-browserify-esm": "^1.0.6",
|
227
227
|
"pdf-parse": "^1.1.1",
|
228
228
|
"pdfjs-dist": "4.8.69",
|
229
|
-
"pg": "^8.16.
|
229
|
+
"pg": "^8.16.3",
|
230
230
|
"pino": "^9.7.0",
|
231
231
|
"plaiceholder": "^3.0.0",
|
232
232
|
"polished": "^4.3.1",
|
233
|
-
"posthog-js": "^1.
|
233
|
+
"posthog-js": "^1.257.2",
|
234
234
|
"pure-rand": "^7.0.1",
|
235
235
|
"pwa-install-handler": "^2.6.2",
|
236
|
-
"query-string": "^9.2.
|
236
|
+
"query-string": "^9.2.2",
|
237
237
|
"random-words": "^2.0.1",
|
238
238
|
"react": "^19.1.0",
|
239
239
|
"react-confetti": "^6.4.0",
|
240
240
|
"react-dom": "^19.1.0",
|
241
241
|
"react-fast-marquee": "^1.6.5",
|
242
242
|
"react-hotkeys-hook": "^5.1.0",
|
243
|
-
"react-i18next": "^15.
|
244
|
-
"react-layout-kit": "^1.9.
|
243
|
+
"react-i18next": "^15.6.1",
|
244
|
+
"react-layout-kit": "^1.9.2",
|
245
245
|
"react-lazy-load": "^4.0.1",
|
246
246
|
"react-pdf": "^9.2.1",
|
247
247
|
"react-rnd": "^10.5.2",
|
248
|
-
"react-scan": "^0.3.
|
249
|
-
"react-virtuoso": "^4.
|
248
|
+
"react-scan": "^0.3.6",
|
249
|
+
"react-virtuoso": "^4.13.0",
|
250
250
|
"react-wrap-balancer": "^1.1.1",
|
251
251
|
"remark": "^15.0.1",
|
252
252
|
"remark-gfm": "^4.0.1",
|
253
253
|
"remark-html": "^16.0.1",
|
254
254
|
"request-filtering-agent": "^2.0.1",
|
255
|
-
"resolve-accept-language": "^3.1.
|
255
|
+
"resolve-accept-language": "^3.1.12",
|
256
256
|
"rtl-detect": "^1.1.2",
|
257
257
|
"semver": "^7.7.2",
|
258
|
-
"sharp": "^0.34.
|
259
|
-
"shiki": "^3.
|
258
|
+
"sharp": "^0.34.3",
|
259
|
+
"shiki": "^3.8.1",
|
260
260
|
"stripe": "^16.12.0",
|
261
261
|
"superjson": "^2.2.2",
|
262
|
-
"svix": "^1.
|
263
|
-
"swr": "^2.3.
|
262
|
+
"svix": "^1.69.0",
|
263
|
+
"swr": "^2.3.4",
|
264
264
|
"systemjs": "^6.15.1",
|
265
265
|
"tokenx": "^0.4.1",
|
266
266
|
"ts-md5": "^1.3.1",
|
@@ -270,12 +270,12 @@
|
|
270
270
|
"url-join": "^5.0.0",
|
271
271
|
"use-merge-value": "^1.2.0",
|
272
272
|
"uuid": "^11.1.0",
|
273
|
-
"ws": "^8.18.
|
273
|
+
"ws": "^8.18.3",
|
274
274
|
"y-protocols": "^1.0.6",
|
275
275
|
"y-webrtc": "^10.3.0",
|
276
276
|
"yaml": "^2.8.0",
|
277
277
|
"yjs": "^13.6.27",
|
278
|
-
"zod": "^3.25.
|
278
|
+
"zod": "^3.25.76",
|
279
279
|
"zustand": "5.0.4",
|
280
280
|
"zustand-utils": "^2.1.0"
|
281
281
|
},
|
@@ -285,10 +285,10 @@
|
|
285
285
|
"@huggingface/tasks": "^0.15.9",
|
286
286
|
"@lobehub/i18n-cli": "^1.25.1",
|
287
287
|
"@lobehub/lint": "^1.26.2",
|
288
|
-
"@lobehub/market-types": "^1.11.
|
289
|
-
"@lobehub/seo-cli": "^1.
|
290
|
-
"@next/bundle-analyzer": "^15.
|
291
|
-
"@next/eslint-plugin-next": "^15.
|
288
|
+
"@lobehub/market-types": "^1.11.4",
|
289
|
+
"@lobehub/seo-cli": "^1.7.0",
|
290
|
+
"@next/bundle-analyzer": "^15.4.3",
|
291
|
+
"@next/eslint-plugin-next": "^15.4.3",
|
292
292
|
"@peculiar/webcrypto": "^1.5.0",
|
293
293
|
"@prettier/sync": "^0.6.1",
|
294
294
|
"@semantic-release/exec": "^6.0.3",
|
@@ -302,14 +302,14 @@
|
|
302
302
|
"@types/fs-extra": "^11.0.4",
|
303
303
|
"@types/ip": "^1.1.3",
|
304
304
|
"@types/json-schema": "^7.0.15",
|
305
|
-
"@types/lodash": "^4.17.
|
305
|
+
"@types/lodash": "^4.17.20",
|
306
306
|
"@types/lodash-es": "^4.17.12",
|
307
|
-
"@types/node": "^22.
|
307
|
+
"@types/node": "^22.16.5",
|
308
308
|
"@types/numeral": "^2.0.5",
|
309
309
|
"@types/oidc-provider": "^9.1.1",
|
310
310
|
"@types/pg": "^8.15.4",
|
311
|
-
"@types/react": "^19.1.
|
312
|
-
"@types/react-dom": "^19.1.
|
311
|
+
"@types/react": "^19.1.8",
|
312
|
+
"@types/react-dom": "^19.1.6",
|
313
313
|
"@types/rtl-detect": "^1.0.3",
|
314
314
|
"@types/semver": "^7.7.0",
|
315
315
|
"@types/systemjs": "^6.15.3",
|
@@ -318,23 +318,23 @@
|
|
318
318
|
"@types/uuid": "^10.0.0",
|
319
319
|
"@types/ws": "^8.18.1",
|
320
320
|
"@typescript/native-preview": "7.0.0-dev.20250711.1",
|
321
|
-
"@vitest/coverage-v8": "^3.
|
321
|
+
"@vitest/coverage-v8": "^3.2.4",
|
322
322
|
"ajv-keywords": "^5.1.0",
|
323
323
|
"commitlint": "^19.8.1",
|
324
324
|
"consola": "^3.4.2",
|
325
325
|
"cross-env": "^7.0.3",
|
326
326
|
"crypto-js": "^4.2.0",
|
327
327
|
"dbdocs": "^0.14.4",
|
328
|
-
"dotenv": "^16.
|
328
|
+
"dotenv": "^16.6.1",
|
329
329
|
"dpdm-fast": "1.0.7",
|
330
330
|
"drizzle-dbml-generator": "^0.10.0",
|
331
|
-
"drizzle-kit": "^0.31.
|
331
|
+
"drizzle-kit": "^0.31.4",
|
332
332
|
"eslint": "^8.57.1",
|
333
|
-
"eslint-plugin-mdx": "^3.
|
333
|
+
"eslint-plugin-mdx": "^3.6.2",
|
334
334
|
"fake-indexeddb": "^6.0.1",
|
335
335
|
"fs-extra": "^11.3.0",
|
336
|
-
"glob": "^11.0.
|
337
|
-
"happy-dom": "^17.
|
336
|
+
"glob": "^11.0.3",
|
337
|
+
"happy-dom": "^17.6.3",
|
338
338
|
"husky": "^9.1.7",
|
339
339
|
"just-diff": "^6.0.2",
|
340
340
|
"lint-staged": "^15.5.2",
|
@@ -346,13 +346,13 @@
|
|
346
346
|
"node-gyp": "^11.2.0",
|
347
347
|
"openapi-typescript": "^7.8.0",
|
348
348
|
"p-map": "^7.0.3",
|
349
|
-
"prettier": "^3.
|
349
|
+
"prettier": "^3.6.2",
|
350
350
|
"remark-cli": "^12.0.1",
|
351
351
|
"remark-frontmatter": "^5.0.0",
|
352
352
|
"remark-mdx": "^3.1.0",
|
353
353
|
"remark-parse": "^11.0.0",
|
354
354
|
"semantic-release": "^21.1.2",
|
355
|
-
"serwist": "^9.
|
355
|
+
"serwist": "^9.1.1",
|
356
356
|
"stylelint": "^15.11.0",
|
357
357
|
"tsx": "~4.19.4",
|
358
358
|
"type-fest": "^4.41.0",
|
@@ -360,7 +360,7 @@
|
|
360
360
|
"unified": "^11.0.5",
|
361
361
|
"unist-util-visit": "^5.0.0",
|
362
362
|
"vite": "^5.4.19",
|
363
|
-
"vitest": "^3.2.
|
363
|
+
"vitest": "^3.2.4",
|
364
364
|
"vitest-canvas-mock": "^0.3.3"
|
365
365
|
},
|
366
366
|
"packageManager": "pnpm@10.10.0",
|
@@ -73,7 +73,9 @@ const PortalPanel = memo(({ children }: PropsWithChildren) => {
|
|
73
73
|
expand={showPortal}
|
74
74
|
maxWidth={CHAT_PORTAL_MAX_WIDTH}
|
75
75
|
minWidth={
|
76
|
-
showArtifactUI || showToolUI || showThread
|
76
|
+
(showArtifactUI || showToolUI || showThread) && md
|
77
|
+
? CHAT_PORTAL_TOOL_UI_WIDTH
|
78
|
+
: CHAT_PORTAL_WIDTH
|
77
79
|
}
|
78
80
|
mode={md ? 'fixed' : 'float'}
|
79
81
|
onSizeChange={handleSizeChange}
|
@@ -10,8 +10,10 @@ import HeaderContent from '@/app/[variants]/(main)/chat/settings/features/Header
|
|
10
10
|
import BrandWatermark from '@/components/BrandWatermark';
|
11
11
|
import PanelTitle from '@/components/PanelTitle';
|
12
12
|
import { INBOX_SESSION_ID } from '@/const/session';
|
13
|
+
import { isDesktop } from '@/const/version';
|
13
14
|
import { AgentCategory, AgentSettings as Settings } from '@/features/AgentSetting';
|
14
15
|
import { AgentSettingsProvider } from '@/features/AgentSetting/AgentSettingsProvider';
|
16
|
+
import { TITLE_BAR_HEIGHT } from '@/features/ElectronTitlebar';
|
15
17
|
import Footer from '@/features/Setting/Footer';
|
16
18
|
import { useInitAgentConfig } from '@/hooks/useInitAgentConfig';
|
17
19
|
import { useAgentStore } from '@/store/agent';
|
@@ -49,7 +51,7 @@ const AgentSettings = memo(() => {
|
|
49
51
|
>
|
50
52
|
<Drawer
|
51
53
|
containerMaxWidth={1280}
|
52
|
-
height={'100vh'}
|
54
|
+
height={isDesktop ? `calc(100vh - ${TITLE_BAR_HEIGHT}px)` : '100vh'}
|
53
55
|
noHeader
|
54
56
|
onClose={() => useAgentStore.setState({ showAgentSetting: false })}
|
55
57
|
open={showAgentSetting}
|
@@ -74,7 +76,7 @@ const AgentSettings = memo(() => {
|
|
74
76
|
sidebarContent: {
|
75
77
|
gap: 48,
|
76
78
|
justifyContent: 'space-between',
|
77
|
-
minHeight: '100%',
|
79
|
+
minHeight: isDesktop ? `calc(100% - ${TITLE_BAR_HEIGHT}px)` : '100%',
|
78
80
|
paddingBlock: 24,
|
79
81
|
paddingInline: 48,
|
80
82
|
},
|
@@ -6,7 +6,7 @@ import { CSSProperties, memo, useCallback } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
8
8
|
|
9
|
-
import { MAX_SEED } from '@/libs/standard-parameters/
|
9
|
+
import { MAX_SEED } from '@/libs/standard-parameters/index';
|
10
10
|
import { generateUniqueSeeds } from '@/utils/number';
|
11
11
|
|
12
12
|
export interface SeedNumberInputProps {
|
@@ -14,12 +14,13 @@ import { useTranslation } from 'react-i18next';
|
|
14
14
|
import { Flexbox } from 'react-layout-kit';
|
15
15
|
|
16
16
|
import InvalidAPIKey from '@/components/InvalidAPIKey';
|
17
|
-
import { RuntimeImageGenParams } from '@/libs/standard-parameters/
|
17
|
+
import { RuntimeImageGenParams } from '@/libs/standard-parameters/index';
|
18
18
|
import { useImageStore } from '@/store/image';
|
19
19
|
import { AsyncTaskErrorType } from '@/types/asyncTask';
|
20
20
|
import { GenerationBatch } from '@/types/generation';
|
21
21
|
|
22
22
|
import { GenerationItem } from './GenerationItem';
|
23
|
+
import { ReferenceImages } from './ReferenceImages';
|
23
24
|
|
24
25
|
const useStyles = createStyles(({ cx, css, token }) => ({
|
25
26
|
batchActions: cx(
|
@@ -132,8 +133,15 @@ export const GenerationBatchItem = memo<GenerationBatchItemProps>(({ batch }) =>
|
|
132
133
|
);
|
133
134
|
}
|
134
135
|
|
135
|
-
|
136
|
-
|
136
|
+
// Calculate total number of reference images
|
137
|
+
const referenceImageCount =
|
138
|
+
(batch.config?.imageUrl ? 1 : 0) + (batch.config?.imageUrls?.length || 0);
|
139
|
+
|
140
|
+
const isSingleImageLayout = referenceImageCount === 1;
|
141
|
+
|
142
|
+
// Content for prompt and metadata
|
143
|
+
const promptAndMetadata = (
|
144
|
+
<>
|
137
145
|
<Markdown variant={'chat'}>{batch.prompt}</Markdown>
|
138
146
|
<Flexbox gap={4} horizontal justify="space-between" style={{ marginBottom: 10 }}>
|
139
147
|
<Flexbox gap={4} horizontal>
|
@@ -146,6 +154,34 @@ export const GenerationBatchItem = memo<GenerationBatchItemProps>(({ batch }) =>
|
|
146
154
|
<Tag>{t('generation.metadata.count', { count: batch.generations.length })}</Tag>
|
147
155
|
</Flexbox>
|
148
156
|
</Flexbox>
|
157
|
+
</>
|
158
|
+
);
|
159
|
+
|
160
|
+
return (
|
161
|
+
<Block className={styles.container} gap={8} variant="borderless">
|
162
|
+
{isSingleImageLayout ? (
|
163
|
+
// Single image layout: horizontal arrangement with vertical centering
|
164
|
+
<Flexbox align="center" gap={16} horizontal>
|
165
|
+
<ReferenceImages
|
166
|
+
imageUrl={batch.config?.imageUrl}
|
167
|
+
imageUrls={batch.config?.imageUrls}
|
168
|
+
layout="single"
|
169
|
+
/>
|
170
|
+
<Flexbox flex={1} gap={8}>
|
171
|
+
{promptAndMetadata}
|
172
|
+
</Flexbox>
|
173
|
+
</Flexbox>
|
174
|
+
) : (
|
175
|
+
// Multiple images or no images: vertical arrangement
|
176
|
+
<>
|
177
|
+
<ReferenceImages
|
178
|
+
imageUrl={batch.config?.imageUrl}
|
179
|
+
imageUrls={batch.config?.imageUrls}
|
180
|
+
layout="multiple"
|
181
|
+
/>
|
182
|
+
{promptAndMetadata}
|
183
|
+
</>
|
184
|
+
)}
|
149
185
|
<Grid maxItemWidth={200} ref={imageGridRef} rows={batch.generations.length || 4}>
|
150
186
|
{batch.generations.map((generation) => (
|
151
187
|
<GenerationItem
|