@buaa_smat/hometrans 26.0.2 → 26.0.4-devecocli.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/code-reviewer.md +111 -154
- package/devecocli-plugin/common.ts +2271 -0
- package/devecocli-plugin/content-resolver.ts +363 -0
- package/devecocli-plugin/install.ts +72 -0
- package/devecocli-plugin/uninstall.ts +26 -0
- package/devecocli-plugin/update.ts +77 -0
- 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/index.js +1643 -0
- package/package.json +18 -168
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/plugin.jsonc +12 -0
- 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/README.md +0 -439
- package/dist/cli/config-store.js +0 -128
- package/dist/cli/config.js +0 -48
- package/dist/cli/editors.json +0 -114
- package/dist/cli/env-vars.js +0 -127
- package/dist/cli/index.js +0 -73
- package/dist/cli/init.js +0 -2513
- package/dist/cli/uninstall.js +0 -406
- package/dist/platform/compose.js +0 -228
- package/dist/platform/frontmatter.js +0 -151
- package/dist/platform/installer.js +0 -417
- package/dist/platform/registry.js +0 -337
- package/dist/platform/transform.js +0 -363
- package/dist/platform/types.js +0 -9
- package/dist/platform/validate.js +0 -152
- package/dist/utils/regex.js +0 -7
- package/env-requirements.json +0 -511
- package/resource/choose_editor.png +0 -0
- package/resource/convert_pipeline_process.svg +0 -114
- package/resource/project_architecture.svg +0 -120
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/resource/set_sdk.png +0 -0
- package/resource/title_dark.png +0 -0
- 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,1656 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Unified environment preflight for a2h-app-migrate.
|
|
4
|
+
*
|
|
5
|
+
* Runs on pipeline startup (bootstrap step 1). Combines path checks + toolchain +
|
|
6
|
+
* config keys + skills root. Exit 0 = pass (warnings allowed); 1 = hard failure.
|
|
7
|
+
* Scheduling is always serial.
|
|
8
|
+
* homegraph is a global CLI: if it is not on PATH during preflight, run `npm i -g homegraph arkanalyzer`,
|
|
9
|
+
* then verify `homegraph --version`; exit 1 only if it still fails, instead of deferring to a leaf node.
|
|
10
|
+
*
|
|
11
|
+
* The full argument list is owned by references/workflow.yaml → `bootstrap.run_env_preflight.args`.
|
|
12
|
+
* Always forward --ui-reused / --skip-logic / --skip-spec-gen / --skip-arch so the
|
|
13
|
+
* gate only demands what the nodes that will actually run need. --skip-ui is accepted only so old callers get a warning.
|
|
14
|
+
*
|
|
15
|
+
* Customer one-shot (defaults fill work / run-dir / ui-info-root / skills-root):
|
|
16
|
+
*
|
|
17
|
+
* node env_preflight.mjs \
|
|
18
|
+
* --android D:/AndroidApp --hmos D:/HarmonyApp \
|
|
19
|
+
* [--apk D:/AndroidApp/app/build/outputs/apk/debug/app-debug.apk] \
|
|
20
|
+
* [--profile full|ui-only|incremental] [--scope-request <pages / node ids>] [--ui-reused] --markdown-only
|
|
21
|
+
*
|
|
22
|
+
* Output modes:
|
|
23
|
+
* (default) full JSON report
|
|
24
|
+
* --markdown-only table only (for customers' manual self-check; the orchestrator **must not** use it -- variables are lost)
|
|
25
|
+
* --report table + last line `PREFLIGHT_VARS {json}` (the orchestrator's fixed usage: the table is for humans,
|
|
26
|
+
* set_vars_from_preflight takes values only from the last line; never infer them from the table text)
|
|
27
|
+
*
|
|
28
|
+
* Orchestrator (explicit paths from workflow vars):
|
|
29
|
+
*
|
|
30
|
+
* node env_preflight.mjs \
|
|
31
|
+
* --android … --hmos … --work … --run-dir … --ui-info-root … \
|
|
32
|
+
* --skills-root … --profile … [--specs-json …] [--specs-json-is-default] [--specs-json-required] …
|
|
33
|
+
* --interaction-mode auto|interactive --interactive-gates <id,…>
|
|
34
|
+
*
|
|
35
|
+
* Interaction arguments, when passed, are validated strictly (ask / invalid value / unknown gate id -> FAIL). all / none / skip are still aliases:
|
|
36
|
+
* all expands to the three gates, none and skip expand to an empty string. Do not list all / none / skip as question options. Normalized results are backfilled via PREFLIGHT_VARS.
|
|
37
|
+
* Without --interaction-mode nothing is checked (customer manual self-check). Pass an empty allowlist as --interactive-gates=; do not omit the value.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
import { spawnSync } from "node:child_process";
|
|
41
|
+
import fs from "node:fs";
|
|
42
|
+
import path from "node:path";
|
|
43
|
+
import { fileURLToPath } from "node:url";
|
|
44
|
+
|
|
45
|
+
import { DEFAULT_SPEC_ENGINE, readPointer } from "./run_dir.mjs";
|
|
46
|
+
import {
|
|
47
|
+
STATUS_FAIL,
|
|
48
|
+
STATUS_OK,
|
|
49
|
+
STATUS_PENDING,
|
|
50
|
+
STATUS_WARN,
|
|
51
|
+
buildMarkdownTable,
|
|
52
|
+
detectSourceKind,
|
|
53
|
+
isUniAppProject,
|
|
54
|
+
parseArgs,
|
|
55
|
+
runPreflight,
|
|
56
|
+
} from "./paths_preflight.mjs";
|
|
57
|
+
import { readJson } from "./json_io.mjs";
|
|
58
|
+
import { argValue, isUnsetValue } from "./cli_values.mjs";
|
|
59
|
+
|
|
60
|
+
// Compatibility for existing callers (test_leaf_questions etc. take these two from env_preflight): implemented in cli_values.mjs.
|
|
61
|
+
export { argValue, isUnsetValue, detectSourceKind, isUniAppProject };
|
|
62
|
+
|
|
63
|
+
// Leaf skills required for a full migration — directory names under SKILLS_ROOT
|
|
64
|
+
const CORE_SKILLS = [
|
|
65
|
+
// discover.utg_static and ui.batch Step 3.1 use the same Node version (a2h-utg-static-bin is deprecated)
|
|
66
|
+
"a2h-utg-static",
|
|
67
|
+
"a2h-arch-generate",
|
|
68
|
+
"a2h-resource-convert",
|
|
69
|
+
"a2h-spec-generate",
|
|
70
|
+
"a2h-module-semantic-docs",
|
|
71
|
+
"a2h-batch-ui-align",
|
|
72
|
+
"a2h-fix-build-errors",
|
|
73
|
+
"a2h-spec-design-pipeline",
|
|
74
|
+
// Called at runtime by the leaves above: cold-start smoke for arch G10 / ui.batch 6.3 / spec_pipeline wrap-up,
|
|
75
|
+
// and per-chunk coding in spec_pipeline B1. Without them a leaf would only fail hours later.
|
|
76
|
+
"a2h-coldstart-smoke-gate",
|
|
77
|
+
"a2h-arkts-logic-coder",
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
// Device-exploration leaf for ui.batch Step 3.2 (I5 in incremental mode): checked only when the UI chain will run.
|
|
81
|
+
export const UI_LANE_SKILLS = ["a2h-utg-explorer"];
|
|
82
|
+
|
|
83
|
+
/** SPEC engines (SPEC_ENGINE knob): the one-SPEC-per-page leaf (default), or the fused a2h-spec-generate. */
|
|
84
|
+
export const SPEC_ENGINES = ["spec-generate", "page-specgen"];
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Leaf skills needed this round: the core set + the full-capture leaf when the UI chain will run.
|
|
88
|
+
* Spec generation has a single required path, the selected engine. If it is missing it would only fail when enrich.spec_gen starts
|
|
89
|
+
* (hours later), so preflight checks it here. a2h-page-specgen is the default engine, so a default run requires it; a run on
|
|
90
|
+
* the optional spec-generate engine does not.
|
|
91
|
+
*/
|
|
92
|
+
export function requiredSkills({ uiNeeded, specEngine = DEFAULT_SPEC_ENGINE, specGenRuns = true }) {
|
|
93
|
+
// Only enrich.spec_gen invokes the engine leaf; a run that skips it (UI only, reused specs.json) must not be blocked
|
|
94
|
+
// for a skill it never calls.
|
|
95
|
+
const extra = specGenRuns && specEngine === "page-specgen" ? ["a2h-page-specgen"] : [];
|
|
96
|
+
const base = [...CORE_SKILLS, ...extra];
|
|
97
|
+
return uiNeeded ? [...base, ...UI_LANE_SKILLS] : base;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const DEVECO_MARKERS = [
|
|
101
|
+
"plugins/codelinter/run/index.js",
|
|
102
|
+
"tools/hvigor/bin/hvigorw.js",
|
|
103
|
+
"tools/ohpm/bin/ohpm",
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Path parameters come only from OS environment variables (`ht init` writes the SDK paths as machine environment variables; there is no ~/.hometrans/config.json any more).
|
|
108
|
+
*/
|
|
109
|
+
function resolveConfigValue(key, envKeys) {
|
|
110
|
+
for (const ek of envKeys || [key]) {
|
|
111
|
+
const val = argValue(process.env[ek]);
|
|
112
|
+
if (val) return [val, `env:${ek}`];
|
|
113
|
+
}
|
|
114
|
+
return ["", "missing"];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function resolveWindowsExecutable(found) {
|
|
118
|
+
if (process.platform !== "win32" || !found) return found;
|
|
119
|
+
if (/\.(exe|cmd|bat)$/i.test(found)) return found;
|
|
120
|
+
for (const ext of [".cmd", ".bat", ".exe"]) {
|
|
121
|
+
if (fs.existsSync(found + ext)) return found + ext;
|
|
122
|
+
}
|
|
123
|
+
return found;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function quoteWinArg(value) {
|
|
127
|
+
const str = String(value);
|
|
128
|
+
if (!/[ \t"]/u.test(str)) return str;
|
|
129
|
+
return `"${str.replace(/"/gu, '\\"')}"`;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function safeReadText(file) {
|
|
133
|
+
try {
|
|
134
|
+
return fs.readFileSync(file, "utf8");
|
|
135
|
+
} catch {
|
|
136
|
+
return "";
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function which(cmd) {
|
|
141
|
+
const isWin = process.platform === "win32";
|
|
142
|
+
const result = spawnSync(isWin ? "where.exe" : "which", [cmd], {
|
|
143
|
+
encoding: "utf8",
|
|
144
|
+
shell: false,
|
|
145
|
+
windowsHide: true,
|
|
146
|
+
});
|
|
147
|
+
if (result.status !== 0) return "";
|
|
148
|
+
const lines = (result.stdout || "")
|
|
149
|
+
.split(/\r?\n/)
|
|
150
|
+
.map((s) => s.trim())
|
|
151
|
+
.filter(Boolean);
|
|
152
|
+
const preferred =
|
|
153
|
+
lines.find((l) => /\.(cmd|bat|exe)$/i.test(l)) || lines[0] || "";
|
|
154
|
+
return resolveWindowsExecutable(preferred);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function runShell(cmd, args = [], { timeout = 20_000, shell = false, cwd, env } = {}) {
|
|
158
|
+
try {
|
|
159
|
+
const needShell =
|
|
160
|
+
shell ||
|
|
161
|
+
(process.platform === "win32" && /\.(cmd|bat)$/i.test(String(cmd)));
|
|
162
|
+
let result;
|
|
163
|
+
if (needShell && process.platform === "win32") {
|
|
164
|
+
// .cmd/.bat must go through the shell; a path containing spaces must be quoted as a whole, or cmd splits it into `C:\Program`.
|
|
165
|
+
const cmdline = [quoteWinArg(cmd), ...args.map(quoteWinArg)].join(" ");
|
|
166
|
+
result = spawnSync(cmdline, {
|
|
167
|
+
encoding: "utf8",
|
|
168
|
+
timeout,
|
|
169
|
+
shell: true,
|
|
170
|
+
windowsHide: true,
|
|
171
|
+
cwd,
|
|
172
|
+
env,
|
|
173
|
+
});
|
|
174
|
+
} else {
|
|
175
|
+
result = spawnSync(cmd, args, {
|
|
176
|
+
encoding: "utf8",
|
|
177
|
+
timeout,
|
|
178
|
+
shell: needShell,
|
|
179
|
+
windowsHide: true,
|
|
180
|
+
cwd,
|
|
181
|
+
env,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
const out = ((result.stdout || "") + (result.stderr || "")).trim();
|
|
185
|
+
return [result.status === 0, out];
|
|
186
|
+
} catch (exc) {
|
|
187
|
+
return [false, String(exc)];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function parseVersionMajorMinor(text) {
|
|
192
|
+
const m = String(text).match(/(\d+)\.(\d+)/);
|
|
193
|
+
if (!m) return null;
|
|
194
|
+
return [Number(m[1]), Number(m[2])];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function versionLt(a, b) {
|
|
198
|
+
return a[0] < b[0] || (a[0] === b[0] && a[1] < b[1]);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** "x.y.z" -> [x, y, z] (missing parts default to 0); returns null if it cannot be parsed. */
|
|
202
|
+
export function parseVersion3(text) {
|
|
203
|
+
const m = String(text).match(/(\d+)\.(\d+)(?:\.(\d+))?/);
|
|
204
|
+
return m ? [Number(m[1]), Number(m[2]), Number(m[3] || 0)] : null;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export function version3Lt(a, b) {
|
|
208
|
+
for (let i = 0; i < 3; i++) if (a[i] !== b[i]) return a[i] < b[i];
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** Minimum HomeGraph version for spec generation (a2h-spec-generate's reqgen); below it reqgen hard-stops and asks the user to upgrade with a global ht init. */
|
|
213
|
+
export const SPEC_HOMEGRAPH_MIN = [1, 5, 2];
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The label of that row in the preflight table, stating "whom it is checked for" (pure function: unit tests need not run the package-installing CLI).
|
|
217
|
+
*/
|
|
218
|
+
export function homegraphLabelFor() {
|
|
219
|
+
return `homegraph (a2h-spec-generate ≥ ${SPEC_HOMEGRAPH_MIN.join(".")})`;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* When spec generation will run this round, bring the homegraph minimum-version check forward to preflight: in auto mode nobody can upgrade midway.
|
|
224
|
+
* When homegraphStatus is not OK the previous row has already reported it; return null.
|
|
225
|
+
*/
|
|
226
|
+
export function specHomegraphRow(homegraphStatus, versionText, { required }) {
|
|
227
|
+
// WARN = preflight just installed / upgraded it and the CLI works -- still check the version
|
|
228
|
+
if (homegraphStatus !== STATUS_OK && homegraphStatus !== STATUS_WARN) return null;
|
|
229
|
+
const floor = SPEC_HOMEGRAPH_MIN.join(".");
|
|
230
|
+
const label = homegraphLabelFor();
|
|
231
|
+
const stops = "reqgen (a2h-spec-generate) hard-stops in the prepare phase";
|
|
232
|
+
const v = parseVersion3(versionText);
|
|
233
|
+
if (!v) {
|
|
234
|
+
// If it cannot be parsed, meeting the minimum cannot be proven; preflight already reinstalled once per HOMEGRAPH_INSTALL_SPEC and it still cannot be parsed, so a mere WARN would bypass the minimum
|
|
235
|
+
return {
|
|
236
|
+
status: required ? STATUS_FAIL : STATUS_WARN,
|
|
237
|
+
detail: `cannot parse the homegraph version from "${versionText}" (preflight already tried npm i -g ${HOMEGRAPH_INSTALL_SPEC}); ${label} is the minimum for spec generation, below it ${stops}; run ht init and rerun`,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
if (version3Lt(v, SPEC_HOMEGRAPH_MIN)) {
|
|
241
|
+
return {
|
|
242
|
+
status: required ? STATUS_FAIL : STATUS_WARN,
|
|
243
|
+
detail: `${label}: current ${v.join(".")} < ${floor}, so ${stops}; preflight already tried npm i -g ${HOMEGRAPH_INSTALL_SPEC} and it is still below the minimum; run ht init and rerun`,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
return { status: STATUS_OK, detail: `homegraph ${v.join(".")} ≥ ${floor} (a2h-spec-generate)` };
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* application module: the UI chain (resource-convert) always uses it, and the spec generation chain uses it too
|
|
251
|
+
* when the engine analyzes Gradle modules (a2h-spec-generate). page-specgen builds one SPEC per page from the
|
|
252
|
+
* static UTG, so it needs no application module. This rule lives only here; callers must not stack extra conditions on it.
|
|
253
|
+
*/
|
|
254
|
+
export function appModuleNeeded({ uiNeeded, specGenRuns, specEngine = DEFAULT_SPEC_ENGINE }) {
|
|
255
|
+
return Boolean(uiNeeded || (specGenRuns && specEngine !== "page-specgen"));
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* a2h-spec-generate's reqgen imports its runtime dependencies by bare module name (linked in by `ht init`), so a missing link
|
|
260
|
+
* is a hard failure when that engine will run. a2h-page-specgen is self-contained (no npm runtime deps), so it must never be
|
|
261
|
+
* blocked by the reqgen links. Same rule shape as appModuleNeeded: only what the selected engine actually needs is demanded.
|
|
262
|
+
*/
|
|
263
|
+
export function reqgenDepsNeeded({ specGenRuns, specEngine = DEFAULT_SPEC_ENGINE }) {
|
|
264
|
+
return Boolean(specGenRuns && specEngine !== "page-specgen");
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function checkCommand(name, args, { minVersion = null, required = true } = {}) {
|
|
268
|
+
const exe = which(name);
|
|
269
|
+
if (!exe) {
|
|
270
|
+
return [required ? STATUS_FAIL : STATUS_WARN, "(PATH)", `${name} not found`];
|
|
271
|
+
}
|
|
272
|
+
const [ok, out] = runShell(exe, args);
|
|
273
|
+
if (!ok) {
|
|
274
|
+
return [required ? STATUS_FAIL : STATUS_WARN, exe, out || `${name} failed to run`];
|
|
275
|
+
}
|
|
276
|
+
if (minVersion) {
|
|
277
|
+
const parsed = parseVersionMajorMinor(out);
|
|
278
|
+
if (parsed && versionLt(parsed, minVersion)) {
|
|
279
|
+
return [
|
|
280
|
+
required ? STATUS_FAIL : STATUS_WARN,
|
|
281
|
+
exe,
|
|
282
|
+
`version ${out}, need ≥ ${minVersion[0]}.${minVersion[1]}`,
|
|
283
|
+
];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return [STATUS_OK, exe, out.split(/\r?\n/)[0] || "available"];
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Version constraint for global install / upgrade: within the same major version, not below the spec generation minimum. It used to install an unversioned
|
|
291
|
+
* `homegraph` (= the latest at the time; a major-version bump can make the index format / CLI incompatible), without any visible notice.
|
|
292
|
+
*/
|
|
293
|
+
export const HOMEGRAPH_INSTALL_SPEC = `homegraph@^${SPEC_HOMEGRAPH_MIN.join(".")}`;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* homegraph CLI availability. When missing, install HOMEGRAPH_INSTALL_SPEC; when minVersion is given (spec generation runs this round) and the installed version is lower,
|
|
297
|
+
* upgrade once with the same constraint (same effect as the user running ht init). Any install / upgrade changes the user's global environment,
|
|
298
|
+
* so the result is WARN (added to warnings, with the table stating what was installed), not a silent OK.
|
|
299
|
+
*/
|
|
300
|
+
function ensureHomegraph({ minVersion = null } = {}) {
|
|
301
|
+
const first = checkCommand("homegraph", ["--version"], { required: true });
|
|
302
|
+
const firstVer = first[0] === STATUS_OK ? parseVersion3(first[2]) : null;
|
|
303
|
+
// With a minimum, an unparseable version is also treated as "too old": reinstall as HOMEGRAPH_INSTALL_SPEC instead of letting through a CLI of unknown version
|
|
304
|
+
const tooOld = Boolean(minVersion && first[0] === STATUS_OK && (!firstVer || version3Lt(firstVer, minVersion)));
|
|
305
|
+
if (first[0] === STATUS_OK && !tooOld) return ["homegraph", first[1], first[0], first[2]];
|
|
306
|
+
|
|
307
|
+
const action = tooOld
|
|
308
|
+
? `upgrade (${firstVer ? firstVer.join(".") : `unparseable version: ${first[2]}`} < ${minVersion.join(".")})`
|
|
309
|
+
: "install";
|
|
310
|
+
const npm = which("npm");
|
|
311
|
+
if (!npm) {
|
|
312
|
+
return [
|
|
313
|
+
"homegraph",
|
|
314
|
+
first[1],
|
|
315
|
+
STATUS_FAIL,
|
|
316
|
+
`${first[2]}. homegraph needs an ${action}, but npm was not found, so npm i -g ${HOMEGRAPH_INSTALL_SPEC} arkanalyzer cannot run`,
|
|
317
|
+
];
|
|
318
|
+
}
|
|
319
|
+
const [installed, installOut] = runShell(npm, ["install", "-g", HOMEGRAPH_INSTALL_SPEC, "arkanalyzer"], {
|
|
320
|
+
timeout: 300_000,
|
|
321
|
+
});
|
|
322
|
+
const again = checkCommand("homegraph", ["--version"], { required: true });
|
|
323
|
+
const againVer = again[0] === STATUS_OK ? parseVersion3(again[2]) : null;
|
|
324
|
+
if (again[0] === STATUS_OK && !(minVersion && (!againVer || version3Lt(againVer, minVersion)))) {
|
|
325
|
+
return [
|
|
326
|
+
"homegraph",
|
|
327
|
+
again[1],
|
|
328
|
+
STATUS_WARN,
|
|
329
|
+
`${again[2]} (preflight ran a global ${action} of ${HOMEGRAPH_INSTALL_SPEC} arkanalyzer, which changed the global npm environment)`,
|
|
330
|
+
];
|
|
331
|
+
}
|
|
332
|
+
const tail = (installOut || "").split(/\r?\n/).slice(-4).join(" ").slice(0, 400);
|
|
333
|
+
return [
|
|
334
|
+
"homegraph",
|
|
335
|
+
again[1],
|
|
336
|
+
STATUS_FAIL,
|
|
337
|
+
`${again[2]}. Tried npm i -g ${HOMEGRAPH_INSTALL_SPEC} arkanalyzer` +
|
|
338
|
+
`${installed ? "" : " (install command failed)"}: ${tail || "no output"}`,
|
|
339
|
+
];
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Homecheck is a required tool of the spec pipeline: a missing or too-old CLI is installed/upgraded in
|
|
344
|
+
* place with `npm i -g homecheck@^2.0.0-next.0` (the same result as `ht init`), reported as WARN because it
|
|
345
|
+
* changed the global npm environment. Still missing/too old afterwards, an unresolvable package, or a
|
|
346
|
+
* `config/ruleSet.json` without one of the two fixed domains is a FAIL — the post-loop static-defect
|
|
347
|
+
* check is never skipped. The fixed domains are the ones that check uses; a different domain is never
|
|
348
|
+
* substituted.
|
|
349
|
+
*
|
|
350
|
+
* The floor is 2.0.0-next.0: that release renames the `@arkui-reliability` rule set to
|
|
351
|
+
* `@arkui-semantic-correctness` (rule-id domain and plugin name together), and the scan asks for the new
|
|
352
|
+
* name. It ships as a prerelease under the npm `next` tag (`latest` is still 1.0.5), so the install spec
|
|
353
|
+
* has to name it: a bare `^2.0.0` never matches a prerelease.
|
|
354
|
+
*/
|
|
355
|
+
export const HOMECHECK_MIN = [2, 0, 0];
|
|
356
|
+
/** The released artifact holding that rename (numeric comparison uses HOMECHECK_MIN). */
|
|
357
|
+
export const HOMECHECK_MIN_SPEC = "2.0.0-next.0";
|
|
358
|
+
export const HOMECHECK_RULE_DOMAINS = ["@arkui-semantic-correctness/", "@correctness/"];
|
|
359
|
+
export const HOMECHECK_INSTALL_SPEC = `homecheck@^${HOMECHECK_MIN_SPEC}`;
|
|
360
|
+
|
|
361
|
+
function isHomecheckRoot(dir) {
|
|
362
|
+
return Boolean(dir) &&
|
|
363
|
+
fs.existsSync(path.join(dir, "package.json")) &&
|
|
364
|
+
fs.existsSync(path.join(dir, "lib", "entry", "cli.js")) &&
|
|
365
|
+
fs.existsSync(path.join(dir, "config", "ruleSet.json"));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** Missing fixed rule domains; an unreadable ruleSet.json counts as all missing. */
|
|
369
|
+
export function missingHomecheckRuleSets(root) {
|
|
370
|
+
try {
|
|
371
|
+
const data = readJson(path.join(root, "config", "ruleSet.json"));
|
|
372
|
+
const rules = data && typeof data === "object" ? data.rules : null;
|
|
373
|
+
const keys = rules && typeof rules === "object" && !Array.isArray(rules) ? Object.keys(rules) : [];
|
|
374
|
+
return HOMECHECK_RULE_DOMAINS.filter((domain) => !keys.some((key) => key.startsWith(domain)));
|
|
375
|
+
} catch {
|
|
376
|
+
return [...HOMECHECK_RULE_DOMAINS];
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** Locate the installed package root: HOMECHECK_HOME, then `npm root -g`, then the binary. */
|
|
381
|
+
export function resolveHomecheckRoot({ env = process.env, find = which, run = runShell } = {}) {
|
|
382
|
+
const explicit = String(env.HOMECHECK_HOME || "").trim();
|
|
383
|
+
if (explicit && isHomecheckRoot(explicit)) return explicit;
|
|
384
|
+
|
|
385
|
+
const npm = find("npm");
|
|
386
|
+
if (npm) {
|
|
387
|
+
const [ok, out] = run(npm, ["root", "-g"]);
|
|
388
|
+
if (ok) {
|
|
389
|
+
const lines = String(out).split(/\r?\n/).map((line) => line.trim()).filter(Boolean).reverse();
|
|
390
|
+
const npmRoot = lines.find((line) => path.isAbsolute(line) && fs.existsSync(line)) || "";
|
|
391
|
+
const candidate = npmRoot ? path.join(npmRoot, "homecheck") : "";
|
|
392
|
+
if (candidate && isHomecheckRoot(candidate)) return candidate;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
const exe = find("homecheck");
|
|
397
|
+
if (!exe) return "";
|
|
398
|
+
let dir = path.dirname(exe);
|
|
399
|
+
try {
|
|
400
|
+
dir = path.dirname(fs.realpathSync.native(exe));
|
|
401
|
+
} catch {
|
|
402
|
+
/* keep the PATH location */
|
|
403
|
+
}
|
|
404
|
+
for (let i = 0; i < 6; i++) {
|
|
405
|
+
for (const candidate of [dir, path.join(dir, "node_modules", "homecheck"), path.join(dir, "..", "homecheck")]) {
|
|
406
|
+
if (isHomecheckRoot(candidate)) return path.resolve(candidate);
|
|
407
|
+
}
|
|
408
|
+
dir = path.dirname(dir);
|
|
409
|
+
}
|
|
410
|
+
return "";
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** Pure row builder so tests do not need to install homecheck. */
|
|
414
|
+
export function assessHomecheck({ exe, versionText = "", missingRuleSets = null, required = true } = {}) {
|
|
415
|
+
const status = required ? STATUS_FAIL : STATUS_WARN;
|
|
416
|
+
const skipped = required ? "cannot run" : "will be skipped";
|
|
417
|
+
const param = `homecheck (a2h-spec-design-pipeline static check ≥ ${HOMECHECK_MIN_SPEC})`;
|
|
418
|
+
const p = exe || "(not found)";
|
|
419
|
+
if (!exe) {
|
|
420
|
+
return { param, path: p, status, detail: `homecheck not found; the static defect check at the end of spec_pipeline ${skipped} (npm i -g ${HOMECHECK_INSTALL_SPEC})` };
|
|
421
|
+
}
|
|
422
|
+
const v = parseVersion3(versionText);
|
|
423
|
+
if (!v) {
|
|
424
|
+
return { param, path: p, status, detail: `cannot parse the homecheck version "${String(versionText).trim().slice(0, 100)}"; the static defect check ${required ? "cannot run" : "may be skipped"}` };
|
|
425
|
+
}
|
|
426
|
+
if (version3Lt(v, HOMECHECK_MIN)) {
|
|
427
|
+
return { param, path: p, status, detail: `version ${v.join(".")} < ${HOMECHECK_MIN_SPEC}; run npm i -g ${HOMECHECK_INSTALL_SPEC}` };
|
|
428
|
+
}
|
|
429
|
+
if (missingRuleSets == null) {
|
|
430
|
+
return { param, path: p, status, detail: `homecheck ${v.join(".")}; cannot locate the installed package, so the fixed rule sets were not verified` };
|
|
431
|
+
}
|
|
432
|
+
if (missingRuleSets.length) {
|
|
433
|
+
return { param, path: p, status, detail: `homecheck ${v.join(".")} is missing rule domains ${missingRuleSets.join(", ")}; the static defect check ${skipped}` };
|
|
434
|
+
}
|
|
435
|
+
return { param, path: p, status: STATUS_OK, detail: `homecheck ${v.join(".")}; rule sets @arkui-semantic-correctness / @correctness available` };
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
function homecheckSnapshot({ find = which, run = runShell, env = process.env } = {}) {
|
|
439
|
+
const root = resolveHomecheckRoot({ env, find, run });
|
|
440
|
+
const binary = find("homecheck");
|
|
441
|
+
// Version source parity with homecheck_scan.ts: the resolved package.json version is
|
|
442
|
+
// authoritative (the scan judges the same field); `--version` is only a fallback.
|
|
443
|
+
let versionText = "";
|
|
444
|
+
if (root) {
|
|
445
|
+
try {
|
|
446
|
+
const pkg = readJson(path.join(root, "package.json"));
|
|
447
|
+
if (pkg && typeof pkg.version === "string") versionText = pkg.version;
|
|
448
|
+
} catch {
|
|
449
|
+
/* fall back to --version below */
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
if (!versionText) {
|
|
453
|
+
if (binary) versionText = run(binary, ["--version"])[1];
|
|
454
|
+
else if (root) {
|
|
455
|
+
versionText = run(process.execPath, [path.join(root, "lib", "entry", "cli.js"), "--version"])[1];
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
const exe = binary || (root ? path.join(root, "lib", "entry", "cli.js") : "");
|
|
459
|
+
return { root, exe, versionText, missingRuleSets: root ? missingHomecheckRuleSets(root) : null };
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export function checkHomecheck({ required = true, find = which, run = runShell, env = process.env } = {}) {
|
|
463
|
+
return assessHomecheck({ ...homecheckSnapshot({ find, run, env }), required });
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Required-CLI handling: when the binary is missing or older than HOMECHECK_MIN, install
|
|
468
|
+
* HOMECHECK_INSTALL_SPEC in place and report WARN (the global environment changed). A rule-set gap is
|
|
469
|
+
* not installable and returns the FAIL row as-is. A failed install keeps the diagnosis in the detail.
|
|
470
|
+
*/
|
|
471
|
+
export function ensureHomecheck({ find = which, run = runShell, env = process.env } = {}) {
|
|
472
|
+
let snapshot = homecheckSnapshot({ find, run, env });
|
|
473
|
+
const first = assessHomecheck({ ...snapshot, required: true });
|
|
474
|
+
if (first.status === STATUS_OK) return first;
|
|
475
|
+
|
|
476
|
+
const firstVersion = parseVersion3(snapshot.versionText);
|
|
477
|
+
const installable = !snapshot.exe || !firstVersion || version3Lt(firstVersion, HOMECHECK_MIN);
|
|
478
|
+
if (!installable) return first;
|
|
479
|
+
|
|
480
|
+
const npm = find("npm");
|
|
481
|
+
if (!npm) {
|
|
482
|
+
return { ...first, detail: `${first.detail}; npm was not found, so npm i -g ${HOMECHECK_INSTALL_SPEC} cannot run` };
|
|
483
|
+
}
|
|
484
|
+
const action = firstVersion ? "upgrade" : "install";
|
|
485
|
+
const [installed, installOut] = run(npm, ["install", "-g", HOMECHECK_INSTALL_SPEC], { timeout: 300_000 });
|
|
486
|
+
snapshot = homecheckSnapshot({ find, run, env });
|
|
487
|
+
const again = assessHomecheck({ ...snapshot, required: true });
|
|
488
|
+
if (again.status === STATUS_OK) {
|
|
489
|
+
return {
|
|
490
|
+
...again,
|
|
491
|
+
status: STATUS_WARN,
|
|
492
|
+
detail: `${again.detail} (preflight ran a global ${action} of ${HOMECHECK_INSTALL_SPEC}, which changed the global npm environment)`,
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
const tail = String(installOut || "").split(/\r?\n/).slice(-4).join(" ").slice(0, 400);
|
|
496
|
+
return {
|
|
497
|
+
...again,
|
|
498
|
+
detail: `${again.detail}. Tried npm i -g ${HOMECHECK_INSTALL_SPEC}` +
|
|
499
|
+
`${installed ? "" : " (install command failed)"}: ${tail || "no output"}`,
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Same lookup chain as a2h-fix-build-errors Step 0: env DEVECO_HOME -> parent of DEVECO_SDK_HOME ->
|
|
505
|
+
* OHOS_SDK_PATH minus /sdk/default/openharmony/ets (legacy).
|
|
506
|
+
*/
|
|
507
|
+
export function resolveDevecoHome(env = process.env) {
|
|
508
|
+
const pick = (v) => String(v ?? "").trim();
|
|
509
|
+
if (pick(env.DEVECO_HOME)) return [pick(env.DEVECO_HOME), "env:DEVECO_HOME"];
|
|
510
|
+
if (pick(env.DEVECO_SDK_HOME)) return [path.dirname(pick(env.DEVECO_SDK_HOME)), "parent of env:DEVECO_SDK_HOME"];
|
|
511
|
+
const ohos = pick(env.OHOS_SDK_PATH).replace(/[\\/]+$/, "");
|
|
512
|
+
const suffix = /[\\/]sdk[\\/]default[\\/]openharmony[\\/]ets$/i;
|
|
513
|
+
if (ohos && suffix.test(ohos)) return [ohos.replace(suffix, ""), "env:OHOS_SDK_PATH (legacy)"];
|
|
514
|
+
return ["", "missing"];
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/** required = the UI chain or logic chain runs this round (both the ui.batch build and spec-design-pipeline I2 strictly need it). */
|
|
518
|
+
function checkDevecoHome({ required }) {
|
|
519
|
+
const [home, src] = resolveDevecoHome();
|
|
520
|
+
const bad = required ? STATUS_FAIL : STATUS_WARN;
|
|
521
|
+
if (!home) {
|
|
522
|
+
return {
|
|
523
|
+
home,
|
|
524
|
+
row: {
|
|
525
|
+
param: "DEVECO_HOME",
|
|
526
|
+
path: "(not configured)",
|
|
527
|
+
status: bad,
|
|
528
|
+
detail: "not found (env DEVECO_HOME / DEVECO_SDK_HOME / OHOS_SDK_PATH); " +
|
|
529
|
+
"both the ui.batch build and spec-design-pipeline I2 need it; set the environment variable or rerun ht init",
|
|
530
|
+
},
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
const missing = DEVECO_MARKERS.filter((m) => !fs.existsSync(path.join(home, m)));
|
|
534
|
+
if (missing.length) {
|
|
535
|
+
return { home, row: { param: "DEVECO_HOME", path: home.replace(/\\/g, "/"), status: bad, detail: `incomplete directory, missing ${missing[0]} and others (${src})` } };
|
|
536
|
+
}
|
|
537
|
+
return { home, row: { param: "DEVECO_HOME", path: home.replace(/\\/g, "/"), status: STATUS_OK, detail: `DevEco directory layout OK (${src})` } };
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
function checkSkillsRoot(rows, hard, skillsRoot, skills) {
|
|
541
|
+
if (!skillsRoot) {
|
|
542
|
+
rows.push({
|
|
543
|
+
param: "SKILLS_ROOT",
|
|
544
|
+
path: "(not provided)",
|
|
545
|
+
status: STATUS_FAIL,
|
|
546
|
+
detail: "--skills-root is required",
|
|
547
|
+
});
|
|
548
|
+
hard.push("SKILLS_ROOT: not provided");
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
if (!fs.existsSync(skillsRoot) || !fs.statSync(skillsRoot).isDirectory()) {
|
|
552
|
+
rows.push({
|
|
553
|
+
param: "SKILLS_ROOT",
|
|
554
|
+
path: skillsRoot,
|
|
555
|
+
status: STATUS_FAIL,
|
|
556
|
+
detail: "directory does not exist",
|
|
557
|
+
});
|
|
558
|
+
hard.push(`SKILLS_ROOT: directory does not exist ${skillsRoot}`);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
const missing = skills.filter(
|
|
562
|
+
(s) => !fs.existsSync(path.join(skillsRoot, s, "SKILL.md")),
|
|
563
|
+
);
|
|
564
|
+
if (missing.length) {
|
|
565
|
+
rows.push({
|
|
566
|
+
param: "SKILLS_ROOT",
|
|
567
|
+
path: skillsRoot.replace(/\\/g, "/"),
|
|
568
|
+
status: STATUS_FAIL,
|
|
569
|
+
detail: `missing ${missing.length} leaf skill(s): ${missing.slice(0, 4).join(", ")}${missing.length > 4 ? "…" : ""}`,
|
|
570
|
+
});
|
|
571
|
+
hard.push(`SKILLS_ROOT: missing skill ${missing[0]}`);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
rows.push({
|
|
575
|
+
param: "SKILLS_ROOT",
|
|
576
|
+
path: skillsRoot.replace(/\\/g, "/"),
|
|
577
|
+
status: STATUS_OK,
|
|
578
|
+
detail: `contains the ${skills.length} leaf skills needed this round`,
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* adb + capture device. Returns { adb, serial }: serial = explicit adb_serial / ANDROID_SERIAL (must be online), otherwise the only online device;
|
|
584
|
+
* several online without one specified -> capture would be rejected by adb (more than one device), FAIL when required.
|
|
585
|
+
*/
|
|
586
|
+
function checkAdb(rows, hard, warn, { required, serial: wanted = "" }) {
|
|
587
|
+
let [adb, src] = resolveConfigValue("ADB_PATH");
|
|
588
|
+
if (!adb) {
|
|
589
|
+
adb = which("adb") || "";
|
|
590
|
+
src = adb ? "PATH" : "missing";
|
|
591
|
+
}
|
|
592
|
+
if (!adb) {
|
|
593
|
+
const st = required ? STATUS_FAIL : STATUS_WARN;
|
|
594
|
+
rows.push({
|
|
595
|
+
param: "adb",
|
|
596
|
+
path: "(not found)",
|
|
597
|
+
status: st,
|
|
598
|
+
detail: "ui.batch needs adb to capture pages (both full and incremental I5 captures are done by a2h-utg-explorer)",
|
|
599
|
+
});
|
|
600
|
+
(required ? hard : warn).push("adb: not found");
|
|
601
|
+
return { adb: "", serial: "" };
|
|
602
|
+
}
|
|
603
|
+
const [ok, out] = runShell(adb, ["devices"]);
|
|
604
|
+
if (!ok) {
|
|
605
|
+
const st = required ? STATUS_FAIL : STATUS_WARN;
|
|
606
|
+
rows.push({ param: "adb", path: adb, status: st, detail: out });
|
|
607
|
+
(required ? hard : warn).push(`adb: ${out}`);
|
|
608
|
+
return { adb, serial: "" };
|
|
609
|
+
}
|
|
610
|
+
const devices = out
|
|
611
|
+
.split(/\r?\n/)
|
|
612
|
+
.slice(1)
|
|
613
|
+
.filter((ln) => ln.trim() && ln.includes("device") && !ln.includes("offline"));
|
|
614
|
+
const online = devices.filter((ln) => ln.trimEnd().endsWith("device"));
|
|
615
|
+
if (!online.length) {
|
|
616
|
+
const st = required ? STATUS_FAIL : STATUS_WARN;
|
|
617
|
+
rows.push({
|
|
618
|
+
param: "adb device",
|
|
619
|
+
path: adb,
|
|
620
|
+
status: st,
|
|
621
|
+
detail: "no online device (adb devices is empty)",
|
|
622
|
+
});
|
|
623
|
+
(required ? hard : warn).push("adb: no online device");
|
|
624
|
+
return { adb, serial: "" };
|
|
625
|
+
}
|
|
626
|
+
const serials = online.map((ln) => ln.trim().split(/\s+/)[0]);
|
|
627
|
+
const want = String(wanted || process.env.ANDROID_SERIAL || "").trim();
|
|
628
|
+
const bad = (detail) => {
|
|
629
|
+
const st = required ? STATUS_FAIL : STATUS_WARN;
|
|
630
|
+
rows.push({ param: "adb device", path: adb, status: st, detail });
|
|
631
|
+
(required ? hard : warn).push(`adb: ${detail}`);
|
|
632
|
+
return { adb, serial: "" };
|
|
633
|
+
};
|
|
634
|
+
const pick = pickAdbSerial(serials, want);
|
|
635
|
+
if (pick.error) return bad(pick.error);
|
|
636
|
+
const serial = pick.serial;
|
|
637
|
+
rows.push({
|
|
638
|
+
param: "adb device",
|
|
639
|
+
path: adb,
|
|
640
|
+
status: STATUS_OK,
|
|
641
|
+
detail: `${serial} (${online.length} online; adb from ${src})`,
|
|
642
|
+
});
|
|
643
|
+
return { adb, serial };
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/** Pick the capture device among online devices: an explicit choice must be online; when unspecified, auto-pick only if exactly one is online. */
|
|
647
|
+
/**
|
|
648
|
+
* ui.batch Step 3.2 uses `aapt dump badging` to read the package name and launch Activity. aapt / aapt2 are usually not on PATH
|
|
649
|
+
* but under the SDK's build-tools/<version>/; the SDK root is ANDROID_HOME / ANDROID_SDK_ROOT, or the parent of the platform-tools containing adb.
|
|
650
|
+
* Returns the path of the executable found, or "" if none.
|
|
651
|
+
*/
|
|
652
|
+
export function findAapt({ env = process.env, adbPath = "", find = which } = {}) {
|
|
653
|
+
for (const name of ["aapt", "aapt2"]) {
|
|
654
|
+
const hit = find(name);
|
|
655
|
+
if (hit) return hit;
|
|
656
|
+
}
|
|
657
|
+
const roots = [argValue(env.ANDROID_HOME), argValue(env.ANDROID_SDK_ROOT)];
|
|
658
|
+
if (adbPath) roots.push(path.dirname(path.dirname(adbPath)));
|
|
659
|
+
const exe = process.platform === "win32" ? ".exe" : "";
|
|
660
|
+
for (const root of roots.filter(Boolean)) {
|
|
661
|
+
let versions = [];
|
|
662
|
+
try {
|
|
663
|
+
versions = fs.readdirSync(path.join(root, "build-tools"));
|
|
664
|
+
} catch {
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
667
|
+
versions.sort((a, b) => b.localeCompare(a, undefined, { numeric: true }));
|
|
668
|
+
for (const v of versions) {
|
|
669
|
+
for (const name of ["aapt", "aapt2"]) {
|
|
670
|
+
const p = path.join(root, "build-tools", v, name + exe);
|
|
671
|
+
if (fs.existsSync(p)) return p;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return "";
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/** A missing aapt does not block: ui-align has a fallback that does not depend on aapt (applicationId + resolve-activity), so only WARN. */
|
|
679
|
+
export function aaptRow(found) {
|
|
680
|
+
if (found) {
|
|
681
|
+
return { param: "aapt", path: found.split(path.sep).join("/"), status: STATUS_OK, detail: "ui.batch Step 3.2 reads the package name / launch Activity (dump badging)" };
|
|
682
|
+
}
|
|
683
|
+
return {
|
|
684
|
+
param: "aapt",
|
|
685
|
+
path: "(not found)",
|
|
686
|
+
status: STATUS_WARN,
|
|
687
|
+
detail: "no aapt / aapt2 on PATH or under the SDK build-tools; ui.batch Step 3.2 will infer the package name and launch Activity from applicationId + adb resolve-activity instead",
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
export function pickAdbSerial(online, wanted = "") {
|
|
692
|
+
const want = String(wanted || "").trim();
|
|
693
|
+
if (want) {
|
|
694
|
+
return online.includes(want)
|
|
695
|
+
? { serial: want }
|
|
696
|
+
: { error: `the requested device ${want} is not online; online: ${online.join(", ") || "(none)"}` };
|
|
697
|
+
}
|
|
698
|
+
if (online.length === 1) return { serial: online[0] };
|
|
699
|
+
if (!online.length) return { error: "no online device (adb devices is empty)" };
|
|
700
|
+
return { error: `${online.length} online (${online.join(", ")}): use adb_serial=<serial> or ANDROID_SERIAL to choose the one to capture from` };
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/** ui.batch will actually run (needs APK / device): UI artifacts are not reused. The profile must not cut the whole UI chain. */
|
|
704
|
+
export function needUiLane(uiReused = false) {
|
|
705
|
+
return !uiReused;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* APK check: a2h-batch-ui-align / a2h-resource-convert both treat apk_path as required and would "ask the user",
|
|
710
|
+
* but ui.batch often runs as a Task sub-agent that cannot ask -- so missing/invalid must hard-fail in preflight.
|
|
711
|
+
* Android and UniApp alike: a readable APK must be provided when the UI chain runs.
|
|
712
|
+
*/
|
|
713
|
+
export function checkApk(apkRaw, { required }) {
|
|
714
|
+
const raw = argValue(apkRaw); // "null" / "None" / an unexpanded ${APK} all count as not provided
|
|
715
|
+
const fail = (p, detail) => ({
|
|
716
|
+
param: "APK_PATH",
|
|
717
|
+
path: p,
|
|
718
|
+
status: required ? STATUS_FAIL : STATUS_WARN,
|
|
719
|
+
detail,
|
|
720
|
+
});
|
|
721
|
+
if (!raw) {
|
|
722
|
+
if (!required) {
|
|
723
|
+
return { param: "APK_PATH", path: "(skipped)", status: STATUS_PENDING, detail: "UI chain does not run (reusing UI outputs)" };
|
|
724
|
+
}
|
|
725
|
+
return fail("(not provided)", "the UI chain needs apk_path (the only source for resource conversion); pass apk_path=<absolute path>");
|
|
726
|
+
}
|
|
727
|
+
if (!path.isAbsolute(raw)) return fail(raw, "must be an absolute path");
|
|
728
|
+
const p = raw.replace(/\\/g, "/");
|
|
729
|
+
let st;
|
|
730
|
+
try {
|
|
731
|
+
st = fs.statSync(raw);
|
|
732
|
+
} catch {
|
|
733
|
+
return fail(p, "file does not exist");
|
|
734
|
+
}
|
|
735
|
+
if (!st.isFile()) return fail(p, "not a file");
|
|
736
|
+
if (!/\.apk$/i.test(raw)) return fail(p, "extension is not .apk");
|
|
737
|
+
try {
|
|
738
|
+
const fd = fs.openSync(raw, "r");
|
|
739
|
+
const buf = Buffer.alloc(2);
|
|
740
|
+
fs.readSync(fd, buf, 0, 2, 0);
|
|
741
|
+
fs.closeSync(fd);
|
|
742
|
+
if (buf.toString("latin1") !== "PK") return fail(p, "not a valid APK (not a zip file)");
|
|
743
|
+
} catch (exc) {
|
|
744
|
+
return fail(p, `not readable: ${exc}`);
|
|
745
|
+
}
|
|
746
|
+
const mb = (st.size / 1024 / 1024).toFixed(1);
|
|
747
|
+
return { param: "APK_PATH", path: p, status: STATUS_OK, detail: `APK readable (${mb} MB)` };
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/** Android Gradle project marker (for mutually exclusive detection against UniApp use detectSourceKind / isUniAppProject). */
|
|
751
|
+
export function isAndroidProject(dir) {
|
|
752
|
+
return ["settings.gradle", "settings.gradle.kts", "build.gradle", "build.gradle.kts", "app/src/main/AndroidManifest.xml"]
|
|
753
|
+
.some((rel) => fs.existsSync(path.join(dir || "", rel)));
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* a2h-spec-generate loads the homegraph package from <reqgen-root>/node_modules (npm-linked in after the global install by ht init),
|
|
758
|
+
* and stops if resolution fails. Walk up from reqgen-root looking for node_modules/homegraph per Node resolution rules.
|
|
759
|
+
*/
|
|
760
|
+
/** Packages imported at runtime by a2h-spec-generate's reqgen (same as REQGEN_LINKED_PACKAGES in src/cli/init.ts). */
|
|
761
|
+
export const REQGEN_RUNTIME_PACKAGES = ["commander", "homegraph", "tree-sitter-wasms", "web-tree-sitter", "zod"];
|
|
762
|
+
|
|
763
|
+
/** Walk up from reqgen-root looking for node_modules/<name> per Node resolution rules; returns the names of packages that cannot be resolved. */
|
|
764
|
+
export function missingReqgenPackages(skillsRoot, names = REQGEN_RUNTIME_PACKAGES) {
|
|
765
|
+
const start = path.join(skillsRoot || "", "a2h-spec-generate", "scripts", "reqgen");
|
|
766
|
+
return names.filter((name) => {
|
|
767
|
+
for (let dir = start; ; ) {
|
|
768
|
+
if (fs.existsSync(path.join(dir, "node_modules", name, "package.json"))) return false;
|
|
769
|
+
const parent = path.dirname(dir);
|
|
770
|
+
if (parent === dir) return true;
|
|
771
|
+
dir = parent;
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
export function findReqgenHomegraph(skillsRoot) {
|
|
777
|
+
let dir = path.join(skillsRoot || "", "a2h-spec-generate", "scripts", "reqgen");
|
|
778
|
+
for (;;) {
|
|
779
|
+
const hit = path.join(dir, "node_modules", "homegraph");
|
|
780
|
+
if (fs.existsSync(path.join(hit, "package.json"))) return hit;
|
|
781
|
+
const parent = path.dirname(dir);
|
|
782
|
+
if (parent === dir) return "";
|
|
783
|
+
dir = parent;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
const APP_PLUGIN_RE = /com\.android\.application|plugins\.android\.application\b/;
|
|
788
|
+
const MODULE_SCAN_SKIP = new Set(["build", ".gradle", ".git", ".idea", "node_modules", ".hometrans", ".homegraph"]);
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Gradle modules that apply the Android application plugin (`com.android.application` or the version-catalog alias
|
|
792
|
+
* `alias(libs.plugins.android.application)`), returned as Gradle-style names like [":app"]. Scans two levels under the root.
|
|
793
|
+
* a2h-spec-generate (application-module) and resource-convert (application module) both ask the user when there are several -- preflight settles it first.
|
|
794
|
+
*/
|
|
795
|
+
export function detectAppModules(androidRoot) {
|
|
796
|
+
const out = [];
|
|
797
|
+
const visit = (dir, segs) => {
|
|
798
|
+
for (const name of ["build.gradle", "build.gradle.kts"]) {
|
|
799
|
+
const f = path.join(dir, name);
|
|
800
|
+
if (segs.length && fs.existsSync(f) && APP_PLUGIN_RE.test(safeReadText(f))) {
|
|
801
|
+
out.push(":" + segs.join(":"));
|
|
802
|
+
break;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
if (segs.length >= 2) return;
|
|
806
|
+
let entries = [];
|
|
807
|
+
try {
|
|
808
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
809
|
+
} catch {
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
for (const e of entries) {
|
|
813
|
+
if (e.isDirectory() && !MODULE_SCAN_SKIP.has(e.name) && !e.name.startsWith(".")) visit(path.join(dir, e.name), [...segs, e.name]);
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
if (androidRoot && fs.existsSync(androidRoot)) visit(androidRoot, []);
|
|
817
|
+
return out.sort();
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/** Preflight's APP_MODULE verdict: { status, value, detail }. With sourceKind=uniapp, having no Gradle module is expected. */
|
|
821
|
+
export function resolveAppModule(candidates, requested, { sourceKind = "" } = {}) {
|
|
822
|
+
const want = argValue(requested);
|
|
823
|
+
const norm = want && !want.startsWith(":") ? ":" + want : want;
|
|
824
|
+
if (norm) {
|
|
825
|
+
if (candidates.length && !candidates.includes(norm)) {
|
|
826
|
+
return { status: STATUS_FAIL, value: "", detail: `the requested ${norm} is not an application module; candidates: ${candidates.join(", ")}` };
|
|
827
|
+
}
|
|
828
|
+
return { status: STATUS_OK, value: norm, detail: "specified by the user" };
|
|
829
|
+
}
|
|
830
|
+
if (candidates.length === 1) return { status: STATUS_OK, value: candidates[0], detail: "the only application module" };
|
|
831
|
+
if (!candidates.length) {
|
|
832
|
+
const detail = sourceKind === "uniapp"
|
|
833
|
+
? "UniApp project with no Gradle application module; the leaf skill decides from the appid / directory slug"
|
|
834
|
+
: "no com.android.application module recognized (UniApp or an unusual layout); left to the leaf skill to decide";
|
|
835
|
+
return { status: STATUS_WARN, value: "", detail };
|
|
836
|
+
}
|
|
837
|
+
return {
|
|
838
|
+
status: STATUS_FAIL,
|
|
839
|
+
value: "",
|
|
840
|
+
detail: `${candidates.length} application modules: ${candidates.join(", ")}; choose one with app_module=<module>` +
|
|
841
|
+
" (the UI chain and the spec chain must analyze the same app, and a leaf skill cannot reliably ask the user while running)",
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
export const PROFILES = ["full", "ui-only", "incremental", "resume"];
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* profile=incremental preconditions (scenario 3: a few pages into an existing HarmonyOS project), checked here so
|
|
849
|
+
* a run that cannot work stops in seconds instead of after discovery:
|
|
850
|
+
* - SCOPE (--scope-request) is required: incremental never means "convert everything";
|
|
851
|
+
* - the SPEC engine must be page-specgen, the only engine with --scope (a2h-spec-generate would generate the whole
|
|
852
|
+
* app and code it over the existing project);
|
|
853
|
+
* - the HarmonyOS project must already exist (hmos_mode existing_project): an empty target is a full migration.
|
|
854
|
+
* Returns rows { param, path, status, detail } (empty for any other profile).
|
|
855
|
+
*/
|
|
856
|
+
export function checkIncremental({ profile, scopeRequest, specEngine, hmosMode, logicRuns = true,
|
|
857
|
+
scopeDoc = "", androidDiff = "", scopeFile = "", android = "", checks = {} }) {
|
|
858
|
+
if (profile !== "incremental") return [];
|
|
859
|
+
const rows = [];
|
|
860
|
+
const scope = argValue(scopeRequest);
|
|
861
|
+
const docs = String(argValue(scopeDoc) || "").split(",").map((s) => s.trim()).filter(Boolean);
|
|
862
|
+
const range = argValue(androidDiff);
|
|
863
|
+
const file = argValue(scopeFile);
|
|
864
|
+
const exists = checks.exists ?? ((p) => fs.existsSync(p));
|
|
865
|
+
const gitRange = checks.gitRange ?? ((dir, r) => spawnSync("git", ["-C", dir, "rev-list", "--count", r], { encoding: "utf8" }).status === 0);
|
|
866
|
+
const validScope = checks.validScope ?? ((p) => {
|
|
867
|
+
const r = spawnSync(process.execPath, [path.join(path.dirname(fileURLToPath(import.meta.url)), "scope_model.mjs"), "validate", p], { encoding: "utf8" });
|
|
868
|
+
return r.status === 0 ? "" : (r.stderr.trim() || "invalid scope file");
|
|
869
|
+
});
|
|
870
|
+
if (!scope && !docs.length && !range && !file) {
|
|
871
|
+
rows.push({ param: "SCOPE", path: "(missing)", status: STATUS_FAIL,
|
|
872
|
+
detail: "profile=incremental needs a scope: scope=<pages or a feature description>, scope_doc=<requirement document>, android_diff=<a..b> or scope_file=<scope.json>; incremental never converts the whole app" });
|
|
873
|
+
}
|
|
874
|
+
if (scope) rows.push({ param: "SCOPE", path: scope, status: STATUS_OK, detail: "pages (ui.batch I1–I4) or a feature description (discover.feature_scope F1–F5)" });
|
|
875
|
+
for (const d of docs) {
|
|
876
|
+
rows.push(exists(d)
|
|
877
|
+
? { param: "SCOPE_DOC", path: d, status: STATUS_OK, detail: "requirement document (discover.feature_scope F1)" }
|
|
878
|
+
: { param: "SCOPE_DOC", path: d, status: STATUS_FAIL, detail: "requirement document not found" });
|
|
879
|
+
}
|
|
880
|
+
if (range) {
|
|
881
|
+
rows.push(gitRange(android, range)
|
|
882
|
+
? { param: "ANDROID_DIFF", path: range, status: STATUS_OK, detail: "Android version range (discover.feature_scope F2)" }
|
|
883
|
+
: { param: "ANDROID_DIFF", path: range, status: STATUS_FAIL, detail: "not a git range of the Android project (git rev-list failed): check the tags / commits and that ANDROID is a git repository" });
|
|
884
|
+
}
|
|
885
|
+
if (file) {
|
|
886
|
+
const why = exists(file) ? validScope(file) : "file not found";
|
|
887
|
+
rows.push(why
|
|
888
|
+
? { param: "SCOPE_FILE", path: file, status: STATUS_FAIL, detail: `scope file refused: ${why}` }
|
|
889
|
+
: { param: "SCOPE_FILE", path: file, status: STATUS_OK, detail: "confirmed scope, used as is (auto may skip the confirmation)" });
|
|
890
|
+
}
|
|
891
|
+
if (logicRuns && specEngine !== "page-specgen") {
|
|
892
|
+
rows.push({ param: "SPEC_ENGINE", path: String(specEngine || ""), status: STATUS_FAIL,
|
|
893
|
+
detail: "profile=incremental needs spec_engine=page-specgen: it is the only engine that takes --scope" });
|
|
894
|
+
}
|
|
895
|
+
if (hmosMode && hmosMode !== "existing_project") {
|
|
896
|
+
rows.push({ param: "HMOS", path: hmosMode, status: STATUS_FAIL,
|
|
897
|
+
detail: "profile=incremental migrates into an existing HarmonyOS project; this target is empty (scaffold_new) — run profile=full" });
|
|
898
|
+
}
|
|
899
|
+
return rows;
|
|
900
|
+
}
|
|
901
|
+
export const ENGINE_MODES = ["auto", "off", "required"];
|
|
902
|
+
/** Upper bounds: exceeding one is clamped with a WARN (not FAIL -- large values are usually typos or a "bigger is faster" misconception, and it still runs after clamping).
|
|
903
|
+
* specConcurrency: a2h-spec-generate's hard limit (policy.max_spec_generate_concurrency). */
|
|
904
|
+
export const KNOB_LIMITS = { waveWidth: 32, maxScenariosPerChunk: 128, specConcurrency: 8 };
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Unified validation + normalization of run knobs. These values used to be passed to leaves as is: a misspelled profile -> every chain's decisions followed "not ui-only";
|
|
908
|
+
* an invalid ENGINE_MODE / SPEC_ENGINE / WAVE_WIDTH only failed at logic chain I1 (hours later);
|
|
909
|
+
* and the SPEC_CONCURRENCY clamping required by policy was implemented nowhere.
|
|
910
|
+
* Returns { values, rows }: values are backfilled into PREFLIGHT_VARS; rows are { param, path, status, detail }.
|
|
911
|
+
*/
|
|
912
|
+
export function resolveRunKnobs(raw = {}) {
|
|
913
|
+
const rows = [];
|
|
914
|
+
const values = {};
|
|
915
|
+
const add = (param, value, status, detail) => rows.push({ param, path: String(value), status, detail });
|
|
916
|
+
|
|
917
|
+
const enumKnob = (param, key, input, choices, fallback, norm = (s) => s.toLowerCase()) => {
|
|
918
|
+
const given = argValue(input);
|
|
919
|
+
const v = given ? norm(given) : fallback;
|
|
920
|
+
if (!choices.includes(v)) {
|
|
921
|
+
add(param, given, STATUS_FAIL, `must be one of ${choices.join(" | ")}, got ${given}`);
|
|
922
|
+
values[key] = "";
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
values[key] = v;
|
|
926
|
+
};
|
|
927
|
+
enumKnob("PROFILE", "profile", raw.profile, PROFILES, "full");
|
|
928
|
+
enumKnob("ENGINE_MODE", "engine_mode", raw.engineMode, ENGINE_MODES, "auto");
|
|
929
|
+
enumKnob("SPEC_ENGINE", "spec_engine", raw.specEngine, SPEC_ENGINES, DEFAULT_SPEC_ENGINE);
|
|
930
|
+
|
|
931
|
+
const intKnob = (param, key, input, fallback, max) => {
|
|
932
|
+
const given = argValue(input);
|
|
933
|
+
if (!given) {
|
|
934
|
+
values[key] = fallback;
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
const n = Number(given);
|
|
938
|
+
if (!/^\d+$/.test(given) || !Number.isSafeInteger(n) || n < 1) {
|
|
939
|
+
add(param, given, STATUS_FAIL, `must be a positive integer, got ${given}`);
|
|
940
|
+
values[key] = null;
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
if (max && n > max) {
|
|
944
|
+
add(param, given, STATUS_WARN, `${n} exceeds the limit ${max}; using ${max}`);
|
|
945
|
+
values[key] = max;
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
values[key] = n;
|
|
949
|
+
};
|
|
950
|
+
intKnob("WAVE_WIDTH", "wave_width", raw.waveWidth, 10, KNOB_LIMITS.waveWidth);
|
|
951
|
+
intKnob("MAX_SCENARIOS_PER_CHUNK", "max_scenarios_per_chunk", raw.maxScenariosPerChunk, 32, KNOB_LIMITS.maxScenariosPerChunk);
|
|
952
|
+
// policy.max_spec_generate_concurrency: the per-Area worker concurrency limit of the merged chain.
|
|
953
|
+
// Exceeding it does not block the run: clamp + WARN. Non-positive integer / outside the safe integer range -> default 8 (WARN, no block).
|
|
954
|
+
const concGiven = argValue(raw.specConcurrency);
|
|
955
|
+
const concN = Number(concGiven);
|
|
956
|
+
// Digits-only string + safe integer: a regex check alone would let 999999999999999999999 become 1e+21 and flow into the leaf's concurrency=
|
|
957
|
+
const concValid = Boolean(concGiven) && /^\d+$/.test(concGiven) && Number.isSafeInteger(concN) && concN >= 1;
|
|
958
|
+
if (concGiven && !concValid) {
|
|
959
|
+
// Two reasons stated as they are: 0 / non-numeric is "not a positive integer"; only digits that overflow are "outside the safe integer range"
|
|
960
|
+
// (`0` used to report "outside the safe integer range" too, sending the user off to fix the wrong thing).
|
|
961
|
+
const why =
|
|
962
|
+
/^\d+$/.test(concGiven) && concN >= 1
|
|
963
|
+
? `outside the safe integer range (${concGiven})`
|
|
964
|
+
: `must be a positive integer, got ${concGiven}`;
|
|
965
|
+
add("SPEC_CONCURRENCY", concGiven, STATUS_WARN, `${why}; using the default 8`);
|
|
966
|
+
values.spec_concurrency = 8;
|
|
967
|
+
} else {
|
|
968
|
+
const n = concValid ? concN : 8;
|
|
969
|
+
const cap = KNOB_LIMITS.specConcurrency;
|
|
970
|
+
if (n > cap) add("SPEC_CONCURRENCY", n, STATUS_WARN, `exceeds the limit ${cap} (policy.max_spec_generate_concurrency); using ${cap}`);
|
|
971
|
+
values.spec_concurrency = Math.min(n, cap);
|
|
972
|
+
}
|
|
973
|
+
return { values, rows };
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/** human_gate node ids. The question options are exactly these ids (multi-select, all selected by default), in the order written in the workflow's choices. */
|
|
977
|
+
export const HUMAN_GATES = ["review.arch", "review.spec_gen", "review.ui_batch"];
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Normalization of INTERACTION_MODE / INTERACTIVE_GATES. Whether a gate stops and waits is decided by the orchestrator by "does the allowlist contain the id";
|
|
981
|
+
* a misspelled id or an unanswered ask would make the gate silently --confirmed-by auto, so this must be strict.
|
|
982
|
+
* all / none / skip are command-line aliases, not question options: all on its own expands to the three HUMAN_GATES, none on its own equals an empty string.
|
|
983
|
+
* skip on its own, or written together with gate ids, is treated as an empty string. Mixing all / none with gate ids fails.
|
|
984
|
+
* An unanswered human-review gate question is not a state preflight can see: when interactive and the user did not answer, the orchestrator should pass all three, not an empty string.
|
|
985
|
+
* In auto mode the orchestrator must not ask about these gates again and passes an empty string.
|
|
986
|
+
* Returns { status, detail, mode, gates }; gates is a comma-separated string in HUMAN_GATES order (empty = all auto-confirmed).
|
|
987
|
+
* mode not passed (undefined) -> null: a manual preflight run without interaction arguments omits this row.
|
|
988
|
+
*/
|
|
989
|
+
export function resolveInteraction(modeRaw, gatesRaw) {
|
|
990
|
+
if (modeRaw === undefined) return null;
|
|
991
|
+
const fail = (detail) => ({ status: STATUS_FAIL, detail, mode: "", gates: "" });
|
|
992
|
+
const mode = String(modeRaw).trim().toLowerCase();
|
|
993
|
+
if (!mode || mode === "ask") return fail("still ask: ask_run_config_once must get an answer (auto|interactive) before preflight runs");
|
|
994
|
+
if (mode !== "auto" && mode !== "interactive") return fail(`must be auto or interactive, got ${modeRaw}`);
|
|
995
|
+
if (mode === "auto") return { status: STATUS_OK, detail: "auto: all gates auto-confirmed (INTERACTIVE_GATES forced empty)", mode, gates: "" };
|
|
996
|
+
|
|
997
|
+
const raw = gatesRaw === undefined ? "ask" : String(gatesRaw).trim();
|
|
998
|
+
// When an empty value is not quoted, parseArgs swallows the next flag as the value -- that flag is already lost, so all we can do is stop.
|
|
999
|
+
if (raw.startsWith("--")) return fail(`INTERACTIVE_GATES is ${raw}: for an empty allowlist pass --interactive-gates=, do not omit the value`);
|
|
1000
|
+
const lower = raw.toLowerCase();
|
|
1001
|
+
if (lower === "ask") return fail("INTERACTIVE_GATES is still ask: interactive mode must first ask which gates to stop at");
|
|
1002
|
+
let picked;
|
|
1003
|
+
let alias = "";
|
|
1004
|
+
const tokens = raw.split(/[,\s]+/).filter(Boolean);
|
|
1005
|
+
if (!raw || lower === "none" || tokens.some((tok) => tok.toLowerCase() === "skip")) {
|
|
1006
|
+
picked = [];
|
|
1007
|
+
if (lower === "none") alias = " (none treated as empty)";
|
|
1008
|
+
else if (tokens.some((tok) => tok.toLowerCase() === "skip")) alias = " (skip treated as empty)";
|
|
1009
|
+
} else if (lower === "all") {
|
|
1010
|
+
picked = HUMAN_GATES.slice();
|
|
1011
|
+
alias = " (all expanded)";
|
|
1012
|
+
} else {
|
|
1013
|
+
const bad = [];
|
|
1014
|
+
const want = new Set();
|
|
1015
|
+
for (const tok of tokens) {
|
|
1016
|
+
const id = tok.toLowerCase().startsWith("review.") ? tok.toLowerCase() : `review.${tok.toLowerCase()}`;
|
|
1017
|
+
if (HUMAN_GATES.includes(id)) want.add(id);
|
|
1018
|
+
else bad.push(tok);
|
|
1019
|
+
}
|
|
1020
|
+
if (bad.length) return fail(`INTERACTIVE_GATES contains unknown gates ${bad.join(", ")}; valid values: ${HUMAN_GATES.join(", ")} (multiple allowed; empty string or skip = all auto-confirmed)`);
|
|
1021
|
+
picked = HUMAN_GATES.filter((g) => want.has(g));
|
|
1022
|
+
}
|
|
1023
|
+
const gates = picked.join(",");
|
|
1024
|
+
return {
|
|
1025
|
+
status: STATUS_OK,
|
|
1026
|
+
detail: gates ? `interactive: stop at ${gates}${alias}` : `interactive: allowlist is empty, all gates auto-confirmed${alias}`,
|
|
1027
|
+
mode,
|
|
1028
|
+
gates,
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/** hdc executable: PATH first, then the toolchains bundled with DevEco. */
|
|
1033
|
+
function findHdc(devecoHome) {
|
|
1034
|
+
const onPath = which("hdc");
|
|
1035
|
+
if (onPath) return onPath;
|
|
1036
|
+
if (!devecoHome) return "";
|
|
1037
|
+
for (const name of ["hdc.exe", "hdc"]) {
|
|
1038
|
+
const p = path.join(devecoHome, "sdk", "default", "openharmony", "toolchains", name);
|
|
1039
|
+
if (fs.existsSync(p)) return p;
|
|
1040
|
+
}
|
|
1041
|
+
return "";
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* When the logic chain runs this round, HMOS must be the **root directory** of a git repo (a hard requirement of a2h-spec-design-pipeline I2 / git_baseline).
|
|
1046
|
+
* When HMOS lies under a parent repo, --is-inside-work-tree is true; preflight and arch used to let it through, and it aborted at I2 hours later.
|
|
1047
|
+
* HMOS missing or an empty directory -> arch runs git init when creating the shell (FAIL if arch does not run this round).
|
|
1048
|
+
*/
|
|
1049
|
+
export function checkHmosGitRoot(hmos, { logicRuns, archRuns }) {
|
|
1050
|
+
if (!logicRuns) return null;
|
|
1051
|
+
const p = String(hmos || "");
|
|
1052
|
+
const row = (status, detail) => ({ param: "HMOS git repo root", path: p.replace(/\\/g, "/"), status, detail });
|
|
1053
|
+
let entries = null;
|
|
1054
|
+
try {
|
|
1055
|
+
entries = fs.readdirSync(p);
|
|
1056
|
+
} catch {
|
|
1057
|
+
/* does not exist */
|
|
1058
|
+
}
|
|
1059
|
+
if (!entries || entries.length === 0) {
|
|
1060
|
+
return archRuns
|
|
1061
|
+
? row(STATUS_PENDING, "HMOS does not exist yet; discover.arch runs git init when it creates the shell")
|
|
1062
|
+
: row(STATUS_FAIL, "HMOS does not exist or is empty, and discover.arch does not run this round, so nothing will create the repo; logic.spec_pipeline requires HMOS to be a git repo root");
|
|
1063
|
+
}
|
|
1064
|
+
const r = spawnSync("git", ["-C", p, "rev-parse", "--show-toplevel"], { encoding: "utf8", windowsHide: true });
|
|
1065
|
+
const norm = (x) => {
|
|
1066
|
+
let v = path.resolve(x);
|
|
1067
|
+
try {
|
|
1068
|
+
v = fs.realpathSync.native(v);
|
|
1069
|
+
} catch {
|
|
1070
|
+
/* keep the resolve result */
|
|
1071
|
+
}
|
|
1072
|
+
return process.platform === "win32" ? v.toLowerCase() : v;
|
|
1073
|
+
};
|
|
1074
|
+
if (r.status !== 0) {
|
|
1075
|
+
return row(STATUS_FAIL, `not a git repo; logic.spec_pipeline requires HMOS to be a repo root; run git -C "${p}" init and make one commit first`);
|
|
1076
|
+
}
|
|
1077
|
+
const top = String(r.stdout || "").trim();
|
|
1078
|
+
if (norm(top) !== norm(p)) {
|
|
1079
|
+
return row(STATUS_FAIL, `inside the parent repo ${top.replace(/\\/g, "/")}, not a repo root; logic.spec_pipeline would abort at I2. Run git init inside HMOS (to create a separate repo) and rerun`);
|
|
1080
|
+
}
|
|
1081
|
+
return row(STATUS_OK, "is a git repo root");
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/** Whether app.signingConfigs in build-profile.json5 has at least one entry (adopt.signing / cold-start smoke use this to decide whether to sign first). */
|
|
1085
|
+
export function hasSigningConfig(hmos) {
|
|
1086
|
+
let text = "";
|
|
1087
|
+
try {
|
|
1088
|
+
text = fs.readFileSync(path.join(hmos, "build-profile.json5"), "utf8");
|
|
1089
|
+
} catch {
|
|
1090
|
+
return false;
|
|
1091
|
+
}
|
|
1092
|
+
const noComments = text.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|[^:])\/\/.*$/gm, "$1");
|
|
1093
|
+
return /["']?signingConfigs["']?\s*:\s*\[\s*\{/.test(noComments);
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Three-state verdict of `devecocli auth status`: true logged in / false not logged in / "unknown" unrecognized.
|
|
1098
|
+
* It may still exit 0 when not logged in (body "Not logged in"), so the exit code cannot be used; the old logic "logged in unless it says not logged in"
|
|
1099
|
+
* treated outputs like "Session expired", "token invalid", "please log in first" as logged in. Now both sides must match positively,
|
|
1100
|
+
* and if it looks like neither it is unknown (the caller gives a WARN with the raw text, neither passing it off as OK nor failing it wrongly).
|
|
1101
|
+
*/
|
|
1102
|
+
export function isDevecocliLoggedIn(exitOk, output) {
|
|
1103
|
+
const text = String(output || "");
|
|
1104
|
+
// devecocli may print Chinese whatever the install language; those forms are written as \u escapes.
|
|
1105
|
+
if (/not\s+logged\s+in|\u672a\u767b\u5f55|unauth|log\s*in\s+(first|required)|please log in first|\u8bf7\u5148\u767b\u5f55|session\s+expired|token\s+(expired|invalid)|has expired|\u5df2\u8fc7\u671f/i.test(text)) return false;
|
|
1106
|
+
if (!exitOk) return false;
|
|
1107
|
+
if (/logged\s+in|\u5df2\u767b\u5f55|login\s+success|account\s*[:\uff1a]|user(name)?\s*[:\uff1a]|current account|\u5f53\u524d\u8d26\u53f7/i.test(text)) return true;
|
|
1108
|
+
return "unknown";
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
/** HarmonyOS emulator hdc serials start with 127.0.0.1: (consistent with a2h-coldstart-smoke-gate's real-device check). */
|
|
1112
|
+
export function isEmulatorHdcTarget(target) {
|
|
1113
|
+
return String(target || "").trim().startsWith("127.0.0.1:");
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/** emulatorOnly: at least one device, and all of them emulators. Does not count when a real device is also connected. For an empty list both are false. */
|
|
1117
|
+
export function classifyHdcTargets(targets) {
|
|
1118
|
+
const list = (targets || []).map((t) => String(t).trim()).filter(Boolean);
|
|
1119
|
+
return {
|
|
1120
|
+
emulatorOnly: list.length > 0 && list.every(isEmulatorHdcTarget),
|
|
1121
|
+
realDevice: list.some((t) => !isEmulatorHdcTarget(t)),
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
/** Public target of the emulator network probe: AliDNS, one of the most reliably reachable public IPs in mainland China. */
|
|
1126
|
+
export const EMULATOR_NET_PROBE_HOST = "223.5.5.5";
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Emulator network connectivity verdict, checked only when an emulator is used (a real device handles its own network, so it is not checked):
|
|
1130
|
+
* the HarmonyOS emulator goes through the host NAT, and a host VPN / proxy / firewall often cuts the emulator off from the public network,
|
|
1131
|
+
* so networked steps fail mysteriously at run time; the preflight exposes this by `hdc shell ping`-ing a public IP.
|
|
1132
|
+
* The result is only a WARN, never a Hard-Stop: no step at preflight time strictly needs the network.
|
|
1133
|
+
* ok=false means hdc / the shell itself errored or timed out (described separately from "ping sent but no reply").
|
|
1134
|
+
*/
|
|
1135
|
+
export function assessEmulatorNetwork(ok, output = "", target = "") {
|
|
1136
|
+
const path = `hdc -t ${target} shell ping`;
|
|
1137
|
+
const text = String(output || "");
|
|
1138
|
+
if (ok && (/\b1\s+(packets?\s+)?received\b/i.test(text) || /bytes from/i.test(text))) {
|
|
1139
|
+
return { status: STATUS_OK, path, detail: `${target} can reach the public network (${EMULATOR_NET_PROBE_HOST} replied)` };
|
|
1140
|
+
}
|
|
1141
|
+
const excerpt = text.replace(/\x1b\[[0-9;]*m/g, "").trim().split(/\r?\n/).filter(Boolean).slice(-1)[0]?.slice(0, 160) || "(no output)";
|
|
1142
|
+
if (!ok) {
|
|
1143
|
+
return {
|
|
1144
|
+
status: STATUS_WARN,
|
|
1145
|
+
path,
|
|
1146
|
+
detail: `could not complete the network probe ("${excerpt}"): the shell of ${target} is unavailable or ping timed out; if later steps need the network, fix the emulator network first and rerun`,
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
return {
|
|
1150
|
+
status: STATUS_WARN,
|
|
1151
|
+
path,
|
|
1152
|
+
detail: `${target} ping ${EMULATOR_NET_PROBE_HOST} got no reply: the network inside the emulator is unreachable (a host VPN / proxy / firewall often cuts the emulator NAT), so steps that need the network will fail`,
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* Emulator network connectivity check row, checked only when an emulator is used (not for real devices; then it returns null and produces no row):
|
|
1158
|
+
* when any online hdc target is an emulator (127.0.0.1:) → probe the public-network connectivity of the first emulator
|
|
1159
|
+
* via `hdc -t <target> shell ping`. The result is only a WARN, never a Hard-Stop: no step at preflight time strictly needs the network.
|
|
1160
|
+
*/
|
|
1161
|
+
export function checkEmulatorNetwork(hdc, targets) {
|
|
1162
|
+
const emulatorTarget = (targets || []).find(isEmulatorHdcTarget);
|
|
1163
|
+
if (!emulatorTarget) return null;
|
|
1164
|
+
const [ok, out] = runShell(
|
|
1165
|
+
hdc,
|
|
1166
|
+
["-t", emulatorTarget, "shell", "ping", "-c", "1", "-W", "2", EMULATOR_NET_PROBE_HOST],
|
|
1167
|
+
{ timeout: 15_000 },
|
|
1168
|
+
);
|
|
1169
|
+
return { param: "emulator network", ...assessEmulatorNetwork(ok, out, emulatorTarget) };
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* How strict the login requirement is. Only emulators connected -> not checked: emulators can install unsigned HAPs, cold-start smoke does no signing precheck,
|
|
1174
|
+
* and `devecocli auth login` is not required (with a real device also connected it is not "emulators only").
|
|
1175
|
+
* Without this exception: when the logic pipeline runs this round and the project has no signing config yet, the later
|
|
1176
|
+
* `devecocli signature generate` (adopt.signing) requires login -> "fail".
|
|
1177
|
+
* With an existing signing config login is no longer a precondition; real devices only and no signing -> smoke records DEPLOY_ERROR without blocking the round -> "warn".
|
|
1178
|
+
* Not checked when the logic pipeline is reused / skipped and there is no real device.
|
|
1179
|
+
*/
|
|
1180
|
+
export function devecocliLoginNeed({ logicPipelineRuns, realDevice, emulatorOnly = false, signed }) {
|
|
1181
|
+
if (signed || emulatorOnly) return null;
|
|
1182
|
+
if (logicPipelineRuns) return "fail";
|
|
1183
|
+
if (realDevice) return "warn";
|
|
1184
|
+
return null;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* Environment preflight's verdict on devecocli login. need = the result of devecocliLoginNeed;
|
|
1189
|
+
* returns null when need is empty, or the CLI is absent (loggedIn === null, the version check already failed).
|
|
1190
|
+
*/
|
|
1191
|
+
export function assessDevecocliLogin({ needed, loggedIn, output = "" }) {
|
|
1192
|
+
if (!needed || loggedIn == null) return null;
|
|
1193
|
+
const path = "devecocli auth status";
|
|
1194
|
+
if (loggedIn === true) return { status: STATUS_OK, path, detail: "logged in" };
|
|
1195
|
+
const why = needed === "warn"
|
|
1196
|
+
? "the project is unsigned and a real device is connected: signature generate in the cold-start smoke needs login, otherwise it records DEPLOY_ERROR"
|
|
1197
|
+
: "the project is unsigned, and devecocli signature generate in adopt.signing needs login";
|
|
1198
|
+
if (loggedIn === "unknown") {
|
|
1199
|
+
const excerpt = String(output).trim().split(/\r?\n/)[0]?.slice(0, 120) || "(no output)";
|
|
1200
|
+
return { status: STATUS_WARN, path, detail: `cannot tell the login state ("${excerpt}"); ${why}. Make sure devecocli auth login has been run` };
|
|
1201
|
+
}
|
|
1202
|
+
return {
|
|
1203
|
+
status: needed === "warn" ? STATUS_WARN : STATUS_FAIL,
|
|
1204
|
+
path,
|
|
1205
|
+
detail: `not logged in. ${why}; run devecocli auth login first${needed === "warn" ? "" : ", then start over"}`,
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* ui.batch's STATE_DOCS (the state_doc.mjs check of a2h-batch-ui-align Step 1) reads the official state management docs via `devecocli docs`.
|
|
1211
|
+
* The `docs` subcommand exists since 1.0.0 (preflight already requires >= 1.2), so what is checked here is not the version but
|
|
1212
|
+
* whether the local doc index returns anything: a corrupt index or missing docs.zip must surface in preflight, not halt ui.batch midway.
|
|
1213
|
+
* Running this once serially also completes the first index build after a fresh install / `docs update`, so the later check's concurrent searches will not hit the lock.
|
|
1214
|
+
*/
|
|
1215
|
+
export const DOCS_PROBE_ARGS = ["docs", "search", "arkts-track", "--catalog", "harmonyos-guides", "--format", "json", "--limit", "1"];
|
|
1216
|
+
|
|
1217
|
+
export function assessDevecocliDocs(ok, output = "") {
|
|
1218
|
+
const path = `devecocli ${DOCS_PROBE_ARGS.slice(0, 2).join(" ")}`;
|
|
1219
|
+
const text = String(output);
|
|
1220
|
+
if (ok && /"documentId"\s*:/.test(text)) return { status: STATUS_OK, path, detail: "local doc index available" };
|
|
1221
|
+
const excerpt = text.replace(/\x1b\[[0-9;]*m/g, "").trim().split(/\r?\n/).filter(Boolean).slice(-1)[0]?.slice(0, 160) || "(no output)";
|
|
1222
|
+
const why = /Lock file is already being held|ELOCKED/.test(text)
|
|
1223
|
+
? "another devecocli process is building the doc index; rerun preflight after it finishes"
|
|
1224
|
+
: "try `devecocli docs update`; if it still fails, reinstall @deveco/deveco-cli as prompted";
|
|
1225
|
+
return {
|
|
1226
|
+
status: STATUS_WARN,
|
|
1227
|
+
path,
|
|
1228
|
+
detail: `doc search unavailable ("${excerpt}"): the STATE_DOCS check in ui.batch will fail and stop to ask whether to continue without the official state management docs; ${why}`,
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
export function runEnvPreflight(args) {
|
|
1233
|
+
const pathReport = runPreflight(args);
|
|
1234
|
+
const pathRows = pathReport.rows;
|
|
1235
|
+
const hardFailures = [...pathReport.hard_failures];
|
|
1236
|
+
const warnings = [...pathReport.warnings];
|
|
1237
|
+
const envRows = [];
|
|
1238
|
+
|
|
1239
|
+
function appendEnv(param, p, status, detail) {
|
|
1240
|
+
envRows.push({ param, path: p, status, detail });
|
|
1241
|
+
if (status === STATUS_FAIL) hardFailures.push(`${param}: ${detail}`);
|
|
1242
|
+
else if (status === STATUS_WARN) warnings.push(`${param}: ${detail}`);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
const knobs = resolveRunKnobs(args);
|
|
1246
|
+
for (const r of knobs.rows) {
|
|
1247
|
+
appendEnv(r.param, r.path, r.status, r.detail);
|
|
1248
|
+
}
|
|
1249
|
+
// An invalid profile has already FAILed; later decisions continue as full so this report lists all the other problems too
|
|
1250
|
+
const profile = knobs.values.profile || "full";
|
|
1251
|
+
// Whether each chain actually runs this round -- only check items needed by nodes that will run (will run and missing means certain failure -> FAIL; will degrade/skip -> WARN).
|
|
1252
|
+
const uiNeeded = needUiLane(Boolean(args.uiReused));
|
|
1253
|
+
const logicRuns = profile !== "ui-only" && !args.skipLogic;
|
|
1254
|
+
const specGenRuns = logicRuns && !args.skipSpecGen;
|
|
1255
|
+
const specPipelineRuns = logicRuns && !args.skipLogicPipeline;
|
|
1256
|
+
for (const r of checkIncremental({
|
|
1257
|
+
profile, scopeRequest: args.scopeRequest, specEngine: knobs.values.spec_engine,
|
|
1258
|
+
hmosMode: pathReport.hmos_mode || "", logicRuns,
|
|
1259
|
+
scopeDoc: args.scopeDoc, androidDiff: args.androidDiff, scopeFile: args.scopeFile, android: args.android,
|
|
1260
|
+
})) {
|
|
1261
|
+
appendEnv(r.param, r.path, r.status, r.detail);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
const interaction = resolveInteraction(args.interactionMode, args.interactiveGates);
|
|
1265
|
+
if (interaction) {
|
|
1266
|
+
appendEnv("INTERACTION_MODE", interaction.mode || String(args.interactionMode), interaction.status, interaction.detail);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
if (args.skipCrawl) {
|
|
1270
|
+
appendEnv("SKIP_CRAWL", "(removed)", STATUS_WARN,
|
|
1271
|
+
"this switch was removed and no longer has any effect: ui.batch has no mode that skips capture (a2h-utg-explorer capture needs an adb device)");
|
|
1272
|
+
}
|
|
1273
|
+
if (args.skipUi) {
|
|
1274
|
+
appendEnv("SKIP_UI", "(removed)", STATUS_WARN,
|
|
1275
|
+
"this switch was removed and no longer has any effect: there is no switch to skip the whole UI chain any more; to reuse existing UI outputs pass --ui-reused");
|
|
1276
|
+
}
|
|
1277
|
+
if (!isUnsetValue(args.autoglmApiKey)) {
|
|
1278
|
+
appendEnv("AUTOGLM_API_KEY", "(removed)", STATUS_WARN,
|
|
1279
|
+
"this parameter was removed and no longer has any effect: both full and incremental ui.batch captures are done by a2h-utg-explorer, which needs no model key");
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
// All main-flow leaves are Node (.mjs); Python is no longer probed.
|
|
1283
|
+
const archRuns = !args.skipArch;
|
|
1284
|
+
|
|
1285
|
+
{
|
|
1286
|
+
const [st, p, detail] = checkCommand("node", ["--version"], { minVersion: [22, 18], required: true });
|
|
1287
|
+
appendEnv("Node.js", p, st, detail);
|
|
1288
|
+
}
|
|
1289
|
+
{
|
|
1290
|
+
const [st, p, detail] = checkCommand("npm", ["--version"], { required: true });
|
|
1291
|
+
appendEnv("npm", p, st, detail);
|
|
1292
|
+
}
|
|
1293
|
+
{
|
|
1294
|
+
const [st, p, detail] = checkCommand("git", ["--version"], { required: true });
|
|
1295
|
+
appendEnv("git", p, st, detail);
|
|
1296
|
+
const root = st === STATUS_OK ? checkHmosGitRoot(args.hmos, { logicRuns, archRuns }) : null;
|
|
1297
|
+
if (root) appendEnv(root.param, root.path, root.status, root.detail);
|
|
1298
|
+
}
|
|
1299
|
+
{
|
|
1300
|
+
const [st, p, detail] = checkCommand("devecocli", ["--version"], {
|
|
1301
|
+
minVersion: [1, 2],
|
|
1302
|
+
required: true,
|
|
1303
|
+
});
|
|
1304
|
+
appendEnv("devecocli", p, st, detail);
|
|
1305
|
+
// a2h-coldstart-smoke-gate needs >= 1.3.3, otherwise it returns SKIPPED_NO_CLI (smoke for arch / ui.batch / spec_pipeline is all skipped)
|
|
1306
|
+
const v = st === STATUS_OK ? parseVersion3(detail) : null;
|
|
1307
|
+
if (v && version3Lt(v, [1, 3, 3])) {
|
|
1308
|
+
appendEnv("devecocli (smoke)", p, STATUS_WARN, `version ${v.join(".")} < 1.3.3: the cold-start smoke will be SKIPPED_NO_CLI (it will not verify that the app starts)`);
|
|
1309
|
+
}
|
|
1310
|
+
// The first index build may take tens of seconds; the timeout is relaxed to 3 minutes.
|
|
1311
|
+
if (st === STATUS_OK && uiNeeded) {
|
|
1312
|
+
const [ok, out] = runShell(p, DOCS_PROBE_ARGS, { timeout: 180_000 });
|
|
1313
|
+
const row = assessDevecocliDocs(ok, out);
|
|
1314
|
+
appendEnv("devecocli docs", row.path, row.status, row.detail);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
{
|
|
1318
|
+
// Global CLI. When missing (or spec generation runs this round and the version is below the minimum), run `npm i -g homegraph@^1.5.2 arkanalyzer` in place,
|
|
1319
|
+
// and state the result as WARN; Hard-Stop only if the recheck still fails.
|
|
1320
|
+
const hg = ensureHomegraph({ minVersion: specGenRuns ? SPEC_HOMEGRAPH_MIN : null });
|
|
1321
|
+
appendEnv(...hg);
|
|
1322
|
+
// The minimum-version row is labelled "for a2h-spec-generate"; page-specgen does not go through reqgen, so the
|
|
1323
|
+
// row would misattribute the failure. The base homegraph row above still reports a missing/too-old CLI.
|
|
1324
|
+
if (specGenRuns && knobs.values.spec_engine !== "page-specgen") {
|
|
1325
|
+
const row = specHomegraphRow(hg[2], hg[3], { required: true });
|
|
1326
|
+
if (row) appendEnv(homegraphLabelFor(), hg[1], row.status, row.detail);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
// a2h-spec-generate's reqgen imports runtime dependencies by bare module name, resolvable only from node_modules walking up from the reqgen directory
|
|
1330
|
+
// (ht init attaches them to the global packages via npm link). With the link missing it fails with ERR_MODULE_NOT_FOUND at startup --
|
|
1331
|
+
// this must be stopped in preflight, not left until enrich.spec_gen. a2h-page-specgen is self-contained, so it never needs these links.
|
|
1332
|
+
if (reqgenDepsNeeded({ specGenRuns, specEngine: knobs.values.spec_engine })) {
|
|
1333
|
+
// a2h-spec-generate depends on HomeGraph for both Android and UniApp (the index lives at the sourceRoot chosen by the detector).
|
|
1334
|
+
const required = REQGEN_RUNTIME_PACKAGES;
|
|
1335
|
+
const missing = missingReqgenPackages(args.skillsRoot, required);
|
|
1336
|
+
if (missing.length) {
|
|
1337
|
+
appendEnv("reqgen dependencies", missing.join(", "), STATUS_FAIL,
|
|
1338
|
+
`reqgen in a2h-spec-generate cannot resolve ${missing.join(", ")}: rerun ht init (it npm-links these global packages), ` +
|
|
1339
|
+
`or run npm link ${required.join(" ")} under ${path.join(args.skillsRoot || "", "a2h-spec-generate", "scripts", "reqgen").replace(/\\/g, "/")}`);
|
|
1340
|
+
} else {
|
|
1341
|
+
appendEnv("reqgen dependencies", required.join(", "), STATUS_OK, "all resolvable (including the homegraph package; needed for both Android and UniApp)");
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
if (specPipelineRuns) {
|
|
1346
|
+
const hc = ensureHomecheck();
|
|
1347
|
+
appendEnv(hc.param, hc.path, hc.status, hc.detail);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
const { home: devecoHome, row: devecoRow } = checkDevecoHome({ required: uiNeeded || logicRuns });
|
|
1351
|
+
appendEnv(devecoRow.param, devecoRow.path, devecoRow.status, devecoRow.detail);
|
|
1352
|
+
|
|
1353
|
+
// Cold-start smoke (arch generate / ui.batch Step 6.3 / spec_pipeline wrap-up) uses hdc to find HarmonyOS devices; none -> SKIPPED_NO_DEVICE.
|
|
1354
|
+
// Emulators only does not require login; only an unsigned real device needs signing.
|
|
1355
|
+
let realDevice = false;
|
|
1356
|
+
let emulatorOnly = false;
|
|
1357
|
+
{
|
|
1358
|
+
const hdc = findHdc(devecoHome);
|
|
1359
|
+
if (!hdc) {
|
|
1360
|
+
appendEnv("hdc device", "(hdc not found)", STATUS_WARN, "the cold-start smoke will be SKIPPED_NO_DEVICE (it will not verify that the app starts)");
|
|
1361
|
+
} else {
|
|
1362
|
+
const [ok, out] = runShell(hdc, ["list", "targets"]);
|
|
1363
|
+
const targets = ok ? out.split(/\r?\n/).map((l) => l.trim()).filter((l) => l && !/\[Empty\]/i.test(l)) : [];
|
|
1364
|
+
({ realDevice, emulatorOnly } = classifyHdcTargets(targets));
|
|
1365
|
+
if (targets.length) appendEnv("hdc device", hdc, STATUS_OK, emulatorOnly ? `${targets.length} HarmonyOS emulator(s)` : `${targets.length} HarmonyOS device(s)/emulator(s)`);
|
|
1366
|
+
else appendEnv("hdc device", hdc, STATUS_WARN, "no HarmonyOS device/emulator: the cold-start smoke will be SKIPPED_NO_DEVICE");
|
|
1367
|
+
const net = checkEmulatorNetwork(hdc, targets);
|
|
1368
|
+
if (net) appendEnv(net.param, net.path, net.status, net.detail);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
const sourceInfo = detectSourceKind(args.android);
|
|
1373
|
+
const sourceKind = sourceInfo.kind;
|
|
1374
|
+
appendEnv(
|
|
1375
|
+
"SOURCE_KIND",
|
|
1376
|
+
sourceKind || "unknown",
|
|
1377
|
+
sourceKind === "unknown" ? STATUS_WARN : STATUS_OK,
|
|
1378
|
+
sourceKind === "uniapp"
|
|
1379
|
+
? `UniApp (sourceRoot=${sourceInfo.sourceRootRelative || "."})`
|
|
1380
|
+
: sourceKind === "android"
|
|
1381
|
+
? "Android Gradle"
|
|
1382
|
+
: "could not tell Android / UniApp; downstream leaves will detect it themselves",
|
|
1383
|
+
);
|
|
1384
|
+
|
|
1385
|
+
// application module: the UI chain (resource-convert) always needs it, and so does the spec generation chain when its engine
|
|
1386
|
+
// analyzes Gradle modules (a2h-spec-generate) -- it must be the same one. page-specgen works from the static UTG, so it takes none.
|
|
1387
|
+
// Do not backfill an empty string even when not needed this round: that would overwrite the app_module the user gave explicitly (needed by the next round / other chains).
|
|
1388
|
+
const requestedModule = argValue(args.appModule);
|
|
1389
|
+
let appModule = requestedModule && !requestedModule.startsWith(":") ? `:${requestedModule}` : requestedModule;
|
|
1390
|
+
if (appModuleNeeded({ uiNeeded, specGenRuns, specEngine: knobs.values.spec_engine })) {
|
|
1391
|
+
const r = resolveAppModule(detectAppModules(args.android), requestedModule, { sourceKind });
|
|
1392
|
+
appModule = r.value;
|
|
1393
|
+
appendEnv("APP_MODULE", r.value || "(undecided)", r.status, r.detail);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
// App signing is not checked: at the start there is often no project yet. Emulators only -> login not checked.
|
|
1397
|
+
// With a real device, or when the logic chain runs and it is not emulators only, signature generate requires being logged in.
|
|
1398
|
+
{
|
|
1399
|
+
const loginNeeded = devecocliLoginNeed({
|
|
1400
|
+
logicPipelineRuns: logicRuns && !args.skipLogicPipeline,
|
|
1401
|
+
realDevice,
|
|
1402
|
+
emulatorOnly,
|
|
1403
|
+
signed: hasSigningConfig(args.hmos),
|
|
1404
|
+
});
|
|
1405
|
+
let loggedIn = null;
|
|
1406
|
+
let authText = "";
|
|
1407
|
+
if (loginNeeded) {
|
|
1408
|
+
const cli = which("devecocli");
|
|
1409
|
+
if (cli) {
|
|
1410
|
+
const [authOk, authOut] = runShell(cli, ["auth", "status"]);
|
|
1411
|
+
authText = authOut;
|
|
1412
|
+
loggedIn = isDevecocliLoggedIn(authOk, authOut);
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
const login = assessDevecocliLogin({ needed: loginNeeded, loggedIn, output: authText });
|
|
1416
|
+
if (login) appendEnv("devecocli login", login.path, login.status, login.detail);
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
{
|
|
1420
|
+
const r = checkApk(args.apk, { required: uiNeeded });
|
|
1421
|
+
appendEnv(r.param, r.path, r.status, r.detail);
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
let adbInfo = { adb: "", serial: "" };
|
|
1425
|
+
// Capture happens in ui.batch Step 3.2 (I5 in incremental mode): whenever the UI chain runs an adb device is required (both Android and UniApp provide an APK).
|
|
1426
|
+
const crawlNeeded = uiNeeded;
|
|
1427
|
+
|
|
1428
|
+
checkSkillsRoot(envRows, hardFailures, args.skillsRoot || "",
|
|
1429
|
+
requiredSkills({ uiNeeded, specGenRuns, specEngine: knobs.values.spec_engine || DEFAULT_SPEC_ENGINE }));
|
|
1430
|
+
if (crawlNeeded) {
|
|
1431
|
+
adbInfo = checkAdb(envRows, hardFailures, warnings, {
|
|
1432
|
+
required: !args.allowNoDevice,
|
|
1433
|
+
serial: argValue(args.adbSerial),
|
|
1434
|
+
}) || adbInfo;
|
|
1435
|
+
const aapt = aaptRow(findAapt({ adbPath: adbInfo.adb }));
|
|
1436
|
+
appendEnv(aapt.param, aapt.path, aapt.status, aapt.detail);
|
|
1437
|
+
} else {
|
|
1438
|
+
appendEnv("adb device", "(skipped)", STATUS_PENDING, "UI chain does not run (reusing UI outputs)");
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
const allRows = [...pathRows, ...envRows];
|
|
1442
|
+
const markdown = renderEnvMarkdown(pathRows, envRows, hardFailures);
|
|
1443
|
+
|
|
1444
|
+
const exitCode = hardFailures.length ? 1 : 0;
|
|
1445
|
+
return {
|
|
1446
|
+
exit_code: exitCode,
|
|
1447
|
+
normalized: pathReport.normalized,
|
|
1448
|
+
path_rows: pathRows,
|
|
1449
|
+
env_rows: envRows,
|
|
1450
|
+
rows: allRows,
|
|
1451
|
+
hard_failures: hardFailures,
|
|
1452
|
+
warnings,
|
|
1453
|
+
markdown_table: markdown,
|
|
1454
|
+
hmos_mode: pathReport.hmos_mode || "",
|
|
1455
|
+
serialize_discover: pathReport.serialize_discover || false,
|
|
1456
|
+
defer_work_creation: pathReport.defer_work_creation || false,
|
|
1457
|
+
app_module: appModule,
|
|
1458
|
+
source_kind: sourceKind || "unknown",
|
|
1459
|
+
source_root: sourceInfo.sourceRoot || "",
|
|
1460
|
+
// Exported only when the directory structure check passes: downstream build-fixer / a2h-fix-build-errors use it directly instead of probing or asking the user themselves
|
|
1461
|
+
adb_path: adbInfo.serial ? String(adbInfo.adb).replace(/\\/g, "/") : "",
|
|
1462
|
+
// When the UI chain does not run this round no device was probed: backfill the user's explicit value, since an empty string would overwrite it (same as app_module)
|
|
1463
|
+
adb_serial: adbInfo.serial || (crawlNeeded ? "" : argValue(args.adbSerial) || ""),
|
|
1464
|
+
deveco_home: devecoRow.status === STATUS_OK ? String(devecoHome).replace(/\\/g, "/") : "",
|
|
1465
|
+
profile: knobs.values.profile || "",
|
|
1466
|
+
engine_mode: knobs.values.engine_mode || "",
|
|
1467
|
+
wave_width: knobs.values.wave_width ?? null,
|
|
1468
|
+
max_scenarios_per_chunk: knobs.values.max_scenarios_per_chunk ?? null,
|
|
1469
|
+
spec_concurrency: knobs.values.spec_concurrency ?? null,
|
|
1470
|
+
spec_engine: knobs.values.spec_engine || "",
|
|
1471
|
+
interaction_mode: interaction ? interaction.mode : "",
|
|
1472
|
+
interactive_gates: interaction ? interaction.gates : "",
|
|
1473
|
+
checks: {
|
|
1474
|
+
paths_preflight_passed: !pathReport.hard_failures.length,
|
|
1475
|
+
ui_lane_needed: uiNeeded,
|
|
1476
|
+
apk_valid: envRows.some((r) => r.param === "APK_PATH" && r.status === STATUS_OK),
|
|
1477
|
+
hmos_mode: pathReport.hmos_mode || "",
|
|
1478
|
+
serialize_discover: pathReport.serialize_discover || false,
|
|
1479
|
+
devecocli_available: envRows.some((r) => r.param === "devecocli" && r.status === STATUS_OK),
|
|
1480
|
+
source_kind: sourceKind || "unknown",
|
|
1481
|
+
},
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
/** Prefix of the last line of --report; the orchestrator locates the machine-readable variable line by this prefix. */
|
|
1486
|
+
export const PREFLIGHT_VARS_PREFIX = "PREFLIGHT_VARS ";
|
|
1487
|
+
|
|
1488
|
+
/** Fields needed by set_vars_from_preflight in workflow.yaml (plus exit_code for verification). */
|
|
1489
|
+
/**
|
|
1490
|
+
* The preflight Markdown shown to the user. buildMarkdownTable writes an H2 that is demoted to
|
|
1491
|
+
* H3 here, so the title and the .replace() use the same heading strings.
|
|
1492
|
+
*/
|
|
1493
|
+
export function renderEnvMarkdown(pathRows, envRows, hardFailures = []) {
|
|
1494
|
+
const h2Paths = "## Paths";
|
|
1495
|
+
const h2Env = "## Toolchain and Config";
|
|
1496
|
+
const pathMd = buildMarkdownTable(pathRows, { title: h2Paths.replace(/^## /, "") });
|
|
1497
|
+
const envMd = buildMarkdownTable(envRows, { title: h2Env.replace(/^## /, "") });
|
|
1498
|
+
let markdown = [
|
|
1499
|
+
"# Environment Precheck (a2h-app-migrate)",
|
|
1500
|
+
"",
|
|
1501
|
+
pathMd.replace(h2Paths, "### Paths"),
|
|
1502
|
+
"",
|
|
1503
|
+
envMd.replace(h2Env, "### Toolchain and Config"),
|
|
1504
|
+
].join("\n");
|
|
1505
|
+
|
|
1506
|
+
if (hardFailures.length) {
|
|
1507
|
+
markdown += "\n\n### Suggested Fixes\n";
|
|
1508
|
+
hardFailures.forEach((msg, i) => {
|
|
1509
|
+
markdown += `${i + 1}. ${msg}\n`;
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
return markdown;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
export function preflightVars(report) {
|
|
1516
|
+
return {
|
|
1517
|
+
exit_code: report.exit_code,
|
|
1518
|
+
hmos_mode: report.hmos_mode || "",
|
|
1519
|
+
serialize_discover: Boolean(report.serialize_discover),
|
|
1520
|
+
defer_work_creation: Boolean(report.defer_work_creation),
|
|
1521
|
+
app_module: report.app_module || "",
|
|
1522
|
+
source_kind: report.source_kind || "unknown",
|
|
1523
|
+
source_root: report.source_root || "",
|
|
1524
|
+
deveco_home: report.deveco_home || "",
|
|
1525
|
+
adb_path: report.adb_path || "",
|
|
1526
|
+
adb_serial: report.adb_serial || "",
|
|
1527
|
+
// Normalized run knobs (empty / null for invalid values, with exit_code=1)
|
|
1528
|
+
profile: report.profile || "",
|
|
1529
|
+
engine_mode: report.engine_mode || "",
|
|
1530
|
+
wave_width: report.wave_width ?? null,
|
|
1531
|
+
max_scenarios_per_chunk: report.max_scenarios_per_chunk ?? null,
|
|
1532
|
+
spec_concurrency: report.spec_concurrency ?? null,
|
|
1533
|
+
spec_engine: report.spec_engine || "",
|
|
1534
|
+
// Normalized values (all expanded, short names completed, in fixed order); empty interaction_mode = not passed or invalid (invalid sets exit_code=1)
|
|
1535
|
+
interaction_mode: report.interaction_mode || "",
|
|
1536
|
+
interactive_gates: report.interactive_gates || "",
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
/** --report output: Markdown table + a single line `PREFLIGHT_VARS {json}` (always the last line). */
|
|
1541
|
+
export function formatReport(report) {
|
|
1542
|
+
return `${report.markdown_table}\n\n${PREFLIGHT_VARS_PREFIX}${JSON.stringify(preflightVars(report))}\n`;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
/** Parse the variable line from --report output; returns null if not found or unparseable (the orchestrator should treat that as a preflight failure). */
|
|
1546
|
+
export function parsePreflightVars(output) {
|
|
1547
|
+
const lines = String(output).split(/\r?\n/).filter((l) => l.startsWith(PREFLIGHT_VARS_PREFIX));
|
|
1548
|
+
if (lines.length !== 1) return null;
|
|
1549
|
+
try {
|
|
1550
|
+
return JSON.parse(lines[0].slice(PREFLIGHT_VARS_PREFIX.length));
|
|
1551
|
+
} catch {
|
|
1552
|
+
return null;
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
function main() {
|
|
1557
|
+
const rawArgv = process.argv.slice(2);
|
|
1558
|
+
const args = parseArgs(rawArgv, {
|
|
1559
|
+
required: ["android", "hmos"],
|
|
1560
|
+
defaults: {
|
|
1561
|
+
work: "",
|
|
1562
|
+
runDir: "",
|
|
1563
|
+
uiInfoRoot: "",
|
|
1564
|
+
skillsRoot: "",
|
|
1565
|
+
profile: "full",
|
|
1566
|
+
specsJson: "",
|
|
1567
|
+
autoglmApiKey: "", // removed: parsed only for compatibility with old callers; passing it only gives a WARN
|
|
1568
|
+
apk: "",
|
|
1569
|
+
appModule: "",
|
|
1570
|
+
adbSerial: "",
|
|
1571
|
+
engineMode: "",
|
|
1572
|
+
specEngine: "",
|
|
1573
|
+
waveWidth: "",
|
|
1574
|
+
maxScenariosPerChunk: "",
|
|
1575
|
+
specConcurrency: "",
|
|
1576
|
+
scopeRequest: "",
|
|
1577
|
+
scopeDoc: "",
|
|
1578
|
+
androidDiff: "",
|
|
1579
|
+
scopeFile: "",
|
|
1580
|
+
},
|
|
1581
|
+
flags: [
|
|
1582
|
+
"specsJsonIsDefault",
|
|
1583
|
+
"specsJsonRequired",
|
|
1584
|
+
"skipCrawl", // removed: parsed only for compatibility with old callers; passing it only gives a WARN
|
|
1585
|
+
"skipLogic",
|
|
1586
|
+
"skipSpecGen",
|
|
1587
|
+
"skipUtgStatic", // L2: never used (no check belongs to utg_static alone); parsed only so old callers do not hit Unknown option
|
|
1588
|
+
"skipArch",
|
|
1589
|
+
"skipModuleDocs", // L2: never used (module_docs needs only what always runs); parsed only for old callers
|
|
1590
|
+
"skipLogicPipeline",
|
|
1591
|
+
"skipUi", // removed: parsed only for compatibility with old callers; passing it only gives a WARN and no longer skips UI
|
|
1592
|
+
"uiReused",
|
|
1593
|
+
"allowNoDevice",
|
|
1594
|
+
"markdownOnly",
|
|
1595
|
+
"jsonOnly",
|
|
1596
|
+
"report",
|
|
1597
|
+
],
|
|
1598
|
+
// Must stay undefined when not passed (resolveInteraction relies on it to skip the interaction check)
|
|
1599
|
+
optional: ["interactionMode", "interactiveGates"],
|
|
1600
|
+
});
|
|
1601
|
+
|
|
1602
|
+
// Customer one-shot defaults (same as former run-env-preflight.mjs wrapper).
|
|
1603
|
+
if (!args.work) {
|
|
1604
|
+
args.work = path.join(args.hmos, ".hometrans", "app-migrate");
|
|
1605
|
+
}
|
|
1606
|
+
if (!args.runDir) {
|
|
1607
|
+
// The run directory is decided by run_dir.mjs's pointer (each new run gets a new one); with no pointer yet it stays empty = to be decided by enrich.spec_gen.
|
|
1608
|
+
args.runDir = readPointer(args.work);
|
|
1609
|
+
}
|
|
1610
|
+
if (!args.uiInfoRoot) {
|
|
1611
|
+
args.uiInfoRoot = path.join(args.hmos, ".hometrans", "ui_info");
|
|
1612
|
+
}
|
|
1613
|
+
if (!args.skillsRoot) {
|
|
1614
|
+
// Auto-detect: script lives in .../a2h-app-migrate/scripts/
|
|
1615
|
+
args.skillsRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
1616
|
+
}
|
|
1617
|
+
if (!args.specsJson && !args.specsJsonIsDefault) {
|
|
1618
|
+
args.specsJsonIsDefault = true;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
const report = runEnvPreflight(args);
|
|
1622
|
+
if (args.report) {
|
|
1623
|
+
process.stdout.write(formatReport(report));
|
|
1624
|
+
} else if (args.markdownOnly) {
|
|
1625
|
+
process.stdout.write(report.markdown_table + "\n");
|
|
1626
|
+
} else {
|
|
1627
|
+
process.stdout.write(JSON.stringify(report, null, 2) + "\n");
|
|
1628
|
+
}
|
|
1629
|
+
return report.exit_code;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
// Node realpaths import.meta.url (the main module) but keeps process.argv[1]
|
|
1633
|
+
// as typed, and neither normalises the Windows drive-letter case; comparing
|
|
1634
|
+
// the two naively made a symlinked/junctioned invocation (a common way to
|
|
1635
|
+
// install skills) a silent no-op exit 0 — for a gate script that means the
|
|
1636
|
+
// gate silently PASSES. Compare canonical real paths instead.
|
|
1637
|
+
function canonicalScriptPath(p) {
|
|
1638
|
+
let out;
|
|
1639
|
+
try {
|
|
1640
|
+
out = fs.realpathSync.native(p);
|
|
1641
|
+
} catch {
|
|
1642
|
+
out = path.resolve(p);
|
|
1643
|
+
}
|
|
1644
|
+
return process.platform === "win32" ? out.toLowerCase() : out;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
const isDirect =
|
|
1648
|
+
process.argv[1] && canonicalScriptPath(process.argv[1]) === canonicalScriptPath(fileURLToPath(import.meta.url));
|
|
1649
|
+
if (isDirect) {
|
|
1650
|
+
try {
|
|
1651
|
+
process.exit(main());
|
|
1652
|
+
} catch (err) {
|
|
1653
|
+
process.stderr.write(String(err?.message || err) + "\n");
|
|
1654
|
+
process.exit(2);
|
|
1655
|
+
}
|
|
1656
|
+
}
|