@buaa_smat/hometrans 26.0.3 → 26.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/agents/code-reviewer.md +91 -21
- package/env-requirements.json +1 -1
- package/i18n/agents/code-reviewer.md +93 -21
- package/i18n/skills/a2h-app-migrate/SKILL.md +19 -11
- package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +2 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +320 -73
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
- package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
- package/i18n/skills/a2h-arch-generate/SKILL.md +20 -17
- package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
- package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
- package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
- package/i18n/skills/a2h-arch-generate/references/source-baseline.md +4 -4
- package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +52 -11
- package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
- package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +70 -21
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +31 -0
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +22 -6
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +386 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +133 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
- package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +11 -9
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/i18n/skills/a2h-page-specgen/SKILL.md +123 -20
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +11 -9
- package/i18n/skills/a2h-page-specgen/references/gates.md +119 -52
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +69 -22
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +113 -110
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +171 -62
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +314 -192
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +364 -76
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +216 -8
- package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -223
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +521 -13
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
- package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +483 -125
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +10 -33
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +134 -163
- package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +206 -9
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
- package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +862 -12
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +166 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +69 -44
- package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +658 -120
- package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
- package/i18n/skills/a2h-resource-convert/SKILL.md +9 -1
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
- package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +69 -109
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +135 -37
- package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +24 -13
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +170 -7
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/i18n/skills/a2h-spec-generate/SKILL.md +2 -2
- package/i18n/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +3 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +74 -84
- package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +211 -61
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +724 -47
- package/i18n/skills/a2h-utg-static/SKILL.md +6 -2
- package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +82 -12
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
- package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +50 -5
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +17 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +181 -17
- package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +118 -19
- package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +113 -70
- package/package.json +3 -6
- package/skills/a2h-app-migrate/SKILL.md +19 -11
- package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/skills/a2h-app-migrate/references/stage-map.md +2 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +307 -74
- package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
- package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
- package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +64 -6
- package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +33 -9
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +27 -17
- package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
- package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
- package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
- package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +7 -7
- package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
- package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +10 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +39 -0
- package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +33 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
- package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +13 -5
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +170 -3
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +12 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
- package/skills/a2h-arch-generate/SKILL.md +20 -17
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +10 -8
- package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
- package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +17 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +26 -0
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +146 -17
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +42 -11
- package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
- package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +244 -0
- package/skills/a2h-batch-ui-align/SKILL.md +72 -22
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
- package/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
- package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +380 -16
- package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
- package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
- package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +39 -5
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +213 -30
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
- package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
- package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
- package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
- package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +24 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +24 -2
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +14 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +41 -7
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +1 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +19 -0
- package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +155 -1
- package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
- package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
- package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
- package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +5 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
- package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
- package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
- package/skills/a2h-page-specgen/SKILL.md +124 -20
- package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
- package/skills/a2h-page-specgen/references/body-language.md +11 -9
- package/skills/a2h-page-specgen/references/evidence.md +35 -0
- package/skills/a2h-page-specgen/references/execution-model.md +135 -26
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +20 -15
- package/skills/a2h-page-specgen/references/gates.md +120 -52
- package/skills/a2h-page-specgen/references/page-inventory.md +69 -22
- package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
- package/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/skills/a2h-page-specgen/references/spec-template.md +112 -109
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +8 -5
- package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +170 -61
- package/skills/a2h-page-specgen/scripts/finalize.mjs +466 -63
- package/skills/a2h-page-specgen/scripts/footprint.mjs +302 -180
- package/skills/a2h-page-specgen/scripts/gate.mjs +372 -82
- package/skills/a2h-page-specgen/scripts/interactions.mjs +215 -8
- package/skills/a2h-page-specgen/scripts/inventory.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -216
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +105 -13
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +520 -12
- package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +129 -6
- package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
- package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
- package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +106 -0
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +470 -122
- package/skills/a2h-page-specgen/scripts/render.mjs +11 -34
- package/skills/a2h-page-specgen/scripts/report.mjs +339 -6
- package/skills/a2h-page-specgen/scripts/submission.mjs +253 -88
- package/skills/a2h-page-specgen/scripts/submit.mjs +12 -6
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
- package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +135 -137
- package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +178 -9
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +19 -1
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
- package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +869 -13
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
- package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +42 -2
- package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +171 -3
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +365 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
- package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +85 -42
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
- package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
- package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +645 -115
- package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +88 -74
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +30 -1
- package/skills/a2h-page-specgen/scripts/waker.mjs +79 -12
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +18 -17
- package/skills/a2h-resource-convert/SKILL.md +9 -1
- package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
- package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
- package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
- package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
- package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
- package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
- package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +48 -72
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +123 -37
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +40 -8
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +5 -4
- package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +37 -5
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
- package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +38 -14
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +127 -4
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +90 -24
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +65 -34
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +11 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +10 -2
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/{HttpExtraDataEmptyStringCheck.js → platform/ExtraDataSubCheck.js} +27 -30
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +4 -2
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +3 -2
- package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +55 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +138 -7
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +10 -13
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +21 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +32 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +109 -13
- package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
- package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +12 -17
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +172 -7
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +36 -16
- package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +27 -3
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +20 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +143 -13
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +168 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +139 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +25 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +37 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +4 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +59 -8
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +44 -0
- package/skills/a2h-spec-generate/SKILL.md +2 -2
- package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +1 -2
- package/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/skills/a2h-utg-explorer/references/architecture.md +3 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +56 -5
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
- package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
- package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
- package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
- package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
- package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
- package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +122 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +138 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +22 -13
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
- package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
- package/skills/a2h-utg-static/SKILL.md +6 -2
- package/skills/a2h-utg-static/scripts/assemble.mjs +65 -0
- package/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +8 -1
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
- package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
- package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +0 -55
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +0 -60
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -948
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -1014
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diagnostics.mjs — failure classes that are not coverage gaps of a page, shared by task_runner
|
|
3
|
+
* (which names them while a phase runs) and report (which lists them, for old campaigns too).
|
|
4
|
+
*
|
|
5
|
+
* Collapsed phase: one replay prefix that failed, and the prefix memo failing every other task
|
|
6
|
+
* behind it without running it. Measured (coolmall 2026-11-15): a first-run hop (Guide 「跳过」)
|
|
7
|
+
* that was no longer shown failed at replay step 0 in the first round and in all 7 recovery
|
|
8
|
+
* phases; the report listed some 30 `selector-not-found` gaps and never said that each phase had
|
|
9
|
+
* run one task. A collapse is an explorer fault to fix, not a page to review.
|
|
10
|
+
*
|
|
11
|
+
* Empty state: a selector or list row that is missing because the page shows its own empty-state
|
|
12
|
+
* component (no orders, no coupons), not because the path is wrong. Measured (coolmall
|
|
13
|
+
* 2026-11-16): the order list showed 「暂无数据」 and 14 pages behind 「交易完成」 failed as
|
|
14
|
+
* selector-not-found; the remedy is test data, which a selector review cannot give. The empty
|
|
15
|
+
* components come from the static pass's own body texts (their `at` file lies in an `empty`
|
|
16
|
+
* component: `component/empty/EmptyData.kt`, `layout/view_empty.xml`), never from app vocabulary.
|
|
17
|
+
*
|
|
18
|
+
* Exports: COLLAPSE_MIN_CASCADE, collapsedPrefixes, collapseNote, EMPTY_AT_RE, emptyStateComponents,
|
|
19
|
+
* emptyStateShown
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** Tasks failed through one root's prefix before a phase counts as collapsed. */
|
|
23
|
+
export const COLLAPSE_MIN_CASCADE = 3;
|
|
24
|
+
|
|
25
|
+
const verifiedId = (o) => {
|
|
26
|
+
const r = (o && o.static_resolution) || {};
|
|
27
|
+
return r.status === 'verified' ? r.static_id : null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* collapsedPrefixes(events, tasksById, { env, min }): the roots whose failed prefix the memo
|
|
32
|
+
* reused for at least `min` other tasks, per environment:
|
|
33
|
+
* [{ environment_id, root_task, replay_index, step_label, page, reason, cascaded, targets }].
|
|
34
|
+
* `step_label` is the root task's replay step at `replay_index`; `page` the screen it failed on.
|
|
35
|
+
*/
|
|
36
|
+
export function collapsedPrefixes(events, tasksById, { env = null, min = COLLAPSE_MIN_CASCADE } = {}) {
|
|
37
|
+
const pageOf = new Map();
|
|
38
|
+
for (const e of events) {
|
|
39
|
+
if (e.kind === 'mapping' && e.payload) { pageOf.set(e.payload.observation_id, e.payload.static_id); }
|
|
40
|
+
else if (e.kind === 'observation' && e.payload && verifiedId(e.payload)) { pageOf.set(e.payload.observation_id, verifiedId(e.payload)); }
|
|
41
|
+
}
|
|
42
|
+
const groups = new Map();
|
|
43
|
+
for (const e of events) {
|
|
44
|
+
if (e.kind !== 'task_result' || !e.payload || !e.payload.prefix_failed_from) { continue; }
|
|
45
|
+
if (env !== null && e.environment_id !== env) { continue; }
|
|
46
|
+
const p = e.payload;
|
|
47
|
+
const k = JSON.stringify([e.environment_id, p.prefix_failed_from, p.replay_index ?? null]);
|
|
48
|
+
if (!groups.has(k)) {
|
|
49
|
+
groups.set(k, { environment_id: e.environment_id, root_task: p.prefix_failed_from, replay_index: p.replay_index ?? null,
|
|
50
|
+
reason: p.reason ?? null, observation_id: p.observation_id ?? null, targets: [] });
|
|
51
|
+
}
|
|
52
|
+
groups.get(k).targets.push(p.target_static);
|
|
53
|
+
}
|
|
54
|
+
const out = [];
|
|
55
|
+
for (const g of groups.values()) {
|
|
56
|
+
if (g.targets.length < min) { continue; }
|
|
57
|
+
const root = tasksById.get(String(g.root_task)) || tasksById.get(String(g.root_task).split('@')[0]) || {};
|
|
58
|
+
const step = Number.isInteger(g.replay_index) ? ((root.replay || [])[g.replay_index] || {}) : {};
|
|
59
|
+
out.push({ environment_id: g.environment_id, root_task: g.root_task, replay_index: g.replay_index,
|
|
60
|
+
step_label: step.static_label ?? step.type ?? null, page: pageOf.get(g.observation_id) ?? null,
|
|
61
|
+
reason: g.reason, cascaded: g.targets.length, targets: [...new Set(g.targets)].sort() });
|
|
62
|
+
}
|
|
63
|
+
return out.sort((a, b) => b.cascaded - a.cascaded || String(a.environment_id).localeCompare(String(b.environment_id)));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** One line naming a collapse: `19 tasks failed with <root> at replay step 0 「跳过」 on <page>`. */
|
|
67
|
+
export function collapseNote(c) {
|
|
68
|
+
const step = c.replay_index === null ? 'its prefix' : `replay step ${c.replay_index}${c.step_label ? ` 「${c.step_label}」` : ''}`;
|
|
69
|
+
return `${c.cascaded} tasks failed with ${c.root_task} at ${step}${c.page ? ` on ${c.page}` : ''} (${c.reason ?? 'failed'})`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** An `at` that lies in an empty-state component: a dir, file or layout named empty*. */
|
|
73
|
+
export const EMPTY_AT_RE = /(?:^|[\\/_.-])empty/i;
|
|
74
|
+
/** Of those, the ones that stand for a failed load (network / error), not for missing data. */
|
|
75
|
+
const NETWORK_AT_RE = /network|offline|error|fail/i;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* emptyStateComponents(nodes): Map component file -> { kind: 'data' | 'network', texts: Set } from
|
|
79
|
+
* the static nodes' body texts (`{ text, at: 'path/File.kt:23' }`) whose `at` is an empty component.
|
|
80
|
+
*/
|
|
81
|
+
export function emptyStateComponents(nodes) {
|
|
82
|
+
const out = new Map();
|
|
83
|
+
for (const n of nodes || []) {
|
|
84
|
+
for (const b of (n && n.body_text) || []) {
|
|
85
|
+
const at = String((b && b.at) || '');
|
|
86
|
+
const text = String((b && b.text) || '').trim();
|
|
87
|
+
if (!text || !EMPTY_AT_RE.test(at.replace(/:\d+$/, ''))) { continue; }
|
|
88
|
+
const file = at.replace(/:\d+$/, '');
|
|
89
|
+
if (!out.has(file)) { out.set(file, { kind: NETWORK_AT_RE.test(file.split(/[\\/]/).pop()) ? 'network' : 'data', texts: new Set() }); }
|
|
90
|
+
out.get(file).texts.add(text);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* emptyStateShown(observation, components): the empty component the screen shows, or null. The
|
|
98
|
+
* component with the most of its texts visible wins; it needs two of them (all, when it has one),
|
|
99
|
+
* so a lone shared word (「重新加载」 is in both the data and the network component) decides nothing.
|
|
100
|
+
* -> { kind, file, texts: [shown texts] }
|
|
101
|
+
*/
|
|
102
|
+
export function emptyStateShown(observation, components) {
|
|
103
|
+
if (!components || !components.size) { return null; }
|
|
104
|
+
const shown = new Set();
|
|
105
|
+
for (const n of (observation && observation.nodes) || []) {
|
|
106
|
+
if (n && n.visible === false) { continue; }
|
|
107
|
+
for (const t of [n && n.text, n && (n.content_desc ?? n['content-desc'])]) { if (t && String(t).trim()) { shown.add(String(t).trim()); } }
|
|
108
|
+
}
|
|
109
|
+
let best = null;
|
|
110
|
+
for (const [file, c] of components) {
|
|
111
|
+
const hits = [...c.texts].filter((t) => shown.has(t));
|
|
112
|
+
if (hits.length < Math.min(2, c.texts.size)) { continue; }
|
|
113
|
+
if (!best || hits.length > best.texts.length) { best = { kind: c.kind, file, texts: hits.sort() }; }
|
|
114
|
+
}
|
|
115
|
+
return best;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Does a value satisfy a state predicate { op: 'in'|'not-in', values }? */
|
|
119
|
+
const satisfies = (pred, v) => (pred.op === 'in' ? pred.values.includes(v) : !pred.values.includes(v));
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* seedPlan(gaps, nodesById, model): the fewest records to seed so every uncovered page's data needs
|
|
123
|
+
* hold (a2h-utg-static data_model `data_needs`: per entity, one predicate per field), chosen greedily:
|
|
124
|
+
* each pick is the entity / field / value that satisfies the most remaining page constraints.
|
|
125
|
+
* Pages needing only an instance (any state) are satisfied by any record of that entity.
|
|
126
|
+
* gaps [{ id, reason }] the report's uncovered nodes
|
|
127
|
+
* nodesById Map id -> static node (with data_needs, data_path_conflicts)
|
|
128
|
+
* model data_model.json or null (value labels and data sources, for the report)
|
|
129
|
+
* present entities the run already saw a record of (a covered page that needs one): their
|
|
130
|
+
* instance-only needs are met, so no "any state" record is asked for
|
|
131
|
+
* -> { seeds: [{ entity, field?, value?, label?, unlocks: [id] }], conflicts: [{ id, ... }],
|
|
132
|
+
* unseeded: [{ entity, field, op, values, ids }] (constraints no known value satisfies) }
|
|
133
|
+
*/
|
|
134
|
+
export function seedPlan(gaps, nodesById, model = null, present = new Set()) {
|
|
135
|
+
const pending = [];
|
|
136
|
+
for (const g of gaps) {
|
|
137
|
+
const needs = (nodesById.get(g.id) || {}).data_needs;
|
|
138
|
+
if (!Array.isArray(needs) || !needs.length) { continue; }
|
|
139
|
+
for (const n of needs) {
|
|
140
|
+
const fields = Object.entries(n.states || {});
|
|
141
|
+
if (!fields.length) { if (!present.has(n.entity)) { pending.push({ id: g.id, entity: n.entity, field: null }); } continue; }
|
|
142
|
+
for (const [field, pred] of fields) { pending.push({ id: g.id, entity: n.entity, field, pred }); }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const labelOf = (e, f, v) => model?.entities?.[e]?.fields?.[f]?.values?.[v] ?? null;
|
|
146
|
+
const domain = (e, f) => {
|
|
147
|
+
const vs = new Set(Object.keys(model?.entities?.[e]?.fields?.[f]?.values || {}));
|
|
148
|
+
for (const c of pending) { if (c.entity === e && c.field === f) { for (const v of c.pred.values) { vs.add(v); } } }
|
|
149
|
+
return [...vs].sort((a, b) => (Number.isNaN(+a) || Number.isNaN(+b) ? a.localeCompare(b) : +a - +b));
|
|
150
|
+
};
|
|
151
|
+
const seeds = []; let open = pending.filter((c) => c.field);
|
|
152
|
+
for (;;) {
|
|
153
|
+
let best = null;
|
|
154
|
+
for (const key of new Set(open.map((c) => `${c.entity}\u0000${c.field}`))) {
|
|
155
|
+
const [e, f] = key.split('\u0000');
|
|
156
|
+
for (const v of domain(e, f)) {
|
|
157
|
+
const hit = open.filter((c) => c.entity === e && c.field === f && satisfies(c.pred, v));
|
|
158
|
+
if (hit.length && (!best || hit.length > best.hit.length)) { best = { e, f, v, hit }; }
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (!best) { break; }
|
|
162
|
+
seeds.push({ entity: best.e, field: best.f, value: best.v, label: labelOf(best.e, best.f, best.v), unlocks: [...new Set(best.hit.map((c) => c.id))].sort() });
|
|
163
|
+
open = open.filter((c) => !best.hit.includes(c));
|
|
164
|
+
}
|
|
165
|
+
const unseeded = [];
|
|
166
|
+
for (const c of open) {
|
|
167
|
+
const u = unseeded.find((x) => x.entity === c.entity && x.field === c.field && x.op === c.pred.op && JSON.stringify(x.values) === JSON.stringify(c.pred.values));
|
|
168
|
+
if (u) { u.ids.push(c.id); } else { unseeded.push({ entity: c.entity, field: c.field, op: c.pred.op, values: c.pred.values, ids: [c.id] }); }
|
|
169
|
+
}
|
|
170
|
+
// instance-only needs: met by any seeded record of the entity, else one record in any state
|
|
171
|
+
for (const c of pending.filter((x) => !x.field)) {
|
|
172
|
+
const s = seeds.find((x) => x.entity === c.entity);
|
|
173
|
+
if (s) { if (!s.unlocks.includes(c.id)) { s.unlocks.push(c.id); s.unlocks.sort(); } continue; }
|
|
174
|
+
let any = seeds.find((x) => x.entity === c.entity && x.field === undefined);
|
|
175
|
+
if (!any) { any = { entity: c.entity, unlocks: [] }; seeds.push(any); }
|
|
176
|
+
if (!any.unlocks.includes(c.id)) { any.unlocks.push(c.id); }
|
|
177
|
+
}
|
|
178
|
+
const conflicts = gaps.filter((g) => (nodesById.get(g.id) || {}).data_path_conflicts)
|
|
179
|
+
.map((g) => ({ id: g.id, conflicts: nodesById.get(g.id).data_path_conflicts }));
|
|
180
|
+
return { seeds, conflicts, unseeded };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Entities a covered page needs an instance of: the run saw such a record, so it exists. */
|
|
184
|
+
export function presentEntities(mappedIds, nodesById) {
|
|
185
|
+
const out = new Set();
|
|
186
|
+
for (const id of mappedIds) {
|
|
187
|
+
for (const n of (nodesById.get(id) || {}).data_needs || []) { out.add(n.entity); }
|
|
188
|
+
}
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** One line per seed, for report.md: `order.status = 2 (待收货): unlocks 5: a, b, ...`. */
|
|
193
|
+
export function seedNote(s) {
|
|
194
|
+
const what = s.field === undefined ? `${s.entity} (any state)` : `${s.entity}.${s.field} = ${s.value}${s.label ? ` (${s.label})` : ''}`;
|
|
195
|
+
return `${what}: unlocks ${s.unlocks.length}: ${s.unlocks.join(', ')}`;
|
|
196
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hybrid_route.mjs — shared helpers for uni-app / hybrid page capture.
|
|
3
|
+
*
|
|
4
|
+
* A uni-app page is not an Android Activity: every page lives in one WebView host, so the
|
|
5
|
+
* Activity-based direct-launch fallback cannot reach it. The equivalent first-class action is a
|
|
6
|
+
* route jump through the page WebView (`uni.reLaunch` / `uni.switchTab`), handled by
|
|
7
|
+
* DeviceAdapter's `route` action (hybrid_route_cdp.mjs). These helpers keep task/phase creation
|
|
8
|
+
* consistent between compile_tasks.mjs and direct_launch.mjs.
|
|
9
|
+
*/
|
|
10
|
+
import { get, truthy, pyStr, sha256Hex } from './_py.mjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Routes declared under a components/modules/static folder are building blocks, not pages. A
|
|
14
|
+
* leading `modules/` is not counted: it is usually a subPackage root (the whole package), and only
|
|
15
|
+
* a2h-utg-static knows the root (uniapp_nav.mjs isComponentRoute).
|
|
16
|
+
*/
|
|
17
|
+
export const COMPONENT_ROUTE_RE = /(?:^|\/)(?:components?|static)(?:\/|$)|\/modules?(?:\/|$)/;
|
|
18
|
+
|
|
19
|
+
/** A static node that can be captured by a uni-app route jump. */
|
|
20
|
+
export function isHybridPageNode(n) {
|
|
21
|
+
return get(n, 'kind') === 'hybrid-page' && truthy(get(n, 'route'));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A route under pages/components, a subpackage's modules folder, or a static component folder is
|
|
26
|
+
* a component/overlay entry in pages.json, not an independently navigable page. It stays in the
|
|
27
|
+
* graph (its edges may explain a parent page) but is out of the coverage denominator. This is the
|
|
28
|
+
* fallback for a graph without a2h-utg-static's verdict; no leaf-name rule (popup / dialog /
|
|
29
|
+
* picker): uni-app opens such registered pages with navigateTo.
|
|
30
|
+
*/
|
|
31
|
+
export function isComponentRoute(route) {
|
|
32
|
+
const r = pyStr(route).replace(/^\/+/, '');
|
|
33
|
+
return COMPONENT_ROUTE_RE.test(r);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A hybrid component/overlay route entry that has no screen of its own: a2h-utg-static marks it
|
|
38
|
+
* `non_navigable` (uniapp_nav.mjs); an older graph without the marker falls back to the route
|
|
39
|
+
* heuristic. Native denominator:false nodes (host activities, embedded fragments, shells, dialogs)
|
|
40
|
+
* are NOT non-navigable: their edges still carry click obligations. plan.mjs drops the edges of
|
|
41
|
+
* exactly these nodes and audit.mjs takes exactly these edges out of the denominator.
|
|
42
|
+
*/
|
|
43
|
+
export function isNonNavigable(n) {
|
|
44
|
+
const v = get(n, 'non_navigable');
|
|
45
|
+
if (v === true || v === false) { return v; } // a2h-utg-static's verdict
|
|
46
|
+
// A hybrid page the static layer took out of the denominator is a component entry too (no
|
|
47
|
+
// native node kind: those keep their edges).
|
|
48
|
+
if (get(n, 'kind') === 'hybrid-page' && (get(n, 'denominator') === false || truthy(get(n, 'out_of_scope')))) { return true; }
|
|
49
|
+
return isHybridPageNode(n) && isComponentRoute(get(n, 'route'));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Deterministic id shared by compile_tasks and direct_launch (so a recompile never duplicates). */
|
|
53
|
+
export function routeTaskId(route) {
|
|
54
|
+
return 'route-' + sha256Hex(Buffer.from(pyStr(route), 'utf8')).slice(0, 16);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** '/' + normalized route. */
|
|
58
|
+
export function routeUrl(route) {
|
|
59
|
+
const r = pyStr(route).replace(/^\/+/, '');
|
|
60
|
+
return '/' + r;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The runner action for a page route. */
|
|
64
|
+
export function routeAction(node) {
|
|
65
|
+
return { type: 'route', url: routeUrl(get(node, 'route')), api: 'reLaunch', appid: get(node, 'appid') };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** A task that reaches `node` with a direct route jump, independent of any in-app click path. */
|
|
69
|
+
export function routeTask(node, phaseId, opts = {}) {
|
|
70
|
+
const route = pyStr(get(node, 'route')).replace(/^\/+/, '');
|
|
71
|
+
const expected = {};
|
|
72
|
+
const src = get(node, 'expected');
|
|
73
|
+
if (src && typeof src === 'object' && !Array.isArray(src)) {
|
|
74
|
+
for (const k of Object.keys(src)) { expected[k] = src[k]; }
|
|
75
|
+
}
|
|
76
|
+
if (get(node, 'kind') !== undefined) { expected.kind = get(node, 'kind'); }
|
|
77
|
+
if (get(node, 'label') !== undefined) { expected.label = get(node, 'label'); }
|
|
78
|
+
if (get(node, 'aliases') !== undefined) { expected.aliases = get(node, 'aliases'); }
|
|
79
|
+
return {
|
|
80
|
+
task_id: routeTaskId(route),
|
|
81
|
+
phase: phaseId,
|
|
82
|
+
environment_id: pyStr(get(opts, 'environment_id', 'default')),
|
|
83
|
+
source_static: get(node, 'id'),
|
|
84
|
+
source_context: null,
|
|
85
|
+
target_static: get(node, 'id'),
|
|
86
|
+
target_expected: expected,
|
|
87
|
+
requires: [...(get(opts, 'requires', []) || [])],
|
|
88
|
+
purpose: 'route-launch',
|
|
89
|
+
source_launch: null,
|
|
90
|
+
replay: [],
|
|
91
|
+
prelude: [],
|
|
92
|
+
task_preconditions: [],
|
|
93
|
+
action: routeAction(node),
|
|
94
|
+
status: 'compiled',
|
|
95
|
+
compile_issues: [],
|
|
96
|
+
provenance: { hybrid_route: { route, reason: pyStr(get(opts, 'reason',
|
|
97
|
+
'uni-app page: direct route jump (uni.reLaunch); no clickable static trigger required')) } },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Group hybrid nodes into requirement-free `p0-routes*` phases (chunked so a runner's
|
|
103
|
+
* max-tasks cap never starves them) and register the phases in `doc`. Returns [{id, nodes}].
|
|
104
|
+
*/
|
|
105
|
+
export function ensureRoutePhases(doc, nodes, perPhase = 80) {
|
|
106
|
+
const want = [];
|
|
107
|
+
const seen = new Set();
|
|
108
|
+
for (const n of nodes) {
|
|
109
|
+
if (!isHybridPageNode(n)) { continue; }
|
|
110
|
+
if (get(n, 'denominator') === false || get(n, 'out_of_scope') || get(n, 'status') === 'unreachable') { continue; }
|
|
111
|
+
// Older static graphs predate the denominator flag: still refuse component/overlay routes.
|
|
112
|
+
if (isNonNavigable(n)) { continue; }
|
|
113
|
+
const id = pyStr(get(n, 'id'));
|
|
114
|
+
if (seen.has(id)) { continue; }
|
|
115
|
+
seen.add(id);
|
|
116
|
+
want.push(n);
|
|
117
|
+
}
|
|
118
|
+
if (!want.length) { return []; }
|
|
119
|
+
want.sort((a, b) => pyStr(get(a, 'route')).localeCompare(pyStr(get(b, 'route'))));
|
|
120
|
+
const size = Math.max(1, Number(perPhase) || 80);
|
|
121
|
+
const phases = get(doc, 'phases', []);
|
|
122
|
+
if (!Array.isArray(phases)) { doc.phases = []; }
|
|
123
|
+
const list = doc.phases;
|
|
124
|
+
const out = [];
|
|
125
|
+
let maxOrder = list.reduce((m, p) => Math.max(m, Number(get(p, 'order', 0)) || 0), 0);
|
|
126
|
+
const idFor = (j) => (j === 0 ? 'p0-routes' : `p0-routes-${j + 1}`);
|
|
127
|
+
for (let i = 0, j = 0; i < want.length; i += size, j += 1) {
|
|
128
|
+
const chunk = want.slice(i, i + size);
|
|
129
|
+
const id = idFor(j);
|
|
130
|
+
let phase = list.find((p) => pyStr(get(p, 'id')) === id) || null;
|
|
131
|
+
if (phase === null) {
|
|
132
|
+
maxOrder += 1;
|
|
133
|
+
phase = { id, order: maxOrder, environment: 'default', requires: [], depends_on: [],
|
|
134
|
+
obligations: [], status: 'pending' };
|
|
135
|
+
list.push(phase);
|
|
136
|
+
}
|
|
137
|
+
out.push({ id, nodes: chunk, environment: pyStr(get(phase, 'environment', 'default')), requires: [] });
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* occludedIndices, treePackage, resolvePage, _SCREEN_KINDS, _shareRowContainer,
|
|
7
7
|
* _hostCompatible, _toolbarTitleCandidates, _selectedTabCandidates,
|
|
8
8
|
* _ownWidgetCandidates, _overlayLeadTitleCandidates, OVERLAY_KINDS, androidUnescape, androidValue, decodeAndroidString,
|
|
9
|
-
* panelHost, observationMatchesStatic
|
|
9
|
+
* panelHost, observationMatchesStatic, _hybridRouteOf, _hybridRouteResolution, _hybridModalOpen
|
|
10
10
|
*
|
|
11
11
|
* Python sets become JS Sets in insertion order. Where Python iterated a set of strings to
|
|
12
12
|
* build an ordered result (only `_toolbarTitleCandidates`, whose order Python leaves to the
|
|
@@ -169,12 +169,19 @@ export function buildCatalog(graph, project = null, locale = 'en') {
|
|
|
169
169
|
component: truthy(g(expected, 'component')) ? g(expected, 'component') : g(expected, 'activity'),
|
|
170
170
|
basis: [], entry_labels: [] };
|
|
171
171
|
item.component = component;
|
|
172
|
+
// uni-app page: its route is what the runtime's page WebView reports as its text (_hybridRouteOf).
|
|
173
|
+
if (item.kind === 'hybrid-page') {
|
|
174
|
+
item.route = truthy(g(n, 'route')) ? S(n.route) : null;
|
|
175
|
+
item.appid = truthy(g(n, 'appid')) ? S(n.appid) : null;
|
|
176
|
+
}
|
|
172
177
|
const links = g(graph, 'links', g(graph, 'edges', []));
|
|
173
178
|
item.hosts_static_pages = links.some((e) => g(e, 'source') === ident && g(e, 'target') !== ident
|
|
174
179
|
&& !S(g(e, 'target', '')).startsWith('activity:'));
|
|
175
180
|
// Static openers: the pages with an edge into this one (used to tell layout twins apart).
|
|
176
181
|
item.opened_from = sortedStr(new Set(links.filter((e) => g(e, 'target') === ident && truthy(g(e, 'source'))
|
|
177
182
|
&& g(e, 'source') !== ident).map((e) => S(g(e, 'source')))));
|
|
183
|
+
// the parameterized template an instance node was made from (a2h-utg-static compose_overlay)
|
|
184
|
+
if (truthy(g(n, 'template_of'))) { item.template_of = S(g(n, 'template_of')); }
|
|
178
185
|
item.default_children = sortedStr(new Set(links.filter((e) => g(e, 'source') === ident && g(e, 'target') !== ident
|
|
179
186
|
&& !S(g(e, 'target', '')).startsWith('activity:')
|
|
180
187
|
&& (g(g(e, 'args') || {}, 'action') === 'default' || g(e, 'mechanism') === 'fragment-embed')
|
|
@@ -632,7 +639,8 @@ const textSet = (nodes, pred) => {
|
|
|
632
639
|
// resolvePage(obs, catalog, identity, 'pkg') (positional), or resolvePage(obs, catalog, {configured_identity, app_package}).
|
|
633
640
|
export function resolvePage(observation, catalog, configuredIdentity = null, opts = null) {
|
|
634
641
|
let appPackage = null;
|
|
635
|
-
|
|
642
|
+
let skipHybrid = false;
|
|
643
|
+
if (typeof opts === 'string') { appPackage = opts; } else if (opts && typeof opts === 'object') { appPackage = opts.app_package ?? null; skipHybrid = opts._skip_hybrid === true; }
|
|
636
644
|
if (configuredIdentity && typeof configuredIdentity === 'object' && !Array.isArray(configuredIdentity)
|
|
637
645
|
&& ('configured_identity' in configuredIdentity || 'app_package' in configuredIdentity)) {
|
|
638
646
|
appPackage = configuredIdentity.app_package ?? appPackage;
|
|
@@ -645,6 +653,24 @@ export function resolvePage(observation, catalog, configuredIdentity = null, opt
|
|
|
645
653
|
if (truthy(appPackage) && truthy(pkg) && pkg !== appPackage) {
|
|
646
654
|
return { status: 'foreign-package', candidates: [], package: pkg };
|
|
647
655
|
}
|
|
656
|
+
// A uni-app page names itself: the runtime's page WebView carries its route as text. It runs before
|
|
657
|
+
// the configured anchors, which read every stacked page WebView (the hidden tab pages too).
|
|
658
|
+
const hybrid = skipHybrid ? null : _hybridRouteResolution(g(observation, 'nodes', []), catalog);
|
|
659
|
+
if (hybrid) {
|
|
660
|
+
// A native dialog over the WebViews (showModal, an action sheet, a permission prompt): the route
|
|
661
|
+
// names the page behind it, not the screen. The other tiers may name the overlay, but never a page
|
|
662
|
+
// (they would read the hidden tab WebViews too). The same route in several bundles (a host app and
|
|
663
|
+
// a UniMP; the WebView text carries no appid): the other tiers may pick among the route's owners.
|
|
664
|
+
const modal = _hybridModalOpen(observation);
|
|
665
|
+
if (!modal && hybrid.status !== 'ambiguous') { return hybrid; }
|
|
666
|
+
const owners = hybrid.status === 'ambiguous' ? hybrid.candidates.map((c) => c.static_id) : [];
|
|
667
|
+
const accept = (id) => (modal ? OVERLAY_KINDS.includes(g(g(catalog, id, {}), 'kind')) : owners.includes(id));
|
|
668
|
+
const rest = resolvePage(observation, catalog, ci, { app_package: appPackage, _skip_hybrid: true });
|
|
669
|
+
if (g(rest, 'status') === 'verified' && accept(rest.static_id)) {
|
|
670
|
+
return { ...rest, reason: 'hybrid-webview-route+' + rest.reason, webview_route: hybrid.webview_route };
|
|
671
|
+
}
|
|
672
|
+
return modal ? { status: 'unmapped', candidates: [], webview_route: hybrid.webview_route, overlay_open: true } : hybrid;
|
|
673
|
+
}
|
|
648
674
|
if (g(ci, 'status') === 'verified' && Object.hasOwn(catalog, configuredId)) {
|
|
649
675
|
return { status: 'verified', static_id: configuredId, reason: 'configured-positive-anchor', anchors: [...g(ci, 'basis', [])] };
|
|
650
676
|
}
|
|
@@ -671,6 +697,104 @@ export function resolvePage(observation, catalog, configuredIdentity = null, opt
|
|
|
671
697
|
return verdict;
|
|
672
698
|
}
|
|
673
699
|
|
|
700
|
+
// A uni-app page WebView's text: `<route>[<webview id>]` (pages/mine/mine[4],
|
|
701
|
+
// team/baseTeam/pages/enterprise/enterprise-index[2]).
|
|
702
|
+
const HYBRID_ROUTE = /^([A-Za-z0-9_.@-]+(?:\/[A-Za-z0-9_.@-]+)+)\[\d+\]$/;
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* _hybridRouteOf(nodes) -> the route of the uni-app page shown, or null. The runtime stacks one
|
|
706
|
+
* WebView per open page (tab pages stay loaded behind the current one) and reports every one as
|
|
707
|
+
* visible. The page on top is the one whose branch draws last where the branches part: the higher
|
|
708
|
+
* `drawing-order` of the two ancestors below their common one. Dump order does not tell it.
|
|
709
|
+
* Measured (app_uni_harmony): a 我的收藏 capture dumped collect-category[4] first, under a
|
|
710
|
+
* ViewGroup drawn 5th, then the tab pages customIndex[2] / mine[3] under a FrameLayout drawn 4th;
|
|
711
|
+
* the screenshot showed 我的收藏. Without drawing orders, the later in dump order wins.
|
|
712
|
+
*/
|
|
713
|
+
export function _hybridRouteOf(nodes) {
|
|
714
|
+
// Every visible WebView with an area takes part in the stacking, routed or not: a pushed page still
|
|
715
|
+
// loading (empty text) is on top, and the routed tab page below it is not the screen.
|
|
716
|
+
const routes = [];
|
|
717
|
+
nodes.forEach((n, i) => {
|
|
718
|
+
if (!S(g(n, 'class', '')).endsWith('WebView') || !vis(n)) { return; }
|
|
719
|
+
const b = g(n, 'bounds', null);
|
|
720
|
+
if (Array.isArray(b) && b.length === 4 && (b[2] <= b[0] || b[3] <= b[1])) { return; }
|
|
721
|
+
const m = HYBRID_ROUTE.exec(S(g(n, 'text', '')).trim());
|
|
722
|
+
routes.push([i, m ? m[1] : null]);
|
|
723
|
+
});
|
|
724
|
+
if (!routes.some(([, r]) => r !== null)) { return null; }
|
|
725
|
+
const chain = (i) => {
|
|
726
|
+
const out = [];
|
|
727
|
+
for (let k = i, guard = 0; inRange(k, nodes) && guard < 256; k = parentOf(nodes[k]), guard++) { out.unshift(k); }
|
|
728
|
+
return out;
|
|
729
|
+
};
|
|
730
|
+
const order = (k) => {
|
|
731
|
+
const v = Number.parseInt(S(g(nodes[k], 'drawing-order', g(nodes[k], 'drawing_order', ''))), 10);
|
|
732
|
+
return Number.isFinite(v) ? v : null;
|
|
733
|
+
};
|
|
734
|
+
// b above a?
|
|
735
|
+
const above = (a, b) => {
|
|
736
|
+
const ca = chain(a); const cb = chain(b);
|
|
737
|
+
let d = 0;
|
|
738
|
+
while (d < ca.length && d < cb.length && ca[d] === cb[d]) { d++; }
|
|
739
|
+
const oa = d < ca.length ? order(ca[d]) : null;
|
|
740
|
+
const ob = d < cb.length ? order(cb[d]) : null;
|
|
741
|
+
return oa !== null && ob !== null && oa !== ob ? ob > oa : b > a;
|
|
742
|
+
};
|
|
743
|
+
// A WebView drawn inside a routed page WebView's subtree (a <web-view> component) belongs to that page.
|
|
744
|
+
const routed = routes.filter(([, r]) => r !== null);
|
|
745
|
+
const owner = (i) => routed.find(([j]) => j !== i && chain(i).includes(j));
|
|
746
|
+
const pages = routes.filter(([i, r]) => r !== null || owner(i) === undefined);
|
|
747
|
+
let top = pages[0];
|
|
748
|
+
for (const r of pages.slice(1)) { if (above(top[0], r[0])) { top = r; } }
|
|
749
|
+
// Top WebView without a route (still loading): this tier does not decide.
|
|
750
|
+
return top[1];
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* A native modal window shown over the page WebViews: uni.showModal / showActionSheet, a permission
|
|
755
|
+
* prompt. Its dump still lists the page WebViews as visible, so the route would name the page behind
|
|
756
|
+
* it. Read from visible nodes only: the modal ids _ownWidgetCandidates reads, plus an id that starts
|
|
757
|
+
* with `dialog` / `alert` (dialog_title, alert_message), not one that only mentions it (btn_dialog_close).
|
|
758
|
+
*/
|
|
759
|
+
const _MODAL_IDS = ['alertTitle', 'parentPanel', 'design_bottom_sheet', 'permission_message'];
|
|
760
|
+
export function _hybridModalOpen(observation) {
|
|
761
|
+
const nodes = g(observation, 'nodes', []);
|
|
762
|
+
// Ancestors of the page WebViews (a host `dialog_container` holding them) are page chrome, not a modal.
|
|
763
|
+
const hosts = new Set();
|
|
764
|
+
nodes.forEach((n, i) => {
|
|
765
|
+
if (!S(g(n, 'class', '')).endsWith('WebView')) { return; }
|
|
766
|
+
for (let k = i, guard = 0; inRange(k, nodes) && guard < 256; k = parentOf(nodes[k]), guard++) { hosts.add(k); }
|
|
767
|
+
});
|
|
768
|
+
return g(observation, 'window') === 'dialog' || nodes.some((n, i) => {
|
|
769
|
+
if (!vis(n)) { return false; }
|
|
770
|
+
const id = tail(S(g(n, 'resource_id', '')));
|
|
771
|
+
return _MODAL_IDS.includes(id) || (/^(?:dialog|alert)(?:_|$)/i.test(id) && !hosts.has(i));
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* _hybridRouteResolution(nodes, catalog) -> a resolution from the shown uni-app route, or null when
|
|
777
|
+
* the catalog has no hybrid page or no page WebView names a route. A route no catalog page owns is
|
|
778
|
+
* unmapped: the other tiers would read the stacked pages behind it.
|
|
779
|
+
*/
|
|
780
|
+
export function _hybridRouteResolution(nodes, catalog) {
|
|
781
|
+
const pages = Object.entries(catalog).filter(([, p]) => g(p, 'kind') === 'hybrid-page');
|
|
782
|
+
if (!pages.length) { return null; }
|
|
783
|
+
const route = _hybridRouteOf(nodes);
|
|
784
|
+
if (!route) { return null; }
|
|
785
|
+
const owners = pages.filter(([ident, p]) => (truthy(g(p, 'route'))
|
|
786
|
+
? S(p.route).replace(/^\/+/, '') === route : ident.replace(/^hybrid-page:[^/]+\//, '') === route)).map(([ident]) => ident);
|
|
787
|
+
const anchors = ['webview-route:' + route];
|
|
788
|
+
if (owners.length === 1) {
|
|
789
|
+
return { status: 'verified', static_id: owners[0], reason: 'hybrid-webview-route', anchors, webview_route: route };
|
|
790
|
+
}
|
|
791
|
+
if (owners.length > 1) {
|
|
792
|
+
return { status: 'ambiguous', webview_route: route,
|
|
793
|
+
candidates: sortedStr(owners).map((static_id) => ({ static_id, reason: 'hybrid-webview-route', anchors })) };
|
|
794
|
+
}
|
|
795
|
+
return { status: 'unmapped', candidates: [], webview_route: route };
|
|
796
|
+
}
|
|
797
|
+
|
|
674
798
|
/** resolvePage's source-anchor tiers (after configured and learned rules). */
|
|
675
799
|
function _resolveBySource(observation, nodes, catalog) {
|
|
676
800
|
const rid = (n) => S(g(n, 'resource_id', ''));
|
|
@@ -1170,9 +1294,19 @@ export function resolveTwinByOpener(resolution, prior, catalog) {
|
|
|
1170
1294
|
const weak = g(resolution, 'status') === 'unmapped' ? (g(resolution, 'weak_candidates') || []) : [];
|
|
1171
1295
|
if (weak.length) { return _weakByOpener(resolution, weak, prior, catalog); }
|
|
1172
1296
|
const cands = truthy(g(resolution, 'candidates')) ? resolution.candidates : [];
|
|
1173
|
-
|
|
1297
|
+
let kind = cands.length ? g(cands[0], 'reason') : null;
|
|
1298
|
+
// Instances of one template (`template_of`) that show one title (a cancel-reason sheet opened from
|
|
1299
|
+
// three pages): matched alike by any rule, they are twins when each has its own openers, none shared.
|
|
1300
|
+
// Measured (coolmall 2026-11-16): `overlay-lead-title-alone` on all three left the sheet unmapped.
|
|
1301
|
+
if (g(resolution, 'status') === 'ambiguous' && cands.length >= 2 && !['layout-twin', 'shared-title-twin'].includes(kind)
|
|
1302
|
+
&& cands.every((c) => g(c, 'reason') === kind)) {
|
|
1303
|
+
const tpl = new Set(cands.map((c) => g(g(catalog, g(c, 'static_id'), {}), 'template_of') ?? null));
|
|
1304
|
+
const ops = cands.map((c) => new Set(g(g(catalog, g(c, 'static_id'), {}), 'opened_from', []) || []));
|
|
1305
|
+
const disjoint = ops.every((s) => s.size) && ops.every((s, i) => ops.every((t, j) => i === j || ![...s].some((x) => t.has(x))));
|
|
1306
|
+
if (tpl.size === 1 && !tpl.has(null) && disjoint) { kind = 'layout-twin'; }
|
|
1307
|
+
}
|
|
1174
1308
|
if (g(resolution, 'status') !== 'ambiguous' || cands.length < 2 || !['layout-twin', 'shared-title-twin'].includes(kind)
|
|
1175
|
-
|| !cands.every((c) => g(c, 'reason') ===
|
|
1309
|
+
|| !cands.every((c) => g(c, 'reason') === cands[0].reason)) {
|
|
1176
1310
|
return resolution;
|
|
1177
1311
|
}
|
|
1178
1312
|
const pr = g(prior || {}, 'static_resolution', {});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* state_phase.mjs — best-effort execution of a state phase that has no fixture/probe.
|
|
3
|
+
*
|
|
4
|
+
* A static plan puts pages behind login/content/data guards. When the campaign config carries no
|
|
5
|
+
* fixture and no probe for that state, the phase blocks: D (recover_d.mjs) then proposes a recipe
|
|
6
|
+
* for it and close_phases.mjs reports it. For a uni-app / hybrid app the fallback instead runs the
|
|
7
|
+
* phase's tasks against the current, verified device state and records that no probe was used.
|
|
8
|
+
*
|
|
9
|
+
* The fallback is on by default only for hybrid apps (isHybridApp). A native app keeps the
|
|
10
|
+
* blocking default: a best-effort run there would spend the task's only attempt
|
|
11
|
+
* (max_task_attempts=1) and settle the phase, so D would never produce its recipe. An explicit
|
|
12
|
+
* `state_phase_fallback: true|false` overrides the default either way.
|
|
13
|
+
*/
|
|
14
|
+
import { get, truthy, pyStr } from './_py.mjs';
|
|
15
|
+
import { isHybridPageNode } from './hybrid_route.mjs';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A uni-app / hybrid app: its launcher is a hybrid page, or every page in the denominator is one
|
|
19
|
+
* (a pre-bundled APK whose native host activity is denominator:false). A native app that merely
|
|
20
|
+
* embeds some hybrid pages is not one.
|
|
21
|
+
*/
|
|
22
|
+
export function isHybridApp(doc) {
|
|
23
|
+
const nodes = Array.isArray(get(doc, 'nodes')) ? doc.nodes : [];
|
|
24
|
+
if (nodes.some((n) => isHybridPageNode(n) && (truthy(get(n, 'is_launcher')) || truthy(get(n, 'entry'))))) { return true; }
|
|
25
|
+
const pages = nodes.filter((n) => get(n, 'denominator') !== false && !truthy(get(n, 'out_of_scope')));
|
|
26
|
+
return pages.length > 0 && pages.every(isHybridPageNode);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** config.state_phase_fallback when set; otherwise on for a hybrid app (doc) and off for a native one. */
|
|
30
|
+
export function statePhaseFallbackEnabled(config, doc = null) {
|
|
31
|
+
const v = get(config, 'state_phase_fallback');
|
|
32
|
+
if (v !== undefined && v !== null) { return v !== false; }
|
|
33
|
+
return isHybridApp(doc);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Whether a phase with `requires` but no configured probes may run against the current device
|
|
38
|
+
* state. Returns null when it must still block, else the scope string recorded in the
|
|
39
|
+
* environment_verified event.
|
|
40
|
+
*/
|
|
41
|
+
export function fallbackScope(config, phase, probes, doc = null) {
|
|
42
|
+
if (!truthy(get(phase, 'requires'))) { return 'existing state, no guard assumed'; }
|
|
43
|
+
if (truthy(probes)) { return null; }
|
|
44
|
+
if (!statePhaseFallbackEnabled(config, doc)) { return null; }
|
|
45
|
+
return 'best-effort: no state probe configured; current device state (' +
|
|
46
|
+
(get(phase, 'requires', []) || []).map(pyStr).join(', ') + ')';
|
|
47
|
+
}
|
|
@@ -107,15 +107,19 @@ export function stringFiles(project) {
|
|
|
107
107
|
const _STRING_EL = /<string\s+name="([^"]+)"[^>]*>([\s\S]*?)<\/string>/g;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* loadStringTables(project, locale) -> {device: Map(key -> device-locale value),
|
|
111
|
-
* Map(normalized value in any locale -> Set(keys))}. Which file
|
|
112
|
-
* best locale rank (valuesDirRank); at equal rank the `main` source
|
|
113
|
-
* shares (a variant's own value is added by
|
|
114
|
-
* sets, the first in path order. Never the
|
|
110
|
+
* loadStringTables(project, locale) -> {device: Map(key -> device-locale value), deviceAll:
|
|
111
|
+
* Map(key -> Set(values)), keysByValue: Map(normalized value in any locale -> Set(keys))}. Which file
|
|
112
|
+
* gives a key its device value: the best locale rank (valuesDirRank); at equal rank the `main` source
|
|
113
|
+
* set, which every build variant shares (a variant's own value is added by
|
|
114
|
+
* semantics._variantOverrides); between two other source sets, the first in path order. Never the
|
|
115
|
+
* scan order. `deviceAll`: every value a key has at that best score. Two modules may define one key
|
|
116
|
+
* differently (coolmall `phone_number`: 「手机号码」 in feature/user, 「手机号」 in feature/main); the
|
|
117
|
+
* build keeps one of them by its library merge order, which a file walk does not know, so every
|
|
118
|
+
* value stays a candidate.
|
|
115
119
|
*/
|
|
116
120
|
export function loadStringTables(project, locale) {
|
|
117
|
-
const device = new Map(); const best = new Map(); const keysByValue = new Map();
|
|
118
|
-
if (!truthy(project)) { return { device, keysByValue }; }
|
|
121
|
+
const device = new Map(); const deviceAll = new Map(); const best = new Map(); const keysByValue = new Map();
|
|
122
|
+
if (!truthy(project)) { return { device, deviceAll, keysByValue }; }
|
|
119
123
|
for (const [dir, file] of stringFiles(project)) {
|
|
120
124
|
const r = valuesDirRank(path.basename(dir), locale);
|
|
121
125
|
const score = r < 0 ? -1 : 2 * r + (sourceSetOf(dir) === 'main' ? 1 : 0);
|
|
@@ -127,10 +131,11 @@ export function loadStringTables(project, locale) {
|
|
|
127
131
|
const nv = normalized(value);
|
|
128
132
|
if (!keysByValue.has(nv)) { keysByValue.set(nv, new Set()); }
|
|
129
133
|
keysByValue.get(nv).add(key);
|
|
130
|
-
if (score >= 0 && score > (best.get(key) ?? -1)) { device.set(key, value); best.set(key, score); }
|
|
134
|
+
if (score >= 0 && score > (best.get(key) ?? -1)) { device.set(key, value); best.set(key, score); deviceAll.set(key, new Set()); }
|
|
135
|
+
if (score >= 0 && score === best.get(key)) { deviceAll.get(key).add(value); }
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
|
-
return { device, keysByValue };
|
|
138
|
+
return { device, deviceAll, keysByValue };
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
/** Most device-locale texts one source text may stand for (a value several keys share). */
|
|
@@ -138,16 +143,20 @@ export const MAX_DEVICE_TEXTS = 3;
|
|
|
138
143
|
|
|
139
144
|
/**
|
|
140
145
|
* deviceTextsIn(tables, text, keys=[]) -> the device-locale text(s) of `text` written in any app
|
|
141
|
-
* locale, never `text` itself. A known resource key of that value is exact
|
|
142
|
-
* carrying the value is a candidate; when they translate
|
|
143
|
-
* MAX_DEVICE_TEXTS) are returned, beyond that none.
|
|
146
|
+
* locale, never `text` itself. A known resource key of that value is exact (each of its
|
|
147
|
+
* `deviceAll` values). Otherwise every key carrying the value is a candidate; when they translate
|
|
148
|
+
* differently all (at most MAX_DEVICE_TEXTS) are returned, beyond that none.
|
|
144
149
|
*/
|
|
145
150
|
export function deviceTextsIn(tables, text, keys = []) {
|
|
146
151
|
const nt = normalized(text);
|
|
147
152
|
const owners = tables.keysByValue.get(nt);
|
|
148
153
|
if (!owners) { return []; }
|
|
149
154
|
const out = [];
|
|
150
|
-
const push = (k) => {
|
|
155
|
+
const push = (k) => {
|
|
156
|
+
for (const d of (tables.deviceAll ?? new Map()).get(k) ?? [tables.device.get(k)]) {
|
|
157
|
+
if (truthy(d) && normalized(d) !== nt && !out.includes(d)) { out.push(d); }
|
|
158
|
+
}
|
|
159
|
+
};
|
|
151
160
|
for (const k of keys) { if (truthy(k) && owners.has(S(k))) { push(S(k)); } }
|
|
152
161
|
if (out.length) { return out; }
|
|
153
162
|
for (const k of sortedStr(owners)) { push(k); }
|