quash-mcp 0.2.4__py3-none-any.whl → 0.2.6__py3-none-any.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 quash-mcp might be problematic. Click here for more details.
- quash_mcp/tools/execute_v3.py +51 -1
- {quash_mcp-0.2.4.dist-info → quash_mcp-0.2.6.dist-info}/METADATA +1 -1
- {quash_mcp-0.2.4.dist-info → quash_mcp-0.2.6.dist-info}/RECORD +5 -5
- {quash_mcp-0.2.4.dist-info → quash_mcp-0.2.6.dist-info}/WHEEL +0 -0
- {quash_mcp-0.2.4.dist-info → quash_mcp-0.2.6.dist-info}/entry_points.txt +0 -0
quash_mcp/tools/execute_v3.py
CHANGED
|
@@ -7,12 +7,27 @@ This hybrid approach keeps proprietary code private while allowing local device
|
|
|
7
7
|
|
|
8
8
|
import time
|
|
9
9
|
import uuid
|
|
10
|
+
import asyncio
|
|
10
11
|
from typing import Dict, Any, Callable, Optional
|
|
11
12
|
from ..state import get_state
|
|
12
13
|
from ..backend_client import get_backend_client
|
|
13
14
|
from ..device.state_capture import get_device_state
|
|
14
15
|
from ..device.adb_tools import AdbTools
|
|
15
16
|
|
|
17
|
+
# Import mahoraga components for tool functions
|
|
18
|
+
try:
|
|
19
|
+
from mahoraga.tools import Tools, describe_tools
|
|
20
|
+
from mahoraga.tools.adb import AdbTools as MahoragaAdbTools
|
|
21
|
+
from mahoraga.agent.context.personas import DEFAULT
|
|
22
|
+
from mahoraga.agent.utils.async_utils import async_to_sync
|
|
23
|
+
except ImportError as e:
|
|
24
|
+
print(f"Warning: Could not import mahoraga components: {e}")
|
|
25
|
+
Tools = None
|
|
26
|
+
describe_tools = None
|
|
27
|
+
MahoragaAdbTools = None
|
|
28
|
+
DEFAULT = None
|
|
29
|
+
async_to_sync = None
|
|
30
|
+
|
|
16
31
|
|
|
17
32
|
async def execute_v3(
|
|
18
33
|
task: str,
|
|
@@ -114,11 +129,46 @@ async def execute_v3(
|
|
|
114
129
|
# Initialize local ADB tools for code execution
|
|
115
130
|
adb_tools = AdbTools(serial=state.device_serial, use_tcp=True)
|
|
116
131
|
|
|
117
|
-
# Code executor namespace
|
|
132
|
+
# Code executor namespace - add tool functions so generated code can call them
|
|
118
133
|
executor_globals = {
|
|
119
134
|
"__builtins__": __builtins__,
|
|
120
135
|
"adb_tools": adb_tools
|
|
121
136
|
}
|
|
137
|
+
|
|
138
|
+
# Add tool functions to executor namespace (like start_app, swipe, etc.)
|
|
139
|
+
if describe_tools and DEFAULT and MahoragaAdbTools:
|
|
140
|
+
try:
|
|
141
|
+
# Create a mahoraga AdbTools instance for tool execution
|
|
142
|
+
# This instance has all the tool methods like swipe, start_app, etc.
|
|
143
|
+
mahoraga_tools = MahoragaAdbTools(
|
|
144
|
+
serial=state.device_serial,
|
|
145
|
+
use_tcp=True,
|
|
146
|
+
remote_tcp_port=8080
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
# Get all tool functions from mahoraga AdbTools instance
|
|
150
|
+
tool_list = describe_tools(mahoraga_tools, exclude_tools=None)
|
|
151
|
+
|
|
152
|
+
# Filter by allowed tools from DEFAULT persona
|
|
153
|
+
allowed_tool_names = DEFAULT.allowed_tools if hasattr(DEFAULT, 'allowed_tools') else []
|
|
154
|
+
filtered_tools = {name: func for name, func in tool_list.items() if name in allowed_tool_names}
|
|
155
|
+
|
|
156
|
+
# Add each tool function to executor globals
|
|
157
|
+
for tool_name, tool_function in filtered_tools.items():
|
|
158
|
+
# Convert async functions to sync if needed
|
|
159
|
+
if asyncio.iscoroutinefunction(tool_function):
|
|
160
|
+
if async_to_sync:
|
|
161
|
+
tool_function = async_to_sync(tool_function)
|
|
162
|
+
|
|
163
|
+
# Add to globals so code can call it directly
|
|
164
|
+
executor_globals[tool_name] = tool_function
|
|
165
|
+
|
|
166
|
+
log_progress(f"🔧 Loaded {len(filtered_tools)} tool functions: {list(filtered_tools.keys())}")
|
|
167
|
+
except Exception as e:
|
|
168
|
+
log_progress(f"⚠️ Warning: Could not load tool functions: {e}")
|
|
169
|
+
import traceback
|
|
170
|
+
log_progress(f"Traceback: {traceback.format_exc()}")
|
|
171
|
+
|
|
122
172
|
executor_locals = {}
|
|
123
173
|
|
|
124
174
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quash-mcp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Model Context Protocol server for Quash - AI-powered mobile automation agent
|
|
5
5
|
Project-URL: Homepage, https://quashbugs.com
|
|
6
6
|
Project-URL: Repository, https://github.com/quash/quash-mcp
|
|
@@ -14,10 +14,10 @@ quash_mcp/tools/configure.py,sha256=cv4RTolu6qae-XzyACSJUDrALfd0gYC-XE5s66_zfNk,
|
|
|
14
14
|
quash_mcp/tools/connect.py,sha256=Kc7RGRUgtd2sR_bv6U4CB4kWSaLfsDc5kBo9u4FEjzs,4799
|
|
15
15
|
quash_mcp/tools/execute.py,sha256=kR3VzIl31Lek-js4Hgxs-S_ls4YwKnbqkt79KFbvFuM,909
|
|
16
16
|
quash_mcp/tools/execute_v2_backup.py,sha256=waWnaD0dEVcOJgRBbqZo3HnxME1s6YUOn8aRbm4R3X4,6081
|
|
17
|
-
quash_mcp/tools/execute_v3.py,sha256=
|
|
17
|
+
quash_mcp/tools/execute_v3.py,sha256=Pn506rAED6u6NNDq_M2pRKfSRhPIqhvDJwn_uYQCt5k,13329
|
|
18
18
|
quash_mcp/tools/runsuite.py,sha256=gohLk9FpN8v7F0a69fspqOqUexTcslpYf3qU-iIZZ3s,7220
|
|
19
19
|
quash_mcp/tools/usage.py,sha256=g76A6FO36fThoyRFG7q92QmS3Kh1pIKOrhYOzUdIubA,1155
|
|
20
|
-
quash_mcp-0.2.
|
|
21
|
-
quash_mcp-0.2.
|
|
22
|
-
quash_mcp-0.2.
|
|
23
|
-
quash_mcp-0.2.
|
|
20
|
+
quash_mcp-0.2.6.dist-info/METADATA,sha256=UqoMmv6xb1hu_k_YLdpol8wh23k6eUoCfHaWrKbWARI,8129
|
|
21
|
+
quash_mcp-0.2.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
22
|
+
quash_mcp-0.2.6.dist-info/entry_points.txt,sha256=9sbDxrx0ApGDVRS-IE3mQgSao3DwKnnV_k-_ipFn9QI,52
|
|
23
|
+
quash_mcp-0.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|