@lobehub/lobehub 2.0.0-next.187 → 2.0.0-next.189

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 (177) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +18 -0
  3. package/e2e/CLAUDE.md +109 -2
  4. package/e2e/docs/llm-mock.md +68 -0
  5. package/e2e/docs/local-setup.md +354 -0
  6. package/e2e/docs/testing-tips.md +94 -0
  7. package/e2e/src/features/journeys/agent/agent-conversation.feature +0 -32
  8. package/e2e/src/mocks/llm/index.ts +6 -6
  9. package/e2e/src/steps/agent/conversation.steps.ts +3 -471
  10. package/locales/ar/models.json +89 -5
  11. package/locales/ar/plugin.json +5 -0
  12. package/locales/ar/providers.json +1 -0
  13. package/locales/bg-BG/models.json +68 -0
  14. package/locales/bg-BG/plugin.json +5 -0
  15. package/locales/bg-BG/providers.json +1 -0
  16. package/locales/de-DE/models.json +85 -0
  17. package/locales/de-DE/plugin.json +5 -0
  18. package/locales/de-DE/providers.json +1 -0
  19. package/locales/en-US/models.json +11 -10
  20. package/locales/en-US/plugin.json +5 -0
  21. package/locales/en-US/providers.json +1 -0
  22. package/locales/es-ES/models.json +72 -0
  23. package/locales/es-ES/plugin.json +5 -0
  24. package/locales/es-ES/providers.json +1 -0
  25. package/locales/fa-IR/models.json +86 -0
  26. package/locales/fa-IR/plugin.json +5 -0
  27. package/locales/fa-IR/providers.json +1 -0
  28. package/locales/fr-FR/models.json +49 -0
  29. package/locales/fr-FR/plugin.json +5 -0
  30. package/locales/fr-FR/providers.json +1 -0
  31. package/locales/it-IT/models.json +82 -0
  32. package/locales/it-IT/plugin.json +5 -0
  33. package/locales/it-IT/providers.json +1 -0
  34. package/locales/ja-JP/models.json +42 -5
  35. package/locales/ja-JP/plugin.json +5 -0
  36. package/locales/ja-JP/providers.json +1 -0
  37. package/locales/ko-KR/models.json +54 -0
  38. package/locales/ko-KR/plugin.json +5 -0
  39. package/locales/ko-KR/providers.json +1 -0
  40. package/locales/nl-NL/models.json +12 -1
  41. package/locales/nl-NL/plugin.json +5 -0
  42. package/locales/nl-NL/providers.json +1 -0
  43. package/locales/pl-PL/models.json +46 -0
  44. package/locales/pl-PL/plugin.json +5 -0
  45. package/locales/pl-PL/providers.json +1 -0
  46. package/locales/pt-BR/models.json +59 -0
  47. package/locales/pt-BR/plugin.json +5 -0
  48. package/locales/pt-BR/providers.json +1 -0
  49. package/locales/ru-RU/models.json +85 -0
  50. package/locales/ru-RU/plugin.json +5 -0
  51. package/locales/ru-RU/providers.json +1 -0
  52. package/locales/tr-TR/models.json +81 -0
  53. package/locales/tr-TR/plugin.json +5 -0
  54. package/locales/tr-TR/providers.json +1 -0
  55. package/locales/vi-VN/models.json +54 -0
  56. package/locales/vi-VN/plugin.json +5 -0
  57. package/locales/vi-VN/providers.json +1 -0
  58. package/locales/zh-CN/models.json +42 -5
  59. package/locales/zh-CN/plugin.json +5 -0
  60. package/locales/zh-CN/providers.json +1 -0
  61. package/locales/zh-TW/models.json +85 -0
  62. package/locales/zh-TW/plugin.json +5 -0
  63. package/locales/zh-TW/providers.json +1 -0
  64. package/package.json +2 -2
  65. package/packages/builtin-tool-gtd/src/manifest.ts +13 -8
  66. package/packages/builtin-tool-gtd/src/systemRole.ts +54 -19
  67. package/packages/builtin-tool-knowledge-base/package.json +1 -0
  68. package/packages/builtin-tool-knowledge-base/src/client/Inspector/ReadKnowledge/index.tsx +97 -0
  69. package/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx +75 -0
  70. package/packages/builtin-tool-knowledge-base/src/client/Inspector/index.ts +11 -0
  71. package/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/FileCard.tsx +12 -12
  72. package/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/index.tsx +16 -25
  73. package/packages/builtin-tool-knowledge-base/src/client/Render/SearchKnowledgeBase/Item/index.tsx +21 -47
  74. package/packages/builtin-tool-knowledge-base/src/client/Render/SearchKnowledgeBase/index.tsx +19 -31
  75. package/packages/builtin-tool-knowledge-base/src/client/Render/index.ts +0 -5
  76. package/packages/builtin-tool-knowledge-base/src/client/index.ts +5 -1
  77. package/packages/builtin-tool-knowledge-base/src/executor/index.ts +119 -0
  78. package/packages/builtin-tool-local-system/package.json +1 -0
  79. package/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx +44 -29
  80. package/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx +20 -18
  81. package/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx +76 -0
  82. package/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx +8 -32
  83. package/packages/builtin-tool-local-system/src/client/Inspector/RenameLocalFile/index.tsx +62 -0
  84. package/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx +17 -11
  85. package/packages/builtin-tool-local-system/src/client/Inspector/WriteLocalFile/index.tsx +61 -0
  86. package/packages/builtin-tool-local-system/src/client/Inspector/index.ts +6 -0
  87. package/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx +6 -1
  88. package/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/SearchView.tsx +19 -31
  89. package/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/index.tsx +2 -42
  90. package/packages/builtin-tool-local-system/src/client/Render/index.ts +0 -2
  91. package/packages/builtin-tool-local-system/src/client/components/FilePathDisplay.tsx +56 -0
  92. package/packages/builtin-tool-local-system/src/client/components/index.ts +2 -0
  93. package/packages/builtin-tool-local-system/src/executor/index.ts +435 -0
  94. package/packages/builtin-tool-web-browsing/src/client/Inspector/Search/index.tsx +32 -5
  95. package/packages/model-runtime/src/core/contextBuilders/google.test.ts +84 -0
  96. package/packages/model-runtime/src/core/contextBuilders/google.ts +37 -1
  97. package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/List/Item/Actions.tsx +4 -13
  98. package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/List/Item/index.tsx +23 -29
  99. package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx +3 -3
  100. package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx +4 -13
  101. package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/index.tsx +10 -18
  102. package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx +3 -3
  103. package/src/app/[variants]/(main)/community/(detail)/assistant/features/Sidebar/ActionButton/AddAgent.tsx +47 -27
  104. package/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx +4 -3
  105. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/Actions.tsx +4 -13
  106. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/index.tsx +23 -29
  107. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx +3 -3
  108. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx +4 -13
  109. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/index.tsx +10 -18
  110. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx +3 -3
  111. package/src/app/[variants]/(main)/group/profile/features/AgentBuilder/TopicSelector.tsx +18 -20
  112. package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/index.tsx +19 -25
  113. package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/index.tsx +21 -26
  114. package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Item/Actions.tsx +4 -13
  115. package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Item/useDropdownMenu.tsx +3 -3
  116. package/src/app/[variants]/(main)/home/_layout/Body/Project/List/Actions.tsx +4 -13
  117. package/src/app/[variants]/(main)/home/_layout/Body/Project/List/Item.tsx +8 -15
  118. package/src/app/[variants]/(main)/home/_layout/Body/Project/List/useDropdownMenu.tsx +3 -3
  119. package/src/app/[variants]/(main)/home/_layout/Header/components/AddButton.tsx +3 -4
  120. package/src/app/[variants]/(main)/page/_layout/Body/List/Item/Actions.tsx +4 -13
  121. package/src/app/[variants]/(main)/page/_layout/Body/List/Item/index.tsx +13 -20
  122. package/src/app/[variants]/(main)/page/_layout/Body/List/Item/useDropdownMenu.tsx +3 -3
  123. package/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/List/Item/Actions.tsx +4 -13
  124. package/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/List/Item/index.tsx +16 -23
  125. package/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/List/Item/useDropdownMenu.tsx +3 -3
  126. package/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx +4 -6
  127. package/src/features/AgentBuilder/TopicSelector.tsx +18 -17
  128. package/src/features/Conversation/ChatItem/style.ts +7 -0
  129. package/src/features/Conversation/Messages/Assistant/Actions/Error.tsx +1 -3
  130. package/src/features/Conversation/Messages/Assistant/Actions/index.tsx +37 -16
  131. package/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx +36 -17
  132. package/src/features/Conversation/Messages/Supervisor/Actions/index.tsx +36 -17
  133. package/src/features/Conversation/Messages/Task/Actions/Error.tsx +1 -3
  134. package/src/features/Conversation/Messages/Task/Actions/index.tsx +31 -15
  135. package/src/features/Conversation/Messages/User/Actions/index.tsx +1 -1
  136. package/src/features/Conversation/Messages/index.tsx +8 -59
  137. package/src/features/Conversation/components/ShareMessageModal/index.tsx +1 -1
  138. package/src/features/Conversation/hooks/useChatItemContextMenu.tsx +313 -83
  139. package/src/features/NavPanel/components/NavItem.tsx +33 -3
  140. package/src/features/PageEditor/Copilot/TopicSelector/Actions.tsx +6 -14
  141. package/src/features/PageEditor/Copilot/TopicSelector/TopicItem.tsx +1 -0
  142. package/src/features/PageEditor/Copilot/TopicSelector/useDropdownMenu.tsx +6 -3
  143. package/src/features/ResourceManager/components/Explorer/ItemDropdown/DropdownMenu.tsx +12 -35
  144. package/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx +4 -8
  145. package/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx +162 -160
  146. package/src/features/ResourceManager/components/Explorer/MasonryView/MasonryFileItem/index.tsx +16 -8
  147. package/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx +4 -3
  148. package/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx +6 -12
  149. package/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx +8 -8
  150. package/src/features/ResourceManager/components/Explorer/ToolBar/ViewSwitcher.tsx +8 -11
  151. package/src/features/ResourceManager/components/Tree/index.tsx +121 -122
  152. package/src/helpers/toolEngineering/index.ts +1 -1
  153. package/src/layout/GlobalProvider/index.tsx +5 -2
  154. package/src/locales/default/plugin.ts +6 -0
  155. package/src/server/modules/Mecha/AgentToolsEngine/__tests__/index.test.ts +1 -1
  156. package/src/server/modules/Mecha/AgentToolsEngine/index.ts +1 -1
  157. package/src/store/chat/slices/builtinTool/actions/index.ts +1 -11
  158. package/src/store/tool/slices/builtin/executors/index.ts +4 -0
  159. package/src/styles/global.ts +6 -0
  160. package/src/styles/text.ts +1 -1
  161. package/src/tools/executionRuntimes.ts +3 -8
  162. package/src/tools/identifiers.ts +1 -1
  163. package/src/tools/index.ts +1 -1
  164. package/src/tools/inspectors.ts +5 -0
  165. package/src/tools/renders.ts +6 -12
  166. package/packages/builtin-tool-local-system/src/client/Render/RenameLocalFile/index.tsx +0 -37
  167. package/src/features/Conversation/components/ContextMenu.tsx +0 -418
  168. package/src/store/chat/slices/builtinTool/actions/__tests__/localSystem.test.ts +0 -201
  169. package/src/store/chat/slices/builtinTool/actions/knowledgeBase.ts +0 -163
  170. package/src/store/chat/slices/builtinTool/actions/localSystem.ts +0 -241
  171. package/src/tools/knowledge-base/ExecutionRuntime/index.ts +0 -25
  172. package/src/tools/knowledge-base/Render/ReadKnowledge/index.tsx +0 -29
  173. package/src/tools/knowledge-base/Render/SearchKnowledgeBase/index.tsx +0 -29
  174. package/src/tools/knowledge-base/Render/index.ts +0 -7
  175. package/src/tools/knowledge-base/index.ts +0 -12
  176. package/src/tools/local-system/ExecutionRuntime/index.ts +0 -9
  177. package/src/tools/local-system/systemRole.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { CaretDownFilled, LoadingOutlined } from '@ant-design/icons';
4
- import { ActionIcon, Block, Dropdown, Flexbox, Icon } from '@lobehub/ui';
4
+ import { ActionIcon, Block, Flexbox, Icon, showContextMenu } from '@lobehub/ui';
5
5
  import { App, Input } from 'antd';
6
6
  import { createStaticStyles, cx } from 'antd-style';
7
7
  import { FileText, FolderIcon, FolderOpenIcon } from 'lucide-react';
@@ -328,129 +328,55 @@ const FileTreeRow = memo<{
328
328
 
329
329
  return (
330
330
  <Flexbox gap={2}>
331
- <Dropdown menu={{ items: menuItems }} trigger={['contextMenu']}>
332
- <Block
333
- align={'center'}
334
- className={cx(
335
- styles.treeItem,
336
- isOver && styles.fileItemDragOver,
337
- isDragging && styles.dragging,
338
- )}
339
- clickable
340
- data-drop-target-id={item.id}
341
- data-is-folder={String(item.isFolder)}
342
- draggable
343
- gap={8}
344
- height={36}
345
- horizontal
346
- onClick={() => handleFolderClick(item.id, item.slug)}
347
- onDragEnd={handleDragEnd}
348
- onDragLeave={handleDragLeave}
349
- onDragOver={handleDragOver}
350
- onDragStart={handleDragStart}
351
- onDrop={handleDrop}
352
- paddingInline={4}
353
- style={{
354
- paddingInlineStart: level * 12 + 4,
355
- }}
356
- variant={isActive ? 'filled' : 'borderless'}
357
- >
358
- {isLoading ? (
359
- <ActionIcon
360
- icon={LoadingOutlined as any}
361
- size={'small'}
362
- spin
363
- style={{ width: 20 }}
364
- />
365
- ) : (
366
- <motion.div
367
- animate={{ rotate: isExpanded ? 0 : -90 }}
368
- initial={false}
369
- transition={{ duration: 0.2, ease: 'easeInOut' }}
370
- >
371
- <ActionIcon
372
- icon={CaretDownFilled as any}
373
- onClick={(e) => {
374
- e.stopPropagation();
375
- handleToggle();
376
- }}
377
- size={'small'}
378
- style={{ width: 20 }}
379
- />
380
- </motion.div>
381
- )}
382
- <Flexbox
383
- align={'center'}
384
- flex={1}
385
- gap={8}
386
- horizontal
387
- style={{ minHeight: 28, minWidth: 0, overflow: 'hidden' }}
388
- >
389
- <Icon icon={isExpanded ? FolderOpenIcon : FolderIcon} size={18} />
390
- {isRenaming ? (
391
- <Input
392
- onBlur={handleRenameConfirm}
393
- onChange={(e) => setRenamingValue(e.target.value)}
394
- onClick={(e) => e.stopPropagation()}
395
- onKeyDown={(e) => {
396
- if (e.key === 'Enter') {
397
- e.preventDefault();
398
- handleRenameConfirm();
399
- } else if (e.key === 'Escape') {
400
- e.preventDefault();
401
- handleRenameCancel();
402
- }
403
- }}
404
- onPointerDown={(e) => e.stopPropagation()}
405
- ref={inputRef}
406
- size="small"
407
- style={{ flex: 1 }}
408
- value={renamingValue}
409
- />
410
- ) : (
411
- <span
412
- style={{
413
- flex: 1,
414
- overflow: 'hidden',
415
- textOverflow: 'ellipsis',
416
- whiteSpace: 'nowrap',
417
- }}
418
- >
419
- {item.name}
420
- </span>
421
- )}
422
- </Flexbox>
423
- </Block>
424
- </Dropdown>
425
- </Flexbox>
426
- );
427
- }
428
-
429
- // Render as file
430
- const isActive = selectedKey === itemKey;
431
- return (
432
- <Flexbox gap={2}>
433
- <Dropdown menu={{ items: menuItems }} trigger={['contextMenu']}>
434
331
  <Block
435
332
  align={'center'}
436
- className={cx(styles.treeItem, isDragging && styles.dragging)}
333
+ className={cx(
334
+ styles.treeItem,
335
+ isOver && styles.fileItemDragOver,
336
+ isDragging && styles.dragging,
337
+ )}
437
338
  clickable
438
339
  data-drop-target-id={item.id}
439
- data-is-folder={false}
340
+ data-is-folder={String(item.isFolder)}
440
341
  draggable
441
342
  gap={8}
442
343
  height={36}
443
344
  horizontal
444
- onClick={handleItemClick}
345
+ onClick={() => handleFolderClick(item.id, item.slug)}
346
+ onContextMenu={(e) => {
347
+ e.preventDefault();
348
+ showContextMenu(menuItems());
349
+ }}
445
350
  onDragEnd={handleDragEnd}
351
+ onDragLeave={handleDragLeave}
352
+ onDragOver={handleDragOver}
446
353
  onDragStart={handleDragStart}
354
+ onDrop={handleDrop}
447
355
  paddingInline={4}
448
356
  style={{
449
357
  paddingInlineStart: level * 12 + 4,
450
358
  }}
451
359
  variant={isActive ? 'filled' : 'borderless'}
452
360
  >
453
- <div style={{ width: 20 }} />
361
+ {isLoading ? (
362
+ <ActionIcon icon={LoadingOutlined as any} size={'small'} spin style={{ width: 20 }} />
363
+ ) : (
364
+ <motion.div
365
+ animate={{ rotate: isExpanded ? 0 : -90 }}
366
+ initial={false}
367
+ transition={{ duration: 0.2, ease: 'easeInOut' }}
368
+ >
369
+ <ActionIcon
370
+ icon={CaretDownFilled as any}
371
+ onClick={(e) => {
372
+ e.stopPropagation();
373
+ handleToggle();
374
+ }}
375
+ size={'small'}
376
+ style={{ width: 20 }}
377
+ />
378
+ </motion.div>
379
+ )}
454
380
  <Flexbox
455
381
  align={'center'}
456
382
  flex={1}
@@ -458,24 +384,97 @@ const FileTreeRow = memo<{
458
384
  horizontal
459
385
  style={{ minHeight: 28, minWidth: 0, overflow: 'hidden' }}
460
386
  >
461
- {item.sourceType === 'document' ? (
462
- <Icon icon={FileText} size={18} />
387
+ <Icon icon={isExpanded ? FolderOpenIcon : FolderIcon} size={18} />
388
+ {isRenaming ? (
389
+ <Input
390
+ onBlur={handleRenameConfirm}
391
+ onChange={(e) => setRenamingValue(e.target.value)}
392
+ onClick={(e) => e.stopPropagation()}
393
+ onKeyDown={(e) => {
394
+ if (e.key === 'Enter') {
395
+ e.preventDefault();
396
+ handleRenameConfirm();
397
+ } else if (e.key === 'Escape') {
398
+ e.preventDefault();
399
+ handleRenameCancel();
400
+ }
401
+ }}
402
+ onPointerDown={(e) => e.stopPropagation()}
403
+ ref={inputRef}
404
+ size="small"
405
+ style={{ flex: 1 }}
406
+ value={renamingValue}
407
+ />
463
408
  ) : (
464
- <FileIcon fileName={item.name} fileType={item.fileType} size={18} />
409
+ <span
410
+ style={{
411
+ flex: 1,
412
+ overflow: 'hidden',
413
+ textOverflow: 'ellipsis',
414
+ whiteSpace: 'nowrap',
415
+ }}
416
+ >
417
+ {item.name}
418
+ </span>
465
419
  )}
466
- <span
467
- style={{
468
- flex: 1,
469
- overflow: 'hidden',
470
- textOverflow: 'ellipsis',
471
- whiteSpace: 'nowrap',
472
- }}
473
- >
474
- {item.name}
475
- </span>
476
420
  </Flexbox>
477
421
  </Block>
478
- </Dropdown>
422
+ </Flexbox>
423
+ );
424
+ }
425
+
426
+ // Render as file
427
+ const isActive = selectedKey === itemKey;
428
+ return (
429
+ <Flexbox gap={2}>
430
+ <Block
431
+ align={'center'}
432
+ className={cx(styles.treeItem, isDragging && styles.dragging)}
433
+ clickable
434
+ data-drop-target-id={item.id}
435
+ data-is-folder={false}
436
+ draggable
437
+ gap={8}
438
+ height={36}
439
+ horizontal
440
+ onClick={handleItemClick}
441
+ onContextMenu={(e) => {
442
+ e.preventDefault();
443
+ showContextMenu(menuItems());
444
+ }}
445
+ onDragEnd={handleDragEnd}
446
+ onDragStart={handleDragStart}
447
+ paddingInline={4}
448
+ style={{
449
+ paddingInlineStart: level * 12 + 4,
450
+ }}
451
+ variant={isActive ? 'filled' : 'borderless'}
452
+ >
453
+ <div style={{ width: 20 }} />
454
+ <Flexbox
455
+ align={'center'}
456
+ flex={1}
457
+ gap={8}
458
+ horizontal
459
+ style={{ minHeight: 28, minWidth: 0, overflow: 'hidden' }}
460
+ >
461
+ {item.sourceType === 'document' ? (
462
+ <Icon icon={FileText} size={18} />
463
+ ) : (
464
+ <FileIcon fileName={item.name} fileType={item.fileType} size={18} />
465
+ )}
466
+ <span
467
+ style={{
468
+ flex: 1,
469
+ overflow: 'hidden',
470
+ textOverflow: 'ellipsis',
471
+ whiteSpace: 'nowrap',
472
+ }}
473
+ >
474
+ {item.name}
475
+ </span>
476
+ </Flexbox>
477
+ </Block>
479
478
  </Flexbox>
480
479
  );
481
480
  },
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Tools Engineering - Unified tools processing using ToolsEngine
3
3
  */
4
+ import { KnowledgeBaseManifest } from '@lobechat/builtin-tool-knowledge-base';
4
5
  import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing';
5
6
  import { ToolsEngine } from '@lobechat/context-engine';
6
7
  import type { PluginEnableChecker } from '@lobechat/context-engine';
@@ -11,7 +12,6 @@ import { getAgentStoreState } from '@/store/agent';
11
12
  import { agentSelectors } from '@/store/agent/selectors';
12
13
  import { getToolStoreState } from '@/store/tool';
13
14
  import { klavisStoreSelectors, pluginSelectors } from '@/store/tool/selectors';
14
- import { KnowledgeBaseManifest } from '@/tools/knowledge-base';
15
15
 
16
16
  import { getSearchConfig } from '../getSearchConfig';
17
17
  import { isCanUseFC } from '../isCanUseFC';
@@ -1,5 +1,5 @@
1
1
  import { ENABLE_BUSINESS_FEATURES } from '@lobechat/business-const';
2
- import { ModalHost } from '@lobehub/ui';
2
+ import { ContextMenuHost, ModalHost, TooltipGroup } from '@lobehub/ui';
3
3
  import { LazyMotion, domMax } from 'motion/react';
4
4
  import { type ReactNode, Suspense } from 'react';
5
5
 
@@ -66,8 +66,11 @@ const GlobalLayout = async ({
66
66
  <GroupWizardProvider>
67
67
  <DragUploadProvider>
68
68
  <LazyMotion features={domMax}>
69
- <LobeAnalyticsProviderWrapper>{children}</LobeAnalyticsProviderWrapper>
69
+ <TooltipGroup layoutAnimation={false}>
70
+ <LobeAnalyticsProviderWrapper>{children}</LobeAnalyticsProviderWrapper>
71
+ </TooltipGroup>
70
72
  <ModalHost />
73
+ <ContextMenuHost />
71
74
  </LazyMotion>
72
75
  </DragUploadProvider>
73
76
  </GroupWizardProvider>
@@ -73,6 +73,8 @@ export default {
73
73
  'builtins.lobe-gtd.title': 'Task Tools',
74
74
  'builtins.lobe-knowledge-base.apiName.readKnowledge': 'Read Library content',
75
75
  'builtins.lobe-knowledge-base.apiName.searchKnowledgeBase': 'Search Library',
76
+ 'builtins.lobe-knowledge-base.inspector.andMoreFiles': 'and {{count}} more',
77
+ 'builtins.lobe-knowledge-base.inspector.noResults': 'No results',
76
78
  'builtins.lobe-knowledge-base.title': 'Library',
77
79
  'builtins.lobe-local-system.apiName.editLocalFile': 'Edit file',
78
80
  'builtins.lobe-local-system.apiName.getCommandOutput': 'Get command output',
@@ -86,6 +88,9 @@ export default {
86
88
  'builtins.lobe-local-system.apiName.runCommand': 'Run command',
87
89
  'builtins.lobe-local-system.apiName.searchLocalFiles': 'Search files',
88
90
  'builtins.lobe-local-system.apiName.writeLocalFile': 'Write file',
91
+ 'builtins.lobe-local-system.inspector.noResults': 'No results',
92
+ 'builtins.lobe-local-system.inspector.rename.result':
93
+ '<old>{{oldName}}</old> → <new>{{newName}}</new>',
89
94
  'builtins.lobe-local-system.title': 'Local System',
90
95
  'builtins.lobe-page-agent.apiName.batchUpdate': 'Batch update nodes',
91
96
  'builtins.lobe-page-agent.apiName.compareSnapshots': 'Compare snapshots',
@@ -143,6 +148,7 @@ export default {
143
148
  'builtins.lobe-web-browsing.apiName.crawlMultiPages': 'Read multiple pages',
144
149
  'builtins.lobe-web-browsing.apiName.crawlSinglePage': 'Read page content',
145
150
  'builtins.lobe-web-browsing.apiName.search': 'Search pages',
151
+ 'builtins.lobe-web-browsing.inspector.noResults': 'No results',
146
152
  'builtins.lobe-web-browsing.title': 'Web Search',
147
153
  'confirm': 'Confirm',
148
154
  'debug.arguments': 'Arguments',
@@ -1,11 +1,11 @@
1
1
  // @vitest-environment node
2
+ import { KnowledgeBaseManifest } from '@lobechat/builtin-tool-knowledge-base';
2
3
  import { LocalSystemManifest } from '@lobechat/builtin-tool-local-system';
3
4
  import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing';
4
5
  import { ToolsEngine } from '@lobechat/context-engine';
5
6
  import { describe, expect, it } from 'vitest';
6
7
 
7
8
  import { builtinTools } from '@/tools';
8
- import { KnowledgeBaseManifest } from '@/tools/knowledge-base';
9
9
 
10
10
  import { createServerAgentToolsEngine, createServerToolsEngine } from '../index';
11
11
  import type { InstalledPlugin, ServerAgentToolsContext } from '../types';
@@ -9,6 +9,7 @@
9
9
  * - Gets model capabilities from provided function
10
10
  * - No dependency on frontend stores (useToolStore, useAgentStore, etc.)
11
11
  */
12
+ import { KnowledgeBaseManifest } from '@lobechat/builtin-tool-knowledge-base';
12
13
  import { LocalSystemManifest } from '@lobechat/builtin-tool-local-system';
13
14
  import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing';
14
15
  import { ToolsEngine } from '@lobechat/context-engine';
@@ -16,7 +17,6 @@ import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
16
17
  import debug from 'debug';
17
18
 
18
19
  import { builtinTools } from '@/tools';
19
- import { KnowledgeBaseManifest } from '@/tools/knowledge-base';
20
20
 
21
21
  import type {
22
22
  ServerAgentToolsContext,
@@ -5,18 +5,10 @@ import { type ChatStore } from '@/store/chat/store';
5
5
  import { type AgentBuilderAction, agentBuilderSlice } from './agentBuilder';
6
6
  import { type GroupAgentBuilderAction, groupAgentBuilderSlice } from './groupAgentBuilder';
7
7
  import { type ChatCodeInterpreterAction, codeInterpreterSlice } from './interpreter';
8
- import { type KnowledgeBaseAction, knowledgeBaseSlice } from './knowledgeBase';
9
- import { type LocalFileAction, localSystemSlice } from './localSystem';
10
8
  import { type SearchAction, searchSlice } from './search';
11
9
 
12
10
  export interface ChatBuiltinToolAction
13
- extends
14
- SearchAction,
15
- LocalFileAction,
16
- ChatCodeInterpreterAction,
17
- KnowledgeBaseAction,
18
- AgentBuilderAction,
19
- GroupAgentBuilderAction {}
11
+ extends SearchAction, ChatCodeInterpreterAction, AgentBuilderAction, GroupAgentBuilderAction {}
20
12
 
21
13
  export const chatToolSlice: StateCreator<
22
14
  ChatStore,
@@ -25,9 +17,7 @@ export const chatToolSlice: StateCreator<
25
17
  ChatBuiltinToolAction
26
18
  > = (...params) => ({
27
19
  ...searchSlice(...params),
28
- ...localSystemSlice(...params),
29
20
  ...codeInterpreterSlice(...params),
30
- ...knowledgeBaseSlice(...params),
31
21
  ...agentBuilderSlice(...params),
32
22
  ...groupAgentBuilderSlice(...params),
33
23
  });
@@ -6,6 +6,8 @@
6
6
  */
7
7
  import { groupManagementExecutor } from '@lobechat/builtin-tool-group-management/executor';
8
8
  import { gtdExecutor } from '@lobechat/builtin-tool-gtd/executor';
9
+ import { knowledgeBaseExecutor } from '@lobechat/builtin-tool-knowledge-base/executor';
10
+ import { localSystemExecutor } from '@lobechat/builtin-tool-local-system/executor';
9
11
  import { memoryExecutor } from '@lobechat/builtin-tool-memory/executor';
10
12
  import { notebookExecutor } from '@lobechat/builtin-tool-notebook/executor';
11
13
 
@@ -117,6 +119,8 @@ const registerExecutors = (executors: IBuiltinToolExecutor[]): void => {
117
119
  registerExecutors([
118
120
  groupManagementExecutor,
119
121
  gtdExecutor,
122
+ knowledgeBaseExecutor,
123
+ localSystemExecutor,
120
124
  memoryExecutor,
121
125
  notebookExecutor,
122
126
  pageAgentExecutor,
@@ -1,3 +1,4 @@
1
+ import { CLASSNAMES } from '@lobehub/ui';
1
2
  import { type Theme, css } from 'antd-style';
2
3
 
3
4
  // fix ios input keyboard
@@ -55,4 +56,9 @@ export default ({ token }: { prefixCls: string; token: Theme }) => css`
55
56
  button {
56
57
  -webkit-app-region: no-drag;
57
58
  }
59
+
60
+ .${CLASSNAMES.ContextTrigger}[data-popup-open],
61
+ .${CLASSNAMES.DropdownMenuTrigger}[data-popup-open] {
62
+ background: ${token.colorFillTertiary};
63
+ }
58
64
  `;
@@ -33,7 +33,7 @@ export const highlightTextStyles = createStaticStyles(({ css, cssVar }) => ({
33
33
  primary: css`
34
34
  padding-block-end: 1px;
35
35
  color: ${cssVar.colorText};
36
- background: linear-gradient(to top, ${cssVar.colorPrimaryBg} 40%, transparent 40%);
36
+ background: linear-gradient(to top, ${cssVar.colorPrimaryBgHover} 40%, transparent 40%);
37
37
  `,
38
38
  warning: css`
39
39
  padding-block-end: 1px;
@@ -1,19 +1,14 @@
1
1
  import { AgentBuilderManifest } from '@lobechat/builtin-tool-agent-builder';
2
2
  import { AgentBuilderExecutionRuntime } from '@lobechat/builtin-tool-agent-builder/executionRuntime';
3
- import { GroupAgentBuilderIdentifier } from '@lobechat/builtin-tool-group-agent-builder';
3
+ import { GroupAgentBuilderManifest } from '@lobechat/builtin-tool-group-agent-builder';
4
4
  import { GroupAgentBuilderExecutionRuntime } from '@lobechat/builtin-tool-group-agent-builder/executionRuntime';
5
- import { LocalSystemManifest } from '@lobechat/builtin-tool-local-system';
6
5
  import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing';
7
6
  import { WebBrowsingExecutionRuntime } from '@lobechat/builtin-tool-web-browsing/executionRuntime';
8
7
 
9
- import { KnowledgeBaseManifest } from './knowledge-base';
10
- import { KnowledgeBaseExecutionRuntime } from './knowledge-base/ExecutionRuntime';
11
- import { LocalSystemExecutionRuntime } from './local-system/ExecutionRuntime';
8
+ // Note: KnowledgeBase and LocalSystem now use executor pattern via toolStore/builtin/executors
12
9
 
13
10
  export const BuiltinToolServerRuntimes: Record<string, any> = {
14
11
  [AgentBuilderManifest.identifier]: AgentBuilderExecutionRuntime,
15
- [GroupAgentBuilderIdentifier]: GroupAgentBuilderExecutionRuntime,
16
- [KnowledgeBaseManifest.identifier]: KnowledgeBaseExecutionRuntime,
17
- [LocalSystemManifest.identifier]: LocalSystemExecutionRuntime,
12
+ [GroupAgentBuilderManifest.identifier]: GroupAgentBuilderExecutionRuntime,
18
13
  [WebBrowsingManifest.identifier]: WebBrowsingExecutionRuntime,
19
14
  };
@@ -3,6 +3,7 @@ import { CloudSandboxManifest } from '@lobechat/builtin-tool-cloud-sandbox';
3
3
  import { GroupAgentBuilderManifest } from '@lobechat/builtin-tool-group-agent-builder';
4
4
  import { GroupManagementManifest } from '@lobechat/builtin-tool-group-management';
5
5
  import { GTDManifest } from '@lobechat/builtin-tool-gtd';
6
+ import { KnowledgeBaseManifest } from '@lobechat/builtin-tool-knowledge-base';
6
7
  import { LocalSystemManifest } from '@lobechat/builtin-tool-local-system';
7
8
  import { MemoryManifest } from '@lobechat/builtin-tool-memory';
8
9
  import { NotebookManifest } from '@lobechat/builtin-tool-notebook';
@@ -10,7 +11,6 @@ import { PageAgentManifest } from '@lobechat/builtin-tool-page-agent';
10
11
  import { WebBrowsingManifest } from '@lobechat/builtin-tool-web-browsing';
11
12
 
12
13
  import { ArtifactsManifest } from './artifacts';
13
- import { KnowledgeBaseManifest } from './knowledge-base';
14
14
 
15
15
  export const builtinToolIdentifiers: string[] = [
16
16
  AgentBuilderManifest.identifier,
@@ -3,6 +3,7 @@ import { CloudSandboxManifest } from '@lobechat/builtin-tool-cloud-sandbox';
3
3
  import { GroupAgentBuilderManifest } from '@lobechat/builtin-tool-group-agent-builder';
4
4
  import { GroupManagementManifest } from '@lobechat/builtin-tool-group-management';
5
5
  import { GTDManifest } from '@lobechat/builtin-tool-gtd';
6
+ import { KnowledgeBaseManifest } from '@lobechat/builtin-tool-knowledge-base';
6
7
  import { LocalSystemManifest } from '@lobechat/builtin-tool-local-system';
7
8
  import { MemoryManifest } from '@lobechat/builtin-tool-memory';
8
9
  import { NotebookManifest } from '@lobechat/builtin-tool-notebook';
@@ -12,7 +13,6 @@ import { isDesktop } from '@lobechat/const';
12
13
  import { type LobeBuiltinTool } from '@lobechat/types';
13
14
 
14
15
  import { ArtifactsManifest } from './artifacts';
15
- import { KnowledgeBaseManifest } from './knowledge-base';
16
16
 
17
17
  export const builtinTools: LobeBuiltinTool[] = [
18
18
  {
@@ -7,6 +7,10 @@ import {
7
7
  GroupManagementManifest,
8
8
  } from '@lobechat/builtin-tool-group-management/client';
9
9
  import { GTDInspectors, GTDManifest } from '@lobechat/builtin-tool-gtd/client';
10
+ import {
11
+ KnowledgeBaseInspectors,
12
+ KnowledgeBaseManifest,
13
+ } from '@lobechat/builtin-tool-knowledge-base/client';
10
14
  import {
11
15
  LocalSystemInspectors,
12
16
  LocalSystemManifest,
@@ -32,6 +36,7 @@ const BuiltinToolInspectors: Record<string, Record<string, BuiltinInspector>> =
32
36
  BuiltinInspector
33
37
  >,
34
38
  [GTDManifest.identifier]: GTDInspectors as Record<string, BuiltinInspector>,
39
+ [KnowledgeBaseManifest.identifier]: KnowledgeBaseInspectors as Record<string, BuiltinInspector>,
35
40
  [LocalSystemManifest.identifier]: LocalSystemInspectors as Record<string, BuiltinInspector>,
36
41
  [PageAgentManifest.identifier]: PageAgentInspectors as Record<string, BuiltinInspector>,
37
42
  [WebBrowsingManifest.identifier]: WebBrowsingInspectors as Record<string, BuiltinInspector>,
@@ -1,31 +1,25 @@
1
- // agent-builder
2
1
  import { AgentBuilderManifest } from '@lobechat/builtin-tool-agent-builder';
3
2
  import { AgentBuilderRenders } from '@lobechat/builtin-tool-agent-builder/client';
4
- // cloud-sandbox
5
3
  import { CloudSandboxManifest } from '@lobechat/builtin-tool-cloud-sandbox';
6
4
  import { CloudSandboxRenders } from '@lobechat/builtin-tool-cloud-sandbox/client';
7
- // group-management
8
5
  import { GroupManagementManifest } from '@lobechat/builtin-tool-group-management';
9
6
  import { GroupManagementRenders } from '@lobechat/builtin-tool-group-management/client';
10
- // gtd
11
7
  import { GTDManifest, GTDRenders } from '@lobechat/builtin-tool-gtd/client';
12
- // local-system
13
8
  import {
14
- LocalSystemIdentifier,
9
+ KnowledgeBaseManifest,
10
+ KnowledgeBaseRenders,
11
+ } from '@lobechat/builtin-tool-knowledge-base/client';
12
+ import {
13
+ LocalSystemManifest,
15
14
  LocalSystemRenders,
16
15
  } from '@lobechat/builtin-tool-local-system/client';
17
16
  import { NotebookManifest, NotebookRenders } from '@lobechat/builtin-tool-notebook/client';
18
- // web-browsing
19
17
  import {
20
18
  WebBrowsingManifest,
21
19
  WebBrowsingRenders,
22
20
  } from '@lobechat/builtin-tool-web-browsing/client';
23
21
  import { type BuiltinRender } from '@lobechat/types';
24
22
 
25
- // knowledge-base
26
- import { KnowledgeBaseManifest } from './knowledge-base';
27
- import { KnowledgeBaseRenders } from './knowledge-base/Render';
28
-
29
23
  /**
30
24
  * Builtin tools renders registry
31
25
  * Organized by toolset (identifier) -> API name
@@ -37,7 +31,7 @@ const BuiltinToolsRenders: Record<string, Record<string, BuiltinRender>> = {
37
31
  [GTDManifest.identifier]: GTDRenders as Record<string, BuiltinRender>,
38
32
  [NotebookManifest.identifier]: NotebookRenders as Record<string, BuiltinRender>,
39
33
  [KnowledgeBaseManifest.identifier]: KnowledgeBaseRenders as Record<string, BuiltinRender>,
40
- [LocalSystemIdentifier]: LocalSystemRenders as Record<string, BuiltinRender>,
34
+ [LocalSystemManifest.identifier]: LocalSystemRenders as Record<string, BuiltinRender>,
41
35
  [WebBrowsingManifest.identifier]: WebBrowsingRenders as Record<string, BuiltinRender>,
42
36
  };
43
37
 
@@ -1,37 +0,0 @@
1
- import type { LocalReadFileState } from '@lobechat/builtin-tool-local-system';
2
- import { type RenameLocalFileParams } from '@lobechat/electron-client-ipc';
3
- import { type BuiltinRenderProps } from '@lobechat/types';
4
- import { Flexbox, Icon } from '@lobehub/ui';
5
- import { createStaticStyles } from 'antd-style';
6
- import { ArrowRightIcon } from 'lucide-react';
7
- import path from 'path-browserify-esm';
8
- import React, { memo } from 'react';
9
-
10
- import { LocalFile } from '@/features/LocalFile';
11
-
12
- const styles = createStaticStyles(({ css, cssVar }) => ({
13
- container: css`
14
- color: ${cssVar.colorTextQuaternary};
15
- `,
16
- new: css`
17
- color: ${cssVar.colorTextSecondary};
18
- `,
19
- }));
20
-
21
- const RenameLocalFile = memo<BuiltinRenderProps<RenameLocalFileParams, LocalReadFileState>>(
22
- ({ args }) => {
23
- const { base: oldFileName, dir } = path.parse(args.path);
24
-
25
- return (
26
- <Flexbox align={'center'} className={styles.container} gap={8} horizontal paddingInline={12}>
27
- <Flexbox>{oldFileName}</Flexbox>
28
- <Flexbox>
29
- <Icon icon={ArrowRightIcon} />
30
- </Flexbox>
31
- <LocalFile name={args.newName} path={path.join(dir, args.newName)} />
32
- </Flexbox>
33
- );
34
- },
35
- );
36
-
37
- export default RenameLocalFile;