@lobehub/chat 0.64.0 → 0.65.0

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,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 0.65.0](https://github.com/lobehub/lobe-chat/compare/v0.64.1...v0.65.0)
6
+
7
+ <sup>Released on **2023-08-29**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **misc**: 支持本地插件自定义 gateway.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's improved
19
+
20
+ - **misc**: 支持本地插件自定义 gateway, closes [#129](https://github.com/lobehub/lobe-chat/issues/129) ([770048a](https://github.com/lobehub/lobe-chat/commit/770048a))
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.64.1](https://github.com/lobehub/lobe-chat/compare/v0.64.0...v0.64.1)
31
+
32
+ <sup>Released on **2023-08-29**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Update i18n.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Update i18n, closes [#128](https://github.com/lobehub/lobe-chat/issues/128) ([3bf1509](https://github.com/lobehub/lobe-chat/commit/3bf1509))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ## [Version 0.64.0](https://github.com/lobehub/lobe-chat/compare/v0.63.3...v0.64.0)
6
56
 
7
57
  <sup>Released on **2023-08-29**</sup>
@@ -51,6 +51,7 @@
51
51
  "regenerate": "Regenerate",
52
52
  "rename": "Rename",
53
53
  "reset": "Reset",
54
+ "retry": "Retry",
54
55
  "roleAndArchive": "Roles and Archives",
55
56
  "searchAgentPlaceholder": "Search Assistants and Conversations...",
56
57
  "send": "Send",
@@ -61,7 +62,8 @@
61
62
  "stop": "Stop",
62
63
  "tab": {
63
64
  "chat": "Chat",
64
- "market": "Assistant Market"
65
+ "market": "Assistant Market",
66
+ "setting": "Settings"
65
67
  },
66
68
  "temp": "Temporary",
67
69
  "tokenDetail": "Role Setting: {{systemRoleToken}} · Message History: {{chatsToken}}",
@@ -74,8 +76,10 @@
74
76
  "confirmRemoveTopic": "You are about to delete this topic. Once deleted, it cannot be recovered. Please proceed with caution.",
75
77
  "defaultTitle": "Default Topic",
76
78
  "saveCurrentMessages": "Save the current session as a topic",
77
- "searchPlaceholder": "Search Topics..."
79
+ "searchPlaceholder": "Search Topics...",
80
+ "title": "Topic"
78
81
  },
79
82
  "updateAgent": "Update Assistant Information",
80
- "updatePrompt": "Update Prompts"
83
+ "updatePrompt": "Update Prompts",
84
+ "warp": "Line break"
81
85
  }
@@ -1,4 +1,8 @@
1
1
  {
2
+ "pluginSettings": {
3
+ "desc": "Complete the following configuration to start using this plugin",
4
+ "title": "{{name}} Plugin Configuration"
5
+ },
2
6
  "response": {
3
7
  "400": "Sorry, the server does not understand your request. Please make sure your request parameters are correct.",
4
8
  "401": "Sorry, the server has rejected your request, possibly due to insufficient permissions or invalid authentication.",
@@ -11,7 +15,17 @@
11
15
  "503": "Sorry, the server is currently unable to process your request, possibly due to overload or maintenance. Please try again later.",
12
16
  "504": "Sorry, the server did not receive a response from the upstream server. Please try again later.",
13
17
  "InvalidAccessCode": "The password is incorrect or empty. Please enter the correct access password or add a custom OpenAI API Key.",
14
- "OpenAIBizError": "Error requesting OpenAI service. Please troubleshoot or retry based on the following information."
18
+ "OpenAIBizError": "Error requesting OpenAI service. Please troubleshoot or retry based on the following information.",
19
+ "PluginMarketIndexNotFound": "Sorry, the server could not find the plugin index. Please check if the index address is correct",
20
+ "PluginMarketIndexInvalid": "Sorry, the plugin index validation failed. Please check if the index file format is correct",
21
+ "PluginMetaNotFound": "Sorry, the plugin was not found in the index. Please check the plugin's configuration information in the index",
22
+ "PluginMetaInvalid": "Sorry, the plugin's metadata validation failed. Please check if the plugin metadata format is correct",
23
+ "PluginManifestNotFound": "Sorry, the server could not find the plugin's manifest file (manifest.json). Please check if the plugin manifest file address is correct",
24
+ "PluginManifestInvalid": "Sorry, the plugin's manifest validation failed. Please check if the manifest format is correct",
25
+ "PluginApiNotFound": "Sorry, the API does not exist in the plugin's manifest. Please check if your request method matches the plugin manifest API",
26
+ "PluginApiParamsError": "Sorry, the input parameter validation for the plugin request failed. Please check if the input parameters match the API description",
27
+ "PluginSettingsInvalid": "This plugin needs to be correctly configured before it can be used. Please check if your configuration is correct",
28
+ "PluginServerError": "Plugin server request returned an error. Please check your plugin manifest file, plugin configuration, or server implementation based on the error information below"
15
29
  },
16
30
  "unlock": {
17
31
  "apikey": {
@@ -4,6 +4,83 @@
4
4
  "function_call": "Function Call",
5
5
  "response": "Response"
6
6
  },
7
+ "dev": {
8
+ "confirmDeleteDevPlugin": "Are you sure you want to delete this local plugin? Once deleted, it cannot be recovered.",
9
+ "deleteSuccess": "Plugin deleted successfully",
10
+ "manifest": {
11
+ "identifier": {
12
+ "desc": "The unique identifier of the plugin",
13
+ "label": "Identifier"
14
+ },
15
+ "mode": {
16
+ "local": "Visual Configuration",
17
+ "local-tooltip": "Visual configuration is not supported at the moment",
18
+ "url": "Online Link"
19
+ },
20
+ "name": {
21
+ "desc": "The title of the plugin",
22
+ "label": "Title",
23
+ "placeholder": "Search Engine"
24
+ }
25
+ },
26
+ "meta": {
27
+ "author": {
28
+ "desc": "The author of the plugin",
29
+ "label": "Author"
30
+ },
31
+ "avatar": {
32
+ "desc": "The icon of the plugin, can be an Emoji or a URL",
33
+ "label": "Icon"
34
+ },
35
+ "description": {
36
+ "desc": "The description of the plugin",
37
+ "label": "Description",
38
+ "placeholder": "Get information from search engines"
39
+ },
40
+ "formFieldRequired": "This field is required",
41
+ "homepage": {
42
+ "desc": "The homepage of the plugin",
43
+ "label": "Homepage"
44
+ },
45
+ "identifier": {
46
+ "desc": "The unique identifier of the plugin, only supports alphanumeric characters, hyphen -, and underscore _",
47
+ "errorDuplicate": "The identifier is already used by another plugin, please modify the identifier",
48
+ "label": "Identifier",
49
+ "pattenErrorMessage": "Only alphanumeric characters, hyphen -, and underscore _ are allowed"
50
+ },
51
+ "manifest": {
52
+ "desc": "LobeChat will install the plugin using this link",
53
+ "invalid": "The input manifest link is invalid or does not comply with the specification",
54
+ "label": "Plugin Manifest URL",
55
+ "urlError": "Please enter a valid URL"
56
+ },
57
+ "title": {
58
+ "desc": "The title of the plugin",
59
+ "label": "Title",
60
+ "placeholder": "Search Engine"
61
+ }
62
+ },
63
+ "metaConfig": "Plugin metadata configuration",
64
+ "modalDesc": "After adding a custom plugin, it can be used for plugin development verification or directly in conversations. Please refer to the plugin development documentation for more information.",
65
+ "preview": {
66
+ "card": "Preview of plugin display",
67
+ "desc": "Preview of plugin description",
68
+ "title": "Plugin Name Preview"
69
+ },
70
+ "save": "Save",
71
+ "saveSuccess": "Plugin settings saved successfully",
72
+ "tabs": {
73
+ "manifest": "Function Description Manifest (Manifest)",
74
+ "meta": "Plugin Metadata"
75
+ },
76
+ "title": "Add Custom Plugin"
77
+ },
78
+ "list": {
79
+ "item": {
80
+ "local.config": "Configuration",
81
+ "local.title": "Local"
82
+ }
83
+ },
7
84
  "loading": {
8
85
  "content": "Loading...",
9
86
  "plugin": "Plugin is running..."
@@ -13,7 +90,8 @@
13
90
  "realtimeWeather": "Realtime Weather",
14
91
  "searchEngine": "Search Engine",
15
92
  "undefined": "Plugin Detection...",
16
- "websiteCrawler": "Website Crawler"
93
+ "websiteCrawler": "Website Crawler",
94
+ "unknown": "Plugin detection in progress..."
17
95
  },
18
96
  "realtimeWeather": {
19
97
  "data": {
@@ -128,7 +128,10 @@
128
128
  }
129
129
  },
130
130
  "settingPlugin": {
131
- "title": "Plugin List"
131
+ "title": "Plugin List",
132
+ "add": "Add",
133
+ "addTooltip": "Add custom plugin",
134
+ "config": "{{id}} Plugin Configuration"
132
135
  },
133
136
  "settingSystem": {
134
137
  "accessCode": {
@@ -51,6 +51,7 @@
51
51
  "regenerate": "重新生成",
52
52
  "rename": "重命名",
53
53
  "reset": "重置",
54
+ "retry": "重试",
54
55
  "roleAndArchive": "角色与记录",
55
56
  "searchAgentPlaceholder": "搜索助手和对话...",
56
57
  "send": "发送",
@@ -61,7 +62,8 @@
61
62
  "stop": "停止",
62
63
  "tab": {
63
64
  "chat": "会话",
64
- "market": "助手市场"
65
+ "market": "发现",
66
+ "setting": "设置"
65
67
  },
66
68
  "temp": "临时",
67
69
  "tokenDetail": "角色设定: {{systemRoleToken}} · 历史消息: {{chatsToken}}",
@@ -74,8 +76,10 @@
74
76
  "confirmRemoveTopic": "即将删除该话题,删除后将不可恢复,请谨慎操作。",
75
77
  "defaultTitle": "默认话题",
76
78
  "saveCurrentMessages": "将当前会话保存为话题",
77
- "searchPlaceholder": "搜索话题..."
79
+ "searchPlaceholder": "搜索话题...",
80
+ "title": "话题"
78
81
  },
79
82
  "updateAgent": "更新助理信息",
80
- "updatePrompt": "更新提示词"
83
+ "updatePrompt": "更新提示词",
84
+ "warp": "换行"
81
85
  }
@@ -1,4 +1,8 @@
1
1
  {
2
+ "pluginSettings": {
3
+ "desc": "完成以下配置,即可开始使用该插件",
4
+ "title": "{{name}}插件配置"
5
+ },
2
6
  "response": {
3
7
  "400": "很抱歉,服务器不明白您的请求,请确认您的请求参数是否正确",
4
8
  "401": "很抱歉,服务器拒绝了您的请求,可能是因为您的权限不足或未提供有效的身份验证",
@@ -10,6 +14,16 @@
10
14
  "502": "很抱歉,服务器似乎迷失了方向,暂时无法提供服务,请稍后再试",
11
15
  "503": "很抱歉,服务器当前无法处理您的请求,可能是由于过载或正在进行维护,请稍后再试",
12
16
  "504": "很抱歉,服务器没有等到上游服务器的回应,请稍后再试",
17
+ "PluginMarketIndexNotFound": "很抱歉,服务器没有找到插件索引,请检查索引地址是否正确",
18
+ "PluginMarketIndexInvalid": "很抱歉,插件索引校验未通过,请检查索引文件格式是否规范",
19
+ "PluginMetaNotFound": "很抱歉,没有在索引中发现该插件,请插件在索引中的配置信息",
20
+ "PluginMetaInvalid": "很抱歉,该插件的元信息校验未通过,请检查插件元信息格式是否规范",
21
+ "PluginManifestNotFound": "很抱歉,服务器没有找到该插件的描述清单 (manifest.json),请检查插件描述文件地址是否正确",
22
+ "PluginManifestInvalid": "很抱歉,该插件的描述清单校验未通过,请检查描述清单格式是否规范",
23
+ "PluginApiNotFound": "很抱歉,插件描述清单中不存在该 API ,请检查你的请求方法与插件清单 API 是否匹配",
24
+ "PluginApiParamsError": "很抱歉,该插件请求的入参校验未通过,请检查入参与 Api 描述信息是否匹配",
25
+ "PluginSettingsInvalid": "该插件需要正确配置后才可以使用,请检查你的配置是否正确",
26
+ "PluginServerError": "插件服务端请求返回出错,请检查根据下面的报错信息检查你的插件描述文件、插件配置或服务端实现",
13
27
  "InvalidAccessCode": "密码不正确或为空,请输入正确的访问密码,或者添加自定义 OpenAI API Key",
14
28
  "OpenAIBizError": "请求 OpenAI 服务出错,请根据以下信息排查或重试"
15
29
  },
@@ -4,30 +4,89 @@
4
4
  "function_call": "函数调用",
5
5
  "response": "返回结果"
6
6
  },
7
+ "dev": {
8
+ "confirmDeleteDevPlugin": "即将删除该本地插件,删除后将无法找回,是否删除该插件?",
9
+ "deleteSuccess": "插件删除成功",
10
+ "manifest": {
11
+ "identifier": {
12
+ "desc": "插件的唯一标识",
13
+ "label": "标识符"
14
+ },
15
+ "mode": {
16
+ "local": "可视化配置",
17
+ "local-tooltip": "暂时不支持可视化配置",
18
+ "url": "在线链接"
19
+ },
20
+ "name": {
21
+ "desc": "插件标题",
22
+ "label": "标题",
23
+ "placeholder": "搜索引擎"
24
+ }
25
+ },
26
+ "meta": {
27
+ "author": {
28
+ "desc": "插件的作者",
29
+ "label": "作者"
30
+ },
31
+ "avatar": {
32
+ "desc": "插件的图标,可以使用 Emoji,也可以使用 URL",
33
+ "label": "图标"
34
+ },
35
+ "description": {
36
+ "desc": "插件描述",
37
+ "label": "描述",
38
+ "placeholder": "查询搜索引擎获取信息"
39
+ },
40
+ "formFieldRequired": "该字段为必填项",
41
+ "homepage": {
42
+ "desc": "插件的首页",
43
+ "label": "首页"
44
+ },
45
+ "identifier": {
46
+ "desc": "插件的唯一标识,仅支持英文字符、数字、破折号 - 、下划线 _",
47
+ "errorDuplicate": "标识符和已有插件重复,请修改标识符",
48
+ "label": "标识符",
49
+ "pattenErrorMessage": "只能输入英文字符、数字 、- 和_ 这两个符号"
50
+ },
51
+ "manifest": {
52
+ "desc": "LobeChat 将会通过该链接安装插件",
53
+ "invalid": "输入的 manifest 链接无效,或 manifest 不符合规范",
54
+ "label": "插件描述文件 Url 地址",
55
+ "urlError": "请输入一个有效的网址"
56
+ },
57
+ "title": {
58
+ "desc": "插件标题",
59
+ "label": "标题",
60
+ "placeholder": "搜索引擎"
61
+ }
62
+ },
63
+ "metaConfig": "插件元信息配置",
64
+ "modalDesc": "添加自定义插件后,可用于插件开发验证,也可直接在会话中使用。插件开发文档请参考",
65
+ "preview": {
66
+ "card": "预览插件展示效果",
67
+ "desc": "预览插件描述",
68
+ "title": "插件名称预览"
69
+ },
70
+ "save": "保存",
71
+ "saveSuccess": "插件设置保存成功",
72
+ "tabs": {
73
+ "manifest": "功能描述清单 (Manifest)",
74
+ "meta": "插件元信息"
75
+ },
76
+ "title": "添加自定义插件"
77
+ },
78
+ "list": {
79
+ "item": {
80
+ "local.config": "配置",
81
+ "local.title": "本地"
82
+ }
83
+ },
7
84
  "loading": {
8
85
  "content": "数据获取中...",
9
86
  "plugin": "插件运行中..."
10
87
  },
11
88
  "pluginList": "插件列表",
12
89
  "plugins": {
13
- "realtimeWeather": "实时天气预报",
14
- "searchEngine": "搜索引擎",
15
- "undefined": "插件检测中...",
16
- "websiteCrawler": "网页内容提取"
17
- },
18
- "realtimeWeather": {
19
- "data": {
20
- "date": "日期",
21
- "daytemp_float": "日间温度",
22
- "dayweather": "日间天气",
23
- "daywind": "日间风速",
24
- "nighttemp_float": "夜间温度",
25
- "nightweather": "夜间天气",
26
- "nightwind": "夜间风速",
27
- "week": "星期"
28
- },
29
- "title": "近7日天气数据({{city}})",
30
- "updateAt": "更新时间"
31
- },
32
- "responseData": "返回数据"
90
+ "unknown": "插件检测中..."
91
+ }
33
92
  }
@@ -128,6 +128,9 @@
128
128
  }
129
129
  },
130
130
  "settingPlugin": {
131
+ "add": "添加",
132
+ "addTooltip": "添加自定义插件",
133
+ "config": "{{id}} 插件配置",
131
134
  "title": "插件列表"
132
135
  },
133
136
  "settingSystem": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.64.0",
3
+ "version": "0.65.0",
4
4
  "description": "Lobe Chat is an open-source chatbot client using LangChain, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -66,8 +66,8 @@
66
66
  "@emoji-mart/data": "^1",
67
67
  "@emoji-mart/react": "^1",
68
68
  "@icons-pack/react-simple-icons": "^9",
69
- "@lobehub/chat-plugin-sdk": "latest",
70
- "@lobehub/chat-plugins-gateway": "latest",
69
+ "@lobehub/chat-plugin-sdk": "^1.13.0",
70
+ "@lobehub/chat-plugins-gateway": "^1.5.0",
71
71
  "@lobehub/ui": "latest",
72
72
  "@vercel/analytics": "^1",
73
73
  "ahooks": "^3",
@@ -1,7 +1,3 @@
1
- import { PluginErrorType } from '@lobehub/chat-plugin-sdk';
2
-
3
- import { ChatErrorType } from '@/types/fetch';
4
-
5
1
  export default {
6
2
  pluginSettings: {
7
3
  desc: '完成以下配置,即可开始使用该插件',
@@ -19,30 +15,24 @@ export default {
19
15
  503: '很抱歉,服务器当前无法处理您的请求,可能是由于过载或正在进行维护,请稍后再试',
20
16
  504: '很抱歉,服务器没有等到上游服务器的回应,请稍后再试',
21
17
 
22
- [PluginErrorType.PluginMarketIndexNotFound]:
23
- '很抱歉,服务器没有找到插件索引,请检查索引地址是否正确',
24
- [PluginErrorType.PluginMarketIndexInvalid]:
25
- '很抱歉,插件索引校验未通过,请检查索引文件格式是否规范',
26
- [PluginErrorType.PluginMetaNotFound]:
27
- '很抱歉,没有在索引中发现该插件,请插件在索引中的配置信息',
28
- [PluginErrorType.PluginMetaInvalid]:
29
- '很抱歉,该插件的元信息校验未通过,请检查插件元信息格式是否规范',
30
- [PluginErrorType.PluginManifestNotFound]:
18
+ /* eslint-disable sort-keys-fix/sort-keys-fix */
19
+ PluginMarketIndexNotFound: '很抱歉,服务器没有找到插件索引,请检查索引地址是否正确',
20
+ PluginMarketIndexInvalid: '很抱歉,插件索引校验未通过,请检查索引文件格式是否规范',
21
+ PluginMetaNotFound: '很抱歉,没有在索引中发现该插件,请插件在索引中的配置信息',
22
+ PluginMetaInvalid: '很抱歉,该插件的元信息校验未通过,请检查插件元信息格式是否规范',
23
+ PluginManifestNotFound:
31
24
  '很抱歉,服务器没有找到该插件的描述清单 (manifest.json),请检查插件描述文件地址是否正确',
32
- [PluginErrorType.PluginManifestInvalid]:
33
- '很抱歉,该插件的描述清单校验未通过,请检查描述清单格式是否规范',
34
- [PluginErrorType.PluginApiNotFound]:
25
+ PluginManifestInvalid: '很抱歉,该插件的描述清单校验未通过,请检查描述清单格式是否规范',
26
+ PluginApiNotFound:
35
27
  '很抱歉,插件描述清单中不存在该 API ,请检查你的请求方法与插件清单 API 是否匹配',
36
- [PluginErrorType.PluginApiParamsError]:
37
- '很抱歉,该插件请求的入参校验未通过,请检查入参与 Api 描述信息是否匹配',
38
- [PluginErrorType.PluginSettingsInvalid]:
39
- '该插件需要正确配置后才可以使用,请检查你的配置是否正确',
40
- [PluginErrorType.PluginServerError]:
28
+ PluginApiParamsError: '很抱歉,该插件请求的入参校验未通过,请检查入参与 Api 描述信息是否匹配',
29
+ PluginSettingsInvalid: '该插件需要正确配置后才可以使用,请检查你的配置是否正确',
30
+ PluginServerError:
41
31
  '插件服务端请求返回出错,请检查根据下面的报错信息检查你的插件描述文件、插件配置或服务端实现',
42
32
 
43
- [ChatErrorType.InvalidAccessCode]:
44
- '密码不正确或为空,请输入正确的访问密码,或者添加自定义 OpenAI API Key',
45
- [ChatErrorType.OpenAIBizError]: '请求 OpenAI 服务出错,请根据以下信息排查或重试',
33
+ InvalidAccessCode: '密码不正确或为空,请输入正确的访问密码,或者添加自定义 OpenAI API Key',
34
+ OpenAIBizError: '请求 OpenAI 服务出错,请根据以下信息排查或重试',
35
+ /* eslint-enable */
46
36
  },
47
37
  unlock: {
48
38
  apikey: {
@@ -3,6 +3,7 @@ import empty from '../../../locales/en_US/empty.json';
3
3
  import error from '../../../locales/en_US/error.json';
4
4
  import plugin from '../../../locales/en_US/plugin.json';
5
5
  import setting from '../../../locales/en_US/setting.json';
6
+ import welcome from '../../../locales/en_US/welcome.json';
6
7
 
7
8
  const resources = {
8
9
  common,
@@ -10,6 +11,7 @@ const resources = {
10
11
  error,
11
12
  plugin,
12
13
  setting,
14
+ welcome,
13
15
  } as const;
14
16
 
15
17
  export default resources;
@@ -6,4 +6,4 @@ export const config = {
6
6
  runtime: 'edge',
7
7
  };
8
8
 
9
- export default createLobeChatPluginGateway(PLUGINS_INDEX_URL);
9
+ export default createLobeChatPluginGateway({ pluginsIndexUrl: PLUGINS_INDEX_URL });
@@ -22,7 +22,9 @@ export const fetchPlugin = async (
22
22
  const settings = pluginSelectors.getPluginSettingsById(params.identifier)(s);
23
23
  const manifest = pluginSelectors.getPluginManifestById(params.identifier)(s);
24
24
 
25
- const res = await fetch(URLS.plugins, {
25
+ const gatewayURL = manifest?.gateway;
26
+
27
+ const res = await fetch(gatewayURL ?? URLS.plugins, {
26
28
  body: JSON.stringify({ ...params, manifest }),
27
29
  headers: createHeadersWithPluginSettings(settings),
28
30
  method: 'POST',