@lobehub/chat 1.87.4 → 1.87.6
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 +50 -0
- package/apps/desktop/src/main/core/App.ts +4 -0
- package/changelog/v1.json +18 -0
- package/docs/usage/providers/vllm.zh-CN.mdx +2 -2
- package/locales/ar/models.json +23 -8
- package/locales/ar/plugin.json +15 -0
- package/locales/bg-BG/models.json +23 -8
- package/locales/bg-BG/plugin.json +15 -0
- package/locales/de-DE/models.json +23 -8
- package/locales/de-DE/plugin.json +15 -0
- package/locales/en-US/models.json +23 -8
- package/locales/en-US/plugin.json +15 -0
- package/locales/es-ES/models.json +23 -8
- package/locales/es-ES/plugin.json +15 -0
- package/locales/fa-IR/models.json +23 -8
- package/locales/fa-IR/plugin.json +15 -0
- package/locales/fr-FR/models.json +23 -8
- package/locales/fr-FR/plugin.json +15 -0
- package/locales/it-IT/models.json +23 -8
- package/locales/it-IT/plugin.json +15 -0
- package/locales/ja-JP/models.json +23 -8
- package/locales/ja-JP/plugin.json +15 -0
- package/locales/ko-KR/models.json +23 -8
- package/locales/ko-KR/plugin.json +15 -0
- package/locales/nl-NL/models.json +23 -8
- package/locales/nl-NL/plugin.json +15 -0
- package/locales/pl-PL/models.json +23 -8
- package/locales/pl-PL/plugin.json +15 -0
- package/locales/pt-BR/models.json +23 -8
- package/locales/pt-BR/plugin.json +15 -0
- package/locales/ru-RU/models.json +23 -8
- package/locales/ru-RU/plugin.json +15 -0
- package/locales/tr-TR/models.json +23 -8
- package/locales/tr-TR/plugin.json +15 -0
- package/locales/vi-VN/models.json +23 -8
- package/locales/vi-VN/plugin.json +15 -0
- package/locales/zh-CN/models.json +23 -8
- package/locales/zh-CN/plugin.json +15 -0
- package/locales/zh-TW/models.json +23 -8
- package/locales/zh-TW/plugin.json +15 -0
- package/package.json +76 -76
- package/src/features/Conversation/Messages/Assistant/Tool/Inspector/BuiltinPluginTitle.tsx +59 -0
- package/src/features/Conversation/Messages/Assistant/Tool/Inspector/ToolTitle.tsx +33 -7
- package/src/features/InitClientDB/ErrorResult.tsx +0 -3
- package/src/locales/default/plugin.ts +15 -0
- package/src/tools/local-system/Render/ListFiles/Result.tsx +1 -1
- package/src/tools/local-system/systemRole.ts +1 -1
- package/src/utils/fetch/fetchSSE.ts +2 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.87.
|
3
|
+
"version": "1.87.6",
|
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",
|
@@ -121,26 +121,26 @@
|
|
121
121
|
"dependencies": {
|
122
122
|
"@ant-design/icons": "^5.6.1",
|
123
123
|
"@ant-design/pro-components": "^2.8.7",
|
124
|
-
"@anthropic-ai/sdk": "^0.
|
124
|
+
"@anthropic-ai/sdk": "^0.51.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.812.0",
|
127
|
+
"@aws-sdk/client-s3": "^3.812.0",
|
128
|
+
"@aws-sdk/s3-request-presigner": "^3.812.0",
|
129
129
|
"@azure-rest/ai-inference": "1.0.0-beta.5",
|
130
130
|
"@azure/core-auth": "^1.9.0",
|
131
131
|
"@cfworker/json-schema": "^4.1.1",
|
132
|
-
"@clerk/localizations": "^3.
|
133
|
-
"@clerk/nextjs": "^6.
|
134
|
-
"@clerk/themes": "^2.2.
|
132
|
+
"@clerk/localizations": "^3.16.0",
|
133
|
+
"@clerk/nextjs": "^6.19.4",
|
134
|
+
"@clerk/themes": "^2.2.45",
|
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
|
-
"@google-cloud/vertexai": "^1.
|
139
|
-
"@google/generative-ai": "^0.24.
|
138
|
+
"@google-cloud/vertexai": "^1.10.0",
|
139
|
+
"@google/generative-ai": "^0.24.1",
|
140
140
|
"@huggingface/inference": "^2.8.1",
|
141
141
|
"@icons-pack/react-simple-icons": "9.6.0",
|
142
142
|
"@khmyznikov/pwa-install": "0.3.9",
|
143
|
-
"@langchain/community": "^0.3.
|
143
|
+
"@langchain/community": "^0.3.43",
|
144
144
|
"@lobechat/electron-client-ipc": "workspace:*",
|
145
145
|
"@lobechat/electron-server-ipc": "workspace:*",
|
146
146
|
"@lobechat/file-loaders": "workspace:*",
|
@@ -150,96 +150,96 @@
|
|
150
150
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
151
151
|
"@lobehub/icons": "^2.0.0",
|
152
152
|
"@lobehub/tts": "^2.0.1",
|
153
|
-
"@lobehub/ui": "^2.1.
|
154
|
-
"@modelcontextprotocol/sdk": "^1.11.
|
153
|
+
"@lobehub/ui": "^2.1.6",
|
154
|
+
"@modelcontextprotocol/sdk": "^1.11.4",
|
155
155
|
"@neondatabase/serverless": "^1.0.0",
|
156
|
-
"@next/third-parties": "^15.3.
|
156
|
+
"@next/third-parties": "^15.3.2",
|
157
157
|
"@react-spring/web": "^9.7.5",
|
158
158
|
"@sentry/nextjs": "^7.120.3",
|
159
|
-
"@serwist/next": "^9.0.
|
159
|
+
"@serwist/next": "^9.0.14",
|
160
160
|
"@t3-oss/env-nextjs": "^0.12.0",
|
161
|
-
"@tanstack/react-query": "^5.
|
162
|
-
"@trpc/client": "^11.
|
163
|
-
"@trpc/next": "^11.
|
164
|
-
"@trpc/react-query": "^11.
|
165
|
-
"@trpc/server": "^11.
|
161
|
+
"@tanstack/react-query": "^5.76.1",
|
162
|
+
"@trpc/client": "^11.1.2",
|
163
|
+
"@trpc/next": "^11.1.2",
|
164
|
+
"@trpc/react-query": "^11.1.2",
|
165
|
+
"@trpc/server": "^11.1.2",
|
166
166
|
"@vercel/analytics": "^1.5.0",
|
167
167
|
"@vercel/edge-config": "^1.4.0",
|
168
|
-
"@vercel/functions": "^2.
|
168
|
+
"@vercel/functions": "^2.1.0",
|
169
169
|
"@vercel/speed-insights": "^1.2.0",
|
170
170
|
"@xterm/xterm": "^5.5.0",
|
171
|
-
"ahooks": "^3.8.
|
171
|
+
"ahooks": "^3.8.5",
|
172
172
|
"ai": "^3.4.33",
|
173
|
-
"antd": "^5.25.
|
173
|
+
"antd": "^5.25.2",
|
174
174
|
"antd-style": "^3.7.1",
|
175
175
|
"brotli-wasm": "^3.0.1",
|
176
176
|
"chroma-js": "^3.1.2",
|
177
|
-
"countries-and-timezones": "^3.
|
177
|
+
"countries-and-timezones": "^3.8.0",
|
178
178
|
"dayjs": "^1.11.13",
|
179
|
-
"debug": "^4.4.
|
179
|
+
"debug": "^4.4.1",
|
180
180
|
"dexie": "^3.2.7",
|
181
181
|
"diff": "^7.0.0",
|
182
182
|
"drizzle-orm": "^0.41.0",
|
183
183
|
"drizzle-zod": "^0.5.1",
|
184
184
|
"epub2": "^3.0.2",
|
185
185
|
"fast-deep-equal": "^3.1.3",
|
186
|
-
"file-type": "^20.
|
187
|
-
"framer-motion": "^12.
|
186
|
+
"file-type": "^20.5.0",
|
187
|
+
"framer-motion": "^12.12.1",
|
188
188
|
"gpt-tokenizer": "^2.9.0",
|
189
189
|
"html-to-text": "^9.0.5",
|
190
190
|
"i18next": "^24.2.3",
|
191
|
-
"i18next-browser-languagedetector": "^8.0
|
191
|
+
"i18next-browser-languagedetector": "^8.1.0",
|
192
192
|
"i18next-resources-to-backend": "^1.2.1",
|
193
|
-
"idb-keyval": "^6.2.
|
193
|
+
"idb-keyval": "^6.2.2",
|
194
194
|
"immer": "^10.1.1",
|
195
195
|
"jose": "^5.10.0",
|
196
196
|
"js-sha256": "^0.11.0",
|
197
197
|
"jsonl-parse-stringify": "^1.0.3",
|
198
198
|
"keyv": "^4.5.4",
|
199
|
-
"langchain": "^0.3.
|
200
|
-
"langfuse": "^3.37.
|
201
|
-
"langfuse-core": "^3.37.
|
199
|
+
"langchain": "^0.3.26",
|
200
|
+
"langfuse": "^3.37.2",
|
201
|
+
"langfuse-core": "^3.37.2",
|
202
202
|
"lodash-es": "^4.17.21",
|
203
203
|
"lucide-react": "^0.509.0",
|
204
204
|
"mammoth": "^1.9.0",
|
205
205
|
"mdast-util-to-markdown": "^2.1.2",
|
206
206
|
"modern-screenshot": "^4.6.0",
|
207
207
|
"nanoid": "^5.1.5",
|
208
|
-
"next": "^15.3.
|
208
|
+
"next": "^15.3.2",
|
209
209
|
"next-auth": "5.0.0-beta.25",
|
210
210
|
"next-mdx-remote": "^5.0.0",
|
211
211
|
"nextjs-toploader": "^3.8.16",
|
212
212
|
"numeral": "^2.0.6",
|
213
|
-
"nuqs": "^2.4.
|
213
|
+
"nuqs": "^2.4.3",
|
214
214
|
"officeparser": "^5.1.1",
|
215
|
-
"oidc-provider": "^8.
|
216
|
-
"ollama": "^0.5.
|
217
|
-
"openai": "^4.
|
215
|
+
"oidc-provider": "^8.8.1",
|
216
|
+
"ollama": "^0.5.15",
|
217
|
+
"openai": "^4.100.0",
|
218
218
|
"openapi-fetch": "^0.9.8",
|
219
219
|
"partial-json": "^0.1.7",
|
220
220
|
"path-browserify-esm": "^1.0.6",
|
221
221
|
"pdf-parse": "^1.1.1",
|
222
222
|
"pdfjs-dist": "4.8.69",
|
223
|
-
"pg": "^8.
|
224
|
-
"pino": "^9.
|
223
|
+
"pg": "^8.16.0",
|
224
|
+
"pino": "^9.7.0",
|
225
225
|
"plaiceholder": "^3.0.0",
|
226
226
|
"polished": "^4.3.1",
|
227
|
-
"posthog-js": "^1.
|
227
|
+
"posthog-js": "^1.245.0",
|
228
228
|
"pwa-install-handler": "^2.6.2",
|
229
|
-
"query-string": "^9.1.
|
229
|
+
"query-string": "^9.1.2",
|
230
230
|
"random-words": "^2.0.1",
|
231
231
|
"react": "^19.1.0",
|
232
232
|
"react-confetti": "^6.4.0",
|
233
233
|
"react-dom": "^19.1.0",
|
234
234
|
"react-fast-marquee": "^1.6.5",
|
235
|
-
"react-hotkeys-hook": "^4.6.
|
236
|
-
"react-i18next": "^15.
|
235
|
+
"react-hotkeys-hook": "^4.6.2",
|
236
|
+
"react-i18next": "^15.5.1",
|
237
237
|
"react-layout-kit": "^1.9.1",
|
238
238
|
"react-lazy-load": "^4.0.1",
|
239
239
|
"react-pdf": "^9.2.1",
|
240
240
|
"react-rnd": "^10.5.2",
|
241
|
-
"react-scan": "^0.3.
|
242
|
-
"react-virtuoso": "^4.12.
|
241
|
+
"react-scan": "^0.3.4",
|
242
|
+
"react-virtuoso": "^4.12.7",
|
243
243
|
"react-wrap-balancer": "^1.1.1",
|
244
244
|
"remark": "^15.0.1",
|
245
245
|
"remark-gfm": "^4.0.1",
|
@@ -247,12 +247,12 @@
|
|
247
247
|
"request-filtering-agent": "^2.0.1",
|
248
248
|
"resolve-accept-language": "^3.1.11",
|
249
249
|
"rtl-detect": "^1.1.2",
|
250
|
-
"semver": "^7.7.
|
250
|
+
"semver": "^7.7.2",
|
251
251
|
"sharp": "^0.33.5",
|
252
|
-
"shiki": "^3.2
|
252
|
+
"shiki": "^3.4.2",
|
253
253
|
"stripe": "^16.12.0",
|
254
254
|
"superjson": "^2.2.2",
|
255
|
-
"svix": "^1.
|
255
|
+
"svix": "^1.65.0",
|
256
256
|
"swr": "^2.3.3",
|
257
257
|
"systemjs": "^6.15.1",
|
258
258
|
"ts-md5": "^1.3.1",
|
@@ -262,24 +262,24 @@
|
|
262
262
|
"use-merge-value": "^1.2.0",
|
263
263
|
"utility-types": "^3.11.0",
|
264
264
|
"uuid": "^11.1.0",
|
265
|
-
"ws": "^8.18.
|
265
|
+
"ws": "^8.18.2",
|
266
266
|
"y-protocols": "^1.0.6",
|
267
267
|
"y-webrtc": "^10.3.0",
|
268
|
-
"yaml": "^2.
|
269
|
-
"yjs": "^13.6.
|
270
|
-
"zod": "^3.
|
271
|
-
"zustand": "^5.0.
|
268
|
+
"yaml": "^2.8.0",
|
269
|
+
"yjs": "^13.6.27",
|
270
|
+
"zod": "^3.25.7",
|
271
|
+
"zustand": "^5.0.4",
|
272
272
|
"zustand-utils": "^2.1.0"
|
273
273
|
},
|
274
274
|
"devDependencies": {
|
275
|
-
"@commitlint/cli": "^19.8.
|
275
|
+
"@commitlint/cli": "^19.8.1",
|
276
276
|
"@edge-runtime/vm": "^5.0.0",
|
277
277
|
"@huggingface/tasks": "^0.15.9",
|
278
278
|
"@lobehub/i18n-cli": "^1.20.3",
|
279
279
|
"@lobehub/lint": "^1.26.1",
|
280
280
|
"@lobehub/seo-cli": "^1.4.3",
|
281
|
-
"@next/bundle-analyzer": "^15.3.
|
282
|
-
"@next/eslint-plugin-next": "^15.3.
|
281
|
+
"@next/bundle-analyzer": "^15.3.2",
|
282
|
+
"@next/eslint-plugin-next": "^15.3.2",
|
283
283
|
"@peculiar/webcrypto": "^1.5.0",
|
284
284
|
"@semantic-release/exec": "^6.0.3",
|
285
285
|
"@testing-library/jest-dom": "^6.6.3",
|
@@ -294,12 +294,12 @@
|
|
294
294
|
"@types/json-schema": "^7.0.15",
|
295
295
|
"@types/lodash": "^4.17.16",
|
296
296
|
"@types/lodash-es": "^4.17.12",
|
297
|
-
"@types/node": "^22.
|
297
|
+
"@types/node": "^22.15.19",
|
298
298
|
"@types/numeral": "^2.0.5",
|
299
299
|
"@types/oidc-provider": "^8.8.1",
|
300
|
-
"@types/pg": "^8.
|
301
|
-
"@types/react": "^19.1.
|
302
|
-
"@types/react-dom": "^19.1.
|
300
|
+
"@types/pg": "^8.15.2",
|
301
|
+
"@types/react": "^19.1.4",
|
302
|
+
"@types/react-dom": "^19.1.5",
|
303
303
|
"@types/rtl-detect": "^1.0.3",
|
304
304
|
"@types/semver": "^7.7.0",
|
305
305
|
"@types/systemjs": "^6.15.3",
|
@@ -307,35 +307,35 @@
|
|
307
307
|
"@types/unist": "^3.0.3",
|
308
308
|
"@types/uuid": "^10.0.0",
|
309
309
|
"@types/ws": "^8.18.1",
|
310
|
-
"@vitest/coverage-v8": "^3.1.
|
310
|
+
"@vitest/coverage-v8": "^3.1.4",
|
311
311
|
"ajv-keywords": "^5.1.0",
|
312
|
-
"commitlint": "^19.8.
|
312
|
+
"commitlint": "^19.8.1",
|
313
313
|
"consola": "^3.4.2",
|
314
314
|
"cross-env": "^7.0.3",
|
315
315
|
"crypto-js": "^4.2.0",
|
316
|
-
"dbdocs": "^0.14.
|
317
|
-
"dotenv": "^16.
|
316
|
+
"dbdocs": "^0.14.4",
|
317
|
+
"dotenv": "^16.5.0",
|
318
318
|
"dpdm-fast": "^1.0.7",
|
319
319
|
"drizzle-dbml-generator": "^0.10.0",
|
320
320
|
"drizzle-kit": "^0.30.6",
|
321
321
|
"eslint": "^8.57.1",
|
322
|
-
"eslint-plugin-mdx": "^3.
|
323
|
-
"fake-indexeddb": "^6.0.
|
322
|
+
"eslint-plugin-mdx": "^3.4.2",
|
323
|
+
"fake-indexeddb": "^6.0.1",
|
324
324
|
"fs-extra": "^11.3.0",
|
325
|
-
"glob": "^11.0.
|
325
|
+
"glob": "^11.0.2",
|
326
326
|
"gray-matter": "^4.0.3",
|
327
|
-
"happy-dom": "^17.4.
|
327
|
+
"happy-dom": "^17.4.7",
|
328
328
|
"husky": "^9.1.7",
|
329
329
|
"just-diff": "^6.0.2",
|
330
|
-
"lint-staged": "^15.5.
|
330
|
+
"lint-staged": "^15.5.2",
|
331
331
|
"lodash": "^4.17.21",
|
332
332
|
"markdown-table": "^3.0.4",
|
333
333
|
"markdown-to-txt": "^2.0.1",
|
334
334
|
"mcp-hello-world": "^1.1.2",
|
335
|
-
"mime": "^4.0.
|
335
|
+
"mime": "^4.0.7",
|
336
336
|
"node-fetch": "^3.3.2",
|
337
337
|
"node-gyp": "^11.2.0",
|
338
|
-
"openapi-typescript": "^7.
|
338
|
+
"openapi-typescript": "^7.8.0",
|
339
339
|
"p-map": "^7.0.3",
|
340
340
|
"prettier": "^3.5.3",
|
341
341
|
"remark-cli": "^12.0.1",
|
@@ -343,14 +343,14 @@
|
|
343
343
|
"remark-mdx": "^3.1.0",
|
344
344
|
"remark-parse": "^11.0.0",
|
345
345
|
"semantic-release": "^21.1.2",
|
346
|
-
"serwist": "^9.0.
|
346
|
+
"serwist": "^9.0.14",
|
347
347
|
"stylelint": "^15.11.0",
|
348
|
-
"tsx": "^4.19.
|
349
|
-
"typescript": "^5.8.
|
348
|
+
"tsx": "^4.19.4",
|
349
|
+
"typescript": "^5.8.3",
|
350
350
|
"unified": "^11.0.5",
|
351
351
|
"unist-util-visit": "^5.0.0",
|
352
|
-
"vite": "^5.4.
|
353
|
-
"vitest": "^3.1.
|
352
|
+
"vite": "^5.4.19",
|
353
|
+
"vitest": "^3.1.4",
|
354
354
|
"vitest-canvas-mock": "^0.3.3"
|
355
355
|
},
|
356
356
|
"packageManager": "pnpm@10.10.0",
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { createStyles } from 'antd-style';
|
2
|
+
import { ReactNode, memo } from 'react';
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
4
|
+
|
5
|
+
import Loader from '@/components/CircleLoader';
|
6
|
+
import { useChatStore } from '@/store/chat';
|
7
|
+
import { chatSelectors } from '@/store/chat/selectors';
|
8
|
+
import { shinyTextStylish } from '@/styles/loading';
|
9
|
+
|
10
|
+
export const useStyles = createStyles(({ css, token }) => ({
|
11
|
+
apiName: css`
|
12
|
+
overflow: hidden;
|
13
|
+
display: -webkit-box;
|
14
|
+
-webkit-box-orient: vertical;
|
15
|
+
-webkit-line-clamp: 1;
|
16
|
+
|
17
|
+
font-family: ${token.fontFamilyCode};
|
18
|
+
font-size: 12px;
|
19
|
+
text-overflow: ellipsis;
|
20
|
+
`,
|
21
|
+
|
22
|
+
shinyText: shinyTextStylish(token),
|
23
|
+
}));
|
24
|
+
|
25
|
+
interface BuiltinPluginTitleProps {
|
26
|
+
apiName: string;
|
27
|
+
icon?: ReactNode;
|
28
|
+
identifier: string;
|
29
|
+
index: number;
|
30
|
+
messageId: string;
|
31
|
+
title: string;
|
32
|
+
toolCallId: string;
|
33
|
+
}
|
34
|
+
|
35
|
+
const BuiltinPluginTitle = memo<BuiltinPluginTitleProps>(
|
36
|
+
({ messageId, index, apiName, toolCallId, icon, title }) => {
|
37
|
+
const { styles } = useStyles();
|
38
|
+
|
39
|
+
const isLoading = useChatStore((s) => {
|
40
|
+
const toolMessageId = chatSelectors.getMessageByToolCallId(toolCallId)(s)?.id;
|
41
|
+
const isToolCallStreaming = chatSelectors.isToolCallStreaming(messageId, index)(s);
|
42
|
+
const isPluginApiInvoking = !toolMessageId
|
43
|
+
? true
|
44
|
+
: chatSelectors.isPluginApiInvoking(toolMessageId)(s);
|
45
|
+
return isToolCallStreaming || isPluginApiInvoking;
|
46
|
+
});
|
47
|
+
|
48
|
+
return (
|
49
|
+
<Flexbox align={'center'} className={isLoading ? styles.shinyText : ''} gap={4} horizontal>
|
50
|
+
{isLoading ? <Loader /> : icon}
|
51
|
+
<Flexbox align={'baseline'} gap={4} horizontal>
|
52
|
+
<div>{title}</div>/<span className={styles.apiName}>{apiName}</span>
|
53
|
+
</Flexbox>
|
54
|
+
</Flexbox>
|
55
|
+
);
|
56
|
+
},
|
57
|
+
);
|
58
|
+
|
59
|
+
export default BuiltinPluginTitle;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Icon } from '@lobehub/ui';
|
2
2
|
import { createStyles } from 'antd-style';
|
3
3
|
import isEqual from 'fast-deep-equal';
|
4
|
-
import { Globe } from 'lucide-react';
|
5
|
-
import { memo } from 'react';
|
4
|
+
import { Globe, Laptop } from 'lucide-react';
|
5
|
+
import { memo, useMemo } from 'react';
|
6
6
|
import { useTranslation } from 'react-i18next';
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
8
8
|
|
@@ -13,8 +13,11 @@ import { chatSelectors } from '@/store/chat/selectors';
|
|
13
13
|
import { pluginHelpers, useToolStore } from '@/store/tool';
|
14
14
|
import { toolSelectors } from '@/store/tool/selectors';
|
15
15
|
import { shinyTextStylish } from '@/styles/loading';
|
16
|
+
import { LocalSystemManifest } from '@/tools/local-system';
|
16
17
|
import { WebBrowsingManifest } from '@/tools/web-browsing';
|
17
18
|
|
19
|
+
import BuiltinPluginTitle from './BuiltinPluginTitle';
|
20
|
+
|
18
21
|
export const useStyles = createStyles(({ css, token }) => ({
|
19
22
|
apiName: css`
|
20
23
|
overflow: hidden;
|
@@ -53,12 +56,35 @@ const ToolTitle = memo<ToolTitleProps>(({ identifier, messageId, index, apiName,
|
|
53
56
|
|
54
57
|
const pluginMeta = useToolStore(toolSelectors.getMetaById(identifier), isEqual);
|
55
58
|
|
56
|
-
|
59
|
+
const plugins = useMemo(
|
60
|
+
() => [
|
61
|
+
{
|
62
|
+
apiName: t(`search.apiName.${apiName}`, apiName),
|
63
|
+
icon: <Icon icon={Globe} size={13} />,
|
64
|
+
id: WebBrowsingManifest.identifier,
|
65
|
+
title: t('search.title'),
|
66
|
+
},
|
67
|
+
{
|
68
|
+
apiName: t(`localSystem.apiName.${apiName}`, apiName),
|
69
|
+
icon: <Icon icon={Laptop} size={13} />,
|
70
|
+
id: LocalSystemManifest.identifier,
|
71
|
+
title: t('localSystem.title'),
|
72
|
+
},
|
73
|
+
],
|
74
|
+
[],
|
75
|
+
);
|
76
|
+
|
77
|
+
const builtinPluginTitle = plugins.find((item) => item.id === identifier);
|
78
|
+
|
79
|
+
if (!!builtinPluginTitle) {
|
57
80
|
return (
|
58
|
-
<
|
59
|
-
{
|
60
|
-
|
61
|
-
|
81
|
+
<BuiltinPluginTitle
|
82
|
+
{...builtinPluginTitle}
|
83
|
+
identifier={identifier}
|
84
|
+
index={index}
|
85
|
+
messageId={messageId}
|
86
|
+
toolCallId={toolCallId}
|
87
|
+
/>
|
62
88
|
);
|
63
89
|
}
|
64
90
|
|
@@ -220,8 +220,23 @@ export default {
|
|
220
220
|
content: '调用插件中...',
|
221
221
|
plugin: '插件运行中...',
|
222
222
|
},
|
223
|
+
localSystem: {
|
224
|
+
apiName: {
|
225
|
+
listLocalFiles: '查看文件列表',
|
226
|
+
moveLocalFiles: '移动文件',
|
227
|
+
readLocalFile: '读取文件内容',
|
228
|
+
renameLocalFile: '重命名',
|
229
|
+
searchLocalFiles: '搜索文件',
|
230
|
+
writeLocalFile: '写入文件',
|
231
|
+
},
|
232
|
+
title: '本地文件',
|
233
|
+
},
|
223
234
|
pluginList: '插件列表',
|
224
235
|
search: {
|
236
|
+
apiName: {
|
237
|
+
crawlSinglePage: '读取页面内容',
|
238
|
+
search: '搜索页面',
|
239
|
+
},
|
225
240
|
config: {
|
226
241
|
addKey: '添加秘钥',
|
227
242
|
close: '删除',
|
@@ -29,7 +29,7 @@ const SearchFiles = memo<SearchFilesProps>(({ listResults = [], messageId }) =>
|
|
29
29
|
}
|
30
30
|
|
31
31
|
return (
|
32
|
-
<Flexbox gap={2} style={{ maxHeight:
|
32
|
+
<Flexbox gap={2} style={{ maxHeight: 140, overflow: 'scroll' }}>
|
33
33
|
{listResults.map((item) => (
|
34
34
|
<FileItem key={item.path} {...item} showTime />
|
35
35
|
))}
|
@@ -16,7 +16,7 @@ Here are some known locations and system details on the user's system. User is u
|
|
16
16
|
You have access to a set of tools to interact with the user's local file system:
|
17
17
|
|
18
18
|
1. **listLocalFiles**: Lists files and directories in a specified path.
|
19
|
-
2. **readLocalFile**: Reads the content of a specified file, optionally within a line range.
|
19
|
+
2. **readLocalFile**: Reads the content of a specified file, optionally within a line range. You can read file types such as Word, Excel, PowerPoint, PDF, and plain text files.
|
20
20
|
3. **writeFile**: Write content to a specific file, only support plain text file like \`.text\` or \`.md\`
|
21
21
|
4. **searchLocalFiles**: Searches for files based on keywords and other criteria. Use this tool to find files if the user is unsure about the exact path.
|
22
22
|
5. **renameLocalFile**: Renames a single file or directory in its current location.
|
@@ -316,10 +316,11 @@ export const fetchSSE = async (url: string, options: RequestInit & FetchSSEOptio
|
|
316
316
|
const { smoothing } = options;
|
317
317
|
|
318
318
|
const textSmoothing = false;
|
319
|
+
// const toolsCallingSmoothing = false;
|
319
320
|
// TODO: 看下后面就是完全移除 smoothing 还是怎么说
|
320
321
|
// const textSmoothing = typeof smoothing === 'boolean' ? smoothing : (smoothing?.text ?? true);
|
321
322
|
const toolsCallingSmoothing =
|
322
|
-
typeof smoothing === 'boolean' ? smoothing : (smoothing?.toolsCalling ??
|
323
|
+
typeof smoothing === 'boolean' ? smoothing : (smoothing?.toolsCalling ?? false);
|
323
324
|
|
324
325
|
const smoothingSpeed = isObject(smoothing) ? smoothing.speed : undefined;
|
325
326
|
|