Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/api/script_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def get_script_type_icon(type_key: str) -> Response:
"""根据脚本类型键返回插件声明的图标资源。

icon_path 格式为 ``package_name:relative/path``,例如
``automas_script_maafw_pack_m9a:assets/m9a.png``。
``example_script_plugin:assets/icon.png``。
"""
try:
provider = script_type_registry.get(type_key)
Expand Down
8 changes: 3 additions & 5 deletions app/api/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def _build_maafw_agent_env_info_items(agent_plans: list[Any]) -> list[MaaFWAgent
"MaaConfig": MaaConfig,
"SrcConfig": SrcConfig,
"MaaEndConfig": MaaEndConfig,
"M9AConfig": M9AConfig,
"MaaFWConfig": MaaFWConfig,
"GeneralConfig": GeneralConfig,
"PluginScriptConfig": PluginScriptConfig,
Expand All @@ -108,7 +107,6 @@ def _build_maafw_agent_env_info_items(agent_plans: list[Any]) -> list[MaaFWAgent
"MaaConfig": MaaUserConfig,
"SrcConfig": SrcUserConfig,
"MaaEndConfig": MaaEndUserConfig,
"M9AConfig": M9AUserConfig,
"MaaFWConfig": MaaFWUserConfig,
"GeneralConfig": GeneralUserConfig,
"PluginScriptConfig": PluginUserConfig,
Expand Down Expand Up @@ -157,7 +155,7 @@ def _plugin_provider(type_key: str):


def _is_maafw_framework_script(script_config: Any) -> bool:
"""判定脚本配置是否属于 MaaFW 框架运行链路(含 M9A 等 pack 形态)。"""
"""判定脚本配置是否属于 MaaFW 框架运行链路。"""

from app.core.script_types import script_type_registry

Expand All @@ -181,15 +179,15 @@ def _is_maafw_framework_script(script_config: Any) -> bool:
return provider.metadata.get("framework") == "maafw"
except Exception:
# 注册表未就绪或类名未注册时,回退到已知 legacy 类名。
return config_class_name in {"MaaFWConfig", "M9AConfig"}
return config_class_name == "MaaFWConfig"


async def _resolve_maafw_script_form(script_config: Any) -> dict[str, Any]:
"""解析 MaaFW 框架脚本的表单态配置(插件形态与 legacy 均适用)。

插件形态脚本统一存为 PluginScriptConfig,真实配置在 PluginData.Config
(JSON 字符串),须经 storage_to_form 解码后才有 Info.Path / Update.* 字段;
legacy MaaFWConfig/M9AConfig 直接 toDict 即为表单态。
legacy MaaFWConfig 直接 toDict 即为表单态。
"""
from app.models.plugin_script_config import PluginScriptConfig

Expand Down
Loading
Loading