MaaFw 4.5.5__py3-none-win_arm64.whl → 5.0.0a1__py3-none-win_arm64.whl

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.

Potentially problematic release.


This version of MaaFw might be problematic. Click here for more details.

@@ -1,199 +0,0 @@
1
- import ctypes
2
- import json
3
- from abc import ABC
4
- from typing import Optional, Tuple, Any
5
- from enum import IntEnum
6
- from dataclasses import dataclass
7
-
8
- from .define import MaaNotificationCallback
9
-
10
-
11
- # class NotificationEvent(IntEnum):
12
- # ResourceLoading = 1
13
- # ControllerAction = 2
14
- # TaskerTask = 3
15
- # TaskNextList = 4
16
- # TaskRecognition = 5
17
- # TaskAction = 6
18
-
19
-
20
- class NotificationType(IntEnum):
21
- Unknown = 0
22
- Starting = 1
23
- Succeeded = 2
24
- Failed = 3
25
-
26
-
27
- class NotificationHandler(ABC):
28
-
29
- @dataclass
30
- class ResourceLoadingDetail:
31
- res_id: int
32
- hash: str
33
- path: str
34
-
35
- def on_resource_loading(
36
- self, noti_type: NotificationType, detail: ResourceLoadingDetail
37
- ):
38
- pass
39
-
40
- @dataclass
41
- class ControllerActionDetail:
42
- ctrl_id: int
43
- uuid: str
44
- action: str
45
- param: dict
46
-
47
- def on_controller_action(
48
- self, noti_type: NotificationType, detail: ControllerActionDetail
49
- ):
50
- pass
51
-
52
- @dataclass
53
- class TaskerTaskDetail:
54
- task_id: int
55
- entry: str
56
- uuid: str
57
- hash: str
58
-
59
- def on_tasker_task(self, noti_type: NotificationType, detail: TaskerTaskDetail):
60
- pass
61
-
62
- @dataclass
63
- class NodeNextListDetail:
64
- task_id: int
65
- name: str
66
- next_list: list[str]
67
- focus: Any
68
-
69
- def on_node_next_list(
70
- self, noti_type: NotificationType, detail: NodeNextListDetail
71
- ):
72
- pass
73
-
74
- @dataclass
75
- class NodeRecognitionDetail:
76
- task_id: int
77
- reco_id: int
78
- name: str
79
- focus: Any
80
-
81
- def on_node_recognition(
82
- self, noti_type: NotificationType, detail: NodeRecognitionDetail
83
- ):
84
- pass
85
-
86
- @dataclass
87
- class NodeActionDetail:
88
- task_id: int
89
- node_id: int
90
- name: str
91
- focus: Any
92
-
93
- def on_node_action(self, noti_type: NotificationType, detail: NodeActionDetail):
94
- pass
95
-
96
- def on_unknown_notification(self, msg: str, details: dict):
97
- pass
98
-
99
- def on_raw_notification(self, msg: str, details: dict):
100
-
101
- noti_type = NotificationHandler._notification_type(msg)
102
-
103
- if msg.startswith("Resource.Loading"):
104
- detail = self.ResourceLoadingDetail(
105
- res_id=details["res_id"],
106
- hash=details["hash"],
107
- path=details["path"],
108
- )
109
- self.on_resource_loading(noti_type, detail)
110
-
111
- elif msg.startswith("Controller.Action"):
112
- detail = self.ControllerActionDetail(
113
- ctrl_id=details["ctrl_id"],
114
- uuid=details["uuid"],
115
- action=details["action"],
116
- param=details["param"],
117
- )
118
- self.on_controller_action(noti_type, detail)
119
-
120
- elif msg.startswith("Tasker.Task"):
121
- detail = self.TaskerTaskDetail(
122
- task_id=details["task_id"],
123
- entry=details["entry"],
124
- uuid=details["uuid"],
125
- hash=details["hash"],
126
- )
127
- self.on_tasker_task(noti_type, detail)
128
-
129
- elif msg.startswith("Node.NextList"):
130
- detail = self.NodeNextListDetail(
131
- task_id=details["task_id"],
132
- name=details["name"],
133
- next_list=details["list"],
134
- focus=details["focus"],
135
- )
136
- self.on_node_next_list(noti_type, detail)
137
-
138
- elif msg.startswith("Node.Recognition"):
139
- detail = self.NodeRecognitionDetail(
140
- task_id=details["task_id"],
141
- reco_id=details["reco_id"],
142
- name=details["name"],
143
- focus=details["focus"],
144
- )
145
- self.on_node_recognition(noti_type, detail)
146
-
147
- elif msg.startswith("Node.Action"):
148
- detail = self.NodeActionDetail(
149
- task_id=details["task_id"],
150
- node_id=details["node_id"],
151
- name=details["name"],
152
- focus=details["focus"],
153
- )
154
- self.on_node_action(noti_type, detail)
155
-
156
- else:
157
- self.on_unknown_notification(msg, details)
158
-
159
- @property
160
- def c_callback(self) -> MaaNotificationCallback:
161
- return self._c_notification_agent
162
-
163
- @property
164
- def c_callback_arg(self) -> ctypes.c_void_p:
165
- return ctypes.c_void_p.from_buffer(ctypes.py_object(self))
166
-
167
- @staticmethod
168
- def _gen_c_param(
169
- handler: Optional["NotificationHandler"],
170
- ) -> Tuple[MaaNotificationCallback, ctypes.c_void_p]:
171
- if handler:
172
- return handler.c_callback, handler.c_callback_arg
173
- else:
174
- return NotificationHandler._c_notification_agent, ctypes.c_void_p()
175
-
176
- @staticmethod
177
- def _notification_type(message: str) -> NotificationType:
178
- if message.endswith(".Starting"):
179
- return NotificationType.Starting
180
- elif message.endswith(".Succeeded"):
181
- return NotificationType.Succeeded
182
- elif message.endswith(".Failed"):
183
- return NotificationType.Failed
184
- else:
185
- return NotificationType.Unknown
186
-
187
- @staticmethod
188
- @MaaNotificationCallback
189
- def _c_notification_agent(
190
- msg: ctypes.c_char_p,
191
- details_json: ctypes.c_char_p,
192
- callback_arg: ctypes.c_void_p,
193
- ):
194
- if not callback_arg:
195
- return
196
-
197
- self: NotificationHandler = ctypes.cast(callback_arg, ctypes.py_object).value
198
-
199
- self.on_raw_notification(msg.decode(), json.loads(details_json.decode()))
@@ -1,33 +0,0 @@
1
- maa/__init__.py,sha256=t2Z9yJWrSZfH16xYN67bKpiPEHDf7iaiw4wi0PjmU8U,250
2
- maa/agent_client.py,sha256=qx1-3VGp97JB_UMlbkvK-O_GTigbdqD6U4gGKi2yQW4,4049
3
- maa/buffer.py,sha256=XFr1MnWt-xmZkhQ_2ZzGfiqSJJwmphY4U07EEzMNYQc,16544
4
- maa/context.py,sha256=dYCvRNqq2iCL8lIyp2TkZorGB5KNI34L3pGzlpdL7co,6454
5
- maa/controller.py,sha256=pyVPwRnpGcGCoWAa2FOPBvwIY5jY2kqmRtd-V16bPyU,24507
6
- maa/custom_action.py,sha256=honGd28UaKWzApYBHO9_Cka8hPfzZUy6HBUfIdfQiaU,2554
7
- maa/custom_recognition.py,sha256=nfNgPKq9a6t2eoXwKMJRvZMXTh31Jn0JfxUMsfGI33Y,3384
8
- maa/define.py,sha256=EHTbELEAf4vXuCLyNM6Xhp9MM6iigSA6b9QE3m-B3DE,13643
9
- maa/job.py,sha256=MUI5T2X9ON9c7Dl6yo_0pp8Ulpn25XOD_uEdGm2k-TA,1231
10
- maa/library.py,sha256=u6gbEHDV3I0y69-ZoBo1p6-bAtP4jqSQa4FICuzaw3U,3961
11
- maa/notification_handler.py,sha256=dpbIEKTqCvW9mj6am49Fd9ntoM39OCadhOGrvkmhyyI,5502
12
- maa/resource.py,sha256=sCGAK1FFjZCaf01t_FPdtl4pMDQsybhEjmafp9XfITA,12222
13
- maa/tasker.py,sha256=8eGK83RhsVXh1Px2_eHhUBd6epaubIGDN0FG4soi4xM,14232
14
- maa/toolkit.py,sha256=H7P58dPLKzEm_aZMsDJ98IaMZnTE-hcFgK8MKnN0F6g,11381
15
- maa/agent/__init__.py,sha256=K4vyyD6YgLR6PEQl86t4oKP4eViCdNr3Br94dNk8YjM,257
16
- maa/agent/agent_server.py,sha256=e0yE_ffWJlTPydJbYLK9OhCM5fVVlZQIcvEQMjB5V68,3636
17
- maa/bin/DirectML.dll,sha256=d7Dbg_-QPyMj9cr1OEmdda9gOLvqI7eVn30jLZpKudQ,18444832
18
- maa/bin/MaaAdbControlUnit.dll,sha256=60H3DsVeLnuq046bb4Q5uic4vlxrcZV7HeCMMTsJErs,838144
19
- maa/bin/MaaAgentClient.dll,sha256=Q8WDVoc-NgtmVuXDB7fPDNtPt39vqORA6F4jJFA3U4g,1115136
20
- maa/bin/MaaAgentServer.dll,sha256=LA27OONEMtVA2Gsri7MuM2sfGwAJNXqfEZyX1dYpl0U,1253376
21
- maa/bin/MaaCustomControlUnit.dll,sha256=2xtyL6XZELABtZVTBMSfWO5_lTf1TIRwCVM5g_UjR9c,276992
22
- maa/bin/MaaDbgControlUnit.dll,sha256=TeNK8KOgVEP7XiHzEHBjshcfrxEKv6o2ND7nE9yzLSg,394752
23
- maa/bin/MaaFramework.dll,sha256=HP-wj1UJ0ikYrElgkF6xNLTwqZnZNiuzq9R-T-9UfqQ,1978368
24
- maa/bin/MaaToolkit.dll,sha256=wveQtEb-TXtfygs-a_Gyik4UNEM4_67-uSSnJbnzavI,779776
25
- maa/bin/MaaUtils.dll,sha256=ZkQ8aSHcMPlsjxL9ZjWF6hryqQtsAsR2dyKla6U8RO0,562688
26
- maa/bin/MaaWin32ControlUnit.dll,sha256=9oEpav_EjeWdTgPvEkH7ik58GLv_t1u5ftjHN41G3XQ,353792
27
- maa/bin/fastdeploy_ppocr_maa.dll,sha256=5LEyrao0OSuJyHjRe3HCyzw_2D2Ynt28TOzjAkQgI8o,1049088
28
- maa/bin/onnxruntime_maa.dll,sha256=r9qt8ChcpFeoZkstIGFHQ5CLAmfERPXBQJJGdlfB8VQ,19039744
29
- maa/bin/opencv_world4_maa.dll,sha256=fjKN9Dg59liGwlCpkZ8FZNzbMh65SeSRnD98pWtcfuE,12862464
30
- maafw-4.5.5.dist-info/licenses/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
31
- maafw-4.5.5.dist-info/METADATA,sha256=Jp-6D2WC4-2VSOLFixgPAfQXK-Dim4tc4a_FOASUNZQ,24481
32
- maafw-4.5.5.dist-info/WHEEL,sha256=CUnyDJaykcVTxcKkonAaC86WeSAkytRwcxeIq_huwCo,93
33
- maafw-4.5.5.dist-info/RECORD,,
File without changes