automas-maafw-controller-adb 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: automas-maafw-controller-adb
3
+ Version: 0.1.0
4
+ Summary: ADB controller provider for AUTO-MAS MaaFW plugins
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: pydantic>=2
8
+
9
+ # automas-maafw-controller-adb
10
+
11
+ ADB controller provider for the AUTO-MAS MaaFW plugin group.
12
+
13
+ This package declares the ADB controller capability without importing `maa` at
14
+ plugin startup. Runtime device resolution remains owned by the MaaFW script
15
+ adapter until the host controller path is fully split.
@@ -0,0 +1,7 @@
1
+ # automas-maafw-controller-adb
2
+
3
+ ADB controller provider for the AUTO-MAS MaaFW plugin group.
4
+
5
+ This package declares the ADB controller capability without importing `maa` at
6
+ plugin startup. Runtime device resolution remains owned by the MaaFW script
7
+ adapter until the host controller path is fully split.
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "automas-maafw-controller-adb"
7
+ version = "0.1.0"
8
+ description = "ADB controller provider for AUTO-MAS MaaFW plugins"
9
+ readme = { file = "README.md", content-type = "text/markdown" }
10
+ requires-python = ">=3.10"
11
+ dependencies = [
12
+ "pydantic>=2",
13
+ ]
14
+
15
+ [project.entry-points."auto_mas.plugins"]
16
+ automas_maafw_controller_adb = "automas_maafw_controller_adb.plugin:Plugin"
17
+
18
+ [tool.setuptools.packages.find]
19
+ where = ["src"]
20
+
21
+ [tool.setuptools.package-data]
22
+ automas_maafw_controller_adb = ["py.typed"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from __future__ import annotations
2
+
3
+ __all__: list[str] = []
@@ -0,0 +1,47 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from .service import MaaFWAdbControllerService
6
+
7
+ if TYPE_CHECKING:
8
+ from auto_mas_core import PluginContext
9
+
10
+
11
+ DEFAULT_INSTANCE = {
12
+ "name": "MaaFW ADB Controller",
13
+ "enabled": True,
14
+ "config": {},
15
+ }
16
+
17
+ schema = {
18
+ "__no_plugin_config__": {
19
+ "type": "boolean",
20
+ "default": True,
21
+ "hidden": True,
22
+ "configurable": False,
23
+ "title": "No plugin-level configuration",
24
+ },
25
+ }
26
+
27
+
28
+ class Plugin:
29
+ provides = ["maafw.controller.adb"]
30
+ wants = ["maafw.registry.v1"]
31
+
32
+ def __init__(self, ctx: "PluginContext") -> None:
33
+ self.ctx = ctx
34
+ self.service = MaaFWAdbControllerService()
35
+
36
+ async def on_start(self) -> None:
37
+ self.ctx.set("maafw.controller.adb", self.service)
38
+ registry = self.ctx.get("maafw.registry.v1")
39
+ if registry is not None and hasattr(registry, "register_controller_provider"):
40
+ registry.register_controller_provider(self.service.get_provider_definition())
41
+ self.ctx.logger.info("maafw.controller.adb ready")
42
+
43
+ async def on_stop(self, reason: str) -> None:
44
+ registry = self.ctx.get("maafw.registry.v1")
45
+ if registry is not None and hasattr(registry, "unregister_controller_provider"):
46
+ registry.unregister_controller_provider("adb")
47
+ self.ctx.logger.info(f"maafw.controller.adb stopped, reason={reason}")
@@ -0,0 +1,40 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+
5
+
6
+ class MaaFWAdbControllerService:
7
+ """maafw.controller.adb service."""
8
+
9
+ key = "adb"
10
+ display_name = "ADB"
11
+ controller_types = ["Adb"]
12
+
13
+ def get_provider_definition(self) -> dict[str, Any]:
14
+ return {
15
+ "key": self.key,
16
+ "displayName": self.display_name,
17
+ "controllerTypes": list(self.controller_types),
18
+ "capabilities": [
19
+ "device_spec",
20
+ "emulator_service_consumption",
21
+ ],
22
+ }
23
+
24
+ def build_device_spec(
25
+ self,
26
+ *,
27
+ adb_path: str | None = None,
28
+ address: str | None = None,
29
+ screencap_methods: int = 0,
30
+ input_methods: int = 0,
31
+ config: dict[str, Any] | None = None,
32
+ ) -> dict[str, Any]:
33
+ return {
34
+ "type": "Adb",
35
+ "adbPath": adb_path,
36
+ "address": address,
37
+ "screencapMethods": screencap_methods,
38
+ "inputMethods": input_methods,
39
+ "config": dict(config or {}),
40
+ }
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: automas-maafw-controller-adb
3
+ Version: 0.1.0
4
+ Summary: ADB controller provider for AUTO-MAS MaaFW plugins
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: pydantic>=2
8
+
9
+ # automas-maafw-controller-adb
10
+
11
+ ADB controller provider for the AUTO-MAS MaaFW plugin group.
12
+
13
+ This package declares the ADB controller capability without importing `maa` at
14
+ plugin startup. Runtime device resolution remains owned by the MaaFW script
15
+ adapter until the host controller path is fully split.
@@ -0,0 +1,12 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/automas_maafw_controller_adb/__init__.py
4
+ src/automas_maafw_controller_adb/plugin.py
5
+ src/automas_maafw_controller_adb/py.typed
6
+ src/automas_maafw_controller_adb/service.py
7
+ src/automas_maafw_controller_adb.egg-info/PKG-INFO
8
+ src/automas_maafw_controller_adb.egg-info/SOURCES.txt
9
+ src/automas_maafw_controller_adb.egg-info/dependency_links.txt
10
+ src/automas_maafw_controller_adb.egg-info/entry_points.txt
11
+ src/automas_maafw_controller_adb.egg-info/requires.txt
12
+ src/automas_maafw_controller_adb.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [auto_mas.plugins]
2
+ automas_maafw_controller_adb = automas_maafw_controller_adb.plugin:Plugin