@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,316 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Merge one incremental run's mapping document into the project-level resource mapping document.
|
|
4
|
+
*
|
|
5
|
+
* Why: incremental mode writes its mapping to <work>/converter_mapping.md, but every consumer
|
|
6
|
+
* (a2h-batch-ui-align Step 4.3 Lottie grep, group_pack.mjs HarmonyRes) reads
|
|
7
|
+
* ${harmony_project_dir}/.hometrans/resource_mapping.md. Without a merge, a project that never ran
|
|
8
|
+
* full mode has no mapping at all, and one that did sees a stale mapping without this run's rows.
|
|
9
|
+
*
|
|
10
|
+
* Merge rules (base = --into, add = --from):
|
|
11
|
+
* - Keyed tables are merged row by row; every other part of base is kept verbatim.
|
|
12
|
+
* Resource Inventory key = Android Resource Path + Resource Name
|
|
13
|
+
* Mapping Details key = Android Resource Path (all rows of a path are replaced
|
|
14
|
+
* together, so a one-to-many conversion or a former
|
|
15
|
+
* `unmappable` N/A row never lingers next to the new targets)
|
|
16
|
+
* Lottie Animation Resources key = Android Source
|
|
17
|
+
* Compose Material Icons key = Compose reference
|
|
18
|
+
* Rows of add replace base rows with the same key at the first base position; new keys are
|
|
19
|
+
* appended at the end of the table. Base rows whose key add does not have are kept.
|
|
20
|
+
* - A keyed section base lacks is inserted from add where the full converter writes it (Lottie after
|
|
21
|
+
* "4.4 Runtime Remote Resources", icons before "Quick Findings"; at the end when base has no such
|
|
22
|
+
* heading); a keyed section base has without a table
|
|
23
|
+
* (e.g. "icons not run") is replaced by add's section.
|
|
24
|
+
* - Metadata gets one provenance line per merge.
|
|
25
|
+
* - base missing: add is copied as-is (plus the provenance line).
|
|
26
|
+
* - Summary sections (4.x counts, Quick Findings) stay base's: they are not recomputed.
|
|
27
|
+
*
|
|
28
|
+
* Usage:
|
|
29
|
+
* node merge_mapping.ts --into <resource_mapping.md> --from <converter_mapping.md>
|
|
30
|
+
*
|
|
31
|
+
* Prints one JSON line: {into, created, tables: {<kind>: {added, updated, kept}}, appended: [...]}.
|
|
32
|
+
* Exit codes: 0 merged; 1 a keyed table's header (column names and order, case and spacing aside)
|
|
33
|
+
* differs between the two documents; 2 usage error.
|
|
34
|
+
*
|
|
35
|
+
* Zero third-party dependencies. Requires Node >= 22.18 (native strip-types).
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
import * as fs from 'node:fs';
|
|
39
|
+
import * as path from 'node:path';
|
|
40
|
+
import { fileURLToPath } from 'node:url';
|
|
41
|
+
|
|
42
|
+
type Kind = 'inventory' | 'mapping' | 'lottie' | 'icons';
|
|
43
|
+
|
|
44
|
+
/** Heading substrings shared by the zh and en documents (the zh headings carry the English name too). */
|
|
45
|
+
const MARKERS: ReadonlyArray<[Kind, string]> = [
|
|
46
|
+
['inventory', 'Resource Inventory'],
|
|
47
|
+
['mapping', 'Mapping Details'],
|
|
48
|
+
['lottie', 'Lottie Animation Resources'],
|
|
49
|
+
['icons', 'Compose Material Icons'],
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const KEY_COLS: Record<Kind, number[]> = {
|
|
53
|
+
inventory: [0, 1],
|
|
54
|
+
mapping: [0],
|
|
55
|
+
lottie: [0],
|
|
56
|
+
icons: [0],
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
interface Block {
|
|
60
|
+
/** heading line index */
|
|
61
|
+
start: number;
|
|
62
|
+
/** exclusive: next heading of the same or a higher level, or EOF */
|
|
63
|
+
end: number;
|
|
64
|
+
level: number;
|
|
65
|
+
table: { header: number; rowStart: number; rowEnd: number } | null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface Parsed {
|
|
69
|
+
lines: string[];
|
|
70
|
+
blocks: Map<Kind, Block>;
|
|
71
|
+
metadataEnd: number | null;
|
|
72
|
+
/** where a keyed section base lacks goes, so it lands where the full converter writes it */
|
|
73
|
+
anchors: Partial<Record<Kind, number>>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Lottie goes after "4.4 Runtime Remote Resources" (the converter writes it there); icons go before
|
|
78
|
+
* "Quick Findings". A document without the anchor heading gets the section at its end.
|
|
79
|
+
*/
|
|
80
|
+
const ANCHORS: ReadonlyArray<[Kind, RegExp, 'after' | 'before']> = [
|
|
81
|
+
['lottie', /^#{1,6}\s+4\.4\s/, 'after'],
|
|
82
|
+
['icons', /Quick Findings/, 'before'],
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
export class MergeError extends Error {}
|
|
86
|
+
|
|
87
|
+
function headingLevel(line: string): number {
|
|
88
|
+
const m = /^(#{1,6})\s/.exec(line);
|
|
89
|
+
return m ? m[1].length : 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function kindOf(line: string): Kind | null {
|
|
93
|
+
for (const [k, marker] of MARKERS) if (line.includes(marker)) return k;
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Split a markdown table row into trimmed cells, honouring `\|` escapes. */
|
|
98
|
+
export function cells(row: string): string[] {
|
|
99
|
+
const t = row.trim().replace(/^\|/, '').replace(/(?<!\\)\|$/, '');
|
|
100
|
+
return t.split(/(?<!\\)\|/).map((c) => c.trim());
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Header cells as compared: case and spacing do not matter. `Host Layout` is the Lottie column's name in
|
|
105
|
+
* documents written from lottie-conversion-rules.md before the converter emitted the table itself.
|
|
106
|
+
*/
|
|
107
|
+
const HEADER_ALIASES: Record<string, string> = { 'host layout': 'host layout / loader' };
|
|
108
|
+
export function headerCells(row: string): string[] {
|
|
109
|
+
return cells(row).map((c) => {
|
|
110
|
+
const n = c.replace(/\s+/g, ' ').trim().toLowerCase();
|
|
111
|
+
return HEADER_ALIASES[n] ?? n;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function rowKey(kind: Kind, row: string): string {
|
|
116
|
+
const c = cells(row);
|
|
117
|
+
return KEY_COLS[kind].map((i) => c[i] ?? '').join('\u0000');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function parse(text: string): Parsed {
|
|
121
|
+
const lines = text.replace(/\r\n/g, '\n').split('\n');
|
|
122
|
+
const blocks = new Map<Kind, Block>();
|
|
123
|
+
let metadataEnd: number | null = null;
|
|
124
|
+
const headings: Array<[number, number]> = [];
|
|
125
|
+
lines.forEach((l, i) => { const lv = headingLevel(l); if (lv) headings.push([i, lv]); });
|
|
126
|
+
|
|
127
|
+
headings.forEach(([idx, lv], hi) => {
|
|
128
|
+
let end = lines.length;
|
|
129
|
+
for (let j = hi + 1; j < headings.length; j++) {
|
|
130
|
+
if (headings[j][1] <= lv) { end = headings[j][0]; break; }
|
|
131
|
+
}
|
|
132
|
+
if (metadataEnd === null && lv === 2 && /元数据|Metadata/.test(lines[idx])) {
|
|
133
|
+
// the metadata list ends at the first sub-heading or blank line after its items
|
|
134
|
+
let k = idx + 1;
|
|
135
|
+
while (k < end && lines[k].trim() === '') k++;
|
|
136
|
+
while (k < end && lines[k].startsWith('- ')) k++;
|
|
137
|
+
metadataEnd = k;
|
|
138
|
+
}
|
|
139
|
+
const kind = kindOf(lines[idx]);
|
|
140
|
+
if (!kind || blocks.has(kind)) return;
|
|
141
|
+
let table: Block['table'] = null;
|
|
142
|
+
for (let k = idx + 1; k < end; k++) {
|
|
143
|
+
if (headingLevel(lines[k])) break; // a sub-heading's table belongs to that sub-heading
|
|
144
|
+
if (lines[k].startsWith('|') && lines[k + 1]?.startsWith('|') && /^\|[\s|:-]+\|?$/.test(lines[k + 1].trim())) {
|
|
145
|
+
let r = k + 2;
|
|
146
|
+
while (r < end && lines[r].startsWith('|')) r++;
|
|
147
|
+
table = { header: k, rowStart: k + 2, rowEnd: r };
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
blocks.set(kind, { start: idx, end, level: lv, table });
|
|
152
|
+
});
|
|
153
|
+
const anchors: Parsed['anchors'] = {};
|
|
154
|
+
headings.forEach(([idx, lv], hi) => {
|
|
155
|
+
for (const [kind, re, where] of ANCHORS) {
|
|
156
|
+
if (anchors[kind] !== undefined || !re.test(lines[idx])) continue;
|
|
157
|
+
if (where === 'before') { anchors[kind] = idx; continue; }
|
|
158
|
+
let end = lines.length;
|
|
159
|
+
for (let j = hi + 1; j < headings.length; j++) {
|
|
160
|
+
if (headings[j][1] <= lv) { end = headings[j][0]; break; }
|
|
161
|
+
}
|
|
162
|
+
anchors[kind] = end;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return { lines, blocks, metadataEnd, anchors };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface TableStats { added: number; updated: number; kept: number }
|
|
169
|
+
|
|
170
|
+
export interface MergeResult {
|
|
171
|
+
text: string;
|
|
172
|
+
created: boolean;
|
|
173
|
+
tables: Partial<Record<Kind, TableStats>>;
|
|
174
|
+
appended: Kind[];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function provenance(zh: boolean, from: string, at: string, stats: Partial<Record<Kind, TableStats>>): string {
|
|
178
|
+
const m = stats.mapping ?? { added: 0, updated: 0, kept: 0 };
|
|
179
|
+
return zh
|
|
180
|
+
? `- 增量合并:${from},${at}(映射明细 新增 ${m.added} / 更新 ${m.updated})`
|
|
181
|
+
: `- Incremental merge: ${from}, ${at} (mapping details: ${m.added} added / ${m.updated} updated)`;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Merge `addText` into `baseText` (null: no base document yet). Pure; throws MergeError. */
|
|
185
|
+
export function mergeMapping(baseText: string | null, addText: string, from: string, at: string): MergeResult {
|
|
186
|
+
const add = parse(addText);
|
|
187
|
+
if (baseText === null) {
|
|
188
|
+
const zh = addText.includes('元数据');
|
|
189
|
+
const out = [...add.lines];
|
|
190
|
+
const stats: Partial<Record<Kind, TableStats>> = {};
|
|
191
|
+
for (const [k, b] of add.blocks) {
|
|
192
|
+
if (b.table) stats[k] = { added: b.table.rowEnd - b.table.rowStart, updated: 0, kept: 0 };
|
|
193
|
+
}
|
|
194
|
+
if (add.metadataEnd !== null) out.splice(add.metadataEnd, 0, provenance(zh, from, at, stats));
|
|
195
|
+
return { text: out.join('\n'), created: true, tables: stats, appended: [] };
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const base = parse(baseText);
|
|
199
|
+
const zh = baseText.includes('元数据');
|
|
200
|
+
// Edits are planned against base line indices, then applied bottom-up so indices stay valid.
|
|
201
|
+
// ord: document order of insertions sharing one index (Lottie before icons when both anchor at "## 6")
|
|
202
|
+
const edits: Array<{ at: number; del: number; ins: string[]; ord?: number }> = [];
|
|
203
|
+
const tail: string[] = [];
|
|
204
|
+
const stats: Partial<Record<Kind, TableStats>> = {};
|
|
205
|
+
const appended: Kind[] = [];
|
|
206
|
+
|
|
207
|
+
for (const [kind, ab] of add.blocks) {
|
|
208
|
+
const bb = base.blocks.get(kind);
|
|
209
|
+
const addBlock = add.lines.slice(ab.start, ab.end);
|
|
210
|
+
if (!bb) {
|
|
211
|
+
if (!ab.table) continue; // nothing worth appending (e.g. "icons not run")
|
|
212
|
+
while (addBlock.length && addBlock[addBlock.length - 1].trim() === '') addBlock.pop();
|
|
213
|
+
const anchor = base.anchors[kind];
|
|
214
|
+
if (anchor !== undefined && anchor < base.lines.length) {
|
|
215
|
+
const lead = anchor > 0 && base.lines[anchor - 1].trim() !== '' ? [''] : [];
|
|
216
|
+
edits.push({ at: anchor, del: 0, ins: [...lead, ...addBlock, ''], ord: ANCHORS.findIndex(([k]) => k === kind) });
|
|
217
|
+
} else {
|
|
218
|
+
tail.push('', ...addBlock);
|
|
219
|
+
}
|
|
220
|
+
appended.push(kind);
|
|
221
|
+
stats[kind] = { added: ab.table.rowEnd - ab.table.rowStart, updated: 0, kept: 0 };
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (!ab.table) continue; // add has no rows for it: base stays
|
|
225
|
+
if (!bb.table) {
|
|
226
|
+
edits.push({ at: bb.start, del: bb.end - bb.start, ins: addBlock });
|
|
227
|
+
stats[kind] = { added: ab.table.rowEnd - ab.table.rowStart, updated: 0, kept: 0 };
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
// same columns in the same order, or rows would land under the wrong column
|
|
231
|
+
const bh = headerCells(base.lines[bb.table.header]);
|
|
232
|
+
const ah = headerCells(add.lines[ab.table.header]);
|
|
233
|
+
const diff = bh.length !== ah.length ? -1 : bh.findIndex((c, i) => c !== ah[i]);
|
|
234
|
+
if (bh.length !== ah.length || diff >= 0) {
|
|
235
|
+
throw new MergeError(bh.length !== ah.length
|
|
236
|
+
? `${kind} table header differs: base has ${bh.length} columns, add has ${ah.length}`
|
|
237
|
+
: `${kind} table header differs at column ${diff + 1}: base "${bh[diff]}", add "${ah[diff]}"`);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const addRows = add.lines.slice(ab.table.rowStart, ab.table.rowEnd);
|
|
241
|
+
const byKey = new Map<string, string[]>();
|
|
242
|
+
for (const r of addRows) {
|
|
243
|
+
const k = rowKey(kind, r);
|
|
244
|
+
if (!byKey.has(k)) byKey.set(k, []);
|
|
245
|
+
byKey.get(k)!.push(r);
|
|
246
|
+
}
|
|
247
|
+
const out: string[] = [];
|
|
248
|
+
const placed = new Set<string>();
|
|
249
|
+
let updated = 0;
|
|
250
|
+
let kept = 0;
|
|
251
|
+
for (const r of base.lines.slice(bb.table.rowStart, bb.table.rowEnd)) {
|
|
252
|
+
const k = rowKey(kind, r);
|
|
253
|
+
if (!byKey.has(k)) { out.push(r); kept++; continue; }
|
|
254
|
+
if (!placed.has(k)) { out.push(...byKey.get(k)!); placed.add(k); updated += byKey.get(k)!.length; }
|
|
255
|
+
}
|
|
256
|
+
let added = 0;
|
|
257
|
+
for (const [k, rows] of byKey) {
|
|
258
|
+
if (!placed.has(k)) { out.push(...rows); added += rows.length; }
|
|
259
|
+
}
|
|
260
|
+
edits.push({ at: bb.table.rowStart, del: bb.table.rowEnd - bb.table.rowStart, ins: out });
|
|
261
|
+
stats[kind] = { added, updated, kept };
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (base.metadataEnd !== null) {
|
|
265
|
+
edits.push({ at: base.metadataEnd, del: 0, ins: [provenance(zh, from, at, stats)] });
|
|
266
|
+
}
|
|
267
|
+
const lines = [...base.lines];
|
|
268
|
+
// bottom-up; at one index a replacement goes first, so an insertion there lands before it, not inside
|
|
269
|
+
for (const e of edits.sort((a, b) => b.at - a.at || b.del - a.del || (b.ord ?? 0) - (a.ord ?? 0))) {
|
|
270
|
+
lines.splice(e.at, e.del, ...e.ins);
|
|
271
|
+
}
|
|
272
|
+
if (tail.length) {
|
|
273
|
+
while (lines.length && lines[lines.length - 1].trim() === '') lines.pop();
|
|
274
|
+
lines.push(...tail, '');
|
|
275
|
+
}
|
|
276
|
+
return { text: lines.join('\n'), created: false, tables: stats, appended };
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function main(): void {
|
|
280
|
+
const argv = process.argv.slice(2);
|
|
281
|
+
const args: Record<string, string> = {};
|
|
282
|
+
for (let i = 0; i < argv.length; i += 2) {
|
|
283
|
+
if (!argv[i].startsWith('--') || argv[i + 1] === undefined) {
|
|
284
|
+
console.error('usage: node merge_mapping.ts --into <resource_mapping.md> --from <converter_mapping.md>');
|
|
285
|
+
process.exit(2);
|
|
286
|
+
}
|
|
287
|
+
args[argv[i].slice(2)] = argv[i + 1];
|
|
288
|
+
}
|
|
289
|
+
const { into, from } = args;
|
|
290
|
+
if (!into || !from) {
|
|
291
|
+
console.error('usage: node merge_mapping.ts --into <resource_mapping.md> --from <converter_mapping.md>');
|
|
292
|
+
process.exit(2);
|
|
293
|
+
}
|
|
294
|
+
if (!fs.existsSync(from)) {
|
|
295
|
+
console.error(`[merge_mapping] --from does not exist: ${from}`);
|
|
296
|
+
process.exit(2);
|
|
297
|
+
}
|
|
298
|
+
const baseText = fs.existsSync(into) ? fs.readFileSync(into, 'utf8') : null;
|
|
299
|
+
let res: MergeResult;
|
|
300
|
+
try {
|
|
301
|
+
res = mergeMapping(baseText, fs.readFileSync(from, 'utf8'), path.basename(from), new Date().toISOString());
|
|
302
|
+
} catch (e) {
|
|
303
|
+
if (e instanceof MergeError) { console.error(`[merge_mapping] ${e.message}; ${into} left unchanged`); process.exit(1); }
|
|
304
|
+
throw e;
|
|
305
|
+
}
|
|
306
|
+
fs.mkdirSync(path.dirname(path.resolve(into)), { recursive: true });
|
|
307
|
+
// write-then-rename: a crash mid-write must not truncate the project-level document
|
|
308
|
+
const tmp = `${into}.tmp-${process.pid}`;
|
|
309
|
+
fs.writeFileSync(tmp, res.text, 'utf8');
|
|
310
|
+
fs.renameSync(tmp, into);
|
|
311
|
+
console.log(JSON.stringify({ into: path.resolve(into), created: res.created, tables: res.tables, appended: res.appended }));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
315
|
+
main();
|
|
316
|
+
}
|
|
@@ -625,7 +625,8 @@ function main(argv: string[]): void {
|
|
|
625
625
|
process.exit(errors > 0 || (strict && warns > 0) ? 1 : 0);
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
-
|
|
628
|
+
// realpath: import.meta.url is the resolved path, argv[1] may go through a symlink/junction (skill installed by link)
|
|
629
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(fs.realpathSync(process.argv[1])).href) {
|
|
629
630
|
main(process.argv.slice(2));
|
|
630
631
|
}
|
|
631
632
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// code_vector_icons: the transparent guard box of upstream Material SVGs must be stripped in every spelling.
|
|
2
|
+
// Left in place, HarmonyOS .fillColor() paints it into a solid 24x24 block that hides the icon.
|
|
3
|
+
// Run from scripts/: node --test tests/code_vector_guard.test.mjs
|
|
4
|
+
import { test } from 'node:test';
|
|
5
|
+
import assert from 'node:assert/strict';
|
|
6
|
+
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as os from 'node:os';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
import { stripGuardBox } from '../code_vector_icons.ts';
|
|
12
|
+
|
|
13
|
+
const SCRIPTS = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
14
|
+
|
|
15
|
+
const HEAD = '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">';
|
|
16
|
+
|
|
17
|
+
test('strips the <path> guard box (both spellings)', () => {
|
|
18
|
+
for (const g of ['<path d="M0 0h24v24H0z" fill="none"/>', '<path d="M0 0h24v24H0V0z" fill="none"/>']) {
|
|
19
|
+
assert.equal(stripGuardBox(`${HEAD}${g}<path d="M1 1h2z"/></svg>`), `${HEAD}<path d="M1 1h2z"/></svg>`);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('strips the <rect> guard box and its now-empty <g> (read_more upstream form)', () => {
|
|
24
|
+
const src = `${HEAD}<g><rect fill="none" height="24" width="24"/></g><g><g><rect height="2" width="9" x="13" y="7"/></g></g></svg>`;
|
|
25
|
+
assert.equal(stripGuardBox(src), `${HEAD}<g><g><rect height="2" width="9" x="13" y="7"/></g></g></svg>`);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('keeps rects that are drawn or do not cover the viewBox', () => {
|
|
29
|
+
const kept = [
|
|
30
|
+
'<rect height="2" width="9" x="13" y="7"/>',
|
|
31
|
+
'<rect fill="none" x="2" y="2" width="24" height="24"/>',
|
|
32
|
+
'<rect fill="none" width="20" height="24"/>',
|
|
33
|
+
'<rect fill="#000" width="24" height="24"/>',
|
|
34
|
+
];
|
|
35
|
+
for (const r of kept) {
|
|
36
|
+
assert.equal(stripGuardBox(`${HEAD}${r}</svg>`), `${HEAD}${r}</svg>`, r);
|
|
37
|
+
}
|
|
38
|
+
assert.equal(stripGuardBox(`${HEAD}<rect fill="none" x="0" y="0" width="24" height="24"/></svg>`), `${HEAD}</svg>`);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('keeps a stroked full-size rect: it is a visible border, not a guard box', () => {
|
|
42
|
+
const border = '<rect fill="none" stroke="#000" stroke-width="2" width="24" height="24"/>';
|
|
43
|
+
assert.equal(stripGuardBox(`${HEAD}${border}</svg>`), `${HEAD}${border}</svg>`);
|
|
44
|
+
// stroke="none" draws nothing, so that rect is still a guard box
|
|
45
|
+
assert.equal(stripGuardBox(`${HEAD}<rect fill="none" stroke="none" width="24" height="24"/></svg>`), `${HEAD}</svg>`);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('removes every <g> left empty, nested or with attributes', () => {
|
|
49
|
+
const src = `${HEAD}<g><g><rect fill="none" width="24" height="24"/></g></g><g fill="none"><g></g></g><path d="M1 1z"/></svg>`;
|
|
50
|
+
assert.equal(stripGuardBox(src), `${HEAD}<path d="M1 1z"/></svg>`);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// A skill installed by symlink/junction: import.meta.url is the resolved path while argv[1] is the link.
|
|
54
|
+
// The entry check used to compare them raw, so main() silently never ran and the script exited 0.
|
|
55
|
+
test('runs main() when invoked through a directory link', (t) => {
|
|
56
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'cvi-link-'));
|
|
57
|
+
const link = path.join(tmp, 'scripts');
|
|
58
|
+
try {
|
|
59
|
+
try {
|
|
60
|
+
fs.symlinkSync(SCRIPTS, link, process.platform === 'win32' ? 'junction' : 'dir');
|
|
61
|
+
} catch (e) {
|
|
62
|
+
t.skip(`cannot create a directory link here: ${e.message}`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
for (const name of ['code_vector_icons.ts', 'svg_fidelity_check.ts']) {
|
|
66
|
+
const r = spawnSync(process.execPath, [path.join(link, name)], { encoding: 'utf8' });
|
|
67
|
+
assert.equal(r.status, 2, `${name} via link: exit ${r.status}, stderr=${r.stderr}`);
|
|
68
|
+
assert.match(r.stderr, /required|missing/, name);
|
|
69
|
+
}
|
|
70
|
+
} finally {
|
|
71
|
+
// Remove only the link itself, never recurse through it into the real scripts/ dir
|
|
72
|
+
fs.unlinkSync(link);
|
|
73
|
+
fs.rmdirSync(tmp);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// lottie_hosts: every Lottie JSON is bound to the Android screen that plays it, through Compose indirection.
|
|
2
|
+
// Run from scripts/: node --test tests/lottie_hosts.test.mjs
|
|
3
|
+
import { test } from 'node:test';
|
|
4
|
+
import assert from 'node:assert/strict';
|
|
5
|
+
import * as fs from 'node:fs';
|
|
6
|
+
import * as os from 'node:os';
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import { bindLottieHosts, isLottie, markdownRows, normalizeLottieName, toHarmonyPage } from '../lottie_hosts.ts';
|
|
9
|
+
|
|
10
|
+
const LOTTIE = JSON.stringify({ v: '5.7.4', fr: 30, ip: 0, op: 60, w: 100, h: 100, layers: [] });
|
|
11
|
+
|
|
12
|
+
function project(files) {
|
|
13
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'lottie-hosts-'));
|
|
14
|
+
for (const [rel, src] of Object.entries(files)) {
|
|
15
|
+
fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
|
|
16
|
+
fs.writeFileSync(path.join(root, rel), src, 'utf8');
|
|
17
|
+
}
|
|
18
|
+
return root;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function bindAll(files) {
|
|
22
|
+
const root = project(files);
|
|
23
|
+
try { return bindLottieHosts(root); } finally { fs.rmSync(root, { recursive: true, force: true }); }
|
|
24
|
+
}
|
|
25
|
+
const bind = bindAll;
|
|
26
|
+
|
|
27
|
+
const byName = (anims) => Object.fromEntries(anims.map((a) => [a.name, a]));
|
|
28
|
+
const screens = (a) => a.hosts.map((h) => h.screen).sort();
|
|
29
|
+
|
|
30
|
+
const SRC = 'feature/main/src/main/java/a';
|
|
31
|
+
const RAW = 'feature/main/src/main/res/raw';
|
|
32
|
+
|
|
33
|
+
test('enum resource id → composable taking an Int → screen that calls it (the CoolMall bottom tabs)', () => {
|
|
34
|
+
const anims = byName(bind({
|
|
35
|
+
[`${RAW}/home.json`]: LOTTIE,
|
|
36
|
+
[`${RAW}/me.json`]: LOTTIE,
|
|
37
|
+
[`${SRC}/model/TopLevelDestination.kt`]: `package a
|
|
38
|
+
enum class TopLevelDestination(
|
|
39
|
+
@param:StringRes val titleTextId: Int,
|
|
40
|
+
@param:RawRes val animationResId: Int,
|
|
41
|
+
) {
|
|
42
|
+
HOME(titleTextId = R.string.home, animationResId = R.raw.home),
|
|
43
|
+
ME(titleTextId = R.string.me, animationResId = R.raw.me)
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
[`${SRC}/component/BottomNavigationBar.kt`]: `package a
|
|
47
|
+
@Composable
|
|
48
|
+
fun BottomNavigationBar(destinations: List<TopLevelDestination>, current: Int) {
|
|
49
|
+
Row {
|
|
50
|
+
destinations.forEachIndexed { i, d -> TabLottieAnimation(animRes = d.animationResId, isSelected = i == current) }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@Composable
|
|
55
|
+
private fun TabLottieAnimation(animRes: Int, isSelected: Boolean) {
|
|
56
|
+
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(animRes))
|
|
57
|
+
LottieAnimation(composition = composition)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Preview
|
|
61
|
+
@Composable
|
|
62
|
+
fun BarPreview() {
|
|
63
|
+
BottomNavigationBar(destinations = TopLevelDestination.entries, current = 0)
|
|
64
|
+
}
|
|
65
|
+
`,
|
|
66
|
+
[`${SRC}/view/MainScreen.kt`]: `package a
|
|
67
|
+
@Composable
|
|
68
|
+
internal fun MainRoute() { MainScreen() }
|
|
69
|
+
|
|
70
|
+
@Composable
|
|
71
|
+
internal fun MainScreen() {
|
|
72
|
+
Scaffold(bottomBar = { BottomNavigationBar(destinations = TopLevelDestination.entries, current = 0) }) { }
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
}));
|
|
76
|
+
for (const n of ['home', 'me']) {
|
|
77
|
+
assert.equal(anims[n].status, 'bound');
|
|
78
|
+
assert.deepEqual(screens(anims[n]), ['MainScreen']);
|
|
79
|
+
assert.equal(anims[n].hosts[0].page, 'MainPage');
|
|
80
|
+
assert.equal(anims[n].load_path, `lottie/${n}.json`);
|
|
81
|
+
assert.ok(anims[n].hosts[0].chain.some((c) => c.includes('BottomNavigationBar')));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('a direct R.raw reference inside a screen, and a helper climbed through its call site', () => {
|
|
86
|
+
const anims = byName(bind({
|
|
87
|
+
[`${RAW}/loading.json`]: LOTTIE,
|
|
88
|
+
[`${RAW}/success.json`]: LOTTIE,
|
|
89
|
+
[`${SRC}/LoginScreen.kt`]: `package a
|
|
90
|
+
@Composable
|
|
91
|
+
fun LoginScreen() {
|
|
92
|
+
val c by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.loading))
|
|
93
|
+
LottieAnimation(c)
|
|
94
|
+
Done()
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@Composable
|
|
98
|
+
private fun Done() {
|
|
99
|
+
LottieAnimation(rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.success)).value)
|
|
100
|
+
}
|
|
101
|
+
`,
|
|
102
|
+
}));
|
|
103
|
+
assert.deepEqual(screens(anims.loading), ['LoginScreen']);
|
|
104
|
+
assert.deepEqual(screens(anims.success), ['LoginScreen']);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('a layout lottie_rawRes is bound to the Activity inflating it, by R.layout or by its ViewBinding', () => {
|
|
108
|
+
const anims = byName(bind({
|
|
109
|
+
[`${RAW}/wave.json`]: LOTTIE,
|
|
110
|
+
[`${RAW}/spin.json`]: LOTTIE,
|
|
111
|
+
'app/src/main/res/layout/activity_splash.xml': '<FrameLayout>\n <com.airbnb.lottie.LottieAnimationView app:lottie_rawRes="@raw/wave" />\n</FrameLayout>\n',
|
|
112
|
+
'app/src/main/res/layout/fragment_loading_panel.xml': '<FrameLayout>\n <com.airbnb.lottie.LottieAnimationView app:lottie_rawRes="@raw/spin" />\n</FrameLayout>\n',
|
|
113
|
+
'app/src/main/java/a/SplashActivity.kt': 'package a\nclass SplashActivity : AppCompatActivity() {\n override fun onCreate(b: Bundle?) {\n setContentView(R.layout.activity_splash)\n }\n}\n',
|
|
114
|
+
'app/src/main/java/a/LoadingFragment.kt': 'package a\nclass LoadingFragment : Fragment() {\n private val binding by lazy { FragmentLoadingPanelBinding.inflate(layoutInflater) }\n}\n',
|
|
115
|
+
}));
|
|
116
|
+
assert.deepEqual(screens(anims.wave), ['SplashActivity']);
|
|
117
|
+
assert.equal(anims.wave.hosts[0].page, 'SplashPage');
|
|
118
|
+
assert.deepEqual(screens(anims.spin), ['LoadingFragment']);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('an assets/ literal is bound; the same name in a comment is not a reference', () => {
|
|
122
|
+
const anims = byName(bind({
|
|
123
|
+
'app/src/main/assets/confetti.json': LOTTIE,
|
|
124
|
+
'app/src/main/java/a/PayResultFragment.kt': `package a
|
|
125
|
+
class PayResultFragment : Fragment() {
|
|
126
|
+
// was "confetti.json" in the old design
|
|
127
|
+
fun show() { binding.anim.setAnimation("confetti.json") }
|
|
128
|
+
}
|
|
129
|
+
`,
|
|
130
|
+
}));
|
|
131
|
+
assert.deepEqual(screens(anims.confetti), ['PayResultFragment']);
|
|
132
|
+
assert.equal(anims.confetti.refs.length, 1);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test('references only in previews or comments leave the animation unreferenced; no screen reached is unresolved', () => {
|
|
136
|
+
const anims = byName(bind({
|
|
137
|
+
[`${RAW}/a.json`]: LOTTIE,
|
|
138
|
+
[`${RAW}/b.json`]: LOTTIE,
|
|
139
|
+
[`${SRC}/Demo.kt`]: `package a
|
|
140
|
+
// R.raw.a was used here
|
|
141
|
+
@Preview
|
|
142
|
+
@Composable
|
|
143
|
+
fun APreview() { LottieAnimation(rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.a)).value) }
|
|
144
|
+
|
|
145
|
+
@Composable
|
|
146
|
+
fun Orphan() { LottieAnimation(rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.b)).value) }
|
|
147
|
+
`,
|
|
148
|
+
}));
|
|
149
|
+
assert.equal(anims.a.status, 'unreferenced');
|
|
150
|
+
assert.equal(anims.b.status, 'unresolved');
|
|
151
|
+
assert.equal(anims.b.refs.length, 1);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test('only JSON with the Lottie signature counts', () => {
|
|
155
|
+
assert.equal(isLottie(LOTTIE), true);
|
|
156
|
+
assert.equal(isLottie(JSON.stringify({ v: 1, fr: 30, ip: 0, op: 1, w: 1, h: 1 })), false);
|
|
157
|
+
assert.equal(isLottie('{"layers": []}'), false);
|
|
158
|
+
assert.equal(isLottie('not json'), false);
|
|
159
|
+
assert.deepEqual(bind({ [`${RAW}/config.json`]: '{"a":1}' }), []);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
test('markdown rows carry host, page and load path; an unbound animation stays Unknown with the reason', () => {
|
|
163
|
+
const md = markdownRows([
|
|
164
|
+
{ name: 'home', source: 'res/raw/home.json', load_path: 'lottie/home.json', status: 'bound', refs: ['M.kt:3'],
|
|
165
|
+
hosts: [{ screen: 'MainScreen', page: 'MainPage', file: 'MainScreen.kt', line: 9, chain: ['R.raw.home at M.kt:3', 'in TopLevelDestination'] }] },
|
|
166
|
+
{ name: 'x', source: 'res/raw/x.json', load_path: 'lottie/x.json', status: 'unreferenced', refs: [], hosts: [] },
|
|
167
|
+
]);
|
|
168
|
+
const rows = md.trim().split('\n');
|
|
169
|
+
assert.equal(rows.length, 4);
|
|
170
|
+
assert.match(rows[2], /^\| res\/raw\/home\.json \| rawfile\/lottie\/home\.json \| MainScreen \| R\.raw\.home at M\.kt:3 \| MainPage \| load_path=lottie\/home\.json;/);
|
|
171
|
+
assert.match(rows[3], /\| Unknown \| N\/A \| Unknown \| no static references found/);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
test('load_path is the normalized rawfile name, with the assets/raw collision prefix', () => {
|
|
175
|
+
assert.equal(normalizeLottieName('Loading Spinner 1.json'), 'loading_spinner_1.json');
|
|
176
|
+
assert.equal(normalizeLottieName('01-intro.json'), 'lottie_01_intro.json');
|
|
177
|
+
assert.equal(normalizeLottieName('WaveAnim.json'), 'waveanim.json');
|
|
178
|
+
assert.equal(normalizeLottieName('__a--b__.json'), 'a_b.json');
|
|
179
|
+
const anims = byName(bind({
|
|
180
|
+
'app/src/main/assets/Loading Spinner 1.json': LOTTIE,
|
|
181
|
+
'app/src/main/assets/01-intro.json': LOTTIE,
|
|
182
|
+
'app/src/main/assets/logo.json': LOTTIE,
|
|
183
|
+
[`${RAW}/logo.json`]: LOTTIE,
|
|
184
|
+
'app/src/main/java/a/IntroActivity.kt': `package a
|
|
185
|
+
class IntroActivity : AppCompatActivity() {
|
|
186
|
+
fun show() {
|
|
187
|
+
anim.setAnimation("Loading Spinner 1.json")
|
|
188
|
+
intro.setAnimation("01-intro.json")
|
|
189
|
+
LottieCompositionFactory.fromRawRes(this, R.raw.logo)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
`,
|
|
193
|
+
}));
|
|
194
|
+
assert.equal(anims['Loading Spinner 1'].load_path, 'lottie/loading_spinner_1.json');
|
|
195
|
+
assert.deepEqual(screens(anims['Loading Spinner 1']), ['IntroActivity']);
|
|
196
|
+
assert.equal(anims['01-intro'].load_path, 'lottie/lottie_01_intro.json');
|
|
197
|
+
const logos = bindAll({
|
|
198
|
+
'app/src/main/assets/logo.json': LOTTIE,
|
|
199
|
+
[`${RAW}/logo.json`]: LOTTIE,
|
|
200
|
+
}).map((a) => a.load_path).sort();
|
|
201
|
+
assert.deepEqual(logos, ['lottie/assets_logo.json', 'lottie/raw_logo.json']);
|
|
202
|
+
const md = markdownRows([anims['01-intro']]);
|
|
203
|
+
assert.match(md, /rawfile\/lottie\/lottie_01_intro\.json/);
|
|
204
|
+
assert.match(md, /renamed from "01-intro\.json"/);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
test('test source sets are skipped, a package named test or out is not', () => {
|
|
208
|
+
const anims = byName(bind({
|
|
209
|
+
[`${RAW}/a.json`]: LOTTIE,
|
|
210
|
+
[`${RAW}/b.json`]: LOTTIE,
|
|
211
|
+
'app/src/test/java/a/AScreenTest.kt': 'package a\nfun FakeScreen() { LottieAnimation(rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.a)).value) }\n',
|
|
212
|
+
'app/src/main/java/com/x/test/out/PlayScreen.kt': 'package a\n@Composable\nfun PlayScreen() { LottieAnimation(rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.b)).value) }\n',
|
|
213
|
+
}));
|
|
214
|
+
assert.equal(anims.a.status, 'unreferenced');
|
|
215
|
+
assert.deepEqual(screens(anims.b), ['PlayScreen']);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test('page names follow the shared suffix rule', () => {
|
|
219
|
+
assert.equal(toHarmonyPage('MainScreen'), 'MainPage');
|
|
220
|
+
assert.equal(toHarmonyPage('SplashActivity'), 'SplashPage');
|
|
221
|
+
assert.equal(toHarmonyPage('CouponSheet'), 'CouponPage');
|
|
222
|
+
});
|