harmony-plugin

v0.2.2
@itlili/harmony-plugin Checked 1 day ago Published 3 months ago

HarmonyOS Engineering Agent - AI-native MCP toolkit for building, migrating, validating and maintaining HarmonyOS applications

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

build_check_environment

Check HarmonyOS development environment (SDK, JDK, Node, DevEco, Hvigor)

build_detect_sdk

Detect HarmonyOS SDK version

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

build_detect_deveco

Detect DevEco Studio installation

build_run_hvigor

Run Hvigor build

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
taskstringSpecific Hvigor task to run

build_build_module

Build a specific module

ParameterTypeDescription
moduleName *stringName of the module to build
projectPath *stringPath to the HarmonyOS project

build_build_app

Build the full app (HAP)

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
buildModestringBuild mode (e.g. debug, release)

build_clean_build

Clean and rebuild

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

build_parse_build_errors

Parse build output into structured errors

ParameterTypeDescription
buildOutput *stringRaw build output text to parse

build_classify_build_error

Classify a build error

ParameterTypeDescription
errorCode *stringError code
errorMessage *stringError message text

build_search_docs_for_error

Search docs for error resolution

ParameterTypeDescription
errorCode *stringError code to search for
errorMessage *stringError message to search for

build_generate_fix

Generate fix suggestion for a build error

ParameterTypeDescription
error *objectBuild error object
projectPath *stringPath to the HarmonyOS project

build_apply_fix

Apply a fix patch to the project

ParameterTypeDescription
fix *objectFix patch object to apply
projectPath *stringPath to the HarmonyOS project

build_build_fix_loop

Run the build-fix loop (BUILD→FAIL→FIX→BUILD until PASS or BLOCKED)

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
maxIterationsintegerMaximum fix iterations

build_environment_doctor

环境全面检查。检查 DevEco Studio、SDK、JDK、Node.js、Hvigor、设备、PATH、权限、ohpm、Git 共 10 个组件,输出环境健康度评分。

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

build_auto_fix_environment

自动修复环境问题。针对可自动修复的环境问题(JDK版本、Hvigor版本、PATH配置、ohpm版本等),执行自动修复命令。

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
issueIdsarray要修复的问题 ID 列表,不传则修复所有可自动修复的问题

build_generate_packaging

Generate multi-module packaging config for HarmonyOS. Creates build-profile.json5 with entry, feature, and library modules. Supports phone/tablet/2in1 device types, delivery with install, and installation-free feature modules.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
modulesarrayModule names (default: entry, feature, library)

build_generate_multi_channel

Generate multi-channel packaging config for HarmonyOS. Creates Product + buildMode configuration with per-channel bundle names, signing configs, and obfuscation rules. Supports channel-specific builds.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
channelsarrayChannel names (default: huawei, xiaomi, oppo, vivo, default)

doctor_code_doctor

全面代码质量检查。扫描架构、代码质量、Lint、废弃API、API兼容性、依赖、权限、安全、并发、生命周期、内存、资源、性能、无障碍、国际化共15个维度,返回 CodeDoctorResult 包含问题列表、分类统计、自动修复建议。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
categoriesarray要检查的维度列表,不传则检查全部 15 个维度

doctor_health_score

项目健康评分。从 Architecture、Correctness、Performance、Security、Compatibility、Maintainability 六个维度评估项目健康度,给出 A-F 评级和改进计划。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

doctor_check_deprecated_apis

Check for deprecated API usage in the project. Identifies deprecated APIs, provides replacement alternatives, migration code examples, and severity classification. Covers @system.router → @ohos.router, @system.storage → @ohos.data.preferences, @system.fetch → @ohos.net.http, and more.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
targetSdkstringTarget SDK version (e.g. 'API 12'), defaults to 'API 12'

doctor_check_arkts_syntax

ArkTS 语法检查器。扫描项目中的 ArkTS 文件,检查语法错误、类型错误、装饰器使用规范、性能警告。支持自动修复(autoFix=true)。检测 ETS1001-ETS1004 等常见错误码。

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
autoFixbooleanAuto-fix detected errors (default: false)

dep_scan_dependencies

Scan project dependencies from build files (build.gradle, Podfile, pubspec.yaml, package.json, etc.) and return migration status

ParameterTypeDescription
projectPath *stringPath to the project root directory
frameworkstringFramework hint: android, ios, flutter, react-native

dep_search_ohpm

Search for packages in OHPM (HarmonyOS OpenHarmony Package Manager) knowledge base

ParameterTypeDescription
query *stringSearch query - package name, keyword, or equivalent name from other platforms
categorystringFilter by category (e.g. '网络', '图像', '数据存储', '图表', '安全')

dep_resolve_dependency

Resolve whether a specific dependency is compatible with HarmonyOS and get migration guidance

ParameterTypeDescription
dependencyName *stringName of the dependency to resolve
sourcePlatform *stringSource platform: android, ios, flutter, react-native
version *stringCurrent version of the dependency

dep_replace_dependency

Find HarmonyOS equivalent replacements for a dependency with confidence scores

ParameterTypeDescription
dependencyName *stringName of the dependency to find replacements for
sourcePlatform *stringSource platform: android, ios, flutter, react-native

dep_audit_license

Audit licenses of project dependencies and flag risky licenses (GPL, AGPL, unknown, etc.)

ParameterTypeDescription
dependenciesarrayList of dependency names to audit (alternative to projectPath)
projectPathstringPath to the project root directory (scans build files)

dep_audit_vulnerability

Check for known vulnerabilities (CVEs) in project dependencies

ParameterTypeDescription
dependenciesarrayList of dependency names to check (alternative to projectPath)
projectPathstringPath to the project root directory (scans build files)

device_list_devices

列出所有已连接/可用的设备和模拟器

device_start_emulator

启动一个 HarmonyOS 模拟器

ParameterTypeDescription
deviceNamestring模拟器设备名称,不指定则使用默认模拟器

device_stop_emulator

停止一个模拟器

ParameterTypeDescription
deviceId *string模拟器设备 ID

device_install_app

在设备上安装 HAP 包

ParameterTypeDescription
deviceId *string目标设备 ID
hapPath *stringHAP 文件路径

device_launch_app

在设备上启动应用

ParameterTypeDescription
bundleName *string应用包名
deviceId *string目标设备 ID

device_stop_app

停止设备上的应用

ParameterTypeDescription
bundleName *string应用包名
deviceId *string目标设备 ID

device_restart_app

重启设备上的应用

ParameterTypeDescription
bundleName *string应用包名
deviceId *string目标设备 ID

device_clear_app_data

清除设备上应用的数据

ParameterTypeDescription
bundleName *string应用包名
deviceId *string目标设备 ID

device_capture_screenshot

截取设备屏幕截图

ParameterTypeDescription
deviceId *string目标设备 ID
outputPathstring截图保存路径,不指定则使用默认路径

device_tap

在设备屏幕上点击指定坐标

ParameterTypeDescription
deviceId *string目标设备 ID
x *numberX 坐标
y *numberY 坐标

device_input_text

在设备上输入文本

ParameterTypeDescription
deviceId *string目标设备 ID
text *string要输入的文本

device_swipe

在设备屏幕上执行滑动手势

ParameterTypeDescription
deviceId *string目标设备 ID
endX *number结束 X 坐标
endY *number结束 Y 坐标
startX *number起始 X 坐标
startY *number起始 Y 坐标
durationnumber滑动持续时间(毫秒),默认 300

device_collect_logs

收集设备系统日志

ParameterTypeDescription
deviceId *string目标设备 ID
linesnumber获取的日志行数,默认 200
tagstring日志标签过滤

device_collect_hilog

收集设备 HiLog 输出

ParameterTypeDescription
deviceId *string目标设备 ID
levelstring日志级别过滤(D/I/W/E/F)
tagstringHiLog 标签过滤

device_get_device_info

获取设备信息(OS 版本、屏幕尺寸等)

ParameterTypeDescription
deviceId *string目标设备 ID

device_create_device_matrix

Create a device matrix for multi-device testing. Generates a matrix of device configurations covering Phone, Tablet, Foldable, Wearable, and Large Screen with Portrait/Landscape orientations, Light/Dark themes, font scales, and locales.

ParameterTypeDescription
name *stringName for the device matrix

device_run_device_matrix_tests

Run tests across all devices in a device matrix. Tests each device configuration and reports issues specific to each device type (foldable gaps, wearable truncation, dark theme contrast, etc.).

ParameterTypeDescription
matrixId *stringID of the device matrix to test against
projectPath *stringPath to the HarmonyOS project
testNamestringOptional specific test name to run

device_add_device_to_matrix

Add a custom device configuration to the device matrix. Validate device specs and add to the testing matrix.

ParameterTypeDescription
dpi *numberScreen DPI
height *numberScreen height in vp
name *stringDevice name
orientation *stringDefault orientation
theme *stringTheme
type *stringDevice type
width *numberScreen width in vp
descriptionstringDevice description
fontScalenumberFont scale factor
localestringLocale code

device_analyze_hardware_access

Analyze hardware access capabilities in the project. Checks camera, bluetooth, NFC, gyroscope, GPS hardware support, SysCap detection, and provides degradation suggestions for unsupported hardware.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
targetDevicesarrayOptional target device types to filter compatibility analysis

device_analyze_interaction

Analyze interaction methods supported by the project. Checks touch, mouse, keyboard, stylus, and remote control adaptation. Reports focus navigation issues, keyboard shortcuts, and interaction method adaptation scores.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

docs_search_harmony_docs

Search HarmonyOS documentation with query and optional filters

ParameterTypeDescription
query *stringSearch query for HarmonyOS documentation
categorystringFilter by API category (e.g., ArkUI, Network, Storage, Media, Router, Permission, Lifecycle, etc.)
limitintegerMaximum number of results to return (default: 10)
sdkVersionstringFilter by minimum SDK version (e.g., API 9, API 10)

docs_get_harmony_api

Get full API details including name, signature, description, parameters, return value, minimum SDK, deprecation status, related APIs, and code examples

ParameterTypeDescription
apiName *stringThe exact name of the HarmonyOS API to look up (e.g., 'http.createHttp', 'router.pushUrl', 'Text')

docs_get_api_version

Get version information for a specific API including introduced in, deprecated in, removed in, and current SDK compatibility

ParameterTypeDescription
apiName *stringThe name of the HarmonyOS API to check version info for

docs_check_api_compatibility

Check if an API is compatible with the current project's SDK version

ParameterTypeDescription
apiName *stringThe name of the HarmonyOS API to check compatibility for
projectSDKVersion *stringThe project's SDK version (e.g., 'API 9', 'API 10', 'API 11')

docs_search_best_practice

Search for best practices and patterns (e.g., navigation, state management, network request, permission, lifecycle, image loading, list performance)

ParameterTypeDescription
query *stringSearch query for best practices (e.g., 'navigation', 'state management', 'network request', 'permission')
limitintegerMaximum number of results to return (default: 10)

docs_search_knowledge_base

搜索 HarmonyOS 知识库(本地 + 云端双路)。本地返回内置 API 文档和最佳实践,同时提示可调用官方 deveco-mcp 的 harmonyos_knowledge_search 获取最新云端文档

ParameterTypeDescription
query *string搜索关键词(API名称、组件名、模块名等)
maxResultsinteger最大返回结果数(默认10)

docs_get_official_knowledge_config

获取官方 HarmonyOS 知识库(deveco-mcp 的 harmonyos_knowledge_search)的配置信息和使用说明

docs_search_official_knowledge

直接调用华为云端 HarmonyOS 知识库搜索。支持搜索API参考、开发指南、最佳实践、常见问题和版本变更说明。结果来自华为官方实时文档。

ParameterTypeDescription
keywords *array搜索关键词列表
maxCharSizeinteger最大返回字符数(默认10000)

enterprise_manage_roles

Manage team roles and permissions (list, add, remove, update)

ParameterTypeDescription
action *stringAction to perform on roles
permissionsarrayList of permissions for the role
rolestringRole name (e.g. Developer, Reviewer, QA, TechLead, Admin, Security, ReleaseManager)
userIdstringUser ID to assign the role to

enterprise_query_audit_log

Query audit log entries for a project

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
actionstringFilter by action type
fromDatestringFilter from this date (ISO 8601)
limitintegerMaximum number of entries to return
toDatestringFilter to this date (ISO 8601)
userIdstringFilter by user ID

enterprise_manage_rules

Manage enterprise rule packs (list, add, remove, check)

ParameterTypeDescription
action *stringAction to perform on rules
projectPathstringPath to the HarmonyOS project
ruleConfigstringJSON configuration for the rule
ruleTypestringType of rule

enterprise_manage_private_capability_graph

Manage private SDK capability mappings (list, add, remove, search)

ParameterTypeDescription
action *stringAction to perform on capability graph
descriptionstringDescription of the capability mapping
sourceSDKstringSource SDK API name
targetSDKstringTarget HarmonyOS SDK API name

enterprise_manage_custom_recipes

Manage custom migration recipes (list, add, remove, execute)

ParameterTypeDescription
action *stringAction to perform on recipes
descriptionstringDescription of the recipe
recipeNamestringRecipe name
sourceCodestringSource code pattern for the recipe
targetCodestringTarget HarmonyOS code for the recipe

enterprise_record_knowledge

Record migration knowledge from completed projects

ParameterTypeDescription
projectPath *stringPath to the project
sourceFramework *stringSource framework name
targetFramework *stringTarget HarmonyOS framework
failedMappingsstringJSON array of failed API mappings
issuesFoundstringJSON array of issues encountered
notesstringAdditional notes about the migration
successfulMappingsstringJSON array of successful API mappings

enterprise_get_knowledge

Retrieve accumulated migration knowledge

ParameterTypeDescription
limitintegerMaximum number of entries to return
querystringSearch query for matching knowledge entries
sourceFrameworkstringFilter by source framework
targetFrameworkstringFilter by target framework

kit_search_kit_api

在 25 个 HarmonyOS SDK Kit 中搜索 API。返回导入路径、函数签名、参数列表、返回值、错误码、权限要求、代码示例。支持按 Kit 名称和功能分类过滤。

ParameterTypeDescription
query *string搜索关键词(API 名称、Kit 名称、功能描述)
categorystring功能分类,如 '应用服务'、'网络通信'、'安全认证'
kitNamestring限定 Kit 名称,如 'Push Kit'、'Network Kit'

kit_generate_kit_code

根据需求描述,生成完整的 Kit 调用代码(导入、初始化、调用、错误处理)。支持 Push Kit、Account Kit、Network Kit、Location Kit、Scan Kit、Share Kit、IAP Kit 等。

ParameterTypeDescription
kitName *stringKit 名称,如 'Push Kit'、'Account Kit'、'Network Kit'
scenario *string使用场景描述,如 '获取推送 Token 并显示消息列表'
targetSdkstring目标 SDK 版本,默认 API 12

kit_check_kit_permissions

检查指定 Kit 需要的权限,返回权限列表、权限级别、module.json5 配置示例、声明指南。

ParameterTypeDescription
kitName *stringKit 名称,如 'Push Kit'、'Location Kit'、'Scan Kit'、'Network Kit'
featurestring具体功能,如 '推送通知'、'GPS 定位'

kit_list_kits

列出所有 25 个 HarmonyOS SDK Kit 的完整信息,包括名称、功能领域、核心 API、使用场景、SDK 版本。

migration_assess_migration

Full migration assessment report - analyzes source project and generates a comprehensive migration feasibility report

ParameterTypeDescription
projectPath *stringPath to the source project to assess

migration_create_migration_plan

Create detailed migration plan - generates a step-by-step migration plan with task breakdown, dependencies, and estimates

ParameterTypeDescription
projectPath *stringPath to the source project to create a migration plan for

migration_create_ir

Create Migration IR from source project - generates an intermediate representation of the source project for migration processing

ParameterTypeDescription
projectPath *stringPath to the source project
sourcePlatform *stringSource platform (android, ios, flutter, react-native, uni-app, etc.)

migration_map_capability

Map a source API to its HarmonyOS equivalent - looks up the capability mapping database for the best match

ParameterTypeDescription
sourceAPI *stringThe source API to map (e.g., "android.app.Activity", "UIView", "Navigator.push")
sourcePlatform *stringSource platform (android, ios, flutter, react-native, uni-app, etc.)

migration_convert_file

Convert a single source file to HarmonyOS ArkTS/ArkUI - performs syntax, API, and pattern migration on one file

ParameterTypeDescription
sourcePath *stringAbsolute path to the source file to convert
sourcePlatform *stringSource platform (android, ios, flutter, react-native, uni-app, etc.)
targetPath *stringAbsolute path where the converted file should be written

migration_convert_module

Convert an entire module/directory - recursively converts all files in a module from source platform to HarmonyOS

ParameterTypeDescription
sourceModulePath *stringAbsolute path to the source module directory
sourcePlatform *stringSource platform (android, ios, flutter, react-native, uni-app, etc.)
targetModulePath *stringAbsolute path where the converted module should be written

migration_convert_feature

Convert a named feature/feature-set - identifies and migrates all files related to a specific business feature

ParameterTypeDescription
featureName *stringName of the feature to convert (e.g., "login", "payment", "profile")
projectPath *stringPath to the source project root
sourcePlatform *stringSource platform (android, ios, flutter, react-native, uni-app, etc.)

migration_convert_project

Full project conversion - converts an entire source project to a HarmonyOS project in one operation

ParameterTypeDescription
sourcePlatform *stringSource platform (android, ios, flutter, react-native, uni-app, etc.)
sourceProjectPath *stringAbsolute path to the source project root
targetProjectPath *stringAbsolute path where the HarmonyOS project should be created

migration_sync_incremental_changes

Sync incremental changes from source to target - detects and migrates only the files that have changed since a given commit

ParameterTypeDescription
sourceProjectPath *stringAbsolute path to the source project root
targetProjectPath *stringAbsolute path to the target HarmonyOS project root
sinceCommitstringGit commit hash or ref to diff from (default: HEAD~1)

migration_detect_source_changes

Detect recent changes in source repository - scans git commits to find added, modified, and deleted files for cross-platform sync

ParameterTypeDescription
sourceRepoPath *stringAbsolute path to the source repository root
maxCommitsnumberMaximum number of commits to scan
sinceCommitstringGit commit hash or ref to start scanning from (default: HEAD~10)

migration_analyze_sync_impact

Analyze impact of source changes on target HarmonyOS project - checks file/symbol mappings to determine what needs to be synced

ParameterTypeDescription
sourceCommit *stringGit commit hash of the source change
sourceProjectPath *stringAbsolute path to the source project root
targetProjectPath *stringAbsolute path to the target HarmonyOS project root

migration_generate_harmony_patches

Generate HarmonyOS patches from source changes - creates code patches that can be applied to the target project

ParameterTypeDescription
sourceCommit *stringGit commit hash of the source change
sourceProjectPath *stringAbsolute path to the source project root
targetProjectPath *stringAbsolute path to the target HarmonyOS project root

migration_configure_sync

Configure cross-platform sync settings - set up auto-sync, auto-test, auto-PR, watch branches, and ignore patterns

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project root
targetProjectPath *stringPath to the target project (for config storage)
autoPRbooleanAutomatically create PRs after syncing
autoSyncbooleanAutomatically sync changes without manual confirmation
autoTestbooleanAutomatically run tests after syncing
enabledbooleanEnable or disable cross-platform sync
ignorePatternsarrayFile patterns to ignore during sync
watchBranchesarrayGit branches to watch for changes

migration_execute_cross_platform_sync

Execute full cross-platform sync workflow - detect changes, analyze impact, generate patches, and optionally apply, test, and create PRs

ParameterTypeDescription
sourceProjectPath *stringAbsolute path to the source project root
targetProjectPath *stringAbsolute path to the target HarmonyOS project root
autoApplybooleanAutomatically apply generated patches
autoPRbooleanAutomatically create a pull request
autoTestbooleanAutomatically run tests after applying patches
dryRunbooleanDry run mode - analyze but do not apply changes
sinceCommitstringGit commit hash from which to start detecting changes

migration_migrate_resources

Migrate resources from source project to HarmonyOS. Handles images, SVG, fonts, strings, colors, animations, audio, video, JSON, and raw resources. Supports optimization, duplicate detection, unused detection, and snake_case renaming.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project
detectDuplicatesbooleanDetect duplicate resources by name
detectUnusedbooleanDetect unused resources not referenced in code
optimizebooleanEnable image optimization suggestions
renameToSnakebooleanRename resources from camelCase to snake_case

migration_optimize_images

Analyze image files in a project and suggest optimizations. Detects large images (>500KB by default), suggests resize dimensions, format conversion (PNG/JPG→WebP), and estimates compression ratio.

ParameterTypeDescription
projectPath *stringPath to the project to scan for images
thresholdKBnumberSize threshold in KB for optimization suggestions

migration_migrate_database

Migrate databases from source project to HarmonyOS. Detects SQLite, Room, CoreData, Realm, Hive, AsyncStorage, IndexedDB, SharedPreferences, and UserDefaults. Generates schema migration scripts and data compatibility reports.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project

migration_migrate_network

Migrate network layer from source project to HarmonyOS. Detects Retrofit, OkHttp, Alamofire, Axios, Dio, and Fetch. Maps to @ohos.net.http with features: request, interceptor, auth, retry, cache, upload, download, WebSocket.

ParameterTypeDescription
sourcePlatform *stringSource platform (android, ios, flutter, react-native, etc.)
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project

migration_validate_api_contract

Validate API contracts (OpenAPI, Swagger, GraphQL, Proto) and generate HarmonyOS client code. Detects contract files, extracts endpoints/schemas, generates client code and model classes.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
contractPathstringPath to a specific API contract file (optional)

migration_generate_mock_server

Generate a mock server configuration from API contracts or network code. Creates mock endpoints with realistic response data for testing HarmonyOS apps when backend is unavailable.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
outputPathstringOutput path for the mock server config file

migration_migrate_authentication

Migrate authentication methods from source project to HarmonyOS. Detects OAuth, JWT, SSO, Enterprise Login, SMS, Password, and Biometric. Maps to HarmonyOS account APIs and security frameworks.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project

migration_migrate_native_code

Analyze and migrate native code (JNI, NDK, SO, C, C++, Rust, FFI) and binary SDKs (AAR, SO, Framework). Classifies into Reusable, Port Required, Platform-Specific, Binary Only, and Unsupported categories.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project

migration_migrate_webview

Migrate WebView usage from source project to HarmonyOS. Analyzes 9 key features: JS Bridge, Cookie, Login, Deep Link, File Upload, Download, Camera, Location, Payment. Detects common Hybrid App feature gaps.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project

migration_backend_migration_assistant

后端迁移助手。分析迁移对后端服务的影响,输出完整的 Mobile/Backend/Console/Secrets/Deployment 变更清单。同时提供跨仓库协调方案(Android Repo + Harmony Repo + Backend Repo),包括受影响仓库、建议分支和团队协调计划。

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project
sourcePlatformstring源平台类型,默认 android

migration_generate_network_client

Generate HarmonyOS network client code (@ohos.net.http wrapper). Includes interceptors, retry with exponential backoff, in-memory cache with TTL, timeout control, and unified error handling.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
sourcePlatform *stringSource platform (android, ios, flutter, react-native, etc.)

migration_generate_websocket

Generate HarmonyOS WebSocket connection management code. Features: auto-reconnect with exponential backoff, heartbeat keep-alive, offline message queue, connection state machine, event listeners.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

migration_generate_network_monitor

Generate HarmonyOS network state change listener code. Detects WiFi/cellular/ethernet/VPN/offline states, monitors signal strength, identifies 5G/4G/3G/2G cellular types, and checks metered network status.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

migration_generate_kvstore

Generate HarmonyOS distributed KVStore sync code. Features: distributed read/write, batch operations, type-safe access (getString/getNumber/getBoolean/getObject), auto-sync with configurable interval, data change listener, encrypted storage (S2 security level).

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

migration_generate_continuation

Generate HarmonyOS Continuation task migration code. Enables cross-device task handoff: save app state, discover nearby devices, transfer tasks phone↔tablet↔pad, and restore state on target device.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

migration_generate_tap_share

Generate HarmonyOS Tap-to-Share (碰一碰) code. Features: NFC tap sharing, multi-device transfer (phone↔tablet↔PC), multiple content types (TEXT/URL/IMAGE/FILE/CONTACT/APP_LINK), nearby device discovery, share history.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

orchestrator_create_agent_team

创建多 Agent 迁移团队。组建 Planner/Migration/UI/API/Dependency/Build/Test/Performance/Reviewer/Verification 共 10 个专业 Agent,自动分配迁移任务。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

orchestrator_plan_tasks

Planner Agent 任务规划。将项目拆解为独立可执行的迁移任务,按依赖关系排序,预估工作量和风险。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

orchestrator_verify_task

Verification Agent 独立验证。检查迁移任务的完成质量,验证功能完整性,发现遗漏。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
taskId *string任务 ID

orchestrator_review_changes

Reviewer Agent 独立审查。审查迁移代码质量和架构合理性,发现潜在问题。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
taskIdstring任务 ID(可选,不传则审查所有变更)

orchestrator_configure_approval_gates

配置审批门规则。设置 SAFE/WRITE/HIGH_RISK 三级审批策略,控制 Agent 的操作权限。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
customRulesarray自定义审批规则(不传则使用默认规则)
enabledboolean是否启用审批门,默认 true

orchestrator_check_approval

检查操作是否需要审批。根据风险级别判断:SAFE 自动执行、WRITE 需项目授权、HIGH_RISK 必须人工确认。

ParameterTypeDescription
operation *string操作名称
projectPath *stringHarmonyOS 项目路径
riskLevel *string操作风险级别

orchestrator_create_checkpoint

创建 Git 检查点。在大规模修改前创建安全回滚点,失败时可一键回滚。

ParameterTypeDescription
message *string检查点描述信息
projectPath *stringHarmonyOS 项目路径
taskIdstring关联的任务 ID

orchestrator_rollback_to_checkpoint

回滚到指定检查点。恢复项目到变更前的状态,避免不可逆损坏。

ParameterTypeDescription
checkpointId *string检查点 ID
projectPath *stringHarmonyOS 项目路径

orchestrator_list_checkpoints

列出所有检查点。查看项目历史回滚点。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

orchestrator_create_patch

创建独立补丁。每个迁移任务生成独立 Patch,便于审查和按需回滚。

ParameterTypeDescription
additions *number新增行数
deletions *number删除行数
description *string补丁描述
filesChanged *array变更的文件列表
projectPath *stringHarmonyOS 项目路径
taskId *string关联的任务 ID
title *string补丁标题

orchestrator_list_patches

列出所有补丁。按任务 ID 筛选或查看全部。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
taskIdstring任务 ID(可选,不传则列出所有)

orchestrator_review_patch

审查补丁。批准或拒绝变更补丁。

ParameterTypeDescription
approved *boolean是否批准
comments *string审查意见
patchId *string补丁 ID

orchestrator_explain_change

解释变更原因。说明 Agent 为什么做了某个变更,包括源行为、目标能力、变更理由、证据、风险、置信度。

ParameterTypeDescription
patchId *string补丁 ID
taskId *string任务 ID

orchestrator_check_silent_rewrite

静默重写检查。检查 Agent 是否在用户不知情的情况下:删除业务逻辑、改变接口签名、改变数据结构、改变安全逻辑。

ParameterTypeDescription
patchId *string补丁 ID
projectPath *stringHarmonyOS 项目路径

orchestrator_configure_hooks

配置 Plugin 生命周期 Hooks。支持 POST_TOOL_USE、POST_BUILD、PRE_HIGH_RISK、SESSION_START、SESSION_END、FILE_CHANGED 六种触发时机。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
customHooksarray自定义 Hooks(不传则使用默认配置)

orchestrator_trigger_hook

手动触发 Hook。用于测试和调试 Hook 配置。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
trigger *string触发时机
contextobject上下文数据

orchestrator_list_hooks

列出所有配置的 Hooks。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

orchestrator_check_reliability

可靠性检查。验证工具返回格式统一性、空结果保护、错误处理、超时保护、幂等性。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

orchestrator_version_pinning

版本锁定。记录当前 Plugin、引擎、SDK 版本,确保迁移可复现。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

orchestrator_offline_capability

离线能力检查。检查哪些功能支持离线运行(Build/Lint/Migration Rules/Local Docs/Test/Trace)。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

orchestrator_estimate_cost

迁移成本估算。基于文件数量估算 Agent 调用成本(Token 消耗),便于企业设置预算。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
fileCountnumber文件数量,默认 500

orchestrator_check_idempotency

幂等性检查。检查工具的幂等性,避免重复执行导致重复添加依赖、文件、路由、配置。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
toolNamestring工具名称(可选,不传则检查所有)

orchestrator_create_pr

创建 Pull Request。自动生成 PR 描述(包含变更内容、原因、风险、测试、截图),便于人工 Review。

ParameterTypeDescription
description *stringPR 描述
files *array变更文件列表
projectPath *stringHarmonyOS 项目路径
title *stringPR 标题
baseBranchstring目标分支,默认 main

orchestrator_check_pr_gate

PR Gate 检查。自动执行 Build/Lint/Test/Security/Performance/Compatibility 六项检查,失败阻止合并。

ParameterTypeDescription
prId *stringPR ID
projectPath *stringHarmonyOS 项目路径

orchestrator_configure_continuous_sync

配置持续同步。设置 Android → HarmonyOS 自动增量同步,支持定时检测、自动 PR、自动合并。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
sourceRepo *string源仓库地址
targetRepo *string目标仓库地址
enabledboolean是否启用,默认 true

orchestrator_trigger_continuous_sync

触发持续同步。立即执行一次 Android → HarmonyOS 增量同步,检测变更、生成补丁、应用补丁。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

perf_capture_trace

Capture performance trace. Scans for trace files (.trace, .perf, .json) in the project, returns TraceAnalysis with hotspot detection, long task analysis, and jank rate calculation.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
durationMsnumberOptional: trace duration in milliseconds

perf_analyze_trace

Analyze an existing trace file. Takes a trace file path, parses it, and returns detailed TraceAnalysis including frame analysis, function hotspots, and memory leak detection.

ParameterTypeDescription
traceFilePath *stringAbsolute path to the trace file (.trace, .perf, .json)

perf_profile_startup

Profile app startup performance. Returns StartupProfile with cold/warm start times, phase breakdown (processCreate, appInit, abilityCreate, firstFrame, fullyDrawn).

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

perf_profile_memory

Profile memory usage. Returns MemoryProfile with heap analysis, GC statistics, and memory leak suspicions.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

perf_profile_cpu

Profile CPU usage. Returns CPUProfile with average/peak usage, thread analysis, top threads by CPU.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

perf_profile_ui

Profile UI rendering performance. Analyzes FPS, jank, frame timing, layout/draw overhead.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

perf_compare_performance

Compare performance between source and target projects. Returns PerformanceComparison with deltas, improvements, and regressions.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project (Android/iOS/Flutter/RN/etc.)
targetProjectPath *stringPath to the HarmonyOS target project
metricsarrayOptional: specific metrics to compare (startupTime, firstFrameTime, avgFPS, jankRate, memoryUsage, peakMemory, cpuUsage, apkSize, coldStartTime, warmStartTime, gcTime, batteryDrain)

perf_map_trace_to_source

Map trace symbols to source code. Maps performance trace hotspots to exact source files, functions, and line numbers. Integrates git blame to find the commit that introduced the performance issue. Essential for Trace → Source debugging.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
traceFilestringOptional: path to a specific trace file to analyze

perf_create_performance_budget

Create a performance budget with thresholds for key metrics. Defines budgets for cold start, FPS, frame timing, memory, CPU, and APK size. Supports custom budgets and severity levels (BLOCKING/WARNING/INFO).

ParameterTypeDescription
projectName *stringProject name for the budget
customBudgetsarrayOptional custom budget items to add or override defaults

perf_check_performance_budget

Check current performance measurements against defined budgets. Reports pass/fail/warn status for each metric with deviation calculations. If any BLOCKING budget fails, overall status is FAIL.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
budgetIdstringOptional: specific budget ID to check against

perf_detect_performance_regression

Detect performance regression between versions. Compares performance snapshots of two versions, identifies regressed/improved/unchanged metrics, and finds suspect commits using git bisect. Detects cold start, FPS, frame timing, memory, CPU, and APK size regressions.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
baselineVersionstringBaseline version to compare against (e.g., 'v1.2.0')
currentVersionstringCurrent version to check (e.g., 'v1.3.0')

perf_git_bisect_performance

Git bisect for performance regression. Binary searches through git history to find the commit that introduced a performance regression. Requires a test command that returns exit code 0 for good performance and non-zero for bad performance.

ParameterTypeDescription
badCommit *stringCommit hash known to have bad performance
goodCommit *stringCommit hash known to have good performance
projectPath *stringPath to the HarmonyOS project
testCommandstringOptional: custom test command to evaluate performance. Defaults to a built-in performance test.

perf_analyze_crash

Analyze crash logs with symbolication and source mapping. Parses crash logs, symbolicates stack traces against debug symbols, maps to source code locations, and provides root cause analysis with fix suggestions.

ParameterTypeDescription
crashLogContentstringOptional: crash log content as a string
crashLogPathstringOptional: path to a crash log file

perf_analyze_logs

Log intelligence analysis. Analyzes logs from various sources (BUILD/RUNTIME/DEVICE/APP/NETWORK/CRASH/HILOG), detects errors, warnings, performance issues, and provides structured insights with severity classification.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
logContentstringOptional: log content as a string. If not provided, logs will be collected from the project.
logTypestringOptional: type of logs to analyze

perf_diagnose_crash

崩溃日志一键诊断。输入崩溃日志(jscrash/faultlog/hilog),自动识别崩溃类型(JS/C++/Freeze),解析堆栈,定位源代码,输出根因和修复建议。支持 JS 崩溃、C++ 崩溃、ANR 冻屏。

ParameterTypeDescription
logPath *string崩溃日志文件路径
logTypestring日志类型,默认 auto 自动识别

perf_analyze_freeze

应用冻屏分析。输入冻屏日志,分析主线程阻塞原因,定位卡死代码位置。输出冻屏时间线、阻塞线程、卡死代码、修复建议。

ParameterTypeDescription
logPath *stringhilog/faultlog 日志文件路径
bundleNamestring应用包名,用于过滤日志

perf_detect_memory_leak

内存泄漏检测。输入 heap snapshot 或 rawheap 文件,分析内存对象,识别泄漏对象和引用链。支持 JS 堆泄漏和 Native 内存泄漏。

ParameterTypeDescription
heapFilePath *string.heapsnapshot 或 .rawheap 文件路径
leakTypestring泄漏类型,默认 auto

perf_analyze_api_fault

API 故障分析。输入 API 错误码或错误日志,查询知识库,返回错误原因和解决方案。支持常见错误码如 801、B0001 等。

ParameterTypeDescription
errorCode *string错误码,如 '801'、'B0001'
errorMessagestring错误信息
moduleNamestring出错的模块名

perf_optimize_memory_tier

低端机内存分档优化。采集内存数据 → 分析瓶颈 → 生成分档方案 → 生成优化代码 → 验证。提供完整的内存优化闭环。

ParameterTypeDescription
memoryLimit *number内存上限(MB)
projectPath *string项目路径
targetDevice *string目标低端机型号

perf_generate_napi_binding

Generate ArkTS NAPI binding code from C++ header. Creates NapiBridge singleton with type-safe interface, ArrayBuffer data transfer, callback registration, and thread-safe function support. Includes both ArkTS wrapper and C++ napi_init.cpp template.

ParameterTypeDescription
headerFilePath *stringPath to the C++ header file to generate bindings for

perf_generate_cmake

Generate CMakeLists.txt config for HarmonyOS native development. Includes C++17 standard, Release/Debug optimization, security flags, platform detection, EGL/GLES/NAPI/HiLog library linking, and optional third-party integration (OpenCV/TFLite/FFmpeg).

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

perf_ndk_debug_guide

Generate native code debugging guide and performance analysis tips. Covers LLDB debugging, crash analysis (SIGSEGV/SIGABRT/SIGBUS), memory debugging with ASan, CPU profiling, multi-thread debugging, and common pitfalls. Includes tool references and command examples.

ParameterTypeDescription
issueType *stringType of native debugging issue (e.g., crash, memory_leak, performance, thread_deadlock)

project_inspect_project

Deep analysis of project structure, returns ProjectDNA

ParameterTypeDescription
projectPath *stringPath to the project root directory

project_scan_tree

Scan directory tree structure

ParameterTypeDescription
projectPath *stringPath to the project root directory
maxDepthintegerMaximum depth to scan

project_detect_framework

Auto-detect project framework type

ParameterTypeDescription
projectPath *stringPath to the project root directory

project_analyze_architecture

Analyze project architecture patterns

ParameterTypeDescription
projectPath *stringPath to the project root directory

project_extract_business_features

Extract business capabilities

ParameterTypeDescription
projectPath *stringPath to the project root directory

project_build_call_graph

Build static call graph

ParameterTypeDescription
projectPath *stringPath to the project root directory

project_estimate_project_size

Estimate project size (files, lines, modules)

ParameterTypeDescription
projectPath *stringPath to the project root directory

release_check_release_readiness

检查项目是否准备好发布。运行所有发布检查:签名、版本、权限、隐私、包大小、兼容性、商店合规、测试覆盖、安全。返回 ReleaseCheckItem[] 数组。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

release_validate_signing

验证应用签名。检查密钥库、证书有效期、签名算法、调试 vs 发布模式。返回 SigningInfo。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

release_generate_release_report

生成综合发布报告。汇总所有检查结果并生成 ReleaseReport,包含整体发布就绪评估。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

release_generate_changelog

从 Git 历史生成变更日志。分析提交记录生成结构化的发布说明。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径(Git 仓库)
fromRefstring起始 Git 引用(如 tag、branch、commit hash),默认 HEAD~20
toRefstring结束 Git 引用,默认 HEAD

release_check_internationalization

国际化检查。扫描硬编码字符串、Locale 支持、日期/货币格式、RTL 布局、复数规则、文本溢出、编码问题,返回 InternationalizationCheck 结果。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

release_check_accessibility

无障碍检查。扫描 Accessibility Label、对比度、触控区域、屏幕阅读器支持、字体缩放、焦点顺序、键盘导航、语义化,返回 AccessibilityCheck 结果和 WCAG 合规等级。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

release_audit_app_metadata

应用元数据审计。检查应用名称、图标、截图、描述、隐私政策、版本号、内容分级、应用分类、开发者信息等上架元数据的合规性。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

release_generate_signing

生成 HarmonyOS 签名配置。支持三种签名模式:自动签名 (auto_debug,调试)、手动签名 (manual_release,发布)、企业签名 (enterprise,内部分发)。使用 SHA256withECDSA 算法,.p12 密钥库 + .p7b Profile。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径

security_scan_secret

Scan source code for hardcoded secrets including API keys, passwords, tokens, private keys, and certificates. Returns a SecretScanResult with location, pattern, and masked value of each finding.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
excludePatternsarrayGlob patterns to exclude from scanning

security_scan_permission

Audit permissions declared in module.json5 against actual usage in code. Identifies unused permissions, missing declarations, and high-risk permissions. Returns a PermissionAudit with score and recommendations.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

security_scan_security

General security vulnerability scan. Checks for insecure HTTP, cleartext traffic, debug mode, WebView risks, SQL injection, command injection, XSS, and more. Returns SecurityScanResult[] with findings and CWE references.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
categoriesarrayFilter by specific security categories

security_audit_privacy

Audit privacy compliance. Checks for personal data collection (phone, email, location, biometrics, etc.), data encryption, privacy policy references, and user consent mechanisms. Returns privacy audit with overall score.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

security_check_encryption

Verify encryption algorithm usage. Identifies weak algorithms (MD5, DES, RC4, SHA-1, ECB mode), checks for hardcoded keys, static IVs, and weak random generators. Also audits Huks key management. Returns encryption audit with score.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

security_generate_sbom

Generate a Software Bill of Materials (SBOM). Scans dependencies from oh-package.json5 and package.json, includes license information, known vulnerabilities, and supplier details. Supports CycloneDX and SPDX formats.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
formatstringSBOM output format (default: CycloneDX)
includeDevDependenciesbooleanInclude devDependencies (default: true)

security_configure_data_boundary

Configure data boundary rules for local-only mode. Define which types of data can or cannot be sent to cloud services, with enforcement levels (STRICT/WARN/AUDIT).

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
allowCloudarrayData types explicitly allowed to cloud
denyCloudarrayData types explicitly denied to cloud
enforcementLevelstringEnforcement level: STRICT (block), WARN (warn), AUDIT (log only)
localOnlybooleanEnable local-only data boundary mode

security_check_data_boundary

Check whether a specific data type/category can be sent to cloud based on configured data boundary rules.

ParameterTypeDescription
category *stringCategory of the data to check
dataType *stringThe data type to check
projectPath *stringPath to the HarmonyOS project

security_audit_supply_chain

Supply chain security audit: checks package trust, maintenance status, license compliance, known vulnerabilities, and typosquatting risks for all dependencies.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

security_audit_privacy_enhanced

Enhanced privacy compliance audit with AppGallery requirements checklist. Includes user data collection declaration, third-party SDK privacy risk assessment, data retention policies, and actionable fixes.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

security_scan_cve

Scan project dependencies against CVE database for known vulnerabilities. Also performs OWASP Mobile Top 10 security checks. Returns CVE entries with CVSS scores, severity, and fix versions.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

security_audit_encryption

Comprehensive encryption audit covering transport encryption (HTTPS/TLS/WebSocket), storage encryption (files/Preferences/database), and key management (HUKS/hardcoded keys/rotation). Returns score and prioritized recommendations.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

test_generate_test

Generate unit and UI test cases for HarmonyOS project. Auto-detects target files and produces ArkTS test templates with @ohos/hypium and @ohos.UiTest frameworks.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
testType *stringType of tests to generate
includeSetupbooleanWhether to include setup/teardown code
targetFilesarrayOptional: specific files to generate tests for. If empty, auto-discovers source files.

test_run_unit_test

Scan and execute unit tests in HarmonyOS project. Detects test files and runs hypium-based unit tests.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

test_run_ui_test

Execute UI tests in HarmonyOS project. Detects and runs @ohos.UiTest based UI test suites.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

test_run_regression_test

Execute regression tests to verify migration doesn't break existing functionality. Supports baseline comparison.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
baselineResultPathstringOptional: path to previous test result JSON for baseline comparison

test_analyze_test_results

Analyze test run results to identify failure patterns, flaky tests, slow tests, and provide actionable recommendations.

ParameterTypeDescription
testRunResult *objectTest run result object from run_unit_test, run_ui_test, or run_regression_test

test_generate_test_report

Generate a comprehensive test report with coverage estimation, pass rate analysis, and improvement recommendations.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
testRunResult *objectTest run result from run_unit_test, run_ui_test, or run_regression_test

test_compare_test_coverage

Compare test coverage between source project and HarmonyOS target project. Identifies coverage gaps and missing tests.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project (Android/iOS/Flutter/RN/etc.)
targetProjectPath *stringPath to the HarmonyOS target project
sourceTestResultobjectOptional: source project test run result
targetTestResultobjectOptional: target project test run result

test_run_local_test

运行本地测试。在本地环境中执行单元测试和 UI 测试,返回测试结果、覆盖率报告和失败用例详情。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
moduleNamestring可选:指定模块名称,为空则使用项目名

test_run_instrument_test

运行插桩测试。在真机/模拟器上执行插桩测试,支持 ASan 内存检测,返回测试结果、覆盖率和 ASan 报告。

ParameterTypeDescription
projectPath *stringHarmonyOS 项目路径
enableASanboolean是否启用 ASan 内存检测,默认关闭

verify_verify_feature_parity

Compare source project features against HarmonyOS target project to detect missing capabilities. Returns feature parity report with matched/missing/partial statistics.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project (Android/iOS/Flutter/RN/etc.)
targetProjectPath *stringPath to the HarmonyOS target project
sourceFrameworkstringSource framework hint: android, ios, flutter, react-native, uniapp, etc.

verify_compare_call_graphs

Build and compare static call graphs between source and HarmonyOS target projects. Analyzes class/function coverage and call relationships.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project

verify_validate_ui_migration

Validate UI component migration completeness between source and HarmonyOS target projects. Checks screen/component/page coverage.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project
sourceFrameworkstringSource framework hint: android, ios, flutter, react-native, uniapp, etc.

verify_compare_screenshots

Compare screenshots between source and HarmonyOS target builds. Detects visual differences in layout, color, typography, and spacing.

ParameterTypeDescription
sourceScreenshotDir *stringDirectory containing source project screenshots
targetScreenshotDir *stringDirectory containing HarmonyOS target project screenshots

verify_calculate_ui_similarity

Calculate quantitative UI similarity scores between source and HarmonyOS target projects across multiple dimensions (layout, color, typography, spacing, components).

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project
dimensionsarraySpecific dimensions to compare

verify_verify_build_output

Verify HarmonyOS build output integrity. Checks for HAP/HSP/APP artifacts, build directories, and build configuration files.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
buildOutputPathstringOptional: specific build output directory path

verify_check_api_usage

Check API usage in HarmonyOS project for validity, deprecation, and correctness. Detects invalid @ohos imports and deprecated @system APIs.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project

verify_validate_network_behavior

Validate network behavior between source and target projects. Compares HTTP requests, headers, bodies, endpoints, and responses to detect missing headers, wrong parameters, and mismatched URLs.

ParameterTypeDescription
sourceNetworkLog *stringPath to the source project's network log file (JSON array of NetworkRequest)
targetNetworkLog *stringPath to the HarmonyOS target project's network log file (JSON array of NetworkRequest)

verify_validate_state_regression

Validate that state management has not regressed after migration. Checks 12 state categories including auth, cache, cart, favorites, drafts, playback, settings, form data, session, preferences, notifications, and local data.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project root
targetProjectPath *stringPath to the HarmonyOS target project root

visual_compare_screenshot

Compare a single source screenshot against a HarmonyOS target screenshot. Detects visual differences in layout, color, typography, and spacing.

ParameterTypeDescription
sourceScreenshotPath *stringPath to the source project screenshot file
targetScreenshotPath *stringPath to the HarmonyOS target project screenshot file

visual_detect_layout_difference

Detect layout differences between source and HarmonyOS target projects. Scans file structure to estimate layout differences in position, size, margins, padding, alignment, and visibility.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project

visual_validate_design_tokens

Validate design tokens migration between source and HarmonyOS target projects. Detects color, typography, spacing, radius, and shadow tokens from source and compares with target.

ParameterTypeDescription
sourceProjectPath *stringPath to the source project
targetProjectPath *stringPath to the HarmonyOS target project

visual_record_flow

Record user behavior flow with steps (TAP, SWIPE, TYPE, SCROLL, etc.). Creates a BehaviorRecording that can be replayed or compared against target.

ParameterTypeDescription
name *stringName of the behavior recording
platform *stringPlatform identifier (e.g. 'android', 'ios', 'harmonyos')
steps *arrayArray of behavior steps to record

visual_replay_flow

Replay a recorded behavior flow against a HarmonyOS target project. Takes a BehaviorRecording and simulates replay, returning pass/fail results for each step.

ParameterTypeDescription
recording *objectThe behavior recording to replay
targetProjectPath *stringPath to the HarmonyOS target project

visual_compare_flow

Compare two behavior recordings (source vs target). Returns BehaviorComparison with matched/mismatched steps and similarity score.

ParameterTypeDescription
sourceRecording *objectThe source platform behavior recording
targetRecording *objectThe HarmonyOS target platform behavior recording

visual_check_responsive_layout

Check responsive layout across different device sizes. Analyzes layout adaptability, breakpoints, flexible units, and provides recommendations.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
deviceSizesarrayOptional: custom device sizes to check against

visual_screenshot_to_arkui

Analyze a screenshot (Android app, Figma design, or mockup) and generate ArkUI code. Detects UI elements, layouts, colors, and fonts, then generates complete HarmonyOS page code.

ParameterTypeDescription
screenshotPath *stringPath to the screenshot file (PNG, JPG, WebP)
pageNamestringName for the generated page (e.g., 'LoginPage', 'HomePage')

visual_design_to_arkui

Generate complete ArkUI page code from a design analysis result. Supports both screenshot-based and Figma-based designs. Generates @Component struct with proper @State, layouts, styles, and imports.

ParameterTypeDescription
path *stringPath to the design file
type *stringDesign input type
pageNamestringName for the generated page
targetTypestringType of ArkUI component to generate
themestringTheme for the generated page

visual_analyze_adaptive_ui

Deeply analyze ArkTS/ArkUI code for adaptive UI issues. Detects 13 types of responsiveness problems: fixed widths/heights, overflow, landscape anomalies, foldable gaps, overlap, truncation, hardcoded dp, missing breakpoints, missing scroll, missing safe area, unresponsive images, and rigid layouts.

ParameterTypeDescription
projectPath *stringPath to the HarmonyOS project
targetDevicesarrayFilter by target device types
targetOrientationsarrayFilter by target orientations

visual_design_to_arkui_visual

Convert a design specification to ArkUI visual code. Generates complete ArkUI page code with CSS token mapping, layout configuration, and component tree. Includes mock data demonstrating a login page design conversion with proper color tokens, typography, spacing, and shadow mappings.

ParameterTypeDescription
componentList *arrayList of expected UI components in the design
designSpec *stringDesign specification description (e.g. 'login page', 'home page with tabs')