@@ -317,9 +317,20 @@ function PluginsPageContent() {
}
// 检查插件兼容性
+ // 规则:
+ // 1. manifest_version === 1 的插件在麦麦 >= 1.0.0 时一律视为不兼容(旧 manifest 已不再被宿主接受);
+ // 2. 否则若声明了 host_application 范围,则按版本范围判定。
const checkPluginCompatibility = (plugin: PluginInfo): boolean => {
- if (!maimaiVersion || !plugin.manifest?.host_application) return true
-
+ if (!maimaiVersion) return true
+
+ // manifest v1 在 1.0.0+ 麦麦上不再兼容
+ const manifestVersion = plugin.manifest?.manifest_version ?? 1
+ if (manifestVersion <= 1 && maimaiVersion.version_major >= 1) {
+ return false
+ }
+
+ if (!plugin.manifest?.host_application) return true
+
return isPluginCompatible(
plugin.manifest.host_application.min_version,
plugin.manifest.host_application.max_version,
@@ -327,11 +338,35 @@ function PluginsPageContent() {
)
}
+ // 不兼容原因(用于 UI 提示)
+ const getIncompatibleReason = (plugin: PluginInfo): string | null => {
+ if (!maimaiVersion) return null
+ const manifestVersion = plugin.manifest?.manifest_version ?? 1
+ if (manifestVersion <= 1 && maimaiVersion.version_major >= 1) {
+ return `该插件使用旧版 manifest (v${manifestVersion}),已不被麦麦 ${maimaiVersion.version} 支持`
+ }
+ if (plugin.manifest?.host_application && !isPluginCompatible(
+ plugin.manifest.host_application.min_version,
+ plugin.manifest.host_application.max_version,
+ maimaiVersion
+ )) {
+ const min = plugin.manifest.host_application.min_version || '未知'
+ const max = plugin.manifest.host_application.max_version
+ const range = max ? `${min} - ${max}` : `${min}+`
+ return `不兼容当前版本 (需要 ${range},当前 ${maimaiVersion.version})`
+ }
+ return null
+ }
+
// 检查是否需要更新(市场版本比已安装版本新)
const needsUpdate = (plugin: PluginInfo): boolean => {
if (!plugin.installed || !plugin.installed_version || !plugin.manifest?.version) {
return false
}
+ // 不兼容的插件不允许更新
+ if (!checkPluginCompatibility(plugin)) {
+ return false
+ }
const installedVer = plugin.installed_version.trim()
const marketVer = plugin.manifest.version.trim()
@@ -368,7 +403,7 @@ function PluginsPageContent() {
if (maimaiVersion && !checkPluginCompatibility(plugin)) {
toast({
title: '无法安装',
- description: '插件与当前麦麦版本不兼容',
+ description: getIncompatibleReason(plugin) ?? '插件与当前麦麦版本不兼容',
variant: 'destructive',
})
return
@@ -526,6 +561,16 @@ function PluginsPageContent() {
return
}
+ // 不兼容的插件不允许更新
+ if (maimaiVersion && !checkPluginCompatibility(plugin)) {
+ toast({
+ title: '无法更新',
+ description: getIncompatibleReason(plugin) ?? '插件与当前麦麦版本不兼容',
+ variant: 'destructive',
+ })
+ return
+ }
+
try {
const updateResult = await updatePlugin(
plugin.id,
@@ -833,6 +878,7 @@ function PluginsPageContent() {
checkPluginCompatibility={checkPluginCompatibility}
needsUpdate={needsUpdate}
getStatusBadge={getStatusBadge}
+ getIncompatibleReason={getIncompatibleReason}
/>
) : activeTab === 'installed' ? (
) : (
From 368c725b54da5157eca08eee4dc369f9f29d8c4c Mon Sep 17 00:00:00 2001
From: DrSmoothl <1787882683@qq.com>
Date: Sat, 2 May 2026 19:32:02 +0800
Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0maibot-plugin-sdk?=
=?UTF-8?q?=E7=89=88=E6=9C=AC=E8=87=B32.4.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pyproject.toml | 2 +-
requirements.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index dd389eef..a63e074a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -20,7 +20,7 @@ dependencies = [
"json-repair>=0.47.6",
"maim-message>=0.6.2",
"maibot-dashboard==1.0.1.dev2026050251",
- "maibot-plugin-sdk>=2.3.0",
+ "maibot-plugin-sdk>=2.4.0",
"matplotlib>=3.10.5",
"mcp",
"msgpack>=1.1.2",
diff --git a/requirements.txt b/requirements.txt
index c5f5af3d..cbe42b42 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,7 +9,7 @@ httpx
jieba>=0.42.1
json-repair>=0.47.6
maim-message>=0.6.2
-maibot-plugin-sdk>=1.2.3,<2.0.0
+maibot-plugin-sdk>=2.4.0
mcp
msgpack>=1.1.2
numpy>=2.2.6