@lobehub/chat 0.60.0 → 0.60.2
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/package.json +1 -1
- package/src/services/plugin.ts +2 -6
- package/src/store/global/store.ts +9 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.60.2](https://github.com/lobehub/lobe-chat/compare/v0.60.1...v0.60.2)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-08-26**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix fetch plugin header error.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Fix fetch plugin header error ([fa4a0e1](https://github.com/lobehub/lobe-chat/commit/fa4a0e1))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.60.1](https://github.com/lobehub/lobe-chat/compare/v0.60.0...v0.60.1)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-08-26**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix settings storage error.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix settings storage error ([57d7eb1](https://github.com/lobehub/lobe-chat/commit/57d7eb1))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
## [Version 0.60.0](https://github.com/lobehub/lobe-chat/compare/v0.59.0...v0.60.0)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2023-08-26**</sup>
|
package/package.json
CHANGED
package/src/services/plugin.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { PluginRequestPayload } from '@lobehub/chat-plugin-sdk';
|
|
1
|
+
import { PluginRequestPayload, createHeadersWithPluginSettings } from '@lobehub/chat-plugin-sdk';
|
|
2
2
|
|
|
3
|
-
import { LOBE_PLUGIN_SETTINGS } from '@/const/fetch';
|
|
4
3
|
import { usePluginStore } from '@/store/plugin';
|
|
5
4
|
import { getMessageError } from '@/utils/fetch';
|
|
6
5
|
|
|
@@ -22,10 +21,7 @@ export const fetchPlugin = async (
|
|
|
22
21
|
|
|
23
22
|
const res = await fetch(URLS.plugins, {
|
|
24
23
|
body: JSON.stringify(params),
|
|
25
|
-
headers:
|
|
26
|
-
'Content-Type': 'application/json',
|
|
27
|
-
[LOBE_PLUGIN_SETTINGS]: JSON.stringify(settings) || '',
|
|
28
|
-
},
|
|
24
|
+
headers: createHeadersWithPluginSettings(settings),
|
|
29
25
|
method: 'POST',
|
|
30
26
|
signal: options?.signal,
|
|
31
27
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { produce } from 'immer';
|
|
1
2
|
import { PersistOptions, devtools, persist } from 'zustand/middleware';
|
|
2
3
|
import { shallow } from 'zustand/shallow';
|
|
3
4
|
import { createWithEqualityFn } from 'zustand/traditional';
|
|
@@ -27,10 +28,14 @@ type GlobalPersist = Pick<GlobalStore, 'preference' | 'settings'>;
|
|
|
27
28
|
|
|
28
29
|
const persistOptions: PersistOptions<GlobalStore, GlobalPersist> = {
|
|
29
30
|
merge: (persistedState, currentState) => {
|
|
30
|
-
|
|
31
|
-
currentState
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
return {
|
|
32
|
+
...currentState,
|
|
33
|
+
settings: produce((persistedState as GlobalPersist).settings, (draft) => {
|
|
34
|
+
if (!draft.defaultAgent) {
|
|
35
|
+
draft.defaultAgent = DEFAULT_AGENT;
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
34
39
|
},
|
|
35
40
|
name: 'LOBE_SETTINGS',
|
|
36
41
|
partialize: (s) => ({
|