quash-mcp 0.2.3__py3-none-any.whl → 0.2.5__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/backend_client.py +7 -6
- quash_mcp/tools/execute_v3.py +39 -1
- {quash_mcp-0.2.3.dist-info → quash_mcp-0.2.5.dist-info}/METADATA +1 -1
- {quash_mcp-0.2.3.dist-info → quash_mcp-0.2.5.dist-info}/RECORD +6 -6
- {quash_mcp-0.2.3.dist-info → quash_mcp-0.2.5.dist-info}/WHEEL +0 -0
- {quash_mcp-0.2.3.dist-info → quash_mcp-0.2.5.dist-info}/entry_points.txt +0 -0
quash_mcp/backend_client.py
CHANGED
|
@@ -245,19 +245,20 @@ class BackendClient:
|
|
|
245
245
|
# Convert to JSON string
|
|
246
246
|
data_json = json.dumps(data_dict)
|
|
247
247
|
|
|
248
|
-
# Prepare
|
|
249
|
-
|
|
250
|
-
"data": ("data.json", data_json, "application/json")
|
|
251
|
-
}
|
|
248
|
+
# Prepare form data (data field as string)
|
|
249
|
+
form_data = {"data": data_json}
|
|
252
250
|
|
|
253
|
-
#
|
|
251
|
+
# Prepare files dict (only screenshot if provided)
|
|
252
|
+
files = {}
|
|
254
253
|
if screenshot_bytes:
|
|
255
254
|
files["screenshot"] = ("screenshot.png", screenshot_bytes, "image/png")
|
|
256
255
|
|
|
257
256
|
async with httpx.AsyncClient(timeout=self.timeout) as client:
|
|
257
|
+
# Send both form data and files (multipart/form-data)
|
|
258
258
|
response = await client.post(
|
|
259
259
|
f"{self.base_url}/api/agent/step",
|
|
260
|
-
|
|
260
|
+
data=form_data,
|
|
261
|
+
files=files if files else None
|
|
261
262
|
)
|
|
262
263
|
|
|
263
264
|
if response.status_code == 200:
|
quash_mcp/tools/execute_v3.py
CHANGED
|
@@ -7,12 +7,25 @@ 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 descriptions
|
|
18
|
+
try:
|
|
19
|
+
from mahoraga.tools import Tools, describe_tools
|
|
20
|
+
from mahoraga.agent.context.personas import DEFAULT
|
|
21
|
+
from mahoraga.agent.utils.async_utils import async_to_sync
|
|
22
|
+
except ImportError as e:
|
|
23
|
+
print(f"Warning: Could not import mahoraga components: {e}")
|
|
24
|
+
Tools = None
|
|
25
|
+
describe_tools = None
|
|
26
|
+
DEFAULT = None
|
|
27
|
+
async_to_sync = None
|
|
28
|
+
|
|
16
29
|
|
|
17
30
|
async def execute_v3(
|
|
18
31
|
task: str,
|
|
@@ -114,11 +127,36 @@ async def execute_v3(
|
|
|
114
127
|
# Initialize local ADB tools for code execution
|
|
115
128
|
adb_tools = AdbTools(serial=state.device_serial, use_tcp=True)
|
|
116
129
|
|
|
117
|
-
# Code executor namespace
|
|
130
|
+
# Code executor namespace - add tool functions so generated code can call them
|
|
118
131
|
executor_globals = {
|
|
119
132
|
"__builtins__": __builtins__,
|
|
120
133
|
"adb_tools": adb_tools
|
|
121
134
|
}
|
|
135
|
+
|
|
136
|
+
# Add tool functions to executor namespace (like start_app, swipe, etc.)
|
|
137
|
+
if describe_tools and DEFAULT:
|
|
138
|
+
try:
|
|
139
|
+
# Get all tool functions from AdbTools instance
|
|
140
|
+
tool_list = describe_tools(adb_tools, exclude_tools=None)
|
|
141
|
+
|
|
142
|
+
# Filter by allowed tools from DEFAULT persona
|
|
143
|
+
allowed_tool_names = DEFAULT.allowed_tools if hasattr(DEFAULT, 'allowed_tools') else []
|
|
144
|
+
filtered_tools = {name: func for name, func in tool_list.items() if name in allowed_tool_names}
|
|
145
|
+
|
|
146
|
+
# Add each tool function to executor globals
|
|
147
|
+
for tool_name, tool_function in filtered_tools.items():
|
|
148
|
+
# Convert async functions to sync if needed
|
|
149
|
+
if asyncio.iscoroutinefunction(tool_function):
|
|
150
|
+
if async_to_sync:
|
|
151
|
+
tool_function = async_to_sync(tool_function)
|
|
152
|
+
|
|
153
|
+
# Add to globals so code can call it directly
|
|
154
|
+
executor_globals[tool_name] = tool_function
|
|
155
|
+
|
|
156
|
+
log_progress(f"🔧 Loaded {len(filtered_tools)} tool functions: {list(filtered_tools.keys())}")
|
|
157
|
+
except Exception as e:
|
|
158
|
+
log_progress(f"⚠️ Warning: Could not load tool functions: {e}")
|
|
159
|
+
|
|
122
160
|
executor_locals = {}
|
|
123
161
|
|
|
124
162
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quash-mcp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
quash_mcp/__init__.py,sha256=LImiWCRgjAbb5DZXBq2DktUEAbftvnO61Vil4Ayun9A,39
|
|
2
2
|
quash_mcp/__main__.py,sha256=WCg5OlnXhr6i0XJHAUGpbhliMy3qE2SJkFzVD4wO-lw,239
|
|
3
|
-
quash_mcp/backend_client.py,sha256=
|
|
3
|
+
quash_mcp/backend_client.py,sha256=FvrchO5R4fByTlSh_LosFSKXOZSsPKYEsRZ3LNioDdk,9998
|
|
4
4
|
quash_mcp/server.py,sha256=scUGnplxjsvyYLK2q6hrjl-5Chkdnat9pODDtLzsQFY,15519
|
|
5
5
|
quash_mcp/state.py,sha256=Tnt795GnZcas-h62Y6KYyIZVopeoWPM0TbRwOeVFYj4,4394
|
|
6
6
|
quash_mcp/device/__init__.py,sha256=6e8CtHolt-vJKPxZUU_Vsd6-QGqos9VrFykaLTT90rk,772
|
|
@@ -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=pP9UdTiK4djUYwKcWO5mSQGPNK1LTEskD03xlBZSwNE,12788
|
|
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.5.dist-info/METADATA,sha256=QWrTqHgScsnvqNnYHW49YFGRENPVFvl4sNuzEP9Uka8,8129
|
|
21
|
+
quash_mcp-0.2.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
22
|
+
quash_mcp-0.2.5.dist-info/entry_points.txt,sha256=9sbDxrx0ApGDVRS-IE3mQgSao3DwKnnV_k-_ipFn9QI,52
|
|
23
|
+
quash_mcp-0.2.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|