@buaa_smat/hometrans 26.0.2 → 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 +7 -6
- 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,1220 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* shell_contract.mjs — app-shell contract: the conventions the entry group used
|
|
4
|
+
* to establish alone.
|
|
5
|
+
*
|
|
6
|
+
* node shell_contract.mjs <harmony_dir> --android <android_dir> [--static <utg.json>] [--deveco <dir>]
|
|
7
|
+
*
|
|
8
|
+
* (Node >= 22.18, ESM, zero dependencies. Behaviour-identical port of
|
|
9
|
+
* shell_contract.py: same args, exit codes, stdout and output files.)
|
|
10
|
+
*
|
|
11
|
+
* Writes .hometrans/shell_contract.json and .md. Every group prompt cites it
|
|
12
|
+
* as Project Fact (Shell Contract), and group_queue lets stage-1 groups start beside
|
|
13
|
+
* the entry group once it exists (Scheduling rule 1).
|
|
14
|
+
*
|
|
15
|
+
* Why the entry group had to run alone: it fixed the window mode, the
|
|
16
|
+
* EntryAbility window layer, how pages learn the system-bar heights, font
|
|
17
|
+
* registration and the page registry. Groups started after it so they could
|
|
18
|
+
* read those from its files. Each of these is decidable before any group
|
|
19
|
+
* runs, and deciding it once in a script is also more reliable than a model's
|
|
20
|
+
* grep. Measured: the parent's "project fact (window mode)" said
|
|
21
|
+
* non-immersive because its grep searched `enableEdgeToEdge` only, while
|
|
22
|
+
* `MainActivity.java:30` calls `EdgeToEdge.enable(this)`. G001 and G002 each
|
|
23
|
+
* had to discover and override it.
|
|
24
|
+
*
|
|
25
|
+
* What is decided here, from source only:
|
|
26
|
+
* * window mode per Activity: the conversion-procedure keyword list
|
|
27
|
+
* (`enableEdgeToEdge` / `EdgeToEdge.enable` / `setDecorFitsSystemWindows` /
|
|
28
|
+
* `WindowCompat.setDecorFitsSystemWindows` / `windowTranslucentStatus` /
|
|
29
|
+
* `windowDrawsSystemBarBackgrounds` / `fitsSystemWindows`), searched in the
|
|
30
|
+
* Activity, its base classes, the Application class and the themes the
|
|
31
|
+
* manifest applies. Every hit is `file:line`; zero hits are stated.
|
|
32
|
+
* * the shell interface: AppStorage keys for system-bar heights (vp) that
|
|
33
|
+
* the entry group's EntryAbility writes before loadContent and every page
|
|
34
|
+
* reads, and the font families registered from rawfile/fonts.
|
|
35
|
+
* * ownership: only the entry group writes EntryAbility.ets,
|
|
36
|
+
* main_pages.json and module.json5. Other groups code against the keys and
|
|
37
|
+
* report anything else they need from the shell for Step 5.5.
|
|
38
|
+
*
|
|
39
|
+
* Nothing about a page's layout is decided here. Phase 5's window-mode
|
|
40
|
+
* evidence is still written per page; it now cites this file for item 1.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
import * as fs from 'node:fs';
|
|
44
|
+
import * as path from 'node:path';
|
|
45
|
+
import { pathToFileURL } from 'node:url';
|
|
46
|
+
|
|
47
|
+
// ---------------------------------------------------------------- Python compatibility layer
|
|
48
|
+
// The output is a contract read by the agent and must match the original Python version byte for byte: JSON in
|
|
49
|
+
// json.dumps(indent=1, ensure_ascii=False) format (floats by repr, keys in insertion order),
|
|
50
|
+
// Windows text mode writes \r\n; regexes use Python's Unicode \w \s \b semantics;
|
|
51
|
+
// directory walks follow Python 3.13 pathlib.rglob order and (on Windows) case-insensitive matching.
|
|
52
|
+
|
|
53
|
+
const IS_WIN = process.platform === 'win32';
|
|
54
|
+
const EOL = IS_WIN ? '\r\n' : '\n';
|
|
55
|
+
const SEP = IS_WIN ? '\\' : '/';
|
|
56
|
+
|
|
57
|
+
/** A float read by json.loads: written back as Python repr. */
|
|
58
|
+
class PyFloat {
|
|
59
|
+
constructor(value) { this.value = value; }
|
|
60
|
+
valueOf() { return this.value; }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// When an object has integer-like keys ("0", "12") JS moves them first; record the original key order.
|
|
64
|
+
const KEY_ORDER = Symbol('pyKeyOrder');
|
|
65
|
+
const INDEX_KEY = /^(?:0|[1-9][0-9]*)$/;
|
|
66
|
+
|
|
67
|
+
function floatRepr(x) {
|
|
68
|
+
if (!Number.isFinite(x)) {
|
|
69
|
+
if (Number.isNaN(x)) { return 'NaN'; }
|
|
70
|
+
return x > 0 ? 'Infinity' : '-Infinity';
|
|
71
|
+
}
|
|
72
|
+
if (x === 0) { return Object.is(x, -0) ? '-0.0' : '0.0'; }
|
|
73
|
+
const a = Math.abs(x);
|
|
74
|
+
let s;
|
|
75
|
+
if (a >= 1e16 || a < 1e-4) {
|
|
76
|
+
s = a.toExponential();
|
|
77
|
+
let [mant, exp] = s.split('e');
|
|
78
|
+
const sign = exp[0] === '-' ? '-' : '+';
|
|
79
|
+
exp = exp.replace(/^[-+]/, '');
|
|
80
|
+
if (exp.length < 2) { exp = '0' + exp; }
|
|
81
|
+
s = mant + 'e' + sign + exp;
|
|
82
|
+
} else {
|
|
83
|
+
s = String(a);
|
|
84
|
+
if (!s.includes('.')) { s += '.0'; }
|
|
85
|
+
}
|
|
86
|
+
return (x < 0 ? '-' : '') + s;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function pyJsonLoads(text) {
|
|
90
|
+
let i = 0;
|
|
91
|
+
const n = text.length;
|
|
92
|
+
const fail = (msg) => { throw new SyntaxError(`${msg}: char ${i}`); };
|
|
93
|
+
const ws = () => {
|
|
94
|
+
while (i < n) {
|
|
95
|
+
const c = text.charCodeAt(i);
|
|
96
|
+
if (c === 0x20 || c === 0x09 || c === 0x0a || c === 0x0d) { i++; } else { break; }
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const NUM = /-?(?:0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?/y;
|
|
100
|
+
const str = () => {
|
|
101
|
+
i++;
|
|
102
|
+
let out = '';
|
|
103
|
+
let start = i;
|
|
104
|
+
for (;;) {
|
|
105
|
+
if (i >= n) { fail('Unterminated string'); }
|
|
106
|
+
const c = text.charCodeAt(i);
|
|
107
|
+
if (c === 0x22) { out += text.slice(start, i); i++; return out; }
|
|
108
|
+
if (c < 0x20) { fail('Invalid control character'); }
|
|
109
|
+
if (c === 0x5c) {
|
|
110
|
+
out += text.slice(start, i);
|
|
111
|
+
const esc = text[i + 1];
|
|
112
|
+
const simple = { '"': '"', '\\': '\\', '/': '/', b: '\b', f: '\f', n: '\n', r: '\r', t: '\t' }[esc];
|
|
113
|
+
if (simple !== undefined) {
|
|
114
|
+
out += simple;
|
|
115
|
+
i += 2;
|
|
116
|
+
} else if (esc === 'u') {
|
|
117
|
+
const hex = text.slice(i + 2, i + 6);
|
|
118
|
+
if (!/^[0-9a-fA-F]{4}$/.test(hex)) { fail('Invalid \\uXXXX escape'); }
|
|
119
|
+
out += String.fromCharCode(parseInt(hex, 16));
|
|
120
|
+
i += 6;
|
|
121
|
+
} else {
|
|
122
|
+
fail('Invalid \\escape');
|
|
123
|
+
}
|
|
124
|
+
start = i;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
i++;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const value = () => {
|
|
131
|
+
ws();
|
|
132
|
+
const c = text[i];
|
|
133
|
+
if (c === '{') {
|
|
134
|
+
i++;
|
|
135
|
+
const o = {};
|
|
136
|
+
const order = [];
|
|
137
|
+
let hasIndex = false;
|
|
138
|
+
ws();
|
|
139
|
+
if (text[i] === '}') { i++; return o; }
|
|
140
|
+
for (;;) {
|
|
141
|
+
ws();
|
|
142
|
+
if (text[i] !== '"') { fail('Expecting property name enclosed in double quotes'); }
|
|
143
|
+
const k = str();
|
|
144
|
+
ws();
|
|
145
|
+
if (text[i] !== ':') { fail("Expecting ':' delimiter"); }
|
|
146
|
+
i++;
|
|
147
|
+
const v = value();
|
|
148
|
+
if (!Object.hasOwn(o, k)) {
|
|
149
|
+
order.push(k);
|
|
150
|
+
if (INDEX_KEY.test(k)) { hasIndex = true; }
|
|
151
|
+
}
|
|
152
|
+
if (k === '__proto__') {
|
|
153
|
+
Object.defineProperty(o, k, { value: v, enumerable: true, writable: true, configurable: true });
|
|
154
|
+
} else {
|
|
155
|
+
o[k] = v;
|
|
156
|
+
}
|
|
157
|
+
ws();
|
|
158
|
+
if (text[i] === ',') { i++; continue; }
|
|
159
|
+
if (text[i] === '}') { i++; break; }
|
|
160
|
+
fail("Expecting ',' delimiter");
|
|
161
|
+
}
|
|
162
|
+
if (hasIndex) { o[KEY_ORDER] = order; }
|
|
163
|
+
return o;
|
|
164
|
+
}
|
|
165
|
+
if (c === '[') {
|
|
166
|
+
i++;
|
|
167
|
+
const a = [];
|
|
168
|
+
ws();
|
|
169
|
+
if (text[i] === ']') { i++; return a; }
|
|
170
|
+
for (;;) {
|
|
171
|
+
a.push(value());
|
|
172
|
+
ws();
|
|
173
|
+
if (text[i] === ',') { i++; continue; }
|
|
174
|
+
if (text[i] === ']') { i++; break; }
|
|
175
|
+
fail("Expecting ',' delimiter");
|
|
176
|
+
}
|
|
177
|
+
return a;
|
|
178
|
+
}
|
|
179
|
+
if (c === '"') { return str(); }
|
|
180
|
+
if (text.startsWith('null', i)) { i += 4; return null; }
|
|
181
|
+
if (text.startsWith('true', i)) { i += 4; return true; }
|
|
182
|
+
if (text.startsWith('false', i)) { i += 5; return false; }
|
|
183
|
+
if (text.startsWith('NaN', i)) { i += 3; return new PyFloat(NaN); }
|
|
184
|
+
if (text.startsWith('Infinity', i)) { i += 8; return new PyFloat(Infinity); }
|
|
185
|
+
if (text.startsWith('-Infinity', i)) { i += 9; return new PyFloat(-Infinity); }
|
|
186
|
+
NUM.lastIndex = i;
|
|
187
|
+
const m = NUM.exec(text);
|
|
188
|
+
if (!m) { fail('Expecting value'); }
|
|
189
|
+
i += m[0].length;
|
|
190
|
+
if (m[1] !== undefined || m[2] !== undefined) { return new PyFloat(Number(m[0])); }
|
|
191
|
+
const num = Number(m[0]);
|
|
192
|
+
return Number.isSafeInteger(num) ? (num === 0 ? 0 : num) : BigInt(m[0]);
|
|
193
|
+
};
|
|
194
|
+
const v = value();
|
|
195
|
+
ws();
|
|
196
|
+
if (i !== n) { fail('Extra data'); }
|
|
197
|
+
return v;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function keysOf(o) {
|
|
201
|
+
const ks = Object.keys(o);
|
|
202
|
+
const ord = o[KEY_ORDER];
|
|
203
|
+
if (!ord) { return ks; }
|
|
204
|
+
const present = new Set(ks);
|
|
205
|
+
const out = ord.filter((k) => present.has(k));
|
|
206
|
+
const seen = new Set(out);
|
|
207
|
+
for (const k of ks) { if (!seen.has(k)) { out.push(k); } }
|
|
208
|
+
return out;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Python-style ordered assignment: new keys recorded in insertion order (integer-like keys not moved first), existing keys overwritten in place. */
|
|
212
|
+
function pySet(o, k, v) {
|
|
213
|
+
if (!Object.hasOwn(o, k)) {
|
|
214
|
+
if (!o[KEY_ORDER]) { Object.defineProperty(o, KEY_ORDER, { value: Object.keys(o), writable: true }); }
|
|
215
|
+
o[KEY_ORDER].push(k);
|
|
216
|
+
}
|
|
217
|
+
o[k] = v;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** json.dumps(v, ensure_ascii=False, indent=indent). undefined is treated as None. */
|
|
221
|
+
function pyJsonDumps(v, indent, level = 0) {
|
|
222
|
+
if (v === null || v === undefined) { return 'null'; }
|
|
223
|
+
if (v === true) { return 'true'; }
|
|
224
|
+
if (v === false) { return 'false'; }
|
|
225
|
+
if (typeof v === 'bigint') { return v.toString(); }
|
|
226
|
+
if (v instanceof PyFloat) { return floatRepr(v.value); }
|
|
227
|
+
if (typeof v === 'number') { return Number.isInteger(v) ? (Object.is(v, -0) ? '0' : String(v)) : floatRepr(v); }
|
|
228
|
+
if (typeof v === 'string') { return JSON.stringify(v); }
|
|
229
|
+
const pad = '\n' + ' '.repeat(indent * (level + 1));
|
|
230
|
+
const end = '\n' + ' '.repeat(indent * level);
|
|
231
|
+
if (Array.isArray(v)) {
|
|
232
|
+
if (v.length === 0) { return '[]'; }
|
|
233
|
+
return '[' + pad + v.map((x) => pyJsonDumps(x, indent, level + 1)).join(',' + pad) + end + ']';
|
|
234
|
+
}
|
|
235
|
+
const ks = keysOf(v);
|
|
236
|
+
if (ks.length === 0) { return '{}'; }
|
|
237
|
+
return '{' + pad + ks.map((k) => JSON.stringify(k) + ': ' + pyJsonDumps(v[k], indent, level + 1)).join(',' + pad) +
|
|
238
|
+
end + '}';
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** dict.get: on a non-dict, throws AttributeError like Python (exit code 1). */
|
|
242
|
+
function dget(o, k, d = undefined) {
|
|
243
|
+
if (o === null || typeof o !== 'object' || Array.isArray(o) || o instanceof PyFloat) {
|
|
244
|
+
throw new TypeError(`'${Array.isArray(o) ? 'list' : o === null ? 'NoneType' : typeof o}' object has no attribute 'get'`);
|
|
245
|
+
}
|
|
246
|
+
return Object.hasOwn(o, k) ? o[k] : d;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function truthy(v) {
|
|
250
|
+
if (v === null || v === undefined || v === false) { return false; }
|
|
251
|
+
if (v === true) { return true; }
|
|
252
|
+
if (typeof v === 'number') { return v !== 0; }
|
|
253
|
+
if (typeof v === 'bigint') { return v !== 0n; }
|
|
254
|
+
if (v instanceof PyFloat) { return v.value !== 0; }
|
|
255
|
+
if (typeof v === 'string' || Array.isArray(v)) { return v.length > 0; }
|
|
256
|
+
return Object.keys(v).length > 0;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Approximation of str(x): only used for the substring test `"activity" in str(kind)`. */
|
|
260
|
+
function pyStr(v) {
|
|
261
|
+
if (v === null || v === undefined) { return 'None'; }
|
|
262
|
+
if (v === true) { return 'True'; }
|
|
263
|
+
if (v === false) { return 'False'; }
|
|
264
|
+
if (typeof v === 'string') { return v; }
|
|
265
|
+
if (v instanceof PyFloat) { return floatRepr(v.value).replace('Infinity', 'inf').replace('NaN', 'nan'); }
|
|
266
|
+
if (typeof v === 'number' || typeof v === 'bigint') { return String(v); }
|
|
267
|
+
return pyJsonDumps(v, 0).replace(/\n/g, '');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** dict keys: in Python json.dumps writes None/True/numeric keys as "null"/"true"/"1". */
|
|
271
|
+
function pyKey(v) {
|
|
272
|
+
if (v === null || v === undefined) { return 'null'; }
|
|
273
|
+
if (v === true) { return 'true'; }
|
|
274
|
+
if (v === false) { return 'false'; }
|
|
275
|
+
if (v instanceof PyFloat) { return floatRepr(v.value); }
|
|
276
|
+
if (typeof v === 'string' || typeof v === 'number' || typeof v === 'bigint') { return String(v); }
|
|
277
|
+
throw new TypeError("unhashable type");
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Python re's Unicode \w / \s (JS \w is ASCII only and its \s set differs too; \b is expressed with lookarounds).
|
|
281
|
+
const W = '[\\p{L}\\p{N}_]';
|
|
282
|
+
const WD = '[\\p{L}\\p{N}_.]'; // [\w.]
|
|
283
|
+
const S = '[\\t\\n\\v\\f\\r\\x1c-\\x1f \\x85\\xa0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]';
|
|
284
|
+
const NOT_W_BEFORE = `(?<!${W})`; // \b before a word character
|
|
285
|
+
const NOT_W_AFTER = `(?!${W})`; // \b after a word character
|
|
286
|
+
const rx = (src, flags = '') => new RegExp(src, 'u' + flags);
|
|
287
|
+
// Effect of re.escape; u mode rejects redundant escapes (such as \-), so only syntax characters are escaped; '-' is meaningless outside a character class.
|
|
288
|
+
const reEscape = (s) => s.replace(/[\\^$.*+?()[\]{}|\/]/g, '\\$&');
|
|
289
|
+
|
|
290
|
+
const STRIP_RE = rx(`^${S}+|${S}+$`, 'g');
|
|
291
|
+
/** str.strip() */
|
|
292
|
+
function pyStrip(s) { return s.replace(STRIP_RE, ''); }
|
|
293
|
+
|
|
294
|
+
/** s[:n], sliced by code point. */
|
|
295
|
+
function pyHead(s, n) {
|
|
296
|
+
if (s.length <= n) { return s; }
|
|
297
|
+
const cps = Array.from(s);
|
|
298
|
+
return cps.length <= n ? s : cps.slice(0, n).join('');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** str.splitlines() */
|
|
302
|
+
function pySplitlines(s) {
|
|
303
|
+
const out = s.split(/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/u);
|
|
304
|
+
if (out.length && out[out.length - 1] === '') { out.pop(); }
|
|
305
|
+
return out;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const UTF8 = new TextDecoder('utf-8', { fatal: false, ignoreBOM: true });
|
|
309
|
+
|
|
310
|
+
/** Path(p).read_text(encoding="utf-8", errors="replace"); "" on OSError. */
|
|
311
|
+
// Files read during one build(): themeFacts and the shell scans read the same sources.
|
|
312
|
+
let _readCache = null;
|
|
313
|
+
|
|
314
|
+
function _read(p) {
|
|
315
|
+
if (p === null || p === undefined) { return ''; }
|
|
316
|
+
const key = p instanceof PyPath ? p.fs : String(p);
|
|
317
|
+
if (_readCache?.has(key)) { return _readCache.get(key); }
|
|
318
|
+
const text = _readUncached(p);
|
|
319
|
+
_readCache?.set(key, text);
|
|
320
|
+
return text;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function _readUncached(p) {
|
|
324
|
+
try {
|
|
325
|
+
return UTF8.decode(fs.readFileSync(p instanceof PyPath ? p.fs : p)).replace(/\r\n?/g, '\n');
|
|
326
|
+
} catch {
|
|
327
|
+
return '';
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/** Path.write_text: Windows text mode writes \n as \r\n. */
|
|
332
|
+
function writeText(p, s) {
|
|
333
|
+
fs.writeFileSync(p, IS_WIN ? s.replace(/\n/g, '\r\n') : s, 'utf8');
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// ---------------------------------------------------------------- pathlib compatibility
|
|
337
|
+
/** Normalize like pathlib: split off the anchor and the segments (dropping empty segments and "."), keeping "..". */
|
|
338
|
+
function parsePath(s) {
|
|
339
|
+
let t = String(s);
|
|
340
|
+
let drive = '';
|
|
341
|
+
let root = '';
|
|
342
|
+
if (IS_WIN) {
|
|
343
|
+
t = t.replace(/\//g, '\\');
|
|
344
|
+
let m;
|
|
345
|
+
if ((m = /^\\\\[^\\]+\\[^\\]+/.exec(t))) {
|
|
346
|
+
drive = m[0]; root = '\\'; t = t.slice(m[0].length);
|
|
347
|
+
} else if ((m = /^[A-Za-z]:/.exec(t))) {
|
|
348
|
+
drive = m[0]; t = t.slice(2);
|
|
349
|
+
if (t.startsWith('\\')) { root = '\\'; }
|
|
350
|
+
} else if (t.startsWith('\\')) {
|
|
351
|
+
root = '\\';
|
|
352
|
+
}
|
|
353
|
+
} else if (t.startsWith('/')) {
|
|
354
|
+
root = t.startsWith('//') && !t.startsWith('///') ? '//' : '/';
|
|
355
|
+
}
|
|
356
|
+
const rest = t.split(IS_WIN ? '\\' : '/').filter((x) => x !== '' && x !== '.');
|
|
357
|
+
return { anchor: drive + root, rest };
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/** A path made of a root directory + relative segments; only records the attributes Python uses. */
|
|
361
|
+
class PyPath {
|
|
362
|
+
constructor(base, rel) {
|
|
363
|
+
this.base = base; // parsePath result
|
|
364
|
+
this.rel = rel; // segments relative to the root directory
|
|
365
|
+
}
|
|
366
|
+
get parts() { return (this.base.anchor ? [this.base.anchor] : []).concat(this.base.rest, this.rel); }
|
|
367
|
+
get allRest() { return this.base.rest.concat(this.rel); }
|
|
368
|
+
get fs() {
|
|
369
|
+
const r = this.allRest;
|
|
370
|
+
return this.base.anchor + r.join(SEP) || '.';
|
|
371
|
+
}
|
|
372
|
+
get posix() {
|
|
373
|
+
const a = IS_WIN ? this.base.anchor.replace(/\\/g, '/') : this.base.anchor;
|
|
374
|
+
const r = this.allRest;
|
|
375
|
+
return (a + r.join('/')) || '.';
|
|
376
|
+
}
|
|
377
|
+
// Path equality: case-insensitive on Windows.
|
|
378
|
+
get key() { const k = this.rel.join('/'); return IS_WIN ? k.toLowerCase() : k; }
|
|
379
|
+
get name() { const r = this.allRest; return r.length ? r[r.length - 1] : ''; }
|
|
380
|
+
get parentName() { const r = this.allRest; return r.length >= 2 ? r[r.length - 2] : ''; }
|
|
381
|
+
get suffix() { return pySuffix(this.name); }
|
|
382
|
+
get stem() { return pyStem(this.name); }
|
|
383
|
+
/** relative_to(root).as_posix() */
|
|
384
|
+
relPosix() { return this.rel.join('/') || '.'; }
|
|
385
|
+
child(...names) { return new PyPath(this.base, this.rel.concat(names)); }
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function pySuffix(name) {
|
|
389
|
+
const i = name.lastIndexOf('.');
|
|
390
|
+
return i > 0 && i < name.length - 1 ? name.slice(i) : '';
|
|
391
|
+
}
|
|
392
|
+
function pyStem(name) {
|
|
393
|
+
const suf = pySuffix(name);
|
|
394
|
+
return suf ? name.slice(0, name.length - suf.length) : name;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function rootPath(s) { return new PyPath(parsePath(s), []); }
|
|
398
|
+
|
|
399
|
+
/** Raw os.scandir order (unsorted). null on failure. */
|
|
400
|
+
function scan(p) {
|
|
401
|
+
let d;
|
|
402
|
+
try {
|
|
403
|
+
d = fs.opendirSync(p.fs);
|
|
404
|
+
} catch {
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
const out = [];
|
|
408
|
+
try {
|
|
409
|
+
let e;
|
|
410
|
+
while ((e = d.readSync()) !== null) { out.push(e); }
|
|
411
|
+
} catch {
|
|
412
|
+
// Same as Python: when list(scandir_it) fails, the whole directory is skipped
|
|
413
|
+
try { d.closeSync(); } catch { /* ignore */ }
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
d.closeSync();
|
|
417
|
+
return out;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** pathlib glob matching: case-insensitive on Windows, * does not cross separators. */
|
|
421
|
+
function globMatcher(pat) {
|
|
422
|
+
let src = '';
|
|
423
|
+
for (let i = 0; i < pat.length; i++) {
|
|
424
|
+
const c = pat[i];
|
|
425
|
+
if (c === '*') { src += IS_WIN ? '[^\\\\]*' : '[^/]*'; } else if (c === '[') {
|
|
426
|
+
const j = pat.indexOf(']', i + 1);
|
|
427
|
+
src += '[' + pat.slice(i + 1, j).replace(/\\/g, '\\\\') + ']';
|
|
428
|
+
i = j;
|
|
429
|
+
} else { src += reEscape(c); }
|
|
430
|
+
}
|
|
431
|
+
const re = rx('^(?:' + src + ')$', IS_WIN ? 'is' : 's');
|
|
432
|
+
return (name) => re.test(name);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// Python 3.13 rglob order: yield the root's matches, then pop a dir off a stack, scan it,
|
|
436
|
+
// and for each subdirectory (os.scandir order, symlinks not followed) yield its matches and push it.
|
|
437
|
+
// Python scans each directory twice (pattern + recursion); scanning once gives the same result.
|
|
438
|
+
function* walkDirs(root) {
|
|
439
|
+
const rootEntries = scan(root);
|
|
440
|
+
yield [root, rootEntries];
|
|
441
|
+
const stack = [[root, rootEntries]];
|
|
442
|
+
while (stack.length) {
|
|
443
|
+
const [p, entries] = stack.pop();
|
|
444
|
+
if (!entries) { continue; }
|
|
445
|
+
for (const e of entries) {
|
|
446
|
+
if (e.isDirectory()) {
|
|
447
|
+
const d = p.child(e.name);
|
|
448
|
+
const sub = scan(d);
|
|
449
|
+
yield [d, sub];
|
|
450
|
+
stack.push([d, sub]);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/** Path.rglob(pattern), single-segment pattern: wildcard -> filter each dir's scandir; literal -> lstat. */
|
|
457
|
+
function rglob(root, pattern) {
|
|
458
|
+
const out = [];
|
|
459
|
+
if (/[*?[]/.test(pattern)) {
|
|
460
|
+
const match = pattern === '*' ? () => true : globMatcher(pattern);
|
|
461
|
+
for (const [d, entries] of walkDirs(root)) {
|
|
462
|
+
for (const e of entries || []) { if (match(e.name)) { out.push(d.child(e.name)); } }
|
|
463
|
+
}
|
|
464
|
+
} else {
|
|
465
|
+
for (const [d] of walkDirs(root)) {
|
|
466
|
+
const c = d.child(pattern);
|
|
467
|
+
try { fs.lstatSync(c.fs); out.push(c); } catch { /* not there */ }
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return out;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/** Path.glob(pattern), single-segment glob. */
|
|
474
|
+
function glob(dir, pattern) {
|
|
475
|
+
const match = globMatcher(pattern);
|
|
476
|
+
return (scan(dir) || []).filter((e) => match(e.name)).map((e) => dir.child(e.name));
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function isDir(p) {
|
|
480
|
+
try { return fs.statSync(p.fs).isDirectory(); } catch { return false; }
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/** String comparison of sorted(): by code point. */
|
|
484
|
+
function cmpCodepoints(a, b) {
|
|
485
|
+
const x = Array.from(a, (c) => c.codePointAt(0));
|
|
486
|
+
const y = Array.from(b, (c) => c.codePointAt(0));
|
|
487
|
+
for (let i = 0; i < Math.min(x.length, y.length); i++) { if (x[i] !== y[i]) { return x[i] - y[i]; } }
|
|
488
|
+
return x.length - y.length;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/** for x in v: lists item by item, dicts key by key, strings char by char; anything else throws TypeError like Python. */
|
|
492
|
+
function pyIter(v) {
|
|
493
|
+
if (Array.isArray(v)) { return v; }
|
|
494
|
+
if (typeof v === 'string') { return Array.from(v); }
|
|
495
|
+
if (v !== null && typeof v === 'object' && !(v instanceof PyFloat)) { return keysOf(v); }
|
|
496
|
+
throw new TypeError('object is not iterable');
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
function asStr(v) {
|
|
500
|
+
if (typeof v !== 'string') { throw new TypeError(`'${typeof v}' object has no attribute 'split'`); }
|
|
501
|
+
return v;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// ---------------------------------------------------------------- contract constants
|
|
505
|
+
export const KEYWORDS = ['enableEdgeToEdge', 'EdgeToEdge.enable', 'setDecorFitsSystemWindows',
|
|
506
|
+
'WindowCompat.setDecorFitsSystemWindows', 'windowTranslucentStatus',
|
|
507
|
+
'windowDrawsSystemBarBackgrounds', 'fitsSystemWindows'];
|
|
508
|
+
// Draw behind the bars (the page pads itself) vs. inset handling on one view.
|
|
509
|
+
export const IMMERSIVE = new Set(['enableEdgeToEdge', 'EdgeToEdge.enable', 'windowTranslucentStatus']);
|
|
510
|
+
// Python: r"setDecorFitsSystemWindows\s*\(.*[,(]\s*false\s*\)" (`.` excludes \n)
|
|
511
|
+
export const DECOR_FALSE = rx(`setDecorFitsSystemWindows${S}*\\([^\\n]*[,(]${S}*false${S}*\\)`);
|
|
512
|
+
export const SKIP = new Set(['build', '.gradle', '.git', 'test', 'androidTest', 'intermediates']);
|
|
513
|
+
// How pages handle the system bars. Fixed, not per app: component-level background immersion
|
|
514
|
+
// (HarmonyOS best practice Immersive Window, option 1). The window keeps its default layout, so ArkUI
|
|
515
|
+
// lays every page out in the safe area and avoids the bars by itself; edge chrome only extends
|
|
516
|
+
// its *background* into them. Measured: the previous contract (window-level
|
|
517
|
+
// setWindowLayoutFullScreen(true) + AppStorage bar-height keys every page padded by) left the
|
|
518
|
+
// toolbar with no top padding on device while the window was full-screen: pages read the key
|
|
519
|
+
// once in aboutToAppear (the avoid area can be 0 then and arrives via avoidAreaChange), and the
|
|
520
|
+
// contract's own `@StorageProp` is a V1 decorator phase5_check bans in V2. The toolbar landed
|
|
521
|
+
// under the status bar on every page using the key (~25) and could not be tapped.
|
|
522
|
+
// Nothing here can go stale: no page computes a bar height.
|
|
523
|
+
export const SYSTEM_BARS = {
|
|
524
|
+
window_layer: 'EntryAbility does not call setWindowLayoutFullScreen; the window keeps its default ' +
|
|
525
|
+
'layout and ArkUI keeps all content in the safe area (status bar and navigation indicator ' +
|
|
526
|
+
'avoided by the system). It may set setWindowSystemBarProperties (bar ink color).',
|
|
527
|
+
immersive_host: 'For an `immersive` Activity (draws behind the bars), the chrome touching a bar ' +
|
|
528
|
+
"extends only its background into it: `.background(<color or @Builder>, { ignoresLayoutSafeAreaEdges: " +
|
|
529
|
+
"[LayoutSafeAreaEdge.TOP] })` on the shell/page root (status bar) and `[LayoutSafeAreaEdge.BOTTOM]` " +
|
|
530
|
+
'on the bottom chrome (navigation indicator). "Background" is every layer Android paints inside the ' +
|
|
531
|
+
'bar area, in z-order: a container color, and any full-size image (header picture), gradient or ' +
|
|
532
|
+
'scrim drawn above it; each goes into that background (an image via a @Builder), not just the ' +
|
|
533
|
+
'bottom color. Content stays in the safe area. Android ' +
|
|
534
|
+
'`fitsSystemWindows` / inset padding needs no Harmony counterpart.',
|
|
535
|
+
// Fixed height + expandSafeArea: the safe-area docs state the size does not change after extending, so the whole component shifts up by one bar height
|
|
536
|
+
// (measured: the weather1031 header image's bottom edge lost one bar height). GATE/CAND fixed-size-expand-safe-area.
|
|
537
|
+
full_bleed: 'Content that itself must draw under a bar (full-screen cover art, video) uses ' +
|
|
538
|
+
'component-level `.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])` on that component, ' +
|
|
539
|
+
'never the window layer. That component has no fixed height: with a fixed height or \'auto\' the ' +
|
|
540
|
+
'extension keeps its size and moves the whole component up by the bar height, so its bottom edge ' +
|
|
541
|
+
'rises too. Use a percentage height, or a fixed-height host whose background carries the content.',
|
|
542
|
+
// Measured (nova 16, API 24, side-by-side probe): a fixed-height Column at the page root reaches
|
|
543
|
+
// under the status bar with either form; the same Column inside Refresh, Scroll or List > ListItem
|
|
544
|
+
// stops at the safe-area top with both. The weather home header sat in Refresh, so its status bar
|
|
545
|
+
// stayed the page-root color. Enforced by GATE safe-area-in-clipping-ancestor. The probe looked at
|
|
546
|
+
// the top only: with expandSafeArea the fixed-height Column also lost a bar height at the bottom
|
|
547
|
+
// (weather1031 header image), hence the background form below.
|
|
548
|
+
clipping_ancestors: 'Neither form reaches a bar from inside Refresh, Scroll or List: the ancestor ' +
|
|
549
|
+
'clips the extension. When the chrome that touches a bar lives in one (a collapsing header inside ' +
|
|
550
|
+
'pull-to-refresh), put its background in a separate layer under the page root, outside the ' +
|
|
551
|
+
'container, sized by the same state and `.hitTestBehavior(HitTestMode.None)`; the content stays ' +
|
|
552
|
+
'where it is. That layer keeps its safe-area height (the same value as the header) and draws via ' +
|
|
553
|
+
'`.background(<color or @Builder>, { ignoresLayoutSafeAreaEdges: [LayoutSafeAreaEdge.TOP] })`, ' +
|
|
554
|
+
'whose area adds the bar on top; not `.expandSafeArea`, which only moves a fixed-height layer up. ' +
|
|
555
|
+
'A @Builder background does not follow later changes inside the builder, so put state-driven ' +
|
|
556
|
+
'opacity on the layer itself.',
|
|
557
|
+
non_immersive_host: 'For a `non-immersive` Activity: nothing; default layout.',
|
|
558
|
+
forbidden: 'No page or component reads a system-bar height: no getWindowAvoidArea for ' +
|
|
559
|
+
"TYPE_SYSTEM / TYPE_NAVIGATION_INDICATOR / TYPE_CUTOUT, no on('avoidAreaChange'), no AppStorage " +
|
|
560
|
+
'bar-height key, no padding by a bar height. (TYPE_KEYBOARD for soft-keyboard avoidance is fine.)',
|
|
561
|
+
};
|
|
562
|
+
export const OWNED_BY_ENTRY = ['entry/src/main/ets/entryability/EntryAbility.ets',
|
|
563
|
+
'entry/src/main/resources/base/profile/main_pages.json',
|
|
564
|
+
'entry/src/main/module.json5'];
|
|
565
|
+
|
|
566
|
+
const RE_EXTENDS = rx(`${NOT_W_BEFORE}class${S}+${W}+(?:<[^>{]*>)?${S}+extends${S}+(${WD}+)`);
|
|
567
|
+
const RE_KOTLIN_BASE = rx(`${NOT_W_BEFORE}class${S}+${W}+[^:{]*:${S}*(${WD}+)${S}*\\(`);
|
|
568
|
+
const RE_APP_THEME = rx(`<application${NOT_W_AFTER}[^>]*android:theme="@style/(${WD}+)"`, 'gs');
|
|
569
|
+
const RE_ACTIVITY_TAG = rx(`<activity${NOT_W_AFTER}([^>]*)>`, 'gs');
|
|
570
|
+
const RE_THEME_ATTR = rx(`android:theme="@style/(${WD}+)"`, 'g');
|
|
571
|
+
const RE_STYLE = rx(`<style${S}+name="(${WD}+)"(?:${S}+parent="@?(?:style/)?(${WD}+)")?`, 'g');
|
|
572
|
+
const RE_APP_NAME = rx(`<application${NOT_W_AFTER}[^>]*android:name="(${WD}+)"`, 's');
|
|
573
|
+
const RE_PACKAGE = rx(`package="(${WD}+)"`);
|
|
574
|
+
const RE_NAMESPACE = rx(`namespace${S}*=?${S}*["'](${WD}+)`);
|
|
575
|
+
const RE_ACTIVITY_NAME = rx(`<activity${NOT_W_AFTER}[^>]*android:name="(${WD}+)"`, 'gs');
|
|
576
|
+
|
|
577
|
+
const skipped = (p) => p.parts.some((x) => SKIP.has(x));
|
|
578
|
+
const toPath = (p) => (p instanceof PyPath ? p : rootPath(p));
|
|
579
|
+
|
|
580
|
+
export function _sources(android) {
|
|
581
|
+
return rglob(toPath(android), '*').filter((p) => (p.suffix === '.java' || p.suffix === '.kt') && !skipped(p));
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
export function _classFile(fqn, sources) {
|
|
585
|
+
const tail = fqn.replace(/\./g, '/');
|
|
586
|
+
return sources.find((p) => p.posix.endsWith(tail + p.suffix)) ?? null;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/** The Activity file and its in-project base classes. */
|
|
590
|
+
export function _baseChain(p, sources, limit = 6) {
|
|
591
|
+
const chain = [];
|
|
592
|
+
const seen = new Set();
|
|
593
|
+
while (p && !seen.has(p.key) && chain.length < limit) {
|
|
594
|
+
seen.add(p.key);
|
|
595
|
+
chain.push(p);
|
|
596
|
+
const m = RE_EXTENDS.exec(_read(p)) || RE_KOTLIN_BASE.exec(_read(p));
|
|
597
|
+
const base = m ? m[1].split('.').at(-1) : null;
|
|
598
|
+
p = base ? (sources.find((s) => s.stem === base) ?? null) : null;
|
|
599
|
+
}
|
|
600
|
+
return chain;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export function _hits(p, root) {
|
|
604
|
+
const out = [];
|
|
605
|
+
const lines = pySplitlines(_read(p));
|
|
606
|
+
for (let i = 0; i < lines.length; i++) {
|
|
607
|
+
const line = lines[i];
|
|
608
|
+
for (const k of KEYWORDS) {
|
|
609
|
+
const st = pyStrip(line);
|
|
610
|
+
if (line.includes(k) && !(st.startsWith('import ') || st.startsWith('//') || st.startsWith('*'))) {
|
|
611
|
+
// The qualified form already reports its own keyword.
|
|
612
|
+
if (k === 'setDecorFitsSystemWindows' && line.includes('WindowCompat.setDecorFitsSystemWindows')) { continue; }
|
|
613
|
+
if (k === 'fitsSystemWindows' && line.includes('setDecorFitsSystemWindows')) { continue; }
|
|
614
|
+
out.push({ keyword: k, at: `${p.relPosix()}:${i + 1}`, line: pyHead(st, 160) });
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
return out;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
export function _manifest(android) {
|
|
622
|
+
const ms = rglob(toPath(android), 'AndroidManifest.xml').filter((p) => !skipped(p));
|
|
623
|
+
const main = ms.find((p) => p.parentName === 'main') ?? (ms.length ? ms[0] : null);
|
|
624
|
+
return [main, main ? _read(main) : ''];
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/** Theme names the manifest applies to this activity (and the application). */
|
|
628
|
+
export function _themes(android, manifestText, activityShort) {
|
|
629
|
+
const names = [...manifestText.matchAll(RE_APP_THEME)].map((m) => m[1]);
|
|
630
|
+
const nameRe = rx(`android:name="${WD}*\\.?${reEscape(activityShort)}"`);
|
|
631
|
+
for (const m of manifestText.matchAll(RE_ACTIVITY_TAG)) {
|
|
632
|
+
const attrs = m[1];
|
|
633
|
+
if (nameRe.test(attrs)) { names.push(...[...attrs.matchAll(RE_THEME_ATTR)].map((x) => x[1])); }
|
|
634
|
+
}
|
|
635
|
+
return names;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
// Keyword items in those styles and their parents (values*/ themes/styles).
|
|
639
|
+
export function _styleHits(android, themeNames, root) {
|
|
640
|
+
const files = rglob(toPath(android), '*.xml').filter((p) => p.parentName.startsWith('values') && !skipped(p));
|
|
641
|
+
const defs = new Map();
|
|
642
|
+
for (const f of files) {
|
|
643
|
+
for (const m of _read(f).matchAll(RE_STYLE)) {
|
|
644
|
+
if (!defs.has(m[1])) { defs.set(m[1], []); }
|
|
645
|
+
defs.get(m[1]).push([f, m[2] ?? null]);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
const out = [];
|
|
649
|
+
const todo = [...themeNames];
|
|
650
|
+
const seen = new Set();
|
|
651
|
+
while (todo.length) {
|
|
652
|
+
const name = todo.pop();
|
|
653
|
+
if (seen.has(name)) { continue; }
|
|
654
|
+
seen.add(name);
|
|
655
|
+
for (const [f, parent] of defs.get(name) ?? []) {
|
|
656
|
+
const text = pySplitlines(_read(f));
|
|
657
|
+
const start = text.findIndex((l) => l.includes(`name="${name}"`) && l.includes('<style'));
|
|
658
|
+
if (start < 0) { continue; }
|
|
659
|
+
for (let i = start; i < text.length; i++) {
|
|
660
|
+
const l = text[i];
|
|
661
|
+
for (const k of KEYWORDS) {
|
|
662
|
+
if (l.includes(`name="${k}"`) || l.includes(`name="android:${k}"`)) {
|
|
663
|
+
out.push({ keyword: k, at: `${f.relPosix()}:${i + 1}`, line: pyHead(pyStrip(l), 160), theme: name });
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
if (l.includes('</style>')) { break; }
|
|
667
|
+
}
|
|
668
|
+
if (parent) { todo.push(parent); }
|
|
669
|
+
}
|
|
670
|
+
if (name.includes('.')) {
|
|
671
|
+
todo.push(name.slice(0, name.lastIndexOf('.'))); // implicit dotted parent
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return out;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export function windowMode(hits) {
|
|
678
|
+
const kinds = new Set(hits.map((h) => h.keyword));
|
|
679
|
+
const immersive = hits.filter((h) => IMMERSIVE.has(h.keyword) ||
|
|
680
|
+
(h.keyword.endsWith('setDecorFitsSystemWindows') && DECOR_FALSE.test(h.line)) ||
|
|
681
|
+
((h.keyword === 'windowTranslucentStatus' || h.keyword === 'windowDrawsSystemBarBackgrounds') &&
|
|
682
|
+
h.line.replace(/ /g, '').includes('>true<')));
|
|
683
|
+
if (immersive.length) { return ['immersive', immersive]; }
|
|
684
|
+
if (!kinds.size || [...kinds].every((k) => k === 'fitsSystemWindows')) {
|
|
685
|
+
// fitsSystemWindows alone is per-view inset padding, not a window mode.
|
|
686
|
+
return ['non-immersive', []];
|
|
687
|
+
}
|
|
688
|
+
return ['needs-review', hits];
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// ---------------------------------------------------------------- shell hosts
|
|
692
|
+
// An Activity that swaps Fragments (or plain Views) inside a persistent chrome (bottom nav,
|
|
693
|
+
// tabs, drawer) is a *shell host*: what it swaps in are content units, not routed pages.
|
|
694
|
+
// Detected from independent signals, all of which must hold, so an app without such a shell is
|
|
695
|
+
// untouched (build() then omits `shell_hosts` and every output stays byte-identical):
|
|
696
|
+
// 1. the UTG has >= 2 swap edges from the Activity to distinct destinations:
|
|
697
|
+
// `fragment-transaction` → `fragment:`, or `view-swap` → `view-page:` (a content
|
|
698
|
+
// FrameLayout whose child the Activity replaces with removeAllViews + addView);
|
|
699
|
+
// 2. a persistent chrome widget is declared, either
|
|
700
|
+
// a. in the Activity's content layout XML (setContentView(R.layout.x) in its base chain), or
|
|
701
|
+
// b. in code: the Activity chain `addView(<Chrome>(…))`s a widget whose class name is a
|
|
702
|
+
// chrome kind (a custom `PhoneNavigationBar` counts; Android draws it once, every
|
|
703
|
+
// destination below it is swapped).
|
|
704
|
+
// Measured (where2study7): MainActivity built its layout in code (setContentView(adaptiveRoot)),
|
|
705
|
+
// added a custom PhoneNavigationBar with Gravity.BOTTOM and swapped 5 view-pages. Signal 1 only
|
|
706
|
+
// knew fragment-transaction and signal 2 only XML, so no shell was found; the parent copied the
|
|
707
|
+
// bar into 5 @Entry pages and 4 of them left it vertically centered.
|
|
708
|
+
const CHROME_KIND = '(?:BottomNavigation|NavigationBar|NavigationRail|BottomBar|TabBar|TabLayout|NavigationView|DrawerLayout|BottomAppBar)';
|
|
709
|
+
const RE_CHROME = rx(`<([\\w.]*(?:BottomNavigationView|NavigationBarView|NavigationRailView|TabLayout|NavigationView|DrawerLayout|BottomAppBar))${NOT_W_AFTER}`, 'g');
|
|
710
|
+
const RE_CHROME_CODE = rx(`addView${S}*\\(${S}*(?:new${S}+)?(?:${WD}*\\.)?(${W}*${CHROME_KIND}${W}*)${S}*\\(`, 'g');
|
|
711
|
+
const RE_GRAVITY = rx(`Gravity\\.(BOTTOM|TOP|START|END|LEFT|RIGHT)${NOT_W_AFTER}`);
|
|
712
|
+
const RE_SET_CONTENT = rx(`setContentView${S}*\\(${S}*R\\.layout\\.(${W}+)`);
|
|
713
|
+
const RE_CONTAINER_ID = rx(`\\.(?:replace|add)${S}*\\(${S}*R\\.id\\.(${W}+)`, 'g');
|
|
714
|
+
const RE_VIEW_CONTAINER = rx(`(${W}+)\\.removeAllViews${S}*\\(${S}*\\)[^]{0,240}?\\1\\.addView${S}*\\(`, 'g');
|
|
715
|
+
const RE_TRANSITION = rx(`setCustomAnimations${S}*\\([^)]*\\)|TransitionEffect\\.${W}+|Material(?:SharedAxis|FadeThrough|ContainerTransform|Fade)|overridePendingTransition${S}*\\([^)]*\\)`, 'g');
|
|
716
|
+
const SWAP_EDGES = { 'fragment-transaction': 'fragment:', 'view-swap': 'view-page:' };
|
|
717
|
+
|
|
718
|
+
const lineOf = (text, idx) => text.slice(0, idx).split('\n').length;
|
|
719
|
+
|
|
720
|
+
/** Chrome added in code: `addView(PhoneNavigationBar(this).apply {…}, LayoutParams(…, Gravity.BOTTOM))`. */
|
|
721
|
+
function codeChrome(chain) {
|
|
722
|
+
const out = [];
|
|
723
|
+
for (const p of chain) {
|
|
724
|
+
const text = _read(p);
|
|
725
|
+
for (const m of text.matchAll(RE_CHROME_CODE)) {
|
|
726
|
+
// The addView call's own arguments (LayoutParams with its gravity) end at its closing paren.
|
|
727
|
+
let depth = 0;
|
|
728
|
+
let end = m.index + m[0].length - 1;
|
|
729
|
+
for (let i = text.indexOf('(', m.index); i < text.length; i++) {
|
|
730
|
+
if (text[i] === '(') { depth++; } else if (text[i] === ')' && --depth === 0) { end = i; break; }
|
|
731
|
+
}
|
|
732
|
+
const g = RE_GRAVITY.exec(text.slice(m.index, end + 1));
|
|
733
|
+
out.push({ widget: m[1], at: `${p.relPosix()}:${lineOf(text, m.index)}`,
|
|
734
|
+
...(g ? { gravity: g[1] } : {}) });
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return out;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
export function detectShellHosts(android, sources, graph, acts) {
|
|
741
|
+
const links = pyIter(dget(graph, 'links', []));
|
|
742
|
+
const byAct = new Map();
|
|
743
|
+
for (const l of links) {
|
|
744
|
+
const prefix = SWAP_EDGES[pyStr(dget(l, 'mechanism'))];
|
|
745
|
+
if (prefix === undefined) { continue; }
|
|
746
|
+
const s = pyStr(dget(l, 'source'));
|
|
747
|
+
const t = pyStr(dget(l, 'target'));
|
|
748
|
+
if (!s.startsWith('activity:') || !t.startsWith(prefix)) { continue; }
|
|
749
|
+
if (!byAct.has(s)) { byAct.set(s, new Set()); }
|
|
750
|
+
byAct.get(s).add(t);
|
|
751
|
+
}
|
|
752
|
+
const layouts = rglob(toPath(android), '*.xml').filter((p) => p.parentName.startsWith('layout') && !skipped(p));
|
|
753
|
+
const hosts = {};
|
|
754
|
+
for (const n of acts) {
|
|
755
|
+
const id = pyStr(dget(n, 'id'));
|
|
756
|
+
const dests = byAct.get(id);
|
|
757
|
+
if (!dests || dests.size < 2) { continue; }
|
|
758
|
+
const f = _classFile(asStr(n.fqn), sources);
|
|
759
|
+
if (!f) { continue; }
|
|
760
|
+
const chain = _baseChain(f, sources);
|
|
761
|
+
let layoutName = null;
|
|
762
|
+
for (const p of chain) {
|
|
763
|
+
const m = RE_SET_CONTENT.exec(_read(p));
|
|
764
|
+
if (m) { layoutName = m[1]; break; }
|
|
765
|
+
}
|
|
766
|
+
const layoutFile = layoutName ? layouts.find((p) => p.stem === layoutName) : null;
|
|
767
|
+
let chrome = [];
|
|
768
|
+
if (layoutFile) {
|
|
769
|
+
const xml = _read(layoutFile);
|
|
770
|
+
chrome = [...xml.matchAll(RE_CHROME)].map((m) => ({
|
|
771
|
+
widget: m[1].split('.').at(-1), at: `${layoutFile.relPosix()}:${lineOf(xml, m.index)}` }));
|
|
772
|
+
}
|
|
773
|
+
if (!chrome.length) { chrome = codeChrome(chain); }
|
|
774
|
+
if (!chrome.length) { continue; }
|
|
775
|
+
const containers = new Set();
|
|
776
|
+
const transitions = [];
|
|
777
|
+
for (const p of chain) {
|
|
778
|
+
const text = _read(p);
|
|
779
|
+
for (const m of text.matchAll(RE_CONTAINER_ID)) { containers.add(m[1]); }
|
|
780
|
+
for (const m of text.matchAll(RE_VIEW_CONTAINER)) { containers.add(m[1]); }
|
|
781
|
+
for (const m of text.matchAll(RE_TRANSITION)) {
|
|
782
|
+
transitions.push({ at: `${p.relPosix()}:${lineOf(text, m.index)}`, declaration: pyHead(pyStrip(m[0]), 160) });
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
hosts[id] = {
|
|
786
|
+
fqn: n.fqn, layout: layoutFile ? layoutFile.relPosix() : null,
|
|
787
|
+
containers: [...containers].sort(cmpCodepoints), chrome,
|
|
788
|
+
// Destinations the host itself swaps in (UTG fragment-transaction / view-swap edges from
|
|
789
|
+
// the Activity). Which of them sit on a chrome tab (replace + clear back stack) and which
|
|
790
|
+
// are pushed children (add/hide + back stack) is the host's own dispatch code, not
|
|
791
|
+
// decidable from the graph: the parent reads it before dispatch and records it in the
|
|
792
|
+
// shell contract.
|
|
793
|
+
host_destinations: [...dests].sort(cmpCodepoints),
|
|
794
|
+
transitions,
|
|
795
|
+
transitions_note: transitions.length ? 'declared in source' :
|
|
796
|
+
'no transition declared anywhere in the Activity chain: content swaps are NOT animated',
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
return hosts;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// Raw ids of activities (None / numbers etc.), so render uses str(aid) rather than the JSON key.
|
|
803
|
+
const RAW_IDS = Symbol('rawIds');
|
|
804
|
+
|
|
805
|
+
// The SDK the build compiles against. Measured: the machine had two SDK copies; a group looked up
|
|
806
|
+
// `supportSvg2` in AppData/Local/OpenHarmony/Sdk/20 (absent), concluded the API did not exist and
|
|
807
|
+
// left the stroke icon untinted, while the build used DEVECO_SDK_HOME (API 24, image.d.ts:2153 has it).
|
|
808
|
+
// local.properties is not a source: for a HarmonyOS project hvigor skips the file and drops
|
|
809
|
+
// hwsdk.dir, taking the SDK from DEVECO_SDK_HOME alone (hvigor-ohos-plugin sdk/lib/property-get.js).
|
|
810
|
+
const RE_COMPAT_SDK = /compatibleSdkVersion["']?\s*:\s*["']?([^"',\s}]+)/;
|
|
811
|
+
export function sdkFacts(hp, env = process.env, deveco = null) {
|
|
812
|
+
hp = toPath(hp);
|
|
813
|
+
const prof = _read(hp.child('build-profile.json5')) || '';
|
|
814
|
+
const m = RE_COMPAT_SDK.exec(prof);
|
|
815
|
+
const homes = [];
|
|
816
|
+
// --deveco: the DevEco install (or its sdk dir) the caller validated and builds with; the migrate
|
|
817
|
+
// orchestrator passes DEVECO_HOME as a skill parameter, so the env var may be unset here.
|
|
818
|
+
if (truthy(deveco)) { homes.push(path.join(deveco, 'sdk'), deveco); }
|
|
819
|
+
if (truthy(env.DEVECO_SDK_HOME)) { homes.push(env.DEVECO_SDK_HOME); }
|
|
820
|
+
if (truthy(env.DEVECO_HOME)) { homes.push(path.join(env.DEVECO_HOME, 'sdk')); }
|
|
821
|
+
let dts = null;
|
|
822
|
+
for (const h of homes) {
|
|
823
|
+
const d = path.join(h, 'default', 'openharmony', 'ets', 'component');
|
|
824
|
+
let ok = false;
|
|
825
|
+
try { ok = fs.statSync(d).isDirectory(); } catch { ok = false; }
|
|
826
|
+
if (ok) { dts = d; break; }
|
|
827
|
+
}
|
|
828
|
+
return {
|
|
829
|
+
compatible_sdk: m ? m[1] : null,
|
|
830
|
+
component_dts_dir: dts,
|
|
831
|
+
rule: dts
|
|
832
|
+
? 'Decide whether an ArkUI API exists only from the .d.ts files under component_dts_dir. Other ' +
|
|
833
|
+
'SDK copies on the machine are not what the build uses.'
|
|
834
|
+
: 'No SDK found from --deveco / DEVECO_SDK_HOME / DEVECO_HOME. Before deciding an API is missing, find the ' +
|
|
835
|
+
'SDK path the build log prints and read the .d.ts there; never conclude from another copy.',
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// ---------------------------------------------------------------- theme mechanism
|
|
840
|
+
// Measured (CoolMall 11-07): AppTheme picks DarkColorScheme / LightColorScheme by isSystemInDarkTheme()
|
|
841
|
+
// and copies primary = themeColor from a preference flow; the UI groups copied the light values into
|
|
842
|
+
// `static readonly` hex constants, so setColorMode(DARK) later changed nothing (it switches resource
|
|
843
|
+
// qualifiers only) and the theme colour reached two components. Decided here from source, once.
|
|
844
|
+
const THEME_DARK = [
|
|
845
|
+
['darkColorScheme', rx(`${NOT_W_BEFORE}(?:darkColorScheme|darkColors)${S}*\\(`)],
|
|
846
|
+
['dynamicDarkColorScheme', rx(`${NOT_W_BEFORE}dynamicDarkColorScheme${S}*\\(`)],
|
|
847
|
+
['isSystemInDarkTheme', rx(`${NOT_W_BEFORE}isSystemInDarkTheme${S}*\\(`)],
|
|
848
|
+
['setDefaultNightMode', rx(`${NOT_W_BEFORE}setDefaultNightMode${S}*\\(`)],
|
|
849
|
+
['setApplicationNightMode', rx(`${NOT_W_BEFORE}setApplicationNightMode${S}*\\(`)],
|
|
850
|
+
['UI_MODE_NIGHT', rx(`${NOT_W_BEFORE}UI_MODE_NIGHT_(?:YES|MASK)${NOT_W_AFTER}`)],
|
|
851
|
+
];
|
|
852
|
+
// A scheme whose primary is a parameter/variable (lowerCamel, no `_`: not a generated md_theme_* constant).
|
|
853
|
+
// Material Theme Builder names its constants primaryLight / primaryDark (`val primaryLight = Color(…)`):
|
|
854
|
+
// those are fixed colours, filtered in themeFacts.
|
|
855
|
+
const RE_RUNTIME_PRIMARY = rx(`${NOT_W_BEFORE}primary${S}*=${S}*([a-z][\\p{L}\\p{N}]*)${S}*(?:[,)]|$)`);
|
|
856
|
+
const RE_DAYNIGHT = rx(`<style${S}[^>]*parent="[^"]*DayNight`);
|
|
857
|
+
|
|
858
|
+
export const THEME_POLICY = {
|
|
859
|
+
static: 'The Android theme has one colour scheme: colours may be literals or resources.',
|
|
860
|
+
dynamic: 'Every colour the Android theme changes (surfaces, text, borders, icon tints, sheet and ' +
|
|
861
|
+
"dialog backgrounds) is a resource `$r('app.color.<name>')`, defined under one name in " +
|
|
862
|
+
'`resources/base/element/color.json` (light value) and `resources/dark/element/color.json` ' +
|
|
863
|
+
'(the dark scheme / values-night value, cited). `ApplicationContext.setColorMode` only switches ' +
|
|
864
|
+
"resource qualifiers: a `'#RRGGBB'` string or a `static readonly` hex constant never changes. " +
|
|
865
|
+
'bindSheet / bindPopup / CustomDialog take `backgroundColor` explicitly (the sheet default is ' +
|
|
866
|
+
'Color.White). A colour identical in both Android schemes may stay a literal under ' +
|
|
867
|
+
'`// THEME-FIXED: <both scheme lines>`.',
|
|
868
|
+
runtime: 'The user picks a colour at runtime (`hits_runtime`): it is read from one observable theme ' +
|
|
869
|
+
'state (per PARADIGM) through getters, never copied into a `static readonly` constant; the UI ' +
|
|
870
|
+
'groups read it, the logic stage wires its persistence.',
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
/** `val <name> = Color(…)` / `val <name>: Color = Color(…)`: a fixed colour constant. */
|
|
874
|
+
const RE_COLOR_VAL = /(?:^|\n)[ \t]*(?:(?:private|internal|public)[ \t]+)?val[ \t]+([A-Za-z_][\w]*)[ \t]*(?::[ \t]*Color[ \t]*)?=[ \t]*Color[ \t]*\(/g;
|
|
875
|
+
|
|
876
|
+
/** A colour constant, not a runtime value: Theme Builder's `…Light` / `…Dark`, or a `val X = Color(…)`. */
|
|
877
|
+
export function _fixedColorName(name, colorVals) {
|
|
878
|
+
return /(?:Light|Dark)(?:MediumContrast|HighContrast)?$/.test(name) || colorVals.has(name);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export function themeFacts(android, sources) {
|
|
882
|
+
const root = toPath(android);
|
|
883
|
+
const dark = [];
|
|
884
|
+
const runtime = [];
|
|
885
|
+
const colorVals = new Set(sources.flatMap((p) => [..._read(p).matchAll(RE_COLOR_VAL)].map((m) => m[1])));
|
|
886
|
+
const hit = (list, keyword, p, i, line) => list.push({ keyword, at: `${p.relPosix()}:${i + 1}`, line: pyHead(pyStrip(line), 160) });
|
|
887
|
+
for (const p of sources) {
|
|
888
|
+
const text = _read(p);
|
|
889
|
+
const lines = pySplitlines(text);
|
|
890
|
+
const schemeFile = /ColorScheme|lightColors|darkColors/.test(text);
|
|
891
|
+
for (let i = 0; i < lines.length; i++) {
|
|
892
|
+
const st = pyStrip(lines[i]);
|
|
893
|
+
if (st.startsWith('import ') || st.startsWith('//') || st.startsWith('*')) { continue; }
|
|
894
|
+
for (const [k, re] of THEME_DARK) { if (re.test(lines[i])) { hit(dark, k, p, i, lines[i]); } }
|
|
895
|
+
const pm = schemeFile ? RE_RUNTIME_PRIMARY.exec(lines[i]) : null;
|
|
896
|
+
if (pm && !_fixedColorName(pm[1], colorVals)) { hit(runtime, 'primary = <variable>', p, i, lines[i]); }
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
const xml = rglob(root, '*.xml').filter((p) => p.parentName.startsWith('values') && !skipped(p));
|
|
900
|
+
const nightDirs = new Set();
|
|
901
|
+
for (const p of xml) {
|
|
902
|
+
if (p.parentName.startsWith('values-night')) {
|
|
903
|
+
if (!nightDirs.has(p.parentName)) { nightDirs.add(p.parentName); dark.push({ keyword: p.parentName, at: p.relPosix(), line: '(qualifier directory)' }); }
|
|
904
|
+
continue;
|
|
905
|
+
}
|
|
906
|
+
const lines = pySplitlines(_read(p));
|
|
907
|
+
lines.forEach((l, i) => { if (RE_DAYNIGHT.test(l)) { hit(dark, 'DayNight theme', p, i, l); } });
|
|
908
|
+
}
|
|
909
|
+
const mode = dark.length && runtime.length ? 'light-dark+runtime-color'
|
|
910
|
+
: runtime.length ? 'runtime-color' : dark.length ? 'light-dark' : 'static';
|
|
911
|
+
return { mode, hits_dark: dark, hits_runtime: runtime };
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
export function build(hp, android, staticPath = null, env = process.env, deveco = null) {
|
|
915
|
+
const outer = _readCache;
|
|
916
|
+
_readCache = outer ?? new Map();
|
|
917
|
+
try { return _build(hp, android, staticPath, env, deveco); } finally { _readCache = outer; }
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
function _build(hp, android, staticPath, env, deveco) {
|
|
921
|
+
hp = toPath(hp);
|
|
922
|
+
android = toPath(android);
|
|
923
|
+
const root = android;
|
|
924
|
+
const sources = _sources(android);
|
|
925
|
+
const [, mtext] = _manifest(android);
|
|
926
|
+
const app = RE_APP_NAME.exec(mtext);
|
|
927
|
+
const pkg = RE_PACKAGE.exec(mtext);
|
|
928
|
+
const gradle = rglob(android, 'build.gradle*').find((p) => p.parentName === 'app') ?? null;
|
|
929
|
+
const ns = gradle ? RE_NAMESPACE.exec(_read(gradle)) : null;
|
|
930
|
+
const basePkg = (pkg || ns) ? (pkg || ns)[1] : '';
|
|
931
|
+
const q = (n) => (n.startsWith('.') ? basePkg + n : n);
|
|
932
|
+
const appFile = app ? _classFile(q(app[1]), sources) : null;
|
|
933
|
+
let staticFile = truthy(staticPath) ? toPath(staticPath) : hp.child('.hometrans', 'utg_static', 'utg.json');
|
|
934
|
+
// Measured (where2study 11-05): `--static <utg_static dir>` read as '' gave an empty graph, so the
|
|
935
|
+
// shell host went undetected with exit 0 and every tab became its own @Entry page. A directory
|
|
936
|
+
// means its utg.json; a graph that is missing or has no nodes stops the run: an input error (exit 2,
|
|
937
|
+
// one line), not a crash. Without the graph the contract would state "no shell host" as a fact.
|
|
938
|
+
if (isDir(staticFile)) { staticFile = staticFile.child('utg.json'); }
|
|
939
|
+
const graph = pyJsonLoads(_read(staticFile) || '{}');
|
|
940
|
+
if (!pyIter(dget(graph, 'nodes', [])).length) {
|
|
941
|
+
throw new InputError(`static UTG ${staticFile.fs} is missing or has no nodes: pass --static <utg.json>`);
|
|
942
|
+
}
|
|
943
|
+
const plan = dget(pyJsonLoads(_read(hp.child('.hometrans', 'ui_info', 'conversion_set.json')) || '{}'), 'plan', {});
|
|
944
|
+
let acts = pyIter(dget(graph, 'nodes', [])).filter((n) => pyStr(dget(n, 'kind')).includes('activity') &&
|
|
945
|
+
truthy(dget(n, 'fqn')));
|
|
946
|
+
if (!acts.length) {
|
|
947
|
+
acts = [...mtext.matchAll(RE_ACTIVITY_NAME)].map((m) => ({ id: `activity:${m[1].split('.').at(-1)}`, fqn: q(m[1]) }));
|
|
948
|
+
}
|
|
949
|
+
const activities = {};
|
|
950
|
+
const rawIds = new Map();
|
|
951
|
+
Object.defineProperty(activities, RAW_IDS, { value: rawIds });
|
|
952
|
+
for (const n of acts) {
|
|
953
|
+
if (!Object.hasOwn(n, 'id') || !Object.hasOwn(n, 'fqn')) { throw new Error("KeyError: 'id'"); }
|
|
954
|
+
const fqn = asStr(n.fqn);
|
|
955
|
+
const f = _classFile(fqn, sources);
|
|
956
|
+
const chain = f ? _baseChain(f, sources) : [];
|
|
957
|
+
const files = chain.concat(appFile && !chain.some((p) => p.key === appFile.key) ? [appFile] : []);
|
|
958
|
+
const hits = files.flatMap((p) => _hits(p, root));
|
|
959
|
+
const themes = _themes(android, mtext, fqn.split('.').at(-1));
|
|
960
|
+
hits.push(..._styleHits(android, themes, root));
|
|
961
|
+
const [mode, basis] = windowMode(hits);
|
|
962
|
+
const key = pyKey(n.id);
|
|
963
|
+
rawIds.set(key, n.id);
|
|
964
|
+
pySet(activities, key, {
|
|
965
|
+
fqn: n.fqn, mode,
|
|
966
|
+
searched: files.map((p) => p.relPosix()).concat([`themes: ${themes.join(', ') || '(none)'}`]),
|
|
967
|
+
hits, basis,
|
|
968
|
+
inset_views: hits.filter((h) => h.keyword === 'fitsSystemWindows').map((h) => h.at),
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
const shellHosts = detectShellHosts(android, sources, graph, acts);
|
|
972
|
+
const res = hp.child('entry', 'src', 'main', 'resources');
|
|
973
|
+
const fontsDir = res.child('rawfile', 'fonts');
|
|
974
|
+
const fonts = isDir(fontsDir) ? glob(fontsDir, '*.[ot]tf').map((p) => p.name).sort(cmpCodepoints) : [];
|
|
975
|
+
const contract = {
|
|
976
|
+
schema: 'shell-contract/1',
|
|
977
|
+
entry_node: dget(plan, 'entry_node'), launcher_host: dget(plan, 'launcher_host'),
|
|
978
|
+
keywords: KEYWORDS, activities,
|
|
979
|
+
system_bars: SYSTEM_BARS,
|
|
980
|
+
sdk: sdkFacts(hp, env, deveco),
|
|
981
|
+
theme: themeFacts(android, sources),
|
|
982
|
+
fonts: fonts.map((f) => ({ file: `rawfile/fonts/${f}`, family: pyStem(f) })),
|
|
983
|
+
owned_by_entry_group: OWNED_BY_ENTRY,
|
|
984
|
+
...(Object.keys(shellHosts).length ? { shell_hosts: shellHosts } : {}),
|
|
985
|
+
rules: [
|
|
986
|
+
'Only the entry group writes the files in owned_by_entry_group.',
|
|
987
|
+
"The entry group's EntryAbility leaves the window layout at its default (system_bars.window_layer) " +
|
|
988
|
+
'and registers every font in `fonts` under its `family` before windowStage.loadContent.',
|
|
989
|
+
'Every page handles the system bars per system_bars for its host Activity mode and never reads ' +
|
|
990
|
+
'a bar height (system_bars.forbidden).',
|
|
991
|
+
// Shell state defaults: a source-only group's mock writes its data state into the shell and changes every host page
|
|
992
|
+
// (measured: G028 mocked MainShell.playerVisible as true, so the home page grew a player bar from nowhere,
|
|
993
|
+
// which the captured home reference does not have; that group had itself derived from source that it is hidden by default).
|
|
994
|
+
// But only "structural" state is forbidden. Measured weather1031: forecast data lives on the cross-page shared MainViewModel,
|
|
995
|
+
// the old wording forbade mocking "shared VM fields" wholesale, leaving the home page hourly / day forecast empty,
|
|
996
|
+
// while the captured reference had data in both.
|
|
997
|
+
'Structure state that lives in the shell or is shared across pages (chrome visibility such as ' +
|
|
998
|
+
'a player sheet, badge or drawer, a selected tab, AppStorage flags: anything that adds, removes ' +
|
|
999
|
+
"or switches UI on another host page) starts at the Android source's initial state. A group's " +
|
|
1000
|
+
'mock data-state never sets it.',
|
|
1001
|
+
'Content data on a shared VM/Model (list items, forecast entries, displayed values) is not ' +
|
|
1002
|
+
'structure state. When a captured page shows it populated, the group that renders it mocks it ' +
|
|
1003
|
+
'to reproduce that reference (conversion-procedure.md mock rules), marked `// TODO(data-layer)`, ' +
|
|
1004
|
+
'provided every captured page that reads the field shows it populated; otherwise it starts at the ' +
|
|
1005
|
+
"Android source's initial state. A group that may not edit the shared VM reports the mock under " +
|
|
1006
|
+
'`shell requests`.',
|
|
1007
|
+
'A group that needs anything else from the shell (a route, a window flag, a shell state value) ' +
|
|
1008
|
+
'reports it under `shell requests` instead of writing it; the Step 5.5 wiring sub-agent applies it.'],
|
|
1009
|
+
};
|
|
1010
|
+
const meta = hp.child('.hometrans');
|
|
1011
|
+
fs.mkdirSync(meta.fs, { recursive: true });
|
|
1012
|
+
writeText(meta.child('shell_contract.json').fs, pyJsonDumps(contract, 1));
|
|
1013
|
+
writeText(meta.child('shell_contract.md').fs, render(contract));
|
|
1014
|
+
return contract;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
export function render(c) {
|
|
1018
|
+
const out = ['# ' + "Project Fact (Shell Contract)", '',
|
|
1019
|
+
'Generated by `shell_contract.mjs` from Android source. Window mode below is the result of ' +
|
|
1020
|
+
`searching every keyword of conversion-procedure.md's ${"Window Mode Evidence"} ① in the Activity, its base ` +
|
|
1021
|
+
'classes, the Application class and the themes the manifest applies. Cite it for item ①; ' +
|
|
1022
|
+
'items ②③④ are still written per page.', ''];
|
|
1023
|
+
const raw = c.activities[RAW_IDS];
|
|
1024
|
+
for (const aid of keysOf(c.activities)) {
|
|
1025
|
+
const a = c.activities[aid];
|
|
1026
|
+
out.push(`## ${raw && raw.has(aid) ? pyStr(raw.get(aid)) : aid} — **${a.mode}**`);
|
|
1027
|
+
out.push(`- searched: ${a.searched.join('; ')}`);
|
|
1028
|
+
if (a.hits.length) {
|
|
1029
|
+
out.push(...a.hits.map((h) => `- \`${h.at}\` ${h.keyword}: \`${h.line}\``));
|
|
1030
|
+
} else {
|
|
1031
|
+
out.push(`- all keywords searched, zero hits: ${c.keywords.join(', ')}`);
|
|
1032
|
+
}
|
|
1033
|
+
if (a.mode === 'needs-review') {
|
|
1034
|
+
out.push('- **needs-review**: the hits do not decide the mode by themselves. The parent decides ' +
|
|
1035
|
+
'it before dispatch and records the reason here.');
|
|
1036
|
+
}
|
|
1037
|
+
out.push('');
|
|
1038
|
+
}
|
|
1039
|
+
if (c.shell_hosts) {
|
|
1040
|
+
out.push('## Shell hosts', '',
|
|
1041
|
+
'An Activity below swaps Fragments or Views inside a persistent chrome. What it swaps in are ' +
|
|
1042
|
+
'content units mounted by the entry group\'s shell, not routed pages: they carry no `@Entry`, ' +
|
|
1043
|
+
'draw no chrome, and reach each other through the shell, not `router.pushUrl`. The shell draws ' +
|
|
1044
|
+
'the chrome once, at the gravity listed.', '');
|
|
1045
|
+
for (const id of keysOf(c.shell_hosts)) {
|
|
1046
|
+
const h = c.shell_hosts[id];
|
|
1047
|
+
out.push(`### ${id}`, `- layout: ${h.layout ? `\`${h.layout}\`` : 'built in code'}; content containers: ${h.containers.map((x) => `\`${x}\``).join(', ') || '(none found)'}`);
|
|
1048
|
+
out.push(...h.chrome.map((x) => `- chrome \`${x.widget}\` at \`${x.at}\`${x.gravity ? ` (Gravity.${x.gravity})` : ''}`));
|
|
1049
|
+
out.push(`- host-swapped destinations (${h.host_destinations.length}): ${h.host_destinations.join(', ')}`);
|
|
1050
|
+
out.push(`- transitions: ${h.transitions_note}`);
|
|
1051
|
+
out.push(...h.transitions.map((x) => ` - \`${x.at}\` \`${x.declaration}\``), '');
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
out.push('## Shell interface', '', 'System bars (component-level background immersion; one fixed policy):', '');
|
|
1055
|
+
out.push(...keysOf(c.system_bars).map((k) => `- \`${k}\` — ${c.system_bars[k]}`));
|
|
1056
|
+
if (c.sdk) {
|
|
1057
|
+
out.push('', `SDK (compatibleSdkVersion ${c.sdk.compatible_sdk ?? '(not found)'}):`, '');
|
|
1058
|
+
out.push(`- \`component_dts_dir\` — ${c.sdk.component_dts_dir ? '`' + c.sdk.component_dts_dir + '`' : '(not resolved)'}`);
|
|
1059
|
+
out.push(`- ${c.sdk.rule}`);
|
|
1060
|
+
}
|
|
1061
|
+
if (c.theme) {
|
|
1062
|
+
const t = c.theme;
|
|
1063
|
+
out.push('', `Theme mechanism — **${t.mode}** (Android source; GATE \`theme-color-literal\` reads this mode):`, '');
|
|
1064
|
+
const hl = [...t.hits_dark, ...t.hits_runtime].map((h) => `- \`${h.at}\` ${h.keyword}: \`${h.line}\``);
|
|
1065
|
+
out.push(...(hl.length ? hl : ['- no dark scheme, night mode, values-night or runtime primary found']));
|
|
1066
|
+
out.push(`- ${t.mode === 'static' ? THEME_POLICY.static : THEME_POLICY.dynamic}`);
|
|
1067
|
+
if (t.hits_runtime.length) { out.push(`- ${THEME_POLICY.runtime}`); }
|
|
1068
|
+
}
|
|
1069
|
+
out.push('', "Fonts registered from rawfile (use `fontFamily('<family>')`):", '');
|
|
1070
|
+
const fl = c.fonts.map((f) => `- \`${f.family}\` ← \`${f.file}\``);
|
|
1071
|
+
out.push(...(fl.length ? fl : ['- (none)']));
|
|
1072
|
+
out.push('', '## Ownership', '');
|
|
1073
|
+
out.push(...c.owned_by_entry_group.map((p) => `- \`${p}\` — entry group only`));
|
|
1074
|
+
out.push('', ...c.rules.map((r) => `- ${r}`), '');
|
|
1075
|
+
return out.join('\n');
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
// ---------------------------------------------------------------- CLI (argparse compatible)
|
|
1079
|
+
// argparse description=__doc__ (RawDescriptionHelpFormatter, verbatim).
|
|
1080
|
+
const DOC = `App-shell contract: the conventions the entry group used to establish alone.
|
|
1081
|
+
|
|
1082
|
+
shell_contract.mjs <harmony_dir> --android <android_dir> [--static <utg.json>] [--deveco <dir>]
|
|
1083
|
+
|
|
1084
|
+
Writes .hometrans/shell_contract.json and .md. Every group prompt cites it
|
|
1085
|
+
as Project Fact (Shell Contract), and group_queue.mjs lets stage-1 groups start beside
|
|
1086
|
+
the entry group once it exists (Scheduling rule 1).
|
|
1087
|
+
|
|
1088
|
+
Why the entry group had to run alone: it fixed the window mode, the
|
|
1089
|
+
EntryAbility window layer, how pages learn the system-bar heights, font
|
|
1090
|
+
registration and the page registry. Groups started after it so they could
|
|
1091
|
+
read those from its files. Each of these is decidable before any group
|
|
1092
|
+
runs, and deciding it once in a script is also more reliable than a model's
|
|
1093
|
+
grep. Measured: the parent's "project fact (window mode)" said
|
|
1094
|
+
non-immersive because its grep searched \`enableEdgeToEdge\` only, while
|
|
1095
|
+
\`MainActivity.java:30\` calls \`EdgeToEdge.enable(this)\`. G001 and G002 each
|
|
1096
|
+
had to discover and override it.
|
|
1097
|
+
|
|
1098
|
+
What is decided here, from source only:
|
|
1099
|
+
* window mode per Activity: the conversion-procedure keyword list
|
|
1100
|
+
(\`enableEdgeToEdge\` / \`EdgeToEdge.enable\` / \`setDecorFitsSystemWindows\` /
|
|
1101
|
+
\`WindowCompat.setDecorFitsSystemWindows\` / \`windowTranslucentStatus\` /
|
|
1102
|
+
\`windowDrawsSystemBarBackgrounds\` / \`fitsSystemWindows\`), searched in the
|
|
1103
|
+
Activity, its base classes, the Application class and the themes the
|
|
1104
|
+
manifest applies. Every hit is \`file:line\`; zero hits are stated.
|
|
1105
|
+
* the shell interface: the fixed system-bar policy (default window layout,
|
|
1106
|
+
background-only immersion via ignoresLayoutSafeAreaEdges, no page reads a
|
|
1107
|
+
bar height) and the font families registered from rawfile/fonts.
|
|
1108
|
+
* ownership: only the entry group writes EntryAbility.ets,
|
|
1109
|
+
main_pages.json and module.json5. Shell and shared state start at the
|
|
1110
|
+
Android source's initial state. Other groups report anything else they
|
|
1111
|
+
need from the shell for Step 5.5.
|
|
1112
|
+
|
|
1113
|
+
Nothing about a page's layout is decided here. Phase 5's window-mode
|
|
1114
|
+
evidence is still written per page; it now cites this file for item 1.
|
|
1115
|
+
`;
|
|
1116
|
+
|
|
1117
|
+
function usage(prog) {
|
|
1118
|
+
return `usage: ${prog} [-h] --android ANDROID [--static STATIC] [--deveco DEVECO] harmony_dir`;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
function help(prog) {
|
|
1122
|
+
return `${usage(prog)}\n\n${DOC}\npositional arguments:\n harmony_dir\n\noptions:\n` +
|
|
1123
|
+
' -h, --help show this help message and exit\n --android ANDROID\n' +
|
|
1124
|
+
' --static STATIC static utg.json (default .hometrans/utg_static/utg.json)\n' +
|
|
1125
|
+
' --deveco DEVECO DevEco Studio install or SDK dir (default env DEVECO_SDK_HOME / DEVECO_HOME)\n';
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
class ArgError extends Error {}
|
|
1129
|
+
/** Bad input (a missing static UTG): main() reports it in one line with exit 2, like a usage error. */
|
|
1130
|
+
export class InputError extends Error {}
|
|
1131
|
+
|
|
1132
|
+
/** argparse subset: --opt X / --opt=X, unique long-option prefixes, `--`, required checks and unrecognized arguments, exit code 2. */
|
|
1133
|
+
export function parseArgs(argv) {
|
|
1134
|
+
const LONG = ['--help', '--android', '--static', '--deveco'];
|
|
1135
|
+
const resolve = (tok) => {
|
|
1136
|
+
const name = tok.split('=')[0];
|
|
1137
|
+
if (LONG.includes(name)) { return name; }
|
|
1138
|
+
if (!name.startsWith('--') || name.length < 3) { return null; }
|
|
1139
|
+
const hits = LONG.filter((o) => o.startsWith(name));
|
|
1140
|
+
if (hits.length > 1) {
|
|
1141
|
+
throw new ArgError(`ambiguous option: ${name} could match ${hits.join(', ')}`);
|
|
1142
|
+
}
|
|
1143
|
+
return hits[0] ?? null;
|
|
1144
|
+
};
|
|
1145
|
+
// argparse: a '-' prefix looks like an option; negative numbers and strings with a space
|
|
1146
|
+
// (unless they start with a known option) are positional.
|
|
1147
|
+
const isOptLike = (t) => t.startsWith('-') && t !== '-' && !/^-\d+$|^-\d*\.\d+$/.test(t) &&
|
|
1148
|
+
!(t.includes(' ') && !LONG.includes(t.split('=')[0]));
|
|
1149
|
+
const res = { harmony_dir: null, android: null, static: null, deveco: null, help: false };
|
|
1150
|
+
const pos = [];
|
|
1151
|
+
const extras = [];
|
|
1152
|
+
let i = 0;
|
|
1153
|
+
let dashdash = false;
|
|
1154
|
+
while (i < argv.length) {
|
|
1155
|
+
const t = argv[i];
|
|
1156
|
+
if (!dashdash && t === '--') { dashdash = true; i++; continue; }
|
|
1157
|
+
if (!dashdash && isOptLike(t)) {
|
|
1158
|
+
if (t === '-h') { res.help = true; return res; }
|
|
1159
|
+
const o = resolve(t);
|
|
1160
|
+
if (o === '--help') { res.help = true; return res; }
|
|
1161
|
+
if (o === null) { extras.push(t); i++; continue; }
|
|
1162
|
+
const dest = o.slice(2);
|
|
1163
|
+
if (t.includes('=')) {
|
|
1164
|
+
res[dest] = t.slice(t.indexOf('=') + 1);
|
|
1165
|
+
i++;
|
|
1166
|
+
continue;
|
|
1167
|
+
}
|
|
1168
|
+
const v = argv[i + 1];
|
|
1169
|
+
if (v === undefined || (isOptLike(v) && v !== '--')) { throw new ArgError(`argument ${o}: expected one argument`); }
|
|
1170
|
+
if (v === '--') { throw new ArgError(`argument ${o}: expected one argument`); }
|
|
1171
|
+
res[dest] = v;
|
|
1172
|
+
i += 2;
|
|
1173
|
+
continue;
|
|
1174
|
+
}
|
|
1175
|
+
pos.push(t);
|
|
1176
|
+
i++;
|
|
1177
|
+
}
|
|
1178
|
+
if (res.help) { return res; }
|
|
1179
|
+
if (pos.length) { res.harmony_dir = pos.shift(); }
|
|
1180
|
+
const missing = [];
|
|
1181
|
+
if (res.harmony_dir === null) { missing.push('harmony_dir'); }
|
|
1182
|
+
if (res.android === null) { missing.push('--android'); }
|
|
1183
|
+
if (missing.length) { throw new ArgError(`the following arguments are required: ${missing.join(', ')}`); }
|
|
1184
|
+
extras.push(...pos);
|
|
1185
|
+
if (extras.length) { throw new ArgError(`unrecognized arguments: ${extras.join(' ')}`); }
|
|
1186
|
+
return res;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
export function main(argv = process.argv.slice(2)) {
|
|
1190
|
+
const prog = path.basename(process.argv[1] || 'shell_contract.mjs');
|
|
1191
|
+
let a;
|
|
1192
|
+
try {
|
|
1193
|
+
a = parseArgs(argv);
|
|
1194
|
+
} catch (e) {
|
|
1195
|
+
if (!(e instanceof ArgError)) { throw e; }
|
|
1196
|
+
process.stderr.write(`${usage(prog)}${EOL}${prog}: error: ${e.message}${EOL}`);
|
|
1197
|
+
return 2;
|
|
1198
|
+
}
|
|
1199
|
+
if (a.help) { process.stdout.write(help(prog).replace(/\n/g, EOL)); return 0; }
|
|
1200
|
+
let c;
|
|
1201
|
+
try {
|
|
1202
|
+
c = build(a.harmony_dir, a.android, a.static, process.env, a.deveco);
|
|
1203
|
+
} catch (e) {
|
|
1204
|
+
if (e instanceof InputError) { process.stderr.write(`${prog}: error: ${e.message}${EOL}`); return 2; }
|
|
1205
|
+
process.stderr.write(`Traceback (most recent call last):${EOL}${e && e.stack ? e.stack : e}${EOL}`);
|
|
1206
|
+
return 1;
|
|
1207
|
+
}
|
|
1208
|
+
const summary = {};
|
|
1209
|
+
for (const aid of keysOf(c.activities)) {
|
|
1210
|
+
const x = c.activities[aid];
|
|
1211
|
+
pySet(summary, aid, { mode: x.mode, hits: x.hits.map((h) => h.at) });
|
|
1212
|
+
}
|
|
1213
|
+
pySet(summary, 'fonts', c.fonts.map((f) => f.family));
|
|
1214
|
+
process.stdout.write(pyJsonDumps(summary, 1).replace(/\n/g, EOL) + EOL);
|
|
1215
|
+
return 0;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) {
|
|
1219
|
+
process.exitCode = main();
|
|
1220
|
+
}
|