@buaa_smat/hometrans 26.0.2 → 26.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/agents/code-reviewer.md +25 -138
- package/dist/cli/index.js +4 -1
- package/dist/cli/init.js +131 -26
- package/dist/cli/uninstall.js +5 -5
- package/dist/platform/language.js +77 -0
- package/env-requirements.json +30 -5
- package/i18n/FILE-NAMES.md +9 -0
- package/i18n/agents/code-reviewer.md +364 -0
- package/i18n/agents/model-render-worker.md +38 -0
- package/i18n/agents/specgen-worker.md +18 -0
- package/i18n/commands/hometrans.md +17 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +198 -0
- package/i18n/skills/a2h-app-migrate/references/config.example.json +28 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +19 -0
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +50 -0
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +1760 -0
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +114 -0
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1588 -0
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +657 -0
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +541 -0
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +131 -0
- package/i18n/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
- package/i18n/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/i18n/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
- package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +698 -0
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
- package/i18n/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/i18n/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +219 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -0
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/i18n/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/i18n/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +171 -0
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/i18n/skills/a2h-arch-generate/SKILL.md +375 -0
- package/i18n/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
- package/i18n/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
- package/i18n/skills/a2h-arch-generate/references/arkts-mvvm-v2.md +1407 -0
- package/i18n/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
- package/i18n/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
- package/i18n/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
- package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
- package/i18n/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
- package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
- package/i18n/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
- package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +120 -0
- package/i18n/skills/a2h-arch-generate/references/source-baseline.md +93 -0
- package/i18n/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +360 -0
- package/i18n/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +798 -0
- package/i18n/skills/a2h-arch-generate/scripts/lib/contract_terms.mjs +40 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/generate.mjs +639 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1261 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
- package/i18n/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +851 -0
- package/i18n/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +982 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +9 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +192 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +303 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/design/move_spec_technical_reference.mjs +162 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +298 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +587 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/test_check_units.ts +149 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +352 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +323 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +31 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/build.md +13 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +17 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +27 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +80 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +22 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +87 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/state-v1.md +29 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +14 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +57 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +29 -0
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +705 -0
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +417 -0
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +139 -0
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2549 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +560 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +148 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +220 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +28 -0
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +216 -0
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +203 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +210 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +2005 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +1748 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/detect_paradigm.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1787 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/gen_rule_docs.mjs +100 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1836 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/image_probe.mjs +405 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1406 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1226 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1220 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +412 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/cli.ts +134 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +18 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +173 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +629 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +125 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +67 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/block_comment_break.ts +64 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +134 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_call_sites.ts +242 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +136 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/canvas.ts +255 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/column_shrink.ts +154 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +39 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/container_align.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_root_builtin.ts +69 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_route.ts +114 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/fixed_size_safe_area.ts +103 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/format_string.ts +157 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +551 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +374 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/offset_in_scroll.ts +163 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/orphan_component.ts +119 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/page_reachability.ts +94 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/path_commands_vp.ts +50 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +80 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +137 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/r_template_string.ts +37 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/request_permission.ts +98 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/resource_as_string.ts +68 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +97 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sdk_api.ts +195 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shared_chrome.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_blur.ts +95 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shell_content.ts +198 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/stack_occluding.ts +118 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_decorators.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_name_shadows.ts +93 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/string_quote_leak.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/surface_stroke.ts +50 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/track_getter.ts +132 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +67 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +560 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +470 -0
- package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +59 -0
- package/i18n/skills/a2h-dashboard-render/SKILL.md +73 -0
- package/i18n/skills/a2h-dashboard-render/references/artifact-contract.jsonc +117 -0
- package/i18n/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
- package/i18n/skills/a2h-dashboard-render/references/dashboard-guide.md +91 -0
- package/i18n/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
- package/i18n/skills/a2h-dashboard-render/scripts/dashboard.mjs +3245 -0
- package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +2048 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/i18n/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +154 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/i18n/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/i18n/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
- package/i18n/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/i18n/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- package/i18n/skills/a2h-fix-build-errors/SKILL.md +304 -0
- package/i18n/skills/a2h-fix-build-errors/references/arkts-strict-patterns.md +219 -0
- package/i18n/skills/a2h-fix-build-errors/references/rdb-entity-pattern.md +131 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +227 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/i18n/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/i18n/skills/a2h-page-specgen/SKILL.md +136 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +177 -0
- package/i18n/skills/a2h-page-specgen/references/gates.md +262 -0
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +173 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +207 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +576 -0
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +138 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +262 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +176 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +248 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +506 -0
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +299 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +616 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1166 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +8 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +7 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +8 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +54 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +271 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +83 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +77 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +419 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +511 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1765 -0
- package/i18n/skills/a2h-resource-convert/SKILL.md +367 -0
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +335 -0
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +251 -0
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +219 -0
- package/i18n/skills/a2h-resource-convert/references/resource-mapping-rules.md +493 -0
- package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +249 -0
- package/i18n/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +2532 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +278 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +260 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +163 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +44 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +589 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +506 -0
- package/i18n/skills/a2h-spec-generate/SKILL.md +375 -0
- package/i18n/skills/a2h-spec-generate/references/batch-mode.md +215 -0
- package/i18n/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
- package/i18n/skills/a2h-spec-generate/references/fusion-task-contract.md +184 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +27 -0
- package/i18n/skills/a2h-spec-generate/references/library-evidence.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/method-discipline.md +64 -0
- package/i18n/skills/a2h-spec-generate/references/optional-gates.json +45 -0
- package/i18n/skills/a2h-spec-generate/references/recall-guide.md +84 -0
- package/i18n/skills/a2h-spec-generate/references/recall-terse.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
- package/i18n/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
- package/i18n/skills/a2h-spec-generate/references/review-checklist.md +22 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
- package/i18n/skills/a2h-spec-generate/references/spec-samples.md +65 -0
- package/i18n/skills/a2h-spec-generate/references/specs.schema.json +85 -0
- package/i18n/skills/a2h-spec-generate/references/synthesis-rules.md +145 -0
- package/i18n/skills/a2h-spec-generate/references/transfer-file.md +5 -0
- package/i18n/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
- package/i18n/skills/a2h-spec-generate/references/worker-rules.md +129 -0
- package/i18n/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +702 -0
- package/i18n/skills/a2h-spec-generate/scripts/check_spec.ts +515 -0
- package/i18n/skills/a2h-spec-generate/scripts/collect-specs.mjs +727 -0
- package/i18n/skills/a2h-spec-generate/scripts/feature-stem.mjs +151 -0
- package/i18n/skills/a2h-spec-generate/scripts/parse_requirements.ts +515 -0
- package/i18n/skills/a2h-spec-generate/scripts/prepare-facts.mjs +313 -0
- package/i18n/skills/a2h-spec-generate/scripts/publish-specs.mjs +354 -0
- package/i18n/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +669 -0
- package/i18n/skills/a2h-spec-generate/scripts/render-tasks.mjs +385 -0
- package/i18n/skills/a2h-spec-generate/scripts/report.mjs +136 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1265 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1057 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +565 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +544 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +317 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +707 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +436 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +608 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +650 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +178 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +912 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +279 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +163 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +256 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +576 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +340 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1857 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +262 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +722 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/i18n/skills/a2h-spec-generate/template/REQ.txt +22 -0
- package/i18n/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
- package/i18n/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +847 -0
- package/i18n/skills/a2h-spec-generate/test/check-spec.test.ts +415 -0
- package/i18n/skills/a2h-spec-generate/test/collect-specs.test.mjs +808 -0
- package/i18n/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/i18n/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/i18n/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
- package/i18n/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
- package/i18n/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
- package/i18n/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
- package/i18n/skills/a2h-spec-generate/test/report.test.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/SKILL.md +120 -0
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +279 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +918 -0
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +446 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hint_check.mjs +147 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hint_source.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_b.mjs +550 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +380 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +492 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1412 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +2037 -0
- package/i18n/skills/a2h-utg-static/SKILL.md +368 -0
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
- package/i18n/skills/a2h-utg-static/references/view-interactions.md +215 -0
- package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +2120 -0
- package/i18n/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +609 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +250 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +374 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
- package/i18n/skills/a2h-utg-static/scripts/fragment_nav.mjs +1137 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +660 -0
- package/i18n/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +913 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +517 -0
- package/i18n/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
- package/i18n/skills/a2h-utg-static/scripts/static_prior.mjs +956 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +108 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +289 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_fresh_branch_guard.mjs +49 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +136 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +293 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +368 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +44 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_off_path.mjs +67 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +61 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_data_table.mjs +340 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_relative_url.mjs +125 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +231 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +340 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1351 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
- package/package.json +13 -160
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/skills/a2h-app-migrate/SKILL.md +17 -6
- package/skills/a2h-app-migrate/references/config.example.json +1 -0
- package/skills/a2h-app-migrate/references/stage-map.md +3 -1
- package/skills/a2h-app-migrate/references/workflow.yaml +138 -47
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +1 -2
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +105 -39
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +7 -8
- package/skills/a2h-app-migrate/scripts/ledger.mjs +17 -5
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +43 -7
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +127 -41
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +2 -0
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +38 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +131 -0
- package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +63 -0
- package/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
- package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/skills/a2h-app-migrate/test/test_devecocli_docs_preflight.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +102 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +698 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
- package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +68 -0
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +51 -0
- package/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +91 -0
- package/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +111 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_parse_args.mjs +69 -0
- package/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +219 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -0
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_acceptance.mjs +94 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +147 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +344 -0
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +83 -0
- package/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
- package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +41 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +178 -0
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/skills/a2h-arch-generate/SKILL.md +1 -1
- package/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
- package/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +15 -6
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +2 -2
- package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +35 -46
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +33 -40
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +2 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +11 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +12 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +17 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +14 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +10 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +6 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +16 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1260 -0
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +191 -0
- package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +52 -0
- package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +34 -0
- package/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +138 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +2 -5
- package/skills/a2h-arkts-logic-coder/SKILL.md +21 -2
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +1 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +62 -0
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +4 -0
- package/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +22 -25
- package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +583 -0
- package/skills/a2h-arkts-logic-coder/test/golden/inspect_happy.json +20 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
- package/skills/a2h-arkts-logic-coder/test/golden/resolve_cases.json +36 -0
- package/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
- package/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
- package/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
- package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +352 -0
- package/skills/a2h-batch-ui-align/SKILL.md +6 -4
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +1 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +22 -3
- package/skills/a2h-batch-ui-align/references/checker-rules.md +66 -3
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +45 -8
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -5
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +2 -2
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +4 -2
- package/skills/a2h-batch-ui-align/references/step5-convert.md +7 -5
- package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +6 -7
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +84 -7
- package/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +229 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1 -2
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +4 -5
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +88 -26
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +305 -12
- package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +231 -54
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +8 -9
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +18 -5
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +103 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +1 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +14 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +8 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +3 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +84 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +11 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +5 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +66 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +81 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +2 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +6 -0
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +235 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_safearea.test.mjs +742 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +91 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +86 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +567 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +290 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +74 -0
- package/skills/a2h-batch-ui-align/scripts/tests/detect_paradigm.test.mjs +260 -0
- package/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +244 -0
- package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +420 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +31 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
- package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1628 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +215 -0
- package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +297 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -0
- package/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
- package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +12 -14
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +29 -30
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +1 -0
- package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +203 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/skills/a2h-page-specgen/SKILL.md +136 -0
- package/skills/a2h-page-specgen/references/body-language.md +177 -0
- package/skills/a2h-page-specgen/references/evidence.md +70 -0
- package/skills/a2h-page-specgen/references/execution-model.md +255 -0
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +250 -0
- package/skills/a2h-page-specgen/references/gates.md +255 -0
- package/skills/a2h-page-specgen/references/page-inventory.md +173 -0
- package/skills/a2h-page-specgen/references/spec-template.md +207 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +209 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +422 -0
- package/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
- package/skills/a2h-page-specgen/scripts/gate.mjs +558 -0
- package/skills/a2h-page-specgen/scripts/interactions.mjs +137 -0
- package/skills/a2h-page-specgen/scripts/inventory.mjs +269 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +255 -0
- package/skills/a2h-page-specgen/scripts/lib/deps-source.mjs +399 -0
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +137 -0
- package/skills/a2h-page-specgen/scripts/lib/footprint-roles.mjs +278 -0
- package/skills/a2h-page-specgen/scripts/lib/fsx.mjs +79 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +175 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +234 -0
- package/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +391 -0
- package/skills/a2h-page-specgen/scripts/lib/symbols.mjs +125 -0
- package/skills/a2h-page-specgen/scripts/lib/utg-io.mjs +110 -0
- package/skills/a2h-page-specgen/scripts/lib/waker-event-store.mjs +658 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +492 -0
- package/skills/a2h-page-specgen/scripts/render.mjs +317 -0
- package/skills/a2h-page-specgen/scripts/report.mjs +7 -0
- package/skills/a2h-page-specgen/scripts/submission.mjs +532 -0
- package/skills/a2h-page-specgen/scripts/submit.mjs +79 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/README.md +77 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +590 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/cases.example.json +57 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +207 -0
- package/skills/a2h-page-specgen/scripts/test/dispatch.test.mjs +258 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1164 -0
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Api.kt +20 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/BothAnnotations.kt +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Cache.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Comments.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Mmkv.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Models.kt +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Pair.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Prefs.kt +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Room.kt +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Sample.kt +43 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Templates.kt +34 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Timeouts.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/androidTest/Helper.kt +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/build.gradle.kts +16 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/en.js.txt +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/libs.versions.toml +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/package.json +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values/strings.xml +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-land/strings.xml +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-night/strings.xml +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-v21/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/test/Legacy.kt +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/weather.proto +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/AppPreferences.kt +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/SettingsViewModel.kt +16 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-dao/src/UserDao.kt +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/base/strings.xml +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/fil/strings.xml +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/arrays.xml +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/strings.xml +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/xml/prefs.xml +27 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Api.java +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Datastore.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Settings.java +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/forecast.js +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/store.js +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/BasePreferences.kt +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/Screen.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/UiPreferences.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-retrofit/src/AuthAPI.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/AndroidManifest.xml +20 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/feature/auth/navigation/ScreenRoute.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/pages.json +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/components/Widget.vue +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/detail/detail.vue +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/index/index.vue +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/store/userStore.js +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/uni_modules/uview-ui/components/u-thing.js +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp.mkdb.mjs +144 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +94 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/MainFragment.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyListeners.java +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/PlainActivity.java +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/fold-chain/utg.json +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/utg.json +34 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-roles.test.mjs +172 -0
- package/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +54 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +222 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +45 -0
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +464 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +120 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +68 -0
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +390 -0
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +167 -0
- package/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +503 -0
- package/skills/a2h-page-specgen/scripts/test/source-text.test.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -0
- package/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/skills/a2h-page-specgen/scripts/test/waker-event-store.test.mjs +1365 -0
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1765 -0
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +1979 -0
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +313 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +1234 -0
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +298 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +49 -51
- package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +182 -0
- package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +206 -0
- package/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +79 -78
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +51 -12
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +24 -6
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +3 -2
- package/skills/a2h-spec-design-pipeline/references/initialization.md +15 -4
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +82 -41
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +61 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +19 -10
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +267 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +61 -8
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +62 -13
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +8 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +8 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +55 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +60 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/HttpExtraDataEmptyStringCheck.js +488 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +11 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +17 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +12 -38
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +40 -5
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +18 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +74 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +2 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +128 -5
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +98 -35
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +218 -37
- package/skills/a2h-spec-design-pipeline/scripts/lib/shared_classes.ts +113 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/shared_docs.ts +202 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/wiring.ts +58 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +6 -7
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +3 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +348 -0
- package/skills/a2h-spec-design-pipeline/scripts/scan_shared.ts +642 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +15 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +7 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +104 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +24 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +394 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +24 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +163 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +15 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +350 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_scan_shared.ts +996 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_classes.ts +80 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_docs.ts +205 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +121 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_e2e.ts +85 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_validate_shared_manifest.ts +720 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_wiring.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/validate_shared_manifest.ts +566 -0
- package/skills/a2h-spec-generate/SKILL.md +87 -21
- package/skills/a2h-spec-generate/references/batch-mode.md +78 -17
- package/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +7 -0
- package/skills/a2h-spec-generate/references/review-checklist.md +1 -0
- package/skills/a2h-spec-generate/references/synthesis-rules.md +4 -2
- package/skills/a2h-spec-generate/references/worker-rules.md +6 -3
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +4 -5
- package/skills/a2h-spec-generate/scripts/check_spec.ts +145 -14
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +261 -19
- package/skills/a2h-spec-generate/scripts/dispatch-watch.mjs +1168 -0
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +25 -46
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +26 -27
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +3 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +31 -32
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +2 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +15 -26
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +102 -81
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +39 -19
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +12 -13
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +35 -196
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +3 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +22 -96
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +3 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +1 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +74 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +51 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +42 -111
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +1 -20
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +3 -4
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +50 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +75 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +256 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/zip.ts +63 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +650 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-seed.test.ts +195 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +347 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1948 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-library-evidence.test.ts +239 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +277 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +844 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +117 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +175 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +286 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +25 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/zip.test.ts +61 -0
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +879 -0
- package/skills/a2h-spec-generate/test/check-spec.test.ts +430 -0
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +811 -0
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
- package/skills/a2h-spec-generate/test/dispatch-watch.test.mjs +606 -0
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +230 -0
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
- package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +8 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +6 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +4 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +8 -0
- package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +1 -0
- package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
- package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +182 -0
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
- package/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
- package/skills/a2h-spec-generate/test/report.test.mjs +47 -0
- package/skills/a2h-utg-explorer/references/architecture.md +4 -0
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +64 -80
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +1 -2
- package/skills/a2h-utg-explorer/scripts/recover.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +5 -3
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +244 -0
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
- package/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +104 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +231 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +160 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_identity.test.mjs +77 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +187 -0
- package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +137 -0
- package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +16 -0
- package/skills/a2h-utg-explorer/scripts/tests/fresh_state_plan.test.mjs +78 -0
- package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
- package/skills/a2h-utg-explorer/scripts/tests/holds_without_data_parity.test.mjs +26 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +492 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_failure.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +193 -0
- package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
- package/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +212 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +213 -0
- package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +454 -0
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +336 -0
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +142 -0
- package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/skills/a2h-utg-explorer/scripts/tests/string_tables_twin_ties.test.mjs +83 -0
- package/skills/a2h-utg-explorer/scripts/tests/tar_fixture.mjs +12 -0
- package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +346 -0
- package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +112 -0
- package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +24 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +13 -3
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +107 -65
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +155 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +28 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +19 -20
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +102 -2
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +2 -3
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +2 -3
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +1 -2
- package/skills/a2h-utg-static/scripts/route_interceptor.mjs +21 -7
- package/skills/a2h-utg-static/scripts/static_prior.mjs +26 -29
- package/skills/a2h-utg-static/scripts/tests/test_activity_gates.mjs +84 -0
- package/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +29 -1
- package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-app-migrate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-arch-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +0 -5
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +0 -54
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +0 -38
- package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-resource-convert/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +0 -70
- package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +0 -54
- package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-static/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/tests/test_i18n_term.mjs +0 -155
|
@@ -2136,6 +2136,82 @@ function _walkKt(project) {
|
|
|
2136
2136
|
return out;
|
|
2137
2137
|
}
|
|
2138
2138
|
|
|
2139
|
+
const _SET_CONTENT_RE = P(S`\bsetContent\s*\{`);
|
|
2140
|
+
const _GATE_ARM_RE = P(S`\b(?:else\s+)?if\s*\(|\belse\b(?!\s*if\b)`);
|
|
2141
|
+
/** The head of a brace-less arm: `if (showLanding) LandingScreen()`. */
|
|
2142
|
+
const _GATE_BARE_CALL_RE = /[A-Z]\w*\s*/y;
|
|
2143
|
+
/** A composable that builds the navigation graph is the regular content, never a gate. */
|
|
2144
|
+
const _GATE_NAV_RE = /\bNavHost\s*\(|\brememberNavController\s*\(/;
|
|
2145
|
+
/** Wrappers and NavHosts a setContent arm may call that are no screen of their own. */
|
|
2146
|
+
const _GATE_SKIP = new Set(['Surface', 'Box', 'Column', 'Row', 'Scaffold', 'CompositionLocalProvider',
|
|
2147
|
+
'DisposableEffect', 'LaunchedEffect', 'SideEffect', 'Modifier', 'Text']);
|
|
2148
|
+
|
|
2149
|
+
/** The arm starting at `at`: a `{ }` block's content, or one call with its arguments and lambda. */
|
|
2150
|
+
function _gateArmBody(content, at) {
|
|
2151
|
+
while (at < content.length && /\s/.test(content[at])) { at++; }
|
|
2152
|
+
if (content[at] === '{') { return _extractBalancedGenerous(content, at, '{', '}'); }
|
|
2153
|
+
_GATE_BARE_CALL_RE.lastIndex = at;
|
|
2154
|
+
const m = _GATE_BARE_CALL_RE.exec(content);
|
|
2155
|
+
if (!m) { return null; }
|
|
2156
|
+
let end = at + m[0].length;
|
|
2157
|
+
for (const [o, c] of [['(', ')'], ['{', '}']]) {
|
|
2158
|
+
while (end < content.length && /\s/.test(content[end])) { end++; }
|
|
2159
|
+
const inner = content[end] === o ? _extractBalancedGenerous(content, end, o, c) : null;
|
|
2160
|
+
if (inner !== null) { end += inner.length + 2; }
|
|
2161
|
+
}
|
|
2162
|
+
return content.slice(at, end);
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* activityGates(text, strings) -> [{name, kind, line, activity, condition, identity}].
|
|
2167
|
+
* A screen an Activity's `setContent { }` shows INSTEAD of its NavHost, behind an if / else-if arm:
|
|
2168
|
+
* a landing splash (`if (showLanding) LandingScreen()`), a consent dialog
|
|
2169
|
+
* (`else if (showUserAgreementTip) UserAgreementScreen(...)`). No route or overlay scan sees it -- it
|
|
2170
|
+
* is a private composable of the Activity file -- so every capture of it stayed unmapped. Measured
|
|
2171
|
+
* (jingmo): LandingScreen (96+ captures) and UserAgreementScreen (101+) had no UTG node.
|
|
2172
|
+
* An arm is a `{ }` block or one brace-less call (`if (showLanding) LandingScreen() else ...`).
|
|
2173
|
+
* Taken: a composable declared in the same file that renders a text of its own and does not build
|
|
2174
|
+
* the navigation graph. Small apps declare their NavHost in MainActivity.kt too (`MainNavHost()`
|
|
2175
|
+
* holds `NavHost(` / `rememberNavController(`), and a side effect (`EdgeToEdgeEffect()`) shows no
|
|
2176
|
+
* text: as nodes they would be pages no capture can identify.
|
|
2177
|
+
*/
|
|
2178
|
+
export function activityGates(text, strings) {
|
|
2179
|
+
const cls = search(_ACTIVITY_CLASS_RE, text);
|
|
2180
|
+
if (!cls) { return []; }
|
|
2181
|
+
const out = []; const seen = new Set();
|
|
2182
|
+
for (const sc of finditer(_SET_CONTENT_RE, text)) {
|
|
2183
|
+
const brace = mEnd(sc) - 1;
|
|
2184
|
+
const content = _extractBalancedGenerous(text, brace, '{', '}');
|
|
2185
|
+
if (content === null) { continue; }
|
|
2186
|
+
for (const arm of finditer(_GATE_ARM_RE, content)) {
|
|
2187
|
+
let cond = ''; let at = mEnd(arm);
|
|
2188
|
+
if (arm[0].trim().endsWith('(')) {
|
|
2189
|
+
const c = _extractBalancedGenerous(content, mEnd(arm) - 1);
|
|
2190
|
+
if (c === null) { continue; }
|
|
2191
|
+
cond = c.trim();
|
|
2192
|
+
at = mEnd(arm) - 1 + c.length + 2;
|
|
2193
|
+
}
|
|
2194
|
+
const body = _gateArmBody(content, at);
|
|
2195
|
+
if (body === null) { continue; }
|
|
2196
|
+
const first = finditer(_CALL_RE, body).map((m) => m[1]).find((n) => !_GATE_SKIP.has(n));
|
|
2197
|
+
if (!first || seen.has(first)) { continue; }
|
|
2198
|
+
const decl = search(P(S`@Composable\s+(?:private\s+|internal\s+)?fun\s+` + reEscape(first) + S`\s*\(`), text);
|
|
2199
|
+
if (!decl) { continue; }
|
|
2200
|
+
seen.add(first);
|
|
2201
|
+
const own = ownBody(text, mEnd(decl));
|
|
2202
|
+
if (_GATE_NAV_RE.test(own)) { continue; }
|
|
2203
|
+
// a Kotlin literal's escapes are what the device renders as newlines / quotes
|
|
2204
|
+
const identity = overlayIdentityText(own, strings)
|
|
2205
|
+
.map((t) => t.replace(/\\([nt"'\\$])/g, (_, c) => (c === 'n' ? '\n' : c === 't' ? '\t' : c)));
|
|
2206
|
+
if (!identity.length) { continue; }
|
|
2207
|
+
const kind = [...DIALOG_PRIMS, 'AlertDialog('].some((x) => _findPrim(own, x) >= 0) ? 'dialog'
|
|
2208
|
+
: SHEET_PRIMS.some((x) => _findPrim(own, x) >= 0) ? 'sheet' : 'screen';
|
|
2209
|
+
out.push({ name: first, kind, line: lineOf(text, decl.index), activity: cls[1], condition: cond || 'else', identity });
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
return out;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2139
2215
|
export function main(argv = process.argv.slice(2)) {
|
|
2140
2216
|
const ap = new ArgumentParser({ prog: 'compose_overlay.mjs' });
|
|
2141
2217
|
ap.add_argument('project');
|
|
@@ -2251,6 +2327,28 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
2251
2327
|
nodes.push(node);
|
|
2252
2328
|
}
|
|
2253
2329
|
|
|
2330
|
+
// ---- Activity gates: screens setContent shows in place of the NavHost
|
|
2331
|
+
const gateIds = new Set(nodes.map((x) => x.id));
|
|
2332
|
+
for (const [p, text] of fileText) {
|
|
2333
|
+
for (const gate of activityGates(text, strings)) {
|
|
2334
|
+
const id = 'overlay:' + gate.name;
|
|
2335
|
+
if (gateIds.has(id) || overlays.has(gate.name)) { continue; }
|
|
2336
|
+
gateIds.add(id);
|
|
2337
|
+
const node = {
|
|
2338
|
+
type: 'node', id, kind: gate.kind, label: gate.name,
|
|
2339
|
+
declared_at: `${rel(p, project)}:${gate.line}`, status: 'static-only', provenance: 'static:activity-gate',
|
|
2340
|
+
host_activity: { id: 'activity:' + gate.activity }, gate_condition: gate.condition,
|
|
2341
|
+
};
|
|
2342
|
+
if (T(gate.identity)) {
|
|
2343
|
+
// A dialog's texts are its titles (overlay lead title). A gate screen has no top bar: its texts
|
|
2344
|
+
// are body anchors -- as a title too, the catalog would drop them from its own body.
|
|
2345
|
+
if (gate.kind !== 'screen') { node.expected = { title_any: [...gate.identity] }; }
|
|
2346
|
+
node.body_text = gate.identity.map((text) => ({ text, at: `${rel(p, project)}:${gate.line}` }));
|
|
2347
|
+
}
|
|
2348
|
+
nodes.push(node);
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2254
2352
|
// ---- gated content slots
|
|
2255
2353
|
const expandableIndex = _buildExpandableStateIndex(fileText);
|
|
2256
2354
|
const gatedSlotMeta = new Map();
|
|
@@ -2598,7 +2696,8 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
2598
2696
|
const edge = {
|
|
2599
2697
|
type: 'edge', source, target: pid, mechanism: 'pager-swipe', trigger: `pager@${r}:${pagerLine}`,
|
|
2600
2698
|
guard: get(variant, 'guard'),
|
|
2601
|
-
args: { pager_index: idx, source_resolved_by: how, action: swipeDir || 'default',
|
|
2699
|
+
args: { pager_index: idx, source_resolved_by: how, action: swipeDir || 'default', initial_page: initialPage,
|
|
2700
|
+
initial_page_confident: pageConfident },
|
|
2602
2701
|
provenance: 'static:overlay-scan', status: 'static-only', confidence: asFloat(0.8),
|
|
2603
2702
|
};
|
|
2604
2703
|
if (T(get(variant, 'variant_group'))) { edge.args.variant_group = variant.variant_group; }
|
|
@@ -2666,7 +2765,8 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
2666
2765
|
fragEdges.set(key, {
|
|
2667
2766
|
type: 'edge', source: hostId, target: pid, mechanism: 'pager-swipe',
|
|
2668
2767
|
trigger: `createFragment@${r}:${fragLine}`, guard: null,
|
|
2669
|
-
args: { pager_index: idx, source_resolved_by: 'activity-host', action: swipeDir || 'default',
|
|
2768
|
+
args: { pager_index: idx, source_resolved_by: 'activity-host', action: swipeDir || 'default', initial_page: initialPage,
|
|
2769
|
+
initial_page_confident: true },
|
|
2670
2770
|
provenance: 'static:fragment-adapter', status: 'static-only', confidence: asFloat(0.8),
|
|
2671
2771
|
});
|
|
2672
2772
|
}
|
|
@@ -45,7 +45,6 @@ import { ActivityChain, HostResolver, blankCommentsAndStrings, buildClassIndex,
|
|
|
45
45
|
import { buildViewIdIndex, resolveViewId, _osWalk } from './layout_resolve.mjs';
|
|
46
46
|
import { fnRanges, innermostFnAt, isShippingDir, _finditer } from './scope_utils.mjs';
|
|
47
47
|
import { findLayoutFiles } from './view_widgets.mjs';
|
|
48
|
-
import { term } from './i18n-term.mjs';
|
|
49
48
|
// Cyclic (plaindialog_nav imports this module): only used inside functions, never at top level.
|
|
50
49
|
import { buildDialogSet } from './plaindialog_nav.mjs';
|
|
51
50
|
|
|
@@ -802,7 +801,7 @@ export function _srcIds(srcId, owner, resolver, method = null) {
|
|
|
802
801
|
}
|
|
803
802
|
|
|
804
803
|
// Synthetic label in the installed language; lower-case in English so _isCodeName keeps it.
|
|
805
|
-
export const _DRAWER_LABEL =
|
|
804
|
+
export const _DRAWER_LABEL = '抽屉菜单';
|
|
806
805
|
export const _IF_HEAD_RE = pyRe('\\bif\\s*\\(');
|
|
807
806
|
export const _DRAWER_DISABLE_RE = pyRe(
|
|
808
807
|
'setDrawerLockMode\\s*\\(\\s*[^)]*LOCK_MODE_LOCKED_CLOSED' +
|
|
@@ -960,7 +959,7 @@ export function detectEdges(sources, project, fragNames, opts = {}) {
|
|
|
960
959
|
delete args.relation;
|
|
961
960
|
sdef(args, 'label', _DRAWER_LABEL);
|
|
962
961
|
if (drawerBlock) {
|
|
963
|
-
guard = { text:
|
|
962
|
+
guard = { text: `需要 ${drawerBlock} 为 false(否则抽屉被锁闭/隐藏)`,
|
|
964
963
|
kind: 'device-env', condition: drawerBlock, need: false };
|
|
965
964
|
}
|
|
966
965
|
}
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
} from './_py.mjs';
|
|
23
23
|
import { _isCodeName } from './click_paths.mjs';
|
|
24
24
|
import { _iterStringsXml, loadStrings } from './label_resolve.mjs';
|
|
25
|
-
import { term } from './i18n-term.mjs';
|
|
26
25
|
|
|
27
26
|
export { _isCodeName };
|
|
28
27
|
|
|
@@ -333,12 +332,12 @@ const _EVIDENCE_RE = pyRe('[^\\s:]+:\\d+\\s*$');
|
|
|
333
332
|
// A copy, not an import: the two skills ship separately. tests/test_nl_hint_grammar.mjs asserts parity
|
|
334
333
|
// with the explorer's own hintSteps whenever that skill sits beside this one.
|
|
335
334
|
// Quoted targets stay in the app's UI language; only the no-gesture marker follows the install
|
|
336
|
-
// language
|
|
335
|
+
// language, and both parsers accept either marker.
|
|
337
336
|
export const HINT_GRAMMAR = 'Hint grammar (the explorer compiles it, anything else is needs_external): every clause ' +
|
|
338
337
|
'with a tap/long-press verb (点击/选择/长按/tap/…) must QUOTE its on-screen target — 「设置」, “Settings” — ' +
|
|
339
338
|
'OUTSIDE parentheses (parenthesised text is stripped as commentary), or name it as 〔id:resource_name〕, or ' +
|
|
340
339
|
'be an any-row phrase (任意一个…条目 / the first row). An icon without text: quote its contentDescription. ' +
|
|
341
|
-
`Start with ${
|
|
340
|
+
`Start with ${'(无需操作)'} for a page that opens without a gesture. Typing/swipe clauses need a quoted target.`;
|
|
342
341
|
const _HG_QUOTED = pyRe("[「『“\"]([^」』”\"]+)[」』”\"]|(?<![A-Za-z])'([^']+)'(?![A-Za-z])");
|
|
343
342
|
const _HG_NO_GESTURE = pyRe('^\\s*(?:[((]\\s*)?(无需点击|无需操作|无需任何操作|自动(?:进入|跳转)|no action|automatic)', 'i');
|
|
344
343
|
const _HG_TAP = pyRe('(点击|点按|轻触|轻点|轻按|选择|打开|取消勾选|勾选|点(?=\\s*(?:一下)?\\s*[「『“"〔])|tap|click|select|press)', 'i');
|
|
@@ -31,7 +31,6 @@ import { loadProjectStrings, loadStrings } from './label_resolve.mjs';
|
|
|
31
31
|
import { _osWalk } from './layout_resolve.mjs';
|
|
32
32
|
import { _finditer } from './scope_utils.mjs';
|
|
33
33
|
import { _owningClass, buildFragmentSet } from './fragment_nav.mjs';
|
|
34
|
-
import { term } from './i18n-term.mjs';
|
|
35
34
|
|
|
36
35
|
export const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
37
36
|
export const _SKIP_DIRS = new Set(['build', '.git', 'test', 'androidTest', '.gradle', '.idea', 'node_modules']);
|
|
@@ -310,7 +309,7 @@ export const _SETTINGS_TITLE_KEYS = ['header_settings', 'settings', 'title_setti
|
|
|
310
309
|
'action_settings', 'settings_title', 'preferences', 'nav_settings'];
|
|
311
310
|
export function _catalogTitle(strings) {
|
|
312
311
|
for (const k of _SETTINGS_TITLE_KEYS) { const v = get(strings, k); if (v) { return v; } }
|
|
313
|
-
return
|
|
312
|
+
return '设置';
|
|
314
313
|
}
|
|
315
314
|
export function presenterNodeId(cls, kind = 'dialog') {
|
|
316
315
|
return `${kind}:${simpleName(cls).replaceAll('Presenter', '').replaceAll('Controller', '')}`;
|
|
@@ -21,10 +21,12 @@
|
|
|
21
21
|
* is a display rule, not a login wall, and is not counted — so it cannot make a real one ambiguous.
|
|
22
22
|
* A `::class` set alone is any route table (bottom-bar routes, full-screen routes); the login test in
|
|
23
23
|
* the same condition is what makes it a login gate. Two login-gated sets with different members are
|
|
24
|
-
* ambiguous and refused; identical copies (build flavors) are one set. Test sources are not read
|
|
24
|
+
* ambiguous and refused; identical copies (build flavors) are one set. Test sources are not read;
|
|
25
|
+
* pass the project dir as `root` so only the path inside the project decides that (a checkout under
|
|
26
|
+
* `~/workspace/test/…` is not test code — without `root` every file there would be skipped).
|
|
25
27
|
*
|
|
26
28
|
* Exports: loginPolarity classSets membershipPredicates gatesIn routeResolver
|
|
27
|
-
* findLoginInterceptor(sources, loginRe, readText, isRoute) applyLoginInterceptor(nodes, edges, found, project)
|
|
29
|
+
* findLoginInterceptor(sources, loginRe, readText, isRoute, root) applyLoginInterceptor(nodes, edges, found, project)
|
|
28
30
|
*/
|
|
29
31
|
import * as path from 'node:path';
|
|
30
32
|
import { heldRouteKey } from './compose_nav.mjs';
|
|
@@ -39,6 +41,14 @@ const _FUN_RE = /\bfun\s+(?:<[^>]*>\s*)?(?:[\w.]+\.)?([A-Za-z_]\w*)\s*\(/g;
|
|
|
39
41
|
const _IF_RE = /\bif\s*\(/g;
|
|
40
42
|
const _WHEN_RE = /\bwhen\s*(?:\([^()]*\)\s*)?\{/g;
|
|
41
43
|
const _TEST_DIR_RE = /[\\/](?:test|androidTest|testFixtures|testDebug|testRelease)[\\/]/;
|
|
44
|
+
/** `p` relative to `root`, with a leading separator so a top-level `test/` dir still matches. A path
|
|
45
|
+
* outside `root` (or no root) is returned unchanged. */
|
|
46
|
+
function _inProject(p, root) {
|
|
47
|
+
if (!root) { return p; }
|
|
48
|
+
const rel = path.relative(root, p);
|
|
49
|
+
const outside = rel === '' || rel === '..' || rel.startsWith('..' + path.sep) || path.isAbsolute(rel);
|
|
50
|
+
return outside ? p : path.sep + rel;
|
|
51
|
+
}
|
|
42
52
|
|
|
43
53
|
/** Blank comments and string literals in place (newlines kept): no bracket or `/*` inside a string
|
|
44
54
|
* can unbalance a scan, and offsets still map to source lines. Route literals are never strings. */
|
|
@@ -281,14 +291,15 @@ const memberSig = (members) => members.map((m) => `${m.holder}.${m.member}`).sor
|
|
|
281
291
|
/**
|
|
282
292
|
* Scan Kotlin sources for the interceptor. `readText(p)` returns file text (or throws); `isRoute`
|
|
283
293
|
* (dotted literal -> truthy) says which redirect candidates are route nodes (default: any literal).
|
|
284
|
-
* A gate counts only when its logged-out branch names one.
|
|
294
|
+
* A gate counts only when its logged-out branch names one. `root` (the project dir) scopes the
|
|
295
|
+
* test-source check to the path INSIDE the project: a checkout under `~/workspace/test/…` is not test code.
|
|
285
296
|
* -> {set_file, set_line, gate_file, gate_line, gate_cond, members, redirect: [literal] | null}
|
|
286
297
|
* | {refused} | null. `redirect` is null when two gates redirect to different routes.
|
|
287
298
|
*/
|
|
288
|
-
export function findLoginInterceptor(sources, loginRe, readText, isRoute = null) {
|
|
299
|
+
export function findLoginInterceptor(sources, loginRe, readText, isRoute = null, root = null) {
|
|
289
300
|
const code = new Map();
|
|
290
301
|
for (const p of sources) {
|
|
291
|
-
if (!/\.kt$/i.test(p) || _TEST_DIR_RE.test(p)) { continue; }
|
|
302
|
+
if (!/\.kt$/i.test(p) || _TEST_DIR_RE.test(_inProject(p, root))) { continue; }
|
|
292
303
|
let t; try { t = readText(p); } catch { continue; }
|
|
293
304
|
if (t && (t.includes('::class') || /\b(?:if|when)\b/.test(t))) { code.set(p, t); }
|
|
294
305
|
}
|
|
@@ -331,7 +342,8 @@ export function findLoginInterceptor(sources, loginRe, readText, isRoute = null)
|
|
|
331
342
|
/**
|
|
332
343
|
* Stamp the interceptor onto the graph: each protected compose-route node, and each of its
|
|
333
344
|
* `#variant` nodes, gets required_state:['login'] + login_interceptor; each edge into one that carries
|
|
334
|
-
* no guard yet
|
|
345
|
+
* no guard yet, or only a login guard guessed from the route name (`inferred:`), gets
|
|
346
|
+
* {kind:'login', text:'interceptor:<file>:<line>', redirect_when_unmet}. Any other existing
|
|
335
347
|
* guard on an edge (a data-state branch, a pay route) is kept: the node's required_state already
|
|
336
348
|
* carries the login axis. Nothing is stamped when the redirect does not resolve to a route node: a
|
|
337
349
|
* gate that sends a logged-out user nowhere known is not evidence of a login wall.
|
|
@@ -366,7 +378,9 @@ export function applyLoginInterceptor(nodes, edges, found, project) {
|
|
|
366
378
|
for (const e of edges) {
|
|
367
379
|
const tgt = String(e.target ?? '');
|
|
368
380
|
if (!tgt.startsWith('compose-route:') || !protectedKeys.has(baseKey(tgt))) { continue; }
|
|
369
|
-
|
|
381
|
+
// a login guard guessed from the route NAME (`inferred:…`) yields to the interceptor read from code;
|
|
382
|
+
// any other earned guard (data-state, pay, a branch test) is kept and the node carries the login axis
|
|
383
|
+
if (e.guard && !(e.guard.kind === 'login' && String(e.guard.text ?? '').startsWith('inferred:'))) { continue; }
|
|
370
384
|
e.guard = { text: `interceptor:${at}`, kind: 'login', redirect_when_unmet: redirectId };
|
|
371
385
|
res.edges++;
|
|
372
386
|
}
|
|
@@ -30,10 +30,9 @@ import {
|
|
|
30
30
|
import { nodeLinkGraph, dijkstraPath, singleSourceDijkstraPaths, NetworkXNoPath, NodeNotFound } from './_graph.mjs';
|
|
31
31
|
import { decodeAndroidString } from './label_resolve.mjs';
|
|
32
32
|
import * as phasePlanner from './phase_planner.mjs';
|
|
33
|
-
import { term, termLang } from './i18n-term.mjs';
|
|
34
33
|
|
|
35
34
|
// operationText clause separator and sentence end in the installed language.
|
|
36
|
-
const _clauseJoin = (parts) =>
|
|
35
|
+
const _clauseJoin = (parts) => `${parts.join(',')}。`;
|
|
37
36
|
|
|
38
37
|
export const _GUARDED_COST = 50.0;
|
|
39
38
|
export const _NORMAL_COST = 1.0;
|
|
@@ -582,7 +581,7 @@ export class StaticPrior {
|
|
|
582
581
|
for (const stem of ['滑动', '滑到', '点击', '按']) {
|
|
583
582
|
if (hint.includes(stem)) { return hint.replace(stem, () => verb); }
|
|
584
583
|
}
|
|
585
|
-
return
|
|
584
|
+
return `${verb}:${hint}`;
|
|
586
585
|
}
|
|
587
586
|
/** Full natural-language operation sequence to reach nodeId (a readable route; the explorer
|
|
588
587
|
* compiles nl_hint itself, compile_tasks.mjs hintedPrefix). */
|
|
@@ -592,7 +591,7 @@ export class StaticPrior {
|
|
|
592
591
|
let steps = truthy(entry) ? get(entry, 'steps') : null;
|
|
593
592
|
const detour = this._detourSteps(nodeId);
|
|
594
593
|
if (truthy(detour)) { steps = detour; }
|
|
595
|
-
const parts = [
|
|
594
|
+
const parts = [`打开${pyStr(appName)}`];
|
|
596
595
|
if (truthy(steps)) {
|
|
597
596
|
for (const step of steps) {
|
|
598
597
|
const action = or3(get(step, 'action'), 'tap');
|
|
@@ -614,26 +613,24 @@ export class StaticPrior {
|
|
|
614
613
|
const isAmbiguous = truthy(get(step, 'label_ambiguous'));
|
|
615
614
|
let destTitle = this._expectedTitle(or3(get(step, 'target_id'), ''));
|
|
616
615
|
const arrivalName = or3(destTitle, label);
|
|
617
|
-
const arrival = (name) =>
|
|
618
|
-
const tapped = (v, lab, name) =>
|
|
619
|
-
{ verb: v, label: pyStr(lab), arrival: arrivalVerb, name: pyStr(name), noun });
|
|
616
|
+
const arrival = (name) => `${arrivalVerb}「${pyStr(name)}」${noun}`;
|
|
617
|
+
const tapped = (v, lab, name) => `${v}「${pyStr(lab)}」,${arrivalVerb}「${pyStr(name)}」${noun}`;
|
|
620
618
|
if (action === 'default') {
|
|
621
619
|
if (truthy(arrivalName)) { parts.push(arrival(arrivalName)); }
|
|
622
620
|
} else if (typeof action === 'string' && action.startsWith('swipe-')) {
|
|
623
|
-
parts.push(
|
|
621
|
+
parts.push(`${pyStr(verb)},${arrivalVerb}「${pyStr(label)}」${noun}`);
|
|
624
622
|
} else if (action === 'tap' && isCode) {
|
|
625
623
|
destTitle = this._expectedTitle(or3(get(step, 'target_id'), ''));
|
|
626
|
-
if (destTitle) { parts.push(
|
|
627
|
-
else { parts.push(
|
|
624
|
+
if (destTitle) { parts.push(`找到并进入通往「${destTitle}」${noun}的入口,${arrivalVerb}该${noun}`); }
|
|
625
|
+
else { parts.push(`找到并进入与「${pyStr(label)}」相关的入口,${arrivalVerb}对应${noun}`); }
|
|
628
626
|
} else if (isAmbiguous && truthy(verb) && destTitle && destTitle !== label) {
|
|
629
|
-
parts.push(
|
|
630
|
-
{ verb, label: pyStr(label), dest: destTitle, arrival: arrivalVerb, noun }));
|
|
627
|
+
parts.push(`${verb}「${pyStr(label)}」(该页面上有多个同名控件,请选择通往「${destTitle}」的那一个),${arrivalVerb}「${destTitle}」${noun}`);
|
|
631
628
|
} else if (truthy(verb)) {
|
|
632
629
|
const arr = or3(arrivalName, label);
|
|
633
630
|
if (truthy(label)) { parts.push(tapped(verb, label, arr)); }
|
|
634
631
|
else if (truthy(arr)) { parts.push(arrival(arr)); }
|
|
635
632
|
} else if (truthy(label)) {
|
|
636
|
-
parts.push(tapped(
|
|
633
|
+
parts.push(tapped('点击', label, label));
|
|
637
634
|
} else if (truthy(arrivalName)) {
|
|
638
635
|
parts.push(arrival(arrivalName));
|
|
639
636
|
}
|
|
@@ -641,9 +638,9 @@ export class StaticPrior {
|
|
|
641
638
|
return _clauseJoin(parts);
|
|
642
639
|
}
|
|
643
640
|
const bc = this.breadcrumb(nodeId);
|
|
644
|
-
if (!bc) { return
|
|
641
|
+
if (!bc) { return `${parts[0]},回到应用首页。`; }
|
|
645
642
|
const labels = bc.split('>').map((s) => pyStrip(s)).filter((s) => s);
|
|
646
|
-
for (const lab of labels) { parts.push(
|
|
643
|
+
for (const lab of labels) { parts.push(`点击「${lab}」`); }
|
|
647
644
|
return _clauseJoin(parts);
|
|
648
645
|
}
|
|
649
646
|
|
|
@@ -750,9 +747,9 @@ export class StaticPrior {
|
|
|
750
747
|
if (!(truthy(get(args, 'icon_only')) || truthy(get(args, 'low_signal')))) { return null; }
|
|
751
748
|
const icon = pyStrip(or3(get(args, 'icon'), ''));
|
|
752
749
|
const kind = get(this.g.nodeGet(nodeId, {}), 'kind', '');
|
|
753
|
-
const opens = OVERLAY_OR_MODE.has(kind) ?
|
|
754
|
-
if (icon) { return
|
|
755
|
-
return
|
|
750
|
+
const opens = OVERLAY_OR_MODE.has(kind) ? '打开面板/弹层' : '进入对应页面';
|
|
751
|
+
if (icon) { return `在界面顶部工具栏找到并点击「${icon}」图标(该按钮只有图标、没有文字),${opens}`; }
|
|
752
|
+
return `在界面顶部工具栏找到并点击对应的图标按钮(无文字标签),${opens}`;
|
|
756
753
|
}
|
|
757
754
|
|
|
758
755
|
clickDepth(nodeId) {
|
|
@@ -937,13 +934,13 @@ export class StaticPrior {
|
|
|
937
934
|
// Gesture verbs, arrival verbs and page nouns of operationText, in the installed language.
|
|
938
935
|
// _GESTURE_SYNONYMS matches words inside an nl_hint (app language), so it stays as written.
|
|
939
936
|
StaticPrior._ACTION_VERB = {
|
|
940
|
-
tap:
|
|
941
|
-
double_tap:
|
|
942
|
-
long_press:
|
|
943
|
-
'swipe-left':
|
|
944
|
-
'swipe-right':
|
|
945
|
-
'swipe-up':
|
|
946
|
-
'swipe-down':
|
|
937
|
+
tap: '点击',
|
|
938
|
+
double_tap: '双击',
|
|
939
|
+
long_press: '长按',
|
|
940
|
+
'swipe-left': '向左滑动',
|
|
941
|
+
'swipe-right': '向右滑动',
|
|
942
|
+
'swipe-up': '向上滑动',
|
|
943
|
+
'swipe-down': '向下滑动',
|
|
947
944
|
};
|
|
948
945
|
StaticPrior._GESTURE_SYNONYMS = {
|
|
949
946
|
double_tap: ['双击', '连点两次', '点击两次'],
|
|
@@ -953,7 +950,7 @@ StaticPrior._GESTURE_SYNONYMS = {
|
|
|
953
950
|
'swipe-up': ['向上', '上滑', '往上'],
|
|
954
951
|
'swipe-down': ['向下', '下滑', '往下'],
|
|
955
952
|
};
|
|
956
|
-
StaticPrior._ARRIVAL_VERB = { dialog:
|
|
957
|
-
StaticPrior._DEFAULT_ARRIVAL_VERB =
|
|
958
|
-
StaticPrior._PAGE_NOUN = { dialog:
|
|
959
|
-
StaticPrior._DEFAULT_PAGE_NOUN =
|
|
953
|
+
StaticPrior._ARRIVAL_VERB = { dialog: '弹出', sheet: '弹出', menu: '打开' };
|
|
954
|
+
StaticPrior._DEFAULT_ARRIVAL_VERB = '到达';
|
|
955
|
+
StaticPrior._PAGE_NOUN = { dialog: '对话框', sheet: '弹窗', menu: '菜单' };
|
|
956
|
+
StaticPrior._DEFAULT_PAGE_NOUN = '页面';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Screens an Activity's setContent shows instead of its NavHost (landing splash, consent dialog) are
|
|
2
|
+
// UTG nodes; the NavHost arm and wrappers are not.
|
|
3
|
+
import { test } from 'node:test';
|
|
4
|
+
import assert from 'node:assert/strict';
|
|
5
|
+
import { activityGates } from '../compose_overlay.mjs';
|
|
6
|
+
|
|
7
|
+
const SRC = `
|
|
8
|
+
class MainActivity : ComponentActivity() {
|
|
9
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
10
|
+
setContent {
|
|
11
|
+
AppTheme {
|
|
12
|
+
Surface(modifier = Modifier.fillMaxSize()) {
|
|
13
|
+
if (showLanding) {
|
|
14
|
+
LandingScreen()
|
|
15
|
+
} else if (state.showTip) {
|
|
16
|
+
ConsentScreen(onFinish = { finish() })
|
|
17
|
+
} else {
|
|
18
|
+
AppNavHost(navController = nav)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
@Composable
|
|
26
|
+
private fun LandingScreen(modifier: Modifier = Modifier) {
|
|
27
|
+
Box(modifier) { Text(text = "献给\n\n读者") }
|
|
28
|
+
}
|
|
29
|
+
@Composable
|
|
30
|
+
private fun ConsentScreen(onFinish: () -> Unit) {
|
|
31
|
+
AlertDialog(onDismissRequest = {}, confirmButton = { Button(onClick = {}) { Text(text = "同意并继续") } })
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
test('setContent if / else-if arms calling same-file composables are gates', () => {
|
|
36
|
+
const g = activityGates(SRC, {});
|
|
37
|
+
assert.deepEqual(g.map((x) => [x.name, x.kind, x.activity, x.condition]), [
|
|
38
|
+
['LandingScreen', 'screen', 'MainActivity', 'showLanding'],
|
|
39
|
+
['ConsentScreen', 'dialog', 'MainActivity', 'state.showTip'],
|
|
40
|
+
]);
|
|
41
|
+
assert.deepEqual(g[0].identity, ['献给\n\n读者'], 'Kotlin escapes become the rendered text');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('no Activity class, no gates', () => {
|
|
45
|
+
assert.deepEqual(activityGates(SRC.replace('ComponentActivity', 'Base'), {}), []);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Small apps declare the NavHost (and side effects) in MainActivity.kt too.
|
|
49
|
+
const host = (content) => `
|
|
50
|
+
class MainActivity : ComponentActivity() {
|
|
51
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
52
|
+
setContent { AppTheme { ${content} } }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
@Composable
|
|
56
|
+
private fun LandingScreen() { Box { Text(text = "欢迎") } }
|
|
57
|
+
@Composable
|
|
58
|
+
private fun ConsentScreen() { AlertDialog(onDismissRequest = {}, confirmButton = { Text(text = "同意") }) }
|
|
59
|
+
@Composable
|
|
60
|
+
fun MainNavHost() {
|
|
61
|
+
val nav = rememberNavController()
|
|
62
|
+
NavHost(navController = nav, startDestination = "home") { composable("home") { Text("首页") } }
|
|
63
|
+
}
|
|
64
|
+
@Composable
|
|
65
|
+
private fun EdgeToEdgeEffect() { SideEffect { } }
|
|
66
|
+
@Composable
|
|
67
|
+
private fun BottomBar() { Text(text = "底栏") }
|
|
68
|
+
`;
|
|
69
|
+
const gates = (content) => activityGates(host(content), {}).map((x) => [x.name, x.kind, x.condition]);
|
|
70
|
+
|
|
71
|
+
test('a same-file NavHost or a text-less side effect is no gate', () => {
|
|
72
|
+
assert.deepEqual(gates('if (showLanding) { LandingScreen() } else { MainNavHost() }'),
|
|
73
|
+
[['LandingScreen', 'screen', 'showLanding']]);
|
|
74
|
+
assert.deepEqual(gates('if (edge) { EdgeToEdgeEffect() }\n MainNavHost()'), []);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('brace-less arms are gates; a later block is not read as their body', () => {
|
|
78
|
+
assert.deepEqual(gates('if (showLanding) LandingScreen() else if (tip) ConsentScreen() else MainNavHost()'),
|
|
79
|
+
[['LandingScreen', 'screen', 'showLanding'], ['ConsentScreen', 'dialog', 'tip']]);
|
|
80
|
+
assert.deepEqual(gates('if (showLanding) LandingScreen() else MainNavHost()\n Scaffold(bottomBar = { BottomBar() }) { }'),
|
|
81
|
+
[['LandingScreen', 'screen', 'showLanding']]);
|
|
82
|
+
assert.deepEqual(gates('if (tip)\n ConsentScreen() else { LandingScreen() }'),
|
|
83
|
+
[['ConsentScreen', 'dialog', 'tip'], ['LandingScreen', 'screen', 'else']]);
|
|
84
|
+
});
|
|
@@ -134,6 +134,20 @@ test('apply stamps nodes and unguarded edges, keeps an earned guard', () => {
|
|
|
134
134
|
assert.equal(nodes['compose-route:Me'].required_state, undefined);
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
+
test('apply replaces a route-name login guard, not one read from code', () => {
|
|
138
|
+
const nodes = { 'compose-route:Me': {}, 'compose-route:Profile': {}, 'compose-route:Login': {}, 'compose-route:OrderRoutes.List': {} };
|
|
139
|
+
const branch = { text: 'branch:!isLoggedIn', kind: 'login', polarity: 'logged-out' };
|
|
140
|
+
const edges = [
|
|
141
|
+
{ source: 'compose-route:Me', target: 'compose-route:Profile', guard: { text: 'inferred:Profile', kind: 'login', polarity: 'logged-out' } },
|
|
142
|
+
{ source: 'compose-route:Me', target: 'compose-route:OrderRoutes.List', guard: branch },
|
|
143
|
+
];
|
|
144
|
+
const { sources, read } = fake({ '/p/RouteInterceptor.kt': INTERCEPTOR, '/p/AppNavigator.kt': NAVIGATOR });
|
|
145
|
+
const r = applyLoginInterceptor(nodes, edges, findLoginInterceptor(sources, _LOGIN_TEST_RE, read), '/p');
|
|
146
|
+
assert.equal(r.edges, 1);
|
|
147
|
+
assert.deepEqual(edges[0].guard, { text: 'interceptor:RouteInterceptor.kt:4', kind: 'login', redirect_when_unmet: 'compose-route:Login' });
|
|
148
|
+
assert.equal(edges[1].guard, branch);
|
|
149
|
+
});
|
|
150
|
+
|
|
137
151
|
test('apply reports members with no route node', () => {
|
|
138
152
|
const nodes = { 'compose-route:Profile': {}, 'compose-route:Login': {} };
|
|
139
153
|
const { sources, read } = fake({ '/p/RouteInterceptor.kt': INTERCEPTOR, '/p/AppNavigator.kt': NAVIGATOR });
|
|
@@ -203,6 +217,30 @@ test('test sources are not read; identical flavor copies are one set', () => {
|
|
|
203
217
|
assert.equal(f.set_file, '/p/src/debug/A.kt');
|
|
204
218
|
});
|
|
205
219
|
|
|
220
|
+
test('a project checked out under a test/ directory is still read', () => {
|
|
221
|
+
const root = path.join(path.sep, 'Users', 'u', 'workspace', 'test', 'app');
|
|
222
|
+
const inRoot = (rel) => path.join(root, ...rel.split('/'));
|
|
223
|
+
const files = {
|
|
224
|
+
[inRoot('core/src/main/java/RouteInterceptor.kt')]: INTERCEPTOR,
|
|
225
|
+
[inRoot('core/src/main/java/AppNavigator.kt')]: NAVIGATOR,
|
|
226
|
+
};
|
|
227
|
+
const { sources, read } = fake(files);
|
|
228
|
+
assert.equal(findLoginInterceptor(sources, _LOGIN_TEST_RE, read), null, 'absolute path: the /test/ above the project hides it');
|
|
229
|
+
const f = findLoginInterceptor(sources, _LOGIN_TEST_RE, read, null, root);
|
|
230
|
+
assert.ok(f && !f.refused);
|
|
231
|
+
assert.deepEqual(f.redirect, ['AuthRoutes.Login']);
|
|
232
|
+
// a test source set inside the project is still skipped: its different set would make it ambiguous
|
|
233
|
+
const fakeInTest = INTERCEPTOR.replace(/UserRoutes\.Profile::class,/, 'X.Y::class,');
|
|
234
|
+
const withTest = fake({ ...files, [inRoot('core/src/test/java/C.kt')]: fakeInTest, [inRoot('core/src/test/java/D.kt')]: NAVIGATOR });
|
|
235
|
+
const g = findLoginInterceptor(withTest.sources, _LOGIN_TEST_RE, withTest.read, null, root);
|
|
236
|
+
assert.ok(g, 'the main-source interceptor is still found');
|
|
237
|
+
assert.equal(g.refused, undefined);
|
|
238
|
+
assert.equal(g.set_file, inRoot('core/src/main/java/RouteInterceptor.kt'));
|
|
239
|
+
// a directory whose name merely starts with '..' is inside the project
|
|
240
|
+
const dotted = fake({ [inRoot('..shared/src/main/java/RouteInterceptor.kt')]: INTERCEPTOR, [inRoot('..shared/src/main/java/AppNavigator.kt')]: NAVIGATOR });
|
|
241
|
+
assert.ok(findLoginInterceptor(dotted.sources, _LOGIN_TEST_RE, dotted.read, null, root), '..shared is not outside the project');
|
|
242
|
+
});
|
|
243
|
+
|
|
206
244
|
test('a membership test after a fun body is not credited to that fun', () => {
|
|
207
245
|
const ic = `package a
|
|
208
246
|
class RouteInterceptor {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { test } from 'node:test';
|
|
5
5
|
import assert from 'node:assert/strict';
|
|
6
6
|
import {
|
|
7
|
-
_hasToken, _identWords, _PAY_ROUTE_TOKENS, _ENV_ROUTE_TOKENS, _LOGIN_ROUTE_TOKENS, _INSTANCE_ROUTE_SUFFIXES,
|
|
7
|
+
_hasToken, _identWords, _PAY_ROUTE_TOKENS, _ENV_ROUTE_TOKENS, _LOGIN_ROUTE_TOKENS, _isAuthEntryRoute, _INSTANCE_ROUTE_SUFFIXES,
|
|
8
8
|
enrichNodesAndEdges,
|
|
9
9
|
} from '../assemble.mjs';
|
|
10
10
|
|
|
@@ -38,6 +38,34 @@ test('env / login tokens: whole (multi-)words', () => {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
+
test('auth-entry route: the token must end the name, after page suffixes', () => {
|
|
42
|
+
for (const k of ['Login', 'AccountLogin', 'SmsLogin', 'SmsLoginScreen', 'AuthRoutes.Register', 'SignIn',
|
|
43
|
+
'sign_in', 'LoginActivity', 'register_page']) {
|
|
44
|
+
assert.equal(_isAuthEntryRoute(k), true, k);
|
|
45
|
+
}
|
|
46
|
+
for (const k of ['account_settings', 'AccountInfo', 'ResetPassword', 'loginless', 'registry', 'LoginHistory',
|
|
47
|
+
'LoginDevices', 'ChangeLoginPassword', 'RegisterDevice', 'SignInCalendar', 'login_history_screen', 'Screen']) {
|
|
48
|
+
assert.equal(_isAuthEntryRoute(k), false, k);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('guard backfill: an auth-entry route is logged-out, a needs-login name is not', () => {
|
|
53
|
+
const keys = ['AccountLogin', 'Register', 'account_settings', 'LoginHistory', 'SignInCalendar'];
|
|
54
|
+
const nodes = { 'compose-route:home': { id: 'compose-route:home', kind: 'compose-route', label: 'Home' } };
|
|
55
|
+
for (const k of keys) { nodes[`compose-route:${k}`] = { id: `compose-route:${k}`, kind: 'compose-route', label: k }; }
|
|
56
|
+
const edges = keys.map((t) => ({
|
|
57
|
+
source: 'compose-route:home', target: `compose-route:${t}`, mechanism: 'compose-navigate', guard: null,
|
|
58
|
+
}));
|
|
59
|
+
enrichNodesAndEdges(nodes, edges, null);
|
|
60
|
+
const g = (t) => edges.find((e) => e.target === `compose-route:${t}`).guard;
|
|
61
|
+
for (const k of ['AccountLogin', 'Register']) {
|
|
62
|
+
assert.deepEqual(g(k), { text: `inferred:${k}`, kind: 'login', polarity: 'logged-out' }, k);
|
|
63
|
+
}
|
|
64
|
+
for (const k of ['account_settings', 'LoginHistory', 'SignInCalendar']) {
|
|
65
|
+
assert.deepEqual(g(k), { text: `inferred:${k}`, kind: 'login' }, k);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
41
69
|
test('instance suffixes need a real separator', () => {
|
|
42
70
|
for (const k of ['chinese_riddle_info', 'poem_detail', 'settings_shared_user_info', 'file-path']) {
|
|
43
71
|
assert.equal(_hasToken(k, _INSTANCE_ROUTE_SUFFIXES), true, k);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Types for i18n-term.mjs (canonical source: i18n/tools/i18n-term.d.mts; copies are synced).
|
|
2
|
-
export declare function termLang(): 'zh' | 'en';
|
|
3
|
-
export declare function term(zh: string, vars?: Record<string, string | number>): string;
|
|
4
|
-
export declare function termForms(zh: string): string[];
|
|
5
|
-
export declare function resetTermCache(): void;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Business-text output in the installed language. Canonical source: i18n/tools/i18n-term.mjs.
|
|
2
|
-
// Copies next to the code that uses it are written by `node i18n/tools/build-lang.mjs --write`;
|
|
3
|
-
// do not edit a copy by hand.
|
|
4
|
-
//
|
|
5
|
-
// A Chinese install has no i18n.json next to this file, so term() returns its Chinese argument
|
|
6
|
-
// unchanged. An English install gets i18n.json from the i18n/ overlay ({ "lang": "en",
|
|
7
|
-
// "strings": { "<zh>": "<en>" } }) and term() returns the English text.
|
|
8
|
-
// HT_I18N_FILE=<path to an i18n.json> overrides the lookup (tests, or trying English in a repo).
|
|
9
|
-
import fs from 'node:fs';
|
|
10
|
-
import path from 'node:path';
|
|
11
|
-
import { fileURLToPath } from 'node:url';
|
|
12
|
-
|
|
13
|
-
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
-
let table;
|
|
15
|
-
|
|
16
|
-
function load() {
|
|
17
|
-
if (table !== undefined) return table;
|
|
18
|
-
const file = process.env.HT_I18N_FILE || path.join(HERE, 'i18n.json');
|
|
19
|
-
try {
|
|
20
|
-
const j = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
21
|
-
table = j && j.lang === 'en' && j.strings && typeof j.strings === 'object' ? j.strings : null;
|
|
22
|
-
} catch {
|
|
23
|
-
table = null;
|
|
24
|
-
}
|
|
25
|
-
return table;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** 'en' when an English table is installed, otherwise 'zh'. */
|
|
29
|
-
export function termLang() {
|
|
30
|
-
return load() ? 'en' : 'zh';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The installed-language form of a business string. `zh` is the exact Chinese text (a template
|
|
35
|
-
* when it contains `{name}` placeholders); `vars` fills the placeholders in whichever form is used.
|
|
36
|
-
*/
|
|
37
|
-
export function term(zh, vars) {
|
|
38
|
-
const t = load();
|
|
39
|
-
let s = t && Object.prototype.hasOwnProperty.call(t, zh) ? t[zh] : zh;
|
|
40
|
-
if (vars) s = s.replace(/\{(\w+)\}/g, (m, k) => (Object.prototype.hasOwnProperty.call(vars, k) ? String(vars[k]) : m));
|
|
41
|
-
return s;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** Both forms of a business string, for readers that must accept either: [zh, en]. */
|
|
45
|
-
export function termForms(zh) {
|
|
46
|
-
const t = load();
|
|
47
|
-
const en = t && Object.prototype.hasOwnProperty.call(t, zh) ? t[zh] : undefined;
|
|
48
|
-
return en && en !== zh ? [zh, en] : [zh];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** Test hook: forget the cached table so the next call re-reads HT_I18N_FILE. */
|
|
52
|
-
export function resetTermCache() {
|
|
53
|
-
table = undefined;
|
|
54
|
-
}
|