@lobehub/chat 0.59.0 → 0.60.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/CHANGELOG.md CHANGED
@@ -2,6 +2,64 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.60.1](https://github.com/lobehub/lobe-chat/compare/v0.60.0...v0.60.1)
6
+
7
+ <sup>Released on **2023-08-26**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix settings storage error.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix settings storage error ([57d7eb1](https://github.com/lobehub/lobe-chat/commit/57d7eb1))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ## [Version 0.60.0](https://github.com/lobehub/lobe-chat/compare/v0.59.0...v0.60.0)
31
+
32
+ <sup>Released on **2023-08-26**</sup>
33
+
34
+ #### ♻ Code Refactoring
35
+
36
+ - **misc**: Refactor with new market index url.
37
+
38
+ #### ✨ Features
39
+
40
+ - **misc**: 支持插件 manifest 加载失败后重试.
41
+
42
+ <br/>
43
+
44
+ <details>
45
+ <summary><kbd>Improvements and Fixes</kbd></summary>
46
+
47
+ #### Code refactoring
48
+
49
+ - **misc**: Refactor with new market index url ([d2834b7](https://github.com/lobehub/lobe-chat/commit/d2834b7))
50
+
51
+ #### What's improved
52
+
53
+ - **misc**: 支持插件 manifest 加载失败后重试 ([f36378e](https://github.com/lobehub/lobe-chat/commit/f36378e))
54
+
55
+ </details>
56
+
57
+ <div align="right">
58
+
59
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
60
+
61
+ </div>
62
+
5
63
  ## [Version 0.59.0](https://github.com/lobehub/lobe-chat/compare/v0.58.0...v0.59.0)
6
64
 
7
65
  <sup>Released on **2023-08-26**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.59.0",
3
+ "version": "0.60.1",
4
4
  "description": "Lobe Chat is an open-source chatbot client using LangChain, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
package/src/const/url.ts CHANGED
@@ -7,5 +7,4 @@ export const FEEDBACK = pkg.bugs.url;
7
7
  export const DISCORD = 'https://discord.gg/AYFPHvv2jT';
8
8
 
9
9
  export const PLUGINS_INDEX_URL =
10
- process.env.PLUGINS_INDEX_URL ??
11
- 'https://registry.npmmirror.com/@lobehub/lobe-chat-plugins/latest/files';
10
+ process.env.PLUGINS_INDEX_URL ?? 'https://chat-plugins-index.lobehub.com';
@@ -11,7 +11,10 @@ import { pluginHelpers, pluginSelectors, usePluginStore } from '@/store/plugin';
11
11
 
12
12
  const PluginStatus = memo<{ id: string; title?: string }>(({ title, id }) => {
13
13
  const { t } = useTranslation('common');
14
- const status = usePluginStore(pluginSelectors.getPluginManifestLoadingStatus(id));
14
+ const [status, fetchPluginManifest] = usePluginStore((s) => [
15
+ pluginSelectors.getPluginManifestLoadingStatus(id)(s),
16
+ s.fetchPluginManifest,
17
+ ]);
15
18
 
16
19
  const renderStatus = useMemo(() => {
17
20
  switch (status) {
@@ -19,7 +22,16 @@ const PluginStatus = memo<{ id: string; title?: string }>(({ title, id }) => {
19
22
  return <Badge color={'blue'} status={'processing'} />;
20
23
  }
21
24
  case 'error': {
22
- return <ActionIcon icon={LucideRotateCw} size={'small'} title={t('retry')} />;
25
+ return (
26
+ <ActionIcon
27
+ icon={LucideRotateCw}
28
+ onClick={() => {
29
+ fetchPluginManifest(id);
30
+ }}
31
+ size={'small'}
32
+ title={t('retry')}
33
+ />
34
+ );
23
35
  }
24
36
  case 'success': {
25
37
  return <Badge status={status} />;
@@ -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
- if (!(persistedState as GlobalPersist).settings.defaultAgent) {
31
- currentState.settings.defaultAgent = DEFAULT_AGENT;
32
- }
33
- return currentState;
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) => ({