@buaa_smat/hometrans 26.0.1 → 26.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -7
- package/agents/code-reviewer.md +25 -138
- package/dist/cli/index.js +4 -1
- package/dist/cli/init.js +131 -26
- package/dist/cli/uninstall.js +5 -5
- package/dist/platform/language.js +77 -0
- package/env-requirements.json +30 -5
- package/i18n/FILE-NAMES.md +9 -0
- package/i18n/agents/code-reviewer.md +364 -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 +198 -0
- package/i18n/skills/a2h-app-migrate/references/config.example.json +28 -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 +1760 -0
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +114 -0
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1588 -0
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +657 -0
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +541 -0
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +131 -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 +698 -0
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +89 -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 +219 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -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 +146 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -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 +171 -0
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/i18n/skills/a2h-arch-generate/SKILL.md +375 -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 +120 -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/references/ISSUES.md +9 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +192 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +303 -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 +587 -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 +352 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +323 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +31 -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 +80 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +22 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +87 -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 +57 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +29 -0
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +705 -0
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +417 -0
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +139 -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 +2549 -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 +148 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +220 -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 +216 -0
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +203 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +210 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +2005 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +1748 -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 +1787 -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 +1836 -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 +1406 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1226 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1220 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +412 -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 +173 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +629 -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 +67 -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/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/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/layout_placement.ts +551 -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 +374 -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/padding_in_size.ts +119 -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 +80 -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/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 +97 -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 +75 -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/theme_color.ts +123 -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/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_layout_placement.test.mjs +427 -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_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/build_conversion_set.test.mjs +560 -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 +324 -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 +325 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -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 +59 -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 +2048 -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 +227 -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 +136 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +177 -0
- package/i18n/skills/a2h-page-specgen/references/gates.md +262 -0
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +173 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +207 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +576 -0
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +138 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +262 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +176 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +248 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +506 -0
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +299 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +616 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1166 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -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/utg/click_paths.json +28 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -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 +54 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +271 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +83 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +77 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +419 -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 +323 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +511 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -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 +1765 -0
- package/i18n/skills/a2h-resource-convert/SKILL.md +367 -0
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +335 -0
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +251 -0
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +219 -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 +249 -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 +2532 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +278 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +260 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +163 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +44 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +589 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +506 -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 +120 -0
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +279 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +918 -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/recover_b.mjs +550 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +380 -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/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/interruptions.test.mjs +492 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -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/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/semantics.mjs +1412 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +2037 -0
- package/i18n/skills/a2h-utg-static/SKILL.md +368 -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 +2120 -0
- package/i18n/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +609 -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/fragment_nav.mjs +1137 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +660 -0
- package/i18n/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +913 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +517 -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 +108 -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_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_scope.mjs +293 -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 +44 -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_source.mjs +231 -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 +1351 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
- package/package.json +13 -160
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/skills/a2h-app-migrate/SKILL.md +17 -6
- package/skills/a2h-app-migrate/references/config.example.json +1 -0
- package/skills/a2h-app-migrate/references/stage-map.md +3 -1
- package/skills/a2h-app-migrate/references/workflow.yaml +138 -47
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +1 -2
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +105 -39
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +7 -8
- package/skills/a2h-app-migrate/scripts/ledger.mjs +17 -5
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +43 -7
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +127 -41
- 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 +131 -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 +698 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +89 -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_infer_android_root.mjs +91 -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 +111 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +53 -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 +219 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -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 +147 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +344 -0
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +53 -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 +178 -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 +1 -1
- 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 +15 -6
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +2 -2
- package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +35 -46
- 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 +191 -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 +138 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +2 -5
- package/skills/a2h-arkts-logic-coder/SKILL.md +21 -2
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +1 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +62 -0
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +4 -0
- 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 +583 -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 +352 -0
- package/skills/a2h-batch-ui-align/SKILL.md +6 -4
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +1 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +22 -3
- package/skills/a2h-batch-ui-align/references/checker-rules.md +66 -3
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +45 -8
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -5
- 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/step4-prepare.md +4 -2
- package/skills/a2h-batch-ui-align/references/step5-convert.md +7 -5
- package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +6 -7
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +84 -7
- package/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +229 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1 -2
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +4 -5
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +88 -26
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +305 -12
- package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +231 -54
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +8 -9
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +18 -5
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +103 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +1 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +14 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +8 -0
- 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/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/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/media_content.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +66 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
- 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/scroll_delta.ts +178 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
- 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 +6 -0
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +217 -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_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_fidelity.test.mjs +507 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -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_review_fixes.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +235 -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_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_weight_color.test.mjs +473 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +567 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +290 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +74 -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 +420 -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/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_queue.test.mjs +1628 -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/image_probe.test.mjs +243 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +297 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -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-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_page_capture.mjs +147 -0
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- 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_scan_and_commit.mjs +388 -0
- package/skills/a2h-page-specgen/SKILL.md +136 -0
- package/skills/a2h-page-specgen/references/body-language.md +177 -0
- package/skills/a2h-page-specgen/references/evidence.md +70 -0
- package/skills/a2h-page-specgen/references/execution-model.md +255 -0
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +250 -0
- package/skills/a2h-page-specgen/references/gates.md +255 -0
- package/skills/a2h-page-specgen/references/page-inventory.md +173 -0
- package/skills/a2h-page-specgen/references/spec-template.md +207 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +209 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +422 -0
- package/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
- package/skills/a2h-page-specgen/scripts/gate.mjs +558 -0
- package/skills/a2h-page-specgen/scripts/interactions.mjs +137 -0
- package/skills/a2h-page-specgen/scripts/inventory.mjs +269 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +255 -0
- package/skills/a2h-page-specgen/scripts/lib/deps-source.mjs +399 -0
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +137 -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/hg.mjs +175 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +234 -0
- package/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +391 -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/prepare.mjs +492 -0
- package/skills/a2h-page-specgen/scripts/render.mjs +317 -0
- package/skills/a2h-page-specgen/scripts/report.mjs +7 -0
- package/skills/a2h-page-specgen/scripts/submission.mjs +532 -0
- package/skills/a2h-page-specgen/scripts/submit.mjs +79 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/README.md +77 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +590 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/cases.example.json +57 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +207 -0
- package/skills/a2h-page-specgen/scripts/test/dispatch.test.mjs +258 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1164 -0
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -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 +94 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/MainFragment.java +6 -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/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 +758 -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 +54 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +222 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +45 -0
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +464 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +120 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +68 -0
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +390 -0
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +167 -0
- package/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +503 -0
- package/skills/a2h-page-specgen/scripts/test/source-text.test.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -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 +1765 -0
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +1979 -0
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +313 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +1234 -0
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +298 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +49 -51
- 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/docs_only_i18n.test.mjs +44 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +79 -78
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +51 -12
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +24 -6
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +3 -2
- package/skills/a2h-spec-design-pipeline/references/initialization.md +15 -4
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +82 -41
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +61 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +19 -10
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +267 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +61 -8
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +62 -13
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +8 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +8 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +55 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +60 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/HttpExtraDataEmptyStringCheck.js +488 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +11 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +17 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +12 -38
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +40 -5
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +18 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +74 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +2 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +128 -5
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +98 -35
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +218 -37
- 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 +6 -7
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +3 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +348 -0
- package/skills/a2h-spec-design-pipeline/scripts/scan_shared.ts +642 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +15 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +7 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +104 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +24 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +394 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +24 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +163 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +15 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +350 -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 +121 -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 +87 -21
- 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/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/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 +230 -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/references/architecture.md +4 -0
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +64 -80
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +1 -2
- package/skills/a2h-utg-explorer/scripts/recover.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +5 -3
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -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/device_health.test.mjs +160 -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/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/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/interruptions.test.mjs +492 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -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/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/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 +454 -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/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 +13 -3
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +107 -65
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +155 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +28 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +19 -20
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +102 -2
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +2 -3
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +2 -3
- 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/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_login_interceptor.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +29 -1
- package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-app-migrate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-arch-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +0 -5
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +0 -54
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +0 -38
- package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-resource-convert/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/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_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,551 @@
|
|
|
1
|
+
// static_check/rules/layout_placement.ts — split out of arkts_static_check.ts (logic unchanged).
|
|
2
|
+
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { report } from '../core/findings.ts';
|
|
5
|
+
import { PCT_FULL, attrChainFrom, builderRoots, containerKids, definiteOnAxis, directUiChildren, hasAttr, importedStructNames, lineOfIndex, markedAbove, matchBracket, minOnAxis, rootChainAttrs, structBuildRoots } from '../core/parse.ts';
|
|
6
|
+
import type { UiAttr, UiChild } from '../core/parse.ts';
|
|
7
|
+
import { resolveStructFile } from '../core/scan.ts';
|
|
8
|
+
import type { FileScan, PctAutoRoot, StackHosted } from '../core/scan.ts';
|
|
9
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
10
|
+
|
|
11
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
12
|
+
export const meta: RuleMeta[] = [
|
|
13
|
+
{
|
|
14
|
+
id: "main-axis-pct-siblings",
|
|
15
|
+
levels: ["GATE", "CAND"],
|
|
16
|
+
invariant: "geometry",
|
|
17
|
+
card: "geometry",
|
|
18
|
+
needs: [],
|
|
19
|
+
summary: "≥2 direct children (including @Builder roots) of a `Row`/`Column` all write `'100%'` on the main axis; CAND when only 1 does and it has other siblings.",
|
|
20
|
+
fix: "`main-axis-pct-siblings` (GATE: ≥2 direct children of a `Row`/`Column` are all `'100%'` on the main axis, including `@Builder` root nodes; CAND when only 1 is and it has other siblings) → change to `.layoutWeight(n)`",
|
|
21
|
+
escape: null,
|
|
22
|
+
cases: [
|
|
23
|
+
"Measured source (where2study3): the mode tabs `Day Week Month Year` are four siblings that each write `.width('100%')` (on Android 0dp + weight=1); the first one takes the whole row and the other three are pushed off screen — the page appears to have \"only a day view\"",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "stack-child-align-noop",
|
|
28
|
+
levels: ["GATE", "CAND"],
|
|
29
|
+
invariant: "geometry",
|
|
30
|
+
card: "alignment",
|
|
31
|
+
needs: [],
|
|
32
|
+
summary: "a `Stack` has no alignContent, and a child relies on its own `.align()` to pin to the bottom/edge while wrapping its content on that axis.",
|
|
33
|
+
fix: "`stack-child-align-noop` (GATE: a `Stack` with no `alignContent` (both the constructor argument and its own `.alignContent()` / `.align()` count; the last one wins), whose child relies on its own `.align()` to pin to the bottom/edge while that child wraps its content on that axis) → set `alignContent` on the `Stack`",
|
|
34
|
+
escape: null,
|
|
35
|
+
cases: [
|
|
36
|
+
"[where2study3] In the settings page's `Stack()` (default alignContent=Center), the nav's outer Column writes `.align(Alignment.Bottom)`; `.align` only arranges the Column's own content and does not decide its position in the Stack — the bottom nav floats in the middle of the screen",
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "stack-overlay-default-center",
|
|
41
|
+
levels: ["GATE", "CAND"],
|
|
42
|
+
invariant: "geometry",
|
|
43
|
+
card: "alignment",
|
|
44
|
+
needs: [],
|
|
45
|
+
summary: "in a `Stack` with no alignContent (or set to Center), one of ≥2 siblings is positioned only by a one-sided margin, does not fill the height, and has no position/offset/align.",
|
|
46
|
+
fix: "`stack-overlay-default-center` (GATE: in a `Stack` likewise without `alignContent`, one of ≥2 siblings is positioned only by a one-sided `margin.bottom`/`margin.top`, does not fill the height, and has no position/offset/align; write `// STACK-CENTER: <basis>` for an intentional center to downgrade it to CAND) → set the matching `alignContent` on the `Stack`",
|
|
47
|
+
escape: "// STACK-CENTER:",
|
|
48
|
+
cases: [
|
|
49
|
+
"Measured (where2study7): Step 5.5 wiring copied `PhoneNavBar(...).margin({ left, right, bottom })` from the home page's `Stack({ alignContent: Alignment.Bottom })` to 4 other destination pages, but their root containers were written as `Stack()`.",
|
|
50
|
+
"Measured (ydweather observation cards): the UV index \"UV\" overlaps the number, humidity \"Comfortable\" overlaps the water-drop icon, and pressure \"hPa\" overlaps the arrow.",
|
|
51
|
+
"Measured (antennapod AddFeed): Grid().width('100%').margin({ top: 8 })",
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "stack-bar-default-center",
|
|
56
|
+
levels: ["GATE", "CAND"],
|
|
57
|
+
invariant: "geometry",
|
|
58
|
+
card: "alignment",
|
|
59
|
+
needs: [],
|
|
60
|
+
summary: "in a `Stack` with no alignContent, among ≥2 siblings one is horizontally `'100%'`, has a fixed height vertically and no positioning at all (the bar child is vertically centered).",
|
|
61
|
+
fix: "Compose Box / FrameLayout default to top-left: Box() translates to Stack({ alignContent: Alignment.TopStart }), Box(contentAlignment = X) translates to X; when centering is really intended, write // STACK-CENTER: <basis> above it",
|
|
62
|
+
escape: "// STACK-CENTER:",
|
|
63
|
+
cases: [
|
|
64
|
+
"Measured (ydweather home page): the top-right \"+\" icon appears at the middle right of the screen, and the top-right corner of the screenshot is empty",
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "fixed-box-text-wraps",
|
|
69
|
+
levels: ["GATE", "CAND"],
|
|
70
|
+
invariant: "geometry",
|
|
71
|
+
card: "geometry",
|
|
72
|
+
needs: [],
|
|
73
|
+
summary: "the literal text of a fixed-width, fixed-height `Text` does not fit by font-size estimate and there is no `maxLines`.",
|
|
74
|
+
fix: "`fixed-box-text-wraps` (GATE: the literal text of a fixed-width, fixed-height `Text` does not fit by font-size estimate and has no `maxLines`; CJK/symbols estimated at 1em, pure ASCII reported as GATE only when clearly overflowing; when the font size cannot be read as a number (`$r(...)`, a variable, `px`) it is estimated at 16 and downgraded to CAND) → `.maxLines(1)` + widen.",
|
|
75
|
+
escape: null,
|
|
76
|
+
cases: [
|
|
77
|
+
"[where2study3] `Text('•••').width(36).height(36)` without maxLines: `•` is wider in the HarmonyOS font than in Roboto, so it wraps to two lines and the three dots form \"⁘\".",
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "pct-in-auto-size-parent",
|
|
82
|
+
levels: ["GATE", "CAND"],
|
|
83
|
+
invariant: "geometry",
|
|
84
|
+
card: "geometry",
|
|
85
|
+
needs: [],
|
|
86
|
+
summary: "a container has no definite size on some axis (only a constraintSize min lower bound, or nothing written at all), while a direct child writes `'100%'` on the same axis; for a struct root, it is followed to the call sites.",
|
|
87
|
+
fix: "remove the child's `'100%'` and let the parent's `alignItems` and the child's `constraintSize({ min… })` size it; when equal heights are really required, measure with `onAreaChange` and set a value, or give the parent a definite size. When the size really is given from above, write `// PCT-PARENT-SIZED: <basis>` above the container to downgrade it to CAND.",
|
|
88
|
+
escape: "// PCT-PARENT-SIZED:",
|
|
89
|
+
cases: [
|
|
90
|
+
"Measured (where2study6 settings page): the SettingsSegmentedControl root Stack has only constraintSize({ minHeight }), while the inner Row and each segment write .height('100%'); it is reused in three places (default campus, max courses shown, style preview), and all of them are stretched very tall.",
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "card-width-wraps",
|
|
95
|
+
levels: ["GATE", "CAND"],
|
|
96
|
+
invariant: "geometry",
|
|
97
|
+
card: "geometry",
|
|
98
|
+
needs: [],
|
|
99
|
+
summary: "a child container in a `Column` (including @Builder roots) with a background color and a corner radius or stroke has no width declaration at all; a chip containing only Text/Image/SymbolGlyph is CAND.",
|
|
100
|
+
fix: "add `.width('100%')` to the card, and if the parent Column has no width either, add it there too; when it really wraps its content, write `// WRAP-WIDTH: <basis>` above it.",
|
|
101
|
+
escape: "// WRAP-WIDTH:",
|
|
102
|
+
cases: [
|
|
103
|
+
"Measured (where2study5 settings page): none of the 11 cards wrote a width, so each card shrank to its own content and the right edges are ragged, unlike the full-width card column on Android — compilation, GATE and smoke all passed.",
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "text-on-stateful-bg-no-color",
|
|
108
|
+
levels: ["GATE", "CAND"],
|
|
109
|
+
invariant: "appearance",
|
|
110
|
+
card: "dynamics",
|
|
111
|
+
needs: [],
|
|
112
|
+
summary: "a container's `backgroundColor` is a ternary expression, while neither its direct child `Text` nor its `Span`s have `fontColor`; CAND when only some Spans set a color.",
|
|
113
|
+
fix: "go back to the source and check the `setTextColor` in the same branch; when it really is the default color, write `// TEXT-COLOR-DEFAULT: <basis>` above it.",
|
|
114
|
+
escape: "// TEXT-COLOR-DEFAULT:",
|
|
115
|
+
cases: [
|
|
116
|
+
"Measured (where2study5 home-page period cells): the selected state is black text on green, while measure_pack measured white text.",
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
// ======================================================================
|
|
127
|
+
// The three layout-placement rules (main-axis-pct-siblings / stack-child-align-noop / fixed-box-text-wraps)
|
|
128
|
+
//
|
|
129
|
+
// have in common: compilation, resources and EVIDENCE all pass, only real-device rendering reveals them, but the criteria are lexical.
|
|
130
|
+
// - several siblings on the main axis each write '100%' (Android is 0dp + weight=1): the first takes it all, the rest are pushed out;
|
|
131
|
+
// - a Stack child's `.align` only arranges its own content and does not decide its position in the Stack;
|
|
132
|
+
// - fixed-size Text without maxLines: HarmonyOS font glyph widths differ from Roboto, so it wraps when it does not fit.
|
|
133
|
+
// ======================================================================
|
|
134
|
+
|
|
135
|
+
export const CONTAINER_KINDS: Set<string> = new Set<string>(['Column', 'Row', 'Stack', 'Flex', 'RelativeContainer']);
|
|
136
|
+
|
|
137
|
+
export const WIDTH_ATTRS: string[] = ['width', 'layoutWeight', 'flexGrow', 'flexBasis', 'constraintSize', 'size'];
|
|
138
|
+
|
|
139
|
+
export const RE_PCT_FULL_ARG: RegExp = PCT_FULL;
|
|
140
|
+
|
|
141
|
+
/** For card-width-wraps chip detection: a container holding only these leaf nodes is a pill/tag, not a card. */
|
|
142
|
+
export const CHIP_LEAF_KINDS: Set<string> = new Set<string>(['Text', 'Image', 'SymbolGlyph']);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Whether the `Text(...)` statement (at is its start) itself or its `{ Span(...) ... }` body sets fontColor.
|
|
146
|
+
* Returns 'own' = on the Text chain; 'all-spans' = every Span has one; 'some-spans' = only some Spans have one; 'none'.
|
|
147
|
+
*/
|
|
148
|
+
export function textColorCoverage(code: string, at: number, ownAttrs: UiAttr[]): 'own' | 'all-spans' | 'some-spans' | 'none' {
|
|
149
|
+
if (hasAttr(ownAttrs, 'fontColor')) { return 'own'; }
|
|
150
|
+
const paren: number = code.indexOf('(', at);
|
|
151
|
+
const pclose: number = paren < 0 ? -1 : matchBracket(code, paren);
|
|
152
|
+
if (pclose < 0) { return 'none'; }
|
|
153
|
+
let k: number = pclose + 1;
|
|
154
|
+
while (k < code.length && /\s/.test(code[k])) { k++; }
|
|
155
|
+
if (code[k] !== '{') { return 'none'; }
|
|
156
|
+
const bodyClose: number = matchBracket(code, k);
|
|
157
|
+
if (bodyClose < 0) { return 'none'; }
|
|
158
|
+
const body: string = code.slice(k, bodyClose);
|
|
159
|
+
const re: RegExp = /(^|[^\w$.])Span\s*\(/g;
|
|
160
|
+
let total: number = 0;
|
|
161
|
+
let colored: number = 0;
|
|
162
|
+
let m: RegExpExecArray | null;
|
|
163
|
+
while ((m = re.exec(body)) !== null) {
|
|
164
|
+
const sp: number = k + m.index + m[0].length - 1;
|
|
165
|
+
const sc: number = matchBracket(code, sp);
|
|
166
|
+
if (sc < 0) { continue; }
|
|
167
|
+
total++;
|
|
168
|
+
const [attrs] = attrChainFrom(code, sc + 1);
|
|
169
|
+
if (hasAttr(attrs, 'fontColor')) { colored++; }
|
|
170
|
+
}
|
|
171
|
+
if (total === 0 || colored === 0) { return 'none'; }
|
|
172
|
+
return colored === total ? 'all-spans' : 'some-spans';
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export const PCT_AUTO_MSG = (container: string, axis: string, childLine: number): string =>
|
|
176
|
+
`${container} has no definite ${axis === 'height' ? 'vertical' : 'horizontal'} size (no .${axis} / layoutWeight / aspectRatio, ` +
|
|
177
|
+
`at most a constraintSize lower bound), yet its direct child (line ${childLine}) sets .${axis}('100%'). ` +
|
|
178
|
+
'An Android WRAP_CONTENT parent + MATCH_PARENT child falls back to the content size in the second measure pass; ArkUI does not — ' +
|
|
179
|
+
'the percentage resolves against the outer constraint (about the viewport inside a Scroll / page Column), so the container is stretched very tall/wide, ' +
|
|
180
|
+
'while the build and every self-check before screenshot comparison pass. Fix: delete the child\'s \'100%\' and use the parent\'s alignItems / the child\'s ' +
|
|
181
|
+
'constraintSize({ min… }) instead; when the child must match the parent, measure the parent with onAreaChange and set a definite value, ' +
|
|
182
|
+
`or give the parent a definite .${axis}(). When the size really comes from above, write // PCT-PARENT-SIZED: <basis> above the parent`;
|
|
183
|
+
|
|
184
|
+
export function checkLayoutPlacement(code: string, rel: string, rawLines: string[] = [],
|
|
185
|
+
pctRoots: PctAutoRoot[] = [], stackHosted: StackHosted[] = []): void {
|
|
186
|
+
const importedNames: Set<string> = importedStructNames(code);
|
|
187
|
+
const roots: Map<string, UiChild> = builderRoots(code);
|
|
188
|
+
const structRootAt: Map<number, string> = new Map();
|
|
189
|
+
for (const r of structBuildRoots(code)) { structRootAt.set(r.paren, r.struct); }
|
|
190
|
+
// Attributes cannot be chained at a builder call site (compile error), so the size follows the builder root; component calls take their own chain
|
|
191
|
+
const attrsOf = (c: UiChild): UiAttr[] => (c.isBuilderCall ? (roots.get(c.name)?.attrs ?? []) : c.attrs);
|
|
192
|
+
const kindOf = (c: UiChild): string => (c.isBuilderCall ? (roots.get(c.name)?.name ?? '') : c.name);
|
|
193
|
+
const setsWidth = (a: UiAttr[]): boolean => a.some((x) =>
|
|
194
|
+
WIDTH_ATTRS.includes(x.name) &&
|
|
195
|
+
(x.name === 'constraintSize' ? /minWidth/.test(x.args) : x.name === 'size' ? /width/.test(x.args) : true));
|
|
196
|
+
|
|
197
|
+
const re: RegExp = /(^|[^\w$.])(Row|Column|Stack)\s*\(/g;
|
|
198
|
+
let m: RegExpExecArray | null;
|
|
199
|
+
while ((m = re.exec(code)) !== null) {
|
|
200
|
+
const kind: string = m[2];
|
|
201
|
+
const paren: number = m.index + m[0].length - 1;
|
|
202
|
+
const pclose: number = matchBracket(code, paren);
|
|
203
|
+
if (pclose < 0) { continue; }
|
|
204
|
+
let k: number = pclose + 1;
|
|
205
|
+
while (k < code.length && /\s/.test(code[k])) { k++; }
|
|
206
|
+
if (code[k] !== '{') { continue; }
|
|
207
|
+
const bodyClose: number = matchBracket(code, k);
|
|
208
|
+
if (bodyClose < 0) { continue; }
|
|
209
|
+
const kids: UiChild[] = directUiChildren(code, k, bodyClose);
|
|
210
|
+
const [ownAttrs] = attrChainFrom(code, bodyClose + 1);
|
|
211
|
+
|
|
212
|
+
// ---- GATE pct-in-auto-size-parent: inside an unsized container, a child writes '100%' on the same axis
|
|
213
|
+
//
|
|
214
|
+
// Typical shape: the root Stack has only constraintSize({ minHeight }), an inner Row / child has .height('100%'), and it gets stretched very tall.
|
|
215
|
+
// A min bound without a size = the author explicitly expects content to decide the size → GATE; no size at all is only reported as CAND vertically
|
|
216
|
+
// (horizontal "Column without width + child width('100%')" is too common, and is mostly caught by an upper width).
|
|
217
|
+
for (const axis of ['height', 'width'] as ('height' | 'width')[]) {
|
|
218
|
+
if (definiteOnAxis(ownAttrs, axis)) { continue; }
|
|
219
|
+
const minOnly: boolean = minOnAxis(ownAttrs, axis);
|
|
220
|
+
if (!minOnly && axis === 'width') { continue; }
|
|
221
|
+
const kid: UiChild | undefined = kids.find((c) =>
|
|
222
|
+
attrsOf(c).some((x) => x.name === axis && RE_PCT_FULL_ARG.test(x.args)) &&
|
|
223
|
+
!hasAttr(attrsOf(c), 'layoutWeight'));
|
|
224
|
+
if (kid === undefined) { continue; }
|
|
225
|
+
const line: number = lineOfIndex(code, m.index + m[1].length);
|
|
226
|
+
const childLine: number = lineOfIndex(code, kid.at);
|
|
227
|
+
const marked: boolean = markedAbove(rawLines, line, 'PCT-PARENT-SIZED');
|
|
228
|
+
const owner: string | undefined = structRootAt.get(paren);
|
|
229
|
+
if (owner !== undefined) {
|
|
230
|
+
pctRoots.push({ struct: owner, axis, line, childLine, container: kind, minOnly, marked });
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
report(minOnly && !marked ? 'GATE' : 'CAND', 'pct-in-auto-size-parent', rel, line,
|
|
234
|
+
PCT_AUTO_MSG(kind, axis, childLine));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (kind === 'Row' || kind === 'Column') {
|
|
238
|
+
// ---- GATE main-axis-pct-siblings: ≥2 siblings on the main axis are both 100%
|
|
239
|
+
const axis: string = kind === 'Row' ? 'width' : 'height';
|
|
240
|
+
const full: UiChild[] = kids.filter((c) => {
|
|
241
|
+
const a: UiAttr[] = attrsOf(c);
|
|
242
|
+
return a.some((x) => x.name === axis && RE_PCT_FULL_ARG.test(x.args)) &&
|
|
243
|
+
!hasAttr(a, 'layoutWeight') && !hasAttr(a, 'flexGrow');
|
|
244
|
+
});
|
|
245
|
+
const where: string = kind === 'Row' ? 'horizontal' : 'vertical';
|
|
246
|
+
if (full.length >= 2) {
|
|
247
|
+
report('GATE', 'main-axis-pct-siblings', rel, lineOfIndex(code, full[0].at),
|
|
248
|
+
`${kind} has ${full.length} direct children that all set .${axis}('100%') on the main axis` +
|
|
249
|
+
(full.some((c) => c.isBuilderCall) ? ' (including @Builder roots)' : '') +
|
|
250
|
+
` — 100% is relative to the parent and is not shared among siblings: the first takes all the ${where} space and the rest are pushed out of view. ` +
|
|
251
|
+
'Translate Android 0dp + layout_weight as .layoutWeight(n) (@Builder roots too), not 100%');
|
|
252
|
+
} else if (full.length === 1 && kids.length >= 2) {
|
|
253
|
+
report('CAND', 'main-axis-pct-siblings', rel, lineOfIndex(code, full[0].at),
|
|
254
|
+
`${kind} has one child with .${axis}('100%') next to ${kids.length - 1} other siblings; the siblings may be pushed out of view. ` +
|
|
255
|
+
'If the Android side is 0dp + layout_weight, use .layoutWeight(1)');
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (kind === 'Column') {
|
|
260
|
+
// ---- GATE card-width-wraps: a child container (card) in a Column with background color + radius/border has no width declaration at all
|
|
261
|
+
//
|
|
262
|
+
// Children of an Android vertical LinearLayout default to MATCH_PARENT width (generateDefaultLayoutParams),
|
|
263
|
+
// while ArkUI Column children shrink to content by default: cards without a width get ragged right edges.
|
|
264
|
+
for (const c of kids) {
|
|
265
|
+
const a: UiAttr[] = attrsOf(c);
|
|
266
|
+
if (!CONTAINER_KINDS.has(kindOf(c))) { continue; }
|
|
267
|
+
if (!hasAttr(a, 'backgroundColor') || !(hasAttr(a, 'borderRadius') || hasAttr(a, 'border'))) { continue; }
|
|
268
|
+
if (setsWidth(a)) { continue; }
|
|
269
|
+
const at: number = lineOfIndex(code, c.at);
|
|
270
|
+
const rootAt: number = c.isBuilderCall && roots.has(c.name) ? lineOfIndex(code, roots.get(c.name)!.at) : at;
|
|
271
|
+
const marked: boolean = markedAbove(rawLines, at, 'WRAP-WIDTH') || markedAbove(rawLines, rootAt, 'WRAP-WIDTH');
|
|
272
|
+
// Pills/tags (chip, pill) wrap their content by design: a Row / Stack / Flex container whose children are only Text/Image (icon + text,
|
|
273
|
+
// single text) → candidate only. Column containers (vertical content, even a single line of text) and multi-level nested containers are cards and stay GATE.
|
|
274
|
+
// Content in conditional branches cannot be fully seen, so it does not count as a chip
|
|
275
|
+
const node: UiChild | undefined = c.isBuilderCall ? roots.get(c.name) : c;
|
|
276
|
+
const inner: { n: number } = { n: 0 };
|
|
277
|
+
const leafs: UiChild[] = node === undefined ? [] : containerKids(code, node, inner);
|
|
278
|
+
const chip: boolean = ['Row', 'Stack', 'Flex'].includes(kindOf(c)) && inner.n === 0 && leafs.length > 0 &&
|
|
279
|
+
leafs.every((x) => !x.isBuilderCall && CHIP_LEAF_KINDS.has(x.name));
|
|
280
|
+
report(marked || chip ? 'CAND' : 'GATE', 'card-width-wraps', rel, at,
|
|
281
|
+
`Column child container ${c.isBuilderCall ? `this.${c.name}() (root ${kindOf(c)})` : kindOf(c)} has a background and rounded corners/border, ` +
|
|
282
|
+
'but no .width / .layoutWeight / constraintSize(minWidth) — ArkUI Column children shrink to their content by default, ' +
|
|
283
|
+
'while children of a vertical Android LinearLayout default to MATCH_PARENT. The card should be .width(\'100%\') (add it to the parent Column too if that has no width); ' +
|
|
284
|
+
'check in view.xml whether the container bounds are as wide as the sibling cards. When it really wraps its content, write // WRAP-WIDTH: <Android basis> above it');
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (kind === 'Row' || kind === 'Column' || kind === 'Stack') {
|
|
289
|
+
// ---- GATE text-on-stateful-bg-no-color: the container background switches with state, yet the direct child Text has no fontColor at all
|
|
290
|
+
//
|
|
291
|
+
// States like selected/occupied usually change both background and text color on Android (setTextColor and setBackground in the same branch).
|
|
292
|
+
// Only the background was translated, and the text color stayed on the default dark: unreadable on a dark background. Span color inherits from the enclosing Text; when neither Span nor Text sets one
|
|
293
|
+
// it is the default color.
|
|
294
|
+
const bg: UiAttr | undefined = ownAttrs.find((x) => x.name === 'backgroundColor');
|
|
295
|
+
if (bg !== undefined && /\?/.test(bg.args) && /:/.test(bg.args)) {
|
|
296
|
+
for (const c of kids) {
|
|
297
|
+
if (c.isBuilderCall || c.name !== 'Text') { continue; }
|
|
298
|
+
const cov = textColorCoverage(code, c.at, c.attrs);
|
|
299
|
+
if (cov === 'own' || cov === 'all-spans') { continue; }
|
|
300
|
+
const at: number = lineOfIndex(code, c.at);
|
|
301
|
+
const marked: boolean = markedAbove(rawLines, at, 'TEXT-COLOR-DEFAULT');
|
|
302
|
+
report(marked || cov === 'some-spans' ? 'CAND' : 'GATE', 'text-on-stateful-bg-no-color', rel, at,
|
|
303
|
+
`${kind} backgroundColor switches with state (${bg.args.trim().slice(0, 80)}), but its direct child Text ` +
|
|
304
|
+
(cov === 'some-spans' ? 'sets fontColor on only some Spans' : 'and its Spans set no fontColor and stay the default dark color') +
|
|
305
|
+
' — find setTextColor in the same state branch of the Android source and write .fontColor() with the same condition as the background, ' +
|
|
306
|
+
'and check that text\'s inkColor in measure_pack. When it really is the default color, write // TEXT-COLOR-DEFAULT: <basis> above it');
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (kind === 'Stack') {
|
|
312
|
+
const stackArgs: string = code.slice(paren + 1, pclose);
|
|
313
|
+
// .alignContent() and .align() on the Stack's own chain act the same (both arrange children); the later one wins and overrides the constructor argument
|
|
314
|
+
const ownAlign: UiAttr | undefined = [...ownAttrs].reverse().find((x) => x.name === 'alignContent' || x.name === 'align');
|
|
315
|
+
const alignM: RegExpExecArray | null = ownAlign !== undefined
|
|
316
|
+
? /^\s*(Alignment\.\w+)\s*$/.exec(ownAlign.args)
|
|
317
|
+
: /alignContent\s*:\s*(Alignment\.\w+)/.exec(stackArgs);
|
|
318
|
+
const hasAlign: boolean = ownAlign !== undefined || /alignContent/.test(stackArgs);
|
|
319
|
+
// For cross-file shared-chrome-placement-drift: direct children (imported custom components) of the struct build() root Stack
|
|
320
|
+
// and that Stack's alignment. Only the root Stack is collected — Stacks deep inside the page (card badges, cover overlays) are not page chrome
|
|
321
|
+
for (const c of kids) {
|
|
322
|
+
if (!structRootAt.has(paren)) { break; }
|
|
323
|
+
if (c.isBuilderCall || !importedNames.has(c.name)) { continue; }
|
|
324
|
+
stackHosted.push({ comp: c.name, align: alignM !== null ? alignM[1] : hasAlign ? '?' : 'default',
|
|
325
|
+
line: lineOfIndex(code, c.at) });
|
|
326
|
+
}
|
|
327
|
+
// An explicit Center centers the same as omitting it: a child with Modifier.align(BottomCenter) inside a Compose Box(contentAlignment = Center),
|
|
328
|
+
// translated to Stack({ alignContent: Alignment.Center }), loses its own alignment and keeps only padding → margin.bottom.
|
|
329
|
+
// The result: a label meant to hug the edge sits on top of the centered content.
|
|
330
|
+
// The overlay / child-align-noop rules below hold for it equally; the bar rule only targets Box's default TopStart translated into a bare Stack(),
|
|
331
|
+
// and an explicit Center is intentional centering, not reported.
|
|
332
|
+
const explicitCenter: boolean = hasAlign && alignM !== null && alignM[1] === 'Alignment.Center';
|
|
333
|
+
if (hasAlign && !explicitCenter) { continue; }
|
|
334
|
+
const centerWhy: string = explicitCenter ? 'Stack alignment is Center' : 'Stack has no alignContent (default Center)';
|
|
335
|
+
|
|
336
|
+
// ---- GATE stack-overlay-default-center: Stack without alignContent or set to Center, a child pinned to the bottom/top only by a one-sided vertical margin
|
|
337
|
+
//
|
|
338
|
+
// Typical source: `X(...).margin({ bottom })` inside `Stack({ alignContent: Alignment.Bottom })` copied into
|
|
339
|
+
// another page's `Stack()`. Under the default Center, margin.bottom only moves it up a few vp, leaving it mid-screen.
|
|
340
|
+
// stack-child-align-noop only recognizes .align() and cannot see this shape.
|
|
341
|
+
if (kids.length >= 2) {
|
|
342
|
+
for (const c of kids) {
|
|
343
|
+
const a: UiAttr[] = attrsOf(c);
|
|
344
|
+
if (['position', 'offset', 'markAnchor', 'alignRules', 'translate', 'align'].some((n) => hasAttr(a, n))) { continue; }
|
|
345
|
+
const h: UiAttr | undefined = a.find((x) => x.name === 'height');
|
|
346
|
+
if (h !== undefined && RE_PCT_FULL_ARG.test(h.args)) { continue; }
|
|
347
|
+
const mg: UiAttr | undefined = a.find((x) => x.name === 'margin');
|
|
348
|
+
if (mg === undefined) { continue; }
|
|
349
|
+
const bottom: boolean = /\bbottom\s*:/.test(mg.args);
|
|
350
|
+
const top: boolean = /\btop\s*:/.test(mg.args);
|
|
351
|
+
const left: boolean = /\b(?:left|start)\s*:/.test(mg.args);
|
|
352
|
+
const right: boolean = /\b(?:right|end)\s*:/.test(mg.args);
|
|
353
|
+
// One-sided vertical first; only when neither vertical side is written, look at one-sided horizontal (wind compass "West" writes only margin.left, "East" only margin.right)
|
|
354
|
+
// Under an explicit Center, a horizontally filling child is the content layer that sizes the Stack (grid + centered error overlay); a one-sided margin is just spacing,
|
|
355
|
+
// not a dropped Modifier.align (e.g. Grid().width('100%').margin({ top: 8 })).
|
|
356
|
+
const fullW: boolean = a.some((x) => x.name === 'width' && RE_PCT_FULL_ARG.test(x.args));
|
|
357
|
+
const contentLayer: boolean = fullW || hasAttr(a, 'aspectRatio') ||
|
|
358
|
+
['Grid', 'List', 'Scroll', 'WaterFlow', 'Swiper'].includes(c.name);
|
|
359
|
+
if (explicitCenter && contentLayer) { continue; }
|
|
360
|
+
let side: string;
|
|
361
|
+
if (bottom !== top) {
|
|
362
|
+
side = bottom ? 'bottom' : 'top';
|
|
363
|
+
} else if (!bottom && left !== right) {
|
|
364
|
+
// One-sided spacing on a horizontally filling child is normal usage
|
|
365
|
+
if (fullW) { continue; }
|
|
366
|
+
side = left ? 'left' : 'right';
|
|
367
|
+
} else {
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
const vert: boolean = side === 'bottom' || side === 'top';
|
|
371
|
+
const toEnd: boolean = side === 'bottom' || side === 'right';
|
|
372
|
+
const edge: string = vert ? (toEnd ? 'bottom' : 'top') : (toEnd ? 'right' : 'left');
|
|
373
|
+
const boxAlign: string = vert ? (toEnd ? 'BottomCenter' : 'TopCenter') : (toEnd ? 'CenterEnd' : 'CenterStart');
|
|
374
|
+
const stackAlign: string = vert ? (toEnd ? 'Bottom' : 'Top') : (toEnd ? 'End' : 'Start');
|
|
375
|
+
const wrap: string = `${vert ? 'Column' : 'Row'}().width('100%').height('100%')` +
|
|
376
|
+
`.justifyContent(FlexAlign.${toEnd ? 'End' : 'Start'}).padding({ ${side}: … })`;
|
|
377
|
+
const at: number = lineOfIndex(code, c.at);
|
|
378
|
+
const marked: boolean = markedAbove(rawLines, at, 'STACK-CENTER');
|
|
379
|
+
report(marked ? 'CAND' : 'GATE', 'stack-overlay-default-center', rel, at,
|
|
380
|
+
`${centerWhy}, and child ${kindOf(c) || c.name} only sets margin.${side} — ` +
|
|
381
|
+
`under center alignment a one-sided margin only moves it a few vp, so it stays in the middle of the Stack (overlapping the other centered children), while this code clearly means to hug the ${edge}. ` +
|
|
382
|
+
(explicitCenter
|
|
383
|
+
? `Most likely the Compose Box child's Modifier.align(Alignment.${boxAlign}) was dropped: wrap it in a Stack-sized ` +
|
|
384
|
+
`${wrap}, or position it with .position/.markAnchor; keep the other children centered. `
|
|
385
|
+
: `Use Stack({ alignContent: Alignment.${stackAlign} }) (if the other children rely on centering, wrap them in a full-size container), ` +
|
|
386
|
+
`or wrap only this child in ${wrap}; if the same component is placed on another page, copy that Stack's alignContent. `) +
|
|
387
|
+
'When centering is really intended, write // STACK-CENTER: <basis> above it');
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// ---- GATE stack-bar-default-center: Stack without alignContent, a horizontally filling, fixed-height bar child is vertically centered
|
|
392
|
+
//
|
|
393
|
+
// Compose Box / FrameLayout default to top-left (TopStart), ArkUI Stack defaults to Center. The mapping table once said "Box → Stack direct mapping",
|
|
394
|
+
// so a top bar copied as a bare Stack() with child Row().width('100%').height(48): the whole top bar lands mid-screen.
|
|
395
|
+
// The previous rule only recognizes one-sided margins and cannot see it.
|
|
396
|
+
// For a bar that fills horizontally, has a fixed height and no positioning at all, centering is almost never intended.
|
|
397
|
+
if (kids.length >= 2 && !explicitCenter) {
|
|
398
|
+
const stackH: UiAttr | undefined = ownAttrs.find((x) => x.name === 'height');
|
|
399
|
+
for (const c of kids) {
|
|
400
|
+
const a: UiAttr[] = attrsOf(c);
|
|
401
|
+
if (['position', 'offset', 'markAnchor', 'alignRules', 'translate', 'align'].some((n) => hasAttr(a, n))) { continue; }
|
|
402
|
+
const mg: UiAttr | undefined = a.find((x) => x.name === 'margin');
|
|
403
|
+
if (mg !== undefined && /\b(?:top|bottom)\s*:/.test(mg.args)) { continue; }
|
|
404
|
+
const w: UiAttr | undefined = a.find((x) => x.name === 'width');
|
|
405
|
+
const h: UiAttr | undefined = a.find((x) => x.name === 'height');
|
|
406
|
+
if (w === undefined || !RE_PCT_FULL_ARG.test(w.args) || h === undefined || /%/.test(h.args)) { continue; }
|
|
407
|
+
// Stack as tall as the bar: centered means filled, harmless
|
|
408
|
+
if (stackH !== undefined && stackH.args.trim() === h.args.trim()) { continue; }
|
|
409
|
+
// An unsized Stack shrinks to its tallest child: the bar is centered only when a sibling fills (%) or is taller than the bar; when that cannot be told, only CAND
|
|
410
|
+
const vpOf = (s: string): number | null => {
|
|
411
|
+
const m: RegExpExecArray | null = /^\s*(['"]?)(\d+(?:\.\d+)?)(?:vp)?\1\s*$/.exec(s);
|
|
412
|
+
return m === null ? null : Number(m[2]);
|
|
413
|
+
};
|
|
414
|
+
const barVp: number | null = vpOf(h.args);
|
|
415
|
+
const taller: boolean = stackH !== undefined || kids.some((o) => {
|
|
416
|
+
if (o === c) { return false; }
|
|
417
|
+
const oh: UiAttr | undefined = attrsOf(o).find((x) => x.name === 'height');
|
|
418
|
+
if (oh === undefined) { return false; }
|
|
419
|
+
const ov: number | null = vpOf(oh.args);
|
|
420
|
+
return /%/.test(oh.args) || (ov !== null && barVp !== null && ov > barVp);
|
|
421
|
+
});
|
|
422
|
+
const at: number = lineOfIndex(code, c.at);
|
|
423
|
+
const marked: boolean = markedAbove(rawLines, at, 'STACK-CENTER');
|
|
424
|
+
report(marked || !taller ? 'CAND' : 'GATE', 'stack-bar-default-center', rel, at,
|
|
425
|
+
`Stack has no alignContent (default Center), and child ${kindOf(c) || c.name} fills the width with height ${h.args.trim()} — ` +
|
|
426
|
+
'it is centered vertically and stays in the middle of the Stack. Compose Box / FrameLayout default to top-left: translate Box() as ' +
|
|
427
|
+
'Stack({ alignContent: Alignment.TopStart }) and Box(contentAlignment = X) as X; use Top/TopStart for a top bar, Bottom for a bottom bar. ' +
|
|
428
|
+
'When centering is really intended, write // STACK-CENTER: <basis> above it');
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// ---- GATE stack-child-align-noop: Stack without alignContent or set to Center, a child positioned by its own .align()
|
|
433
|
+
for (const c of kids) {
|
|
434
|
+
const a: UiAttr[] = attrsOf(c);
|
|
435
|
+
const al: UiAttr | undefined = a.find((x) => x.name === 'align');
|
|
436
|
+
if (al === undefined || /Alignment\.Center\b/.test(al.args)) { continue; }
|
|
437
|
+
// A scroll container's .align arranges its content (position when content is shorter than the viewport) — valid usage, belongs to scroll-align-*
|
|
438
|
+
if (['Scroll', 'List', 'Grid', 'WaterFlow'].includes(c.name)) { continue; }
|
|
439
|
+
if (['position', 'offset', 'markAnchor', 'alignRules', 'translate'].some((n) => hasAttr(a, n))) { continue; }
|
|
440
|
+
const needV: boolean = /Top|Bottom/.test(al.args);
|
|
441
|
+
const needH: boolean = /Start|End/.test(al.args);
|
|
442
|
+
const dim = (n: string): string | null => {
|
|
443
|
+
const x: UiAttr | undefined = a.find((y) => y.name === n);
|
|
444
|
+
return x === undefined ? null : x.args;
|
|
445
|
+
};
|
|
446
|
+
const h: string | null = dim('height');
|
|
447
|
+
const w: string | null = dim('width');
|
|
448
|
+
const wraps: boolean = (needV && h === null) || (needH && w === null);
|
|
449
|
+
const notFull: boolean = (needV && h !== null && !RE_PCT_FULL_ARG.test(h)) ||
|
|
450
|
+
(needH && w !== null && !RE_PCT_FULL_ARG.test(w));
|
|
451
|
+
const msg: string = `${centerWhy}, and child ${c.name} sets .align(${al.args.trim()}) — ` +
|
|
452
|
+
'.align() only arranges that child\'s own content and does not decide its position in the Stack, so it is still centered. ' +
|
|
453
|
+
"To hug the bottom/an edge: Stack({ alignContent: Alignment.Bottom }) or .alignContent(), or first make the child fill that axis ('100%') and then arrange its content with .align";
|
|
454
|
+
if (wraps) {
|
|
455
|
+
report('GATE', 'stack-child-align-noop', rel, lineOfIndex(code, c.at), msg);
|
|
456
|
+
} else if (notFull) {
|
|
457
|
+
report('CAND', 'stack-child-align-noop', rel, lineOfIndex(code, c.at), msg);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// ---- GATE fixed-box-text-wraps: the estimated width of a fixed-width, fixed-height Text's literal text exceeds the box width
|
|
464
|
+
const tre: RegExp = /(^|[^\w$.])Text\s*\(\s*(['"])((?:(?!\2)[^\\\n]|\\.)*)\2\s*\)/g;
|
|
465
|
+
let t: RegExpExecArray | null;
|
|
466
|
+
while ((t = tre.exec(code)) !== null) {
|
|
467
|
+
const text: string = t[3];
|
|
468
|
+
if (text === '' || text.includes('\\n')) { continue; }
|
|
469
|
+
const [attrs] = attrChainFrom(code, t.index + t[0].length);
|
|
470
|
+
const num = (n: string): number | null => {
|
|
471
|
+
const x: UiAttr | undefined = attrs.find((y) => y.name === n);
|
|
472
|
+
if (x === undefined) { return null; }
|
|
473
|
+
const v: RegExpExecArray | null = /^\s*(-?\d+(?:\.\d+)?)\s*$/.exec(x.args);
|
|
474
|
+
return v === null ? NaN : Number(v[1]);
|
|
475
|
+
};
|
|
476
|
+
const w: number | null = num('width');
|
|
477
|
+
const h: number | null = num('height');
|
|
478
|
+
if (w === null || h === null || Number.isNaN(w) || Number.isNaN(h)) { continue; }
|
|
479
|
+
if (hasAttr(attrs, 'minFontSize') || hasAttr(attrs, 'maxFontSize')) { continue; }
|
|
480
|
+
// fontSize: bare number / 'N' / 'Nfp' / 'Nvp' as N; unreadable ones such as $r(…), variables, 'Npx' are estimated at 16 but only listed as candidates
|
|
481
|
+
const fsArg: string | undefined = attrs.find((y) => y.name === 'fontSize')?.args;
|
|
482
|
+
const fsM: RegExpExecArray | null = fsArg === undefined ? null
|
|
483
|
+
: /^\s*(?:(['"])(\d+(?:\.\d+)?)(?:fp|vp)?\1|(\d+(?:\.\d+)?))\s*$/.exec(fsArg);
|
|
484
|
+
const fsUnknown: boolean = fsArg !== undefined && fsM === null;
|
|
485
|
+
const fs0: number = fsM === null ? 16 : Number(fsM[2] ?? fsM[3]);
|
|
486
|
+
const lsp: number | null = num('letterSpacing');
|
|
487
|
+
const ls: number = lsp === null || Number.isNaN(lsp) ? 0 : lsp;
|
|
488
|
+
const pad: number | null = num('padding');
|
|
489
|
+
const inner: number = w - 2 * (pad === null || Number.isNaN(pad) ? 0 : pad);
|
|
490
|
+
const bold: boolean = attrs.some((y) => y.name === 'fontWeight' && /Bold|Medium|[6-9]00/.test(y.args));
|
|
491
|
+
const chars: string[] = [...text];
|
|
492
|
+
let em: number = 0;
|
|
493
|
+
let ascii: boolean = false;
|
|
494
|
+
for (const ch of chars) {
|
|
495
|
+
const cp: number = ch.codePointAt(0) ?? 0;
|
|
496
|
+
if (cp === 0x20) { em += 0.28; ascii = true; }
|
|
497
|
+
else if (cp < 0x80) { em += /[A-Z]/.test(ch) ? 0.65 : (/[a-z0-9]/.test(ch) ? 0.55 : 0.4); ascii = true; }
|
|
498
|
+
// CJK, full-width, and symbols such as • ‹ › …: the target usually renders them with a CJK fallback font, estimated at 1em
|
|
499
|
+
else { em += 1.0; }
|
|
500
|
+
}
|
|
501
|
+
const est: number = em * fs0 * (bold ? 1.05 : 1) + ls * Math.max(chars.length - 1, 0);
|
|
502
|
+
if (est <= inner) { continue; }
|
|
503
|
+
// Pure-ASCII estimates are imprecise (glyph width differences); slight overflows are only listed as candidates
|
|
504
|
+
const hard: boolean = !ascii || est > inner * 1.15;
|
|
505
|
+
const capped: boolean = hasAttr(attrs, 'maxLines');
|
|
506
|
+
const msg: string = `Text('${text}') has fixed width ${w}vp${inner !== w ? ` (content area ${inner}vp)` : ''} and fixed height ${h}vp; ` +
|
|
507
|
+
`at fontSize ${fs0}${fsUnknown ? ` (${fsArg!.trim()} unreadable, estimated with the default)` : ''}${bold ? ' bold' : ''}${ls ? ` + letterSpacing ${ls}` : ''} the text is estimated at about ${est.toFixed(1)}vp wide and does not fit — ` +
|
|
508
|
+
(capped ? 'maxLines is set, so it will be truncated. ' : 'maxLines is not set, so it wraps (several lines squeezed into a fixed-height box, e.g. "•••" laid out as "⁘"). ') +
|
|
509
|
+
'It fits on Android at the same size because the font differs (Roboto\'s • ‹ › etc. are narrower than the HarmonyOS fallback font). ' +
|
|
510
|
+
'Fix: .maxLines(1) and widen the width / reduce letterSpacing, or adapt with .minFontSize()/.maxFontSize()';
|
|
511
|
+
const line: number = lineOfIndex(code, t.index + t[1].length);
|
|
512
|
+
report(hard && !capped && !fsUnknown ? 'GATE' : 'CAND', 'fixed-box-text-wraps', rel, line, msg);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* The struct-root part of pct-in-auto-size-parent: the root container is unsized on axis and a child writes '100%'.
|
|
518
|
+
* As long as one call site gives no size on that axis, it will be stretched when rendered there — reported at the root container, with the call sites attached.
|
|
519
|
+
* Not reported when every call site gives a size (or there is no call site at all, which belongs to orphan-component).
|
|
520
|
+
*/
|
|
521
|
+
export function checkPctAutoRoots(scans: FileScan[]): void {
|
|
522
|
+
const declCount: Map<string, number> = new Map();
|
|
523
|
+
for (const s of scans) {
|
|
524
|
+
for (const n of s.declaredStructs) { declCount.set(n, (declCount.get(n) || 0) + 1); }
|
|
525
|
+
}
|
|
526
|
+
for (const s of scans) {
|
|
527
|
+
for (const r of s.pctRoots) {
|
|
528
|
+
const ambiguous: boolean = (declCount.get(r.struct) || 0) > 1;
|
|
529
|
+
const call: RegExp = new RegExp('(?<![\\w$.])' + r.struct + '\\s*\\(', 'g');
|
|
530
|
+
let unsized: string = '';
|
|
531
|
+
for (const t of scans) {
|
|
532
|
+
if (ambiguous && resolveStructFile(t, r.struct) !== path.resolve(s.abs)) { continue; }
|
|
533
|
+
call.lastIndex = 0;
|
|
534
|
+
let m: RegExpExecArray | null;
|
|
535
|
+
while (unsized === '' && (m = call.exec(t.code)) !== null) {
|
|
536
|
+
const before: string = t.code.slice(Math.max(0, m.index - 20), m.index);
|
|
537
|
+
if (/\bstruct\s+$|\bnew\s+$|\bfunction\s+$/.test(before)) { continue; }
|
|
538
|
+
const names: string[] = rootChainAttrs(t.code, m.index + m[0].length - 1).map((a) => a.name);
|
|
539
|
+
const sized: boolean = names.some((n) => n === r.axis || n === 'layoutWeight' || n === 'flexGrow' ||
|
|
540
|
+
n === 'flexBasis' || n === 'aspectRatio' || n === 'size');
|
|
541
|
+
if (!sized) { unsized = `${t.rel}:${lineOfIndex(t.code, m.index)}`; }
|
|
542
|
+
}
|
|
543
|
+
if (unsized !== '') { break; }
|
|
544
|
+
}
|
|
545
|
+
if (unsized === '') { continue; }
|
|
546
|
+
report(r.minOnly && !r.marked ? 'GATE' : 'CAND', 'pct-in-auto-size-parent', s.rel, r.line,
|
|
547
|
+
PCT_AUTO_MSG(`root ${r.container} of struct ${r.struct}`, r.axis, r.childLine) +
|
|
548
|
+
` (call site ${unsized} gives no size on that axis either)`);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|