@lobehub/chat 0.119.11 → 0.119.13
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/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/package.json +1 -1
- package/src/app/chat/(desktop)/features/ChatInput/TextArea.tsx +4 -0
- package/src/app/chat/(desktop)/features/SideBar.tsx +1 -0
- package/src/database/models/message.ts +6 -0
- package/src/features/Conversation/Actions/Function.tsx +2 -2
- package/src/services/__tests__/message.test.ts +3 -4
- package/src/services/message.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.119.13](https://github.com/lobehub/lobe-chat/compare/v0.119.12...v0.119.13)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-01-10**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Add delete and regenerate for function message.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Add delete and regenerate for function message, closes [#992](https://github.com/lobehub/lobe-chat/issues/992) ([7f8c717](https://github.com/lobehub/lobe-chat/commit/7f8c717))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.119.12](https://github.com/lobehub/lobe-chat/compare/v0.119.11...v0.119.12)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-01-09**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix new line after sending messages with enter key.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix new line after sending messages with enter key, closes [#990](https://github.com/lobehub/lobe-chat/issues/990) ([e6ab019](https://github.com/lobehub/lobe-chat/commit/e6ab019))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 0.119.11](https://github.com/lobehub/lobe-chat/compare/v0.119.10...v0.119.11)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-01-09**</sup>
|
package/README.md
CHANGED
|
@@ -208,14 +208,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
208
208
|
|
|
209
209
|
<!-- AGENT LIST -->
|
|
210
210
|
|
|
211
|
-
| Recent Submits | Description
|
|
212
|
-
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
213
|
-
| [
|
|
214
|
-
| [
|
|
215
|
-
| [
|
|
216
|
-
| [
|
|
217
|
-
|
|
218
|
-
> 📊 Total agents: [<kbd>**
|
|
211
|
+
| Recent Submits | Description |
|
|
212
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
213
|
+
| [Emoji Generator](https://chat-preview.lobehub.com/market?agent=emoji-generate)<br/><sup>By **[mushan0x0](https://github.com/mushan0x0)** on **2024-01-09**</sup> | Generate emoji expressions based on content<br/>`expression-generation` `emoji` `creative` |
|
|
214
|
+
| [Personal Growth Coach](https://chat-preview.lobehub.com/market?agent=personal-growth-coach)<br/><sup>By **[Ajasra](https://github.com/Ajasra)** on **2024-01-08**</sup> | As an AI Personal Growth Coach, your primary objective is to assist users in their journey of self-improvement and personal development<br/>`personal-growth` `coaching` `self-improvement` `goal-setting` `motivation` |
|
|
215
|
+
| [Performance Evaluation Superhero](https://chat-preview.lobehub.com/market?agent=kpi-hero)<br/><sup>By **[canisminor1990](https://github.com/canisminor1990)** on **2024-01-05**</sup> | Specializes in writing performance evaluation reports and year-end summaries<br/>`performance-evaluation` `report-writing` `data-analysis` `professional-insights` `okr` `kpi` |
|
|
216
|
+
| [SVG Flowchart Explanation Assistant](https://chat-preview.lobehub.com/market?agent=svg-flowchart-explanation-assistant)<br/><sup>By **[Justin3go](https://github.com/Justin3go)** on **2024-01-05**</sup> | Explain SVG flowcharts by inputting SVG source code and interpreting the flowchart.<br/>`flowchart-explanation` `technical-documentation-writing` `business-knowledge` |
|
|
217
|
+
|
|
218
|
+
> 📊 Total agents: [<kbd>**93**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
219
219
|
|
|
220
220
|
<!-- AGENT LIST -->
|
|
221
221
|
|
package/README.zh-CN.md
CHANGED
|
@@ -184,14 +184,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
184
184
|
|
|
185
185
|
<!-- AGENT LIST -->
|
|
186
186
|
|
|
187
|
-
| 最近新增 | 助手说明
|
|
188
|
-
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
189
|
-
| [
|
|
190
|
-
| [
|
|
191
|
-
| [
|
|
192
|
-
| [
|
|
193
|
-
|
|
194
|
-
> 📊 Total agents: [<kbd>**
|
|
187
|
+
| 最近新增 | 助手说明 |
|
|
188
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
189
|
+
| [Emoji 生成](https://chat-preview.lobehub.com/market?agent=emoji-generate)<br/><sup>By **[mushan0x0](https://github.com/mushan0x0)** on **2024-01-09**</sup> | 可以根据内容生成 Emoji 表情<br/>`表情生成` `emoji` `创意` |
|
|
190
|
+
| [个人成长教练](https://chat-preview.lobehub.com/market?agent=personal-growth-coach)<br/><sup>By **[Ajasra](https://github.com/Ajasra)** on **2024-01-08**</sup> | 作为人工智能个人成长教练,您的主要目标是协助用户在自我提升和个人发展的旅程中。<br/>`个人成长` `辅导` `自我提升` `目标设定` `动力` |
|
|
191
|
+
| [绩效评估超人](https://chat-preview.lobehub.com/market?agent=kpi-hero)<br/><sup>By **[canisminor1990](https://github.com/canisminor1990)** on **2024-01-05**</sup> | 擅长写绩效评估报告与年终总结<br/>`绩效评估` `报告撰写` `数据分析` `专业见解` `okr` `kpi` |
|
|
192
|
+
| [SVG 流程图解释助手](https://chat-preview.lobehub.com/market?agent=svg-flowchart-explanation-assistant)<br/><sup>By **[Justin3go](https://github.com/Justin3go)** on **2024-01-05**</sup> | SVG 流程图解释,输入 SVG 源代码,解释该流程图<br/>`流程图解释` `技术文档编写` `业务知识` |
|
|
193
|
+
|
|
194
|
+
> 📊 Total agents: [<kbd>**93**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
195
195
|
|
|
196
196
|
<!-- AGENT LIST -->
|
|
197
197
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.119.
|
|
3
|
+
"version": "0.119.13",
|
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -88,6 +88,10 @@ const InputArea = memo<{ setExpand?: (expand: boolean) => void }>(({ setExpand }
|
|
|
88
88
|
|
|
89
89
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
90
90
|
const send = () => {
|
|
91
|
+
// avoid inserting newline when sending message.
|
|
92
|
+
// refs: https://github.com/lobehub/lobe-chat/pull/989
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
|
|
91
95
|
sendMessage();
|
|
92
96
|
setExpand?.(false);
|
|
93
97
|
};
|
|
@@ -102,6 +102,12 @@ class _MessageModel extends BaseModel {
|
|
|
102
102
|
return super._update(id, data);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
async updatePluginState(id: string, key: string, value: any) {
|
|
106
|
+
const item = await this.findById(id);
|
|
107
|
+
|
|
108
|
+
return this.update(id, { pluginState: { ...item.pluginState, [key]: value } });
|
|
109
|
+
}
|
|
110
|
+
|
|
105
111
|
/**
|
|
106
112
|
* Batch updates multiple fields of the specified messages.
|
|
107
113
|
*
|
|
@@ -5,10 +5,10 @@ import { useChatListActionsBar } from '../hooks/useChatListActionsBar';
|
|
|
5
5
|
import { RenderAction } from '../types';
|
|
6
6
|
|
|
7
7
|
export const FunctionActionsBar: RenderAction = memo(({ onActionClick }) => {
|
|
8
|
-
const { regenerate, divider, del } = useChatListActionsBar();
|
|
8
|
+
const { regenerate, divider, delAndRegenerate, del } = useChatListActionsBar();
|
|
9
9
|
return (
|
|
10
10
|
<ActionIconGroup
|
|
11
|
-
dropdownMenu={[regenerate, divider, del]}
|
|
11
|
+
dropdownMenu={[regenerate, divider, delAndRegenerate, del]}
|
|
12
12
|
items={[regenerate]}
|
|
13
13
|
onActionClick={onActionClick}
|
|
14
14
|
type="ghost"
|
|
@@ -26,6 +26,7 @@ vi.mock('@/database/models/message', () => {
|
|
|
26
26
|
clearTable: vi.fn(),
|
|
27
27
|
batchUpdate: vi.fn(),
|
|
28
28
|
queryAll: vi.fn(),
|
|
29
|
+
updatePluginState: vi.fn(),
|
|
29
30
|
},
|
|
30
31
|
};
|
|
31
32
|
});
|
|
@@ -255,7 +256,7 @@ describe('MessageService', () => {
|
|
|
255
256
|
const key = 'stateKey';
|
|
256
257
|
const value = 'stateValue';
|
|
257
258
|
const newPluginState = { [key]: value };
|
|
258
|
-
(MessageModel.
|
|
259
|
+
(MessageModel.updatePluginState as Mock).mockResolvedValue({
|
|
259
260
|
...mockMessage,
|
|
260
261
|
pluginState: newPluginState,
|
|
261
262
|
});
|
|
@@ -264,9 +265,7 @@ describe('MessageService', () => {
|
|
|
264
265
|
const result = await messageService.updateMessagePluginState(mockMessageId, key, value);
|
|
265
266
|
|
|
266
267
|
// Assert
|
|
267
|
-
expect(MessageModel.
|
|
268
|
-
pluginState: newPluginState,
|
|
269
|
-
});
|
|
268
|
+
expect(MessageModel.updatePluginState).toHaveBeenCalledWith(mockMessageId, key, value);
|
|
270
269
|
expect(result).toEqual({ ...mockMessage, pluginState: newPluginState });
|
|
271
270
|
});
|
|
272
271
|
});
|
package/src/services/message.ts
CHANGED
|
@@ -53,8 +53,9 @@ export class MessageService {
|
|
|
53
53
|
async updateMessagePlugin(id: string, plugin: ChatPluginPayload) {
|
|
54
54
|
return MessageModel.update(id, { plugin });
|
|
55
55
|
}
|
|
56
|
+
|
|
56
57
|
async updateMessagePluginState(id: string, key: string, value: any) {
|
|
57
|
-
return MessageModel.
|
|
58
|
+
return MessageModel.updatePluginState(id, key, value);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
async getAllMessages() {
|