harmony-plugin
v0.2.2HarmonyOS 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
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
build_detect_deveco
Detect DevEco Studio installation
build_run_hvigor
Run Hvigor build
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
task | string | Specific Hvigor task to run |
build_build_module
Build a specific module
| Parameter | Type | Description |
|---|---|---|
moduleName * | string | Name of the module to build |
projectPath * | string | Path to the HarmonyOS project |
build_build_app
Build the full app (HAP)
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
buildMode | string | Build mode (e.g. debug, release) |
build_clean_build
Clean and rebuild
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
build_parse_build_errors
Parse build output into structured errors
| Parameter | Type | Description |
|---|---|---|
buildOutput * | string | Raw build output text to parse |
build_classify_build_error
Classify a build error
| Parameter | Type | Description |
|---|---|---|
errorCode * | string | Error code |
errorMessage * | string | Error message text |
build_search_docs_for_error
Search docs for error resolution
| Parameter | Type | Description |
|---|---|---|
errorCode * | string | Error code to search for |
errorMessage * | string | Error message to search for |
build_generate_fix
Generate fix suggestion for a build error
| Parameter | Type | Description |
|---|---|---|
error * | object | Build error object |
projectPath * | string | Path to the HarmonyOS project |
build_apply_fix
Apply a fix patch to the project
| Parameter | Type | Description |
|---|---|---|
fix * | object | Fix patch object to apply |
projectPath * | string | Path to the HarmonyOS project |
build_build_fix_loop
Run the build-fix loop (BUILD→FAIL→FIX→BUILD until PASS or BLOCKED)
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
maxIterations | integer | Maximum fix iterations |
build_environment_doctor
环境全面检查。检查 DevEco Studio、SDK、JDK、Node.js、Hvigor、设备、PATH、权限、ohpm、Git 共 10 个组件,输出环境健康度评分。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
build_auto_fix_environment
自动修复环境问题。针对可自动修复的环境问题(JDK版本、Hvigor版本、PATH配置、ohpm版本等),执行自动修复命令。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
issueIds | array | 要修复的问题 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
modules | array | Module 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
channels | array | Channel names (default: huawei, xiaomi, oppo, vivo, default) |
doctor_code_doctor
全面代码质量检查。扫描架构、代码质量、Lint、废弃API、API兼容性、依赖、权限、安全、并发、生命周期、内存、资源、性能、无障碍、国际化共15个维度,返回 CodeDoctorResult 包含问题列表、分类统计、自动修复建议。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
categories | array | 要检查的维度列表,不传则检查全部 15 个维度 |
doctor_health_score
项目健康评分。从 Architecture、Correctness、Performance、Security、Compatibility、Maintainability 六个维度评估项目健康度,给出 A-F 评级和改进计划。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
targetSdk | string | Target SDK version (e.g. 'API 12'), defaults to 'API 12' |
doctor_check_arkts_syntax
ArkTS 语法检查器。扫描项目中的 ArkTS 文件,检查语法错误、类型错误、装饰器使用规范、性能警告。支持自动修复(autoFix=true)。检测 ETS1001-ETS1004 等常见错误码。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
autoFix | boolean | Auto-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
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project root directory |
framework | string | Framework hint: android, ios, flutter, react-native |
dep_search_ohpm
Search for packages in OHPM (HarmonyOS OpenHarmony Package Manager) knowledge base
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query - package name, keyword, or equivalent name from other platforms |
category | string | Filter by category (e.g. '网络', '图像', '数据存储', '图表', '安全') |
dep_resolve_dependency
Resolve whether a specific dependency is compatible with HarmonyOS and get migration guidance
| Parameter | Type | Description |
|---|---|---|
dependencyName * | string | Name of the dependency to resolve |
sourcePlatform * | string | Source platform: android, ios, flutter, react-native |
version * | string | Current version of the dependency |
dep_replace_dependency
Find HarmonyOS equivalent replacements for a dependency with confidence scores
| Parameter | Type | Description |
|---|---|---|
dependencyName * | string | Name of the dependency to find replacements for |
sourcePlatform * | string | Source platform: android, ios, flutter, react-native |
dep_audit_license
Audit licenses of project dependencies and flag risky licenses (GPL, AGPL, unknown, etc.)
| Parameter | Type | Description |
|---|---|---|
dependencies | array | List of dependency names to audit (alternative to projectPath) |
projectPath | string | Path to the project root directory (scans build files) |
dep_audit_vulnerability
Check for known vulnerabilities (CVEs) in project dependencies
| Parameter | Type | Description |
|---|---|---|
dependencies | array | List of dependency names to check (alternative to projectPath) |
projectPath | string | Path to the project root directory (scans build files) |
device_list_devices
列出所有已连接/可用的设备和模拟器
device_start_emulator
启动一个 HarmonyOS 模拟器
| Parameter | Type | Description |
|---|---|---|
deviceName | string | 模拟器设备名称,不指定则使用默认模拟器 |
device_stop_emulator
停止一个模拟器
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | 模拟器设备 ID |
device_install_app
在设备上安装 HAP 包
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | 目标设备 ID |
hapPath * | string | HAP 文件路径 |
device_launch_app
在设备上启动应用
| Parameter | Type | Description |
|---|---|---|
bundleName * | string | 应用包名 |
deviceId * | string | 目标设备 ID |
device_stop_app
停止设备上的应用
| Parameter | Type | Description |
|---|---|---|
bundleName * | string | 应用包名 |
deviceId * | string | 目标设备 ID |
device_restart_app
重启设备上的应用
| Parameter | Type | Description |
|---|---|---|
bundleName * | string | 应用包名 |
deviceId * | string | 目标设备 ID |
device_clear_app_data
清除设备上应用的数据
| Parameter | Type | Description |
|---|---|---|
bundleName * | string | 应用包名 |
deviceId * | string | 目标设备 ID |
device_capture_screenshot
截取设备屏幕截图
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | 目标设备 ID |
outputPath | string | 截图保存路径,不指定则使用默认路径 |
device_tap
在设备屏幕上点击指定坐标
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | 目标设备 ID |
x * | number | X 坐标 |
y * | number | Y 坐标 |
device_input_text
在设备上输入文本
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | 目标设备 ID |
text * | string | 要输入的文本 |
device_swipe
在设备屏幕上执行滑动手势
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | 目标设备 ID |
endX * | number | 结束 X 坐标 |
endY * | number | 结束 Y 坐标 |
startX * | number | 起始 X 坐标 |
startY * | number | 起始 Y 坐标 |
duration | number | 滑动持续时间(毫秒),默认 300 |
device_collect_logs
收集设备系统日志
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | 目标设备 ID |
lines | number | 获取的日志行数,默认 200 |
tag | string | 日志标签过滤 |
device_collect_hilog
收集设备 HiLog 输出
| Parameter | Type | Description |
|---|---|---|
deviceId * | string | 目标设备 ID |
level | string | 日志级别过滤(D/I/W/E/F) |
tag | string | HiLog 标签过滤 |
device_get_device_info
获取设备信息(OS 版本、屏幕尺寸等)
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Name 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.).
| Parameter | Type | Description |
|---|---|---|
matrixId * | string | ID of the device matrix to test against |
projectPath * | string | Path to the HarmonyOS project |
testName | string | Optional 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.
| Parameter | Type | Description |
|---|---|---|
dpi * | number | Screen DPI |
height * | number | Screen height in vp |
name * | string | Device name |
orientation * | string | Default orientation |
theme * | string | Theme |
type * | string | Device type |
width * | number | Screen width in vp |
description | string | Device description |
fontScale | number | Font scale factor |
locale | string | Locale 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
targetDevices | array | Optional 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
docs_search_harmony_docs
Search HarmonyOS documentation with query and optional filters
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query for HarmonyOS documentation |
category | string | Filter by API category (e.g., ArkUI, Network, Storage, Media, Router, Permission, Lifecycle, etc.) |
limit | integer | Maximum number of results to return (default: 10) |
sdkVersion | string | Filter 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
| Parameter | Type | Description |
|---|---|---|
apiName * | string | The 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
| Parameter | Type | Description |
|---|---|---|
apiName * | string | The 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
| Parameter | Type | Description |
|---|---|---|
apiName * | string | The name of the HarmonyOS API to check compatibility for |
projectSDKVersion * | string | The 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)
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query for best practices (e.g., 'navigation', 'state management', 'network request', 'permission') |
limit | integer | Maximum number of results to return (default: 10) |
docs_search_knowledge_base
搜索 HarmonyOS 知识库(本地 + 云端双路)。本地返回内置 API 文档和最佳实践,同时提示可调用官方 deveco-mcp 的 harmonyos_knowledge_search 获取最新云端文档
| Parameter | Type | Description |
|---|---|---|
query * | string | 搜索关键词(API名称、组件名、模块名等) |
maxResults | integer | 最大返回结果数(默认10) |
docs_get_official_knowledge_config
获取官方 HarmonyOS 知识库(deveco-mcp 的 harmonyos_knowledge_search)的配置信息和使用说明
docs_search_official_knowledge
直接调用华为云端 HarmonyOS 知识库搜索。支持搜索API参考、开发指南、最佳实践、常见问题和版本变更说明。结果来自华为官方实时文档。
| Parameter | Type | Description |
|---|---|---|
keywords * | array | 搜索关键词列表 |
maxCharSize | integer | 最大返回字符数(默认10000) |
enterprise_manage_roles
Manage team roles and permissions (list, add, remove, update)
| Parameter | Type | Description |
|---|---|---|
action * | string | Action to perform on roles |
permissions | array | List of permissions for the role |
role | string | Role name (e.g. Developer, Reviewer, QA, TechLead, Admin, Security, ReleaseManager) |
userId | string | User ID to assign the role to |
enterprise_query_audit_log
Query audit log entries for a project
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
action | string | Filter by action type |
fromDate | string | Filter from this date (ISO 8601) |
limit | integer | Maximum number of entries to return |
toDate | string | Filter to this date (ISO 8601) |
userId | string | Filter by user ID |
enterprise_manage_rules
Manage enterprise rule packs (list, add, remove, check)
| Parameter | Type | Description |
|---|---|---|
action * | string | Action to perform on rules |
projectPath | string | Path to the HarmonyOS project |
ruleConfig | string | JSON configuration for the rule |
ruleType | string | Type of rule |
enterprise_manage_private_capability_graph
Manage private SDK capability mappings (list, add, remove, search)
| Parameter | Type | Description |
|---|---|---|
action * | string | Action to perform on capability graph |
description | string | Description of the capability mapping |
sourceSDK | string | Source SDK API name |
targetSDK | string | Target HarmonyOS SDK API name |
enterprise_manage_custom_recipes
Manage custom migration recipes (list, add, remove, execute)
| Parameter | Type | Description |
|---|---|---|
action * | string | Action to perform on recipes |
description | string | Description of the recipe |
recipeName | string | Recipe name |
sourceCode | string | Source code pattern for the recipe |
targetCode | string | Target HarmonyOS code for the recipe |
enterprise_record_knowledge
Record migration knowledge from completed projects
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project |
sourceFramework * | string | Source framework name |
targetFramework * | string | Target HarmonyOS framework |
failedMappings | string | JSON array of failed API mappings |
issuesFound | string | JSON array of issues encountered |
notes | string | Additional notes about the migration |
successfulMappings | string | JSON array of successful API mappings |
enterprise_get_knowledge
Retrieve accumulated migration knowledge
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum number of entries to return |
query | string | Search query for matching knowledge entries |
sourceFramework | string | Filter by source framework |
targetFramework | string | Filter by target framework |
kit_search_kit_api
在 25 个 HarmonyOS SDK Kit 中搜索 API。返回导入路径、函数签名、参数列表、返回值、错误码、权限要求、代码示例。支持按 Kit 名称和功能分类过滤。
| Parameter | Type | Description |
|---|---|---|
query * | string | 搜索关键词(API 名称、Kit 名称、功能描述) |
category | string | 功能分类,如 '应用服务'、'网络通信'、'安全认证' |
kitName | string | 限定 Kit 名称,如 'Push Kit'、'Network Kit' |
kit_generate_kit_code
根据需求描述,生成完整的 Kit 调用代码(导入、初始化、调用、错误处理)。支持 Push Kit、Account Kit、Network Kit、Location Kit、Scan Kit、Share Kit、IAP Kit 等。
| Parameter | Type | Description |
|---|---|---|
kitName * | string | Kit 名称,如 'Push Kit'、'Account Kit'、'Network Kit' |
scenario * | string | 使用场景描述,如 '获取推送 Token 并显示消息列表' |
targetSdk | string | 目标 SDK 版本,默认 API 12 |
kit_check_kit_permissions
检查指定 Kit 需要的权限,返回权限列表、权限级别、module.json5 配置示例、声明指南。
| Parameter | Type | Description |
|---|---|---|
kitName * | string | Kit 名称,如 'Push Kit'、'Location Kit'、'Scan Kit'、'Network Kit' |
feature | string | 具体功能,如 '推送通知'、'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
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the source project |
sourcePlatform * | string | Source 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
| Parameter | Type | Description |
|---|---|---|
sourceAPI * | string | The source API to map (e.g., "android.app.Activity", "UIView", "Navigator.push") |
sourcePlatform * | string | Source 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
| Parameter | Type | Description |
|---|---|---|
sourcePath * | string | Absolute path to the source file to convert |
sourcePlatform * | string | Source platform (android, ios, flutter, react-native, uni-app, etc.) |
targetPath * | string | Absolute 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
| Parameter | Type | Description |
|---|---|---|
sourceModulePath * | string | Absolute path to the source module directory |
sourcePlatform * | string | Source platform (android, ios, flutter, react-native, uni-app, etc.) |
targetModulePath * | string | Absolute 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
| Parameter | Type | Description |
|---|---|---|
featureName * | string | Name of the feature to convert (e.g., "login", "payment", "profile") |
projectPath * | string | Path to the source project root |
sourcePlatform * | string | Source 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
| Parameter | Type | Description |
|---|---|---|
sourcePlatform * | string | Source platform (android, ios, flutter, react-native, uni-app, etc.) |
sourceProjectPath * | string | Absolute path to the source project root |
targetProjectPath * | string | Absolute 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
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Absolute path to the source project root |
targetProjectPath * | string | Absolute path to the target HarmonyOS project root |
sinceCommit | string | Git 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
| Parameter | Type | Description |
|---|---|---|
sourceRepoPath * | string | Absolute path to the source repository root |
maxCommits | number | Maximum number of commits to scan |
sinceCommit | string | Git 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
| Parameter | Type | Description |
|---|---|---|
sourceCommit * | string | Git commit hash of the source change |
sourceProjectPath * | string | Absolute path to the source project root |
targetProjectPath * | string | Absolute 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
| Parameter | Type | Description |
|---|---|---|
sourceCommit * | string | Git commit hash of the source change |
sourceProjectPath * | string | Absolute path to the source project root |
targetProjectPath * | string | Absolute 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
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project root |
targetProjectPath * | string | Path to the target project (for config storage) |
autoPR | boolean | Automatically create PRs after syncing |
autoSync | boolean | Automatically sync changes without manual confirmation |
autoTest | boolean | Automatically run tests after syncing |
enabled | boolean | Enable or disable cross-platform sync |
ignorePatterns | array | File patterns to ignore during sync |
watchBranches | array | Git 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
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Absolute path to the source project root |
targetProjectPath * | string | Absolute path to the target HarmonyOS project root |
autoApply | boolean | Automatically apply generated patches |
autoPR | boolean | Automatically create a pull request |
autoTest | boolean | Automatically run tests after applying patches |
dryRun | boolean | Dry run mode - analyze but do not apply changes |
sinceCommit | string | Git 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path to the HarmonyOS target project |
detectDuplicates | boolean | Detect duplicate resources by name |
detectUnused | boolean | Detect unused resources not referenced in code |
optimize | boolean | Enable image optimization suggestions |
renameToSnake | boolean | Rename 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project to scan for images |
thresholdKB | number | Size 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourcePlatform * | string | Source platform (android, ios, flutter, react-native, etc.) |
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
contractPath | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
outputPath | string | Output 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path to the HarmonyOS target project |
migration_migrate_deeplink_push
Migrate deep links and push notifications from source project to HarmonyOS. Handles URL Scheme, Universal Link, App Link, Push Link, Share Link. Migrates FCM/APNs to HarmonyOS Push Kit with token, topic, payload, foreground/background, and server integration.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path to the HarmonyOS target project |
migration_backend_migration_assistant
后端迁移助手。分析迁移对后端服务的影响,输出完整的 Mobile/Backend/Console/Secrets/Deployment 变更清单。同时提供跨仓库协调方案(Android Repo + Harmony Repo + Backend Repo),包括受影响仓库、建议分支和团队协调计划。
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path to the HarmonyOS target project |
sourcePlatform | string | 源平台类型,默认 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
sourcePlatform * | string | Source 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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).
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
orchestrator_create_agent_team
创建多 Agent 迁移团队。组建 Planner/Migration/UI/API/Dependency/Build/Test/Performance/Reviewer/Verification 共 10 个专业 Agent,自动分配迁移任务。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_plan_tasks
Planner Agent 任务规划。将项目拆解为独立可执行的迁移任务,按依赖关系排序,预估工作量和风险。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_verify_task
Verification Agent 独立验证。检查迁移任务的完成质量,验证功能完整性,发现遗漏。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
taskId * | string | 任务 ID |
orchestrator_review_changes
Reviewer Agent 独立审查。审查迁移代码质量和架构合理性,发现潜在问题。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
taskId | string | 任务 ID(可选,不传则审查所有变更) |
orchestrator_configure_approval_gates
配置审批门规则。设置 SAFE/WRITE/HIGH_RISK 三级审批策略,控制 Agent 的操作权限。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
customRules | array | 自定义审批规则(不传则使用默认规则) |
enabled | boolean | 是否启用审批门,默认 true |
orchestrator_check_approval
检查操作是否需要审批。根据风险级别判断:SAFE 自动执行、WRITE 需项目授权、HIGH_RISK 必须人工确认。
| Parameter | Type | Description |
|---|---|---|
operation * | string | 操作名称 |
projectPath * | string | HarmonyOS 项目路径 |
riskLevel * | string | 操作风险级别 |
orchestrator_create_checkpoint
创建 Git 检查点。在大规模修改前创建安全回滚点,失败时可一键回滚。
| Parameter | Type | Description |
|---|---|---|
message * | string | 检查点描述信息 |
projectPath * | string | HarmonyOS 项目路径 |
taskId | string | 关联的任务 ID |
orchestrator_rollback_to_checkpoint
回滚到指定检查点。恢复项目到变更前的状态,避免不可逆损坏。
| Parameter | Type | Description |
|---|---|---|
checkpointId * | string | 检查点 ID |
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_list_checkpoints
列出所有检查点。查看项目历史回滚点。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_create_patch
创建独立补丁。每个迁移任务生成独立 Patch,便于审查和按需回滚。
| Parameter | Type | Description |
|---|---|---|
additions * | number | 新增行数 |
deletions * | number | 删除行数 |
description * | string | 补丁描述 |
filesChanged * | array | 变更的文件列表 |
projectPath * | string | HarmonyOS 项目路径 |
taskId * | string | 关联的任务 ID |
title * | string | 补丁标题 |
orchestrator_list_patches
列出所有补丁。按任务 ID 筛选或查看全部。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
taskId | string | 任务 ID(可选,不传则列出所有) |
orchestrator_review_patch
审查补丁。批准或拒绝变更补丁。
| Parameter | Type | Description |
|---|---|---|
approved * | boolean | 是否批准 |
comments * | string | 审查意见 |
patchId * | string | 补丁 ID |
orchestrator_explain_change
解释变更原因。说明 Agent 为什么做了某个变更,包括源行为、目标能力、变更理由、证据、风险、置信度。
| Parameter | Type | Description |
|---|---|---|
patchId * | string | 补丁 ID |
taskId * | string | 任务 ID |
orchestrator_check_silent_rewrite
静默重写检查。检查 Agent 是否在用户不知情的情况下:删除业务逻辑、改变接口签名、改变数据结构、改变安全逻辑。
| Parameter | Type | Description |
|---|---|---|
patchId * | string | 补丁 ID |
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_configure_hooks
配置 Plugin 生命周期 Hooks。支持 POST_TOOL_USE、POST_BUILD、PRE_HIGH_RISK、SESSION_START、SESSION_END、FILE_CHANGED 六种触发时机。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
customHooks | array | 自定义 Hooks(不传则使用默认配置) |
orchestrator_trigger_hook
手动触发 Hook。用于测试和调试 Hook 配置。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
trigger * | string | 触发时机 |
context | object | 上下文数据 |
orchestrator_list_hooks
列出所有配置的 Hooks。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_check_reliability
可靠性检查。验证工具返回格式统一性、空结果保护、错误处理、超时保护、幂等性。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_version_pinning
版本锁定。记录当前 Plugin、引擎、SDK 版本,确保迁移可复现。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_offline_capability
离线能力检查。检查哪些功能支持离线运行(Build/Lint/Migration Rules/Local Docs/Test/Trace)。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_estimate_cost
迁移成本估算。基于文件数量估算 Agent 调用成本(Token 消耗),便于企业设置预算。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
fileCount | number | 文件数量,默认 500 |
orchestrator_check_idempotency
幂等性检查。检查工具的幂等性,避免重复执行导致重复添加依赖、文件、路由、配置。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
toolName | string | 工具名称(可选,不传则检查所有) |
orchestrator_create_pr
创建 Pull Request。自动生成 PR 描述(包含变更内容、原因、风险、测试、截图),便于人工 Review。
| Parameter | Type | Description |
|---|---|---|
description * | string | PR 描述 |
files * | array | 变更文件列表 |
projectPath * | string | HarmonyOS 项目路径 |
title * | string | PR 标题 |
baseBranch | string | 目标分支,默认 main |
orchestrator_check_pr_gate
PR Gate 检查。自动执行 Build/Lint/Test/Security/Performance/Compatibility 六项检查,失败阻止合并。
| Parameter | Type | Description |
|---|---|---|
prId * | string | PR ID |
projectPath * | string | HarmonyOS 项目路径 |
orchestrator_configure_continuous_sync
配置持续同步。设置 Android → HarmonyOS 自动增量同步,支持定时检测、自动 PR、自动合并。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
sourceRepo * | string | 源仓库地址 |
targetRepo * | string | 目标仓库地址 |
enabled | boolean | 是否启用,默认 true |
orchestrator_trigger_continuous_sync
触发持续同步。立即执行一次 Android → HarmonyOS 增量同步,检测变更、生成补丁、应用补丁。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
durationMs | number | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
traceFilePath * | string | Absolute 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).
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
perf_profile_memory
Profile memory usage. Returns MemoryProfile with heap analysis, GC statistics, and memory leak suspicions.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
perf_profile_cpu
Profile CPU usage. Returns CPUProfile with average/peak usage, thread analysis, top threads by CPU.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
perf_profile_ui
Profile UI rendering performance. Analyzes FPS, jank, frame timing, layout/draw overhead.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
perf_compare_performance
Compare performance between source and target projects. Returns PerformanceComparison with deltas, improvements, and regressions.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project (Android/iOS/Flutter/RN/etc.) |
targetProjectPath * | string | Path to the HarmonyOS target project |
metrics | array | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
traceFile | string | Optional: 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).
| Parameter | Type | Description |
|---|---|---|
projectName * | string | Project name for the budget |
customBudgets | array | Optional 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
budgetId | string | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
baselineVersion | string | Baseline version to compare against (e.g., 'v1.2.0') |
currentVersion | string | Current 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.
| Parameter | Type | Description |
|---|---|---|
badCommit * | string | Commit hash known to have bad performance |
goodCommit * | string | Commit hash known to have good performance |
projectPath * | string | Path to the HarmonyOS project |
testCommand | string | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
crashLogContent | string | Optional: crash log content as a string |
crashLogPath | string | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
logContent | string | Optional: log content as a string. If not provided, logs will be collected from the project. |
logType | string | Optional: type of logs to analyze |
perf_diagnose_crash
崩溃日志一键诊断。输入崩溃日志(jscrash/faultlog/hilog),自动识别崩溃类型(JS/C++/Freeze),解析堆栈,定位源代码,输出根因和修复建议。支持 JS 崩溃、C++ 崩溃、ANR 冻屏。
| Parameter | Type | Description |
|---|---|---|
logPath * | string | 崩溃日志文件路径 |
logType | string | 日志类型,默认 auto 自动识别 |
perf_analyze_freeze
应用冻屏分析。输入冻屏日志,分析主线程阻塞原因,定位卡死代码位置。输出冻屏时间线、阻塞线程、卡死代码、修复建议。
| Parameter | Type | Description |
|---|---|---|
logPath * | string | hilog/faultlog 日志文件路径 |
bundleName | string | 应用包名,用于过滤日志 |
perf_detect_memory_leak
内存泄漏检测。输入 heap snapshot 或 rawheap 文件,分析内存对象,识别泄漏对象和引用链。支持 JS 堆泄漏和 Native 内存泄漏。
| Parameter | Type | Description |
|---|---|---|
heapFilePath * | string | .heapsnapshot 或 .rawheap 文件路径 |
leakType | string | 泄漏类型,默认 auto |
perf_analyze_api_fault
API 故障分析。输入 API 错误码或错误日志,查询知识库,返回错误原因和解决方案。支持常见错误码如 801、B0001 等。
| Parameter | Type | Description |
|---|---|---|
errorCode * | string | 错误码,如 '801'、'B0001' |
errorMessage | string | 错误信息 |
moduleName | string | 出错的模块名 |
perf_optimize_memory_tier
低端机内存分档优化。采集内存数据 → 分析瓶颈 → 生成分档方案 → 生成优化代码 → 验证。提供完整的内存优化闭环。
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
headerFilePath * | string | Path 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).
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
issueType * | string | Type of native debugging issue (e.g., crash, memory_leak, performance, thread_deadlock) |
project_inspect_project
Deep analysis of project structure, returns ProjectDNA
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project root directory |
project_scan_tree
Scan directory tree structure
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project root directory |
maxDepth | integer | Maximum depth to scan |
project_detect_framework
Auto-detect project framework type
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project root directory |
project_analyze_architecture
Analyze project architecture patterns
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project root directory |
project_extract_business_features
Extract business capabilities
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project root directory |
project_build_call_graph
Build static call graph
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project root directory |
project_estimate_project_size
Estimate project size (files, lines, modules)
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the project root directory |
release_check_release_readiness
检查项目是否准备好发布。运行所有发布检查:签名、版本、权限、隐私、包大小、兼容性、商店合规、测试覆盖、安全。返回 ReleaseCheckItem[] 数组。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
release_validate_signing
验证应用签名。检查密钥库、证书有效期、签名算法、调试 vs 发布模式。返回 SigningInfo。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
release_check_app_gallery_requirements
检查 AppGallery Connect 上架要求。验证华为应用市场发布要求:应用大小限制、权限声明、隐私政策、内容分级、截图、描述。返回 AppGalleryRequirement[] 数组。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
release_generate_release_report
生成综合发布报告。汇总所有检查结果并生成 ReleaseReport,包含整体发布就绪评估。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
release_generate_changelog
从 Git 历史生成变更日志。分析提交记录生成结构化的发布说明。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径(Git 仓库) |
fromRef | string | 起始 Git 引用(如 tag、branch、commit hash),默认 HEAD~20 |
toRef | string | 结束 Git 引用,默认 HEAD |
release_check_internationalization
国际化检查。扫描硬编码字符串、Locale 支持、日期/货币格式、RTL 布局、复数规则、文本溢出、编码问题,返回 InternationalizationCheck 结果。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
release_check_accessibility
无障碍检查。扫描 Accessibility Label、对比度、触控区域、屏幕阅读器支持、字体缩放、焦点顺序、键盘导航、语义化,返回 AccessibilityCheck 结果和 WCAG 合规等级。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
release_audit_app_metadata
应用元数据审计。检查应用名称、图标、截图、描述、隐私政策、版本号、内容分级、应用分类、开发者信息等上架元数据的合规性。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
release_generate_signing
生成 HarmonyOS 签名配置。支持三种签名模式:自动签名 (auto_debug,调试)、手动签名 (manual_release,发布)、企业签名 (enterprise,内部分发)。使用 SHA256withECDSA 算法,.p12 密钥库 + .p7b Profile。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
excludePatterns | array | Glob 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
categories | array | Filter 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
format | string | SBOM output format (default: CycloneDX) |
includeDevDependencies | boolean | Include 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).
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
allowCloud | array | Data types explicitly allowed to cloud |
denyCloud | array | Data types explicitly denied to cloud |
enforcementLevel | string | Enforcement level: STRICT (block), WARN (warn), AUDIT (log only) |
localOnly | boolean | Enable 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.
| Parameter | Type | Description |
|---|---|---|
category * | string | Category of the data to check |
dataType * | string | The data type to check |
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
testType * | string | Type of tests to generate |
includeSetup | boolean | Whether to include setup/teardown code |
targetFiles | array | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
test_run_ui_test
Execute UI tests in HarmonyOS project. Detects and runs @ohos.UiTest based UI test suites.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
test_run_regression_test
Execute regression tests to verify migration doesn't break existing functionality. Supports baseline comparison.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
baselineResultPath | string | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
testRunResult * | object | Test 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
testRunResult * | object | Test 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project (Android/iOS/Flutter/RN/etc.) |
targetProjectPath * | string | Path to the HarmonyOS target project |
sourceTestResult | object | Optional: source project test run result |
targetTestResult | object | Optional: target project test run result |
test_run_local_test
运行本地测试。在本地环境中执行单元测试和 UI 测试,返回测试结果、覆盖率报告和失败用例详情。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
moduleName | string | 可选:指定模块名称,为空则使用项目名 |
test_run_instrument_test
运行插桩测试。在真机/模拟器上执行插桩测试,支持 ASan 内存检测,返回测试结果、覆盖率和 ASan 报告。
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | HarmonyOS 项目路径 |
enableASan | boolean | 是否启用 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project (Android/iOS/Flutter/RN/etc.) |
targetProjectPath * | string | Path to the HarmonyOS target project |
sourceFramework | string | Source 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path to the HarmonyOS target project |
sourceFramework | string | Source 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.
| Parameter | Type | Description |
|---|---|---|
sourceScreenshotDir * | string | Directory containing source project screenshots |
targetScreenshotDir * | string | Directory 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).
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path to the HarmonyOS target project |
dimensions | array | Specific dimensions to compare |
verify_verify_build_output
Verify HarmonyOS build output integrity. Checks for HAP/HSP/APP artifacts, build directories, and build configuration files.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
buildOutputPath | string | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceNetworkLog * | string | Path to the source project's network log file (JSON array of NetworkRequest) |
targetNetworkLog * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project root |
targetProjectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceScreenshotPath * | string | Path to the source project screenshot file |
targetScreenshotPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
sourceProjectPath * | string | Path to the source project |
targetProjectPath * | string | Path 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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Name of the behavior recording |
platform * | string | Platform identifier (e.g. 'android', 'ios', 'harmonyos') |
steps * | array | Array 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.
| Parameter | Type | Description |
|---|---|---|
recording * | object | The behavior recording to replay |
targetProjectPath * | string | Path to the HarmonyOS target project |
visual_compare_flow
Compare two behavior recordings (source vs target). Returns BehaviorComparison with matched/mismatched steps and similarity score.
| Parameter | Type | Description |
|---|---|---|
sourceRecording * | object | The source platform behavior recording |
targetRecording * | object | The 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
deviceSizes | array | Optional: 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.
| Parameter | Type | Description |
|---|---|---|
screenshotPath * | string | Path to the screenshot file (PNG, JPG, WebP) |
pageName | string | Name 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to the design file |
type * | string | Design input type |
pageName | string | Name for the generated page |
targetType | string | Type of ArkUI component to generate |
theme | string | Theme 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.
| Parameter | Type | Description |
|---|---|---|
projectPath * | string | Path to the HarmonyOS project |
targetDevices | array | Filter by target device types |
targetOrientations | array | Filter 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.
| Parameter | Type | Description |
|---|---|---|
componentList * | array | List of expected UI components in the design |
designSpec * | string | Design specification description (e.g. 'login page', 'home page with tabs') |