@buaa_smat/hometrans 26.0.5 → 26.0.6
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 +249 -279
- package/agents/code-reviewer.md +1 -1
- package/dist/cli/editors.json +20 -0
- package/dist/platform/registry.js +1 -0
- package/dist/platform/validate.js +2 -1
- package/i18n/agents/code-reviewer.md +1 -1
- package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
- package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
- package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/package.json +2 -1
- package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/skills/a2h-app-migrate/SKILL.md +31 -14
- package/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
- package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
- package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
- package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
- package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
- package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
- package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +1 -1
- package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
- package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
- package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
- package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
- package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
- package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
- package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
- package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
- package/skills/a2h-page-specgen/SKILL.md +36 -5
- package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
- package/skills/a2h-page-specgen/references/evidence.md +2 -1
- package/skills/a2h-page-specgen/references/execution-model.md +13 -5
- package/skills/a2h-page-specgen/references/gates.md +33 -7
- package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
- package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
- package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
- package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
- package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
- package/skills/a2h-resource-convert/SKILL.md +1 -1
- package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
- package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
- package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
- package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
- package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
- package/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
- package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
- package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
- package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
- package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
- package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
- package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
- package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
- package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
- package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
- package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
- package/skills/a2h-utg-static/SKILL.md +3 -3
- package/skills/a2h-utg-static/references/extractors.md +7 -0
- package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
- package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
- package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
- package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
- package/resource/convert_pipeline_process.svg +0 -114
- package/resource/project_architecture.svg +0 -120
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
|
@@ -893,15 +893,43 @@ function registration(im: Png, cs: CoordSpace, nodes: Node[], skip: (n: Node) =>
|
|
|
893
893
|
}
|
|
894
894
|
|
|
895
895
|
/**
|
|
896
|
-
* Every visible
|
|
896
|
+
* Every visible image node the reference shows — ImageView/ImageButton, or an image-sized leaf of another class
|
|
897
|
+
* (Compose draws Image/Icon/AsyncImage as a bare android.view.View) — in view.xml and in each scroll frame,
|
|
898
|
+
* sampled at its **registered** position. phase5_check's
|
|
897
899
|
* [icons] stage requires each key to be covered by an `// ICON: <key>` marker on an image-rendering line; an
|
|
898
900
|
* `// ICON-OMIT:` is refused when the sample here says the icon is drawn on a solid background.
|
|
899
901
|
*/
|
|
900
902
|
interface IconRow {
|
|
901
|
-
key: string; node: number; rid: string; declaredPx: string; sampledPx: string; dy: number;
|
|
903
|
+
key: string; node: number; rid: string; desc: string; declaredPx: string; sampledPx: string; dy: number;
|
|
902
904
|
ink: string; bg: string; inkShare: number; bgUniform: boolean; visible: boolean;
|
|
903
905
|
/** subtree = dy of an anchor sharing a sub-window ancestor; fallback = drifted dy tried after a blank read; none = declared position. */
|
|
904
906
|
dySource: 'subtree' | 'fallback' | 'none';
|
|
907
|
+
/** image = ImageView/ImageButton; leaf = an image-sized leaf of another class (Compose draws images as android.view.View). */
|
|
908
|
+
kind: 'image' | 'leaf';
|
|
909
|
+
/** Capture the row was sampled from: 0 = view.xml/screenshot.png, N = view_scroll_N.xml/screenshot_scroll_N.png. */
|
|
910
|
+
frame: number;
|
|
911
|
+
/** Other frames that showed the same icon (same key); set on the first row of the key only. */
|
|
912
|
+
frames?: number[];
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* Classes that never stand for a drawn image on their own: layout containers, text, input and stateful widgets
|
|
917
|
+
* (mapped by their own rules), and media surfaces. Everything else that is a leaf can be an image renderer — Compose
|
|
918
|
+
* `Image` / `Icon` / `AsyncImage` surface in uiautomator as a bare `android.view.View` with no children and no text.
|
|
919
|
+
*/
|
|
920
|
+
const NOT_ICON_LEAF = /(Layout|ScrollView|RecyclerView|ListView|GridView|ViewPager2?|ViewGroup|ViewStub|WebView|TextView|EditText|CheckBox|RadioButton|Switch|ToggleButton|SeekBar|ProgressBar|Spinner|RatingBar|SurfaceView|TextureView|VideoView|ComposeView|Toolbar|CardView)$/;
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Icon candidate test. ImageView/ImageButton keep the old rule (≥ minPx on the short side). Any other class must look
|
|
924
|
+
* like an image on its own: a leaf with empty text, ≥ minPx on both axes, at most maxPx on both (a full-size background
|
|
925
|
+
* or decoration View is not an icon), not wider than half the window, aspect ≤ 2.5 (dividers, bars and pills are out).
|
|
926
|
+
*/
|
|
927
|
+
function iconCandidate(n: Node, minPx: number, maxPx: number, hasKids: (n: Node) => boolean, rootW: number): IconRow['kind'] | null {
|
|
928
|
+
if (/Image(View|Button)$/.test(n.cls)) { return Math.min(n.w, n.h) >= minPx ? 'image' : null; }
|
|
929
|
+
if (hasKids(n) || n.text.trim() || NOT_ICON_LEAF.test(n.cls)) { return null; }
|
|
930
|
+
if (n.w < minPx || n.h < minPx || n.w > maxPx || n.h > maxPx || n.w > rootW / 2) { return null; }
|
|
931
|
+
if (Math.max(n.w, n.h) / Math.min(n.w, n.h) > 2.5) { return null; }
|
|
932
|
+
return 'leaf';
|
|
905
933
|
}
|
|
906
934
|
|
|
907
935
|
function iconKey(n: Node): string {
|
|
@@ -914,10 +942,14 @@ function iconKey(n: Node): string {
|
|
|
914
942
|
}
|
|
915
943
|
|
|
916
944
|
function iconInventory(im: Png, cs: CoordSpace, nodes: Node[], tree: Node[], reg: Registration,
|
|
917
|
-
minPx: number, skip: (n: Node) => boolean, root: Node): IconRow[] {
|
|
945
|
+
minPx: number, maxPx: number, skip: (n: Node) => boolean, root: Node, frame = 0): IconRow[] {
|
|
918
946
|
const rows: IconRow[] = [];
|
|
947
|
+
const parents = new Set<number>(tree.map((t) => t.parent).filter((p): p is number => p !== null));
|
|
948
|
+
const at = new Map<Node, number>(tree.map((t, i) => [t, i]));
|
|
949
|
+
const hasKids = (n: Node): boolean => parents.has(at.get(n) ?? -1);
|
|
919
950
|
for (const n of nodes) {
|
|
920
|
-
|
|
951
|
+
const kind = skip(n) ? null : iconCandidate(n, minPx, maxPx, hasKids, root.w);
|
|
952
|
+
if (!kind) { continue; }
|
|
921
953
|
const r = toImgRect(im, cs, n);
|
|
922
954
|
if (!r) { continue; }
|
|
923
955
|
const sample = (dy: number): { c: ReturnType<typeof contrastColors>; y1: number; y2: number; visible: boolean } | null => {
|
|
@@ -942,14 +974,98 @@ function iconInventory(im: Png, cs: CoordSpace, nodes: Node[], tree: Node[], reg
|
|
|
942
974
|
}
|
|
943
975
|
if (!s) { continue; }
|
|
944
976
|
const c = s.c, y1 = s.y1, y2 = s.y2;
|
|
945
|
-
rows.push({ key: iconKey(n), node: n.idx, rid: n.rid, declaredPx: `[${r.x1},${r.y1}][${r.x2},${r.y2}]`,
|
|
977
|
+
rows.push({ key: iconKey(n), node: n.idx, rid: n.rid, desc: n.desc, declaredPx: `[${r.x1},${r.y1}][${r.x2},${r.y2}]`,
|
|
946
978
|
sampledPx: `[${r.x1},${y1}][${r.x2},${y2}]`, dy, ink: c.ink, bg: c.bg,
|
|
947
979
|
inkShare: Math.round(c.inkShare * 1e4) / 1e4, bgUniform: c.bgUniform,
|
|
948
|
-
visible: s.visible, dySource });
|
|
980
|
+
visible: s.visible, dySource, kind, frame });
|
|
949
981
|
}
|
|
950
982
|
return rows;
|
|
951
983
|
}
|
|
952
984
|
|
|
985
|
+
/** A scroll frame's icons plus how far its content scrolled from the primary capture (image px, null = unknown). */
|
|
986
|
+
interface FrameIcons { rows: IconRow[]; offsetPx: number | null; }
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* Scroll distance between two captures of one page: texts that occur once in each frame and moved by the same dy.
|
|
990
|
+
* Fixed chrome (toolbar title) does not move, so only non-zero dy values vote. Null when nothing moved or no text is shared.
|
|
991
|
+
*/
|
|
992
|
+
function scrollDy(prev: Node[], cur: Node[]): number | null {
|
|
993
|
+
const once = (ns: Node[]): Map<string, Node> => {
|
|
994
|
+
const m = new Map<string, Node>(), dup = new Set<string>();
|
|
995
|
+
for (const n of ns) {
|
|
996
|
+
const t = n.text.trim();
|
|
997
|
+
if (!t) { continue; }
|
|
998
|
+
if (m.has(t)) { dup.add(t); } else { m.set(t, n); }
|
|
999
|
+
}
|
|
1000
|
+
for (const t of dup) { m.delete(t); }
|
|
1001
|
+
return m;
|
|
1002
|
+
};
|
|
1003
|
+
const a = once(prev), b = once(cur);
|
|
1004
|
+
const votes = new Map<number, number>();
|
|
1005
|
+
for (const [t, n] of b) {
|
|
1006
|
+
const p = a.get(t);
|
|
1007
|
+
if (!p || p.x1 !== n.x1) { continue; }
|
|
1008
|
+
const dy = p.y1 - n.y1;
|
|
1009
|
+
if (dy !== 0) { votes.set(dy, (votes.get(dy) ?? 0) + 1); }
|
|
1010
|
+
}
|
|
1011
|
+
let best: number | null = null, hits = 0;
|
|
1012
|
+
for (const [dy, c] of votes) { if (c > hits) { best = dy; hits = c; } }
|
|
1013
|
+
return best;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
const pxBox = (s: string): number[] => (s.match(/-?\d+/g) || []).map(Number);
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* Merge the scroll frames' rows into the primary inventory. Primary rows stay as they are (list rows sharing a key
|
|
1020
|
+
* merge downstream in icon_coverage). The same icon across captures is found by resource-id, else content-desc, else
|
|
1021
|
+
* the same box — at the same screen place (fixed chrome repeats in every frame) or at the same place in the scrolled
|
|
1022
|
+
* content (box shifted by the frame's scroll offset, ±6px). A scroll frame adds at most one row per key: for an icon not
|
|
1023
|
+
* seen before, or when every earlier row of that key read blank and this frame draws it; an icon seen again only records
|
|
1024
|
+
* the frame in `frames`. A scroll frame's node index is not the primary's, so a new index key becomes `s<N>_node<idx>`.
|
|
1025
|
+
*/
|
|
1026
|
+
function mergeFrameIcons(primary: IconRow[], frames: FrameIcons[]): IconRow[] {
|
|
1027
|
+
const out: IconRow[] = [...primary];
|
|
1028
|
+
const named = new Map<string, string>();
|
|
1029
|
+
const boxes: { b: number[]; contentY: number | null; key: string }[] = [];
|
|
1030
|
+
const remember = (r: IconRow, offset: number | null): void => {
|
|
1031
|
+
const name = r.rid ? 'r:' + r.rid : r.desc.trim() ? 'd:' + r.desc.trim() : '';
|
|
1032
|
+
if (name) { if (!named.has(name)) { named.set(name, r.key); } return; }
|
|
1033
|
+
const b = pxBox(r.declaredPx);
|
|
1034
|
+
boxes.push({ b, contentY: offset === null ? null : b[1] + offset, key: r.key });
|
|
1035
|
+
};
|
|
1036
|
+
const lookup = (r: IconRow, offset: number | null): string | undefined => {
|
|
1037
|
+
const name = r.rid ? 'r:' + r.rid : r.desc.trim() ? 'd:' + r.desc.trim() : '';
|
|
1038
|
+
if (name) { return named.get(name); }
|
|
1039
|
+
const b = pxBox(r.declaredPx);
|
|
1040
|
+
const sameSize = (o: number[]): boolean => o[0] === b[0] && o[2] === b[2] && o[3] - o[1] === b[3] - b[1];
|
|
1041
|
+
const fixed = boxes.find((x) => sameSize(x.b) && x.b[1] === b[1]);
|
|
1042
|
+
if (fixed) { return fixed.key; }
|
|
1043
|
+
if (offset === null) { return undefined; }
|
|
1044
|
+
return boxes.find((x) => sameSize(x.b) && x.contentY !== null && Math.abs(x.contentY - (b[1] + offset)) <= 6)?.key;
|
|
1045
|
+
};
|
|
1046
|
+
for (const r of primary) { remember(r, 0); }
|
|
1047
|
+
for (const { rows, offsetPx } of frames) {
|
|
1048
|
+
const best = new Map<string, IconRow>();
|
|
1049
|
+
for (const r0 of rows) {
|
|
1050
|
+
let key = lookup(r0, offsetPx);
|
|
1051
|
+
if (!key) {
|
|
1052
|
+
key = /^node\d+$/.test(r0.key) ? `s${r0.frame}_${r0.key}` : r0.key;
|
|
1053
|
+
remember({ ...r0, key }, offsetPx);
|
|
1054
|
+
}
|
|
1055
|
+
const r = { ...r0, key };
|
|
1056
|
+
const cur = best.get(key);
|
|
1057
|
+
if (!cur || (r.visible && (!cur.visible || (r.bgUniform && !cur.bgUniform)))) { best.set(key, r); }
|
|
1058
|
+
}
|
|
1059
|
+
for (const [key, r] of best) {
|
|
1060
|
+
const seen = out.filter((x) => x.key === key);
|
|
1061
|
+
if (!seen.length || (r.visible && !seen.some((x) => x.visible))) { out.push(r); continue; }
|
|
1062
|
+
const first = seen[0];
|
|
1063
|
+
first.frames = [...new Set([...(first.frames ?? []), r.frame])];
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
return out;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
953
1069
|
function hexRgbArr(h: string): number[] {
|
|
954
1070
|
return [1, 3, 5].map((i) => parseInt(h.slice(i, i + 2), 16));
|
|
955
1071
|
}
|
|
@@ -1200,6 +1316,7 @@ function main(): void {
|
|
|
1200
1316
|
let metaDensity: number | null = null;
|
|
1201
1317
|
let metaScreen: ScreenSize | null = null;
|
|
1202
1318
|
let metaStatusBarPx: number | null = null;
|
|
1319
|
+
const scrollFrames: { frame: number; shot: string; xml: string }[] = [];
|
|
1203
1320
|
const cliDensity: number = parseFloat(arg('--density') || '0');
|
|
1204
1321
|
if (fs.existsSync(metaP)) {
|
|
1205
1322
|
try {
|
|
@@ -1208,6 +1325,15 @@ function main(): void {
|
|
|
1208
1325
|
const root: string = path.dirname(dir);
|
|
1209
1326
|
if (typeof meta.screenshot === 'string') { shot = path.resolve(root, meta.screenshot); }
|
|
1210
1327
|
if (typeof meta.view_xml === 'string') { vx = path.resolve(root, meta.view_xml); }
|
|
1328
|
+
// Scroll captures (screenshots[i] pairs with view_xmls[i]); index 0 is the primary pair above.
|
|
1329
|
+
if (Array.isArray(meta.screenshots) && Array.isArray(meta.view_xmls)) {
|
|
1330
|
+
const ss = meta.screenshots as unknown[], xs = meta.view_xmls as unknown[];
|
|
1331
|
+
for (let i = 1; i < Math.min(ss.length, xs.length); i++) {
|
|
1332
|
+
if (typeof ss[i] === 'string' && typeof xs[i] === 'string') {
|
|
1333
|
+
scrollFrames.push({ frame: i, shot: path.resolve(root, ss[i] as string), xml: path.resolve(root, xs[i] as string) });
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1211
1337
|
const dev = meta.device_info as Record<string, unknown> | undefined;
|
|
1212
1338
|
if (dev && typeof dev.density === 'number' && dev.density > 0) {
|
|
1213
1339
|
metaDensity = dev.density;
|
|
@@ -1392,9 +1518,40 @@ function main(): void {
|
|
|
1392
1518
|
// Screenshot ↔ view-tree registration, then every visible icon sampled at its registered position
|
|
1393
1519
|
const skipOcc = (n: Node): boolean => coverOf.has(n);
|
|
1394
1520
|
const reg: Registration | null = im && cs ? registration(im, cs, nodes, skipOcc) : null;
|
|
1395
|
-
|
|
1396
|
-
|
|
1521
|
+
// Icon size window: ≥16dp (all classes), ≤96dp for non-ImageView leaves (larger is a picture/background, not an icon)
|
|
1522
|
+
const iconMin: number = d ? Math.round(16 * d) : 32;
|
|
1523
|
+
const iconMax: number = d ? Math.round(96 * d) : 192;
|
|
1524
|
+
const primaryIcons: IconRow[] = im && cs && reg
|
|
1525
|
+
? iconInventory(im, cs, nodes, tree, reg, iconMin, iconMax, skipOcc, root) : [];
|
|
1397
1526
|
if (reg && reg.ok === false) { console.error('!! ' + reg.note); }
|
|
1527
|
+
// Content below the first viewport is only in the scroll frames: an icon there must be in the inventory too.
|
|
1528
|
+
const frameRows: FrameIcons[] = [];
|
|
1529
|
+
// Scroll offset of each frame from the primary, chained through the frames already read (frame 4 may share no text with view.xml)
|
|
1530
|
+
const seenTrees: { nodes: Node[]; offset: number | null }[] = [{ nodes, offset: 0 }];
|
|
1531
|
+
for (const f of im ? scrollFrames : []) {
|
|
1532
|
+
if (!fs.existsSync(f.shot) || !fs.existsSync(f.xml)) { continue; }
|
|
1533
|
+
try {
|
|
1534
|
+
const fim: Png = decodePng(f.shot);
|
|
1535
|
+
const ftree: Node[] = parseNodes(fs.readFileSync(f.xml, 'utf8'));
|
|
1536
|
+
const fnodes: Node[] = ftree.filter((n) => n.x1 >= 0 && n.y1 >= 0 && n.x2 >= 0 && n.y2 >= 0);
|
|
1537
|
+
if (!fnodes.length) { continue; }
|
|
1538
|
+
const fcs: CoordSpace = coordSpace(fim, fnodes[0], metaScreen);
|
|
1539
|
+
const fcover: Map<Node, Node> = occluders(ftree);
|
|
1540
|
+
const fskip = (n: Node): boolean => fcover.has(n);
|
|
1541
|
+
const freg: Registration = registration(fim, fcs, fnodes, fskip);
|
|
1542
|
+
let offset: number | null = null;
|
|
1543
|
+
for (let k = seenTrees.length - 1; k >= 0 && offset === null; k--) {
|
|
1544
|
+
const dy = seenTrees[k].offset === null ? null : scrollDy(seenTrees[k].nodes, fnodes);
|
|
1545
|
+
if (dy !== null) { offset = (seenTrees[k].offset as number) + dy; }
|
|
1546
|
+
}
|
|
1547
|
+
seenTrees.push({ nodes: fnodes, offset });
|
|
1548
|
+
frameRows.push({ rows: iconInventory(fim, fcs, fnodes, ftree, freg, iconMin, iconMax, fskip, fnodes[0], f.frame),
|
|
1549
|
+
offsetPx: offset === null ? null : Math.round(offset * fcs.sy) });
|
|
1550
|
+
} catch (e) {
|
|
1551
|
+
console.error(`!! scroll frame ${f.frame} skipped for icon_inventory — ${String(e)}`);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
const icons: IconRow[] = mergeFrameIcons(primaryIcons, frameRows);
|
|
1398
1555
|
|
|
1399
1556
|
// Four-edge color sampling: for judging background/scrim compositing and edge tinting under immersion (values only, no judgment).
|
|
1400
1557
|
// With a nav bar, bottom/center are sampled within the app content area, and the nav bar itself is listed separately as nav_bar.
|
|
@@ -1564,10 +1721,13 @@ function main(): void {
|
|
|
1564
1721
|
`(${reg.anchors.length} anchors) — ${reg.note}`);
|
|
1565
1722
|
}
|
|
1566
1723
|
if (icons.length) {
|
|
1567
|
-
console.log(` ${col('icons')}: ${icons.length}
|
|
1724
|
+
console.log(` ${col('icons')}: ${icons.length} image node(s) (ImageView/ImageButton, or an image-sized leaf such as a Compose View); ` +
|
|
1725
|
+
'each needs an "// ICON: <key>" marker in code (phase5 [icons])');
|
|
1568
1726
|
for (const ic of icons) {
|
|
1727
|
+
const label: string = ic.kind === 'leaf' && ic.desc.trim() ? ` "${ic.desc.trim().slice(0, 16)}"` : '';
|
|
1569
1728
|
console.log(` ${ic.key.padEnd(24)} ${ic.visible ? 'VISIBLE' : 'blank '} ink ${ic.ink} ${(ic.inkShare * 100).toFixed(1)}% on ${ic.bg}` +
|
|
1570
|
-
` at ${ic.sampledPx}${ic.
|
|
1729
|
+
` at ${ic.sampledPx}${ic.frame ? ' in scroll frame ' + ic.frame : ''}${label}` +
|
|
1730
|
+
`${ic.dy ? ' (shifted dy ' + ic.dy + (ic.dySource === 'fallback' ? ', fallback' : '') + ')' : ''}`);
|
|
1571
1731
|
}
|
|
1572
1732
|
}
|
|
1573
1733
|
console.log(` ${col('regions')}: ${regions.length} / all nodes ${nodes.length}`);
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// module_placement.mjs — the architecture, not the conversion agent, decides which module a group's code goes to.
|
|
3
|
+
//
|
|
4
|
+
// node module_placement.mjs prepare --hp <harmony_project_dir> [--design <project_design.md>] [--ui-module <m>]
|
|
5
|
+
// Read the design's module table and conversion_set.json's plan. Write
|
|
6
|
+
// .hometrans/work/module_placement.worklist.md (every design module with its semantics, every group with
|
|
7
|
+
// its members) and, when absent, a skeleton .hometrans/module_placement.json for the parent to fill:
|
|
8
|
+
// { "schema": "module-placement/1", "design": "<path>", "ui_module": "products/phone",
|
|
9
|
+
// "groups": { "<anchor node>": { "module": "features/x", "reason": "<design row it follows>",
|
|
10
|
+
// "members": { "<member node>": "features/y" } } },
|
|
11
|
+
// "unassigned": { "<design module>": "<why no UI lands there>" } }
|
|
12
|
+
// `members` only for a member the design puts in another module than its group (a search sheet the
|
|
13
|
+
// main page hosts). Prints the worklist path.
|
|
14
|
+
//
|
|
15
|
+
// node module_placement.mjs check --hp <harmony_project_dir> [--design <file>]
|
|
16
|
+
// Exit 1 when: a plan group has no module; a module is not a module of the design / of the project;
|
|
17
|
+
// a design module whose semantics describe UI (界面 / 页面 / 面板 / 对话框 / 展示 …) receives no group or
|
|
18
|
+
// member and is not listed in `unassigned` with a reason. Prints one line per problem.
|
|
19
|
+
//
|
|
20
|
+
// Why: the conversion prompt said only "MainFragment 内容可放 features/weatherdisplay", the agent judged the
|
|
21
|
+
// resources easier in products/phone, and features/weatherdisplay and features/placesearch shipped empty
|
|
22
|
+
// (WeatherApp 11-22). build_conversion_set.mjs reads module_placement.json on every run (group_queue's
|
|
23
|
+
// refreshes included) and writes each group's `module` and module-prefixed `predicted_writes`.
|
|
24
|
+
import * as fs from 'node:fs';
|
|
25
|
+
import * as path from 'node:path';
|
|
26
|
+
import { fileURLToPath } from 'node:url';
|
|
27
|
+
|
|
28
|
+
export const SCHEMA = 'module-placement/1';
|
|
29
|
+
/** Design semantics that mean a module hosts UI (pages, panels, dialogs), not only data or capability. */
|
|
30
|
+
const UI_WORDS = /界面|页面|面板|对话框|弹窗|展示|交互|半模态|列表|组件|screen|page|dialog|panel|\bUI\b/i;
|
|
31
|
+
|
|
32
|
+
const readText = (p) => { try { return fs.readFileSync(p, 'utf8').replace(/^/, ''); } catch { return null; } };
|
|
33
|
+
const readJson = (p) => { const t = readText(p); if (t === null) return null; try { return JSON.parse(t); } catch { return undefined; } };
|
|
34
|
+
// backticks first: `` `features/x/` `` and `` `./features/x` `` are the same module as features/x
|
|
35
|
+
const norm = (s) => String(s).trim().replace(/^`+|`+$/g, '').trim().replace(/\\/g, '/').replace(/^\.\//, '').replace(/\/+$/, '');
|
|
36
|
+
const isFile = (p) => { try { return fs.statSync(p).isFile(); } catch { return false; } };
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The design doc: the architecture stage's own output first, then its baseline copy
|
|
40
|
+
* (a2h-module-semantic-docs design_baseline.mjs; cleanup_intermediates.mjs deletes arch_generate/).
|
|
41
|
+
* enrich.module_docs later rewrites .hometrans/project_design.md from the code as it stands, which would
|
|
42
|
+
* turn a drift into the design: it is read only when neither exists.
|
|
43
|
+
*/
|
|
44
|
+
export function designPath(hp, given = null) {
|
|
45
|
+
if (given) return path.resolve(given);
|
|
46
|
+
const meta = path.join(hp, '.hometrans');
|
|
47
|
+
for (const p of [path.join(meta, 'arch_generate', 'formal_docs', 'PROJECT_DESIGN.md'),
|
|
48
|
+
path.join(meta, 'arch_baseline', 'project_design.md'),
|
|
49
|
+
path.join(meta, 'project_design.md'), path.join(hp, 'PROJECT_DESIGN.md'), path.join(hp, 'project_design.md')]) {
|
|
50
|
+
if (isFile(p)) return p;
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The module root a 模块语义 row belongs to, with the capability it names (null for a module-root row).
|
|
57
|
+
* a2h-arch-generate's contract (artifact-contracts.generate.md rule 4) gives every capability package
|
|
58
|
+
* `<module>/src/main/ets/<capability>` a row and the module root none; older designs list module roots.
|
|
59
|
+
* Any other `/src` path (resources, tests) is no module row: null.
|
|
60
|
+
*/
|
|
61
|
+
export function moduleRootOf(p) {
|
|
62
|
+
const m = /^(.+?)\/src\/main\/ets(?:\/(.+))?$/.exec(p);
|
|
63
|
+
if (m) return { root: m[1], capability: m[2] ?? null };
|
|
64
|
+
return /(^|\/)src(\/|$)/.test(p) ? null : { root: p, capability: null };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Modules of the design's 模块语义 table: `| <path> | <semantics> |`, capability rows folded into their
|
|
69
|
+
* module root (semantics joined as `<capability>: <text>`). With a project tree a root counts only when
|
|
70
|
+
* `<root>/src/main/module.json5` exists.
|
|
71
|
+
*/
|
|
72
|
+
export function designModules(text, hp = null) {
|
|
73
|
+
const out = new Map();
|
|
74
|
+
const tree = hp && fs.existsSync(path.join(hp, 'build-profile.json5'));
|
|
75
|
+
for (const line of String(text ?? '').split(/\r?\n/)) {
|
|
76
|
+
const m = /^\s*\|\s*([^|]+?)\s*\|\s*([^|]+?)\s*\|\s*$/.exec(line);
|
|
77
|
+
if (!m) continue;
|
|
78
|
+
const p = norm(m[1]);
|
|
79
|
+
if (!/^[\w.-]+(\/[\w.-]+)*$/.test(p) || /^-+$/.test(p)) continue;
|
|
80
|
+
const r = moduleRootOf(p);
|
|
81
|
+
if (!r || (tree && !isFile(path.join(hp, r.root, 'src', 'main', 'module.json5')))) continue;
|
|
82
|
+
const sem = r.capability ? `${r.capability}: ${m[2].trim()}` : m[2].trim();
|
|
83
|
+
const had = out.get(r.root);
|
|
84
|
+
if (had === undefined) out.set(r.root, sem);
|
|
85
|
+
else if (!had.split('; ').includes(sem)) out.set(r.root, `${had}; ${sem}`);
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const uiInfoOf = (hp) => {
|
|
91
|
+
const prog = readJson(path.join(hp, '.hometrans', 'batch_progress.json'));
|
|
92
|
+
return (prog && prog.ui_info_root) || path.join(hp, '.hometrans', 'ui_info');
|
|
93
|
+
};
|
|
94
|
+
const planOf = (hp) => (readJson(path.join(uiInfoOf(hp), 'conversion_set.json')) ?? {}).plan ?? {};
|
|
95
|
+
export const placementPath = (hp) => path.join(hp, '.hometrans', 'module_placement.json');
|
|
96
|
+
|
|
97
|
+
/** Problems of a placement against the plan and the design (empty = valid). */
|
|
98
|
+
export function problems(doc, plan, modules, hp = null) {
|
|
99
|
+
const out = [];
|
|
100
|
+
if (!doc || typeof doc !== 'object') return ['module_placement.json is missing or not JSON: run `prepare` and fill it'];
|
|
101
|
+
const gs = doc.groups && typeof doc.groups === 'object' ? doc.groups : {};
|
|
102
|
+
const known = (m) => modules.has(m) || (hp && isFile(path.join(hp, m, 'src', 'main', 'module.json5')));
|
|
103
|
+
const used = new Set();
|
|
104
|
+
for (const gr of plan.groups ?? []) {
|
|
105
|
+
const row = gs[gr.anchor];
|
|
106
|
+
const m = row && typeof row.module === 'string' ? norm(row.module) : '';
|
|
107
|
+
if (!m) { out.push(`${gr.id} (${gr.anchor}): no module`); continue; }
|
|
108
|
+
if (!known(m)) out.push(`${gr.id} (${gr.anchor}): module ${m} is not a module of the design`);
|
|
109
|
+
used.add(m);
|
|
110
|
+
const mine = new Set((gr.members ?? []).map((x) => x.node));
|
|
111
|
+
for (const [n, v] of Object.entries(row.members ?? {})) {
|
|
112
|
+
const mm = norm(typeof v === 'string' ? v : (v ?? {}).module ?? '');
|
|
113
|
+
if (!mine.has(n)) out.push(`${gr.id}: member ${n} is not in this group (plan members: ${[...mine].join(', ')})`);
|
|
114
|
+
else if (!mm || !known(mm)) out.push(`${gr.id}: member ${n} has module '${mm}', not a module of the design`);
|
|
115
|
+
else used.add(mm);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const excused = doc.unassigned && typeof doc.unassigned === 'object' ? doc.unassigned : {};
|
|
119
|
+
for (const [m, sem] of modules) {
|
|
120
|
+
if (used.has(m) || !UI_WORDS.test(sem)) continue;
|
|
121
|
+
if (typeof excused[m] === 'string' && excused[m].trim()) continue;
|
|
122
|
+
out.push(`design module ${m} describes UI ("${sem.slice(0, 40)}…") but no group or member is placed there: `
|
|
123
|
+
+ 'place the group/member it describes, or give a reason under "unassigned"');
|
|
124
|
+
}
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function worklist(hp, design, modules, plan, uiModule) {
|
|
129
|
+
const lines = [`# Module placement worklist`, '', `design: ${design}`, `ui_module: ${uiModule ?? '(unknown)'}`, '',
|
|
130
|
+
'## Design modules', '', '| module | semantics |', '|---|---|',
|
|
131
|
+
...[...modules].map(([m, s]) => `| ${m} | ${s.replace(/\|/g, '\\|')} |`), '', '## Groups', ''];
|
|
132
|
+
for (const gr of plan.groups ?? []) {
|
|
133
|
+
lines.push(`- ${gr.id} anchor \`${gr.anchor}\`${gr.verify_only ? ' (verify_only)' : ''}: `
|
|
134
|
+
+ (gr.members ?? []).map((x) => `\`${x.node}\` (${x.relation})`).join(', '));
|
|
135
|
+
}
|
|
136
|
+
lines.push('', 'Rules: the entry Ability, route registration and the shell stay in the UI module; a page or component '
|
|
137
|
+
+ 'goes to the module whose semantics describe it; a member described by another module goes under `members`.');
|
|
138
|
+
return lines.join('\n') + '\n';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function argOf(argv, k) { const i = argv.indexOf(k); return i >= 0 && i + 1 < argv.length ? argv[i + 1] : null; }
|
|
142
|
+
|
|
143
|
+
export function main(argv) {
|
|
144
|
+
const cmd = argv[0];
|
|
145
|
+
const hp = argOf(argv, '--hp');
|
|
146
|
+
if (!['prepare', 'check'].includes(cmd) || !hp) {
|
|
147
|
+
process.stderr.write('usage: module_placement.mjs prepare|check --hp <harmony_project_dir> [--design <file>] [--ui-module <m>]\n');
|
|
148
|
+
return 2;
|
|
149
|
+
}
|
|
150
|
+
const design = designPath(hp, argOf(argv, '--design'));
|
|
151
|
+
if (!design) {
|
|
152
|
+
process.stdout.write('no design doc (project_design.md): placement not applicable, groups go to the UI module\n');
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
const modules = designModules(readText(design), hp);
|
|
156
|
+
const plan = planOf(hp);
|
|
157
|
+
if (!(plan.groups ?? []).length) { process.stderr.write('conversion_set.json has no plan.groups: run Step 3 first\n'); return 2; }
|
|
158
|
+
const pp = placementPath(hp);
|
|
159
|
+
if (cmd === 'prepare') {
|
|
160
|
+
const prog = readJson(path.join(hp, '.hometrans', 'batch_progress.json')) ?? {};
|
|
161
|
+
const uiModule = argOf(argv, '--ui-module') ?? prog.ui_module ?? null;
|
|
162
|
+
const wl = path.join(hp, '.hometrans', 'work', 'module_placement.worklist.md');
|
|
163
|
+
fs.mkdirSync(path.dirname(wl), { recursive: true });
|
|
164
|
+
fs.writeFileSync(wl, worklist(hp, design, modules, plan, uiModule), 'utf8');
|
|
165
|
+
const old = readJson(pp);
|
|
166
|
+
if (old === undefined || (old !== null && (typeof old !== 'object' || Array.isArray(old)))) {
|
|
167
|
+
// a hand-filled file with a syntax error: rewriting it as a skeleton would lose every filled row
|
|
168
|
+
process.stderr.write(`${pp} exists but is not a JSON object: fix it (nothing was written)\n`);
|
|
169
|
+
return 2;
|
|
170
|
+
}
|
|
171
|
+
const doc = old ?? { schema: SCHEMA, groups: {}, unassigned: {} };
|
|
172
|
+
doc.design = design;
|
|
173
|
+
if (uiModule) doc.ui_module = norm(uiModule);
|
|
174
|
+
doc.groups ??= {};
|
|
175
|
+
for (const gr of plan.groups) doc.groups[gr.anchor] ??= { module: null, reason: '' };
|
|
176
|
+
fs.writeFileSync(pp, JSON.stringify(doc, null, 2) + '\n', 'utf8');
|
|
177
|
+
process.stdout.write(`${modules.size} design modules, ${plan.groups.length} groups\nworklist: ${wl}\nfill: ${pp}\n`);
|
|
178
|
+
return 0;
|
|
179
|
+
}
|
|
180
|
+
const ps = problems(readJson(pp), plan, modules, hp);
|
|
181
|
+
for (const p of ps) process.stdout.write(`[PLACEMENT] ${p}\n`);
|
|
182
|
+
process.stdout.write(`${(plan.groups ?? []).length} groups, ${modules.size} design modules, ${ps.length} problems\n`);
|
|
183
|
+
return ps.length ? 1 : 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const self = fileURLToPath(import.meta.url);
|
|
187
|
+
let invoked = '';
|
|
188
|
+
try { invoked = process.argv[1] ? fs.realpathSync(process.argv[1]) : ''; } catch { invoked = ''; }
|
|
189
|
+
if (invoked !== '' && path.resolve(invoked) === path.resolve(self)) { process.exitCode = main(process.argv.slice(2)); }
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// overlay_effects.mjs — what opening / dismissing an overlay also does to its host page, end to end.
|
|
2
|
+
//
|
|
3
|
+
// a2h-utg-static writes on each open-overlay edge `args.host_effects`:
|
|
4
|
+
// {open: [{id: "fx:<path>:<line>:<column>", stmt, at, resolved: [{stmt, at}]}], dismiss: [...]}
|
|
5
|
+
// (ydweather ds-1126: WeatherDailyPanel.kt:189 `showHideWeatherContent?.invoke(false)` fades the weather cards
|
|
6
|
+
// out while the daily detail is open; the conversion set only the overlay's own flag and the cards stayed).
|
|
7
|
+
// build_conversion_set.mjs carries them into meta.json (reached_from / navigates_to, captured pages:
|
|
8
|
+
// overlay_effects) and conversion_set.json `overlay_effects`. This module reads them back for the group pack
|
|
9
|
+
// (renderEffectsSection) and for phase5_check (effectCoverage): each effect is implemented in the code that
|
|
10
|
+
// opens / dismisses the overlay and marked `// EFFECT: <id>` on or up to 3 lines above the implementing
|
|
11
|
+
// statement, or waived with `// EFFECT-OMIT: <id> — <basis>`.
|
|
12
|
+
//
|
|
13
|
+
// An older UTG has no host_effects: every function returns nothing and the check is skipped silently.
|
|
14
|
+
|
|
15
|
+
import * as fs from 'node:fs';
|
|
16
|
+
import * as path from 'node:path';
|
|
17
|
+
|
|
18
|
+
const LOOKAHEAD = 3;
|
|
19
|
+
|
|
20
|
+
function readJson(p) {
|
|
21
|
+
try { return JSON.parse(fs.readFileSync(p, 'utf8')); } catch { return null; }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const isObj = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
25
|
+
|
|
26
|
+
/** host_effects with at least one open / dismiss entry. */
|
|
27
|
+
export function hasHostEffects(fx) {
|
|
28
|
+
return isObj(fx) && ['open', 'dismiss'].some((k) => Array.isArray(fx[k]) && fx[k].length > 0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Edges with host effects: conversion_set.json `overlay_effects`, else every page meta.json under uiInfo
|
|
33
|
+
* (reached_from / navigates_to / overlay_effects). Each edge is {source, target, mechanism, trigger, host_effects}.
|
|
34
|
+
*/
|
|
35
|
+
export function loadEffects(uiInfo) {
|
|
36
|
+
if (!uiInfo) { return []; }
|
|
37
|
+
const cs = readJson(path.join(uiInfo, 'conversion_set.json'));
|
|
38
|
+
if (isObj(cs) && Array.isArray(cs.overlay_effects)) { return cs.overlay_effects.filter((e) => hasHostEffects(e && e.host_effects)); }
|
|
39
|
+
const out = new Map();
|
|
40
|
+
let dirs = [];
|
|
41
|
+
try { dirs = fs.readdirSync(uiInfo, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name); } catch { return []; }
|
|
42
|
+
for (const d of dirs) {
|
|
43
|
+
const meta = readJson(path.join(uiInfo, d, 'meta.json'));
|
|
44
|
+
if (!isObj(meta)) { continue; }
|
|
45
|
+
const me = meta.static_node;
|
|
46
|
+
const views = [...(meta.reached_from ?? []).map((e) => ({ ...e, target: me })),
|
|
47
|
+
...(meta.navigates_to ?? []).map((e) => ({ source: me, ...e })), ...(meta.overlay_effects ?? [])];
|
|
48
|
+
for (const e of views) {
|
|
49
|
+
if (!isObj(e) || !hasHostEffects(e.host_effects) || !e.source || !e.target) { continue; }
|
|
50
|
+
out.set(`${e.source}\u0000${e.target}\u0000${e.trigger ?? ''}`, e);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return [...out.values()];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Converted nodes of conversion_set.json (role page / attach), or null when it lists none. */
|
|
57
|
+
export function convertedNodes(uiInfo) {
|
|
58
|
+
const cs = uiInfo ? readJson(path.join(uiInfo, 'conversion_set.json')) : null;
|
|
59
|
+
const rows = isObj(cs) && Array.isArray(cs.nodes) ? cs.nodes : [];
|
|
60
|
+
const s = new Set(rows.filter((r) => r && (r.role === 'page' || r.role === 'attach')).map((r) => r.node));
|
|
61
|
+
return s.size ? s : null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Member nodes of group gid in conversion_set.json plan, or null when the group is unknown. */
|
|
65
|
+
export function groupNodes(uiInfo, gid) {
|
|
66
|
+
const cs = uiInfo ? readJson(path.join(uiInfo, 'conversion_set.json')) : null;
|
|
67
|
+
const groups = isObj(cs) && isObj(cs.plan) && Array.isArray(cs.plan.groups) ? cs.plan.groups : [];
|
|
68
|
+
const g = groups.find((x) => x && x.id === gid);
|
|
69
|
+
return g ? new Set((g.members ?? []).map((m) => m && m.node).filter(Boolean)) : null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Every effect of the edges: {id, phase, stmt, at, resolved, edge}. */
|
|
73
|
+
export function effectsOf(edges) {
|
|
74
|
+
const out = [];
|
|
75
|
+
for (const e of edges) {
|
|
76
|
+
for (const phase of ['open', 'dismiss']) {
|
|
77
|
+
for (const fx of (e.host_effects?.[phase] ?? [])) {
|
|
78
|
+
if (isObj(fx) && fx.id) { out.push({ id: String(fx.id), phase, stmt: fx.stmt ?? '', at: fx.at ?? '', resolved: fx.resolved ?? [], edge: e }); }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// The id is `fx:<path>:<line>:<column>` (a2h-utg-static), or `fx:<basename>:<line>` from an older UTG:
|
|
86
|
+
// matched by its shape, so punctuation written after it is not part of it.
|
|
87
|
+
// The path part is anything but whitespace and ':' (non-ASCII, '+', '@' and spaces-free names alike), with an
|
|
88
|
+
// optional drive letter for an id rel() could not make relative; the number(s) end it.
|
|
89
|
+
// a colon written after the id (`fx:a.kt:12:5: reason`) ends it like any other punctuation
|
|
90
|
+
const FX_ID = String.raw`fx:(?:[A-Za-z]:)?[^\s:]+:\d+(?::\d+)?(?!\d|:\d)`;
|
|
91
|
+
const RE_MARK = new RegExp(String.raw`\/\/\s*EFFECT(?!-)\s*[::]\s*(${FX_ID})`);
|
|
92
|
+
const RE_OMIT = new RegExp(String.raw`\/\/\s*EFFECT-OMIT\s*[::]\s*(${FX_ID})\s*(?:[—–::-]+\s*)?(.*)$`);
|
|
93
|
+
|
|
94
|
+
/** A line that does something: an assignment, a call or ++ / --, not a comment, brace, control head or UI component. */
|
|
95
|
+
export function realStatement(line) {
|
|
96
|
+
const code = line.replace(/\/\/.*$/, '').trim();
|
|
97
|
+
if (!code || /^[}\])\s;,]*$/.test(code) || /^\/?\*/.test(code)) { return false; }
|
|
98
|
+
if (/^(?:if|else|for|while|switch|case|function|struct|class|@\w+)\b/.test(code) || /^\}?\s*else\b/.test(code)) { return false; }
|
|
99
|
+
if (/^[A-Z][\w$]*\s*\(/.test(code)) { return false; }
|
|
100
|
+
return /[\w$\])]\s*(?:[+\-*/%&|?]{0,2})=(?!=)/.test(code) || /[\w$\])]\s*(?:\?\.)?\s*\(/.test(code) || /\+\+|--/.test(code);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** markers in src: marks id -> [{line, attached}], omits id -> [{line, reason}]. */
|
|
104
|
+
export function scanEffectMarkers(src) {
|
|
105
|
+
const lines = src.split(/\r?\n/);
|
|
106
|
+
const marks = new Map();
|
|
107
|
+
const omits = new Map();
|
|
108
|
+
lines.forEach((ln, i) => {
|
|
109
|
+
const o = RE_OMIT.exec(ln);
|
|
110
|
+
if (o) { if (!omits.has(o[1])) { omits.set(o[1], []); } omits.get(o[1]).push({ line: i + 1, reason: o[2].trim() }); return; }
|
|
111
|
+
const m = RE_MARK.exec(ln);
|
|
112
|
+
if (!m) { return; }
|
|
113
|
+
const attached = realStatement(ln.slice(0, ln.indexOf('//'))) || lines.slice(i + 1, i + 1 + LOOKAHEAD).some(realStatement);
|
|
114
|
+
if (!marks.has(m[1])) { marks.set(m[1], []); }
|
|
115
|
+
marks.get(m[1]).push({ line: i + 1, attached });
|
|
116
|
+
});
|
|
117
|
+
return { marks, omits };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** A basis worth the name: 4+ chars, or 2+ CJK chars (same bar as static_check hit_test.ts hasBasis). */
|
|
121
|
+
export function hasBasis(s) {
|
|
122
|
+
const t = String(s ?? '').replace(/\s+/g, '');
|
|
123
|
+
return t.length >= 4 || (t.match(/[㐀-鿿]/g) ?? []).length >= 2;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Edges in scope: touching a group member (group mode), else touching a converted node (or all, when unknown). */
|
|
127
|
+
export function edgesInScope(edges, { members = null, converted = null } = {}) {
|
|
128
|
+
const set = members ?? converted;
|
|
129
|
+
return set === null ? edges : edges.filter((e) => set.has(e.source) || set.has(e.target));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* GATE overlay-effect-uncovered: an effect of an edge in scope with no attached `// EFFECT: <id>` in files or
|
|
134
|
+
* shared and no `// EFFECT-OMIT: <id> — <basis>`. GATE effect-marker-detached: an EFFECT marker in files with no
|
|
135
|
+
* statement on its line or the next 3. In group mode an edge whose opener (source) is outside the group is only
|
|
136
|
+
* a candidate there: the host's group or the Step 5.5 wiring writes it. files / shared: [[rel, src]].
|
|
137
|
+
*/
|
|
138
|
+
export function effectCoverage({ edges, members = null, converted = null, files = [], shared = [] }) {
|
|
139
|
+
const gate = [];
|
|
140
|
+
const cand = [];
|
|
141
|
+
const marks = new Map();
|
|
142
|
+
const omits = new Map();
|
|
143
|
+
const seen = new Set();
|
|
144
|
+
const add = (rel, src, own) => {
|
|
145
|
+
const s = scanEffectMarkers(src);
|
|
146
|
+
for (const [id, v] of s.marks) {
|
|
147
|
+
for (const x of v) {
|
|
148
|
+
if (!x.attached) {
|
|
149
|
+
if (own) { gate.push(`effect-marker-detached ${rel}:${x.line} // EFFECT: ${id} — no assignment / call on this line or the next ${LOOKAHEAD}`); }
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (!marks.has(id)) { marks.set(id, []); }
|
|
153
|
+
marks.get(id).push(`${rel}:${x.line}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
for (const [id, v] of s.omits) { if (!omits.has(id)) { omits.set(id, []); } omits.get(id).push(...v.map((x) => ({ ...x, at: `${rel}:${x.line}` }))); }
|
|
157
|
+
};
|
|
158
|
+
for (const [rel, src] of files) { seen.add(rel); add(rel, src, true); }
|
|
159
|
+
for (const [rel, src] of shared) { if (!seen.has(rel)) { add(rel, src, false); } }
|
|
160
|
+
const all = effectsOf(edgesInScope(edges, { members, converted }));
|
|
161
|
+
// One verdict per id, over every edge that carries it: the same overlay opened from two hosts lists its
|
|
162
|
+
// dismiss effects (in the overlay's own file) twice, and the edge listed first must not decide.
|
|
163
|
+
const byId = new Map();
|
|
164
|
+
for (const fx of all) { if (!byId.has(fx.id)) { byId.set(fx.id, []); } byId.get(fx.id).push(fx); }
|
|
165
|
+
for (const [id, xs] of byId) {
|
|
166
|
+
if (marks.has(id)) { continue; }
|
|
167
|
+
const om = (omits.get(id) ?? []).find((x) => hasBasis(x.reason));
|
|
168
|
+
if (om) { continue; }
|
|
169
|
+
const own = members === null ? xs[0] : xs.find((x) => members.has(x.edge.source));
|
|
170
|
+
const fx = own ?? xs[0];
|
|
171
|
+
const bad = (omits.get(id) ?? [])[0];
|
|
172
|
+
const where = `${fx.edge.source} → ${fx.edge.target} ${fx.phase}`;
|
|
173
|
+
const msg = `overlay-effect-uncovered ${id} (${where}): \`${fx.stmt}\` at ${fx.at} has no // EFFECT: ${id} ` +
|
|
174
|
+
`on an implementing statement${bad ? ` (EFFECT-OMIT at ${bad.at} has no basis)` : ''}`;
|
|
175
|
+
(own ? gate : cand).push(msg);
|
|
176
|
+
}
|
|
177
|
+
return { gate, cand, checked: byId.size };
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Group pack section: every host effect of the edges, with the marker rule. [] when there is none. */
|
|
181
|
+
export function renderEffectsSection(edges) {
|
|
182
|
+
const withFx = edges.filter((e) => hasHostEffects(e.host_effects));
|
|
183
|
+
if (!withFx.length) { return []; }
|
|
184
|
+
const lines = ['## Overlay host effects — implement each one where the overlay opens / dismisses', '',
|
|
185
|
+
'Opening or dismissing these overlays also changes the host page in Android (a2h-utg-static `host_effects`). ' +
|
|
186
|
+
'Setting the overlay\'s own visibility flag is not enough. Implement **each** effect below in the HarmonyOS code ' +
|
|
187
|
+
'that opens / dismisses the overlay (the trigger handler, the onDismiss / close callback), from its `resolved` ' +
|
|
188
|
+
'statements, and put `// EFFECT: <id>` on the implementing statement or up to 3 lines above it. An effect that ' +
|
|
189
|
+
'cannot or must not be ported gets `// EFFECT-OMIT: <id> — <basis>` instead. phase5_check gates both ' +
|
|
190
|
+
'(`overlay-effect-uncovered`, `effect-marker-detached`); when Step 5.5 moves the overlay mounting, the markers ' +
|
|
191
|
+
'and statements move with it.', ''];
|
|
192
|
+
for (const e of withFx) {
|
|
193
|
+
lines.push(`### ${e.source} → ${e.target} (${e.mechanism ?? 'open-overlay'}${e.trigger ? `, trigger \`${e.trigger}\`` : ''})`, '');
|
|
194
|
+
for (const phase of ['open', 'dismiss']) {
|
|
195
|
+
for (const fx of e.host_effects[phase] ?? []) {
|
|
196
|
+
if (!isObj(fx) || !fx.id) { continue; }
|
|
197
|
+
lines.push(`- ${phase} \`${fx.id}\`: \`${fx.stmt ?? ''}\` at \`${fx.at ?? ''}\``);
|
|
198
|
+
for (const r of fx.resolved ?? []) { lines.push(` - resolves to \`${r.stmt ?? ''}\` at \`${r.at ?? ''}\``); }
|
|
199
|
+
if (!(fx.resolved ?? []).length) { lines.push(' - not resolved upstream: follow the call from `at` in the Android source'); }
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
lines.push('');
|
|
203
|
+
}
|
|
204
|
+
return lines;
|
|
205
|
+
}
|