@lobehub/chat 0.95.1 → 0.96.1
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/.github/workflows/issue-auto-comments.yml +72 -0
- package/.github/workflows/issue-close-require.yml +9 -6
- package/CHANGELOG.md +50 -0
- package/README.md +3 -3
- package/README.zh-CN.md +12 -12
- package/locales/en_US/chat.json +3 -0
- package/locales/en_US/error.json +1 -1
- package/locales/en_US/market.json +14 -0
- package/locales/en_US/plugin.json +5 -3
- package/locales/ja_JP/chat.json +3 -0
- package/locales/ja_JP/error.json +1 -1
- package/locales/ja_JP/market.json +14 -0
- package/locales/ja_JP/plugin.json +5 -3
- package/locales/ko_KR/chat.json +3 -0
- package/locales/ko_KR/market.json +14 -0
- package/locales/ko_KR/plugin.json +5 -3
- package/locales/ru_RU/chat.json +3 -0
- package/locales/ru_RU/error.json +1 -1
- package/locales/ru_RU/market.json +14 -0
- package/locales/ru_RU/plugin.json +5 -3
- package/locales/zh_CN/chat.json +3 -0
- package/locales/zh_CN/common.json +0 -1
- package/locales/zh_CN/error.json +1 -1
- package/locales/zh_CN/market.json +14 -0
- package/locales/zh_CN/plugin.json +3 -1
- package/locales/zh_TW/chat.json +3 -0
- package/locales/zh_TW/error.json +1 -1
- package/locales/zh_TW/market.json +14 -0
- package/locales/zh_TW/plugin.json +5 -3
- package/package.json +1 -1
- package/public/images/market_modal_banner.webp +0 -0
- package/src/app/chat/(desktop)/features/SessionList.tsx +12 -2
- package/src/app/chat/features/ChatHeader/ShareButton/Preview.tsx +1 -1
- package/src/app/chat/features/ChatHeader/ShareButton/style.ts +1 -0
- package/src/app/chat/features/Conversation/ChatList/Extras/Translate.tsx +8 -6
- package/src/app/chat/features/SessionListContent/CollapseGroup/index.tsx +1 -1
- package/src/app/chat/features/SessionListContent/Inbox/index.tsx +1 -1
- package/src/app/chat/features/SessionListContent/List/Item/index.tsx +18 -15
- package/src/app/chat/features/SessionListContent/List/index.tsx +7 -6
- package/src/app/chat/features/SessionListContent/index.tsx +37 -13
- package/src/app/chat/settings/features/SubmitAgentButton/index.tsx +0 -1
- package/src/app/market/(desktop)/features/Header.tsx +3 -14
- package/src/app/market/(mobile)/features/Header.tsx +3 -1
- package/src/app/market/features/AgentDetailContent/AgentInfo/index.tsx +5 -1
- package/src/app/market/features/AgentDetailContent/AgentInfo/style.ts +2 -1
- package/src/app/market/features/ShareAgentButton/Inner.tsx +52 -0
- package/src/app/market/features/ShareAgentButton/index.tsx +43 -0
- package/src/features/AgentInfo/index.tsx +3 -2
- package/src/features/AgentSetting/AgentPlugin/PluginSettings.tsx +10 -7
- package/src/features/PluginSettings/index.tsx +10 -7
- package/src/locales/default/chat.ts +3 -1
- package/src/locales/default/common.ts +0 -3
- package/src/locales/default/error.ts +1 -1
- package/src/locales/default/market.ts +14 -0
- package/src/store/global/initialState.ts +2 -0
- package/src/store/global/selectors/preference.ts +10 -0
- package/src/store/global/selectors.ts +1 -0
- package/src/store/session/slices/session/selectors/index.ts +6 -0
- package/src/store/session/slices/session/selectors/list.ts +7 -0
- package/.github/workflows/issue-remove-inactive.yml +0 -26
- package/.github/workflows/pr-welcome.yml +0 -27
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
"debug": {
|
|
3
3
|
"arguments": "參數",
|
|
4
4
|
"function_call": "函式呼叫",
|
|
5
|
-
"response": "回應"
|
|
5
|
+
"response": "回應",
|
|
6
|
+
"off": "關閉偵錯",
|
|
7
|
+
"on": "查看插件呼叫資訊"
|
|
6
8
|
},
|
|
7
9
|
"dev": {
|
|
8
10
|
"confirmDeleteDevPlugin": "您確定要刪除此本機外掛嗎?一旦刪除,將無法復原。",
|
|
@@ -89,8 +91,8 @@
|
|
|
89
91
|
}
|
|
90
92
|
},
|
|
91
93
|
"loading": {
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
+
"plugin": "外掛執行中...",
|
|
95
|
+
"content": "呼叫插件中..."
|
|
94
96
|
},
|
|
95
97
|
"pluginList": "外掛清單",
|
|
96
98
|
"plugins": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.96.1",
|
|
4
4
|
"description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatbot",
|
|
Binary file
|
|
@@ -7,7 +7,17 @@ import FolderPanel from '@/features/FolderPanel';
|
|
|
7
7
|
import SessionListContent from '../../features/SessionListContent';
|
|
8
8
|
import Header from './SessionHeader';
|
|
9
9
|
|
|
10
|
-
const useStyles = createStyles(({ stylish }) =>
|
|
10
|
+
const useStyles = createStyles(({ stylish, css, cx }) =>
|
|
11
|
+
cx(
|
|
12
|
+
stylish.noScrollbar,
|
|
13
|
+
css`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 2px;
|
|
17
|
+
padding: 0 6px;
|
|
18
|
+
`,
|
|
19
|
+
),
|
|
20
|
+
);
|
|
11
21
|
|
|
12
22
|
const Sessions = memo(() => {
|
|
13
23
|
const { styles } = useStyles();
|
|
@@ -15,7 +25,7 @@ const Sessions = memo(() => {
|
|
|
15
25
|
return (
|
|
16
26
|
<FolderPanel>
|
|
17
27
|
<Header />
|
|
18
|
-
<DraggablePanelBody className={styles}
|
|
28
|
+
<DraggablePanelBody className={styles}>
|
|
19
29
|
<SessionListContent />
|
|
20
30
|
</DraggablePanelBody>
|
|
21
31
|
</FolderPanel>
|
|
@@ -130,7 +130,7 @@ const Preview = memo<PreviewProps>(({ withSystemRole, imageType, withBackground,
|
|
|
130
130
|
</Flexbox>
|
|
131
131
|
{withSystemRole && systemRole && (
|
|
132
132
|
<div className={styles.role}>
|
|
133
|
-
<Markdown>{systemRole}</Markdown>
|
|
133
|
+
<Markdown className={styles.markdown}>{systemRole}</Markdown>
|
|
134
134
|
</div>
|
|
135
135
|
)}
|
|
136
136
|
</div>
|
|
@@ -31,6 +31,7 @@ export const useStyles = createStyles(({ css, token, stylish, cx }, withBackgrou
|
|
|
31
31
|
background: ${token.colorBgContainer};
|
|
32
32
|
border-bottom: 1px solid ${token.colorBorder};
|
|
33
33
|
`,
|
|
34
|
+
markdown: stylish.markdownInChat,
|
|
34
35
|
preview: cx(
|
|
35
36
|
stylish.noScrollbar,
|
|
36
37
|
css`
|
|
@@ -12,10 +12,8 @@ import { ChatTranslate } from '@/types/chatMessage';
|
|
|
12
12
|
|
|
13
13
|
import BubblesLoading from '../Loading';
|
|
14
14
|
|
|
15
|
-
const useStyles = createStyles(({
|
|
16
|
-
|
|
17
|
-
margin-top: 8px;
|
|
18
|
-
`,
|
|
15
|
+
const useStyles = createStyles(({ stylish }) => ({
|
|
16
|
+
markdown: stylish.markdownInChat,
|
|
19
17
|
}));
|
|
20
18
|
|
|
21
19
|
interface TranslateProps extends ChatTranslate {
|
|
@@ -24,7 +22,7 @@ interface TranslateProps extends ChatTranslate {
|
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
const Translate = memo<TranslateProps>(({ content = '', from, to, id, loading }) => {
|
|
27
|
-
const { theme } = useStyles();
|
|
25
|
+
const { theme, styles } = useStyles();
|
|
28
26
|
const { t } = useTranslation('common');
|
|
29
27
|
const [show, setShow] = useState(true);
|
|
30
28
|
const clearTranslate = useSessionStore((s) => s.clearTranslate);
|
|
@@ -67,7 +65,11 @@ const Translate = memo<TranslateProps>(({ content = '', from, to, id, loading })
|
|
|
67
65
|
/>
|
|
68
66
|
</Flexbox>
|
|
69
67
|
</Flexbox>
|
|
70
|
-
{!show ? null : loading && !content ?
|
|
68
|
+
{!show ? null : loading && !content ? (
|
|
69
|
+
<BubblesLoading />
|
|
70
|
+
) : (
|
|
71
|
+
<Markdown className={styles.markdown}>{content}</Markdown>
|
|
72
|
+
)}
|
|
71
73
|
</Flexbox>
|
|
72
74
|
);
|
|
73
75
|
});
|
|
@@ -6,10 +6,10 @@ import { memo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
const useStyles = createStyles(({ css, prefixCls, token }) => ({
|
|
8
8
|
container: css`
|
|
9
|
-
border-radius: 0;
|
|
10
9
|
.${prefixCls}-collapse-header {
|
|
11
10
|
padding-inline: 16px !important;
|
|
12
11
|
color: ${token.colorTextDescription} !important;
|
|
12
|
+
border-radius: 8px !important;
|
|
13
13
|
|
|
14
14
|
&:hover {
|
|
15
15
|
color: ${token.colorText} !important;
|
|
@@ -18,6 +18,7 @@ const useStyles = createStyles(({ css }) => {
|
|
|
18
18
|
return {
|
|
19
19
|
container: css`
|
|
20
20
|
position: relative;
|
|
21
|
+
border-radius: 8px;
|
|
21
22
|
`,
|
|
22
23
|
|
|
23
24
|
modalRoot: css`
|
|
@@ -96,21 +97,23 @@ const SessionItem = memo<SessionItemProps>(({ id }) => {
|
|
|
96
97
|
);
|
|
97
98
|
|
|
98
99
|
return (
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
<Flexbox paddingBlock={1}>
|
|
101
|
+
<Item
|
|
102
|
+
actions={actions}
|
|
103
|
+
// needn't active state in mobile
|
|
104
|
+
active={mobile ? false : active}
|
|
105
|
+
addon={addon}
|
|
106
|
+
avatar={avatarRender}
|
|
107
|
+
className={styles.container}
|
|
108
|
+
date={updateAt}
|
|
109
|
+
description={description || systemRole}
|
|
110
|
+
loading={loading}
|
|
111
|
+
pin={pin}
|
|
112
|
+
ref={ref}
|
|
113
|
+
showAction={open || isHovering}
|
|
114
|
+
title={title}
|
|
115
|
+
/>
|
|
116
|
+
</Flexbox>
|
|
114
117
|
);
|
|
115
118
|
}, shallow);
|
|
116
119
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createStyles, useResponsive } from 'antd-style';
|
|
2
|
-
import isEqual from 'fast-deep-equal';
|
|
3
2
|
import Link from 'next/link';
|
|
4
3
|
import { memo } from 'react';
|
|
5
4
|
import LazyLoad from 'react-lazy-load';
|
|
6
5
|
|
|
7
6
|
import { SESSION_CHAT_URL } from '@/const/url';
|
|
8
7
|
import { useSessionHydrated, useSessionStore } from '@/store/session';
|
|
9
|
-
import {
|
|
8
|
+
import { LobeAgentSession } from '@/types/session';
|
|
10
9
|
|
|
11
10
|
import AddButton from './AddButton';
|
|
12
11
|
import SessionItem from './Item';
|
|
@@ -18,8 +17,10 @@ const useStyles = createStyles(
|
|
|
18
17
|
`,
|
|
19
18
|
);
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
interface SessionListProps {
|
|
21
|
+
dataSource: LobeAgentSession[];
|
|
22
|
+
}
|
|
23
|
+
const SessionList = memo<SessionListProps>(({ dataSource }) => {
|
|
23
24
|
const [activeSession, switchSession] = useSessionStore((s) => [s.activeSession, s.switchSession]);
|
|
24
25
|
const { styles } = useStyles();
|
|
25
26
|
const isInit = useSessionHydrated();
|
|
@@ -28,8 +29,8 @@ const SessionList = memo(() => {
|
|
|
28
29
|
|
|
29
30
|
return !isInit ? (
|
|
30
31
|
<SkeletonList />
|
|
31
|
-
) :
|
|
32
|
-
|
|
32
|
+
) : dataSource.length > 0 ? (
|
|
33
|
+
dataSource.map(({ id }) => (
|
|
33
34
|
<LazyLoad className={styles} key={id}>
|
|
34
35
|
<Link
|
|
35
36
|
aria-label={id}
|
|
@@ -1,28 +1,52 @@
|
|
|
1
1
|
import { CollapseProps } from 'antd';
|
|
2
|
-
import
|
|
2
|
+
import isEqual from 'fast-deep-equal';
|
|
3
|
+
import { memo } from 'react';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
4
5
|
|
|
6
|
+
import { preferenceSelectors, useGlobalStore } from '@/store/global';
|
|
7
|
+
import { useSessionStore } from '@/store/session';
|
|
8
|
+
import { sessionSelectors } from '@/store/session/selectors';
|
|
9
|
+
|
|
5
10
|
import CollapseGroup from './CollapseGroup';
|
|
6
11
|
import Inbox from './Inbox';
|
|
7
12
|
import SessionList from './List';
|
|
8
13
|
|
|
9
14
|
const SessionListContent = memo(() => {
|
|
10
|
-
const { t } = useTranslation('
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const { t } = useTranslation('chat');
|
|
16
|
+
const unpinnedSessionList = useSessionStore(sessionSelectors.unpinnedSessionList, isEqual);
|
|
17
|
+
const pinnedList = useSessionStore(sessionSelectors.pinnedSessionList, isEqual);
|
|
18
|
+
const hasPinnedSessionList = useSessionStore(sessionSelectors.hasPinnedSessionList);
|
|
19
|
+
|
|
20
|
+
const [sessionGroupKeys, updatePreference] = useGlobalStore((s) => [
|
|
21
|
+
preferenceSelectors.sessionGroupKeys(s),
|
|
22
|
+
s.updatePreference,
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
const items = [
|
|
26
|
+
hasPinnedSessionList && {
|
|
27
|
+
children: <SessionList dataSource={pinnedList} />,
|
|
28
|
+
key: 'pinned',
|
|
29
|
+
label: t('pin'),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
children: <SessionList dataSource={unpinnedSessionList} />,
|
|
33
|
+
key: 'sessionList',
|
|
34
|
+
label: t('sessionList'),
|
|
35
|
+
},
|
|
36
|
+
].filter(Boolean) as CollapseProps['items'];
|
|
21
37
|
|
|
22
38
|
return (
|
|
23
39
|
<>
|
|
24
40
|
<Inbox />
|
|
25
|
-
<CollapseGroup
|
|
41
|
+
<CollapseGroup
|
|
42
|
+
activeKey={sessionGroupKeys}
|
|
43
|
+
items={items}
|
|
44
|
+
onChange={(keys) => {
|
|
45
|
+
const sessionGroupKeys = typeof keys === 'string' ? [keys] : keys;
|
|
46
|
+
|
|
47
|
+
updatePreference({ sessionGroupKeys });
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
26
50
|
</>
|
|
27
51
|
);
|
|
28
52
|
});
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { ChatHeader,
|
|
2
|
-
import { Button } from 'antd';
|
|
1
|
+
import { ChatHeader, Logo } from '@lobehub/ui';
|
|
3
2
|
import { createStyles } from 'antd-style';
|
|
4
|
-
import { Bot } from 'lucide-react';
|
|
5
3
|
import Link from 'next/link';
|
|
6
4
|
import { memo } from 'react';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
5
|
|
|
9
|
-
import
|
|
6
|
+
import ShareAgentButton from '../../features/ShareAgentButton';
|
|
10
7
|
|
|
11
8
|
export const useStyles = createStyles(({ css, token }) => ({
|
|
12
9
|
logo: css`
|
|
@@ -17,7 +14,6 @@ export const useStyles = createStyles(({ css, token }) => ({
|
|
|
17
14
|
|
|
18
15
|
const Header = memo(() => {
|
|
19
16
|
const { styles } = useStyles();
|
|
20
|
-
const { t } = useTranslation('market');
|
|
21
17
|
|
|
22
18
|
return (
|
|
23
19
|
<ChatHeader
|
|
@@ -26,14 +22,7 @@ const Header = memo(() => {
|
|
|
26
22
|
<Logo className={styles.logo} extra={'Discover'} size={36} type={'text'} />
|
|
27
23
|
</Link>
|
|
28
24
|
}
|
|
29
|
-
right={
|
|
30
|
-
<Button
|
|
31
|
-
icon={<Icon icon={Bot} />}
|
|
32
|
-
onClick={() => window.open(AGENTS_INDEX_GITHUB, '__blank')}
|
|
33
|
-
>
|
|
34
|
-
{t('submitAgent')}
|
|
35
|
-
</Button>
|
|
36
|
-
}
|
|
25
|
+
right={<ShareAgentButton />}
|
|
37
26
|
/>
|
|
38
27
|
);
|
|
39
28
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Logo, MobileNavBar } from '@lobehub/ui';
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
|
|
4
|
+
import ShareAgentButton from '../../features/ShareAgentButton';
|
|
5
|
+
|
|
4
6
|
const Header = memo(() => {
|
|
5
|
-
return <MobileNavBar center={<Logo type={'text'} />} />;
|
|
7
|
+
return <MobileNavBar center={<Logo type={'text'} />} right={<ShareAgentButton mobile />} />;
|
|
6
8
|
});
|
|
7
9
|
|
|
8
10
|
export default Header;
|
|
@@ -59,7 +59,11 @@ const AgentModalInner = memo(() => {
|
|
|
59
59
|
/>
|
|
60
60
|
</Flexbox>
|
|
61
61
|
<Flexbox style={{ padding: 16 }}>
|
|
62
|
-
{tab === InfoTabs.prompt &&
|
|
62
|
+
{tab === InfoTabs.prompt && (
|
|
63
|
+
<Markdown className={styles.markdown} fullFeaturedCodeBlock>
|
|
64
|
+
{systemRole}
|
|
65
|
+
</Markdown>
|
|
66
|
+
)}
|
|
63
67
|
{tab === InfoTabs.comment && <Comment identifier={identifier} />}
|
|
64
68
|
</Flexbox>
|
|
65
69
|
</>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createStyles } from 'antd-style';
|
|
2
2
|
|
|
3
|
-
export const useStyles = createStyles(({ css, token, prefixCls }) => ({
|
|
3
|
+
export const useStyles = createStyles(({ css, token, prefixCls, stylish }) => ({
|
|
4
4
|
author: css`
|
|
5
5
|
font-size: 12px;
|
|
6
6
|
`,
|
|
@@ -27,6 +27,7 @@ export const useStyles = createStyles(({ css, token, prefixCls }) => ({
|
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
}
|
|
29
29
|
`,
|
|
30
|
+
markdown: stylish.markdownInChat,
|
|
30
31
|
nav: css`
|
|
31
32
|
padding-top: 4px;
|
|
32
33
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Icon } from '@lobehub/ui';
|
|
2
|
+
import { Button, Divider, Tag } from 'antd';
|
|
3
|
+
import { Github, Settings, Share2 } from 'lucide-react';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
|
|
8
|
+
import { AGENTS_INDEX_GITHUB } from '@/const/url';
|
|
9
|
+
|
|
10
|
+
const Inner = memo(() => {
|
|
11
|
+
const { t } = useTranslation('market');
|
|
12
|
+
return (
|
|
13
|
+
<div>
|
|
14
|
+
<Image
|
|
15
|
+
alt={'banner'}
|
|
16
|
+
height={602}
|
|
17
|
+
src={'/images/market_modal_banner.webp'}
|
|
18
|
+
style={{ height: 'auto', marginBottom: 24, width: '100%' }}
|
|
19
|
+
width={1602}
|
|
20
|
+
/>
|
|
21
|
+
<h3>
|
|
22
|
+
<Tag color={'cyan'}>{t('guide.func1.tag')}</Tag>
|
|
23
|
+
<span>{t('guide.func1.title')}</span>
|
|
24
|
+
</h3>
|
|
25
|
+
<p>
|
|
26
|
+
<Icon icon={Settings} />
|
|
27
|
+
{' - '}
|
|
28
|
+
{t('guide.func1.desc1')}
|
|
29
|
+
<br />
|
|
30
|
+
<Icon icon={Share2} />
|
|
31
|
+
{' - '}
|
|
32
|
+
{t('guide.func1.desc2')}
|
|
33
|
+
</p>
|
|
34
|
+
<Divider />
|
|
35
|
+
<h3>
|
|
36
|
+
<Tag color={'cyan'}>{t('guide.func2.tag')}</Tag>
|
|
37
|
+
<span>{t('guide.func2.title')}</span>
|
|
38
|
+
</h3>
|
|
39
|
+
<p>{t('guide.func2.desc')}</p>
|
|
40
|
+
<br />
|
|
41
|
+
<Button
|
|
42
|
+
icon={<Icon icon={Github} />}
|
|
43
|
+
onClick={() => window.open(AGENTS_INDEX_GITHUB, '__blank')}
|
|
44
|
+
type={'primary'}
|
|
45
|
+
>
|
|
46
|
+
{t('guide.func2.button')}
|
|
47
|
+
</Button>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export default Inner;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ActionIcon, Icon, Modal } from '@lobehub/ui';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import { Share2 } from 'lucide-react';
|
|
4
|
+
import { memo, useState } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
|
|
7
|
+
import { MOBILE_HEADER_ICON_SIZE } from '@/const/layoutTokens';
|
|
8
|
+
|
|
9
|
+
import Inner from './Inner';
|
|
10
|
+
|
|
11
|
+
const ShareAgentButton = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
12
|
+
const { t } = useTranslation('market');
|
|
13
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
14
|
+
|
|
15
|
+
const buttonContent = mobile ? (
|
|
16
|
+
<ActionIcon
|
|
17
|
+
icon={Share2}
|
|
18
|
+
onClick={() => setIsModalOpen(true)}
|
|
19
|
+
size={MOBILE_HEADER_ICON_SIZE}
|
|
20
|
+
title={t('submitAgent')}
|
|
21
|
+
/>
|
|
22
|
+
) : (
|
|
23
|
+
<Button icon={<Icon icon={Share2} />} onClick={() => setIsModalOpen(true)}>
|
|
24
|
+
{t('submitAgent')}
|
|
25
|
+
</Button>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
{buttonContent}
|
|
31
|
+
<Modal
|
|
32
|
+
footer={null}
|
|
33
|
+
onCancel={() => setIsModalOpen(false)}
|
|
34
|
+
open={isModalOpen}
|
|
35
|
+
title={t('submitAgent')}
|
|
36
|
+
>
|
|
37
|
+
<Inner />
|
|
38
|
+
</Modal>
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export default ShareAgentButton;
|
|
@@ -7,7 +7,7 @@ import { Center } from 'react-layout-kit';
|
|
|
7
7
|
|
|
8
8
|
import { MetaData } from '@/types/meta';
|
|
9
9
|
|
|
10
|
-
const useStyles = createStyles(({ css, token }) => ({
|
|
10
|
+
const useStyles = createStyles(({ css, token, stylish }) => ({
|
|
11
11
|
avatar: css`
|
|
12
12
|
flex: none;
|
|
13
13
|
`,
|
|
@@ -15,6 +15,7 @@ const useStyles = createStyles(({ css, token }) => ({
|
|
|
15
15
|
color: ${token.colorTextDescription};
|
|
16
16
|
text-align: center;
|
|
17
17
|
`,
|
|
18
|
+
markdown: stylish.markdownInChat,
|
|
18
19
|
|
|
19
20
|
title: css`
|
|
20
21
|
font-size: 20px;
|
|
@@ -59,7 +60,7 @@ const AgentInfo = memo<AgentInfoProps>(({ systemRole, style, meta }) => {
|
|
|
59
60
|
{systemRole && (
|
|
60
61
|
<>
|
|
61
62
|
<Divider style={{ margin: '8px 0' }} />
|
|
62
|
-
<Markdown>{systemRole}</Markdown>
|
|
63
|
+
<Markdown className={styles.markdown}>{systemRole}</Markdown>
|
|
63
64
|
</>
|
|
64
65
|
)}
|
|
65
66
|
</Center>
|
|
@@ -12,12 +12,15 @@ import { pluginHelpers, pluginSelectors, usePluginStore } from '@/store/plugin';
|
|
|
12
12
|
|
|
13
13
|
import { useStore } from '../store';
|
|
14
14
|
|
|
15
|
-
const useStyles = createStyles(({ css, token }) => ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const useStyles = createStyles(({ css, token, cx, stylish }) => ({
|
|
16
|
+
markdown: cx(
|
|
17
|
+
stylish.markdownInChat,
|
|
18
|
+
css`
|
|
19
|
+
p {
|
|
20
|
+
color: ${token.colorTextDescription};
|
|
21
|
+
}
|
|
22
|
+
`,
|
|
23
|
+
),
|
|
21
24
|
}));
|
|
22
25
|
|
|
23
26
|
const PluginSettings = memo(() => {
|
|
@@ -62,7 +65,7 @@ const PluginSettings = memo(() => {
|
|
|
62
65
|
type={item.type as any}
|
|
63
66
|
/>
|
|
64
67
|
),
|
|
65
|
-
desc: item.desc && <Markdown className={styles.
|
|
68
|
+
desc: item.desc && <Markdown className={styles.markdown}>{item.desc}</Markdown>,
|
|
66
69
|
})),
|
|
67
70
|
icon: ToyBrick,
|
|
68
71
|
title: t('settingPlugin.config', { id: pluginHelpers.getPluginTitle(item.meta) }),
|
|
@@ -26,12 +26,15 @@ interface PluginSettingsConfigProps {
|
|
|
26
26
|
schema: PluginSchema;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const useStyles = createStyles(({ css, token }) => ({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const useStyles = createStyles(({ css, token, stylish, cx }) => ({
|
|
30
|
+
markdown: cx(
|
|
31
|
+
stylish.markdownInChat,
|
|
32
|
+
css`
|
|
33
|
+
p {
|
|
34
|
+
color: ${token.colorTextDescription};
|
|
35
|
+
}
|
|
36
|
+
`,
|
|
37
|
+
),
|
|
35
38
|
}));
|
|
36
39
|
|
|
37
40
|
const PluginSettingsConfig = memo<PluginSettingsConfigProps>(({ schema, id }) => {
|
|
@@ -45,7 +48,7 @@ const PluginSettingsConfig = memo<PluginSettingsConfigProps>(({ schema, id }) =>
|
|
|
45
48
|
<Form layout={'vertical'}>
|
|
46
49
|
{items.map((item) => (
|
|
47
50
|
<Form.Item
|
|
48
|
-
desc={item.desc && <Markdown className={styles.
|
|
51
|
+
desc={item.desc && <Markdown className={styles.markdown}>{item.desc as string}</Markdown>}
|
|
49
52
|
key={item.label}
|
|
50
53
|
label={item.label}
|
|
51
54
|
tag={item.tag}
|
|
@@ -18,12 +18,14 @@ export default {
|
|
|
18
18
|
newAgent: '新建助手',
|
|
19
19
|
noDescription: '暂无描述',
|
|
20
20
|
|
|
21
|
+
pin: '置顶',
|
|
22
|
+
pinOff: '取消置顶',
|
|
21
23
|
regenerate: '重新生成',
|
|
22
|
-
|
|
23
24
|
roleAndArchive: '角色与记录',
|
|
24
25
|
searchAgentPlaceholder: '搜索助手和对话...',
|
|
25
26
|
send: '发送',
|
|
26
27
|
sendPlaceholder: '输入聊天内容...',
|
|
28
|
+
sessionList: '助手列表',
|
|
27
29
|
shareModal: {
|
|
28
30
|
download: '下载截图',
|
|
29
31
|
imageType: '图片格式',
|
|
@@ -30,7 +30,6 @@ export default {
|
|
|
30
30
|
feedback: '反馈与建议',
|
|
31
31
|
historyRange: '历史范围',
|
|
32
32
|
import: '导入配置',
|
|
33
|
-
|
|
34
33
|
lang: {
|
|
35
34
|
'en': '英语',
|
|
36
35
|
'en-US': '英语',
|
|
@@ -52,7 +51,6 @@ export default {
|
|
|
52
51
|
reset: '重置',
|
|
53
52
|
retry: '重试',
|
|
54
53
|
send: '发送',
|
|
55
|
-
sessionList: '助手列表',
|
|
56
54
|
setting: '设置',
|
|
57
55
|
share: '分享',
|
|
58
56
|
stop: '停止',
|
|
@@ -62,7 +60,6 @@ export default {
|
|
|
62
60
|
setting: '设置',
|
|
63
61
|
},
|
|
64
62
|
temp: '临时',
|
|
65
|
-
|
|
66
63
|
updateAgent: '更新助理信息',
|
|
67
64
|
upgradeVersion: {
|
|
68
65
|
action: '立即升级',
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
addAgent: '添加助手',
|
|
3
|
+
guide: {
|
|
4
|
+
func1: {
|
|
5
|
+
desc1: '在会话窗口中通过右上角设置进入你想提交助手的设置页面;',
|
|
6
|
+
desc2: '点击右上角提交到助手市场按钮。',
|
|
7
|
+
tag: '方法一',
|
|
8
|
+
title: '通过 LobeChat 提交',
|
|
9
|
+
},
|
|
10
|
+
func2: {
|
|
11
|
+
button: '前往 Github 助手仓库',
|
|
12
|
+
desc: '如果您想将助手添加到索引中,请使用 agent-template.json 或 agent-template-full.json 在 plugins 目录中创建一个条目,编写简短的描述并适当标记,然后创建一个拉取请求。',
|
|
13
|
+
tag: '方法二',
|
|
14
|
+
title: '通过 Github 提交',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
3
17
|
search: {
|
|
4
18
|
placeholder: '搜索助手名称介绍或关键词...',
|
|
5
19
|
},
|
|
@@ -22,6 +22,7 @@ export interface GlobalPreference {
|
|
|
22
22
|
guide?: Guide;
|
|
23
23
|
inputHeight: number;
|
|
24
24
|
mobileShowTopic?: boolean;
|
|
25
|
+
sessionGroupKeys: string[];
|
|
25
26
|
sessionsWidth: number;
|
|
26
27
|
showChatSideBar?: boolean;
|
|
27
28
|
showSessionPanel?: boolean;
|
|
@@ -49,6 +50,7 @@ export const initialState: GlobalState = {
|
|
|
49
50
|
guide: {},
|
|
50
51
|
inputHeight: 200,
|
|
51
52
|
mobileShowTopic: false,
|
|
53
|
+
sessionGroupKeys: ['pinned', 'sessionList'],
|
|
52
54
|
sessionsWidth: 320,
|
|
53
55
|
showChatSideBar: true,
|
|
54
56
|
showSessionPanel: true,
|