@buaa_smat/hometrans 26.0.2 → 26.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/agents/code-reviewer.md +111 -154
- package/dist/cli/index.js +4 -1
- package/dist/cli/init.js +131 -26
- package/dist/cli/uninstall.js +5 -5
- package/dist/platform/language.js +77 -0
- package/env-requirements.json +30 -5
- package/i18n/FILE-NAMES.md +9 -0
- package/i18n/agents/code-reviewer.md +436 -0
- package/i18n/agents/model-render-worker.md +38 -0
- package/i18n/agents/specgen-worker.md +18 -0
- package/i18n/commands/hometrans.md +17 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +206 -0
- package/i18n/skills/a2h-app-migrate/references/config.example.json +28 -0
- package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +19 -0
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +50 -0
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +2007 -0
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +187 -0
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1656 -0
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +728 -0
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +541 -0
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +143 -0
- package/i18n/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
- package/i18n/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/i18n/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
- package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +713 -0
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +117 -0
- package/i18n/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/i18n/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +271 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +222 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +136 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +552 -0
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +263 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +165 -0
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/i18n/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/i18n/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +207 -0
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/i18n/skills/a2h-arch-generate/SKILL.md +378 -0
- package/i18n/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
- package/i18n/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
- package/i18n/skills/a2h-arch-generate/references/arkts-mvvm-v2.md +1407 -0
- package/i18n/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
- package/i18n/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
- package/i18n/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
- package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
- package/i18n/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
- package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
- package/i18n/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
- package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +131 -0
- package/i18n/skills/a2h-arch-generate/references/source-baseline.md +93 -0
- package/i18n/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +360 -0
- package/i18n/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +798 -0
- package/i18n/skills/a2h-arch-generate/scripts/lib/contract_terms.mjs +40 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/generate.mjs +639 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1261 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
- package/i18n/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +851 -0
- package/i18n/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +982 -0
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +10 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +249 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +344 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/design/move_spec_technical_reference.mjs +162 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +298 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +877 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/test_check_units.ts +149 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +597 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +372 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +35 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/build.md +13 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +17 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +27 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +85 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +23 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +89 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/state-v1.md +29 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +14 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +62 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +30 -0
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +930 -0
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +420 -0
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +158 -0
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2552 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +560 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +175 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +251 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +28 -0
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +232 -0
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +206 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +232 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +2005 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +2118 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/detect_paradigm.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1805 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/gen_rule_docs.mjs +100 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1959 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/image_probe.mjs +405 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1632 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1300 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1234 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +417 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/cli.ts +134 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +18 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +216 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +615 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +125 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +49 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/block_comment_break.ts +64 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +134 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_call_sites.ts +242 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +136 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/canvas.ts +255 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/column_shrink.ts +154 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +39 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/container_align.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_root_builtin.ts +69 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_route.ts +114 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/fixed_size_safe_area.ts +103 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/format_string.ts +157 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +780 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +408 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/offset_in_scroll.ts +163 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/orphan_component.ts +119 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +179 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/page_reachability.ts +94 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/path_commands_vp.ts +50 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +81 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +137 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/r_template_string.ts +37 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/request_permission.ts +98 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/resource_as_string.ts +68 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +147 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +127 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sdk_api.ts +195 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shared_chrome.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_blur.ts +95 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shell_content.ts +198 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/stack_occluding.ts +118 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_decorators.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_name_shadows.ts +93 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/string_quote_leak.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/surface_stroke.ts +50 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +184 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/track_getter.ts +132 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +67 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +651 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +693 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +326 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +356 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +395 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +470 -0
- package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +62 -0
- package/i18n/skills/a2h-dashboard-render/SKILL.md +73 -0
- package/i18n/skills/a2h-dashboard-render/references/artifact-contract.jsonc +117 -0
- package/i18n/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
- package/i18n/skills/a2h-dashboard-render/references/dashboard-guide.md +91 -0
- package/i18n/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
- package/i18n/skills/a2h-dashboard-render/scripts/dashboard.mjs +3245 -0
- package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +2050 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/i18n/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +154 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/i18n/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/i18n/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
- package/i18n/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/i18n/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- package/i18n/skills/a2h-fix-build-errors/SKILL.md +304 -0
- package/i18n/skills/a2h-fix-build-errors/references/arkts-strict-patterns.md +219 -0
- package/i18n/skills/a2h-fix-build-errors/references/rdb-entity-pattern.md +131 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +265 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/i18n/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/i18n/skills/a2h-page-specgen/SKILL.md +239 -0
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +179 -0
- package/i18n/skills/a2h-page-specgen/references/gates.md +329 -0
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +220 -0
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +210 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +1613 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +1650 -0
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +864 -0
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +346 -0
- package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +155 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +684 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +252 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +864 -0
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +276 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +897 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +205 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1205 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +271 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +8 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +7 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +8 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +1029 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +143 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +1121 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +188 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +549 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +368 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +348 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +250 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +776 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1103 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +240 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +427 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +418 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1782 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +536 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +1239 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1801 -0
- package/i18n/skills/a2h-resource-convert/SKILL.md +375 -0
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +336 -0
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +272 -0
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +226 -0
- package/i18n/skills/a2h-resource-convert/references/resource-mapping-rules.md +493 -0
- package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +251 -0
- package/i18n/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +2596 -0
- package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +238 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +358 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +266 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +55 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +752 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +661 -0
- package/i18n/skills/a2h-spec-generate/SKILL.md +375 -0
- package/i18n/skills/a2h-spec-generate/references/batch-mode.md +215 -0
- package/i18n/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
- package/i18n/skills/a2h-spec-generate/references/fusion-task-contract.md +184 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +27 -0
- package/i18n/skills/a2h-spec-generate/references/library-evidence.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/method-discipline.md +64 -0
- package/i18n/skills/a2h-spec-generate/references/optional-gates.json +45 -0
- package/i18n/skills/a2h-spec-generate/references/recall-guide.md +84 -0
- package/i18n/skills/a2h-spec-generate/references/recall-terse.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
- package/i18n/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
- package/i18n/skills/a2h-spec-generate/references/review-checklist.md +22 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
- package/i18n/skills/a2h-spec-generate/references/spec-samples.md +65 -0
- package/i18n/skills/a2h-spec-generate/references/specs.schema.json +85 -0
- package/i18n/skills/a2h-spec-generate/references/synthesis-rules.md +145 -0
- package/i18n/skills/a2h-spec-generate/references/transfer-file.md +5 -0
- package/i18n/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
- package/i18n/skills/a2h-spec-generate/references/worker-rules.md +129 -0
- package/i18n/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +702 -0
- package/i18n/skills/a2h-spec-generate/scripts/check_spec.ts +515 -0
- package/i18n/skills/a2h-spec-generate/scripts/collect-specs.mjs +727 -0
- package/i18n/skills/a2h-spec-generate/scripts/feature-stem.mjs +151 -0
- package/i18n/skills/a2h-spec-generate/scripts/parse_requirements.ts +515 -0
- package/i18n/skills/a2h-spec-generate/scripts/prepare-facts.mjs +313 -0
- package/i18n/skills/a2h-spec-generate/scripts/publish-specs.mjs +354 -0
- package/i18n/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +669 -0
- package/i18n/skills/a2h-spec-generate/scripts/render-tasks.mjs +385 -0
- package/i18n/skills/a2h-spec-generate/scripts/report.mjs +136 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1265 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1057 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +565 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +544 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +317 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +707 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +436 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +608 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +650 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +178 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +912 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +279 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +163 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +256 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +576 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +340 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1857 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +262 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +722 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/i18n/skills/a2h-spec-generate/template/REQ.txt +22 -0
- package/i18n/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
- package/i18n/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +847 -0
- package/i18n/skills/a2h-spec-generate/test/check-spec.test.ts +415 -0
- package/i18n/skills/a2h-spec-generate/test/collect-specs.test.mjs +808 -0
- package/i18n/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/i18n/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/i18n/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
- package/i18n/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
- package/i18n/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
- package/i18n/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
- package/i18n/skills/a2h-spec-generate/test/report.test.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/SKILL.md +126 -0
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +282 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +908 -0
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +446 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hint_check.mjs +147 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hint_source.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_b.mjs +550 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +647 -0
- package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +614 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +214 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1562 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +2714 -0
- package/i18n/skills/a2h-utg-static/SKILL.md +372 -0
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
- package/i18n/skills/a2h-utg-static/references/view-interactions.md +215 -0
- package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +2190 -0
- package/i18n/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +720 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +250 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +374 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
- package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/i18n/skills/a2h-utg-static/scripts/fragment_nav.mjs +1137 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +705 -0
- package/i18n/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +958 -0
- package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +545 -0
- package/i18n/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
- package/i18n/skills/a2h-utg-static/scripts/static_prior.mjs +956 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +125 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +289 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_fresh_branch_guard.mjs +49 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +136 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +457 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +368 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +78 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_off_path.mjs +67 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +61 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_data_table.mjs +340 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_relative_url.mjs +125 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +330 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +340 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1394 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
- package/package.json +11 -161
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/skills/a2h-app-migrate/SKILL.md +31 -12
- package/skills/a2h-app-migrate/references/config.example.json +1 -0
- package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +427 -103
- package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -6
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
- package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +178 -44
- package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +81 -11
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +80 -10
- package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +72 -12
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +137 -41
- package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
- package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
- package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +2 -0
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +38 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +143 -0
- package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +63 -0
- package/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
- package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/skills/a2h-app-migrate/test/test_devecocli_docs_preflight.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +102 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +713 -0
- package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +117 -0
- package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +68 -0
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +51 -0
- package/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
- package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
- package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +101 -0
- package/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +150 -0
- package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +86 -0
- package/skills/a2h-app-migrate/test/test_parse_args.mjs +69 -0
- package/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +271 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +222 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +136 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +552 -0
- package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_acceptance.mjs +94 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +155 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +263 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +165 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +511 -0
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +65 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +83 -0
- package/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
- package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +41 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +214 -0
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/skills/a2h-arch-generate/SKILL.md +20 -17
- package/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
- package/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +2 -2
- package/skills/a2h-arch-generate/references/source-baseline.md +4 -4
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
- package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +35 -46
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +33 -40
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +2 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +11 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +12 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +17 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +14 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +10 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +6 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +16 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1260 -0
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +208 -0
- package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +52 -0
- package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +34 -0
- package/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +164 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +2 -5
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +163 -15
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +3 -1
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +120 -1
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +46 -11
- package/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +22 -25
- package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +873 -0
- package/skills/a2h-arkts-logic-coder/test/golden/inspect_happy.json +20 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
- package/skills/a2h-arkts-logic-coder/test/golden/resolve_cases.json +36 -0
- package/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
- package/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
- package/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
- package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +596 -0
- package/skills/a2h-batch-ui-align/SKILL.md +78 -26
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +6 -1
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +9 -3
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +27 -3
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/skills/a2h-batch-ui-align/references/checker-rules.md +301 -13
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +53 -13
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +14 -9
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +2 -2
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +7 -2
- package/skills/a2h-batch-ui-align/references/step5-convert.md +33 -9
- package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +6 -7
- package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +463 -22
- package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
- package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
- package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
- package/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +263 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +20 -3
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +4 -5
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +220 -35
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +517 -41
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +231 -54
- package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +239 -14
- package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +98 -11
- package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +118 -4
- package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
- package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +1 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +61 -12
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +32 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +3 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +84 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +11 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +5 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +110 -12
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +179 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +81 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +184 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +2 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +30 -2
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +231 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +651 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +269 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_safearea.test.mjs +742 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +91 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +86 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
- package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +693 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +291 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +93 -0
- package/skills/a2h-batch-ui-align/scripts/tests/detect_paradigm.test.mjs +260 -0
- package/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +244 -0
- package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +435 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +31 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
- package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1782 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +215 -0
- package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
- package/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +326 -0
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +356 -0
- package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +302 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +60 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +395 -0
- package/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
- package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +12 -14
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +29 -30
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +1 -0
- package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +203 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
- package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
- package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/skills/a2h-page-specgen/SKILL.md +240 -0
- package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
- package/skills/a2h-page-specgen/references/body-language.md +179 -0
- package/skills/a2h-page-specgen/references/evidence.md +105 -0
- package/skills/a2h-page-specgen/references/execution-model.md +364 -0
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +255 -0
- package/skills/a2h-page-specgen/references/gates.md +323 -0
- package/skills/a2h-page-specgen/references/page-inventory.md +220 -0
- package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
- package/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/skills/a2h-page-specgen/references/spec-template.md +210 -0
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +212 -0
- package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +1613 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +825 -0
- package/skills/a2h-page-specgen/scripts/footprint.mjs +1650 -0
- package/skills/a2h-page-specgen/scripts/gate.mjs +848 -0
- package/skills/a2h-page-specgen/scripts/interactions.mjs +344 -0
- package/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +155 -0
- package/skills/a2h-page-specgen/scripts/lib/deps-source.mjs +399 -0
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +229 -0
- package/skills/a2h-page-specgen/scripts/lib/footprint-roles.mjs +278 -0
- package/skills/a2h-page-specgen/scripts/lib/fsx.mjs +79 -0
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +683 -0
- package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +478 -0
- package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +238 -0
- package/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
- package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
- package/skills/a2h-page-specgen/scripts/lib/symbols.mjs +125 -0
- package/skills/a2h-page-specgen/scripts/lib/utg-io.mjs +110 -0
- package/skills/a2h-page-specgen/scripts/lib/waker-event-store.mjs +658 -0
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +840 -0
- package/skills/a2h-page-specgen/scripts/render.mjs +294 -0
- package/skills/a2h-page-specgen/scripts/report.mjs +340 -0
- package/skills/a2h-page-specgen/scripts/submission.mjs +697 -0
- package/skills/a2h-page-specgen/scripts/submit.mjs +85 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/README.md +77 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +871 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/cases.example.json +57 -0
- package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +205 -0
- package/skills/a2h-page-specgen/scripts/test/dispatch.test.mjs +258 -0
- package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1203 -0
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +243 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Api.kt +20 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/BothAnnotations.kt +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Cache.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Comments.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Mmkv.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Models.kt +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Pair.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Prefs.kt +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Room.kt +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Sample.kt +43 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Templates.kt +34 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Timeouts.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/androidTest/Helper.kt +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/build.gradle.kts +16 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/en.js.txt +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/libs.versions.toml +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/package.json +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values/strings.xml +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-land/strings.xml +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-night/strings.xml +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-v21/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/test/Legacy.kt +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/weather.proto +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/AppPreferences.kt +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/SettingsViewModel.kt +16 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-dao/src/UserDao.kt +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/base/strings.xml +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/fil/strings.xml +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/arrays.xml +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/strings.xml +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/xml/prefs.xml +27 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Api.java +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Datastore.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Settings.java +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/forecast.js +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/store.js +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/BasePreferences.kt +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/Screen.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/UiPreferences.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-retrofit/src/AuthAPI.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/AndroidManifest.xml +20 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/feature/auth/navigation/ScreenRoute.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/pages.json +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/components/Widget.vue +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/detail/detail.vue +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/index/index.vue +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/store/userStore.js +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/uni_modules/uview-ui/components/u-thing.js +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp.mkdb.mjs +144 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +112 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/MainFragment.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyListeners.java +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/PlainActivity.java +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/fold-chain/utg.json +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/utg.json +34 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +1029 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-roles.test.mjs +172 -0
- package/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +143 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +1078 -0
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +188 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +549 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +368 -0
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +310 -0
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +250 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +776 -0
- package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +464 -0
- package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1103 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +160 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +236 -0
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +398 -0
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
- package/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +418 -0
- package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1782 -0
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +546 -0
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
- package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
- package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/skills/a2h-page-specgen/scripts/test/source-text.test.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +1231 -0
- package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/skills/a2h-page-specgen/scripts/test/waker-event-store.test.mjs +1365 -0
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1801 -0
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +1993 -0
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +342 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +1301 -0
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +299 -0
- package/skills/a2h-resource-convert/SKILL.md +9 -1
- package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +115 -53
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
- package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
- package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
- package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
- package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
- package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +182 -0
- package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +206 -0
- package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
- package/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
- package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +98 -121
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +170 -45
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +62 -12
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -4
- package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +49 -6
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +198 -54
- package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +67 -0
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +47 -14
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +390 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +148 -29
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +104 -24
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +18 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +16 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/platform/ExtraDataSubCheck.js +485 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +13 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +18 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +12 -38
- package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +95 -7
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +156 -7
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +71 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +22 -3
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +33 -3
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +2 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +232 -13
- package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
- package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +220 -44
- package/skills/a2h-spec-design-pipeline/scripts/lib/shared_classes.ts +113 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/shared_docs.ts +202 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/wiring.ts +58 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +178 -14
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +3 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +368 -0
- package/skills/a2h-spec-design-pipeline/scripts/scan_shared.ts +642 -0
- package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +42 -8
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +27 -9
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +242 -9
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +192 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +531 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +49 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +51 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +17 -10
- package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +401 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_scan_shared.ts +996 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_classes.ts +80 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_docs.ts +205 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +165 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_e2e.ts +85 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_validate_shared_manifest.ts +720 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_wiring.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/validate_shared_manifest.ts +566 -0
- package/skills/a2h-spec-generate/SKILL.md +89 -23
- package/skills/a2h-spec-generate/references/batch-mode.md +78 -17
- package/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +7 -0
- package/skills/a2h-spec-generate/references/review-checklist.md +1 -0
- package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
- package/skills/a2h-spec-generate/references/synthesis-rules.md +4 -2
- package/skills/a2h-spec-generate/references/worker-rules.md +6 -3
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +4 -5
- package/skills/a2h-spec-generate/scripts/check_spec.ts +145 -14
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +261 -19
- package/skills/a2h-spec-generate/scripts/dispatch-watch.mjs +1168 -0
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +25 -46
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +26 -27
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +3 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +31 -32
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +2 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +15 -26
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +102 -81
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +39 -19
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +12 -13
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +35 -196
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +3 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +22 -96
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +3 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +1 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +74 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +51 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +42 -111
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +1 -20
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +3 -4
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +50 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +75 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +256 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/zip.ts +63 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +650 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-seed.test.ts +195 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +347 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1948 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-library-evidence.test.ts +239 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +277 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +844 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +117 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +175 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +286 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +25 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/zip.test.ts +61 -0
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +879 -0
- package/skills/a2h-spec-generate/test/check-spec.test.ts +430 -0
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +811 -0
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
- package/skills/a2h-spec-generate/test/dispatch-watch.test.mjs +606 -0
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +229 -0
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
- package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +8 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +6 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +4 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +8 -0
- package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +1 -0
- package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
- package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +182 -0
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
- package/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
- package/skills/a2h-spec-generate/test/report.test.mjs +47 -0
- package/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/skills/a2h-utg-explorer/references/architecture.md +7 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +120 -85
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +1 -2
- package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +5 -3
- package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
- package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +244 -0
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
- package/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +104 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +231 -0
- package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +160 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_identity.test.mjs +77 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +187 -0
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
- package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +137 -0
- package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +16 -0
- package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
- package/skills/a2h-utg-explorer/scripts/tests/fresh_state_plan.test.mjs +78 -0
- package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
- package/skills/a2h-utg-explorer/scripts/tests/holds_without_data_parity.test.mjs +26 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +614 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +214 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_failure.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +193 -0
- package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
- package/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +212 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
- package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +213 -0
- package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +458 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +336 -0
- package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +142 -0
- package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/skills/a2h-utg-explorer/scripts/tests/string_tables_twin_ties.test.mjs +83 -0
- package/skills/a2h-utg-explorer/scripts/tests/tar_fixture.mjs +12 -0
- package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +346 -0
- package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +112 -0
- package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +24 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +135 -7
- package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +245 -69
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +164 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
- package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
- package/skills/a2h-utg-static/SKILL.md +6 -2
- package/skills/a2h-utg-static/scripts/assemble.mjs +93 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +135 -25
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +110 -3
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +2 -3
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +34 -7
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +1 -2
- package/skills/a2h-utg-static/scripts/route_interceptor.mjs +21 -7
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
- package/skills/a2h-utg-static/scripts/static_prior.mjs +26 -29
- package/skills/a2h-utg-static/scripts/tests/test_activity_gates.mjs +84 -0
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
- package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
- package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +29 -1
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
- package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-app-migrate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-arch-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +0 -5
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +0 -54
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +0 -38
- package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-resource-convert/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -885
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -856
- package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +0 -70
- package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +0 -54
- package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-static/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/tests/test_i18n_term.mjs +0 -155
|
@@ -0,0 +1,2050 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live device capture for the dependency-free Node dashboard.
|
|
3
|
+
*
|
|
4
|
+
* Source-side Android screenshots are immutable pipeline inputs: when every
|
|
5
|
+
* page declared by ui_info already has meta.json, view.xml and a screenshot,
|
|
6
|
+
* the dashboard reuses them and never contacts ADB. HarmonyOS capture is a
|
|
7
|
+
* single startup snapshot. Browser reloads only rebuild HTML from artifacts;
|
|
8
|
+
* they never trigger another device capture.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import fs from 'node:fs';
|
|
12
|
+
import path from 'node:path';
|
|
13
|
+
import { spawn } from 'node:child_process';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
|
|
16
|
+
// Capture captions and validation reasons are business text in the installed language
|
|
17
|
+
//; dashboard.mjs trCaptureDetail renders either form in the display language.
|
|
18
|
+
const listJoin = (items) => items.join(', ');
|
|
19
|
+
// Validation reasons that the state-retry loop re-checks, in both forms.
|
|
20
|
+
const RETRYABLE_REASON = /^Target state is missing visible content|^The page structure did not change after the tap/;
|
|
21
|
+
|
|
22
|
+
const MODULE_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
23
|
+
// page_capture.mjs (zero-dependency Node; port of the removed a2h-utg-crawler's
|
|
24
|
+
// page_capture.py) runs under this same Node, so live capture needs no Python.
|
|
25
|
+
// Its CLI (--device/--serial/-o/--max-scrolls/--stability-only) matches the calls below.
|
|
26
|
+
const PAGE_CAPTURE_SCRIPT = path.resolve(MODULE_DIR, 'page_capture.mjs');
|
|
27
|
+
const NODE = process.execPath;
|
|
28
|
+
|
|
29
|
+
// Windows env blocks may store the variable as "Path"; Node's process.env
|
|
30
|
+
// bridges both spellings, but copied env objects do not. An explicitly
|
|
31
|
+
// configured empty PATH stays empty — callers use it to simulate a PATH-less
|
|
32
|
+
// environment — so only an undefined PATH falls back to the other spelling.
|
|
33
|
+
function envPathValue(env = process.env) {
|
|
34
|
+
if (env.PATH !== undefined) return String(env.PATH);
|
|
35
|
+
if (env.Path !== undefined) return String(env.Path);
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const STARTUP_DEVICE_WAIT_MS = 60_000;
|
|
40
|
+
|
|
41
|
+
function readText(file) {
|
|
42
|
+
try { return fs.readFileSync(file, 'utf8'); } catch { return '';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function readJson(file) {
|
|
47
|
+
try { return JSON.parse(fs.readFileSync(file, 'utf8').replace(/^\uFEFF/, '')); } catch { return null; }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function writeJson(file, value) {
|
|
51
|
+
fs.writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`, 'utf8');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function exists(file) {
|
|
55
|
+
try { return fs.existsSync(file); } catch { return false; }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function safeName(value) {
|
|
59
|
+
return String(value || 'Page').replace(/[^\p{L}\p{N}_.-]+/gu, '_').replace(/^_+|_+$/g, '') || 'Page';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function normalizedPage(value) {
|
|
63
|
+
return safeName(String(value || '').split(/[\\/]/).at(-1).replace(/\.(ets|cj)$/i, '')).toLowerCase();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function decodeXml(value) {
|
|
67
|
+
return String(value || '').replace(/&(#x?[0-9a-f]+|amp|lt|gt|quot|apos);/gi, (match, entity) => {
|
|
68
|
+
const named = { amp: '&', lt: '<', gt: '>', quot: '"', apos: "'" };
|
|
69
|
+
if (!entity.startsWith('#')) return named[entity.toLowerCase()] ?? match;
|
|
70
|
+
const code = entity[1]?.toLowerCase() === 'x'
|
|
71
|
+
? Number.parseInt(entity.slice(2), 16)
|
|
72
|
+
: Number.parseInt(entity.slice(1), 10);
|
|
73
|
+
return Number.isFinite(code) ? String.fromCodePoint(code) : match;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function xmlAttributes(raw) {
|
|
78
|
+
const attrs = {};
|
|
79
|
+
const pattern = /([^\s=/>]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
80
|
+
let match;
|
|
81
|
+
while ((match = pattern.exec(raw))) attrs[match[1]] = decodeXml(match[2] ?? match[3] ?? '');
|
|
82
|
+
return attrs;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function truthyXml(value) {
|
|
86
|
+
return /^(1|true|yes)$/i.test(String(value || ''));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function clickableElementsFromXml(xml, scrollIndex = 0) {
|
|
90
|
+
const rows = [];
|
|
91
|
+
const seen = new Set();
|
|
92
|
+
const pattern = /<node\b([^>]*)>/gi;
|
|
93
|
+
let match;
|
|
94
|
+
while ((match = pattern.exec(String(xml || '')))) {
|
|
95
|
+
const attrs = xmlAttributes(match[1]);
|
|
96
|
+
if (attrs.enabled && !truthyXml(attrs.enabled)) continue;
|
|
97
|
+
if (![attrs.clickable, attrs['long-clickable'], attrs.checkable].some(truthyXml)) continue;
|
|
98
|
+
const bounds = String(attrs.bounds || '').match(/\[(-?\d+),(-?\d+)\]\[(-?\d+),(-?\d+)\]/);
|
|
99
|
+
if (!bounds) continue;
|
|
100
|
+
const [, x1, y1, x2, y2] = bounds.map(Number);
|
|
101
|
+
if (x2 <= x1 || y2 <= y1) continue;
|
|
102
|
+
const key = `${x1},${y1},${x2},${y2}`;
|
|
103
|
+
if (seen.has(key)) continue;
|
|
104
|
+
seen.add(key);
|
|
105
|
+
rows.push({
|
|
106
|
+
class: attrs.class || attrs.type || '',
|
|
107
|
+
'resource-id': attrs['resource-id'] || attrs.id || '',
|
|
108
|
+
text: attrs.text || '',
|
|
109
|
+
'content-desc': attrs['content-desc'] || attrs.description || '',
|
|
110
|
+
bounds: `[${x1},${y1}][${x2},${y2}]`,
|
|
111
|
+
center: [Math.trunc((x1 + x2) / 2), Math.trunc((y1 + y2) / 2)],
|
|
112
|
+
scroll_index: scrollIndex,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return rows;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function parsedBounds(value) {
|
|
119
|
+
const match = String(value || '').match(/\[(-?\d+),(-?\d+)\]\[(-?\d+),(-?\d+)\]/);
|
|
120
|
+
return match ? match.slice(1).map(Number) : null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function boundsContain(outerValue, innerValue) {
|
|
124
|
+
const outer = parsedBounds(outerValue);
|
|
125
|
+
const inner = parsedBounds(innerValue);
|
|
126
|
+
if (!outer || !inner) return false;
|
|
127
|
+
// ArkUI can report a Text child a few pixels wider than its clickable Row
|
|
128
|
+
// because glyph/layout bounds are not clipped to the hit-test rectangle.
|
|
129
|
+
// The child's centre is the stable ownership signal in that case.
|
|
130
|
+
const centerX = (inner[0] + inner[2]) / 2;
|
|
131
|
+
const centerY = (inner[1] + inner[3]) / 2;
|
|
132
|
+
return outer[0] <= centerX && centerX <= outer[2]
|
|
133
|
+
&& outer[1] <= centerY && centerY <= outer[3];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function scopedClickableElementsFromXml(xml, expectedVisible = [], scrollIndex = 0) {
|
|
137
|
+
const scope = expectedVisible.length ? smallestExpectedScope(xml, expectedVisible, true) : String(xml || '');
|
|
138
|
+
const rows = clickableElementsFromXml(scope, scrollIndex);
|
|
139
|
+
const nodes = [];
|
|
140
|
+
const stack = [];
|
|
141
|
+
const pattern = /<node\b([^>]*?)(\/?)>|<\/node\s*>/gi;
|
|
142
|
+
let match;
|
|
143
|
+
while ((match = pattern.exec(scope))) {
|
|
144
|
+
if (match[0].startsWith('</')) {
|
|
145
|
+
const node = stack.pop();
|
|
146
|
+
if (node) node.end = pattern.lastIndex;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const node = { attrs: xmlAttributes(match[1]), start: match.index, end: pattern.lastIndex };
|
|
150
|
+
nodes.push(node);
|
|
151
|
+
if (match[2] !== '/') stack.push(node);
|
|
152
|
+
}
|
|
153
|
+
while (stack.length) stack.pop().end = scope.length;
|
|
154
|
+
const labelled = rows.map((row) => {
|
|
155
|
+
const owner = nodes.find((node) => {
|
|
156
|
+
const attrs = node.attrs;
|
|
157
|
+
return String(attrs.bounds || '') === String(row.bounds || '')
|
|
158
|
+
&& String(attrs.class || attrs.type || '') === String(row.class || '')
|
|
159
|
+
&& [attrs.clickable, attrs['long-clickable'], attrs.checkable].some(truthyXml);
|
|
160
|
+
});
|
|
161
|
+
const ownerXml = owner ? scope.slice(owner.start, owner.end) : '';
|
|
162
|
+
const labels = [...ownerXml.matchAll(/<node\b([^>]*)>/gi)]
|
|
163
|
+
.flatMap((item) => {
|
|
164
|
+
const attrs = xmlAttributes(item[1]);
|
|
165
|
+
return [attrs.text, attrs['content-desc']];
|
|
166
|
+
})
|
|
167
|
+
.map((value) => String(value || '').trim())
|
|
168
|
+
.filter(Boolean)
|
|
169
|
+
.sort((left, right) => right.length - left.length);
|
|
170
|
+
return labels[0] ? { ...row, text: labels[0] } : row;
|
|
171
|
+
});
|
|
172
|
+
return labelled.filter((row, index) => {
|
|
173
|
+
// ArkUI selection rows commonly expose both the whole Row and its nested
|
|
174
|
+
// Radio/Checkbox/Toggle as clickable. They are one user action, so keep
|
|
175
|
+
// the larger semantic row and discard only the nested selection control.
|
|
176
|
+
if (/^(?:Radio|Checkbox|Toggle)$/i.test(String(row.class || ''))) {
|
|
177
|
+
const owner = labelled.find((candidate, candidateIndex) => candidateIndex !== index
|
|
178
|
+
&& !/^(?:Radio|Checkbox|Toggle)$/i.test(String(candidate.class || ''))
|
|
179
|
+
&& boundsContain(candidate.bounds, row.bounds)
|
|
180
|
+
&& candidate.bounds !== row.bounds);
|
|
181
|
+
if (owner) return false;
|
|
182
|
+
}
|
|
183
|
+
return !labelled.slice(0, index).some((candidate) => (
|
|
184
|
+
candidate.bounds === row.bounds && candidate.class === row.class && candidate.text === row.text
|
|
185
|
+
));
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function enrichCaptureMeta(dir, options = {}) {
|
|
190
|
+
const metaFile = path.join(dir, 'meta.json');
|
|
191
|
+
const meta = readJson(metaFile) ?? {};
|
|
192
|
+
const xmlFiles = fs.readdirSync(dir, { withFileTypes: true })
|
|
193
|
+
.filter((item) => item.isFile() && /^view(?:_scroll_\d+)?\.xml$/i.test(item.name))
|
|
194
|
+
.map((item) => item.name)
|
|
195
|
+
.sort((left, right) => {
|
|
196
|
+
const a = Number(left.match(/(\d+)/)?.[1] ?? 0);
|
|
197
|
+
const b = Number(right.match(/(\d+)/)?.[1] ?? 0);
|
|
198
|
+
return a - b;
|
|
199
|
+
});
|
|
200
|
+
const clickable = [];
|
|
201
|
+
xmlFiles.forEach((name, index) => clickable.push(...scopedClickableElementsFromXml(
|
|
202
|
+
readText(path.join(dir, name)),
|
|
203
|
+
Array.isArray(options.expectedVisible) ? options.expectedVisible : [],
|
|
204
|
+
index,
|
|
205
|
+
)));
|
|
206
|
+
if (clickable.length) meta.clickable_elements = clickable;
|
|
207
|
+
meta.capture_origin = 'node-dashboard-live';
|
|
208
|
+
meta.captured_at = meta.timestamp || new Date().toISOString();
|
|
209
|
+
writeJson(metaFile, meta);
|
|
210
|
+
return meta;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function captureStructureSignature(metaFile) {
|
|
214
|
+
const xml = readText(path.join(path.dirname(metaFile), 'view.xml'));
|
|
215
|
+
const nodes = [];
|
|
216
|
+
const pattern = /<node\b([^>]*)>/gi;
|
|
217
|
+
let match;
|
|
218
|
+
while ((match = pattern.exec(xml))) {
|
|
219
|
+
const attrs = xmlAttributes(match[1]);
|
|
220
|
+
nodes.push([
|
|
221
|
+
attrs.class || attrs.type || '',
|
|
222
|
+
attrs.bounds || '',
|
|
223
|
+
String(attrs.clickable || '').toLowerCase(),
|
|
224
|
+
String(attrs['long-clickable'] || '').toLowerCase(),
|
|
225
|
+
String(attrs.checkable || '').toLowerCase(),
|
|
226
|
+
String(attrs.scrollable || '').toLowerCase(),
|
|
227
|
+
String(attrs.focusable || '').toLowerCase(),
|
|
228
|
+
// Text is also evidence of "the page changed": two structurally identical pages that differ only in
|
|
229
|
+
// wording (home button "Tap me to jump" → sub-page button "Tap me to go back") must count as navigated, otherwise they
|
|
230
|
+
// get falsely reported as "no structural change after the tap".
|
|
231
|
+
String(attrs.text || '').toLowerCase(),
|
|
232
|
+
String(attrs['content-desc'] || '').toLowerCase(),
|
|
233
|
+
].join('|'));
|
|
234
|
+
}
|
|
235
|
+
if (nodes.length) return nodes.join('\n');
|
|
236
|
+
const clickable = readJson(metaFile)?.clickable_elements || [];
|
|
237
|
+
return clickable.map((item) => [
|
|
238
|
+
item.class || '',
|
|
239
|
+
item.bounds || '',
|
|
240
|
+
Array.isArray(item.center) ? item.center.join(',') : '',
|
|
241
|
+
String(item.text || item['content-desc'] || '').toLowerCase(),
|
|
242
|
+
].join('|')).join('\n');
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function captureStateChanged(beforeMetaFile, afterMetaFile) {
|
|
246
|
+
if (!beforeMetaFile || !afterMetaFile || !exists(beforeMetaFile) || !exists(afterMetaFile)) return false;
|
|
247
|
+
const before = captureStructureSignature(beforeMetaFile);
|
|
248
|
+
const after = captureStructureSignature(afterMetaFile);
|
|
249
|
+
return Boolean(before && after && before !== after);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function screenshotIn(dir, hmos = false) {
|
|
253
|
+
const names = hmos
|
|
254
|
+
? ['long_screenshot.jpeg', 'long_screenshot.jpg', 'long_screenshot.png', 'screenshot.jpeg', 'screenshot.jpg', 'screenshot.png']
|
|
255
|
+
: ['long_screenshot.png', 'long_screenshot.jpeg', 'long_screenshot.jpg', 'screenshot.png', 'screenshot.jpeg', 'screenshot.jpg'];
|
|
256
|
+
return names.map((name) => path.join(dir, name)).find((file) => {
|
|
257
|
+
try { return fs.statSync(file).isFile() && fs.statSync(file).size > 0; } catch { return false; }
|
|
258
|
+
}) || '';
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function smallestExpectedScope(xml, expectedVisible, preserveCase = false) {
|
|
262
|
+
const expected = expectedVisible.map((value) => String(value || '').trim().toLowerCase()).filter(Boolean);
|
|
263
|
+
if (!expected.length) return String(xml || '').toLowerCase();
|
|
264
|
+
const roots = [];
|
|
265
|
+
const stack = [];
|
|
266
|
+
const tagPattern = /<node\b([^>]*?)(\/?)>|<\/node\s*>/gi;
|
|
267
|
+
let tag;
|
|
268
|
+
while ((tag = tagPattern.exec(String(xml || '')))) {
|
|
269
|
+
if (tag[0].startsWith('</')) {
|
|
270
|
+
const node = stack.pop();
|
|
271
|
+
if (node) node.end = tagPattern.lastIndex;
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
const node = {
|
|
275
|
+
attrs: xmlAttributes(tag[1]),
|
|
276
|
+
start: tag.index,
|
|
277
|
+
end: tagPattern.lastIndex,
|
|
278
|
+
depth: stack.length,
|
|
279
|
+
children: [],
|
|
280
|
+
};
|
|
281
|
+
if (stack.length) stack.at(-1).children.push(node);
|
|
282
|
+
else roots.push(node);
|
|
283
|
+
if (tag[2] === '/') node.end = tagPattern.lastIndex;
|
|
284
|
+
else stack.push(node);
|
|
285
|
+
}
|
|
286
|
+
while (stack.length) {
|
|
287
|
+
const node = stack.pop();
|
|
288
|
+
node.end = String(xml || '').length;
|
|
289
|
+
}
|
|
290
|
+
const matches = [];
|
|
291
|
+
const visit = (node) => {
|
|
292
|
+
const raw = String(xml || '').slice(node.start, node.end);
|
|
293
|
+
const blob = raw.toLowerCase();
|
|
294
|
+
if (expected.every((value) => blob.includes(value))) matches.push({ node, blob, raw });
|
|
295
|
+
node.children.forEach(visit);
|
|
296
|
+
};
|
|
297
|
+
roots.forEach(visit);
|
|
298
|
+
// An overlay/dialog is normally the deepest and smallest subtree containing
|
|
299
|
+
// every required label. Scoping forbidden-label checks to that subtree
|
|
300
|
+
// prevents the still-rendered page underneath the overlay from being
|
|
301
|
+
// mistaken for a different dialog state.
|
|
302
|
+
matches.sort((left, right) => right.node.depth - left.node.depth || left.blob.length - right.blob.length);
|
|
303
|
+
if (!matches[0]) return preserveCase ? String(xml || '') : String(xml || '').toLowerCase();
|
|
304
|
+
return preserveCase ? matches[0].raw : matches[0].blob;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function parseBoundsRect(raw) {
|
|
308
|
+
const match = String(raw || '').match(/\[(-?\d+),(-?\d+)\]\[(-?\d+),(-?\d+)\]/);
|
|
309
|
+
if (!match) return null;
|
|
310
|
+
const [, x1, y1, x2, y2] = match.map(Number);
|
|
311
|
+
return { x1, y1, x2, y2 };
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function screenBoundsFromXml(xml) {
|
|
315
|
+
const match = String(xml || '').match(/<node\b[^>]*bounds="\[(\d+),(\d+)\]\[(\d+),(\d+)\]"/);
|
|
316
|
+
if (!match) return null;
|
|
317
|
+
const width = Number(match[3]) - Number(match[1]);
|
|
318
|
+
const height = Number(match[4]) - Number(match[2]);
|
|
319
|
+
return width > 0 && height > 0 ? { width, height } : null;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Clickable-element geometry normalized to the screen rectangle, so Android
|
|
323
|
+
// and HarmonyOS captures at different resolutions become comparable. The
|
|
324
|
+
// authoritative screen size is the recorder's device_info (wm size); the
|
|
325
|
+
// view-tree root bounds are only a fallback — dialog dumps can carry a root
|
|
326
|
+
// smaller than the physical screen and would push normalized y past 1.
|
|
327
|
+
function normalizedStructure(elements, xml, screenHint = null) {
|
|
328
|
+
const hintWidth = Number(screenHint?.width_px ?? screenHint?.width);
|
|
329
|
+
const hintHeight = Number(screenHint?.height_px ?? screenHint?.height);
|
|
330
|
+
const hint = hintWidth > 0 && hintHeight > 0 ? { width: hintWidth, height: hintHeight } : null;
|
|
331
|
+
const screen = hint || screenBoundsFromXml(xml);
|
|
332
|
+
if (!screen) return [];
|
|
333
|
+
const seen = new Set();
|
|
334
|
+
const rows = [];
|
|
335
|
+
for (const item of (Array.isArray(elements) ? elements : [])) {
|
|
336
|
+
const rect = parseBoundsRect(item?.bounds);
|
|
337
|
+
if (!rect) continue;
|
|
338
|
+
const row = {
|
|
339
|
+
cx: (rect.x1 + rect.x2) / 2 / screen.width,
|
|
340
|
+
cy: (rect.y1 + rect.y2) / 2 / screen.height,
|
|
341
|
+
w: (rect.x2 - rect.x1) / screen.width,
|
|
342
|
+
h: (rect.y2 - rect.y1) / screen.height,
|
|
343
|
+
text: String(item?.text || '').trim(),
|
|
344
|
+
};
|
|
345
|
+
// The crawler can record the same control twice (parent + child with
|
|
346
|
+
// identical bounds). Collapse near-identical geometry so one real element
|
|
347
|
+
// counts once; duplicates would both dilute the match ratio and surface
|
|
348
|
+
// as fake extras on the other side.
|
|
349
|
+
const key = [row.cx, row.cy, row.w, row.h].map((value) => value.toFixed(2)).join(',');
|
|
350
|
+
if (seen.has(key)) continue;
|
|
351
|
+
seen.add(key);
|
|
352
|
+
rows.push(row);
|
|
353
|
+
}
|
|
354
|
+
return rows;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Every visible text of a source page (view texts + clickable texts), used to
|
|
358
|
+
// tell "foreign" unmatched elements (dialog buttons from another state) from
|
|
359
|
+
// wording the target page itself legitimately shows.
|
|
360
|
+
function xmlTextCorpus(xml, elements) {
|
|
361
|
+
const values = [...String(xml || '').matchAll(/text="([^"]+)"/g)].map((match) => match[1]);
|
|
362
|
+
for (const item of Array.isArray(elements) ? elements : []) {
|
|
363
|
+
if (item?.text) values.push(String(item.text));
|
|
364
|
+
}
|
|
365
|
+
return values.map((value) => value.toLowerCase()).join('\n');
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// Positional matching between the expected (Android source state) and the
|
|
369
|
+
// actual (captured HarmonyOS state) clickable sets. Structure — not wording —
|
|
370
|
+
// decides whether the target state was reached; migrated apps may legitimately
|
|
371
|
+
// reword labels while keeping the layout.
|
|
372
|
+
function compareStructure(expected, actual, tolerance = 0.18) {
|
|
373
|
+
if (!expected.length || !actual.length) {
|
|
374
|
+
return { matchedCount: 0, expectedCount: expected.length, matchedRatio: 0, extras: [] };
|
|
375
|
+
}
|
|
376
|
+
const used = new Set();
|
|
377
|
+
const matches = [];
|
|
378
|
+
// Pass 1: anchor identical-text pairs (within a loose positional sanity
|
|
379
|
+
// window) before positional matching. Without this, an overlay sitting
|
|
380
|
+
// between two list rows can steal a row's positional match and let the
|
|
381
|
+
// real row surface as an "extra".
|
|
382
|
+
const pending = [];
|
|
383
|
+
for (const exp of expected) {
|
|
384
|
+
if (!exp.text) { pending.push(exp); continue; }
|
|
385
|
+
const wanted = exp.text.toLowerCase();
|
|
386
|
+
let best = -1;
|
|
387
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
388
|
+
actual.forEach((act, index) => {
|
|
389
|
+
if (used.has(index) || String(act.text || '').trim().toLowerCase() !== wanted) return;
|
|
390
|
+
const distance = Math.hypot(exp.cx - act.cx, exp.cy - act.cy);
|
|
391
|
+
if (distance < bestDistance) { bestDistance = distance; best = index; }
|
|
392
|
+
});
|
|
393
|
+
if (best >= 0 && bestDistance <= 0.3) {
|
|
394
|
+
used.add(best);
|
|
395
|
+
matches.push({ expected: exp, actual: actual[best] });
|
|
396
|
+
} else {
|
|
397
|
+
pending.push(exp);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// Pass 2: greedy nearest-center matching for everything else — reworded
|
|
401
|
+
// labels and textless icons still pair positionally.
|
|
402
|
+
for (const exp of pending) {
|
|
403
|
+
let best = -1;
|
|
404
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
405
|
+
actual.forEach((act, index) => {
|
|
406
|
+
if (used.has(index)) return;
|
|
407
|
+
const distance = Math.hypot(exp.cx - act.cx, exp.cy - act.cy);
|
|
408
|
+
if (distance < bestDistance) { bestDistance = distance; best = index; }
|
|
409
|
+
});
|
|
410
|
+
if (best >= 0 && bestDistance <= tolerance) {
|
|
411
|
+
used.add(best);
|
|
412
|
+
matches.push({ expected: exp, actual: actual[best] });
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
const extras = actual.filter((_, index) => !used.has(index));
|
|
416
|
+
// Text agreement among the POSITIONALLY matched pairs. A global "text appears
|
|
417
|
+
// somewhere" check cannot separate an overlay from the page beneath (the
|
|
418
|
+
// settings rows repeat the dialog option labels), so compare the wording at
|
|
419
|
+
// the matched positions instead: a reworded label still counts when one text
|
|
420
|
+
// contains the other ("Select language" ↔ "Language").
|
|
421
|
+
let matchedTextTotal = 0;
|
|
422
|
+
let agreedTextTotal = 0;
|
|
423
|
+
for (const match of matches) {
|
|
424
|
+
const expectedText = String(match.expected.text || '').trim().toLowerCase();
|
|
425
|
+
if (!expectedText) continue;
|
|
426
|
+
matchedTextTotal += 1;
|
|
427
|
+
const actualText = String(match.actual.text || '').trim().toLowerCase();
|
|
428
|
+
if (actualText && (actualText === expectedText
|
|
429
|
+
|| actualText.includes(expectedText) || expectedText.includes(actualText))) {
|
|
430
|
+
agreedTextTotal += 1;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return {
|
|
434
|
+
matchedCount: matches.length,
|
|
435
|
+
expectedCount: expected.length,
|
|
436
|
+
matchedRatio: matches.length / expected.length,
|
|
437
|
+
matchedTextTotal,
|
|
438
|
+
agreedTextTotal,
|
|
439
|
+
extras,
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function validateHmosCapture(dir, expectedNames = [], options = {}) {
|
|
444
|
+
const meta = readJson(path.join(dir, 'meta.json'));
|
|
445
|
+
const screenshot = screenshotIn(dir, true);
|
|
446
|
+
if (!meta || !screenshot) return { ok: false, reason: "meta.json or the screenshot file is missing", actualPage: '' };
|
|
447
|
+
const actualPage = String(meta.page_name || '');
|
|
448
|
+
const expected = expectedNames.map(normalizedPage).filter(Boolean);
|
|
449
|
+
const actualIdentity = normalizedPage(actualPage);
|
|
450
|
+
// Some HDC/uitest versions omit pagePath and report "unknown". In that
|
|
451
|
+
// case the caller must provide an independent runtime fingerprint (for
|
|
452
|
+
// example the navigation click that was just executed). Never treat an
|
|
453
|
+
// unknown identity as a successful match by itself.
|
|
454
|
+
if ((!actualIdentity || actualIdentity === 'unknown') && !options.allowUnknown) {
|
|
455
|
+
return { ok: false, reason: "HDC returned no verifiable page_name", actualPage };
|
|
456
|
+
}
|
|
457
|
+
if (actualIdentity && actualIdentity !== 'unknown' && expected.length && !expected.includes(actualIdentity)) {
|
|
458
|
+
return { ok: false, reason: `The actual page is ${actualPage || "unknown page"}, which does not match the target ${expectedNames.join('/')}`, actualPage };
|
|
459
|
+
}
|
|
460
|
+
const pageXml = readText(path.join(dir, 'view.xml'));
|
|
461
|
+
const expectedBundle = String(options.expectedBundle || '').trim().toLowerCase();
|
|
462
|
+
const observedBundles = [...pageXml.matchAll(/\bpackage="([^"]+)"/gi)]
|
|
463
|
+
.map((match) => String(match[1] || '').trim().toLowerCase())
|
|
464
|
+
.filter(Boolean);
|
|
465
|
+
if (expectedBundle && options.requireBundle && !observedBundles.length) {
|
|
466
|
+
return { ok: false, reason: "The HDC page tree returned no foreground app bundle; the screenshot cannot be attributed", actualPage };
|
|
467
|
+
}
|
|
468
|
+
if (expectedBundle && observedBundles.length && !observedBundles.includes(expectedBundle)) {
|
|
469
|
+
return { ok: false, reason: `The foreground page does not belong to ${options.expectedBundle} (actually ${listJoin([...new Set(observedBundles)])})`, actualPage };
|
|
470
|
+
}
|
|
471
|
+
const visibleText = `${pageXml}\n${(meta.clickable_elements || [])
|
|
472
|
+
.flatMap((item) => [item.text, item['content-desc'], item['resource-id']])
|
|
473
|
+
.filter(Boolean)
|
|
474
|
+
.join('\n')}`.toLowerCase();
|
|
475
|
+
const expectedVisible = Array.isArray(options.expectedVisible) ? options.expectedVisible : [];
|
|
476
|
+
const forbiddenVisible = Array.isArray(options.forbiddenVisible) ? options.forbiddenVisible : [];
|
|
477
|
+
// Structure gate: compare clickable-element geometry (normalized to the
|
|
478
|
+
// screen) against the Android source state instead of requiring the
|
|
479
|
+
// Android wording to appear verbatim — migrated apps may reword labels
|
|
480
|
+
// while keeping the layout. Unmatched elements whose text the target page
|
|
481
|
+
// never shows (dialog buttons from another state) flag overlay residue.
|
|
482
|
+
const actualStructure = normalizedStructure(meta.clickable_elements, pageXml, meta.device_info);
|
|
483
|
+
const expectedStructure = Array.isArray(options.expectedStructure) ? options.expectedStructure : [];
|
|
484
|
+
const expectedTexts = String(options.expectedTexts || '').toLowerCase();
|
|
485
|
+
let gateFailure = '';
|
|
486
|
+
if (expectedStructure.length && actualStructure.length) {
|
|
487
|
+
const comparison = compareStructure(expectedStructure, actualStructure);
|
|
488
|
+
// Structure alone cannot separate layouts that share a shape (the four
|
|
489
|
+
// preference dialogs all render option/option/Cancel at the same spots), so
|
|
490
|
+
// the wording at the matched positions must also agree — tolerantly
|
|
491
|
+
// (containment counts, and half of the textual pairs is enough to survive
|
|
492
|
+
// a couple of reworded labels).
|
|
493
|
+
const textAgreementOk = !comparison.matchedTextTotal
|
|
494
|
+
|| comparison.agreedTextTotal / comparison.matchedTextTotal >= 0.5;
|
|
495
|
+
if (comparison.matchedRatio < 0.5) {
|
|
496
|
+
gateFailure = `Page structure does not match the target state (${comparison.matchedCount}/${comparison.expectedCount} element positions correspond)`;
|
|
497
|
+
} else if (!textAgreementOk) {
|
|
498
|
+
gateFailure = `Target-state text mismatch (${comparison.matchedTextTotal} text-bearing elements located, only ${comparison.agreedTextTotal} of them agree with the target)`;
|
|
499
|
+
} else if (comparison.extras.length <= comparison.expectedCount) {
|
|
500
|
+
// Only inspect unmatched elements for foreign text when both sides expose
|
|
501
|
+
// a comparable number of clickables. When the captured dump marks far
|
|
502
|
+
// more elements clickable than the source dump (different UI-toolkit
|
|
503
|
+
// hit-testing), the surplus is granularity noise, not overlay evidence.
|
|
504
|
+
const foreignExtras = comparison.extras
|
|
505
|
+
.filter((item) => item.text && item.text.length >= 2 && !expectedTexts.includes(item.text.toLowerCase()))
|
|
506
|
+
.map((item) => item.text);
|
|
507
|
+
if (foreignExtras.length >= 2) {
|
|
508
|
+
gateFailure = `The screenshot shows ${foreignExtras.length} text element(s) that do not belong to the target state (${listJoin(foreignExtras.slice(0, 3))}); likely a leftover overlay or dialog`;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
} else if (expectedVisible.length) {
|
|
512
|
+
const missing = expectedVisible.filter((value) => !visibleText.includes(String(value).toLowerCase()));
|
|
513
|
+
if (missing.length) gateFailure = `Target state is missing visible content: ${listJoin(missing)}`;
|
|
514
|
+
}
|
|
515
|
+
if (gateFailure) return { ok: false, reason: gateFailure, actualPage };
|
|
516
|
+
const expectedScope = smallestExpectedScope(pageXml, expectedVisible);
|
|
517
|
+
const forbidden = forbiddenVisible.find((value) => expectedScope.includes(String(value).toLowerCase()));
|
|
518
|
+
if (forbidden) return { ok: false, reason: `The screenshot shows content from another state: ${forbidden}`, actualPage };
|
|
519
|
+
if (options.mustDifferFromMeta && !captureStateChanged(options.mustDifferFromMeta, path.join(dir, 'meta.json'))) {
|
|
520
|
+
return { ok: false, reason: "The page structure did not change after the tap; the target page or dialog did not actually open", actualPage };
|
|
521
|
+
}
|
|
522
|
+
return { ok: true, actualPage, screenshot };
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function assertWithin(root, target) {
|
|
526
|
+
const base = path.resolve(root);
|
|
527
|
+
const resolved = path.resolve(target);
|
|
528
|
+
const relative = path.relative(base, resolved);
|
|
529
|
+
if (!relative || relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
530
|
+
if (resolved !== base) throw new Error(`Refusing to operate outside the capture directory: ${resolved}`);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function removeGeneratedDir(root, target) {
|
|
535
|
+
assertWithin(root, target);
|
|
536
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function atomicPromoteCapture(captureRoot, pendingDir, finalDir) {
|
|
540
|
+
assertWithin(captureRoot, pendingDir);
|
|
541
|
+
assertWithin(captureRoot, finalDir);
|
|
542
|
+
// A leftover backup means a previous promote crashed between its two renames:
|
|
543
|
+
// restore it before replacing, so the previous cache survives.
|
|
544
|
+
const backup = `${finalDir}.previous`;
|
|
545
|
+
assertWithin(captureRoot, backup);
|
|
546
|
+
if (!exists(finalDir) && exists(backup)) fs.renameSync(backup, finalDir);
|
|
547
|
+
if (exists(backup)) removeGeneratedDir(captureRoot, backup);
|
|
548
|
+
if (exists(finalDir)) fs.renameSync(finalDir, backup);
|
|
549
|
+
try {
|
|
550
|
+
fs.renameSync(pendingDir, finalDir);
|
|
551
|
+
if (exists(backup)) removeGeneratedDir(captureRoot, backup);
|
|
552
|
+
} catch (error) {
|
|
553
|
+
if (exists(finalDir)) removeGeneratedDir(captureRoot, finalDir);
|
|
554
|
+
if (exists(backup)) fs.renameSync(backup, finalDir);
|
|
555
|
+
throw error;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
function runCommand(command, args, options = {}) {
|
|
560
|
+
return new Promise((resolve) => {
|
|
561
|
+
let stdout = '';
|
|
562
|
+
let stderr = '';
|
|
563
|
+
let settled = false;
|
|
564
|
+
let timer = null;
|
|
565
|
+
let child;
|
|
566
|
+
const finish = (result) => {
|
|
567
|
+
if (settled) return;
|
|
568
|
+
settled = true;
|
|
569
|
+
if (timer) clearTimeout(timer);
|
|
570
|
+
resolve({ stdout, stderr, ...result });
|
|
571
|
+
};
|
|
572
|
+
try {
|
|
573
|
+
child = spawn(command, args, {
|
|
574
|
+
cwd: options.cwd,
|
|
575
|
+
env: options.env || process.env,
|
|
576
|
+
windowsHide: true,
|
|
577
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
578
|
+
});
|
|
579
|
+
} catch (error) {
|
|
580
|
+
finish({ code: null, error });
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
child.stdout?.on('data', (chunk) => { stdout += chunk.toString('utf8'); });
|
|
584
|
+
child.stderr?.on('data', (chunk) => { stderr += chunk.toString('utf8'); });
|
|
585
|
+
child.on('error', (error) => finish({ code: null, error }));
|
|
586
|
+
child.on('close', (code, signal) => finish({ code, signal }));
|
|
587
|
+
timer = setTimeout(() => {
|
|
588
|
+
child.kill('SIGTERM');
|
|
589
|
+
finish({ code: null, timedOut: true, error: new Error(`Command timed out (${options.timeoutMs || 10_000}ms)`) });
|
|
590
|
+
}, options.timeoutMs || 10_000);
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
function executableCandidates(name, env = process.env) {
|
|
595
|
+
const executable = process.platform === 'win32' && !name.endsWith('.exe') ? `${name}.exe` : name;
|
|
596
|
+
const fromPath = envPathValue(env).split(path.delimiter).filter(Boolean).map((dir) => path.join(dir, executable));
|
|
597
|
+
const home = env.USERPROFILE || env.HOME || '';
|
|
598
|
+
const extra = name.startsWith('hdc') ? [
|
|
599
|
+
env.HOMETRANS_HDC,
|
|
600
|
+
env.HDC_PATH,
|
|
601
|
+
env.DEVECO_SDK_HOME && path.join(env.DEVECO_SDK_HOME, 'default', 'openharmony', 'toolchains', executable),
|
|
602
|
+
env.DEVECO_SDK_HOME && path.join(env.DEVECO_SDK_HOME, 'openharmony', 'toolchains', executable),
|
|
603
|
+
env.HARMONYOS_SDK_HOME && path.join(env.HARMONYOS_SDK_HOME, 'default', 'openharmony', 'toolchains', executable),
|
|
604
|
+
env.HARMONYOS_SDK_HOME && path.join(env.HARMONYOS_SDK_HOME, 'openharmony', 'toolchains', executable),
|
|
605
|
+
env.OHOS_SDK_HOME && path.join(env.OHOS_SDK_HOME, 'default', 'openharmony', 'toolchains', executable),
|
|
606
|
+
env.OHOS_SDK_HOME && path.join(env.OHOS_SDK_HOME, 'openharmony', 'toolchains', executable),
|
|
607
|
+
env.DEVECO_HOME && path.join(env.DEVECO_HOME, 'sdk', 'default', 'openharmony', 'toolchains', executable),
|
|
608
|
+
env.LOCALAPPDATA && path.join(env.LOCALAPPDATA, 'Huawei', 'Sdk', 'default', 'openharmony', 'toolchains', executable),
|
|
609
|
+
home && path.join(home, 'AppData', 'Local', 'OpenHarmony', 'Sdk', 'default', 'openharmony', 'toolchains', executable),
|
|
610
|
+
home && path.join(home, 'AppData', 'Local', 'Huawei', 'Sdk', 'default', 'openharmony', 'toolchains', executable),
|
|
611
|
+
home && path.join(home, 'Library', 'Huawei', 'Sdk', 'default', 'openharmony', 'toolchains', executable),
|
|
612
|
+
home && path.join(home, 'Library', 'OpenHarmony', 'Sdk', 'default', 'openharmony', 'toolchains', executable),
|
|
613
|
+
home && path.join(home, 'Huawei', 'Sdk', 'default', 'openharmony', 'toolchains', executable),
|
|
614
|
+
home && path.join(home, 'OpenHarmony', 'Sdk', 'default', 'openharmony', 'toolchains', executable),
|
|
615
|
+
] : [];
|
|
616
|
+
return [...extra, ...fromPath].filter(Boolean);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
function findExecutable(name, env = process.env) {
|
|
620
|
+
const candidates = executableCandidates(name, env);
|
|
621
|
+
const visible = candidates.find((candidate) => exists(candidate));
|
|
622
|
+
if (visible) return visible;
|
|
623
|
+
// A managed/sandboxed process may be denied even for a valid SDK path.
|
|
624
|
+
// Preserve an explicitly configured SDK location so the runner reports the
|
|
625
|
+
// real launch error and the dashboard can visibly fall back to its cache.
|
|
626
|
+
if (name.startsWith('hdc')) {
|
|
627
|
+
if (env.HOMETRANS_HDC) return env.HOMETRANS_HDC;
|
|
628
|
+
const sdk = env.DEVECO_SDK_HOME || env.HARMONYOS_SDK_HOME || env.OHOS_SDK_HOME;
|
|
629
|
+
if (sdk) return path.join(sdk, 'default', 'openharmony', 'toolchains', process.platform === 'win32' ? 'hdc.exe' : 'hdc');
|
|
630
|
+
if (env.DEVECO_HOME) return path.join(env.DEVECO_HOME, 'sdk', 'default', 'openharmony', 'toolchains', process.platform === 'win32' ? 'hdc.exe' : 'hdc');
|
|
631
|
+
}
|
|
632
|
+
return '';
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
function commandFailure(result, fallback) {
|
|
636
|
+
if (result.timedOut) return result.error?.message || fallback;
|
|
637
|
+
if (result.error) return result.error.message;
|
|
638
|
+
const detail = `${result.stdout || ''}\n${result.stderr || ''}`.trim();
|
|
639
|
+
return detail.slice(-600) || fallback;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
async function detectHdc(runner = runCommand, env = process.env) {
|
|
643
|
+
const executable = findExecutable('hdc', env);
|
|
644
|
+
if (!executable) return { connected: false, executable: '', targets: [], detail: "hdc not found; using the local cache" };
|
|
645
|
+
const result = await runner(executable, ['list', 'targets'], { timeoutMs: 5_000, env });
|
|
646
|
+
if (result.code !== 0) return { connected: false, executable, targets: [], detail: `hdc check failed: ${commandFailure(result, 'unknown error')}` };
|
|
647
|
+
const targets = String(result.stdout || '').split(/\r?\n/).map((line) => line.trim())
|
|
648
|
+
.filter((line) => line && !/\[Empty\]/i.test(line));
|
|
649
|
+
return { connected: targets.length > 0, executable, targets, detail: targets.length ? `Connected: ${targets.join(', ')}` : "No HarmonyOS device detected; using the local cache" };
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
function captureRootFor(entry) {
|
|
653
|
+
return path.resolve(entry.ui_capture_dir || path.join(entry.path, '.hometrans', 'dashboard-ui-capture'));
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
function uiInfoRootFor(entry) {
|
|
657
|
+
const candidates = [
|
|
658
|
+
entry.ui_info_root,
|
|
659
|
+
entry.android_project_dir ? path.join(entry.android_project_dir, 'ui_info') : '',
|
|
660
|
+
path.join(entry.path, 'ui_info'),
|
|
661
|
+
path.join(entry.path, '.hometrans', 'ui_info'),
|
|
662
|
+
].filter(Boolean).map((candidate) => path.resolve(candidate));
|
|
663
|
+
return candidates.find((candidate) => exists(path.join(candidate, 'index.json')))
|
|
664
|
+
|| candidates.find((candidate) => exists(candidate))
|
|
665
|
+
|| candidates[0]
|
|
666
|
+
|| path.join(entry.path, 'ui_info');
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
function hmosCaptureProjectRoot(entry) {
|
|
670
|
+
return path.resolve(entry.hmos_capture_project_dir || entry.path);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
function localProperty(root, key) {
|
|
674
|
+
const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
675
|
+
const raw = readText(path.join(root, 'local.properties')).match(new RegExp(`^${escaped}=(.+)$`, 'mi'))?.[1]?.trim();
|
|
676
|
+
return raw ? raw.replace(/\\:/g, ':').replace(/\\+/g, '\\') : '';
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
function listRecursively(root, predicate, maxDepth = 8, depth = 0, rows = []) {
|
|
680
|
+
if (!root || !exists(root) || depth > maxDepth) return rows;
|
|
681
|
+
let entries = [];
|
|
682
|
+
try { entries = fs.readdirSync(root, { withFileTypes: true }); } catch { return rows; }
|
|
683
|
+
for (const entry of entries) {
|
|
684
|
+
const file = path.join(root, entry.name);
|
|
685
|
+
if (entry.isDirectory()) listRecursively(file, predicate, maxDepth, depth + 1, rows);
|
|
686
|
+
else if (entry.isFile() && predicate(file)) rows.push(file);
|
|
687
|
+
}
|
|
688
|
+
return rows;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
function latestSignedHap(root, explicit = '') {
|
|
692
|
+
if (explicit) {
|
|
693
|
+
const selected = path.resolve(explicit);
|
|
694
|
+
if (!exists(selected)) throw new Error(`The explicitly specified HAP does not exist: ${selected}`);
|
|
695
|
+
if (!/\.hap$/i.test(selected)) throw new Error(`The explicitly specified file is not a HAP: ${selected}`);
|
|
696
|
+
if (/unsigned/i.test(path.basename(selected))) throw new Error(`The explicitly specified file is an unsigned HAP and cannot be used for device capture: ${selected}`);
|
|
697
|
+
return selected;
|
|
698
|
+
}
|
|
699
|
+
const candidates = listRecursively(root, (file) => (
|
|
700
|
+
/signed\.hap$/i.test(path.basename(file))
|
|
701
|
+
&& !/unsigned/i.test(path.basename(file))
|
|
702
|
+
&& (file.split(path.sep).some((part) => part.toLowerCase() === 'build') || file.includes(`${path.sep}.hometrans${path.sep}`))
|
|
703
|
+
), 10);
|
|
704
|
+
return candidates.sort((left, right) => fs.statSync(right).mtimeMs - fs.statSync(left).mtimeMs)[0] || '';
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
function json5String(file, key) {
|
|
708
|
+
const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
709
|
+
return readText(file).match(new RegExp(`(?:["']?${escaped}["']?)\\s*:\\s*["']([^"']+)["']`, 'i'))?.[1] || '';
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// JSON5 comment stripper (keeps string contents intact) so structural scans
|
|
713
|
+
// cannot be fooled by commented-out ability entries.
|
|
714
|
+
function stripJson5Comments(text) {
|
|
715
|
+
let out = '';
|
|
716
|
+
let quote = '';
|
|
717
|
+
let escaped = false;
|
|
718
|
+
let line = false;
|
|
719
|
+
let block = false;
|
|
720
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
721
|
+
const char = text[i];
|
|
722
|
+
const next = text[i + 1] || '';
|
|
723
|
+
if (line) { if (char === '\n') { line = false; out += char; } continue; }
|
|
724
|
+
if (block) { if (char === '*' && next === '/') { block = false; i += 1; } continue; }
|
|
725
|
+
if (quote) {
|
|
726
|
+
out += char;
|
|
727
|
+
if (escaped) escaped = false;
|
|
728
|
+
else if (char === '\\') escaped = true;
|
|
729
|
+
else if (char === quote) quote = '';
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
732
|
+
if (char === '/' && next === '/') { line = true; i += 1; continue; }
|
|
733
|
+
if (char === '/' && next === '*') { block = true; i += 1; continue; }
|
|
734
|
+
if (char === '"' || char === "'" || char === '`') { quote = char; out += char; continue; }
|
|
735
|
+
out += char;
|
|
736
|
+
}
|
|
737
|
+
return out;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// Slice the balanced block starting at openIndex, skipping brackets inside
|
|
741
|
+
// strings. Returns '' when unbalanced.
|
|
742
|
+
function balancedSlice(text, openIndex, openChar = '{', closeChar = '}') {
|
|
743
|
+
let depth = 0;
|
|
744
|
+
let quote = '';
|
|
745
|
+
let escaped = false;
|
|
746
|
+
for (let i = openIndex; i < text.length; i += 1) {
|
|
747
|
+
const char = text[i];
|
|
748
|
+
if (quote) {
|
|
749
|
+
if (escaped) escaped = false;
|
|
750
|
+
else if (char === '\\') escaped = true;
|
|
751
|
+
else if (char === quote) quote = '';
|
|
752
|
+
continue;
|
|
753
|
+
}
|
|
754
|
+
if (char === '"' || char === "'" || char === '`') { quote = char; continue; }
|
|
755
|
+
if (char === openChar) depth += 1;
|
|
756
|
+
else if (char === closeChar) {
|
|
757
|
+
depth -= 1;
|
|
758
|
+
if (depth === 0) return text.slice(openIndex, i + 1);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return '';
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// The ability's own `name`, read only at the object's top level so a nested
|
|
765
|
+
// metadata entry (e.g. { "name": "ohos.ability.shortcuts" }) written before it
|
|
766
|
+
// cannot win.
|
|
767
|
+
function topLevelAbilityName(objectText) {
|
|
768
|
+
let depth = 0;
|
|
769
|
+
let quote = '';
|
|
770
|
+
let escaped = false;
|
|
771
|
+
for (let i = 1; i < objectText.length - 1; i += 1) {
|
|
772
|
+
const char = objectText[i];
|
|
773
|
+
if (quote) {
|
|
774
|
+
if (escaped) escaped = false;
|
|
775
|
+
else if (char === '\\') escaped = true;
|
|
776
|
+
else if (char === quote) quote = '';
|
|
777
|
+
continue;
|
|
778
|
+
}
|
|
779
|
+
if (char === '"' || char === "'") {
|
|
780
|
+
let j = i + 1;
|
|
781
|
+
let value = '';
|
|
782
|
+
while (j < objectText.length && objectText[j] !== char) {
|
|
783
|
+
if (objectText[j] === '\\') j += 1;
|
|
784
|
+
value += objectText[j];
|
|
785
|
+
j += 1;
|
|
786
|
+
}
|
|
787
|
+
if (depth === 0 && /^name$/i.test(value.trim())) {
|
|
788
|
+
const match = objectText.slice(j + 1).match(/^\s*:\s*["']([^"']*)["']/);
|
|
789
|
+
if (match) return match[1];
|
|
790
|
+
}
|
|
791
|
+
i = j;
|
|
792
|
+
continue;
|
|
793
|
+
}
|
|
794
|
+
if (char === '{' || char === '[') depth += 1;
|
|
795
|
+
else if (char === '}' || char === ']') depth -= 1;
|
|
796
|
+
}
|
|
797
|
+
return '';
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function moduleAbilities(text) {
|
|
801
|
+
const clean = stripJson5Comments(text);
|
|
802
|
+
const start = clean.search(/["']abilities["']\s*:\s*\[/i);
|
|
803
|
+
if (start < 0) return [];
|
|
804
|
+
const open = clean.indexOf('[', start);
|
|
805
|
+
if (open < 0) return [];
|
|
806
|
+
const arrayText = balancedSlice(clean, open, '[', ']');
|
|
807
|
+
if (!arrayText) return [];
|
|
808
|
+
const abilities = [];
|
|
809
|
+
let cursor = 0;
|
|
810
|
+
while (cursor < arrayText.length) {
|
|
811
|
+
const brace = arrayText.indexOf('{', cursor);
|
|
812
|
+
if (brace < 0) break;
|
|
813
|
+
const body = balancedSlice(arrayText, brace, '{', '}');
|
|
814
|
+
if (!body) break;
|
|
815
|
+
cursor = brace + body.length;
|
|
816
|
+
abilities.push({
|
|
817
|
+
name: topLevelAbilityName(body),
|
|
818
|
+
// The launcher entry is the ability declaring the home entity, with the
|
|
819
|
+
// home action (older `action.system.home` / newer `ohos.want.action.home`).
|
|
820
|
+
home: /entity\.system\.home/i.test(body)
|
|
821
|
+
&& /(?:action\.system\.home|ohos\.want\.action\.home)/i.test(body),
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
return abilities;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// `aa start -a` needs the ability's own name from module.json5's abilities[]
|
|
828
|
+
// array, not the module-level mainElement string. Priority mirrors the
|
|
829
|
+
// launcher: home-skills ability → the one named by mainElement (when it really
|
|
830
|
+
// exists in the array) → the first ability → the caller's legacy fallback.
|
|
831
|
+
function json5AbilityName(file, mainElement = '') {
|
|
832
|
+
const text = readText(file);
|
|
833
|
+
if (!text) return '';
|
|
834
|
+
const abilities = moduleAbilities(text);
|
|
835
|
+
if (!abilities.length) return '';
|
|
836
|
+
const home = abilities.find((item) => item.name && item.home);
|
|
837
|
+
if (home) return home.name;
|
|
838
|
+
const wanted = String(mainElement || '').trim().toLowerCase();
|
|
839
|
+
const named = wanted ? abilities.find((item) => item.name && item.name.toLowerCase() === wanted) : null;
|
|
840
|
+
if (named) return named.name;
|
|
841
|
+
if (abilities[0]?.name) return abilities[0].name;
|
|
842
|
+
return '';
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
function hmosIdentity(root) {
|
|
846
|
+
const app = path.join(root, 'AppScope', 'app.json5');
|
|
847
|
+
const modules = listRecursively(root, (file) => path.basename(file).toLowerCase() === 'module.json5' && file.includes(`${path.sep}src${path.sep}main${path.sep}`), 6);
|
|
848
|
+
const entryModule = modules.find((file) => /(?:["']?type["']?\s*:\s*["']entry["'])/i.test(readText(file)))
|
|
849
|
+
|| modules.find((file) => json5String(file, 'mainElement'))
|
|
850
|
+
|| modules[0]
|
|
851
|
+
|| '';
|
|
852
|
+
return {
|
|
853
|
+
bundle: json5String(app, 'bundleName'),
|
|
854
|
+
ability: json5AbilityName(entryModule, json5String(entryModule, 'mainElement'))
|
|
855
|
+
|| json5String(entryModule, 'mainElement')
|
|
856
|
+
|| json5String(entryModule, 'name'),
|
|
857
|
+
moduleFile: entryModule,
|
|
858
|
+
moduleRoot: entryModule ? path.resolve(entryModule, '..', '..', '..') : '',
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
function hmosSdkFromEntry(entry) {
|
|
863
|
+
for (const root of [entry.hmos_capture_project_dir, entry.path].filter(Boolean)) {
|
|
864
|
+
const sdk = localProperty(root, 'hwsdk.dir') || localProperty(root, 'sdk.dir');
|
|
865
|
+
if (sdk) return sdk;
|
|
866
|
+
}
|
|
867
|
+
return '';
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
function balancedBlockEnd(text, start) {
|
|
871
|
+
let depth = 0;
|
|
872
|
+
let quote = '';
|
|
873
|
+
let escaped = false;
|
|
874
|
+
for (let index = start; index < text.length; index += 1) {
|
|
875
|
+
const char = text[index];
|
|
876
|
+
if (quote) {
|
|
877
|
+
if (escaped) escaped = false;
|
|
878
|
+
else if (char === '\\') escaped = true;
|
|
879
|
+
else if (char === quote) quote = '';
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
if (char === '"' || char === "'" || char === '`') { quote = char; continue; }
|
|
883
|
+
if (char === '{') depth += 1;
|
|
884
|
+
if (char === '}' && --depth === 0) return index;
|
|
885
|
+
}
|
|
886
|
+
return text.length - 1;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
function etsMethods(text) {
|
|
890
|
+
const methods = new Map();
|
|
891
|
+
const pattern = /(?:private\s+|public\s+|protected\s+)?([A-Za-z_$][\w$]*)\s*\([^)]*\)\s*(?::\s*[^\{]+)?\{/g;
|
|
892
|
+
let match;
|
|
893
|
+
while ((match = pattern.exec(text))) {
|
|
894
|
+
const open = text.indexOf('{', match.index + match[0].length - 1);
|
|
895
|
+
const end = balancedBlockEnd(text, open);
|
|
896
|
+
methods.set(match[1], { body: text.slice(open + 1, end), start: match.index, end });
|
|
897
|
+
pattern.lastIndex = end + 1;
|
|
898
|
+
}
|
|
899
|
+
return methods;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
function hmosPageFiles(root) {
|
|
903
|
+
const identity = hmosIdentity(root);
|
|
904
|
+
const moduleRoot = identity.moduleRoot || root;
|
|
905
|
+
return [
|
|
906
|
+
...listRecursively(path.join(moduleRoot, 'src', 'main', 'ets', 'pages'), (file) => /\.ets$/i.test(file), 6),
|
|
907
|
+
...listRecursively(path.join(moduleRoot, 'src', 'main', 'cangjie', 'pages'), (file) => /\.cj$/i.test(file), 6),
|
|
908
|
+
].sort();
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
function entryPageName(root) {
|
|
912
|
+
const pages = hmosPageFiles(root);
|
|
913
|
+
const entry = pages.find((file) => /@Entry\b/.test(readText(file)) && /\bbuild\s*\(/.test(readText(file)))
|
|
914
|
+
|| pages.find((file) => /\bbuild\s*\(/.test(readText(file)));
|
|
915
|
+
return entry ? path.basename(entry, path.extname(entry)) : '';
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
function captureBinding(entry, pageName, fallbackSequence) {
|
|
919
|
+
const bindings = entry.ui_page_bindings || {};
|
|
920
|
+
const pair = Object.entries(bindings).find(([key, value]) => (
|
|
921
|
+
normalizedPage(key) === normalizedPage(pageName)
|
|
922
|
+
|| normalizedPage(value?.component) === normalizedPage(pageName)
|
|
923
|
+
|| normalizedPage(value?.capture_name) === normalizedPage(pageName)
|
|
924
|
+
));
|
|
925
|
+
const value = pair?.[1] || {};
|
|
926
|
+
return {
|
|
927
|
+
sequence: Number(value.capture_seq) || fallbackSequence,
|
|
928
|
+
cacheName: value.capture_name || pageName,
|
|
929
|
+
clickPath: Array.isArray(value.capture_click_path) ? value.capture_click_path : null,
|
|
930
|
+
expectedVisible: Array.isArray(value.capture_expect_text) ? value.capture_expect_text : [],
|
|
931
|
+
forbiddenVisible: Array.isArray(value.capture_forbid_text) ? value.capture_forbid_text : [],
|
|
932
|
+
captureScroll: value.capture_scroll !== false,
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
function sourceStepKey(step) {
|
|
937
|
+
return String(step?.resource_id || step?.['resource-id'] || step?.text || step?.['content-desc'] || step?.element || '').trim().toLowerCase();
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
function sameSourcePath(left, right) {
|
|
941
|
+
if (left.length !== right.length) return false;
|
|
942
|
+
return left.every((step, index) => sourceStepKey(step) === sourceStepKey(right[index]));
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
function sourceStepSelector(step, parentState) {
|
|
946
|
+
const clickables = Array.isArray(parentState?.clickable_elements) ? parentState.clickable_elements : [];
|
|
947
|
+
const resourceId = String(step?.resource_id || step?.['resource-id'] || '').trim();
|
|
948
|
+
// The new-generation UTG explorer carries the tap label in the label field (the old crawler used text).
|
|
949
|
+
const text = String(step?.text || step?.label || '').trim();
|
|
950
|
+
const description = String(step?.content_desc || step?.['content-desc'] || '').trim();
|
|
951
|
+
const element = String(step?.element || '').trim();
|
|
952
|
+
let index = clickables.findIndex((candidate) => resourceId && String(candidate?.['resource-id'] || candidate?.resource_id || '').trim() === resourceId);
|
|
953
|
+
if (index < 0) index = clickables.findIndex((candidate) => text && String(candidate?.text || '').trim() === text);
|
|
954
|
+
if (index < 0) index = clickables.findIndex((candidate) => description && String(candidate?.['content-desc'] || candidate?.content_desc || '').trim() === description);
|
|
955
|
+
const resourceLabel = resourceId.split('/').pop()?.replace(/(?:button|btn)$/i, '').trim() || '';
|
|
956
|
+
// Prefer the semantic label before a shared resource id (for example every
|
|
957
|
+
// option in an Android single-choice dialog uses android:id/text1).
|
|
958
|
+
const texts = [...new Set([text, description, element, resourceLabel].filter(Boolean))];
|
|
959
|
+
const center = Array.isArray(step?.center) && step.center.length === 2 ? step.center.map(Number) : null;
|
|
960
|
+
// Record where the control sat on the SOURCE screen (normalized). Migrated
|
|
961
|
+
// HarmonyOS controls frequently lose their label (icon buttons carry no
|
|
962
|
+
// text/desc/id), so the normalized position is the geometry that survives
|
|
963
|
+
// wording changes and resolution differences for the positional fallback.
|
|
964
|
+
const screenHint = parentState?.device_info;
|
|
965
|
+
const screenWidth = Number(screenHint?.width_px ?? screenHint?.width);
|
|
966
|
+
const screenHeight = Number(screenHint?.height_px ?? screenHint?.height);
|
|
967
|
+
const relative = center && screenWidth > 0 && screenHeight > 0
|
|
968
|
+
? [center[0] / screenWidth, center[1] / screenHeight]
|
|
969
|
+
: null;
|
|
970
|
+
return {
|
|
971
|
+
...(texts[0] ? { text: texts[0], texts } : {}),
|
|
972
|
+
...(index >= 0 ? { ordinal: index + 1 } : {}),
|
|
973
|
+
...(center ? { center } : {}),
|
|
974
|
+
...(relative ? { relative } : {}),
|
|
975
|
+
...(step?.scroll_info ? { scrollInfo: step.scroll_info } : {}),
|
|
976
|
+
...((step?.['long-clickable'] || step?.long_clickable) ? { longClickable: true } : {}),
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// --- New-generation navigation (.hometrans/utg_static) -----------------------
|
|
981
|
+
// a2h-app-migrate keeps navigation in the UTG workspace instead of ui_info:
|
|
982
|
+
// click_paths.json : node id -> ordered steps (tap label / labels_alt / action)
|
|
983
|
+
// ui_elements.json : ui_info page key -> aliases (UTG node ids) + elements
|
|
984
|
+
// utg.json : nodes carry a slug matching the ui_info folder name
|
|
985
|
+
// The legacy convention (click_path inside ui_info/meta.json) stays untouched;
|
|
986
|
+
// this only fills the gap when a page has no legacy click_path.
|
|
987
|
+
function normalizedNavKey(value) {
|
|
988
|
+
return String(value || '').trim().toLowerCase().replace(/[-_]+/g, '_');
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
function utgNavigation(entry) {
|
|
992
|
+
const raw = entry.utg_static_dir;
|
|
993
|
+
const base = path.resolve(raw
|
|
994
|
+
? (path.isAbsolute(raw) ? raw : path.join(entry.path, raw))
|
|
995
|
+
: path.join(entry.path, '.hometrans', 'utg_static'));
|
|
996
|
+
const clickPaths = readJson(path.join(base, 'click_paths.json'));
|
|
997
|
+
if (!clickPaths || !clickPaths.paths || typeof clickPaths.paths !== 'object') return null;
|
|
998
|
+
const uiElements = readJson(path.join(base, 'ui_elements.json')) || {};
|
|
999
|
+
const utg = readJson(path.join(base, 'utg.json')) || {};
|
|
1000
|
+
const slugToNode = new Map();
|
|
1001
|
+
for (const node of (Array.isArray(utg.nodes) ? utg.nodes : [])) {
|
|
1002
|
+
if (node?.slug) slugToNode.set(String(node.slug).toLowerCase(), String(node.id));
|
|
1003
|
+
}
|
|
1004
|
+
const keyToNode = new Map();
|
|
1005
|
+
for (const [key, value] of Object.entries(uiElements.pages || {})) {
|
|
1006
|
+
const aliases = Array.isArray(value?.aliases) ? value.aliases : [];
|
|
1007
|
+
if (aliases.length) keyToNode.set(normalizedNavKey(key), String(aliases[0]));
|
|
1008
|
+
}
|
|
1009
|
+
return { clickPaths, slugToNode, keyToNode };
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
// Match a ui_info page to a UTG node: exact by folder slug / page key first,
|
|
1013
|
+
// then by the recorded ui_sequence label chain for crawler-named dynamic states
|
|
1014
|
+
// (dyn_NNN) that carry no static identity of their own.
|
|
1015
|
+
function utgNodeForPage(page, navigation, uiSequence) {
|
|
1016
|
+
if (!navigation) return '';
|
|
1017
|
+
const pageId = String(page?.page_id || '');
|
|
1018
|
+
const bySlug = navigation.slugToNode.get(pageId.toLowerCase());
|
|
1019
|
+
if (bySlug) return bySlug;
|
|
1020
|
+
const byKey = navigation.keyToNode.get(normalizedNavKey(pageId));
|
|
1021
|
+
if (byKey) return byKey;
|
|
1022
|
+
const clicks = String(uiSequence || '').split('→').map((token) => token.trim()).filter(Boolean).slice(1);
|
|
1023
|
+
if (!clicks.length) return '';
|
|
1024
|
+
let best = '';
|
|
1025
|
+
let bestScore = 0;
|
|
1026
|
+
for (const [nodeId, value] of Object.entries(navigation.clickPaths.paths)) {
|
|
1027
|
+
const labels = (Array.isArray(value?.labels) ? value.labels : []).map((label) => String(label).trim()).filter(Boolean);
|
|
1028
|
+
let score = 0;
|
|
1029
|
+
if (labels.length === clicks.length
|
|
1030
|
+
&& clicks.every((token) => labels.some((label) => label.toLowerCase() === token.toLowerCase()))) {
|
|
1031
|
+
score = 100 + labels.length;
|
|
1032
|
+
} else if (!labels.length && clicks.length === 1
|
|
1033
|
+
&& String(nodeId).split(':').pop().toLowerCase() === clicks[0].toLowerCase()) {
|
|
1034
|
+
// No-tap state: the crawler names the reached component in the sequence.
|
|
1035
|
+
score = 50;
|
|
1036
|
+
}
|
|
1037
|
+
if (score > bestScore) { bestScore = score; best = nodeId; }
|
|
1038
|
+
}
|
|
1039
|
+
return best;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
// Convert a click_paths node entry into the dashboard's click-step format,
|
|
1043
|
+
// keeping the tap chain only (launch / default / guarded branch steps are
|
|
1044
|
+
// navigation bookkeeping, not clicks). The UTG labels describe the ANDROID
|
|
1045
|
+
// app; the migrated HarmonyOS controls may carry no matching label, so each
|
|
1046
|
+
// step also gets the source capture's geometry (center / ordinal) as a
|
|
1047
|
+
// fallback — the same last-resort the legacy click_path steps carry.
|
|
1048
|
+
function utgClickSteps(pathEntry, labelIndex) {
|
|
1049
|
+
const steps = Array.isArray(pathEntry?.steps) ? pathEntry.steps : [];
|
|
1050
|
+
const labels = Array.isArray(pathEntry?.labels) ? pathEntry.labels : [];
|
|
1051
|
+
const labelsAlt = Array.isArray(pathEntry?.labels_alt) ? pathEntry.labels_alt : [];
|
|
1052
|
+
const lookupSource = (wanted) => {
|
|
1053
|
+
const needle = String(wanted || '').trim().toLowerCase();
|
|
1054
|
+
if (!needle || !labelIndex) return null;
|
|
1055
|
+
if (labelIndex.has(needle)) return labelIndex.get(needle);
|
|
1056
|
+
for (const [key, hit] of labelIndex) {
|
|
1057
|
+
if (key.includes(needle) || needle.includes(key)) return hit;
|
|
1058
|
+
}
|
|
1059
|
+
return null;
|
|
1060
|
+
};
|
|
1061
|
+
const result = [];
|
|
1062
|
+
let tapIndex = 0;
|
|
1063
|
+
for (const step of steps) {
|
|
1064
|
+
if (String(step?.action || '') !== 'tap') continue;
|
|
1065
|
+
const candidates = [step?.label, labels[tapIndex], labelsAlt[tapIndex]]
|
|
1066
|
+
.map((value) => String(value || '').trim()).filter(Boolean);
|
|
1067
|
+
const texts = [...new Set(candidates)];
|
|
1068
|
+
tapIndex += 1;
|
|
1069
|
+
if (!texts.length) continue;
|
|
1070
|
+
let center = null;
|
|
1071
|
+
let ordinal = 0;
|
|
1072
|
+
let relative = null;
|
|
1073
|
+
for (const candidate of texts) {
|
|
1074
|
+
const hit = lookupSource(candidate);
|
|
1075
|
+
if (!hit) continue;
|
|
1076
|
+
const rect = parseBoundsRect(hit.item?.bounds);
|
|
1077
|
+
if (rect) center = [Math.trunc((rect.x1 + rect.x2) / 2), Math.trunc((rect.y1 + rect.y2) / 2)];
|
|
1078
|
+
else if (Array.isArray(hit.item?.center) && hit.item.center.length === 2) center = hit.item.center.map(Number);
|
|
1079
|
+
ordinal = hit.index + 1;
|
|
1080
|
+
const hint = hit.state?.device_info;
|
|
1081
|
+
const screenWidth = Number(hint?.width_px ?? hint?.width);
|
|
1082
|
+
const screenHeight = Number(hint?.height_px ?? hint?.height);
|
|
1083
|
+
if (center && screenWidth > 0 && screenHeight > 0) {
|
|
1084
|
+
relative = [center[0] / screenWidth, center[1] / screenHeight];
|
|
1085
|
+
}
|
|
1086
|
+
break;
|
|
1087
|
+
}
|
|
1088
|
+
result.push({
|
|
1089
|
+
text: texts[0],
|
|
1090
|
+
texts,
|
|
1091
|
+
...(center ? { center } : {}),
|
|
1092
|
+
...(relative ? { relative } : {}),
|
|
1093
|
+
...(ordinal ? { ordinal } : {}),
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
return result;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
function sourceUiCapturePlan(entry, entryName) {
|
|
1100
|
+
const targetRoot = path.resolve(entry.path);
|
|
1101
|
+
const progress = [
|
|
1102
|
+
path.join(targetRoot, 'ui_info', 'batch_progress.json'),
|
|
1103
|
+
path.join(targetRoot, '.hometrans', 'ui_info', 'batch_progress.json'),
|
|
1104
|
+
].map(readJson).find((value) => value?.pages && typeof value.pages === 'object');
|
|
1105
|
+
const infoRoot = uiInfoRootFor(entry);
|
|
1106
|
+
let sourceIndex = readJson(path.join(infoRoot, 'index.json'));
|
|
1107
|
+
// Current captures carry pages.json (topological page list), not the legacy
|
|
1108
|
+
// index.json. Its folders are named by slug(node_id) — activity_*, fragment_*,
|
|
1109
|
+
// overlay_*, mode_*, route_*, dyn_NNN — not page_NNN_*, so accept any folder
|
|
1110
|
+
// carrying a meta.json and use pages.json's order as the sequence source.
|
|
1111
|
+
const crawlerPages = readJson(path.join(infoRoot, 'pages.json'));
|
|
1112
|
+
if (!Array.isArray(sourceIndex)) {
|
|
1113
|
+
sourceIndex = [];
|
|
1114
|
+
let items = [];
|
|
1115
|
+
try { items = fs.readdirSync(infoRoot, { withFileTypes: true }); } catch { items = []; }
|
|
1116
|
+
// Crawler's pages.json (if present) is the authoritative topo order; when
|
|
1117
|
+
// absent, fall back to the legacy page_NNN_* convention below.
|
|
1118
|
+
const orderedDirs = (Array.isArray(crawlerPages?.pages) ? crawlerPages.pages : [])
|
|
1119
|
+
.map((row) => path.basename(String(row?.page_dir || '')))
|
|
1120
|
+
.filter(Boolean);
|
|
1121
|
+
const dirSet = new Set(items.filter((item) => item.isDirectory()).map((item) => item.name));
|
|
1122
|
+
// Skip crawler internal dirs (_attempts, _dyn_tmp_*); only keep folders that
|
|
1123
|
+
// actually hold a meta.json.
|
|
1124
|
+
const seen = new Set();
|
|
1125
|
+
const collect = (dirName) => {
|
|
1126
|
+
if (!dirName || seen.has(dirName) || !dirSet.has(dirName)) return;
|
|
1127
|
+
seen.add(dirName);
|
|
1128
|
+
const meta = readJson(path.join(infoRoot, dirName, 'meta.json'));
|
|
1129
|
+
if (meta && typeof meta === 'object') sourceIndex.push({ page_id: dirName, ...meta });
|
|
1130
|
+
};
|
|
1131
|
+
orderedDirs.forEach(collect);
|
|
1132
|
+
if (!sourceIndex.length) {
|
|
1133
|
+
for (const item of items) {
|
|
1134
|
+
if (!item.isDirectory() || /^page_\d+_/i.test(item.name)) collect(item.name);
|
|
1135
|
+
else if (/^(?:activity|fragment|overlay|mode|route|dyn)_/i.test(item.name)) collect(item.name);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
// Sort by pages.json topo order when available; otherwise leave dir order.
|
|
1139
|
+
if (orderedDirs.length) {
|
|
1140
|
+
const rank = new Map(orderedDirs.map((dir, index) => [dir, index]));
|
|
1141
|
+
sourceIndex.sort((left, right) =>
|
|
1142
|
+
(rank.get(String(left?.page_id || '')) ?? Number.POSITIVE_INFINITY)
|
|
1143
|
+
- (rank.get(String(right?.page_id || '')) ?? Number.POSITIVE_INFINITY));
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
if (!sourceIndex.length) return [];
|
|
1147
|
+
const byId = new Map(sourceIndex.map((page) => [String(page?.page_id || '').toLowerCase(), page]));
|
|
1148
|
+
const taskIds = progress
|
|
1149
|
+
? Object.keys(progress.pages).filter((id) => byId.has(id.toLowerCase()))
|
|
1150
|
+
: sourceIndex.map((page) => String(page?.page_id || '')).filter(Boolean);
|
|
1151
|
+
if (!taskIds.length) return [];
|
|
1152
|
+
// Preserve sourceIndex order (pages.json topo order when present). Fall back
|
|
1153
|
+
// to a numeric prefix only for legacy page_NNN_* names.
|
|
1154
|
+
const orderRank = new Map(sourceIndex.map((page, index) => [String(page?.page_id || '').toLowerCase(), index]));
|
|
1155
|
+
taskIds.sort((left, right) =>
|
|
1156
|
+
(orderRank.get(left.toLowerCase()) ?? Number.POSITIVE_INFINITY)
|
|
1157
|
+
- (orderRank.get(right.toLowerCase()) ?? Number.POSITIVE_INFINITY)
|
|
1158
|
+
|| Number(left.match(/(\d+)/)?.[1] || 0) - Number(right.match(/(\d+)/)?.[1] || 0));
|
|
1159
|
+
const plan = [];
|
|
1160
|
+
// Lazy: load the UTG navigation workspace only when some page lacks the
|
|
1161
|
+
// legacy ui_info click_path (new-generation projects).
|
|
1162
|
+
let navigation = null;
|
|
1163
|
+
let navigationLoaded = false;
|
|
1164
|
+
const ensureNavigation = () => {
|
|
1165
|
+
if (!navigationLoaded) { navigation = utgNavigation(entry); navigationLoaded = true; }
|
|
1166
|
+
return navigation;
|
|
1167
|
+
};
|
|
1168
|
+
const uiSequenceByDir = new Map((Array.isArray(crawlerPages?.pages) ? crawlerPages.pages : [])
|
|
1169
|
+
.map((row) => [path.basename(String(row?.page_dir || '')), String(row?.ui_sequence || '')]));
|
|
1170
|
+
// Label -> source geometry across every captured page: a tap step happens on
|
|
1171
|
+
// some earlier state (the home page for "button settings", the settings page
|
|
1172
|
+
// for "Select language"), which can be a different ui_info capture than the
|
|
1173
|
+
// step's target page.
|
|
1174
|
+
const sourceLabelIndex = new Map();
|
|
1175
|
+
for (const page of sourceIndex) {
|
|
1176
|
+
for (const [index, item] of (Array.isArray(page.clickable_elements) ? page.clickable_elements : []).entries()) {
|
|
1177
|
+
for (const value of [item?.text, item?.['content-desc'], item?.['resource-id']]) {
|
|
1178
|
+
const key = String(value || '').trim().toLowerCase();
|
|
1179
|
+
if (key && !sourceLabelIndex.has(key)) sourceLabelIndex.set(key, { item, index, state: page });
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
for (const taskId of taskIds) {
|
|
1184
|
+
const sourcePage = byId.get(taskId.toLowerCase());
|
|
1185
|
+
const sourcePath = Array.isArray(sourcePage?.click_path) ? sourcePage.click_path : [];
|
|
1186
|
+
let clickPath = sourcePath.map((step, stepIndex) => {
|
|
1187
|
+
// The new-generation UTG explorer's click_path array starts with a launch bookkeeping step and carries
|
|
1188
|
+
// tap labels in the label field; the legacy mapping only consumes tap — bookkeeping steps are skipped
|
|
1189
|
+
// (old-format steps have no action field, behavior unchanged), otherwise they get mapped to empty step
|
|
1190
|
+
// objects and every real-device navigation step reports "tap target not found in the current state: undefined".
|
|
1191
|
+
if (step?.action && step.action !== 'tap') return null;
|
|
1192
|
+
const prefix = sourcePath.slice(0, stepIndex);
|
|
1193
|
+
const parentState = sourceIndex.find((page) => sameSourcePath(Array.isArray(page?.click_path) ? page.click_path : [], prefix));
|
|
1194
|
+
return sourceStepSelector(step, parentState);
|
|
1195
|
+
}).filter(Boolean);
|
|
1196
|
+
// A page resolved through the UTG workspace may live on a different ArkUI
|
|
1197
|
+
// page than the app entry (e.g. the Settings page hosting the dialogs), so
|
|
1198
|
+
// the entry-page name no longer identifies it. Identity is then left to the
|
|
1199
|
+
// bundle + structure gates. The legacy click_path path keeps its name gate.
|
|
1200
|
+
let viaUtg = false;
|
|
1201
|
+
// New-generation click_path pages have the same property: the migrated
|
|
1202
|
+
// landing page is routinely NOT the entry page (SubActivity → pages/SubPage.ets),
|
|
1203
|
+
// so the entry-name gate would misflag every correct capture as mismatched.
|
|
1204
|
+
const newGeneration = sourcePath.some((step) => step?.action);
|
|
1205
|
+
if (!clickPath.length) {
|
|
1206
|
+
const nav = ensureNavigation();
|
|
1207
|
+
const nodeId = utgNodeForPage(sourcePage, nav, uiSequenceByDir.get(String(sourcePage?.page_id || '')));
|
|
1208
|
+
const node = nodeId && nav ? nav.clickPaths.paths[nodeId] : null;
|
|
1209
|
+
if (node) { clickPath = utgClickSteps(node, sourceLabelIndex); viaUtg = true; }
|
|
1210
|
+
}
|
|
1211
|
+
const expectedVisible = clickPath.length
|
|
1212
|
+
? [...new Set((sourcePage?.clickable_elements || []).map((item) => String(item?.text || '').trim()).filter(Boolean))].slice(0, 6)
|
|
1213
|
+
: [];
|
|
1214
|
+
const sourceDir = path.join(infoRoot, String(sourcePage?.page_id || ''));
|
|
1215
|
+
const sourceXml = readText(path.join(sourceDir, 'view.xml'));
|
|
1216
|
+
const expectedStructure = normalizedStructure(sourcePage?.clickable_elements, sourceXml, sourcePage?.device_info);
|
|
1217
|
+
const expectedTexts = xmlTextCorpus(sourceXml, sourcePage?.clickable_elements);
|
|
1218
|
+
const sequence = Number(taskId.match(/page_(\d+)/i)?.[1])
|
|
1219
|
+
|| (orderRank.has(taskId.toLowerCase()) ? orderRank.get(taskId.toLowerCase()) + 1 : 0)
|
|
1220
|
+
|| plan.length + 1;
|
|
1221
|
+
plan.push({
|
|
1222
|
+
name: taskId,
|
|
1223
|
+
stateLabel: sourcePage?.label || sourcePage?.page_name || taskId,
|
|
1224
|
+
expectedNames: viaUtg || newGeneration ? [] : [entryName],
|
|
1225
|
+
sequence,
|
|
1226
|
+
cacheName: taskId,
|
|
1227
|
+
clickPath,
|
|
1228
|
+
expectedVisible,
|
|
1229
|
+
expectedStructure,
|
|
1230
|
+
expectedTexts,
|
|
1231
|
+
forbiddenVisible: [],
|
|
1232
|
+
captureScroll: Array.isArray(sourcePage?.screenshots) && sourcePage.screenshots.length > 1,
|
|
1233
|
+
taskId,
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
return plan;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
function localAndroidScreenshots(entry) {
|
|
1240
|
+
const infoRoot = uiInfoRootFor(entry);
|
|
1241
|
+
const plan = sourceUiCapturePlan(entry, path.basename(entry.path));
|
|
1242
|
+
if (!plan.length) return { complete: false, found: 0, planned: 0, root: infoRoot, missing: [] };
|
|
1243
|
+
const missing = [];
|
|
1244
|
+
let found = 0;
|
|
1245
|
+
for (const page of plan) {
|
|
1246
|
+
const pageDir = path.join(infoRoot, page.taskId || page.name);
|
|
1247
|
+
const validation = validateAndroidCapture(pageDir);
|
|
1248
|
+
if (validation.ok) found += 1;
|
|
1249
|
+
else missing.push({ page: page.taskId || page.name, reason: validation.reason });
|
|
1250
|
+
}
|
|
1251
|
+
return { complete: missing.length === 0, found, planned: plan.length, root: infoRoot, missing };
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
function arktsCapturePlan(entry) {
|
|
1255
|
+
const root = hmosCaptureProjectRoot(entry);
|
|
1256
|
+
const pageFiles = hmosPageFiles(root);
|
|
1257
|
+
const entryName = entryPageName(root);
|
|
1258
|
+
if (!Object.keys(entry.ui_page_bindings || {}).length) {
|
|
1259
|
+
const sourcePlan = sourceUiCapturePlan(entry, entryName);
|
|
1260
|
+
if (sourcePlan.length) return sourcePlan;
|
|
1261
|
+
}
|
|
1262
|
+
if (!entryName && !Object.keys(entry.ui_page_bindings || {}).length) return [];
|
|
1263
|
+
const entryFile = pageFiles.find((file) => path.basename(file, path.extname(file)) === entryName);
|
|
1264
|
+
const firstName = entryName || Object.keys(entry.ui_page_bindings || {})[0];
|
|
1265
|
+
const first = captureBinding(entry, firstName, 1);
|
|
1266
|
+
const plan = [{ name: firstName, expectedNames: [firstName], clickOrdinal: null, ...first }];
|
|
1267
|
+
if (entryFile && /\.cj$/i.test(entryFile)) {
|
|
1268
|
+
const planned = new Set(plan.map((item) => normalizedPage(item.name)));
|
|
1269
|
+
for (const [component, binding] of Object.entries(entry.ui_page_bindings || {})) {
|
|
1270
|
+
if (planned.has(normalizedPage(component)) || !Array.isArray(binding?.capture_click_path) || !binding.capture_click_path.length) continue;
|
|
1271
|
+
const bound = captureBinding(entry, component, plan.length + 1);
|
|
1272
|
+
plan.push({ name: component, stateLabel: binding.title || component, expectedNames: [binding.expected_page || firstName], ...bound });
|
|
1273
|
+
}
|
|
1274
|
+
return plan;
|
|
1275
|
+
}
|
|
1276
|
+
if (!entryFile) {
|
|
1277
|
+
const planned = new Set(plan.map((item) => normalizedPage(item.name)));
|
|
1278
|
+
for (const [component, binding] of Object.entries(entry.ui_page_bindings || {})) {
|
|
1279
|
+
if (planned.has(normalizedPage(component)) || !Array.isArray(binding?.capture_click_path) || !binding.capture_click_path.length) continue;
|
|
1280
|
+
const bound = captureBinding(entry, component, plan.length + 1);
|
|
1281
|
+
plan.push({ name: component, stateLabel: binding.title || component, expectedNames: [binding.expected_page || firstName], ...bound });
|
|
1282
|
+
}
|
|
1283
|
+
return plan;
|
|
1284
|
+
}
|
|
1285
|
+
const methods = etsMethods(readText(entryFile));
|
|
1286
|
+
const build = methods.get('build')?.body || '';
|
|
1287
|
+
for (const file of pageFiles) {
|
|
1288
|
+
const name = path.basename(file, path.extname(file));
|
|
1289
|
+
if (name === entryName || !/\bbuild\s*\(/.test(readText(file))) continue;
|
|
1290
|
+
let handler = '';
|
|
1291
|
+
for (const [methodName, method] of methods) {
|
|
1292
|
+
const routes = [...method.body.matchAll(/router\.(?:pushUrl|replaceUrl)\s*\([\s\S]*?url\s*:\s*["']pages\/([^"']+)["']/g)];
|
|
1293
|
+
if (routes.some((route) => normalizedPage(route[1]) === normalizedPage(name))) { handler = methodName; break; }
|
|
1294
|
+
}
|
|
1295
|
+
if (!handler) {
|
|
1296
|
+
plan.push({ name, error: `the entry page has no router path to pages/${name}`, ...captureBinding(entry, name, plan.length + 1) });
|
|
1297
|
+
continue;
|
|
1298
|
+
}
|
|
1299
|
+
const call = new RegExp(`\\bthis\\.${handler.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*\\(`).exec(build);
|
|
1300
|
+
const clickOrdinal = call ? [...build.slice(0, call.index).matchAll(/\.onClick\s*\(/g)].length : 0;
|
|
1301
|
+
plan.push({
|
|
1302
|
+
name,
|
|
1303
|
+
handler,
|
|
1304
|
+
clickOrdinal,
|
|
1305
|
+
error: clickOrdinal > 0 ? '' : `cannot determine the entry tap position for ${handler}`,
|
|
1306
|
+
expectedNames: [name],
|
|
1307
|
+
...captureBinding(entry, name, plan.length + 1),
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
const planned = new Set(plan.map((item) => normalizedPage(item.name)));
|
|
1311
|
+
for (const [component, binding] of Object.entries(entry.ui_page_bindings || {})) {
|
|
1312
|
+
if (planned.has(normalizedPage(component)) || !Array.isArray(binding?.capture_click_path) || !binding.capture_click_path.length) continue;
|
|
1313
|
+
const bound = captureBinding(entry, component, plan.length + 1);
|
|
1314
|
+
plan.push({
|
|
1315
|
+
name: component,
|
|
1316
|
+
stateLabel: binding.title || component,
|
|
1317
|
+
expectedNames: [binding.expected_page || entryName],
|
|
1318
|
+
clickPath: bound.clickPath,
|
|
1319
|
+
sequence: bound.sequence,
|
|
1320
|
+
cacheName: bound.cacheName,
|
|
1321
|
+
expectedVisible: bound.expectedVisible,
|
|
1322
|
+
forbiddenVisible: bound.forbiddenVisible,
|
|
1323
|
+
captureScroll: bound.captureScroll,
|
|
1324
|
+
});
|
|
1325
|
+
planned.add(normalizedPage(component));
|
|
1326
|
+
}
|
|
1327
|
+
return plan;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
// Positional fallback for click steps whose label did not survive migration
|
|
1331
|
+
// (icon buttons on HarmonyOS often carry no text/desc/id at all). The source
|
|
1332
|
+
// control's normalized position is matched against the live capture's
|
|
1333
|
+
// clickables, also normalized — so resolution differences and small layout
|
|
1334
|
+
// shifts are absorbed. Full-screen hit-test containers are excluded: their
|
|
1335
|
+
// centers sit near the middle of the screen and would shadow real controls.
|
|
1336
|
+
const POSITIONAL_MAX_DISTANCE = 0.15;
|
|
1337
|
+
|
|
1338
|
+
function positionalClickCoordinate(metaFile, step) {
|
|
1339
|
+
const relative = Array.isArray(step?.relative) && step.relative.length === 2
|
|
1340
|
+
? step.relative.map(Number) : null;
|
|
1341
|
+
if (!relative || !Number.isFinite(relative[0]) || !Number.isFinite(relative[1])) return null;
|
|
1342
|
+
const meta = readJson(metaFile) || {};
|
|
1343
|
+
const clickables = Array.isArray(meta.clickable_elements) ? meta.clickable_elements : [];
|
|
1344
|
+
const screenHint = meta.device_info;
|
|
1345
|
+
const hintWidth = Number(screenHint?.width_px ?? screenHint?.width);
|
|
1346
|
+
const hintHeight = Number(screenHint?.height_px ?? screenHint?.height);
|
|
1347
|
+
const screen = hintWidth > 0 && hintHeight > 0
|
|
1348
|
+
? { width: hintWidth, height: hintHeight }
|
|
1349
|
+
: screenBoundsFromXml(readText(path.join(path.dirname(metaFile), 'view.xml')));
|
|
1350
|
+
if (!screen) return null;
|
|
1351
|
+
const screenArea = screen.width * screen.height;
|
|
1352
|
+
let best = null;
|
|
1353
|
+
let bestDistance = POSITIONAL_MAX_DISTANCE;
|
|
1354
|
+
for (const candidate of clickables) {
|
|
1355
|
+
const center = Array.isArray(candidate?.center) && candidate.center.length === 2
|
|
1356
|
+
? candidate.center.map(Number) : null;
|
|
1357
|
+
if (!center || center.some((value) => !Number.isFinite(value))) continue;
|
|
1358
|
+
const rect = parseBoundsRect(candidate.bounds);
|
|
1359
|
+
if (rect && screenArea > 0 && (rect.x2 - rect.x1) * (rect.y2 - rect.y1) > screenArea * 0.5) continue;
|
|
1360
|
+
const distance = Math.hypot(center[0] / screen.width - relative[0], center[1] / screen.height - relative[1]);
|
|
1361
|
+
if (distance < bestDistance) {
|
|
1362
|
+
bestDistance = distance;
|
|
1363
|
+
best = center;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
return best;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
function clickCoordinate(metaFile, step, options = {}) {
|
|
1370
|
+
const clickable = readJson(metaFile)?.clickable_elements || [];
|
|
1371
|
+
if (step && typeof step === 'object') {
|
|
1372
|
+
const requestedValues = [...new Set([
|
|
1373
|
+
step.text,
|
|
1374
|
+
step.label,
|
|
1375
|
+
...(Array.isArray(step.texts) ? step.texts : []),
|
|
1376
|
+
].map((value) => String(value || '').trim().toLowerCase()).filter(Boolean))];
|
|
1377
|
+
for (const requested of requestedValues) {
|
|
1378
|
+
const values = (candidate) => [candidate.text, candidate['content-desc'], candidate['resource-id']]
|
|
1379
|
+
.map((value) => String(value || '').trim().toLowerCase())
|
|
1380
|
+
.filter(Boolean);
|
|
1381
|
+
// Match an exact label first. Python's quick-capture helper also
|
|
1382
|
+
// accepts a contained keyword (for translated/annotated labels), so use
|
|
1383
|
+
// that only when no exact live-tree label exists.
|
|
1384
|
+
const item = clickable.find((candidate) => values(candidate).includes(requested))
|
|
1385
|
+
|| clickable.find((candidate) => values(candidate).some((value) => value.includes(requested)));
|
|
1386
|
+
if (Array.isArray(item?.center) && item.center.length === 2) return item.center.map(Number);
|
|
1387
|
+
// HDC frequently puts the visible label on a non-clickable Text child
|
|
1388
|
+
// while the surrounding Row owns the click action. Resolve that label
|
|
1389
|
+
// back to its nearest clickable ancestor, matching the Python navigator.
|
|
1390
|
+
const xml = readText(path.join(path.dirname(metaFile), 'view.xml'));
|
|
1391
|
+
const stack = [];
|
|
1392
|
+
const tagPattern = /<node\b([^>]*?)(\/?)>|<\/node\s*>/gi;
|
|
1393
|
+
let tag;
|
|
1394
|
+
while ((tag = tagPattern.exec(xml))) {
|
|
1395
|
+
if (tag[0].startsWith('</')) { stack.pop(); continue; }
|
|
1396
|
+
const attrs = xmlAttributes(tag[1]);
|
|
1397
|
+
const labels = [attrs.text, attrs['content-desc'], attrs['resource-id']]
|
|
1398
|
+
.map((value) => String(value || '').trim().toLowerCase()).filter(Boolean);
|
|
1399
|
+
const current = { attrs };
|
|
1400
|
+
stack.push(current);
|
|
1401
|
+
if (labels.includes(requested) || labels.some((value) => value.includes(requested))) {
|
|
1402
|
+
const owner = [...stack].reverse().find((node) => (
|
|
1403
|
+
[node.attrs.clickable, node.attrs['long-clickable'], node.attrs.checkable].some(truthyXml)
|
|
1404
|
+
));
|
|
1405
|
+
const bounds = String(owner?.attrs.bounds || '').match(/\[(-?\d+),(-?\d+)\]\[(-?\d+),(-?\d+)\]/);
|
|
1406
|
+
if (bounds) {
|
|
1407
|
+
const [, x1, y1, x2, y2] = bounds.map(Number);
|
|
1408
|
+
return [Math.trunc((x1 + x2) / 2), Math.trunc((y1 + y2) / 2)];
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
if (tag[2] === '/') stack.pop();
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
if (options.requireLiveLabel) return null;
|
|
1415
|
+
// Semantic ladder, position before raw geometry: the label survived →
|
|
1416
|
+
// click the live twin; otherwise the normalized source position picks the
|
|
1417
|
+
// nearest live clickable; only then fall back to the raw Android center
|
|
1418
|
+
// (wrong once the resolution differs) and the recorded ordinal.
|
|
1419
|
+
const positional = positionalClickCoordinate(metaFile, step);
|
|
1420
|
+
if (positional) return positional;
|
|
1421
|
+
const fallback = Array.isArray(step.center) && step.center.length === 2 ? step.center.map(Number) : null;
|
|
1422
|
+
step = Number(step.ordinal);
|
|
1423
|
+
if ((!Number.isInteger(step) || step < 1 || step > clickable.length) && fallback) return fallback;
|
|
1424
|
+
}
|
|
1425
|
+
const ordinal = Number(step);
|
|
1426
|
+
if (!Number.isInteger(ordinal) || ordinal < 1 || ordinal > clickable.length) return null;
|
|
1427
|
+
const center = clickable[ordinal - 1]?.center;
|
|
1428
|
+
return Array.isArray(center) && center.length === 2 ? center.map(Number) : null;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
function permissionAllowCoordinate(metaFile) {
|
|
1432
|
+
// the system dialog is in the device's language, whatever the build language
|
|
1433
|
+
const labels = [
|
|
1434
|
+
'本次使用时允许',
|
|
1435
|
+
'仅在使用时允许',
|
|
1436
|
+
'使用应用时允许',
|
|
1437
|
+
'本次使用允许',
|
|
1438
|
+
'使用时允许',
|
|
1439
|
+
'始终允许',
|
|
1440
|
+
'允许',
|
|
1441
|
+
'while using the app',
|
|
1442
|
+
'allow only while using the app',
|
|
1443
|
+
'only this time',
|
|
1444
|
+
'always allow',
|
|
1445
|
+
'allow',
|
|
1446
|
+
];
|
|
1447
|
+
for (const text of labels) {
|
|
1448
|
+
const coordinate = clickCoordinate(metaFile, { text });
|
|
1449
|
+
if (coordinate) return coordinate;
|
|
1450
|
+
}
|
|
1451
|
+
return null;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
function isPermissionCapture(dir) {
|
|
1455
|
+
const meta = readJson(path.join(dir, 'meta.json')) || {};
|
|
1456
|
+
const xml = readText(path.join(dir, 'view.xml'));
|
|
1457
|
+
return normalizedPage(meta.page_name) === 'permissiongrantdialog'
|
|
1458
|
+
|| /permission_dialog_vertical_button/i.test(xml)
|
|
1459
|
+
|| /while using the app|allow only while using the app|only this time|allow(?: access)?/i.test(xml);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
function toolEnvironment(executable, env = process.env) {
|
|
1463
|
+
const folder = path.dirname(executable);
|
|
1464
|
+
// Windows env blocks may store the variable as "Path"; Node's process.env
|
|
1465
|
+
// bridges both spellings, but a spread copy does not. Read either spelling
|
|
1466
|
+
// and emit a single canonical PATH so child spawns can resolve executables.
|
|
1467
|
+
const base = envPathValue(env);
|
|
1468
|
+
const merged = { ...env, PATH: `${folder}${path.delimiter}${base}` };
|
|
1469
|
+
delete merged.Path;
|
|
1470
|
+
return merged;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
function hdcTargetArgs(target) {
|
|
1474
|
+
return target ? ['-t', target] : [];
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
function selectTarget(platform, targets, entry = {}) {
|
|
1478
|
+
const configured = String(entry.hmos_device || '').trim();
|
|
1479
|
+
if (configured) {
|
|
1480
|
+
if (!targets.includes(configured)) throw new Error(`Configured ${platform} device ${configured} is not connected; available: ${targets.join(', ') || 'none'}`);
|
|
1481
|
+
return configured;
|
|
1482
|
+
}
|
|
1483
|
+
return targets[0] || '';
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
function validateAndroidCapture(dir, expectedPackage = '', options = {}) {
|
|
1487
|
+
const metaFile = path.join(dir, 'meta.json');
|
|
1488
|
+
const meta = readJson(metaFile);
|
|
1489
|
+
const screenshot = screenshotIn(dir, false);
|
|
1490
|
+
const xmlFile = path.join(dir, 'view.xml');
|
|
1491
|
+
if (!meta || !exists(xmlFile) || !screenshot) return { ok: false, reason: "meta.json, view.xml, or the screenshot file is missing" };
|
|
1492
|
+
if (expectedPackage) {
|
|
1493
|
+
const evidence = `${JSON.stringify(meta.activity_info || {})}\n${readText(xmlFile)}`.toLowerCase();
|
|
1494
|
+
if (!evidence.includes(String(expectedPackage).toLowerCase())) {
|
|
1495
|
+
return { ok: false, reason: `The foreground page does not belong to ${expectedPackage}` };
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
if (options.mustDifferFromMeta && !captureStateChanged(options.mustDifferFromMeta, metaFile)) {
|
|
1499
|
+
return { ok: false, reason: "The page structure did not change after the tap; the target page or dialog did not actually open" };
|
|
1500
|
+
}
|
|
1501
|
+
return { ok: true, screenshot };
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
async function runHdc(executable, args, context, timeoutMs = 30_000) {
|
|
1505
|
+
const result = await context.runner(executable, [...hdcTargetArgs(context.device), ...args], { cwd: context.cwd, timeoutMs, env: context.env });
|
|
1506
|
+
if (result.code !== 0) throw new Error(commandFailure(result, `hdc ${args.join(' ')} failed`));
|
|
1507
|
+
return result;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
async function launchHmosAbility(entry, identity, context) {
|
|
1511
|
+
const projectRoot = hmosCaptureProjectRoot(entry);
|
|
1512
|
+
// `aa force-stop` is best-effort: a first install or platform version can
|
|
1513
|
+
// report a non-zero code even though the following cold start is valid.
|
|
1514
|
+
// The start command itself remains a strict, receipt-validated gate.
|
|
1515
|
+
await context.runner(context.executable, [...hdcTargetArgs(context.device), 'shell', 'aa', 'force-stop', identity.bundle], {
|
|
1516
|
+
cwd: projectRoot, timeoutMs: 15_000, env: context.env,
|
|
1517
|
+
});
|
|
1518
|
+
const result = await runHdc(context.executable, ['shell', 'aa', 'start', '-a', identity.ability, '-b', identity.bundle], { ...context, cwd: projectRoot });
|
|
1519
|
+
const output = `${result.stdout || ''}\n${result.stderr || ''}`;
|
|
1520
|
+
if (!/start ability successfully/i.test(output)) {
|
|
1521
|
+
throw new Error(`aa start returned no standard success receipt: ${output.trim().slice(-400) || 'no output'}`);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
async function captureHdcState(captureRoot, outputDir, projectRoot, context, maxScrolls = 0, attempts = 3) {
|
|
1526
|
+
const limit = Math.max(1, Number(attempts) || 1);
|
|
1527
|
+
let result = { code: null, stdout: '', stderr: '' };
|
|
1528
|
+
for (let attempt = 1; attempt <= limit; attempt += 1) {
|
|
1529
|
+
if (exists(outputDir)) removeGeneratedDir(captureRoot, outputDir);
|
|
1530
|
+
result = await context.runner(NODE, [
|
|
1531
|
+
PAGE_CAPTURE_SCRIPT, '--device', 'hdc', '--serial', context.device,
|
|
1532
|
+
'-o', outputDir, '--max-scrolls', String(maxScrolls),
|
|
1533
|
+
], { cwd: projectRoot, timeoutMs: context.timeoutMs || 90_000, env: context.env });
|
|
1534
|
+
if (result.code === 0 && exists(path.join(outputDir, 'meta.json'))) {
|
|
1535
|
+
return { ok: true, result, attempts: attempt };
|
|
1536
|
+
}
|
|
1537
|
+
if (exists(outputDir)) removeGeneratedDir(captureRoot, outputDir);
|
|
1538
|
+
if (attempt < limit) await new Promise((resolve) => setTimeout(resolve, 600 * attempt));
|
|
1539
|
+
}
|
|
1540
|
+
return { ok: false, result, attempts: limit };
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
async function captureHmosEntry(entry, context) {
|
|
1544
|
+
const projectRoot = hmosCaptureProjectRoot(entry);
|
|
1545
|
+
const hap = latestSignedHap(projectRoot, entry.hmos_hap);
|
|
1546
|
+
if (!hap) throw new Error('No installable *-signed.hap found (unsigned HAPs are not used for device capture)');
|
|
1547
|
+
const identity = hmosIdentity(projectRoot);
|
|
1548
|
+
if (!identity.bundle || !identity.ability) throw new Error('Cannot determine bundleName or mainElement from app.json5/module.json5');
|
|
1549
|
+
if (!exists(PAGE_CAPTURE_SCRIPT)) throw new Error(`HDC page capture script not found: ${PAGE_CAPTURE_SCRIPT}`);
|
|
1550
|
+
const captureRoot = captureRootFor(entry);
|
|
1551
|
+
fs.mkdirSync(captureRoot, { recursive: true });
|
|
1552
|
+
const fullPlan = arktsCapturePlan(entry);
|
|
1553
|
+
const requestedSequences = new Set((Array.isArray(entry.hmos_capture_sequences) ? entry.hmos_capture_sequences : [])
|
|
1554
|
+
.map(Number).filter((value) => Number.isInteger(value) && value > 0));
|
|
1555
|
+
const plan = requestedSequences.size
|
|
1556
|
+
? fullPlan.filter((page) => requestedSequences.has(Number(page.sequence)))
|
|
1557
|
+
: fullPlan;
|
|
1558
|
+
if (!plan.length) throw new Error('No ArkTS page was discovered in the entry module; configure ui_page_bindings for explicit capture navigation');
|
|
1559
|
+
// Skip reinstall when the same bundleName is already installed — preserves the skip state of first-run
|
|
1560
|
+
// onboarding pages, so apps with a privacy-consent page (like CoolMall) don't get stuck on it every capture.
|
|
1561
|
+
// A changed HAP (code update) still forces reinstall — the HAP path's mtime is compared with the device install time.
|
|
1562
|
+
const hdcList = await context.runner(context.executable, [...hdcTargetArgs(context.device), 'shell', 'bm', 'dump', '-a'], {
|
|
1563
|
+
cwd: projectRoot, timeoutMs: 30_000, env: context.env,
|
|
1564
|
+
});
|
|
1565
|
+
const listOutput = `${hdcList.stdout || ''}\n${hdcList.stderr || ''}`;
|
|
1566
|
+
const alreadyInstalled = listOutput.includes(identity.bundle);
|
|
1567
|
+
if (!alreadyInstalled) {
|
|
1568
|
+
const install = await context.runner(context.executable, [...hdcTargetArgs(context.device), 'install', '-r', hap], { cwd: projectRoot, timeoutMs: 90_000, env: context.env });
|
|
1569
|
+
const installOutput = `${install.stdout || ''}\n${install.stderr || ''}`;
|
|
1570
|
+
if (install.code !== 0 && !/successfully/i.test(installOutput)) throw new Error(`HAP install failed: ${commandFailure(install, 'unknown error')}`);
|
|
1571
|
+
}
|
|
1572
|
+
let captured = 0;
|
|
1573
|
+
let entryMeta = '';
|
|
1574
|
+
const errors = [];
|
|
1575
|
+
const warnings = [];
|
|
1576
|
+
const captureAttempts = Math.max(1, Number(entry.hmos_capture_attempts) || 3);
|
|
1577
|
+
const captureTimeoutMs = Number(entry.hmos_capture_timeout_ms) || 90_000;
|
|
1578
|
+
const stateRetryLimit = Math.max(0, Number(entry.hmos_state_retry_limit) || 2);
|
|
1579
|
+
const captureContext = { ...context, timeoutMs: captureTimeoutMs };
|
|
1580
|
+
for (const page of plan) {
|
|
1581
|
+
if (page.error) { errors.push(`${page.name}: ${page.error}`); continue; }
|
|
1582
|
+
const pendingDir = path.join(captureRoot, `.pending_hmos_${page.sequence}_${safeName(page.cacheName)}_${process.pid}`);
|
|
1583
|
+
const finalDir = path.join(captureRoot, `hmos_page_${page.sequence}_${safeName(page.cacheName)}`);
|
|
1584
|
+
const cachedMeta = path.join(finalDir, 'meta.json');
|
|
1585
|
+
if (exists(pendingDir)) removeGeneratedDir(captureRoot, pendingDir);
|
|
1586
|
+
await launchHmosAbility(entry, identity, context);
|
|
1587
|
+
// A live weather page can still be replacing its startup/loading layer at
|
|
1588
|
+
// 1.5s. Clicking during that transition is accepted by `uiInput` but is
|
|
1589
|
+
// discarded by ArkUI, which previously saved the unchanged home page as a
|
|
1590
|
+
// secondary state. Match the stable manual/Android capture settle window.
|
|
1591
|
+
await new Promise((resolve) => setTimeout(resolve, Number(entry.capture_launch_wait_ms) || 4_000));
|
|
1592
|
+
const clickPath = page.clickPath || (page.clickOrdinal ? [page.clickOrdinal] : []);
|
|
1593
|
+
let currentMeta = entryMeta;
|
|
1594
|
+
let navigationFailed = false;
|
|
1595
|
+
const traversed = [];
|
|
1596
|
+
if (clickPath.length) {
|
|
1597
|
+
const rootStateDir = path.join(captureRoot, `.pending_navigation_${process.pid}_${page.sequence}_root`);
|
|
1598
|
+
if (exists(rootStateDir)) removeGeneratedDir(captureRoot, rootStateDir);
|
|
1599
|
+
let rootCapture = await captureHdcState(captureRoot, rootStateDir, projectRoot, captureContext, 0, captureAttempts);
|
|
1600
|
+
let rootState = rootCapture.result;
|
|
1601
|
+
if (!rootCapture.ok) {
|
|
1602
|
+
errors.push(`${page.name}: still cannot capture the navigation start page after ${rootCapture.attempts} first-round retries`);
|
|
1603
|
+
navigationFailed = true;
|
|
1604
|
+
} else {
|
|
1605
|
+
enrichCaptureMeta(rootStateDir);
|
|
1606
|
+
currentMeta = path.join(rootStateDir, 'meta.json');
|
|
1607
|
+
}
|
|
1608
|
+
// A newly installed app can present multiple permission sheets one
|
|
1609
|
+
// after another. Drain every sheet before resolving an ordinal click;
|
|
1610
|
+
// otherwise "first clickable" refers to the system dialog instead of
|
|
1611
|
+
// the app's search/settings button and the exposed home page is falsely
|
|
1612
|
+
// recorded as the requested secondary state.
|
|
1613
|
+
let rootPermissionAttempts = 0;
|
|
1614
|
+
while (!navigationFailed && isPermissionCapture(rootStateDir) && rootPermissionAttempts < 4) {
|
|
1615
|
+
const permissionCenter = permissionAllowCoordinate(currentMeta);
|
|
1616
|
+
if (!permissionCenter) {
|
|
1617
|
+
errors.push(`${page.name}: a system permission dialog was detected before navigation, but no allow button was found`);
|
|
1618
|
+
navigationFailed = true;
|
|
1619
|
+
break;
|
|
1620
|
+
}
|
|
1621
|
+
await runHdc(context.executable, ['shell', 'uitest', 'uiInput', 'click', String(permissionCenter[0]), String(permissionCenter[1])], { ...context, cwd: projectRoot });
|
|
1622
|
+
removeGeneratedDir(captureRoot, rootStateDir);
|
|
1623
|
+
await new Promise((resolve) => setTimeout(resolve, 1_500));
|
|
1624
|
+
rootCapture = await captureHdcState(captureRoot, rootStateDir, projectRoot, captureContext, 0, captureAttempts);
|
|
1625
|
+
rootState = rootCapture.result;
|
|
1626
|
+
if (!rootCapture.ok) {
|
|
1627
|
+
errors.push(`${page.name}: after handling the system permission dialog, still cannot recapture the navigation start after ${rootCapture.attempts} first-round retries`);
|
|
1628
|
+
navigationFailed = true;
|
|
1629
|
+
break;
|
|
1630
|
+
}
|
|
1631
|
+
enrichCaptureMeta(rootStateDir);
|
|
1632
|
+
currentMeta = path.join(rootStateDir, 'meta.json');
|
|
1633
|
+
rootPermissionAttempts += 1;
|
|
1634
|
+
}
|
|
1635
|
+
if (!navigationFailed && isPermissionCapture(rootStateDir)) {
|
|
1636
|
+
errors.push(`${page.name}: still a system permission dialog after ${rootPermissionAttempts} consecutive attempts`);
|
|
1637
|
+
navigationFailed = true;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
if (navigationFailed) continue;
|
|
1641
|
+
for (let stepIndex = 0; stepIndex < clickPath.length; stepIndex += 1) {
|
|
1642
|
+
const step = clickPath[stepIndex];
|
|
1643
|
+
const click = clickCoordinate(currentMeta, step);
|
|
1644
|
+
if (!click) {
|
|
1645
|
+
const stepLabel = typeof step === 'object' ? (step.text || step.label || step.ordinal) : step;
|
|
1646
|
+
errors.push(`${page.name}: tap target not found in the current state: ${stepLabel}`);
|
|
1647
|
+
navigationFailed = true;
|
|
1648
|
+
break;
|
|
1649
|
+
}
|
|
1650
|
+
await runHdc(context.executable, ['shell', 'uitest', 'uiInput', 'click', String(click[0]), String(click[1])], { ...context, cwd: projectRoot });
|
|
1651
|
+
await new Promise((resolve) => setTimeout(resolve, Number(entry.capture_navigation_wait_ms) || 1_200));
|
|
1652
|
+
traversed.push(step);
|
|
1653
|
+
if (stepIndex < clickPath.length - 1) {
|
|
1654
|
+
const navigationDir = path.join(captureRoot, `.pending_navigation_${process.pid}_${page.sequence}_${stepIndex}`);
|
|
1655
|
+
if (exists(navigationDir)) removeGeneratedDir(captureRoot, navigationDir);
|
|
1656
|
+
let navigationCapture = await captureHdcState(captureRoot, navigationDir, projectRoot, captureContext, 0, captureAttempts);
|
|
1657
|
+
if (!navigationCapture.ok) {
|
|
1658
|
+
errors.push(`${page.name}: intermediate navigation state capture still failed after ${navigationCapture.attempts} first-round retries`);
|
|
1659
|
+
navigationFailed = true;
|
|
1660
|
+
break;
|
|
1661
|
+
}
|
|
1662
|
+
enrichCaptureMeta(navigationDir);
|
|
1663
|
+
const nextStep = clickPath[stepIndex + 1];
|
|
1664
|
+
let nextMeta = path.join(navigationDir, 'meta.json');
|
|
1665
|
+
let transitionRetries = 0;
|
|
1666
|
+
// A successful dump only proves that *some* state was captured. It
|
|
1667
|
+
// does not prove the preceding click opened the requested layer. Do
|
|
1668
|
+
// not advance to Android fallback coordinates until the next live
|
|
1669
|
+
// HarmonyOS click target is actually visible.
|
|
1670
|
+
while (!clickCoordinate(nextMeta, nextStep, { requireLiveLabel: true }) && transitionRetries < stateRetryLimit) {
|
|
1671
|
+
transitionRetries += 1;
|
|
1672
|
+
await runHdc(context.executable, ['shell', 'uitest', 'uiInput', 'click', String(click[0]), String(click[1])], { ...context, cwd: projectRoot });
|
|
1673
|
+
await new Promise((resolve) => setTimeout(resolve, (Number(entry.capture_navigation_wait_ms) || 1_200) + transitionRetries * 600));
|
|
1674
|
+
navigationCapture = await captureHdcState(captureRoot, navigationDir, projectRoot, captureContext, 0, captureAttempts);
|
|
1675
|
+
if (!navigationCapture.ok) break;
|
|
1676
|
+
enrichCaptureMeta(navigationDir);
|
|
1677
|
+
nextMeta = path.join(navigationDir, 'meta.json');
|
|
1678
|
+
}
|
|
1679
|
+
if (!navigationCapture.ok) {
|
|
1680
|
+
const nextLabel = typeof nextStep === 'object' ? (nextStep.text || nextStep.label || nextStep.ordinal) : nextStep;
|
|
1681
|
+
errors.push(`${page.name}: capturing the intermediate state after tap step ${stepIndex + 1} failed; next target is ${nextLabel}`);
|
|
1682
|
+
navigationFailed = true;
|
|
1683
|
+
break;
|
|
1684
|
+
}
|
|
1685
|
+
currentMeta = nextMeta;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
if (navigationFailed) continue;
|
|
1689
|
+
// Stability precheck: after a click path, wait until two consecutive
|
|
1690
|
+
// layout dumps are identical before the final screenshot, so a
|
|
1691
|
+
// still-closing dialog or mid-transition layer is not frozen into the
|
|
1692
|
+
// capture. A timeout here is not an error — the structure validation
|
|
1693
|
+
// remains the acceptance gate.
|
|
1694
|
+
if (clickPath.length) {
|
|
1695
|
+
const stabilityDir = path.join(captureRoot, `.pending_stability_${page.sequence}_${process.pid}`);
|
|
1696
|
+
if (exists(stabilityDir)) removeGeneratedDir(captureRoot, stabilityDir);
|
|
1697
|
+
await context.runner(NODE, [
|
|
1698
|
+
PAGE_CAPTURE_SCRIPT, '--device', 'hdc', '--serial', context.device,
|
|
1699
|
+
'-o', stabilityDir, '--stability-only',
|
|
1700
|
+
], { cwd: projectRoot, timeoutMs: 60_000, env: context.env });
|
|
1701
|
+
if (exists(stabilityDir)) removeGeneratedDir(captureRoot, stabilityDir);
|
|
1702
|
+
}
|
|
1703
|
+
const maxScrolls = page.captureScroll === false ? 0 : (Number(entry.capture_max_scrolls) || 10);
|
|
1704
|
+
let pageCapture = await captureHdcState(captureRoot, pendingDir, projectRoot, captureContext, maxScrolls, captureAttempts);
|
|
1705
|
+
let result = pageCapture.result;
|
|
1706
|
+
if (!pageCapture.ok) {
|
|
1707
|
+
errors.push(`${page.name}: screenshot still failed after ${pageCapture.attempts} first-round retries: ${commandFailure(result, 'screenshot command failed')}`);
|
|
1708
|
+
// A long-scroll frame can fail after a valid entry capture was already
|
|
1709
|
+
// promoted by a previous attempt. Keep navigation independent: reuse
|
|
1710
|
+
// that validated entry geometry so one flaky frame does not suppress
|
|
1711
|
+
// every secondary page in the same freshly installed app.
|
|
1712
|
+
if (!clickPath.length && exists(cachedMeta)) entryMeta = cachedMeta;
|
|
1713
|
+
continue;
|
|
1714
|
+
}
|
|
1715
|
+
let meta = enrichCaptureMeta(pendingDir, { expectedVisible: page.expectedVisible });
|
|
1716
|
+
let pageXml = readText(path.join(pendingDir, 'view.xml'));
|
|
1717
|
+
let permissionDialog = normalizedPage(meta.page_name) === 'permissiongrantdialog'
|
|
1718
|
+
|| /本次使用允许|使用时允许|允许访问|while using the app|only this time|allow(?: access)?/i.test(pageXml);
|
|
1719
|
+
let permissionFailed = false;
|
|
1720
|
+
let permissionAttempts = 0;
|
|
1721
|
+
while (permissionDialog && permissionAttempts < 3) {
|
|
1722
|
+
const permissionCenter = permissionAllowCoordinate(path.join(pendingDir, 'meta.json'));
|
|
1723
|
+
if (!permissionCenter) {
|
|
1724
|
+
removeGeneratedDir(captureRoot, pendingDir);
|
|
1725
|
+
errors.push(`${page.name}: a system permission dialog was detected, but no "allow" button was found; the old cache is kept`);
|
|
1726
|
+
permissionFailed = true;
|
|
1727
|
+
break;
|
|
1728
|
+
}
|
|
1729
|
+
await runHdc(context.executable, ['shell', 'uitest', 'uiInput', 'click', String(permissionCenter[0]), String(permissionCenter[1])], { ...context, cwd: projectRoot });
|
|
1730
|
+
removeGeneratedDir(captureRoot, pendingDir);
|
|
1731
|
+
await new Promise((resolve) => setTimeout(resolve, 800));
|
|
1732
|
+
pageCapture = await captureHdcState(captureRoot, pendingDir, projectRoot, captureContext, maxScrolls, captureAttempts);
|
|
1733
|
+
result = pageCapture.result;
|
|
1734
|
+
if (!pageCapture.ok) {
|
|
1735
|
+
errors.push(`${page.name}: screenshot still failed after handling the permission dialog and ${pageCapture.attempts} first-round retries; the old cache is kept`);
|
|
1736
|
+
permissionFailed = true;
|
|
1737
|
+
break;
|
|
1738
|
+
}
|
|
1739
|
+
meta = enrichCaptureMeta(pendingDir, { expectedVisible: page.expectedVisible });
|
|
1740
|
+
pageXml = readText(path.join(pendingDir, 'view.xml'));
|
|
1741
|
+
permissionDialog = normalizedPage(meta.page_name) === 'permissiongrantdialog'
|
|
1742
|
+
|| /本次使用允许|使用时允许|允许访问|while using the app|only this time|allow(?: access)?/i.test(pageXml);
|
|
1743
|
+
permissionAttempts += 1;
|
|
1744
|
+
}
|
|
1745
|
+
if (permissionFailed) continue;
|
|
1746
|
+
if (permissionDialog) {
|
|
1747
|
+
removeGeneratedDir(captureRoot, pendingDir);
|
|
1748
|
+
errors.push(`${page.name}: still a system permission dialog after ${permissionAttempts} consecutive attempts; refusing to save it as an app page`);
|
|
1749
|
+
continue;
|
|
1750
|
+
}
|
|
1751
|
+
let validationBaselineMeta = currentMeta;
|
|
1752
|
+
const validatePending = () => validateHmosCapture(pendingDir, page.expectedNames || [page.name], {
|
|
1753
|
+
// A cold Ability launch (and, for secondary pages, a just-validated
|
|
1754
|
+
// entry click path) is an independent runtime fingerprint. Some HDC
|
|
1755
|
+
// versions still omit pagePath and report "unknown"; allow that narrow
|
|
1756
|
+
// case while continuing to reject every explicit mismatched page name.
|
|
1757
|
+
allowUnknown: true,
|
|
1758
|
+
expectedBundle: identity.bundle,
|
|
1759
|
+
requireBundle: true,
|
|
1760
|
+
expectedVisible: page.expectedVisible,
|
|
1761
|
+
expectedStructure: page.expectedStructure,
|
|
1762
|
+
expectedTexts: page.expectedTexts,
|
|
1763
|
+
forbiddenVisible: page.forbiddenVisible,
|
|
1764
|
+
mustDifferFromMeta: clickPath.length ? validationBaselineMeta : '',
|
|
1765
|
+
});
|
|
1766
|
+
let validation = validatePending();
|
|
1767
|
+
let stateRetries = 0;
|
|
1768
|
+
let stateRetryFailure = '';
|
|
1769
|
+
// A page click can be accepted by uitest while ArkUI is still replacing
|
|
1770
|
+
// the previous layer. Recover inside this one startup batch: inspect the
|
|
1771
|
+
// rejected state, resume from the latest click-path step still visible,
|
|
1772
|
+
// replay the remaining suffix, and recapture. This is finite work in the
|
|
1773
|
+
// first round; it does not restore background polling or browser-triggered
|
|
1774
|
+
// screenshots.
|
|
1775
|
+
while (!validation.ok
|
|
1776
|
+
&& clickPath.length
|
|
1777
|
+
&& stateRetries < stateRetryLimit
|
|
1778
|
+
&& RETRYABLE_REASON.test(validation.reason)) {
|
|
1779
|
+
stateRetries += 1;
|
|
1780
|
+
// Validation scopes markers to the expected *final* page. When the
|
|
1781
|
+
// rejected state is still a modal, that intentionally hides the modal
|
|
1782
|
+
// controls from meta.clickable_elements. Re-enrich without final-page
|
|
1783
|
+
// scoping before recovery so English/Русский (or another top overlay
|
|
1784
|
+
// action) remains clickable.
|
|
1785
|
+
enrichCaptureMeta(pendingDir);
|
|
1786
|
+
let replayMeta = path.join(pendingDir, 'meta.json');
|
|
1787
|
+
let resumeAt = -1;
|
|
1788
|
+
for (let index = clickPath.length - 1; index >= 0; index -= 1) {
|
|
1789
|
+
if (clickCoordinate(replayMeta, clickPath[index], { requireLiveLabel: true })) {
|
|
1790
|
+
resumeAt = index;
|
|
1791
|
+
break;
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
if (resumeAt >= 0) {
|
|
1795
|
+
for (let index = resumeAt; index < clickPath.length; index += 1) {
|
|
1796
|
+
const retryClick = clickCoordinate(replayMeta, clickPath[index]);
|
|
1797
|
+
if (!retryClick) {
|
|
1798
|
+
stateRetryFailure = `first-round state retry ${stateRetries} cannot continue tapping step ${index + 1}`;
|
|
1799
|
+
break;
|
|
1800
|
+
}
|
|
1801
|
+
if (index === clickPath.length - 1) {
|
|
1802
|
+
if (path.resolve(path.dirname(replayMeta)) === path.resolve(pendingDir)) {
|
|
1803
|
+
const retryBaselineDir = path.join(captureRoot, `.pending_navigation_${process.pid}_${page.sequence}_retry_${stateRetries}_baseline`);
|
|
1804
|
+
if (exists(retryBaselineDir)) removeGeneratedDir(captureRoot, retryBaselineDir);
|
|
1805
|
+
fs.cpSync(pendingDir, retryBaselineDir, { recursive: true });
|
|
1806
|
+
validationBaselineMeta = path.join(retryBaselineDir, 'meta.json');
|
|
1807
|
+
} else {
|
|
1808
|
+
validationBaselineMeta = replayMeta;
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
await runHdc(context.executable, ['shell', 'uitest', 'uiInput', 'click', String(retryClick[0]), String(retryClick[1])], { ...context, cwd: projectRoot });
|
|
1812
|
+
await new Promise((resolve) => setTimeout(resolve, (Number(entry.capture_navigation_wait_ms) || 1_200) + stateRetries * 600));
|
|
1813
|
+
if (index < clickPath.length - 1) {
|
|
1814
|
+
const retryNavigationDir = path.join(captureRoot, `.pending_navigation_${process.pid}_${page.sequence}_retry_${stateRetries}_${index}`);
|
|
1815
|
+
const retryNavigation = await captureHdcState(captureRoot, retryNavigationDir, projectRoot, captureContext, 0, captureAttempts);
|
|
1816
|
+
if (!retryNavigation.ok) {
|
|
1817
|
+
stateRetryFailure = `first-round state retry ${stateRetries}: intermediate navigation capture failed`;
|
|
1818
|
+
break;
|
|
1819
|
+
}
|
|
1820
|
+
enrichCaptureMeta(retryNavigationDir);
|
|
1821
|
+
replayMeta = path.join(retryNavigationDir, 'meta.json');
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
} else {
|
|
1825
|
+
await new Promise((resolve) => setTimeout(resolve, 1_200 + stateRetries * 600));
|
|
1826
|
+
}
|
|
1827
|
+
if (stateRetryFailure) break;
|
|
1828
|
+
pageCapture = await captureHdcState(captureRoot, pendingDir, projectRoot, captureContext, maxScrolls, captureAttempts);
|
|
1829
|
+
if (!pageCapture.ok) {
|
|
1830
|
+
stateRetryFailure = `screenshot command still failed after first-round state retry ${stateRetries}`;
|
|
1831
|
+
break;
|
|
1832
|
+
}
|
|
1833
|
+
meta = enrichCaptureMeta(pendingDir, { expectedVisible: page.expectedVisible });
|
|
1834
|
+
pageXml = readText(path.join(pendingDir, 'view.xml'));
|
|
1835
|
+
validation = validatePending();
|
|
1836
|
+
}
|
|
1837
|
+
// Advisory verdict: a mismatched capture is still real evidence of what
|
|
1838
|
+
// the device actually showed (navigation that did not take, reworded
|
|
1839
|
+
// labels, an overlay). It is promoted like any other capture and the
|
|
1840
|
+
// mismatch rides along in meta.json plus a status-bar warning — a correct
|
|
1841
|
+
// page whose wording drifted must not leave an empty slot.
|
|
1842
|
+
const retryNote = stateRetries ? `; ${stateRetries} internal first-round retries${stateRetryFailure ? ` (${stateRetryFailure})` : ''}` : '';
|
|
1843
|
+
atomicPromoteCapture(captureRoot, pendingDir, finalDir);
|
|
1844
|
+
const promotedMeta = path.join(finalDir, 'meta.json');
|
|
1845
|
+
const promotedMetaJson = readJson(promotedMeta);
|
|
1846
|
+
if (promotedMetaJson) {
|
|
1847
|
+
promotedMetaJson.validation = {
|
|
1848
|
+
verdict: validation.ok ? 'match' : 'mismatch',
|
|
1849
|
+
...(validation.ok ? {} : { reason: validation.reason }),
|
|
1850
|
+
state_retries: stateRetries,
|
|
1851
|
+
checked_at: new Date().toISOString(),
|
|
1852
|
+
};
|
|
1853
|
+
writeJson(promotedMeta, promotedMetaJson);
|
|
1854
|
+
}
|
|
1855
|
+
if (!validation.ok) {
|
|
1856
|
+
warnings.push(`${page.name}: does not fully match the source page, kept (${validation.reason}${retryNote})`);
|
|
1857
|
+
}
|
|
1858
|
+
if (!clickPath.length) entryMeta = promotedMeta;
|
|
1859
|
+
captured += 1;
|
|
1860
|
+
}
|
|
1861
|
+
for (const item of fs.readdirSync(captureRoot, { withFileTypes: true })) {
|
|
1862
|
+
if (!item.isDirectory() || !item.name.startsWith(`.pending_navigation_${process.pid}_`)) continue;
|
|
1863
|
+
removeGeneratedDir(captureRoot, path.join(captureRoot, item.name));
|
|
1864
|
+
}
|
|
1865
|
+
if (!captured) {
|
|
1866
|
+
// The denominator truth travels with the error: #refreshPlatform's "X/Y pages succeeded" caliber uses
|
|
1867
|
+
// planned (planned page count), not the error count — multi-page failures used to be joined into one error, displaying 0/2 as 0/1.
|
|
1868
|
+
const message = plan.length ? errors.join(';') : 'no capturable pages (no source page snapshots found)';
|
|
1869
|
+
throw Object.assign(new Error(message), { planned: plan.length });
|
|
1870
|
+
}
|
|
1871
|
+
return { captured, planned: plan.length, errors, warnings };
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
function platformState(status, detail = '', extra = {}) {
|
|
1875
|
+
return { status, detail, usingCache: status !== 'ready', updatedAt: new Date().toISOString(), ...extra };
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
class DeviceCaptureManager {
|
|
1879
|
+
constructor(entries, options = {}) {
|
|
1880
|
+
this.entries = entries;
|
|
1881
|
+
this.runner = options.runner || runCommand;
|
|
1882
|
+
this.env = { ...process.env, ...(options.env || {}) };
|
|
1883
|
+
// A spread copy of process.env loses Node's PATH/Path case bridging on
|
|
1884
|
+
// Windows; without this, every env.PATH lookup below sees an empty PATH
|
|
1885
|
+
// and child spawns (hdc) fail with ENOENT. An explicitly
|
|
1886
|
+
// configured empty PATH stays empty — callers use it to simulate a
|
|
1887
|
+
// PATH-less environment.
|
|
1888
|
+
if (this.env.PATH === undefined && this.env.Path !== undefined) this.env.PATH = this.env.Path;
|
|
1889
|
+
if (!this.env.HOMETRANS_HDC) this.env.HOMETRANS_HDC = entries.map((entry) => entry.hmos_hdc).find(Boolean) || '';
|
|
1890
|
+
if (!this.env.DEVECO_SDK_HOME && !this.env.HARMONYOS_SDK_HOME && !this.env.OHOS_SDK_HOME) {
|
|
1891
|
+
const sdk = entries.map(hmosSdkFromEntry).find(Boolean);
|
|
1892
|
+
if (sdk) this.env.DEVECO_SDK_HOME = sdk;
|
|
1893
|
+
}
|
|
1894
|
+
this.pollMs = options.pollMs || 2_000;
|
|
1895
|
+
this.startupDeviceWaitMs = options.startupDeviceWaitMs ?? STARTUP_DEVICE_WAIT_MS;
|
|
1896
|
+
this.retryAfterMs = options.retryAfterMs ?? Number.POSITIVE_INFINITY;
|
|
1897
|
+
this.timer = null;
|
|
1898
|
+
this.started = false;
|
|
1899
|
+
this.refreshing = false;
|
|
1900
|
+
this.attempts = { android: { signature: '', at: 0, failed: false }, hmos: { signature: '', at: 0, failed: false } };
|
|
1901
|
+
this.state = {
|
|
1902
|
+
android: platformState('checking', "Checking UI migration artifact screenshots"),
|
|
1903
|
+
hmos: platformState('checking', "Checking HDC devices"),
|
|
1904
|
+
};
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
snapshot() {
|
|
1908
|
+
return JSON.parse(JSON.stringify(this.state));
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
async refresh(options = {}) {
|
|
1912
|
+
if (this.refreshing) return this.snapshot();
|
|
1913
|
+
this.refreshing = true;
|
|
1914
|
+
try {
|
|
1915
|
+
// The board never captures the Android side: source screenshots come
|
|
1916
|
+
// straight from the UI migration artifacts (ui_info), so no ADB device
|
|
1917
|
+
// is detected or driven — only HarmonyOS gets a live capture round.
|
|
1918
|
+
this.#useLocalAndroidScreenshots(this.entries.map(localAndroidScreenshots));
|
|
1919
|
+
const hdc = await detectHdc(this.runner, this.env);
|
|
1920
|
+
await this.#refreshPlatform('hmos', hdc, options.force);
|
|
1921
|
+
return this.snapshot();
|
|
1922
|
+
} finally {
|
|
1923
|
+
this.refreshing = false;
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
#useLocalAndroidScreenshots(evidence) {
|
|
1928
|
+
const captured = evidence.reduce((total, item) => total + item.found, 0);
|
|
1929
|
+
const planned = evidence.reduce((total, item) => total + item.planned, 0);
|
|
1930
|
+
const roots = evidence.map((item) => item.root);
|
|
1931
|
+
this.attempts.android = { signature: `local:${roots.join('|')}`, at: Date.now(), failed: false };
|
|
1932
|
+
const detail = planned > captured
|
|
1933
|
+
? `Using ${captured}/${planned} UI migration artifact screenshot(s); missing pages show a placeholder on the source side`
|
|
1934
|
+
: `Reused ${captured} UI migration artifact screenshot(s)`;
|
|
1935
|
+
this.state.android = platformState('ready', detail, { captured, planned, roots, targets: [], usingCache: true, source: 'local-ui-info' });
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
async #refreshPlatform(platform, connection, force = false) {
|
|
1939
|
+
if (!connection.connected) {
|
|
1940
|
+
this.attempts[platform] = { signature: '', at: 0, failed: false };
|
|
1941
|
+
this.state[platform] = platformState('disconnected', connection.detail, { targets: [] });
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
const signature = connection.targets.join('|');
|
|
1945
|
+
const prior = this.attempts[platform];
|
|
1946
|
+
const retryDue = prior.failed && Date.now() - prior.at >= this.retryAfterMs;
|
|
1947
|
+
if (!force && prior.signature === signature && !retryDue) return;
|
|
1948
|
+
this.attempts[platform] = { signature, at: Date.now(), failed: false };
|
|
1949
|
+
this.state[platform] = platformState('capturing', `${connection.detail}, capturing from the connected device`, { targets: connection.targets, usingCache: true });
|
|
1950
|
+
const errors = [];
|
|
1951
|
+
const warnings = [];
|
|
1952
|
+
let captured = 0;
|
|
1953
|
+
let planned = 0;
|
|
1954
|
+
for (const entry of this.entries) {
|
|
1955
|
+
try {
|
|
1956
|
+
entry.ui_capture_dir = captureRootFor(entry);
|
|
1957
|
+
const device = selectTarget(platform, connection.targets, entry);
|
|
1958
|
+
const result = await captureHmosEntry(entry, { runner: this.runner, executable: connection.executable, device, env: toolEnvironment(connection.executable, this.env) });
|
|
1959
|
+
captured += result.captured;
|
|
1960
|
+
planned += Number(result.planned) || 0;
|
|
1961
|
+
errors.push(...result.errors.map((error) => `${entry.name}/${error}`));
|
|
1962
|
+
warnings.push(...(Array.isArray(result.warnings) ? result.warnings : []).map((warning) => `${entry.name}/${warning}`));
|
|
1963
|
+
} catch (error) {
|
|
1964
|
+
errors.push(`${entry.name}: ${error.message || error}`);
|
|
1965
|
+
planned += Number(error?.planned) || 0;
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
if (errors.length) {
|
|
1969
|
+
this.attempts[platform].failed = true;
|
|
1970
|
+
// Keep the status bar readable: the per-page failure details (often long,
|
|
1971
|
+
// e.g. "activity_MainActivity: screenshot still failed after 3 retries within the first round: …") are kept
|
|
1972
|
+
// on `errors` for debugging, NOT dumped into the one-line caption. The
|
|
1973
|
+
// renderLiveCaptureState bar already prefixes "Local cache fallback · " when
|
|
1974
|
+
// status==='error', so detail here only states the success/failure tally.
|
|
1975
|
+
// Denominator = planned page count, not error count: one aggregated error can cover several pages, and one
|
|
1976
|
+
// page can produce several error messages. When capture never even started (no plan could be built,
|
|
1977
|
+
// e.g. a missing signed HAP), state the reason honestly instead of forcing the X/Y formula.
|
|
1978
|
+
const detail = planned > 0
|
|
1979
|
+
? `HarmonyOS capture succeeded for ${captured}/${planned} page(s); the rest fell back to the local cache`
|
|
1980
|
+
: `HarmonyOS capture could not start: ${errors[0]}`;
|
|
1981
|
+
this.state[platform] = platformState(
|
|
1982
|
+
'error',
|
|
1983
|
+
detail,
|
|
1984
|
+
{ targets: connection.targets, captured, errors, warnings, errorCount: errors.length },
|
|
1985
|
+
);
|
|
1986
|
+
} else {
|
|
1987
|
+
const detail = warnings.length
|
|
1988
|
+
? `Captured ${captured} page(s) from the connected HarmonyOS device, ${warnings.length} of them do not fully match the source page (kept)`
|
|
1989
|
+
: `Captured ${captured} page(s) from the connected HarmonyOS device`;
|
|
1990
|
+
this.state[platform] = platformState('ready', detail, { targets: connection.targets, captured, warnings, usingCache: false });
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
start() {
|
|
1995
|
+
if (this.started) return;
|
|
1996
|
+
this.started = true;
|
|
1997
|
+
// One command invocation means one capture round. Browser reloads and
|
|
1998
|
+
// long-running server lifetime only rescan artifacts; they never recapture
|
|
1999
|
+
// a page or reinstall an app behind the user's back.
|
|
2000
|
+
const startedAt = Date.now();
|
|
2001
|
+
const tick = () => void this.refresh({ force: false }).then(() => {
|
|
2002
|
+
if (this.attempts.hmos.signature || Date.now() - startedAt >= this.startupDeviceWaitMs) this.stop();
|
|
2003
|
+
}).catch((error) => {
|
|
2004
|
+
const detail = error?.stack || error?.message || String(error);
|
|
2005
|
+
// Device capture is auxiliary. A failure must remain visible in the
|
|
2006
|
+
// dashboard and fall back to cache, never terminate the HTTP service.
|
|
2007
|
+
// The Android side never captures, so only HarmonyOS can fail here.
|
|
2008
|
+
this.state.hmos = platformState('error', `Device capture failed; using the local cache: ${detail}`, { errors: [detail] });
|
|
2009
|
+
console.error(`[a2h-dashboard-render] Device capture failed (the dashboard server keeps running): ${detail}`);
|
|
2010
|
+
});
|
|
2011
|
+
// No capture timer: one dashboard process performs exactly one startup
|
|
2012
|
+
// round. Browser refreshes only reread artifacts.
|
|
2013
|
+
tick();
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
stop() {
|
|
2017
|
+
if (this.timer) clearInterval(this.timer);
|
|
2018
|
+
this.timer = null;
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
export {
|
|
2023
|
+
DeviceCaptureManager,
|
|
2024
|
+
RETRYABLE_REASON,
|
|
2025
|
+
arktsCapturePlan,
|
|
2026
|
+
atomicPromoteCapture,
|
|
2027
|
+
captureStateChanged,
|
|
2028
|
+
clickCoordinate,
|
|
2029
|
+
clickableElementsFromXml,
|
|
2030
|
+
captureHdcState,
|
|
2031
|
+
detectHdc,
|
|
2032
|
+
enrichCaptureMeta,
|
|
2033
|
+
entryPageName,
|
|
2034
|
+
findExecutable,
|
|
2035
|
+
hmosIdentity,
|
|
2036
|
+
hmosSdkFromEntry,
|
|
2037
|
+
hmosCaptureProjectRoot,
|
|
2038
|
+
latestSignedHap,
|
|
2039
|
+
launchHmosAbility,
|
|
2040
|
+
localAndroidScreenshots,
|
|
2041
|
+
permissionAllowCoordinate,
|
|
2042
|
+
positionalClickCoordinate,
|
|
2043
|
+
selectTarget,
|
|
2044
|
+
sourceUiCapturePlan,
|
|
2045
|
+
uiInfoRootFor,
|
|
2046
|
+
validateAndroidCapture,
|
|
2047
|
+
validateHmosCapture,
|
|
2048
|
+
normalizedStructure,
|
|
2049
|
+
xmlTextCorpus,
|
|
2050
|
+
};
|