Skip to content

Commit 418a05e

Browse files
committed
Merge branch 'r-dev' of https://github.com/Mai-with-u/MaiBot into r-dev
2 parents 37f45d4 + 2c279f7 commit 418a05e

99 files changed

Lines changed: 15453 additions & 4961 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
1. 尽量保持良好的注释
1818
2. 如果原来的代码中有注释,则重构的时候,除非这部分代码被删除,否则相同功能的代码应该保留注释(可以对注释进行修改以保持准确性,但不应该删除注释)。
1919
3. 如果原来的代码中没有注释,则重构的时候,如果某个功能块的代码较长或者逻辑较为复杂,则应该添加注释来解释这部分代码的功能和逻辑。
20+
4. 对于类,方法以及模块的注释,首选使用的注释格式为 Google DocStr 格式,但保证语言为简体中文
2021
## 类型注解规范
2122
1. 重构代码时,如果原来的代码中有类型注解,则相同功能的代码应该保留类型注解(可以对类型注解进行修改以保持准确性,但不应该删除类型注解)。
2223
2. 重构代码时,如果原来的代码中没有类型注解,则重构的时候,如果某个函数的功能较为复杂或者参数较多,则应该添加类型注解来提高代码的可读性和可维护性。(对于简单的变量,可以不添加类型注解)
@@ -35,3 +36,7 @@
3536
# 运行/调试/构建/测试/依赖
3637
优先使用uv
3738
依赖项以 pyproject.toml 为准
39+
40+
# 语言规范
41+
42+
项目的首选语言为简体中文,无论是注释语言,日志展示语言,还是 WebUI 展示语言都应该首要以简体中文为首要实现目标
Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,40 @@
11
{
2-
"manifest_version": 1,
3-
"name": "发言频率控制插件|BetterFrequency Plugin",
2+
"manifest_version": 2,
43
"version": "2.0.0",
5-
"description": "控制聊天频率,支持设置focus_value和talk_frequency调整值,提供命令",
4+
"name": "发言频率控制插件|BetterFrequency Plugin",
5+
"description": "控制聊天频率,支持设置 focus_value 和 talk_frequency 调整值,并提供命令入口。",
66
"author": {
77
"name": "SengokuCola",
88
"url": "https://github.com/MaiM-with-u"
99
},
1010
"license": "GPL-v3.0-or-later",
11+
"urls": {
12+
"repository": "https://github.com/SengokuCola/BetterFrequency",
13+
"homepage": "https://github.com/SengokuCola/BetterFrequency",
14+
"documentation": "https://github.com/SengokuCola/BetterFrequency",
15+
"issues": "https://github.com/SengokuCola/BetterFrequency/issues"
16+
},
1117
"host_application": {
12-
"min_version": "1.0.0"
18+
"min_version": "1.0.0",
19+
"max_version": "1.0.0"
1320
},
14-
"homepage_url": "https://github.com/SengokuCola/BetterFrequency",
15-
"repository_url": "https://github.com/SengokuCola/BetterFrequency",
16-
"keywords": [
17-
"frequency",
18-
"control",
19-
"talk_frequency",
20-
"plugin",
21-
"shortcut"
22-
],
23-
"categories": [
24-
"Chat",
25-
"Frequency",
26-
"Control"
21+
"sdk": {
22+
"min_version": "2.0.0",
23+
"max_version": "2.99.99"
24+
},
25+
"dependencies": [],
26+
"capabilities": [
27+
"send.text",
28+
"frequency.set_adjust",
29+
"frequency.get_current_talk_value",
30+
"frequency.get_adjust"
2731
],
28-
"default_locale": "zh-CN",
29-
"locales_path": "_locales",
30-
"plugin_info": {
31-
"is_built_in": false,
32-
"plugin_type": "frequency",
33-
"components": [
34-
{
35-
"type": "command",
36-
"name": "set_talk_frequency",
37-
"description": "设置当前聊天的talk_frequency调整值",
38-
"pattern": "/chat talk_frequency <数字> 或 /chat t <数字>"
39-
},
40-
{
41-
"type": "command",
42-
"name": "show_frequency",
43-
"description": "显示当前聊天的频率控制状态",
44-
"pattern": "/chat show 或 /chat s"
45-
}
46-
],
47-
"features": [
48-
"设置talk_frequency调整值",
49-
"调整当前聊天的发言频率",
50-
"显示当前频率控制状态",
51-
"实时频率控制调整",
52-
"命令执行反馈(不保存消息)",
53-
"支持完整命令和简化命令",
54-
"快速操作支持"
32+
"i18n": {
33+
"default_locale": "zh-CN",
34+
"locales_path": "_locales",
35+
"supported_locales": [
36+
"zh-CN"
5537
]
5638
},
57-
"id": "SengokuCola.BetterFrequency"
58-
}
39+
"id": "sengokucola.betterfrequency"
40+
}

plugins/ChatFrequency/plugin.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
通过 /chat 命令设置和查看聊天频率。
44
"""
55

6-
from maibot_sdk import MaiBotPlugin, Command
6+
from maibot_sdk import Command, MaiBotPlugin
77

88

99
class BetterFrequencyPlugin(MaiBotPlugin):
1010
"""聊天频率控制插件"""
1111

12+
async def on_load(self) -> None:
13+
"""处理插件加载。"""
14+
15+
async def on_unload(self) -> None:
16+
"""处理插件卸载。"""
17+
1218
@Command(
1319
"set_talk_frequency",
1420
description="设置当前聊天的talk_frequency值:/chat talk_frequency <数字> 或 /chat t <数字>",
@@ -80,6 +86,25 @@ async def handle_show_frequency(self, stream_id: str = "", **kwargs):
8086
await self.ctx.send.text(status_msg, stream_id)
8187
return True, None, False
8288

89+
async def on_config_update(self, scope: str, config_data: dict[str, object], version: str) -> None:
90+
"""处理配置热重载事件。
91+
92+
Args:
93+
scope: 配置变更范围。
94+
config_data: 最新配置数据。
95+
version: 配置版本号。
96+
"""
97+
98+
del scope
99+
del config_data
100+
del version
101+
102+
103+
def create_plugin() -> BetterFrequencyPlugin:
104+
"""创建聊天频率插件实例。
105+
106+
Returns:
107+
BetterFrequencyPlugin: 新的聊天频率插件实例。
108+
"""
83109

84-
def create_plugin():
85110
return BetterFrequencyPlugin()
Lines changed: 28 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,42 @@
11
{
2-
"manifest_version": 1,
3-
"name": "MCP桥接插件",
2+
"manifest_version": 2,
43
"version": "2.0.0",
5-
"description": "将 MCP (Model Context Protocol) 服务器的工具桥接到 MaiBot,使麦麦能够调用外部 MCP 工具",
4+
"name": "MCP桥接插件",
5+
"description": "将 MCP (Model Context Protocol) 服务器的工具桥接到 MaiBot,使麦麦能够调用外部 MCP 工具。",
66
"author": {
77
"name": "CharTyr",
88
"url": "https://github.com/CharTyr"
99
},
1010
"license": "AGPL-3.0",
11+
"urls": {
12+
"repository": "https://github.com/CharTyr/MaiBot_MCPBridgePlugin",
13+
"homepage": "https://github.com/CharTyr/MaiBot_MCPBridgePlugin",
14+
"documentation": "https://github.com/CharTyr/MaiBot_MCPBridgePlugin",
15+
"issues": "https://github.com/CharTyr/MaiBot_MCPBridgePlugin/issues"
16+
},
1117
"host_application": {
12-
"min_version": "0.11.6"
18+
"min_version": "0.11.6",
19+
"max_version": "1.0.0"
20+
},
21+
"sdk": {
22+
"min_version": "2.0.0",
23+
"max_version": "2.99.99"
1324
},
14-
"homepage_url": "https://github.com/CharTyr/MaiBot_MCPBridgePlugin",
15-
"repository_url": "https://github.com/CharTyr/MaiBot_MCPBridgePlugin",
16-
"keywords": [
17-
"mcp",
18-
"bridge",
19-
"tool",
20-
"integration",
21-
"resources",
22-
"prompts",
23-
"post-process",
24-
"cache",
25-
"trace",
26-
"permissions",
27-
"import",
28-
"export",
29-
"claude-desktop",
30-
"workflow",
31-
"react",
32-
"agent"
25+
"dependencies": [
26+
{
27+
"type": "python_package",
28+
"name": "mcp",
29+
"version_spec": ">=0.0.0"
30+
}
3331
],
34-
"categories": [
35-
"工具扩展",
36-
"外部集成"
32+
"capabilities": [
33+
"send.text"
3734
],
38-
"default_locale": "zh-CN",
39-
"plugin_info": {
40-
"is_built_in": false,
41-
"components": [],
42-
"features": [
43-
"支持多个 MCP 服务器",
44-
"自动发现并注册 MCP 工具",
45-
"支持 stdio、SSE、HTTP、Streamable HTTP 四种传输方式",
46-
"工具参数自动转换",
47-
"心跳检测与自动重连",
48-
"调用统计(次数、成功率、耗时)",
49-
"WebUI 配置支持",
50-
"Resources 支持(实验性)",
51-
"Prompts 支持(实验性)",
52-
"结果后处理(LLM 摘要提炼)",
53-
"工具禁用管理",
54-
"调用链路追踪",
55-
"工具调用缓存(LRU)",
56-
"工具权限控制(群/用户级别)",
57-
"配置导入导出(Claude Desktop mcpServers)",
58-
"断路器模式(故障快速失败)",
59-
"状态实时刷新",
60-
"Workflow 硬流程(顺序执行多个工具)",
61-
"Workflow 快速添加(表单式配置)",
62-
"ReAct 软流程(LLM 自主多轮调用)",
63-
"双轨制架构(软流程 + 硬流程)"
35+
"i18n": {
36+
"default_locale": "zh-CN",
37+
"supported_locales": [
38+
"zh-CN"
6439
]
6540
},
66-
"id": "MaiBot Community.MCPBridgePlugin"
41+
"id": "chartyr.mcpbridge-plugin"
6742
}
Lines changed: 31 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,44 @@
11
{
2-
"manifest_version": 1,
3-
"name": "BetterEmoji",
2+
"manifest_version": 2,
43
"version": "2.0.0",
4+
"name": "BetterEmoji",
55
"description": "更好的表情包管理插件",
66
"author": {
77
"name": "SengokuCola",
88
"url": "https://github.com/SengokuCola"
99
},
1010
"license": "GPL-v3.0-or-later",
11+
"urls": {
12+
"repository": "https://github.com/SengokuCola/BetterEmoji",
13+
"homepage": "https://github.com/SengokuCola/BetterEmoji",
14+
"documentation": "https://github.com/SengokuCola/BetterEmoji",
15+
"issues": "https://github.com/SengokuCola/BetterEmoji/issues"
16+
},
1117
"host_application": {
12-
"min_version": "1.0.0"
18+
"min_version": "1.0.0",
19+
"max_version": "1.0.0"
1320
},
14-
"homepage_url": "https://github.com/SengokuCola/BetterEmoji",
15-
"repository_url": "https://github.com/SengokuCola/BetterEmoji",
16-
"keywords": [
17-
"emoji",
18-
"manage",
19-
"plugin"
20-
],
21-
"categories": [
22-
"Emoji",
23-
"Management"
21+
"sdk": {
22+
"min_version": "2.0.0",
23+
"max_version": "2.99.99"
24+
},
25+
"dependencies": [],
26+
"capabilities": [
27+
"emoji.get_random",
28+
"emoji.get_count",
29+
"emoji.get_info",
30+
"emoji.get_all",
31+
"emoji.register_emoji",
32+
"emoji.delete_emoji",
33+
"send.text",
34+
"send.forward"
2435
],
25-
"default_locale": "zh-CN",
26-
"locales_path": "_locales",
27-
"plugin_info": {
28-
"is_built_in": false,
29-
"plugin_type": "emoji_manage",
30-
"capabilities": [
31-
"emoji.get_random",
32-
"emoji.get_count",
33-
"emoji.get_info",
34-
"emoji.get_all",
35-
"emoji.register_emoji",
36-
"emoji.delete_emoji",
37-
"send.text",
38-
"send.forward"
39-
],
40-
"components": [
41-
{
42-
"type": "command",
43-
"name": "add_emoji",
44-
"description": "添加表情包",
45-
"pattern": "/emoji add"
46-
},
47-
{
48-
"type": "command",
49-
"name": "emoji_list",
50-
"description": "列表表情包",
51-
"pattern": "/emoji list"
52-
},
53-
{
54-
"type": "command",
55-
"name": "delete_emoji",
56-
"description": "删除表情包",
57-
"pattern": "/emoji delete"
58-
},
59-
{
60-
"type": "command",
61-
"name": "random_emojis",
62-
"description": "发送多张随机表情包",
63-
"pattern": "/random_emojis"
64-
}
36+
"i18n": {
37+
"default_locale": "zh-CN",
38+
"locales_path": "_locales",
39+
"supported_locales": [
40+
"zh-CN"
6541
]
6642
},
67-
"id": "SengokuCola.BetterEmoji"
68-
}
43+
"id": "sengokucola.betteremoji"
44+
}

0 commit comments

Comments
 (0)