ta-studio-mcp 1.4.0 → 1.4.1

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.
Files changed (2) hide show
  1. package/main.py +17 -5
  2. package/package.json +1 -1
package/main.py CHANGED
@@ -17,10 +17,19 @@ import logging
17
17
  import os
18
18
  import sys
19
19
 
20
- from .auth import build_auth_headers
21
- from .ws_client import TAWebSocketClient, DEFAULT_SERVER_URL
22
- from .emulator_relay import dispatch_command
23
- from .stream import FrameStreamer
20
+ # Use try/except to support both execution modes:
21
+ # - `python main.py` (script mode, PYTHONPATH set by cli.js) → absolute imports
22
+ # - `python -m ta_studio_mcp` (module mode) → relative imports
23
+ try:
24
+ from auth import build_auth_headers
25
+ from ws_client import TAWebSocketClient, DEFAULT_SERVER_URL
26
+ from emulator_relay import dispatch_command
27
+ from stream import FrameStreamer
28
+ except ImportError:
29
+ from .auth import build_auth_headers
30
+ from .ws_client import TAWebSocketClient, DEFAULT_SERVER_URL
31
+ from .emulator_relay import dispatch_command
32
+ from .stream import FrameStreamer
24
33
 
25
34
  logging.basicConfig(
26
35
  level=logging.INFO,
@@ -76,7 +85,10 @@ async def main() -> None:
76
85
 
77
86
  async def on_connected(_msg: dict) -> None:
78
87
  """Send identity info on connection."""
79
- from .emulator_relay import handle_list_devices
88
+ try:
89
+ from emulator_relay import handle_list_devices
90
+ except ImportError:
91
+ from .emulator_relay import handle_list_devices
80
92
  devices = await handle_list_devices({})
81
93
  await client.send({
82
94
  "type": "relay_ready",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ta-studio-mcp",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "TA Studio MCP — thin local relay for AI-driven mobile QA",
5
5
  "bin": {
6
6
  "ta-studio-mcp": "bin/cli.js"