@lobehub/chat 1.103.0 → 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.
Files changed (99) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/apps/desktop/build/icon-beta.ico +0 -0
  3. package/apps/desktop/build/icon-dev.ico +0 -0
  4. package/apps/desktop/build/icon-nightly.ico +0 -0
  5. package/apps/desktop/build/icon.ico +0 -0
  6. package/apps/desktop/electron.vite.config.ts +4 -2
  7. package/apps/desktop/package.json +1 -0
  8. package/apps/desktop/src/main/appBrowsers.ts +2 -2
  9. package/apps/desktop/src/main/const/env.ts +5 -4
  10. package/apps/desktop/src/main/const/store.ts +1 -0
  11. package/apps/desktop/src/main/const/theme.ts +11 -0
  12. package/apps/desktop/src/main/controllers/BrowserWindowsCtr.ts +1 -1
  13. package/apps/desktop/src/main/controllers/NotificationCtr.ts +2 -4
  14. package/apps/desktop/src/main/controllers/SystemCtr.ts +4 -0
  15. package/apps/desktop/src/main/controllers/TrayMenuCtr.ts +5 -5
  16. package/apps/desktop/src/main/controllers/index.ts +1 -1
  17. package/apps/desktop/src/main/core/App.ts +9 -10
  18. package/apps/desktop/src/main/core/{Browser.ts → browser/Browser.ts} +129 -88
  19. package/apps/desktop/src/main/core/{BrowserManager.ts → browser/BrowserManager.ts} +13 -3
  20. package/apps/desktop/src/main/core/{StaticFileServerManager.ts → infrastructure/StaticFileServerManager.ts} +13 -7
  21. package/apps/desktop/src/main/core/{StoreManager.ts → infrastructure/StoreManager.ts} +1 -1
  22. package/apps/desktop/src/main/core/{UpdaterManager.ts → infrastructure/UpdaterManager.ts} +1 -1
  23. package/apps/desktop/src/main/core/{MenuManager.ts → ui/MenuManager.ts} +2 -2
  24. package/apps/desktop/src/main/core/{ShortcutManager.ts → ui/ShortcutManager.ts} +7 -1
  25. package/apps/desktop/src/main/core/{Tray.ts → ui/Tray.ts} +61 -59
  26. package/apps/desktop/src/main/core/{TrayManager.ts → ui/TrayManager.ts} +5 -5
  27. package/apps/desktop/src/main/shortcuts/config.ts +2 -2
  28. package/apps/desktop/src/main/types/store.ts +1 -0
  29. package/changelog/v1.json +21 -0
  30. package/docs/development/basic/add-new-image-model.mdx +162 -0
  31. package/docs/development/basic/add-new-image-model.zh-CN.mdx +162 -0
  32. package/docs/usage/features/desktop.mdx +1 -1
  33. package/docs/usage/features/mcp-market.mdx +1 -1
  34. package/docs/usage/providers/fal.mdx +1 -1
  35. package/docs/usage/providers/fal.zh-CN.mdx +1 -1
  36. package/locales/ar/models.json +3 -0
  37. package/locales/bg-BG/models.json +3 -0
  38. package/locales/de-DE/models.json +3 -0
  39. package/locales/en-US/models.json +3 -0
  40. package/locales/es-ES/models.json +3 -0
  41. package/locales/fa-IR/models.json +3 -0
  42. package/locales/fr-FR/models.json +3 -0
  43. package/locales/it-IT/models.json +3 -0
  44. package/locales/ja-JP/models.json +3 -0
  45. package/locales/ko-KR/models.json +3 -0
  46. package/locales/nl-NL/models.json +3 -0
  47. package/locales/pl-PL/models.json +3 -0
  48. package/locales/pt-BR/models.json +3 -0
  49. package/locales/ru-RU/models.json +3 -0
  50. package/locales/tr-TR/models.json +3 -0
  51. package/locales/vi-VN/models.json +3 -0
  52. package/locales/zh-CN/models.json +3 -0
  53. package/locales/zh-TW/models.json +3 -0
  54. package/package.json +66 -66
  55. package/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/Portal.tsx +3 -1
  56. package/src/app/[variants]/(main)/chat/(workspace)/features/AgentSettings/index.tsx +4 -2
  57. package/src/app/[variants]/(main)/image/@menu/components/SeedNumberInput/index.tsx +1 -1
  58. package/src/app/[variants]/(main)/image/features/GenerationFeed/BatchItem.tsx +39 -3
  59. package/src/app/[variants]/(main)/image/features/GenerationFeed/ReferenceImages.tsx +122 -0
  60. package/src/config/aiModels/fal.ts +31 -7
  61. package/src/config/aiModels/openai.ts +10 -1
  62. package/src/features/ElectronTitlebar/WinControl/index.tsx +85 -90
  63. package/src/features/ElectronTitlebar/hooks/useWatchThemeUpdate.ts +10 -5
  64. package/src/features/ImageTopicPanel/index.tsx +0 -1
  65. package/src/features/PluginDevModal/index.tsx +3 -1
  66. package/src/features/User/__tests__/UserAvatar.test.tsx +5 -4
  67. package/src/libs/model-runtime/fal/index.ts +1 -1
  68. package/src/libs/model-runtime/types/image.ts +1 -1
  69. package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.ts +1 -1
  70. package/src/libs/model-runtime/utils/response.ts +2 -0
  71. package/src/libs/model-runtime/utils/streams/google-ai.test.ts +46 -0
  72. package/src/libs/model-runtime/utils/streams/google-ai.ts +4 -4
  73. package/src/libs/model-runtime/utils/streams/vertex-ai.ts +6 -8
  74. package/src/libs/standard-parameters/{meta-schema.test.ts → index.test.ts} +1 -1
  75. package/src/libs/standard-parameters/index.ts +152 -1
  76. package/src/server/ld.test.ts +4 -3
  77. package/src/server/routers/async/image.ts +1 -1
  78. package/src/services/__tests__/chat.test.ts +3 -4
  79. package/src/store/chat/slices/message/selectors.test.ts +2 -3
  80. package/src/store/chat/slices/plugin/action.test.ts +2 -1
  81. package/src/store/image/slices/generationConfig/action.test.ts +2 -2
  82. package/src/store/image/slices/generationConfig/action.ts +1 -1
  83. package/src/store/image/slices/generationConfig/hooks.test.ts +2 -2
  84. package/src/store/image/slices/generationConfig/hooks.ts +1 -4
  85. package/src/store/image/slices/generationConfig/initialState.ts +2 -2
  86. package/src/store/image/slices/generationConfig/selectors.test.ts +2 -2
  87. package/src/store/image/slices/generationConfig/selectors.ts +1 -1
  88. package/src/store/user/slices/auth/selectors.test.ts +3 -2
  89. package/src/types/generation/index.ts +1 -0
  90. package/docs/development/basic/add-new-ai-image-model.mdx +0 -36
  91. package/docs/development/basic/add-new-ai-image-model.zh-CN.mdx +0 -0
  92. package/src/config/paramsSchemas/fal/flux-kontext-dev.ts +0 -8
  93. package/src/config/paramsSchemas/fal/flux-pro-kontext.ts +0 -11
  94. package/src/config/paramsSchemas/fal/flux-schnell.ts +0 -9
  95. package/src/config/paramsSchemas/fal/imagen4.ts +0 -10
  96. package/src/config/paramsSchemas/openai/gpt-image-1.ts +0 -10
  97. package/src/libs/standard-parameters/meta-schema.ts +0 -147
  98. /package/apps/desktop/src/main/core/{I18nManager.ts → infrastructure/I18nManager.ts} +0 -0
  99. /package/apps/desktop/src/main/core/{IoCContainer.ts → infrastructure/IoCContainer.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.103.0",
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.7",
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.821.0",
127
- "@aws-sdk/client-s3": "^3.821.0",
128
- "@aws-sdk/s3-request-presigner": "^3.821.0",
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.9.0",
130
+ "@azure/core-auth": "^1.10.0",
131
131
  "@cfworker/json-schema": "^4.1.1",
132
- "@clerk/localizations": "^3.16.3",
133
- "@clerk/nextjs": "^6.21.0",
134
- "@clerk/themes": "^2.2.48",
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.5.0",
138
+ "@fal-ai/client": "^1.6.1",
139
139
  "@formkit/auto-animate": "^0.8.2",
140
- "@google/genai": "^1.6.0",
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.45",
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.2.0",
154
- "@lobehub/market-sdk": "^0.22.2",
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.3",
157
- "@modelcontextprotocol/sdk": "^1.12.1",
158
- "@neondatabase/serverless": "^1.0.0",
159
- "@next/third-parties": "^15.3.3",
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.0.14",
162
+ "@serwist/next": "^9.1.1",
163
163
  "@t3-oss/env-nextjs": "^0.12.0",
164
- "@tanstack/react-query": "^5.79.0",
165
- "@trpc/client": "^11.2.0",
166
- "@trpc/next": "^11.1.4",
167
- "@trpc/react-query": "^11.2.0",
168
- "@trpc/server": "^11.2.0",
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.1.0",
171
+ "@vercel/functions": "^2.2.4",
172
172
  "@vercel/speed-insights": "^1.2.0",
173
173
  "@xterm/xterm": "^5.5.0",
174
- "ahooks": "^3.8.5",
175
- "antd": "^5.26.4",
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.15.0",
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.1.0",
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.27",
204
- "langfuse": "^3.37.3",
205
- "langfuse-core": "^3.37.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.0",
211
+ "modern-screenshot": "^4.6.5",
212
212
  "nanoid": "^5.1.5",
213
- "next": "~15.3.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.2.0",
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.0",
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.249.0",
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.0",
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.5.2",
244
- "react-layout-kit": "^1.9.1",
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.4",
249
- "react-virtuoso": "^4.12.8",
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.11",
255
+ "resolve-accept-language": "^3.1.12",
256
256
  "rtl-detect": "^1.1.2",
257
257
  "semver": "^7.7.2",
258
- "sharp": "^0.34.2",
259
- "shiki": "^3.4.2",
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.66.0",
263
- "swr": "^2.3.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.2",
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.48",
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.2",
289
- "@lobehub/seo-cli": "^1.6.0",
290
- "@next/bundle-analyzer": "^15.3.3",
291
- "@next/eslint-plugin-next": "^15.3.3",
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.17",
305
+ "@types/lodash": "^4.17.20",
306
306
  "@types/lodash-es": "^4.17.12",
307
- "@types/node": "^22.15.29",
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.6",
312
- "@types/react-dom": "^19.1.5",
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.1.4",
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.5.0",
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.0",
331
+ "drizzle-kit": "^0.31.4",
332
332
  "eslint": "^8.57.1",
333
- "eslint-plugin-mdx": "^3.4.2",
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.2",
337
- "happy-dom": "^17.5.6",
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.5.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.0.14",
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.0",
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 ? CHAT_PORTAL_TOOL_UI_WIDTH : CHAT_PORTAL_WIDTH
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/meta-schema';
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/meta-schema';
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
- return (
136
- <Block className={styles.container} gap={8} variant="borderless">
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
@@ -0,0 +1,122 @@
1
+ 'use client';
2
+
3
+ import { createStyles } from 'antd-style';
4
+ import { memo } from 'react';
5
+ import { Flexbox } from 'react-layout-kit';
6
+
7
+ import ImageItem from '@/components/ImageItem';
8
+
9
+ const useStyles = createStyles(({ css, token }) => ({
10
+ container: css`
11
+ gap: 8px;
12
+ margin-block-end: 12px;
13
+ `,
14
+ image: css`
15
+ overflow: hidden;
16
+ flex-shrink: 0;
17
+
18
+ width: 60px;
19
+ height: 60px;
20
+ border-radius: ${token.borderRadius}px;
21
+ `,
22
+ imageSingle: css`
23
+ position: relative;
24
+ transform: rotate(-3deg);
25
+
26
+ flex-shrink: 0;
27
+
28
+ width: 64px;
29
+ height: 64px;
30
+
31
+ transition: transform 0.2s ease;
32
+
33
+ &::before {
34
+ content: '';
35
+
36
+ position: absolute;
37
+ z-index: -1;
38
+ inset: -4px;
39
+
40
+ border: 1px solid ${token.colorBorder};
41
+ border-radius: ${token.borderRadius}px;
42
+
43
+ background: ${token.colorBgContainer};
44
+ box-shadow: 0 2px 8px ${token.colorBgMask};
45
+ }
46
+
47
+ &:hover {
48
+ transform: rotate(-1deg) scale(1.05);
49
+ }
50
+ `,
51
+ imageSingleInner: css`
52
+ overflow: hidden;
53
+
54
+ width: 100%;
55
+ height: 100%;
56
+ border-radius: ${token.borderRadiusSM}px;
57
+
58
+ background: ${token.colorBgLayout};
59
+ `,
60
+ }));
61
+
62
+ interface ReferenceImagesProps {
63
+ imageUrl?: string | null;
64
+ imageUrls?: string[];
65
+ layout?: 'single' | 'multiple';
66
+ }
67
+
68
+ export const ReferenceImages = memo<ReferenceImagesProps>(({ imageUrl, imageUrls, layout }) => {
69
+ const { styles } = useStyles();
70
+
71
+ // Collect all images
72
+ const allImages: string[] = [];
73
+ if (imageUrl) {
74
+ allImages.push(imageUrl);
75
+ }
76
+ if (imageUrls && imageUrls.length > 0) {
77
+ allImages.push(...imageUrls);
78
+ }
79
+
80
+ // Don't render if no images
81
+ if (allImages.length === 0) {
82
+ return null;
83
+ }
84
+
85
+ // Single image layout (no label, with frame effect)
86
+ if (layout === 'single' && allImages.length === 1) {
87
+ return (
88
+ <div className={styles.imageSingle}>
89
+ <div className={styles.imageSingleInner}>
90
+ <ImageItem
91
+ alt="Reference image"
92
+ preview={{
93
+ src: allImages[0],
94
+ }}
95
+ style={{ height: '100%', width: '100%' }}
96
+ url={allImages[0]}
97
+ />
98
+ </div>
99
+ </div>
100
+ );
101
+ }
102
+
103
+ // Multiple images layout
104
+ return (
105
+ <Flexbox className={styles.container} horizontal wrap="wrap">
106
+ {allImages.map((url, index) => (
107
+ <div className={styles.image} key={`${url}-${index}`}>
108
+ <ImageItem
109
+ alt={`Reference image ${index + 1}`}
110
+ preview={{
111
+ src: url,
112
+ }}
113
+ style={{ height: '100%', width: '100%' }}
114
+ url={url}
115
+ />
116
+ </div>
117
+ ))}
118
+ </Flexbox>
119
+ );
120
+ });
121
+
122
+ ReferenceImages.displayName = 'ReferenceImages';
@@ -1,9 +1,13 @@
1
+ import { ModelParamsSchema } from '@/libs/standard-parameters';
1
2
  import { AIImageModelCard } from '@/types/aiModel';
2
3
 
3
- import { fluxKontextDevParamsSchema } from '../paramsSchemas/fal/flux-kontext-dev';
4
- import { fluxProKontextParamsSchema } from '../paramsSchemas/fal/flux-pro-kontext';
5
- import { fluxSchnellParamsSchema } from '../paramsSchemas/fal/flux-schnell';
6
- import { imagen4ParamsSchema } from '../paramsSchemas/fal/imagen4';
4
+ export const fluxSchnellParamsSchema: ModelParamsSchema = {
5
+ height: { default: 1024, max: 1536, min: 512, step: 1 },
6
+ prompt: { default: '' },
7
+ seed: { default: null },
8
+ steps: { default: 4, max: 12, min: 1 },
9
+ width: { default: 1024, max: 1536, min: 512, step: 1 },
10
+ };
7
11
 
8
12
  const falImageModels: AIImageModelCard[] = [
9
13
  {
@@ -11,7 +15,12 @@ const falImageModels: AIImageModelCard[] = [
11
15
  displayName: 'FLUX.1 Kontext Dev',
12
16
  enabled: true,
13
17
  id: 'flux-kontext/dev',
14
- parameters: fluxKontextDevParamsSchema,
18
+ parameters: {
19
+ imageUrl: { default: null },
20
+ prompt: { default: '' },
21
+ seed: { default: null },
22
+ steps: { default: 28, max: 50, min: 10 },
23
+ },
15
24
  releasedAt: '2025-06-28',
16
25
  type: 'image',
17
26
  },
@@ -21,7 +30,15 @@ const falImageModels: AIImageModelCard[] = [
21
30
  displayName: 'FLUX.1 Kontext [pro]',
22
31
  enabled: true,
23
32
  id: 'flux-pro/kontext',
24
- parameters: fluxProKontextParamsSchema,
33
+ parameters: {
34
+ aspectRatio: {
35
+ default: '1:1',
36
+ enum: ['21:9', '16:9', '4:3', '3:2', '1:1', '2:3', '3:4', '9:16', '9:21'],
37
+ },
38
+ imageUrl: { default: null },
39
+ prompt: { default: '' },
40
+ seed: { default: null },
41
+ },
25
42
  releasedAt: '2025-05-01',
26
43
  type: 'image',
27
44
  },
@@ -41,7 +58,14 @@ const falImageModels: AIImageModelCard[] = [
41
58
  enabled: true,
42
59
  id: 'imagen4/preview',
43
60
  organization: 'Deepmind',
44
- parameters: imagen4ParamsSchema,
61
+ parameters: {
62
+ aspectRatio: {
63
+ default: '1:1',
64
+ enum: ['1:1', '16:9', '9:16', '3:4', '4:3'],
65
+ },
66
+ prompt: { default: '' },
67
+ seed: { default: null },
68
+ },
45
69
  releasedAt: '2025-05-21',
46
70
  type: 'image',
47
71
  },
@@ -1,4 +1,4 @@
1
- import { gptImage1ParamsSchema } from '@/config/paramsSchemas/openai/gpt-image-1';
1
+ import { ModelParamsSchema } from '@/libs/standard-parameters';
2
2
  import {
3
3
  AIChatModelCard,
4
4
  AIEmbeddingModelCard,
@@ -8,6 +8,15 @@ import {
8
8
  AITTSModelCard,
9
9
  } from '@/types/aiModel';
10
10
 
11
+ export const gptImage1ParamsSchema: ModelParamsSchema = {
12
+ imageUrls: { default: [] },
13
+ prompt: { default: '' },
14
+ size: {
15
+ default: 'auto',
16
+ enum: ['auto', '1024x1024', '1536x1024', '1024x1536'],
17
+ },
18
+ };
19
+
11
20
  export const openaiChatModels: AIChatModelCard[] = [
12
21
  {
13
22
  abilities: {