- Showcase UI Reorganization: * Move web UI dashboard from root directory into apps/showcase_ui/ for cleaner project structure * Add 'artemis ui' CLI command (artemis/interfaces/cli/commands/ui.py) and launcher scripts for the interactive showcase console - Standalone MCP Server & Notifiers (mcp_server/): * Implement dedicated MCP server package with mobile automation tools (device_state, inspect_trace, task_manager, task_runner) * Add multi-channel notifiers (AgentAPI, Desktop notifications, Webhooks, File output, and Composite routing) * Introduce background task runner and trace store for autonomous mobile execution monitoring - Cross-Platform Runtime & Toolchain Support: * Add artemis/platform/ with OS-specific implementations for Linux, macOS (Darwin), and Windows * Add artemis/runtime/supervisor.py for resilient process and agent runtime supervision * Add artemis/toolchain/ with dependency resolution and SDK descriptors * Add cross-platform launcher scripts (start.sh, start.bat) and installer scripts (scripts/install_deps.*) - Core Enhancements & Diagnostics: * Enhance coordinate normalization, OCR API fallback, and perception pipeline * Add credential validation (credentials_validator.py) and system diagnostics * Update bilingual documentation (README.md, README_CN.md) and architecture diagrams - Test Suite Expansion: * Add integration tests for cloud gateway, remote ADB, and Artemis login * Add unit tests covering core diagnostics, platform detection, toolchain, credentials validator, optional OCR, and MCP tools
87 lines
2.5 KiB
Python
87 lines
2.5 KiB
Python
# Copyright 2026 Google LLC
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
"""Toolchain descriptors and metadata for cross-platform binary discovery."""
|
|
|
|
from collections.abc import Callable
|
|
from dataclasses import dataclass
|
|
|
|
|
|
def _get_embedded_adb() -> str | None:
|
|
"""Fallback to adb binary bundled with adbutils if available."""
|
|
try:
|
|
import adbutils
|
|
|
|
if hasattr(adbutils, "adb_path"):
|
|
return adbutils.adb_path()
|
|
except Exception:
|
|
pass
|
|
return None
|
|
|
|
|
|
def _get_embedded_ffmpeg() -> str | None:
|
|
"""Fallback to ffmpeg binary bundled with imageio_ffmpeg if available."""
|
|
try:
|
|
import imageio_ffmpeg
|
|
|
|
if hasattr(imageio_ffmpeg, "get_ffmpeg_exe"):
|
|
return imageio_ffmpeg.get_ffmpeg_exe()
|
|
except Exception:
|
|
pass
|
|
return None
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ToolDescriptor:
|
|
"""Metadata and resolution strategies for an external binary/toolchain."""
|
|
|
|
name: str
|
|
binary_name: str
|
|
win_binary_name: str
|
|
sdk_relative_path: str | None = None
|
|
embedded_fallback: Callable[[], str | None] | None = None
|
|
description: str = ""
|
|
|
|
|
|
# Standard supported toolchains
|
|
TOOLS: dict[str, ToolDescriptor] = {
|
|
"adb": ToolDescriptor(
|
|
name="adb",
|
|
binary_name="adb",
|
|
win_binary_name="adb.exe",
|
|
sdk_relative_path="platform-tools/adb",
|
|
embedded_fallback=_get_embedded_adb,
|
|
description="Android Debug Bridge client",
|
|
),
|
|
"ffmpeg": ToolDescriptor(
|
|
name="ffmpeg",
|
|
binary_name="ffmpeg",
|
|
win_binary_name="ffmpeg.exe",
|
|
embedded_fallback=_get_embedded_ffmpeg,
|
|
description="FFmpeg multimedia processing framework",
|
|
),
|
|
"scrcpy": ToolDescriptor(
|
|
name="scrcpy",
|
|
binary_name="scrcpy",
|
|
win_binary_name="scrcpy.exe",
|
|
description="Screen Copy display and control tool",
|
|
),
|
|
"uv": ToolDescriptor(
|
|
name="uv",
|
|
binary_name="uv",
|
|
win_binary_name="uv.exe",
|
|
description="Fast Python package manager",
|
|
),
|
|
}
|