@lobehub/chat 0.98.1 → 0.98.3
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/release.yml +14 -3
- package/CHANGELOG.md +50 -0
- package/README.md +2 -2
- package/README.zh-CN.md +12 -12
- package/package.json +1 -1
- package/src/app/chat/features/Conversation/ChatList/Plugins/Render/StandaloneType/Iframe.tsx +2 -2
- package/src/app/home/Redirect.tsx +2 -2
- package/src/layout/GlobalLayout/Locale.tsx +6 -11
- package/src/store/session/hooks/useSessionHydrated.ts +2 -2
- package/src/store/session/slices/session/selectors/index.ts +2 -0
- package/src/store/session/slices/session/selectors/list.ts +7 -0
|
@@ -23,11 +23,22 @@ jobs:
|
|
|
23
23
|
- name: Test
|
|
24
24
|
run: bun run test
|
|
25
25
|
|
|
26
|
-
- name: Workflow
|
|
27
|
-
run: bun run workflow:readme
|
|
28
|
-
|
|
29
26
|
- name: Release
|
|
30
27
|
run: bun run release
|
|
31
28
|
env:
|
|
32
29
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
33
30
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
31
|
+
|
|
32
|
+
- name: Workflow
|
|
33
|
+
run: bun run workflow:readme
|
|
34
|
+
|
|
35
|
+
- name: Commit changes
|
|
36
|
+
run: |-
|
|
37
|
+
git diff
|
|
38
|
+
git config --global user.name "lobehubbot"
|
|
39
|
+
git config --global user.email "i@lobehub.com"
|
|
40
|
+
git add .
|
|
41
|
+
git commit -m "📝 docs(bot): Auto sync agents & plugin to readme" || exit 0
|
|
42
|
+
git push
|
|
43
|
+
env:
|
|
44
|
+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.98.3](https://github.com/lobehub/lobe-chat/compare/v0.98.2...v0.98.3)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-11-07**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix redirect to welcome problem when there are topics in inbox.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Fix redirect to welcome problem when there are topics in inbox, closes [#422](https://github.com/lobehub/lobe-chat/issues/422) ([3d2588a](https://github.com/lobehub/lobe-chat/commit/3d2588a))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.98.2](https://github.com/lobehub/lobe-chat/compare/v0.98.1...v0.98.2)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-11-07**</sup>
|
|
33
|
+
|
|
34
|
+
#### ♻ Code Refactoring
|
|
35
|
+
|
|
36
|
+
- **misc**: Refactor antd locale file to useSWR.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### Code refactoring
|
|
44
|
+
|
|
45
|
+
- **misc**: Refactor antd locale file to useSWR ([2e1cd7c](https://github.com/lobehub/lobe-chat/commit/2e1cd7c))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 0.98.1](https://github.com/lobehub/lobe-chat/compare/v0.98.0...v0.98.1)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2023-11-07**</sup>
|
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ By establishing a versatile plugin system, ChatGPT becomes capable of delivering
|
|
|
122
122
|
|
|
123
123
|
In our agent market. We have accumulated a large number of practical, prompt agents that have been used in daily work and study. You can also share your agents here and iterate and optimize your prompt agents with more people. You can submit your agents through [🤖/🏪 Submit Agents][submit-agents-link], and our automated i18n workflow will automatically translate your agents into multiple languages, allowing users worldwide to enjoy your wisdom.
|
|
124
124
|
|
|
125
|
-
<!-- AGENT LIST -->
|
|
125
|
+
<!-- AGENT LIST -->
|
|
126
126
|
|
|
127
127
|
| Recent Submits | Description |
|
|
128
128
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -297,7 +297,7 @@ Plugins provide a means to extend the [Function Calling][fc-link] capabilities o
|
|
|
297
297
|
> - [x] [**Plugin Phase 2**](https://github.com/lobehub/lobe-chat/issues/97): The security and stability of the plugin's use, more accurately presenting abnormal states, the maintainability of the plugin architecture, and developer-friendly.
|
|
298
298
|
> - [ ] [**Plugin Phase 3**](https://github.com/lobehub/lobe-chat/issues/149): Higher-level and more comprehensive customization capabilities, support for plugin authentication, and examples.
|
|
299
299
|
|
|
300
|
-
<!-- PLUGIN LIST -->
|
|
300
|
+
<!-- PLUGIN LIST -->
|
|
301
301
|
|
|
302
302
|
| Official Plugin | Repository | Description |
|
|
303
303
|
| ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
package/README.zh-CN.md
CHANGED
|
@@ -120,14 +120,14 @@ LobeChat 是一个开源的、可扩展的([Function Calling][fc-link])高
|
|
|
120
120
|
|
|
121
121
|
在我们的助手市场中,我们积累了大量实用的助手 Prompt,这些都是在日常工作和学习中得到实际应用的。你也可以在这里分享你的助手,与更多的人一起迭代和优化你的助手提示词。你可以通过 [🤖/🏪 提交助手][submit-agents-link] 来提交你的助手,我们构建的自动化 i18n 工作流将会自动将你的助手翻译成多语言版本,让多语种用户都能享受到你的智慧成果。
|
|
122
122
|
|
|
123
|
-
<!-- AGENT LIST -->
|
|
123
|
+
<!-- AGENT LIST -->
|
|
124
124
|
|
|
125
|
-
| 最近新增
|
|
126
|
-
|
|
|
127
|
-
| [LobeChat 技术文档专家](https://chat-preview.lobehub.com/market?agent=lobe-chat-develop-doc-writter)<br/><sup>By **[arvinxx](https://github.com/arvinxx)** on **2023-11-05**</sup> | LobeChat是一个Next.js框架构建的AI会话应用,我将会帮你一起书写 LobeChat 的开发文档<br/>`开发文档` `技术介绍` `next-js` `react` `lobe-chat` |
|
|
128
|
-
| [Sketch 特性总结专家](https://chat-preview.lobehub.com/market?agent=sketch-changelog-highlighter)<br/><sup>By **[arvinxx](https://github.com/arvinxx)** on **2023-11-02**</sup> | 擅长从 Sketch 的更新日志中提取关键变更要点<br/>`体验设计` `sketch` `更新` `特性` `文本总结`
|
|
129
|
-
| [抬杠高手](https://chat-preview.lobehub.com/market?agent=tqg-20231026)<br/><sup>By **[cake79](https://github.com/cake79)** on **2023-10-26**</sup>
|
|
130
|
-
| [图表生成器](https://chat-preview.lobehub.com/market?agent=graph-generator)<br/><sup>By **[choldrim](https://github.com/choldrim)** on **2023-10-23**</sup>
|
|
125
|
+
| 最近新增 | 助手说明 |
|
|
126
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
127
|
+
| [LobeChat 技术文档专家](https://chat-preview.lobehub.com/market?agent=lobe-chat-develop-doc-writter)<br/><sup>By **[arvinxx](https://github.com/arvinxx)** on **2023-11-05**</sup> | LobeChat 是一个 Next.js 框架构建的 AI 会话应用,我将会帮你一起书写 LobeChat 的开发文档<br/>`开发文档` `技术介绍` `next-js` `react` `lobe-chat` |
|
|
128
|
+
| [Sketch 特性总结专家](https://chat-preview.lobehub.com/market?agent=sketch-changelog-highlighter)<br/><sup>By **[arvinxx](https://github.com/arvinxx)** on **2023-11-02**</sup> | 擅长从 Sketch 的更新日志中提取关键变更要点<br/>`体验设计` `sketch` `更新` `特性` `文本总结` |
|
|
129
|
+
| [抬杠高手](https://chat-preview.lobehub.com/market?agent=tqg-20231026)<br/><sup>By **[cake79](https://github.com/cake79)** on **2023-10-26**</sup> | 模拟那些喜欢抬杠的人,能对用户输入的任何观点进行抬杠表达的角色<br/>`写作` `对话` |
|
|
130
|
+
| [图表生成器](https://chat-preview.lobehub.com/market?agent=graph-generator)<br/><sup>By **[choldrim](https://github.com/choldrim)** on **2023-10-23**</sup> | 自动图表生成器<br/>`图表` |
|
|
131
131
|
|
|
132
132
|
> 📊 Total agents: [<kbd>**38**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
133
133
|
|
|
@@ -299,14 +299,14 @@ $ docker run -d -p 3210:3210 \
|
|
|
299
299
|
> - [x] [**插件二期**](https://github.com/lobehub/lobe-chat/issues/97): 插件的安全性与使用的稳定性,更加精准地呈现异常状态,插件架构的可维护性与开发者友好
|
|
300
300
|
> - [ ] [**插件三期**](https://github.com/lobehub/lobe-chat/issues/149):更高阶与完善的自定义能力,支持插件鉴权与示例
|
|
301
301
|
|
|
302
|
-
<!-- PLUGIN LIST -->
|
|
302
|
+
<!-- PLUGIN LIST -->
|
|
303
303
|
|
|
304
|
-
| 官方插件 | 仓库
|
|
305
|
-
|
|
|
304
|
+
| 官方插件 | 仓库 | 插件描述 |
|
|
305
|
+
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------- |
|
|
306
306
|
| [时钟时间](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-11-01**</sup> | [lobehub/chat-plugin-clock-time](https://github.com/lobehub/chat-plugin-clock-time) | 显示一个时钟来展示当前时间<br/>`时钟` `时间` |
|
|
307
307
|
| [网站爬虫](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-17**</sup> | [lobehub/chat-plugin-web-crawler](https://github.com/lobehub/chat-plugin-web-crawler) | 从网页链接中提取内容<br/>`网页` `内容爬取器` |
|
|
308
|
-
| [搜索引擎](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-15**</sup> | [lobehub/chat-plugin-search-engine](https://github.com/lobehub/chat-plugin-search-engine) | 查询搜索引擎以获取信息<br/>`网络` `搜索`
|
|
309
|
-
| [实时天气](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-12**</sup> | [lobehub/chat-plugin-realtime-weather](https://github.com/lobehub/chat-plugin-realtime-weather) | 获取实时天气信息<br/>`天气` `实时`
|
|
308
|
+
| [搜索引擎](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-15**</sup> | [lobehub/chat-plugin-search-engine](https://github.com/lobehub/chat-plugin-search-engine) | 查询搜索引擎以获取信息<br/>`网络` `搜索` |
|
|
309
|
+
| [实时天气](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2023-08-12**</sup> | [lobehub/chat-plugin-realtime-weather](https://github.com/lobehub/chat-plugin-realtime-weather) | 获取实时天气信息<br/>`天气` `实时` |
|
|
310
310
|
|
|
311
311
|
> 📊 Total plugins: [<kbd>**4**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
|
312
312
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.98.
|
|
3
|
+
"version": "0.98.3",
|
|
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",
|
package/src/app/chat/features/Conversation/ChatList/Plugins/Render/StandaloneType/Iframe.tsx
CHANGED
|
@@ -2,8 +2,6 @@ import { PluginRequestPayload } from '@lobehub/chat-plugin-sdk';
|
|
|
2
2
|
import { Skeleton } from 'antd';
|
|
3
3
|
import { memo, useRef, useState } from 'react';
|
|
4
4
|
|
|
5
|
-
import { useOnPluginSettingsUpdate } from '@/app/chat/features/Conversation/ChatList/Plugins/Render/utils/pluginSettings';
|
|
6
|
-
import { useOnPluginStateUpdate } from '@/app/chat/features/Conversation/ChatList/Plugins/Render/utils/pluginState';
|
|
7
5
|
import { pluginSelectors, usePluginStore } from '@/store/plugin';
|
|
8
6
|
import { useSessionStore } from '@/store/session';
|
|
9
7
|
import { chatSelectors } from '@/store/session/selectors';
|
|
@@ -15,6 +13,8 @@ import {
|
|
|
15
13
|
useOnPluginFetchPluginState,
|
|
16
14
|
useOnPluginFillContent,
|
|
17
15
|
} from '../utils/listenToPlugin';
|
|
16
|
+
import { useOnPluginSettingsUpdate } from '../utils/pluginSettings';
|
|
17
|
+
import { useOnPluginStateUpdate } from '../utils/pluginState';
|
|
18
18
|
import {
|
|
19
19
|
sendMessageContentToPlugin,
|
|
20
20
|
sendPayloadToPlugin,
|
|
@@ -12,9 +12,9 @@ const Redirect = memo(() => {
|
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
useSessionStore.persist.onFinishHydration(() => {
|
|
14
14
|
const store = useSessionStore.getState();
|
|
15
|
-
const
|
|
15
|
+
const hasConversion = sessionSelectors.hasConversion(store);
|
|
16
16
|
|
|
17
|
-
if (
|
|
17
|
+
if (hasConversion) {
|
|
18
18
|
router.push('/chat');
|
|
19
19
|
store.switchSession();
|
|
20
20
|
} else {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigProvider } from 'antd';
|
|
2
|
-
import defaultLocale from 'antd/locale/en_US';
|
|
3
2
|
import { PropsWithChildren, memo, useState } from 'react';
|
|
3
|
+
import useSWR from 'swr';
|
|
4
4
|
|
|
5
5
|
import { createI18nNext } from '@/locales/create';
|
|
6
6
|
import { useOnFinishHydrationGlobal } from '@/store/global';
|
|
@@ -12,7 +12,11 @@ interface LocaleLayoutProps extends PropsWithChildren {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const InnerLocale = memo<LocaleLayoutProps>(({ children, lang }) => {
|
|
15
|
-
const
|
|
15
|
+
const { data: locale } = useSWR(
|
|
16
|
+
lang,
|
|
17
|
+
async () =>
|
|
18
|
+
await import(`antd/locale/${lang?.includes('-') ? lang?.replace('-', '_') : 'en-US'}.js`),
|
|
19
|
+
);
|
|
16
20
|
const [i18n] = useState(createI18nNext(lang));
|
|
17
21
|
|
|
18
22
|
// if run on server side, init i18n instance everytime
|
|
@@ -27,19 +31,10 @@ const InnerLocale = memo<LocaleLayoutProps>(({ children, lang }) => {
|
|
|
27
31
|
});
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
const getLocale = async (localeName: string) => {
|
|
31
|
-
setLocale((await import(`antd/locale/${localeName}.js`)) as any);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
34
|
useOnFinishHydrationGlobal((s) => {
|
|
35
35
|
if (s.settings.language === 'auto') {
|
|
36
36
|
switchLang('auto');
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
if (lang?.includes('-') && lang !== 'en-US') {
|
|
40
|
-
const localeName = lang?.replace('-', '_');
|
|
41
|
-
getLocale(localeName);
|
|
42
|
-
}
|
|
43
38
|
}, []);
|
|
44
39
|
|
|
45
40
|
return <ConfigProvider locale={locale}>{children}</ConfigProvider>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import { sessionSelectors } from '../selectors';
|
|
3
4
|
import { useSessionStore } from '../store';
|
|
4
5
|
import { useEffectAfterSessionHydrated } from './useEffectAfterHydrated';
|
|
5
6
|
|
|
6
7
|
export const useSessionHydrated = () => {
|
|
7
|
-
|
|
8
|
-
const hasInited = !!Object.values(useSessionStore.getState().sessions).length;
|
|
8
|
+
const hasInited = sessionSelectors.hasConversion(useSessionStore.getState());
|
|
9
9
|
|
|
10
10
|
const [isInit, setInit] = useState(hasInited);
|
|
11
11
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
currentSessionSafe,
|
|
8
8
|
getSessionById,
|
|
9
9
|
getSessionMetaById,
|
|
10
|
+
hasConversion,
|
|
10
11
|
hasPinnedSessionList,
|
|
11
12
|
hasSessionList,
|
|
12
13
|
pinnedSessionList,
|
|
@@ -24,6 +25,7 @@ export const sessionSelectors = {
|
|
|
24
25
|
getExportAgent,
|
|
25
26
|
getSessionById,
|
|
26
27
|
getSessionMetaById,
|
|
28
|
+
hasConversion,
|
|
27
29
|
hasPinnedSessionList,
|
|
28
30
|
hasSessionList,
|
|
29
31
|
isInboxSession,
|
|
@@ -92,3 +92,10 @@ export const getSessionMetaById =
|
|
|
92
92
|
//
|
|
93
93
|
// return sessionTree;
|
|
94
94
|
// };
|
|
95
|
+
|
|
96
|
+
export const hasConversion = (s: SessionStore) => {
|
|
97
|
+
const hasCustomAgents = !!Object.keys(s.sessions).length;
|
|
98
|
+
const hasMessageInInbox = !!Object.keys(s.inbox.chats).length;
|
|
99
|
+
|
|
100
|
+
return hasCustomAgents || hasMessageInInbox;
|
|
101
|
+
};
|