mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-11 06:48:39 +03:00
fix(plugins): expose skill-only packages
This commit is contained in:
@@ -962,7 +962,7 @@ def mcp_presets_payload(
|
|||||||
plugin_rows = [
|
plugin_rows = [
|
||||||
_agent_plugin_payload(state)
|
_agent_plugin_payload(state)
|
||||||
for state in discover_agent_plugin_states(config.workspace_path)
|
for state in discover_agent_plugin_states(config.workspace_path)
|
||||||
if state.mcp_servers and f"plugin-{state.plugin.name}" not in existing_names
|
if f"plugin-{state.plugin.name}" not in existing_names
|
||||||
]
|
]
|
||||||
payload: dict[str, Any] = {
|
payload: dict[str, Any] = {
|
||||||
"presets": [*preset_rows, *custom_rows, *plugin_rows],
|
"presets": [*preset_rows, *custom_rows, *plugin_rows],
|
||||||
@@ -1587,7 +1587,6 @@ async def mcp_presets_settings_action(
|
|||||||
if (
|
if (
|
||||||
name not in plugin_config.tools.mcp_servers
|
name not in plugin_config.tools.mcp_servers
|
||||||
and plugin_state is not None
|
and plugin_state is not None
|
||||||
and plugin_state.mcp_servers
|
|
||||||
):
|
):
|
||||||
if action not in {"enable", "disable"}:
|
if action not in {"enable", "disable"}:
|
||||||
raise McpPresetError("Agent Plugins support enable and disable actions only")
|
raise McpPresetError("Agent Plugins support enable and disable actions only")
|
||||||
|
|||||||
@@ -150,6 +150,9 @@ def test_agent_plugin_reuses_mcp_catalog_and_runtime_action(
|
|||||||
with pytest.raises(McpPresetError, match="enable and disable"):
|
with pytest.raises(McpPresetError, match="enable and disable"):
|
||||||
asyncio.run(plugin_action("remove"))
|
asyncio.run(plugin_action("remove"))
|
||||||
|
|
||||||
|
(load_config().workspace_path / "plugins" / "desktop" / "mcp.json").unlink()
|
||||||
|
assert any(item["name"] == "plugin-desktop" for item in mcp_presets_payload()["presets"])
|
||||||
|
|
||||||
config_path = tmp_path / "config.json"
|
config_path = tmp_path / "config.json"
|
||||||
config = json.loads(config_path.read_text(encoding="utf-8"))
|
config = json.loads(config_path.read_text(encoding="utf-8"))
|
||||||
config["tools"] = {
|
config["tools"] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user