@lobehub/lobehub 2.0.0-next.183 → 2.0.0-next.184
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 +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/packages/builtin-tool-local-system/package.json +10 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/EditLocalFile/index.tsx +81 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/GlobLocalFiles/index.tsx +73 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/GrepContent/index.tsx +73 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx +81 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/RunCommand/index.tsx +80 -0
- package/packages/builtin-tool-local-system/src/client/Inspector/SearchLocalFiles/index.tsx +71 -0
- package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Inspector/index.ts +1 -2
- package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Intervention/index.ts +1 -2
- package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/ListFiles/Result.tsx +2 -1
- package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/index.ts +1 -2
- package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Streaming/index.ts +1 -2
- package/packages/builtin-tool-local-system/src/client/index.ts +20 -0
- package/src/app/[variants]/(main)/chat/_layout/Sidebar/Topic/index.tsx +3 -3
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/index.tsx +3 -3
- package/src/app/[variants]/(main)/home/_layout/Body/Agent/index.tsx +3 -3
- package/src/app/[variants]/(main)/home/features/RecentPage/index.tsx +3 -2
- package/src/app/[variants]/(main)/home/features/RecentResource/index.tsx +3 -2
- package/src/app/[variants]/(main)/home/features/RecentTopic/index.tsx +3 -3
- package/src/components/NeuralNetworkLoading/index.tsx +181 -0
- package/src/libs/swr/index.ts +1 -8
- package/src/tools/inspectors.ts +6 -5
- package/src/tools/interventions.ts +5 -4
- package/src/tools/placeholders.ts +9 -7
- package/src/tools/renders.ts +5 -3
- package/src/tools/streamings.ts +6 -5
- package/src/tools/local-system/Inspector/EditLocalFile/index.tsx +0 -55
- package/src/tools/local-system/Inspector/GlobLocalFiles/index.tsx +0 -59
- package/src/tools/local-system/Inspector/GrepContent/index.tsx +0 -59
- package/src/tools/local-system/Inspector/ReadLocalFile/index.tsx +0 -55
- package/src/tools/local-system/Inspector/RunCommand/index.tsx +0 -66
- package/src/tools/local-system/Inspector/SearchLocalFiles/index.tsx +0 -59
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Intervention/EditLocalFile/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Intervention/MoveLocalFiles/MoveFileItem.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Intervention/MoveLocalFiles/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Intervention/RunCommand/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Intervention/WriteFile/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Placeholder/ListFiles.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Placeholder/SearchFiles.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/EditLocalFile/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/ListFiles/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/MoveLocalFiles/MoveFileItem.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/MoveLocalFiles/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/ReadLocalFile/ReadFileSkeleton.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/ReadLocalFile/ReadFileView.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/ReadLocalFile/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/RenameLocalFile/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/RunCommand/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/SearchFiles/Result.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/SearchFiles/SearchQuery/SearchView.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/SearchFiles/SearchQuery/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/SearchFiles/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Render/WriteFile/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/Streaming/RunCommand/index.tsx +0 -0
- /package/{src/tools/local-system → packages/builtin-tool-local-system/src/client}/components/FileItem.tsx +0 -0
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { type RunCommandParams, type RunCommandResult } from '@lobechat/electron-client-ipc';
|
|
4
|
-
import { type BuiltinInspectorProps } from '@lobechat/types';
|
|
5
|
-
import { Icon } from '@lobehub/ui';
|
|
6
|
-
import { createStaticStyles, cx } from 'antd-style';
|
|
7
|
-
import { ChevronRight } from 'lucide-react';
|
|
8
|
-
import { memo } from 'react';
|
|
9
|
-
import { useTranslation } from 'react-i18next';
|
|
10
|
-
|
|
11
|
-
import { shinyTextStyles } from '@/styles';
|
|
12
|
-
|
|
13
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
14
|
-
content: css`
|
|
15
|
-
font-family: ${cssVar.fontFamilyCode};
|
|
16
|
-
`,
|
|
17
|
-
root: css`
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
display: -webkit-box;
|
|
20
|
-
-webkit-box-orient: vertical;
|
|
21
|
-
-webkit-line-clamp: 1;
|
|
22
|
-
|
|
23
|
-
color: ${cssVar.colorTextDescription};
|
|
24
|
-
`,
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
|
-
interface RunCommandState {
|
|
28
|
-
message: string;
|
|
29
|
-
result: RunCommandResult;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const RunCommandInspector = memo<BuiltinInspectorProps<RunCommandParams, RunCommandState>>(
|
|
33
|
-
({ args, isLoading }) => {
|
|
34
|
-
const { t } = useTranslation('plugin');
|
|
35
|
-
|
|
36
|
-
// Show description if available, otherwise show command
|
|
37
|
-
const displayText = args?.description || args?.command || '';
|
|
38
|
-
|
|
39
|
-
// When loading, show "Local System > 执行命令"
|
|
40
|
-
if (isLoading) {
|
|
41
|
-
return (
|
|
42
|
-
<div className={cx(styles.root, shinyTextStyles.shinyText)}>
|
|
43
|
-
<span>{t('builtins.lobe-local-system.title')}</span>
|
|
44
|
-
<Icon icon={ChevronRight} style={{ marginInline: 4 }} />
|
|
45
|
-
<span>{t('builtins.lobe-local-system.apiName.runCommand')}</span>
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<div className={styles.root}>
|
|
52
|
-
<span>{t('builtins.lobe-local-system.apiName.runCommand')}</span>
|
|
53
|
-
{displayText && (
|
|
54
|
-
<>
|
|
55
|
-
<Icon icon={ChevronRight} style={{ marginInline: 4 }} />
|
|
56
|
-
<span className={styles.content}>{displayText}</span>
|
|
57
|
-
</>
|
|
58
|
-
)}
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
},
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
RunCommandInspector.displayName = 'RunCommandInspector';
|
|
65
|
-
|
|
66
|
-
export default RunCommandInspector;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { type LocalFileSearchState } from '@lobechat/builtin-tool-local-system';
|
|
4
|
-
import { type LocalSearchFilesParams } from '@lobechat/electron-client-ipc';
|
|
5
|
-
import { type BuiltinInspectorProps } from '@lobechat/types';
|
|
6
|
-
import { Icon } from '@lobehub/ui';
|
|
7
|
-
import { createStaticStyles, cx } from 'antd-style';
|
|
8
|
-
import { ChevronRight } from 'lucide-react';
|
|
9
|
-
import { memo } from 'react';
|
|
10
|
-
import { useTranslation } from 'react-i18next';
|
|
11
|
-
|
|
12
|
-
import { shinyTextStyles } from '@/styles';
|
|
13
|
-
|
|
14
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
15
|
-
content: css`
|
|
16
|
-
font-family: ${cssVar.fontFamilyCode};
|
|
17
|
-
`,
|
|
18
|
-
root: css`
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
display: -webkit-box;
|
|
21
|
-
-webkit-box-orient: vertical;
|
|
22
|
-
-webkit-line-clamp: 1;
|
|
23
|
-
|
|
24
|
-
color: ${cssVar.colorTextDescription};
|
|
25
|
-
`,
|
|
26
|
-
}));
|
|
27
|
-
|
|
28
|
-
export const SearchLocalFilesInspector = memo<
|
|
29
|
-
BuiltinInspectorProps<LocalSearchFilesParams, LocalFileSearchState>
|
|
30
|
-
>(({ args, isLoading }) => {
|
|
31
|
-
const { t } = useTranslation('plugin');
|
|
32
|
-
|
|
33
|
-
const keywords = args?.keywords || '';
|
|
34
|
-
|
|
35
|
-
// When loading, show "本地系统 > 搜索文件"
|
|
36
|
-
if (isLoading) {
|
|
37
|
-
return (
|
|
38
|
-
<div className={cx(styles.root, shinyTextStyles.shinyText)}>
|
|
39
|
-
<span>{t('builtins.lobe-local-system.title')}</span>
|
|
40
|
-
<Icon icon={ChevronRight} style={{ marginInline: 4 }} />
|
|
41
|
-
<span>{t('builtins.lobe-local-system.apiName.searchLocalFiles')}</span>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<div className={styles.root}>
|
|
48
|
-
<span>{t('builtins.lobe-local-system.apiName.searchLocalFiles')}</span>
|
|
49
|
-
{keywords && (
|
|
50
|
-
<>
|
|
51
|
-
<Icon icon={ChevronRight} style={{ marginInline: 4 }} />
|
|
52
|
-
<span className={styles.content}>{keywords}</span>
|
|
53
|
-
</>
|
|
54
|
-
)}
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
SearchLocalFilesInspector.displayName = 'SearchLocalFilesInspector';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|