@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.
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/e2e/CLAUDE.md +109 -2
- package/e2e/docs/llm-mock.md +68 -0
- package/e2e/docs/local-setup.md +354 -0
- package/e2e/docs/testing-tips.md +94 -0
- package/e2e/src/features/journeys/agent/agent-conversation.feature +0 -32
- package/e2e/src/mocks/llm/index.ts +6 -6
- package/e2e/src/steps/agent/conversation.steps.ts +3 -471
- package/locales/ar/models.json +89 -5
- package/locales/ar/plugin.json +5 -0
- package/locales/ar/providers.json +1 -0
- package/locales/bg-BG/models.json +68 -0
- package/locales/bg-BG/plugin.json +5 -0
- package/locales/bg-BG/providers.json +1 -0
- package/locales/de-DE/models.json +85 -0
- package/locales/de-DE/plugin.json +5 -0
- package/locales/de-DE/providers.json +1 -0
- package/locales/en-US/models.json +11 -10
- package/locales/en-US/plugin.json +5 -0
- package/locales/en-US/providers.json +1 -0
- package/locales/es-ES/models.json +72 -0
- package/locales/es-ES/plugin.json +5 -0
- package/locales/es-ES/providers.json +1 -0
- package/locales/fa-IR/models.json +86 -0
- package/locales/fa-IR/plugin.json +5 -0
- package/locales/fa-IR/providers.json +1 -0
- package/locales/fr-FR/models.json +49 -0
- package/locales/fr-FR/plugin.json +5 -0
- package/locales/fr-FR/providers.json +1 -0
- package/locales/it-IT/models.json +82 -0
- package/locales/it-IT/plugin.json +5 -0
- package/locales/it-IT/providers.json +1 -0
- package/locales/ja-JP/models.json +42 -5
- package/locales/ja-JP/plugin.json +5 -0
- package/locales/ja-JP/providers.json +1 -0
- package/locales/ko-KR/models.json +54 -0
- package/locales/ko-KR/plugin.json +5 -0
- package/locales/ko-KR/providers.json +1 -0
- package/locales/nl-NL/models.json +12 -1
- package/locales/nl-NL/plugin.json +5 -0
- package/locales/nl-NL/providers.json +1 -0
- package/locales/pl-PL/models.json +46 -0
- package/locales/pl-PL/plugin.json +5 -0
- package/locales/pl-PL/providers.json +1 -0
- package/locales/pt-BR/models.json +59 -0
- package/locales/pt-BR/plugin.json +5 -0
- package/locales/pt-BR/providers.json +1 -0
- package/locales/ru-RU/models.json +85 -0
- package/locales/ru-RU/plugin.json +5 -0
- package/locales/ru-RU/providers.json +1 -0
- package/locales/tr-TR/models.json +81 -0
- package/locales/tr-TR/plugin.json +5 -0
- package/locales/tr-TR/providers.json +1 -0
- package/locales/vi-VN/models.json +54 -0
- package/locales/vi-VN/plugin.json +5 -0
- package/locales/vi-VN/providers.json +1 -0
- package/locales/zh-CN/models.json +42 -5
- package/locales/zh-CN/plugin.json +5 -0
- package/locales/zh-CN/providers.json +1 -0
- package/locales/zh-TW/models.json +85 -0
- package/locales/zh-TW/plugin.json +5 -0
- package/locales/zh-TW/providers.json +1 -0
- package/package.json +2 -2
- package/packages/builtin-tool-gtd/src/manifest.ts +13 -8
- package/packages/builtin-tool-gtd/src/systemRole.ts +54 -19
- package/packages/builtin-tool-knowledge-base/package.json +1 -0
- package/packages/builtin-tool-knowledge-base/src/client/Inspector/ReadKnowledge/index.tsx +97 -0
- package/packages/builtin-tool-knowledge-base/src/client/Inspector/SearchKnowledgeBase/index.tsx +75 -0
- package/packages/builtin-tool-knowledge-base/src/client/Inspector/index.ts +11 -0
- package/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/FileCard.tsx +12 -12
- package/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/index.tsx +16 -25
- package/packages/builtin-tool-knowledge-base/src/client/Render/SearchKnowledgeBase/Item/index.tsx +21 -47
- package/packages/builtin-tool-knowledge-base/src/client/Render/SearchKnowledgeBase/index.tsx +19 -31
- package/packages/builtin-tool-knowledge-base/src/client/Render/index.ts +0 -5
- package/packages/builtin-tool-knowledge-base/src/client/index.ts +5 -1
- package/packages/builtin-tool-knowledge-base/src/executor/index.ts +119 -0
- package/packages/builtin-tool-local-system/package.json +1 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx +44 -29
- package/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx +20 -18
- package/packages/builtin-tool-local-system/src/client/Inspector/ListLocalFiles/index.tsx +76 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx +8 -32
- package/packages/builtin-tool-local-system/src/client/Inspector/RenameLocalFile/index.tsx +62 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx +17 -11
- package/packages/builtin-tool-local-system/src/client/Inspector/WriteLocalFile/index.tsx +61 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/index.ts +6 -0
- package/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx +6 -1
- package/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/SearchView.tsx +19 -31
- package/packages/builtin-tool-local-system/src/client/Render/SearchFiles/SearchQuery/index.tsx +2 -42
- package/packages/builtin-tool-local-system/src/client/Render/index.ts +0 -2
- package/packages/builtin-tool-local-system/src/client/components/FilePathDisplay.tsx +56 -0
- package/packages/builtin-tool-local-system/src/client/components/index.ts +2 -0
- package/packages/builtin-tool-local-system/src/executor/index.ts +435 -0
- package/packages/builtin-tool-web-browsing/src/client/Inspector/Search/index.tsx +32 -5
- package/packages/model-runtime/src/core/contextBuilders/google.test.ts +84 -0
- package/packages/model-runtime/src/core/contextBuilders/google.ts +37 -1
- package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/List/Item/Actions.tsx +4 -13
- package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/List/Item/index.tsx +23 -29
- package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx +3 -3
- package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx +4 -13
- package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/index.tsx +10 -18
- package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx +3 -3
- package/src/app/[variants]/(main)/community/(detail)/assistant/features/Sidebar/ActionButton/AddAgent.tsx +47 -27
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx +4 -3
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/Actions.tsx +4 -13
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/index.tsx +23 -29
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/useDropdownMenu.tsx +3 -3
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/Actions.tsx +4 -13
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/index.tsx +10 -18
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/TopicListContent/ThreadList/ThreadItem/useDropdownMenu.tsx +3 -3
- package/src/app/[variants]/(main)/group/profile/features/AgentBuilder/TopicSelector.tsx +18 -20
- package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentGroupItem/index.tsx +19 -25
- package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/AgentItem/index.tsx +21 -26
- package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Item/Actions.tsx +4 -13
- package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Item/useDropdownMenu.tsx +3 -3
- package/src/app/[variants]/(main)/home/_layout/Body/Project/List/Actions.tsx +4 -13
- package/src/app/[variants]/(main)/home/_layout/Body/Project/List/Item.tsx +8 -15
- package/src/app/[variants]/(main)/home/_layout/Body/Project/List/useDropdownMenu.tsx +3 -3
- package/src/app/[variants]/(main)/home/_layout/Header/components/AddButton.tsx +3 -4
- package/src/app/[variants]/(main)/page/_layout/Body/List/Item/Actions.tsx +4 -13
- package/src/app/[variants]/(main)/page/_layout/Body/List/Item/index.tsx +13 -20
- package/src/app/[variants]/(main)/page/_layout/Body/List/Item/useDropdownMenu.tsx +3 -3
- package/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/List/Item/Actions.tsx +4 -13
- package/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/List/Item/index.tsx +16 -23
- package/src/app/[variants]/(main)/resource/(home)/_layout/Body/LibraryList/List/Item/useDropdownMenu.tsx +3 -3
- package/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx +4 -6
- package/src/features/AgentBuilder/TopicSelector.tsx +18 -17
- package/src/features/Conversation/ChatItem/style.ts +7 -0
- package/src/features/Conversation/Messages/Assistant/Actions/Error.tsx +1 -3
- package/src/features/Conversation/Messages/Assistant/Actions/index.tsx +37 -16
- package/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx +36 -17
- package/src/features/Conversation/Messages/Supervisor/Actions/index.tsx +36 -17
- package/src/features/Conversation/Messages/Task/Actions/Error.tsx +1 -3
- package/src/features/Conversation/Messages/Task/Actions/index.tsx +31 -15
- package/src/features/Conversation/Messages/User/Actions/index.tsx +1 -1
- package/src/features/Conversation/Messages/index.tsx +8 -59
- package/src/features/Conversation/components/ShareMessageModal/index.tsx +1 -1
- package/src/features/Conversation/hooks/useChatItemContextMenu.tsx +313 -83
- package/src/features/NavPanel/components/NavItem.tsx +33 -3
- package/src/features/PageEditor/Copilot/TopicSelector/Actions.tsx +6 -14
- package/src/features/PageEditor/Copilot/TopicSelector/TopicItem.tsx +1 -0
- package/src/features/PageEditor/Copilot/TopicSelector/useDropdownMenu.tsx +6 -3
- package/src/features/ResourceManager/components/Explorer/ItemDropdown/DropdownMenu.tsx +12 -35
- package/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx +4 -8
- package/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx +162 -160
- package/src/features/ResourceManager/components/Explorer/MasonryView/MasonryFileItem/index.tsx +16 -8
- package/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx +4 -3
- package/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx +6 -12
- package/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx +8 -8
- package/src/features/ResourceManager/components/Explorer/ToolBar/ViewSwitcher.tsx +8 -11
- package/src/features/ResourceManager/components/Tree/index.tsx +121 -122
- package/src/helpers/toolEngineering/index.ts +1 -1
- package/src/layout/GlobalProvider/index.tsx +5 -2
- package/src/locales/default/plugin.ts +6 -0
- package/src/server/modules/Mecha/AgentToolsEngine/__tests__/index.test.ts +1 -1
- package/src/server/modules/Mecha/AgentToolsEngine/index.ts +1 -1
- package/src/store/chat/slices/builtinTool/actions/index.ts +1 -11
- package/src/store/tool/slices/builtin/executors/index.ts +4 -0
- package/src/styles/global.ts +6 -0
- package/src/styles/text.ts +1 -1
- package/src/tools/executionRuntimes.ts +3 -8
- package/src/tools/identifiers.ts +1 -1
- package/src/tools/index.ts +1 -1
- package/src/tools/inspectors.ts +5 -0
- package/src/tools/renders.ts +6 -12
- package/packages/builtin-tool-local-system/src/client/Render/RenameLocalFile/index.tsx +0 -37
- package/src/features/Conversation/components/ContextMenu.tsx +0 -418
- package/src/store/chat/slices/builtinTool/actions/__tests__/localSystem.test.ts +0 -201
- package/src/store/chat/slices/builtinTool/actions/knowledgeBase.ts +0 -163
- package/src/store/chat/slices/builtinTool/actions/localSystem.ts +0 -241
- package/src/tools/knowledge-base/ExecutionRuntime/index.ts +0 -25
- package/src/tools/knowledge-base/Render/ReadKnowledge/index.tsx +0 -29
- package/src/tools/knowledge-base/Render/SearchKnowledgeBase/index.tsx +0 -29
- package/src/tools/knowledge-base/Render/index.ts +0 -7
- package/src/tools/knowledge-base/index.ts +0 -12
- package/src/tools/local-system/ExecutionRuntime/index.ts +0 -9
- 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,
|
|
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(
|
|
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={
|
|
340
|
+
data-is-folder={String(item.isFolder)}
|
|
440
341
|
draggable
|
|
441
342
|
gap={8}
|
|
442
343
|
height={36}
|
|
443
344
|
horizontal
|
|
444
|
-
onClick={
|
|
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
|
-
|
|
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
|
-
{
|
|
462
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
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,
|
package/src/styles/global.ts
CHANGED
|
@@ -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
|
`;
|
package/src/styles/text.ts
CHANGED
|
@@ -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.
|
|
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 {
|
|
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
|
-
|
|
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
|
-
[
|
|
16
|
-
[KnowledgeBaseManifest.identifier]: KnowledgeBaseExecutionRuntime,
|
|
17
|
-
[LocalSystemManifest.identifier]: LocalSystemExecutionRuntime,
|
|
12
|
+
[GroupAgentBuilderManifest.identifier]: GroupAgentBuilderExecutionRuntime,
|
|
18
13
|
[WebBrowsingManifest.identifier]: WebBrowsingExecutionRuntime,
|
|
19
14
|
};
|
package/src/tools/identifiers.ts
CHANGED
|
@@ -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,
|
package/src/tools/index.ts
CHANGED
|
@@ -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
|
{
|
package/src/tools/inspectors.ts
CHANGED
|
@@ -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>,
|
package/src/tools/renders.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
[
|
|
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;
|