refactor(agent): rename run_plugin_command to run_slash_command to avoid confusion with execute_command (shell)

This commit is contained in:
jxxghp
2026-04-06 23:53:49 +08:00
parent 7806267e92
commit a8fb4a6d84
5 changed files with 16 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ class ListAllCommandsTool(MoviePilotTool):
"List all available commands in the system, including system preset commands "
"(e.g. /cookiecloud, /sites, /subscribes, /downloading, /transfer, /restart, etc.) "
"and plugin-registered commands. "
"Use this tool to discover what commands are available before executing them with run_plugin_command. "
"Use this tool to discover what commands are available before executing them with run_slash_command. "
"This is especially useful when the user describes an action in natural language and you need to "
"find the matching command to fulfill their request."
)

View File

@@ -29,7 +29,7 @@ class QueryPluginCapabilitiesTool(MoviePilotTool):
name: str = "query_plugin_capabilities"
description: str = (
"Query the capabilities of installed plugins, including supported commands and scheduled services. "
"Commands are slash-commands (e.g. /xxx) that can be executed via the run_plugin_command tool. "
"Commands are slash-commands (e.g. /xxx) that can be executed via the run_slash_command tool. "
"Scheduled services are periodic tasks that can be triggered via the run_scheduler tool. "
"Optionally specify a plugin_id to query a specific plugin, or omit to query all running plugins."
)

View File

@@ -1,4 +1,4 @@
"""运行插件/系统命令工具"""
"""运行斜杠命令工具(系统命令 + 插件命令)"""
import json
from typing import Optional, Type
@@ -12,8 +12,8 @@ from app.log import logger
from app.schemas.types import EventType, MessageChannel
class RunPluginCommandInput(BaseModel):
"""运行插件/系统命令工具的输入参数模型"""
class RunSlashCommandInput(BaseModel):
"""运行斜杠命令工具的输入参数模型"""
explanation: str = Field(
...,
@@ -28,11 +28,11 @@ class RunPluginCommandInput(BaseModel):
)
class RunPluginCommandTool(MoviePilotTool):
name: str = "run_plugin_command"
class RunSlashCommandTool(MoviePilotTool):
name: str = "run_slash_command"
description: str = (
"Execute a system or plugin command by sending a CommandExcute event. "
"This tool supports ALL registered commands, including: "
"Execute a slash command (system or plugin) by sending a CommandExcute event. "
"This tool supports ALL registered slash commands, including: "
"1) System preset commands (e.g. /cookiecloud, /sites, /subscribes, /downloading, /transfer, /restart, etc.) "
"2) Plugin commands registered by installed plugins. "
"Use the query_plugin_capabilities tool to discover plugin commands, "
@@ -40,7 +40,7 @@ class RunPluginCommandTool(MoviePilotTool):
"The command will be executed asynchronously. "
"Note: This tool triggers the command execution but the actual processing happens in the background."
)
args_schema: Type[BaseModel] = RunPluginCommandInput
args_schema: Type[BaseModel] = RunSlashCommandInput
require_admin: bool = True
def get_tool_message(self, **kwargs) -> Optional[str]: